Debian Codegraph @

gdraw/ggadgetP.h

raw symbols SCIP
1 /* Copyright (C) 2000-2012 by George Williams */
2 /*
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are met:
5
6 * Redistributions of source code must retain the above copyright notice, this
7 * list of conditions and the following disclaimer.
8
9 * Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation
11 * and/or other materials provided with the distribution.
12
13 * The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28 #ifndef FONTFORGE_GGADGET_P_H
29 #define FONTFORGE_GGADGET_P_H
30
31 #include "ggadget.h"
32 #include "gresedit.h"
33
34 struct gfuncs {
35 unsigned int is_widget: 1;
36 uint16_t size;
37 int (*handle_expose)(GWindow pixmap,GGadget *g,GEvent *event);
38 int (*handle_mouse)(GGadget *g,GEvent *event);
39 int (*handle_key)(GGadget *g,GEvent *event);
40 int (*handle_editcmd)(GGadget *g,enum editor_commands);
41 int (*handle_focus)(GGadget *g,GEvent *event);
42 int (*handle_timer)(GGadget *g,GEvent *event);
43 int (*handle_sel)(GGadget *g,GEvent *event);
44
45 void (*redraw)(GGadget *g);
46 void (*move)(GGadget *g,int32_t x, int32_t y);
47 void (*resize)(GGadget *g,int32_t width, int32_t height);
48 void (*setvisible)(GGadget *g,int);
49 void (*setenabled)(GGadget *g,int);
50
51 GRect *(*getsize)(GGadget *g,GRect *);
52 GRect *(*getinnersize)(GGadget *g,GRect *);
53
54 void (*destroy)(GGadget *g);
55
56 void (*set_title)(GGadget *g,const unichar_t *str);
57 const unichar_t *(*_get_title)(GGadget *g);
58 unichar_t *(*get_title)(GGadget *g);
59 void (*set_imagetitle)(GGadget *g,GImage *,const unichar_t *str,int before);
60 GImage *(*get_image)(GGadget *g);
61
62 void (*set_font)(GGadget *g,GFont *);
63 GFont *(*get_font)(GGadget *g);
64
65 void (*clear_list)(GGadget *g);
66 void (*set_list)(GGadget *g, GTextInfo **ti, int32_t copyit);
67 GTextInfo **(*get_list)(GGadget *g,int32_t *len);
68 GTextInfo *(*get_list_item)(GGadget *g,int32_t pos);
69 void (*select_list_item)(GGadget *g,int32_t pos, int32_t sel);
70 void (*select_one_list_item)(GGadget *g,int32_t pos);
71 int32_t (*is_list_item_selected)(GGadget *g,int32_t pos);
72 int32_t (*get_first_selection)(GGadget *g);
73 void (*scroll_list_to_pos)(GGadget *g,int32_t pos);
74 void (*scroll_list_to_text)(GGadget *g,const unichar_t *lab,int32_t sel);
75 void (*set_list_orderer)(GGadget *g,int (*orderer)(const void *, const void *));
76
77 void (*get_desired_size)(GGadget *g, GRect *outer, GRect *inner);
78 void (*set_desired_size)(GGadget *g, GRect *outer, GRect *inner);
79 int (*fills_window)(GGadget *g);
80 int (*is_default)(GGadget *g);
81 };
82
83 enum gadget_state {gs_invisible, gs_disabled, gs_enabled, gs_active,
84 gs_focused, gs_pressedactive };
85
86 struct ggadget {
87 struct gfuncs *funcs;
88 struct gwindow *base;
89 GRect r;
90 GRect inner;
91 unichar_t mnemonic;
92 unichar_t shortcut;
93 short short_mask;
94 struct ggadget *prev;
95 unsigned int takes_input: 1;
96 unsigned int takes_keyboard: 1;
97 unsigned int focusable: 1;
98 unsigned int has_focus: 1;
99 unsigned int free_box: 1;
100 unsigned int was_disabled: 1;
101 unsigned int vert: 1; /* For lines & scrollbars */
102 unsigned int opengroup: 1; /* For groupboxes */
103 unsigned int prevlabel: 1; /* For groupboxes */
104 unsigned int contained: 1; /* is part of a bigger ggadget (ie. a scrollbar is part of a listbox) */
105 unsigned int gg_skip_hotkey_processing: 1;
106 unsigned int gg_skip_unqualified_hotkey_processing: 1;
107 short cid;
108 void *data;
109 GBox *box;
110 enum gadget_state state;
111 unichar_t *popup_msg;
112 GGadgetHandler handle_controlevent;
113 int16_t desired_width, desired_height;
114 };
115
116 typedef struct ggadget GLine;
117 typedef struct ggadget GGroup;
118
119 typedef struct ggadget GSpacer; /* a blank space of a given size, used in box layout */
120
121 typedef struct glabel { /* or simple text, or groupbox */
122 GGadget g;
123 unsigned int fh:8;
124 unsigned int as: 8;
125 unsigned int image_precedes: 1;
126 unsigned int is_default: 1;
127 unsigned int is_cancel: 1;
128 unsigned int pressed: 1;
129 unsigned int within: 1;
130 unsigned int labeltype: 2; /* 0=>label/button(this), 1=>imagebutton, 2=>listbutton, 3=>colorbutton */
131 unsigned int shiftonpress: 1;
132 FontInstance *font;
133 unichar_t *label;
134 GImage *image;
135 GTextInfo **ti;
136 uint16_t ltot;
137 } GLabel, GButton;
138
139 typedef struct gimagebutton {
140 GGadget g;
141 unsigned int fh:8;
142 unsigned int as: 8;
143 unsigned int image_precedes: 1;
144 unsigned int is_default: 1;
145 unsigned int is_cancel: 1;
146 unsigned int pressed: 1;
147 unsigned int within: 1;
148 unsigned int labeltype: 2; /* 0=>label, 1=>imagebutton(this), 2=>listbutton */
149 unsigned int shiftonpress: 1;
150 FontInstance *font;
151 unichar_t *label;
152 GImage *image, *img_within, *active, *disabled;
153 } GImageButton;
154
155 typedef struct glistbutton {
156 GGadget g;
157 unsigned int fh:8;
158 unsigned int as: 8;
159 unsigned int image_precedes: 1;
160 unsigned int is_default: 1;
161 unsigned int is_cancel: 1;
162 unsigned int pressed: 1;
163 unsigned int within: 1;
164 unsigned int labeltype: 2; /* 0=>label, 1=>imagebutton, 2=>listbutton(this) */
165 unsigned int shiftonpress: 1;
166 FontInstance *font;
167 unichar_t *label;
168 GImage *image;
169 GTextInfo **ti;
170 uint16_t ltot;
171 GWindow popup;
172 } GListButton;
173
174 typedef struct gcolorbutton {
175 GGadget g;
176 unsigned int fh:8;
177 unsigned int as: 8;
178 unsigned int image_precedes: 1;
179 unsigned int is_default: 1;
180 unsigned int is_cancel: 1;
181 unsigned int pressed: 1;
182 unsigned int within: 1;
183 unsigned int labeltype: 2; /* 0=>label/button, 1=>imagebutton, 2=>listbutton, 3=>colorbutton(this) */
184 unsigned int shiftonpress: 1;
185 FontInstance *font;
186 unichar_t *label;
187 GImage *image;
188 Color col;
189 } GColorButton;
190
191 typedef struct gcheck {
192 GGadget g;
193 unsigned int fh:8;
194 unsigned int as: 8;
195 unsigned int image_precedes: 1;
196 unsigned int pressed: 1;
197 unsigned int within: 1;
198 unsigned int isradio: 1;
199 unsigned int ison: 1;
200 FontInstance *font;
201 unichar_t *label;
202 GImage *image;
203 GRect onoffrect, onoffinner;
204 GBox *onbox, *offbox;
205 GResImage *on, *off, *ondis, *offdis;
206 } GCheckBox;
207
208 typedef struct gradio {
209 GGadget g;
210 unsigned int fh:8;
211 unsigned int as: 8;
212 unsigned int image_precedes: 1;
213 unsigned int pressed: 1;
214 unsigned int within: 1;
215 unsigned int isradio: 1;
216 unsigned int ison: 1;
217 FontInstance *font;
218 unichar_t *label;
219 GImage *image;
220 GRect onoffrect, onoffinner;
221 GBox *onbox, *offbox;
222 GResImage *on, *off, *ondis, *offdis;
223 struct gradio *post;
224 int radiogroup;
225 } GRadio;
226
227 typedef struct gscrollbar { /* and slider */
228 struct ggadget g;
229 int32_t sb_min, sb_max, sb_pagesize, sb_pos;
230 int32_t sb_mustshow; /* normally this is sb_pagesize, but might be the height of a single line */
231 /* if we want people to be able to scroll to see white space */
232 /* after the document */
233 /*unsigned int vert: 1; */ /* Moved to GGadget, shared with line */
234 unsigned int thumbpressed: 1;
235 unsigned int ignorenext45: 1;
236 int8_t repeatcmd; /* sb event to be generated on timer interrupts (ie. upline)*/
237 int8_t thumbborder; /* Size of the border of the thumbbox */
238 int8_t sbborder; /* Size of the border of the main scrollbar */
239 int16_t size_offset; /* Thumb size offset when the thumb size gets clamped. */
240 int16_t thumboff; /* Offset from where the thumb was pressed to top of thumb */
241 int16_t arrowsize;
242 int16_t thumbsize; /* Current thumb size, refigured after every call to setbounds */
243 int16_t thumbpos; /* Current thumb pos */
244 GTimer *pressed;
245 GBox *thumbbox;
246 } GScrollBar;
247
248 typedef struct glist {
249 GGadget g;
250 uint8_t fh;
251 uint8_t as;
252 uint8_t sofar_max, sofar_pos;
253 uint16_t ltot, loff, lcnt;
254 uint16_t xoff, xmax;
255 uint16_t start, end; /* current selection drag */
256 uint16_t hmax; /* maximum line height */
257 FontInstance *font;
258 GTextInfo **ti;
259 struct gscrollbar *vsb;
260 int (*orderer)(const void *, const void *);
261 unsigned int backwards: 1; /* reverse the order given by orderer */
262 unsigned int multiple_sel: 1; /* Allow multiple selections */
263 unsigned int exactly_one: 1; /* List must always have something selected */
264 unsigned int parentpressed: 1; /* For listbuttons, pressed in parent */
265 unsigned int freeti: 1; /* Free the ti array when we're destroyed */
266 unsigned int ispopup: 1; /* respond to Return and Escape */
267 unsigned int sameheight: 1; /* all lines are the same height */
268 unsigned int always_show_sb: 1; /* display scrollbar even if we don't need it */
269 unichar_t *sofar; /* user input */
270 GTimer *enduser;
271 GTimer *pressed;
272 void (*popup_callback)(GGadget *g,int pos);
273 } GList;
274
275 typedef struct gscroll1box {
276 GGadget g;
277 int32_t count;
278 int32_t sbsize;
279 int32_t minsize, oppoatmin;
280 int32_t subwidth, subheight;
281 int32_t oppoatcur; // Not subwidth/height because the scroll bar can add size
282 int32_t pad;
283 int32_t scrollchange;
284 int32_t offset; // wrt scrolling
285 GGadget **children;
286 GGadget *sb;
287 unsigned int vertical: 1;
288 unsigned int always_show_sb: 1;
289 unsigned int sized_for_sb: 1;
290 unsigned int align_flow_labels: 1;
291 enum gg_flags just;
292 GWindow nested;
293 } GScroll1Box;
294
295 typedef struct gtextfield {
296 GGadget g;
297 unsigned int cursor_on: 1;
298 unsigned int wordsel: 1;
299 unsigned int linesel: 1;
300 unsigned int listfield: 1;
301 unsigned int drag_and_drop: 1;
302 unsigned int has_dd_cursor: 1;
303 unsigned int hidden_cursor: 1;
304 unsigned int multi_line: 1;
305 unsigned int accepts_tabs: 1;
306 unsigned int accepts_returns: 1;
307 unsigned int wrap: 1;
308 unsigned int password: 1;
309 unsigned int dontdraw: 1; /* Used when the tf is part of a larger control, and the control determines when to draw the tf */
310 unsigned int numericfield: 1;
311 unsigned int incr_down: 1; /* Direction of increments when numeric_scroll events happen */
312 unsigned int completionfield: 1;
313 unsigned int was_completing: 1;
314 uint8_t fh;
315 uint8_t as;
316 uint8_t nw; /* Width of one character (an "n") */
317 int32_t xoff_left, loff_top;
318 int32_t sel_start, sel_end, sel_base;
319 int32_t sel_oldstart, sel_oldend, sel_oldbase;
320 int32_t dd_cursor_pos;
321 unichar_t *text, *oldtext;
322 FontInstance *font;
323 GTimer *pressed;
324 GTimer *cursor;
325 GCursor old_cursor;
326 GScrollBar *hsb, *vsb;
327 int32_t lcnt, lmax;
328 int32_t *lines; /* offsets in text to the start of the nth line */
329 int32_t xmax;
330 GIC *gic;
331 GTimer *numeric_scroll;
332 char *utf8_text; /* For Pango */
333 int32_t *lines8; /* offsets in utf8_text */
334 } GTextField;
335
336 typedef struct glistfield {
337 GTextField gt;
338 GRect fieldrect, buttonrect;
339 GTextInfo **ti;
340 uint16_t ltot;
341 GWindow popup;
342 } GListField;
343
344 typedef struct gcompletionfield {
345 GListField gl;
346 unichar_t **choices;
347 uint16_t ctot; int16_t selected;
348 GWindow choice_popup;
349 GTextCompletionHandler completion;
350 } GCompletionField;
351
352 typedef struct gnumericfield {
353 GTextField gt;
354 GRect fieldrect, buttonrect;
355 } GNumericField;
356
357 typedef struct gmenubar {
358 GGadget g;
359 GMenuItem *mi;
360 uint16_t *xs; /* locations at which to draw each name (+1 to give us width of last one) */
361 uint16_t mtot;
362 int16_t entry_with_mouse;
363 int16_t lastmi; /* If the menubar doesn't fit across the top the make some of it be vertical. Start here */
364 int ascender;
365 int descender;
366 struct gmenu *child;
367 unsigned int pressed: 1;
368 unsigned int initial_press: 1;
369 unsigned int any_unmasked_shortcuts: 1;
370 FontInstance *font;
371 GMenuItem fake[2]; /* Used if not enough room for menu... */
372 } GMenuBar;
373
374 struct tabs { unichar_t *name; int16_t x, width, tw, nesting; unsigned int disabled: 1; GWindow w; };
375
376 typedef struct gtabset {
377 struct ggadget g;
378 struct tabs *tabs;
379 int16_t *rowstarts; /* for each row, index into tab array of its first tab, one extra entry at end with tabcnt */
380 int16_t tabcnt; /* number of tabs */
381 int16_t sel; /* active tab */
382 int16_t oldsel; /* used when swapping tabs */
383 int16_t rcnt; /* number of rows */
384 int16_t active_row; /* row which is closest to the display area */
385 int16_t offset_per_row; /* stagger tabs by this much */
386 int16_t rowh; /* height of each row */
387 int16_t toff; /* amount things are scrolled off left (x, tabs) */
388 int16_t arrow_width; /* width of arrow tab (for scrolling) */
389 int16_t arrow_size; /* size of the actual arrow itself */
390 int16_t ds;
391 int16_t pressed_sel;
392 unsigned int scrolled: 1; /* big tabsets either get scrolled or appear in multiple rows */
393 unsigned int haslarrow: 1;
394 unsigned int hasrarrow: 1;
395 unsigned int pressed: 1;
396 unsigned int filllines: 1; /* If we have multiple lines then fill them so that each row takes up the entire width of the tabset */
397 unsigned int fill1line: 1;
398 unsigned int vertical: 1;
399 unsigned int nowindow: 1;
400 bool closable, movable;
401 FontInstance *font;
402 void (*remove_sync)(GWindow gw, int pos);
403 void (*swap_sync)(GWindow gw, int pos_a, int pos_b);
404 void (*nested_expose)(GWindow pixmap, GGadget *g, GEvent *event);
405 int (*nested_mouse)(GGadget *g, GEvent *event);
406 int16_t vert_list_width;
407 int16_t as, fh, offtop;
408 GGadget *vsb;
409 } GTabSet;
410
411 struct gdirentry;
412 typedef struct gfilechooser {
413 struct ggadget g;
414 GTextField *name;
415 GList *files, *subdirs;
416 GListButton *directories;
417 GButton *ok, *filterb; /* Not created by us, can be set by user to give chooser a better appearance */
418 unichar_t **mimetypes;
419 unichar_t *wildcard;
420 unichar_t *lastname;
421 GFileChooserFilterType filter;
422 GFileChooserInputFilenameFuncType inputfilenamefunc;
423 GButton *up, *home;
424 GButton *bookmarks, *config;
425 struct ghvbox *topbox;
426 unichar_t **history;
427 unichar_t **paths;
428 unichar_t *inputfilenameprevchar;
429 int hpos, hcnt, hmax;
430 } GFileChooser;
431
432 typedef struct ghvbox {
433 GGadget g;
434 int rows, cols;
435 int hpad, vpad; /* Internal padding */
436 int grow_col, grow_row; /* -1 => all */
437 GGadget **children; /* array of rows*cols */
438 GGadget *label;
439 int label_height;
440 } GHVBox;
441
442 typedef struct gflowbox {
443 GGadget g;
444 int count;
445 int hpad, vpad, lpad; /* Internal padding */
446 int label_size;
447 enum gg_flags just;
448 unsigned int vertical: 1;
449 GGadget **children;
450 GGadget *label;
451 } GFlowBox;
452
453 struct col_data {
454 enum me_type me_type;
455 char *(*func)(GGadget *,int r,int c); /* Produces a string to display if md_str==NULL */
456 GMenuItem *enum_vals;
457 void (*enable_enum)(GGadget *,GMenuItem *, int r, int c);
458 GTextCompletionHandler completer;
459 char *title;
460 int16_t width, x; /* Relative to inner.x */
461 uint8_t fixed;
462 uint8_t disabled;
463 uint8_t hidden;
464 };
465
466 typedef struct gmatrixedit {
467 GGadget g;
468 int rows, cols;
469 int row_max;
470 struct col_data *col_data;
471 int hpad, vpad; /* Internal padding */
472 unsigned int has_titles: 1;
473 unsigned int lr_pointer: 1;
474 unsigned int wasnew: 1; /* So we need to call newafter when finished editing */
475 unsigned int big_done: 1;
476 unsigned int edit_active: 1;
477 unsigned int no_edit: 1;
478 int pressed_col; /* For changing column spacing */
479 struct matrix_data *data;
480 int16_t as, fh;
481 int16_t font_as, font_fh;
482 FontInstance *font;
483 FontInstance *titfont;
484 GGadget *tf;
485 int active_col, active_row;
486 int off_top, off_left;
487 GGadget *vsb, *hsb;
488 GGadget *del;
489 GGadget *up, *down;
490 GGadget **buttonlist;
491 GWindow nested;
492 int16_t mark_length, mark_size, mark_skip;
493 char *newtext;
494 void (*initrow)(GGadget *g,int row);
495 int (*candelete)(GGadget *g,int row);
496 enum gme_updown (*canupdown)(GGadget *g,int row);
497 void (*popupmenu)(GGadget *g,GEvent *e,int row,int col);
498 int (*handle_key)(GGadget *g,GEvent *e);
499 char *(*bigedittitle)(GGadget *g,int r, int c);
500 void (*finishedit)(GGadget *g,int r, int c, int wasnew);
501 char *(*validatestr)(GGadget *g,int r, int c, int wasnew, char *str);
502 void (*setotherbuttons)(GGadget *g, int r, int c);
503 void (*reportmousemove)(GGadget *g, int r, int c);
504 void (*reporttextchanged)(GGadget *g, int r, int c, GGadget *textfield);
505 void (*predelete)(GGadget *g, int r);
506 void (*rowmotion)(GGadget *g, int oldr, int newr);
507 } GMatrixEdit;
508
509 typedef struct gdrawable {
510 GGadget g;
511 GWindow gw;
512 GDrawEH e_h;
513 } GDrawable;
514
515 typedef struct rowcol {
516 GGadget g;
517 int rows, cols;
518 GFont *font;
519 int as, fh;
520 unsigned int hrules: 1; /* Draw horizontal lines between each row */
521 unsigned int vrules: 1; /* Draw vertical lines between each column */
522 unsigned int display_only: 1;
523 unsigned int order_entries: 1; /* normally order rows based on first column entry */
524 uint8_t hpad;
525 int *colx; /* col+1 entries, last is xmax */
526 GTextInfo **labels;
527 GTextInfo **ti;
528 GTextField *tf;
529 GScrollBar *vsb, *hsb;
530 int loff, xoff;
531 int tfr, tfc; /* row,col of textfield (or -1) */
532 int (*orderer)(const void *, const void *);
533 } RowCol;
534
535
536 /* ColorPicker */
537
538 extern int _GScrollBar_StartTime,_GScrollBar_RepeatTime; /* in millisecs */
539 extern int _GScrollBar_Width; /* in points */
540 extern int _GListMarkSize; /* in points, def width of popup mark in buttons */
541 extern int _GGadget_Skip; /* in points, def hor space between gadgets */
542 extern int _GGadget_TextImageSkip; /* in points, def hor space text and image */
543 extern GBox _GListMark_Box, _GGroup_LineBox;
544 extern GResFont _ggadget_default_font;
545
546 void _GWidget_AddGGadget(GWindow gw,struct ggadget *g);
547 void _GWidget_RemoveGadget(struct ggadget *g);
548 void _GWidget_SetMenuBar(GGadget *g);
549 void _GWidget_SetDefaultButton(GGadget *g);
550 void _GWidget_MakeDefaultButton(GGadget *g);
551 void _GWidget_SetCancelButton(GGadget *g);
552 void _GWidget_SetGrabGadget(GGadget *g);
553 void _GWidget_ClearGrabGadget(GGadget *g);
554 void _GWidget_SetPopupOwner(GGadget *g);
555 void _GWidget_ClearPopupOwner(GGadget *g);
556
557 extern void _GGadgetCopyDefaultBox(GBox *box);
558 extern void _GGadgetInitDefaultBox(const char *class, GBox *box);
559 extern void _ggadget_underlineMnemonic(GWindow gw,int32_t x,int32_t y,unichar_t *label,
560 unichar_t mneumonic, Color fg,int ymax);
561 extern void _ggadgetFigureSize(GWindow gw, GBox *design, GRect *r, int isdef);
562 extern void _ggadgetSetRects(GGadget *g, GRect *outer, GRect *inner, int xjust, int yjust );
563 extern void _GGadgetCloseGroup(GGadget *g);
564 extern void _ggadget_redraw(GGadget *g);
565 extern int _ggadget_noop(GGadget *g, GEvent *event);
566 extern void _ggadget_move(GGadget *g, int32_t x, int32_t y );
567 extern void _ggadget_resize(GGadget *g, int32_t width, int32_t height );
568 extern void _ggadget_setvisible(GGadget *g,int visible);
569 extern void _ggadget_setenabled(GGadget *g,int enabled);
570 extern GRect *_ggadget_getsize(GGadget *g,GRect *rct);
571 extern GRect *_ggadget_getinnersize(GGadget *g,GRect *rct);
572 extern void _ggadget_getDesiredSize(GGadget *g, GRect *outer, GRect *inner);
573 extern void _ggadget_setDesiredSize(GGadget *g,GRect *outer, GRect *inner);
574 void _GGroup_Init(void);
575
576 extern unichar_t *_GGadgetFileToUString(char *filename,int max);
577
578 extern int GBoxDrawBorder(GWindow gw,GRect *pos,GBox *design,
579 enum gadget_state state,int is_default);
580 extern void GBoxDrawBackground(GWindow gw,GRect *pos,GBox *design,
581 enum gadget_state state,int is_default);
582 extern void GBoxDrawTabOutline(GWindow pixmap, GGadget *g, int x, int y,
583 int width, int rowh, int active );
584 extern int GBoxDrawHLine(GWindow gw,GRect *pos,GBox *design);
585 extern int GBoxDrawVLine(GWindow gw,GRect *pos,GBox *design);
586 extern int GBoxBorderWidth(GWindow gw, GBox *box);
587 extern int GBoxExtraSpace(GGadget *g);
588 extern int GBoxDrawnWidth(GWindow gw, GBox *box);
589
590 extern int GGadgetInnerWithin(GGadget *g, int x, int y);
591
592 extern int GTextInfoGetWidth(GWindow base,GTextInfo *ti,FontInstance *font);
593 extern int GTextInfoGetMaxWidth(GWindow base,GTextInfo **ti,FontInstance *font);
594 extern int GTextInfoGetHeight(GWindow base,GTextInfo *ti,FontInstance *font);
595 extern int GTextInfoGetMaxHeight(GWindow base,GTextInfo **ti,FontInstance *font,int *allsame);
596 extern int GTextInfoGetAs(GWindow base,GTextInfo *ti, FontInstance *font);
597 extern int GTextInfoDraw(GWindow base,int x,int y,GTextInfo *ti,
598 FontInstance *font,Color fg,Color sel,int ymax, int as, int ds);
599 extern GTextInfo *GTextInfoCopy(GTextInfo *ti);
600 extern GTextInfo **GTextInfoArrayFromList(GTextInfo *ti, uint16_t *cnt);
601 extern GTextInfo **GTextInfoArrayCopy(GTextInfo **ti);
602 extern int GTextInfoArrayCount(GTextInfo **ti);
603 extern int GTextInfoCompare(GTextInfo *ti1, GTextInfo *ti2);
604 extern int GMenuItemArrayMask(GMenuItem *mi);
605 extern int GMenuItemArrayAnyUnmasked(GMenuItem *mi);
606 extern void _GFlowBoxGetDesiredSize(GGadget *g, GRect *outer, GRect *inner, int squashed, int ignore_des);
607
608 extern GGadget *_GGadget_Create(GGadget *g, struct gwindow *base, GGadgetData *gd,void *data, GBox *def);
609 extern void _GGadget_FinalPosition(GGadget *g, struct gwindow *base, GGadgetData *gd);
610 extern void _ggadget_destroy(GGadget *g);
611
612 extern GWindow GListPopupCreate(GGadget *owner,void (*inform)(GGadget *,int), GTextInfo **ti);
613
614 extern int GMenuPopupCheckKey(GEvent *event);
615 extern int GMenuBarCheckKey(GWindow top, GGadget *g, GEvent *event);
616 extern void _GButton_SetDefault(GGadget *g,int32_t is_default);
617 extern void _GButtonInit(void);
618 extern void GListMarkDraw(GWindow pixmap,int x, int y, int height, enum gadget_state state );
619 extern const char* const* _GGadget_GetImagePath(void);
620 extern int _GGadget_ImageInCache(GImage *image);
621
622 extern GResInfo ggadget_ri, listmark_ri;
623
624 #endif /* FONTFORGE_GGADGET_P_H */