| 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_SFTEXTFIELDP_H |
| 29 |
#define FONTFORGE_SFTEXTFIELDP_H |
| 30 |
|
| 31 |
#include "../gdraw/ggadgetP.h" |
| 32 |
#include "sflayoutP.h" |
| 33 |
|
| 34 |
typedef struct sftextarea { |
| 35 |
GGadget g; |
| 36 |
unsigned int cursor_on: 1; |
| 37 |
unsigned int wordsel: 1; |
| 38 |
unsigned int linesel: 1; |
| 39 |
unsigned int listfield: 1; |
| 40 |
unsigned int drag_and_drop: 1; |
| 41 |
unsigned int has_dd_cursor: 1; |
| 42 |
unsigned int hidden_cursor: 1; |
| 43 |
unsigned int multi_line: 1; |
| 44 |
unsigned int accepts_tabs: 1; |
| 45 |
unsigned int accepts_returns: 1; |
| 46 |
unsigned int tf_wrap: 1; |
| 47 |
unsigned int _dobitext: 1; |
| 48 |
unsigned int password: 1; |
| 49 |
unsigned int dontdraw: 1; |
| 50 |
unsigned int numericfield: 1; |
| 51 |
unsigned int incr_down: 1; |
| 52 |
unsigned int completionfield: 1; |
| 53 |
unsigned int was_completing: 1; |
| 54 |
uint8_t fh; |
| 55 |
uint8_t as; |
| 56 |
uint8_t nw; |
| 57 |
int16_t xoff_left, loff_top; |
| 58 |
int16_t sel_start, sel_end, sel_base; |
| 59 |
int16_t sel_oldstart, sel_oldend, sel_oldbase; |
| 60 |
int16_t dd_cursor_pos; |
| 61 |
unichar_t *pointless_text, *pointless_oldtext; |
| 62 |
FontInstance *font; |
| 63 |
GTimer *pressed; |
| 64 |
GTimer *cursor; |
| 65 |
GCursor old_cursor; |
| 66 |
GScrollBar *hsb, *vsb; |
| 67 |
GIC *gic; |
| 68 |
GTimer *numeric_scroll; |
| 69 |
struct layoutinfo li; |
| 70 |
void *cbcontext; |
| 71 |
void (*changefontcallback)(void *,SplineFont *,enum sftf_fonttype,int size,int aa, |
| 72 |
uint32_t script, uint32_t lang, uint32_t *features); |
| 73 |
} SFTextArea; |
| 74 |
|
| 75 |
extern void SFTFRefreshFonts(GGadget *g); |
| 76 |
extern void SFTextAreaShow(GGadget *g,int pos); |
| 77 |
extern void SFTextAreaSelect(GGadget *g,int start, int end); |
| 78 |
extern void SFTextAreaReplace(GGadget *g,const unichar_t *txt); |
| 79 |
extern int SFTFSetFontData(GGadget *g, int start, int end, SplineFont *sf, |
| 80 |
enum sftf_fonttype, int size, int antialias); |
| 81 |
extern int SFTFSetFont(GGadget *g, int start, int end, SplineFont *sf); |
| 82 |
extern int SFTFSetFontType(GGadget *g, int start, int end, enum sftf_fonttype); |
| 83 |
extern int SFTFSetSize(GGadget *g, int start, int end, int size); |
| 84 |
extern int SFTFSetAntiAlias(GGadget *g, int start, int end, int antialias); |
| 85 |
extern int SFTFSetScriptLang(GGadget *g, int start, int end, uint32_t script, uint32_t lang); |
| 86 |
extern int SFTFSetFeatures(GGadget *g, int start, int end, uint32_t *features); |
| 87 |
extern void SFTFRegisterCallback(GGadget *g, void *cbcontext, |
| 88 |
void (*changefontcallback)(void *,SplineFont *,enum sftf_fonttype,int size,int aa, |
| 89 |
uint32_t script, uint32_t lang, uint32_t *features)); |
| 90 |
extern void SFTFProvokeCallback(GGadget *g); |
| 91 |
extern void SFTFSetDPI(GGadget *g, float dpi); |
| 92 |
extern float SFTFGetDPI(GGadget *g); |
| 93 |
extern void SFTFInitLangSys(GGadget *g, int end, uint32_t script, uint32_t lang); |
| 94 |
extern GGadget *SFTextAreaCreate(struct gwindow *base, GGadgetData *gd,void *data); |
| 95 |
extern void SFTFPopupMenu(SFTextArea *st, GEvent *event); |
| 96 |
|
| 97 |
extern struct gfuncs sftextarea_funcs; |
| 98 |
|
| 99 |
#endif |