| 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 |
#ifndef FONTFORGE_GWIDGET_H |
| 29 |
#define FONTFORGE_GWIDGET_H |
| 30 |
|
| 31 |
#include "gdraw.h" |
| 32 |
#include "ggadget.h" |
| 33 |
#include "gprogress.h" |
| 34 |
|
| 35 |
#include <stdarg.h> |
| 36 |
|
| 37 |
struct ggadget; |
| 38 |
struct ggadgetcreatedata; |
| 39 |
struct gtimer; |
| 40 |
|
| 41 |
typedef GWindow GWidget; |
| 42 |
|
| 43 |
typedef struct gwidgetcreatedata { |
| 44 |
GRect r; |
| 45 |
struct ggadgetcreatedata *gcd; |
| 46 |
struct gwidgetcreatedata *wcd; |
| 47 |
unichar_t *title; |
| 48 |
unsigned int trap_input: 1; |
| 49 |
unsigned int tab_navigation: 1; |
| 50 |
unsigned int arrow_navigation: 1; |
| 51 |
unsigned int do_default: 1; |
| 52 |
unsigned int do_cancel: 1; |
| 53 |
Color fore, back; |
| 54 |
void (*e_h)(GWindow, GEvent *); |
| 55 |
} GWidgetData; |
| 56 |
|
| 57 |
typedef struct gwidgetcreatordata { |
| 58 |
GWidget *(*creator)(GWidget *parent, GWidgetData *, void *data); |
| 59 |
GWidgetData wd; |
| 60 |
void *data; |
| 61 |
} GWidgetCreateData; |
| 62 |
|
| 63 |
extern GWindow GWidgetCreateTopWindow(GDisplay *gdisp, GRect *pos, int (*eh)(GWindow,GEvent *), void *user_data, GWindowAttrs *wattrs); |
| 64 |
extern GWindow GWidgetCreateSubWindow(GWindow w, GRect *pos, int (*eh)(GWindow,GEvent *), void *user_data, GWindowAttrs *wattrs); |
| 65 |
|
| 66 |
GWindow GWindowGetCurrentFocusTopWindow(void); |
| 67 |
GWindow GWidgetGetCurrentFocusWindow(void); |
| 68 |
GWindow GWidgetGetPreviousFocusTopWindow(void); |
| 69 |
struct ggadget *GWindowGetCurrentFocusGadget(void); |
| 70 |
struct ggadget *GWindowGetFocusGadgetOfWindow(GWindow gw); |
| 71 |
void GWindowClearFocusGadgetOfWindow(GWindow gw); |
| 72 |
void GWidgetIndicateFocusGadget(struct ggadget *g); |
| 73 |
void GWidgetNextFocus(GWindow); |
| 74 |
void GWidgetPrevFocus(GWindow); |
| 75 |
|
| 76 |
struct ggadget *GWidgetGetControl(GWindow gw, int cid); |
| 77 |
struct ggadget *_GWidgetGetGadgets(GWindow gw); |
| 78 |
GWindow GWidgetGetParent(GWindow gw); |
| 79 |
GWindow GWidgetGetTopWidget(GWindow gw); |
| 80 |
extern GDrawEH GWidgetGetEH(GWindow w); |
| 81 |
extern void GWidgetSetEH(GWindow w,GDrawEH e_h); |
| 82 |
extern void GWidgetFlowGadgets(GWindow gw); |
| 83 |
extern void GWidgetToDesiredSize(GWindow gw); |
| 84 |
|
| 85 |
|
| 86 |
char *GWidgetOpenFile8(const char *title, const char *defaultfile, |
| 87 |
const char *initial_filter, char **mimetypes,GFileChooserFilterType filter); |
| 88 |
char *GWidgetOpenFileWPath8(const char *title, const char *defaultfile, |
| 89 |
const char *initial_filter, char **mimetypes,GFileChooserFilterType filter, const char* const* path); |
| 90 |
char *GWidgetSaveAsFileWithGadget8(const char *title, const char *defaultfile, |
| 91 |
const char *initial_filter, char **mimetypes, |
| 92 |
GFileChooserFilterType filter, |
| 93 |
GFileChooserInputFilenameFuncType filenamefunc, |
| 94 |
GGadgetCreateData *optional_gcd); |
| 95 |
char *GWidgetSaveAsFile8(const char *title, const char *defaultfile, |
| 96 |
const char *initial_filter, char **mimetypes,GFileChooserFilterType filter ); |
| 97 |
int GWidgetAsk8(const char *title, const char **answers, |
| 98 |
int def, int cancel,const char *question,...); |
| 99 |
int GWidgetAskCentered8(const char *title, |
| 100 |
const char ** answers, int def, int cancel,const char *question,...); |
| 101 |
char *GWidgetAskString8(const char *title, |
| 102 |
const char *def,const char *question,...); |
| 103 |
char *GWidgetAskPassword8(const char *title, |
| 104 |
const char *def,const char *question,...); |
| 105 |
void GWidgetPostNotice8(const char *title,const char *statement,...); |
| 106 |
void _GWidgetPostNotice8(const char *title,const char *statement,va_list ap,int timeout); |
| 107 |
void GWidgetPostNoticeTimeout8(int timeout, const char *title,const char *statement,...); |
| 108 |
int GWidgetPostNoticeActive8(const char *title); |
| 109 |
void GWidgetError8(const char *title,const char *statement,...); |
| 110 |
|
| 111 |
int GWidgetChoices8(const char *title, const char **choices,int cnt, int def, |
| 112 |
const char *question,...); |
| 113 |
int GWidgetChoicesB8(char *title, const char **choices, int cnt, int def, |
| 114 |
char *buts[2], const char *question,...); |
| 115 |
int GWidgetChoicesBM8(const char *title, const char **choices, char *sel, |
| 116 |
int cnt, char *buts[2], const char *question,...); |
| 117 |
|
| 118 |
extern struct hslrgb GWidgetColor(const char *title,struct hslrgb *defcol,struct hslrgb *fontcols); |
| 119 |
extern struct hslrgba GWidgetColorA(const char *title,struct hslrgba *defcol,struct hslrgba *fontcols); |
| 120 |
|
| 121 |
#define gwwv_choose_multiple GWidgetChoicesBM8 |
| 122 |
#define gwwv_choose_with_buttons GWidgetChoicesB8 |
| 123 |
#define gwwv_choose GWidgetChoices8 |
| 124 |
#define gwwv_ask_string GWidgetAskString8 |
| 125 |
#define gwwv_ask_password GWidgetAskPassword8 |
| 126 |
#define gwwv_ask GWidgetAsk8 |
| 127 |
#define gwwv_ask_centered GWidgetAskCentered8 |
| 128 |
#define gwwv_post_error GWidgetError8 |
| 129 |
#define gwwv_post_notice GWidgetPostNotice8 |
| 130 |
#define gwwv_post_notice_timeout GWidgetPostNoticeTimeout8 |
| 131 |
#define gwwv_open_filename(tit,def,filter,filtfunc) GWidgetOpenFile8(tit,def,filter,NULL,filtfunc) |
| 132 |
#define gwwv_open_filename_with_path(tit,def,filter,filtfunc,path) GWidgetOpenFileWPath8(tit,def,filter,NULL,filtfunc,path) |
| 133 |
#define gwwv_save_filename(tit,def,filter) GWidgetSaveAsFile8(tit,def,filter,NULL,NULL) |
| 134 |
#define gwwv_save_filename_with_gadget(tit,def,filter,gcd) GWidgetSaveAsFileWithGadget8(tit,def,filter,NULL,NULL,NULL,gcd) |
| 135 |
|
| 136 |
extern GIC *GWidgetCreateInputContext(GWindow w,enum gic_style def_style); |
| 137 |
extern GIC *GWidgetGetInputContext(GWindow w); |
| 138 |
|
| 139 |
|
| 140 |
#endif |