Link with C++ linker
[oweals/cde.git] / cde / programs / dticon / constants.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: constants.h /main/3 1995/11/02 14:03:35 rswiston $ */
24 /*********************************************************************
25 *  (c) Copyright 1993, 1994 Hewlett-Packard Company     
26 *  (c) Copyright 1993, 1994 International Business Machines Corp.
27 *  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
28 *  (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
29 *      Novell, Inc.
30 **********************************************************************/
31 #include <X11/Xlib.h>
32
33 /***
34 #define DEBUG         True
35 ***/
36
37 #define CLASS_NAME    "Dticon"
38
39 /*
40  * This is the linked list of Help dialogs, which
41  * will be created dynamically, as needed.
42  */
43
44 typedef struct _helpStruct {
45     struct _helpStruct *pNext;
46     struct _helpStruct *pPrev;
47     Widget dialog;
48     Boolean inUse;
49 } HelpStruct;
50
51 typedef struct {
52     Boolean useBMS;
53     String  session;
54     String  bmSuffix;
55     String  pmSuffix;
56     int     maxIconWidth;
57     int     maxIconHeight;
58     Boolean useFileFilter;
59     Boolean useFileLists;
60 } ApplicationData, *ApplicationDataPtr;
61
62 typedef struct {
63     Boolean   useSession;
64     int       iconicState;
65     Position  x, y;
66     Dimension width, height;
67 } SessionData, *SessionDataPtr;
68
69 typedef struct {
70     XColor       xcolor;                /* pixel #, red, blue, green, etc. */
71     Pixel        mono;                  /* black or white pixel for mono   */
72     Pixel        newCell;               /* new color cell for grab-screen  */
73 } PixelTableItem;
74
75 typedef struct {
76     int              pixelTableSize;    /* number of allocated table items */
77     int              numItems;          /* number of items in the table    */
78     int              lastFound;         /* last lookup result, check first */
79     PixelTableItem  *item;              /* array of actual table entries   */
80 } PixelTable;
81
82 #define PIXEL_TABLE_MONO(i)      pixelTable.item[i].mono
83 #define PIXEL_TABLE_NEW_CELL(i)  pixelTable.item[i].newCell
84 #define PIXEL_TABLE_INC 20          /* size to increase table by each time */
85
86 #ifndef NULL
87 #define NULL   0
88 #endif
89
90 /* Maximum icon demensions */
91 #define MAX_ICON_WIDTH   256
92 #define MAX_ICON_HEIGHT  256
93
94 /* Maximum icon demensions */
95 #define MAX_FNAME        256
96
97 #define min(a, b)       ((a < b) ? a : b)
98 #define max(a, b)       ((a > b) ? a : b)
99 #ifndef abs
100 #define abs(a)          (((a) < 0) ? -(a) : (a))
101 #endif
102 #define mag(a,b)        ((a-b) < 0 ? (b-a) : (a-b))
103
104 #define DARK            0
105 #define LIGHT           1
106
107 /* rotation direction */
108 #define ROTATE_L        1
109 #define ROTATE_R        2
110
111 /* File I/O flags */
112 #define READ_FLAGS (XpmColorSymbols)
113 #define WRITE_FLAGS (XpmSize|XpmHotspot|XpmCharsPerPixel|XpmInfos)
114
115 /* State flags for Init_Icons() */
116 #define DO_NOT_SAVE     0
117 #define DO_SAVE         1
118
119 /* Graphics Ops. tools */
120 #define POINT           1
121 #define FLOOD           2
122 #define LINE            3
123 #define POLYLINE        4
124 #define RECTANGLE       5
125 #define POLYGON         6
126 #define CIRCLE          7
127 #define ELLIPSE         8
128 #define ERASER          9
129 #define SELECT         10
130
131 /* Secondary Graphics Ops. */
132 #define S_WAIT_RELEASE 99
133 #define S_PASTE       100
134 #define S_ROTATE      101
135 #define S_SCALE_1     102
136 #define S_SCALE_2     103
137 #define S_HOTSPOT     104
138 #define S_GRAB        105
139
140 /* Interrupt flags for SELECT Ops. */
141 #define INITIAL         0
142 #define CONTINUE        1
143
144 #define NUM_GFX_OPS    11       /* number of Graphics Ops. tools + 1*/
145 #define DEFAULT_MAG     8       /* default magnification factor */
146 #define GAMMA_CUTOFF  150       /* x-over pt. for black/white fg color */
147 #define NUM_STATICS    16       /* number of static colors */
148 #define NUM_DYNAMICS    6       /* number of dynamic colors */
149 #define NUM_PENS      (NUM_STATICS+NUM_DYNAMICS)
150
151 /* max. points for polylines/polygons */
152 #define MAX_PTS       200
153
154 /* dialog state flag values */
155 #define NONE            0
156 #define NEW             1
157 #define OPEN            2
158 #define SAVE            3
159 #define SAVE_AS         4
160 #define GRAB            5
161 #define DROP            6
162 #define QUIT           99
163
164 /* Transfer_Back_Image() state flag values */
165 #define HOLLOW          0
166 #define FILL            1
167
168 /* File I/O state flag values */
169 #define FILE_READ       0
170 #define FILE_WRITE      1
171
172 /* output file format flags */
173 #define FORMAT_XPM      0
174 #define FORMAT_XBM      1
175 #define FORMAT_NONE     2
176
177 /* which color block? */
178 #define STATIC_COLOR    0
179 #define DYNAMIC_COLOR   1
180
181 /* static color flags */
182 #define COLOR1          0
183 #define COLOR2          1
184 #define COLOR3          2
185 #define COLOR4          3
186 #define COLOR5          4
187 #define COLOR6          5
188 #define COLOR7          6
189 #define COLOR8          7
190 #define GREY1           8
191 #define GREY2           9
192 #define GREY3          10
193 #define GREY4          11
194 #define GREY5          12
195 #define GREY6          13
196 #define GREY7          14
197 #define GREY8          15
198
199 /* dynamic color flags */
200 #define BG_COLOR      100
201 #define FG_COLOR      101
202 #define TS_COLOR      102
203 #define BS_COLOR      103
204 #define SELECT_COLOR  104
205 #define TRANS_COLOR   105
206
207 /* flip orientation flags */
208 #define HORIZONTAL      0
209 #define VERTICAL        1
210
211 /* magnification factor flags */
212 #define MAG_2X    2
213 #define MAG_3X    3
214 #define MAG_4X    4
215 #define MAG_5X    5
216 #define MAG_6X    6
217 #define MAG_8X    8
218 #define MAG_10X  10
219 #define MAG_12X  12
220
221 /* command-line parameter flags */
222 #define AUTO_FILE        0
223 #define AUTO_SIZE        1
224 #define NUM_PARAMS       2