forked from enlightenment/efl
Evas font-engine: Added two font opaque types.
Added Evas_Font_Instance and Evas_Font_Set which correspond to RGBA_Font_Int and RGBA_Font. This is very important for strict type checking which we now finally have. This commit does not include logic changes, only casting and changing types of pointers to the opaque pointer types. SVN revision: 59782
This commit is contained in:
parent
b7e2277ef0
commit
60aa86a0ef
|
@ -34,7 +34,7 @@ struct _Evas_Object_Text
|
|||
const char *bidi_delimiters;
|
||||
Evas_Object_Text_Item *items;
|
||||
|
||||
void *engine_data;
|
||||
Evas_Font_Set *font;
|
||||
|
||||
char changed : 1;
|
||||
};
|
||||
|
@ -110,7 +110,7 @@ _evas_object_text_char_coords_get(const Evas_Object *obj,
|
|||
if ((it->text_pos <= pos) &&
|
||||
(pos < (it->text_pos + it->text_props.text_len)))
|
||||
{
|
||||
return ENFN->font_char_coords_get(ENDT, o->engine_data,
|
||||
return ENFN->font_char_coords_get(ENDT, o->font,
|
||||
&it->text_props, pos - it->text_pos, x, y, w, h);
|
||||
}
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ _evas_object_text_last_up_to_pos(const Evas_Object *obj,
|
|||
if ((x <= cx) && (cx < x + it->adv))
|
||||
{
|
||||
return it->text_pos + ENFN->font_last_up_to_pos(ENDT,
|
||||
o->engine_data,
|
||||
o->font,
|
||||
&it->text_props,
|
||||
cx - x,
|
||||
cy);
|
||||
|
@ -197,7 +197,7 @@ _evas_object_text_last_up_to_pos(const Evas_Object *obj,
|
|||
if ((it->x <= cx) && (cx < it->x + it->adv))
|
||||
{
|
||||
return it->text_pos + ENFN->font_last_up_to_pos(ENDT,
|
||||
o->engine_data,
|
||||
o->font,
|
||||
&it->text_props,
|
||||
cx - it->x,
|
||||
cy);
|
||||
|
@ -219,7 +219,7 @@ _evas_object_text_char_at_coords(const Evas_Object *obj,
|
|||
if ((it->x <= cx) && (cx < it->x + it->adv))
|
||||
{
|
||||
return it->text_pos + ENFN->font_char_at_coords_get(ENDT,
|
||||
o->engine_data,
|
||||
o->font,
|
||||
&it->text_props,
|
||||
cx,
|
||||
cy,
|
||||
|
@ -368,15 +368,15 @@ evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size siz
|
|||
}
|
||||
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
if (o->engine_data)
|
||||
evas_common_pipe_op_text_flush(o->engine_data);
|
||||
if (o->font)
|
||||
evas_common_pipe_op_text_flush(o->font);
|
||||
#endif
|
||||
|
||||
/* DO IT */
|
||||
if (o->engine_data)
|
||||
if (o->font)
|
||||
{
|
||||
evas_font_free(obj->layer->evas, o->engine_data);
|
||||
o->engine_data = NULL;
|
||||
evas_font_free(obj->layer->evas, o->font);
|
||||
o->font = NULL;
|
||||
}
|
||||
if (!same_font)
|
||||
{
|
||||
|
@ -389,14 +389,14 @@ evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size siz
|
|||
o->prev.font = NULL;
|
||||
}
|
||||
o->cur.size = size;
|
||||
o->engine_data = evas_font_load(obj->layer->evas, o->cur.font, o->cur.source,
|
||||
o->font = evas_font_load(obj->layer->evas, o->cur.font, o->cur.source,
|
||||
(int)(((double)o->cur.size) * obj->cur.scale));
|
||||
if (o->engine_data)
|
||||
if (o->font)
|
||||
{
|
||||
o->ascent = ENFN->font_ascent_get(ENDT, o->engine_data);
|
||||
o->descent = ENFN->font_descent_get(ENDT, o->engine_data);
|
||||
o->max_ascent = ENFN->font_max_ascent_get(ENDT, o->engine_data);
|
||||
o->max_descent = ENFN->font_max_descent_get(ENDT, o->engine_data);
|
||||
o->ascent = ENFN->font_ascent_get(ENDT, o->font);
|
||||
o->descent = ENFN->font_descent_get(ENDT, o->font);
|
||||
o->max_ascent = ENFN->font_max_ascent_get(ENDT, o->font);
|
||||
o->max_descent = ENFN->font_max_descent_get(ENDT, o->font);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -459,7 +459,7 @@ evas_object_text_font_get(const Evas_Object *obj, const char **font, Evas_Font_S
|
|||
*/
|
||||
static Evas_Object_Text_Item *
|
||||
_evas_object_text_item_new(Evas_Object *obj, Evas_Object_Text *o,
|
||||
void *fi, const Eina_Unicode *str, Evas_Script_Type script,
|
||||
Evas_Font_Instance *fi, const Eina_Unicode *str, Evas_Script_Type script,
|
||||
size_t pos, size_t visual_pos, size_t len)
|
||||
{
|
||||
Evas_Object_Text_Item *it;
|
||||
|
@ -471,17 +471,17 @@ _evas_object_text_item_new(Evas_Object *obj, Evas_Object_Text *o,
|
|||
it->text_pos);
|
||||
evas_common_text_props_script_set(&it->text_props, script);
|
||||
|
||||
if (o->engine_data)
|
||||
if (o->font)
|
||||
{
|
||||
ENFN->font_text_props_info_create(ENDT,
|
||||
fi, str + pos, &it->text_props,
|
||||
o->bidi_par_props, it->text_pos, len);
|
||||
|
||||
ENFN->font_string_size_get(ENDT,
|
||||
o->engine_data,
|
||||
o->font,
|
||||
&it->text_props,
|
||||
&it->w, &it->h);
|
||||
it->adv = ENFN->font_h_advance_get(ENDT, o->engine_data,
|
||||
it->adv = ENFN->font_h_advance_get(ENDT, o->font,
|
||||
&it->text_props);
|
||||
}
|
||||
o->items = (Evas_Object_Text_Item *)
|
||||
|
@ -569,7 +569,7 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico
|
|||
|
||||
while (len > 0)
|
||||
{
|
||||
void *script_fi = NULL;
|
||||
Evas_Font_Instance *script_fi = NULL;
|
||||
int script_len = len, tmp_cut;
|
||||
Evas_Script_Type script;
|
||||
tmp_cut = evas_common_language_script_end_of_run_get(
|
||||
|
@ -583,12 +583,12 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico
|
|||
|
||||
while (script_len > 0)
|
||||
{
|
||||
void *cur_fi;
|
||||
Evas_Font_Instance *cur_fi;
|
||||
int run_len = script_len;
|
||||
if (o->engine_data)
|
||||
if (o->font)
|
||||
{
|
||||
run_len = ENFN->font_run_end_get(ENDT,
|
||||
o->engine_data, &script_fi, &cur_fi,
|
||||
o->font, &script_fi, &cur_fi,
|
||||
script, text + pos, script_len);
|
||||
}
|
||||
#ifdef BIDI_SUPPORT
|
||||
|
@ -812,9 +812,9 @@ evas_object_text_inset_get(const Evas_Object *obj)
|
|||
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||
return 0;
|
||||
MAGIC_CHECK_END();
|
||||
if (!o->engine_data) return 0;
|
||||
if (!o->font) return 0;
|
||||
if (!o->items) return 0;
|
||||
return ENFN->font_inset_get(ENDT, o->engine_data, &o->items->text_props);
|
||||
return ENFN->font_inset_get(ENDT, o->font, &o->items->text_props);
|
||||
}
|
||||
|
||||
EAPI Evas_Coord
|
||||
|
@ -829,7 +829,7 @@ evas_object_text_horiz_advance_get(const Evas_Object *obj)
|
|||
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||
return 0;
|
||||
MAGIC_CHECK_END();
|
||||
if (!o->engine_data) return 0;
|
||||
if (!o->font) return 0;
|
||||
if (!o->items) return 0;
|
||||
return _evas_object_text_horiz_advance_get(obj, o);
|
||||
}
|
||||
|
@ -846,7 +846,7 @@ evas_object_text_vert_advance_get(const Evas_Object *obj)
|
|||
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||
return 0;
|
||||
MAGIC_CHECK_END();
|
||||
if (!o->engine_data) return 0;
|
||||
if (!o->font) return 0;
|
||||
if (!o->items) return o->ascent + o->descent;
|
||||
return _evas_object_text_vert_advance_get(obj, o);
|
||||
}
|
||||
|
@ -865,7 +865,7 @@ evas_object_text_char_pos_get(const Evas_Object *obj, int pos, Evas_Coord *cx, E
|
|||
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||
return EINA_FALSE;
|
||||
MAGIC_CHECK_END();
|
||||
if (!o->engine_data) return EINA_FALSE;
|
||||
if (!o->font) return EINA_FALSE;
|
||||
if (!o->items || (pos < 0)) return EINA_FALSE;
|
||||
ret = _evas_object_text_char_coords_get(obj, o, (size_t) pos,
|
||||
&x, &y, &w, &h);
|
||||
|
@ -906,7 +906,7 @@ evas_object_text_last_up_to_pos(const Evas_Object *obj, Evas_Coord x, Evas_Coord
|
|||
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||
return -1;
|
||||
MAGIC_CHECK_END();
|
||||
if (!o->engine_data) return -1;
|
||||
if (!o->font) return -1;
|
||||
if (!o->items) return -1;
|
||||
return _evas_object_text_last_up_to_pos(obj, o, x, y - o->max_ascent);
|
||||
}
|
||||
|
@ -925,7 +925,7 @@ evas_object_text_char_coords_get(const Evas_Object *obj, Evas_Coord x, Evas_Coor
|
|||
MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
|
||||
return -1;
|
||||
MAGIC_CHECK_END();
|
||||
if (!o->engine_data) return -1;
|
||||
if (!o->font) return -1;
|
||||
if (!o->items) return -1;
|
||||
ret = _evas_object_text_char_at_coords(obj, o, x, y - o->max_ascent,
|
||||
&rx, &ry, &rw, &rh);
|
||||
|
@ -1591,7 +1591,7 @@ evas_object_text_free(Evas_Object *obj)
|
|||
if (o->cur.utf8_text) eina_stringshare_del(o->cur.utf8_text);
|
||||
if (o->cur.font) eina_stringshare_del(o->cur.font);
|
||||
if (o->cur.source) eina_stringshare_del(o->cur.source);
|
||||
if (o->engine_data) evas_font_free(obj->layer->evas, o->engine_data);
|
||||
if (o->font) evas_font_free(obj->layer->evas, o->font);
|
||||
#ifdef BIDI_SUPPORT
|
||||
evas_bidi_paragraph_props_unref(o->bidi_par_props);
|
||||
#endif
|
||||
|
@ -1675,11 +1675,11 @@ evas_object_text_render(Evas_Object *obj, void *output, void *context, void *sur
|
|||
(((int)object->sub.col.a) * (amul)) / 255);
|
||||
|
||||
#define DRAW_TEXT(ox, oy) \
|
||||
if ((o->engine_data) && (it->text_props.len > 0)) \
|
||||
if ((o->font) && (it->text_props.len > 0)) \
|
||||
ENFN->font_draw(output, \
|
||||
context, \
|
||||
surface, \
|
||||
o->engine_data, \
|
||||
o->font, \
|
||||
obj->cur.geometry.x + x + sl + ox + it->x, \
|
||||
obj->cur.geometry.y + y + st + oy + \
|
||||
(int) \
|
||||
|
@ -2004,7 +2004,7 @@ evas_object_text_engine_data_get(Evas_Object *obj)
|
|||
|
||||
o = (Evas_Object_Text *)(obj->object_data);
|
||||
if (!o) return NULL;
|
||||
return o->engine_data;
|
||||
return o->font;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -2048,11 +2048,11 @@ _evas_object_text_rehint(Evas_Object *obj)
|
|||
int is, was;
|
||||
|
||||
o = (Evas_Object_Text *)(obj->object_data);
|
||||
if (!o->engine_data) return;
|
||||
if (!o->font) return;
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
evas_common_pipe_op_text_flush(o->engine_data);
|
||||
evas_common_pipe_op_text_flush(o->font);
|
||||
#endif
|
||||
evas_font_load_hinting_set(obj->layer->evas, o->engine_data,
|
||||
evas_font_load_hinting_set(obj->layer->evas, o->font,
|
||||
obj->layer->evas->hinting);
|
||||
was = evas_object_is_in_output_rect(obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
|
@ -2093,7 +2093,7 @@ _evas_object_text_recalc(Evas_Object *obj)
|
|||
|
||||
if (text) free(text);
|
||||
|
||||
if ((o->engine_data) && (o->items))
|
||||
if ((o->font) && (o->items))
|
||||
{
|
||||
int w, h;
|
||||
int l = 0, r = 0, t = 0, b = 0;
|
||||
|
|
|
@ -338,7 +338,7 @@ struct _Evas_Object_Textblock_Format
|
|||
const char *name;
|
||||
const char *source;
|
||||
const char *fallbacks;
|
||||
void *font;
|
||||
Evas_Font_Set *font;
|
||||
int size;
|
||||
} font;
|
||||
struct {
|
||||
|
@ -2829,7 +2829,7 @@ skip:
|
|||
|
||||
while (str)
|
||||
{
|
||||
void *script_fi = NULL;
|
||||
Evas_Font_Instance *script_fi = NULL;
|
||||
int script_len, tmp_cut;
|
||||
Evas_Script_Type script;
|
||||
|
||||
|
@ -2847,7 +2847,7 @@ skip:
|
|||
|
||||
while (script_len > 0)
|
||||
{
|
||||
void *cur_fi;
|
||||
Evas_Font_Instance *cur_fi;
|
||||
int run_len = script_len;
|
||||
ti = _layout_text_item_new(c, fmt);
|
||||
ti->parent.text_node = n;
|
||||
|
@ -3316,7 +3316,7 @@ _layout_ellipsis_item_new(Ctxt *c, const Evas_Object_Textblock_Item *cur_it)
|
|||
{
|
||||
Evas_Object_Textblock_Text_Item *ellip_ti;
|
||||
Evas_Script_Type script;
|
||||
void *script_fi = NULL, *cur_fi;
|
||||
Evas_Font_Instance *script_fi = NULL, *cur_fi;
|
||||
size_t len = 1; /* The length of _ellip_str */
|
||||
ellip_ti = _layout_text_item_new(c,
|
||||
eina_list_data_get(eina_list_last(c->format_stack)));
|
||||
|
@ -3336,10 +3336,8 @@ _layout_ellipsis_item_new(Ctxt *c, const Evas_Object_Textblock_Item *cur_it)
|
|||
script, _ellip_str, len);
|
||||
|
||||
c->ENFN->font_text_props_info_create(c->ENDT,
|
||||
ellip_ti->parent.format->font.font,
|
||||
_ellip_str, &ellip_ti->text_props,
|
||||
c->par->bidi_props,
|
||||
ellip_ti->parent.text_pos, len);
|
||||
cur_fi, _ellip_str, &ellip_ti->text_props,
|
||||
c->par->bidi_props, ellip_ti->parent.text_pos, len);
|
||||
}
|
||||
|
||||
_text_item_update_sizes(c, ellip_ti);
|
||||
|
@ -7382,7 +7380,7 @@ evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord
|
|||
* @return line number of the char on success, -1 on error.
|
||||
*/
|
||||
static int
|
||||
_evas_textblock_cursor_char_pen_geometry_common_get(int (*query_func) (void *data, void *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch), const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
|
||||
_evas_textblock_cursor_char_pen_geometry_common_get(int (*query_func) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch), const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
|
||||
{
|
||||
Evas_Object_Textblock *o;
|
||||
Evas_Object_Textblock_Line *ln = NULL;
|
||||
|
|
|
@ -46,6 +46,14 @@ typedef struct _Evas_Map_Point Evas_Map_Point;
|
|||
typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array;
|
||||
typedef struct _Evas_Post_Callback Evas_Post_Callback;
|
||||
|
||||
/* General types - used for script type chceking */
|
||||
#define OPAQUE_TYPE(type) struct __##type { int a; }; \
|
||||
typedef struct __##type type
|
||||
|
||||
OPAQUE_TYPE(Evas_Font_Set); /* General type for RGBA_Font */
|
||||
OPAQUE_TYPE(Evas_Font_Instance); /* General type for RGBA_Font_Int */
|
||||
/* End of general types */
|
||||
|
||||
#define MAGIC_EVAS 0x70777770
|
||||
#define MAGIC_OBJ 0x71777770
|
||||
#define MAGIC_OBJ_RECTANGLE 0x71777771
|
||||
|
@ -676,22 +684,22 @@ struct _Evas_Func
|
|||
void (*image_cache_set) (void *data, int bytes);
|
||||
int (*image_cache_get) (void *data);
|
||||
|
||||
void *(*font_load) (void *data, const char *name, int size, Font_Rend_Flags wanted_rend);
|
||||
void *(*font_memory_load) (void *data, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
|
||||
void *(*font_add) (void *data, void *font, const char *name, int size, Font_Rend_Flags wanted_rend);
|
||||
void *(*font_memory_add) (void *data, void *font, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
|
||||
void (*font_free) (void *data, void *font);
|
||||
int (*font_ascent_get) (void *data, void *font);
|
||||
int (*font_descent_get) (void *data, void *font);
|
||||
int (*font_max_ascent_get) (void *data, void *font);
|
||||
int (*font_max_descent_get) (void *data, void *font);
|
||||
void (*font_string_size_get) (void *data, void *font, const Evas_Text_Props *intl_props, int *w, int *h);
|
||||
int (*font_inset_get) (void *data, void *font, const Evas_Text_Props *text_props);
|
||||
int (*font_h_advance_get) (void *data, void *font, const Evas_Text_Props *intl_props);
|
||||
int (*font_v_advance_get) (void *data, void *font, const Evas_Text_Props *intl_props);
|
||||
int (*font_char_coords_get) (void *data, void *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
|
||||
int (*font_char_at_coords_get) (void *data, void *font, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
|
||||
void (*font_draw) (void *data, void *context, void *surface, void *font, int x, int y, int w, int h, int ow, int oh, const Evas_Text_Props *intl_props);
|
||||
Evas_Font_Set *(*font_load) (void *data, const char *name, int size, Font_Rend_Flags wanted_rend);
|
||||
Evas_Font_Set *(*font_memory_load) (void *data, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
|
||||
Evas_Font_Set *(*font_add) (void *data, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend);
|
||||
Evas_Font_Set *(*font_memory_add) (void *data, Evas_Font_Set *font, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
|
||||
void (*font_free) (void *data, Evas_Font_Set *font);
|
||||
int (*font_ascent_get) (void *data, Evas_Font_Set *font);
|
||||
int (*font_descent_get) (void *data, Evas_Font_Set *font);
|
||||
int (*font_max_ascent_get) (void *data, Evas_Font_Set *font);
|
||||
int (*font_max_descent_get) (void *data, Evas_Font_Set *font);
|
||||
void (*font_string_size_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int *w, int *h);
|
||||
int (*font_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
|
||||
int (*font_h_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
|
||||
int (*font_v_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
|
||||
int (*font_char_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
|
||||
int (*font_char_at_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
|
||||
void (*font_draw) (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, const Evas_Text_Props *intl_props);
|
||||
|
||||
void (*font_cache_flush) (void *data);
|
||||
void (*font_cache_set) (void *data, int bytes);
|
||||
|
@ -699,14 +707,14 @@ struct _Evas_Func
|
|||
|
||||
/* Engine functions will over time expand from here */
|
||||
|
||||
void (*font_hinting_set) (void *data, void *font, int hinting);
|
||||
void (*font_hinting_set) (void *data, Evas_Font_Set *font, int hinting);
|
||||
int (*font_hinting_can_hint) (void *data, int hinting);
|
||||
|
||||
/* void (*image_rotation_set) (void *data, void *image); */
|
||||
|
||||
void (*image_scale_hint_set) (void *data, void *image, int hint);
|
||||
int (*image_scale_hint_get) (void *data, void *image);
|
||||
int (*font_last_up_to_pos) (void *data, void *font, const Evas_Text_Props *intl_props, int x, int y);
|
||||
int (*font_last_up_to_pos) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y);
|
||||
|
||||
void (*image_map_draw) (void *data, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level);
|
||||
void *(*image_map_surface_new) (void *data, int w, int h, int alpha);
|
||||
|
@ -714,9 +722,9 @@ struct _Evas_Func
|
|||
|
||||
void (*image_content_hint_set) (void *data, void *surface, int hint);
|
||||
int (*image_content_hint_get) (void *data, void *surface);
|
||||
int (*font_pen_coords_get) (void *data, void *font, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
|
||||
Eina_Bool (*font_text_props_info_create) (void *data __UNUSED__, void *font, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
|
||||
int (*font_right_inset_get) (void *data, void *font, const Evas_Text_Props *text_props);
|
||||
int (*font_pen_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
|
||||
Eina_Bool (*font_text_props_info_create) (void *data __UNUSED__, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
|
||||
int (*font_right_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
|
||||
|
||||
void (*image_draw_filtered) (void *data, void *context, void *surface, void *image, Evas_Filter_Info *filter);
|
||||
Filtered_Image *(*image_filtered_get) (void *image, uint8_t *key, size_t len);
|
||||
|
@ -733,7 +741,7 @@ struct _Evas_Func
|
|||
int (*gl_native_surface_get) (void *data, void *surface, void *native_surface);
|
||||
void *(*gl_api_get) (void *data);
|
||||
int (*image_load_error_get) (void *data, void *image);
|
||||
int (*font_run_end_get) (void *data __UNUSED__, void *fn, void **script_fi, void **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len);
|
||||
int (*font_run_end_get) (void *data, Evas_Font_Set *font, Evas_Font_Instance **script_fi, Evas_Font_Instance **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len);
|
||||
};
|
||||
|
||||
struct _Evas_Image_Load_Func
|
||||
|
|
|
@ -675,140 +675,141 @@ eng_image_cache_get(void *data __UNUSED__)
|
|||
return evas_common_image_get_cache();
|
||||
}
|
||||
|
||||
static void *
|
||||
static Evas_Font_Set *
|
||||
eng_font_load(void *data __UNUSED__, const char *name, int size,
|
||||
Font_Rend_Flags wanted_rend)
|
||||
{
|
||||
return evas_common_font_load(name, size, wanted_rend);
|
||||
return (Evas_Font_Set *) evas_common_font_load(name, size, wanted_rend);
|
||||
}
|
||||
|
||||
static void *
|
||||
static Evas_Font_Set *
|
||||
eng_font_memory_load(void *data __UNUSED__, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend)
|
||||
{
|
||||
return evas_common_font_memory_load(name, size, fdata, fdata_size,
|
||||
wanted_rend);
|
||||
return (Evas_Font_Set *) evas_common_font_memory_load(name, size, fdata,
|
||||
fdata_size, wanted_rend);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_font_add(void *data __UNUSED__, void *font, const char *name, int size, Font_Rend_Flags wanted_rend)
|
||||
static Evas_Font_Set *
|
||||
eng_font_add(void *data __UNUSED__, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend)
|
||||
{
|
||||
return evas_common_font_add(font, name, size, wanted_rend);
|
||||
return (Evas_Font_Set *) evas_common_font_add((RGBA_Font *) font, name,
|
||||
size, wanted_rend);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_font_memory_add(void *data __UNUSED__, void *font, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend)
|
||||
static Evas_Font_Set *
|
||||
eng_font_memory_add(void *data __UNUSED__, Evas_Font_Set *font, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend)
|
||||
{
|
||||
return evas_common_font_memory_add(font, name, size, fdata, fdata_size,
|
||||
wanted_rend);
|
||||
return (Evas_Font_Set *) evas_common_font_memory_add((RGBA_Font *) font,
|
||||
name, size, fdata, fdata_size, wanted_rend);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_font_free(void *data __UNUSED__, void *font)
|
||||
eng_font_free(void *data __UNUSED__, Evas_Font_Set *font)
|
||||
{
|
||||
evas_common_font_free(font);
|
||||
evas_common_font_free((RGBA_Font *) font);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_ascent_get(void *data __UNUSED__, void *font)
|
||||
eng_font_ascent_get(void *data __UNUSED__, Evas_Font_Set *font)
|
||||
{
|
||||
return evas_common_font_ascent_get(font);
|
||||
return evas_common_font_ascent_get((RGBA_Font *) font);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_descent_get(void *data __UNUSED__, void *font)
|
||||
eng_font_descent_get(void *data __UNUSED__, Evas_Font_Set *font)
|
||||
{
|
||||
return evas_common_font_descent_get(font);
|
||||
return evas_common_font_descent_get((RGBA_Font *) font);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_max_ascent_get(void *data __UNUSED__, void *font)
|
||||
eng_font_max_ascent_get(void *data __UNUSED__, Evas_Font_Set *font)
|
||||
{
|
||||
return evas_common_font_max_ascent_get(font);
|
||||
return evas_common_font_max_ascent_get((RGBA_Font *) font);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_max_descent_get(void *data __UNUSED__, void *font)
|
||||
eng_font_max_descent_get(void *data __UNUSED__, Evas_Font_Set *font)
|
||||
{
|
||||
return evas_common_font_max_descent_get(font);
|
||||
return evas_common_font_max_descent_get((RGBA_Font *) font);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_font_string_size_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props, int *w, int *h)
|
||||
eng_font_string_size_get(void *data __UNUSED__, Evas_Font_Set *font, const Evas_Text_Props *text_props, int *w, int *h)
|
||||
{
|
||||
evas_common_font_query_size(font, text_props, w, h);
|
||||
evas_common_font_query_size((RGBA_Font *) font, text_props, w, h);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
|
||||
eng_font_inset_get(void *data __UNUSED__, Evas_Font_Set *font, const Evas_Text_Props *text_props)
|
||||
{
|
||||
return evas_common_font_query_inset(font, text_props);
|
||||
return evas_common_font_query_inset((RGBA_Font *) font, text_props);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_right_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
|
||||
eng_font_right_inset_get(void *data __UNUSED__, Evas_Font_Set *font, const Evas_Text_Props *text_props)
|
||||
{
|
||||
return evas_common_font_query_right_inset(font, text_props);
|
||||
return evas_common_font_query_right_inset((RGBA_Font *) font, text_props);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_h_advance_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
|
||||
eng_font_h_advance_get(void *data __UNUSED__, Evas_Font_Set *font, const Evas_Text_Props *text_props)
|
||||
{
|
||||
int h, v;
|
||||
|
||||
evas_common_font_query_advance(font, text_props, &h, &v);
|
||||
evas_common_font_query_advance((RGBA_Font *) font, text_props, &h, &v);
|
||||
return h;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_v_advance_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
|
||||
eng_font_v_advance_get(void *data __UNUSED__, Evas_Font_Set *font, const Evas_Text_Props *text_props)
|
||||
{
|
||||
int h, v;
|
||||
|
||||
evas_common_font_query_advance(font, text_props, &h, &v);
|
||||
evas_common_font_query_advance((RGBA_Font *) font, text_props, &h, &v);
|
||||
return v;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_pen_coords_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch)
|
||||
eng_font_pen_coords_get(void *data __UNUSED__, Evas_Font_Set *font, const Evas_Text_Props *text_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch)
|
||||
{
|
||||
return evas_common_font_query_pen_coords(font, text_props, pos, cpen_x, cy, cadv, ch);
|
||||
return evas_common_font_query_pen_coords((RGBA_Font *) font, text_props, pos, cpen_x, cy, cadv, ch);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
eng_font_text_props_info_create(void *data __UNUSED__, void *font, const Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t par_pos, size_t len)
|
||||
eng_font_text_props_info_create(void *data __UNUSED__, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t par_pos, size_t len)
|
||||
{
|
||||
return evas_common_text_props_content_create(font, text, text_props,
|
||||
par_props, par_pos, len);
|
||||
return evas_common_text_props_content_create((RGBA_Font_Int *) fi, text,
|
||||
text_props, par_props, par_pos, len);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_char_coords_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props, int pos, int *cx, int *cy, int *cw, int *ch)
|
||||
eng_font_char_coords_get(void *data __UNUSED__, Evas_Font_Set *font, const Evas_Text_Props *text_props, int pos, int *cx, int *cy, int *cw, int *ch)
|
||||
{
|
||||
return evas_common_font_query_char_coords(font, text_props, pos, cx, cy, cw, ch);
|
||||
return evas_common_font_query_char_coords((RGBA_Font *) font, text_props, pos, cx, cy, cw, ch);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_char_at_coords_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props, int x, int y, int *cx, int *cy, int *cw, int *ch)
|
||||
eng_font_char_at_coords_get(void *data __UNUSED__, Evas_Font_Set *font, const Evas_Text_Props *text_props, int x, int y, int *cx, int *cy, int *cw, int *ch)
|
||||
{
|
||||
return evas_common_font_query_char_at_coords(font, text_props, x, y, cx, cy, cw, ch);
|
||||
return evas_common_font_query_char_at_coords((RGBA_Font *) font, text_props, x, y, cx, cy, cw, ch);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_last_up_to_pos(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props, int x, int y)
|
||||
eng_font_last_up_to_pos(void *data __UNUSED__, Evas_Font_Set *font, const Evas_Text_Props *text_props, int x, int y)
|
||||
{
|
||||
return evas_common_font_query_last_up_to_pos(font, text_props, x, y);
|
||||
return evas_common_font_query_last_up_to_pos((RGBA_Font *) font, text_props, x, y);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_font_run_font_end_get(void *data __UNUSED__, void *fn, void **script_fi, void **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len)
|
||||
eng_font_run_font_end_get(void *data __UNUSED__, Evas_Font_Set *font, Evas_Font_Instance **script_fi, Evas_Font_Instance **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len)
|
||||
{
|
||||
return evas_common_font_query_run_font_end_get(fn,
|
||||
return evas_common_font_query_run_font_end_get((RGBA_Font *) font,
|
||||
(RGBA_Font_Int **) script_fi, (RGBA_Font_Int **) cur_fi,
|
||||
script, text, run_len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_font_draw(void *data __UNUSED__, void *context, void *surface, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const Evas_Text_Props *text_props)
|
||||
eng_font_draw(void *data __UNUSED__, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const Evas_Text_Props *text_props)
|
||||
{
|
||||
#ifdef BUILD_PIPE_RENDER
|
||||
if ((cpunum > 1)
|
||||
|
@ -816,11 +817,13 @@ eng_font_draw(void *data __UNUSED__, void *context, void *surface, void *font, i
|
|||
&& evas_common_frameq_enabled()
|
||||
#endif
|
||||
)
|
||||
evas_common_pipe_text_draw(surface, context, font, x, y, text_props);
|
||||
evas_common_pipe_text_draw(surface, context, (RGBA_Font *) font, x, y,
|
||||
text_props);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
evas_common_font_draw(surface, context, font, x, y, text_props);
|
||||
evas_common_font_draw(surface, context, (RGBA_Font *) font, x, y,
|
||||
text_props);
|
||||
evas_common_cpu_end_opt();
|
||||
}
|
||||
}
|
||||
|
@ -849,9 +852,9 @@ eng_font_cache_get(void *data __UNUSED__)
|
|||
}
|
||||
|
||||
static void
|
||||
eng_font_hinting_set(void *data __UNUSED__, void *font, int hinting)
|
||||
eng_font_hinting_set(void *data __UNUSED__, Evas_Font_Set *font, int hinting)
|
||||
{
|
||||
evas_common_font_hinting_set(font, hinting);
|
||||
evas_common_font_hinting_set((RGBA_Font *) font, hinting);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue