| 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_GRESOURCE_H |
| 29 |
#define FONTFORGE_GRESOURCE_H |
| 30 |
|
| 31 |
#include "gimage.h" |
| 32 |
|
| 33 |
#include <iconv.h> |
| 34 |
|
| 35 |
typedef struct ggadgetcreatedata GGadgetCreateData; |
| 36 |
typedef struct _PangoFontDescription PangoFontDescription; |
| 37 |
|
| 38 |
enum border_type { bt_none, bt_box, bt_raised, bt_lowered, bt_engraved, |
| 39 |
bt_embossed, bt_double }; |
| 40 |
enum border_shape { bs_rect, bs_roundrect, bs_elipse, bs_diamond }; |
| 41 |
enum box_flags { |
| 42 |
box_foreground_border_inner = 1, |
| 43 |
box_foreground_border_outer = 2, |
| 44 |
box_active_border_inner = 4, |
| 45 |
box_foreground_shadow_outer = 8, |
| 46 |
box_do_depressed_background = 0x10, |
| 47 |
box_draw_default = 0x20, |
| 48 |
box_generate_colors = 0x40, |
| 49 |
box_gradient_bg = 0x80, |
| 50 |
box_flag_mask = 0xFF |
| 51 |
}; |
| 52 |
typedef struct gbox { |
| 53 |
unsigned char border_type; |
| 54 |
unsigned char border_shape; |
| 55 |
unsigned char border_width; |
| 56 |
unsigned char padding; |
| 57 |
unsigned char rr_radius; |
| 58 |
unsigned char flags; |
| 59 |
Color border_brightest; |
| 60 |
Color border_brighter; |
| 61 |
Color border_darkest; |
| 62 |
Color border_darker; |
| 63 |
Color main_background; |
| 64 |
Color main_foreground; |
| 65 |
Color disabled_background; |
| 66 |
Color disabled_foreground; |
| 67 |
Color active_border; |
| 68 |
Color depressed_background; |
| 69 |
Color gradient_bg_end; |
| 70 |
Color border_inner; |
| 71 |
Color border_outer; |
| 72 |
} GBox; |
| 73 |
|
| 74 |
#define GBOX_EMPTY { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0 ,0 ,0 } |
| 75 |
|
| 76 |
enum font_style { fs_none, fs_italic=1, fs_smallcaps=2, fs_condensed=4, fs_extended=8, fs_vertical=16 }; |
| 77 |
enum font_type { ft_unknown, ft_serif, ft_sans, ft_mono, ft_cursive, ft_max }; |
| 78 |
|
| 79 |
typedef struct { |
| 80 |
const char *utf8_family_name; |
| 81 |
int16_t point_size; |
| 82 |
int16_t weight; |
| 83 |
enum font_style style; |
| 84 |
} FontRequest; |
| 85 |
|
| 86 |
typedef struct font_instance { |
| 87 |
FontRequest rq; |
| 88 |
PangoFontDescription *pango_fd; |
| 89 |
PangoFontDescription *pangoc_fd; |
| 90 |
} FontInstance, GFont; |
| 91 |
|
| 92 |
enum res_type { rt_int, rt_double, rt_bool, rt_color, rt_string, rt_image, rt_font, rt_stringlong, rt_coloralpha }; |
| 93 |
|
| 94 |
struct gimage_cache_bucket; |
| 95 |
|
| 96 |
typedef struct gresimage { |
| 97 |
const char *ini_name; |
| 98 |
struct gimage_cache_bucket *bucket; |
| 99 |
} GResImage; |
| 100 |
|
| 101 |
typedef struct gresfont { |
| 102 |
GFont *fi; |
| 103 |
const char *rstr; |
| 104 |
uint8_t can_free_name; |
| 105 |
} GResFont; |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
void fix_CJK_UI_font(GResFont* font); |
| 110 |
|
| 111 |
#define GRESIMAGE_INIT(defstr) { (defstr), NULL } |
| 112 |
#define GRESFONT_INIT(defstr) { NULL, (defstr), false } |
| 113 |
|
| 114 |
GImage *GResImageGetImage(GResImage *); |
| 115 |
|
| 116 |
typedef struct gresstruct { |
| 117 |
const char *resname; |
| 118 |
enum res_type type; |
| 119 |
void *val; |
| 120 |
void *(*cvt)(char *,void *); |
| 121 |
int found; |
| 122 |
} GResStruct; |
| 123 |
|
| 124 |
#define GRESSTRUCT_EMPTY { NULL, 0, NULL, NULL, 0 } |
| 125 |
|
| 126 |
struct resed { |
| 127 |
const char *name, *resname; |
| 128 |
enum res_type type; |
| 129 |
void *val; |
| 130 |
char *popup; |
| 131 |
void *(*cvt)(char *,void *); |
| 132 |
union { int ival; double dval; char *sval; GResFont fontval; GResImage imageval; } orig; |
| 133 |
int cid; |
| 134 |
int found; |
| 135 |
}; |
| 136 |
|
| 137 |
#define RESED_EMPTY { NULL, NULL, 0, NULL, NULL, NULL, { 0 }, 0, 0 } |
| 138 |
|
| 139 |
typedef struct gresinfo { |
| 140 |
struct gresinfo *next; |
| 141 |
struct gresinfo *inherits_from; |
| 142 |
struct gresinfo *seealso1, *seealso2; |
| 143 |
GBox *boxdata; |
| 144 |
GResFont *font; |
| 145 |
GGadgetCreateData *examples; |
| 146 |
struct resed *extras; |
| 147 |
char *name; |
| 148 |
char *initialcomment; |
| 149 |
char *resname; |
| 150 |
char *progname; |
| 151 |
uint8_t is_button; |
| 152 |
uint8_t is_initialized; |
| 153 |
uint32_t override_mask; |
| 154 |
GBox overrides; |
| 155 |
GBox orig_state; |
| 156 |
void (*refresh)(void); |
| 157 |
int (*initialize)(struct gresinfo *); |
| 158 |
void *reserved_for_future_use2; |
| 159 |
} GResInfo; |
| 160 |
|
| 161 |
extern char *GResourceProgramName; |
| 162 |
|
| 163 |
int ResStrToFontRequest(const char *resname, FontRequest *rq); |
| 164 |
|
| 165 |
void GResourceSetProg(const char *prog); |
| 166 |
void GResourceAddResourceFile(const char *filename,const char *prog,int warn); |
| 167 |
void GResourceAddResourceString(const char *string,const char *prog); |
| 168 |
|
| 169 |
#endif |