Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

struct, union, enum c++ visibility

This patch eliminates all the remaining cases where C allowed you to
bury globally scoped names inside structs and unions.
  • Loading branch information...
commit 773b7637f29ef3fdb86ca1f323607376f7e144de 1 parent 5182f72
@chemoelectric chemoelectric authored khaledhosny committed
Showing with 802 additions and 537 deletions.
  1. +19 −15 fontforge/anchorsaway.c
  2. +5 −2 fontforge/autowidth.c
  3. +33 −17 fontforge/baseviews.h
  4. +4 −4 fontforge/contextchain.c
  5. +9 −3 fontforge/delta.h
  6. +2 −1  fontforge/encoding.c
  7. +66 −31 fontforge/featurefile.c
  8. +3 −1 fontforge/fvmetrics.h
  9. +7 −5 fontforge/histograms.c
  10. +26 −18 fontforge/macbinary.c
  11. +4 −2 fontforge/mmdlg.c
  12. +14 −8 fontforge/oflib.c
  13. +9 −7 fontforge/parsettfatt.c
  14. +15 −13 fontforge/parsettfbmf.c
  15. +7 −1 fontforge/print.c
  16. +27 −23 fontforge/print.h
  17. +12 −8 fontforge/problems.c
  18. +9 −7 fontforge/psfont.h
  19. +3 −1 fontforge/scstyles.c
  20. +45 −31 fontforge/sd.h
  21. +24 −12 fontforge/sfd1.h
  22. +37 −29 fontforge/sflayoutP.h
  23. +3 −1 fontforge/showatt.c
  24. +30 −24 fontforge/splinesave.c
  25. +7 −5 fontforge/splinesaveafm.c
  26. +3 −1 fontforge/splinestroke.c
  27. +36 −28 fontforge/stemdb.h
  28. +24 −18 fontforge/tottfgpos.c
  29. +94 −64 fontforge/ttf.h
  30. +58 −36 fontforge/views.h
  31. +6 −4 gdraw/fontP.h
  32. +3 −1 gdraw/gchardlg.c
  33. +2 −1  gdraw/gdrawerror.c
  34. +21 −15 gdraw/ggadgetP.h
  35. +13 −9 gdraw/gimageclut.c
  36. +15 −13 gdraw/gresedit.c
  37. +48 −31 gdraw/gxdrawP.h
  38. +6 −2 inc/gdraw.h
  39. +53 −45 inc/ggadget.h
View
34 fontforge/anchorsaway.c
@@ -35,6 +35,23 @@ int aa_pixelsize = 150;
/* The dialog should contain a lig index !!!! */
+struct apmatch {
+ SplineChar *sc;
+ AnchorPoint *ap;
+ BDFChar *bdfc;
+ int off; /* a mark-to-mark display might have the same */
+ int size; /* odd positioning problems as above */
+ int xstart; /* This is scaled by factor, others are not */
+};
+
+struct state {
+ SplineChar *sc;
+ int changed;
+ AnchorPoint *ap_pt;
+ AnchorPoint ap_vals;
+ struct state *next;
+};
+
typedef struct anchord {
GWindow gw;
int ctl_len;
@@ -71,27 +88,14 @@ typedef struct anchord {
/* (length is bdfc->width + apmatch->width */
/* left to right/right to left is important here! */
/* we might be cursive exit, we see all the entries that attach */
- struct apmatch {
- SplineChar *sc;
- AnchorPoint *ap;
- BDFChar *bdfc;
- int off; /* a mark-to-mark display might have the same */
- int size; /* odd positioning problems as above */
- int xstart; /* This is scaled by factor, others are not */
- } *apmatch;
+ struct apmatch *apmatch;
void *freetypecontext;
int combo, on_ap;
BasePoint orig_pos;
int done;
/* If they change more than one anchor, retain the original values so that */
/* we can revert to them */
- struct state {
- SplineChar *sc;
- int changed;
- AnchorPoint *ap_pt;
- AnchorPoint ap_vals;
- struct state *next;
- } *orig_vals;
+ struct state *orig_vals;
int layer;
} AnchorDlg;
View
7 fontforge/autowidth.c
@@ -1356,10 +1356,13 @@ static char *SCListToName(SplineChar **sclist) {
return( names );
}
+struct otlmap { OTLookup *from, *to; };
+struct submap { struct lookup_subtable *from, *to; };
+
struct lookupmap {
int lc, sc;
- struct otlmap { OTLookup *from, *to; } *lmap;
- struct submap { struct lookup_subtable *from, *to; } *smap;
+ struct otlmap *lmap;
+ struct submap *smap;
SplineFont *sf;
};
View
50 fontforge/baseviews.h
@@ -118,9 +118,12 @@ struct cvcontainer {
};
enum nav_type { nt_prevdef, nt_prev, nt_goto, nt_next, nt_nextdef };
+
+enum cv_container_type { cvc_searcher, cvc_mathkern, cvc_tilepath,
+ cvc_gradient, cvc_multiplepattern, cvc_stroke };
+
struct cvcontainer_funcs {
- enum cv_container_type { cvc_searcher, cvc_mathkern, cvc_tilepath,
- cvc_gradient, cvc_multiplepattern, cvc_stroke } type;
+ enum cv_container_type type;
void (*activateMe)(struct cvcontainer *cvc,struct charviewbase *cv);
void (*charEvent)(struct cvcontainer *cvc,void *event);
int (*canNavigate)(struct cvcontainer *cvc,enum nav_type type);
@@ -145,8 +148,10 @@ struct fvcontainer {
struct fvcontainer_funcs *funcs;
};
+enum fv_container_type { fvc_kernformat, fvc_glyphset };
+
struct fvcontainer_funcs {
- enum fv_container_type { fvc_kernformat, fvc_glyphset } type;
+ enum fv_container_type type;
int is_modal; /* If the fvc is in a modal dialog then we can't create modeless windows (like charviews, fontinfo, etc.) */
void (*activateMe)(struct fvcontainer *fvc,struct fontviewbase *fv);
void (*charEvent)(struct fvcontainer *fvc,void *event);
@@ -200,6 +205,8 @@ typedef struct {
char *upload_id; /* Way to manipulate upload on OFLib */
} OFLibData;
+enum counter_type { ct_squish, ct_retain, ct_auto };
+
struct lcg_zones {
/* info for unhinted processing */
/* everything abvoe this should be moved down (default xheight/2) */
@@ -216,7 +223,7 @@ struct lcg_zones {
/* also anything on the other side of a hint from this should be moved down */
int bottom_bound;
- enum counter_type { ct_squish, ct_retain, ct_auto } counter_type;
+ enum counter_type counter_type;
SplineSet *(*embolden_hook)(SplineSet *,struct lcg_zones *,SplineChar *,int layer);
int wants_hints;
@@ -231,6 +238,11 @@ struct lcg_zones {
/* This order is the same order as the radio buttons in the embolden dlg */
enum embolden_type { embolden_lcg, embolden_cjk, embolden_auto, embolden_custom, embolden_error };
+struct ci_zones {
+ double start, width;
+ double moveto, newwidth; /* Only change width for diagonal stems*/
+};
+
struct counterinfo {
double c_factor, c_add; /* For counters */
double sb_factor, sb_add; /* For side bearings */
@@ -248,10 +260,7 @@ struct counterinfo {
#define BOT_Z 1
int cnts[2];
int maxes[2];
- struct ci_zones {
- double start, width;
- double moveto, newwidth; /* Only change width for diagonal stems*/
- } *zones[2];
+ struct ci_zones *zones[2];
};
enum fvformats { fv_bdf, fv_ttf, fv_pk, fv_pcf, fv_mac, fv_win, fv_palm,
@@ -371,6 +380,17 @@ extern void SmallCapsFindConstants(struct smallcaps *small, SplineFont *sf,
enum glyphchange_type { gc_generic, gc_smallcaps, gc_subsuper, gc_max };
+struct position_maps {
+ double current , desired;
+ double cur_width, des_width;
+ int overlap_index;
+};
+
+struct fixed_maps {
+ int cnt;
+ struct position_maps *maps;
+};
+
struct genericchange {
enum glyphchange_type gc;
uint32 feature_tag;
@@ -390,14 +410,7 @@ struct genericchange {
uint8 petite; /* generate petite caps rather than smallcaps */
double vcounter_scale, vcounter_add; /* If not using mapping */
double v_scale; /* If using mapping */
- struct fixed_maps {
- int cnt;
- struct position_maps {
- double current , desired;
- double cur_width, des_width;
- int overlap_index;
- } *maps;
- } m;
+ struct fixed_maps m;
struct fixed_maps g; /* Adjusted for each glyph */
double vertical_offset;
unsigned int dstem_control, serif_control;
@@ -500,6 +513,9 @@ extern int OFLibUploadFont(OFLibData *);
enum search_flags { sv_reverse = 0x1, sv_flips = 0x2, sv_rotate = 0x4,
sv_scale = 0x8, sv_endpoints=0x10 };
+
+enum flipset { flip_none = 0, flip_x, flip_y, flip_xy };
+
typedef struct searchdata {
SplineChar sc_srch, sc_rpl;
SplineSet *path, *revpath, *replacepath, *revreplace;
@@ -526,7 +542,7 @@ typedef struct searchdata {
real matched_rot, matched_scale;
real matched_x, matched_y;
double matched_co, matched_si; /* Precomputed sin, cos */
- enum flipset { flip_none = 0, flip_x, flip_y, flip_xy } matched_flip;
+ enum flipset matched_flip;
#ifdef _HAS_LONGLONG
unsigned long long matched_refs; /* Bit map of which refs in the char were matched */
unsigned long long matched_ss; /* Bit map of which splines in the char were matched */
View
8 fontforge/contextchain.c
@@ -35,6 +35,9 @@
/* ************************************************************************** */
/* ************************ Context/Chaining Dialog ************************* */
/* ************************************************************************** */
+enum activewindow { aw_formats, aw_coverage, aw_grules, aw_glyphs,
+ aw_classrules, aw_classnumber,
+ aw_coverage_simple, aw_glyphs_simple, aw_classes_simple };
struct contextchaindlg {
struct gfi_data *gfi;
SplineFont *sf;
@@ -44,10 +47,7 @@ struct contextchaindlg {
GWindow gw;
GWindow formats, coverage, grules, glyphs, classrules, classnumber;
GWindow coverage_simple, glyphs_simple, classes_simple;
- enum activewindow { aw_formats, aw_coverage, aw_grules, aw_glyphs,
- aw_classrules, aw_classnumber,
- aw_coverage_simple, aw_glyphs_simple, aw_classes_simple
- } aw;
+ enum activewindow aw;
/* Wizard panes:
formats -- gives user a choice between by glyph/class/coverage table
Simple version:
View
12 fontforge/delta.h
@@ -44,6 +44,12 @@ struct qgnode {
char *name;
};
+enum qg_error { qg_ok, qg_notnumber, qg_badnumber, qg_badrange, qg_nofont };
+
+enum glyph_sort { gs_unicode, gs_alpha, gs_gid };
+
+enum info_sort { is_glyph_size_pt, is_glyph_pt_size, is_size_glyph_pt };
+
typedef struct qg_data {
/* Set by dlg */
FontViewBase *fv;
@@ -62,7 +68,7 @@ typedef struct qg_data {
/* Set internally */
QuestionableGrid *qg;
int cur, max, glyph_start;
- enum qg_error { qg_ok, qg_notnumber, qg_badnumber, qg_badrange, qg_nofont } error;
+ enum qg_error error;
/* Dlg internal */
struct gwindow *gw;
@@ -76,8 +82,8 @@ typedef struct qg_data {
int loff_top;
struct ggadget *vsb;
struct gwindow *v;
- enum glyph_sort { gs_unicode, gs_alpha, gs_gid } glyph_sort;
- enum info_sort { is_glyph_size_pt, is_glyph_pt_size, is_size_glyph_pt } info_sort;
+ enum glyph_sort glyph_sort;
+ enum info_sort info_sort;
struct qgnode list;
View
3  fontforge/encoding.c
@@ -1187,10 +1187,11 @@ void SFEncodeToMap(SplineFont *sf,struct cidmap *map) {
}
enum cmaptype { cmt_out=-1, cmt_coderange, cmt_notdefs, cmt_cid, cmt_max };
+struct coderange { uint32 first, last, cid; };
struct cmap {
struct {
int n;
- struct coderange { uint32 first, last, cid; } *ranges;
+ struct coderange *ranges;
} groups[cmt_max];
char *registry;
char *ordering;
View
97 fontforge/featurefile.c
@@ -2132,28 +2132,59 @@ static char *fea_classesSplit(char *class1, char *class2) {
return( intersection );
}
+enum toktype { tk_name, tk_class, tk_int, tk_char, tk_cid, tk_eof,
+/* keywords */
+ tk_firstkey,
+ tk_anchor=tk_firstkey, tk_anonymous, tk_by, tk_caret, tk_cursive, tk_device,
+ tk_enumerate, tk_excludeDFLT, tk_exclude_dflt, tk_feature, tk_from,
+ tk_ignore, tk_ignoreDFLT, tk_ignoredflt, tk_IgnoreBaseGlyphs,
+ tk_IgnoreLigatures, tk_IgnoreMarks, tk_include, tk_includeDFLT,
+ tk_include_dflt, tk_language, tk_languagesystem, tk_lookup,
+ tk_lookupflag, tk_mark, tk_nameid, tk_NULL, tk_parameters, tk_position,
+ tk_required, tk_RightToLeft, tk_script, tk_substitute, tk_subtable,
+ tk_table, tk_useExtension,
+/* Additional keywords in the 2008 draft */
+ tk_anchorDef, tk_valueRecordDef, tk_contourpoint,
+ tk_MarkAttachmentType, tk_UseMarkFilteringSet,
+ tk_markClass, tk_reversesub, tk_base, tk_ligature, tk_ligComponent,
+ tk_featureNames
+};
+
+struct glyphclasses {
+ char *classname, *glyphs;
+ struct glyphclasses *next;
+};
+
+struct namedanchor {
+ char *name;
+ AnchorPoint *ap;
+ struct namedanchor *next;
+};
+
+struct namedvalue {
+ char *name;
+ struct vr *vr;
+ struct namedvalue *next;
+};
+
+struct gdef_mark { char *name; int index; char *glyphs; };
+
+/* GPOS mark classes may have multiple definitions each added a glyph
+ * class and anchor, these are linked under "same" */
+struct gpos_mark {
+ char *name;
+ char *glyphs;
+ AnchorPoint *ap;
+ struct gpos_mark *same, *next;
+ int name_used; /* Same "markClass" can be used in any mark type lookup, or indeed in multiple lookups of the same type */
+} *gpos_mark;
+
#define MAXT 80
#define MAXI 5
struct parseState {
char tokbuf[MAXT+1];
long value;
- enum toktype { tk_name, tk_class, tk_int, tk_char, tk_cid, tk_eof,
-/* keywords */
- tk_firstkey,
- tk_anchor=tk_firstkey, tk_anonymous, tk_by, tk_caret, tk_cursive, tk_device,
- tk_enumerate, tk_excludeDFLT, tk_exclude_dflt, tk_feature, tk_from,
- tk_ignore, tk_ignoreDFLT, tk_ignoredflt, tk_IgnoreBaseGlyphs,
- tk_IgnoreLigatures, tk_IgnoreMarks, tk_include, tk_includeDFLT,
- tk_include_dflt, tk_language, tk_languagesystem, tk_lookup,
- tk_lookupflag, tk_mark, tk_nameid, tk_NULL, tk_parameters, tk_position,
- tk_required, tk_RightToLeft, tk_script, tk_substitute, tk_subtable,
- tk_table, tk_useExtension,
-/* Additional keywords in the 2008 draft */
- tk_anchorDef, tk_valueRecordDef, tk_contourpoint,
- tk_MarkAttachmentType, tk_UseMarkFilteringSet,
- tk_markClass, tk_reversesub, tk_base, tk_ligature, tk_ligComponent,
- tk_featureNames
- } type;
+ enum toktype type;
uint32 tag;
int could_be_tag;
FILE *inlist[MAXI];
@@ -2168,23 +2199,16 @@ struct parseState {
unsigned int skipping: 1;
SplineFont *sf;
struct scriptlanglist *def_langsyses;
- struct glyphclasses { char *classname, *glyphs; struct glyphclasses *next; } *classes;
- struct namedanchor { char *name; AnchorPoint *ap; struct namedanchor *next; } *namedAnchors;
- struct namedvalue { char *name; struct vr *vr; struct namedvalue *next; } *namedValueRs;
+ struct glyphclasses *classes;
+ struct namedanchor *namedAnchors;
+ struct namedvalue *namedValueRs;
struct feat_item *sofar;
int base; /* normally numbers are base 10, but in the case of languages in stringids, they can be octal or hex */
OTLookup *created, *last; /* Ordered, but not sorted into GSUB, GPOS yet */
AnchorClass *accreated;
int gm_cnt[2], gm_max[2], gm_pos[2];
- struct gdef_mark { char *name; int index; char *glyphs; } *gdef_mark[2];
- /* GPOS mark classes may have multiple definitions each added a glyph class and anchor, these are linked under "same" */
- struct gpos_mark {
- char *name;
- char *glyphs;
- AnchorPoint *ap;
- struct gpos_mark *same, *next;
- int name_used; /* Same "markClass" can be used in any mark type lookup, or indeed in multiple lookups of the same type */
- } *gpos_mark;
+ struct gdef_mark *gdef_mark[2];
+ struct gpos_mark *gpos_mark;
};
static struct keywords {
@@ -3160,6 +3184,17 @@ return;
}
}
+struct apmark {
+ AnchorPoint *ap;
+ struct gpos_mark *mark_class;
+ uint16 mark_count;
+};
+
+struct ligcomponent {
+ int apm_cnt;
+ struct apmark *apmark;
+};
+
struct markedglyphs {
unsigned int has_marks: 1; /* Are there any marked glyphs in the entire sequence? */
unsigned int is_cursive: 1; /* Only in a position sequence */
@@ -3176,9 +3211,9 @@ struct markedglyphs {
int ap_cnt; /* Number of anchor points */
AnchorPoint **anchors;
int apm_cnt;
- struct apmark { AnchorPoint *ap; struct gpos_mark *mark_class; uint16 mark_count; } *apmark;
+ struct apmark *apmark;
int lc_cnt;
- struct ligcomponent { int apm_cnt; struct apmark *apmark; } *ligcomp;
+ struct ligcomponent *ligcomp;
char *lookupname;
struct markedglyphs *next;
};
View
4 fontforge/fvmetrics.h
@@ -28,6 +28,8 @@
#include <math.h>
#include <ustring.h>
+enum settype { st_set, st_scale, st_incr };
+
typedef struct createwidthdata {
unsigned int done: 1;
void *_fv;
@@ -35,7 +37,7 @@ typedef struct createwidthdata {
real setto;
real scale;
real increment;
- enum settype { st_set, st_scale, st_incr } type;
+ enum settype type;
enum widthtype wtype;
} CreateWidthData;
View
12 fontforge/histograms.c
@@ -35,13 +35,15 @@
/* This operations are designed to work on a single font. NOT a CID collection*/
/* A CID collection must be treated one sub-font at a time */
+struct hentry {
+ int cnt, sum;
+ int char_cnt, max;
+ SplineChar **chars;
+};
+
typedef struct histdata {
int low, high;
- struct hentry {
- int cnt, sum;
- int char_cnt, max;
- SplineChar **chars;
- } *hist; /* array of high-low+1 elements */
+ struct hentry *hist; /* array of high-low+1 elements */
int tot, max;
} HistData;
View
44 fontforge/macbinary.c
@@ -2199,30 +2199,38 @@ return( sf );
return( NULL );
}
+struct assoc {
+ short size, style, id;
+ /* size==0 => scalable */
+ /* style>>8 is the bit depth (0=>1, 1=>2, 2=>4, 3=>8) */
+ /* search order for ID is sfnt, NFNT, FONT */
+};
+
+struct stylewidths {
+ short style;
+ short *widthtab; /* 4.12 fixed number with the width specified as a fraction of an em */
+};
+
+struct kerns {
+ unsigned char ch1, ch2;
+ short offset; /* 4.12 */
+};
+
+struct stylekerns {
+ short style;
+ int kernpairs;
+ struct kerns *kerns;
+};
+
typedef struct fond {
char *fondname;
int first, last;
int assoc_cnt;
- struct assoc {
- short size, style, id;
- } *assoc;
- /* size==0 => scalable */
- /* style>>8 is the bit depth (0=>1, 1=>2, 2=>4, 3=>8) */
- /* search order for ID is sfnt, NFNT, FONT */
+ struct assoc *assoc;
int stylewidthcnt;
- struct stylewidths {
- short style;
- short *widthtab; /* 4.12 fixed number with the width specified as a fraction of an em */
- } *stylewidths;
+ struct stylewidths *stylewidths;
int stylekerncnt;
- struct stylekerns {
- short style;
- int kernpairs;
- struct kerns {
- unsigned char ch1, ch2;
- short offset; /* 4.12 */
- } *kerns;
- } *stylekerns;
+ struct stylekerns *stylekerns;
char *psnames[48];
struct fond *next;
} FOND;
View
6 fontforge/mmdlg.c
@@ -833,10 +833,12 @@ GTextInfo mastercounts[] = {
GTEXTINFO_EMPTY
};
+enum mmw_state { mmw_counts, mmw_axes, mmw_designs, mmw_named, mmw_funcs,
+ mmw_others };
+
typedef struct mmw {
GWindow gw;
- enum mmw_state { mmw_counts, mmw_axes, mmw_designs, mmw_named, mmw_funcs,
- mmw_others } state;
+ enum mmw_state state;
GWindow subwins[mmw_others+1];
MMSet *mm, *old;
int isnew;
View
22 fontforge/oflib.c
@@ -62,18 +62,22 @@ extern GBox _ggadget_Default_Box;
static int fakemons[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
static char *monnames[] = { N_("January"), N_("February"), N_("March"), N_("April"), N_("May"), N_("June"), N_("July"), N_("August"), N_("September"), N_("October"), N_("November"), N_("December") };
+enum ofl_license { ofll_ofl, ofll_pd };
+
+struct ofl_download_urls {
+ char *url;
+ char *comment;
+ uint8 selected;
+ struct ofl_download_urls *next;
+};
+
struct ofl_font_info {
char *name;
char *author;
int date; /* Not real date. Minutes since 2005, assuming Feb has 29 days*/
char *taglist;
- enum ofl_license { ofll_ofl, ofll_pd } license;
- struct ofl_download_urls {
- char *url;
- char *comment;
- uint8 selected;
- struct ofl_download_urls *next;
- } *urls;
+ enum ofl_license license;
+ struct ofl_download_urls *urls;
/* If they've looked at the preview image in the past, cache that locally */
char *preview_filename;
GImage *preview;
@@ -443,10 +447,12 @@ return( anymatches );
}
}
+enum tok_type { tok_int, tok_str, tok_name, tok_EOF };
+
struct tokbuf {
char *buf;
int buf_max;
- enum tok_type { tok_int, tok_str, tok_name, tok_EOF } type;
+ enum tok_type type;
int ival;
};
View
16 fontforge/parsettfatt.c
@@ -183,17 +183,19 @@ return( copy(""));
return( ret );
}
+struct language { /* normal entry with lang tag 'dflt' */
+ uint32 tag;
+ uint32 offset;
+ uint16 req; /* required feature index. 0xffff for null */
+ int fcnt;
+ uint16 *features;
+};
+
struct scripts {
uint32 offset;
uint32 tag;
int langcnt; /* the default language is included as a */
- struct language { /* normal entry with lang tag 'dflt' */
- uint32 tag;
- uint32 offset;
- uint16 req; /* required feature index. 0xffff for null */
- int fcnt;
- uint16 *features;
- } *languages;
+ struct language *languages;
};
struct feature {
View
28 fontforge/parsettfbmf.c
@@ -866,24 +866,26 @@ static int32 ttfdumpf8_9bchar(FILE *bdat, BDFChar *bc,BDFFont *bdf) {
return( pos );
}
+struct sbitLineMetrics {
+ int8 ascender;
+ int8 descender;
+ uint8 widthMax;
+ int8 caretRise;
+ int8 caretRun;
+ int8 caretOff;
+ int8 minoriginsb;
+ int8 minAdvancesb;
+ int8 maxbeforebl;
+ int8 minafterbl;
+ int8 pad1, pad2;
+};
+
struct bitmapSizeTable {
int32 subtableoffset;
int32 tablesize;
int32 numsubtables;
int32 colorRef;
- struct sbitLineMetrics {
- int8 ascender;
- int8 descender;
- uint8 widthMax;
- int8 caretRise;
- int8 caretRun;
- int8 caretOff;
- int8 minoriginsb;
- int8 minAdvancesb;
- int8 maxbeforebl;
- int8 minafterbl;
- int8 pad1, pad2;
- } hori, vert;
+ struct sbitLineMetrics hori, vert;
uint16 startGlyph;
uint16 endGlyph;
uint8 ppemX;
View
8 fontforge/print.c
@@ -400,6 +400,12 @@ static void pdf_dump_type1(PI *pi,int sfid) {
sfbit->twobyte = false;
}
+struct opac_state {
+ int isfill;
+ float opacity;
+ int obj;
+};
+
struct glyph_res {
int pattern_cnt, pattern_max;
char **pattern_names;
@@ -408,7 +414,7 @@ struct glyph_res {
char **image_names;
int *image_objs;
int opacity_cnt, opacity_max;
- struct opac_state { int isfill; float opacity; int obj; } *opac_state;
+ struct opac_state *opac_state;
};
#define GLYPH_RES_EMPTY { 0, 0, NULL, NULL, 0, 0, NULL, NULL, 0, 0, NULL }
View
50 fontforge/print.h
@@ -35,13 +35,38 @@ extern int use_gv;
static const int printdpi = 600;
+enum printtype { pt_fontdisplay, pt_chars, pt_multisize, pt_fontsample };
+
+struct sfbits {
+ /* If it's a CID font we'll only have one. Otherwise we might have */
+ /* several different encodings to get all the glyphs we need. Each */
+ /* one counts as a font */
+ SplineFont *sf;
+ EncMap *map;
+ char psfontname[300];
+ int *our_font_objs;
+ int next_font, max_font;
+ int *fonts; /* An array of sf->charcnt/256 entries indicating */
+ /* the font number of encodings on that page of */
+ /* the font. -1 => not mapped (no encodings) */
+ FILE *fontfile;
+ int cidcnt;
+ unsigned int twobyte: 1;
+ unsigned int istype42cid: 1;
+ unsigned int iscid: 1;
+ unsigned int wastwobyte: 1;
+ unsigned int isunicode: 1;
+ unsigned int isunicodefull: 1;
+ struct sfmaps *sfmap;
+};
+
typedef struct printinfo {
FontViewBase *fv;
struct metricsview *mv;
SplineChar *sc;
SplineFont *mainsf;
EncMap *mainmap;
- enum printtype { pt_fontdisplay, pt_chars, pt_multisize, pt_fontsample } pt;
+ enum printtype pt;
int pointsize;
int32 *pointsizes;
int extrahspace, extravspace;
@@ -68,28 +93,7 @@ typedef struct printinfo {
/* sample text there may be many logical fonts. And each one may need to */
/* be represented by many actual fonts to encode all our glyphs */
int sfcnt, sfmax, sfid;
- struct sfbits {
- /* If it's a CID font we'll only have one. Otherwise we might have */
- /* several different encodings to get all the glyphs we need. Each */
- /* one counts as a font */
- SplineFont *sf;
- EncMap *map;
- char psfontname[300];
- int *our_font_objs;
- int next_font, max_font;
- int *fonts; /* An array of sf->charcnt/256 entries indicating */
- /* the font number of encodings on that page of */
- /* the font. -1 => not mapped (no encodings) */
- FILE *fontfile;
- int cidcnt;
- unsigned int twobyte: 1;
- unsigned int istype42cid: 1;
- unsigned int iscid: 1;
- unsigned int wastwobyte: 1;
- unsigned int isunicode: 1;
- unsigned int isunicodefull: 1;
- struct sfmaps *sfmap;
- } *sfbits;
+ struct sfbits *sfbits;
long start_cur_page;
int lastfont, intext;
struct layoutinfo *sample;
View
20 fontforge/problems.c
@@ -35,6 +35,16 @@
/* ***************************** Problems Dialog **************************** */
/* ************************************************************************** */
+struct mgrpl {
+ char *search;
+ char *rpl; /* a rpl of "" means delete (NULL means not found) */
+};
+
+struct mlrpl {
+ uint32 search;
+ uint32 rpl;
+};
+
struct problems {
FontView *fv;
CharView *cv;
@@ -108,14 +118,8 @@ struct problems {
struct lookup_subtable *badsubs_lsubtable;
AnchorClass *missinganchor_class;
int rpl_cnt, rpl_max;
- struct mgrpl {
- char *search;
- char *rpl; /* a rpl of "" means delete (NULL means not found) */
- } *mg;
- struct mlrpl {
- uint32 search;
- uint32 rpl;
- } *mlt;
+ struct mgrpl *mg;
+ struct mlrpl *mlt;
char *glyphname;
int glyphenc;
EncMap *map;
View
16 fontforge/psfont.h
@@ -160,17 +160,19 @@ typedef struct fontdict {
#endif
} FontDict;
+struct fddata {
+ int leniv;
+ int subrmapoff, sdbytes, subrcnt;
+ int flexmax;
+ unsigned int iscjk:1;
+ struct pschars *subrs;
+};
+
struct cidbytes {
int fdbytes, gdbytes, cidcnt;
int cidmapoffset;
int fdcnt;
- struct fddata {
- int leniv;
- int subrmapoff, sdbytes, subrcnt;
- int flexmax;
- unsigned int iscjk:1;
- struct pschars *subrs;
- } *fds;
+ struct fddata *fds;
int *fdind;
int errors;
};
View
4 fontforge/scstyles.c
@@ -4477,13 +4477,15 @@ static void ItalicCompress(SplineChar *sc,int layer,struct hsquash *squash) {
}
}
+enum pt_type { pt_oncurve, pt_offcurve, pt_end };
+
struct italicserifdata {
int emsize;
double stemwidth;
double xheight;
double ia;
double stem_angle;
- struct { double x,y; enum { pt_oncurve, pt_offcurve, pt_end } type; } points[27];
+ struct { double x,y; enum pt_type type; } points[27];
};
static struct italicserifdata normalitalicserif = /* faces right */
{ 1000, 84, 450, -15.2, 90, /* vertical */{
View
76 fontforge/sd.h
@@ -57,31 +57,41 @@ typedef struct textunit {
struct textunit *next;
} TextUnit;
+struct filledsplines {
+ SplineSet *splines;
+ unsigned int isfillable: 1; /* All splinesets are closed */
+ Pen fill, stroke; /* A value of 0xffffffff means do not fill or stroke */
+ float stroke_width;
+ enum linejoin join;
+ enum linecap cap;
+ real transform[6]; /* The stroke may be quite different depending on the transformation (ie. ellipse not circle, rotated, etc) */
+};
+
+struct text {
+ TextUnit *text;
+ real transform[6];
+ struct entity *bound;
+};
+
+struct image {
+ GImage *image;
+ real transform[6];
+ Color col; /* that gets poured into imagemasks */
+};
+
+struct group {
+ struct entity *group;
+};
+
+enum entity_type { et_splines, et_text, et_image, et_group };
+
typedef struct entity {
- enum entity_type { et_splines, et_text, et_image, et_group } type;
+ enum entity_type type;
union {
- struct filledsplines {
- SplineSet *splines;
- unsigned int isfillable: 1; /* All splinesets are closed */
- Pen fill, stroke; /* A value of 0xffffffff means do not fill or stroke */
- float stroke_width;
- enum linejoin join;
- enum linecap cap;
- real transform[6]; /* The stroke may be quite different depending on the transformation (ie. ellipse not circle, rotated, etc) */
- } splines;
- struct text {
- TextUnit *text;
- real transform[6];
- struct entity *bound;
- } text;
- struct image {
- GImage *image;
- real transform[6];
- Color col; /* that gets poured into imagemasks */
- } image;
- struct group {
- struct entity *group;
- } group;
+ struct filledsplines splines;
+ struct text text;
+ struct image image;
+ struct group group;
} u;
SplineSet *clippath;
DBounds bb;
@@ -140,15 +150,19 @@ struct pskeydict {
struct pskeyval *entries;
};
+enum pstype { ps_void, ps_num, ps_bool, ps_string, ps_instr, ps_lit,
+ ps_mark, ps_array, ps_dict };
+
+union vals {
+ real val;
+ int tf;
+ char *str;
+ struct pskeydict dict; /* and for arrays too */
+};
+
struct psstack {
- enum pstype { ps_void, ps_num, ps_bool, ps_string, ps_instr, ps_lit,
- ps_mark, ps_array, ps_dict } type;
- union vals {
- real val;
- int tf;
- char *str;
- struct pskeydict dict; /* and for arrays too */
- } u;
+ enum pstype type;
+ union vals u;
};
struct pskeyval {
View
36 fontforge/sfd1.h
@@ -79,10 +79,31 @@ typedef struct generic_asm1 { /* Apple State Machine */
uint32 opentype_tag; /* If converted from opentype */
} ASM1;
+struct table_ordering {
+ uint32 table_tag;
+ uint32 *ordered_features;
+ struct table_ordering *next;
+};
+
+struct script_record {
+ uint32 script;
+ uint32 *langs;
+};
+
+struct tagtype {
+ enum possub_type type;
+ uint32 tag;
+};
+
+struct gentagtype {
+ uint16 tt_cur, tt_max;
+ struct tagtype *tagtype;
+};
+
typedef struct splinefont1 {
SplineFont sf;
- struct table_ordering { uint32 table_tag; uint32 *ordered_features; struct table_ordering *next; } *orders;
+ struct table_ordering *orders;
/* Any GPOS/GSUB entry (PST, AnchorClass, kerns, FPST */
/* Has an entry saying what scripts/languages it should appear it */
@@ -91,19 +112,10 @@ typedef struct splinefont1 {
/* Rather than store the complete list of possibilities in each PST we */
/* store all choices used here, and just store an index into this list */
/* in the PST. All lists are terminated by a 0 entry */
- struct script_record {
- uint32 script;
- uint32 *langs;
- } **script_lang;
+ struct script_record **script_lang;
int16 sli_cnt;
- struct gentagtype {
- uint16 tt_cur, tt_max;
- struct tagtype {
- enum possub_type type;
- uint32 tag;
- } *tagtype;
- } gentags;
+ struct gentagtype gentags;
} SplineFont1;
extern int SFFindBiggestScriptLangIndex(SplineFont *_sf,uint32 script,uint32 lang);
View
66 fontforge/sflayoutP.h
@@ -46,40 +46,48 @@ typedef struct fontdata {
struct sfmaps *sfmap;
} FontData;
+struct lineheights {
+ int32 y;
+ int16 as, fh;
+ uint16 p, linelen;
+ uint32 start_pos;
+};
+
+struct fontlist {
+ int start, end; /* starting and ending characters [start,end) */
+ /* always break at newline & will omit it between fontlists */
+ uint32 *feats; /* Ends with a 0 entry */
+ uint32 script, lang;
+ FontData *fd;
+ SplineChar **sctext;
+ int scmax;
+ struct opentype_str *ottext;
+ struct fontlist *next;
+};
+
+struct sfmaps {
+ SplineFont *sf;
+ EncMap *map;
+ int16 sfbit_id;
+ int16 notdef_gid;
+ SplineChar *fake_notdef;
+ struct sfmaps *next;
+};
+
+struct paras {
+ struct opentype_str **para; /* An array of pointers to ottext entries */
+ int start_pos;
+};
+
typedef struct layoutinfo {
unichar_t *text, *oldtext; /* Input glyphs (in unicode) */
int16 lcnt, lmax;
struct opentype_str ***lines; /* pointers into the paras array */
int16 xmax;
- struct lineheights {
- int32 y;
- int16 as, fh;
- uint16 p, linelen;
- uint32 start_pos;
- } *lineheights;
- struct fontlist {
- int start, end; /* starting and ending characters [start,end) */
- /* always break at newline & will omit it between fontlists */
- uint32 *feats; /* Ends with a 0 entry */
- uint32 script, lang;
- FontData *fd;
- SplineChar **sctext;
- int scmax;
- struct opentype_str *ottext;
- struct fontlist *next;
- } *fontlist, *oldfontlist;
- struct sfmaps {
- SplineFont *sf;
- EncMap *map;
- int16 sfbit_id;
- int16 notdef_gid;
- SplineChar *fake_notdef;
- struct sfmaps *next;
- } *sfmaps;
- struct paras {
- struct opentype_str **para; /* An array of pointers to ottext entries */
- int start_pos;
- } *paras;
+ struct lineheights *lineheights;
+ struct fontlist *fontlist, *oldfontlist;
+ struct sfmaps *sfmaps;
+ struct paras *paras;
int pcnt, pmax;
int ps, pe, ls, le;
struct fontlist *oldstart, *oldend;
View
4 fontforge/showatt.c
@@ -62,6 +62,8 @@ struct node {
int lpos;
};
+enum dlg_type { dt_show_att, dt_font_comp };
+
struct att_dlg {
unsigned int done: 1;
struct node *tables;
@@ -74,7 +76,7 @@ struct att_dlg {
int fh, as;
GFont *font, *monofont;
struct node *current;
- enum dlg_type { dt_show_att, dt_font_comp } dlg_type;
+ enum dlg_type dlg_type;
FontView *fv1, *fv2;
struct node *popup_node;
};
View
54 fontforge/splinesave.c
@@ -87,37 +87,43 @@ int autohint_before_generate = 1;
/* Then, on top of that I tried generating some full glyph subroutines, and */
/* to my surprise, it just made things worse. */
+struct potentialsubrs {
+ uint8 *data; /* the charstring of the subr */
+ int len; /* the length of the charstring */
+ int idx; /* initially index into psubrs array */
+ /* then index into subrs array or -1 if none */
+ int cnt; /* the usage count */
+ int fd; /* Which sub font is it in */
+ /* -1 => used in more than one */
+ int next;
+ int full_glyph_index; /* Into the glyphbits array */
+ /* for full references */
+ BasePoint *startstop; /* Again for full references */
+};
+
+struct bits {
+ uint8 *data;
+ int dlen;
+ int psub_index;
+};
+
+struct glyphbits {
+ SplineChar *sc;
+ int fd; /* Which subfont is it in */
+ int bcnt;
+ struct bits *bits;
+ uint8 wasseac;
+};
+
#define HSH_SIZE 511
/* In type2 charstrings we divide every character into bits where a bit is */
/* bounded by a hintmask/moveto. Each of these is a potential subroutine and */
/* is stored here */
typedef struct glyphinfo {
- struct potentialsubrs {
- uint8 *data; /* the charstring of the subr */
- int len; /* the length of the charstring */
- int idx; /* initially index into psubrs array */
- /* then index into subrs array or -1 if none */
- int cnt; /* the usage count */
- int fd; /* Which sub font is it in */
- /* -1 => used in more than one */
- int next;
- int full_glyph_index; /* Into the glyphbits array */
- /* for full references */
- BasePoint *startstop; /* Again for full references */
- } *psubrs;
+ struct potentialsubrs *psubrs;
int pcnt, pmax;
int hashed[HSH_SIZE];
- struct glyphbits {
- SplineChar *sc;
- int fd; /* Which subfont is it in */
- int bcnt;
- struct bits {
- uint8 *data;
- int dlen;
- int psub_index;
- } *bits;
- uint8 wasseac;
- } *gb, *active;
+ struct glyphbits *gb, *active;
SplineFont *sf;
int layer;
int glyphcnt;
View
12 fontforge/splinesaveafm.c
@@ -1191,15 +1191,17 @@ static void AfmSplineFontHeader(FILE *afm, SplineFont *sf, int formattype,
fprintf( afm, "Descender %d\n", (int) rint(dsh*1000/em) );
}
+struct cc_accents {
+ SplineChar *accent;
+ real xoff, yoff;
+ struct cc_accents *next;
+};
+
struct cc_data {
char *name;
SplineChar *base;
int acnt;
- struct cc_accents {
- SplineChar *accent;
- real xoff, yoff;
- struct cc_accents *next;
- } *accents;
+ struct cc_accents *accents;
};
struct cc_container {
View
4 fontforge/splinestroke.c
@@ -64,8 +64,10 @@ struct extrapoly {
int ptcnt; /* 3 (for miters) or 4 (for square caps) */
};
+enum pentype { pt_circle, pt_square, pt_poly };
+
typedef struct strokecontext {
- enum pentype { pt_circle, pt_square, pt_poly } pentype;
+ enum pentype pentype;
int cur, max;
StrokePoint *all;
struct extrapoly *ep;
View
64 fontforge/stemdb.h
@@ -29,6 +29,11 @@
# include "fontforge.h"
+struct segment {
+ double start, end, sbase, ebase;
+ int curved, scurved, ecurved;
+};
+
typedef struct glyphdata {
SplineFont *sf;
BlueData bd;
@@ -62,10 +67,7 @@ typedef struct glyphdata {
struct st *stspace;
DBounds size;
struct pointdata **pspace;
- struct segment {
- double start, end, sbase, ebase;
- int curved, scurved, ecurved;
- } *lspace, *rspace, *bothspace, *activespace;
+ struct segment *lspace, *rspace, *bothspace, *activespace;
int only_hv;
} GlyphData;
@@ -118,6 +120,33 @@ typedef struct linedata {
struct pointdata **points;
} LineData;
+struct stem_chunk {
+ struct stemdata *parent;
+ struct pointdata *l;
+ struct pointdata *r;
+ uint8 lpotential, rpotential;
+ uint8 lnext, rnext; /* are we using the next/prev side of the left/right points */
+ uint8 ltick, rtick;
+ uint8 stub;
+ uint8 stemcheat; /* It's not a real stem, but it's something we'd like PostScript to hint for us */
+ uint8 is_ball; /* Specifies if this chunk marks the opposite sides of a ball terminal (useful for TTF instructions) */
+ struct stemdata *ball_m;
+ int l_e_idx, r_e_idx; /* Which of the opposed edges assigned to the left and right points corresponds to this chunk */
+};
+
+struct dependent_stem {
+ struct stemdata *stem;
+ uint8 lbase;
+ char dep_type; /* can be 'a' (align), 'i' (interpolate), 'm' (move) or 's' (serif) */
+};
+
+struct dependent_serif {
+ struct stemdata *stem;
+ double width; /* The distance from an edge of the main stem to the opposite edge of the serif stem */
+ uint8 lbase;
+ uint8 is_ball;
+};
+
typedef struct stemdata {
BasePoint unit; /* Unit vector pointing in direction of stem */
BasePoint l_to_r; /* Unit vector pointing from left to right (across stem) */
@@ -130,19 +159,7 @@ typedef struct stemdata {
double lmin, lmax, rmin, rmax;
double width;
int chunk_cnt; /* number of separate point-pairs on this stem */
- struct stem_chunk {
- struct stemdata *parent;
- struct pointdata *l;
- struct pointdata *r;
- uint8 lpotential, rpotential;
- uint8 lnext, rnext; /* are we using the next/prev side of the left/right points */
- uint8 ltick, rtick;
- uint8 stub;
- uint8 stemcheat; /* It's not a real stem, but it's something we'd like PostScript to hint for us */
- uint8 is_ball; /* Specifies if this chunk marks the opposite sides of a ball terminal (useful for TTF instructions) */
- struct stemdata *ball_m;
- int l_e_idx, r_e_idx; /* Which of the opposed edges assigned to the left and right points corresponds to this chunk */
- } *chunks;
+ struct stem_chunk *chunks;
int activecnt;
struct segment *active;
uint8 toobig; /* Stem is fatter than tall, unlikely to be a real stem */
@@ -161,17 +178,8 @@ typedef struct stemdata {
int confl_cnt;
int dep_cnt;
int serif_cnt;
- struct dependent_stem {
- struct stemdata *stem;
- uint8 lbase;
- char dep_type; /* can be 'a' (align), 'i' (interpolate), 'm' (move) or 's' (serif) */
- } *dependent; /* Lists other stems dependent from the given stem */
- struct dependent_serif {
- struct stemdata *stem;
- double width; /* The distance from an edge of the main stem to the opposite edge of the serif stem */
- uint8 lbase;
- uint8 is_ball;
- } *serifs; /* Lists serifs and other elements protruding from the base stem */
+ struct dependent_stem *dependent; /* Lists other stems dependent from the given stem */
+ struct dependent_serif *serifs; /* Lists serifs and other elements protruding from the base stem */
} StemData;
typedef struct vchunk {
View
42 fontforge/tottfgpos.c
@@ -2583,27 +2583,33 @@ return( lfile );
return( final );
}
+struct feat_lookups {
+ uint32 tag;
+ int lcnt;
+ OTLookup **lookups;
+ int feature_id; /* Initially consecutive, but may be rearranged by sorting */
+ uint32 name_param_ptr;
+};
+
+struct langsys {
+ uint32 lang;
+ int fc;
+ int *feature_id;
+ int same_as;
+ int32 offset;
+};
+
+struct scriptset {
+ uint32 script;
+ int lc;
+ struct langsys *langsys;
+};
+
struct ginfo {
int fmax, fcnt;
- struct feat_lookups {
- uint32 tag;
- int lcnt;
- OTLookup **lookups;
- int feature_id; /* Initially consecutive, but may be rearranged by sorting */
- uint32 name_param_ptr;
- } *feat_lookups;
+ struct feat_lookups *feat_lookups;
int sc;
- struct scriptset {
- uint32 script;
- int lc;
- struct langsys {
- uint32 lang;
- int fc;
- int *feature_id;
- int same_as;
- int32 offset;
- } *langsys;
- } *scripts;
+ struct scriptset *scripts;
};
static int FindOrMakeNewFeatureLookup(struct ginfo *ginfo,OTLookup **lookups,
View
158 fontforge/ttf.h
@@ -37,33 +37,50 @@ struct dup {
struct dup *prev;
};
+struct taxis {
+ uint32 tag;
+ real min, def, max; /* in user design space */
+ int nameid;
+ int paircount;
+ real *mapfrom; /* after conversion from [-1,1] */
+ real *mapto; /* secondary conversiont to [-1,1] */
+};
+
+struct tinstance {
+ int nameid;
+ real *coords; /* Location along axes array[axis_count] */
+};
+
+struct tuples {
+ real *coords; /* Location along axes array[axis_count] */
+ SplineChar **chars; /* Varied glyphs, array parallels one in info */
+ struct ttf_table *cvt;
+ KernClass *khead, *klast, *vkhead, *vklast; /* Varied kern classes */
+};
+
struct variations {
int axis_count;
- struct taxis {
- uint32 tag;
- real min, def, max; /* in user design space */
- int nameid;
- int paircount;
- real *mapfrom; /* after conversion from [-1,1] */
- real *mapto; /* secondary conversiont to [-1,1] */
- } *axes; /* Array of axis_count entries */
+ struct taxis *axes; /* Array of axis_count entries */
int instance_count; /* Not master designs, but named interpolations in design space */
- struct tinstance {
- int nameid;
- real *coords; /* Location along axes array[axis_count] */
- } *instances;
+ struct tinstance *instances;
int tuple_count;
- struct tuples {
- real *coords; /* Location along axes array[axis_count] */
- SplineChar **chars; /* Varied glyphs, array parallels one in info */
- struct ttf_table *cvt;
- KernClass *khead, *klast, *vkhead, *vklast;
- /* Varied kern classes */
- } *tuples;
+ struct tuples *tuples;
};
enum gsub_inusetype { git_normal, git_justinuse, git_findnames };
+struct macidname {
+ int id;
+ struct macname *head, *last;
+ struct macidname *next;
+};
+
+struct savetab {
+ uint32 tag;
+ uint32 offset;
+ int len;
+};
+
struct ttfinfo {
int emsize; /* ascent + descent? from the head table */
int ascent, descent; /* from the hhea table */
@@ -260,18 +277,10 @@ struct ttfinfo {
int lookup_cnt; /* Max lookup in current GPOS/GSUB table */
int feature_cnt; /* Max feature in current GPOS/GSUB table */
struct variations *variations;
- struct macidname {
- int id;
- struct macname *head, *last;
- struct macidname *next;
- } *macstrids;
+ struct macidname *macstrids;
struct fontdict *fd; /* For reading in Type42 fonts. Glyph names in postscript section must be associated with glyphs in TTF section */
int savecnt;
- struct savetab {
- uint32 tag;
- uint32 offset;
- int len;
- } *savetab;
+ struct savetab *savetab;
int32 last_size_pos;
uint16 design_size;
uint16 fontstyle_id;
@@ -323,6 +332,16 @@ struct ttfinfo {
enum gsub_inusetype justinuse;
};
+struct taboff {
+ uint32 tag; /* Table name */
+ uint32 checksum;/* for table */
+ uint32 offset; /* to start of table in file */
+ uint32 length;
+ FILE *data;
+ uint16 dup_of;
+ uint16 orderingval;
+};
+
#define MAX_TAB 48
struct tabdir {
int32 version; /* 0x00010000 */
@@ -330,15 +349,7 @@ struct tabdir {
uint16 searchRange; /* (Max power of 2 <= numtab) *16 */
uint16 entrySel; /* Log2(Max power of 2 <= numtab ) */
uint16 rangeShift; /* numtab*16 - searchRange */
- struct taboff {
- uint32 tag; /* Table name */
- uint32 checksum;/* for table */
- uint32 offset; /* to start of table in file */
- uint32 length;
- FILE *data;
- uint16 dup_of;
- uint16 orderingval;
- } tabs[MAX_TAB]; /* room for all the above tables */
+ struct taboff tabs[MAX_TAB];/* room for all the tables */
/* Not in any particular order. */
struct taboff *ordered[MAX_TAB]; /* Ordered the way the tables should be output in file */
struct taboff *alpha[MAX_TAB]; /* Ordered alphabetically by tag for the ttf header */
@@ -395,6 +406,13 @@ struct hmtx {
int16 lsb;
};
+struct kp {
+ uint16 left; /* left glyph num */
+ uint16 right; /* right glyph num */
+ /* table is ordered by these two above treated as uint32 */
+ int16 offset; /* kern amount */
+};
+
struct kern {
uint16 version; /* 0 */
uint16 ntab; /* 1, number of subtables */
@@ -406,12 +424,7 @@ struct kern {
uint16 searchRange; /* (Max power of 2 <= nPairs) *6 */
uint16 entrySel; /* Log2(Max power of 2 <= nPairs ) */
uint16 rangeShift; /* numtab*6 - searchRange */
- struct kp {
- uint16 left; /* left glyph num */
- uint16 right; /* right glyph num */
- /* table is ordered by these two above treated as uint32 */
- int16 offset; /* kern amount */
- } *kerns; /* Array should be nPairs big */
+ struct kp *kerns; /* Array should be nPairs big */
};
struct maxp {
@@ -434,19 +447,21 @@ struct maxp {
/* OpenType docs say: 1 (if no composits), any depth allowed */
};
+struct namerec {
+ uint16 platform; /* 3 => MS */
+ uint16 specific; /* 1 */
+ uint16 language; /* 0x0409 */
+ uint16 nameid; /* 0=>copyright, 1=>family, 2=>weight, 4=>fullname */
+ /* 5=>version, 6=>postscript name */
+ uint16 strlen;
+ uint16 stroff;
+};
+
struct nametab {
uint16 format; /* 0 */
uint16 numrec; /* 1 */
uint16 startOfStrings; /* offset from start of table to start of strings */
- struct namerec {
- uint16 platform; /* 3 => MS */
- uint16 specific; /* 1 */
- uint16 language; /* 0x0409 */
- uint16 nameid; /* 0=>copyright, 1=>family, 2=>weight, 4=>fullname */
- /* 5=>version, 6=>postscript name */
- uint16 strlen;
- uint16 stroff;
- } nr[6];
+ struct namerec nr[6];
};
struct os2 {
@@ -581,6 +596,17 @@ struct vorg {
#endif
};
+struct feat_name {
+ int strid;
+ struct macname *mn, *smn;
+};
+
+struct other_names {
+ int strid;
+ struct macname *mn;
+ struct other_names *next;
+};
+
struct alltabs {
struct tabdir tabdir;
struct head head;
@@ -702,8 +728,8 @@ struct alltabs {
struct fd2data *fds;
int next_strid;
- struct feat_name { int strid; struct macname *mn, *smn; } *feat_name;
- struct other_names { int strid; struct macname *mn; struct other_names *next; } *other_names;
+ struct feat_name *feat_name;
+ struct other_names *other_names;
struct macname2 *ordered_feat;
int next_lookup; /* for doing nested lookups in contextual features */
@@ -720,20 +746,24 @@ struct subhead { uint16 first, cnt, delta, rangeoff; }; /* a sub header in 8/16
enum touchflags { tf_x=1, tf_y=2, tf_d=4, tf_endcontour=0x80, tf_startcontour=0x40 };
+struct ct_branch {
+ uint16 classnum;
+ struct contexttree *branch;
+};
+
+struct ct_subs {
+ struct fpst_rule *rule;
+ struct contexttree *branch;/* if the rule ends here this will be null */
+ uint16 thisclassnum;
+};
+
struct contexttree {
int depth;
int branch_cnt; /* count of subbranches of this node */
- struct ct_branch {
- uint16 classnum;
- struct contexttree *branch;
- } *branches;
+ struct ct_branch *branches;
struct fpst_rule *ends_here;
int rule_cnt; /* count of rules which are active here */
- struct ct_subs {
- struct fpst_rule *rule;
- struct contexttree *branch;/* if the rule ends here this will be null */
- uint16 thisclassnum;
- } *rules;
+ struct ct_subs *rules;
int pending_pos;
OTLookup *applymarkedsubs;
OTLookup *applycursubs;
View
94 fontforge/views.h
@@ -87,6 +87,11 @@ struct instrinfo {
int (*handle_char)(struct instrinfo *,GEvent *e);
};
+struct reflist {
+ RefChar *ref;
+ struct reflist *parent;
+};
+
typedef struct debugview {
struct debugger_context *dc; /* Local to freetype.c */
GWindow dv, v;
@@ -109,13 +114,23 @@ typedef struct debugview {
int codeSize;
uint8 initialbytes[4];
- struct reflist { RefChar *ref; struct reflist *parent; } *active_refs;
+ struct reflist *active_refs;
int last_npoints;
int layer;
} DebugView;
enum dv_coderange { cr_none=0, cr_fpgm, cr_prep, cr_glyph }; /* cleverly chosen to match ttobjs.h */
+struct freehand {
+ struct tracedata *head, *last; /* for the freehand tool */
+ SplinePointList *current_trace;
+ int ignore_wobble; /* Ignore wiggles smaller than this */
+ int skip_cnt;
+};
+
+enum expandedge { ee_none, ee_nw, ee_up, ee_ne, ee_right, ee_se, ee_down,
+ ee_sw, ee_left, ee_max };
+
typedef struct charview {
CharViewBase b;
uint32 showback[BACK_LAYER_MAX/32];
@@ -212,14 +227,8 @@ typedef struct charview {
IPoint handscroll_base;
uint16 rfh, ras;
BasePoint lastknife;
- struct freehand {
- struct tracedata *head, *last; /* for the freehand tool */
- SplinePointList *current_trace;
- int ignore_wobble; /* Ignore wiggles smaller than this */
- int skip_cnt;
- } freehand;
- enum expandedge { ee_none, ee_nw, ee_up, ee_ne, ee_right, ee_se, ee_down,
- ee_sw, ee_left, ee_max } expandedge;
+ struct freehand freehand;
+ enum expandedge expandedge;
BasePoint expandorigin;
real expandwidth, expandheight;
SplinePointList *active_shape;
@@ -298,6 +307,18 @@ struct aplist { AnchorPoint *ap; int connected_to, selected; struct aplist *next
enum mv_grids { mv_hidegrid, mv_showgrid, mv_partialgrid, mv_hidemovinggrid };
enum mv_type { mv_kernonly, mv_widthonly, mv_kernwidth };
+
+struct metricchar {
+ int16 dx, dwidth; /* position and width of the displayed char */
+ int16 dy, dheight; /* displayed info for vertical metrics */
+ int xoff, yoff;
+ int16 mx, mwidth; /* position and width of the text underneath */
+ int16 kernafter;
+ unsigned int selected: 1;
+ GGadget *width, *lbearing, *rbearing, *kern, *name;
+ GGadget* updownkparray[10]; /* Cherry picked elements from width...kern allowing up/down key navigation */
+};
+
typedef struct metricsview {
struct fontview *fv;
SplineFont *sf;
@@ -321,16 +342,7 @@ typedef struct metricsview {
int16 cmax, clen;
SplineChar **chars; /* Character input stream */
struct opentype_str *glyphs;/* after going through the various gsub/gpos transformations */
- struct metricchar { /* One for each glyph above */
- int16 dx, dwidth; /* position and width of the displayed char */
- int16 dy, dheight; /* displayed info for vertical metrics */
- int xoff, yoff;
- int16 mx, mwidth; /* position and width of the text underneath */
- int16 kernafter;
- unsigned int selected: 1;
- GGadget *width, *lbearing, *rbearing, *kern, *name;
- GGadget* updownkparray[10]; /* Cherry picked elements from width...kern allowing up/down key navigation */
- } *perchar;
+ struct metricchar *perchar; /* One for each glyph above */
SplineChar **sstr; /* Character input stream */
int16 mwidth, mbase;
int16 glyphcnt, max;
@@ -564,25 +576,35 @@ typedef struct strokedlg {
} StrokeDlg;
extern void StrokeCharViewInits(StrokeDlg *sd,int cid);
+struct lksubinfo {
+ struct lookup_subtable *subtable;
+ unsigned int deleted: 1;
+ unsigned int new: 1;
+ unsigned int selected: 1;
+ unsigned int moved: 1;
+};
+
+struct lkinfo {
+ OTLookup *lookup;
+ unsigned int open: 1;
+ unsigned int deleted: 1;
+ unsigned int new: 1;
+ unsigned int selected: 1;
+ unsigned int moved: 1;
+ int16 subtable_cnt, subtable_max;
+ struct lksubinfo *subtables;
+};
+
struct lkdata {
int cnt, max;
int off_top, off_left;
- struct lkinfo {
- OTLookup *lookup;
- unsigned int open: 1;
- unsigned int deleted: 1;
- unsigned int new: 1;
- unsigned int selected: 1;
- unsigned int moved: 1;
- int16 subtable_cnt, subtable_max;
- struct lksubinfo {
- struct lookup_subtable *subtable;
- unsigned int deleted: 1;
- unsigned int new: 1;
- unsigned int selected: 1;
- unsigned int moved: 1;
- } *subtables;
- } *all;
+ struct lkinfo *all;
+};
+
+struct anchor_shows {
+ CharView *cv;
+ SplineChar *sc;
+ int restart;
};
struct gfi_data { /* FontInfo */
@@ -600,7 +622,7 @@ struct gfi_data { /* FontInfo */
unsigned int mpdone: 1;
unsigned int lk_drag_and_drop: 1;
unsigned int lk_dropablecursor: 1;
- struct anchor_shows { CharView *cv; SplineChar *sc; int restart; } anchor_shows[2];
+ struct anchor_shows anchor_shows[2];
struct texdata texdata;
GFont *font;
int as, fh;
View
10 gdraw/fontP.h
@@ -187,6 +187,11 @@ struct family_info {
/* encoding, see if we can use a screen font */
};
+struct charset_cairofont { /* One of these for every font in the set (nfont of them) */
+ cairo_scaled_font_t *cf;
+ FcCharSet *cs;
+};
+
struct font_instance {
FontRequest rq; /* identification of this instance */
struct family_info *fam;
@@ -204,10 +209,7 @@ struct font_instance {
GDisplay *mapped_to;
#ifndef _NO_LIBCAIRO
FcFontSet *ordered;
- struct charset_cairofont { /* One of these for every font in the set (nfont of them) */
- cairo_scaled_font_t *cf;
- FcCharSet *cs;
- } *cscf;
+ struct charset_cairofont *cscf; /* One of these for every font in the set (nfont of them) */
FcPattern *pat;
int16 replacement_index;
uint16 replacement_char;
View
4 gdraw/gchardlg.c
@@ -56,6 +56,8 @@ static const struct unicode_nameannot * const *const *_UnicodeNameAnnot = NULL;
#define INSCHR_Close 10
#define INSCHR_Show 11
+enum dsp_mode { d_hex, d_dec, d_unicode, d_kuten };
+
static struct inschr {
GWindow icw;
int width, height;
@@ -63,7 +65,7 @@ static struct inschr {
long sel_char;
enum charset map;
int page;
- enum dsp_mode { d_hex, d_dec, d_unicode, d_kuten } dsp_mode;
+ enum dsp_mode dsp_mode;
unsigned int hidden: 1;
unsigned int show_enabled: 1;
unsigned int mouse_down: 1;
View
3  gdraw/gdrawerror.c
@@ -35,11 +35,12 @@
#define ERR_LINE_MAX 20
static GWindow error;
+enum err_type { et_info, et_warn, et_error, et_fatal };
static struct errinfo {
unichar_t *lines[ERR_LINE_MAX];
unsigned int dismissed: 1;
int width;
- enum err_type { et_info, et_warn, et_error, et_fatal } err_type;
+ enum err_type err_type;
} errinfo;
static int e_h(GWindow gw, GEvent *event) {
View
36 gdraw/ggadgetP.h
@@ -76,6 +76,9 @@ struct gfuncs {
int (*is_default)(GGadget *g);
};
+enum gadget_state {gs_invisible, gs_disabled, gs_enabled, gs_active,
+ gs_focused, gs_pressedactive };
+
struct ggadget {
struct gfuncs *funcs;
struct gwindow *base;
@@ -98,8 +101,7 @@ struct ggadget {
short cid;
void *data;
GBox *box;
- enum gadget_state {gs_invisible, gs_disabled, gs_enabled, gs_active,
- gs_focused, gs_pressedactive } state;
+ enum gadget_state state;
unichar_t *popup_msg;
GGadgetHandler handle_controlevent;
int16 desired_width, desired_height;
@@ -345,9 +347,11 @@ typedef struct gmenubar {
GMenuItem fake[2]; /* Used if not enough room for menu... */
} GMenuBar;
+struct tabs { unichar_t *name; int16 x, width, tw, nesting; unsigned int disabled: 1; GWindow w; };
+
typedef struct gtabset {
struct ggadget g;
- struct tabs { unichar_t *name; int16 x, width, tw, nesting; unsigned int disabled: 1; GWindow w; } *tabs;
+ struct tabs *tabs;
int16 *rowstarts; /* for each row, index into tab array of its first tab, one extra entry at end with tabcnt */
int16 tabcnt; /* number of tabs */
int16 sel; /* active tab */
@@ -408,22 +412,24 @@ typedef struct ghvbox {
int label_height;
} GHVBox;
+struct col_data {
+ enum me_type me_type;
+ char *(*func)(GGadget *,int r,int c); /* Produces a string to display if md_str==NULL */
+ GMenuItem *enum_vals;
+ void (*enable_enum)(GGadget *,GMenuItem *, int r, int c);
+ GTextCompletionHandler completer;
+ char *title;
+ int16 width, x; /* Relative to inner.x */
+ uint8 fixed;
+ uint8 disabled;
+ uint8 hidden;
+};
+
typedef struct gmatrixedit {
GGadget g;
int rows, cols;
int row_max;
- struct col_data {
- enum me_type me_type;
- char *(*func)(GGadget *,int r,int c); /* Produces a string to display if md_str==NULL */
- GMenuItem *enum_vals;
- void (*enable_enum)(GGadget *,GMenuItem *, int r, int c);
- GTextCompletionHandler completer;
- char *title;
- int16 width, x; /* Relative to inner.x */
- uint8 fixed;
- uint8 disabled;
- uint8 hidden;
- } *col_data;
+ struct col_data *col_data;
int hpad, vpad; /* Internal padding */
unsigned int has_titles: 1;
unsigned int lr_pointer: 1;
View
22 gdraw/gimageclut.c
@@ -29,18 +29,22 @@
#include "charset.h"
#include "ustring.h"
+struct clutinf {
+ Color col;
+ int32 cnt;
+ struct clutinf *next;
+};
+
+struct clutcube {
+ int32 cnt;
+ struct clutinf *ours;
+};
+
struct clutcnt {
int sofar;
- struct clutinf {
- Color col;
- int32 cnt;
- struct clutinf *next;
- } clut[256];
+ struct clutinf clut[256];
struct clutinf transinf;
- struct clutcube {
- int32 cnt;
- struct clutinf *ours;
- } cube[16][16][16];
+ struct clutcube cube[16][16][16];
int32 dither[6*6*6];
int size, div;
};
View
28 gdraw/gresedit.c
@@ -33,20 +33,22 @@
#include <stdlib.h>
#include <ustring.h>
-typedef struct greseditdlg {
- struct tofree {
- GGadgetCreateData *gcd;
- GTextInfo *lab;
- GGadgetCreateData mainbox[2], flagsbox, colbox, extrabox, ibox, fontbox,
+struct tofree {
+ GGadgetCreateData *gcd;
+ GTextInfo *lab;
+ GGadgetCreateData mainbox[2], flagsbox, colbox, extrabox, ibox, fontbox,
sabox;
- GGadgetCreateData *marray[11], *farray[5][6], *carray[12][9], *(*earray)[8];
- GGadgetCreateData *iarray[4], *fontarray[5], *saarray[5];
- char *fontname;
- char **extradefs;
- char bw[20], padding[20], rr[20];
- GResInfo *res;
- int startcid, fontcid, btcid;
- } *tofree;
+ GGadgetCreateData *marray[11], *farray[5][6], *carray[12][9], *(*earray)[8];
+ GGadgetCreateData *iarray[4], *fontarray[5], *saarray[5];
+ char *fontname;
+ char **extradefs;
+ char bw[20], padding[20], rr[20];
+ GResInfo *res;
+ int startcid, fontcid, btcid;
+};
+
+typedef struct greseditdlg {
+ struct tofree *tofree;
GWindow gw;
GGadget *tabset;
const char *def_res_file;
View
79 gdraw/gxdrawP.h
@@ -193,8 +193,9 @@ struct gatoms {
redirected => characters from any window go to one window
targetted_redirect => characters from one special window (and its children) go to another window
*/
+enum inputtype { it_normal, it_restricted, it_redirected, it_targetted };
struct inputRedirect {
- enum inputtype { it_normal, it_restricted, it_redirected, it_targetted } it;
+ enum inputtype it;
GWindow cur_dlg; /* This one always gets input */
GWindow inactive; /* This one gives its input to the dlg */
struct inputRedirect *prev;
@@ -210,20 +211,22 @@ struct button_state {
int16 double_wiggle; /* max pixel wiggle allowed between release&click */
};
+struct seldata {
+ int32 typeatom;
+ int32 cnt;
+ int32 unitsize;
+ void *data;
+ void *(*gendata)(void *,int32 *len);
+ /* Either the data are stored here, or we use this function to generate them on the fly */
+ void (*freedata)(void *);
+ struct seldata *next;
+};
+
struct gxselinfo {
int32 sel_atom; /* Either XA_PRIMARY or CLIPBOARD */
GXWindow owner;
Time timestamp;
- struct seldata {
- int32 typeatom;
- int32 cnt;
- int32 unitsize;
- void *data;
- void *(*gendata)(void *,int32 *len);
- /* Either the data are stored here, or we use this function to generate them on the fly */
- void (*freedata)(void *);
- struct seldata *next;
- } *datalist;
+ struct seldata *datalist;
};
struct gxseltypes {
@@ -232,14 +235,43 @@ struct gxseltypes {
Atom *types; /* array of selection types */
};
+struct things_to_do {
+ void (*func)(void *);
+ void *data;
+ struct things_to_do *next;
+};
+
struct xthreaddata {
# ifdef HAVE_PTHREAD_H
pthread_mutex_t sync_mutex; /* controls access to the rest of this structure */
- struct things_to_do { void (*func)(void *); void *data; struct things_to_do *next; } *things_to_do;
+ struct things_to_do *things_to_do;
# endif
int sync_sock, send_sock; /* socket on which to send sync events to thread displaying screen */
};
+struct gimageglobals {
+ XImage *img, *mask;
+ int16 *red_dith, *green_dith, *blue_dith;
+ int32 iwidth, iheight;
+};
+
+struct atomdata { char *atomname; int32 xatom; };
+
+struct inputdevices {
+ char *name;
+ int devid;
+# ifndef _NO_XINPUT
+ XDevice *dev;
+# else
+ int *dev;
+# endif
+ int event_types[5]; /* mousemove, mousedown, mouseup, char, charup */
+};
+
+struct xkb {
+ int opcode, event, error;
+};
+
typedef struct gxdisplay /* : GDisplay */ {
struct displayfuncs *funcs;
void *semaphore; /* To lock the display against multiple threads */
@@ -281,11 +313,7 @@ typedef struct gxdisplay /* : GDisplay */ {
struct button_state bs;
XComposeStatus buildingkeys;
struct inputRedirect *input;
- struct gimageglobals {
- XImage *img, *mask;
- int16 *red_dith, *green_dith, *blue_dith;
- int32 iwidth, iheight;
- } gg;
+ struct gimageglobals gg;
Pixmap grey_stipple;
Pixmap fence_stipple;
int32 mycontext;
@@ -294,7 +322,7 @@ typedef struct gxdisplay /* : GDisplay */ {
Time last_event_time;
struct gxselinfo selinfo[sn_max];
int amax, alen;
- struct atomdata { char *atomname; int32 xatom; } *atomdata;
+ struct atomdata *atomdata;
struct gxseltypes seltypes;
int32 SelNotifyTimeout; /* In seconds (time to give up on requests for selections) */
struct {
@@ -318,25 +346,14 @@ typedef struct gxdisplay /* : GDisplay */ {
int16 xres; /* What X Thinks the resolution is */
XIM im; /* Input method for current locale */
XFontSet def_im_fontset;
- struct inputdevices {
- char *name;
- int devid;
-# ifndef _NO_XINPUT
- XDevice *dev;
-# else
- int *dev;
-# endif
- int event_types[5]; /* mousemove, mousedown, mouseup, char, charup */
- } *inputdevices;
+ struct inputdevices *inputdevices;
int n_inputdevices;
# ifdef _WACOM_DRV_BROKEN
struct wacom_state *wacom_state;
int wacom_fd;
# endif
GXWindow default_icon;
- struct xkb {
- int opcode, event, error;
- } xkb;
+ struct xkb xkb;
#ifndef _NO_LIBPANGO
PangoFontMap *pango_fontmap;
PangoContext *pango_context;
View
8 inc/gdraw.h
@@ -69,13 +69,15 @@ typedef struct font_instance FontInstance, GFont;
enum gic_style { gic_overspot=2, gic_root=1, gic_hidden=0, gic_orlesser=4, gic_type=3 };
typedef struct ginput_context GIC;
+enum draw_func { df_copy, df_xor };
+
typedef struct ggc {
struct gwindow *w;
int32 xor_base;
Color fg;
Color bg;
GRect clip;
- enum draw_func { df_copy, df_xor } func;
+ enum draw_func func;
unsigned int copy_through_sub_windows: 1;
unsigned int bitmap_col: 1; /* window is mapped for bitmap */
int16 skip_len, dash_len;
@@ -291,12 +293,14 @@ enum printer_attr_mask { pam_pagesize=1, pam_margins=2, pam_scale=4,
pam_lpr=0x800, pam_queue=0x1000, pam_eps=0x2000, pam_landscape=0x4000,
pam_title=0x8000 };
+enum printer_units { pu_inches, pu_points, pu_mm };
+
typedef struct gprinter_attrs {
enum printer_attr_mask mask;
float width, height; /* paper size */
float lmargin, rmargin, tmargin, bmargin;
float scale; /* 1.0 implies no scaling */
- enum printer_units { pu_inches, pu_points, pu_mm } units;
+ enum printer_units units;
int32 res; /* printer resolution */
int16 num_copies;
int16 thumbnails; /* linear count of number of thumbnail*/
View
98 inc/ggadget.h
@@ -163,6 +163,30 @@ struct scrollbarinit { int32 sb_min, sb_max, sb_pagesize, sb_pos; };
typedef int (*GGadgetHandler)(GGadget *,GEvent *);
typedef unichar_t **(*GTextCompletionHandler)(GGadget *,int from_tab);
+enum gg_flags { gg_visible=1, gg_enabled=2, gg_pos_in_pixels=4,
+ gg_sb_vert=8, gg_line_vert=gg_sb_vert,
+ gg_but_default=0x10, gg_but_cancel=0x20,
+ gg_cb_on=0x40, gg_rad_startnew=0x80,
+ gg_rad_continueold=0x100, /* even if not previous */
+ gg_list_alphabetic=0x100, gg_list_multiplesel=0x200,
+ gg_list_exactlyone=0x400, gg_list_internal=0x800,
+ gg_group_prevlabel=0x1000, gg_group_end=0x2000,
+ gg_textarea_wrap=0x4000,
+ gg_tabset_scroll=0x8000, gg_tabset_filllines=0x10000, gg_tabset_fill1line = 0x20000,
+ gg_tabset_nowindow=gg_textarea_wrap,
+ gg_rowcol_alphabetic=gg_list_alphabetic,
+ gg_rowcol_vrules=0x40000, gg_rowcol_hrules=0x800000,
+ gg_rowcol_displayonly=0x1000000,
+ gg_dontcopybox=0x10000000,
+ gg_pos_use0=0x20000000, gg_pos_under=0x40000000,
+ gg_pos_newline = (int) 0x80000000,
+ /* Reuse some flag values for different widgets */
+ gg_file_pulldown=gg_sb_vert, gg_file_multiple = gg_list_multiplesel,
+ gg_text_xim = gg_tabset_scroll,
+ gg_tabset_vert = gg_sb_vert,
+ gg_utf8_popup = gg_rowcol_displayonly
+};
+
typedef struct ggadgetdata {
GRect pos;
GBox *box;
@@ -185,29 +209,7 @@ typedef struct ggadgetdata {
Color col;
int radiogroup;
} u;
- enum gg_flags { gg_visible=1, gg_enabled=2, gg_pos_in_pixels=4,
- gg_sb_vert=8, gg_line_vert=gg_sb_vert,
- gg_but_default=0x10, gg_but_cancel=0x20,
- gg_cb_on=0x40, gg_rad_startnew=0x80,
- gg_rad_continueold=0x100, /* even if not previous */
- gg_list_alphabetic=0x100, gg_list_multiplesel=0x200,
- gg_list_exactlyone=0x400, gg_list_internal=0x800,
- gg_group_prevlabel=0x1000, gg_group_end=0x2000,
- gg_textarea_wrap=0x4000,
- gg_tabset_scroll=0x8000, gg_tabset_filllines=0x10000, gg_tabset_fill1line = 0x20000,
- gg_tabset_nowindow=gg_textarea_wrap,
- gg_rowcol_alphabetic=gg_list_alphabetic,
- gg_rowcol_vrules=0x40000, gg_rowcol_hrules=0x800000,
- gg_rowcol_displayonly=0x1000000,
- gg_dontcopybox=0x10000000,
- gg_pos_use0=0x20000000, gg_pos_under=0x40000000,
- gg_pos_newline = (int) 0x80000000,
- /* Reuse some flag values for different widgets */
- gg_file_pulldown=gg_sb_vert, gg_file_multiple = gg_list_multiplesel,
- gg_text_xim = gg_tabset_scroll,
- gg_tabset_vert = gg_sb_vert,
- gg_utf8_popup = gg_rowcol_displayonly
- } flags;
+ enum gg_flags flags;
const unichar_t *popup_msg; /* Brief help message */
GGadgetHandler handle_controlevent;
} GGadgetData;
@@ -239,31 +241,37 @@ enum editor_commands { ec_cut, ec_clear, ec_copy, ec_paste, ec_undo, ec_redo,
/* return values from file chooser filter functions */
enum fchooserret { fc_hide, fc_show, fc_showdisabled };
+enum me_type { me_int, me_enum, me_real, me_string, me_bigstr, me_func,
+ me_funcedit,
+ me_stringchoice, me_stringchoicetrans, me_stringchoicetag,
+ me_button,
+ me_hex, me_uhex, me_addr, me_onlyfuncedit };
+
+struct col_init {
+ enum me_type me_type;
+ char *(*func)(GGadget *,int r,int c);
+ GTextInfo *enum_vals;
+ void (*enable_enum)(GGadget *,GMenuItem *, int r, int c);
+ char *title;
+};
+
+struct matrix_data {
+ union {
+ intpt md_ival;
+ double md_real;
+ char *md_str;
+ void *md_addr;
+ } u;
+ uint8 frozen;
+ uint8 user_bits;
+ uint8 current;
+};
+
struct matrixinit {
int col_cnt;
- struct col_init {
- enum me_type { me_int, me_enum, me_real, me_string, me_bigstr, me_func,
- me_funcedit,
- me_stringchoice, me_stringchoicetrans, me_stringchoicetag,
- me_button,
- me_hex, me_uhex, me_addr, me_onlyfuncedit } me_type;
- char *(*func)(GGadget *,int r,int c);
- GTextInfo *enum_vals;
- void (*enable_enum)(GGadget *,GMenuItem *, int r, int c);
- char *title;
- } *col_init;
+ struct col_init *col_init;
int initial_row_cnt;
- struct matrix_data {
- union {
- intpt md_ival;
- double md_real;
- char *md_str;
- void *md_addr;
- } u;
- uint8 frozen;
- uint8 user_bits;
- uint8 current;
- } *matrix_data;
+ struct matrix_data *matrix_data;
void (*initrow)(GGadget *g,int row);
int (*candelete)(GGadget *g,int row);
void (*finishedit)(GGadget *g,int r, int c, int wasnew);
Please sign in to comment.