summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_textgrid_eo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/canvas/evas_textgrid_eo.h')
-rw-r--r--src/lib/evas/canvas/evas_textgrid_eo.h259
1 files changed, 259 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_textgrid_eo.h b/src/lib/evas/canvas/evas_textgrid_eo.h
new file mode 100644
index 0000000..3eac6dc
--- /dev/null
+++ b/src/lib/evas/canvas/evas_textgrid_eo.h
@@ -0,0 +1,259 @@
1#ifndef _EVAS_TEXTGRID_EO_H_
2#define _EVAS_TEXTGRID_EO_H_
3
4#ifndef _EVAS_TEXTGRID_EO_CLASS_TYPE
5#define _EVAS_TEXTGRID_EO_CLASS_TYPE
6
7typedef Eo Evas_Textgrid;
8
9#endif
10
11#ifndef _EVAS_TEXTGRID_EO_TYPES
12#define _EVAS_TEXTGRID_EO_TYPES
13
14/** The palette to use for the foreground and background colors.
15 *
16 * @since 1.7
17 *
18 * @ingroup Evas_Textgrid
19 */
20typedef enum
21{
22 EVAS_TEXTGRID_PALETTE_NONE = 0, /**< No palette is used */
23 EVAS_TEXTGRID_PALETTE_STANDARD, /**< Standard palette (around 16 colors) */
24 EVAS_TEXTGRID_PALETTE_EXTENDED, /**< Extended palette (at max 256 colors) */
25 EVAS_TEXTGRID_PALETTE_LAST /**< Sentinel value to indicate last enum field
26 * during iteration */
27} Evas_Textgrid_Palette;
28
29/** The style to give to each character of the grid.
30 *
31 * @since 1.7
32 *
33 * @ingroup Evas_Textgrid
34 */
35typedef enum
36{
37 EVAS_TEXTGRID_FONT_STYLE_NORMAL = 1 /* 1 >> 0 */, /**< Normal style */
38 EVAS_TEXTGRID_FONT_STYLE_BOLD = 2 /* 1 >> 1 */, /**< Bold style */
39 EVAS_TEXTGRID_FONT_STYLE_ITALIC = 4 /* 1 >> 2 */ /**< Oblique style */
40} Evas_Textgrid_Font_Style;
41
42/** Evas textgrid cell data structure
43 *
44 * @ingroup Evas_Textgrid
45 */
46typedef struct _Evas_Textgrid_Cell Evas_Textgrid_Cell;
47
48
49#endif
50/** Evas textgrid class
51 *
52 * @ingroup Evas_Textgrid
53 */
54#define EVAS_TEXTGRID_CLASS evas_textgrid_class_get()
55
56EWAPI const Efl_Class *evas_textgrid_class_get(void);
57
58/**
59 * @brief This function is not implemented yet, do not use.
60 *
61 * @param[in] obj The object.
62 * @param[in] styles EVAS_TEXTGRID_FONT_STYLE_NORMAL
63 *
64 * @ingroup Evas_Textgrid
65 */
66EOAPI void evas_obj_textgrid_supported_font_styles_set(Eo *obj, Evas_Textgrid_Font_Style styles);
67
68/**
69 * @brief This function is not implemented yet, do not use.
70 *
71 * @param[in] obj The object.
72 *
73 * @return EVAS_TEXTGRID_FONT_STYLE_NORMAL
74 *
75 * @ingroup Evas_Textgrid
76 */
77EOAPI Evas_Textgrid_Font_Style evas_obj_textgrid_supported_font_styles_get(const Eo *obj);
78
79/**
80 * @brief Set the size of the textgrid object.
81 *
82 * This function sets the number of lines @c h and the number of columns @c w
83 * for the textgrid object @c obj. If @c w or @c h are less than or equal to 0,
84 * this function does nothing.
85 *
86 * @param[in] obj The object.
87 * @param[in] w The number of columns (width in cells) of the grid.
88 * @param[in] h The number of rows (height in cells) of the grid.
89 *
90 * @since 1.7
91 *
92 * @ingroup Evas_Textgrid
93 */
94EOAPI void evas_obj_textgrid_grid_size_set(Eo *obj, int w, int h);
95
96/**
97 * @brief Get the size of the textgrid object.
98 *
99 * This function retrieves the number of lines in the buffer @c h and the
100 * number of columns in the buffer @c w of the textgrid object @c obj. @c w or
101 * @c h can be @c null. On error, they are set to 0.
102 *
103 * @param[in] obj The object.
104 * @param[out] w The number of columns (width in cells) of the grid.
105 * @param[out] h The number of rows (height in cells) of the grid.
106 *
107 * @since 1.7
108 *
109 * @ingroup Evas_Textgrid
110 */
111EOAPI void evas_obj_textgrid_grid_size_get(const Eo *obj, int *w, int *h);
112
113/**
114 * @brief Retrieve the size of a cell of the given textgrid object in pixels.
115 *
116 * This functions retrieves the width and height, in pixels, of a cell of the
117 * textgrid object @c obj and stores them respectively in the buffers @c width
118 * and @c height. Their values depend on the monospace font and style used for
119 * the textgrid object. @c width and @c height can be @c null. On error, they
120 * are set to 0.
121 *
122 * See also @ref efl_text_font_set and
123 * @ref evas_obj_textgrid_supported_font_styles_set
124 *
125 * @param[in] obj The object.
126 * @param[out] width A pointer to the location to store the cell's width in
127 * pixels.
128 * @param[out] height A pointer to the location to store the cell's height in
129 * pixels.
130 *
131 * @since 1.7
132 *
133 * @ingroup Evas_Textgrid
134 */
135EOAPI void evas_obj_textgrid_cell_size_get(const Eo *obj, int *width, int *height);
136
137/**
138 * @brief Indicate for evas that part of a textgrid region (cells) has been
139 * updated.
140 *
141 * This function declares to evas that a region of cells was updated by code
142 * and needs refreshing.
143 *
144 * See also @ref evas_obj_textgrid_cellrow_set,
145 * @ref evas_obj_textgrid_cellrow_get and
146 * @ref evas_obj_textgrid_grid_size_set.
147 *
148 * @param[in] obj The object.
149 * @param[in] x The rect region of cells top-left x (column).
150 * @param[in] y The rect region of cells top-left y (row).
151 * @param[in] w The rect region size in number of cells (columns).
152 * @param[in] h The rect region size in number of cells (rows).
153 *
154 * @since 1.7
155 *
156 * @ingroup Evas_Textgrid
157 */
158EOAPI void evas_obj_textgrid_update_add(Eo *obj, int x, int y, int w, int h);
159
160/**
161 * @brief Set the string at the given row of the given textgrid object.
162 *
163 * This function returns cells to the textgrid taken by
164 * evas_object_textgrid_cellrow_get. The row pointer @c row should be the same
165 * row pointer returned by evas_object_textgrid_cellrow_get for the same row
166 * @c y.
167 *
168 * See also @ref evas_obj_textgrid_cellrow_get,
169 * @ref evas_obj_textgrid_grid_size_set and @ref evas_obj_textgrid_update_add.
170 *
171 * @param[in] obj The object.
172 * @param[in] y The row index of the grid.
173 * @param[in] row The string as a sequence of #Evas_Textgrid_Cell.
174 *
175 * @since 1.7
176 *
177 * @ingroup Evas_Textgrid
178 */
179EOAPI void evas_obj_textgrid_cellrow_set(Eo *obj, int y, const Evas_Textgrid_Cell *row);
180
181/**
182 * @brief Get the string at the given row of the given textgrid object.
183 *
184 * This function returns a pointer to the first cell of the line @c y of the
185 * textgrid object @c obj. If @c y is not between 0 and the number of lines of
186 * the grid - 1, or on error, this function return @c null.
187 *
188 * See also @ref evas_obj_textgrid_cellrow_set,
189 * @ref evas_obj_textgrid_grid_size_set and @ref evas_obj_textgrid_update_add.
190 *
191 * @param[in] obj The object.
192 * @param[in] y The row index of the grid.
193 *
194 * @return A pointer to the first cell of the given row.
195 *
196 * @since 1.7
197 *
198 * @ingroup Evas_Textgrid
199 */
200EOAPI Evas_Textgrid_Cell *evas_obj_textgrid_cellrow_get(const Eo *obj, int y);
201
202/**
203 * @brief The set color to the given palette at the given index of the given
204 * textgrid object.
205 *
206 * This function sets the color for the palette of type @c pal at the index
207 * @c idx of the textgrid object @c obj. The ARGB components are given by @c r,
208 * @c g, @c b and @c a. This color can be used when setting the
209 * #Evas_Textgrid_Cell structure. The components must set a pre-multiplied
210 * color. If pal is #EVAS_TEXTGRID_PALETTE_NONE or #EVAS_TEXTGRID_PALETTE_LAST,
211 * or if @c idx is not between 0 and 255, or on error, this function does
212 * nothing. The color components are clamped between 0 and 255. If @c idx is
213 * greater than the latest set color, the colors between this last index and
214 * @c idx - 1 are set to black (0, 0, 0, 0).
215 *
216 * See also @ref evas_obj_textgrid_palette_get.
217 *
218 * @param[in] obj The object.
219 * @param[in] pal The type of the palette to set the color.
220 * @param[in] idx The index of the palette to which the color is stored.
221 * @param[in] r The red component of the color.
222 * @param[in] g The green component of the color.
223 * @param[in] b The blue component of the color.
224 * @param[in] a The alpha component of the color.
225 *
226 * @since 1.7
227 *
228 * @ingroup Evas_Textgrid
229 */
230EOAPI void evas_obj_textgrid_palette_set(Eo *obj, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a);
231
232/**
233 * @brief The retrieve color to the given palette at the given index of the
234 * given textgrid object.
235 *
236 * This function retrieves the color for the palette of type @c pal at the
237 * index @c idx of the textgrid object @c obj. The ARGB components are stored
238 * in the buffers @c r, @c g, @c b and @c a. If @c idx is not between 0 and the
239 * index of the latest set color, or if @c pal is #EVAS_TEXTGRID_PALETTE_NONE
240 * or #EVAS_TEXTGRID_PALETTE_LAST, the values of the components are 0. @c r,
241 * @c g, @c b and @c a can be @c null.
242 *
243 * See also @ref evas_obj_textgrid_palette_set.
244 *
245 * @param[in] obj The object.
246 * @param[in] pal The type of the palette to set the color.
247 * @param[in] idx The index of the palette to which the color is stored.
248 * @param[out] r A pointer to the red component of the color.
249 * @param[out] g A pointer to the green component of the color.
250 * @param[out] b A pointer to the blue component of the color.
251 * @param[out] a A pointer to the alpha component of the color.
252 *
253 * @since 1.7
254 *
255 * @ingroup Evas_Textgrid
256 */
257EOAPI void evas_obj_textgrid_palette_get(const Eo *obj, Evas_Textgrid_Palette pal, int idx, int *r, int *g, int *b, int *a);
258
259#endif