return;
MAGIC_CHECK_END();
- text = evas_common_encoding_utf8_to_unicode((unsigned char *) _text, NULL);
+ text = evas_common_encoding_utf8_to_unicode(_text, NULL);
if (!text) text = eina_unicode_strdup(EINA_UNICODE_EMPTY_STRING);
if ((o->cur.text) && (text) && (!eina_unicode_strcmp(o->cur.text, text)))
if (decoded) *decoded = 0;
if ((!str) || (pos < 0)) return 0;
p = pos;
- d = evas_common_encoding_utf8_get_next((unsigned char *)str, &p);
+ d = evas_common_encoding_utf8_get_next(str, &p);
if (decoded) *decoded = d;
return p;
}
if (decoded) *decoded = 0;
if ((!str) || (pos < 1)) return 0;
p = pos;
- d = evas_common_encoding_utf8_get_prev((unsigned char *)str, &p);
+ d = evas_common_encoding_utf8_get_prev(str, &p);
if (decoded) *decoded = d;
return p;
}
evas_string_char_len_get(const char *str)
{
if (!str) return 0;
- return evas_common_encoding_utf8_get_len((const unsigned char *) str);
+ return evas_common_encoding_utf8_get_len(str);
}
/**
str = alloca((len + 1) * sizeof(Eina_Unicode));
tbase = str;
ind = 0;
- urepch = evas_common_encoding_utf8_get_next(
- (const unsigned char *)repch, &ind);
+ urepch = evas_common_encoding_utf8_get_next(repch, &ind);
for (i = 0, ptr = (Eina_Unicode *)tbase; i < len; ptr++, i++)
*ptr = urepch;
*ptr = 0;
{
Evas_Object_Textblock_Node_Format *node;
Evas_Object_Textblock_Node_Format *itr;
- size_t position = 0;
+ int position = 0;
if (!cur->node) return NULL;
int len = 0;
if (!cur) return 0;
- text = evas_common_encoding_utf8_to_unicode((const unsigned char *) _text, &len);
+ text = evas_common_encoding_utf8_to_unicode(_text, &len);
o = (Evas_Object_Textblock *)(cur->obj->object_data);
/* Update all the cursors after our position. */
_evas_textblock_cursors_update_offset(cur, cur->node, cur->pos, len);
Eina_Bool
evas_bidi_is_rtl_str(const Eina_Unicode *str)
{
- int i = 0;
- int ch;
EvasBiDiCharType type;
if (!str)
#include "evas_common.h"
#include "evas_encoding.h"
-EAPI int
-evas_common_encoding_utf8_get_next(const unsigned char *buf, int *iindex)
+EAPI Eina_Unicode
+evas_common_encoding_utf8_get_next(const char *buf, int *iindex)
{
/* Reads UTF8 bytes from @buf, starting at *@index and returns
* the decoded code point at iindex offset, and advances iindex
return r;
}
-EAPI int
-evas_common_encoding_utf8_get_prev(const unsigned char *buf, int *iindex)
+EAPI Eina_Unicode
+evas_common_encoding_utf8_get_prev(const char *buf, int *iindex)
{
/* Reads UTF8 bytes from @buf, starting at *@index and returns
* the decoded code point at iindex offset, and advances iindex
return r;
}
-EAPI int
-evas_common_encoding_utf8_get_last(const unsigned char *buf, int buflen)
+EAPI Eina_Unicode
+evas_common_encoding_utf8_get_last(const char *buf, int buflen)
{
/* jumps to the nul byte at the buffer end and decodes backwards and
* returns the offset index byte in the buffer where the last character
}
EAPI int
-evas_common_encoding_utf8_get_len(const unsigned char *buf)
+evas_common_encoding_utf8_get_len(const char *buf)
{
/* returns the number of utf8 characters (not bytes) in the string */
int index = 0, len = 0;
/* FIXME: Should optimize! */
EAPI Eina_Unicode *
-evas_common_encoding_utf8_to_unicode(const unsigned char *utf, int *_len)
+evas_common_encoding_utf8_to_unicode(const char *utf, int *_len)
{
int len, i;
int index;
/* FIXME: An assumption that will probably break in the future */
#define EVAS_ENCODING_UTF8_BYTES_PER_CHAR 4
-EAPI int
-evas_common_encoding_utf8_get_next(const unsigned char *buf, int *iindex);
+EAPI Eina_Unicode
+evas_common_encoding_utf8_get_next(const char *buf, int *iindex);
-EAPI int
-evas_common_encoding_utf8_get_prev(const unsigned char *buf, int *iindex);
+EAPI Eina_Unicode
+evas_common_encoding_utf8_get_prev(const char *buf, int *iindex);
-EAPI int
-evas_common_encoding_utf8_get_last(const unsigned char *buf, int buflen);
+EAPI Eina_Unicode
+evas_common_encoding_utf8_get_last(const char *buf, int buflen);
EAPI int
-evas_common_encoding_utf8_get_len(const unsigned char *buf);
+evas_common_encoding_utf8_get_len(const char *buf);
EAPI Eina_Unicode *
-evas_common_encoding_utf8_to_unicode(const unsigned char *utf, int *_len) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
+evas_common_encoding_utf8_to_unicode(const char *utf, int *_len) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
EAPI char *
evas_common_encoding_unicode_to_utf8(const Eina_Unicode *uni, int *_len) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
};
+#if defined(METRIC_CACHE) || defined(WORD_CACHE)
LK(lock_words); // for word cache call
static Eina_Inlist *words = NULL;
static struct prword *evas_font_word_prerender(RGBA_Draw_Context *dc, const Eina_Unicode *text, Evas_BiDi_Props *intl_props, int len, RGBA_Font *fn, RGBA_Font_Int *fi,int use_kerning);
+#endif
EAPI void
evas_common_font_draw_init(void)
{
int pen_x, pen_y;
int last_adv;
- int chr;
const Eina_Unicode *text = in_text;
- int len;
FT_Face pface = NULL;
FT_UInt prev_index;
DATA32 *im;
int c;
- char *p;
int char_index = 0; /* the index of the current char */
}
if (xrun < 1) return;
-#ifdef WORD_CACHE
+# ifdef WORD_CACHE
if (word->im){
for (j = rowstart ; j < rowend ; j ++){
func(NULL, word->im + (word->roww * j) + xstart, dc->col.col,
}
return;
}
-#elif defined(METRIC_CACHE)
+# elif defined(METRIC_CACHE)
int ind;
y += word->baseline;
for (ind = 0 ; ind < len ; ind ++){
}
}
return;
-#endif
+# endif
}
}
/* FIXME: Where is it freed at? */
+/* Only used if cache is on */
+#if defined(METRIC_CACHE) || defined(WORD_CACHE)
struct prword *
evas_font_word_prerender(RGBA_Draw_Context *dc, const Eina_Unicode *in_text, Evas_BiDi_Props *intl_props, int len, RGBA_Font *fn, RGBA_Font_Int *fi,int use_kerning){
int pen_x, pen_y;
struct prword *w;
int gl;
-#ifndef METRIC_CACHE
+# ifndef METRIC_CACHE
gl = dc->font_ext.func.gl_new ? 1: 0;
if (gl) return NULL;
-#endif
+# endif
LKL(lock_words);
(pface == fi->src->ft.face))
{
int kern = 0;
-#ifdef BIDI_SUPPORT
+# ifdef BIDI_SUPPORT
/* if it's rtl, the kerning matching should be reversed, i.e prev
* index is now the index and the other way around.
* There is a slight exception when there are compositing chars
ci->pos.x += kern;
}
else
-#endif
+# endif
{
if (evas_common_font_query_kerning(fi, prev_index, ci->index, &kern))
return save;
}
+#endif
EAPI int
evas_common_font_ascent_get(RGBA_Font *fn)
{
- int val, dv;
- int ret;
+ int val;
RGBA_Font_Int *fi;
// evas_common_font_size_use(fn);
EAPI int
evas_common_font_descent_get(RGBA_Font *fn)
{
- int val, dv;
- int ret;
+ int val;
RGBA_Font_Int *fi;
// evas_common_font_size_use(fn);
EAPI int
evas_common_font_get_line_advance(RGBA_Font *fn)
{
- int val, dv;
- int ret;
+ int val;
RGBA_Font_Int *fi;
// evas_common_font_size_use(fn);
// return ret;
}
-/*DEPRECATED! Should use evas_common_encoding_* instead */
-EAPI int
-evas_common_font_utf8_get_next(const unsigned char *buf, int *iindex)
-{
- return evas_common_encoding_utf8_get_next(buf, iindex);
-}
-
-EAPI int
-evas_common_font_utf8_get_prev(const unsigned char *buf, int *iindex)
-{
- return evas_common_encoding_utf8_get_prev(buf, iindex);
-}
-
-EAPI int
-evas_common_font_utf8_get_last(const unsigned char *buf, int buflen)
-{
- return evas_common_encoding_utf8_get_last(buf, buflen);
-}
-
-EAPI int
-evas_common_font_utf8_get_len(const unsigned char *buf)
-{
- return evas_common_encoding_utf8_get_len(buf);
-}
int dst_region_w, int dst_region_h)
{
DATA32 *dst_ptr;
- int dst_jump;
int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
int src_w, src_h, dst_w, dst_h;