File: FGrid.h

package info (click to toggle)
xmbdfed 4.7patch1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,728 kB
  • ctags: 2,508
  • sloc: ansic: 37,440; makefile: 105
file content (286 lines) | stat: -rw-r--r-- 9,331 bytes parent folder | download
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
/*
 * Copyright 2004 Computing Research Labs, New Mexico State University
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
 * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
#ifndef _h_XmuttFontGrid
#define _h_XmuttFontGrid

/*
 * $Id: FGrid.h,v 1.12 2004/02/07 21:20:08 mleisher Exp $
 */

/*
 * This is the BDF Font Grid widget.
 */

#include <Xm/Xm.h>
#include "bdfP.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
 * A macro for prototypes.
 */
#undef __
#ifndef _NO_PROTO
#define __(x) x
#else
#define __(x) ()
#endif

#ifndef XmNbdfFont
#define XmNbdfFont "bdfFont"
#define XmCBDFFont "BDFFont"
#endif

#define XmNcodeBase "codeBase"
#define XmCCodeBase "CodeBase"

#define XmNpointSize "pointSize"
#define XmCPointSize "PointSize"

#define XmNhorizontalResolution "horizontalResolution"
#define XmCHorizontalResolution "HorizontalResolution"

#define XmNverticalResolution "verticalResolution"
#define XmCVerticalResolution "VerticalResolution"

#define XmNfontSpacing "fontSpacing"
#define XmCFontSpacing "FontSpacing"

#define XmNcellRows "cellRows"
#define XmCCellRows "CellRows"

#define XmNcellColumns "cellColumns"
#define XmCCellColumns "CellColumns"

#define XmNskipBlankPages "skipBlankPages"
#define XmCSkipBlankPages "SkipBlankPages"

#define XmNdisplayUnencoded "displayUnencoded"
#define XmCDisplayUnencoded "DisplayUnencoded"

#define XmNpageCallback "pageCallback"
#define XmCPageCallback "PageCallback"

#define XmNcodePageCallback "codePageCallback"
#define XmCCodePageCallback "CodePageCallback"

#define XmNstartSelectionCallback "startSelection"
#define XmCStartSelectionCallback "StartSelection"

#define XmNextendSelectionCallback "extendSelection"
#define XmCExtendSelectionCallback "ExtendSelection"

#define XmNendSelectionCallback "endSelection"
#define XmCEndSelectionCallback "EndSelection"

#define XmNmodifiedCallback "fontModified"
#define XmCModifiedCallback "FontModified"

#define XmNmultiClickTime "multiClickTime"
#define XmCMultiClickTime "MultiClickTime"

#define XmNgridOverwriteMode "gridOverwriteMode"
#define XmCGridOverwriteMode "GridOverwriteMode"

#define XmNpowersOfTwo "powersOfTwo"
#define XmCPowersOfTwo "PowersOfTwo"

#define XmNbitsPerPixel "bitsPerPixel"
#define XmCBitsPerPixel "CitsPerPixel"

#define XmNcolorList "colorList"
#define XmCColorList "ColorList"

#define XmNinitialGlyph "initialGlyph"
#define XmCInitialGlyph "InitialGlyph"

externalref WidgetClass xmuttFontGridWidgetClass;

typedef struct _XmuttFGridClassRec *XmuttFontGridWidgetClass;
typedef struct _XmuttFGridRec      *XmuttFontGridWidget;

#ifndef XmuttIsFontGrid
#define XmuttIsFontGrid(w) XtIsSubclass(w, xmuttFontGridWidgetClass)
#endif /* XmuttIsFontGrid */

typedef struct {
    long previous_page;
    long current_page;
    long next_page;
    Boolean unencoded;
    long num_unencoded;
    long num_encoded;
} XmuttFontGridPageInfoStruct;

#define XmuttFG_SELECTION_INFO   -1
#define XmuttFG_ACTIVATE          0
#define XmuttFG_START_SELECTION   1
#define XmuttFG_EXTEND_SELECTION  2
#define XmuttFG_END_SELECTION     3
#define XmuttFG_DELETE            4
#define XmuttFG_INSERT            5
#define XmuttFG_REPLACE           6
#define XmuttFG_REPLACE_MAPPINGS  7
#define XmuttFG_NAME_CHANGE       8
#define XmuttFG_RESIZE            9
#define XmuttFG_MODIFIED          10
#define XmuttFG_GLYPH_NAME_CHANGE 11

typedef struct {
    int reason;
    long start;
    long end;
    int base;
    bdf_glyph_t *glyphs;
    unsigned long num_glyphs;
    Boolean unencoded;
} XmuttFontGridSelectionStruct;

typedef struct {
    int reason;
    long start;
    long end;
    char *font_name;
    Boolean unencoded;
} XmuttFontGridModifiedCallbackStruct;

typedef struct {
    char *name;
    char *comments;
    char *messages;
    long bits_per_pixel;
    long default_char;
    long point_size;
    unsigned short monowidth;
    unsigned short spacing;
    long font_ascent;
    long font_descent;
    long resolution_x;
    long resolution_y;
    bdf_bbx_t bbx;
} XmuttFontGridFontInfoStruct;

/*
 * Paste type operations for XmuttFontGridPasteSelection().
 */
#define XmuttFG_NORMAL_PASTE  0
#define XmuttFG_INSERT_PASTE  1
#define XmuttFG_MERGE_PASTE   2
#define XmuttFG_OVERLAY_PASTE 2

extern void XmuttFontGridUpdateMetrics __((Widget w, bdf_metrics_t *metrics));

extern void XmuttFontGridUpdateFont __((Widget w, bdf_glyph_t *glyph,
                                        Boolean unencoded));

extern void XmuttFontGridUpdatePSFMappings __((Widget w, long encoding,
                                               bdf_psf_unimap_t *mappings));

extern void XmuttFontGridPageInfo
    __((Widget w, XmuttFontGridPageInfoStruct *pageinfo));

extern void XmuttFontGridSelectionInfo
    __((Widget w, XmuttFontGridSelectionStruct *selinfo));

extern void XmuttFontGridViewUnencoded __((Widget w, Boolean unencoded));
extern int XmuttFontGridCodeBase __((Widget w));
extern void XmuttFontGridChangeCodeBase __((Widget w, int base));
extern void XmuttFontGridFirstPage __((Widget w));
extern void XmuttFontGridGotoPage __((Widget w, long pageno));
extern void XmuttFontGridLastPage __((Widget w));
extern void XmuttFontGridNextPage __((Widget w));
extern void XmuttFontGridPreviousPage __((Widget w));
extern void XmuttFontGridGotoCodePage __((Widget w, long code));

extern Boolean XmuttFontGridModified __((Widget w));
extern void XmuttFontGridSetModified __((Widget w, Boolean modified));
extern void XmuttFontGridCallModifiedCallback __((Widget w));

extern Boolean XmuttFontGridHasXLFDName __((Widget w));
extern void XmuttFontGridMakeXLFDName __((Widget w));
extern void XmuttFontGridUpdateNameFromProperties __((Widget w));
extern void XmuttFontGridUpdatePropertiesFromName __((Widget w));
extern void XmuttFontGridUpdateAverageWidth __((Widget w));
extern void XmuttFontGridSetFontName __((Widget w, char *name));

/*
 * Font info functions.
 */
extern bdf_font_t *XmuttFontGridFont __((Widget w));

extern char *XmuttFontGridFontName __((Widget w));
extern char *XmuttFontGridFontComments __((Widget w));
extern char *XmuttFontGridFontMessages __((Widget w));
extern int XmuttFontGridFontSpacing __((Widget w));
extern unsigned short XmuttFontGridFontDeviceWidth __((Widget w));
extern void XmuttFontGridFontResolution __((Widget w, long *resolution_x,
                                            long *resolution_y));

extern void XmuttFontGridGetFontInfo __((Widget w,
                                         XmuttFontGridFontInfoStruct *info));

extern void XmuttFontGridSetFontInfo __((Widget w,
                                         XmuttFontGridFontInfoStruct *info));

extern void XmuttFontGridUpdateComments __((Widget w, char *comments,
                                            unsigned long comments_len));

extern void XmuttFontGridTranslateGlyphs __((Widget w,
                                             Position dx,
                                             Position dy,
                                             bdf_callback_t callback,
                                             void *data,
                                             Boolean all_glyphs));

extern void XmuttFontGridRotateGlyphs __((Widget w,
                                          short degrees,
                                          bdf_callback_t callback,
                                          void *data,
                                          Boolean all_glyphs));

extern void XmuttFontGridShearGlyphs __((Widget w,
                                         short degrees,
                                         bdf_callback_t callback,
                                         void *data,
                                         Boolean all_glyphs));

extern void XmuttFontGridEmboldenGlyphs __((Widget w,
                                            bdf_callback_t callback,
                                            void *data,
                                            Boolean all_glyphs));

extern Boolean XmuttFontGridHasSelection __((Widget w));
extern Boolean XmuttFontGridClipboardEmpty __((Widget w));

extern void XmuttFontGridCopySelection __((Widget w));
extern void XmuttFontGridCutSelection __((Widget w));
extern void XmuttFontGridPasteSelection __((Widget w, int type));

#undef __

#ifdef __cplusplus
}
#endif

#endif /* _h_XmuttFontGrid */