WinWorkstation.st
author Claus Gittinger <cg@exept.de>
Fri, 11 Sep 1998 15:59:46 +0200
changeset 2329 73bb4001db25
parent 2328 478ec9b5cbe1
child 2331 71a2798c7413
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     1
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     2
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     3
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     5
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     6
 only in accordance with the terms of that license and with the
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     9
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    10
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    11
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    12
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    13
'From Smalltalk/X, Version:3.4.8 on 23-jul-1998 at 12:28:43'                    !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    14
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    15
DeviceWorkstation subclass:#WinWorkstation
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    16
	instanceVariableNames:'blackpixel whitepixel listOfFonts rootWin rootDC buttonsPressed
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    17
		eventTrace eventBuffer usingSystemPalette inRecursiveDispatch
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    18
		dispatchingExpose'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    19
	classVariableNames:'BeepFrequency BeepDuration NativeWindows NativeWindowClassTable
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
    20
		StandardColorValues'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    21
	poolDictionaries:''
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    22
	category:'Interface-Graphics'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    23
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    24
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    25
!WinWorkstation primitiveDefinitions!
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    26
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    27
#define COUNT_RESOURCES 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    28
#define COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    29
#define ADJUSTWINDOW
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    30
#define ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    31
#define WIN32THREADS
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    32
/*#define DEBUGMASK*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    33
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    34
# undef INT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    35
# define INT WIN_INT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    36
# undef Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    37
# define Array WIN_Array
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    38
# undef Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    39
# define Number WIN_Number
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    40
# undef Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    41
# define Method WIN_Method
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    42
# undef Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    43
# define Point WIN_Point
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    44
# undef Rectangle
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
    45
/*# define Rectangle WIN_Rectangle*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    46
# undef True
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    47
# define True WIN_True
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    48
# undef False
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    49
# define False WIN_False
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    50
# undef Block
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
    51
# define Block WIN_Block
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
    52
# undef Context
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
    53
# define Context WIN_Context
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    54
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    55
# undef xxCONTEXT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    56
# define xxCONTEXT        WIN_CONTEXT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    57
# undef _xxCONTEXT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    58
# define _xxCONTEXT       _WIN_CONTEXT
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    59
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    60
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;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   159
    int		maskOrgX;
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
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) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   696
        if (gcData->_hDC) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   697
            ReleaseDC(gcData->hWnd,gcData->_hDC);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   698
        }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   699
    } else if (gcData->hBitmap) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   700
        SelectObject(gcData->_hDC,gcData->savehBitmap);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   701
        DeleteDC(gcData->_hDC);
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) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   711
        if (lastGcData == gcData) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   712
            //printf(".");
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   713
            return gcData->_hDC;
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   714
        }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   715
        __releaseDC(lastGcData);
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) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   720
        if (__isWinNT && (gcData->hWnd == __rootWin)) {
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);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   723
        } else {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   724
            if (gcData->clipByChild) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   725
	        //gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_CLIPCHILDREN);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   726
	        gcData->_hDC = GetDC(gcData->hWnd);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   727
            } else
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   728
	        gcData->_hDC = GetDCEx(gcData->hWnd,0,DCX_PARENTCLIP);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   729
        }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   730
    } else if (gcData->hBitmap) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   731
        gcData->_hDC = CreateCompatibleDC(tmpDC);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   732
        gcData->savehBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
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) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   735
        SetTextColor(gcData->_hDC, gcData->bgColor);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   736
        SetBkColor(gcData->_hDC, gcData->fgColor);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   737
        if (gcData->rop2)
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   738
            SetROP2(gcData->_hDC, gcData->rop2);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   739
        if (gcData->clipping) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   740
	    HRGN  region = CreateRectRgn( gcData->clipX,gcData->clipY,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   741
				          gcData->clipX + gcData->clipW,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   742
				          gcData->clipY + gcData->clipH );
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   743
	    if( region == NULL ) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   744
	        DPRINTF((" clipping region creation failed!\n"));
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   745
	    } else {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   746
	        if (SelectClipRgn(gcData->_hDC, region) == ERROR ) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   747
		    DPRINTF((" clipping region release unsuccessful\n" ));
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   748
	        }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   749
	        /*printf("%x c\n",hDC);*/
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   750
	        DelObject(region);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   751
	    }
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   752
        }
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) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   764
        hBrush = CreatePatternBrush(gcData->hMask);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   765
        RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   766
    } else {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   767
        hBrush = CreateSolidBrush(gcData->fgColor);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
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) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   780
        Brush.lbStyle = BS_PATTERN;
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   781
        Brush.lbHatch = (DWORD)gcData->hMask;
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   782
        Brush.lbColor = gcData->fgColor;
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   783
        hPen = ExtCreatePen(PS_GEOMETRIC | gcData->capStyle | gcData->joinStyle | gcData->lineStyle,
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);       
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   788
        RESPRINTF(("ExtCreatePen %s %d %x %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED",
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   789
				                gcData->lineWidth,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   790
				                gcData->fgColor,gcData->hMask));
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) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   793
        if (gcData->lineStyle == PS_SOLID)
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   794
	    hPen = CreatePen(gcData->lineStyle,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   795
		             gcData->lineWidth,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   796
		             gcData->fgColor);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   797
        else
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   798
	    hPen = CreatePen(PS_DOT,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   799
		             0,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   800
		             0);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   801
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   802
        RESPRINTF(("CreatePen %s %d %x\n",(gcData->lineStyle == PS_SOLID) ? "SOLID " : "DASHED",
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
   803
				          gcData->lineWidth,
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1216
	    GetClientRect(hWnd, &rct);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1217
	    EVENT_PRINTF(("WM_WINDOWPOSCHANGED\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1218
	    enqEvent(0,hWnd, message, wParam,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1219
			       rct.left, rct.top,
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1220
			       rct.right-rct.left,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1221
			       rct.bottom-rct.top);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1222
	    return 0;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1223
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1224
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1225
	case WM_ERASEBKGND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1226
	    EVENT_PRINTF(("WM_ERASEBKGND\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1227
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1228
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1229
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1230
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1231
	    *pDefault = 0;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1232
	    return 1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1233
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1234
	case WM_PAINT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1235
	    EVENT_PRINTF(("WM_PAINT\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1236
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1237
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1238
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1239
	    }
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1240
	    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
  1241
	    {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1242
	      if (GetUpdateRect(hWnd, &upd, FALSE))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1243
	      {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1244
		  if (GetWindow_eventMask(hWnd) & ExposureMask)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1245
		    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
  1246
	      }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1247
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1248
	    else
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1249
	      pDefault = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1250
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1251
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1252
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1253
	case WM_SIZE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1254
	    EVENT_PRINTF(("WM_SIZE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1255
	    switch(wParam)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1256
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1257
	      case SIZE_RESTORED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1258
	      case SIZE_MAXIMIZED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1259
		GetClientRect(hWnd, (LPRECT) &upd);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1260
		if (GetWindow_eventMask(hWnd) & ExposureMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1261
		  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
  1262
		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
  1263
		break;
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
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1266
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1267
	case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1268
	    EVENT_PRINTF(("WM_SHOWWINDOW\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1269
	    enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1270
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1271
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1272
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1273
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1274
	    break;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1275
	    //*pDefault = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1276
	    //return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1277
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1278
	case WM_MOUSEACTIVATE :
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1279
	    EVENT_PRINTF2(("WM_MOUSEACTIVATE h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1280
	    *pDefault = 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1281
	    if ((__rootWinSpezial == hWnd) || (GetActiveWindow() && (LOWORD(lParam) == HTCLIENT))
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1282
		/*((GETLOCALWINDOWINFOPTR(hWnd)->flag & LI_TOPWIN) == 0) */
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1283
	       )
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1284
	       return MA_NOACTIVATE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1285
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1286
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1287
	      return MA_ACTIVATE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1288
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1289
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1290
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1291
	case WM_NCHITTEST:
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1292
	    EVENT_PRINTF(("WM_NCHITTEST\n"));
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1293
	    if (hWnd == __rootWinSpezial)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1294
	    {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1295
	      *pDefault = 0;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1296
	      return HTCLIENT;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1297
	    }
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1298
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1299
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1300
	case WM_NCACTIVATE:
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1301
	    EVENT_PRINTF(("WM_NCACTIVATE\n"));
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1302
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1303
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1304
	case WM_ACTIVATE:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1305
	    CPRINTF(("WM_ACTIVATE %s h=%x\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1306
			    LOWORD(wParam) ? "active" : "inactive",
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1307
			    hWnd));
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1308
#if 1
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1309
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1310
	    switch (LOWORD(wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1311
		case WA_INACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1312
		    EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1313
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1314
		case WA_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1315
		    EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1316
		    if (currentCapture == CAPTURE_NONE)
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1317
		    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1318
		      POINT p;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1319
		      HWND hWndChild,hWndTemp;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1320
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1321
		      p.x = evRootX;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1322
		      p.y = evRootY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1323
		      ScreenToClient(hWnd, &p);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1324
		      hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1325
		      do
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1326
		      {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1327
			hWndTemp = hWndChild;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1328
			hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1329
		      } while ((hWndChild) && (hWndChild != hWndTemp));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1330
		      /*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
  1331
		      if (hWndChild /*&& (hWndChild != hWnd)*/)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1332
		      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1333
			  modifiers = getModifiers();
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1334
			  if (hWndChild != currentPointerView)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1335
			  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1336
			      if (currentPointerView)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1337
			      {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1338
				  if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1339
				    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
  1340
				  currentPointerView = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1341
			      }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1342
			      if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1343
				enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1344
			      //SetFocus(hWndChild);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1345
			      currentPointerView = hWndChild;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1346
			  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1347
		      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1348
		    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1349
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1350
		case WA_CLICKACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1351
		    EVENT_PRINTF2(("WM_ACTIVATE clkactive h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1352
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1353
		default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1354
		    EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1355
		    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1356
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1357
	    if (isNative) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1358
		*pDefault = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1359
		return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1360
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1361
	    *pDefault = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1362
	    return 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1363
#endif
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1364
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1365
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1366
	case WM_SYSCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1367
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1368
	    goto commonChar;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1369
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1370
	case WM_CHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1371
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1372
	commonChar:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1373
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1374
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1375
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1376
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1377
	    modifiers = getModifiers();
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
		POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1380
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1381
		p.x = evRootX;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1382
		p.y = evRootY;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1383
		ScreenToClient(hWnd, &p);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1384
		x = p.x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1385
		y = p.y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1386
	    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1387
	    if (currentPointerView) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1388
	      int evMask = GetWindow_eventMask(currentPointerView);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1389
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1390
	      if (evMask & KeyPressMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1391
		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
  1392
	      if (evMask & KeyReleaseMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1393
		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
  1394
	    } else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1395
	      int evMask = GetWindow_eventMask(hWnd);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1396
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1397
	      if (evMask & KeyPressMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1398
		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
  1399
	      if (evMask & KeyReleaseMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1400
		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
  1401
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1402
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1403
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1404
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1405
	case WM_KEYUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1406
	    EVENT_PRINTF2(("WM_KEYUP h=%x %x\n", hWnd, wParam));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1407
	    goto commonKeyUp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1408
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1409
	case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1410
	    EVENT_PRINTF2(("WM_SYSKEYUP %x\n, wParam"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1411
	commonKeyUp:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1412
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1413
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1414
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1415
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1416
	    modifiers = getModifiers();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1417
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1418
		POINT p;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1419
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1420
		p.x = evRootX;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1421
		p.y = evRootY;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1422
		ScreenToClient(hWnd, &p);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1423
		x = p.x;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1424
		y = p.y;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1425
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1426
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1427
	    if (currentPointerView) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1428
	      if (GetWindow_eventMask(currentPointerView) & KeyReleaseMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1429
		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
  1430
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1431
	      if (GetWindow_eventMask(hWnd) & KeyReleaseMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1432
		enqEvent(KeyReleaseMask,hWnd, message, wParam, x, y, lParam, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1433
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1434
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1435
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1436
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1437
	case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1438
	    EVENT_PRINTF2(("WM_SYSKEYDOWN %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1439
	    goto commonKey;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1440
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1441
	case WM_KEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1442
	    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
  1443
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1444
	    /* while debugging ... */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1445
	    if (wParam == VK_ESCAPE) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1446
		ReleaseCapture();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1447
		currentCapture = CAPTURE_NONE;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1448
		CPRINTF(("ReleaseCapture <ESC>\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1449
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1450
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1451
	commonKey:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1452
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1453
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1454
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1455
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1456
	    modifiers = getModifiers();
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1457
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1458
		POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1459
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1460
		p.x = evRootX;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1461
		p.y = evRootY;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1462
		ScreenToClient(hWnd, &p);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1463
		x = p.x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1464
		y = p.y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1465
	    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1466
	    if (currentPointerView) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1467
	      if (GetWindow_eventMask(currentPointerView) & KeyPressMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1468
		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
  1469
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1470
	      if (GetWindow_eventMask(hWnd) & KeyPressMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1471
		enqEvent(KeyPressMask,hWnd, message, wParam, x, y, lParam, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1472
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1473
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1474
	    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1475
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1476
	case WM_MOUSEMOVE:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1477
	    EVENT_PRINTF3(("WM_MOUSEMOVE h=%x\n", hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1478
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1479
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1480
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1481
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1482
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1483
	    {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1484
		short x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1485
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1486
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1487
		y = (int)(short)HIWORD(lParam);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1488
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1489
		modifiers = getModifiers();
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1490
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1491
		if (currentCapture == CAPTURE_NONE)
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1492
		{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1493
		  if (hWnd != currentPointerView) {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1494
		      if (currentPointerView) {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1495
			  if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1496
			    enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1497
			  currentPointerView = 0;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1498
		      }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1499
		      if (GetWindow_eventMask(hWnd) & EnterWindowMask)
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1500
			enqEvent(EnterWindowMask,hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1501
		      currentPointerView = hWnd;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1502
		  }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1503
		  CPRINTF(("MouseMove %x\n",currentPointerView));
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1504
		}
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1505
		else
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1506
		{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1507
		  CPRINTF(("MouseMove Capture %x\n",currentPointerView));
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1508
		}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1509
		if (    (GetWindow_eventMask(currentPointerView) & PointerMotionMask)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1510
		     || (modifiers & (Button1Mask|Button2Mask|Button3Mask))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1511
		   )
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1512
		     enqEvent(PointerMotionMask,currentPointerView, message, wParam, x, y, 0, modifiers);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1513
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1514
	    *pDefault = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1515
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1516
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1517
	case WM_LBUTTONUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1518
	case WM_MBUTTONUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1519
	case WM_RBUTTONUP:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1520
	    if (isNative) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1521
		*pDefault = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1522
		return 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1523
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1524
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1525
	    if (currentCapture == CAPTURE_IMPLICIT) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1526
		currentCapture = CAPTURE_NONE;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1527
		ReleaseCapture();
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1528
		CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1529
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1530
	    modifiers = getModifiers();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1531
	    EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1532
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
2151
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
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1535
	    if (GetWindow_eventMask(hWnd) & ButtonReleaseMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1536
	      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
  1537
					      wParam,modifiers);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1538
	    *pDefault = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1539
	    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1540
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1541
	case WM_LBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1542
	case WM_MBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1543
	case WM_RBUTTONDOWN:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1544
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1545
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1546
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1547
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1548
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1549
	    if (currentCapture == CAPTURE_NONE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1550
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1551
		currentCapture = CAPTURE_IMPLICIT;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1552
		//SetFocus(hWnd);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1553
		SetCapture(hWnd);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1554
		CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1555
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1556
	    goto commonButton;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1557
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1558
	case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1559
	case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1560
	case WM_RBUTTONDBLCLK:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1561
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1562
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1563
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1564
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1565
	commonButton:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1566
	    modifiers = getModifiers();
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1567
	    EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1568
			   hWnd, LOWORD(lParam), HIWORD(lParam)));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1569
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1570
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1571
	    if (GetWindow_eventMask(hWnd) & ButtonPressMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1572
	      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
  1573
					      wParam,modifiers);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1574
	    *pDefault = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1575
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1576
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1577
	case WM_CAPTURECHANGED:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1578
	    CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1579
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1580
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1581
	case WM_KILLFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1582
	    CPRINTF(("WM_KILLFOCUS\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1583
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1584
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1585
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1586
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1587
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1588
	    *pDefault = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1589
	    return 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1590
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1591
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1592
	case WM_SETFOCUS:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1593
	    CPRINTF(("WM_SETFOCUS %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1594
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1595
	    //enqEvent(0,hWnd, message, wParam, 0, 0, 0, 0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1596
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1597
	      POINT p;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1598
	      HWND hWndChild,hWndTemp;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1599
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1600
	      p.x = evRootX;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1601
	      p.y = evRootY;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1602
	      ScreenToClient(hWnd, &p);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1603
	      hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1604
	      do
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1605
	      {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1606
		hWndTemp = hWndChild;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1607
		hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1608
	      } while ((hWndChild) && (hWndChild != hWndTemp));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1609
	      /*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
  1610
	      if (hWndChild /*&& (hWndChild != hWnd)*/)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1611
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1612
		  modifiers = getModifiers();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1613
		  if (hWndChild != currentPointerView)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1614
		  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1615
		      if (currentPointerView)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1616
		      {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1617
			  if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1618
			    enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1619
			  currentPointerView = 0;
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
		      if (GetWindow_eventMask(hWndChild) & EnterWindowMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1622
			enqEvent(EnterWindowMask,hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1623
		      //SetFocus(hWndChild);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1624
		      currentPointerView = hWndChild;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1625
		  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1626
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1627
	    }
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1628
#endif
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1629
	    if (isNative) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1630
		*pDefault = 1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1631
		return 0;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1632
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1633
	    *pDefault = 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1634
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1635
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1636
	case WM_STYLECHANGING:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1637
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1638
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1639
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1640
	case WM_STYLECHANGED:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1641
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1642
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1643
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1644
	case WM_GETTEXT:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1645
	    /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1646
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1647
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1648
	case WM_GETTEXTLENGTH:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1649
	    EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1650
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1651
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1652
	case WM_NCCREATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1653
	    EVENT_PRINTF(("WM_NCCREATE %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1654
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1655
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1656
	case WM_NCMOUSEMOVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1657
	    {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1658
		short x, y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1659
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1660
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1661
		y = (int)(short)HIWORD(lParam);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1662
		EVENT_PRINTF(("WM_NCMOUSEMOVE %d/%d\n", x, y));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1663
		lastNCMouseX = x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1664
		lastNCMouseY = y;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1665
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1666
		modifiers = getModifiers();
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1667
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1668
		if (currentCapture == CAPTURE_NONE)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1669
		{
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1670
		  if (hWnd != currentPointerView) {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1671
		      if (currentPointerView) {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1672
			  if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1673
			    enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers);
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1674
			  currentPointerView = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1675
		      }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1676
		  }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1677
		}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1678
	    }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1679
	    *pDefault = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1680
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1681
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1682
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1683
	case WM_PARENTNOTIFY:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1684
	    EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1685
				hWnd, lParam, LOWORD(wParam)));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1686
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1687
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1688
	case WM_NCLBUTTONDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1689
	    EVENT_PRINTF(("WM_NCLBUTTONDOWN\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1690
	    {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1691
		short x, y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1692
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1693
		x = (int)(short)LOWORD(lParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1694
		y = (int)(short)HIWORD(lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1695
		lastNCMouseX = x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1696
		lastNCMouseY = y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1697
	    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1698
	    break;
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
	case WM_NCLBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1701
	    EVENT_PRINTF(("WM_NCLBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1702
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1703
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1704
	case WM_NCRBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1705
	    EVENT_PRINTF(("WM_NCRBUTTONDOWN\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1706
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1707
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1708
	case WM_NCRBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1709
	    EVENT_PRINTF(("WM_NCRBUTTONUP\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1710
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1711
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1712
	case WM_NCMBUTTONDOWN:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1713
	    EVENT_PRINTF(("WM_NCMBUTTONDOWN\n"));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1714
	    break;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1715
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1716
	case WM_NCMBUTTONUP:
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1717
	    EVENT_PRINTF(("WM_NCMBUTTONUP\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1718
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1719
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1720
	case WM_SETTEXT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1721
	    EVENT_PRINTF(("WM_SETTEXT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1722
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1723
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1724
	case 0x88:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1725
	    EVENT_PRINTF(("0x88 (undoc)\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1726
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1727
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1728
	case WM_NCCALCSIZE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1729
	    EVENT_PRINTF(("WM_NCCALCSIZE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1730
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1731
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1732
	case WM_NCPAINT:
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1733
	    EVENT_PRINTF3(("WM_NCPAINT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1734
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1735
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1736
	case WM_SYSCOMMAND:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1737
	    switch (wParam & ~0x000F) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1738
		case SC_CLOSE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1739
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1740
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1741
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1742
		case SC_MOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1743
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1744
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1745
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1746
		case SC_RESTORE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1747
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1748
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1749
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1750
		case SC_SIZE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1751
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1752
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1753
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1754
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1755
		    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1756
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1757
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1758
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1759
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1760
	case WM_INITMENU:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1761
	    EVENT_PRINTF(("WM_INITMENU\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1762
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1763
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1764
	case WM_INITMENUPOPUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1765
	    EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1766
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1767
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1768
	case WM_ENTERIDLE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1769
	    EVENT_PRINTF(("WM_ENTERIDLE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1770
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1771
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1772
	case WM_ENTERMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1773
	    EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1774
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1775
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1776
	case WM_EXITMENULOOP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1777
	    EVENT_PRINTF(("WM_EXITMENULOOP\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1778
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1779
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1780
	case WM_MENUSELECT:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1781
	    EVENT_PRINTF(("WM_MENUSELECT\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1782
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1783
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1784
	case WM_QUIT:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1785
	    UNHANDLED_EVENT_PRINTF(("WM_QUIT\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1786
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1787
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1788
	case WM_NCDESTROY:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1789
	    EVENT_PRINTF(("WM_NCDESTROY\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1790
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1791
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1792
	case WM_QUERYNEWPALETTE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1793
	    EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1794
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1795
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1796
	case WM_PALETTECHANGED:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1797
	    EVENT_PRINTF(("WM_PALETTECHANGED\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1798
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1799
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1800
	case WM_ACTIVATEAPP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1801
	    EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  1802
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1803
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1804
	case WM_SYSDEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1805
	    EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1806
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1807
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1808
	case WM_DEADCHAR:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1809
	    EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1810
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1811
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1812
	case WM_PAINTICON:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1813
	    EVENT_PRINTF(("WM_PAINTICON\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1814
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1815
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1816
	case WM_ICONERASEBKGND:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1817
	    EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1818
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1819
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1820
	case WM_WINDOWPOSCHANGING:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1821
	    EVENT_PRINTF(("WM_WINDOWPOSCHANGING\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1822
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1823
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1824
	case WM_QUERYOPEN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1825
	    EVENT_PRINTF(("WM_QUERYOPEN\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1826
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1827
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1828
	case WM_QUERYENDSESSION:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1829
	    EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1830
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0);
1127
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
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1833
	case WM_FONTCHANGE:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1834
	    UNHANDLED_EVENT_PRINTF(("WM_FONTCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1835
	    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
  1836
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1837
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1838
	case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1839
	    EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1840
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1841
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1842
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1843
	case WM_MOVING:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  1844
	    EVENT_PRINTF(("WM_MOVING\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1845
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1846
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1847
	case WM_SIZING:
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1848
	    EVENT_PRINTF(("WM_SIZING\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1849
	    /*__debugEvent__();*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1850
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1851
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1852
	case WM_EXITSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1853
	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  1854
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1855
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1856
	case WM_ENTERSIZEMOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1857
	    EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1858
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1859
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1860
	case WM_MOVE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1861
	    EVENT_PRINTF(("WM_MOVE\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1862
	    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1863
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1864
	case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1865
	    UNHANDLED_EVENT_PRINTF(("WM_POWER\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1866
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1867
	    break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1868
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1869
	default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1870
	    UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: unhandled msg = %x\n", message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1871
	    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1872
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1873
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1874
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1875
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1876
LONG APIENTRY
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1877
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1878
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1879
static void _USERENTRY
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1880
dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1881
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1882
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1883
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1884
    MSG msg;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1885
    localWindowInfo *li;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1886
    _dispatchThreadId = GetCurrentThreadId();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1887
    TH_DPRINTF(("TS %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1888
    PeekMessage(&msg,NULL,0,0,PM_NOREMOVE);   /* must be */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1889
#ifndef WIN32THREADS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1890
    AttachThreadInput(_dispatchThreadId,_masterThreadId,TRUE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1891
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1892
    /*SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1893
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1894
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1895
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1896
    /* allocate localMemory for Window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1897
    li = (localWindowInfo*)malloc(sizeof(localWindowInfo));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1898
    if (li)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1899
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1900
      memset(li,0,sizeof(*_thread_local));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1901
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1902
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1903
    __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
  1904
				       WS_POPUP|WS_DISABLED,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1905
				0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1906
				rect.right-rect.left,rect.bottom-rect.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1907
				0,0,(HANDLE) __getHInstance(),li);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1908
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1909
    /*printf("__rootWinSpezial %x\n",__rootWinSpezial);*/
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1910
    //ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1911
    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
  1912
    SetEvent(hCreateEvent);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1913
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1914
    while (bdispatchThreadState)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1915
    {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1916
	HANDLE dummy;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1917
	TH_DPRINTF(("TG %d\n", th_calls++));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1918
	if (currentPointerView)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1919
	{
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1920
	  while (PeekMessage(&msg,0,0,0,PM_NOREMOVE) == 0)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1921
	  {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1922
	    if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1923
	    {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1924
	      POINT point;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1925
	      if (GetCursorPos(&point))
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1926
	      {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1927
		HWND hWnd = WindowFromPoint(point);
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1928
		if (hWnd)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1929
		{
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1930
		  if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId())
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1931
		  {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1932
		    if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1933
		      enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers());
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1934
		    currentPointerView = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1935
		    break;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1936
		  }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1937
		}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1938
	      }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1939
	    }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1940
	  }
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1941
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1942
	GetMessage(&msg, NULL, 0, 0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1943
	TH_DPRINTF(("TD %d\n", th_calls++));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1944
	destroyWin = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1945
	if (msg.message == WM_THREADDESTROYWINDOW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1946
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1947
	  destroyWin = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1948
	  msg.message = WM_CLOSE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1949
	  CPRINTF(("thread WM_THREADDESTROYWINDOW %x\n",msg.hwnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1950
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1951
	else if (msg.message == WM_THREADSETFOCUS)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1952
	{
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1953
#ifdef xxWIN32THREADS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1954
	  if (msg.lParam)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1955
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1956
	    if (AttachThreadInput(_dispatchThreadId,msg.lParam,TRUE) == FALSE)
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  1957
	      PRINTF(("SetFocus AttachThreadInput error %d\n",GetLastError()));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1958
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1959
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1960
	  CPRINTF(("threadSetfocus %x\n",msg.wParam));
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1961
	  //SetForegroundWindow((HWND)msg.wParam);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1962
	  //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
  1963
	  SetFocus((HWND)msg.wParam);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1964
	  continue;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1965
	}
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1966
	else if (msg.message == WM_THREADSETCURSOR)
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1967
	{
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1968
	  if (msg.lParam)
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1969
	  {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1970
	    POINT p;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1971
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1972
	    GetCursorPos(&p);
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1973
	    if (WindowFromPoint(p) == msg.hwnd)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1974
	    {
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1975
	      CPRINTF(("threadSetCursor %x\n",msg.lParam));
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1976
	      SetCursor((HCURSOR)msg.lParam);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1977
	    }
2247
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1978
	  }
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1979
	  continue;
50650fdc8c72 cursor fixes
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1980
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1981
	else if (msg.message == WM_THREADSETCAPTURE)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1982
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1983
	  if (msg.wParam)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1984
	  {
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1985
	    if (currentPointerView)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1986
	    {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1987
		if (GetWindow_eventMask(currentPointerView) & LeaveWindowMask)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1988
		  enqEvent(LeaveWindowMask,currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers());
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1989
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1990
	    currentPointerView = msg.wParam;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1991
	    currentCapture = CAPTURE_EXPLICIT;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1992
	    CPRINTF(("threadSetCapture %x\n",msg.wParam));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1993
	    SetCapture(currentPointerView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1994
	  }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1995
	  else
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  1996
	  {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1997
	    if (currentPointerView  == __rootWinSpezial)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1998
	    {
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  1999
	      //ShowWindow(__rootWinSpezial, SW_HIDE);
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2000
	      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
  2001
			     |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
  2002
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2003
	    currentPointerView = 0;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2004
	    currentCapture = CAPTURE_NONE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2005
	    CPRINTF(("threadReleaseCapture\n"));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2006
	    ReleaseCapture();
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2007
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2008
	  if (msg.lParam)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2009
	  {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2010
	      CPRINTF(("threadSetCursor %x\n",msg.lParam));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2011
	      SetCursor((HCURSOR)msg.lParam);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2012
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2013
	  continue;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2014
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2015
	else if (msg.message == WM_THREADCREATEWINDOW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2016
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2017
	  TH_DPRINTF(("C %d\n", th_calls));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2018
	  if (_thread_winStyleBits & WS_POPUP)
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2019
	  {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2020
	    //_thread_parentHandle = GetActiveWindow();
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  2021
	  }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2022
	  _thread_newWinHandle = CreateWindowEx(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2023
				      _thread_winStyleBitsEx,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2024
				      _thread_className,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2025
				      _thread_windowName,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2026
				      _thread_winStyleBits,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2027
				      _thread_x, _thread_y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2028
				      _thread_dx,_thread_dy,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2029
				      _thread_parentHandle,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2030
				      NULL,           /* menu */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2031
				      (HANDLE) __getHInstance(),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2032
				      _thread_local);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2033
	  SetEvent(hCreateEvent);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2034
	  continue;
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
	/* TranslateMessage(&msg); */ /* Translates virtual key codes */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2037
	if (   (msg.message == WM_KEYDOWN)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2038
	    || (msg.message == WM_KEYUP)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2039
	    || (msg.message == WM_SYSKEYDOWN)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2040
	    || (msg.message == WM_SYSKEYUP)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2041
	   )
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2042
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2043
#ifdef xxDEBUG
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2044
	   if ((msg.wParam == 0x11) && (msg.message == WM_KEYDOWN))/* CTRL-C */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2045
	   {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2046
	     if (c_count++ > 3)  /* for debugging */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2047
		exit(1);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2048
	   }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2049
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2050
	    /*printf("keymsg %x\n",msg.wParam);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2051
	    if (
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2052
		   ((msg.wParam >= '0') && (msg.wParam <= 'Z'))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2053
		|| (msg.wParam == 0x20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2054
		|| (msg.wParam == 0x14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2055
		/*|| (msg.wParam == 0x10)*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2056
		|| (msg.wParam >= 0xB0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2057
	       )
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2058
	    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2059
		/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2060
		 * translate to a WM_CHAR message
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2061
		 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2062
		if (TranslateMessage(&msg))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2063
		    continue;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2064
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2065
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2066
	evRootX = msg.pt.x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2067
	evRootY = msg.pt.y;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2068
	lastMSGTime = msg.time;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2069
	DispatchMessage(&msg);   /* Dispatches message to window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2070
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2071
    return 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2072
}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2073
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2074
LONG APIENTRY
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2075
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2076
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2077
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2078
    int retVal;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2079
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2080
    TH_DPRINTF(("TMW %d\n",message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2081
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2082
    if (wantDefault) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2083
	DDPRINTF((">>DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2084
	retVal = DefWindowProc(hWnd, message, wParam, lParam);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2085
	DDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2086
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2087
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2088
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2089
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2090
static int CALLBACK
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2091
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData )
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2092
	LOGFONT*        lplf;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2093
	TEXTMETRIC*     lptm;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2094
	DWORD           dwType;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2095
	LPARAM          lpData;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2096
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2097
	OBJ t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2098
	OBJ* refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2099
	OBJ  typeFaceList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2100
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2101
	if (lplf) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2102
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2103
	    __PROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2104
	    t = __MKSTRING( lplf->lfFaceName );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2105
	    __UNPROTECT__(*refToList);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2106
	    typeFaceList = *refToList;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2107
	    __SSEND1( typeFaceList, @symbol(add:), 0, t );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2108
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2109
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2110
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2111
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2112
static int CALLBACK
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2113
EnumFontsProc( lplf, lptm, dwType, lpData )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2114
	LOGFONT*      lplf;     /* address of logical-font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2115
	TEXTMETRIC*   lptm;     /* address of physical font data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2116
	DWORD         dwType;   /* font type */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2117
	LPARAM        lpData;   /* address of application supplied data */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2118
{
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2119
	OBJ newArray, t;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2120
	OBJ *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2121
	OBJ list;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2122
	char *s;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2123
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2124
	DPRINTF(("EnumFontProc\n\n\n\n"));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2125
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2126
	if( lplf ) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2127
	    refToList = (OBJ*) lpData;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2128
	    __PROTECT__(*refToList);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2129
	    DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2130
	    DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2131
	    DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2132
	    DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2133
	    DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2134
	    DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2135
	    DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2136
	    DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2137
	    DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2138
	    DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2139
	    DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2140
	    DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2141
	    DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2142
	    DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2143
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2144
	    newArray = __ARRAY_NEW_INT(16);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2145
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2146
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2147
	    if ( dwType & TRUETYPE_FONTTYPE )
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2148
	      __ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(0);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2149
	    else
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2150
	      //__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
  2151
	      __ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2152
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2153
	    __ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2154
	    __ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2155
	    __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
  2156
	    switch (lplf->lfWeight) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2157
		case FW_NORMAL:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2158
		    s = "normal";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2159
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2160
		case FW_BOLD:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2161
		    s = "bold";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2162
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2163
		case FW_MEDIUM:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2164
		    s = "medium";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2165
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2166
		case FW_LIGHT:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2167
		    s = "demi";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2168
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2169
		default:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2170
		    s = "other";
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2171
		    break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2172
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2173
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2174
	    __PROTECT__(newArray);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2175
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2176
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2177
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2178
	    __ArrayInstPtr(newArray)->a_element[4] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2179
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2180
	    if( lplf->lfItalic == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2181
		if( lplf->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2182
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2183
			s = "italic-underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2184
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2185
			s = "italic-underline";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2186
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2187
		} else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2188
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2189
			s = "italic-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2190
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2191
			s = "italic";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2192
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2193
		}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2194
	    } else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2195
		if( lplf->lfUnderline == TRUE ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2196
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2197
			s = "underline-strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2198
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2199
			s = "underline";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2200
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2201
		} else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2202
		    if( lplf->lfStrikeOut == TRUE ) {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2203
			s = "strikeOut";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2204
		    } else {
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2205
			s = "normal";
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2206
		    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2207
		}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2208
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2209
	    __PROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2210
	    __PROTECT__(newArray);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2211
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2212
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2213
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2214
	    __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
  2215
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2216
	    __ArrayInstPtr(newArray)->a_element[5] = __MKSMALLINT(lplf->lfItalic);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2217
	    __ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfUnderline);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2218
	    __ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfStrikeOut);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2219
	    __ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfCharSet);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2220
	    __ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfOutPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2221
	    __ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfClipPrecision);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2222
	    __ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfQuality);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2223
	    __ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfPitchAndFamily);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2224
	    /* ... */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2225
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2226
	    __PROTECT__(newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2227
	    t = __MKSTRING(lplf->lfFaceName);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2228
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2229
	    __UNPROTECT__(*refToList);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2230
	    __ArrayInstPtr(newArray)->a_element[13] = t; __STORE(newArray, t);
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2231
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2232
	    switch (lplf->lfCharSet) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2233
		case ANSI_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2234
		    s = "ansi";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2235
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2236
		case DEFAULT_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2237
		    s = "default";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2238
		case SYMBOL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2239
		    s = "symbol";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2240
		case SHIFTJIS_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2241
		    s = "sjis";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2242
		case GB2312_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2243
		    s = "gb";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2244
		case HANGEUL_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2245
		    s = "hangeul";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2246
		case CHINESEBIG5_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2247
		    s = "big5";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2248
		case OEM_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2249
		    s = "oem";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2250
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2251
# ifdef JOHAB_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2252
		case JOHAB_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2253
		    s = "johab";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2254
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2255
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2256
# ifdef HEBREW_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2257
		case HEBREW_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2258
		    s = "hebrew";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2259
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2260
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2261
# ifdef GREEK_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2262
		case GREEK_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2263
		    s = "greek";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2264
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2265
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2266
# ifdef RUSSIAN_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2267
		case RUSSIAN_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2268
		    s = "russian";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2269
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2270
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2271
# ifdef MAC_CHARSET
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2272
		case MAC_CHARSET:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2273
		    s = "mac";
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2274
		    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2275
# endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2276
		default:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2277
		    s = "unknown";
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2278
		    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2279
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2280
	    __PROTECT__(*refToList);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2281
	    __PROTECT__(newArray);
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2282
	    t = __MKSTRING(s);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2283
	    __UNPROTECT__(newArray);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2284
	    __UNPROTECT__(*refToList);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2285
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
  2286
	    __ArrayInstPtr(newArray)->a_element[14] = t; __STORE(newArray, t);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2287
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2288
	    list = *refToList;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2289
	    __SSEND1(list, @symbol(add:), 0, newArray);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2290
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2291
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2292
	DPRINTF((" dwType            %d\n", dwType ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2293
	return 1;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2294
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  2295
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2296
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2297
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2298
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2299
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2300
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2301
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2302
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2303
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2304
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2305
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2306
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2307
 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
  2308
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2309
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2310
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2311
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2312
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2313
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2314
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2315
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2316
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2317
    See more documentation in my superclass, DeviceWorkstation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2318
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2319
    [author:]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2320
	Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2321
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2322
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2323
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2324
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2325
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2326
initialize
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2327
    |nButtons swap|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2328
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2329
    super initialize.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2330
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2331
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2332
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2333
    NativeWindows := false.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2334
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2335
    BeepFrequency := 440.       "/ Hertz
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2336
    BeepDuration := 200.        "/ millis
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2337
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2338
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2339
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2340
    nButtons := self getSystemMetrics:#mouseButtons.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2341
    swap := self getSystemMetrics:#swapButton.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2342
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2343
    nButtons == 0 ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2344
	'WinWorkstation [warning]: mouse-less operation may not work' infoPrintCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2345
    ] ifFalse:[
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2346
	nButtons == 2 ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2347
	    ButtonTranslation := #(1 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2348
	].
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2349
	swap ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2350
	    ButtonTranslation := ButtonTranslation copy reverse
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2351
	]
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  2352
    ].
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2353
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2354
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2355
    "/ to Windows windowClass (windows-specific).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2356
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2357
    NativeWindowClassTable := IdentityDictionary new.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2358
    NativeWindowClassTable at:#ScrollBar     put:'SCROLLBAR'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2359
    NativeWindowClassTable at:#CheckBox      put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2360
    NativeWindowClassTable at:#RadioButton   put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2361
    NativeWindowClassTable at:#Button        put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2362
    NativeWindowClassTable at:#DefaultButton put:'BUTTON'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2363
    NativeWindowClassTable at:#ComboBox      put:'COMBOBOX'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2364
    NativeWindowClassTable at:#EditField     put:'EDIT'.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  2365
    NativeWindowClassTable at:#ListBox       put:'LISTBOX'.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2366
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2367
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2368
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2369
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2370
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  2371
    "setup standard color names"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2372
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2373
    StandardColorValues := Dictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2374
    #(
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2375
	(240 248 255)   'alice blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2376
	(240 248 255)   'AliceBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2377
	(250 235 215)   'antique white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2378
	(250 235 215)   'AntiqueWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2379
	(255 239 219)   'AntiqueWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2380
	(238 223 204)   'AntiqueWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2381
	(205 192 176)   'AntiqueWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2382
	(139 131 120)   'AntiqueWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2383
	(127 255 212)   'aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2384
	(127 255 212)   'aquamarine1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2385
	(118 238 198)   'aquamarine2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2386
	(102 205 170)   'aquamarine3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2387
	( 69 139 116)   'aquamarine4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2388
	(240 255 255)   'azure'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2389
	(240 255 255)   'azure1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2390
	(224 238 238)   'azure2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2391
	(193 205 205)   'azure3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2392
	(131 139 139)   'azure4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2393
	(245 245 220)   'beige'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2394
	(255 228 196)   'bisque'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2395
	(255 228 196)   'bisque1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2396
	(238 213 183)   'bisque2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2397
	(205 183 158)   'bisque3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2398
	(139 125 107)   'bisque4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2399
	(  0   0   0)   'black'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2400
	(255 235 205)   'blanched almond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2401
	(255 235 205)   'BlanchedAlmond'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2402
	(  0   0 255)   'blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2403
	(138  43 226)   'blue violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2404
	(  0   0 255)   'blue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2405
	(  0   0 238)   'blue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2406
	(  0   0 205)   'blue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2407
	(  0   0 139)   'blue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2408
	(138  43 226)   'BlueViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2409
	(165  42  42)   'brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2410
	(255  64  64)   'brown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2411
	(238  59  59)   'brown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2412
	(205  51  51)   'brown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2413
	(139  35  35)   'brown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2414
	(222 184 135)   'burlywood'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2415
	(255 211 155)   'burlywood1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2416
	(238 197 145)   'burlywood2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2417
	(205 170 125)   'burlywood3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2418
	(139 115  85)   'burlywood4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2419
	( 95 158 160)   'cadet blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2420
	( 95 158 160)   'CadetBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2421
	(152 245 255)   'CadetBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2422
	(142 229 238)   'CadetBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2423
	(122 197 205)   'CadetBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2424
	( 83 134 139)   'CadetBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2425
	(127 255   0)   'chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2426
	(127 255   0)   'chartreuse1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2427
	(118 238   0)   'chartreuse2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2428
	(102 205   0)   'chartreuse3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2429
	( 69 139   0)   'chartreuse4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2430
	(210 105  30)   'chocolate'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2431
	(255 127  36)   'chocolate1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2432
	(238 118  33)   'chocolate2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2433
	(205 102  29)   'chocolate3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2434
	(139  69  19)   'chocolate4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2435
	(255 127  80)   'coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2436
	(255 114  86)   'coral1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2437
	(238 106  80)   'coral2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2438
	(205  91  69)   'coral3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2439
	(139  62  47)   'coral4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2440
	(100 149 237)   'cornflower blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2441
	(100 149 237)   'CornflowerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2442
	(255 248 220)   'cornsilk'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2443
	(255 248 220)   'cornsilk1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2444
	(238 232 205)   'cornsilk2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2445
	(205 200 177)   'cornsilk3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2446
	(139 136 120)   'cornsilk4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2447
	(  0 255 255)   'cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2448
	(  0 255 255)   'cyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2449
	(  0 238 238)   'cyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2450
	(  0 205 205)   'cyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2451
	(  0 139 139)   'cyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2452
	(  0   0 139)   'dark blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2453
	(  0 139 139)   'dark cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2454
	(184 134  11)   'dark goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2455
	(169 169 169)   'dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2456
	(  0 100   0)   'dark green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2457
	(169 169 169)   'dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2458
	(189 183 107)   'dark khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2459
	(139   0 139)   'dark magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2460
	( 85 107  47)   'dark olive green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2461
	(255 140   0)   'dark orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2462
	(153  50 204)   'dark orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2463
	(139   0   0)   'dark red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2464
	(233 150 122)   'dark salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2465
	(143 188 143)   'dark sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2466
	( 72  61 139)   'dark slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2467
	( 47  79  79)   'dark slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2468
	( 47  79  79)   'dark slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2469
	(  0 206 209)   'dark turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2470
	(148   0 211)   'dark violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2471
	(  0   0 139)   'DarkBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2472
	(  0 139 139)   'DarkCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2473
	(184 134  11)   'DarkGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2474
	(255 185  15)   'DarkGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2475
	(238 173  14)   'DarkGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2476
	(205 149  12)   'DarkGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2477
	(139 101   8)   'DarkGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2478
	(169 169 169)   'DarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2479
	(  0 100   0)   'DarkGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2480
	(169 169 169)   'DarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2481
	(189 183 107)   'DarkKhaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2482
	(139   0 139)   'DarkMagenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2483
	( 85 107  47)   'DarkOliveGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2484
	(202 255 112)   'DarkOliveGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2485
	(188 238 104)   'DarkOliveGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2486
	(162 205  90)   'DarkOliveGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2487
	(110 139  61)   'DarkOliveGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2488
	(255 140   0)   'DarkOrange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2489
	(255 127   0)   'DarkOrange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2490
	(238 118   0)   'DarkOrange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2491
	(205 102   0)   'DarkOrange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2492
	(139  69   0)   'DarkOrange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2493
	(153  50 204)   'DarkOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2494
	(191  62 255)   'DarkOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2495
	(178  58 238)   'DarkOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2496
	(154  50 205)   'DarkOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2497
	(104  34 139)   'DarkOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2498
	(139   0   0)   'DarkRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2499
	(233 150 122)   'DarkSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2500
	(143 188 143)   'DarkSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2501
	(193 255 193)   'DarkSeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2502
	(180 238 180)   'DarkSeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2503
	(155 205 155)   'DarkSeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2504
	(105 139 105)   'DarkSeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2505
	( 72  61 139)   'DarkSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2506
	( 47  79  79)   'DarkSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2507
	(151 255 255)   'DarkSlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2508
	(141 238 238)   'DarkSlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2509
	(121 205 205)   'DarkSlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2510
	( 82 139 139)   'DarkSlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2511
	( 47  79  79)   'DarkSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2512
	(  0 206 209)   'DarkTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2513
	(148   0 211)   'DarkViolet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2514
	(255  20 147)   'deep pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2515
	(  0 191 255)   'deep sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2516
	(255  20 147)   'DeepPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2517
	(255  20 147)   'DeepPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2518
	(238  18 137)   'DeepPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2519
	(205  16 118)   'DeepPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2520
	(139  10  80)   'DeepPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2521
	(  0 191 255)   'DeepSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2522
	(  0 191 255)   'DeepSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2523
	(  0 178 238)   'DeepSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2524
	(  0 154 205)   'DeepSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2525
	(  0 104 139)   'DeepSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2526
	(105 105 105)   'dim gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2527
	(105 105 105)   'dim grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2528
	(105 105 105)   'DimGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2529
	(105 105 105)   'DimGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2530
	( 30 144 255)   'dodger blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2531
	( 30 144 255)   'DodgerBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2532
	( 30 144 255)   'DodgerBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2533
	( 28 134 238)   'DodgerBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2534
	( 24 116 205)   'DodgerBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2535
	( 16  78 139)   'DodgerBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2536
	(178  34  34)   'firebrick'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2537
	(255  48  48)   'firebrick1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2538
	(238  44  44)   'firebrick2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2539
	(205  38  38)   'firebrick3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2540
	(139  26  26)   'firebrick4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2541
	(255 250 240)   'floral white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2542
	(255 250 240)   'FloralWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2543
	( 34 139  34)   'forest green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2544
	( 34 139  34)   'ForestGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2545
	(220 220 220)   'gainsboro'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2546
	(248 248 255)   'ghost white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2547
	(248 248 255)   'GhostWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2548
	(255 215   0)   'gold'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2549
	(255 215   0)   'gold1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2550
	(238 201   0)   'gold2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2551
	(205 173   0)   'gold3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2552
	(139 117   0)   'gold4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2553
	(218 165  32)   'goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2554
	(255 193  37)   'goldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2555
	(238 180  34)   'goldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2556
	(205 155  29)   'goldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2557
	(139 105  20)   'goldenrod4'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2558
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2559
	(192 192 192)   'grey'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2560
	(  0   0   0)   'grey0'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2561
	(  3   3   3)   'grey1'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2562
	( 26  26  26)   'grey10'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2563
	(255 255 255)   'grey100'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2564
	( 28  28  28)   'grey11'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2565
	( 31  31  31)   'grey12'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2566
	( 33  33  33)   'grey13'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2567
	( 36  36  36)   'grey14'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2568
	( 38  38  38)   'grey15'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2569
	( 41  41  41)   'grey16'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2570
	( 43  43  43)   'grey17'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2571
	( 46  46  46)   'grey18'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2572
	( 48  48  48)   'grey19'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2573
	(  5   5   5)   'grey2'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2574
	( 51  51  51)   'grey20'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2575
	( 54  54  54)   'grey21'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2576
	( 56  56  56)   'grey22'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2577
	( 59  59  59)   'grey23'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2578
	( 61  61  61)   'grey24'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2579
	( 64  64  64)   'grey25'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2580
	( 66  66  66)   'grey26'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2581
	( 69  69  69)   'grey27'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2582
	( 71  71  71)   'grey28'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2583
	( 74  74  74)   'grey29'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2584
	(  8   8   8)   'grey3'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2585
	( 77  77  77)   'grey30'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2586
	( 79  79  79)   'grey31'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2587
	( 82  82  82)   'grey32'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2588
	( 84  84  84)   'grey33'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2589
	( 87  87  87)   'grey34'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2590
	( 89  89  89)   'grey35'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2591
	( 92  92  92)   'grey36'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2592
	( 94  94  94)   'grey37'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2593
	( 97  97  97)   'grey38'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2594
	( 99  99  99)   'grey39'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2595
	( 10  10  10)   'grey4'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2596
	(102 102 102)   'grey40'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2597
	(105 105 105)   'grey41'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2598
	(107 107 107)   'grey42'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2599
	(110 110 110)   'grey43'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2600
	(112 112 112)   'grey44'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2601
	(115 115 115)   'grey45'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2602
	(117 117 117)   'grey46'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2603
	(120 120 120)   'grey47'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2604
	(122 122 122)   'grey48'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2605
	(125 125 125)   'grey49'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2606
	( 13  13  13)   'grey5'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2607
	(127 127 127)   'grey50'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2608
	(130 130 130)   'grey51'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2609
	(133 133 133)   'grey52'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2610
	(135 135 135)   'grey53'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2611
	(138 138 138)   'grey54'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2612
	(140 140 140)   'grey55'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2613
	(143 143 143)   'grey56'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2614
	(145 145 145)   'grey57'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2615
	(148 148 148)   'grey58'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2616
	(150 150 150)   'grey59'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2617
	( 15  15  15)   'grey6'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2618
	(153 153 153)   'grey60'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2619
	(156 156 156)   'grey61'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2620
	(158 158 158)   'grey62'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2621
	(161 161 161)   'grey63'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2622
	(163 163 163)   'grey64'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2623
	(166 166 166)   'grey65'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2624
	(168 168 168)   'grey66'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2625
	(171 171 171)   'grey67'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2626
	(173 173 173)   'grey68'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2627
	(176 176 176)   'grey69'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2628
	( 18  18  18)   'grey7'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2629
	(179 179 179)   'grey70'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2630
	(181 181 181)   'grey71'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2631
	(184 184 184)   'grey72'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2632
	(186 186 186)   'grey73'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2633
	(189 189 189)   'grey74'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2634
	(191 191 191)   'grey75'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2635
	(194 194 194)   'grey76'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2636
	(196 196 196)   'grey77'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2637
	(199 199 199)   'grey78'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2638
	(201 201 201)   'grey79'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2639
	( 20  20  20)   'grey8'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2640
	(204 204 204)   'grey80'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2641
	(207 207 207)   'grey81'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2642
	(209 209 209)   'grey82'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2643
	(212 212 212)   'grey83'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2644
	(214 214 214)   'grey84'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2645
	(217 217 217)   'grey85'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2646
	(219 219 219)   'grey86'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2647
	(222 222 222)   'grey87'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2648
	(224 224 224)   'grey88'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2649
	(227 227 227)   'grey89'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2650
	( 23  23  23)   'grey9'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2651
	(229 229 229)   'grey90'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2652
	(232 232 232)   'grey91'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2653
	(235 235 235)   'grey92'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2654
	(237 237 237)   'grey93'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2655
	(240 240 240)   'grey94'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2656
	(242 242 242)   'grey95'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2657
	(245 245 245)   'grey96'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2658
	(247 247 247)   'grey97'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2659
	(250 250 250)   'grey98'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2660
	(252 252 252)   'grey99'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  2661
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2662
	(192 192 192)   'gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2663
	(  0   0   0)   'gray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2664
	(  3   3   3)   'gray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2665
	( 26  26  26)   'gray10'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2666
	(255 255 255)   'gray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2667
	( 28  28  28)   'gray11'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2668
	( 31  31  31)   'gray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2669
	( 33  33  33)   'gray13'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2670
	( 36  36  36)   'gray14'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2671
	( 38  38  38)   'gray15'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2672
	( 41  41  41)   'gray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2673
	( 43  43  43)   'gray17'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2674
	( 46  46  46)   'gray18'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2675
	( 48  48  48)   'gray19'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2676
	(  5   5   5)   'gray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2677
	( 51  51  51)   'gray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2678
	( 54  54  54)   'gray21'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2679
	( 56  56  56)   'gray22'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2680
	( 59  59  59)   'gray23'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2681
	( 61  61  61)   'gray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2682
	( 64  64  64)   'gray25'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2683
	( 66  66  66)   'gray26'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2684
	( 69  69  69)   'gray27'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2685
	( 71  71  71)   'gray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2686
	( 74  74  74)   'gray29'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2687
	(  8   8   8)   'gray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2688
	( 77  77  77)   'gray30'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2689
	( 79  79  79)   'gray31'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2690
	( 82  82  82)   'gray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2691
	( 84  84  84)   'gray33'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2692
	( 87  87  87)   'gray34'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2693
	( 89  89  89)   'gray35'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2694
	( 92  92  92)   'gray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2695
	( 94  94  94)   'gray37'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2696
	( 97  97  97)   'gray38'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2697
	( 99  99  99)   'gray39'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2698
	( 10  10  10)   'gray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2699
	(102 102 102)   'gray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2700
	(105 105 105)   'gray41'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2701
	(107 107 107)   'gray42'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2702
	(110 110 110)   'gray43'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2703
	(112 112 112)   'gray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2704
	(115 115 115)   'gray45'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2705
	(117 117 117)   'gray46'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2706
	(120 120 120)   'gray47'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2707
	(122 122 122)   'gray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2708
	(125 125 125)   'gray49'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2709
	( 13  13  13)   'gray5'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2710
	(127 127 127)   'gray50'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2711
	(130 130 130)   'gray51'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2712
	(133 133 133)   'gray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2713
	(135 135 135)   'gray53'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2714
	(138 138 138)   'gray54'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2715
	(140 140 140)   'gray55'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2716
	(143 143 143)   'gray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2717
	(145 145 145)   'gray57'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2718
	(148 148 148)   'gray58'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2719
	(150 150 150)   'gray59'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2720
	( 15  15  15)   'gray6'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2721
	(153 153 153)   'gray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2722
	(156 156 156)   'gray61'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2723
	(158 158 158)   'gray62'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2724
	(161 161 161)   'gray63'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2725
	(163 163 163)   'gray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2726
	(166 166 166)   'gray65'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2727
	(168 168 168)   'gray66'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2728
	(171 171 171)   'gray67'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2729
	(173 173 173)   'gray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2730
	(176 176 176)   'gray69'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2731
	( 18  18  18)   'gray7'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2732
	(179 179 179)   'gray70'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2733
	(181 181 181)   'gray71'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2734
	(184 184 184)   'gray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2735
	(186 186 186)   'gray73'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2736
	(189 189 189)   'gray74'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2737
	(191 191 191)   'gray75'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2738
	(194 194 194)   'gray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2739
	(196 196 196)   'gray77'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2740
	(199 199 199)   'gray78'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2741
	(201 201 201)   'gray79'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2742
	( 20  20  20)   'gray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2743
	(204 204 204)   'gray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2744
	(207 207 207)   'gray81'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2745
	(209 209 209)   'gray82'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2746
	(212 212 212)   'gray83'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2747
	(214 214 214)   'gray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2748
	(217 217 217)   'gray85'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2749
	(219 219 219)   'gray86'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2750
	(222 222 222)   'gray87'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2751
	(224 224 224)   'gray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2752
	(227 227 227)   'gray89'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2753
	( 23  23  23)   'gray9'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2754
	(229 229 229)   'gray90'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2755
	(232 232 232)   'gray91'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2756
	(235 235 235)   'gray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2757
	(237 237 237)   'gray93'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2758
	(240 240 240)   'gray94'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2759
	(242 242 242)   'gray95'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2760
	(245 245 245)   'gray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2761
	(247 247 247)   'gray97'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2762
	(250 250 250)   'gray98'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2763
	(252 252 252)   'gray99'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2764
	(  0 255   0)   'green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2765
	(173 255  47)   'green yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2766
	(  0 255   0)   'green1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2767
	(  0 238   0)   'green2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2768
	(  0 205   0)   'green3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2769
	(  0 139   0)   'green4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2770
	(173 255  47)   'GreenYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2771
	(240 255 240)   'honeydew'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2772
	(240 255 240)   'honeydew1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2773
	(224 238 224)   'honeydew2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2774
	(193 205 193)   'honeydew3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2775
	(131 139 131)   'honeydew4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2776
	(255 105 180)   'hot pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2777
	(255 105 180)   'HotPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2778
	(255 110 180)   'HotPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2779
	(238 106 167)   'HotPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2780
	(205  96 144)   'HotPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2781
	(139  58  98)   'HotPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2782
	(205  92  92)   'indian red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2783
	(205  92  92)   'IndianRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2784
	(255 106 106)   'IndianRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2785
	(238  99  99)   'IndianRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2786
	(205  85  85)   'IndianRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2787
	(139  58  58)   'IndianRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2788
	(255 255 240)   'ivory'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2789
	(255 255 240)   'ivory1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2790
	(238 238 224)   'ivory2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2791
	(205 205 193)   'ivory3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2792
	(139 139 131)   'ivory4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2793
	(240 230 140)   'khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2794
	(255 246 143)   'khaki1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2795
	(238 230 133)   'khaki2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2796
	(205 198 115)   'khaki3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2797
	(139 134  78)   'khaki4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2798
	(230 230 250)   'lavender'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2799
	(255 240 245)   'lavender blush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2800
	(255 240 245)   'LavenderBlush'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2801
	(255 240 245)   'LavenderBlush1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2802
	(238 224 229)   'LavenderBlush2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2803
	(205 193 197)   'LavenderBlush3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2804
	(139 131 134)   'LavenderBlush4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2805
	(124 252   0)   'lawn green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2806
	(124 252   0)   'LawnGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2807
	(255 250 205)   'lemon chiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2808
	(255 250 205)   'LemonChiffon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2809
	(255 250 205)   'LemonChiffon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2810
	(238 233 191)   'LemonChiffon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2811
	(205 201 165)   'LemonChiffon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2812
	(139 137 112)   'LemonChiffon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2813
	(173 216 230)   'light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2814
	(240 128 128)   'light coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2815
	(224 255 255)   'light cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2816
	(238 221 130)   'light goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2817
	(250 250 210)   'light goldenrod yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2818
	(211 211 211)   'light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2819
	(144 238 144)   'light green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2820
	(211 211 211)   'light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2821
	(255 182 193)   'light pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2822
	(255 160 122)   'light salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2823
	( 32 178 170)   'light sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2824
	(135 206 250)   'light sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2825
	(132 112 255)   'light slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2826
	(119 136 153)   'light slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2827
	(119 136 153)   'light slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2828
	(176 196 222)   'light steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2829
	(255 255 224)   'light yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2830
	(173 216 230)   'LightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2831
	(191 239 255)   'LightBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2832
	(178 223 238)   'LightBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2833
	(154 192 205)   'LightBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2834
	(104 131 139)   'LightBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2835
	(240 128 128)   'LightCoral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2836
	(224 255 255)   'LightCyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2837
	(224 255 255)   'LightCyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2838
	(209 238 238)   'LightCyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2839
	(180 205 205)   'LightCyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2840
	(122 139 139)   'LightCyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2841
	(238 221 130)   'LightGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2842
	(255 236 139)   'LightGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2843
	(238 220 130)   'LightGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2844
	(205 190 112)   'LightGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2845
	(139 129  76)   'LightGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2846
	(250 250 210)   'LightGoldenrodYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2847
	(211 211 211)   'LightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2848
	(144 238 144)   'LightGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2849
	(211 211 211)   'LightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2850
	(255 182 193)   'LightPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2851
	(255 174 185)   'LightPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2852
	(238 162 173)   'LightPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2853
	(205 140 149)   'LightPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2854
	(139  95 101)   'LightPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2855
	(255 160 122)   'LightSalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2856
	(255 160 122)   'LightSalmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2857
	(238 149 114)   'LightSalmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2858
	(205 129  98)   'LightSalmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2859
	(139  87  66)   'LightSalmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2860
	( 32 178 170)   'LightSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2861
	(135 206 250)   'LightSkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2862
	(176 226 255)   'LightSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2863
	(164 211 238)   'LightSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2864
	(141 182 205)   'LightSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2865
	( 96 123 139)   'LightSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2866
	(132 112 255)   'LightSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2867
	(119 136 153)   'LightSlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2868
	(119 136 153)   'LightSlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2869
	(176 196 222)   'LightSteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2870
	(202 225 255)   'LightSteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2871
	(188 210 238)   'LightSteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2872
	(162 181 205)   'LightSteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2873
	(110 123 139)   'LightSteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2874
	(255 255 224)   'LightYellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2875
	(255 255 224)   'LightYellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2876
	(238 238 209)   'LightYellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2877
	(205 205 180)   'LightYellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2878
	(139 139 122)   'LightYellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2879
	( 50 205  50)   'lime green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2880
	( 50 205  50)   'LimeGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2881
	(250 240 230)   'linen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2882
	(255   0 255)   'magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2883
	(255   0 255)   'magenta1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2884
	(238   0 238)   'magenta2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2885
	(205   0 205)   'magenta3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2886
	(139   0 139)   'magenta4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2887
	(176  48  96)   'maroon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2888
	(255  52 179)   'maroon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2889
	(238  48 167)   'maroon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2890
	(205  41 144)   'maroon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2891
	(139  28  98)   'maroon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2892
	(102 205 170)   'medium aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2893
	(  0   0 205)   'medium blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2894
	(186  85 211)   'medium orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2895
	(147 112 219)   'medium purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2896
	( 60 179 113)   'medium sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2897
	(123 104 238)   'medium slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2898
	(  0 250 154)   'medium spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2899
	( 72 209 204)   'medium turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2900
	(199  21 133)   'medium violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2901
	(102 205 170)   'MediumAquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2902
	(  0   0 205)   'MediumBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2903
	(186  85 211)   'MediumOrchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2904
	(224 102 255)   'MediumOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2905
	(209  95 238)   'MediumOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2906
	(180  82 205)   'MediumOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2907
	(122  55 139)   'MediumOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2908
	(147 112 219)   'MediumPurple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2909
	(171 130 255)   'MediumPurple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2910
	(159 121 238)   'MediumPurple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2911
	(137 104 205)   'MediumPurple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2912
	( 93  71 139)   'MediumPurple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2913
	( 60 179 113)   'MediumSeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2914
	(123 104 238)   'MediumSlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2915
	(  0 250 154)   'MediumSpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2916
	( 72 209 204)   'MediumTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2917
	(199  21 133)   'MediumVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2918
	( 25  25 112)   'midnight blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2919
	( 25  25 112)   'MidnightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2920
	(245 255 250)   'mint cream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2921
	(245 255 250)   'MintCream'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2922
	(255 228 225)   'misty rose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2923
	(255 228 225)   'MistyRose'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2924
	(255 228 225)   'MistyRose1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2925
	(238 213 210)   'MistyRose2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2926
	(205 183 181)   'MistyRose3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2927
	(139 125 123)   'MistyRose4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2928
	(255 228 181)   'moccasin'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2929
	(255 222 173)   'navajo white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2930
	(255 222 173)   'NavajoWhite'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2931
	(255 222 173)   'NavajoWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2932
	(238 207 161)   'NavajoWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2933
	(205 179 139)   'NavajoWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2934
	(139 121  94)   'NavajoWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2935
	(  0   0 128)   'navy'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2936
	(  0   0 128)   'navy blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2937
	(  0   0 128)   'NavyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2938
	(253 245 230)   'old lace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2939
	(253 245 230)   'OldLace'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2940
	(107 142  35)   'olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2941
	(107 142  35)   'OliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2942
	(192 255  62)   'OliveDrab1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2943
	(179 238  58)   'OliveDrab2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2944
	(154 205  50)   'OliveDrab3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2945
	(105 139  34)   'OliveDrab4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2946
	(255 165   0)   'orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2947
	(255  69   0)   'orange red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2948
	(255 165   0)   'orange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2949
	(238 154   0)   'orange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2950
	(205 133   0)   'orange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2951
	(139  90   0)   'orange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2952
	(255  69   0)   'OrangeRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2953
	(255  69   0)   'OrangeRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2954
	(238  64   0)   'OrangeRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2955
	(205  55   0)   'OrangeRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2956
	(139  37   0)   'OrangeRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2957
	(218 112 214)   'orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2958
	(255 131 250)   'orchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2959
	(238 122 233)   'orchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2960
	(205 105 201)   'orchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2961
	(139  71 137)   'orchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2962
	(238 232 170)   'pale goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2963
	(152 251 152)   'pale green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2964
	(175 238 238)   'pale turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2965
	(219 112 147)   'pale violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2966
	(238 232 170)   'PaleGoldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2967
	(152 251 152)   'PaleGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2968
	(154 255 154)   'PaleGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2969
	(144 238 144)   'PaleGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2970
	(124 205 124)   'PaleGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2971
	( 84 139  84)   'PaleGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2972
	(175 238 238)   'PaleTurquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2973
	(187 255 255)   'PaleTurquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2974
	(174 238 238)   'PaleTurquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2975
	(150 205 205)   'PaleTurquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2976
	(102 139 139)   'PaleTurquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2977
	(219 112 147)   'PaleVioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2978
	(255 130 171)   'PaleVioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2979
	(238 121 159)   'PaleVioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2980
	(205 104 137)   'PaleVioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2981
	(139  71  93)   'PaleVioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2982
	(255 239 213)   'papaya whip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2983
	(255 239 213)   'PapayaWhip'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2984
	(255 218 185)   'peach puff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2985
	(255 218 185)   'PeachPuff'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2986
	(255 218 185)   'PeachPuff1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2987
	(238 203 173)   'PeachPuff2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2988
	(205 175 149)   'PeachPuff3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2989
	(139 119 101)   'PeachPuff4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2990
	(205 133  63)   'peru'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2991
	(255 192 203)   'pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2992
	(255 181 197)   'pink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2993
	(238 169 184)   'pink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2994
	(205 145 158)   'pink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2995
	(139  99 108)   'pink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2996
	(221 160 221)   'plum'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2997
	(255 187 255)   'plum1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2998
	(238 174 238)   'plum2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  2999
	(205 150 205)   'plum3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3000
	(139 102 139)   'plum4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3001
	(176 224 230)   'powder blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3002
	(176 224 230)   'PowderBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3003
	(160  32 240)   'purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3004
	(155  48 255)   'purple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3005
	(145  44 238)   'purple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3006
	(125  38 205)   'purple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3007
	( 85  26 139)   'purple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3008
	(255   0   0)   'red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3009
	(255   0   0)   'red1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3010
	(238   0   0)   'red2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3011
	(205   0   0)   'red3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3012
	(139   0   0)   'red4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3013
	(188 143 143)   'rosy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3014
	(188 143 143)   'RosyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3015
	(255 193 193)   'RosyBrown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3016
	(238 180 180)   'RosyBrown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3017
	(205 155 155)   'RosyBrown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3018
	(139 105 105)   'RosyBrown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3019
	( 65 105 225)   'royal blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3020
	( 65 105 225)   'RoyalBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3021
	( 72 118 255)   'RoyalBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3022
	( 67 110 238)   'RoyalBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3023
	( 58  95 205)   'RoyalBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3024
	( 39  64 139)   'RoyalBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3025
	(139  69  19)   'saddle brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3026
	(139  69  19)   'SaddleBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3027
	(250 128 114)   'salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3028
	(255 140 105)   'salmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3029
	(238 130  98)   'salmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3030
	(205 112  84)   'salmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3031
	(139  76  57)   'salmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3032
	(244 164  96)   'sandy brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3033
	(244 164  96)   'SandyBrown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3034
	( 255 206 137)   'scoActiveBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3035
	( 43  45  49)   'scoActiveForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3036
	( 254 222 255)   'scoActiveTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3037
	( 172 186 204)   'scoAltBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3038
	( 203 203 192)   'scoBackground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3039
	( 11   0 113)   'scoForeground'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3040
	( 141 178 215)   'scoHighlight'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3041
	( 255 240 248)   'scoTopShadow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3042
	( 46 139  87)   'sea green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3043
	( 46 139  87)   'SeaGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3044
	( 84 255 159)   'SeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3045
	( 78 238 148)   'SeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3046
	( 67 205 128)   'SeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3047
	( 46 139  87)   'SeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3048
	(255 245 238)   'seashell'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3049
	(255 245 238)   'seashell1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3050
	(238 229 222)   'seashell2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3051
	(205 197 191)   'seashell3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3052
	(139 134 130)   'seashell4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3053
	(142 56 142)   'sgi beet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3054
	(197 193 170)   'sgi bright gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3055
	(197 193 170)   'sgi bright grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3056
	(113 198 113)   'sgi chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3057
	( 85  85  85)   'sgi dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3058
	( 85  85  85)   'sgi dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3059
	(  0   0   0)   'sgi gray 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3060
	(255 255 255)   'sgi gray 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3061
	( 30  30  30)   'sgi gray 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3062
	( 40  40  40)   'sgi gray 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3063
	( 51  51  51)   'sgi gray 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3064
	( 61  61  61)   'sgi gray 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3065
	( 71  71  71)   'sgi gray 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3066
	( 81  81  81)   'sgi gray 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3067
	( 91  91  91)   'sgi gray 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3068
	( 10  10  10)   'sgi gray 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3069
	(102 102 102)   'sgi gray 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3070
	(112 112 112)   'sgi gray 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3071
	(122 122 122)   'sgi gray 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3072
	(132 132 132)   'sgi gray 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3073
	(142 142 142)   'sgi gray 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3074
	(153 153 153)   'sgi gray 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3075
	(163 163 163)   'sgi gray 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3076
	(173 173 173)   'sgi gray 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3077
	(183 183 183)   'sgi gray 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3078
	(193 193 193)   'sgi gray 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3079
	( 20  20  20)   'sgi gray 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3080
	(204 204 204)   'sgi gray 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3081
	(214 214 214)   'sgi gray 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3082
	(224 224 224)   'sgi gray 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3083
	(234 234 234)   'sgi gray 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3084
	(244 244 244)   'sgi gray 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3085
	(  0   0   0)   'sgi grey 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3086
	(255 255 255)   'sgi grey 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3087
	( 30  30  30)   'sgi grey 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3088
	( 40  40  40)   'sgi grey 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3089
	( 51  51  51)   'sgi grey 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3090
	( 61  61  61)   'sgi grey 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3091
	( 71  71  71)   'sgi grey 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3092
	( 81  81  81)   'sgi grey 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3093
	( 91  91  91)   'sgi grey 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3094
	( 10  10  10)   'sgi grey 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3095
	(102 102 102)   'sgi grey 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3096
	(112 112 112)   'sgi grey 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3097
	(122 122 122)   'sgi grey 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3098
	(132 132 132)   'sgi grey 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3099
	(142 142 142)   'sgi grey 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3100
	(153 153 153)   'sgi grey 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3101
	(163 163 163)   'sgi grey 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3102
	(173 173 173)   'sgi grey 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3103
	(183 183 183)   'sgi grey 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3104
	(193 193 193)   'sgi grey 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3105
	( 20  20  20)   'sgi grey 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3106
	(204 204 204)   'sgi grey 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3107
	(214 214 214)   'sgi grey 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3108
	(224 224 224)   'sgi grey 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3109
	(234 234 234)   'sgi grey 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3110
	(244 244 244)   'sgi grey 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3111
	(125 158 192)   'sgi light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3112
	(170 170 170)   'sgi light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3113
	(170 170 170)   'sgi light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3114
	(132 132 132)   'sgi medium gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3115
	(132 132 132)   'sgi medium grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3116
	(142 142  56)   'sgi olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3117
	(198 113 113)   'sgi salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3118
	(113 113 198)   'sgi slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3119
	( 56 142 142)   'sgi teal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3120
	( 40  40  40)   'sgi very dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3121
	( 40  40  40)   'sgi very dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3122
	(214 214 214)   'sgi very light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3123
	(214 214 214)   'sgi very light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3124
	(142 56 142)   'SGIBeet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3125
	(197 193 170)   'SGIBrightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3126
	(197 193 170)   'SGIBrightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3127
	(113 198 113)   'SGIChartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3128
	( 85  85  85)   'SGIDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3129
	( 85  85  85)   'SGIDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3130
	(  0   0   0)   'SGIGray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3131
	(255 255 255)   'SGIGray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3132
	( 30  30  30)   'SGIGray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3133
	( 40  40  40)   'SGIGray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3134
	( 51  51  51)   'SGIGray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3135
	( 61  61  61)   'SGIGray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3136
	( 71  71  71)   'SGIGray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3137
	( 81  81  81)   'SGIGray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3138
	( 91  91  91)   'SGIGray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3139
	( 10  10  10)   'SGIGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3140
	(102 102 102)   'SGIGray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3141
	(112 112 112)   'SGIGray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3142
	(122 122 122)   'SGIGray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3143
	(132 132 132)   'SGIGray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3144
	(142 142 142)   'SGIGray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3145
	(153 153 153)   'SGIGray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3146
	(163 163 163)   'SGIGray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3147
	(173 173 173)   'SGIGray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3148
	(183 183 183)   'SGIGray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3149
	(193 193 193)   'SGIGray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3150
	( 20  20  20)   'SGIGray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3151
	(204 204 204)   'SGIGray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3152
	(214 214 214)   'SGIGray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3153
	(224 224 224)   'SGIGray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3154
	(234 234 234)   'SGIGray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3155
	(244 244 244)   'SGIGray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3156
	(  0   0   0)   'SGIGrey0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3157
	(255 255 255)   'SGIGrey100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3158
	( 30  30  30)   'SGIGrey12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3159
	( 40  40  40)   'SGIGrey16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3160
	( 51  51  51)   'SGIGrey20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3161
	( 61  61  61)   'SGIGrey24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3162
	( 71  71  71)   'SGIGrey28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3163
	( 81  81  81)   'SGIGrey32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3164
	( 91  91  91)   'SGIGrey36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3165
	( 10  10  10)   'SGIGrey4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3166
	(102 102 102)   'SGIGrey40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3167
	(112 112 112)   'SGIGrey44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3168
	(122 122 122)   'SGIGrey48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3169
	(132 132 132)   'SGIGrey52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3170
	(142 142 142)   'SGIGrey56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3171
	(153 153 153)   'SGIGrey60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3172
	(163 163 163)   'SGIGrey64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3173
	(173 173 173)   'SGIGrey68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3174
	(183 183 183)   'SGIGrey72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3175
	(193 193 193)   'SGIGrey76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3176
	( 20  20  20)   'SGIGrey8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3177
	(204 204 204)   'SGIGrey80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3178
	(214 214 214)   'SGIGrey84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3179
	(224 224 224)   'SGIGrey88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3180
	(234 234 234)   'SGIGrey92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3181
	(244 244 244)   'SGIGrey96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3182
	(125 158 192)   'SGILightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3183
	(170 170 170)   'SGILightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3184
	(170 170 170)   'SGILightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3185
	(132 132 132)   'SGIMediumGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3186
	(132 132 132)   'SGIMediumGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3187
	(142 142  56)   'SGIOliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3188
	(198 113 113)   'SGISalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3189
	(113 113 198)   'SGISlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3190
	( 56 142 142)   'SGITeal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3191
	( 40  40  40)   'SGIVeryDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3192
	( 40  40  40)   'SGIVeryDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3193
	(214 214 214)   'SGIVeryLightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3194
	(214 214 214)   'SGIVeryLightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3195
	(160  82  45)   'sienna'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3196
	(255 130  71)   'sienna1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3197
	(238 121  66)   'sienna2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3198
	(205 104  57)   'sienna3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3199
	(139  71  38)   'sienna4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3200
	(135 206 235)   'sky blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3201
	(135 206 235)   'SkyBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3202
	(135 206 255)   'SkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3203
	(126 192 238)   'SkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3204
	(108 166 205)   'SkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3205
	( 74 112 139)   'SkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3206
	(106  90 205)   'slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3207
	(112 128 144)   'slate gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3208
	(112 128 144)   'slate grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3209
	(106  90 205)   'SlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3210
	(131 111 255)   'SlateBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3211
	(122 103 238)   'SlateBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3212
	(105  89 205)   'SlateBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3213
	( 71  60 139)   'SlateBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3214
	(112 128 144)   'SlateGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3215
	(198 226 255)   'SlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3216
	(185 211 238)   'SlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3217
	(159 182 205)   'SlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3218
	(108 123 139)   'SlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3219
	(112 128 144)   'SlateGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3220
	(255 250 250)   'snow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3221
	(255 250 250)   'snow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3222
	(238 233 233)   'snow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3223
	(205 201 201)   'snow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3224
	(139 137 137)   'snow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3225
	(  0 255 127)   'spring green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3226
	(  0 255 127)   'SpringGreen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3227
	(  0 255 127)   'SpringGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3228
	(  0 238 118)   'SpringGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3229
	(  0 205 102)   'SpringGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3230
	(  0 139  69)   'SpringGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3231
	( 70 130 180)   'steel blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3232
	( 70 130 180)   'SteelBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3233
	( 99 184 255)   'SteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3234
	( 92 172 238)   'SteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3235
	( 79 148 205)   'SteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3236
	( 54 100 139)   'SteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3237
	(210 180 140)   'tan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3238
	(255 165  79)   'tan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3239
	(238 154  73)   'tan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3240
	(205 133  63)   'tan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3241
	(139  90  43)   'tan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3242
	(216 191 216)   'thistle'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3243
	(255 225 255)   'thistle1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3244
	(238 210 238)   'thistle2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3245
	(205 181 205)   'thistle3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3246
	(139 123 139)   'thistle4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3247
	(255  99  71)   'tomato'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3248
	(255  99  71)   'tomato1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3249
	(238  92  66)   'tomato2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3250
	(205  79  57)   'tomato3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3251
	(139  54  38)   'tomato4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3252
	( 64 224 208)   'turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3253
	(  0 245 255)   'turquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3254
	(  0 229 238)   'turquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3255
	(  0 197 205)   'turquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3256
	(  0 134 139)   'turquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3257
	(238 130 238)   'violet'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3258
	(208  32 144)   'violet red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3259
	(208  32 144)   'VioletRed'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3260
	(255  62 150)   'VioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3261
	(238  58 140)   'VioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3262
	(205  50 120)   'VioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3263
	(139  34  82)   'VioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3264
	(245 222 179)   'wheat'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3265
	(255 231 186)   'wheat1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3266
	(238 216 174)   'wheat2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3267
	(205 186 150)   'wheat3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3268
	(139 126 102)   'wheat4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3269
	(255 255 255)   'white'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3270
	(245 245 245)   'white smoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3271
	(245 245 245)   'WhiteSmoke'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3272
	(255 255   0)   'yellow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3273
	(154 205  50)   'yellow green'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3274
	(255 255   0)   'yellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3275
	(238 238   0)   'yellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3276
	(205 205   0)   'yellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3277
	(139 139   0)   'yellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3278
	(154 205  50)   'YellowGreen'   
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3279
    ) pairWiseDo:[ :value :name |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3280
	StandardColorValues at:name put:value
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3281
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3282
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3283
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3284
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3285
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3286
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3287
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3288
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3289
nativeWindows:aBoolean
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3290
    "enable / disable use of native windows"
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3291
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3292
    NativeWindows := aBoolean
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3293
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3294
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3295
!WinWorkstation class methodsFor:'debugging'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3296
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3297
debug:aBoolean
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3298
    "enable/disable debug prints - this will vanish"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3299
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3300
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3301
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3302
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3303
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3304
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3305
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3306
prim
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3307
   "show prim values"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3308
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3309
   ('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
  3310
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3311
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3312
primBitmaps
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3313
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3314
    RETURN ( __MKSMALLINT(__cnt_bitmap));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3315
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3316
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3317
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3318
primBmpDc
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3319
%{  /* NOCONTEXT */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3320
    RETURN ( __MKSMALLINT(__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3321
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3322
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3323
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3324
primWindows
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3325
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3326
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3327
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3328
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3329
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3330
primgcData
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3331
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3332
    RETURN ( __MKSMALLINT(__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3333
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3334
! !
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
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3337
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3338
getSystemMetrics:aSymbol
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3339
    "get a system metrics value"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3340
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3341
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3342
    int info = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3343
    int isBool = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3344
    int arg;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3345
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3346
    if ((aSymbol == @symbol(swapButton))
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3347
    || (aSymbol == @symbol(SM_SWAPBUTTON))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3348
	arg = SM_SWAPBUTTON;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3349
	isBool = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3350
    } else if (aSymbol == @symbol(mouseButtons)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3351
	arg = SM_CMOUSEBUTTONS;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3352
    } else if ((aSymbol == @symbol(iconWidth)) || (aSymbol == @symbol(SM_CXICON))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3353
	arg = SM_CXICON;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3354
    } else if ((aSymbol == @symbol(iconHeight)) || (aSymbol == @symbol(SM_CYICON))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3355
	arg = SM_CYICON;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3356
    } else if ((aSymbol == @symbol(cursorWidth)) || (aSymbol == @symbol(SM_CXCURSOR))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3357
	arg = SM_CXCURSOR;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3358
    } else if ((aSymbol == @symbol(cursorHeight)) || (aSymbol == @symbol(SM_CYCURSOR))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3359
	arg = SM_CYCURSOR;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3360
    } else if ((aSymbol == @symbol(captionHeight)) || (aSymbol == @symbol(SM_CYCAPTION))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3361
	arg = SM_CYCAPTION;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3362
    } else if ((aSymbol == @symbol(resizeFrameWidth)) || (aSymbol == @symbol(SM_CXFRAME))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3363
	arg = SM_CXFRAME;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3364
    } else if ((aSymbol == @symbol(resizeFrameHeight)) || (aSymbol == @symbol(SM_CYFRAME))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3365
	arg = SM_CYFRAME;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3366
    } else if ((aSymbol == @symbol(borderFrameWidth)) || (aSymbol == @symbol(SM_CXBORDER))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3367
	arg = SM_CXBORDER;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3368
    } else if ((aSymbol == @symbol(borderFrameHeight)) || (aSymbol == @symbol(SM_CYBORDER))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3369
	arg = SM_CYBORDER;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3370
    } else if ((aSymbol == @symbol(fullScreenWindowWidth)) || (aSymbol == @symbol(SM_CXFULLSCREEN))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3371
	arg = SM_CXFULLSCREEN;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3372
    } else if ((aSymbol == @symbol(fullScreenWindowHeight)) || (aSymbol == @symbol(SM_CYFULLSCREEN))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3373
	arg = SM_CYFULLSCREEN;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3374
    } else if ((aSymbol == @symbol(vScrollbarWidth)) || (aSymbol == @symbol(SM_CXVSCROLL))) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3375
	arg = SM_CXVSCROLL;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3376
    } else if ((aSymbol == @symbol(hScrollbarHeight)) || (aSymbol == @symbol(SM_CYHSCROLL))) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3377
	arg = SM_CYHSCROLL;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3378
    } else if ((aSymbol == @symbol(vThumbHeight)) || (aSymbol == @symbol(SM_CYVTHUMB))) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3379
	arg = SM_CYVTHUMB;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3380
    } else if ((aSymbol == @symbol(hThumbWidth)) || (aSymbol == @symbol(SM_CXHTHUMB))) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3381
	arg = SM_CXHTHUMB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3382
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3383
	RETURN (nil);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3384
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3385
    info = GetSystemMetrics(arg);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3386
    if (isBool) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3387
	RETURN (info ? true : false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3388
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3389
    RETURN (__MKSMALLINT(info));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3390
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3391
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3392
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3393
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3394
    "ST-80 compatibility.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3395
     Return a string describing the display systems platform."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3396
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3397
    ^ 'WIN32'  
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3398
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3399
    "Modified: 26.5.1996 / 15:32:46 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3400
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3401
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3402
!WinWorkstation methodsFor:'accessing & queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3403
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3404
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3405
    "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
  3406
     This is the devices mask."
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
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3409
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3410
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3411
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3412
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3413
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3414
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3415
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3416
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3417
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3418
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3419
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3420
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3421
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3422
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3423
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3424
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3425
%}
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
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3428
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
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
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3433
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3434
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3435
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3436
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3437
    RETURN (__MKSMALLINT(Button2MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3438
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3439
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3440
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3441
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3442
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3443
     For backward compatibility."
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
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3446
    RETURN (__MKSMALLINT(Button3MotionMask)); 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3447
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3448
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3449
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3450
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3451
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3452
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3453
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3454
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3455
    if (aButton == __MKSMALLINT(1)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3456
	RETURN (__MKSMALLINT(Button1MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3457
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3458
    if (aButton == __MKSMALLINT(2)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3459
	RETURN (__MKSMALLINT(Button2MotionMask));    
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3460
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3461
    if (aButton == __MKSMALLINT(3)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3462
	RETURN (__MKSMALLINT(Button3MotionMask));    
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
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3465
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3466
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3467
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3468
controlMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3469
    "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
  3470
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3471
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3472
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3473
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3474
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3475
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3476
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3477
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3478
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3479
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3480
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3481
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3482
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3483
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3484
%}
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
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3488
    "return the displays fileNumber for select, if any"
1127
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 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3491
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3492
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3493
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3494
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3495
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3496
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3497
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3498
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3499
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3500
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3501
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3502
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3503
getSystemColor:aKey
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3504
    "retrieve a windows system color.
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3505
     The styleSheet/View classes may use this to setup default colors"
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3506
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3507
    |rgb|
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3508
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3509
    rgb := self primGetSystemColor:aKey.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3510
    rgb notNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3511
	^ Color
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3512
	    redByte:((rgb bitShift:-16) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3513
	    greenByte:((rgb bitShift:-8) bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3514
	    blueByte:(rgb bitAnd:16rFF)
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3515
    ].
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3516
    ^ nil
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3517
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3518
    "
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3519
     Display getSystemColor:#COLOR_WINDOW
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3520
     Display getSystemColor:#COLOR_HIGHLIGHT
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3521
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3522
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3523
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3524
primGetSystemColor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3525
%{  /* xxLIMITEDSTACK (WIN95 only) */
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3526
    int p;
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3527
    int rgb, r, g, b;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3528
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3529
    if (aKey == @symbol(COLOR_WINDOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3530
      p = COLOR_WINDOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3531
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3532
      p = COLOR_WINDOWTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3533
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3534
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3535
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3536
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3537
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3538
      p = COLOR_BTNFACE;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3539
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3540
      p = COLOR_BTNSHADOW;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3541
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3542
      p = COLOR_BTNTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3543
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3544
      p = COLOR_GRAYTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3545
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3546
      p = COLOR_HIGHLIGHT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3547
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3548
      p = COLOR_HIGHLIGHTTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3549
    } else if (aKey == @symbol(COLOR_MENU)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3550
      p = COLOR_MENU;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3551
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3552
      p = COLOR_MENUTEXT;
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3553
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3554
      p = COLOR_SCROLLBAR;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  3555
#ifdef COLOR_SHADOW
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3556
    } else if (aKey == @symbol(COLOR_SHADOW)) {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3557
      p = COLOR_SHADOW;
2239
f535b1178597 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  3558
#endif
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3559
    } else {
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  3560
      RETURN (nil);
2238
e04ff81bb3d9 more added to GetSysColor
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
  3561
    }
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3562
    rgb = GetSysColor(p);
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3563
    /* win uses BGR order */
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3564
    r = rgb & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3565
    g = (rgb >> 8) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3566
    b = (rgb >> 16) & 0xFF;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3567
    rgb = (((r << 8) | g) << 8) | b;
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  3568
    RETURN (__MKSMALLINT(rgb));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3569
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3570
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3571
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3572
primTranslatePointX:x y:y from:windowId1 to:windowId2
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3573
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3574
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3575
    HWND w1, w2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3576
    POINT point;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3577
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3578
    if (__isExternalAddress(windowId1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3579
     && __isExternalAddress(windowId2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3580
     && __bothSmallInteger(x, y)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3581
	w1 = _HWNDVal(windowId1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3582
	w2 = _HWNDVal(windowId2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3583
	point.x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3584
	point.y = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3585
	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
  3586
	ClientToScreen(w1,&point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3587
	ScreenToClient(w2,&point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3588
	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
  3589
	RETURN (__MKPOINT_INT(point.x, point.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3590
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3591
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3592
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3593
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3594
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3595
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3596
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3597
    "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
  3598
     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
  3599
     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
  3600
     - 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
  3601
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3602
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3603
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3604
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3605
    int xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3606
    HWND child_return;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3607
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3608
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3609
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3610
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3611
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3612
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3613
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3614
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3615
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3616
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3617
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3618
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3619
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3620
	    ScreenToClient(hWnd, &p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3621
	    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
  3622
	    /*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
  3623
	    if ((child_return) && (child_return != hWnd))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3624
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3625
		RETURN ( __MKEXTERNALADDRESS(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
	    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3628
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3629
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3630
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3631
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3632
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3633
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3634
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3635
     For Windows, a dummy number is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3636
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3637
    ^ '1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3638
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3639
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3640
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3641
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3642
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3643
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3644
serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3645
    "return the server vendor string. 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3646
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3647
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3648
    ^ 'microsoft'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3649
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3650
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3651
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3652
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3653
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3654
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3655
shiftMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3656
    "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
  3657
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3658
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3659
    RETURN (__MKSMALLINT(ShiftMask));
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
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3664
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3665
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3666
     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
  3667
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3668
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3669
    |x1 y1 x2 y2|
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3670
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3671
    x1 := x2 := aPoint x truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3672
    y1 := y2 := aPoint y truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3673
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3674
%{
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3675
    HWND w1, w2;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3676
    POINT point;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3677
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3678
    if (__isExternalAddress(windowId1)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3679
     && __isExternalAddress(windowId2)
2279
30a35be06995 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2276
diff changeset
  3680
     && __bothSmallInteger(x1, y1)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3681
	w1 = _HWNDVal(windowId1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3682
	w2 = _HWNDVal(windowId2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3683
	point.x = __intVal(x1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3684
	point.y = __intVal(y1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3685
	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
  3686
	ClientToScreen(w1,&point);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3687
	ScreenToClient(w2,&point);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3688
	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
  3689
	x2 = __MKSMALLINT(point.x);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  3690
	y2 = __MKSMALLINT(point.y);
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3691
    }
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
    ^ (x2 @ y2)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  3694
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3695
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3696
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3697
vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3698
    "return the display-servers vendor release 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3699
     - should normally not be of any interest, 
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3700
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3701
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3702
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3703
    ^ 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3704
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3705
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3706
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3707
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3708
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3709
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3710
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3711
    "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
  3712
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3713
     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
  3714
     - 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
  3715
     
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3716
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3717
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3718
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3719
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3720
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3721
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3722
	]
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
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3726
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3727
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3728
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3729
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3730
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3731
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3732
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3733
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3734
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3735
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3736
captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3737
    "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
  3738
     standard topWindows."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3739
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3740
    ^ self class getSystemMetrics:#captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3741
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3742
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3743
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3744
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3745
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3746
    |d w h|
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3747
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3748
    w := self class getSystemMetrics:#iconWidth.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3749
    h := self class getSystemMetrics:#iconHeight.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3750
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3751
    d := IdentityDictionary new.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3752
    d at:#minWidth put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3753
    d at:#maxWidth put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3754
    d at:#widthStep put:1.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3755
    d at:#minHeight put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3756
    d at:#maxHeight put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3757
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3758
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3759
    ^ OrderedCollection with:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3760
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3761
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3762
     Display iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3763
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3764
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3765
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3766
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3767
    "return true, if this display asynchronously sends expose events after a
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3768
     scroll operation. False otherwise. Asynchronous expose events are an X
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3769
     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
  3770
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3771
    "/ event Handling erst verbessern 
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3772
    ^ true "/ false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3773
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3774
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3775
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3776
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3777
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3778
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3779
    |info|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3780
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3781
    info := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3782
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3783
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3784
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3785
    ^ Array with:info
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3786
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3787
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3788
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3789
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3790
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3791
    ^ true
2232
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3794
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3795
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3796
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3797
    ^ false "/ true
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3798
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3799
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3800
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3801
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3802
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3803
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3804
    "Created: 10.6.1996 / 21:08:18 / cg"
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
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3807
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3808
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3809
     Normally, the same as extent, but may be smaller, in
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3810
     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
  3811
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3812
    ^ (self class getSystemMetrics:#fullScreenWindowWidth)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3813
      @
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3814
      (self class getSystemMetrics:#fullScreenWindowHeight)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3815
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3816
    "
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3817
     Display usableExtent
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3818
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3819
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3820
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3821
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3822
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3823
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3824
    |bitmapId|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3825
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3826
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3827
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3828
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3829
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3830
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3831
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3832
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3833
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3834
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3835
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3836
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3837
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3838
    int b_width, b_height;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3839
/*    printf("CreateBitmap B/W\n");*/
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3840
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3841
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3842
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3843
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3844
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3845
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3846
	if (newBitmapHandle)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3847
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3848
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3849
	    __cnt_bitmap++;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3850
	   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
  3851
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3852
	  RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3853
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3854
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3855
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3856
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3857
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3858
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3859
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3860
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3861
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3862
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3863
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3864
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3865
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3866
    HANDLE newBitmapHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3867
    /*printf("CreateBitmap Color\n");*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3868
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3869
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3870
	if (__intVal(d) == 1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3871
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3872
	  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
  3873
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3874
	else
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3875
	{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3876
	  /*if (__intVal(d) != __depth)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3877
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3878
	    printf("invalite depth\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3879
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3880
	  } */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3881
	  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
  3882
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3883
	if (newBitmapHandle)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3884
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3885
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3886
	    __cnt_bitmap++;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3887
	   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
  3888
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3889
	  RETURN ( __MKOBJ(newBitmapHandle));
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
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
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
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3894
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3895
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3896
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3897
createWindowFor:aView type:typeSymbol
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3898
		 origin:origin
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3899
		 extent:extent
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3900
		 minExtent:minExt
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3901
		 maxExtent:maxExt
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3902
		 borderWidth:bWidth
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3903
		 subViewOf:wsuperView
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3904
		 style:wStyle
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3905
		 inputOnly:winputOnly
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3906
		 label:wlabel
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3907
		 owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3908
		 icon:wicon
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3909
		 iconMask:wiconMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3910
		 iconView:wiconView
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3911
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3912
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3913
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3914
     wsuperViewId wiconId wiconMaskId windowId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3915
     weventMask wiconHeight
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3916
     wiconWidth windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3917
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3918
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3919
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3920
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3921
    displayId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3922
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3923
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3924
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3925
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3926
    origin notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3927
	xpos := origin x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3928
	ypos := origin y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3929
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3930
	xpos := ypos := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3931
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3932
    extent notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3933
	wwidth := extent x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3934
	wheight := extent y.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3935
    ] ifFalse:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3936
	wwidth := 100.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3937
	wheight := 40.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3938
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3939
    minExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3940
	minWidth := minExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3941
	minHeight := minExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3942
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3943
    maxExt notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3944
	maxWidth := maxExt x.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3945
	maxHeight := maxExt y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3946
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3947
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3948
    wsuperView notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3949
	wsuperViewId := wsuperView id
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3952
    wicon notNil ifTrue:[
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3953
	wiconId := wicon id.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3954
	wiconHeight := wicon height.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  3955
	wiconWidth  := wicon width.
1418
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  3956
	wiconMask notNil ifTrue:[
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  3957
	    wiconMaskId := wiconMask id
d21112d621a1 prepared for iconMasks
Claus Gittinger <cg@exept.de>
parents: 1416
diff changeset
  3958
	]
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3959
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3960
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3961
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3962
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3963
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3964
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3965
    NativeWindows ifTrue:[
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3966
	windowType := aView nativeWindowType.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3967
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3968
	"/ if it is already a string, take it as it is;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3969
	"/ otherwise, it must be a symbol and is used
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3970
	"/ as a key into the nativeClass translation map.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3971
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3972
	windowType isString ifTrue:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3973
	    windowClass := windowType
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3974
	] ifFalse:[
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3975
	    windowClass := NativeWindowClassTable at:windowType ifAbsent:nil
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3976
	]
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  3977
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  3978
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3979
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3980
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3981
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3982
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3983
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3984
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3985
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3986
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3987
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3988
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3989
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3990
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3991
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3992
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3993
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3994
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  3995
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3996
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  3997
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3998
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3999
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4000
      windowId := self
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4001
		  primCreateWindowFor:aView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4002
		  type:typeSymbol
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4003
		  borderWidth:bWidth
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4004
		  subViewOf:wsuperView
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4005
		  style:wStyle
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4006
		  inputOnly:winputOnly
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4007
		  label:wlabel
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4008
		  owner:wowner
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4009
		  icon:wicon
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4010
		  iconMask:wiconMask
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4011
		  moreArgs:moreArgs.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4012
      aView setId:windowId.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4013
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4014
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4015
    windowId notNil ifTrue:[self addKnownView:aView withId:windowId].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4016
    ^ windowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4017
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4018
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4019
destroyGC:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4020
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4021
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4022
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4023
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4024
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4025
	__cnt_gcData--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4026
       RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4027
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4028
       if (gcData->hBitmap) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4029
       {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4030
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4031
	    __cnt_bmpdc--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4032
	    RES_BMP_PRINTF(("free BmpDC %d\n",__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4033
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4034
       }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4035
       if (lastGcData == gcData)
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4036
       {
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4037
	 _releaseDC(lastGcData);
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4038
	 lastGcData = 0;
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  4039
       }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4040
       free(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4041
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4042
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4043
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4044
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4045
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4046
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4047
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4048
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4049
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4050
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4051
	if (bitmapHandle)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4052
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4053
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4054
	    __cnt_bitmap--;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4055
	    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
  4056
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4057
	    if( DelObject(bitmapHandle) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4058
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4059
		DPRINTF(("Bitmap deleted!\n"));
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
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4062
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4063
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4064
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4065
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4066
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4067
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4068
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4069
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4070
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4071
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4072
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4073
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4074
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4075
    struct gcData *gcData;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4076
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4077
    if (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4078
	hWnd = _HWNDVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4079
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4080
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4081
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4082
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4083
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4084
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4085
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4086
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4087
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4088
	gcData->_hDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4089
	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
  4090
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4091
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4092
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4093
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4094
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4095
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4096
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4097
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4098
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4099
    struct gcData *gcData;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4100
    BITMAP bitmap;
2000
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
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4103
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4104
	HDC hDC;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4105
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4106
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4107
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4108
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4109
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4110
	__cnt_bmpdc++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4111
	RES_BMP_PRINTF(("CreateBmpDC %d\n",__cnt_bmpdc));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4112
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4113
	if (GetObject(hBitmap,sizeof(bitmap),&bitmap))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4114
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4115
	    DPRINTF(("bitmap info:%d\n",bitmap.bmBitsPixel));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4116
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4117
	else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4118
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4119
	    DPRINTF(("noinfo returned\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4120
	}
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4121
	gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4122
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4123
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4124
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4125
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4126
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4127
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4128
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4129
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4130
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4131
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4132
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4133
primCreateBitmapFromArray:anArray width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4134
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4135
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4136
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4137
    HBITMAP newBitmapHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4138
    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
  4139
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4140
    unsigned char *cp, *bPits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4141
    unsigned char *b_bits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4142
    unsigned char *pBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4143
    int index;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4144
    OBJ num, *op;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4145
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4146
    unsigned char fastBits[10000];
2000
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
    if (! ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4149
	RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4150
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4151
*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4152
    if (__bothSmallInteger(w, h) && _isNonNilObject(anArray))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4153
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4154
	b_width = __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4155
	b_height = __intVal(h);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4156
	bytesPerRowST = (b_width + 7) / 8;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4157
	bytesPerRowWN = ((b_width + 15) / 16) * 2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4158
	padding = bytesPerRowWN - bytesPerRowST;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4159
	nBytes = b_height * bytesPerRowWN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4160
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4161
	if (nBytes < sizeof(fastBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4162
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4163
	    cp = b_bits = fastBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4164
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4165
	else
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
	    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4168
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4169
	if (cp)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4170
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4171
	  if (__qClass(anArray) == @global(Array))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4172
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4173
	      index = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4174
	      op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4175
	      for (row = b_height; row; row--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4176
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4177
		  for (col = bytesPerRowST; col; col--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4178
		  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4179
		      num = *op++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4180
		      if (! __isSmallInteger(num))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4181
			goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4182
		      *cp++ = __intVal(num);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4183
		  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4184
		  cp += padding;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4185
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4186
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4187
	  else if (__qClass(anArray) == @global(ByteArray))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4188
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4189
	      pBits = __ByteArrayInstPtr(anArray)->ba_element;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4190
	      for (row = b_height; row; row--)
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
		  for (col = bytesPerRowST; col; col--)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4193
		  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4194
		      *cp++ = ( *pBits++ /*^ 0xFF*/ );
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
		  cp += padding;
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
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4199
	  else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4200
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4201
	      goto fail;
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
	  DPRINTF(("create bitmap ...\n"));
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
	  newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, b_bits );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4206
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4207
	  if( newBitmapHandle )
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4208
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4209
#ifdef COUNT_BMP_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4210
	    __cnt_bitmap++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4211
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle,__cnt_bitmap));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4212
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4213
	    DPRINTF(("returning bitmap ...\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4214
	    if (allocatedBits)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4215
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4216
	      free(allocatedBits);
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
	    RETURN ( __MKOBJ(newBitmapHandle));
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
      }
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
fail: ;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4223
    PRINTF(("create bitmap FAILED!!!\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4224
    if (allocatedBits)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4225
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4226
      PRINTF(("freeing up bitmap bits ...\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4227
      free(allocatedBits);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4228
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4229
    DPRINTF(("returning nil ...\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4230
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4231
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4232
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4233
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4234
primCreateWindowFor:aView type:aSymbol
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4235
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4236
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4237
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4238
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4239
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4240
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4241
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4242
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4243
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4244
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4245
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4246
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4247
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4248
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4249
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4250
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4251
    HANDLE parentHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4252
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4253
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4254
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4255
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4256
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4257
    OBJ stClassName;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4258
    int isTopWindow = 0;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4259
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4260
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4261
    HBITMAP        xBitMap, maskBitmap;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4262
    int            height, width;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4263
    int            nBytes, nBits;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4264
    int            index;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4265
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4266
    SIZE           oldSize;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4267
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4268
    char *className;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4269
    unsigned char *allocatedBits = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4270
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4271
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4272
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4273
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4274
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4275
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4276
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4277
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4278
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4279
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4280
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4281
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4282
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4283
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4284
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4285
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4286
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4287
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4288
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4289
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4290
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4291
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4292
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4293
    /* get bitmap for icon */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4294
    if(  __isExternalAddress(wiconId) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4295
    {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4296
	xBitMap = _HBITMAPVAL( wiconId );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4297
	if( xBitMap != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4298
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4299
	  BITMAP bm;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4300
	  if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4301
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4302
	    int d = bm.bmPlanes * bm.bmBitsPixel;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4303
	    BYTE *ep;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4304
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4305
	    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
  4306
	    height = __intVal( wiconHeight );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4307
	    width  = __intVal( wiconWidth  );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4308
	    nBytes = ( width + 15 ) / 16;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4309
	    nBytes = height * nBytes * 2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4310
	    if (nBytes < sizeof(fastBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4311
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4312
		ep = fastBits;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4313
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4314
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4315
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4316
		ep = allocatedBits = (unsigned char *) malloc(nBytes);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4317
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4318
	    if ( ep != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4319
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4320
		memset(ep,0,nBytes);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4321
		maskBitmap = CreateBitmap(width, height, 1, 1, ep );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4322
		if( maskBitmap != NULL )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4323
		{
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4324
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4325
		    iconInfo.fIcon = TRUE;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4326
		    iconInfo.hbmMask  = maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4327
		    iconInfo.hbmColor = xBitMap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4328
		    xIcon = CreateIconIndirect( &iconInfo );
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4329
		    DPRINTF(( "ICON CREATED!!!\n" ));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4330
		    DelObject( maskBitmap );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4331
		} else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4332
		    DPRINTF(( "BITMAP mask CREATION failed!!!\n" ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4333
		}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4334
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4335
		PRINTF(( " malloc failed\n" ));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4336
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4337
	    if (allocatedBits)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4338
		free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4339
	  }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4340
	} else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4341
	    DPRINTF((" xBitMap is zero \n" ));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4342
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4343
    } else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4344
	if (wiconId == nil) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4345
	    DPRINTF((" wiconId is nil\n"));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4346
	} else {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4347
	    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
  4348
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4349
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4350
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4351
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4352
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4353
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4354
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4355
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4356
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4357
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4358
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4359
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4360
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4361
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4362
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4363
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4364
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4365
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4366
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4367
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4368
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4369
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4370
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4371
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4372
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4373
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4374
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4375
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4376
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4377
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4378
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  4379
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4380
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4381
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4382
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4383
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4384
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4385
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4386
	}
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
	bw = 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
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4391
    className = app_name;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4392
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4393
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4394
    if (__isString(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4395
	className = __stringVal(windowClass);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4396
    }
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4397
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4398
    if (__isString(windowClass)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4399
	if (__isInteger(wStyle)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4400
	    winStyleBits |= __longIntVal(wStyle);
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4401
	} else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4402
	    if (windowType == @symbol(RadioButton)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4403
		winStyleBits |= BS_RADIOBUTTON;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4404
	    } else if (windowType == @symbol(CheckBox)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4405
		winStyleBits |= BS_CHECKBOX;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4406
	    } else if (windowType == @symbol(HorizontalScrollbar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4407
		winStyleBits |= SBS_HORZ;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4408
	    } else if (windowType == @symbol(VerticalScrollBar)) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4409
		winStyleBits |= SBS_VERT;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4410
	    }
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4411
	}
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4412
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4413
#endif /* LATER */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4414
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4415
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4416
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4417
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4418
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4419
	parentHandle = _HANDLEVal(wsuperViewId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4420
	winStyleBits |= WS_CHILD;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4421
	if (winputOnly != true) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4422
	    winStyleBits |= (WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4423
	    /*winStyleBits |= WS_CLIPCHILDREN;*/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4424
	    DPRINTF(("parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4425
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4426
	    winEXStyleBits |= WS_EX_TRANSPARENT;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4427
	    DPRINTF(("inputview parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4428
	}
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4429
    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4430
	char buf[300];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4431
	char *stName;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4432
	static winCount;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4433
#   ifdef __BORLANDC__
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4434
	struct timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4435
	ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4436
#   else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4437
	struct _timeb timebuffer;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4438
	_ftime(&timebuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4439
#   endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4440
	if (__isString(stClassName)) {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4441
	    stName = __stringVal(stClassName);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4442
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4443
	    stName = app_name;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4444
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4445
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4446
	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
  4447
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4448
	 * a top window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4449
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4450
	parentHandle = NULL;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4451
	isTopWindow = 1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4452
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4453
#ifdef TOPWINDOWCLASS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4454
	DPRINTF(("topview - registerClass:%s\n",buf));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4455
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4456
	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
  4457
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4458
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4459
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4460
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4461
	if (xIcon) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4462
	    wc.hIcon   = xIcon;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4463
	    /* 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
  4464
	} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4465
	    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
  4466
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4467
	wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4468
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4469
	wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4470
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4471
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4472
	wc.lpszClassName = buf;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4473
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4474
	if (!RegisterClass(&wc)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4475
	    PRINTF(("RegisterClass failed\n"));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4476
	    RETURN( nil );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4477
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4478
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4479
	className = buf;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4480
#endif
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4481
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4482
	    winStyleBits |= WS_POPUP;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4483
	    winStyleBits |= WS_DISABLED;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4484
	    winEXStyleBits |= WS_EX_TOOLWINDOW;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  4485
	    CPRINTF(("Create popUpWindow\n"));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4486
	} else if (wStyle == @symbol(dialog)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4487
/*
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4488
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4489
*/
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4490
	    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
  4491
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4492
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4493
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4494
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  4495
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4496
	} else {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4497
	    //winStyleBits |= WS_OVERLAPPEDWINDOW;
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4498
	    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
  4499
	    //winEXStyleBits |= WS_EX_CLIENTEDGE;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4500
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4501
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4502
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4503
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4504
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4505
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4506
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4507
    rec.bottom = y+ h;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4508
    _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
  4509
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4510
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4511
    AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4512
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4513
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4514
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4515
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4516
    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
  4517
		((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
  4518
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4519
    /* allocate localMemory for Window */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4520
    _thread_local = (localWindowInfo*)malloc(sizeof(localWindowInfo));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4521
    if (_thread_local)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4522
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4523
      memset(_thread_local,0,sizeof(*_thread_local));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4524
      if (isTopWindow)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4525
      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4526
	if (rec.left < 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4527
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4528
	  rec.left = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4529
	  rec.right = w;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4530
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4531
	if (rec.top < 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4532
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4533
	  rec.top = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4534
	  rec.bottom = h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4535
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4536
	_thread_local->flag = LI_TOPWIN;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4537
      }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4538
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4539
      if (winputOnly == true)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4540
	  _thread_local->flag |= LI_INPUTWIN;
2000
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
      _thread_className = className;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4543
      _thread_winStyleBits = winStyleBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4544
      _thread_parentHandle = parentHandle;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4545
      _thread_x = rec.left;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4546
      _thread_y = rec.top;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4547
      _thread_dx = rec.right - rec.left;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4548
      _thread_dy = rec.bottom - rec.top;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4549
      rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4550
      rec.top = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4551
      rec.right = min_width;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4552
      rec.bottom = min_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4553
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4554
      AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4555
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4556
      _thread_local->minWidth = rec.right - rec.left;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4557
      _thread_local->minHeight = rec.bottom - rec.top;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4558
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4559
      rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4560
      rec.top = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4561
      rec.right = max_width;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4562
      rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4563
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4564
      AdjustWindowRectEx(&rec,winStyleBits,0,_thread_winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4565
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4566
      _thread_local->maxWidth = rec.right - rec.left;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4567
      _thread_local->maxHeight = rec.bottom - rec.top;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4568
      _thread_local->bgBrush = 0; /*GetStockObject(HOLLOW_BRUSH);*/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4569
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4570
      if (__isSmallInteger(eventMask))
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4571
	  _thread_local->eventMask = __intVal(eventMask);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4572
      else
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4573
	  _thread_local->eventMask = 0xffffffff;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4574
      DPRINTF(("eventMask is %x\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4575
#ifdef DEBUGMASK1
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4576
      printMask(_thread_local->eventMask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4577
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4578
      _thread_newWinHandle = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4579
      _thread_windowName = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4580
      if (isTopWindow)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4581
      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4582
	  if (__isString(wlabel) || __isSymbol(wlabel)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4583
	      _thread_windowName = (char *) __stringVal(wlabel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4584
	      DPRINTF(("title = %s\n", _thread_windowName));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4585
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4586
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4587
      PostThreadMessage(_dispatchThreadId,WM_THREADCREATEWINDOW,0,0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4588
      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4589
	DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4590
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4591
	/* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4592
	dwWaitResult = WaitForSingleObject(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4593
	  hCreateEvent,   /* handle of mutex */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4594
	  15000L);   /* time-out interval */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4595
      }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4596
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4597
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4598
    DPRINTF(("handle = %x\n", _thread_newWinHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4599
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4600
    if (! _thread_newWinHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4601
	DPRINTF(("handle is nil\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4602
	RETURN ( nil );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4603
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4604
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4605
    windowId = __MKOBJ(_thread_newWinHandle);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4606
    if (_thread_newWinHandle)
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4607
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4608
      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
  4609
#ifndef TOPWINDOWCLASS
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4610
      if (xIcon) 
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4611
      {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  4612
	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
  4613
	SendMessage(_thread_newWinHandle,WM_SETICON,ICON_BIG,(LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4614
      }
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4615
#endif      
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4616
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4617
    DPRINTF(("done - create\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4618
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4619
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4620
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4621
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4622
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4623
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4624
%{  /* xxLIMITEDSTACK (WIN95 only) */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4625
    HICON yIcon;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4626
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4627
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4628
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4629
	if (win && IsWindow(win))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4630
	{
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4631
#ifndef TOPWINDOWCLASS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4632
	   yIcon = (HICON)GetClassLong(_thread_newWinHandle,GCL_HICON);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4633
	   SetClassLong(_thread_newWinHandle,GCL_HICON,(DWORD)0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4634
	   /* 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
  4635
	   if( yIcon )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4636
	   {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  4637
		if( DestroyIcon( yIcon ) )
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4638
		    DPRINTF(( "Old icon deleted\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4639
	   }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  4640
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4641
	   /*printf("post WM_THREADDESTROYWINDOW\n");*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4642
	   PostMessage(win,WM_THREADDESTROYWINDOW,0,0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4643
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4644
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4645
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4646
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4647
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4648
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4649
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4650
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4651
     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
  4652
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4653
     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
  4654
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4655
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4656
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4657
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4658
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4659
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4660
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4661
    "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
  4662
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4663
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4664
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4665
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4666
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4667
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4668
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4669
    ^ self colorScaledRed:r scaledGreen:g scaledBlue:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4670
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4671
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4672
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4673
    "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
  4674
     (i.e. colorID)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4675
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4676
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4677
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4678
    if (__bothSmallInteger(r, g)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4679
     && __isSmallInteger(b))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4680
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4681
      id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4682
      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
  4683
      RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4684
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4685
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4686
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4687
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4688
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4689
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4690
freeColor:colorIndex
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4691
    "free a display color when its no longer needed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4692
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4693
    'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4694
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4695
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4696
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4697
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4698
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4699
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4700
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4701
    |val|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4702
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4703
    self getScaledRGBFrom:index into:[:r :g :b |
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4704
	val := aBlock
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4705
		value:(r * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4706
		value:(g * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4707
		value:(b * 100.0 / 16rFFFF)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4708
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4709
    'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4710
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4711
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4712
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4713
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4714
    "get rgb components (0..100) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4715
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4716
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4717
    |val|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4718
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4719
    self getScaledRGBFromName:colorName into:[:r :g :b |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4720
	r isNil ifTrue:[^nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4721
	val := aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4722
		value:(r * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4723
		value:(g * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4724
		value:(b * 100.0 / 16rFFFF)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4725
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4726
    ^val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4727
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4728
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4729
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4730
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4731
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4732
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4733
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4734
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4735
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4736
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4737
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4738
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4739
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4740
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4741
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4742
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4743
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4744
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4745
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4746
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4747
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4748
    b = __MKSMALLINT(iB);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4749
    /*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
  4750
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4751
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4752
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4753
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4754
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4755
    "get scaled rgb components (0..16rFFFF) of color named colorName,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4756
     and evaluate the 3-arg block, aBlock with them"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4757
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4758
    |triple r g b found|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4759
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4760
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4761
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4762
    (colorName startsWith:$#) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4763
	"/ color in r/g/b hex notation
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4764
	r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4765
	g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4766
	b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4767
	found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4768
    ] ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4769
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4770
	triple := StandardColorValues at:colorName asString ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4771
	triple isNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4772
	    triple := StandardColorValues at:colorName asString asLowercase ifAbsent:nil.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4773
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4774
	triple notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4775
	    r := triple at:1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4776
	    g := triple at:2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4777
	    b := triple at:3.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4778
	    found := true.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4779
	].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4780
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4781
    found ifFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4782
	('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4783
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4784
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4785
    ^ 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
  4786
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4787
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4788
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4789
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4790
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4791
     display-specific (here X-specific)."
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
    |aStream list line index colorName|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4794
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4795
    aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4796
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4797
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4798
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4799
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4800
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4801
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4802
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4803
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4804
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4805
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4806
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4807
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4808
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4809
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4810
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4811
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4812
		list add: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
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4815
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4816
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4817
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4818
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4819
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4820
     Screen current listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4821
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4822
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4823
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4824
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4825
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4826
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4827
    "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
  4828
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4829
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4830
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4831
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4832
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4833
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4834
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4835
    if (__isFloat(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4836
	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4837
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4838
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4839
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4840
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4841
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4842
setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4843
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4844
 'setColor:index scaledRed:sred scaledGreen:sgreen scaledBlue:sblue' printCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4845
^ self.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4846
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4847
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4848
    "Modified: 30.1.1998 / 09:30:22 / md"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4849
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4850
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4851
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4852
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4853
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4854
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4855
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4856
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4857
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4858
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4859
    "/ if you add something here, also add to #shapeNumberFromCursor ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4860
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4861
    ^ #(
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4862
	#upLeftArrow            "/ IDC_ARROW
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4863
	#upDownArrow            "/ IDC_SIZENS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4864
	#leftRightArrow         "/ IDC_SIZEWE
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4865
	#text                   "/ IDC_IBEAM
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4866
	#wait                   "/ IDC_WAIT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4867
	#execute                "/ IDC_APPSTARTING
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4868
	#crossHair              "/ IDC_CROSS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4869
	#fourWay                "/ IDC_SIZEALL
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4870
	#upRightHand            "/ IDC_ARROW
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  4871
       )
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4872
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4873
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4874
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4875
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4876
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4877
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4878
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4879
    number := self shapeNumberFromSymbol:aShape.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4880
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4881
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4882
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4883
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
  4884
    "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
  4885
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4886
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4887
     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
  4888
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4889
    cW := self class getSystemMetrics:#cursorWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4890
    cH := self class getSystemMetrics:#cursorHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4891
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4892
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4893
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4894
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4895
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4896
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4897
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4898
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4899
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4900
    bpl ~~ bplPadded ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4901
	 "/     'repad cursor bits' infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4902
	srcPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4903
	nB := bpl min: bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4904
	nR := cH min: h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4905
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4906
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4907
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4908
	    srcPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4909
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4910
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4911
		with:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4912
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4913
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4914
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4915
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4916
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4917
	maskPadded := ByteArray new:(bplPadded * cH).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4918
	dstOffs := srcOffs := 1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4919
	1 to:nR do:[:row |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4920
	    maskPadded
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4921
		replaceFrom:dstOffs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4922
		to:(dstOffs+nB-1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4923
		with:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4924
		startingAt:srcOffs.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4925
	    dstOffs := dstOffs + bplPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4926
	    srcOffs := srcOffs + bpl.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4927
	].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4928
	src := srcPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4929
	mask := maskPadded.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4930
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4931
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4932
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4933
    1 to:src size do:[:index |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4934
	src byteAt:index put:((src byteAt:index) bitAnd:(mask byteAt:index)).
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4935
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4936
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4937
    cursor := self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4938
	primCreateCursorSourceBits:src
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4939
	maskBits:mask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4940
	hotX:hx hotY:hy
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4941
	width:cW height:cH.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4942
    cursor notNil ifTrue:[  ^ cursor ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4943
    self halt.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4944
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4945
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4946
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4947
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4948
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4949
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4950
destroyCursor:aCursorId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4951
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4952
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4953
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4954
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4955
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4956
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4957
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4958
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4959
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4960
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4961
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4962
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4963
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4964
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4965
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4966
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4967
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4968
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4969
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4970
		 && (curs != H_C_UPARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4971
		 && (curs != H_C_WAIT)) 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4972
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4973
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4974
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4975
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4976
	    __cnt_cur--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4977
	    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4978
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4979
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4980
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4981
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4982
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4983
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4984
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4985
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4986
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4987
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4988
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4989
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4990
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4991
primCreateCursorShapeNr:number
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4992
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4993
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4994
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4995
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4996
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4997
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4998
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4999
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5000
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  5001
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5002
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5003
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5004
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5005
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5006
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5007
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5008
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5009
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5010
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5011
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5012
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5013
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5014
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5015
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5016
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5017
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5018
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5019
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5020
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5021
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5022
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5023
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5024
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5025
		H_C_WAIT = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5026
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5027
	    RETURN ( __MKOBJ(newCursor) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5028
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5029
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5030
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5031
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5032
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5033
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5034
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
  5035
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5036
%{  /* xxLIMITEDSTACK (WIN95) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5037
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5038
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5039
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5040
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5041
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5042
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5043
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5044
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5045
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5046
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5047
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5048
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5049
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5050
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5051
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5052
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5053
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5054
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5055
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5056
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5057
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5058
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5059
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5060
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5061
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5062
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5063
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5064
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5065
    "this is pure Win-knowlegde - but you may easily add more"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5066
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5067
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5068
    if (shape == @symbol(upRightHand)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5069
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5070
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5071
    if (shape == @symbol(upLeftArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5072
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5073
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5074
    if (shape == @symbol(upDownArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5075
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5076
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5077
    if (shape == @symbol(leftRightArrow)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5078
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5079
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5080
    if (shape == @symbol(text)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5081
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5082
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5083
    if (shape == @symbol(wait)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5084
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
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
    if (shape == @symbol(crossHair)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5087
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5088
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5089
    if (shape == @symbol(fourWay)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5090
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5091
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5092
    if (shape == @symbol(execute)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5093
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5094
    }
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
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5097
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5098
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5099
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5100
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5101
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5102
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
  5103
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5104
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5105
     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
  5106
     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
  5107
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5108
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5109
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5110
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5111
    struct gcData *dstGcData = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5112
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5113
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5114
    HDC dstDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5115
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5116
    if (__isExternalAddress(srcGCId))
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
	srcGcData = _GCDATA(srcGCId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5119
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5120
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5121
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5122
	goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5123
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5124
    if (__isExternalAddress(dstGCId)) {
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5125
	dstGcData = _GCDATA(dstGCId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5126
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5127
    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5128
    {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5129
	goto fail;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5130
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5131
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5132
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5133
     && __bothSmallInteger(srcX, srcY)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5134
     && __bothSmallInteger(dstX, dstY))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5135
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5136
	int fun = BITBLT_COPY;
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5137
	if (srcGcData && dstGcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5138
	{
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5139
	  fun = dstGcData->bitbltrop2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5140
#if 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5141
	  switch (fun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5142
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5143
	    case BITBLT_COPY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5144
	      printf("BITBLT_COPY\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5145
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5146
	    case BITBLT_COPYINVERTED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5147
	      printf("BITBLT_COPYINVERTED\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5148
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5149
	    case BITBLT_XOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5150
	      printf("BITBLT_XOR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5151
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5152
	    case BITBLT_AND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5153
	      printf("BITBLT_AND\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5154
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5155
	    case BITBLT_OR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5156
	      printf("BITBLT_OR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5157
	      break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5158
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5159
#endif
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5160
	  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
  5161
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5162
	    RECT rec,uprec;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5163
	    rec.left = __intVal(srcX);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5164
	    rec.top = __intVal(srcY);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5165
	    rec.right = rec.left + __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5166
	    rec.bottom = rec.top + __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5167
	    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
  5168
	    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
  5169
	    UpdateWindow(srcGcData->hWnd);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5170
	    if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5171
	      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
  5172
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5173
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5174
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5175
	  if (srcGcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5176
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5177
	      /*printf("src is HWND %x\n",srcGcData->hWnd);*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5178
	  }
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5179
	  fun = dstGcData->bitbltrop2;
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5180
	  if ((srcGcData == dstGcData) && (fun == BITBLT_COPY))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5181
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5182
	    RECT rec,uprec;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5183
	    rec.left = __intVal(srcX);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5184
	    rec.top = __intVal(srcY);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5185
	    rec.right = rec.left + __intVal(w);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5186
	    rec.bottom = rec.top + __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5187
	    srcDC = _getDC(srcGcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5188
	    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
  5189
	    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
  5190
	    _releaseDC(srcGcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5191
	    RETURN ( self );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5192
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5193
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5194
	  else
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5195
	  {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5196
	    srcDC = _getDC(srcGcData);
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5197
	    dstDC = _getDC(dstGcData);
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5198
	    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
  5199
	    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
  5200
	    if (BitBlt(dstDC,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5201
		 __intVal(dstX), __intVal(dstY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5202
		 __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5203
		 srcDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5204
		 __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5205
		 fun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5206
	       == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5207
	      )
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5208
	      {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5209
		 printf("ERROR in BitBlt\n");
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5210
	      }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5211
	  }
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5212
	  _releaseDC(dstGcData);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5213
	  _releaseDC(srcGcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5214
	  RETURN ( self );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5215
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5216
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  5217
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5218
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5219
%}.
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  5220
 self primitiveFailed.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5221
 ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5222
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5223
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5224
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5225
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
  5226
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5227
    "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
  5228
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5229
     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
  5230
     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
  5231
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5232
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5233
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5234
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5235
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5236
		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
  5237
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5238
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5239
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5240
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
  5241
    "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
  5242
     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
  5243
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5244
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5245
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5246
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5247
    double f;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5248
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5249
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5250
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5251
    else if (__isFloat(startAngle)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5252
	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
  5253
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5254
	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
  5255
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5256
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5257
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5258
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5259
    else if (__isFloat(angle)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5260
	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
  5261
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5262
	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
  5263
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5264
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5265
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5266
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5267
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5268
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5269
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5270
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5271
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5272
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5273
	HPEN hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5274
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5275
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5276
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5277
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5278
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5279
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5280
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5281
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5282
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5283
	    DPRINTF(("displayArc: no pen\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5284
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5285
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5286
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5287
	    double xB, yB, xE, yE, xR, yR;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5288
	    HPEN hSavePen = SelectObject(hDC, hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5289
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5290
	    yR = h / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5291
	    if (angle2 - angle1 >= 360)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5292
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5293
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5294
		yB = yE = __y /*+ yR + 0.5*/;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5295
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5296
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5297
	    {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5298
		double sin(), cos();
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5299
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5300
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5301
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5302
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5303
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5304
		/* sigh - compute the intersections ... */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5305
		xB = (cos((angle1 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5306
		yB = (sin((angle1 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5307
		xE = (cos((angle2 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5308
		yE = (sin((angle2 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5309
		xB = __x + xR - xB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5310
		yB = __y + yR - yB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5311
		xE = __x + xR - xE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5312
		yE = __y + yR - yE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5313
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5314
	    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
  5315
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5316
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5317
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5318
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5319
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5320
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5321
	    SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5322
	    DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5323
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5324
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5325
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5326
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5327
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5328
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5329
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5330
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5331
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5332
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
  5333
    "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
  5334
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5335
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5336
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5337
     /*&& __isExternalAddress(aDrawableId)*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5338
     && __bothSmallInteger(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5339
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5340
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5341
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5342
	HPEN hPen;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5343
	HDC hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5344
/*      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
  5345
		    __intVal(x0), __intVal(y0),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5346
		    __x1, __y1,_HWNDVal(aDrawableId)));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5347
*/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5348
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5349
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5350
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5351
	    HPEN hSavePen = SelectObject(hDC, hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5352
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5353
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5354
	    LineTo(hDC, __x1, __y1);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5355
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5356
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5357
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5358
	    LineTo(hDC, __x1+1, __y1);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5359
	    SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5360
	    DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5361
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5362
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5363
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5364
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5365
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5366
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5367
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5368
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
  5369
    "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
  5370
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5371
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5372
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5373
     && __isExternalAddress(aDrawableId)
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5374
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5375
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5376
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5377
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5378
	HPEN hPen;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5379
	int __x = __intVal(px), __y = __intVal(py);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5380
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5381
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5382
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5383
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5384
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5385
	    HPEN hSavePen = SelectObject(hDC, hPen);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5386
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5387
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5388
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5389
	     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5390
	    LineTo(hDC, __x+1, __y);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5391
	    SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5392
	    DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5393
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5394
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5395
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5396
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5397
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5398
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5399
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5400
displayPolygon:aPolygon in:aDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5401
    "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
  5402
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5403
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5404
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5405
    |numberOfPoints |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5406
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5407
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5408
    self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5409
	primDisplayPolygon:aPolygon n:numberOfPoints
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5410
	in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5411
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5412
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5413
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
  5414
    "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
  5415
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5416
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5417
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5418
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5419
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5420
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5421
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5422
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5423
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5424
	HDC hDC = _getDC(gcData);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5425
	HPEN hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5426
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5427
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5428
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5429
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5430
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5431
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5432
	DPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5433
			xL, yT, w, h));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5434
	/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5435
	 * 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
  5436
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5437
	if ((w >= 0) && (h >= 0)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5438
	    if (!(hPen = GcDataGetPen(hDC,gcData))) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5439
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5440
	    } else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5441
		HPEN hSavePen = SelectObject(hDC, hPen);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5442
		MoveToEx(hDC, xL, yT, NULL);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5443
		LineTo(hDC, xL+w-1, yT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5444
		LineTo(hDC, xL+w-1, yT+h-1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5445
		LineTo(hDC, xL, yT+h-1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5446
		LineTo(hDC, xL, yT);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5447
		SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5448
		DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5449
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5450
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5451
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5452
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5453
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5454
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5455
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5456
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5457
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
  5458
    "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
  5459
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5460
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5461
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5462
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5463
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5464
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5465
    int  i1, i2, l, n;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5466
#   define NLOCALBUFFER 200
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5467
    short xlatebuffer[NLOCALBUFFER];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5468
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5469
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5470
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5471
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5472
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5473
     && __bothSmallInteger(index1, index2)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5474
     && __bothSmallInteger(x, y)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5475
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5476
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5477
	int pX, pY;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5478
	HDC hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5479
	HFONT hOldFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5480
	pX = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5481
	pY = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5482
	pY -= gcData->fontAscent;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5483
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5484
	cls = __qClass(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5485
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5486
	i1 = __intVal(index1) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5487
	if (i1 >= 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5488
	    i2 = __intVal(index2) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5489
	    if (i2 < i1) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5490
		goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5491
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5492
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5493
	    cp = _stringVal(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5494
	    l = i2 - i1 + 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5495
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5496
	    if ((cls == @global(String)) || (cls == @global(Symbol))) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5497
	    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5498
		n = _stringSize(aString);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5499
		if (i2 < n) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5500
		{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5501
		    cp += i1;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  5502
		    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
  5503
		    if (opaque == true) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5504
			SetBkMode(hDC, OPAQUE);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5505
		    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5506
			SetBkMode(hDC, TRANSPARENT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5507
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5508
		    hOldFont = SelectObject(hDC, gcData->hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5509
		    SetTextColor(hDC, gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5510
		    SetBkColor(hDC, gcData->bgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5511
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5512
		    if (!TextOut(hDC, pX, pY, (char *)cp, l))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5513
		    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5514
		       PRINTF(("Textout failed. %d\n",GetLastError()));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5515
		    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5516
		    SelectObject(hDC, hOldFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5517
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5518
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5519
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5520
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5521
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5522
	    cp += nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5523
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5524
	    if (__isBytes(aString)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5525
	    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5526
		n = __byteArraySize(aString) - nInstBytes - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5527
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5528
		if (i2 < n) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5529
		{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5530
		    cp += i1;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  5531
		    DDPRINTF(("string: %s pos=%d/%d\n", cp, pX, pY));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5532
		    if (opaque == true) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5533
			SetBkMode(hDC, OPAQUE);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5534
		    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5535
			SetBkMode(hDC, TRANSPARENT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5536
		    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5537
		    hOldFont = SelectObject(hDC, gcData->hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5538
		    SetTextColor(hDC, gcData->fgColor);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5539
		    SetBkColor(hDC, gcData->bgColor);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5540
		    TextOut(hDC, pX, pY, (char *)cp, l);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5541
		    SelectObject(hDC, hOldFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5542
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5543
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5544
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5545
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5546
#ifdef NOTDEF 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5547
	    /* TWOBYTESTRINGS */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5548
	    if (__isWords(aString)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5549
		n = (__byteArraySize(aString) - nInstBytes) / 2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5550
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5551
		if (i2 < n) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5552
		    union {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5553
			char b[2];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5554
			unsigned short s;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5555
		    } u;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5556
		    int i;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5557
		    XChar2b *cp2 = (XChar2b *)0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5558
		    int mustFree = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5559
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5560
		    cp += (i1 * 2);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5561
		    if (l > 1000) l = 1000;
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
		     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5565
		     * X expects them MSB first
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5566
		     * convert as required
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5567
		     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5568
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5569
		    u.s = 0x1234;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5570
		    if (u.b[0] != 0x12) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5571
			if (l <= NLOCALBUFFER) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5572
			    cp2 = xlatebuffer;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5573
			} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5574
			    cp2 = (XChar2b *)(malloc(l * 2));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5575
			    mustFree = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5576
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5577
			for (i=0; i<l; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5578
			    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5579
			    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5580
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5581
			cp = (char *) cp2;
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5584
		    if (opaque == true)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5585
			XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5586
		    else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5587
			XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5588
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5589
		    if (mustFree) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5590
			free(cp2);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5591
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5592
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5593
		    goto ret; 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5594
		}
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
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5597
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5598
ret:   
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5599
	_releaseDC(gcData); 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5600
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5601
#undef NLOCALBUFFER
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5602
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5603
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5604
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5605
drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5606
			  width:imageWidth height:imageHeight
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5607
			      x:srcx y:srcy
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5608
			   into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5609
			      x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5610
			  width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5611
			   with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5612
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5613
    "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
  5614
     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
  5615
     Individual source pixels have bitsPerPixel bits, allowing to draw
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5616
     depth and pixel-units to be different.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5617
     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
  5618
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5619
     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
  5620
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5621
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5622
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5623
     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
  5624
     an unlimited stack, and thus cannot send primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5625
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5626
    (self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5627
					width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5628
					     x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5629
					  into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5630
					     x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5631
					 width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5632
					  with:aGCId)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5633
    ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5634
	"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5635
	 also happens, if a segmentation violation occurs in the
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5636
	 XPutImage ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5637
	"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5638
	self primitiveFailed
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5639
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5640
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5641
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5642
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
  5643
	       in:aDrawableId with:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5644
    "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
  5645
     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
  5646
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5647
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5648
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5649
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5650
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5651
    if (__isSmallInteger(startAngle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5652
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5653
    else if (__isFloat(startAngle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5654
	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
  5655
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5656
	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
  5657
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5658
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5659
    if (__isSmallInteger(angle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5660
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5661
    else if (__isFloat(angle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5662
	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
  5663
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  5664
	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
  5665
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5666
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5667
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5668
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5669
     && __bothSmallInteger(x, y)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5670
     && __bothSmallInteger(width, height)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5671
     {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5672
	struct gcData *gcData = _GCDATA(aGCId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5673
	HDC hDC;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5674
	HBRUSH hBrush;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5675
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5676
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5677
	h = __intVal(height);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5678
	__x = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5679
	__y = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5680
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5681
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5682
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5683
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5684
	    DPRINTF(("fillArc: no brush\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5685
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5686
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5687
	{
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5688
	  HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5689
	  HPEN hPen = 0;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5690
	  HPEN hSavePen;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5691
	  if (__isWinNT)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5692
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5693
	    if (!(hPen = GcDataGetPen(hDC,gcData)))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5694
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5695
	      DPRINTF(("displayArc: no pen\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5696
	      goto failpen;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5697
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5698
	    hSavePen = SelectObject(hDC, hPen);
2232
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
	  else
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
	    SelectObject(hDC,GetStockObject(NULL_PEN));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5703
	    w++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5704
	    h++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5705
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5706
	  {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5707
	    double xB, yB, xE, yE, xR, yR;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5708
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5709
	    yR = h / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5710
	    if (angle2 - angle1 >= 360)
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
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5713
		yB = yE = __y /*+ yR + 0.5*/;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5714
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5715
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5716
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5717
		double sin(), cos();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5718
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5719
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5720
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5721
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5722
		angle2 = angle1 - angle2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5723
		/* sigh - compute the intersections ... */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5724
		xB = (cos((angle1 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5725
		yB = (sin((angle1 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5726
		xE = (cos((angle2 * 3.14159265359) / 180.0)*xR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5727
		yE = (sin((angle2 * 3.14159265359) / 180.0)*yR);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5728
		xB = __x + xR - xB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5729
		yB = __y + yR - yB+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5730
		xE = __x + xR - xE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5731
		yE = __y + yR - yE+0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5732
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5733
	    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
  5734
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5735
	    Pie(hDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5736
		__x, __y,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5737
		__x + w, __y + h,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5738
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5739
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5740
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5741
	    if (hPen) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5742
	      SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5743
	      DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5744
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5745
	  }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5746
failpen:
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5747
	  SelectObject(hDC,hSaveBrush);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5748
	  DelObject(hBrush);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5749
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5750
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5751
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5752
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5753
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5754
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  5755
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5756
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5757
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5758
fillPolygon:aPolygon in:aDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5759
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5760
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5761
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5762
    |numberOfPoints|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5763
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5764
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5765
    self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5766
	primFillPolygon:aPolygon n:numberOfPoints 
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5767
	in:aDrawableId with:aGCId
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5770
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
  5771
    "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
  5772
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5773
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5774
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5775
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5776
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5777
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5778
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5779
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5780
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5781
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5782
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5783
	/*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
  5784
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5785
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5786
	 * 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
  5787
	 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5788
	if ((w >= 0) && (h >= 0))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5789
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5790
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5791
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5792
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5793
	    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5794
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5795
	    hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5796
	    hBrush = GcDataGetBrush(hDC,gcData);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5797
	    if (! hBrush)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5798
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5799
		PRINTF(("fillRectangle: no brush\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5800
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5801
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5802
	    {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5803
	      HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5804
	      rct.left = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5805
	      rct.top = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5806
	      rct.right = rct.left + w + 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5807
	      rct.bottom = rct.top + h + 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5808
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5809
	      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
  5810
	      SelectObject(hDC, GetStockObject(NULL_PEN));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5811
	      Rectangle(hDC,rct.left,rct.top,rct.right,rct.bottom);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5812
	      SelectObject(hDC,hSaveBrush);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5813
	      DelObject(hBrush);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5814
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5815
	    _releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5816
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5817
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5818
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5819
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5820
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5821
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5822
primDisplayPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5823
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5824
%{  /* xxLIMITEDSTACK (WIN95 only) */
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5825
    OBJ point, px, py;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5826
    int i, num;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5827
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5828
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5829
     && __isExternalAddress(aDrawableId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5830
     && __isSmallInteger(numberOfPoints)) {
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  5831
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5832
	HDC hDC = _getDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5833
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5834
	HPEN hPen;
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
	num = __intVal(numberOfPoints);
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
	for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5839
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5840
	    if (! __isPoint(point)) goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5841
	    px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5842
	    py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5843
	    if (! __bothSmallInteger(px, py))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5844
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5845
		_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5846
		goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5847
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5848
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5849
	if (!(hPen = GcDataGetPen(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5850
	    DPRINTF(("displayPolygon: no pen\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5851
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5852
	    HPEN hSavePen = SelectObject(hDC, hPen);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5853
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5854
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5855
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5856
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5857
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5858
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5859
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5860
		    p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5861
		    p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5862
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5863
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5864
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5865
			LineTo(hDC, p.x, p.y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5866
			/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5867
			 * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5868
			 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5869
			LineTo(hDC, p.x+1, p.y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5870
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5871
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5872
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5873
	    SelectObject(hDC,hSavePen);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  5874
	    DelObject(hPen);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5875
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5876
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5877
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5878
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5879
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5880
fail: ;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5881
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5882
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5883
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5884
primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth padding:padd
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5885
			      width:imageWidth height:imageHeight
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5886
				  x:srcx y:srcy
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5887
			       into:aDrawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5888
				  x:dstx y:dsty
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5889
			      width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5890
			       with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5891
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5892
    "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
  5893
     (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
  5894
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5895
%{  /* xxLIMITEDSTACK */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5896
    unsigned char fastBits[10000];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5897
    unsigned char *b_bits = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5898
    unsigned char *allocatedBits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5899
    struct gcData *gcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5900
    HDC hDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5901
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5902
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5903
     && __isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5904
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5905
     && __bothSmallInteger(srcx, srcy)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5906
     && __bothSmallInteger(dstx, dsty)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5907
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5908
     && __bothSmallInteger(imageWidth, imageHeight)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5909
     && __bothSmallInteger(imageDepth, bitsPerPixel)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5910
     && __isSmallInteger(padd)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5911
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5912
     {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5913
	struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5914
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5915
	  BITMAPINFOHEADER bmiHeader;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5916
	  DWORD r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5917
	  DWORD g;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5918
	  DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5919
	} bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5920
	gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5921
	if (! gcData )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5922
	    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5923
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5924
	DDPRINTF(("hDC = %x\n", hDC));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5925
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5926
	if (__intVal(padd) != WIN32PADDING)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5927
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5928
	  int row, col;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5929
	  unsigned char *cp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5930
	  unsigned char *pBits;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5931
	  int b_width, b_height, bytesPerRowST, bytesPerRowWN, padding, nBytes;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5932
	  int bi = __intVal(bitsPerPixel);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5933
	  b_width = __intVal(w);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5934
	  b_height = __intVal(h);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5935
	  bytesPerRowST = (b_width * bi + (__intVal(padd)-1)) / __intVal(padd);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5936
	  bytesPerRowWN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5937
	  padding = bytesPerRowWN - bytesPerRowST;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5938
	  nBytes = b_height * bytesPerRowWN;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5939
	  /*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
  5940
	  if (padding)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5941
	  {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5942
	    if (nBytes < sizeof(fastBits))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5943
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5944
		cp = b_bits = fastBits;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5945
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5946
	    else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5947
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5948
		cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5949
	    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5950
	    if (cp)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5951
	    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5952
		pBits = __ByteArrayInstPtr(imageBits)->ba_element;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5953
		for (row = b_height; row; row--)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5954
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5955
		    for (col = bytesPerRowST; col; col--)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5956
		    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5957
			*cp++ = ( *pBits++ );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5958
		    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5959
		    cp += 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
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5962
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5963
	      goto fail;
2151
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
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5966
	if (b_bits == 0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5967
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5968
	   b_bits = __ByteArrayInstPtr(imageBits)->ba_element;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5969
	}
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
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5972
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5973
	bitmap.bmiHeader.biPlanes = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5974
	if (__intVal(imageDepth) == 24)
2151
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
	  /*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5977
	  bitmap.r = 0xff0000;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5978
	  bitmap.g = 0x00ff00;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5979
	  bitmap.b = 0x0000ff;*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5980
	  bitmap.bmiHeader.biCompression = BI_RGB;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5981
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5982
	else if (__intVal(imageDepth) == 16)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5983
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5984
	  /*bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5985
	  bitmap.bmiHeader.biCompression = BI_BITFIELDS;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5986
	  bitmap.b = 0x001f;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5987
	  bitmap.g = 0x07e0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5988
	  bitmap.r = 0xf800;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5989
	  bitmap.b = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5990
	  bitmap.g = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5991
	  bitmap.r = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5992
	  bitmap.bmiHeader.biCompression = BI_RGB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5993
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5994
	bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5995
	bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5996
	bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5997
	bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5998
	bitmap.bmiHeader.biClrImportant = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  5999
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6000
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6001
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6002
	/*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
  6003
	SetDIBitsToDevice(hDC,__intVal(dstx),__intVal(dsty),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6004
			      __intVal(w), __intVal(h),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6005
			      __intVal(srcx), __intVal(srcy),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6006
			      0,__intVal(h),
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6007
			      (void *)b_bits,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6008
			      (BITMAPINFO*)&bitmap,DIB_RGB_COLORS);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6009
	if (allocatedBits)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6010
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6011
	  free(allocatedBits);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6012
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6013
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6014
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6015
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6016
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6017
fail: ;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6018
    PRINTF(("create temp bitmap FAILED!!!\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6019
    if (allocatedBits)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6020
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6021
      PRINTF(("freeing up temp bitmap bits ...\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6022
      free(allocatedBits);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6023
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6024
    if (gcData && hDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6025
	_releaseDC(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6026
%}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6027
.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6028
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6029
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6030
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6031
primFillPolygon:aPolygon n:numberOfPoints in:aDrawableId with:aGCId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6032
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6033
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6034
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6035
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6036
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6037
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6038
     && __isExternalAddress(aDrawableId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6039
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6040
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6041
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6042
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6043
	HBRUSH hBrush;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6044
        
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6045
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6046
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6047
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6048
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6049
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6050
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6051
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6052
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6053
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6054
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6055
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6056
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6057
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6058
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6059
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6060
	if (!(hBrush = GcDataGetBrush(hDC,gcData))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6061
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6062
	} else {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6063
	    HBRUSH hSaveBrush = SelectObject(hDC, hBrush);
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6064
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6065
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6066
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6067
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6068
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6069
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6070
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6071
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6072
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6073
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6074
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6075
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6076
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6077
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6078
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6079
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6080
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6081
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6082
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6083
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  6084
	    FillPath(hDC);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6085
	    SelectObject(hDC,hSaveBrush);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6086
	    DelObject(hBrush);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6087
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6088
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6089
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6090
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6091
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6092
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6093
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6094
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6095
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6096
!WinWorkstation methodsFor:'event forwarding'!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6097
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6098
fontChange
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6099
    "the system fonts (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6100
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6101
     TODO: Tell the viewStyle to update itself,
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6102
	   and tell all views to reinit their style.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6103
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6104
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6105
    'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6106
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6107
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6108
queryEndSession
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6109
    "system is about to be shut down.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6110
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6111
     TODO: Tell all views to close themself.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6112
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6113
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6114
    'WinWorkstation [info]: queryEndSession ignored for now.' infoPrintCR
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6115
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6116
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  6117
systemColorChange:aWindowId
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6118
    "the system colors (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]: systemColorChange 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
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6127
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6128
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6129
configEventProcessedFor:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6130
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6131
    if (__isExternalAddress(aWindowId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6132
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6133
      HWND hWnd = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6134
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6135
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6136
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6137
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6138
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6139
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6140
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6141
     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
  6142
     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
  6143
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6144
     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
  6145
     handled.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6146
     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
  6147
	      pending event before calling this."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6148
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6149
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6150
	AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6151
	    ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6152
	] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6153
	    self dispatchLastEvent.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6154
	]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6155
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6156
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6157
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6158
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6159
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6160
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6161
    "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
  6162
     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
  6163
     otherwise only events for the view with given id are processed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6164
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6165
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6166
!
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
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6169
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6170
     eventType|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6171
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6172
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6173
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6174
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6175
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6176
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6177
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6178
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6179
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6180
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6181
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6182
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6183
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6184
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6185
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6186
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6187
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6188
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6189
    static struct inlineCache mot = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6190
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6191
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6192
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6193
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6194
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6195
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6196
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6197
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6198
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6199
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6200
    static struct inlineCache vis = _ILC1;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  6201
    static struct inlineCache sysClrChg = _ILC1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6202
    static struct inlineCache fontChg = _ILC0;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6203
    static struct inlineCache qEndSess = _ILC0;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6204
    static struct inlineCache powerDown = _ILC0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6205
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6206
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6207
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6208
    int isDown = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6209
    int state;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6210
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6211
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6212
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6213
    HWND hWnd = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6214
    DDPRINTF(("dispatchLast\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6215
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6216
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6217
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6218
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6219
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6220
    } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6221
	printf("DISPLAY: no eventBuffer\n");
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6222
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6223
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6224
    if (ev)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6225
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6226
      _ev_buf = *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6227
      ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6228
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6229
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6230
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6231
	DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6232
	RETURN (false);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6233
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6234
    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6235
	OBJ t;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6236
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6237
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6238
	 * 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
  6239
	 * avoid creation & lookup then.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6240
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6241
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6242
	if ((t = __INST(lastId)) != nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6243
	    if (__isExternalAddress(t)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6244
		if (_HWNDVal(t) == hWnd) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6245
		    theView = __INST(lastView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6246
		    if (__isNonNilObject(theView)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6247
			if (__qClass(theView) == nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6248
			    theView = nil;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6249
			}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6250
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6251
		}
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
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6254
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6255
	if (theView == nil) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6256
	    windowID = __MKOBJ(ev->ev_hWnd);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6257
	    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
  6258
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6259
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6260
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6261
    if (theView == nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6262
	DPRINTF(("nil view [hWnd=%x] in dispatchEvent\n", ev->ev_hWnd));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6263
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6264
	RETURN (false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6265
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6266
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6267
    switch (ev->ev_message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6268
#if 1
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6269
	    case WM_WINDOWPOSCHANGED:
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
		RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6272
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6273
		DPRINTF((">>> WM_WINDOWPOSCHANGED -> configureX:y:width:height:view:\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6274
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6275
		x = ev->ev_x;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6276
		y = ev->ev_y;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6277
		w = ev->ev_w;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6278
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6279
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6280
		/*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
  6281
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6282
		(*conf.ilc_func)(self,
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6283
			     @symbol(configureX:y:width:height:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6284
			     nil, &conf,
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6285
			     __MKSMALLINT(x),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6286
			     __MKSMALLINT(y),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6287
			     __MKSMALLINT(w),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6288
			     __MKSMALLINT(h),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6289
			     theView);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6290
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6291
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6292
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6293
	    case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6294
		if (ev->ev_wParam == TRUE) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6295
		    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6296
		    arg = @symbol(unobscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6297
		    (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6298
		    (*map.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6299
				     @symbol(mappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6300
				     nil, &map, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6301
		} else {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6302
		    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6303
		    arg = @symbol(fullyObscured);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6304
		    (*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
  6305
		    (*unmap.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6306
				       @symbol(unmappedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6307
				       nil, &unmap, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6308
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6309
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6310
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6311
	    case WM_CLOSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6312
		    (*termS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6313
				      @symbol(terminateView:), nil, &termS, theView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6314
		    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6315
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6316
	    case WM_DESTROY:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6317
		DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6318
		(*destr.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6319
				   @symbol(destroyedView:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6320
				   nil, &destr, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6321
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6322
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6323
	    case WM_ACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6324
		DPRINTF((">>> WM_ACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6325
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6326
		switch (LOWORD(ev->ev_wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6327
		    case WA_INACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6328
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6329
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6330
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6331
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6332
					false,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6333
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6334
			break;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6335
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6336
		    case WA_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6337
		    case WA_CLICKACTIVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6338
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6339
					@symbol(activate:view:),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6340
					nil,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6341
					&act,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6342
					true,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6343
					theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6344
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6345
		    default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6346
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6347
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6348
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6349
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6350
	    case WM_MOUSEACTIVATE:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6351
		DPRINTF((">>> WM_MOUSEACTIVATE h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6352
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6353
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6354
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6355
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6356
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6357
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6358
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6359
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6360
	    case WM_SETFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6361
		DPRINTF((">>> WM_SETFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6362
		(*focIn.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6363
				   @symbol(focusInView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6364
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6365
				   &focIn,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6366
				   theView);
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_KILLFOCUS:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6370
		DPRINTF((">>> WM_KILLFOCUS h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6371
		(*focOut.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6372
				   @symbol(focusOutView:),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6373
				   nil,
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6374
				   &focOut,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6375
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6376
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6377
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6378
	    case __WM_GEXPOSE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6379
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6380
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6381
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6382
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6383
		(*gexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6384
			 @symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6385
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6386
			 __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6387
			 __MKSMALLINT(w),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6388
			 __MKSMALLINT(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6389
			 true,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6390
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6391
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6392
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6393
	    case __WM_NOGEXPOSE:
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6394
		 (*nexpS.ilc_func)(self,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6395
			 @symbol(noExposeView:), nil, &nexpS,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6396
			 theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6397
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6398
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6399
	    case WM_PAINT:
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6400
		{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6401
		  RECT rec;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6402
		  HDC dc = (HDC)GetDC(ev->ev_hWnd);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6403
		  HBRUSH br = CreateSolidBrush(st2RGB(GetWindow_bgBrush(ev->ev_hWnd),0));
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6404
		  if (br)
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6405
		  {
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6406
		    rec.left = ev->ev_x;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6407
		    rec.top = ev->ev_y;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6408
		    rec.right = ev->ev_w;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6409
		    rec.bottom = ev->ev_h;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  6410
		    //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
  6411
		    SelectClipRgn(dc,0);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6412
		    FillRect(dc, &rec, br);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6413
		    DelObject(br);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6414
		  }
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6415
		  ReleaseDC(ev->ev_hWnd,dc);
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  6416
		}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6417
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6418
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6419
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6420
		h = ev->ev_h;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6421
		/*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
  6422
	    /*expose:*/
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6423
		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
  6424
		(*exp.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6425
			 @symbol(exposeX:y:width:height:view:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6426
			 nil, &exp,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6427
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6428
			 __MKSMALLINT(y),
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  6429
			 __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
  6430
			 __MKSMALLINT((h - y + 1)),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6431
			 theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6432
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6433
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6434
	    case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6435
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6436
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6437
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6438
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6439
	    case WM_LBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6440
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6441
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6442
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6443
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6444
	    case WM_LBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6445
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6446
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6447
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6448
	    case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6449
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6450
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6451
		goto commonButtonDown;
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_MBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6454
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6455
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6456
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6457
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6458
	    case WM_MBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6459
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6460
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6461
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6462
	    case WM_RBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6463
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6464
		butt = __MKSMALLINT(Button3);
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_RBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6468
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6469
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6470
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6471
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6472
	    case WM_RBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6473
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6474
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6475
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6476
	    commonButtonDown:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6477
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6478
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6479
		modifiers = ev->ev_modifiers;
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
		if (__INST(buttonTranslation) != nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6482
		    butt = __AT_(__INST(buttonTranslation), butt);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6483
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6484
		arg = butt;
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
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6487
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6488
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6489
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6490
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6491
		if (isDoubleClick)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6492
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6493
		    multiClickState = 1;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6494
		    nextMultiClickTime = lastMSGTime + multiClickTime;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6495
		    ipS = &bmp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6496
		    symS = @symbol(buttonMultiPress:x:y:view:);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6497
		}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6498
		else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6499
		{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6500
		    if (isDown)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6501
		    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6502
			if (multiClickState && (lastMSGTime < nextMultiClickTime))
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6503
			{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6504
			  nextMultiClickTime = lastMSGTime + multiClickTime;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6505
			  ipS = &bmp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6506
			  symS = @symbol(buttonMultiPress:x:y:view:);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6507
			}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6508
			else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6509
			{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6510
			  multiClickState = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6511
			  ipS = &bp;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6512
			  symS = @symbol(buttonPress:x:y:view:);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6513
			}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6514
		    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6515
		    else
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6516
		    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6517
			ipS = &br;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6518
			symS = @symbol(buttonRelease:x:y:view:);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6519
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6520
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6521
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6522
		if (__isSymbol(arg)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6523
		    DPRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6524
				__stringVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6525
		} else {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6526
		    DPRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6527
				__intVal(arg), x, y));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6528
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6529
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6530
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6531
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6532
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6533
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6534
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6535
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6536
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6537
	    case __WM_MOUSEENTER:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6538
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6539
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6540
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6541
		DPRINTF((">>> WM_MOUSEENTER: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6542
		(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6543
				    nil, &pe,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6544
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6545
				    __MKSMALLINT(x),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6546
				    __MKSMALLINT(y),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6547
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6548
		break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6549
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6550
	    case __WM_MOUSELEAVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6551
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6552
		DPRINTF((">>> WM_MOUSELEAVE: %d/%d %x\n", x, y, state));
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6553
		(*pl.ilc_func)(self, @symbol(pointerLeave:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6554
				    nil, &pl,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6555
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6556
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6557
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6558
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6559
	    case WM_MOUSEMOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6560
		x = ev->ev_x;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6561
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6562
		state = ev->ev_modifiers;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6563
		DPRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6564
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6565
		(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6566
				    nil, &mot,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6567
				    __MKSMALLINT(state),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6568
				    __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6569
				    __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6570
				    theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6571
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6572
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6573
	    case WM_CHAR:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6574
		DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6575
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6576
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6577
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6578
		goto keyPressAndRelease;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6579
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6580
	    case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6581
	    case WM_KEYUP:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6582
		DPRINTF((">>> WM_KEYUP / SYSKEYUP: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6583
		symS = @symbol(keyRelease:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6584
		ipS = &skr;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6585
		upDown = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6586
		goto keyPressAndRelease;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6587
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6588
	    case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6589
	    case WM_KEYDOWN:
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6590
#ifdef DEBUG
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6591
		if (ev->ev_keyCode == 0x11)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6592
		  c_count = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6593
#endif
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6594
		DPRINTF((">>> WM_KEYDOWN / SYSKEYDOWN: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6595
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6596
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6597
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6598
		/* FALL INTO */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6599
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6600
	    keyPressAndRelease: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6601
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6602
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6603
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6604
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6605
#ifdef NOTDEF
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
		    BYTE vKeyState[256];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6608
		    char buff[5];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6609
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6610
		    GetKeyboardState(vKeyState);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6611
		    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6612
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6613
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6614
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6615
		keyCode = ev->ev_keyCode;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6616
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6617
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6618
		if (modifiers & TRANSLATED_KEY) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6619
		    if (modifiers & ControlMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6620
			if (keyCode < 0x20) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6621
			    keyCode = keyCode + 'a' - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6622
			    if (modifiers & ShiftMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6623
				keyCode = keyCode - 'a' + 'A';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6624
			    }
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
		    } else if (modifiers & (MetaMask | AltMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6627
			if (! (modifiers & ShiftMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6628
			    if ((keyCode >= 'A') && (keyCode <= 'Z')) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6629
				keyCode = keyCode - 'A' + 'a';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6630
			    }
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
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6633
		    arg = __MKCHARACTER(keyCode & 0xFF);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6634
		} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6635
		    switch (keyCode) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6636
			case VK_F1:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6637
			    arg = @symbol(F1);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6638
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6639
			case VK_F2:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6640
			    arg = @symbol(F2);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6641
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6642
			case VK_F3:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6643
			    arg = @symbol(F3);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6644
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6645
			case VK_F4:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6646
			    arg = @symbol(F4);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6647
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6648
			case VK_F5:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6649
			    arg = @symbol(F5);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6650
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6651
			case VK_F6:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6652
			    arg = @symbol(F6);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6653
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6654
			case VK_F7:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6655
			    arg = @symbol(F7);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6656
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6657
			case VK_F8:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6658
			    arg = @symbol(F8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6659
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6660
			case VK_F9:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6661
			    arg = @symbol(F9);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6662
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6663
			case VK_F10:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6664
			    arg = @symbol(F10);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6665
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6666
			case VK_F11:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6667
			    arg = @symbol(F11);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6668
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6669
			case VK_F12:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6670
			    arg = @symbol(F12);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6671
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6672
			case VK_PRIOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6673
			    arg = @symbol(Prior);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6674
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6675
			case VK_NEXT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6676
			    arg = @symbol(Next);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6677
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6678
			case VK_END:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6679
			    arg = @symbol(End);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6680
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6681
			case VK_HOME:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6682
			    arg = @symbol(Home);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6683
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6684
			case VK_LEFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6685
			    arg = @symbol(CursorLeft);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6686
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6687
			case VK_RIGHT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6688
			    arg = @symbol(CursorRight);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6689
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6690
			case VK_UP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6691
			    arg = @symbol(CursorUp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6692
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6693
			case VK_DOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6694
			    arg = @symbol(CursorDown);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6695
			    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6696
			case VK_MENU:  /*alt key with w95 ???*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6697
			    arg = @symbol(Menu);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6698
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6699
			case VK_LMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6700
			    arg = @symbol(Menu_L);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6701
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6702
			case VK_RMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6703
			    arg = @symbol(Menu_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6704
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6705
			case VK_PAUSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6706
			    arg = @symbol(Pause);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6707
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6708
			case VK_HELP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6709
			    arg = @symbol(Help);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6710
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6711
			case VK_EXECUTE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6712
			    arg = @symbol(Execute);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6713
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6714
			case VK_CANCEL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6715
			    arg = @symbol(Cancel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6716
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6717
			case VK_SELECT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6718
			    arg = @symbol(Select);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6719
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6720
			case VK_PRINT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6721
			    arg = @symbol(Print);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6722
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6723
			case VK_SNAPSHOT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6724
			    arg = @symbol(Snapshot);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6725
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6726
			case VK_INSERT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6727
			    arg = @symbol(Insert);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6728
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6729
			case VK_DELETE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6730
			    arg = @symbol(Delete);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6731
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6732
			case VK_BACK:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6733
			    arg = @symbol(BackSpace);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6734
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6735
			case VK_LWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6736
			    arg = @symbol(Win_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6737
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6738
			case VK_RWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6739
			    arg = @symbol(Win_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6740
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6741
			case VK_APPS:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6742
			    arg = @symbol(Appl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6743
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6744
			case VK_NUMPAD0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6745
			    arg = @symbol(KeyPad0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6746
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6747
			case VK_NUMPAD1:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6748
			    arg = @symbol(KeyPad1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6749
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6750
			case VK_NUMPAD2:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6751
			    arg = @symbol(KeyPad2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6752
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6753
			case VK_NUMPAD3:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6754
			    arg = @symbol(KeyPad3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6755
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6756
			case VK_NUMPAD4:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6757
			    arg = @symbol(KeyPad4);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6758
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6759
			case VK_NUMPAD5:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6760
			    arg = @symbol(KeyPad5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6761
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6762
			case VK_NUMPAD6:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6763
			    arg = @symbol(KeyPad6);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6764
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6765
			case VK_NUMPAD7:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6766
			    arg = @symbol(KeyPad7);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6767
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6768
			case VK_NUMPAD8:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6769
			    arg = @symbol(KeyPad8);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6770
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6771
			case VK_NUMPAD9:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6772
			    arg = @symbol(KeyPad9);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6773
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6774
			case VK_LSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6775
			    arg = @symbol(Shift_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6776
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6777
			case VK_RSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6778
			    arg = @symbol(Shift_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6779
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6780
			case VK_LCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6781
			    arg = @symbol(Ctrl_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6782
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6783
			case VK_RCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6784
			    arg = @symbol(Ctrl_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6785
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6786
			case VK_CONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6787
			    arg = @symbol(Ctrl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6788
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6789
			case VK_SHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6790
			    arg = @symbol(Shift);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6791
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6792
			case VK_TAB:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6793
			    arg = @symbol(Tab);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6794
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6795
			case VK_ESCAPE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6796
			    arg = @symbol(Escape);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6797
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6798
			case VK_NUMLOCK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6799
			    arg = @symbol(NumLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6800
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6801
			case VK_SCROLL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6802
			    arg = @symbol(ScrollLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6803
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6804
			case VK_RETURN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6805
			    arg = @symbol(Return);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6806
			    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6807
			default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6808
			    nameBuffer[0] = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6809
			    /*GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));*/
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6810
			    DPRINTF(("char is <%d>\n", keyCode));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6811
			    arg = __MKCHARACTER(keyCode & 0xFF);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6812
			    break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6813
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6814
		 }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6815
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6816
		DPRINTF(("%s: code=%x mod=%x\n", __stringVal(symS),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6817
				keyCode, modifiers));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6818
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6819
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6820
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6821
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6822
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6823
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6824
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6825
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6826
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6827
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6828
				   theView);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6829
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6830
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6831
	   case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6832
		DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  6833
		(*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
  6834
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6835
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6836
	   case WM_FONTCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6837
		DPRINTF((">>> WM_FONTCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6838
		(*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6839
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6840
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6841
	   case WM_QUERYENDSESSION:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6842
		DPRINTF((">>> WM_QUERYENDSESSION\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6843
		(*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6844
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6845
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6846
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6847
	   case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6848
		DPRINTF((">>> WM_POWER\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6849
		(*power.ilc_func)(self, @symbol(powerDown), nil, &power);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6850
	       break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6851
#endif
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6852
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6853
	    default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6854
		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
  6855
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6856
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6857
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6858
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6859
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6860
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6861
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6862
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6863
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6864
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6865
     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
  6866
     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
  6867
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6868
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6869
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6870
    "interested in exposes only ?"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6871
    dispatchingExpose notNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6872
	[self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6873
	    self dispatchExposeEventFor:dispatchingExpose
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6874
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6875
	^ self
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6876
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6877
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6878
    [self eventPendingWithSync:false] whileTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6879
	(self getEventFor:nil withMask:nil) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6880
	    AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6881
		ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6882
	    ] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6883
		self dispatchLastEvent
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6884
	    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6885
	].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6886
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6887
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6888
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6889
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6890
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6891
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6892
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6893
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6894
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6895
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6896
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6897
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6898
   PRINTF(("disposeEventsWithMask:for: not yet implemented.\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6899
   RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6900
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6901
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6902
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6903
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6904
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6905
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6906
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6907
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6908
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6909
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6910
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6911
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6912
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6913
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6914
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6915
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6916
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6917
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6918
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6919
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6920
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6921
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6922
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6923
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6924
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6925
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6926
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6927
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6928
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6929
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6930
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6931
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6932
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6933
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6934
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6935
    ConservativeSyncing == true ifTrue:[self sync].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6936
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6937
    dispatchingExpose notNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6938
	^ self exposeEventPendingFor:dispatchingExpose withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6939
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6940
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6941
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6942
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6943
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6944
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6945
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6946
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6947
!
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
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6950
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6951
     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
  6952
    doSync notNil ifTrue:[self flush].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6953
%{  /* xxLIMITEDSTACK (WIN95 only) */
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6954
    MSG msg;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6955
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6956
    if (__INST(inRecursiveDispatch) == true) {
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6957
	RETURN (false);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6958
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6959
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6960
    if (isInputEvent()) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6961
	RETURN (true);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6962
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6963
%}.
2232
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6966
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6967
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6968
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6969
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6970
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6971
    "Created: 12.12.1995 / 21:43:00 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6972
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6973
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6974
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6975
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6976
     (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
  6977
      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
  6978
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6979
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6980
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6981
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6982
    DDPRINTF(("peek q - "));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6983
    if (isInputEvent()) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6984
	DDPRINTF(("true\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6985
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6986
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6987
    DDPRINTF(("false\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6988
    RETURN ( false );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6989
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6990
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6991
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6992
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6993
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  6994
     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
  6995
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6996
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6997
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6998
    DPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6999
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7000
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7001
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7002
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7003
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7004
    "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
  7005
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7006
     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
  7007
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7008
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7009
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7010
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7011
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7012
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7013
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7014
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7015
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7016
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7017
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7018
%{  /* xxLIMITEDSTACK */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7019
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7020
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7021
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7022
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7023
    struct queuedEvent *qev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7024
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7025
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7026
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7027
    } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7028
	printf("DISPLAY: no eventBuffer\n");
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7029
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7030
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7031
    ev->ev_message = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7032
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7033
    if (__isSmallInteger(eventMask)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7034
	evMask = __intVal(eventMask);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7035
    } else {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7036
	evMask = ~0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7037
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7038
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7039
    if (__isExternalAddress(aViewIdOrNil))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7040
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7041
	if (deqEvent(ev,_HWNDVal(aViewIdOrNil),evMask))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7042
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7043
	  RETURN ( true );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7044
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7045
    }
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
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7048
	if (deqEvent(ev,0,evMask))
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
	  RETURN ( true );
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
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7053
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7054
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7055
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7056
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7057
handleAllEvents
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7058
    "from now on, handle any kind of event"
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
    dispatchingExpose := nil
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7063
handleExposeOnlyFor:aView
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7064
    "from now on, handle expose events only"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7065
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7066
    "/ dispatchingExpose := aView id
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7067
    'handleExposeOnlyFor: not yet implemented' printCR.
2232
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7070
mappingChanged:what event:eB
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7071
    "One of Keyboard-, Modifier- or PointerMap has change, probably by xmodmap.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7072
     Tell xlib about the fact."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7073
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7074
    (what == #mappingKeyboard or:[what == #mappingModifier]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7075
	self refreshKeyboardMapping:eB.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7076
	"Maybe some of our modifiers have been changed"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7077
	self initializeModifierMappings.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7078
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7079
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7080
    "Created: 1.12.1995 / 16:28:23 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7081
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7082
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7083
setEventMask:aMask in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7084
    "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
  7085
     is the bitwise or of the eventMask bits (see 'eventMaskFor:')"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7086
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7087
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7088
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7089
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7090
	&& __isSmallInteger(aMask))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7091
    {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7092
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7093
	int mask = __intVal(aMask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7094
	if (GETLOCALWINDOWINFOPTR(hWnd))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7095
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7096
	  DPRINTF(("new eventMask %x\n",mask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7097
#ifdef DEBUGMASK
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7098
	  PRINTF(("new eventMask %x\n",mask));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7099
	  printMask(mask);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7100
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7101
	  GETLOCALWINDOWINFOPTR(hWnd)->eventMask = mask;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7102
	  RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7103
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7104
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7105
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7106
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7107
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7108
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7109
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7110
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7111
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
  7112
    "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
  7113
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7114
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7115
     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
  7116
     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
  7117
     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
  7118
     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
  7119
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7120
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7121
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7122
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7123
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7124
simulateKeyboardInput:aCharacterOrString inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7125
    "send input to some other view, by simulating keyPress/keyRelease
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7126
     events.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7127
     Only a few control characters are supported.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7128
     Notice: not all alien views allow this kind of synthetic input;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7129
	     some simply ignore it."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7130
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7131
    |control code state|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7132
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7133
    aCharacterOrString isString ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7134
	aCharacterOrString do:[:char |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7135
	    self simulateKeyboardInput:char inViewId:viewId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7136
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7137
	^ self
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7138
    ].
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
    control := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7141
    code := aCharacterOrString asciiValue.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7142
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7143
    (aCharacterOrString == Character cr) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7144
	code := #Return
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7145
    ] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7146
	(aCharacterOrString == Character tab) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7147
	    code := #Tab
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7148
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7149
	    (aCharacterOrString == Character esc) ifTrue:[
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7150
		code := #Escape
1127
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
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7153
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7154
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7155
    control ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7156
	state := self controlMask
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7160
    "/ the stuff below should not be needed 
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7161
    "/ (sendKeyOrButtonevent should be able to figure out things itself)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7162
    "/ however, on some linux systems it seems to not work correctly.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7163
    "/ Hopefully, this is correct ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7164
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7165
    code isNumber ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7166
	code >= $A asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7167
	    code <= $Z asciiValue ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7168
		state := self shiftMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7169
	    ]
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
    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
  7174
    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
  7175
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
      sending input to some (possibly alien) view:
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
      |point id|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7180
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7181
      point :=  Display pointFromUser.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7182
      id := Display viewIdFromPoint:point.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7183
      Display simulateKeyboardInput:'Hello_world' inViewId:id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7184
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7185
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7186
    "Modified: 11.6.1996 / 10:59:42 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7187
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7188
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7189
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7190
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7191
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7192
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7193
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7194
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7195
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7196
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7197
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7198
    char *fn;
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
    if (__isString(aFontName)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7201
	fn = __stringVal(aFontName);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7202
	if (strcmp(fn, "fixed") == 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7203
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7204
	} else if (strcmp(fn, "variable") == 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7205
	    hFont = GetStockObject(ANSI_VAR_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7206
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7207
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7208
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7209
	if (hFont) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7210
	    DPRINTF(("createFontFor:aFontName: %s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7211
	    RETURN ( __MKOBJ(hFont) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7212
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7213
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7214
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7215
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7216
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7217
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7218
fontMetricsOf:fontId into:aBlock
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7219
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7220
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7221
    |data|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7222
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7223
    data := Array new:10.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7224
    (self primFontMetricsOf:fontId intoArray:data) isNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7225
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7226
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7227
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7228
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7229
    aBlock value:#iso8859
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7230
	   value:(data at:1)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7231
	   value:(data at:2)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7232
	   value:(data at:3)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7233
	   value:(data at:4)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7234
	   value:(data at:5)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7235
	   value:(data at:6)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7236
	   value:(data at:7)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7237
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7238
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7239
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7240
    "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
  7241
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7242
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7243
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7244
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7245
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7246
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7247
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7248
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7249
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7250
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7251
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7252
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7253
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7254
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7255
	]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7256
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7257
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7258
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7259
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7260
fontsInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7261
    "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
  7262
     on this display.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7263
     On WinWorkStations there is curently no style or Face
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7264
     But only those matching filter (if nonNIl)."
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7265
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7266
    |allFonts fonts|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7267
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7268
    allFonts := self listOfAvailableFonts.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7269
    allFonts isNil ifTrue:[^ nil].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7270
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7271
    fonts := Set new.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7272
    allFonts do:[:fntDescr |
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7273
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7274
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7275
		fonts add:fntDescr
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7276
	    ]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7277
	]
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7278
    ].
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7279
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7280
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7281
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7282
fullNameOf:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7283
    "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
  7284
     used for user feed-back (for example: in the fontPanel).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7285
     If the display/font do not provide that info, return nil."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7286
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7287
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7288
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7289
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7290
    "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
  7291
    self halt.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7292
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7293
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7294
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7295
getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7296
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7297
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7298
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7299
     ^ self createFontFor:'fixed'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7300
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7301
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7302
getFontWithFamily:familyString face:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7303
	    style:styleArgString size:sizeArg encoding:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7304
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7305
    "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
  7306
     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
  7307
     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
  7308
     can be aquired that way."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7309
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7310
    |styleString theName theId xlatedStyle id spacing|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7311
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7312
    styleString := styleArgString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7313
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7314
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7315
    faceString isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7316
	sizeArg notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7317
	    theName := familyString , '-' , sizeArg printString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7318
	] ifFalse:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7319
	    theName := familyString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7320
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7321
	theName isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7322
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7323
	     mhmh - fall back to the default font
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7324
	    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7325
	    theName := 'fixed'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7326
	].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7327
	theId := self createFontFor:theName.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7328
	theId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7329
	    theId := self getDefaultFont
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
	^ theId
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7334
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7335
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7336
    styleString notNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7337
	((styleString endsWith:'-narrow')
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7338
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7339
	    |i|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7340
	    i := styleString lastIndexOf:$-.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7341
	    spacing := styleString copyFrom:(i+1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7342
	    styleString := styleString copyTo:(i-1).
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7343
	] ifFalse:[
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7344
	    spacing := 'normal'.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7345
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7346
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7347
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7348
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7349
    xlatedStyle notNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7350
	xlatedStyle := xlatedStyle first asString
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
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7353
    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7354
	    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7355
	    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7356
	    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7357
	    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7358
	    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7359
	    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7360
	    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7361
	    registry:encodingSym
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7362
	    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7363
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7364
    id isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7365
	(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7366
	    "/ too stupid: encodings come in both cases
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7367
	    "/ and X does not ignore case
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7368
	    "/
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7369
	    id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7370
		    getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7371
		    family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7372
		    weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7373
		    slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7374
		    spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7375
		    pixelSize:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7376
		    size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7377
		    registry:encodingSym asUppercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7378
		    encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7379
	    id isNil ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7380
		id := self
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7381
			getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7382
			family:familyString asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7383
			weight:faceString
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7384
			slant:xlatedStyle
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7385
			spacing:spacing
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7386
			pixelSize:nil
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7387
			size:sizeArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7388
			registry:encodingSym asLowercase
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7389
			encoding:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7390
	    ]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7391
	]
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7392
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7393
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7394
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7395
    "Modified: 24.2.1996 / 22:37:24 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7396
    "Modified: 4.7.1996 / 11:38:47 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7397
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7398
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7399
getFontWithFoundry:foundry family:family weight:weight
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7400
	      slant:slant spacing:spc pixelSize:pSize size:size
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7401
	      registry:registry encoding:encoding
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7402
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7403
    "get the specified font, if not available, return nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7404
     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
  7405
     use this entry.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7406
     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
  7407
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7408
     foundry: 'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7409
     family:  'helvetica' 'courier' 'times' ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7410
     weight:  'bold' 'medium' 'demi' ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7411
     slant:   'r(oman)' 'i(talic)' 'o(blique)'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7412
     spacing: 'narrow' 'normal' semicondensed' ... usually '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7413
     pixelSize: 16,18 ... usually left empty
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7414
     size:      size in point (1/72th of an inch)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7415
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7416
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7417
    "
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7418
    "
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7419
	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
  7420
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7421
		nHeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7422
		nWidth
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7423
		nEscapement
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7424
		nOrientation
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7425
		fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7426
		fdwItalic       TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7427
		fdwUnderline    TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7428
		fdwStrikeOut    TRUE or FALSE
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7429
		fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7430
		fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7431
		fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7432
		fdwQuality      DEFAULT, DRAFT, or PROOF.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7433
		fdwPitchAndFamily
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7434
			DEFAULT, FIXED or VARIABLE pitch
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7435
			DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7436
		lpszFace
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7437
			Typeface Name
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7438
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7439
	These two above descriptions will be matched as follows:
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7440
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7441
		foundry - ignored
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7442
		family  - mapped to type face name.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7443
		weight  - mapped to fnWeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7444
		slant   - NOT USED INITIALLY  user for style
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7445
		spacing - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7446
		pixelSize - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7447
		size      - mapped to nHeight
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7448
		registry  - NOT USED INITIALLY
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7449
		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
  7450
	"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7451
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7452
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7453
    HGDIOBJ hFont;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7454
    int  nHeight, nWidth, nEscapement, nOrientation;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7455
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7456
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7457
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7458
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7459
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7460
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7461
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7462
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7463
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7464
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7465
    DWORD fdwPitchAndFamily;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7466
    LPCTSTR lpszFace;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7467
    static char temp[33];
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7468
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7469
/* INITIALIZE */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7470
    strcpy( temp, "                           " );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7471
    lpszFace = &temp[0];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7472
    strcpy( (char *)lpszFace, "NULL" );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7473
    nHeight  = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7474
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7475
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7476
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7477
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7478
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7479
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7480
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7481
    fdwCharSet   = ANSI_CHARSET;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7482
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7483
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7484
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7485
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7486
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7487
/* SET VALUES */
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7488
    if ( __isString( family ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7489
	work = __stringVal( family );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7490
	if ( strcmp( work, "nil" ) != 0 ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7491
	    strncpy( (char *)lpszFace, work, 32 );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7492
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7493
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7494
    if( __isString( weight ) ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7495
	work = __stringVal( weight );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7496
	if( strcmp( work, "bold" ) == 0 ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7497
	    fnWeight = FW_BOLD;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7498
    } else {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7499
	if( strcmp( work, "medium" ) == 0 ) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7500
	    fnWeight = FW_MEDIUM;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7501
	    } else {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7502
		if( strcmp( work, "demi" ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7503
		    fnWeight = FW_LIGHT;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7504
	    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7505
	}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7506
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7507
    if(__isSmallInteger( size ) )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7508
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7509
	nHeight = __intVal( size );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7510
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7511
    work2 = __stringVal( slant );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7512
    work  = __stringVal( slant );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7513
    if( strncmp( work2, "italic", 6 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7514
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7515
	fdwItalic = TRUE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7516
	if( work2[6] = '-' )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7517
	   strncpy( work, &work2[7], ( strlen( work2 ) - 7 ) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7518
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7519
    if( strncmp( work, "underline", 9 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7520
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7521
	fdwUnderline = TRUE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7522
	if( work[10] == '-' )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7523
	   strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
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
    if( strncmp( work2, "strikeOut", 9 ) == 0 )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7526
	fdwStrikeOut = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7527
    nHeight = -MulDiv(nHeight, __logPixelSY, 72);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7528
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7529
    DPRINTF(("CreateFont %s h=%d\n",lpszFace,nHeight));
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7530
    hFont = CreateFont( nHeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7531
			nWidth,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7532
			nEscapement,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7533
			nOrientation,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7534
			fnWeight,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7535
			fdwItalic,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7536
			fdwUnderline,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7537
			fdwStrikeOut,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7538
			fdwCharSet,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7539
			fdwOutputPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7540
			fdwClipPrecision,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7541
			fdwQuality,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7542
			fdwPitchAndFamily,
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7543
			lpszFace );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7544
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7545
    if( hFont != NULL )
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7546
    {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7547
	DPRINTF(("createFontWithFoundry: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7548
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7549
	    __cnt_font++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7550
	   RES1PRINTF(("CreateFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7551
#endif
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7552
	RETURN ( __MKOBJ(hFont) );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7553
    }
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7554
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7555
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7556
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7557
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7558
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7559
     Display getFontWithFoundry:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7560
			 family:'courier'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7561
			 weight:'medium'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7562
			  slant:'r'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7563
			spacing:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7564
		      pixelSize:nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7565
			   size:13
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7566
		       registry:'iso8859'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7567
		       encoding:'*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7568
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7569
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7570
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7571
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7572
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7573
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7574
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7575
     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
  7576
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7577
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7578
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7579
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7580
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7581
    listOfFonts notNil ifTrue:[^ listOfFonts].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7582
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7583
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7584
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7585
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7586
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7587
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7588
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7589
      "/Transcript showCR:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7590
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7591
      typeFaceList do:[:typeFace |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7592
	  self primEnumFontsIn:typeFace into:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7593
	  0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7594
      ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7595
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7596
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7597
    "/Transcript showCR:list.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7598
    listOfFonts := list
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7599
		       collect:[:anArray |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7600
			| fntDescr family face style size encoding |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7601
			family := anArray at:14.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7602
			face   := anArray at:5.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7603
			style  := anArray at:16.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7604
			size   := anArray at:1.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7605
			encoding := anArray at:15.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7606
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7607
			fntDescr := FontDescription
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7608
					family:family
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7609
					face:face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7610
					style:style
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7611
					size:size
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7612
					encoding:encoding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7613
			fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7614
		       ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7615
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7616
    ^ listOfFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7617
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7618
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7619
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7620
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7621
     Display getAvailableFontsMatching:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7622
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7623
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7624
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7625
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7626
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7627
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7628
primEnumFontTypesInto:typeFaceList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7629
%{      /* xxLIMITEDSTACK (WIN95) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7630
	if (tmpDC)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7631
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7632
	    if ( EnumFontFamilies( tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList))) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7633
		DPRINTF(("EnumFonts successful\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7634
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7635
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7636
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7637
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7638
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7639
primEnumFontsIn:typeFace into:fontList
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7640
%{      /* xxLIMITEDSTACK (WIN95) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7641
	char *cp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7642
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7643
	if (__isString(typeFace))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7644
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7645
	    if (tmpDC) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7646
		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
  7647
		    DPRINTF(("EnumFonts Successful\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7648
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7649
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7650
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7651
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7652
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7653
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7654
primFontMetricsOf:fontId intoArray:data
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7655
    "evaluate aBlock, passing a fonts metrics as arguments"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7656
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7657
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7658
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7659
    if (__isExternalAddress(fontId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7660
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7661
	SIZE size;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7662
	int avgWidth;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7663
	HGDIOBJ hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7664
	HGDIOBJ prevFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7665
	TEXTMETRIC tmet;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7666
	int len;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7667
	hFont = _HGDIOBJVal(fontId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7668
	/*
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7669
	 * temporarily set this font in the root context
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7670
	 */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7671
	prevFont = SelectObject(tmpDC, hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7672
	GetTextMetrics(tmpDC, &tmet);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7673
	GetTextExtentPoint32(tmpDC,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7674
	 "uvwxyz",52,&size);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7675
	SelectObject(tmpDC, prevFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7676
	avgWidth = (size.cx/26+1)/2;
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
	__ArrayInstPtr(data)->a_element[0] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7679
	__ArrayInstPtr(data)->a_element[1] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7680
	__ArrayInstPtr(data)->a_element[2] = __MKSMALLINT(tmet.tmAscent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7681
	__ArrayInstPtr(data)->a_element[3] = __MKSMALLINT(tmet.tmDescent);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7682
	__ArrayInstPtr(data)->a_element[4] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7683
	__ArrayInstPtr(data)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7684
	__ArrayInstPtr(data)->a_element[6] = __MKSMALLINT(avgWidth);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7685
	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
  7686
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7687
		    tmet.tmAveCharWidth));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7688
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7689
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7690
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7691
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7692
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7693
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7694
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7695
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7696
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7697
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7698
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7699
	if (hFont)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7700
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7701
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7702
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7703
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7704
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7705
	  DelObject(hFont);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7706
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7707
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7708
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7709
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7710
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7711
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7712
    "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
  7713
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7714
     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
  7715
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7716
    |sizes|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7717
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7718
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7719
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7720
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7721
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7722
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7723
	^ #(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
  7724
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7725
    ^ sizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7726
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7727
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7728
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7729
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7730
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7731
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7732
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7733
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7734
widthOf:aString from:index1 to:index2 inFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7735
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7736
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7737
    char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7738
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7739
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7740
    int nInstBytes;
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
	if (__bothSmallInteger(index1, index2)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7743
	 && __isExternalAddress(aFontId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7744
	 && __isNonNilObject(aString)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7745
	    HGDIOBJ hFont,prevFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7746
	    SIZE tsize;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7747
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7748
	    hFont = _HGDIOBJVal(aFontId);
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
	    i1 = __intVal(index1) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7751
	    cls = __qClass(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7752
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7753
	    if (i1 >= 0) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7754
		i2 = __intVal(index2) - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7755
		if (i2 < i1) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7756
		    RETURN ( __MKSMALLINT( 0 ) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7757
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7758
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7759
		cp = (char *) _stringVal(aString);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7760
		l = i2 - i1 + 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7761
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7762
		if ((cls == @global(String)) || (cls == @global(Symbol))) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7763
		    n = _stringSize(aString);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7764
		    if (i2 < n)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7765
		    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7766
			cp += i1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7767
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7768
			prevFont = SelectObject(tmpDC, hFont);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7769
			GetTextExtentPoint32(tmpDC, cp, l, &tsize);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7770
#ifdef xxDEBUG
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7771
			if (__debug__)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7772
			{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7773
			  char buf[80];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7774
			  GetTextFace(tmpDC,80,buf);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7775
			  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
  7776
			}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7777
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7778
			SelectObject(tmpDC, prevFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7779
			RETURN ( __MKSMALLINT(tsize.cx) );
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
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7782
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7783
		nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7784
		cp += nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7785
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7786
		if (__isBytes(aString)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7787
		    n = __byteArraySize(aString) - nInstBytes;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7788
		    if (i2 < n)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7789
		    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7790
			cp += i1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7791
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7792
			prevFont = SelectObject(tmpDC, hFont);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7793
			GetTextExtentPoint32(tmpDC, cp, l, &tsize);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7794
#ifdef xxDEBUG
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7795
			if (__debug__)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7796
			{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7797
			  char buf[80];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7798
			  GetTextFace(tmpDC,80,buf);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7799
			  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
  7800
			}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7801
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7802
			SelectObject(tmpDC, prevFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7803
			RETURN ( __MKSMALLINT(tsize.cx) );
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
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7806
	    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7807
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7808
#undef NLOCALBUFFER
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7809
%}.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7810
"/  'no stringlen' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7811
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7812
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7813
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7814
!WinWorkstation methodsFor:'grabbing '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7815
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7816
allowEvents:mode
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7817
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7818
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7819
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7820
    "grab the keyboard"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7821
%{    
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7822
    if (__isExternalAddress(aWindowId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7823
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7824
      HWND hWnd = _HWNDVal(aWindowId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7825
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7826
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7827
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7828
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7829
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7830
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7831
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7832
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7833
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7834
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7835
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7836
	HWND hWnd = _HWNDVal(aWindowId);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7837
	{
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7838
	  HCURSOR hCursor = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7839
	  if (currentCapture != CAPTURE_NONE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7840
	  {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7841
	    PostMessage(currentPointerView,WM_THREADSETCAPTURE,0,0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7842
	    //ReleaseCapture();
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7843
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7844
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7845
	  if (hWnd == __rootWin)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7846
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7847
	     hWnd = __rootWinSpezial;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7848
	     ShowWindow(hWnd,SW_SHOWNOACTIVATE);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7849
	     //EnableWindow(hWnd,TRUE);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  7850
	     SetWindowPos(hWnd, HWND_TOP,
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7851
	      0, 0, 0, 0,SWP_NOREDRAW|SWP_NOSENDCHANGING|SWP_NOCOPYBITS
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  7852
	      |SWP_NOACTIVATE |SWP_NOMOVE|SWP_NOSIZE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7853
	     CPRINTF(("setRootCapture %x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7854
	  }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7855
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7856
	  if (__isExternalAddress(aCursorId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7857
	  {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7858
	      hCursor = _HCURSORVal(aCursorId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7859
	  }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7860
	  CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7861
	  PostMessage(hWnd,WM_THREADSETCAPTURE,(INT)hWnd,(INT)hCursor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7862
	  if (__isExternalAddress(aCursorId))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7863
	  {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7864
	      RETURN ( self );
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
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7867
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7868
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7869
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7870
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7871
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7872
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7873
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7874
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7875
    activeKeyboardGrab := nil.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7876
%{    
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7877
    CPRINTF(("ungrabKeyboard\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7878
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7879
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7880
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7881
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7882
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7883
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7884
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7885
    CPRINTF(("ungrabPointer 1\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7886
    PostThreadMessage(_dispatchThreadId,WM_THREADSETCAPTURE,0,0);
1127
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
    activePointerGrab := nil
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7891
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7892
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7893
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7894
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7895
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7896
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7897
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7898
    if (__isExternalAddress(aWindowId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7899
     && __isExternalAddress(aGCId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7900
     {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7901
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7902
	gcData->clipping = FALSE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7903
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7904
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7905
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7906
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7907
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7908
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7909
    "set background color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7910
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7911
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7912
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7913
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7914
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7915
    if (__isExternalAddress(aGCId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7916
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7917
	COLORREF bgColor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7918
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7919
	//hDC = _getDC(gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7920
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7921
	if (bgColor != gcData->bgColor) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7922
	    gcData->bgColor = bgColor;
2251
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  7923
	    // SetBkColor(hDC, bgColor);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7924
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7925
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7926
	DPRINTF(("setBackground: %x\n", bgColor));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7927
	//_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7928
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7929
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7930
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7931
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7932
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7933
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7934
    "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
  7935
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7936
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7937
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  7938
    if (__isExternalAddress(aGCId)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7939
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  7940
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7941
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  7942
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7943
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  7944
	    gcData->hMask = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7945
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7946
	DPRINTF(("masks set to %x\n",gcData->hMask));
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
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7952
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7953
    "enable/disable drawing into child views"
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) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7956
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7957
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7958
    if (ISCONNECTED && __isExternalAddress(aGCId))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7959
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7960
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7961
	if (gcData && gcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7962
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7963
	    if( aBool == true )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7964
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7965
		/* set clip by child */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7966
		if (gcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7967
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7968
		  gcData->clipByChild = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7969
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7970
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7971
	    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7972
		if (gcData->hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7973
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7974
		  gcData->clipByChild = FALSE;
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
	    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7977
	} else {
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7978
	    DPRINTF(("clipping by child failed - invalid win\n" ));
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7979
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  7980
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7981
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7982
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7983
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7984
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  7985
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
  7986
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7987
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7988
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7989
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7990
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7991
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7992
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7993
      -------
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7994
	  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
  7995
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7996
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7997
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7998
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7999
    /*RETURN (self);*/
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8000
    if (  __isExternalAddress(aGCId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8001
       && __bothSmallInteger(clipX, clipY)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8002
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8003
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8004
	gcData->clipping = TRUE;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8005
	gcData->clipX = __intVal(clipX); 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8006
	gcData->clipY = __intVal(clipY); 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8007
	gcData->clipW = __intVal(clipWidth); 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8008
	gcData->clipH = __intVal(clipHeight); 
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8009
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8010
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8011
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8012
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8013
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8014
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8015
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8016
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8017
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8018
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8019
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8020
	PRINTF(("dashes not yet implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8021
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8022
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8023
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8024
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8025
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8026
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8027
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8028
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8029
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8030
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8031
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8032
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8033
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8034
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8035
	HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8036
	HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8037
	TEXTMETRIC tmet;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8038
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8039
	hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8040
	hFont = _HGDIOBJVal(aFontId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8041
	gcData->hFont = hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8042
	hFont = SelectObject(hDC, hFont);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8043
	GetTextMetrics(hDC, &tmet);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8044
	gcData->fontAscent = tmet.tmAscent;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8045
#ifdef DEBUG
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8046
	if (__debug__)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8047
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8048
	  char buf[80];
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8049
	  GetTextFace(hDC,80,buf);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8050
	  PRINTF(("setFont: %x %s\n", hFont,buf));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8051
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8052
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8053
	SelectObject(hDC, hFont);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8054
	_releaseDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8055
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8056
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8057
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8058
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8059
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8060
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8061
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8062
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8063
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8064
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8065
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8066
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8067
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8068
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8069
	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  8070
	DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8071
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8072
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8073
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8074
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8075
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8076
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8077
    "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
  8078
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8079
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8080
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8081
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8082
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8083
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8084
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8085
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8086
	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8087
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8088
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8089
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8090
	    gcData->hMask = 0;
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  8091
	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
  8092
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8093
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8094
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8095
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8096
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8097
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
  8098
    "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
  8099
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8100
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8101
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8102
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8103
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8104
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8105
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8106
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8107
	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8108
	gcData->lineWidth = __intVal(lw);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8109
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8110
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8111
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8112
	    gcData->hMask = 0;
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  8113
	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
  8114
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8115
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8116
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8117
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8118
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8119
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8120
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8121
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8122
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8123
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8124
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8125
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8126
    if (__isExternalAddress(aGCId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8127
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8128
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8129
	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  8130
	DDPRINTF(("setForeground: %x\n", gcData->fgColor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8131
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8132
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8133
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8134
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8135
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8136
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8137
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8138
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8139
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8140
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8141
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8142
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8143
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8144
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8145
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8146
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8147
	if (aFunctionSymbol == @symbol(copy)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8148
	  fun = R2_COPYPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8149
	  bfun = BITBLT_COPY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8150
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8151
	else if (aFunctionSymbol == @symbol(copyInverted)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8152
	  fun = R2_NOTCOPYPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8153
	  bfun = BITBLT_COPYINVERTED;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8154
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8155
	else if (aFunctionSymbol == @symbol(xor)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8156
	  fun = R2_XORPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8157
	  bfun = BITBLT_XOR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8158
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8159
	else if (aFunctionSymbol == @symbol(and)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8160
	  fun = R2_MASKPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8161
	  bfun = BITBLT_AND;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8162
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8163
	else if (aFunctionSymbol == @symbol(or)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8164
	  fun = R2_MERGEPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8165
	  bfun = BITBLT_OR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8166
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8167
	if (fun != -1) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8168
#if 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8169
	    printf("set func to");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8170
	    switch (bfun)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8171
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8172
	      case BITBLT_COPY:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8173
		printf("BITBLT_COPY\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8174
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8175
	      case BITBLT_COPYINVERTED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8176
		printf("BITBLT_COPYINVERTED\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8177
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8178
	      case BITBLT_XOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8179
		printf("BITBLT_XOR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8180
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8181
	      case BITBLT_AND:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8182
		printf("BITBLT_AND\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8183
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8184
	      case BITBLT_OR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8185
		printf("BITBLT_OR\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8186
		break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8187
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8188
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8189
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8190
	    gcData->bitbltrop2 = bfun;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8191
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8192
	else {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8193
	    if (@global(InfoPrinting) == true) {
2329
73bb4001db25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2328
diff changeset
  8194
	        __win32_fprintf(stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n");
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8195
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8196
	    gcData->rop2 = R2_COPYPEN;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8197
	    gcData->bitbltrop2 = BITBLT_COPY;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8198
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8199
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8200
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8201
    else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8202
        printf("Rasterfunction no GC\n");
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8203
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8204
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8205
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8206
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8207
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8208
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8209
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8210
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8211
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8212
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8213
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8214
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8215
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8216
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8217
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8218
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8219
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8220
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8221
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8222
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8223
	if (lineStyle == @symbol(solid)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8224
	    gcData->lineStyle = PS_SOLID;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8225
	} else if (lineStyle == @symbol(dashed)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8226
	    gcData->lineStyle = PS_DASH;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8227
	} else
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8228
	    gcData->lineStyle = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8229
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8230
	if (capStyle == @symbol(round)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8231
	    gcData->capStyle = PS_ENDCAP_ROUND;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8232
	} else if (capStyle == @symbol(square)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8233
	    gcData->capStyle = PS_ENDCAP_SQUARE;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8234
	} else if (capStyle == @symbol(flat)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8235
	    gcData->capStyle = PS_ENDCAP_FLAT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8236
	} else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8237
	    gcData->capStyle = PS_ENDCAP_FLAT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8238
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8239
	if (joinStyle == @symbol(bevel)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8240
	    gcData->joinStyle = PS_JOIN_BEVEL;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8241
	} else if (joinStyle == @symbol(miter)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8242
	    gcData->joinStyle = PS_JOIN_MITER;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8243
	} else if (joinStyle == @symbol(round)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8244
	    gcData->joinStyle = PS_JOIN_ROUND;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8245
	} else
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8246
	    gcData->joinStyle = PS_JOIN_MITER;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8247
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8248
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8249
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8250
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8251
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8252
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8253
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8254
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8255
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8256
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8257
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8258
    if (__isExternalAddress(aGCId)) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8259
        if (__bothSmallInteger(orgX,orgY)) {
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8260
	    struct gcData *gcData = _GCDATA(aGCId);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8261
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8262
	    gcData->maskOrgX = __intVal(orgX);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8263
	    gcData->maskOrgY = __intVal(orgY);;
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8264
	    RETURN (self);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8265
        }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8266
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8267
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8268
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8269
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8270
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8271
    "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
  8272
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8273
%{  /* xxLIMITEDSTACK (WIN95 only) */
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8274
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8275
	struct gcData *gcData = _GCDATA(aGCId);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8276
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8277
	if (__isExternalAddress(aPixmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8278
	    gcData->hMask = _HBITMAPVAL(aPixmapId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8279
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  8280
	    gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8281
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8282
	DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8283
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8284
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8285
%}
2232
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
!WinWorkstation methodsFor:'initialize / release'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8289
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8290
close
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8291
    "close down the connection to the X-server"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8292
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8293
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8294
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8295
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8296
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8297
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8298
    buttonTranslation := ButtonTranslation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8299
    multiClickTimeDelta := MultiClickTimeDelta.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8300
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8301
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8302
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8303
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8304
initializeEventBuffer
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8305
    |sz|
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
%{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8308
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8309
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8310
    eventBuffer isNil ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8311
	eventBuffer := ByteArray new:sz.
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
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8314
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8315
initializeFor:aDisplayName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8316
    "initialize the receiver for a connection to an X-Server;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8317
     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
  8318
     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
  8319
     as hostname:number"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8320
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8321
    displayId notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8322
	"/ already connected - trying to trick me ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8323
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8324
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8325
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8326
    displayId := self primInitializeFor:aDisplayName.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8327
    displayId isNil ifTrue:[^ self].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8328
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8329
    dispatching := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8330
    isSlow := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8331
    shiftDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8332
    ctrlDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8333
    metaDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8334
    altDown := false.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8335
    motionEventCompression := true.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8336
    buttonsPressed := 0.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8337
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8338
    self initializeScreenProperties.
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8339
    self initializeDeviceResourceTables.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8340
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8341
    self initializeDefaultValues.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8342
    self initializeEventBuffer.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8343
    self initializeSpecialFlags.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8344
    self initializeKeyboardMap.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8345
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8346
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8347
initializeModifierMappings
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8348
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8349
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8350
    metaModifiers := #(#'Alt_L' #'Alt').
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8351
    altModifiers := #(#'Alt_R').
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8352
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8353
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8354
initializeScreenProperties
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8355
    super initializeScreenProperties.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8356
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8357
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8358
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8359
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8360
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8361
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8362
    int nvi, i, val, capabilities,__planes,__numcolors,__numpens,__ras;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8363
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8364
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8365
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8366
    RECT rect;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8367
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8368
    OBJ id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8369
    if (firstInstance)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8370
    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8371
	OSVERSIONINFO osvi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8372
	WNDCLASS wc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8373
	firstInstance = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8374
	DPRINTF(("first create - registerClass\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8375
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8376
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8377
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8378
	GetVersionEx (&osvi);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8379
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8380
	if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8381
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8382
	  __isWinNT = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8383
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8384
	else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8385
	{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8386
	  __isWinNT = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8387
	}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8388
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8389
	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
  8390
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8391
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8392
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8393
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8394
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8395
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8396
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8397
	wc.hbrBackground = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8398
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8399
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8400
	wc.lpszClassName = app_name;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8401
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8402
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8403
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8404
    /*            return NULL;     */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8405
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8406
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8407
	wc.style = 0;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8408
	wc.lpfnWndProc = (WNDPROC) MainWndProc;// Root;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8409
	wc.cbClsExtra = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8410
	wc.cbWndExtra = N_WINDOW_PRIVATE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8411
	wc.hInstance = (HANDLE) __getHInstance();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8412
	wc.hIcon = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8413
	wc.hCursor = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8414
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8415
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8416
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8417
	wc.lpszMenuName =  NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8418
	wc.lpszClassName = app_nameroot;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8419
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8420
	if (!RegisterClass(&wc)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8421
	    DPRINTF(("RegisterClass failed\n"));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8422
    /*            return NULL;     */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8423
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8424
	hCreateEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8425
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8426
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8427
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8428
	    THREADEVENTNAME);  /* name of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8429
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8430
	if (hCreateEvent == NULL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8431
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8432
	    DPRINTF(("CreateEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8433
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8434
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8435
	hInputEvent = CreateEvent(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8436
	    NULL,        /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8437
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8438
	    FALSE,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8439
	    THREADINPUTEVENTNAME);  /* name of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8440
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8441
	if (hInputEvent == NULL)
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
	    DPRINTF(("InputEvent failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8444
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8445
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8446
	hdispatchMutex = CreateMutex(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8447
	    NULL,                       /* no security attributes */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8448
	    FALSE,                      /* initially not owned */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8449
	    THREADMUTEXNAME);  /* name of mutex */
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
	if (hdispatchMutex == NULL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8452
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8453
	    DPRINTF(("CreateMutex failed\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8454
/*            return NULL;     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8455
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8456
	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
  8457
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8458
	/*__setWaitInputEvent(waitInputEvent);*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8459
	bdispatchThreadState = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8460
	_masterThreadId = GetCurrentThreadId();
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
	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
  8463
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8464
	initqueue();
2284
c6490fd1f1f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2281
diff changeset
  8465
	__beginthread(dispatchThread, 4096, 0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8466
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8467
	  DWORD dwWaitResult;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8468
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8469
	  /* Request ownership of mutex. */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8470
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8471
	  dwWaitResult = WaitForSingleObject(
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8472
	    hCreateEvent,   /* handle of mutex */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8473
	    5000L);   /* time-out interval */
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
    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8476
    multiClickTime = GetDoubleClickTime();
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8477
    DPRINTF(("multiClickTime = %d\n",multiClickTime));
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8478
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8479
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8480
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8481
    if (!__rootDesk)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8482
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8483
      PRINTF(("OpenDesktop fail\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8484
      __rootDesk = CreateDesktop ("Desktop0", NULL,NULL,0,DESKTOP_WRITEOBJECTS,NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8485
      if (!__rootDesk)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8486
      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8487
	PRINTF(("CreateDesktop fail\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8488
      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8489
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8490
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8491
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8492
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8493
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8494
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8495
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8496
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8497
    _rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8498
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8499
    tmpDC = CreateCompatibleDC(_rootDC);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8500
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8501
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8502
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8503
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8504
    __INST(rootDC) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8505
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8506
    GetWindowRect(__rootWin, &rect);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8507
    __INST(width) = __MKSMALLINT(rect.right-rect.left);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8508
    __INST(height) = __MKSMALLINT(rect.bottom-rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8509
    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
  8510
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8511
    __planes = GetDeviceCaps(_rootDC, PLANES);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8512
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8513
#ifndef ALWAYSTRUECOLOR
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8514
    __depth = GetDeviceCaps(_rootDC, BITSPIXEL);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8515
#else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8516
    __depth = 24;  /* its a hack */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8517
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8518
    if (__depth == 15)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8519
      __depth = 16;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8520
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8521
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8522
    __numcolors = GetDeviceCaps(_rootDC, NUMCOLORS);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8523
    __numpens = GetDeviceCaps(_rootDC, NUMPENS);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8524
    DPRINTF(("screen has %d planes\n",__planes));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8525
    DPRINTF(("numcolors is %d\n",__numcolors));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8526
    DPRINTF(("numpens is %d\n",__numpens));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8527
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8528
    __ras = GetDeviceCaps(_rootDC, RASTERCAPS);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8529
#if 0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8530
    printf("device support:\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8531
    if (__ras & RC_BANDING)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8532
      printf(" RC_BANDING");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8533
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8534
    if (__ras & RC_BITBLT)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8535
      printf(" RC_BITBLT");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8536
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8537
    if (__ras & RC_BITMAP64)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8538
      printf(" RC_BITMAP64");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8539
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8540
    if (__ras & RC_DI_BITMAP)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8541
      printf(" RC_DI_BITMAP");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8542
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8543
    if (__ras & RC_DIBTODEV)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8544
      printf(" RC_DIBTODEV");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8545
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8546
    if (__ras & RC_FLOODFILL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8547
      printf(" RC_FLOODFILL");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8548
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8549
    if (__ras & RC_PALETTE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8550
      printf(" RC_PALETTE");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8551
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8552
    if (__ras & RC_SCALING)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8553
      printf(" RC_SCALING");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8554
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8555
    if (__ras & RC_STRETCHBLT)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8556
      printf(" RC_STRETCHBLT");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8557
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8558
    if (__ras & RC_STRETCHDIB)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8559
      printf(" RC_STRETCHDIB");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8560
    printf("\n");
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8561
    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
  8562
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8563
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8564
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8565
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8566
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8567
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8568
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8569
    val = GetDeviceCaps(_rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8570
    DPRINTF(("HORSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8571
    __INST(widthMM) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8572
    val = GetDeviceCaps(_rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8573
    DPRINTF(("VERTSIZE=%d\n",val));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8574
    __INST(heightMM) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8575
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8576
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8577
    __logPixelSY = GetDeviceCaps(_rootDC, LOGPIXELSY);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8578
    capabilities = GetDeviceCaps(_rootDC, RASTERCAPS);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8579
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8580
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8581
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8582
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8583
#ifndef ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8584
    if (! (capabilities & RC_PALETTE))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8585
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8586
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8587
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8588
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8589
	    __INST(visualType) = @symbol(GrayScale);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8590
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8591
	    __INST(hasGreyscales) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8592
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8593
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8594
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8595
	    __INST(hasGreyscales) = true;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8596
	    if ((__depth == 16) || (__depth == 15))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8597
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8598
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8599
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8600
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8601
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8602
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8603
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8604
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8605
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8606
	      __INST(redMask) = __MKSMALLINT(0xf800);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8607
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8608
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8609
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8610
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8611
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8612
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8613
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8614
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8615
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8616
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8617
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8618
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8619
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8620
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8621
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8622
#ifndef ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8623
    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8624
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8625
	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
  8626
	printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8627
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8628
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8629
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8630
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8631
	__INST(hasGreyscales) = true;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8632
	__INST(usingSystemPalette) = true;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8633
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8634
	  __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8635
	  __INST(greenShift) = __MKSMALLINT(2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8636
	  __INST(blueShift) = __MKSMALLINT(4);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8637
	  __INST(bitsPerRGB) = __MKSMALLINT(2);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8638
	  __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8639
	  __INST(redMask) = __MKSMALLINT(0x3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8640
	  __INST(greenMask) = __MKSMALLINT(0xc);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8641
	  __INST(blueMask) = __MKSMALLINT(0x30);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8642
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8643
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8644
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8645
    __INST(monitorType) = @symbol(unknown);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8646
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8647
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8648
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8649
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8650
initializeSpecialFlags
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8651
    "perform additional special server implementation flags"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8652
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8653
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8654
primInitializeFor:aDisplayName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8655
    "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
  8656
     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
  8657
     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
  8658
     as hostname:number"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8659
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8660
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8661
    RETURN ( __MKSMALLINT(1) );
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
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8664
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8665
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8666
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8667
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8668
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8669
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8670
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8671
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8672
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8673
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8674
     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
  8675
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8676
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8677
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8678
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8679
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8680
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8681
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8682
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8683
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8684
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8685
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8686
    "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
  8687
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8688
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8689
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8690
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8691
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8692
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8693
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8694
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8695
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8696
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8697
     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
  8698
     therefore return a variable here, which can be changed during startup."
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
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8701
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8702
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8703
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8704
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8705
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8706
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8707
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8708
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8709
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8710
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8711
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8712
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8713
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8714
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8715
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8716
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8717
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8718
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8719
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8720
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8721
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8722
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8723
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8724
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8725
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8726
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8727
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8728
    ^ ''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8729
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8730
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8731
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8732
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8733
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8734
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8735
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8736
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8737
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8738
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8739
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  8740
%{  
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  8741
    __STX_API_CALL1(
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  8742
	MessageBeep, MB_ICONEXCLAMATION
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  8743
    );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8744
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8745
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8746
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8747
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8748
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8749
     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
  8750
     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
  8751
     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
  8752
     (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
  8753
     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
  8754
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8755
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8756
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8757
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8758
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8759
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8760
refreshKeyboardMapping:eB
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8761
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8762
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8763
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8764
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8765
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8766
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8767
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8768
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8769
     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
  8770
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8771
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8772
     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
  8773
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8774
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8775
%{  /* xxLIMITEDSTACK (WIN95 only) */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8776
    if (__isExternalAddress(aWindowId)) 
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8777
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8778
	HWND hWnd = _HWNDVal(aWindowId);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8779
	int r = 0;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8780
	if (revertSymbol == @symbol(parent)) 
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8781
	{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8782
	  r = 1;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8783
	}
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8784
	else if (revertSymbol == @symbol(root)) 
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8785
	{
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8786
	  r = 2;
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8787
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8788
	if (hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8789
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8790
	    if (GetFocus() != hWnd)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8791
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8792
	      CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8793
	      PostMessage(hWnd,WM_THREADSETFOCUS,(INT)hWnd,GetCurrentThreadId());
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8794
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8795
	      if (SetFocus(hWnd) == 0)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8796
	       PRINTF(("SetFocus to %x failed.\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8797
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8798
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8799
	    else
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8800
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8801
	      CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8802
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8803
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8804
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8805
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8806
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8807
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8808
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8809
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8810
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8811
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8812
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8813
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8814
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8815
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8816
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8817
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8818
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8819
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8820
    s = __MKSMALLINT(Button1Mask|Button2Mask|Button3Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8821
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8822
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8823
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8824
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8825
    "Created: 23.3.1996 / 12:46:35 / cg"
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8828
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8829
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8830
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8831
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8832
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8833
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8834
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8835
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8836
%{
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8837
    int modifiers = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8838
    int b1m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8839
    int b3m = Button3Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8840
    if (GetSystemMetrics(SM_SWAPBUTTON))
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8841
    {
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8842
      b3m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8843
      b1m = Button3Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8844
    }
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8845
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8846
    if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8847
	modifiers |= b1m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8848
    if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8849
	modifiers |= Button2Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8850
    if (GetAsyncKeyState(VK_RBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8851
	modifiers |= b3m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8852
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  8853
    s = __MKSMALLINT(modifiers);
2000
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
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8856
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8857
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8858
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8859
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8860
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8861
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8862
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8863
     Display buttonStates bitTest:(Display controlMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8864
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8865
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8866
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8867
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8868
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8869
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8870
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8871
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8872
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8873
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8874
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8875
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8876
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8877
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8878
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8879
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8880
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8881
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8882
    s = __MKSMALLINT(Button1Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8883
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8884
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8885
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8886
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8887
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8888
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8889
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8890
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8891
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8892
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8893
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8894
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8895
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8896
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8897
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8898
    s = __MKSMALLINT(Button2Mask);
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
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8901
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8902
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8903
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8904
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8905
pointerPosition
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8906
    "return the current pointer position in root-window coordinates"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8907
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8908
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8909
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8910
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8911
    if (GetCursorPos(&p)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8912
	RETURN (__MKPOINT_INT(p.x, p.y));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8913
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8914
    RETURN (__MKPOINT_INT(0, 0));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8915
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8916
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8917
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8918
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8919
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8920
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8921
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8922
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8923
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8924
    |s |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8925
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8926
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8927
    s = __MKSMALLINT(Button3Mask);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8928
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8929
    ^ s
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8930
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8931
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8932
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8933
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8934
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8935
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8936
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8937
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8938
    |x y|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8939
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
    x = __MKSMALLINT(evRootX);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8942
    y = __MKSMALLINT(evRootY);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8943
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8944
    ^ x @ y
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8945
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8946
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8947
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8948
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8949
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8950
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8951
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8952
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8953
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8954
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8955
	ypos = __point_Y(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8956
	SetCursorPos(__intVal(xpos), __intVal(ypos));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8957
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8958
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8959
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8960
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8961
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8962
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8963
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8964
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8965
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8966
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8967
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8968
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  8969
    self setCursorPosition:(self translatePoint:newPosition from:aWindowId to:rootView id).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8970
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8971
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8972
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8973
1461
6d8b022bfcd8 renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
  8974
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
  8975
    "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
  8976
     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
  8977
     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
  8978
     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
  8979
     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
  8980
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8981
    |rawInfo info|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8982
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8983
    ((w <= 0) or:[h <= 0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8984
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8985
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8986
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8987
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8988
    rawInfo := Array new:8.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8989
		  "1 -> bit order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8990
		  "2 -> depth"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8991
		  "3 -> bytes_per_line"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8992
		  "4 -> byte_order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8993
		  "5 -> format"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8994
		  "6 -> bitmap_unit"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8995
		  "7 -> bitmap_pad"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8996
		  "8 -> bits_per_pixel"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8997
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8998
    "/ 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
  8999
    "/ unlimitedStack (some implementations use alloca and require huge amounts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9000
    "/ of temporary stack space
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
    (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
  9003
	info := IdentityDictionary new.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9004
	info at:#bitOrder put:(rawInfo at:1).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9005
	info at:#depth put:(rawInfo at:2).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9006
	info at:#bytesPerLine put:(rawInfo at:3).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9007
	info at:#byteOrder put:(rawInfo at:4).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9008
	info at:#format put:(rawInfo at:5).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9009
	info at:#bitmapUnit put:(rawInfo at:6).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9010
	info at:#bitmapPad put:(rawInfo at:7).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9011
	info at:#bitsPerPixel put:(rawInfo at:8).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9012
	^ info
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9013
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9014
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9015
     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
  9016
     or is too small to hold the bits
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9017
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9018
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9019
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9020
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9021
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
  9022
    "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
  9023
     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
  9024
     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
  9025
     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
  9026
     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
  9027
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9028
    |rawInfo info|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9029
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9030
    ((w <= 0) or:[h <= 0]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9031
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9032
	^ nil
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9033
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9034
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9035
    rawInfo := Array new:8.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9036
		  "1 -> bit order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9037
		  "2 -> depth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9038
		  "3 -> bytes_per_line"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9039
		  "4 -> byte_order"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9040
		  "5 -> format"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9041
		  "6 -> bitmap_unit"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9042
		  "7 -> bitmap_pad"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9043
		  "8 -> bits_per_pixel"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9044
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9045
    "/ 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
  9046
    "/ 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
  9047
    "/ of temporary stack space
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
    (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
  9050
	info := IdentityDictionary new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9051
	info at:#bitOrder put:(rawInfo at:1).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9052
	info at:#depth put:(rawInfo at:2).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9053
	info at:#bytesPerLine put:(rawInfo at:3).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9054
	info at:#byteOrder put:(rawInfo at:4).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9055
	info at:#format put:(rawInfo at:5).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9056
	info at:#bitmapUnit put:(rawInfo at:6).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9057
	info at:#bitmapPad put:(rawInfo at:7).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9058
	info at:#bitsPerPixel put:(rawInfo at:8).
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9059
	^ info
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9060
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9061
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9062
     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
  9063
     or is too small to hold the bits
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9064
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9065
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9066
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9067
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9068
getPixelX:x y:y from:aDrawableId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9069
    "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
  9070
     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
  9071
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9072
    'getPixelX:y:from: not yet implemented' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9073
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9074
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9075
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9076
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
  9077
    "since XGetImage may allocate huge amount of stack space
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9078
     (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
  9079
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9080
    "'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
  9081
    ^ false"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9082
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9083
    int            height, width;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9084
    int            numBytes;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9085
    HWND        hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9086
    HBITMAP hBitmap = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9087
    HDC bDC = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9088
    struct
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9089
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9090
      BITMAPINFOHEADER bmiHeader;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9091
      DWORD r;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9092
      DWORD g;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9093
      DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9094
    } bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9095
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9096
    if (__isExternalAddress(aDrawableId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9097
     && __bothSmallInteger(srcX, srcY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9098
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9099
     && __isArray(info)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9100
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9101
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9102
	hWnd = _HWNDVal( aDrawableId );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9103
	DPRINTF(("primGetBits %x\n",hWnd));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9104
	if( hWnd != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9105
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9106
	    HDC wDC = GetDC(hWnd);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9107
	    bDC = CreateCompatibleDC(__rootDC);
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9108
	    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
  9109
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9110
	    width  =  __intVal(w);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9111
	    DPRINTF(("width %d height %d\n",width,height));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9112
	    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
  9113
	    if (!hBitmap)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9114
	      goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9115
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9116
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9117
	    bitmap.bmiHeader.biPlanes = 1;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9118
	    if (__depth == 24)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9119
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9120
	      bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9121
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9122
	    else if (__depth == 16)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9123
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9124
	      /*bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9125
	      bitmap.bmiHeader.biCompression = BI_BITFIELDS;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9126
	      bitmap.b = 0x001f;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9127
	      bitmap.g = 0x07e0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9128
	      bitmap.r = 0xf800;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9129
	      bitmap.b = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9130
	      bitmap.g = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9131
	      bitmap.r = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9132
	      bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9133
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9134
	    bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9135
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9136
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9137
	    bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9138
	    bitmap.bmiHeader.biClrImportant = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9139
	    bitmap.bmiHeader.biBitCount = __depth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9140
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  9141
	    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
  9142
	    bitmap.bmiHeader.biHeight = -height;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9143
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9144
	    SelectObject(bDC,hBitmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9145
	    if (BitBlt(bDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9146
		   0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9147
		   width,height,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9148
		   wDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9149
		   __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9150
		   SRCCOPY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9151
		 == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9152
		)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9153
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9154
	       printf("ERROR in GetBitsFrom: BitBlt\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9155
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9156
	    ReleaseDC(hWnd,wDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9157
	    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
  9158
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9159
		printf("noinfo returned\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9160
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9161
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9162
	    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
  9163
	    numBytes = bitmap.bmiHeader.biSizeImage;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9164
	    if( numBytes != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9165
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9166
	      if (numBytes > __byteArraySize(imageBits)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9167
		  /* imageBits too small */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9168
		  printf("provided byteArray too small\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9169
		  goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9170
	      }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9171
	      DPRINTF(("numBytes %d\n",numBytes));
2000
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
	      bitmap.bmiHeader.biHeight = -height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9174
	      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
  9175
	      {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9176
		  printf("zero bits returned\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9177
		  goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9178
	      }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9179
	      else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9180
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9181
		char *c = __ByteArrayInstPtr(imageBits)->ba_element;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9182
		int n = numBytes;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9183
		for (;n > 0;n -= 3,c += 3)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9184
		{
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9185
		  char b = c[0];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9186
		  c[0] = c[2];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9187
		  c[2] = b;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9188
		}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9189
	      }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9190
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9191
	    else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9192
	    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9193
		printf("unacceptable bitmap\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9194
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9195
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9196
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9197
	else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9198
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9199
	    printf("unacceptable bitmap\n");
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9200
	    goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9201
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9202
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9203
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9204
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9205
	__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
  9206
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9207
	__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9208
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9209
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9210
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9211
	if (bDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9212
	  DeleteDC(bDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9213
	if (hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9214
	  DelObject(hBitmap);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9215
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9216
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9217
fail:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9218
    if (bDC)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9219
      DeleteDC(bDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9220
    if (hBitmap)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9221
      DelObject(hBitmap);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9222
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9223
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9224
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9225
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9226
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9227
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
  9228
    "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
  9229
     (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
  9230
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9231
%{  /* xxLIMITEDSTACK */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9232
    int            height, width;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9233
    int            numBytes;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9234
    unsigned char* ep = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9235
    HBITMAP        xBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9236
    HBITMAP hBitmap = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9237
    HDC bDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9238
    HDC xDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9239
    struct
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9240
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9241
      BITMAPINFOHEADER bmiHeader;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9242
      DWORD rgb[2];
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9243
    } bitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9244
    BITMAP bitmapInfo;
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
    if (__isExternalAddress(aDrawableId)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9247
     && __bothSmallInteger(srcX, srcY)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9248
     && __bothSmallInteger(w, h)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9249
     && __isArray(info)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9250
     && __isByteArray(imageBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9251
    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9252
	xBitmap = _HBITMAPVAL( aDrawableId );
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9253
	DPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9254
	if( xBitmap != 0 )
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9255
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9256
	    xDC = GetDC(0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9257
	    SelectObject(xDC,xBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9258
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
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
	    bDC = CreateCompatibleDC(__rootDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9261
	    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
  9262
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9263
	    width  =  __intVal(w);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9264
	    DPRINTF(("width %d height %d\n",width,height));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9265
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9266
	    hBitmap = CreateCompatibleBitmap(xDC,width,height);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9267
	    if (!hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9268
	      goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9269
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9270
	    SelectObject(bDC,hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9271
	    if (BitBlt(bDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9272
		   0,0,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9273
		   width,height,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9274
		   xDC,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9275
		   __intVal(srcX), __intVal(srcY),
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9276
		   SRCCOPY)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9277
		 == 0
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
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9280
	       DPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9281
	       goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9282
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9283
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9284
	    bitmap.bmiHeader.biPlanes = 1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9285
	    if (__depth == 24)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9286
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9287
	      /*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9288
	      bitmap.r = 0xff0000;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9289
	      bitmap.g = 0x00ff00;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9290
	      bitmap.b = 0x0000ff;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9291
	      bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9292
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9293
	    else if (__depth == 16)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9294
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9295
	      /*bitmap.bmiHeader.biCompression = BI_RGB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9296
	      bitmap.bmiHeader.biCompression = BI_BITFIELDS;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9297
	      bitmap.b = 0x001f;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9298
	      bitmap.g = 0x07e0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9299
	      bitmap.r = 0xf800;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9300
	      bitmap.bmiHeader.biCompression = BI_RGB;
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.biSizeImage = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9303
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9304
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9305
	    bitmap.bmiHeader.biClrUsed = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9306
	    bitmap.bmiHeader.biClrImportant = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9307
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9308
	    bitmap.bmiHeader.biWidth = width;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9309
	    bitmap.bmiHeader.biHeight = -height;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9310
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9311
/* XXX - this seems to overwrite by stack frame ....
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9312
 * check args
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9313
 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9314
	    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
  9315
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9316
		DPRINTF(("noinfo returned\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9317
		goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9318
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9319
	    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
  9320
	    numBytes = bitmap.bmiHeader.biSizeImage;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9321
	    if( numBytes != 0 )
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9322
	    {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9323
	      if (numBytes > __byteArraySize(imageBits)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9324
		  /* imageBits too small */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9325
		  DPRINTF(("provided byteArray too small\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9326
		  goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9327
	      }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9328
	      DPRINTF(("numBytes %d\n",numBytes));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9329
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9330
	      bitmap.bmiHeader.biHeight = -height;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9331
	      bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9332
	      bitmap.rgb[0] = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9333
	      bitmap.rgb[1] = 0xffffff;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9334
	      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
  9335
	      {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9336
		DPRINTF(("zero bits returned\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9337
		goto fail;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9338
	      }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9339
	    }
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9340
	    else
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
		DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9343
		goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9344
	    }
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9345
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9346
	else
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9347
	{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9348
	    DPRINTF(("unacceptable bitmap\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9349
	    goto fail;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9350
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9351
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9352
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9353
	__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
  9354
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9355
	__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
  9356
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9357
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9358
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9359
	if (bDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9360
	  DeleteDC(bDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9361
	if (xDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9362
	  ReleaseDC(0,xDC);//DeleteDC(xDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9363
	if (hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9364
	  DelObject(hBitmap);
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9365
	RETURN ( true );
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
fail:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9368
    if (bDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9369
      DeleteDC(bDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9370
    if (xDC)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9371
      ReleaseDC(0,xDC);//DeleteDC(xDC);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9372
    if (hBitmap)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9373
      DelObject(hBitmap);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9374
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9375
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9376
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9377
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9378
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9379
!WinWorkstation methodsFor:'selections'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9380
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9381
getClipboardData
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9382
%{
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9383
    HANDLE hClip;
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9384
    HANDLE hData;
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9385
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9386
    hClip = OpenClipboard(NULL);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9387
    hData = GetClipboardData(CF_TEXT);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9388
    CloseClipboard();
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9389
printf("%s\n", (char *)hData);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9390
%}
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9391
!
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9392
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9393
getSelectionFor:drawableId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9394
    'getSelectionFor: not yet implemented' errorPrintCR.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9395
    ^ nil
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9396
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9397
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9398
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9399
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9400
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9401
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9402
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9403
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9404
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9405
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9406
     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
  9407
     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
  9408
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9409
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9410
    <resource: #style (#viewSpacing
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9411
		       #borderColor #borderWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9412
		       #viewBackground #shadowColor #lightColor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9413
		      )>
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9414
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9415
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9416
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9417
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9418
"/        ^ Color black
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9419
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9420
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9421
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9422
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9423
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9424
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9425
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9426
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9427
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9428
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9429
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9430
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9431
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9432
"/    aKey == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9433
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9434
"/    ].
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 == #textForegroundColor 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 == #textBackgroundColor 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
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9444
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9445
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9446
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9447
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9448
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9449
clearRectangleX:x y:y width:width height:height in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9450
    "clear a rectangular area to viewbackground"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9451
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9452
    DPRINTF(("clearRect\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9453
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9454
    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
  9455
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9456
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9457
clearWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9458
    "clear a window to viewbackground"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9459
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9460
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9461
    DPRINTF(("clearWin\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9462
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9463
    super clearWindow:aWindowId
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9466
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9467
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9468
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9469
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9470
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9471
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9472
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9473
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9474
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9475
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9476
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9477
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9478
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9479
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9480
	{
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9481
	    CPRINTF(("lowerWindow %x\n",win));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9482
	    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
  9483
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9484
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9485
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9486
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9487
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9488
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9489
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
  9490
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9491
    "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
  9492
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9493
    "/ 'mapView:id:iconified:...height: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9494
%{  /* xxLIMITEDSTACK */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9495
    RECT rec;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9496
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9497
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9498
     && __bothSmallInteger(w, h)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9499
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9500
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9501
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9502
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9503
	    rec.left = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9504
	    rec.top = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9505
	    rec.right = rec.left + __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9506
	    rec.bottom = rec.top + __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9507
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9508
	    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
  9509
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9510
	    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
  9511
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9512
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9513
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9514
			 rec.right - rec.left, rec.bottom - rec.top,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9515
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9516
	    if (aBoolean == true)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9517
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9518
	      ShowWindow(win, SW_SHOWMINIMIZED);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9519
	      enqEvent(0,win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9520
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9521
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9522
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9523
	      enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9524
	      //ShowWindow(win, SW_RESTORE);
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9525
	      ShowWindow(win, SW_SHOWNOACTIVATE);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9526
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9527
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9528
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9529
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9530
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9531
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9532
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9533
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9534
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9535
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9536
%{  /* xxLIMITEDSTACK */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9537
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9538
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9539
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9540
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9541
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9542
	    CPRINTF(("mapWindow %x\n",win));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9543
	    ShowWindow(win, SW_SHOWNOACTIVATE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9544
	    //ShowWindow(win, SW_SHOW);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9545
	    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
  9546
	    //enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9547
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9548
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9549
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9550
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9551
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9552
2251
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9553
activateWindow:aWindowId
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9554
    "make a window active"
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9555
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9556
%{  /* xxLIMITEDSTACK */
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9557
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9558
    if (__isExternalAddress(aWindowId)) {
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9559
	HWND win = _HWNDVal(aWindowId);
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9560
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9561
	if (win) {
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9562
	    CPRINTF(("activateWindow %x\n",win));
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9563
	    ShowWindowAsync(win, SW_SHOW | SW_SHOWNORMAL);
2251
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9564
	    //ShowWindow(win, SW_SHOW);
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9565
	    //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
  9566
	    //enqEvent(0,win, WM_SHOWWINDOW, TRUE, 0, 0, 0, 0);
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9567
	}
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9568
	RETURN ( self );
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9569
    }
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9570
%}
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9571
!
43d624ce346f crash in setBackground - fixed
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  9572
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9573
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9574
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9575
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9576
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9577
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9578
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9579
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9580
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9581
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9582
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9583
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9584
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9585
	    rec.left = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9586
	    rec.top = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9587
	    rec.right = rec.left + __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9588
	    rec.bottom = rec.top + __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9589
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9590
	    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
  9591
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9592
	    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
  9593
			 rec.right - rec.left, rec.bottom - rec.top));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9594
	    SetWindowPos(win, (HWND)0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9595
			 rec.left, rec.top,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9596
			 rec.right - rec.left, rec.bottom - rec.top,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9597
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOZORDER|SWP_NOOWNERZORDER);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9598
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9599
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9600
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9601
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9602
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9603
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9604
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9605
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9606
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9607
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9608
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9609
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9610
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9611
     && __bothSmallInteger(x, y)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9612
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9613
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9614
	if (win)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9615
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9616
	    rec.left = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9617
	    rec.top = __intVal(y);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9618
	    rec.right = rec.left + 10;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9619
	    rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9620
#ifdef ADJUSTWINDOW
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9621
	    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
  9622
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9623
	    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
  9624
	    SetWindowPos(win, (HWND)0,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9625
			 rec.left, rec.top,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9626
			 0, 0,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9627
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER|SWP_NOOWNERZORDER);
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
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9630
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9631
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9632
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9633
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9634
primSetWindowIconId:wiconId width:wiconWidth height:wiconHeight in:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9635
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9636
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9637
    unsigned char* cp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9638
    unsigned char* ep;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9639
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9640
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9641
    int            height, width;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9642
    int            nBytes, nBits;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9643
    int            index;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9644
    HICON          xIcon = (HICON)0, yIcon = (HICON)0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9645
    unsigned char *allocatedBits = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9646
    unsigned char fastBits[10000];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9647
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9648
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9649
     && __isExternalAddress(wiconId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9650
     && __bothSmallInteger(wiconWidth, wiconHeight))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9651
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9652
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9653
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9654
	xBitMap = _HBITMAPVAL( wiconId );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9655
	if( xBitMap != 0 )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9656
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9657
	  BITMAP bm;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9658
	  if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9659
	  {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9660
	    int d = bm.bmPlanes * bm.bmBitsPixel;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9661
	    BYTE *ep,*bp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9662
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9663
	    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
  9664
	    height = __intVal( wiconHeight );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9665
	    width  = __intVal( wiconWidth  );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9666
	    nBytes = ( width + 31 ) / 8;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9667
	    nBytes = height * nBytes;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9668
	    if (nBytes < sizeof(fastBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9669
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9670
		ep = fastBits;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9671
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9672
	    else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9673
	    {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9674
		ep = allocatedBits = (unsigned char *) malloc(nBytes);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9675
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9676
	    if( ep != 0 ) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9677
		memset(ep,0,nBytes);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9678
		maskBitmap = CreateBitmap(width, height, 1, 1, ep );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9679
		if( maskBitmap != NULL ) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9680
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9681
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9682
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9683
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9684
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9685
		    DPRINTF(( "ICON CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9686
		    DelObject( maskBitmap );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9687
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9688
		    DPRINTF(( "BITMAP mask CREATION failed!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9689
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9690
	    } else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9691
		PRINTF(( " malloc failed\n" ));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9692
	    }
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9693
	    if (allocatedBits)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9694
		free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9695
	  }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9696
	} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9697
	    DPRINTF((" xBitMap is zero \n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9698
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9699
	if (xIcon) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9700
#ifndef TOPWINDOWCLASS
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9701
	   yIcon = (HICON)GetClassLong(win,GCL_HICON);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9702
	   SetClassLong(win,GCL_HICON,(DWORD)xIcon);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9703
/* 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
  9704
	    if( yIcon ) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9705
		if( DestroyIcon( yIcon ) )
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9706
		    DPRINTF(( "Old icon deleted\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9707
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9708
#else
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  9709
	    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
  9710
	    SendMessage(_thread_newWinHandle,WM_SETICON,ICON_BIG,(LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9711
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9712
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9713
	RETURN (self);
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
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9716
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9717
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9718
raiseWindow:aWindowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9719
    "bring a window to front"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9720
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9721
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9722
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9723
    if (__isExternalAddress(aWindowId)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9724
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9725
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9726
	if (hWnd) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  9727
	    CPRINTF(("raiseWindow %x\n",hWnd));
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9728
	    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
  9729
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9730
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9731
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9732
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9733
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9734
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9735
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9736
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9737
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9738
%{  /* xxLIMITEDSTACK (WIN95 only) */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9739
    RECT rec;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9740
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9741
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9742
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9743
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9744
	if (hWnd)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9745
	{
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9746
	    rec.left = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9747
	    rec.top = 0;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9748
	    rec.right = __intVal(w);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9749
	    rec.bottom = __intVal(h);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9750
#ifdef ADJUSTWINDOW
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9751
	    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
  9752
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9753
	    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
  9754
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9755
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9756
			 rec.right - rec.left, rec.bottom - rec.top,
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9757
			 SWP_NOSENDCHANGING|SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER|SWP_NOOWNERZORDER);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9758
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9759
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9760
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9761
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9762
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9763
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9764
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9765
    "turn on/off backing-store for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9766
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9767
    'setBackingStore:in: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9768
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9769
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9770
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9771
    "set bit gravity for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9772
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9773
    "/ 'setBitGravity:in: not yet implemented' errorPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9774
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9775
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9776
setCursor:aCursorId in:aWindowId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9777
    "define a windows cursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9778
     Ignored here, since in windows, an application
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9779
     has to manage the cursor itself."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9780
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9781
%{  /* xxLIMITEDSTACK (WIN95 only) */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9782
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9783
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9784
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9785
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9786
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9787
     && __isExternalAddress(aCursorId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9788
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9789
	POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9790
2240
bc95654feffb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2239
diff changeset
  9791
	/*printf("setCursor:in:\n");*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9792
	SetWindow_Cursor(win, _HCURSORVal(aCursorId));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9793
#if 1
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9794
	GetCursorPos(&p);
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9795
	if (WindowFromPoint(p) == win)
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9796
	{
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9797
	   PostMessage(win,WM_THREADSETCURSOR,0,(INT)_HCURSORVal(aCursorId));
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  9798
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9799
#else
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9800
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9801
	 * if the pointer is currently in that window ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9802
	 */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9803
	GetCursorPos(&p);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9804
	if (1/*WindowFromPoint(p) == win*/)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9805
	{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9806
	   SetCursor(_HCURSORVal(aCursorId));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9807
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9808
#endif
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9809
	RETURN ( self );
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9810
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9811
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9812
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9813
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9814
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9815
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9816
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9817
%{  /* xxLIMITEDSTACK (WIN95 only) */
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9818
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9819
    if (__isExternalAddress(aWindowId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9820
     && (__isString(aString) || __isSymbol(aString))) {
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9821
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9822
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9823
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9824
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9825
    }
2000
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
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9828
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9829
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9830
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9831
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9832
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9833
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9834
setTransient:aWindowId for:aMainWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9835
    "set aWindowId to be a transient of aMainWindow"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9836
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9837
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9838
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9839
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9840
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9841
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9842
     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
  9843
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9844
%{  /* xxLIMITEDSTACK (WIN95 only) */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9845
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9846
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9847
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9848
	HWND hWnd = _HWNDVal(aWindowId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9849
	/*HBRUSH hBrush = CreateSolidBrush(st2RGB(__intVal(aColorIndex),0));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9850
	if (GetWindow_bgBrush(hWnd))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9851
	  DelObject(GetWindow_bgBrush(hWnd));*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9852
	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
  9853
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9854
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
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
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9859
    "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
  9860
     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
  9861
     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
  9862
     with opaque drawing."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9863
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9864
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9865
    DPRINTF(("setWindowBackgroundPixmap:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9866
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9867
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9868
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9869
setWindowBorderColor:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9870
    "set the windows border color"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9871
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9872
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9873
    DPRINTF(("setWindowBorderColor:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
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
setWindowBorderPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9878
    "set the windows border pattern"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9879
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9880
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9881
    DPRINTF(("setWindowBorderPixmap:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9882
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9883
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9884
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9885
setWindowBorderWidth:aNumber in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9886
    "set the windows border width"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9887
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9888
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9889
    DPRINTF(("setWindowBorderWidth:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9890
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9891
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9892
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9893
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9894
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9895
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9896
     select client specific resources."
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9897
%{  /* NOCONTEXT */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9898
    DPRINTF(("setWindowClass:name:in: not yet implemented\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9899
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9900
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9901
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9902
setWindowGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9903
    "set window gravity for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9904
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9905
%{  /* NOCONTEXT */
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9906
    DPRINTF(("setWindowGravity:in: not yet implemented\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9907
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9908
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9909
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9910
setWindowIcon:aForm in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9911
    "define a bitmap to be used as icon"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9912
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9913
    |wiconId wiconHeight wiconWidth|
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9914
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9915
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9916
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9917
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9918
	wiconWidth  := aForm width.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9919
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9920
	    primSetWindowIconId:wiconId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9921
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9922
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9923
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  9924
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9925
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9926
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9927
setWindowIcon:aForm mask:aMaskForm in:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9928
    "set a windows icon & iconMask"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9929
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9930
%{  /* NOCONTEXT */
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9931
    DPRINTF(("setWindowIcon:mask:in: not yet implemented\n"));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9932
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9933
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9934
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9935
setWindowIconWindow:aView in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9936
    "define a window to be used as icon"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  9937
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9938
    'setWindowIcon:in: not yet implemented' printCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9939
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9940
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9941
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9942
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9943
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9944
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9945
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9946
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9947
     && (__isString(aString) || __isSymbol(aString))) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9948
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9949
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9950
	SetWindowText(win, __stringVal(aString));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9951
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9952
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9953
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9954
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9955
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9956
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9957
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9958
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9959
%{  /* xxLIMITEDSTACK (WIN95 only) */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9960
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9961
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9962
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9963
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9964
	if (win) {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9965
	    CPRINTF(("unmapWindow %x\n",win));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9966
	    ShowWindow(win, SW_HIDE);
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  9967
	    CPRINTF(("unmapWindow1 %x\n",win));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9968
	    //enqEvent(win, WM_SHOWWINDOW, FALSE, 0, 0, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9969
	}
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9975
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9976
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9977
version
2329
73bb4001db25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2328
diff changeset
  9978
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.59 1998-09-11 13:59:46 cg Exp $'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9979
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9980
WinWorkstation initialize!