Debian Codegraph @

fontforgeexe/sftextfieldP.h

raw symbols SCIP
1 /* Copyright (C) 2002-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_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; /* has at least one right to left character */
48 unsigned int password: 1;
49 unsigned int dontdraw: 1; /* Used when the tf is part of a larger control, and the control determines when to draw the tf */
50 unsigned int numericfield: 1;
51 unsigned int incr_down: 1; /* Direction of increments when numeric_scroll events happen */
52 unsigned int completionfield: 1;
53 unsigned int was_completing: 1;
54 uint8_t fh;
55 uint8_t as;
56 uint8_t nw; /* Width of one character (an "n") */
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; /* pointless */
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 /* FONTFORGE_SFTEXTFIELDP_H */