2011-01-30 02:36:39 -08:00
|
|
|
#ifndef _EVAS_TEXT_UTILS_H
|
|
|
|
# define _EVAS_TEXT_UTILS_H
|
|
|
|
|
|
|
|
typedef struct _Evas_Text_Props Evas_Text_Props;
|
2011-02-01 04:17:52 -08:00
|
|
|
typedef struct _Evas_Text_Props_Info Evas_Text_Props_Info;
|
|
|
|
typedef struct _Evas_Font_Glyph_Info Evas_Font_Glyph_Info;
|
2011-01-30 02:36:39 -08:00
|
|
|
|
|
|
|
# include "evas_font_ot.h"
|
|
|
|
# include "language/evas_bidi_utils.h"
|
|
|
|
# include "language/evas_language_utils.h"
|
|
|
|
|
|
|
|
struct _Evas_Text_Props
|
|
|
|
{
|
2011-02-01 04:17:52 -08:00
|
|
|
/* Start and len represent the start offset and the length in the
|
|
|
|
* glyphs_info and ot_data fields, they are both internal */
|
|
|
|
size_t start;
|
|
|
|
size_t len;
|
|
|
|
size_t text_offset; /* The text offset from the start of the info */
|
2011-02-13 04:57:37 -08:00
|
|
|
size_t text_len; /* The length of the original text */
|
2011-01-30 02:36:39 -08:00
|
|
|
Evas_BiDi_Props bidi;
|
|
|
|
Evas_Script_Type script;
|
2011-02-01 04:17:52 -08:00
|
|
|
Evas_Text_Props_Info *info;
|
2011-01-30 02:36:39 -08:00
|
|
|
};
|
|
|
|
|
2011-02-01 04:17:52 -08:00
|
|
|
struct _Evas_Text_Props_Info
|
|
|
|
{
|
|
|
|
unsigned int refcount;
|
|
|
|
Evas_Font_Glyph_Info *glyph;
|
|
|
|
Evas_Font_OT_Info *ot;
|
2011-04-13 01:37:01 -07:00
|
|
|
#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
|
|
|
|
Eina_Unicode *shaped_text;
|
|
|
|
#endif
|
2011-02-01 04:17:52 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Sorted in visual order when created */
|
|
|
|
struct _Evas_Font_Glyph_Info
|
|
|
|
{
|
|
|
|
unsigned int index; /* Should conform to FT */
|
|
|
|
Evas_Coord x_bear;
|
|
|
|
#if 0
|
|
|
|
/* This one is rarely used, only in draw, in which we already get the glyph
|
|
|
|
* so it doesn't really save time. Leaving it here just so no one will
|
|
|
|
* add it thinking it was accidentally skipped */
|
|
|
|
Evas_Coord y_bear;
|
|
|
|
#endif
|
|
|
|
Evas_Coord width;
|
|
|
|
Evas_Coord advance;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-30 02:36:39 -08:00
|
|
|
void
|
|
|
|
evas_common_text_props_bidi_set(Evas_Text_Props *props,
|
|
|
|
Evas_BiDi_Paragraph_Props *bidi_par_props, size_t start);
|
|
|
|
|
|
|
|
void
|
|
|
|
evas_common_text_props_script_set(Evas_Text_Props *props,
|
2011-04-13 01:36:46 -07:00
|
|
|
const Eina_Unicode *str, size_t len);
|
2011-01-30 02:36:39 -08:00
|
|
|
|
2011-02-01 04:17:52 -08:00
|
|
|
EAPI Eina_Bool
|
|
|
|
evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
|
2011-04-13 01:37:01 -07:00
|
|
|
Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props,
|
|
|
|
size_t par_pos, int len);
|
2011-02-01 04:17:52 -08:00
|
|
|
|
2011-01-30 02:36:39 -08:00
|
|
|
void
|
|
|
|
evas_common_text_props_content_copy_and_ref(Evas_Text_Props *dst,
|
|
|
|
const Evas_Text_Props *src);
|
|
|
|
|
2011-01-30 02:43:34 -08:00
|
|
|
void
|
|
|
|
evas_common_text_props_content_ref(Evas_Text_Props *props);
|
|
|
|
|
2011-01-30 02:36:39 -08:00
|
|
|
void
|
|
|
|
evas_common_text_props_content_unref(Evas_Text_Props *props);
|
|
|
|
|
2011-01-30 05:58:06 -08:00
|
|
|
|
2011-01-30 02:40:30 -08:00
|
|
|
EAPI void
|
|
|
|
evas_common_text_props_split(Evas_Text_Props *base, Evas_Text_Props *ext,
|
|
|
|
int cutoff);
|
2011-01-30 02:41:42 -08:00
|
|
|
EAPI void
|
|
|
|
evas_common_text_props_merge(Evas_Text_Props *item1, const Evas_Text_Props *item2);
|
2011-04-12 02:05:47 -07:00
|
|
|
|
2011-01-30 02:36:39 -08:00
|
|
|
#endif
|