summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_text_utils.h
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
commitc15e9c6575c3b5f39ded167dda5259de3de96151 (patch)
tree5115d7ae3620af24c2bc094cd062575af7adeda9 /src/lib/evas/common/evas_text_utils.h
parenta5ac6a987caec5a7f7596a25d0a065b9cc94c50c (diff)
merge: and now Evas
I've tested make -j 3 install and it works nicely I've tested expedite with software and opengl xlib, and it works. Not tested other engines, so please report any problems (engines or other) on the ML. TODO: examples and tests, I'll add them later ISSUE: Eina_Unicode size check. It indirectly depends on eina_config.h, which is created at the end of the configure script. So its size is always 0. I don't know how that size is used, so I can't do a lot, for now. SVN revision: 78895
Diffstat (limited to 'src/lib/evas/common/evas_text_utils.h')
-rw-r--r--src/lib/evas/common/evas_text_utils.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/lib/evas/common/evas_text_utils.h b/src/lib/evas/common/evas_text_utils.h
new file mode 100644
index 0000000000..675df6c200
--- /dev/null
+++ b/src/lib/evas/common/evas_text_utils.h
@@ -0,0 +1,101 @@
1#ifndef _EVAS_TEXT_UTILS_H
2# define _EVAS_TEXT_UTILS_H
3
4typedef struct _Evas_Text_Props Evas_Text_Props;
5typedef struct _Evas_Text_Props_Info Evas_Text_Props_Info;
6typedef struct _Evas_Font_Glyph_Info Evas_Font_Glyph_Info;
7
8typedef enum
9{
10 EVAS_TEXT_PROPS_MODE_NONE = 0,
11 EVAS_TEXT_PROPS_MODE_SHAPE
12} Evas_Text_Props_Mode;
13
14# include "evas_font_ot.h"
15# include "language/evas_bidi_utils.h"
16# include "language/evas_language_utils.h"
17
18/* Used for showing "malformed" or missing chars */
19#define REPLACEMENT_CHAR 0xFFFD
20
21typedef struct _Evas_Glyph Evas_Glyph;
22
23struct _Evas_Text_Props
24{
25 /* Start and len represent the start offset and the length in the
26 * glyphs_info and ot_data fields, they are both internal */
27 size_t start;
28 size_t len;
29 size_t text_offset; /* The text offset from the start of the info */
30 size_t text_len; /* The length of the original text */
31 Evas_BiDi_Props bidi;
32 Evas_Script_Type script;
33 Evas_Text_Props_Info *info;
34 void *font_instance;
35
36 Evas_Glyph *glyphs;
37 int glyphs_length;
38
39 int generation;
40 Eina_Bool changed : 1;
41 Eina_Bool prepare : 1;
42};
43
44struct _Evas_Text_Props_Info
45{
46 unsigned int refcount;
47 Evas_Font_Glyph_Info *glyph;
48 Evas_Font_OT_Info *ot;
49};
50
51/* Sorted in visual order when created */
52struct _Evas_Font_Glyph_Info
53{
54 unsigned int index; /* Should conform to FT */
55 Evas_Coord x_bear;
56 /* This one is rarely used, only in draw, in which we already get the glyph
57 * so it doesn't really save time. Leaving it here just so no one will
58 * add it thinking it was accidentally skipped */
59 Evas_Coord y_bear;
60 Evas_Coord width;
61 Evas_Coord pen_after;
62};
63
64void
65evas_common_text_props_bidi_set(Evas_Text_Props *props,
66 Evas_BiDi_Paragraph_Props *bidi_par_props, size_t start);
67
68void
69evas_common_text_props_script_set(Evas_Text_Props *props, Evas_Script_Type scr);
70
71EAPI Eina_Bool
72evas_common_text_props_content_create(void *_fi, const Eina_Unicode *text,
73 Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props,
74 size_t par_pos, int len, Evas_Text_Props_Mode mode);
75
76void
77evas_common_text_props_content_copy_and_ref(Evas_Text_Props *dst,
78 const Evas_Text_Props *src);
79
80void
81evas_common_text_props_content_ref(Evas_Text_Props *props);
82
83void
84evas_common_text_props_content_unref(Evas_Text_Props *props);
85
86EAPI int
87evas_common_text_props_cluster_next(const Evas_Text_Props *props, int pos);
88
89EAPI int
90evas_common_text_props_cluster_prev(const Evas_Text_Props *props, int pos);
91
92EAPI int
93evas_common_text_props_index_find(const Evas_Text_Props *props, int _cutoff);
94
95EAPI void
96evas_common_text_props_split(Evas_Text_Props *base, Evas_Text_Props *ext,
97 int cutoff);
98EAPI void
99evas_common_text_props_merge(Evas_Text_Props *item1, const Evas_Text_Props *item2);
100
101#endif