File: XpmButtonP.h

package info (click to toggle)
xtel 3.1.4-4
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,988 kB
  • ctags: 4,359
  • sloc: ansic: 14,674; makefile: 3,931; sh: 41
file content (264 lines) | stat: -rw-r--r-- 7,270 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
/*	
 *   Copyright (C) 1995  Pierre Ficheux (pierre@rd.lectra.fr)
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
#ident "$Id: XpmButtonP.h,v 1.1 1996/09/14 22:27:47 pierre Exp $"

/* 
 * XpmButtonP.h - Private definitions for XpmButton widget
 */

#ifndef _XpmButtonP_h
#define _XpmButtonP_h

#ifdef USE_MOTIF
#include <Xm/PrimitiveP.h>
#else
#include <X11/Xaw/SimpleP.h>
#endif
#include <X11/xpm.h>

#include "XpmButton.h"

/* XPM */
static char * default_xpm[] = {
"31 56 10 1",
" 	c white",
".	c sienna",
"X	c peru",
"o	c wheat",
"O	c black",
"+	c lemon chiffon",
"@	c slate grey",
"#	c red",
"$	c tan",
"%	c green",
"             .......XX         ",
"           ..XXXXX...XX        ",
"          ..XX........X.       ",
"         .XXX..oooooo....      ",
"         XX.XoooooooooX .      ",
"         ....oOOOooOOOoX..     ",
"         .X..o O oo O oX...    ",
"         .X.ooO+OooO+OoX.X.    ",
"        ..X.ooo++Oo+++oX.XX.   ",
"        ..X.Xoo+++Oo+oX...X..  ",
"        ..X.X@@oooooo@X...XX.  ",
"      OO.XX..Xoo#OO#oX.XX......",
"   OOO..XX....Xoo##ooX..XXXX...",
"  O....XX...X..XooooXX.....XX..",
"O...............@@@.....oooOXX.",
"    ..O...XXX..o@@...X..OoooO..",
"  O..O...XX...o..XX..X..oooooO.",
"  O.OXX.XX...oo.XX.o.X.$ooooooO",
" O..XX..o..o.o....o..X..ooooooo",
"O.X....o.XXoo..oooo..X.O$oooooo",
"O.OO.Oo....oo.oo+++o.XXXO$ooooo",
" O .OO%o+++oooo+++++o..XOO$$ooo",
"  . %%%%++++oO++++++%%..OOO$$oo",
"   O%%%%%%%oO+++%%%%%%%%O$O$$oo",
"   %%%%%%%%%O%%%%%%%%%%%O$OO$$o",
"  %%%%%%%%%%O%%%%%%%%%%%O$$..$$",
"  %%%%%%%%%%%%%%%%%%%%%%O$$.X.$",
"   %%%%%%%%%%%%%%%%%%%%%O$..X..",
"    %%%%%%%%%%%%%%%%%%%O$$..XX.",
"     O%%%OO$OO%%%%%%%%OO$$...X.",
"      OOO$$$$$OO%%%%%OO$$$.X.X.",
"      OXO$$ooo$$OOOOO$$$o..X...",
"      OX.$ooooo$$$$$$$$oo..XX..",
"     OOX.$ooooooo$oooooo..X.XX.",
"    OXX. $oooooooooooooo.XX....",
"   O ... $oooooooooooooo..O.X..",
"    .O.O $oooooOooooooo.XO..XX.",
"   .   .$$ooo$$O$$ooooo...O.OXX",
"      . $oooooOOooooooo@....OO.",
"        $oooooooooooooooO..XX.O",
"       OoooooooooooooooooO..OX ",
"      OooooooooooooooooooOX OO ",
"      O%ooooooooooooooooooo. O ",
"     O%%%%%%oooooooooooooooO   ",
"     Oo%%%%%%%%%%%%ooooooooO   ",
"     Ooo%%%%%%%%%%%%%%%%%%oO   ",
"     Ooooo%%%%%%%%%%%%%%%%%O   ",
"     Ooooo%%%%%%%%%%%%%ooooO   ",
"     Oooooo%%%%%%%%ooooooooO   ",
"     Oooooo%%%%%%ooooooooooO   ",
"     Oooooooo%%%ooooooooooO    ",
"     OoooooooO+oooooooooooO    ",
"     OoooooooOoooooooooooO     ",
"      OooooooOoooooooooooO     ",
"      OoooooOoooooooooooO      ",
"      OoooooOoooooooooooO      "};


/* XPM */
static char *default_on_xpm[] = {
"31 56 10 1",
" 	c white",
".	c sienna",
"X	c peru",
"o	c wheat",
"O	c black",
"+	c lemon chiffon",
"@	c slate grey",
"#	c red",
"$	c tan",
"%	c magenta",
"             .......XX         ",
"           ..XXXXX...XX        ",
"          ..XX........X.       ",
"         .XXX..oooooo....      ",
"         XX.XoooooooooX .      ",
"         ....oOOOooOOOoX..     ",
"         .X..o O oo O oX...    ",
"         .X.ooO+OooO+OoX.X.    ",
"        ..X.ooo++Oo+++oX.XX.   ",
"        ..X.Xoo+++Oo+oX...X..  ",
"        ..X.X@@oooooo@X...XX.  ",
"      OO.XX..Xoo#OO#oX.XX......",
"   OOO..XX....Xoo##ooX..XXXX...",
"  O....XX...X..XooooXX.....XX..",
"O...............@@@.....oooOXX.",
"    ..O...XXX..o@@...X..OoooO..",
"  O..O...XX...o..XX..X..oooooO.",
"  O.OXX.XX...oo.XX.o.X.$ooooooO",
" O..XX..o..o.o....o..X..ooooooo",
"O.X....o.XXoo..oooo..X.O$oooooo",
"O.OO.Oo....oo.oo+++o.XXXO$ooooo",
" O .OOoo+++oooo+++++o..XOO$$ooo",
"  . O+++++++oO+++++++o..OOO$$oo",
"   O+++++++oO++++%%++++oO$O$$oo",
"   O%%+++++oO+++%##%+++oO$OO$$o",
"  O###+++++oO+o+%OO%++ooO$$..$$",
"  OO%%+++oooOoo++%%+++ooO$$.X.$",
"   OO++oooooOooo+++++ooOO$..X..",
"    OOooooOO$O$ooooooooO$$..XX.",
"     OOOOOO$OO$$$$ooo$OO$$...X.",
"      OOO$$$$$OO$$$$OOO$$$.X.X.",
"      OXO$$ooo$$OOOOO$$$o..X...",
"      OX.$ooooo$$$$$$$$oo..XX..",
"     OOX.$ooooooo$oooooo..X.XX.",
"    OXX. $oooooooooooooo.XX....",
"   O ... $oooooooooooooo..O.X..",
"    .O.O $oooooOooooooo.XO..XX.",
"   .   .$$ooo$$O$$ooooo...O.OXX",
"      . $oooooOOooooooo@....OO.",
"        $oooooooooooooooO..XX.O",
"       OoooooooooooooooooO..OX ",
"      O+oooooooooooooooooOX OO ",
"      Oo++oooooooo+++++++oO. O ",
"     Ooooo++......+$$oooo++O   ",
"     Ooooo$OO....O$$oooooooO   ",
"     Oooooo$$O..OO$ooooooooO   ",
"     Oooooo$$O.OO$$ooooooooO   ",
"     Ooooooo$OOO$$oooooooooO   ",
"     Ooooooo+$O$$+oooooooooO   ",
"     Ooooooo+$O$+ooooooooooO   ",
"     Oooooooo+O+ooooooooooO    ",
"     OoooooooO+oooooooooooO    ",
"     OoooooooOoooooooooooO     ",
"      OooooooOoooooooooooO     ",
"      OoooooOoooooooooooO      ",
"      OoooooOoooooooooooO      "};


/***********************************************************************
 *
 * XpmButton Widget Private Data
 *
 ***********************************************************************/

/************************************
 *
 *  Class structure
 *
 ***********************************/


   /* New fields for the XpmButton widget class record */
typedef struct _XpmButtonClass 
  {
    int makes_compiler_happy;  /* not used */
  } XpmButtonClassPart;

   /* Full class record declaration */
typedef struct _XpmButtonClassRec {
    CoreClassPart		core_class;
#ifdef USE_MOTIF
    XmPrimitiveClassPart  	primitive_class;
#else
    SimpleClassPart		simple_class;
#endif
    XpmButtonClassPart  	xpmbutton_class;
} XpmButtonClassRec;

extern XpmButtonClassRec xpmButtonClassRec;

/***************************************
 *
 *  Instance (widget) structure 
 *
 **************************************/

    /* New fields for the XpmButton widget record */
typedef struct {
    /* resources */
    XtCallbackList 	callback;
    Pixmap		pixmap1;
    Pixmap		pixmap2;
    Pixmap		shape1;
    Pixmap		shape2;
    Pixmap		unsensitive_bitmap;
    XFontStruct		*help_font;
    String		help_string;
    Pixel		help_background;
    Pixel		help_foreground;
    Pixel		shadow_color1;
    Pixel		shadow_color2;
    Dimension		shadow_thickness;

    /* private state */
    GC          	normal_GC;
    GC			color1_GC;
    GC			color2_GC;
    GC			help_GC;
    Pixmap		stipple;
    Window		help_window;
    XtIntervalId	id;
    Boolean     	set;
    Boolean     	help_armed;
} XpmButtonPart;



   /* Full widget declaration */
typedef struct _XpmButtonRec {
    CorePart         core;
#ifdef USE_MOTIF
    XmPrimitivePart  primitive;
#else
    SimplePart	     simple;
#endif
    XpmButtonPart    xpmbutton;
} XpmButtonRec;

#endif /* _XawXpmButtonP_h */