From 825a3d837a33f226c879cd02ad15c3fba57e8b2c Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 23 Jan 2012 23:30:42 +1000 Subject: Update the EFL to what I'm actually using, coz I'm using some stuff not yet released. --- libraries/edje/src/lib/Edje.h | 40 ++- libraries/edje/src/lib/Makefile.in | 2 - libraries/edje/src/lib/edje_cache.c | 13 +- libraries/edje/src/lib/edje_calc.c | 447 ++++++++++++++++------------ libraries/edje/src/lib/edje_callbacks.c | 5 + libraries/edje/src/lib/edje_data.c | 3 + libraries/edje/src/lib/edje_edit.c | 131 ++++---- libraries/edje/src/lib/edje_embryo.c | 2 + libraries/edje/src/lib/edje_entry.c | 350 ++++++++++++---------- libraries/edje/src/lib/edje_load.c | 151 +++++----- libraries/edje/src/lib/edje_lua2.c | 269 ++++++++++++++++- libraries/edje/src/lib/edje_main.c | 5 +- libraries/edje/src/lib/edje_message_queue.c | 4 +- libraries/edje/src/lib/edje_module.c | 4 +- libraries/edje/src/lib/edje_multisense.c | 12 +- libraries/edje/src/lib/edje_private.h | 13 +- libraries/edje/src/lib/edje_program.c | 4 +- libraries/edje/src/lib/edje_util.c | 44 ++- 18 files changed, 958 insertions(+), 541 deletions(-) (limited to 'libraries/edje/src/lib') diff --git a/libraries/edje/src/lib/Edje.h b/libraries/edje/src/lib/Edje.h index c8094b4..6413014 100644 --- a/libraries/edje/src/lib/Edje.h +++ b/libraries/edje/src/lib/Edje.h @@ -377,6 +377,13 @@ part of Edje's API: @author Sebastian Dransfeld @author Tom Hacohen @author Aharon Hillel +@author Shilpa Singh +@author Mike Blumenkrantz +@author billiob (Boris Faure) +@author Govindaraju SM +@author Prince Kumar Dubey +@author David Seikel Please contact to get in contact with the developers and maintainers. @@ -472,7 +479,7 @@ extern "C" { #endif #define EDJE_VERSION_MAJOR 1 -#define EDJE_VERSION_MINOR 0 +#define EDJE_VERSION_MINOR 2 typedef struct _Edje_Version { @@ -794,7 +801,7 @@ typedef enum _Edje_External_Param_Flags EDJE_EXTERNAL_PARAM_FLAGS_STATE) /**< Convenience flag that sets property as GET, SET and STATE. */ } Edje_External_Param_Flags; -typedef enum +typedef enum _Edje_Input_Panel_Layout { EDJE_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */ EDJE_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */ @@ -804,7 +811,10 @@ typedef enum EDJE_INPUT_PANEL_LAYOUT_IP, /**< IP layout */ EDJE_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */ EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ - EDJE_INPUT_PANEL_LAYOUT_INVALID + EDJE_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this */ + EDJE_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout @since 1.2 */ + EDJE_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout @since 1.2 */ + EDJE_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */ } Edje_Input_Panel_Layout; /** @@ -1650,8 +1660,21 @@ EAPI void edje_box_layout_register (const char *name, Evas_Object * } * * @endcode + * + * @note You can get a callback every time edje re-calculates the object + * (either due to animation or some kind of signal or input). This is called + * in-line just after the recalculation has occured. It is a good idea not + * to go and delete or alter the object inside this callbacks, simply make + * a note that the recalculation has taken place and then do somethnig about + * it outside the callback. to register a callback use code like: + * + * @code + * evas_object_smart_callback_add(edje_obj, "recalc", my_cb, my_cb_data); + * @endcode + * + * @see evas_object_smart_callback_add() * - * @note before creating the first Edje object in your code, remember + * @note Before creating the first Edje object in your code, remember * to initialize the library, with edje_init(), or unexpected behavior * might occur. */ @@ -2757,12 +2780,15 @@ EAPI Eina_Bool edje_object_part_text_cursor_is_visible_format_get(const E /** * @brief Returns the content (char) at the cursor position. * @see evas_textblock_cursor_content_get + * + * You must free the return (if not NULL) after you are done with it. * * @param obj A valid Evas_Object handle * @param part The part name * @param cur The cursor to use + * @return The character string pointed to (may be a multi-byte utf8 sequence) terminated by a nul byte. */ -EAPI const char *edje_object_part_text_cursor_content_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); +EAPI char *edje_object_part_text_cursor_content_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); /** * @brief Sets the cursor position to the given value @@ -2941,7 +2967,9 @@ EAPI Eina_Bool edje_object_part_swallow (Evas_Object *obj, const c * * Causes the edje to regurgitate a previously swallowed object. :) * - * @note @p obj_swallow will @b not be deleted. + * @note @p obj_swallow will @b not be deleted or hidden. + * @note @p obj_swallow may appear shown on the evas depending on its state when + * it got unswallowed. Make sure you delete it or hide it if you do not want it to. */ EAPI void edje_object_part_unswallow (Evas_Object *obj, Evas_Object *obj_swallow); diff --git a/libraries/edje/src/lib/Makefile.in b/libraries/edje/src/lib/Makefile.in index cf73390..e67d90c 100644 --- a/libraries/edje/src/lib/Makefile.in +++ b/libraries/edje/src/lib/Makefile.in @@ -230,8 +230,6 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/libraries/edje/src/lib/edje_cache.c b/libraries/edje/src/lib/edje_cache.c index a8b355f..0ce6b30 100644 --- a/libraries/edje/src/lib/edje_cache.c +++ b/libraries/edje/src/lib/edje_cache.c @@ -128,18 +128,11 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) } static Edje_File * -_edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret) +_edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, time_t mtime) { Edje_File *edf; Edje_Part_Collection *edc; Eet_File *ef; - struct stat st; - - if (stat(file, &st) != 0) - { - *error_ret = EDJE_LOAD_ERROR_DOES_NOT_EXIST; - return NULL; - } ef = eet_open(file, EET_FILE_MODE_READ); if (!ef) @@ -156,7 +149,7 @@ _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Co } edf->ef = ef; - edf->mtime = st.st_mtime; + edf->mtime = mtime; if (edf->version != EDJE_FILE_VERSION) { @@ -262,7 +255,7 @@ open_new: if (!_edje_file_hash) _edje_file_hash = eina_hash_string_small_new(NULL); - edf = _edje_file_open(file, coll, error_ret, edc_ret); + edf = _edje_file_open(file, coll, error_ret, edc_ret, st.st_mtime); if (!edf) return NULL; diff --git a/libraries/edje/src/lib/edje_calc.c b/libraries/edje/src/lib/edje_calc.c index d9fd51d..213e266 100644 --- a/libraries/edje/src/lib/edje_calc.c +++ b/libraries/edje/src/lib/edje_calc.c @@ -8,7 +8,8 @@ static void _edje_part_recalc_single(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *center, Edje_Real_Part *light, Edje_Real_Part *persp, Edje_Real_Part *rel1_to_x, Edje_Real_Part *rel1_to_y, Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y, - Edje_Real_Part *confine_to, Edje_Calc_Params *params); + Edje_Real_Part *confine_to, Edje_Calc_Params *params, + FLOAT_T pos); void _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2) @@ -115,6 +116,7 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T ep->description_pos = npos; ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ep->invalidate = 1; #endif @@ -304,6 +306,179 @@ _edje_part_description_find(Edje *ed, Edje_Real_Part *rp, const char *name, return ret; } +static int +_edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, Edje_Part_Description_Image *st, Edje_Part_Image_Id *imid) +{ + Edje_Image_Directory_Set_Entry *entry; + Edje_Image_Directory_Set *set = NULL; + Eina_List *l; + int w = 0; + int h = 0; + int id; + + if (!st && !imid) + return -1; + + if (st && !st->image.set) + return st->image.id; + + if (imid && !imid->set) + return imid->id; + + if (imid) + id = imid->id; + else + id = st->image.id; + + evas_object_geometry_get(obj, NULL, NULL, &w, &h); + + if (eps && *eps) + { + if ((*eps)->id == id) + set = (*eps)->set; + + if (set) + if ((*eps)->entry->size.min.w <= w && w <= (*eps)->entry->size.max.w) + if ((*eps)->entry->size.min.h <= h && h <= (*eps)->entry->size.max.h) + return (*eps)->entry->id; + } + + if (!set) + set = ed->file->image_dir->sets + id; + + EINA_LIST_FOREACH(set->entries, l, entry) + { + if (entry->size.min.w <= w && w <= entry->size.max.w) + if (entry->size.min.h <= h && h <= entry->size.max.h) + { + if (eps) + { + if (!*eps) + *eps = calloc(1, sizeof (Edje_Real_Part_Set)); + + if (*eps) + { + (*eps)->entry = entry; + (*eps)->set = set; + (*eps)->id = id; + } + } + return entry->id; + } + } + + return -1; +} + +static void +_edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T pos) +{ + int image_id; + int image_count, image_num; + + image_id = _edje_image_find(ep->object, ed, + &ep->param1.set, + (Edje_Part_Description_Image*) ep->param1.description, + NULL); + if (image_id < 0) + { + Edje_Image_Directory_Entry *ie; + + if (!ed->file->image_dir) ie = NULL; + else ie = ed->file->image_dir->entries + (-image_id) - 1; + if ((ie) && + (ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) && + (ie->entry)) + { + evas_object_image_file_set(ep->object, ie->entry, NULL); + } + } + else + { + image_count = 2; + if (ep->param2) + image_count += ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens_count; + image_num = TO_INT(MUL(pos, SUB(FROM_INT(image_count), + FROM_DOUBLE(0.5)))); + if (image_num > (image_count - 1)) + image_num = image_count - 1; + if (image_num == 0) + { + image_id = _edje_image_find(ep->object, ed, + &ep->param1.set, + (Edje_Part_Description_Image*) ep->param1.description, + NULL); + } + else + if (ep->param2) + { + if (image_num == (image_count - 1)) + { + image_id = _edje_image_find(ep->object, ed, + &ep->param2->set, + (Edje_Part_Description_Image*) ep->param2->description, + NULL); + } + else + { + Edje_Part_Image_Id *imid; + + imid = ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens[image_num - 1]; + image_id = _edje_image_find(ep->object, ed, NULL, NULL, imid); + } + } + if (image_id < 0) + { + ERR("¨Part \"%s\" has description, " + "\"%s\" %3.3f with a missing image id!!!", + ep->part->name, + ep->param1.description->state.name, + ep->param1.description->state.value); + } + else + { + char buf[1024]; + + /* Replace snprint("edje/images/%i") == memcpy + itoa */ +#define IMAGES "edje/images/" + memcpy(buf, IMAGES, strlen(IMAGES)); + eina_convert_itoa(image_id, buf + strlen(IMAGES)); /* No need to check length as 2³² need only 10 characteres. */ + + evas_object_image_file_set(ep->object, ed->file->path, buf); + if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE) + { + ERR("Error loading image collection \"%s\" from " + "file \"%s\". Missing EET Evas loader module?", + buf, ed->file->path); + switch (evas_object_image_load_error_get(ep->object)) + { + case EVAS_LOAD_ERROR_GENERIC: + ERR("Error type: EVAS_LOAD_ERROR_GENERIC"); + break; + case EVAS_LOAD_ERROR_DOES_NOT_EXIST: + ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST"); + break; + case EVAS_LOAD_ERROR_PERMISSION_DENIED: + ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED"); + break; + case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: + ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED"); + break; + case EVAS_LOAD_ERROR_CORRUPT_FILE: + ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE"); + break; + case EVAS_LOAD_ERROR_UNKNOWN_FORMAT: + ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT"); + break; + default: + ERR("Error type: ???"); + break; + } + } + } + } +} + static void _edje_real_part_rel_to_apply(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_State *state) { @@ -398,6 +573,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ep->invalidate = 1; #endif @@ -423,17 +599,23 @@ _edje_recalc(Edje *ed) return; } } - if (ed->postponed) return; - evas_object_smart_changed(ed->obj); - ed->postponed = 1; +// XXX: dont need this with current smart calc infra. remove me later +// if (ed->postponed) return; +// if (!ed->calc_only) + evas_object_smart_changed(ed->obj); +// XXX: dont need this with current smart calc infra. remove me later +// ed->postponed = 1; } void _edje_recalc_do(Edje *ed) { unsigned int i; + Eina_Bool need_calc; - ed->postponed = 0; +// XXX: dont need this with current smart calc infra. remove me later +// ed->postponed = 0; + need_calc = evas_object_smart_need_recalculate_get(ed->obj); evas_object_smart_need_recalculate_set(ed->obj, 0); if (!ed->dirty) return; ed->have_mapped_part = 0; @@ -460,6 +642,14 @@ _edje_recalc_do(Edje *ed) ed->all_part_change = 0; ed->text_part_change = 0; #endif + if (!ed->calc_only) + { + if (ed->recalc_call) + evas_object_smart_callback_call(ed->obj, "recalc", NULL); + } + else + evas_object_smart_need_recalculate_set(ed->obj, need_calc); + ed->recalc_call = 0; } void @@ -527,6 +717,7 @@ _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y) ep->drag->tmp.x = 0; ep->drag->need_reset = 0; ed->dirty = 1; + ed->recalc_call = 1; } if (ep->drag->y != y || ep->drag->tmp.y) @@ -535,6 +726,7 @@ _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y) ep->drag->tmp.y = 0; ep->drag->need_reset = 0; ed->dirty = 1; + ed->recalc_call = 1; } #ifdef EDJE_CALC_CACHE @@ -598,11 +790,13 @@ _edje_part_recalc_single_rel(Edje *ed, } static Edje_Internal_Aspect -_edje_part_recalc_single_aspect(Edje_Real_Part *ep, +_edje_part_recalc_single_aspect(Edje *ed, + Edje_Real_Part *ep, Edje_Part_Description_Common *desc, Edje_Calc_Params *params, int *minw, int *minh, - int *maxw, int *maxh) + int *maxw, int *maxh, + FLOAT_T pos) { Edje_Internal_Aspect apref = EDJE_ASPECT_PREFER_NONE; FLOAT_T aspect, amax, amin; @@ -612,6 +806,17 @@ _edje_part_recalc_single_aspect(Edje_Real_Part *ep, else aspect = DIV(FROM_INT(params->w), FROM_INT(params->h)); amax = desc->aspect.max; amin = desc->aspect.min; + if (desc->aspect.prefer == EDJE_ASPECT_PREFER_SOURCE && + ep->part->type == EDJE_PART_TYPE_IMAGE) + { + Evas_Coord w, h; + + /* We only need pose to find the right image that would be displayed, + and the right aspect ratio in that case */ + _edje_real_part_image_set(ed, ep, pos); + evas_object_image_size_get(ep->object, &w, &h); + amin = amax = DIV(FROM_INT(w), FROM_INT(h)); + } if ((ep->swallow_params.aspect.w > 0) && (ep->swallow_params.aspect.h > 0)) amin = amax = @@ -693,6 +898,7 @@ _edje_part_recalc_single_aspect(Edje_Real_Part *ep, if ((amin > ZERO) && (aspect < amin)) new_h = DIV(FROM_INT(params->w), amin); break; + case EDJE_ASPECT_PREFER_SOURCE: case EDJE_ASPECT_PREFER_BOTH: /* keep both dimensions in check */ /* adjust for max aspect (width / height) */ @@ -1255,6 +1461,7 @@ _edje_part_recalc_single_min(Edje_Part_Description_Common *desc, minh = tmp; break; } + case EDJE_ASPECT_PREFER_SOURCE: case EDJE_ASPECT_PREFER_BOTH: tmp = minh * params->w / h; if (tmp >= minw) @@ -1321,6 +1528,7 @@ _edje_part_recalc_single_max(Edje_Part_Description_Common *desc, maxh = tmp; break; } + case EDJE_ASPECT_PREFER_SOURCE: case EDJE_ASPECT_PREFER_BOTH: tmp = maxh * params->w / h; if (tmp <= maxw) @@ -1481,6 +1689,15 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, if (ep->swallow_params.min.w > desc->min.w) *minw = ep->swallow_params.min.w; + if (ep->edje->calc_only) + { + if (desc->minmul.have) + { + FLOAT_T mmw = desc->minmul.w; + if (mmw != FROM_INT(1)) *minw = TO_INT(SCALE(mmw, *minw)); + } + } + /* XXX TODO: remove need of EDJE_INF_MAX_W, see edje_util.c */ if ((ep->swallow_params.max.w <= 0) || (ep->swallow_params.max.w == EDJE_INF_MAX_W)) @@ -1508,6 +1725,8 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, *maxw = ep->swallow_params.max.w; } } + if ((ep->edje->calc_only) && (desc->minmul.have) && + (desc->minmul.w != FROM_INT(1))) *maxw = *minw; if (*maxw >= 0) { if (*maxw < *minw) *maxw = *minw; @@ -1518,6 +1737,16 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, if (ep->swallow_params.min.h > desc->min.h) *minh = ep->swallow_params.min.h; + if (ep->edje->calc_only) + { + if (desc->minmul.have) + { + FLOAT_T mmh = desc->minmul.h; + if (mmh != FROM_INT(1)) *minh = TO_INT(SCALE(mmh, *minh)); + } + } + + /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ if ((ep->swallow_params.max.h <= 0) || (ep->swallow_params.max.h == EDJE_INF_MAX_H)) @@ -1544,7 +1773,9 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, if (ep->swallow_params.max.h < *maxh) *maxh = ep->swallow_params.max.h; } - } + } + if ((ep->edje->calc_only) && (desc->minmul.have) && + (desc->minmul.h != FROM_INT(1))) *maxh = *minh; if (*maxh >= 0) { if (*maxh < *minh) *maxh = *minh; @@ -1665,7 +1896,8 @@ _edje_part_recalc_single(Edje *ed, Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y, Edje_Real_Part *confine_to, - Edje_Calc_Params *params) + Edje_Calc_Params *params, + FLOAT_T pos) { Edje_Color_Class *cc = NULL; Edje_Internal_Aspect apref; @@ -1675,12 +1907,12 @@ _edje_part_recalc_single(Edje *ed, sc = ed->scale; if (sc == ZERO) sc = _edje_scale; _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); - + /* relative coords of top left & bottom right */ _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); /* aspect */ - apref = _edje_part_recalc_single_aspect(ep, desc, params, &minw, &minh, &maxw, &maxh); + apref = _edje_part_recalc_single_aspect(ed, ep, desc, params, &minw, &minh, &maxw, &maxh, pos); /* size step */ _edje_part_recalc_single_step(desc, params); @@ -1855,77 +2087,13 @@ _edje_table_recalc_apply(Edje *ed __UNUSED__, } } -static int -_edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, Edje_Part_Description_Image *st, Edje_Part_Image_Id *imid) -{ - Edje_Image_Directory_Set_Entry *entry; - Edje_Image_Directory_Set *set = NULL; - Eina_List *l; - int w = 0; - int h = 0; - int id; - - if (!st && !imid) - return -1; - - if (st && !st->image.set) - return st->image.id; - - if (imid && !imid->set) - return imid->id; - - if (imid) - id = imid->id; - else - id = st->image.id; - - evas_object_geometry_get(obj, NULL, NULL, &w, &h); - - if (eps && *eps) - { - if ((*eps)->id == id) - set = (*eps)->set; - - if (set) - if ((*eps)->entry->size.min.w <= w && w <= (*eps)->entry->size.max.w) - if ((*eps)->entry->size.min.h <= h && h <= (*eps)->entry->size.max.h) - return (*eps)->entry->id; - } - - if (!set) - set = ed->file->image_dir->sets + id; - - EINA_LIST_FOREACH(set->entries, l, entry) - { - if (entry->size.min.w <= w && w <= entry->size.max.w) - if (entry->size.min.h <= h && h <= entry->size.max.h) - { - if (eps) - { - if (!*eps) - *eps = calloc(1, sizeof (Edje_Real_Part_Set)); - - if (*eps) - { - (*eps)->entry = entry; - (*eps)->set = set; - (*eps)->id = id; - } - } - return entry->id; - } - } - - return -1; -} - static void _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Proxy *chosen_desc, FLOAT_T pos) { Edje_Real_Part *pp; int part_id = -1; - if (pos >= 0.5) + if (pos >= FROM_DOUBLE(0.5)) part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; else part_id = chosen_desc->proxy.id; @@ -1967,8 +2135,6 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj static void _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Image *chosen_desc, FLOAT_T pos) { - int image_id; - int image_count, image_num; FLOAT_T sc; sc = ed->scale; @@ -2003,107 +2169,7 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj else if (chosen_desc->image.border.no_fill == 2) evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_SOLID); - image_id = _edje_image_find(ep->object, ed, - &ep->param1.set, - (Edje_Part_Description_Image*) ep->param1.description, - NULL); - if (image_id < 0) - { - Edje_Image_Directory_Entry *ie; - - if (!ed->file->image_dir) ie = NULL; - else ie = ed->file->image_dir->entries + (-image_id) - 1; - if ((ie) && - (ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) && - (ie->entry)) - { - evas_object_image_file_set(ep->object, ie->entry, NULL); - } - } - else - { - image_count = 2; - if (ep->param2) - image_count += ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens_count; - image_num = TO_INT(MUL(pos, SUB(FROM_INT(image_count), - FROM_DOUBLE(0.5)))); - if (image_num > (image_count - 1)) - image_num = image_count - 1; - if (image_num == 0) - { - image_id = _edje_image_find(ep->object, ed, - &ep->param1.set, - (Edje_Part_Description_Image*) ep->param1.description, - NULL); - } - else - if (ep->param2) - { - if (image_num == (image_count - 1)) - { - image_id = _edje_image_find(ep->object, ed, - &ep->param2->set, - (Edje_Part_Description_Image*) ep->param2->description, - NULL); - } - else - { - Edje_Part_Image_Id *imid; - - imid = ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens[image_num - 1]; - image_id = _edje_image_find(ep->object, ed, NULL, NULL, imid); - } - } - if (image_id < 0) - { - ERR("¨Part \"%s\" has description, " - "\"%s\" %3.3f with a missing image id!!!", - ep->part->name, - ep->param1.description->state.name, - ep->param1.description->state.value); - } - else - { - char buf[1024]; - - /* Replace snprint("edje/images/%i") == memcpy + itoa */ -#define IMAGES "edje/images/" - memcpy(buf, IMAGES, strlen(IMAGES)); - eina_convert_itoa(image_id, buf + strlen(IMAGES)); /* No need to check length as 2³² need only 10 characteres. */ - - evas_object_image_file_set(ep->object, ed->file->path, buf); - if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE) - { - ERR("Error loading image collection \"%s\" from " - "file \"%s\". Missing EET Evas loader module?", - buf, ed->file->path); - switch (evas_object_image_load_error_get(ep->object)) - { - case EVAS_LOAD_ERROR_GENERIC: - ERR("Error type: EVAS_LOAD_ERROR_GENERIC"); - break; - case EVAS_LOAD_ERROR_DOES_NOT_EXIST: - ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST"); - break; - case EVAS_LOAD_ERROR_PERMISSION_DENIED: - ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED"); - break; - case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: - ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED"); - break; - case EVAS_LOAD_ERROR_CORRUPT_FILE: - ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE"); - break; - case EVAS_LOAD_ERROR_UNKNOWN_FORMAT: - ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT"); - break; - default: - ERR("Error type: ???"); - break; - } - } - } - } + _edje_real_part_image_set(ed, ep, pos); } static Edje_Real_Part * @@ -2299,13 +2365,15 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta Edje_Real_Part *pp; int part_id = -1; - if (pos >= 0.5) + if (pos >= FROM_DOUBLE(0.5)) part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; else part_id = ((Edje_Part_Description_Proxy*) chosen_desc)->proxy.id; pp = _edje_real_part_state_get(ed, ep, flags, part_id, NULL); +#ifdef EDJE_CALC_CACHE if (pp && pp->invalidate) proxy_invalidate = EINA_TRUE; +#endif } /* Recalc if needed the map center && light source */ @@ -2355,7 +2423,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta _edje_part_recalc_single(ed, ep, ep->param1.description, chosen_desc, center[0], light[0], persp[0], ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x, ep->param1.rel2_to_y, confine_to, - p1); + p1, pos); #ifdef EDJE_CALC_CACHE ep->param1.state = ed->state; @@ -2400,10 +2468,15 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta ((ep->part->type == EDJE_PART_TYPE_TEXT || ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && ed->text_part_change)) #endif { - _edje_part_recalc_single(ed, ep, ep->param2->description, chosen_desc, center[1], light[1], persp[1], - ep->param2->rel1_to_x, ep->param2->rel1_to_y, ep->param2->rel2_to_x, ep->param2->rel2_to_y, + _edje_part_recalc_single(ed, ep, ep->param2->description, + chosen_desc, + center[1], light[1], persp[1], + ep->param2->rel1_to_x, + ep->param2->rel1_to_y, + ep->param2->rel2_to_x, + ep->param2->rel2_to_y, confine_to, - p2); + p2, pos); #ifdef EDJE_CALC_CACHE ep->param2->state = ed->state; #endif @@ -2449,7 +2522,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta p3->req.y = INTP(p1->req.y, p2->req.y, pos); p3->req.w = INTP(p1->req.w, p2->req.w, pos); p3->req.h = INTP(p1->req.h, p2->req.h, pos); - + if (ep->part->dragable.x) { p3->req_drag.x = INTP(p1->req_drag.x, p2->req_drag.x, pos); @@ -2543,11 +2616,11 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta } else if (p1->persp_on) { - memcpy(&p3->map.persp, &p1->map.persp, sizeof (p1->map.light)); + memcpy(&p3->map.persp, &p1->map.persp, sizeof (p1->map.persp)); } else if (p2->persp_on) { - memcpy(&p3->map.persp, &p2->map.persp, sizeof (p2->map.light)); + memcpy(&p3->map.persp, &p2->map.persp, sizeof (p2->map.persp)); } } diff --git a/libraries/edje/src/lib/edje_callbacks.c b/libraries/edje/src/lib/edje_callbacks.c index e0b0eae..2b02891 100644 --- a/libraries/edje/src/lib/edje_callbacks.c +++ b/libraries/edje/src/lib/edje_callbacks.c @@ -134,6 +134,7 @@ _edje_mouse_down_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi _edje_emit(ed, buf, events->part->name); } ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -157,6 +158,7 @@ _edje_mouse_down_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi rp->drag->val.y = dy; if (!ignored) _edje_emit(ed, "drag", rp->part->name); + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; @@ -235,6 +237,7 @@ _edje_mouse_up_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void if (rp->drag->down.count == 0) { rp->drag->need_reset = 1; + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; @@ -314,6 +317,7 @@ _edje_mouse_move_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi rp->drag->tmp.x = ev->cur.canvas.x - rp->drag->down.x; if (rp->part->dragable.y) rp->drag->tmp.y = ev->cur.canvas.y - rp->drag->down.y; + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; @@ -332,6 +336,7 @@ _edje_mouse_move_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi rp->drag->val.y = dy; if (!ignored) _edje_emit(ed, "drag", rp->part->name); + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; diff --git a/libraries/edje/src/lib/edje_data.c b/libraries/edje/src/lib/edje_data.c index 6b7b395..32b17b6 100644 --- a/libraries/edje/src/lib/edje_data.c +++ b/libraries/edje/src/lib/edje_data.c @@ -451,6 +451,9 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "align.y", align.y, EDJE_T_FLOAT); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.w", fixed.w, EET_T_UCHAR); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.h", fixed.h, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.have", minmul.have, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.w", minmul.w, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.h", minmul.h, EDJE_T_FLOAT); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.w", min.w, EET_T_INT); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.h", min.h, EET_T_INT); \ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.w", max.w, EET_T_INT); \ diff --git a/libraries/edje/src/lib/edje_edit.c b/libraries/edje/src/lib/edje_edit.c index 901a1b1..eec5e04 100644 --- a/libraries/edje/src/lib/edje_edit.c +++ b/libraries/edje/src/lib/edje_edit.c @@ -20,14 +20,18 @@ EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED = 0 ; EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_REFERENCED = 0; EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST = 0; -/* Get ed(Edje*) from obj(Evas_Object*) */ -#define GET_ED_OR_RETURN(RET) \ - Edje *ed; \ +/* Get eed(Edje_Edit*) from obj(Evas_Object*) */ +#define GET_EED_OR_RETURN(RET) \ Edje_Edit *eed; \ if (!evas_object_smart_type_check_ptr(obj, _edje_edit_type)) \ return RET; \ eed = evas_object_smart_data_get(obj); \ - if (!eed) return RET; \ + if (!eed) return RET; + +/* Get ed(Edje*) from obj(Evas_Object*) */ +#define GET_ED_OR_RETURN(RET) \ + Edje *ed; \ + GET_EED_OR_RETURN(RET); \ ed = (Edje *)eed; /* Get rp(Edje_Real_Part*) from obj(Evas_Object*) and part(char*) */ @@ -388,72 +392,59 @@ _edje_real_part_free(Edje_Real_Part *rp) static Eina_Bool _edje_import_font_file(Edje *ed, const char *path, const char *entry) { + Eina_File *f; + Eet_File *eetf = NULL; void *fdata = NULL; long fsize = 0; /* Read font data from file */ - { - FILE *f = fopen(path, "rb"); - if (!f) - { - ERR("Unable to open font file \"%s\"", path); - return EINA_FALSE; - } + f = eina_file_open(path, 0); + if (!f) + { + ERR("Unable to open font file \"%s\"", path); + return EINA_FALSE; + } - fseek(f, 0, SEEK_END); - fsize = ftell(f); - rewind(f); - fdata = malloc(fsize); - if (!fdata) - { - ERR("Unable to alloc font file \"%s\"", path); - fclose(f); - return EINA_FALSE; - } - if (fread(fdata, fsize, 1, f) != 1) - { - free(fdata); - fclose(f); - ERR("Unable to read all of font file \"%s\"", path); - return EINA_FALSE; - } - fclose(f); - } + fsize = eina_file_size_get(f); + fdata = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); + if (!fdata) + { + ERR("Unable to map font file \"%s\"", path); + goto on_error; + } /* Write font to edje file */ - { - /* open the eet file */ - Eet_File *eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE); - if (!eetf) - { - ERR("Unable to open \"%s\" for writing output", ed->path); - free(fdata); - return EINA_FALSE; - } + eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE); + if (!eetf) + { + ERR("Unable to open \"%s\" for writing output", ed->path); + goto on_error; + } - if (eet_write(eetf, entry, fdata, fsize, 1) <= 0) - { - ERR("Unable to write font part \"%s\" as \"%s\" part entry", - path, entry); - eet_close(eetf); - free(fdata); - return EINA_FALSE; - } + if (eet_write(eetf, entry, fdata, fsize, 1) <= 0) + { + ERR("Unable to write font part \"%s\" as \"%s\" part entry", + path, entry); + goto on_error; + } - free(fdata); + /* write the edje_file */ + if (!_edje_edit_edje_file_save(eetf, ed->file)) + goto on_error; - /* write the edje_file */ - if (!_edje_edit_edje_file_save(eetf, ed->file)) - { - eet_delete(eetf, entry); - eet_close(eetf); - return EINA_FALSE; - } + eet_close(eetf); - eet_close(eetf); - } + eina_file_map_free(f, fdata); + eina_file_close(f); return EINA_TRUE; + + on_error: + if (eetf) eet_close(eetf); + eina_file_map_free(f, fdata); + eina_file_close(f); + + return EINA_FALSE; } @@ -4791,7 +4782,7 @@ edje_edit_image_id_get(Evas_Object *obj, const char *image_name) { eina_error_set(0); - GET_ED_OR_RETURN(-1); + GET_EED_OR_RETURN(-1); return _edje_image_id_find(eed, image_name); } @@ -5174,7 +5165,6 @@ EAPI Eina_Bool edje_edit_program_add(Evas_Object *obj, const char *name) { Edje_Program *epr; - Edje_Part_Collection *pc; eina_error_set(0); @@ -5191,7 +5181,7 @@ edje_edit_program_add(Evas_Object *obj, const char *name) if (!epr) return EINA_FALSE; //Add program to group - pc = ed->collection; + // pc = ed->collection; /* By default, source and signal are empty, so they fill in nocmp category */ ed->collection->programs.nocmp = realloc(ed->collection->programs.nocmp, @@ -5237,7 +5227,6 @@ edje_edit_program_del(Evas_Object *obj, const char *prog) Eina_List *l, *l_next; Edje_Program_Target *prt; Edje_Program_After *pa; - Edje_Part_Collection *pc; Edje_Program *p; Program_Script *ps, *old_ps; int id, i; @@ -5248,7 +5237,7 @@ edje_edit_program_del(Evas_Object *obj, const char *prog) GET_ED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); - pc = ed->collection; + //pc = ed->collection; //Remove program from programs list id = epr->id; @@ -5737,7 +5726,7 @@ edje_edit_program_action_set(Evas_Object *obj, const char *prog, Edje_Action_Typ eina_error_set(0); - GET_ED_OR_RETURN(EINA_FALSE); + GET_EED_OR_RETURN(EINA_FALSE); GET_EPR_OR_RETURN(EINA_FALSE); //printf("SET ACTION for program: %s [%d]\n", prog, action); @@ -6081,7 +6070,7 @@ edje_edit_script_set(Evas_Object *obj, const char *code) { eina_error_set(0); - GET_ED_OR_RETURN(); + GET_EED_OR_RETURN(); free(eed->embryo_source); free(eed->embryo_processed); @@ -6104,7 +6093,7 @@ edje_edit_script_program_get(Evas_Object *obj, const char *prog) eina_error_set(0); - GET_ED_OR_RETURN(NULL); + GET_EED_OR_RETURN(NULL); GET_EPR_OR_RETURN(NULL); if (epr->action != EDJE_ACTION_TYPE_SCRIPT) @@ -6124,7 +6113,7 @@ edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *cod eina_error_set(0); - GET_ED_OR_RETURN(); + GET_EED_OR_RETURN(); GET_EPR_OR_RETURN(); if (epr->action != EDJE_ACTION_TYPE_SCRIPT) @@ -6550,7 +6539,7 @@ almost_out: EAPI Eina_Bool edje_edit_script_compile(Evas_Object *obj) { - GET_ED_OR_RETURN(EINA_FALSE); + GET_EED_OR_RETURN(EINA_FALSE); if (!eed->script_need_recompile) return EINA_TRUE; @@ -6561,7 +6550,7 @@ edje_edit_script_compile(Evas_Object *obj) EAPI const Eina_List * edje_edit_script_error_list_get(Evas_Object *obj) { - GET_ED_OR_RETURN(NULL); + GET_EED_OR_RETURN(NULL); return eed->errors; } @@ -6643,7 +6632,7 @@ _edje_generate_source_of_program(Evas_Object *obj, const char *program, Eina_Str const char *api_name, *api_description; Edje_Program *epr; - GET_ED_OR_RETURN(EINA_FALSE); + GET_EED_OR_RETURN(EINA_FALSE); epr = _edje_program_get_byname(obj, program); @@ -6816,7 +6805,7 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s if (pd->aspect.min || pd->aspect.max) BUF_APPENDF(I5"aspect: %g %g;\n", TO_DOUBLE(pd->aspect.min), TO_DOUBLE(pd->aspect.max)); if (pd->aspect.prefer) - BUF_APPENDF(I5"aspect_preference: %s;\n", prefers[pd->aspect.prefer]); + BUF_APPENDF(I5"aspect_preference: %s;\n", prefers[(int) pd->aspect.prefer]); if (pd->color_class) BUF_APPENDF(I5"color_class: \"%s\";\n", pd->color_class); @@ -7786,7 +7775,7 @@ edje_edit_print_internal_status(Evas_Object *obj) */ eina_error_set(0); - GET_ED_OR_RETURN(); + GET_EED_OR_RETURN(); _edje_generate_source(obj); /* diff --git a/libraries/edje/src/lib/edje_embryo.c b/libraries/edje/src/lib/edje_embryo.c index c89a4f4..1ad2377 100644 --- a/libraries/edje/src/lib/edje_embryo.c +++ b/libraries/edje/src/lib/edje_embryo.c @@ -674,6 +674,7 @@ _edje_embryo_fn_set_min_size(Embryo_Program *ep, Embryo_Cell *params) if (h < 0.0) h = 0.0; ed->collection->prop.min.w = w; ed->collection->prop.min.h = h; + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; @@ -701,6 +702,7 @@ _edje_embryo_fn_set_max_size(Embryo_Program *ep, Embryo_Cell *params) if (h < 0.0) h = 0.0; ed->collection->prop.max.w = w; ed->collection->prop.max.h = h; + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; diff --git a/libraries/edje/src/lib/edje_entry.c b/libraries/edje/src/lib/edje_entry.c index e25397a..563497d 100644 --- a/libraries/edje/src/lib/edje_entry.c +++ b/libraries/edje/src/lib/edje_entry.c @@ -2,9 +2,9 @@ #ifdef HAVE_ECORE_IMF static Eina_Bool _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos); -static Eina_Bool _edje_entry_imf_event_commit_cb(void *data, int type, void *event); -static Eina_Bool _edje_entry_imf_event_preedit_changed_cb(void *data, int type, void *event); -static Eina_Bool _edje_entry_imf_event_delete_surrounding_cb(void *data, int type, void *event); +static void _edje_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info); +static void _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx, void *event_info); +static void _edje_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx, void *event); #endif typedef struct _Entry Entry; @@ -39,10 +39,6 @@ struct _Entry #ifdef HAVE_ECORE_IMF Eina_Bool have_preedit : 1; Ecore_IMF_Context *imf_context; - - Ecore_Event_Handler *imf_ee_handler_commit; - Ecore_Event_Handler *imf_ee_handler_delete; - Ecore_Event_Handler *imf_ee_handler_changed; #endif }; @@ -272,20 +268,6 @@ _curs_update_from_curs(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, Entr *cy += (ch / 2); } -static void -_curs_back(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, - Entry *en __UNUSED__) -{ - evas_textblock_cursor_char_prev(c); -} - -static void -_curs_next(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, - Entry *en __UNUSED__) -{ - evas_textblock_cursor_char_next(c); -} - static int _curs_line_last_get(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en __UNUSED__) { @@ -415,6 +397,7 @@ static void _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) { if (!en->sel_end) return; + _edje_entry_imf_context_reset(en); _sel_enable(c, o, en); if (!evas_textblock_cursor_compare(c, en->sel_end)) return; evas_textblock_cursor_copy(c, en->sel_end); @@ -424,13 +407,13 @@ _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) en->selection = NULL; } _edje_emit(en->rp->edje, "selection,changed", en->rp->part->name); - _edje_entry_imf_context_reset(en); } static void _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) { if (!en->sel_end) return; + _edje_entry_imf_context_reset(en); _sel_enable(c, o, en); if (!evas_textblock_cursor_compare(c, en->sel_start)) return; evas_textblock_cursor_copy(c, en->sel_start); @@ -440,7 +423,6 @@ _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) en->selection = NULL; } _edje_emit(en->rp->edje, "selection,changed", en->rp->part->name); - _edje_entry_imf_context_reset(en); } static void @@ -1107,6 +1089,10 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v } #endif + if ((!strcmp(ev->key, "Escape")) || + (!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter"))) + _edje_entry_imf_context_reset(en); + old_cur_pos = evas_textblock_cursor_pos_get(en->cursor); control = evas_key_modifier_is_set(ev->modifiers, "Control"); @@ -1138,6 +1124,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v } _sel_clear(en->cursor, rp->object, en); _edje_emit(ed, "entry,key,up", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); } else if (!strcmp(ev->key, "Down") || !strcmp(ev->key, "KP_Down")) { @@ -1157,6 +1144,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v } _sel_clear(en->cursor, rp->object, en); _edje_emit(ed, "entry,key,down", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); } else if (!strcmp(ev->key, "Left") || !strcmp(ev->key, "KP_Left")) { @@ -1165,13 +1153,16 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v if (shift) _sel_start(en->cursor, rp->object, en); else _sel_clear(en->cursor, rp->object, en); } - _curs_back(en->cursor, rp->object, en); + evas_textblock_cursor_char_prev(en->cursor); + /* If control is pressed, go to the start of the word */ + if (control) evas_textblock_cursor_word_start(en->cursor); if (en->select_allow) { if (shift) _sel_extend(en->cursor, rp->object, en); } _sel_clear(en->cursor, rp->object, en); _edje_emit(ed, "entry,key,left", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if (!strcmp(ev->key, "Right") || !strcmp(ev->key, "KP_Right")) @@ -1181,20 +1172,31 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v if (shift) _sel_start(en->cursor, rp->object, en); else _sel_clear(en->cursor, rp->object, en); } - _curs_next(en->cursor, rp->object, en); + /* If control is pressed, go to the start of the word */ + if (control) evas_textblock_cursor_word_end(en->cursor); + evas_textblock_cursor_char_next(en->cursor); if (en->select_allow) { if (shift) _sel_extend(en->cursor, rp->object, en); } _sel_clear(en->cursor, rp->object, en); _edje_emit(ed, "entry,key,right", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if (!strcmp(ev->key, "BackSpace")) { - if (control) + if (control && !en->have_selection) { // del to start of previous word + _sel_start(en->cursor, rp->object, en); + + evas_textblock_cursor_char_prev(en->cursor); + evas_textblock_cursor_word_start(en->cursor); + + _sel_extend(en->cursor, rp->object, en); + + _range_del_emit(ed, en->cursor, rp->object, en); } else if ((alt) && (shift)) { @@ -1224,6 +1226,14 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v if (control) { // del to end of next word + _sel_start(en->cursor, rp->object, en); + + evas_textblock_cursor_word_end(en->cursor); + evas_textblock_cursor_char_next(en->cursor); + + _sel_extend(en->cursor, rp->object, en); + + _range_del_emit(ed, en->cursor, rp->object, en); } else if (shift) { @@ -1281,10 +1291,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v _edje_emit(ed, "entry,key,end", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } - else if (!strcmp(ev->key, "Shift_L") || !strcmp(ev->key, "Shift_R")) - { - return; - } else if ((control) && (!strcmp(ev->key, "v"))) { _edje_emit(ed, "entry,paste,request", rp->part->name); @@ -1303,13 +1309,11 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v } else if ((control) && ((!strcmp(ev->key, "c") || (!strcmp(ev->key, "Insert"))))) { - // FIXME: copy - save selection _edje_emit(ed, "entry,copy,notify", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if ((control) && ((!strcmp(ev->key, "x") || (!strcmp(ev->key, "m"))))) { - // FIXME: cut - save selection, delete seletion _edje_emit(ed, "entry,cut,notify", rp->part->name); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } @@ -1336,7 +1340,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v else if ((control) && (!strcmp(ev->key, "w"))) { _sel_clear(en->cursor, rp->object, en); - // select current word + // select current word? ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if (!strcmp(ev->key, "Tab")) @@ -1361,10 +1365,10 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v _sel_clear(en->cursor, rp->object, en); info->change.insert.pos = evas_textblock_cursor_pos_get(en->cursor); - info->change.insert.content = eina_stringshare_add("<\t>"); + info->change.insert.content = eina_stringshare_add(""); //yy -// evas_textblock_cursor_format_prepend(en->cursor, "\t"); - _text_filter_format_prepend(en, en->cursor, "\t"); +// evas_textblock_cursor_format_prepend(en->cursor, "tab"); + _text_filter_format_prepend(en, en->cursor, "tab"); _anchors_get(en->cursor, rp->object, en); _edje_emit(ed, "entry,changed", rp->part->name); _edje_emit_full(ed, "entry,changed,user", rp->part->name, @@ -1427,19 +1431,20 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v info->change.insert.pos = evas_textblock_cursor_pos_get(en->cursor); - if (shift) + if (shift || + evas_object_textblock_legacy_newline_get(rp->object)) { //yy -// evas_textblock_cursor_format_prepend(en->cursor, "\n"); - _text_filter_format_prepend(en, en->cursor, "\n"); - info->change.insert.content = eina_stringshare_add("<\n>"); +// evas_textblock_cursor_format_prepend(en->cursor, "br"); + _text_filter_format_prepend(en, en->cursor, "br"); + info->change.insert.content = eina_stringshare_add("
"); } else { //yy // evas_textblock_cursor_format_prepend(en->cursor, "ps"); _text_filter_format_prepend(en, en->cursor, "ps"); - info->change.insert.content = eina_stringshare_add(""); + info->change.insert.content = eina_stringshare_add(""); } _anchors_get(en->cursor, rp->object, en); _edje_emit(ed, "entry,changed", rp->part->name); @@ -1499,7 +1504,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v if (!cursor_changed && (old_cur_pos != evas_textblock_cursor_pos_get(en->cursor))) _edje_emit(ed, "cursor,changed", rp->part->name); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); } @@ -1576,6 +1580,8 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS } #endif + _edje_entry_imf_context_reset(en); + en->select_mod_start = EINA_FALSE; en->select_mod_end = EINA_FALSE; if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT) @@ -1690,10 +1696,12 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS } } if (evas_textblock_cursor_compare(tc, en->cursor)) - _edje_emit(rp->edje, "cursor,changed", rp->part->name); + { + _edje_emit(rp->edje, "cursor,changed", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); + } evas_textblock_cursor_free(tc); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); @@ -1733,6 +1741,8 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED } #endif + _edje_entry_imf_context_reset(en); + tc = evas_object_textblock_cursor_new(rp->object); evas_textblock_cursor_copy(en->cursor, tc); evas_object_geometry_get(rp->object, &x, &y, &w, &h); @@ -1799,10 +1809,12 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED en->selecting = EINA_FALSE; } if (evas_textblock_cursor_compare(tc, en->cursor)) - _edje_emit(rp->edje, "cursor,changed", rp->part->name); + { + _edje_emit(rp->edje, "cursor,changed", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); + } evas_textblock_cursor_free(tc); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); } @@ -1893,7 +1905,10 @@ _edje_part_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS _sel_update(en->cursor, rp->object, en); } if (evas_textblock_cursor_compare(tc, en->cursor)) - _edje_emit(rp->edje, "cursor,changed", rp->part->name); + { + _edje_emit(rp->edje, "cursor,changed", rp->part->name); + _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); + } evas_textblock_cursor_free(tc); _edje_entry_imf_context_reset(en); @@ -2014,6 +2029,8 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) evas_object_pass_events_set(en->cursor_fg, EINA_TRUE); _edje_subobj_register(en->rp->edje, en->cursor_fg); + evas_object_textblock_legacy_newline_set(rp->object, EINA_TRUE); + if (rp->part->entry_mode >= EDJE_ENTRY_EDIT_MODE_EDITABLE) { evas_object_show(en->cursor_bg); @@ -2055,9 +2072,9 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context, _edje_entry_imf_retrieve_surrounding_cb, rp->edje); - en->imf_ee_handler_commit = ecore_event_handler_add(ECORE_IMF_EVENT_COMMIT, _edje_entry_imf_event_commit_cb, rp->edje); - en->imf_ee_handler_delete = ecore_event_handler_add(ECORE_IMF_EVENT_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb, rp->edje); - en->imf_ee_handler_changed = ecore_event_handler_add(ECORE_IMF_EVENT_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb, rp->edje); + ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb, rp->edje); + ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb, rp->edje); + ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb, rp->edje); ecore_imf_context_input_mode_set(en->imf_context, rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD ? ECORE_IMF_INPUT_MODE_INVISIBLE : ECORE_IMF_INPUT_MODE_FULL); @@ -2094,23 +2111,9 @@ _edje_entry_real_part_shutdown(Edje_Real_Part *rp) { if (en->imf_context) { - if (en->imf_ee_handler_commit) - { - ecore_event_handler_del(en->imf_ee_handler_commit); - en->imf_ee_handler_commit = NULL; - } - - if (en->imf_ee_handler_delete) - { - ecore_event_handler_del(en->imf_ee_handler_delete); - en->imf_ee_handler_delete = NULL; - } - - if (en->imf_ee_handler_changed) - { - ecore_event_handler_del(en->imf_ee_handler_changed); - en->imf_ee_handler_changed = NULL; - } + ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb); + ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb); + ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb); ecore_imf_context_del(en->imf_context); en->imf_context = NULL; @@ -2189,7 +2192,7 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text) { Entry *en = rp->entry_data; if (!en) return; - + _edje_entry_imf_context_reset(en); // set text as markup _sel_clear(en->cursor, rp->object, en); evas_object_textblock_text_markup_set(rp->object, text); @@ -2228,6 +2231,8 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text) { Entry *en = rp->entry_data; if (!en) return; + _edje_entry_imf_context_reset(en); + // prepend markup @ cursor pos if (en->have_selection) _range_del(en->cursor, rp->object, en); @@ -2239,9 +2244,7 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text) _edje_emit(rp->edje, "entry,changed", rp->part->name); _edje_emit(rp->edje, "cursor,changed", rp->part->name); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); - _edje_entry_real_part_configure(rp); } @@ -2278,6 +2281,9 @@ _edje_entry_select_all(Edje_Real_Part *rp) { Entry *en = rp->entry_data; if (!en) return; + + _edje_entry_imf_context_reset(en); + _sel_clear(en->cursor, rp->object, en); _curs_start(en->cursor, rp->object, en); _sel_enable(en->cursor, rp->object, en); @@ -2285,7 +2291,6 @@ _edje_entry_select_all(Edje_Real_Part *rp) _curs_end(en->cursor, rp->object, en); _sel_extend(en->cursor, rp->object, en); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); } @@ -2295,12 +2300,14 @@ _edje_entry_select_begin(Edje_Real_Part *rp) { Entry *en = rp->entry_data; if (!en) return; + + _edje_entry_imf_context_reset(en); + _sel_clear(en->cursor, rp->object, en); _sel_enable(en->cursor, rp->object, en); _sel_start(en->cursor, rp->object, en); _sel_extend(en->cursor, rp->object, en); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); @@ -2311,9 +2318,9 @@ _edje_entry_select_extend(Edje_Real_Part *rp) { Entry *en = rp->entry_data; if (!en) return; + _edje_entry_imf_context_reset(en); _sel_extend(en->cursor, rp->object, en); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_entry_real_part_configure(rp); @@ -2560,13 +2567,14 @@ _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return EINA_FALSE; + + _edje_entry_imf_context_reset(en); + if (!evas_textblock_cursor_char_next(c)) { return EINA_FALSE; } _sel_update(c, rp->object, rp->entry_data); - - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2580,6 +2588,9 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return EINA_FALSE; + + _edje_entry_imf_context_reset(en); + if (!evas_textblock_cursor_char_prev(c)) { if (evas_textblock_cursor_paragraph_prev(c)) goto ok; @@ -2588,7 +2599,6 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur) ok: _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2604,6 +2614,9 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur) Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; int ln; if (!c) return EINA_FALSE; + + _edje_entry_imf_context_reset(en); + ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); ln--; if (ln < 0) return EINA_FALSE; @@ -2620,7 +2633,6 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur) } _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2636,6 +2648,9 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur) Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; int ln; if (!c) return EINA_FALSE; + + _edje_entry_imf_context_reset(en); + ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); ln++; if (!evas_object_textblock_line_number_geometry_get(rp->object, ln, @@ -2651,7 +2666,6 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur) } _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); _edje_entry_real_part_configure(rp); @@ -2664,10 +2678,12 @@ _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return; + + _edje_entry_imf_context_reset(en); + evas_textblock_cursor_paragraph_first(c); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); _edje_entry_real_part_configure(rp); @@ -2679,10 +2695,12 @@ _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return; + + _edje_entry_imf_context_reset(en); + _curs_end(c, rp->object, rp->entry_data); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2715,10 +2733,11 @@ _edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return; + _edje_entry_imf_context_reset(en); + evas_textblock_cursor_line_char_first(c); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); @@ -2731,10 +2750,10 @@ _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur) Entry *en = rp->entry_data; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return; + _edje_entry_imf_context_reset(en); evas_textblock_cursor_line_char_last(c); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); _edje_entry_real_part_configure(rp); @@ -2766,7 +2785,7 @@ _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur) return evas_textblock_cursor_format_is_visible_get(c); } -const char * +char * _edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur) { static char *s = NULL; @@ -2793,10 +2812,10 @@ _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos) if (evas_textblock_cursor_pos_get(c) == pos) return; + _edje_entry_imf_context_reset(en); evas_textblock_cursor_pos_set(c, pos); _sel_update(c, rp->object, rp->entry_data); - _edje_entry_imf_context_reset(en); _edje_entry_imf_cursor_info_set(en); _edje_emit(rp->edje, "cursor,changed", rp->part->name); _edje_entry_real_part_configure(rp); @@ -2891,43 +2910,33 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx __UNU return EINA_TRUE; } -static Eina_Bool -_edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) +static void +_edje_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, void *event_info) { Edje *ed = data; Edje_Real_Part *rp = ed->focused_part; Entry *en; - Ecore_IMF_Event_Commit *ev = event; - Evas_Textblock_Cursor *tc; - Eina_Bool cursor_move = EINA_FALSE; + char *commit_str = event_info; + int start_pos; - if ((!rp) || (!ev) || (!ev->str)) return ECORE_CALLBACK_PASS_ON; + if ((!rp)) return; en = rp->entry_data; if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) - return ECORE_CALLBACK_PASS_ON; - - if (!en->imf_context) return ECORE_CALLBACK_PASS_ON; - if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; + return; if (en->have_selection) { - if (strcmp(ev->str, "")) + if (strcmp(commit_str, "")) { /* delete selected characters */ - _range_del(en->cursor, rp->object, en); + _range_del_emit(ed, en->cursor, rp->object, en); _sel_clear(en->cursor, rp->object, en); } } - tc = evas_object_textblock_cursor_new(rp->object); - - /* calculate the cursor position to insert commit string */ - if (en->preedit_start) - evas_textblock_cursor_copy(en->preedit_start, tc); - else - evas_textblock_cursor_copy(en->cursor, tc); + start_pos = evas_textblock_cursor_pos_get(en->cursor); #ifdef HAVE_ECORE_IMF /* delete preedit characters */ @@ -2935,17 +2944,16 @@ _edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) _preedit_clear(en); #endif - if (evas_textblock_cursor_compare(en->cursor, tc)) - cursor_move = EINA_TRUE; if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && _edje_password_show_last) _edje_entry_hide_visible_password(en->rp); if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && _edje_password_show_last && (!en->preedit_start)) { - _text_filter_format_prepend(en, tc, "+ password=off"); - _text_filter_markup_prepend(en, tc, ev->str); - _text_filter_format_prepend(en, tc, "- password"); + _text_filter_format_prepend(en, en->cursor, "+ password=off"); + _text_filter_text_prepend(en, en->cursor, commit_str); + _text_filter_format_prepend(en, en->cursor, "- password"); + if (en->pw_timer) { ecore_timer_del(en->pw_timer); @@ -2955,51 +2963,54 @@ _edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) _password_timer_cb, en); } else - _text_filter_text_prepend(en, tc, ev->str); - - if (!cursor_move) - { - /* move cursor to the end of commit string */ - evas_textblock_cursor_copy(tc, en->cursor); - } + _text_filter_text_prepend(en, en->cursor, commit_str); - evas_textblock_cursor_free(tc); _edje_entry_imf_cursor_info_set(en); _anchors_get(en->cursor, rp->object, en); _edje_emit(rp->edje, "entry,changed", rp->part->name); - _edje_emit(ed, "entry,changed,user", rp->part->name); - _edje_emit(ed, "cursor,changed", rp->part->name); - return ECORE_CALLBACK_DONE; + { + Edje_Entry_Change_Info *info = calloc(1, sizeof(*info)); + info->insert = EINA_TRUE; + info->change.insert.pos = start_pos; + info->change.insert.content = eina_stringshare_add(commit_str); + info->change.insert.plain_length = + eina_unicode_utf8_get_len(info->change.insert.content); + _edje_emit_full(ed, "entry,changed,user", rp->part->name, + info, _free_entry_change_info); + _edje_emit(ed, "cursor,changed", rp->part->name); + } } -static Eina_Bool -_edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void *event) +static void +_edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, void *event_info __UNUSED__) { Edje *ed = data; Edje_Real_Part *rp = ed->focused_part; Entry *en; - Ecore_IMF_Event_Preedit_Changed *ev = event; int cursor_pos; int preedit_start_pos, preedit_end_pos; char *preedit_string; int i; Eina_Bool preedit_end_state = EINA_FALSE; + Eina_List *attrs = NULL, *l = NULL; + Ecore_IMF_Preedit_Attr *attr; + Eina_Strbuf *buf; - if ((!rp) || (!ev)) return ECORE_CALLBACK_PASS_ON; + if ((!rp)) return; en = rp->entry_data; if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) - return ECORE_CALLBACK_PASS_ON; - - if (!en->imf_context) return ECORE_CALLBACK_PASS_ON; + return; - if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; + if (!en->imf_context) return; - ecore_imf_context_preedit_string_get(en->imf_context, &preedit_string, &cursor_pos); - if (!preedit_string) return ECORE_CALLBACK_PASS_ON; + ecore_imf_context_preedit_string_with_attributes_get(en->imf_context, + &preedit_string, + &attrs, &cursor_pos); + if (!preedit_string) return; if (!strcmp(preedit_string, "")) preedit_end_state = EINA_TRUE; @@ -3007,7 +3018,7 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * if (en->have_selection && !preedit_end_state) { /* delete selected characters */ - _range_del(en->cursor, rp->object, en); + _range_del_emit(ed, en->cursor, rp->object, en); _sel_clear(en->cursor, rp->object, en); } @@ -3017,23 +3028,51 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * preedit_start_pos = evas_textblock_cursor_pos_get(en->cursor); /* insert preedit character(s) */ - if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && - _edje_password_show_last) + if (strlen(preedit_string) > 0) { - _text_filter_format_prepend(en, en->cursor, "+ password=off"); - _text_filter_markup_prepend(en, en->cursor, preedit_string); - _text_filter_format_prepend(en, en->cursor, "- password"); - if (en->pw_timer) + buf = eina_strbuf_new(); + if (attrs) { - ecore_timer_del(en->pw_timer); - en->pw_timer = NULL; + EINA_LIST_FOREACH(attrs, l, attr) + { + if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1) + { + eina_strbuf_append(buf, ""); + eina_strbuf_append_n(buf, preedit_string + attr->start_index, + attr->end_index - attr->start_index); + eina_strbuf_append(buf, ""); + } + + else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2 || + attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3) + { + eina_strbuf_append(buf, ""); + eina_strbuf_append_n(buf, preedit_string + attr->start_index, + attr->end_index - attr->start_index); + eina_strbuf_append(buf, ""); + } + } } - en->pw_timer = ecore_timer_add(_edje_password_show_last_timeout, - _password_timer_cb, en); - } - else - { - _text_filter_markup_prepend(en, en->cursor, preedit_string); + if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && + _edje_password_show_last) + { + _edje_entry_hide_visible_password(en->rp); + _text_filter_format_prepend(en, en->cursor, "+ password=off"); + _text_filter_markup_prepend(en, en->cursor, eina_strbuf_string_get(buf)); + _text_filter_format_prepend(en, en->cursor, "- password"); + if (en->pw_timer) + { + ecore_timer_del(en->pw_timer); + en->pw_timer = NULL; + } + en->pw_timer = ecore_timer_add(_edje_password_show_last_timeout, + _password_timer_cb, en); + } + else + { + _text_filter_markup_prepend(en, en->cursor, eina_strbuf_string_get(buf)); + } + eina_strbuf_free(buf); } if (!preedit_end_state) @@ -3066,29 +3105,30 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * _edje_emit(rp->edje, "preedit,changed", rp->part->name); _edje_emit(ed, "cursor,changed", rp->part->name); - free(preedit_string); + /* delete attribute list */ + if (attrs) + { + EINA_LIST_FREE(attrs, attr) free(attr); + } - return ECORE_CALLBACK_DONE; + free(preedit_string); } -static Eina_Bool -_edje_entry_imf_event_delete_surrounding_cb(void *data, int type __UNUSED__, void *event) +static void +_edje_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, void *event_info) { Edje *ed = data; Edje_Real_Part *rp = ed->focused_part; Entry *en; - Ecore_IMF_Event_Delete_Surrounding *ev = event; + Ecore_IMF_Event_Delete_Surrounding *ev = event_info; Evas_Textblock_Cursor *del_start, *del_end; int cursor_pos; - if ((!rp) || (!ev)) return ECORE_CALLBACK_PASS_ON; + if ((!rp) || (!ev)) return; en = rp->entry_data; if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) - return ECORE_CALLBACK_PASS_ON; - - if (!en->imf_context) return ECORE_CALLBACK_PASS_ON; - if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; + return; cursor_pos = evas_textblock_cursor_pos_get(en->cursor); @@ -3102,8 +3142,6 @@ _edje_entry_imf_event_delete_surrounding_cb(void *data, int type __UNUSED__, voi evas_textblock_cursor_free(del_start); evas_textblock_cursor_free(del_end); - - return ECORE_CALLBACK_DONE; } #endif diff --git a/libraries/edje/src/lib/edje_load.c b/libraries/edje/src/lib/edje_load.c index 644bb7c..8fe5842 100644 --- a/libraries/edje/src/lib/edje_load.c +++ b/libraries/edje/src/lib/edje_load.c @@ -262,6 +262,10 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g { Edje *ed; Evas *tev; + Edje_Real_Part *rp; + Eina_List *textblocks = NULL; + Eina_List *sources = NULL; + Eina_List *externals = NULL; Eina_List *old_swallows; unsigned int n; Eina_List *parts = NULL; @@ -323,7 +327,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g else { unsigned int i; - int errors = 0; /* colorclass stuff */ for (i = 0; i < ed->collection->parts_count; ++i) @@ -333,8 +336,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g ep = ed->collection->parts[i]; - if (errors) - break; /* Register any color classes in this parts descriptions. */ if ((ep->default_desc) && (ep->default_desc->color_class)) _edje_color_class_member_add(ed, ep->default_desc->color_class); @@ -353,12 +354,12 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g for (n = 0; n < ed->collection->parts_count; n++) { Edje_Part *ep; - Edje_Real_Part *rp; ep = ed->collection->parts[n]; rp = eina_mempool_malloc(_edje_real_part_mp, sizeof(Edje_Real_Part)); if (!rp) { + /* FIXME: destroy all allocated ressource, need to have a common exit point */ ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; evas_event_thaw(tev); evas_event_thaw_eval(tev); @@ -373,7 +374,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g if (!rp->drag) { ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - free(rp); + eina_mempool_free(_edje_real_part_mp, rp); evas_event_thaw(tev); evas_event_thaw_eval(tev); return 0; @@ -407,9 +408,12 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g rp->object = evas_object_text_add(ed->base.evas); evas_object_text_font_source_set(rp->object, ed->path); break; - case EDJE_PART_TYPE_SWALLOW: case EDJE_PART_TYPE_GROUP: + sources = eina_list_append(sources, rp); + case EDJE_PART_TYPE_SWALLOW: case EDJE_PART_TYPE_EXTERNAL: + if (ep->type == EDJE_PART_TYPE_EXTERNAL) + externals = eina_list_append(externals, rp); rp->object = evas_object_rectangle_add(ed->base.evas); evas_object_color_set(rp->object, 0, 0, 0, 0); evas_object_pass_events_set(rp->object, 1); @@ -417,13 +421,16 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g _edje_callbacks_focus_add(rp->object, ed, rp); break; case EDJE_PART_TYPE_TEXTBLOCK: + textblocks = eina_list_append(textblocks, rp); rp->object = evas_object_textblock_add(ed->base.evas); break; case EDJE_PART_TYPE_BOX: + sources = eina_list_append(sources, rp); rp->object = evas_object_box_add(ed->base.evas); rp->anim = _edje_box_layout_anim_new(rp->object); break; case EDJE_PART_TYPE_TABLE: + sources = eina_list_append(sources, rp); rp->object = evas_object_table_add(ed->base.evas); break; case EDJE_PART_TYPE_GRADIENT: @@ -463,7 +470,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g } if (n > 0) { - Edje_Real_Part *rp; Eina_List *l; ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n); @@ -519,7 +525,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g } rp->swallow_params.min.w = 0; - rp->swallow_params.min.w = 0; + rp->swallow_params.min.h = 0; rp->swallow_params.max.w = -1; rp->swallow_params.max.h = -1; @@ -587,8 +593,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g _edje_var_init(ed); for (i = 0; i < ed->table_parts_size; i++) { - Edje_Real_Part *rp; - rp = ed->table_parts[i]; evas_object_show(rp->object); if (_edje_block_break(ed)) break; @@ -599,6 +603,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g _edje_dragable_pos_set(ed, rp, rp->drag->val.x, rp->drag->val.y); } } + ed->recalc_call = 1; ed->dirty = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; @@ -606,11 +611,28 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g if ((evas_object_clipees_get(ed->base.clipper)) && (evas_object_visible_get(obj))) evas_object_show(ed->base.clipper); - + /* instantiate 'internal swallows' */ - for (i = 0; i < ed->table_parts_size; i++) + EINA_LIST_FREE(externals, rp) + { + Edje_Part_Description_External *external; + Evas_Object *child_obj; + + external = (Edje_Part_Description_External *) rp->part->default_desc; + child_obj = _edje_external_type_add(rp->part->source, + evas_object_evas_get(ed->obj), ed->obj, + external->external_params, rp->part->name); + if (child_obj) + { + _edje_real_part_swallow(rp, child_obj, EINA_TRUE); + rp->param1.external_params = _edje_external_params_parse(child_obj, + external->external_params); + _edje_external_recalc_apply(ed, rp, NULL, rp->chosen_description); + } + } + + EINA_LIST_FREE(sources, rp) { - Edje_Real_Part *rp; /* XXX: curr_item and pack_it don't require to be NULL since * XXX: they are just used when source != NULL and type == BOX, * XXX: and they're always set in this case, but GCC fails to @@ -620,8 +642,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g unsigned int item_count = 0; Edje_Pack_Element *pack_it = NULL; const char *source = NULL; - - rp = ed->table_parts[i]; switch (rp->part->type) { @@ -643,25 +663,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g } } break; - case EDJE_PART_TYPE_EXTERNAL: - { - Edje_Part_Description_External *external; - Evas_Object *child_obj; - - external = (Edje_Part_Description_External *) rp->part->default_desc; - child_obj = _edje_external_type_add(rp->part->source, - evas_object_evas_get(ed->obj), ed->obj, - external->external_params, rp->part->name); - if (child_obj) - { - _edje_real_part_swallow(rp, child_obj, EINA_TRUE); - rp->param1.external_params = _edje_external_params_parse(child_obj, - external->external_params); - _edje_external_recalc_apply(ed, rp, NULL, rp->chosen_description); - } - } - continue; default: + /* This list should only be filled by group, box or table, nothing else. */ + abort(); continue; } @@ -682,6 +686,11 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g { if (data == group_path_entry) { + ERR("recursive loop group '%s' already included inside part '%s' of group '%s' from file '%s'", + group_path_entry, rp->part->name, group, file); + textblocks = eina_list_free(textblocks); + externals = eina_list_free(externals); + sources = eina_list_free(sources); _edje_thaw(ed); _edje_unblock(ed); _edje_unref(ed); @@ -698,7 +707,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g return 0; } } - + child_obj = edje_object_add(ed->base.evas); group_path = eina_list_append(group_path, group_path_entry); if (rp->part->type == EDJE_PART_TYPE_GROUP) @@ -708,11 +717,16 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path)) { + ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'", + rp->part->name, group_path_entry, file, source); + textblocks = eina_list_free(textblocks); + externals = eina_list_free(externals); + sources = eina_list_free(sources); _edje_thaw(ed); _edje_unblock(ed); _edje_unref(ed); _edje_file_del(ed); - + if (group_path_started) { while (group_path) @@ -794,56 +808,51 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g { const char *name; Evas_Object *swallow; - + name = eina_list_data_get(old_swallows); old_swallows = eina_list_remove_list(old_swallows, old_swallows); - + swallow = eina_list_data_get(old_swallows); old_swallows = eina_list_remove_list(old_swallows, old_swallows); - + edje_object_part_swallow(obj, name, swallow); eina_stringshare_del(name); } } - + _edje_recalc(ed); _edje_thaw(ed); _edje_unblock(ed); _edje_unref(ed); ed->load_error = EDJE_LOAD_ERROR_NONE; _edje_emit(ed, "load", NULL); - /* instantiate 'internal swallows' */ - for (i = 0; i < ed->table_parts_size; i++) - { - Edje_Real_Part *rp; - - rp = ed->table_parts[i]; - if ((rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) && - (rp->part->default_desc)) - { - Edje_Part_Description_Text *text; - Edje_Style *stl = NULL; - const char *style; - - text = (Edje_Part_Description_Text *) rp->part->default_desc; - style = edje_string_get(&text->text.style); - if (style) - { - Eina_List *l; - - EINA_LIST_FOREACH(ed->file->styles, l, stl) - { - if ((stl->name) && (!strcmp(stl->name, style))) break; - stl = NULL; - } - } - if (stl) - { - if (evas_object_textblock_style_get(rp->object) != stl->style) - evas_object_textblock_style_set(rp->object, stl->style); - } - } - } + + /* instantiate 'internal textblock style' */ + EINA_LIST_FREE(textblocks, rp) + if (rp->part->default_desc) + { + Edje_Part_Description_Text *text; + Edje_Style *stl = NULL; + const char *style; + + text = (Edje_Part_Description_Text *) rp->part->default_desc; + style = edje_string_get(&text->text.style); + if (style) + { + Eina_List *l; + + EINA_LIST_FOREACH(ed->file->styles, l, stl) + { + if ((stl->name) && (!strcmp(stl->name, style))) break; + stl = NULL; + } + } + if (stl) + { + if (evas_object_textblock_style_get(rp->object) != stl->style) + evas_object_textblock_style_set(rp->object, stl->style); + } + } } _edje_entry_init(ed); evas_event_thaw(tev); diff --git a/libraries/edje/src/lib/edje_lua2.c b/libraries/edje/src/lib/edje_lua2.c index 2318af9..1d167e9 100644 --- a/libraries/edje/src/lib/edje_lua2.c +++ b/libraries/edje/src/lib/edje_lua2.c @@ -376,7 +376,7 @@ _elua_gc(lua_State *L) // Stack usage [-0, +0, e] // nil ~ static char * -_elua_push_name(lua_State *L, char *q, int index) // Stack usage [-0, +1, e or m] +_elua_push_name(lua_State *L, char *q, int idx) // Stack usage [-0, +1, e or m] { char *p = q; char temp = '\0'; @@ -387,8 +387,8 @@ _elua_push_name(lua_State *L, char *q, int index) // Stack usage [-0, +1, e or q++; temp = *q; *q = '\0'; - if (index > 0) - lua_getfield(L, index, p); // Stack usage [-0, +1, e] + if (idx > 0) + lua_getfield(L, idx, p); // Stack usage [-0, +1, e] else lua_pushstring(L, p); // Stack usage [-0, +1, m] *q = temp; @@ -614,6 +614,7 @@ static int _elua_echo(lua_State *L); static int _elua_date(lua_State *L); static int _elua_looptime(lua_State *L); static int _elua_seconds(lua_State *L); +static int _elua_version(lua_State *L); static int _elua_objgeom(lua_State *L); static int _elua_objpos(lua_State *L); @@ -649,6 +650,7 @@ static const struct luaL_reg _elua_edje_funcs [] = {"date", _elua_date}, // get date in a table {"looptime", _elua_looptime}, // get loop time {"seconds", _elua_seconds}, // get seconds + {"version", _elua_version}, // edje version // query edje - size, pos {"geom", _elua_objgeom}, // get while edje object geometry in canvas @@ -801,6 +803,25 @@ _elua_seconds(lua_State *L) // Stack usage [-0, +1, -] return 1; } +/** +@page luaref +@subsubsection edje_version edje:version() + +Retrieves the current edje version number. + +@returns A table with these fields: + - integer major: The edje version major number. + - integer minor: The edje version minor number. + +@since 1.2.0 +*/ +static int +_elua_version(lua_State *L) // Stack usage [-4, +5, em] +{ + _elua_ret(L, "%major %minor", EDJE_VERSION_MAJOR, EDJE_VERSION_MINOR); // Stack usage [-4, +5, em] + return 1; +} + //------------- /** @page luaref @@ -2936,7 +2957,9 @@ static int _elua_line_xy(lua_State *L) // Stack usage [ The lua evas map class includes functions for dealing with evas map objects. The evas map objects must have been previously created by lua using the lua -map object creation function edje:map(). +map object creation function edje:map(). The evas map system is complex, rather +than repeat the copious documentation here, please refer to the evas map +documentation. It has pictures and everything. B-) In the following, "map_object" is a place holder for any lua variable that holds a reference to an evas map object. @@ -2980,8 +3003,18 @@ static const struct luaL_reg _elua_evas_map_funcs [] = /** @page luaref -@subsubsection map_alpha map_object:alpha() +@subsubsection map_alpha map_object:alpha(alpha) + +Get (and optionally set) the maps alpha mode. + +Wraps evas_map_alpha_set(). +@param alpha The alpha mode. + +Note that the argument is optional, without it this function just queries the +current value. + +@return A boolean reflecting the alpha mode. @since 1.1.0 */ @@ -3008,6 +3041,11 @@ _elua_map_alpha(lua_State *L) // Stack usage [ @page luaref @subsubsection map_clockwise map_object:clockwise() +Get the maps clockwise state. + +Wraps evas_map_util_clockwise_get(). + +@return A boolean reflecting if the map is clockwise or not. @since 1.1.0 */ @@ -3025,8 +3063,30 @@ _elua_map_clockwise(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_colour map_object:colour() +@subsubsection map_colour map_object:colour(index, r, g, b, a) +Gets or sets colour information for the map. There are two variations, with or +without the index. With the index parameter it gets (and optionally sets) the +colour of the point the index refers to, without it sets the colour for the +entire map. + +Wraps evas_map_point_color_set() or evas_map_util_points_color_set() + +@param index Which point to change the colour of. +@param r The new red value. +@param g The new green value. +@param b The new blue value. +@param a The new alpha value. + +Note that the arguments are optional, without them this function just queries +the current values. The colour arguments can be separate values, or named +fields in a table. + +@return A table with these fields: + - integer r: The red value. + - integer g: The green value. + - integer b: The blue value. + - integer a: The alpha value. @since 1.1.0 */ @@ -3073,8 +3133,24 @@ _elua_map_colour(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_coord map_object:coord() +@subsubsection map_coord map_object:coord(index, x, y, z) + +Gets (and optionally sets) the 3D coordinates of a point on the map. + +Wraps evas_map_point_coord_set(). + +@param x The x coordinate of the point. +@param y The y coordinate of the point. +@param z The z coordinate of the point. + +Note that the arguments are optional, without them this function just queries +the current values. The coordinate arguments can be separate values, or named +fields in a table. +@return A table with these fields: + - integer x: The x coordinate of the point. + - integer y: The y coordinate of the point. + - integer z: The z coordinate of the point. @since 1.1.0 */ @@ -3104,8 +3180,21 @@ _elua_map_coord(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_lighting map_object:lighting() +@subsubsection map_lighting map_object:lighting(x, y, z, r, g, b, ar, ag, ab) + +Set the 3D lights for the map. The three triplets can be tables. +Wraps evas_map_util_3d_lighting(). + +@param x The x coordinate of the light point. +@param y The y coordinate of the light point. +@param z The z coordinate of the light point. +@param r The new red value of the light point. +@param g The new green value of the light point. +@param b The new blue value of the light point. +@param ar The new red value of the ambient light. +@param ag The new green value of the ambient light. +@param ab The new blue value of the ambient light. @since 1.1.0 */ @@ -3133,8 +3222,18 @@ _elua_map_lighting(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_perspective map_object:perspective() +@subsubsection map_perspective map_object:perspective(x, y, z, f) + +Apply a perspective transform to the map. + +Wraps evas_map_util_3d_perspective(). +The arguments can be separate values, or named fields in a table. + +@param x The perspective distance X coordinate +@param y The perspective distance Y coordinate +@param z The "0" z plane value +@param f The focal distance @since 1.1.0 */ @@ -3156,8 +3255,28 @@ _elua_map_perspective(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_populate map_object:populate() +@subsubsection map_populate map_object:populate(...) + +Populate the points in a map, in one of three different methods. + +1) Wraps evas_map_util_points_populate_from_object(). + +@param source An evas object to copy points from. + +2) Wraps evas_map_util_paints_populate_from_object_full(). + +@param source An evas object to copy points from. +@param z Common Z coordinate hint for all four points. +3) Wraps evas_map_util_points_populate_from_geometry(). + +The first four arguments can be separate values, or named fields in a table. + +@param x Point X coordinate +@param y Point Y coordinate +@param w Width to use to calculate second and third points. +@param h Height to use to calculate third and fourth points. +@param z Common Z coordinate hint for all four points. @since 1.1.0 */ @@ -3210,8 +3329,17 @@ _elua_map_populate(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_rotate map_object:rotate() +@subsubsection map_rotate map_object:rotate(degrees, x, y) + +Rotate the maps coordinates in 2D. +Wraps evas_map_util_rotate(). + +The coordinates can be separate values, or named fields in a table. + +@param degrees Amount of degrees from 0.0 to 360.0 to rotate. +@param x Rotation's centre horizontal position. +@param y Rotation's centre vertical position. @since 1.1.0 */ @@ -3238,8 +3366,21 @@ _elua_map_rotate(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_rotate3d map_object:rotate3d() +@subsubsection map_rotate3d map_object:rotate3d(dx, dy, dz, x, y, z) + +Rotate the maps coordinates in 3D. +Wraps evas_map_util_3d_rotate(). + +The coordinates can be separate values, or named fields in a table. The same +with the rotation. + +@param dx Amount of degrees from 0.0 to 360.0 to rotate around X axis. +@param dy Amount of degrees from 0.0 to 360.0 to rotate around Y axis. +@param dz Amount of degrees from 0.0 to 360.0 to rotate around Z axis. +@param x Rotation's centre horizontal position. +@param y Rotation's centre vertical position. +@param z Rotation's centre vertical position. @since 1.1.0 */ @@ -3265,8 +3406,18 @@ _elua_map_rotate3d(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_smooth map_object:smooth() +@subsubsection map_smooth map_object:smooth(smooth) + +Get (and optionally set) the maps smooth mode. + +Wraps evas_map_smooth_set(). + +@param smooth The smooth mode. + +Note that the argument is optional, without it this function just queries the +current value. +@return A boolean reflecting the smooth mode. @since 1.1.0 */ @@ -3291,8 +3442,23 @@ _elua_map_smooth(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_uv map_object:uv() +@subsubsection map_uv map_object:uv(index, u, v) + +Gets (and optionally sets) the texture U and V texture coordinates for this map. + +Wraps evas_map_point_image_uv_set(). + +@param index Index of the point to change. Must be smaller than map size. +@param u The X coordinate within the image/texture source. +@param v The Y coordinate within the image/texture source. + +Note that the U,V arguments are optional, without them this function just queries +the current values. The coordinate arguments can be separate values, or named +fields in a table. +@return A table with these fields: + - number u: The X coordinate within the image/texture source. + - number v: The Y coordinate within the image/texture source. @since 1.1.0 */ @@ -3322,8 +3488,18 @@ _elua_map_uv(lua_State *L) // Stack usage [ /** @page luaref -@subsubsection map_zoom map_object:zoom() +@subsubsection map_zoom map_object:zoom(x, y, x, y) + +Apply a zoom to the map. + +Wraps evas_map_util_zoom(). +The arguments can be two separate values, or named fields in a table. + +@param x The horizontal zoom amount. +@param y The vertical zoom amount. +@param x The X coordinate of the centre of the zoom. +@param y The Y coordinate of the centre of the zoom. @since 1.1.0 */ @@ -3530,7 +3706,7 @@ _elua_text_font(lua_State *L) // Stack usage [ @page luaref @subsubsection text_text text_object:text(text) -Get (and optionally set) the actual tetx for this text object. +Get (and optionally set) the actual text for this text object. Wraps evas_object_text_text_set(). @@ -3569,25 +3745,80 @@ _elua_text_text(lua_State *L) // Stack usage [ //--------------------------------------------------------------------------// + +// A metatable and functions so that calling non existant API does not crash Lua scripts. + +static int _elua_bogan_nilfunc(lua_State *L); +static int _elua_bogan_index(lua_State *L); + +static const struct luaL_reg _elua_bogan_funcs [] = +{ + {"nilfunc", _elua_bogan_nilfunc}, // Just return a nil. + {"__index", _elua_bogan_index}, // Return the above func. + + {NULL, NULL} // end +}; + +static int +_elua_bogan_nilfunc(lua_State *L) +{ + lua_getglobal(L, "nil"); + return 1; +} + +static int +_elua_bogan_index(lua_State *L) +{ + const char *key; + + key = lua_tostring(L, 2); + LE("%s does not exist!", key); + lua_pushcfunction(L, _elua_bogan_nilfunc); + return 1; +} + +static void +_elua_bogan_protect(lua_State *L) // Stack usage [-3, +3, m] +{ + lua_pushnil(L); // Stack usage [-0, +1, -] + luaL_newmetatable(L, "bogan"); // Stack usage [-0, +1, m] + luaL_register(L, 0, _elua_bogan_funcs); // Stack usage [-1, +1, m] + lua_setmetatable(L, -2); // Stack usage [-1, +0, -] + lua_pop(L, 1); // Stack usage [-1, +0, -] +} + +//--------------------------------------------------------------------------// + // Brain dead inheritance thingy, built for speed. Kinda. Part 1. static void _elua_add_functions(lua_State *L, const char *api, const luaL_Reg *funcs, const char *meta, const char *parent, const char *base) // Stack usage [-3, +5, m] if inheriting [-6, +11, em] { + // Create an api table, fill it full of the methods. luaL_register(L, api, funcs); // Stack usage [-0, +1, m] + // Set the api metatable to the bogan metatable. + luaL_getmetatable(L, "bogan"); // Stack usage [-0, +1, -] + lua_setmetatable(L, -2); // Stack usage [-1, +0, -] + // Creat a meta metatable. luaL_newmetatable(L, meta); // Stack usage [-0, +1, m] + // Put the gc functions in the metatable. luaL_register(L, 0, _elua_edje_gc_funcs); // Stack usage [-1, +1, m] + // Create an __index entry in the metatable, make it point to the api table. lua_pushliteral(L, "__index"); // Stack usage [-0, +1, m] lua_pushvalue(L, -3); // Stack usage [-0, +1, -] lua_rawset(L, -3); // Stack usage [-2, +0, m] + // Later this metatable is used as the metatable for newly created objects of this class. if (base && parent) { // Inherit from base lua_getglobal(L, base); // Stack usage [-0, +1, e] + // Create a new parent metatable. luaL_newmetatable(L, parent); // Stack usage [-0, +1, m] + // Create an __index entry in the metatable, make it point to the base table. lua_pushliteral(L, "__index"); // Stack usage [-0, +1, m] lua_pushvalue(L, -3); // Stack usage [-0, +1, -] lua_rawset(L, -3); // Stack usage [-2, +0, m] + // Set the metatable for the api table to the parent metatable. lua_getglobal(L, api); // Stack usage [-0, +1, e] luaL_getmetatable(L, parent); // Stack usage [-0, +1, -] lua_setmetatable(L, -2); // Stack usage [-1, +0, -] @@ -3695,7 +3926,11 @@ _edje_lua2_script_init(Edje *ed) // Stack usage lua_call(L, 1, 0); // Stack usage [-2, +0, m] } + _elua_bogan_protect(L); // Stack usage [+3, -3, m] + luaL_register(L, _elua_edje_api, _elua_edje_funcs); // Stack usage [-0, +1, m] + luaL_getmetatable(L, "bogan"); // Stack usage [-0, +1, -] + lua_setmetatable(L, -2); // Stack usage [-1, +0, -] luaL_newmetatable(L, _elua_edje_meta); // Stack usage [-0, +1, m] luaL_register(L, 0, _elua_edje_gc_funcs); // Stack usage [-1, +1, m] @@ -3737,6 +3972,8 @@ _edje_lua2_script_init(Edje *ed) // Stack usage { int err; + /* This ends up pushing a function onto the stack for the lua_pcall() below to use. + * The function is the compiled code. */ err = luaL_loadbuffer(L, data, size, "edje_lua_script"); // Stack usage [-0, +1, m] if (err) { diff --git a/libraries/edje/src/lib/edje_main.c b/libraries/edje/src/lib/edje_main.c index cf443c7..5d011ad 100644 --- a/libraries/edje/src/lib/edje_main.c +++ b/libraries/edje/src/lib/edje_main.c @@ -22,10 +22,7 @@ edje_init(void) srand(time(NULL)); if (!eina_init()) - { - fprintf(stderr, "Edje: Eina init failed"); - return --_edje_init_count; - } + return --_edje_init_count; _edje_default_log_dom = eina_log_domain_register ("edje", EDJE_DEFAULT_LOG_COLOR); diff --git a/libraries/edje/src/lib/edje_message_queue.c b/libraries/edje/src/lib/edje_message_queue.c index 1a313a5..5628ccc 100644 --- a/libraries/edje/src/lib/edje_message_queue.c +++ b/libraries/edje/src/lib/edje_message_queue.c @@ -364,8 +364,8 @@ _edje_message_propornot_send(Edje *ed, Edje_Queue queue, Edje_Message_Type type, } if (_injob > 0) { - if (_job_loss_timer) ecore_timer_del(_job_loss_timer); - _job_loss_timer = ecore_timer_add(0.001, _edje_job_loss_timer, NULL); + if (!_job_loss_timer) + _job_loss_timer = ecore_timer_add(0.001, _edje_job_loss_timer, NULL); } else { diff --git a/libraries/edje/src/lib/edje_module.c b/libraries/edje/src/lib/edje_module.c index effcee1..358295b 100644 --- a/libraries/edje/src/lib/edje_module.c +++ b/libraries/edje/src/lib/edje_module.c @@ -136,12 +136,12 @@ edje_available_modules_get(void) snprintf(tmp, sizeof (tmp), "%s/%s/" EDJE_MODULE_NAME, info->path, MODULE_ARCH #ifdef EDJE_EXTRA_MODULE_NAME - , ecore_file_file_get(info->path) + , info->path + info->name_start #endif ); if (ecore_file_exists(tmp)) - result = eina_list_append(result, eina_stringshare_add(ecore_file_file_get(info->path))); + result = eina_list_append(result, eina_stringshare_add(info->path + info->name_start)); } eina_iterator_free(it); diff --git a/libraries/edje/src/lib/edje_multisense.c b/libraries/edje/src/lib/edje_multisense.c index f9c7f91..f3324e7 100644 --- a/libraries/edje/src/lib/edje_multisense.c +++ b/libraries/edje/src/lib/edje_multisense.c @@ -351,8 +351,10 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, c command.type.sample.speed = speed; size = write(command_pipe[1], &command, sizeof(command)); #else - ed = NULL; // warning shh - if (speed > 0) sample_name = NULL; // warning shh + // warning shh + (void) ed; + (void) sample_name; + (void) speed; #endif return (size == sizeof(Edje_Multisense_Sound_Action)); } @@ -371,8 +373,10 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const command.type.tone.duration = duration; size = write(command_pipe[1], &command, sizeof(command)); #else - ed = NULL; // warning shh - if (duration > 0) tone_name = NULL; // warning shh + // warning shh + (void) ed; + (void) duration; + (void) tone_name; #endif return (size == sizeof(Edje_Multisense_Sound_Action)); diff --git a/libraries/edje/src/lib/edje_private.h b/libraries/edje/src/lib/edje_private.h index cbb3e03..8bf18eb 100644 --- a/libraries/edje/src/lib/edje_private.h +++ b/libraries/edje/src/lib/edje_private.h @@ -192,7 +192,8 @@ typedef enum EDJE_ASPECT_PREFER_NONE, EDJE_ASPECT_PREFER_VERTICAL, EDJE_ASPECT_PREFER_HORIZONTAL, - EDJE_ASPECT_PREFER_BOTH + EDJE_ASPECT_PREFER_BOTH, + EDJE_ASPECT_PREFER_SOURCE } Edje_Internal_Aspect; struct _Edje_Perspective @@ -232,7 +233,7 @@ struct _Edje_Color struct _Edje_Aspect_Prefer { FLOAT_T min, max; - Edje_Internal_Aspect prefer; + char prefer; }; struct _Edje_Aspect @@ -834,6 +835,11 @@ struct _Edje_Part_Description_Common unsigned char w, h; /* width or height is fixed in side (cannot expand with Edje object size) */ } fixed; + struct { // only during recalc + unsigned char have; + FLOAT_T w, h; + } minmul; + Edje_Size min, max; Edje_Position step; /* size stepping by n pixels, 0 = none */ Edje_Aspect_Prefer aspect; @@ -1138,6 +1144,7 @@ struct _Edje unsigned int all_part_change : 1; #endif unsigned int have_mapped_part : 1; + unsigned int recalc_call : 1; }; struct _Edje_Calc_Params @@ -1915,7 +1922,7 @@ void _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur); Eina_Bool _edje_entry_cursor_coord_set(Edje_Real_Part *rp, Edje_Cursor cur, int x, int y); Eina_Bool _edje_entry_cursor_is_format_get(Edje_Real_Part *rp, Edje_Cursor cur); Eina_Bool _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur); -const char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); +char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos); int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur); void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout); diff --git a/libraries/edje/src/lib/edje_program.c b/libraries/edje/src/lib/edje_program.c index 505b6a2..d80c7c9 100644 --- a/libraries/edje/src/lib/edje_program.c +++ b/libraries/edje/src/lib/edje_program.c @@ -992,7 +992,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f break ; default: - fprintf(stderr, "SPANK SPANK SPANK !!!\nYou should never be here !\n"); + ERR("SPANK SPANK SPANK !!!\nYou should never be here !"); break; } } @@ -1621,6 +1621,7 @@ _edje_param_native_set(Edje_Real_Part *rp, const char *name, const Edje_External if (param->type != EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) return EINA_FALSE; rp->drag->size.x = FROM_DOUBLE(CLAMP(param->d, 0.0, 1.0)); + rp->edje->recalc_call = 1; rp->edje->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; @@ -1633,6 +1634,7 @@ _edje_param_native_set(Edje_Real_Part *rp, const char *name, const Edje_External if (param->type != EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) return EINA_FALSE; rp->drag->size.y = FROM_DOUBLE(CLAMP(param->d, 0.0, 1.0)); + rp->edje->recalc_call = 1; rp->edje->dirty = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; diff --git a/libraries/edje/src/lib/edje_util.c b/libraries/edje/src/lib/edje_util.c index dbb37a7..2205ba3 100644 --- a/libraries/edje/src/lib/edje_util.c +++ b/libraries/edje/src/lib/edje_util.c @@ -438,6 +438,7 @@ edje_color_class_set(const char *color_class, int r, int g, int b, int a, int r2 ed = eina_list_data_get(members); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -504,6 +505,7 @@ edje_color_class_del(const char *color_class) ed = eina_list_data_get(members); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -583,6 +585,7 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in cc->b3 = b3; cc->a3 = a3; ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -611,6 +614,7 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in cc->a3 = a3; ed->color_classes = eina_list_append(ed->color_classes, cc); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -693,6 +697,7 @@ edje_object_color_class_del(Evas_Object *obj, const char *color_class) } ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->all_part_change = 1; #endif @@ -752,6 +757,7 @@ edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size siz ed = eina_list_data_get(members); ed->dirty = 1; + ed->recalc_call = 1; _edje_textblock_style_all_update(ed); #ifdef EDJE_CALC_CACHE ed->text_part_change = 1; @@ -847,6 +853,7 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char /* Update edje */ ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->text_part_change = 1; #endif @@ -881,6 +888,7 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char /* Add to edje's text class list */ ed->text_classes = eina_list_append(ed->text_classes, tc); ed->dirty = 1; + ed->recalc_call = 1; #ifdef EDJE_CALC_CACHE ed->text_part_change = 1; #endif @@ -1005,6 +1013,7 @@ _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char else if (text) rp->text.text = eina_stringshare_add(text); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -1039,6 +1048,7 @@ _edje_object_part_text_raw_append(Evas_Object *obj, Edje_Real_Part *rp, const ch } } rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -1307,6 +1317,7 @@ edje_object_part_text_insert(Evas_Object *obj, const char *part, const char *tex if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return; _edje_entry_text_markup_insert(rp, text); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -1328,6 +1339,7 @@ edje_object_part_text_append(Evas_Object *obj, const char *part, const char *tex if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; _edje_object_part_text_raw_append(obj, rp, part, text); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -1675,7 +1687,7 @@ edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const return 0; } -EAPI const char * +EAPI char * edje_object_part_text_cursor_content_get(const Evas_Object *obj, const char *part, Edje_Cursor cur) { Edje *ed; @@ -1908,6 +1920,13 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw // XXX: by Sachiel, January 21th 2009, 19:30 UTC _edje_recalc_do(ed); + rp = evas_object_data_get(obj_swallow, "\377 edje.swallowing_part"); + if (rp) + { + /* The object is already swallowed somewhere, unswallow it first */ + edje_object_part_unswallow(rp->edje->obj, obj_swallow); + } + rp = _edje_real_part_recursive_get(ed, (char *)part); if (!rp) return EINA_FALSE; if (rp->part->type != EDJE_PART_TYPE_SWALLOW) @@ -1929,6 +1948,7 @@ _recalc_extern_parent(Evas_Object *obj) ed = _edje_fetch(parent); ed->dirty = 1; + ed->recalc_call = 1; // ZZZ: ??? _edje_recalc(ed); } @@ -2110,11 +2130,7 @@ _edje_box_layout_external_new(const char *name, Evas_Object_Box_Layout func, voi name_len = strlen(name) + 1; l = malloc(sizeof(Edje_Box_Layout) + name_len); - if (!l) - { - perror("malloc"); - return NULL; - } + if (!l) return NULL; l->func = func; l->layout_data_get = layout_data_get; @@ -2224,6 +2240,7 @@ edje_object_part_unswallow(Evas_Object *obj __UNUSED__, Evas_Object *obj_swallow rp->swallow_params.max.w = 0; rp->swallow_params.max.h = 0; rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -2684,6 +2701,7 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do rp->drag->size.x = FROM_DOUBLE(dw); rp->drag->size.y = FROM_DOUBLE(dh); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3018,6 +3036,7 @@ _edje_box_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UNUS Edje_Real_Part *rp = data; rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3031,6 +3050,7 @@ _edje_box_child_add(Edje_Real_Part *rp, Evas_Object *child) (child, EVAS_CALLBACK_DEL, _edje_box_child_del_cb, rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3044,6 +3064,7 @@ _edje_box_child_remove(Edje_Real_Part *rp, Evas_Object *child) (child, EVAS_CALLBACK_DEL, _edje_box_child_del_cb, rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3186,6 +3207,7 @@ _edje_table_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UN Edje_Real_Part *rp = data; rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3199,6 +3221,7 @@ _edje_table_child_add(Edje_Real_Part *rp, Evas_Object *child) (child, EVAS_CALLBACK_DEL, _edje_table_child_del_cb, rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3212,6 +3235,7 @@ _edje_table_child_remove(Edje_Real_Part *rp, Evas_Object *child) (child, EVAS_CALLBACK_DEL, _edje_table_child_del_cb, rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; #ifdef EDJE_CALC_CACHE rp->invalidate = 1; #endif @@ -3314,6 +3338,7 @@ _edje_perspective_obj_del(void *data, __UNUSED__ Evas *e, __UNUSED__ Evas_Object if (!ed) continue; ed->persp = NULL; ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } free(ps); @@ -3367,6 +3392,7 @@ edje_perspective_set(Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Co if (!ed->persp) { ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } } @@ -3381,6 +3407,7 @@ edje_perspective_set(Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Co if (!ed->persp) { ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } } @@ -3414,6 +3441,7 @@ edje_perspective_global_set(Edje_Perspective *ps, Eina_Bool global) if (!ed->persp) { ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } } @@ -3453,6 +3481,7 @@ edje_object_perspective_set(Evas_Object *obj, Edje_Perspective *ps) ed->persp = ps; if (ps) ps->users = eina_list_append(ps->users, obj); ed->dirty = 1; + ed->recalc_call = 1; _edje_recalc_do(ed); } @@ -4075,6 +4104,7 @@ _edje_object_part_swallow_changed_hints_cb(void *data, __UNUSED__ Evas *e, __UNU rp = data; _edje_real_part_swallow_hints_update(rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; _edje_recalc(rp->edje); return; } @@ -4096,6 +4126,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, if (hints_update) _edje_real_part_swallow_hints_update(rp); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; _edje_recalc(rp->edje); return; } @@ -4139,6 +4170,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, evas_object_precise_is_inside_set(obj_swallow, 1); rp->edje->dirty = 1; + rp->edje->recalc_call = 1; _edje_recalc(rp->edje); } -- cgit v1.1