diff options
Diffstat (limited to 'libraries/edje/src/lib')
-rw-r--r-- | libraries/edje/src/lib/Edje.h | 40 | ||||
-rw-r--r-- | libraries/edje/src/lib/Makefile.in | 2 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_cache.c | 13 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_calc.c | 447 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_callbacks.c | 5 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_data.c | 3 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_edit.c | 131 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_embryo.c | 2 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_entry.c | 350 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_load.c | 151 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_lua2.c | 269 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_main.c | 5 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_message_queue.c | 4 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_module.c | 4 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_multisense.c | 12 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_private.h | 13 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_program.c | 4 | ||||
-rw-r--r-- | libraries/edje/src/lib/edje_util.c | 44 |
18 files changed, 958 insertions, 541 deletions
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: | |||
377 | @author Sebastian Dransfeld <sd@@tango.flipp.net> | 377 | @author Sebastian Dransfeld <sd@@tango.flipp.net> |
378 | @author Tom Hacohen <tom@@stosb.com> | 378 | @author Tom Hacohen <tom@@stosb.com> |
379 | @author Aharon Hillel <a.hillel@@partner.samsung.com> | 379 | @author Aharon Hillel <a.hillel@@partner.samsung.com> |
380 | @author Shilpa Singh <shilpa.singh@samsung.com> <shilpasingh.o@gmail.com> | ||
381 | @author Mike Blumenkrantz <michael.blumenkrantz@gmail.com | ||
382 | @author Jaehwan Kim <jae.hwan.kim@samsung.com> | ||
383 | @author billiob (Boris Faure) <billiob@gmail.com> | ||
384 | @author Govindaraju SM <govi.sm@samsung.com> <govism@gmail.com> | ||
385 | @author Prince Kumar Dubey <prince.dubey@samsung.com> <prince.dubey@gmail.com> | ||
386 | @author David Seikel <onefang at gmail.com> | ||
380 | 387 | ||
381 | Please contact <enlightenment-devel@lists.sourceforge.net> to get in | 388 | Please contact <enlightenment-devel@lists.sourceforge.net> to get in |
382 | contact with the developers and maintainers. | 389 | contact with the developers and maintainers. |
@@ -472,7 +479,7 @@ extern "C" { | |||
472 | #endif | 479 | #endif |
473 | 480 | ||
474 | #define EDJE_VERSION_MAJOR 1 | 481 | #define EDJE_VERSION_MAJOR 1 |
475 | #define EDJE_VERSION_MINOR 0 | 482 | #define EDJE_VERSION_MINOR 2 |
476 | 483 | ||
477 | typedef struct _Edje_Version | 484 | typedef struct _Edje_Version |
478 | { | 485 | { |
@@ -794,7 +801,7 @@ typedef enum _Edje_External_Param_Flags | |||
794 | EDJE_EXTERNAL_PARAM_FLAGS_STATE) /**< Convenience flag that sets property as GET, SET and STATE. */ | 801 | EDJE_EXTERNAL_PARAM_FLAGS_STATE) /**< Convenience flag that sets property as GET, SET and STATE. */ |
795 | } Edje_External_Param_Flags; | 802 | } Edje_External_Param_Flags; |
796 | 803 | ||
797 | typedef enum | 804 | typedef enum _Edje_Input_Panel_Layout |
798 | { | 805 | { |
799 | EDJE_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */ | 806 | EDJE_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */ |
800 | EDJE_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */ | 807 | EDJE_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */ |
@@ -804,7 +811,10 @@ typedef enum | |||
804 | EDJE_INPUT_PANEL_LAYOUT_IP, /**< IP layout */ | 811 | EDJE_INPUT_PANEL_LAYOUT_IP, /**< IP layout */ |
805 | EDJE_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */ | 812 | EDJE_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */ |
806 | EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ | 813 | EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ |
807 | EDJE_INPUT_PANEL_LAYOUT_INVALID | 814 | EDJE_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this */ |
815 | EDJE_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout @since 1.2 */ | ||
816 | EDJE_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout @since 1.2 */ | ||
817 | EDJE_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */ | ||
808 | } Edje_Input_Panel_Layout; | 818 | } Edje_Input_Panel_Layout; |
809 | 819 | ||
810 | /** | 820 | /** |
@@ -1650,8 +1660,21 @@ EAPI void edje_box_layout_register (const char *name, Evas_Object | |||
1650 | * } | 1660 | * } |
1651 | * | 1661 | * |
1652 | * @endcode | 1662 | * @endcode |
1663 | * | ||
1664 | * @note You can get a callback every time edje re-calculates the object | ||
1665 | * (either due to animation or some kind of signal or input). This is called | ||
1666 | * in-line just after the recalculation has occured. It is a good idea not | ||
1667 | * to go and delete or alter the object inside this callbacks, simply make | ||
1668 | * a note that the recalculation has taken place and then do somethnig about | ||
1669 | * it outside the callback. to register a callback use code like: | ||
1670 | * | ||
1671 | * @code | ||
1672 | * evas_object_smart_callback_add(edje_obj, "recalc", my_cb, my_cb_data); | ||
1673 | * @endcode | ||
1674 | * | ||
1675 | * @see evas_object_smart_callback_add() | ||
1653 | * | 1676 | * |
1654 | * @note before creating the first Edje object in your code, remember | 1677 | * @note Before creating the first Edje object in your code, remember |
1655 | * to initialize the library, with edje_init(), or unexpected behavior | 1678 | * to initialize the library, with edje_init(), or unexpected behavior |
1656 | * might occur. | 1679 | * might occur. |
1657 | */ | 1680 | */ |
@@ -2757,12 +2780,15 @@ EAPI Eina_Bool edje_object_part_text_cursor_is_visible_format_get(const E | |||
2757 | /** | 2780 | /** |
2758 | * @brief Returns the content (char) at the cursor position. | 2781 | * @brief Returns the content (char) at the cursor position. |
2759 | * @see evas_textblock_cursor_content_get | 2782 | * @see evas_textblock_cursor_content_get |
2783 | * | ||
2784 | * You must free the return (if not NULL) after you are done with it. | ||
2760 | * | 2785 | * |
2761 | * @param obj A valid Evas_Object handle | 2786 | * @param obj A valid Evas_Object handle |
2762 | * @param part The part name | 2787 | * @param part The part name |
2763 | * @param cur The cursor to use | 2788 | * @param cur The cursor to use |
2789 | * @return The character string pointed to (may be a multi-byte utf8 sequence) terminated by a nul byte. | ||
2764 | */ | 2790 | */ |
2765 | EAPI const char *edje_object_part_text_cursor_content_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); | 2791 | EAPI char *edje_object_part_text_cursor_content_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); |
2766 | 2792 | ||
2767 | /** | 2793 | /** |
2768 | * @brief Sets the cursor position to the given value | 2794 | * @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 | |||
2941 | * | 2967 | * |
2942 | * Causes the edje to regurgitate a previously swallowed object. :) | 2968 | * Causes the edje to regurgitate a previously swallowed object. :) |
2943 | * | 2969 | * |
2944 | * @note @p obj_swallow will @b not be deleted. | 2970 | * @note @p obj_swallow will @b not be deleted or hidden. |
2971 | * @note @p obj_swallow may appear shown on the evas depending on its state when | ||
2972 | * it got unswallowed. Make sure you delete it or hide it if you do not want it to. | ||
2945 | */ | 2973 | */ |
2946 | EAPI void edje_object_part_unswallow (Evas_Object *obj, Evas_Object *obj_swallow); | 2974 | EAPI void edje_object_part_unswallow (Evas_Object *obj, Evas_Object *obj_swallow); |
2947 | 2975 | ||
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@ | |||
230 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 230 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
231 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 231 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
232 | PKG_CONFIG = @PKG_CONFIG@ | 232 | PKG_CONFIG = @PKG_CONFIG@ |
233 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
234 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
235 | PYTHON = @PYTHON@ | 233 | PYTHON = @PYTHON@ |
236 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 234 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
237 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 235 | 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) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | static Edje_File * | 130 | static Edje_File * |
131 | _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret) | 131 | _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, time_t mtime) |
132 | { | 132 | { |
133 | Edje_File *edf; | 133 | Edje_File *edf; |
134 | Edje_Part_Collection *edc; | 134 | Edje_Part_Collection *edc; |
135 | Eet_File *ef; | 135 | Eet_File *ef; |
136 | struct stat st; | ||
137 | |||
138 | if (stat(file, &st) != 0) | ||
139 | { | ||
140 | *error_ret = EDJE_LOAD_ERROR_DOES_NOT_EXIST; | ||
141 | return NULL; | ||
142 | } | ||
143 | 136 | ||
144 | ef = eet_open(file, EET_FILE_MODE_READ); | 137 | ef = eet_open(file, EET_FILE_MODE_READ); |
145 | if (!ef) | 138 | if (!ef) |
@@ -156,7 +149,7 @@ _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Co | |||
156 | } | 149 | } |
157 | 150 | ||
158 | edf->ef = ef; | 151 | edf->ef = ef; |
159 | edf->mtime = st.st_mtime; | 152 | edf->mtime = mtime; |
160 | 153 | ||
161 | if (edf->version != EDJE_FILE_VERSION) | 154 | if (edf->version != EDJE_FILE_VERSION) |
162 | { | 155 | { |
@@ -262,7 +255,7 @@ open_new: | |||
262 | if (!_edje_file_hash) | 255 | if (!_edje_file_hash) |
263 | _edje_file_hash = eina_hash_string_small_new(NULL); | 256 | _edje_file_hash = eina_hash_string_small_new(NULL); |
264 | 257 | ||
265 | edf = _edje_file_open(file, coll, error_ret, edc_ret); | 258 | edf = _edje_file_open(file, coll, error_ret, edc_ret, st.st_mtime); |
266 | if (!edf) | 259 | if (!edf) |
267 | return NULL; | 260 | return NULL; |
268 | 261 | ||
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, | |||
8 | Edje_Real_Part *center, Edje_Real_Part *light, Edje_Real_Part *persp, | 8 | Edje_Real_Part *center, Edje_Real_Part *light, Edje_Real_Part *persp, |
9 | Edje_Real_Part *rel1_to_x, Edje_Real_Part *rel1_to_y, | 9 | Edje_Real_Part *rel1_to_x, Edje_Real_Part *rel1_to_y, |
10 | Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y, | 10 | Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y, |
11 | Edje_Real_Part *confine_to, Edje_Calc_Params *params); | 11 | Edje_Real_Part *confine_to, Edje_Calc_Params *params, |
12 | FLOAT_T pos); | ||
12 | 13 | ||
13 | void | 14 | void |
14 | _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2) | 15 | _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 | |||
115 | ep->description_pos = npos; | 116 | ep->description_pos = npos; |
116 | 117 | ||
117 | ed->dirty = 1; | 118 | ed->dirty = 1; |
119 | ed->recalc_call = 1; | ||
118 | #ifdef EDJE_CALC_CACHE | 120 | #ifdef EDJE_CALC_CACHE |
119 | ep->invalidate = 1; | 121 | ep->invalidate = 1; |
120 | #endif | 122 | #endif |
@@ -304,6 +306,179 @@ _edje_part_description_find(Edje *ed, Edje_Real_Part *rp, const char *name, | |||
304 | return ret; | 306 | return ret; |
305 | } | 307 | } |
306 | 308 | ||
309 | static int | ||
310 | _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, Edje_Part_Description_Image *st, Edje_Part_Image_Id *imid) | ||
311 | { | ||
312 | Edje_Image_Directory_Set_Entry *entry; | ||
313 | Edje_Image_Directory_Set *set = NULL; | ||
314 | Eina_List *l; | ||
315 | int w = 0; | ||
316 | int h = 0; | ||
317 | int id; | ||
318 | |||
319 | if (!st && !imid) | ||
320 | return -1; | ||
321 | |||
322 | if (st && !st->image.set) | ||
323 | return st->image.id; | ||
324 | |||
325 | if (imid && !imid->set) | ||
326 | return imid->id; | ||
327 | |||
328 | if (imid) | ||
329 | id = imid->id; | ||
330 | else | ||
331 | id = st->image.id; | ||
332 | |||
333 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); | ||
334 | |||
335 | if (eps && *eps) | ||
336 | { | ||
337 | if ((*eps)->id == id) | ||
338 | set = (*eps)->set; | ||
339 | |||
340 | if (set) | ||
341 | if ((*eps)->entry->size.min.w <= w && w <= (*eps)->entry->size.max.w) | ||
342 | if ((*eps)->entry->size.min.h <= h && h <= (*eps)->entry->size.max.h) | ||
343 | return (*eps)->entry->id; | ||
344 | } | ||
345 | |||
346 | if (!set) | ||
347 | set = ed->file->image_dir->sets + id; | ||
348 | |||
349 | EINA_LIST_FOREACH(set->entries, l, entry) | ||
350 | { | ||
351 | if (entry->size.min.w <= w && w <= entry->size.max.w) | ||
352 | if (entry->size.min.h <= h && h <= entry->size.max.h) | ||
353 | { | ||
354 | if (eps) | ||
355 | { | ||
356 | if (!*eps) | ||
357 | *eps = calloc(1, sizeof (Edje_Real_Part_Set)); | ||
358 | |||
359 | if (*eps) | ||
360 | { | ||
361 | (*eps)->entry = entry; | ||
362 | (*eps)->set = set; | ||
363 | (*eps)->id = id; | ||
364 | } | ||
365 | } | ||
366 | return entry->id; | ||
367 | } | ||
368 | } | ||
369 | |||
370 | return -1; | ||
371 | } | ||
372 | |||
373 | static void | ||
374 | _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T pos) | ||
375 | { | ||
376 | int image_id; | ||
377 | int image_count, image_num; | ||
378 | |||
379 | image_id = _edje_image_find(ep->object, ed, | ||
380 | &ep->param1.set, | ||
381 | (Edje_Part_Description_Image*) ep->param1.description, | ||
382 | NULL); | ||
383 | if (image_id < 0) | ||
384 | { | ||
385 | Edje_Image_Directory_Entry *ie; | ||
386 | |||
387 | if (!ed->file->image_dir) ie = NULL; | ||
388 | else ie = ed->file->image_dir->entries + (-image_id) - 1; | ||
389 | if ((ie) && | ||
390 | (ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) && | ||
391 | (ie->entry)) | ||
392 | { | ||
393 | evas_object_image_file_set(ep->object, ie->entry, NULL); | ||
394 | } | ||
395 | } | ||
396 | else | ||
397 | { | ||
398 | image_count = 2; | ||
399 | if (ep->param2) | ||
400 | image_count += ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens_count; | ||
401 | image_num = TO_INT(MUL(pos, SUB(FROM_INT(image_count), | ||
402 | FROM_DOUBLE(0.5)))); | ||
403 | if (image_num > (image_count - 1)) | ||
404 | image_num = image_count - 1; | ||
405 | if (image_num == 0) | ||
406 | { | ||
407 | image_id = _edje_image_find(ep->object, ed, | ||
408 | &ep->param1.set, | ||
409 | (Edje_Part_Description_Image*) ep->param1.description, | ||
410 | NULL); | ||
411 | } | ||
412 | else | ||
413 | if (ep->param2) | ||
414 | { | ||
415 | if (image_num == (image_count - 1)) | ||
416 | { | ||
417 | image_id = _edje_image_find(ep->object, ed, | ||
418 | &ep->param2->set, | ||
419 | (Edje_Part_Description_Image*) ep->param2->description, | ||
420 | NULL); | ||
421 | } | ||
422 | else | ||
423 | { | ||
424 | Edje_Part_Image_Id *imid; | ||
425 | |||
426 | imid = ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens[image_num - 1]; | ||
427 | image_id = _edje_image_find(ep->object, ed, NULL, NULL, imid); | ||
428 | } | ||
429 | } | ||
430 | if (image_id < 0) | ||
431 | { | ||
432 | ERR("¨Part \"%s\" has description, " | ||
433 | "\"%s\" %3.3f with a missing image id!!!", | ||
434 | ep->part->name, | ||
435 | ep->param1.description->state.name, | ||
436 | ep->param1.description->state.value); | ||
437 | } | ||
438 | else | ||
439 | { | ||
440 | char buf[1024]; | ||
441 | |||
442 | /* Replace snprint("edje/images/%i") == memcpy + itoa */ | ||
443 | #define IMAGES "edje/images/" | ||
444 | memcpy(buf, IMAGES, strlen(IMAGES)); | ||
445 | eina_convert_itoa(image_id, buf + strlen(IMAGES)); /* No need to check length as 2³² need only 10 characteres. */ | ||
446 | |||
447 | evas_object_image_file_set(ep->object, ed->file->path, buf); | ||
448 | if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE) | ||
449 | { | ||
450 | ERR("Error loading image collection \"%s\" from " | ||
451 | "file \"%s\". Missing EET Evas loader module?", | ||
452 | buf, ed->file->path); | ||
453 | switch (evas_object_image_load_error_get(ep->object)) | ||
454 | { | ||
455 | case EVAS_LOAD_ERROR_GENERIC: | ||
456 | ERR("Error type: EVAS_LOAD_ERROR_GENERIC"); | ||
457 | break; | ||
458 | case EVAS_LOAD_ERROR_DOES_NOT_EXIST: | ||
459 | ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST"); | ||
460 | break; | ||
461 | case EVAS_LOAD_ERROR_PERMISSION_DENIED: | ||
462 | ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED"); | ||
463 | break; | ||
464 | case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: | ||
465 | ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED"); | ||
466 | break; | ||
467 | case EVAS_LOAD_ERROR_CORRUPT_FILE: | ||
468 | ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE"); | ||
469 | break; | ||
470 | case EVAS_LOAD_ERROR_UNKNOWN_FORMAT: | ||
471 | ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT"); | ||
472 | break; | ||
473 | default: | ||
474 | ERR("Error type: ???"); | ||
475 | break; | ||
476 | } | ||
477 | } | ||
478 | } | ||
479 | } | ||
480 | } | ||
481 | |||
307 | static void | 482 | static void |
308 | _edje_real_part_rel_to_apply(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_State *state) | 483 | _edje_real_part_rel_to_apply(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_State *state) |
309 | { | 484 | { |
@@ -398,6 +573,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
398 | _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); | 573 | _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); |
399 | 574 | ||
400 | ed->dirty = 1; | 575 | ed->dirty = 1; |
576 | ed->recalc_call = 1; | ||
401 | #ifdef EDJE_CALC_CACHE | 577 | #ifdef EDJE_CALC_CACHE |
402 | ep->invalidate = 1; | 578 | ep->invalidate = 1; |
403 | #endif | 579 | #endif |
@@ -423,17 +599,23 @@ _edje_recalc(Edje *ed) | |||
423 | return; | 599 | return; |
424 | } | 600 | } |
425 | } | 601 | } |
426 | if (ed->postponed) return; | 602 | // XXX: dont need this with current smart calc infra. remove me later |
427 | evas_object_smart_changed(ed->obj); | 603 | // if (ed->postponed) return; |
428 | ed->postponed = 1; | 604 | // if (!ed->calc_only) |
605 | evas_object_smart_changed(ed->obj); | ||
606 | // XXX: dont need this with current smart calc infra. remove me later | ||
607 | // ed->postponed = 1; | ||
429 | } | 608 | } |
430 | 609 | ||
431 | void | 610 | void |
432 | _edje_recalc_do(Edje *ed) | 611 | _edje_recalc_do(Edje *ed) |
433 | { | 612 | { |
434 | unsigned int i; | 613 | unsigned int i; |
614 | Eina_Bool need_calc; | ||
435 | 615 | ||
436 | ed->postponed = 0; | 616 | // XXX: dont need this with current smart calc infra. remove me later |
617 | // ed->postponed = 0; | ||
618 | need_calc = evas_object_smart_need_recalculate_get(ed->obj); | ||
437 | evas_object_smart_need_recalculate_set(ed->obj, 0); | 619 | evas_object_smart_need_recalculate_set(ed->obj, 0); |
438 | if (!ed->dirty) return; | 620 | if (!ed->dirty) return; |
439 | ed->have_mapped_part = 0; | 621 | ed->have_mapped_part = 0; |
@@ -460,6 +642,14 @@ _edje_recalc_do(Edje *ed) | |||
460 | ed->all_part_change = 0; | 642 | ed->all_part_change = 0; |
461 | ed->text_part_change = 0; | 643 | ed->text_part_change = 0; |
462 | #endif | 644 | #endif |
645 | if (!ed->calc_only) | ||
646 | { | ||
647 | if (ed->recalc_call) | ||
648 | evas_object_smart_callback_call(ed->obj, "recalc", NULL); | ||
649 | } | ||
650 | else | ||
651 | evas_object_smart_need_recalculate_set(ed->obj, need_calc); | ||
652 | ed->recalc_call = 0; | ||
463 | } | 653 | } |
464 | 654 | ||
465 | void | 655 | void |
@@ -527,6 +717,7 @@ _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y) | |||
527 | ep->drag->tmp.x = 0; | 717 | ep->drag->tmp.x = 0; |
528 | ep->drag->need_reset = 0; | 718 | ep->drag->need_reset = 0; |
529 | ed->dirty = 1; | 719 | ed->dirty = 1; |
720 | ed->recalc_call = 1; | ||
530 | } | 721 | } |
531 | 722 | ||
532 | if (ep->drag->y != y || ep->drag->tmp.y) | 723 | 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) | |||
535 | ep->drag->tmp.y = 0; | 726 | ep->drag->tmp.y = 0; |
536 | ep->drag->need_reset = 0; | 727 | ep->drag->need_reset = 0; |
537 | ed->dirty = 1; | 728 | ed->dirty = 1; |
729 | ed->recalc_call = 1; | ||
538 | } | 730 | } |
539 | 731 | ||
540 | #ifdef EDJE_CALC_CACHE | 732 | #ifdef EDJE_CALC_CACHE |
@@ -598,11 +790,13 @@ _edje_part_recalc_single_rel(Edje *ed, | |||
598 | } | 790 | } |
599 | 791 | ||
600 | static Edje_Internal_Aspect | 792 | static Edje_Internal_Aspect |
601 | _edje_part_recalc_single_aspect(Edje_Real_Part *ep, | 793 | _edje_part_recalc_single_aspect(Edje *ed, |
794 | Edje_Real_Part *ep, | ||
602 | Edje_Part_Description_Common *desc, | 795 | Edje_Part_Description_Common *desc, |
603 | Edje_Calc_Params *params, | 796 | Edje_Calc_Params *params, |
604 | int *minw, int *minh, | 797 | int *minw, int *minh, |
605 | int *maxw, int *maxh) | 798 | int *maxw, int *maxh, |
799 | FLOAT_T pos) | ||
606 | { | 800 | { |
607 | Edje_Internal_Aspect apref = EDJE_ASPECT_PREFER_NONE; | 801 | Edje_Internal_Aspect apref = EDJE_ASPECT_PREFER_NONE; |
608 | FLOAT_T aspect, amax, amin; | 802 | FLOAT_T aspect, amax, amin; |
@@ -612,6 +806,17 @@ _edje_part_recalc_single_aspect(Edje_Real_Part *ep, | |||
612 | else aspect = DIV(FROM_INT(params->w), FROM_INT(params->h)); | 806 | else aspect = DIV(FROM_INT(params->w), FROM_INT(params->h)); |
613 | amax = desc->aspect.max; | 807 | amax = desc->aspect.max; |
614 | amin = desc->aspect.min; | 808 | amin = desc->aspect.min; |
809 | if (desc->aspect.prefer == EDJE_ASPECT_PREFER_SOURCE && | ||
810 | ep->part->type == EDJE_PART_TYPE_IMAGE) | ||
811 | { | ||
812 | Evas_Coord w, h; | ||
813 | |||
814 | /* We only need pose to find the right image that would be displayed, | ||
815 | and the right aspect ratio in that case */ | ||
816 | _edje_real_part_image_set(ed, ep, pos); | ||
817 | evas_object_image_size_get(ep->object, &w, &h); | ||
818 | amin = amax = DIV(FROM_INT(w), FROM_INT(h)); | ||
819 | } | ||
615 | if ((ep->swallow_params.aspect.w > 0) && | 820 | if ((ep->swallow_params.aspect.w > 0) && |
616 | (ep->swallow_params.aspect.h > 0)) | 821 | (ep->swallow_params.aspect.h > 0)) |
617 | amin = amax = | 822 | amin = amax = |
@@ -693,6 +898,7 @@ _edje_part_recalc_single_aspect(Edje_Real_Part *ep, | |||
693 | if ((amin > ZERO) && (aspect < amin)) | 898 | if ((amin > ZERO) && (aspect < amin)) |
694 | new_h = DIV(FROM_INT(params->w), amin); | 899 | new_h = DIV(FROM_INT(params->w), amin); |
695 | break; | 900 | break; |
901 | case EDJE_ASPECT_PREFER_SOURCE: | ||
696 | case EDJE_ASPECT_PREFER_BOTH: | 902 | case EDJE_ASPECT_PREFER_BOTH: |
697 | /* keep both dimensions in check */ | 903 | /* keep both dimensions in check */ |
698 | /* adjust for max aspect (width / height) */ | 904 | /* adjust for max aspect (width / height) */ |
@@ -1255,6 +1461,7 @@ _edje_part_recalc_single_min(Edje_Part_Description_Common *desc, | |||
1255 | minh = tmp; | 1461 | minh = tmp; |
1256 | break; | 1462 | break; |
1257 | } | 1463 | } |
1464 | case EDJE_ASPECT_PREFER_SOURCE: | ||
1258 | case EDJE_ASPECT_PREFER_BOTH: | 1465 | case EDJE_ASPECT_PREFER_BOTH: |
1259 | tmp = minh * params->w / h; | 1466 | tmp = minh * params->w / h; |
1260 | if (tmp >= minw) | 1467 | if (tmp >= minw) |
@@ -1321,6 +1528,7 @@ _edje_part_recalc_single_max(Edje_Part_Description_Common *desc, | |||
1321 | maxh = tmp; | 1528 | maxh = tmp; |
1322 | break; | 1529 | break; |
1323 | } | 1530 | } |
1531 | case EDJE_ASPECT_PREFER_SOURCE: | ||
1324 | case EDJE_ASPECT_PREFER_BOTH: | 1532 | case EDJE_ASPECT_PREFER_BOTH: |
1325 | tmp = maxh * params->w / h; | 1533 | tmp = maxh * params->w / h; |
1326 | if (tmp <= maxw) | 1534 | if (tmp <= maxw) |
@@ -1481,6 +1689,15 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, | |||
1481 | if (ep->swallow_params.min.w > desc->min.w) | 1689 | if (ep->swallow_params.min.w > desc->min.w) |
1482 | *minw = ep->swallow_params.min.w; | 1690 | *minw = ep->swallow_params.min.w; |
1483 | 1691 | ||
1692 | if (ep->edje->calc_only) | ||
1693 | { | ||
1694 | if (desc->minmul.have) | ||
1695 | { | ||
1696 | FLOAT_T mmw = desc->minmul.w; | ||
1697 | if (mmw != FROM_INT(1)) *minw = TO_INT(SCALE(mmw, *minw)); | ||
1698 | } | ||
1699 | } | ||
1700 | |||
1484 | /* XXX TODO: remove need of EDJE_INF_MAX_W, see edje_util.c */ | 1701 | /* XXX TODO: remove need of EDJE_INF_MAX_W, see edje_util.c */ |
1485 | if ((ep->swallow_params.max.w <= 0) || | 1702 | if ((ep->swallow_params.max.w <= 0) || |
1486 | (ep->swallow_params.max.w == EDJE_INF_MAX_W)) | 1703 | (ep->swallow_params.max.w == EDJE_INF_MAX_W)) |
@@ -1508,6 +1725,8 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, | |||
1508 | *maxw = ep->swallow_params.max.w; | 1725 | *maxw = ep->swallow_params.max.w; |
1509 | } | 1726 | } |
1510 | } | 1727 | } |
1728 | if ((ep->edje->calc_only) && (desc->minmul.have) && | ||
1729 | (desc->minmul.w != FROM_INT(1))) *maxw = *minw; | ||
1511 | if (*maxw >= 0) | 1730 | if (*maxw >= 0) |
1512 | { | 1731 | { |
1513 | if (*maxw < *minw) *maxw = *minw; | 1732 | if (*maxw < *minw) *maxw = *minw; |
@@ -1518,6 +1737,16 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, | |||
1518 | if (ep->swallow_params.min.h > desc->min.h) | 1737 | if (ep->swallow_params.min.h > desc->min.h) |
1519 | *minh = ep->swallow_params.min.h; | 1738 | *minh = ep->swallow_params.min.h; |
1520 | 1739 | ||
1740 | if (ep->edje->calc_only) | ||
1741 | { | ||
1742 | if (desc->minmul.have) | ||
1743 | { | ||
1744 | FLOAT_T mmh = desc->minmul.h; | ||
1745 | if (mmh != FROM_INT(1)) *minh = TO_INT(SCALE(mmh, *minh)); | ||
1746 | } | ||
1747 | } | ||
1748 | |||
1749 | |||
1521 | /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ | 1750 | /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ |
1522 | if ((ep->swallow_params.max.h <= 0) || | 1751 | if ((ep->swallow_params.max.h <= 0) || |
1523 | (ep->swallow_params.max.h == EDJE_INF_MAX_H)) | 1752 | (ep->swallow_params.max.h == EDJE_INF_MAX_H)) |
@@ -1544,7 +1773,9 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, | |||
1544 | if (ep->swallow_params.max.h < *maxh) | 1773 | if (ep->swallow_params.max.h < *maxh) |
1545 | *maxh = ep->swallow_params.max.h; | 1774 | *maxh = ep->swallow_params.max.h; |
1546 | } | 1775 | } |
1547 | } | 1776 | } |
1777 | if ((ep->edje->calc_only) && (desc->minmul.have) && | ||
1778 | (desc->minmul.h != FROM_INT(1))) *maxh = *minh; | ||
1548 | if (*maxh >= 0) | 1779 | if (*maxh >= 0) |
1549 | { | 1780 | { |
1550 | if (*maxh < *minh) *maxh = *minh; | 1781 | if (*maxh < *minh) *maxh = *minh; |
@@ -1665,7 +1896,8 @@ _edje_part_recalc_single(Edje *ed, | |||
1665 | Edje_Real_Part *rel2_to_x, | 1896 | Edje_Real_Part *rel2_to_x, |
1666 | Edje_Real_Part *rel2_to_y, | 1897 | Edje_Real_Part *rel2_to_y, |
1667 | Edje_Real_Part *confine_to, | 1898 | Edje_Real_Part *confine_to, |
1668 | Edje_Calc_Params *params) | 1899 | Edje_Calc_Params *params, |
1900 | FLOAT_T pos) | ||
1669 | { | 1901 | { |
1670 | Edje_Color_Class *cc = NULL; | 1902 | Edje_Color_Class *cc = NULL; |
1671 | Edje_Internal_Aspect apref; | 1903 | Edje_Internal_Aspect apref; |
@@ -1675,12 +1907,12 @@ _edje_part_recalc_single(Edje *ed, | |||
1675 | sc = ed->scale; | 1907 | sc = ed->scale; |
1676 | if (sc == ZERO) sc = _edje_scale; | 1908 | if (sc == ZERO) sc = _edje_scale; |
1677 | _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); | 1909 | _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); |
1678 | 1910 | ||
1679 | /* relative coords of top left & bottom right */ | 1911 | /* relative coords of top left & bottom right */ |
1680 | _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); | 1912 | _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); |
1681 | 1913 | ||
1682 | /* aspect */ | 1914 | /* aspect */ |
1683 | apref = _edje_part_recalc_single_aspect(ep, desc, params, &minw, &minh, &maxw, &maxh); | 1915 | apref = _edje_part_recalc_single_aspect(ed, ep, desc, params, &minw, &minh, &maxw, &maxh, pos); |
1684 | 1916 | ||
1685 | /* size step */ | 1917 | /* size step */ |
1686 | _edje_part_recalc_single_step(desc, params); | 1918 | _edje_part_recalc_single_step(desc, params); |
@@ -1855,77 +2087,13 @@ _edje_table_recalc_apply(Edje *ed __UNUSED__, | |||
1855 | } | 2087 | } |
1856 | } | 2088 | } |
1857 | 2089 | ||
1858 | static int | ||
1859 | _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, Edje_Part_Description_Image *st, Edje_Part_Image_Id *imid) | ||
1860 | { | ||
1861 | Edje_Image_Directory_Set_Entry *entry; | ||
1862 | Edje_Image_Directory_Set *set = NULL; | ||
1863 | Eina_List *l; | ||
1864 | int w = 0; | ||
1865 | int h = 0; | ||
1866 | int id; | ||
1867 | |||
1868 | if (!st && !imid) | ||
1869 | return -1; | ||
1870 | |||
1871 | if (st && !st->image.set) | ||
1872 | return st->image.id; | ||
1873 | |||
1874 | if (imid && !imid->set) | ||
1875 | return imid->id; | ||
1876 | |||
1877 | if (imid) | ||
1878 | id = imid->id; | ||
1879 | else | ||
1880 | id = st->image.id; | ||
1881 | |||
1882 | evas_object_geometry_get(obj, NULL, NULL, &w, &h); | ||
1883 | |||
1884 | if (eps && *eps) | ||
1885 | { | ||
1886 | if ((*eps)->id == id) | ||
1887 | set = (*eps)->set; | ||
1888 | |||
1889 | if (set) | ||
1890 | if ((*eps)->entry->size.min.w <= w && w <= (*eps)->entry->size.max.w) | ||
1891 | if ((*eps)->entry->size.min.h <= h && h <= (*eps)->entry->size.max.h) | ||
1892 | return (*eps)->entry->id; | ||
1893 | } | ||
1894 | |||
1895 | if (!set) | ||
1896 | set = ed->file->image_dir->sets + id; | ||
1897 | |||
1898 | EINA_LIST_FOREACH(set->entries, l, entry) | ||
1899 | { | ||
1900 | if (entry->size.min.w <= w && w <= entry->size.max.w) | ||
1901 | if (entry->size.min.h <= h && h <= entry->size.max.h) | ||
1902 | { | ||
1903 | if (eps) | ||
1904 | { | ||
1905 | if (!*eps) | ||
1906 | *eps = calloc(1, sizeof (Edje_Real_Part_Set)); | ||
1907 | |||
1908 | if (*eps) | ||
1909 | { | ||
1910 | (*eps)->entry = entry; | ||
1911 | (*eps)->set = set; | ||
1912 | (*eps)->id = id; | ||
1913 | } | ||
1914 | } | ||
1915 | return entry->id; | ||
1916 | } | ||
1917 | } | ||
1918 | |||
1919 | return -1; | ||
1920 | } | ||
1921 | |||
1922 | static void | 2090 | static void |
1923 | _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Proxy *chosen_desc, FLOAT_T pos) | 2091 | _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Proxy *chosen_desc, FLOAT_T pos) |
1924 | { | 2092 | { |
1925 | Edje_Real_Part *pp; | 2093 | Edje_Real_Part *pp; |
1926 | int part_id = -1; | 2094 | int part_id = -1; |
1927 | 2095 | ||
1928 | if (pos >= 0.5) | 2096 | if (pos >= FROM_DOUBLE(0.5)) |
1929 | part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; | 2097 | part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; |
1930 | else | 2098 | else |
1931 | part_id = chosen_desc->proxy.id; | 2099 | 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 | |||
1967 | static void | 2135 | static void |
1968 | _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Image *chosen_desc, FLOAT_T pos) | 2136 | _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Image *chosen_desc, FLOAT_T pos) |
1969 | { | 2137 | { |
1970 | int image_id; | ||
1971 | int image_count, image_num; | ||
1972 | FLOAT_T sc; | 2138 | FLOAT_T sc; |
1973 | 2139 | ||
1974 | sc = ed->scale; | 2140 | sc = ed->scale; |
@@ -2003,107 +2169,7 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj | |||
2003 | else if (chosen_desc->image.border.no_fill == 2) | 2169 | else if (chosen_desc->image.border.no_fill == 2) |
2004 | evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_SOLID); | 2170 | evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_SOLID); |
2005 | 2171 | ||
2006 | image_id = _edje_image_find(ep->object, ed, | 2172 | _edje_real_part_image_set(ed, ep, pos); |
2007 | &ep->param1.set, | ||
2008 | (Edje_Part_Description_Image*) ep->param1.description, | ||
2009 | NULL); | ||
2010 | if (image_id < 0) | ||
2011 | { | ||
2012 | Edje_Image_Directory_Entry *ie; | ||
2013 | |||
2014 | if (!ed->file->image_dir) ie = NULL; | ||
2015 | else ie = ed->file->image_dir->entries + (-image_id) - 1; | ||
2016 | if ((ie) && | ||
2017 | (ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) && | ||
2018 | (ie->entry)) | ||
2019 | { | ||
2020 | evas_object_image_file_set(ep->object, ie->entry, NULL); | ||
2021 | } | ||
2022 | } | ||
2023 | else | ||
2024 | { | ||
2025 | image_count = 2; | ||
2026 | if (ep->param2) | ||
2027 | image_count += ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens_count; | ||
2028 | image_num = TO_INT(MUL(pos, SUB(FROM_INT(image_count), | ||
2029 | FROM_DOUBLE(0.5)))); | ||
2030 | if (image_num > (image_count - 1)) | ||
2031 | image_num = image_count - 1; | ||
2032 | if (image_num == 0) | ||
2033 | { | ||
2034 | image_id = _edje_image_find(ep->object, ed, | ||
2035 | &ep->param1.set, | ||
2036 | (Edje_Part_Description_Image*) ep->param1.description, | ||
2037 | NULL); | ||
2038 | } | ||
2039 | else | ||
2040 | if (ep->param2) | ||
2041 | { | ||
2042 | if (image_num == (image_count - 1)) | ||
2043 | { | ||
2044 | image_id = _edje_image_find(ep->object, ed, | ||
2045 | &ep->param2->set, | ||
2046 | (Edje_Part_Description_Image*) ep->param2->description, | ||
2047 | NULL); | ||
2048 | } | ||
2049 | else | ||
2050 | { | ||
2051 | Edje_Part_Image_Id *imid; | ||
2052 | |||
2053 | imid = ((Edje_Part_Description_Image*) ep->param2->description)->image.tweens[image_num - 1]; | ||
2054 | image_id = _edje_image_find(ep->object, ed, NULL, NULL, imid); | ||
2055 | } | ||
2056 | } | ||
2057 | if (image_id < 0) | ||
2058 | { | ||
2059 | ERR("¨Part \"%s\" has description, " | ||
2060 | "\"%s\" %3.3f with a missing image id!!!", | ||
2061 | ep->part->name, | ||
2062 | ep->param1.description->state.name, | ||
2063 | ep->param1.description->state.value); | ||
2064 | } | ||
2065 | else | ||
2066 | { | ||
2067 | char buf[1024]; | ||
2068 | |||
2069 | /* Replace snprint("edje/images/%i") == memcpy + itoa */ | ||
2070 | #define IMAGES "edje/images/" | ||
2071 | memcpy(buf, IMAGES, strlen(IMAGES)); | ||
2072 | eina_convert_itoa(image_id, buf + strlen(IMAGES)); /* No need to check length as 2³² need only 10 characteres. */ | ||
2073 | |||
2074 | evas_object_image_file_set(ep->object, ed->file->path, buf); | ||
2075 | if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE) | ||
2076 | { | ||
2077 | ERR("Error loading image collection \"%s\" from " | ||
2078 | "file \"%s\". Missing EET Evas loader module?", | ||
2079 | buf, ed->file->path); | ||
2080 | switch (evas_object_image_load_error_get(ep->object)) | ||
2081 | { | ||
2082 | case EVAS_LOAD_ERROR_GENERIC: | ||
2083 | ERR("Error type: EVAS_LOAD_ERROR_GENERIC"); | ||
2084 | break; | ||
2085 | case EVAS_LOAD_ERROR_DOES_NOT_EXIST: | ||
2086 | ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST"); | ||
2087 | break; | ||
2088 | case EVAS_LOAD_ERROR_PERMISSION_DENIED: | ||
2089 | ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED"); | ||
2090 | break; | ||
2091 | case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: | ||
2092 | ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED"); | ||
2093 | break; | ||
2094 | case EVAS_LOAD_ERROR_CORRUPT_FILE: | ||
2095 | ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE"); | ||
2096 | break; | ||
2097 | case EVAS_LOAD_ERROR_UNKNOWN_FORMAT: | ||
2098 | ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT"); | ||
2099 | break; | ||
2100 | default: | ||
2101 | ERR("Error type: ???"); | ||
2102 | break; | ||
2103 | } | ||
2104 | } | ||
2105 | } | ||
2106 | } | ||
2107 | } | 2173 | } |
2108 | 2174 | ||
2109 | static Edje_Real_Part * | 2175 | static Edje_Real_Part * |
@@ -2299,13 +2365,15 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2299 | Edje_Real_Part *pp; | 2365 | Edje_Real_Part *pp; |
2300 | int part_id = -1; | 2366 | int part_id = -1; |
2301 | 2367 | ||
2302 | if (pos >= 0.5) | 2368 | if (pos >= FROM_DOUBLE(0.5)) |
2303 | part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; | 2369 | part_id = ((Edje_Part_Description_Proxy*) ep->param2->description)->proxy.id; |
2304 | else | 2370 | else |
2305 | part_id = ((Edje_Part_Description_Proxy*) chosen_desc)->proxy.id; | 2371 | part_id = ((Edje_Part_Description_Proxy*) chosen_desc)->proxy.id; |
2306 | 2372 | ||
2307 | pp = _edje_real_part_state_get(ed, ep, flags, part_id, NULL); | 2373 | pp = _edje_real_part_state_get(ed, ep, flags, part_id, NULL); |
2374 | #ifdef EDJE_CALC_CACHE | ||
2308 | if (pp && pp->invalidate) proxy_invalidate = EINA_TRUE; | 2375 | if (pp && pp->invalidate) proxy_invalidate = EINA_TRUE; |
2376 | #endif | ||
2309 | } | 2377 | } |
2310 | 2378 | ||
2311 | /* Recalc if needed the map center && light source */ | 2379 | /* 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 | |||
2355 | _edje_part_recalc_single(ed, ep, ep->param1.description, chosen_desc, center[0], light[0], persp[0], | 2423 | _edje_part_recalc_single(ed, ep, ep->param1.description, chosen_desc, center[0], light[0], persp[0], |
2356 | ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x, ep->param1.rel2_to_y, | 2424 | ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x, ep->param1.rel2_to_y, |
2357 | confine_to, | 2425 | confine_to, |
2358 | p1); | 2426 | p1, pos); |
2359 | 2427 | ||
2360 | #ifdef EDJE_CALC_CACHE | 2428 | #ifdef EDJE_CALC_CACHE |
2361 | ep->param1.state = ed->state; | 2429 | ep->param1.state = ed->state; |
@@ -2400,10 +2468,15 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2400 | ((ep->part->type == EDJE_PART_TYPE_TEXT || ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && ed->text_part_change)) | 2468 | ((ep->part->type == EDJE_PART_TYPE_TEXT || ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && ed->text_part_change)) |
2401 | #endif | 2469 | #endif |
2402 | { | 2470 | { |
2403 | _edje_part_recalc_single(ed, ep, ep->param2->description, chosen_desc, center[1], light[1], persp[1], | 2471 | _edje_part_recalc_single(ed, ep, ep->param2->description, |
2404 | ep->param2->rel1_to_x, ep->param2->rel1_to_y, ep->param2->rel2_to_x, ep->param2->rel2_to_y, | 2472 | chosen_desc, |
2473 | center[1], light[1], persp[1], | ||
2474 | ep->param2->rel1_to_x, | ||
2475 | ep->param2->rel1_to_y, | ||
2476 | ep->param2->rel2_to_x, | ||
2477 | ep->param2->rel2_to_y, | ||
2405 | confine_to, | 2478 | confine_to, |
2406 | p2); | 2479 | p2, pos); |
2407 | #ifdef EDJE_CALC_CACHE | 2480 | #ifdef EDJE_CALC_CACHE |
2408 | ep->param2->state = ed->state; | 2481 | ep->param2->state = ed->state; |
2409 | #endif | 2482 | #endif |
@@ -2449,7 +2522,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2449 | p3->req.y = INTP(p1->req.y, p2->req.y, pos); | 2522 | p3->req.y = INTP(p1->req.y, p2->req.y, pos); |
2450 | p3->req.w = INTP(p1->req.w, p2->req.w, pos); | 2523 | p3->req.w = INTP(p1->req.w, p2->req.w, pos); |
2451 | p3->req.h = INTP(p1->req.h, p2->req.h, pos); | 2524 | p3->req.h = INTP(p1->req.h, p2->req.h, pos); |
2452 | 2525 | ||
2453 | if (ep->part->dragable.x) | 2526 | if (ep->part->dragable.x) |
2454 | { | 2527 | { |
2455 | p3->req_drag.x = INTP(p1->req_drag.x, p2->req_drag.x, pos); | 2528 | 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 | |||
2543 | } | 2616 | } |
2544 | else if (p1->persp_on) | 2617 | else if (p1->persp_on) |
2545 | { | 2618 | { |
2546 | memcpy(&p3->map.persp, &p1->map.persp, sizeof (p1->map.light)); | 2619 | memcpy(&p3->map.persp, &p1->map.persp, sizeof (p1->map.persp)); |
2547 | } | 2620 | } |
2548 | else if (p2->persp_on) | 2621 | else if (p2->persp_on) |
2549 | { | 2622 | { |
2550 | memcpy(&p3->map.persp, &p2->map.persp, sizeof (p2->map.light)); | 2623 | memcpy(&p3->map.persp, &p2->map.persp, sizeof (p2->map.persp)); |
2551 | } | 2624 | } |
2552 | } | 2625 | } |
2553 | 2626 | ||
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 | |||
134 | _edje_emit(ed, buf, events->part->name); | 134 | _edje_emit(ed, buf, events->part->name); |
135 | } | 135 | } |
136 | ed->dirty = 1; | 136 | ed->dirty = 1; |
137 | ed->recalc_call = 1; | ||
137 | #ifdef EDJE_CALC_CACHE | 138 | #ifdef EDJE_CALC_CACHE |
138 | rp->invalidate = 1; | 139 | rp->invalidate = 1; |
139 | #endif | 140 | #endif |
@@ -157,6 +158,7 @@ _edje_mouse_down_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi | |||
157 | rp->drag->val.y = dy; | 158 | rp->drag->val.y = dy; |
158 | if (!ignored) | 159 | if (!ignored) |
159 | _edje_emit(ed, "drag", rp->part->name); | 160 | _edje_emit(ed, "drag", rp->part->name); |
161 | ed->recalc_call = 1; | ||
160 | ed->dirty = 1; | 162 | ed->dirty = 1; |
161 | #ifdef EDJE_CALC_CACHE | 163 | #ifdef EDJE_CALC_CACHE |
162 | rp->invalidate = 1; | 164 | rp->invalidate = 1; |
@@ -235,6 +237,7 @@ _edje_mouse_up_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void | |||
235 | if (rp->drag->down.count == 0) | 237 | if (rp->drag->down.count == 0) |
236 | { | 238 | { |
237 | rp->drag->need_reset = 1; | 239 | rp->drag->need_reset = 1; |
240 | ed->recalc_call = 1; | ||
238 | ed->dirty = 1; | 241 | ed->dirty = 1; |
239 | #ifdef EDJE_CALC_CACHE | 242 | #ifdef EDJE_CALC_CACHE |
240 | rp->invalidate = 1; | 243 | rp->invalidate = 1; |
@@ -314,6 +317,7 @@ _edje_mouse_move_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi | |||
314 | rp->drag->tmp.x = ev->cur.canvas.x - rp->drag->down.x; | 317 | rp->drag->tmp.x = ev->cur.canvas.x - rp->drag->down.x; |
315 | if (rp->part->dragable.y) | 318 | if (rp->part->dragable.y) |
316 | rp->drag->tmp.y = ev->cur.canvas.y - rp->drag->down.y; | 319 | rp->drag->tmp.y = ev->cur.canvas.y - rp->drag->down.y; |
320 | ed->recalc_call = 1; | ||
317 | ed->dirty = 1; | 321 | ed->dirty = 1; |
318 | #ifdef EDJE_CALC_CACHE | 322 | #ifdef EDJE_CALC_CACHE |
319 | rp->invalidate = 1; | 323 | rp->invalidate = 1; |
@@ -332,6 +336,7 @@ _edje_mouse_move_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi | |||
332 | rp->drag->val.y = dy; | 336 | rp->drag->val.y = dy; |
333 | if (!ignored) | 337 | if (!ignored) |
334 | _edje_emit(ed, "drag", rp->part->name); | 338 | _edje_emit(ed, "drag", rp->part->name); |
339 | ed->recalc_call = 1; | ||
335 | ed->dirty = 1; | 340 | ed->dirty = 1; |
336 | #ifdef EDJE_CALC_CACHE | 341 | #ifdef EDJE_CALC_CACHE |
337 | rp->invalidate = 1; | 342 | 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) | |||
451 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "align.y", align.y, EDJE_T_FLOAT); \ | 451 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "align.y", align.y, EDJE_T_FLOAT); \ |
452 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.w", fixed.w, EET_T_UCHAR); \ | 452 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.w", fixed.w, EET_T_UCHAR); \ |
453 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.h", fixed.h, EET_T_UCHAR); \ | 453 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.h", fixed.h, EET_T_UCHAR); \ |
454 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.have", minmul.have, EET_T_UCHAR); \ | ||
455 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.w", minmul.w, EDJE_T_FLOAT); \ | ||
456 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.h", minmul.h, EDJE_T_FLOAT); \ | ||
454 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.w", min.w, EET_T_INT); \ | 457 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.w", min.w, EET_T_INT); \ |
455 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.h", min.h, EET_T_INT); \ | 458 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.h", min.h, EET_T_INT); \ |
456 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.w", max.w, EET_T_INT); \ | 459 | 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 ; | |||
20 | EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_REFERENCED = 0; | 20 | EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_REFERENCED = 0; |
21 | EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST = 0; | 21 | EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST = 0; |
22 | 22 | ||
23 | /* Get ed(Edje*) from obj(Evas_Object*) */ | 23 | /* Get eed(Edje_Edit*) from obj(Evas_Object*) */ |
24 | #define GET_ED_OR_RETURN(RET) \ | 24 | #define GET_EED_OR_RETURN(RET) \ |
25 | Edje *ed; \ | ||
26 | Edje_Edit *eed; \ | 25 | Edje_Edit *eed; \ |
27 | if (!evas_object_smart_type_check_ptr(obj, _edje_edit_type)) \ | 26 | if (!evas_object_smart_type_check_ptr(obj, _edje_edit_type)) \ |
28 | return RET; \ | 27 | return RET; \ |
29 | eed = evas_object_smart_data_get(obj); \ | 28 | eed = evas_object_smart_data_get(obj); \ |
30 | if (!eed) return RET; \ | 29 | if (!eed) return RET; |
30 | |||
31 | /* Get ed(Edje*) from obj(Evas_Object*) */ | ||
32 | #define GET_ED_OR_RETURN(RET) \ | ||
33 | Edje *ed; \ | ||
34 | GET_EED_OR_RETURN(RET); \ | ||
31 | ed = (Edje *)eed; | 35 | ed = (Edje *)eed; |
32 | 36 | ||
33 | /* Get rp(Edje_Real_Part*) from obj(Evas_Object*) and part(char*) */ | 37 | /* Get rp(Edje_Real_Part*) from obj(Evas_Object*) and part(char*) */ |
@@ -388,72 +392,59 @@ _edje_real_part_free(Edje_Real_Part *rp) | |||
388 | static Eina_Bool | 392 | static Eina_Bool |
389 | _edje_import_font_file(Edje *ed, const char *path, const char *entry) | 393 | _edje_import_font_file(Edje *ed, const char *path, const char *entry) |
390 | { | 394 | { |
395 | Eina_File *f; | ||
396 | Eet_File *eetf = NULL; | ||
391 | void *fdata = NULL; | 397 | void *fdata = NULL; |
392 | long fsize = 0; | 398 | long fsize = 0; |
393 | 399 | ||
394 | /* Read font data from file */ | 400 | /* Read font data from file */ |
395 | { | 401 | f = eina_file_open(path, 0); |
396 | FILE *f = fopen(path, "rb"); | 402 | if (!f) |
397 | if (!f) | 403 | { |
398 | { | 404 | ERR("Unable to open font file \"%s\"", path); |
399 | ERR("Unable to open font file \"%s\"", path); | 405 | return EINA_FALSE; |
400 | return EINA_FALSE; | 406 | } |
401 | } | ||
402 | 407 | ||
403 | fseek(f, 0, SEEK_END); | 408 | fsize = eina_file_size_get(f); |
404 | fsize = ftell(f); | 409 | fdata = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); |
405 | rewind(f); | 410 | if (!fdata) |
406 | fdata = malloc(fsize); | 411 | { |
407 | if (!fdata) | 412 | ERR("Unable to map font file \"%s\"", path); |
408 | { | 413 | goto on_error; |
409 | ERR("Unable to alloc font file \"%s\"", path); | 414 | } |
410 | fclose(f); | ||
411 | return EINA_FALSE; | ||
412 | } | ||
413 | if (fread(fdata, fsize, 1, f) != 1) | ||
414 | { | ||
415 | free(fdata); | ||
416 | fclose(f); | ||
417 | ERR("Unable to read all of font file \"%s\"", path); | ||
418 | return EINA_FALSE; | ||
419 | } | ||
420 | fclose(f); | ||
421 | } | ||
422 | 415 | ||
423 | /* Write font to edje file */ | 416 | /* Write font to edje file */ |
424 | { | 417 | eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE); |
425 | /* open the eet file */ | 418 | if (!eetf) |
426 | Eet_File *eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE); | 419 | { |
427 | if (!eetf) | 420 | ERR("Unable to open \"%s\" for writing output", ed->path); |
428 | { | 421 | goto on_error; |
429 | ERR("Unable to open \"%s\" for writing output", ed->path); | 422 | } |
430 | free(fdata); | ||
431 | return EINA_FALSE; | ||
432 | } | ||
433 | 423 | ||
434 | if (eet_write(eetf, entry, fdata, fsize, 1) <= 0) | 424 | if (eet_write(eetf, entry, fdata, fsize, 1) <= 0) |
435 | { | 425 | { |
436 | ERR("Unable to write font part \"%s\" as \"%s\" part entry", | 426 | ERR("Unable to write font part \"%s\" as \"%s\" part entry", |
437 | path, entry); | 427 | path, entry); |
438 | eet_close(eetf); | 428 | goto on_error; |
439 | free(fdata); | 429 | } |
440 | return EINA_FALSE; | ||
441 | } | ||
442 | 430 | ||
443 | free(fdata); | 431 | /* write the edje_file */ |
432 | if (!_edje_edit_edje_file_save(eetf, ed->file)) | ||
433 | goto on_error; | ||
444 | 434 | ||
445 | /* write the edje_file */ | 435 | eet_close(eetf); |
446 | if (!_edje_edit_edje_file_save(eetf, ed->file)) | ||
447 | { | ||
448 | eet_delete(eetf, entry); | ||
449 | eet_close(eetf); | ||
450 | return EINA_FALSE; | ||
451 | } | ||
452 | 436 | ||
453 | eet_close(eetf); | 437 | eina_file_map_free(f, fdata); |
454 | } | 438 | eina_file_close(f); |
455 | 439 | ||
456 | return EINA_TRUE; | 440 | return EINA_TRUE; |
441 | |||
442 | on_error: | ||
443 | if (eetf) eet_close(eetf); | ||
444 | eina_file_map_free(f, fdata); | ||
445 | eina_file_close(f); | ||
446 | |||
447 | return EINA_FALSE; | ||
457 | } | 448 | } |
458 | 449 | ||
459 | 450 | ||
@@ -4791,7 +4782,7 @@ edje_edit_image_id_get(Evas_Object *obj, const char *image_name) | |||
4791 | { | 4782 | { |
4792 | eina_error_set(0); | 4783 | eina_error_set(0); |
4793 | 4784 | ||
4794 | GET_ED_OR_RETURN(-1); | 4785 | GET_EED_OR_RETURN(-1); |
4795 | 4786 | ||
4796 | return _edje_image_id_find(eed, image_name); | 4787 | return _edje_image_id_find(eed, image_name); |
4797 | } | 4788 | } |
@@ -5174,7 +5165,6 @@ EAPI Eina_Bool | |||
5174 | edje_edit_program_add(Evas_Object *obj, const char *name) | 5165 | edje_edit_program_add(Evas_Object *obj, const char *name) |
5175 | { | 5166 | { |
5176 | Edje_Program *epr; | 5167 | Edje_Program *epr; |
5177 | Edje_Part_Collection *pc; | ||
5178 | 5168 | ||
5179 | eina_error_set(0); | 5169 | eina_error_set(0); |
5180 | 5170 | ||
@@ -5191,7 +5181,7 @@ edje_edit_program_add(Evas_Object *obj, const char *name) | |||
5191 | if (!epr) return EINA_FALSE; | 5181 | if (!epr) return EINA_FALSE; |
5192 | 5182 | ||
5193 | //Add program to group | 5183 | //Add program to group |
5194 | pc = ed->collection; | 5184 | // pc = ed->collection; |
5195 | 5185 | ||
5196 | /* By default, source and signal are empty, so they fill in nocmp category */ | 5186 | /* By default, source and signal are empty, so they fill in nocmp category */ |
5197 | ed->collection->programs.nocmp = realloc(ed->collection->programs.nocmp, | 5187 | ed->collection->programs.nocmp = realloc(ed->collection->programs.nocmp, |
@@ -5237,7 +5227,6 @@ edje_edit_program_del(Evas_Object *obj, const char *prog) | |||
5237 | Eina_List *l, *l_next; | 5227 | Eina_List *l, *l_next; |
5238 | Edje_Program_Target *prt; | 5228 | Edje_Program_Target *prt; |
5239 | Edje_Program_After *pa; | 5229 | Edje_Program_After *pa; |
5240 | Edje_Part_Collection *pc; | ||
5241 | Edje_Program *p; | 5230 | Edje_Program *p; |
5242 | Program_Script *ps, *old_ps; | 5231 | Program_Script *ps, *old_ps; |
5243 | int id, i; | 5232 | int id, i; |
@@ -5248,7 +5237,7 @@ edje_edit_program_del(Evas_Object *obj, const char *prog) | |||
5248 | GET_ED_OR_RETURN(EINA_FALSE); | 5237 | GET_ED_OR_RETURN(EINA_FALSE); |
5249 | GET_EPR_OR_RETURN(EINA_FALSE); | 5238 | GET_EPR_OR_RETURN(EINA_FALSE); |
5250 | 5239 | ||
5251 | pc = ed->collection; | 5240 | //pc = ed->collection; |
5252 | 5241 | ||
5253 | //Remove program from programs list | 5242 | //Remove program from programs list |
5254 | id = epr->id; | 5243 | id = epr->id; |
@@ -5737,7 +5726,7 @@ edje_edit_program_action_set(Evas_Object *obj, const char *prog, Edje_Action_Typ | |||
5737 | 5726 | ||
5738 | eina_error_set(0); | 5727 | eina_error_set(0); |
5739 | 5728 | ||
5740 | GET_ED_OR_RETURN(EINA_FALSE); | 5729 | GET_EED_OR_RETURN(EINA_FALSE); |
5741 | GET_EPR_OR_RETURN(EINA_FALSE); | 5730 | GET_EPR_OR_RETURN(EINA_FALSE); |
5742 | 5731 | ||
5743 | //printf("SET ACTION for program: %s [%d]\n", prog, action); | 5732 | //printf("SET ACTION for program: %s [%d]\n", prog, action); |
@@ -6081,7 +6070,7 @@ edje_edit_script_set(Evas_Object *obj, const char *code) | |||
6081 | { | 6070 | { |
6082 | eina_error_set(0); | 6071 | eina_error_set(0); |
6083 | 6072 | ||
6084 | GET_ED_OR_RETURN(); | 6073 | GET_EED_OR_RETURN(); |
6085 | 6074 | ||
6086 | free(eed->embryo_source); | 6075 | free(eed->embryo_source); |
6087 | free(eed->embryo_processed); | 6076 | free(eed->embryo_processed); |
@@ -6104,7 +6093,7 @@ edje_edit_script_program_get(Evas_Object *obj, const char *prog) | |||
6104 | 6093 | ||
6105 | eina_error_set(0); | 6094 | eina_error_set(0); |
6106 | 6095 | ||
6107 | GET_ED_OR_RETURN(NULL); | 6096 | GET_EED_OR_RETURN(NULL); |
6108 | GET_EPR_OR_RETURN(NULL); | 6097 | GET_EPR_OR_RETURN(NULL); |
6109 | 6098 | ||
6110 | if (epr->action != EDJE_ACTION_TYPE_SCRIPT) | 6099 | 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 | |||
6124 | 6113 | ||
6125 | eina_error_set(0); | 6114 | eina_error_set(0); |
6126 | 6115 | ||
6127 | GET_ED_OR_RETURN(); | 6116 | GET_EED_OR_RETURN(); |
6128 | GET_EPR_OR_RETURN(); | 6117 | GET_EPR_OR_RETURN(); |
6129 | 6118 | ||
6130 | if (epr->action != EDJE_ACTION_TYPE_SCRIPT) | 6119 | if (epr->action != EDJE_ACTION_TYPE_SCRIPT) |
@@ -6550,7 +6539,7 @@ almost_out: | |||
6550 | EAPI Eina_Bool | 6539 | EAPI Eina_Bool |
6551 | edje_edit_script_compile(Evas_Object *obj) | 6540 | edje_edit_script_compile(Evas_Object *obj) |
6552 | { | 6541 | { |
6553 | GET_ED_OR_RETURN(EINA_FALSE); | 6542 | GET_EED_OR_RETURN(EINA_FALSE); |
6554 | 6543 | ||
6555 | if (!eed->script_need_recompile) | 6544 | if (!eed->script_need_recompile) |
6556 | return EINA_TRUE; | 6545 | return EINA_TRUE; |
@@ -6561,7 +6550,7 @@ edje_edit_script_compile(Evas_Object *obj) | |||
6561 | EAPI const Eina_List * | 6550 | EAPI const Eina_List * |
6562 | edje_edit_script_error_list_get(Evas_Object *obj) | 6551 | edje_edit_script_error_list_get(Evas_Object *obj) |
6563 | { | 6552 | { |
6564 | GET_ED_OR_RETURN(NULL); | 6553 | GET_EED_OR_RETURN(NULL); |
6565 | return eed->errors; | 6554 | return eed->errors; |
6566 | } | 6555 | } |
6567 | 6556 | ||
@@ -6643,7 +6632,7 @@ _edje_generate_source_of_program(Evas_Object *obj, const char *program, Eina_Str | |||
6643 | const char *api_name, *api_description; | 6632 | const char *api_name, *api_description; |
6644 | Edje_Program *epr; | 6633 | Edje_Program *epr; |
6645 | 6634 | ||
6646 | GET_ED_OR_RETURN(EINA_FALSE); | 6635 | GET_EED_OR_RETURN(EINA_FALSE); |
6647 | 6636 | ||
6648 | epr = _edje_program_get_byname(obj, program); | 6637 | epr = _edje_program_get_byname(obj, program); |
6649 | 6638 | ||
@@ -6816,7 +6805,7 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s | |||
6816 | if (pd->aspect.min || pd->aspect.max) | 6805 | if (pd->aspect.min || pd->aspect.max) |
6817 | BUF_APPENDF(I5"aspect: %g %g;\n", TO_DOUBLE(pd->aspect.min), TO_DOUBLE(pd->aspect.max)); | 6806 | BUF_APPENDF(I5"aspect: %g %g;\n", TO_DOUBLE(pd->aspect.min), TO_DOUBLE(pd->aspect.max)); |
6818 | if (pd->aspect.prefer) | 6807 | if (pd->aspect.prefer) |
6819 | BUF_APPENDF(I5"aspect_preference: %s;\n", prefers[pd->aspect.prefer]); | 6808 | BUF_APPENDF(I5"aspect_preference: %s;\n", prefers[(int) pd->aspect.prefer]); |
6820 | 6809 | ||
6821 | if (pd->color_class) | 6810 | if (pd->color_class) |
6822 | BUF_APPENDF(I5"color_class: \"%s\";\n", pd->color_class); | 6811 | BUF_APPENDF(I5"color_class: \"%s\";\n", pd->color_class); |
@@ -7786,7 +7775,7 @@ edje_edit_print_internal_status(Evas_Object *obj) | |||
7786 | */ | 7775 | */ |
7787 | eina_error_set(0); | 7776 | eina_error_set(0); |
7788 | 7777 | ||
7789 | GET_ED_OR_RETURN(); | 7778 | GET_EED_OR_RETURN(); |
7790 | 7779 | ||
7791 | _edje_generate_source(obj); | 7780 | _edje_generate_source(obj); |
7792 | /* | 7781 | /* |
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) | |||
674 | if (h < 0.0) h = 0.0; | 674 | if (h < 0.0) h = 0.0; |
675 | ed->collection->prop.min.w = w; | 675 | ed->collection->prop.min.w = w; |
676 | ed->collection->prop.min.h = h; | 676 | ed->collection->prop.min.h = h; |
677 | ed->recalc_call = 1; | ||
677 | ed->dirty = 1; | 678 | ed->dirty = 1; |
678 | #ifdef EDJE_CALC_CACHE | 679 | #ifdef EDJE_CALC_CACHE |
679 | ed->all_part_change = 1; | 680 | ed->all_part_change = 1; |
@@ -701,6 +702,7 @@ _edje_embryo_fn_set_max_size(Embryo_Program *ep, Embryo_Cell *params) | |||
701 | if (h < 0.0) h = 0.0; | 702 | if (h < 0.0) h = 0.0; |
702 | ed->collection->prop.max.w = w; | 703 | ed->collection->prop.max.w = w; |
703 | ed->collection->prop.max.h = h; | 704 | ed->collection->prop.max.h = h; |
705 | ed->recalc_call = 1; | ||
704 | ed->dirty = 1; | 706 | ed->dirty = 1; |
705 | #ifdef EDJE_CALC_CACHE | 707 | #ifdef EDJE_CALC_CACHE |
706 | ed->all_part_change = 1; | 708 | 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 @@ | |||
2 | 2 | ||
3 | #ifdef HAVE_ECORE_IMF | 3 | #ifdef HAVE_ECORE_IMF |
4 | static Eina_Bool _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos); | 4 | static Eina_Bool _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos); |
5 | static Eina_Bool _edje_entry_imf_event_commit_cb(void *data, int type, void *event); | 5 | static void _edje_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info); |
6 | static Eina_Bool _edje_entry_imf_event_preedit_changed_cb(void *data, int type, void *event); | 6 | static void _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx, void *event_info); |
7 | static Eina_Bool _edje_entry_imf_event_delete_surrounding_cb(void *data, int type, void *event); | 7 | static void _edje_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx, void *event); |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | typedef struct _Entry Entry; | 10 | typedef struct _Entry Entry; |
@@ -39,10 +39,6 @@ struct _Entry | |||
39 | #ifdef HAVE_ECORE_IMF | 39 | #ifdef HAVE_ECORE_IMF |
40 | Eina_Bool have_preedit : 1; | 40 | Eina_Bool have_preedit : 1; |
41 | Ecore_IMF_Context *imf_context; | 41 | Ecore_IMF_Context *imf_context; |
42 | |||
43 | Ecore_Event_Handler *imf_ee_handler_commit; | ||
44 | Ecore_Event_Handler *imf_ee_handler_delete; | ||
45 | Ecore_Event_Handler *imf_ee_handler_changed; | ||
46 | #endif | 42 | #endif |
47 | }; | 43 | }; |
48 | 44 | ||
@@ -272,20 +268,6 @@ _curs_update_from_curs(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, Entr | |||
272 | *cy += (ch / 2); | 268 | *cy += (ch / 2); |
273 | } | 269 | } |
274 | 270 | ||
275 | static void | ||
276 | _curs_back(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, | ||
277 | Entry *en __UNUSED__) | ||
278 | { | ||
279 | evas_textblock_cursor_char_prev(c); | ||
280 | } | ||
281 | |||
282 | static void | ||
283 | _curs_next(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, | ||
284 | Entry *en __UNUSED__) | ||
285 | { | ||
286 | evas_textblock_cursor_char_next(c); | ||
287 | } | ||
288 | |||
289 | static int | 271 | static int |
290 | _curs_line_last_get(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en __UNUSED__) | 272 | _curs_line_last_get(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o, Entry *en __UNUSED__) |
291 | { | 273 | { |
@@ -415,6 +397,7 @@ static void | |||
415 | _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | 397 | _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) |
416 | { | 398 | { |
417 | if (!en->sel_end) return; | 399 | if (!en->sel_end) return; |
400 | _edje_entry_imf_context_reset(en); | ||
418 | _sel_enable(c, o, en); | 401 | _sel_enable(c, o, en); |
419 | if (!evas_textblock_cursor_compare(c, en->sel_end)) return; | 402 | if (!evas_textblock_cursor_compare(c, en->sel_end)) return; |
420 | evas_textblock_cursor_copy(c, en->sel_end); | 403 | evas_textblock_cursor_copy(c, en->sel_end); |
@@ -424,13 +407,13 @@ _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | |||
424 | en->selection = NULL; | 407 | en->selection = NULL; |
425 | } | 408 | } |
426 | _edje_emit(en->rp->edje, "selection,changed", en->rp->part->name); | 409 | _edje_emit(en->rp->edje, "selection,changed", en->rp->part->name); |
427 | _edje_entry_imf_context_reset(en); | ||
428 | } | 410 | } |
429 | 411 | ||
430 | static void | 412 | static void |
431 | _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | 413 | _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) |
432 | { | 414 | { |
433 | if (!en->sel_end) return; | 415 | if (!en->sel_end) return; |
416 | _edje_entry_imf_context_reset(en); | ||
434 | _sel_enable(c, o, en); | 417 | _sel_enable(c, o, en); |
435 | if (!evas_textblock_cursor_compare(c, en->sel_start)) return; | 418 | if (!evas_textblock_cursor_compare(c, en->sel_start)) return; |
436 | evas_textblock_cursor_copy(c, en->sel_start); | 419 | evas_textblock_cursor_copy(c, en->sel_start); |
@@ -440,7 +423,6 @@ _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | |||
440 | en->selection = NULL; | 423 | en->selection = NULL; |
441 | } | 424 | } |
442 | _edje_emit(en->rp->edje, "selection,changed", en->rp->part->name); | 425 | _edje_emit(en->rp->edje, "selection,changed", en->rp->part->name); |
443 | _edje_entry_imf_context_reset(en); | ||
444 | } | 426 | } |
445 | 427 | ||
446 | static void | 428 | static void |
@@ -1107,6 +1089,10 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1107 | } | 1089 | } |
1108 | #endif | 1090 | #endif |
1109 | 1091 | ||
1092 | if ((!strcmp(ev->key, "Escape")) || | ||
1093 | (!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter"))) | ||
1094 | _edje_entry_imf_context_reset(en); | ||
1095 | |||
1110 | old_cur_pos = evas_textblock_cursor_pos_get(en->cursor); | 1096 | old_cur_pos = evas_textblock_cursor_pos_get(en->cursor); |
1111 | 1097 | ||
1112 | control = evas_key_modifier_is_set(ev->modifiers, "Control"); | 1098 | 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 | |||
1138 | } | 1124 | } |
1139 | _sel_clear(en->cursor, rp->object, en); | 1125 | _sel_clear(en->cursor, rp->object, en); |
1140 | _edje_emit(ed, "entry,key,up", rp->part->name); | 1126 | _edje_emit(ed, "entry,key,up", rp->part->name); |
1127 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | ||
1141 | } | 1128 | } |
1142 | else if (!strcmp(ev->key, "Down") || !strcmp(ev->key, "KP_Down")) | 1129 | else if (!strcmp(ev->key, "Down") || !strcmp(ev->key, "KP_Down")) |
1143 | { | 1130 | { |
@@ -1157,6 +1144,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1157 | } | 1144 | } |
1158 | _sel_clear(en->cursor, rp->object, en); | 1145 | _sel_clear(en->cursor, rp->object, en); |
1159 | _edje_emit(ed, "entry,key,down", rp->part->name); | 1146 | _edje_emit(ed, "entry,key,down", rp->part->name); |
1147 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | ||
1160 | } | 1148 | } |
1161 | else if (!strcmp(ev->key, "Left") || !strcmp(ev->key, "KP_Left")) | 1149 | else if (!strcmp(ev->key, "Left") || !strcmp(ev->key, "KP_Left")) |
1162 | { | 1150 | { |
@@ -1165,13 +1153,16 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1165 | if (shift) _sel_start(en->cursor, rp->object, en); | 1153 | if (shift) _sel_start(en->cursor, rp->object, en); |
1166 | else _sel_clear(en->cursor, rp->object, en); | 1154 | else _sel_clear(en->cursor, rp->object, en); |
1167 | } | 1155 | } |
1168 | _curs_back(en->cursor, rp->object, en); | 1156 | evas_textblock_cursor_char_prev(en->cursor); |
1157 | /* If control is pressed, go to the start of the word */ | ||
1158 | if (control) evas_textblock_cursor_word_start(en->cursor); | ||
1169 | if (en->select_allow) | 1159 | if (en->select_allow) |
1170 | { | 1160 | { |
1171 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1161 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1172 | } | 1162 | } |
1173 | _sel_clear(en->cursor, rp->object, en); | 1163 | _sel_clear(en->cursor, rp->object, en); |
1174 | _edje_emit(ed, "entry,key,left", rp->part->name); | 1164 | _edje_emit(ed, "entry,key,left", rp->part->name); |
1165 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | ||
1175 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1166 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1176 | } | 1167 | } |
1177 | else if (!strcmp(ev->key, "Right") || !strcmp(ev->key, "KP_Right")) | 1168 | 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 | |||
1181 | if (shift) _sel_start(en->cursor, rp->object, en); | 1172 | if (shift) _sel_start(en->cursor, rp->object, en); |
1182 | else _sel_clear(en->cursor, rp->object, en); | 1173 | else _sel_clear(en->cursor, rp->object, en); |
1183 | } | 1174 | } |
1184 | _curs_next(en->cursor, rp->object, en); | 1175 | /* If control is pressed, go to the start of the word */ |
1176 | if (control) evas_textblock_cursor_word_end(en->cursor); | ||
1177 | evas_textblock_cursor_char_next(en->cursor); | ||
1185 | if (en->select_allow) | 1178 | if (en->select_allow) |
1186 | { | 1179 | { |
1187 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1180 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1188 | } | 1181 | } |
1189 | _sel_clear(en->cursor, rp->object, en); | 1182 | _sel_clear(en->cursor, rp->object, en); |
1190 | _edje_emit(ed, "entry,key,right", rp->part->name); | 1183 | _edje_emit(ed, "entry,key,right", rp->part->name); |
1184 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | ||
1191 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1185 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1192 | } | 1186 | } |
1193 | else if (!strcmp(ev->key, "BackSpace")) | 1187 | else if (!strcmp(ev->key, "BackSpace")) |
1194 | { | 1188 | { |
1195 | if (control) | 1189 | if (control && !en->have_selection) |
1196 | { | 1190 | { |
1197 | // del to start of previous word | 1191 | // del to start of previous word |
1192 | _sel_start(en->cursor, rp->object, en); | ||
1193 | |||
1194 | evas_textblock_cursor_char_prev(en->cursor); | ||
1195 | evas_textblock_cursor_word_start(en->cursor); | ||
1196 | |||
1197 | _sel_extend(en->cursor, rp->object, en); | ||
1198 | |||
1199 | _range_del_emit(ed, en->cursor, rp->object, en); | ||
1198 | } | 1200 | } |
1199 | else if ((alt) && (shift)) | 1201 | else if ((alt) && (shift)) |
1200 | { | 1202 | { |
@@ -1224,6 +1226,14 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1224 | if (control) | 1226 | if (control) |
1225 | { | 1227 | { |
1226 | // del to end of next word | 1228 | // del to end of next word |
1229 | _sel_start(en->cursor, rp->object, en); | ||
1230 | |||
1231 | evas_textblock_cursor_word_end(en->cursor); | ||
1232 | evas_textblock_cursor_char_next(en->cursor); | ||
1233 | |||
1234 | _sel_extend(en->cursor, rp->object, en); | ||
1235 | |||
1236 | _range_del_emit(ed, en->cursor, rp->object, en); | ||
1227 | } | 1237 | } |
1228 | else if (shift) | 1238 | else if (shift) |
1229 | { | 1239 | { |
@@ -1281,10 +1291,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1281 | _edje_emit(ed, "entry,key,end", rp->part->name); | 1291 | _edje_emit(ed, "entry,key,end", rp->part->name); |
1282 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1292 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1283 | } | 1293 | } |
1284 | else if (!strcmp(ev->key, "Shift_L") || !strcmp(ev->key, "Shift_R")) | ||
1285 | { | ||
1286 | return; | ||
1287 | } | ||
1288 | else if ((control) && (!strcmp(ev->key, "v"))) | 1294 | else if ((control) && (!strcmp(ev->key, "v"))) |
1289 | { | 1295 | { |
1290 | _edje_emit(ed, "entry,paste,request", rp->part->name); | 1296 | _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 | |||
1303 | } | 1309 | } |
1304 | else if ((control) && ((!strcmp(ev->key, "c") || (!strcmp(ev->key, "Insert"))))) | 1310 | else if ((control) && ((!strcmp(ev->key, "c") || (!strcmp(ev->key, "Insert"))))) |
1305 | { | 1311 | { |
1306 | // FIXME: copy - save selection | ||
1307 | _edje_emit(ed, "entry,copy,notify", rp->part->name); | 1312 | _edje_emit(ed, "entry,copy,notify", rp->part->name); |
1308 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1313 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1309 | } | 1314 | } |
1310 | else if ((control) && ((!strcmp(ev->key, "x") || (!strcmp(ev->key, "m"))))) | 1315 | else if ((control) && ((!strcmp(ev->key, "x") || (!strcmp(ev->key, "m"))))) |
1311 | { | 1316 | { |
1312 | // FIXME: cut - save selection, delete seletion | ||
1313 | _edje_emit(ed, "entry,cut,notify", rp->part->name); | 1317 | _edje_emit(ed, "entry,cut,notify", rp->part->name); |
1314 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1318 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1315 | } | 1319 | } |
@@ -1336,7 +1340,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1336 | else if ((control) && (!strcmp(ev->key, "w"))) | 1340 | else if ((control) && (!strcmp(ev->key, "w"))) |
1337 | { | 1341 | { |
1338 | _sel_clear(en->cursor, rp->object, en); | 1342 | _sel_clear(en->cursor, rp->object, en); |
1339 | // select current word | 1343 | // select current word? |
1340 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1344 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1341 | } | 1345 | } |
1342 | else if (!strcmp(ev->key, "Tab")) | 1346 | else if (!strcmp(ev->key, "Tab")) |
@@ -1361,10 +1365,10 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1361 | _sel_clear(en->cursor, rp->object, en); | 1365 | _sel_clear(en->cursor, rp->object, en); |
1362 | info->change.insert.pos = | 1366 | info->change.insert.pos = |
1363 | evas_textblock_cursor_pos_get(en->cursor); | 1367 | evas_textblock_cursor_pos_get(en->cursor); |
1364 | info->change.insert.content = eina_stringshare_add("<\t>"); | 1368 | info->change.insert.content = eina_stringshare_add("<tab/>"); |
1365 | //yy | 1369 | //yy |
1366 | // evas_textblock_cursor_format_prepend(en->cursor, "\t"); | 1370 | // evas_textblock_cursor_format_prepend(en->cursor, "tab"); |
1367 | _text_filter_format_prepend(en, en->cursor, "\t"); | 1371 | _text_filter_format_prepend(en, en->cursor, "tab"); |
1368 | _anchors_get(en->cursor, rp->object, en); | 1372 | _anchors_get(en->cursor, rp->object, en); |
1369 | _edje_emit(ed, "entry,changed", rp->part->name); | 1373 | _edje_emit(ed, "entry,changed", rp->part->name); |
1370 | _edje_emit_full(ed, "entry,changed,user", rp->part->name, | 1374 | _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 | |||
1427 | 1431 | ||
1428 | info->change.insert.pos = | 1432 | info->change.insert.pos = |
1429 | evas_textblock_cursor_pos_get(en->cursor); | 1433 | evas_textblock_cursor_pos_get(en->cursor); |
1430 | if (shift) | 1434 | if (shift || |
1435 | evas_object_textblock_legacy_newline_get(rp->object)) | ||
1431 | { | 1436 | { |
1432 | //yy | 1437 | //yy |
1433 | // evas_textblock_cursor_format_prepend(en->cursor, "\n"); | 1438 | // evas_textblock_cursor_format_prepend(en->cursor, "br"); |
1434 | _text_filter_format_prepend(en, en->cursor, "\n"); | 1439 | _text_filter_format_prepend(en, en->cursor, "br"); |
1435 | info->change.insert.content = eina_stringshare_add("<\n>"); | 1440 | info->change.insert.content = eina_stringshare_add("<br/>"); |
1436 | } | 1441 | } |
1437 | else | 1442 | else |
1438 | { | 1443 | { |
1439 | //yy | 1444 | //yy |
1440 | // evas_textblock_cursor_format_prepend(en->cursor, "ps"); | 1445 | // evas_textblock_cursor_format_prepend(en->cursor, "ps"); |
1441 | _text_filter_format_prepend(en, en->cursor, "ps"); | 1446 | _text_filter_format_prepend(en, en->cursor, "ps"); |
1442 | info->change.insert.content = eina_stringshare_add("<ps>"); | 1447 | info->change.insert.content = eina_stringshare_add("<ps/>"); |
1443 | } | 1448 | } |
1444 | _anchors_get(en->cursor, rp->object, en); | 1449 | _anchors_get(en->cursor, rp->object, en); |
1445 | _edje_emit(ed, "entry,changed", rp->part->name); | 1450 | _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 | |||
1499 | if (!cursor_changed && (old_cur_pos != evas_textblock_cursor_pos_get(en->cursor))) | 1504 | if (!cursor_changed && (old_cur_pos != evas_textblock_cursor_pos_get(en->cursor))) |
1500 | _edje_emit(ed, "cursor,changed", rp->part->name); | 1505 | _edje_emit(ed, "cursor,changed", rp->part->name); |
1501 | 1506 | ||
1502 | _edje_entry_imf_context_reset(en); | ||
1503 | _edje_entry_imf_cursor_info_set(en); | 1507 | _edje_entry_imf_cursor_info_set(en); |
1504 | _edje_entry_real_part_configure(rp); | 1508 | _edje_entry_real_part_configure(rp); |
1505 | } | 1509 | } |
@@ -1576,6 +1580,8 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1576 | } | 1580 | } |
1577 | #endif | 1581 | #endif |
1578 | 1582 | ||
1583 | _edje_entry_imf_context_reset(en); | ||
1584 | |||
1579 | en->select_mod_start = EINA_FALSE; | 1585 | en->select_mod_start = EINA_FALSE; |
1580 | en->select_mod_end = EINA_FALSE; | 1586 | en->select_mod_end = EINA_FALSE; |
1581 | if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT) | 1587 | 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 | |||
1690 | } | 1696 | } |
1691 | } | 1697 | } |
1692 | if (evas_textblock_cursor_compare(tc, en->cursor)) | 1698 | if (evas_textblock_cursor_compare(tc, en->cursor)) |
1693 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 1699 | { |
1700 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | ||
1701 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | ||
1702 | } | ||
1694 | evas_textblock_cursor_free(tc); | 1703 | evas_textblock_cursor_free(tc); |
1695 | 1704 | ||
1696 | _edje_entry_imf_context_reset(en); | ||
1697 | _edje_entry_imf_cursor_info_set(en); | 1705 | _edje_entry_imf_cursor_info_set(en); |
1698 | 1706 | ||
1699 | _edje_entry_real_part_configure(rp); | 1707 | _edje_entry_real_part_configure(rp); |
@@ -1733,6 +1741,8 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED | |||
1733 | } | 1741 | } |
1734 | #endif | 1742 | #endif |
1735 | 1743 | ||
1744 | _edje_entry_imf_context_reset(en); | ||
1745 | |||
1736 | tc = evas_object_textblock_cursor_new(rp->object); | 1746 | tc = evas_object_textblock_cursor_new(rp->object); |
1737 | evas_textblock_cursor_copy(en->cursor, tc); | 1747 | evas_textblock_cursor_copy(en->cursor, tc); |
1738 | evas_object_geometry_get(rp->object, &x, &y, &w, &h); | 1748 | 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 | |||
1799 | en->selecting = EINA_FALSE; | 1809 | en->selecting = EINA_FALSE; |
1800 | } | 1810 | } |
1801 | if (evas_textblock_cursor_compare(tc, en->cursor)) | 1811 | if (evas_textblock_cursor_compare(tc, en->cursor)) |
1802 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 1812 | { |
1813 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | ||
1814 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | ||
1815 | } | ||
1803 | evas_textblock_cursor_free(tc); | 1816 | evas_textblock_cursor_free(tc); |
1804 | 1817 | ||
1805 | _edje_entry_imf_context_reset(en); | ||
1806 | _edje_entry_imf_cursor_info_set(en); | 1818 | _edje_entry_imf_cursor_info_set(en); |
1807 | _edje_entry_real_part_configure(rp); | 1819 | _edje_entry_real_part_configure(rp); |
1808 | } | 1820 | } |
@@ -1893,7 +1905,10 @@ _edje_part_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1893 | _sel_update(en->cursor, rp->object, en); | 1905 | _sel_update(en->cursor, rp->object, en); |
1894 | } | 1906 | } |
1895 | if (evas_textblock_cursor_compare(tc, en->cursor)) | 1907 | if (evas_textblock_cursor_compare(tc, en->cursor)) |
1896 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 1908 | { |
1909 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | ||
1910 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | ||
1911 | } | ||
1897 | evas_textblock_cursor_free(tc); | 1912 | evas_textblock_cursor_free(tc); |
1898 | 1913 | ||
1899 | _edje_entry_imf_context_reset(en); | 1914 | _edje_entry_imf_context_reset(en); |
@@ -2014,6 +2029,8 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) | |||
2014 | evas_object_pass_events_set(en->cursor_fg, EINA_TRUE); | 2029 | evas_object_pass_events_set(en->cursor_fg, EINA_TRUE); |
2015 | _edje_subobj_register(en->rp->edje, en->cursor_fg); | 2030 | _edje_subobj_register(en->rp->edje, en->cursor_fg); |
2016 | 2031 | ||
2032 | evas_object_textblock_legacy_newline_set(rp->object, EINA_TRUE); | ||
2033 | |||
2017 | if (rp->part->entry_mode >= EDJE_ENTRY_EDIT_MODE_EDITABLE) | 2034 | if (rp->part->entry_mode >= EDJE_ENTRY_EDIT_MODE_EDITABLE) |
2018 | { | 2035 | { |
2019 | evas_object_show(en->cursor_bg); | 2036 | evas_object_show(en->cursor_bg); |
@@ -2055,9 +2072,9 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) | |||
2055 | 2072 | ||
2056 | ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context, | 2073 | ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context, |
2057 | _edje_entry_imf_retrieve_surrounding_cb, rp->edje); | 2074 | _edje_entry_imf_retrieve_surrounding_cb, rp->edje); |
2058 | en->imf_ee_handler_commit = ecore_event_handler_add(ECORE_IMF_EVENT_COMMIT, _edje_entry_imf_event_commit_cb, rp->edje); | 2075 | ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb, rp->edje); |
2059 | en->imf_ee_handler_delete = ecore_event_handler_add(ECORE_IMF_EVENT_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb, rp->edje); | 2076 | ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb, rp->edje); |
2060 | en->imf_ee_handler_changed = ecore_event_handler_add(ECORE_IMF_EVENT_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb, rp->edje); | 2077 | ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb, rp->edje); |
2061 | ecore_imf_context_input_mode_set(en->imf_context, | 2078 | ecore_imf_context_input_mode_set(en->imf_context, |
2062 | rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD ? | 2079 | rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD ? |
2063 | ECORE_IMF_INPUT_MODE_INVISIBLE : ECORE_IMF_INPUT_MODE_FULL); | 2080 | ECORE_IMF_INPUT_MODE_INVISIBLE : ECORE_IMF_INPUT_MODE_FULL); |
@@ -2094,23 +2111,9 @@ _edje_entry_real_part_shutdown(Edje_Real_Part *rp) | |||
2094 | { | 2111 | { |
2095 | if (en->imf_context) | 2112 | if (en->imf_context) |
2096 | { | 2113 | { |
2097 | if (en->imf_ee_handler_commit) | 2114 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb); |
2098 | { | 2115 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb); |
2099 | ecore_event_handler_del(en->imf_ee_handler_commit); | 2116 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb); |
2100 | en->imf_ee_handler_commit = NULL; | ||
2101 | } | ||
2102 | |||
2103 | if (en->imf_ee_handler_delete) | ||
2104 | { | ||
2105 | ecore_event_handler_del(en->imf_ee_handler_delete); | ||
2106 | en->imf_ee_handler_delete = NULL; | ||
2107 | } | ||
2108 | |||
2109 | if (en->imf_ee_handler_changed) | ||
2110 | { | ||
2111 | ecore_event_handler_del(en->imf_ee_handler_changed); | ||
2112 | en->imf_ee_handler_changed = NULL; | ||
2113 | } | ||
2114 | 2117 | ||
2115 | ecore_imf_context_del(en->imf_context); | 2118 | ecore_imf_context_del(en->imf_context); |
2116 | en->imf_context = NULL; | 2119 | en->imf_context = NULL; |
@@ -2189,7 +2192,7 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text) | |||
2189 | { | 2192 | { |
2190 | Entry *en = rp->entry_data; | 2193 | Entry *en = rp->entry_data; |
2191 | if (!en) return; | 2194 | if (!en) return; |
2192 | 2195 | _edje_entry_imf_context_reset(en); | |
2193 | // set text as markup | 2196 | // set text as markup |
2194 | _sel_clear(en->cursor, rp->object, en); | 2197 | _sel_clear(en->cursor, rp->object, en); |
2195 | evas_object_textblock_text_markup_set(rp->object, text); | 2198 | 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) | |||
2228 | { | 2231 | { |
2229 | Entry *en = rp->entry_data; | 2232 | Entry *en = rp->entry_data; |
2230 | if (!en) return; | 2233 | if (!en) return; |
2234 | _edje_entry_imf_context_reset(en); | ||
2235 | |||
2231 | // prepend markup @ cursor pos | 2236 | // prepend markup @ cursor pos |
2232 | if (en->have_selection) | 2237 | if (en->have_selection) |
2233 | _range_del(en->cursor, rp->object, en); | 2238 | _range_del(en->cursor, rp->object, en); |
@@ -2239,9 +2244,7 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text) | |||
2239 | _edje_emit(rp->edje, "entry,changed", rp->part->name); | 2244 | _edje_emit(rp->edje, "entry,changed", rp->part->name); |
2240 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2245 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
2241 | 2246 | ||
2242 | _edje_entry_imf_context_reset(en); | ||
2243 | _edje_entry_imf_cursor_info_set(en); | 2247 | _edje_entry_imf_cursor_info_set(en); |
2244 | |||
2245 | _edje_entry_real_part_configure(rp); | 2248 | _edje_entry_real_part_configure(rp); |
2246 | } | 2249 | } |
2247 | 2250 | ||
@@ -2278,6 +2281,9 @@ _edje_entry_select_all(Edje_Real_Part *rp) | |||
2278 | { | 2281 | { |
2279 | Entry *en = rp->entry_data; | 2282 | Entry *en = rp->entry_data; |
2280 | if (!en) return; | 2283 | if (!en) return; |
2284 | |||
2285 | _edje_entry_imf_context_reset(en); | ||
2286 | |||
2281 | _sel_clear(en->cursor, rp->object, en); | 2287 | _sel_clear(en->cursor, rp->object, en); |
2282 | _curs_start(en->cursor, rp->object, en); | 2288 | _curs_start(en->cursor, rp->object, en); |
2283 | _sel_enable(en->cursor, rp->object, en); | 2289 | _sel_enable(en->cursor, rp->object, en); |
@@ -2285,7 +2291,6 @@ _edje_entry_select_all(Edje_Real_Part *rp) | |||
2285 | _curs_end(en->cursor, rp->object, en); | 2291 | _curs_end(en->cursor, rp->object, en); |
2286 | _sel_extend(en->cursor, rp->object, en); | 2292 | _sel_extend(en->cursor, rp->object, en); |
2287 | 2293 | ||
2288 | _edje_entry_imf_context_reset(en); | ||
2289 | _edje_entry_imf_cursor_info_set(en); | 2294 | _edje_entry_imf_cursor_info_set(en); |
2290 | _edje_entry_real_part_configure(rp); | 2295 | _edje_entry_real_part_configure(rp); |
2291 | } | 2296 | } |
@@ -2295,12 +2300,14 @@ _edje_entry_select_begin(Edje_Real_Part *rp) | |||
2295 | { | 2300 | { |
2296 | Entry *en = rp->entry_data; | 2301 | Entry *en = rp->entry_data; |
2297 | if (!en) return; | 2302 | if (!en) return; |
2303 | |||
2304 | _edje_entry_imf_context_reset(en); | ||
2305 | |||
2298 | _sel_clear(en->cursor, rp->object, en); | 2306 | _sel_clear(en->cursor, rp->object, en); |
2299 | _sel_enable(en->cursor, rp->object, en); | 2307 | _sel_enable(en->cursor, rp->object, en); |
2300 | _sel_start(en->cursor, rp->object, en); | 2308 | _sel_start(en->cursor, rp->object, en); |
2301 | _sel_extend(en->cursor, rp->object, en); | 2309 | _sel_extend(en->cursor, rp->object, en); |
2302 | 2310 | ||
2303 | _edje_entry_imf_context_reset(en); | ||
2304 | _edje_entry_imf_cursor_info_set(en); | 2311 | _edje_entry_imf_cursor_info_set(en); |
2305 | 2312 | ||
2306 | _edje_entry_real_part_configure(rp); | 2313 | _edje_entry_real_part_configure(rp); |
@@ -2311,9 +2318,9 @@ _edje_entry_select_extend(Edje_Real_Part *rp) | |||
2311 | { | 2318 | { |
2312 | Entry *en = rp->entry_data; | 2319 | Entry *en = rp->entry_data; |
2313 | if (!en) return; | 2320 | if (!en) return; |
2321 | _edje_entry_imf_context_reset(en); | ||
2314 | _sel_extend(en->cursor, rp->object, en); | 2322 | _sel_extend(en->cursor, rp->object, en); |
2315 | 2323 | ||
2316 | _edje_entry_imf_context_reset(en); | ||
2317 | _edje_entry_imf_cursor_info_set(en); | 2324 | _edje_entry_imf_cursor_info_set(en); |
2318 | 2325 | ||
2319 | _edje_entry_real_part_configure(rp); | 2326 | _edje_entry_real_part_configure(rp); |
@@ -2560,13 +2567,14 @@ _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2560 | Entry *en = rp->entry_data; | 2567 | Entry *en = rp->entry_data; |
2561 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2568 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2562 | if (!c) return EINA_FALSE; | 2569 | if (!c) return EINA_FALSE; |
2570 | |||
2571 | _edje_entry_imf_context_reset(en); | ||
2572 | |||
2563 | if (!evas_textblock_cursor_char_next(c)) | 2573 | if (!evas_textblock_cursor_char_next(c)) |
2564 | { | 2574 | { |
2565 | return EINA_FALSE; | 2575 | return EINA_FALSE; |
2566 | } | 2576 | } |
2567 | _sel_update(c, rp->object, rp->entry_data); | 2577 | _sel_update(c, rp->object, rp->entry_data); |
2568 | |||
2569 | _edje_entry_imf_context_reset(en); | ||
2570 | _edje_entry_imf_cursor_info_set(en); | 2578 | _edje_entry_imf_cursor_info_set(en); |
2571 | 2579 | ||
2572 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2580 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
@@ -2580,6 +2588,9 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2580 | Entry *en = rp->entry_data; | 2588 | Entry *en = rp->entry_data; |
2581 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2589 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2582 | if (!c) return EINA_FALSE; | 2590 | if (!c) return EINA_FALSE; |
2591 | |||
2592 | _edje_entry_imf_context_reset(en); | ||
2593 | |||
2583 | if (!evas_textblock_cursor_char_prev(c)) | 2594 | if (!evas_textblock_cursor_char_prev(c)) |
2584 | { | 2595 | { |
2585 | if (evas_textblock_cursor_paragraph_prev(c)) goto ok; | 2596 | if (evas_textblock_cursor_paragraph_prev(c)) goto ok; |
@@ -2588,7 +2599,6 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2588 | ok: | 2599 | ok: |
2589 | _sel_update(c, rp->object, rp->entry_data); | 2600 | _sel_update(c, rp->object, rp->entry_data); |
2590 | 2601 | ||
2591 | _edje_entry_imf_context_reset(en); | ||
2592 | _edje_entry_imf_cursor_info_set(en); | 2602 | _edje_entry_imf_cursor_info_set(en); |
2593 | 2603 | ||
2594 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2604 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
@@ -2604,6 +2614,9 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2604 | Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; | 2614 | Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; |
2605 | int ln; | 2615 | int ln; |
2606 | if (!c) return EINA_FALSE; | 2616 | if (!c) return EINA_FALSE; |
2617 | |||
2618 | _edje_entry_imf_context_reset(en); | ||
2619 | |||
2607 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); | 2620 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); |
2608 | ln--; | 2621 | ln--; |
2609 | if (ln < 0) return EINA_FALSE; | 2622 | if (ln < 0) return EINA_FALSE; |
@@ -2620,7 +2633,6 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2620 | } | 2633 | } |
2621 | _sel_update(c, rp->object, rp->entry_data); | 2634 | _sel_update(c, rp->object, rp->entry_data); |
2622 | 2635 | ||
2623 | _edje_entry_imf_context_reset(en); | ||
2624 | _edje_entry_imf_cursor_info_set(en); | 2636 | _edje_entry_imf_cursor_info_set(en); |
2625 | 2637 | ||
2626 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2638 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
@@ -2636,6 +2648,9 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2636 | Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; | 2648 | Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; |
2637 | int ln; | 2649 | int ln; |
2638 | if (!c) return EINA_FALSE; | 2650 | if (!c) return EINA_FALSE; |
2651 | |||
2652 | _edje_entry_imf_context_reset(en); | ||
2653 | |||
2639 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); | 2654 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); |
2640 | ln++; | 2655 | ln++; |
2641 | if (!evas_object_textblock_line_number_geometry_get(rp->object, ln, | 2656 | 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) | |||
2651 | } | 2666 | } |
2652 | _sel_update(c, rp->object, rp->entry_data); | 2667 | _sel_update(c, rp->object, rp->entry_data); |
2653 | 2668 | ||
2654 | _edje_entry_imf_context_reset(en); | ||
2655 | _edje_entry_imf_cursor_info_set(en); | 2669 | _edje_entry_imf_cursor_info_set(en); |
2656 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2670 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
2657 | _edje_entry_real_part_configure(rp); | 2671 | _edje_entry_real_part_configure(rp); |
@@ -2664,10 +2678,12 @@ _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2664 | Entry *en = rp->entry_data; | 2678 | Entry *en = rp->entry_data; |
2665 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2679 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2666 | if (!c) return; | 2680 | if (!c) return; |
2681 | |||
2682 | _edje_entry_imf_context_reset(en); | ||
2683 | |||
2667 | evas_textblock_cursor_paragraph_first(c); | 2684 | evas_textblock_cursor_paragraph_first(c); |
2668 | _sel_update(c, rp->object, rp->entry_data); | 2685 | _sel_update(c, rp->object, rp->entry_data); |
2669 | 2686 | ||
2670 | _edje_entry_imf_context_reset(en); | ||
2671 | _edje_entry_imf_cursor_info_set(en); | 2687 | _edje_entry_imf_cursor_info_set(en); |
2672 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2688 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
2673 | _edje_entry_real_part_configure(rp); | 2689 | _edje_entry_real_part_configure(rp); |
@@ -2679,10 +2695,12 @@ _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2679 | Entry *en = rp->entry_data; | 2695 | Entry *en = rp->entry_data; |
2680 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2696 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2681 | if (!c) return; | 2697 | if (!c) return; |
2698 | |||
2699 | _edje_entry_imf_context_reset(en); | ||
2700 | |||
2682 | _curs_end(c, rp->object, rp->entry_data); | 2701 | _curs_end(c, rp->object, rp->entry_data); |
2683 | _sel_update(c, rp->object, rp->entry_data); | 2702 | _sel_update(c, rp->object, rp->entry_data); |
2684 | 2703 | ||
2685 | _edje_entry_imf_context_reset(en); | ||
2686 | _edje_entry_imf_cursor_info_set(en); | 2704 | _edje_entry_imf_cursor_info_set(en); |
2687 | 2705 | ||
2688 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2706 | _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) | |||
2715 | Entry *en = rp->entry_data; | 2733 | Entry *en = rp->entry_data; |
2716 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2734 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2717 | if (!c) return; | 2735 | if (!c) return; |
2736 | _edje_entry_imf_context_reset(en); | ||
2737 | |||
2718 | evas_textblock_cursor_line_char_first(c); | 2738 | evas_textblock_cursor_line_char_first(c); |
2719 | _sel_update(c, rp->object, rp->entry_data); | 2739 | _sel_update(c, rp->object, rp->entry_data); |
2720 | 2740 | ||
2721 | _edje_entry_imf_context_reset(en); | ||
2722 | _edje_entry_imf_cursor_info_set(en); | 2741 | _edje_entry_imf_cursor_info_set(en); |
2723 | 2742 | ||
2724 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2743 | _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) | |||
2731 | Entry *en = rp->entry_data; | 2750 | Entry *en = rp->entry_data; |
2732 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2751 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2733 | if (!c) return; | 2752 | if (!c) return; |
2753 | _edje_entry_imf_context_reset(en); | ||
2734 | evas_textblock_cursor_line_char_last(c); | 2754 | evas_textblock_cursor_line_char_last(c); |
2735 | _sel_update(c, rp->object, rp->entry_data); | 2755 | _sel_update(c, rp->object, rp->entry_data); |
2736 | 2756 | ||
2737 | _edje_entry_imf_context_reset(en); | ||
2738 | _edje_entry_imf_cursor_info_set(en); | 2757 | _edje_entry_imf_cursor_info_set(en); |
2739 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2758 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
2740 | _edje_entry_real_part_configure(rp); | 2759 | _edje_entry_real_part_configure(rp); |
@@ -2766,7 +2785,7 @@ _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2766 | return evas_textblock_cursor_format_is_visible_get(c); | 2785 | return evas_textblock_cursor_format_is_visible_get(c); |
2767 | } | 2786 | } |
2768 | 2787 | ||
2769 | const char * | 2788 | char * |
2770 | _edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur) | 2789 | _edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur) |
2771 | { | 2790 | { |
2772 | static char *s = NULL; | 2791 | static char *s = NULL; |
@@ -2793,10 +2812,10 @@ _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos) | |||
2793 | if (evas_textblock_cursor_pos_get(c) == pos) | 2812 | if (evas_textblock_cursor_pos_get(c) == pos) |
2794 | return; | 2813 | return; |
2795 | 2814 | ||
2815 | _edje_entry_imf_context_reset(en); | ||
2796 | evas_textblock_cursor_pos_set(c, pos); | 2816 | evas_textblock_cursor_pos_set(c, pos); |
2797 | _sel_update(c, rp->object, rp->entry_data); | 2817 | _sel_update(c, rp->object, rp->entry_data); |
2798 | 2818 | ||
2799 | _edje_entry_imf_context_reset(en); | ||
2800 | _edje_entry_imf_cursor_info_set(en); | 2819 | _edje_entry_imf_cursor_info_set(en); |
2801 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 2820 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
2802 | _edje_entry_real_part_configure(rp); | 2821 | _edje_entry_real_part_configure(rp); |
@@ -2891,43 +2910,33 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx __UNU | |||
2891 | return EINA_TRUE; | 2910 | return EINA_TRUE; |
2892 | } | 2911 | } |
2893 | 2912 | ||
2894 | static Eina_Bool | 2913 | static void |
2895 | _edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) | 2914 | _edje_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, void *event_info) |
2896 | { | 2915 | { |
2897 | Edje *ed = data; | 2916 | Edje *ed = data; |
2898 | Edje_Real_Part *rp = ed->focused_part; | 2917 | Edje_Real_Part *rp = ed->focused_part; |
2899 | Entry *en; | 2918 | Entry *en; |
2900 | Ecore_IMF_Event_Commit *ev = event; | 2919 | char *commit_str = event_info; |
2901 | Evas_Textblock_Cursor *tc; | 2920 | int start_pos; |
2902 | Eina_Bool cursor_move = EINA_FALSE; | ||
2903 | 2921 | ||
2904 | if ((!rp) || (!ev) || (!ev->str)) return ECORE_CALLBACK_PASS_ON; | 2922 | if ((!rp)) return; |
2905 | 2923 | ||
2906 | en = rp->entry_data; | 2924 | en = rp->entry_data; |
2907 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || | 2925 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || |
2908 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) | 2926 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) |
2909 | return ECORE_CALLBACK_PASS_ON; | 2927 | return; |
2910 | |||
2911 | if (!en->imf_context) return ECORE_CALLBACK_PASS_ON; | ||
2912 | if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; | ||
2913 | 2928 | ||
2914 | if (en->have_selection) | 2929 | if (en->have_selection) |
2915 | { | 2930 | { |
2916 | if (strcmp(ev->str, "")) | 2931 | if (strcmp(commit_str, "")) |
2917 | { | 2932 | { |
2918 | /* delete selected characters */ | 2933 | /* delete selected characters */ |
2919 | _range_del(en->cursor, rp->object, en); | 2934 | _range_del_emit(ed, en->cursor, rp->object, en); |
2920 | _sel_clear(en->cursor, rp->object, en); | 2935 | _sel_clear(en->cursor, rp->object, en); |
2921 | } | 2936 | } |
2922 | } | 2937 | } |
2923 | 2938 | ||
2924 | tc = evas_object_textblock_cursor_new(rp->object); | 2939 | start_pos = evas_textblock_cursor_pos_get(en->cursor); |
2925 | |||
2926 | /* calculate the cursor position to insert commit string */ | ||
2927 | if (en->preedit_start) | ||
2928 | evas_textblock_cursor_copy(en->preedit_start, tc); | ||
2929 | else | ||
2930 | evas_textblock_cursor_copy(en->cursor, tc); | ||
2931 | 2940 | ||
2932 | #ifdef HAVE_ECORE_IMF | 2941 | #ifdef HAVE_ECORE_IMF |
2933 | /* delete preedit characters */ | 2942 | /* delete preedit characters */ |
@@ -2935,17 +2944,16 @@ _edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) | |||
2935 | _preedit_clear(en); | 2944 | _preedit_clear(en); |
2936 | #endif | 2945 | #endif |
2937 | 2946 | ||
2938 | if (evas_textblock_cursor_compare(en->cursor, tc)) | ||
2939 | cursor_move = EINA_TRUE; | ||
2940 | if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && | 2947 | if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && |
2941 | _edje_password_show_last) | 2948 | _edje_password_show_last) |
2942 | _edje_entry_hide_visible_password(en->rp); | 2949 | _edje_entry_hide_visible_password(en->rp); |
2943 | if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && | 2950 | if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && |
2944 | _edje_password_show_last && (!en->preedit_start)) | 2951 | _edje_password_show_last && (!en->preedit_start)) |
2945 | { | 2952 | { |
2946 | _text_filter_format_prepend(en, tc, "+ password=off"); | 2953 | _text_filter_format_prepend(en, en->cursor, "+ password=off"); |
2947 | _text_filter_markup_prepend(en, tc, ev->str); | 2954 | _text_filter_text_prepend(en, en->cursor, commit_str); |
2948 | _text_filter_format_prepend(en, tc, "- password"); | 2955 | _text_filter_format_prepend(en, en->cursor, "- password"); |
2956 | |||
2949 | if (en->pw_timer) | 2957 | if (en->pw_timer) |
2950 | { | 2958 | { |
2951 | ecore_timer_del(en->pw_timer); | 2959 | ecore_timer_del(en->pw_timer); |
@@ -2955,51 +2963,54 @@ _edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event) | |||
2955 | _password_timer_cb, en); | 2963 | _password_timer_cb, en); |
2956 | } | 2964 | } |
2957 | else | 2965 | else |
2958 | _text_filter_text_prepend(en, tc, ev->str); | 2966 | _text_filter_text_prepend(en, en->cursor, commit_str); |
2959 | |||
2960 | if (!cursor_move) | ||
2961 | { | ||
2962 | /* move cursor to the end of commit string */ | ||
2963 | evas_textblock_cursor_copy(tc, en->cursor); | ||
2964 | } | ||
2965 | 2967 | ||
2966 | evas_textblock_cursor_free(tc); | ||
2967 | 2968 | ||
2968 | _edje_entry_imf_cursor_info_set(en); | 2969 | _edje_entry_imf_cursor_info_set(en); |
2969 | _anchors_get(en->cursor, rp->object, en); | 2970 | _anchors_get(en->cursor, rp->object, en); |
2970 | _edje_emit(rp->edje, "entry,changed", rp->part->name); | 2971 | _edje_emit(rp->edje, "entry,changed", rp->part->name); |
2971 | _edje_emit(ed, "entry,changed,user", rp->part->name); | ||
2972 | _edje_emit(ed, "cursor,changed", rp->part->name); | ||
2973 | 2972 | ||
2974 | return ECORE_CALLBACK_DONE; | 2973 | { |
2974 | Edje_Entry_Change_Info *info = calloc(1, sizeof(*info)); | ||
2975 | info->insert = EINA_TRUE; | ||
2976 | info->change.insert.pos = start_pos; | ||
2977 | info->change.insert.content = eina_stringshare_add(commit_str); | ||
2978 | info->change.insert.plain_length = | ||
2979 | eina_unicode_utf8_get_len(info->change.insert.content); | ||
2980 | _edje_emit_full(ed, "entry,changed,user", rp->part->name, | ||
2981 | info, _free_entry_change_info); | ||
2982 | _edje_emit(ed, "cursor,changed", rp->part->name); | ||
2983 | } | ||
2975 | } | 2984 | } |
2976 | 2985 | ||
2977 | static Eina_Bool | 2986 | static void |
2978 | _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void *event) | 2987 | _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, void *event_info __UNUSED__) |
2979 | { | 2988 | { |
2980 | Edje *ed = data; | 2989 | Edje *ed = data; |
2981 | Edje_Real_Part *rp = ed->focused_part; | 2990 | Edje_Real_Part *rp = ed->focused_part; |
2982 | Entry *en; | 2991 | Entry *en; |
2983 | Ecore_IMF_Event_Preedit_Changed *ev = event; | ||
2984 | int cursor_pos; | 2992 | int cursor_pos; |
2985 | int preedit_start_pos, preedit_end_pos; | 2993 | int preedit_start_pos, preedit_end_pos; |
2986 | char *preedit_string; | 2994 | char *preedit_string; |
2987 | int i; | 2995 | int i; |
2988 | Eina_Bool preedit_end_state = EINA_FALSE; | 2996 | Eina_Bool preedit_end_state = EINA_FALSE; |
2997 | Eina_List *attrs = NULL, *l = NULL; | ||
2998 | Ecore_IMF_Preedit_Attr *attr; | ||
2999 | Eina_Strbuf *buf; | ||
2989 | 3000 | ||
2990 | if ((!rp) || (!ev)) return ECORE_CALLBACK_PASS_ON; | 3001 | if ((!rp)) return; |
2991 | 3002 | ||
2992 | en = rp->entry_data; | 3003 | en = rp->entry_data; |
2993 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || | 3004 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || |
2994 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) | 3005 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) |
2995 | return ECORE_CALLBACK_PASS_ON; | 3006 | return; |
2996 | |||
2997 | if (!en->imf_context) return ECORE_CALLBACK_PASS_ON; | ||
2998 | 3007 | ||
2999 | if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; | 3008 | if (!en->imf_context) return; |
3000 | 3009 | ||
3001 | ecore_imf_context_preedit_string_get(en->imf_context, &preedit_string, &cursor_pos); | 3010 | ecore_imf_context_preedit_string_with_attributes_get(en->imf_context, |
3002 | if (!preedit_string) return ECORE_CALLBACK_PASS_ON; | 3011 | &preedit_string, |
3012 | &attrs, &cursor_pos); | ||
3013 | if (!preedit_string) return; | ||
3003 | 3014 | ||
3004 | if (!strcmp(preedit_string, "")) | 3015 | if (!strcmp(preedit_string, "")) |
3005 | preedit_end_state = EINA_TRUE; | 3016 | preedit_end_state = EINA_TRUE; |
@@ -3007,7 +3018,7 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * | |||
3007 | if (en->have_selection && !preedit_end_state) | 3018 | if (en->have_selection && !preedit_end_state) |
3008 | { | 3019 | { |
3009 | /* delete selected characters */ | 3020 | /* delete selected characters */ |
3010 | _range_del(en->cursor, rp->object, en); | 3021 | _range_del_emit(ed, en->cursor, rp->object, en); |
3011 | _sel_clear(en->cursor, rp->object, en); | 3022 | _sel_clear(en->cursor, rp->object, en); |
3012 | } | 3023 | } |
3013 | 3024 | ||
@@ -3017,23 +3028,51 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * | |||
3017 | preedit_start_pos = evas_textblock_cursor_pos_get(en->cursor); | 3028 | preedit_start_pos = evas_textblock_cursor_pos_get(en->cursor); |
3018 | 3029 | ||
3019 | /* insert preedit character(s) */ | 3030 | /* insert preedit character(s) */ |
3020 | if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && | 3031 | if (strlen(preedit_string) > 0) |
3021 | _edje_password_show_last) | ||
3022 | { | 3032 | { |
3023 | _text_filter_format_prepend(en, en->cursor, "+ password=off"); | 3033 | buf = eina_strbuf_new(); |
3024 | _text_filter_markup_prepend(en, en->cursor, preedit_string); | 3034 | if (attrs) |
3025 | _text_filter_format_prepend(en, en->cursor, "- password"); | ||
3026 | if (en->pw_timer) | ||
3027 | { | 3035 | { |
3028 | ecore_timer_del(en->pw_timer); | 3036 | EINA_LIST_FOREACH(attrs, l, attr) |
3029 | en->pw_timer = NULL; | 3037 | { |
3038 | if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1) | ||
3039 | { | ||
3040 | eina_strbuf_append(buf, "<preedit>"); | ||
3041 | eina_strbuf_append_n(buf, preedit_string + attr->start_index, | ||
3042 | attr->end_index - attr->start_index); | ||
3043 | eina_strbuf_append(buf, "</preedit>"); | ||
3044 | } | ||
3045 | |||
3046 | else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2 || | ||
3047 | attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3) | ||
3048 | { | ||
3049 | eina_strbuf_append(buf, "<preedit_sel>"); | ||
3050 | eina_strbuf_append_n(buf, preedit_string + attr->start_index, | ||
3051 | attr->end_index - attr->start_index); | ||
3052 | eina_strbuf_append(buf, "</preedit_sel>"); | ||
3053 | } | ||
3054 | } | ||
3030 | } | 3055 | } |
3031 | en->pw_timer = ecore_timer_add(_edje_password_show_last_timeout, | 3056 | if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && |
3032 | _password_timer_cb, en); | 3057 | _edje_password_show_last) |
3033 | } | 3058 | { |
3034 | else | 3059 | _edje_entry_hide_visible_password(en->rp); |
3035 | { | 3060 | _text_filter_format_prepend(en, en->cursor, "+ password=off"); |
3036 | _text_filter_markup_prepend(en, en->cursor, preedit_string); | 3061 | _text_filter_markup_prepend(en, en->cursor, eina_strbuf_string_get(buf)); |
3062 | _text_filter_format_prepend(en, en->cursor, "- password"); | ||
3063 | if (en->pw_timer) | ||
3064 | { | ||
3065 | ecore_timer_del(en->pw_timer); | ||
3066 | en->pw_timer = NULL; | ||
3067 | } | ||
3068 | en->pw_timer = ecore_timer_add(_edje_password_show_last_timeout, | ||
3069 | _password_timer_cb, en); | ||
3070 | } | ||
3071 | else | ||
3072 | { | ||
3073 | _text_filter_markup_prepend(en, en->cursor, eina_strbuf_string_get(buf)); | ||
3074 | } | ||
3075 | eina_strbuf_free(buf); | ||
3037 | } | 3076 | } |
3038 | 3077 | ||
3039 | if (!preedit_end_state) | 3078 | if (!preedit_end_state) |
@@ -3066,29 +3105,30 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void * | |||
3066 | _edje_emit(rp->edje, "preedit,changed", rp->part->name); | 3105 | _edje_emit(rp->edje, "preedit,changed", rp->part->name); |
3067 | _edje_emit(ed, "cursor,changed", rp->part->name); | 3106 | _edje_emit(ed, "cursor,changed", rp->part->name); |
3068 | 3107 | ||
3069 | free(preedit_string); | 3108 | /* delete attribute list */ |
3109 | if (attrs) | ||
3110 | { | ||
3111 | EINA_LIST_FREE(attrs, attr) free(attr); | ||
3112 | } | ||
3070 | 3113 | ||
3071 | return ECORE_CALLBACK_DONE; | 3114 | free(preedit_string); |
3072 | } | 3115 | } |
3073 | 3116 | ||
3074 | static Eina_Bool | 3117 | static void |
3075 | _edje_entry_imf_event_delete_surrounding_cb(void *data, int type __UNUSED__, void *event) | 3118 | _edje_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, void *event_info) |
3076 | { | 3119 | { |
3077 | Edje *ed = data; | 3120 | Edje *ed = data; |
3078 | Edje_Real_Part *rp = ed->focused_part; | 3121 | Edje_Real_Part *rp = ed->focused_part; |
3079 | Entry *en; | 3122 | Entry *en; |
3080 | Ecore_IMF_Event_Delete_Surrounding *ev = event; | 3123 | Ecore_IMF_Event_Delete_Surrounding *ev = event_info; |
3081 | Evas_Textblock_Cursor *del_start, *del_end; | 3124 | Evas_Textblock_Cursor *del_start, *del_end; |
3082 | int cursor_pos; | 3125 | int cursor_pos; |
3083 | 3126 | ||
3084 | if ((!rp) || (!ev)) return ECORE_CALLBACK_PASS_ON; | 3127 | if ((!rp) || (!ev)) return; |
3085 | en = rp->entry_data; | 3128 | en = rp->entry_data; |
3086 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || | 3129 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || |
3087 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) | 3130 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) |
3088 | return ECORE_CALLBACK_PASS_ON; | 3131 | return; |
3089 | |||
3090 | if (!en->imf_context) return ECORE_CALLBACK_PASS_ON; | ||
3091 | if (en->imf_context != ev->ctx) return ECORE_CALLBACK_PASS_ON; | ||
3092 | 3132 | ||
3093 | cursor_pos = evas_textblock_cursor_pos_get(en->cursor); | 3133 | cursor_pos = evas_textblock_cursor_pos_get(en->cursor); |
3094 | 3134 | ||
@@ -3102,8 +3142,6 @@ _edje_entry_imf_event_delete_surrounding_cb(void *data, int type __UNUSED__, voi | |||
3102 | 3142 | ||
3103 | evas_textblock_cursor_free(del_start); | 3143 | evas_textblock_cursor_free(del_start); |
3104 | evas_textblock_cursor_free(del_end); | 3144 | evas_textblock_cursor_free(del_end); |
3105 | |||
3106 | return ECORE_CALLBACK_DONE; | ||
3107 | } | 3145 | } |
3108 | #endif | 3146 | #endif |
3109 | 3147 | ||
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 | |||
262 | { | 262 | { |
263 | Edje *ed; | 263 | Edje *ed; |
264 | Evas *tev; | 264 | Evas *tev; |
265 | Edje_Real_Part *rp; | ||
266 | Eina_List *textblocks = NULL; | ||
267 | Eina_List *sources = NULL; | ||
268 | Eina_List *externals = NULL; | ||
265 | Eina_List *old_swallows; | 269 | Eina_List *old_swallows; |
266 | unsigned int n; | 270 | unsigned int n; |
267 | Eina_List *parts = NULL; | 271 | Eina_List *parts = NULL; |
@@ -323,7 +327,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
323 | else | 327 | else |
324 | { | 328 | { |
325 | unsigned int i; | 329 | unsigned int i; |
326 | int errors = 0; | ||
327 | 330 | ||
328 | /* colorclass stuff */ | 331 | /* colorclass stuff */ |
329 | for (i = 0; i < ed->collection->parts_count; ++i) | 332 | 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 | |||
333 | 336 | ||
334 | ep = ed->collection->parts[i]; | 337 | ep = ed->collection->parts[i]; |
335 | 338 | ||
336 | if (errors) | ||
337 | break; | ||
338 | /* Register any color classes in this parts descriptions. */ | 339 | /* Register any color classes in this parts descriptions. */ |
339 | if ((ep->default_desc) && (ep->default_desc->color_class)) | 340 | if ((ep->default_desc) && (ep->default_desc->color_class)) |
340 | _edje_color_class_member_add(ed, ep->default_desc->color_class); | 341 | _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 | |||
353 | for (n = 0; n < ed->collection->parts_count; n++) | 354 | for (n = 0; n < ed->collection->parts_count; n++) |
354 | { | 355 | { |
355 | Edje_Part *ep; | 356 | Edje_Part *ep; |
356 | Edje_Real_Part *rp; | ||
357 | 357 | ||
358 | ep = ed->collection->parts[n]; | 358 | ep = ed->collection->parts[n]; |
359 | rp = eina_mempool_malloc(_edje_real_part_mp, sizeof(Edje_Real_Part)); | 359 | rp = eina_mempool_malloc(_edje_real_part_mp, sizeof(Edje_Real_Part)); |
360 | if (!rp) | 360 | if (!rp) |
361 | { | 361 | { |
362 | /* FIXME: destroy all allocated ressource, need to have a common exit point */ | ||
362 | ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | 363 | ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; |
363 | evas_event_thaw(tev); | 364 | evas_event_thaw(tev); |
364 | evas_event_thaw_eval(tev); | 365 | evas_event_thaw_eval(tev); |
@@ -373,7 +374,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
373 | if (!rp->drag) | 374 | if (!rp->drag) |
374 | { | 375 | { |
375 | ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | 376 | ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; |
376 | free(rp); | 377 | eina_mempool_free(_edje_real_part_mp, rp); |
377 | evas_event_thaw(tev); | 378 | evas_event_thaw(tev); |
378 | evas_event_thaw_eval(tev); | 379 | evas_event_thaw_eval(tev); |
379 | return 0; | 380 | return 0; |
@@ -407,9 +408,12 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
407 | rp->object = evas_object_text_add(ed->base.evas); | 408 | rp->object = evas_object_text_add(ed->base.evas); |
408 | evas_object_text_font_source_set(rp->object, ed->path); | 409 | evas_object_text_font_source_set(rp->object, ed->path); |
409 | break; | 410 | break; |
410 | case EDJE_PART_TYPE_SWALLOW: | ||
411 | case EDJE_PART_TYPE_GROUP: | 411 | case EDJE_PART_TYPE_GROUP: |
412 | sources = eina_list_append(sources, rp); | ||
413 | case EDJE_PART_TYPE_SWALLOW: | ||
412 | case EDJE_PART_TYPE_EXTERNAL: | 414 | case EDJE_PART_TYPE_EXTERNAL: |
415 | if (ep->type == EDJE_PART_TYPE_EXTERNAL) | ||
416 | externals = eina_list_append(externals, rp); | ||
413 | rp->object = evas_object_rectangle_add(ed->base.evas); | 417 | rp->object = evas_object_rectangle_add(ed->base.evas); |
414 | evas_object_color_set(rp->object, 0, 0, 0, 0); | 418 | evas_object_color_set(rp->object, 0, 0, 0, 0); |
415 | evas_object_pass_events_set(rp->object, 1); | 419 | 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 | |||
417 | _edje_callbacks_focus_add(rp->object, ed, rp); | 421 | _edje_callbacks_focus_add(rp->object, ed, rp); |
418 | break; | 422 | break; |
419 | case EDJE_PART_TYPE_TEXTBLOCK: | 423 | case EDJE_PART_TYPE_TEXTBLOCK: |
424 | textblocks = eina_list_append(textblocks, rp); | ||
420 | rp->object = evas_object_textblock_add(ed->base.evas); | 425 | rp->object = evas_object_textblock_add(ed->base.evas); |
421 | break; | 426 | break; |
422 | case EDJE_PART_TYPE_BOX: | 427 | case EDJE_PART_TYPE_BOX: |
428 | sources = eina_list_append(sources, rp); | ||
423 | rp->object = evas_object_box_add(ed->base.evas); | 429 | rp->object = evas_object_box_add(ed->base.evas); |
424 | rp->anim = _edje_box_layout_anim_new(rp->object); | 430 | rp->anim = _edje_box_layout_anim_new(rp->object); |
425 | break; | 431 | break; |
426 | case EDJE_PART_TYPE_TABLE: | 432 | case EDJE_PART_TYPE_TABLE: |
433 | sources = eina_list_append(sources, rp); | ||
427 | rp->object = evas_object_table_add(ed->base.evas); | 434 | rp->object = evas_object_table_add(ed->base.evas); |
428 | break; | 435 | break; |
429 | case EDJE_PART_TYPE_GRADIENT: | 436 | case EDJE_PART_TYPE_GRADIENT: |
@@ -463,7 +470,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
463 | } | 470 | } |
464 | if (n > 0) | 471 | if (n > 0) |
465 | { | 472 | { |
466 | Edje_Real_Part *rp; | ||
467 | Eina_List *l; | 473 | Eina_List *l; |
468 | 474 | ||
469 | ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n); | 475 | 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 | |||
519 | } | 525 | } |
520 | 526 | ||
521 | rp->swallow_params.min.w = 0; | 527 | rp->swallow_params.min.w = 0; |
522 | rp->swallow_params.min.w = 0; | 528 | rp->swallow_params.min.h = 0; |
523 | rp->swallow_params.max.w = -1; | 529 | rp->swallow_params.max.w = -1; |
524 | rp->swallow_params.max.h = -1; | 530 | rp->swallow_params.max.h = -1; |
525 | 531 | ||
@@ -587,8 +593,6 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
587 | _edje_var_init(ed); | 593 | _edje_var_init(ed); |
588 | for (i = 0; i < ed->table_parts_size; i++) | 594 | for (i = 0; i < ed->table_parts_size; i++) |
589 | { | 595 | { |
590 | Edje_Real_Part *rp; | ||
591 | |||
592 | rp = ed->table_parts[i]; | 596 | rp = ed->table_parts[i]; |
593 | evas_object_show(rp->object); | 597 | evas_object_show(rp->object); |
594 | if (_edje_block_break(ed)) break; | 598 | if (_edje_block_break(ed)) break; |
@@ -599,6 +603,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
599 | _edje_dragable_pos_set(ed, rp, rp->drag->val.x, rp->drag->val.y); | 603 | _edje_dragable_pos_set(ed, rp, rp->drag->val.x, rp->drag->val.y); |
600 | } | 604 | } |
601 | } | 605 | } |
606 | ed->recalc_call = 1; | ||
602 | ed->dirty = 1; | 607 | ed->dirty = 1; |
603 | #ifdef EDJE_CALC_CACHE | 608 | #ifdef EDJE_CALC_CACHE |
604 | ed->all_part_change = 1; | 609 | ed->all_part_change = 1; |
@@ -606,11 +611,28 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
606 | if ((evas_object_clipees_get(ed->base.clipper)) && | 611 | if ((evas_object_clipees_get(ed->base.clipper)) && |
607 | (evas_object_visible_get(obj))) | 612 | (evas_object_visible_get(obj))) |
608 | evas_object_show(ed->base.clipper); | 613 | evas_object_show(ed->base.clipper); |
609 | 614 | ||
610 | /* instantiate 'internal swallows' */ | 615 | /* instantiate 'internal swallows' */ |
611 | for (i = 0; i < ed->table_parts_size; i++) | 616 | EINA_LIST_FREE(externals, rp) |
617 | { | ||
618 | Edje_Part_Description_External *external; | ||
619 | Evas_Object *child_obj; | ||
620 | |||
621 | external = (Edje_Part_Description_External *) rp->part->default_desc; | ||
622 | child_obj = _edje_external_type_add(rp->part->source, | ||
623 | evas_object_evas_get(ed->obj), ed->obj, | ||
624 | external->external_params, rp->part->name); | ||
625 | if (child_obj) | ||
626 | { | ||
627 | _edje_real_part_swallow(rp, child_obj, EINA_TRUE); | ||
628 | rp->param1.external_params = _edje_external_params_parse(child_obj, | ||
629 | external->external_params); | ||
630 | _edje_external_recalc_apply(ed, rp, NULL, rp->chosen_description); | ||
631 | } | ||
632 | } | ||
633 | |||
634 | EINA_LIST_FREE(sources, rp) | ||
612 | { | 635 | { |
613 | Edje_Real_Part *rp; | ||
614 | /* XXX: curr_item and pack_it don't require to be NULL since | 636 | /* XXX: curr_item and pack_it don't require to be NULL since |
615 | * XXX: they are just used when source != NULL and type == BOX, | 637 | * XXX: they are just used when source != NULL and type == BOX, |
616 | * XXX: and they're always set in this case, but GCC fails to | 638 | * 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 | |||
620 | unsigned int item_count = 0; | 642 | unsigned int item_count = 0; |
621 | Edje_Pack_Element *pack_it = NULL; | 643 | Edje_Pack_Element *pack_it = NULL; |
622 | const char *source = NULL; | 644 | const char *source = NULL; |
623 | |||
624 | rp = ed->table_parts[i]; | ||
625 | 645 | ||
626 | switch (rp->part->type) | 646 | switch (rp->part->type) |
627 | { | 647 | { |
@@ -643,25 +663,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
643 | } | 663 | } |
644 | } | 664 | } |
645 | break; | 665 | break; |
646 | case EDJE_PART_TYPE_EXTERNAL: | ||
647 | { | ||
648 | Edje_Part_Description_External *external; | ||
649 | Evas_Object *child_obj; | ||
650 | |||
651 | external = (Edje_Part_Description_External *) rp->part->default_desc; | ||
652 | child_obj = _edje_external_type_add(rp->part->source, | ||
653 | evas_object_evas_get(ed->obj), ed->obj, | ||
654 | external->external_params, rp->part->name); | ||
655 | if (child_obj) | ||
656 | { | ||
657 | _edje_real_part_swallow(rp, child_obj, EINA_TRUE); | ||
658 | rp->param1.external_params = _edje_external_params_parse(child_obj, | ||
659 | external->external_params); | ||
660 | _edje_external_recalc_apply(ed, rp, NULL, rp->chosen_description); | ||
661 | } | ||
662 | } | ||
663 | continue; | ||
664 | default: | 666 | default: |
667 | /* This list should only be filled by group, box or table, nothing else. */ | ||
668 | abort(); | ||
665 | continue; | 669 | continue; |
666 | } | 670 | } |
667 | 671 | ||
@@ -682,6 +686,11 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
682 | { | 686 | { |
683 | if (data == group_path_entry) | 687 | if (data == group_path_entry) |
684 | { | 688 | { |
689 | ERR("recursive loop group '%s' already included inside part '%s' of group '%s' from file '%s'", | ||
690 | group_path_entry, rp->part->name, group, file); | ||
691 | textblocks = eina_list_free(textblocks); | ||
692 | externals = eina_list_free(externals); | ||
693 | sources = eina_list_free(sources); | ||
685 | _edje_thaw(ed); | 694 | _edje_thaw(ed); |
686 | _edje_unblock(ed); | 695 | _edje_unblock(ed); |
687 | _edje_unref(ed); | 696 | _edje_unref(ed); |
@@ -698,7 +707,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
698 | return 0; | 707 | return 0; |
699 | } | 708 | } |
700 | } | 709 | } |
701 | 710 | ||
702 | child_obj = edje_object_add(ed->base.evas); | 711 | child_obj = edje_object_add(ed->base.evas); |
703 | group_path = eina_list_append(group_path, group_path_entry); | 712 | group_path = eina_list_append(group_path, group_path_entry); |
704 | if (rp->part->type == EDJE_PART_TYPE_GROUP) | 713 | 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 | |||
708 | 717 | ||
709 | if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path)) | 718 | if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path)) |
710 | { | 719 | { |
720 | ERR("impossible to set part '%s' of group '%s' from file '%s' to '%s'", | ||
721 | rp->part->name, group_path_entry, file, source); | ||
722 | textblocks = eina_list_free(textblocks); | ||
723 | externals = eina_list_free(externals); | ||
724 | sources = eina_list_free(sources); | ||
711 | _edje_thaw(ed); | 725 | _edje_thaw(ed); |
712 | _edje_unblock(ed); | 726 | _edje_unblock(ed); |
713 | _edje_unref(ed); | 727 | _edje_unref(ed); |
714 | _edje_file_del(ed); | 728 | _edje_file_del(ed); |
715 | 729 | ||
716 | if (group_path_started) | 730 | if (group_path_started) |
717 | { | 731 | { |
718 | while (group_path) | 732 | while (group_path) |
@@ -794,56 +808,51 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
794 | { | 808 | { |
795 | const char *name; | 809 | const char *name; |
796 | Evas_Object *swallow; | 810 | Evas_Object *swallow; |
797 | 811 | ||
798 | name = eina_list_data_get(old_swallows); | 812 | name = eina_list_data_get(old_swallows); |
799 | old_swallows = eina_list_remove_list(old_swallows, old_swallows); | 813 | old_swallows = eina_list_remove_list(old_swallows, old_swallows); |
800 | 814 | ||
801 | swallow = eina_list_data_get(old_swallows); | 815 | swallow = eina_list_data_get(old_swallows); |
802 | old_swallows = eina_list_remove_list(old_swallows, old_swallows); | 816 | old_swallows = eina_list_remove_list(old_swallows, old_swallows); |
803 | 817 | ||
804 | edje_object_part_swallow(obj, name, swallow); | 818 | edje_object_part_swallow(obj, name, swallow); |
805 | eina_stringshare_del(name); | 819 | eina_stringshare_del(name); |
806 | } | 820 | } |
807 | } | 821 | } |
808 | 822 | ||
809 | _edje_recalc(ed); | 823 | _edje_recalc(ed); |
810 | _edje_thaw(ed); | 824 | _edje_thaw(ed); |
811 | _edje_unblock(ed); | 825 | _edje_unblock(ed); |
812 | _edje_unref(ed); | 826 | _edje_unref(ed); |
813 | ed->load_error = EDJE_LOAD_ERROR_NONE; | 827 | ed->load_error = EDJE_LOAD_ERROR_NONE; |
814 | _edje_emit(ed, "load", NULL); | 828 | _edje_emit(ed, "load", NULL); |
815 | /* instantiate 'internal swallows' */ | 829 | |
816 | for (i = 0; i < ed->table_parts_size; i++) | 830 | /* instantiate 'internal textblock style' */ |
817 | { | 831 | EINA_LIST_FREE(textblocks, rp) |
818 | Edje_Real_Part *rp; | 832 | if (rp->part->default_desc) |
819 | 833 | { | |
820 | rp = ed->table_parts[i]; | 834 | Edje_Part_Description_Text *text; |
821 | if ((rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) && | 835 | Edje_Style *stl = NULL; |
822 | (rp->part->default_desc)) | 836 | const char *style; |
823 | { | 837 | |
824 | Edje_Part_Description_Text *text; | 838 | text = (Edje_Part_Description_Text *) rp->part->default_desc; |
825 | Edje_Style *stl = NULL; | 839 | style = edje_string_get(&text->text.style); |
826 | const char *style; | 840 | if (style) |
827 | 841 | { | |
828 | text = (Edje_Part_Description_Text *) rp->part->default_desc; | 842 | Eina_List *l; |
829 | style = edje_string_get(&text->text.style); | 843 | |
830 | if (style) | 844 | EINA_LIST_FOREACH(ed->file->styles, l, stl) |
831 | { | 845 | { |
832 | Eina_List *l; | 846 | if ((stl->name) && (!strcmp(stl->name, style))) break; |
833 | 847 | stl = NULL; | |
834 | EINA_LIST_FOREACH(ed->file->styles, l, stl) | 848 | } |
835 | { | 849 | } |
836 | if ((stl->name) && (!strcmp(stl->name, style))) break; | 850 | if (stl) |
837 | stl = NULL; | 851 | { |
838 | } | 852 | if (evas_object_textblock_style_get(rp->object) != stl->style) |
839 | } | 853 | evas_object_textblock_style_set(rp->object, stl->style); |
840 | if (stl) | 854 | } |
841 | { | 855 | } |
842 | if (evas_object_textblock_style_get(rp->object) != stl->style) | ||
843 | evas_object_textblock_style_set(rp->object, stl->style); | ||
844 | } | ||
845 | } | ||
846 | } | ||
847 | } | 856 | } |
848 | _edje_entry_init(ed); | 857 | _edje_entry_init(ed); |
849 | evas_event_thaw(tev); | 858 | 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] | |||
376 | // nil ~ | 376 | // nil ~ |
377 | 377 | ||
378 | static char * | 378 | static char * |
379 | _elua_push_name(lua_State *L, char *q, int index) // Stack usage [-0, +1, e or m] | 379 | _elua_push_name(lua_State *L, char *q, int idx) // Stack usage [-0, +1, e or m] |
380 | { | 380 | { |
381 | char *p = q; | 381 | char *p = q; |
382 | char temp = '\0'; | 382 | char temp = '\0'; |
@@ -387,8 +387,8 @@ _elua_push_name(lua_State *L, char *q, int index) // Stack usage [-0, +1, e or | |||
387 | q++; | 387 | q++; |
388 | temp = *q; | 388 | temp = *q; |
389 | *q = '\0'; | 389 | *q = '\0'; |
390 | if (index > 0) | 390 | if (idx > 0) |
391 | lua_getfield(L, index, p); // Stack usage [-0, +1, e] | 391 | lua_getfield(L, idx, p); // Stack usage [-0, +1, e] |
392 | else | 392 | else |
393 | lua_pushstring(L, p); // Stack usage [-0, +1, m] | 393 | lua_pushstring(L, p); // Stack usage [-0, +1, m] |
394 | *q = temp; | 394 | *q = temp; |
@@ -614,6 +614,7 @@ static int _elua_echo(lua_State *L); | |||
614 | static int _elua_date(lua_State *L); | 614 | static int _elua_date(lua_State *L); |
615 | static int _elua_looptime(lua_State *L); | 615 | static int _elua_looptime(lua_State *L); |
616 | static int _elua_seconds(lua_State *L); | 616 | static int _elua_seconds(lua_State *L); |
617 | static int _elua_version(lua_State *L); | ||
617 | 618 | ||
618 | static int _elua_objgeom(lua_State *L); | 619 | static int _elua_objgeom(lua_State *L); |
619 | static int _elua_objpos(lua_State *L); | 620 | static int _elua_objpos(lua_State *L); |
@@ -649,6 +650,7 @@ static const struct luaL_reg _elua_edje_funcs [] = | |||
649 | {"date", _elua_date}, // get date in a table | 650 | {"date", _elua_date}, // get date in a table |
650 | {"looptime", _elua_looptime}, // get loop time | 651 | {"looptime", _elua_looptime}, // get loop time |
651 | {"seconds", _elua_seconds}, // get seconds | 652 | {"seconds", _elua_seconds}, // get seconds |
653 | {"version", _elua_version}, // edje version | ||
652 | 654 | ||
653 | // query edje - size, pos | 655 | // query edje - size, pos |
654 | {"geom", _elua_objgeom}, // get while edje object geometry in canvas | 656 | {"geom", _elua_objgeom}, // get while edje object geometry in canvas |
@@ -801,6 +803,25 @@ _elua_seconds(lua_State *L) // Stack usage [-0, +1, -] | |||
801 | return 1; | 803 | return 1; |
802 | } | 804 | } |
803 | 805 | ||
806 | /** | ||
807 | @page luaref | ||
808 | @subsubsection edje_version edje:version() | ||
809 | |||
810 | Retrieves the current edje version number. | ||
811 | |||
812 | @returns A table with these fields: | ||
813 | - integer major: The edje version major number. | ||
814 | - integer minor: The edje version minor number. | ||
815 | |||
816 | @since 1.2.0 | ||
817 | */ | ||
818 | static int | ||
819 | _elua_version(lua_State *L) // Stack usage [-4, +5, em] | ||
820 | { | ||
821 | _elua_ret(L, "%major %minor", EDJE_VERSION_MAJOR, EDJE_VERSION_MINOR); // Stack usage [-4, +5, em] | ||
822 | return 1; | ||
823 | } | ||
824 | |||
804 | //------------- | 825 | //------------- |
805 | /** | 826 | /** |
806 | @page luaref | 827 | @page luaref |
@@ -2936,7 +2957,9 @@ static int _elua_line_xy(lua_State *L) // Stack usage [ | |||
2936 | 2957 | ||
2937 | The lua evas map class includes functions for dealing with evas map objects. | 2958 | The lua evas map class includes functions for dealing with evas map objects. |
2938 | The evas map objects must have been previously created by lua using the lua | 2959 | The evas map objects must have been previously created by lua using the lua |
2939 | map object creation function edje:map(). | 2960 | map object creation function edje:map(). The evas map system is complex, rather |
2961 | than repeat the copious documentation here, please refer to the evas map | ||
2962 | documentation. It has pictures and everything. B-) | ||
2940 | 2963 | ||
2941 | In the following, "map_object" is a place holder for any lua variable that | 2964 | In the following, "map_object" is a place holder for any lua variable that |
2942 | holds a reference to an evas map object. | 2965 | holds a reference to an evas map object. |
@@ -2980,8 +3003,18 @@ static const struct luaL_reg _elua_evas_map_funcs [] = | |||
2980 | 3003 | ||
2981 | /** | 3004 | /** |
2982 | @page luaref | 3005 | @page luaref |
2983 | @subsubsection map_alpha map_object:alpha() | 3006 | @subsubsection map_alpha map_object:alpha(alpha) |
3007 | |||
3008 | Get (and optionally set) the maps alpha mode. | ||
3009 | |||
3010 | Wraps evas_map_alpha_set(). | ||
2984 | 3011 | ||
3012 | @param alpha The alpha mode. | ||
3013 | |||
3014 | Note that the argument is optional, without it this function just queries the | ||
3015 | current value. | ||
3016 | |||
3017 | @return A boolean reflecting the alpha mode. | ||
2985 | 3018 | ||
2986 | @since 1.1.0 | 3019 | @since 1.1.0 |
2987 | */ | 3020 | */ |
@@ -3008,6 +3041,11 @@ _elua_map_alpha(lua_State *L) // Stack usage [ | |||
3008 | @page luaref | 3041 | @page luaref |
3009 | @subsubsection map_clockwise map_object:clockwise() | 3042 | @subsubsection map_clockwise map_object:clockwise() |
3010 | 3043 | ||
3044 | Get the maps clockwise state. | ||
3045 | |||
3046 | Wraps evas_map_util_clockwise_get(). | ||
3047 | |||
3048 | @return A boolean reflecting if the map is clockwise or not. | ||
3011 | 3049 | ||
3012 | @since 1.1.0 | 3050 | @since 1.1.0 |
3013 | */ | 3051 | */ |
@@ -3025,8 +3063,30 @@ _elua_map_clockwise(lua_State *L) // Stack usage [ | |||
3025 | 3063 | ||
3026 | /** | 3064 | /** |
3027 | @page luaref | 3065 | @page luaref |
3028 | @subsubsection map_colour map_object:colour() | 3066 | @subsubsection map_colour map_object:colour(index, r, g, b, a) |
3029 | 3067 | ||
3068 | Gets or sets colour information for the map. There are two variations, with or | ||
3069 | without the index. With the index parameter it gets (and optionally sets) the | ||
3070 | colour of the point the index refers to, without it sets the colour for the | ||
3071 | entire map. | ||
3072 | |||
3073 | Wraps evas_map_point_color_set() or evas_map_util_points_color_set() | ||
3074 | |||
3075 | @param index Which point to change the colour of. | ||
3076 | @param r The new red value. | ||
3077 | @param g The new green value. | ||
3078 | @param b The new blue value. | ||
3079 | @param a The new alpha value. | ||
3080 | |||
3081 | Note that the arguments are optional, without them this function just queries | ||
3082 | the current values. The colour arguments can be separate values, or named | ||
3083 | fields in a table. | ||
3084 | |||
3085 | @return A table with these fields: | ||
3086 | - integer r: The red value. | ||
3087 | - integer g: The green value. | ||
3088 | - integer b: The blue value. | ||
3089 | - integer a: The alpha value. | ||
3030 | 3090 | ||
3031 | @since 1.1.0 | 3091 | @since 1.1.0 |
3032 | */ | 3092 | */ |
@@ -3073,8 +3133,24 @@ _elua_map_colour(lua_State *L) // Stack usage [ | |||
3073 | 3133 | ||
3074 | /** | 3134 | /** |
3075 | @page luaref | 3135 | @page luaref |
3076 | @subsubsection map_coord map_object:coord() | 3136 | @subsubsection map_coord map_object:coord(index, x, y, z) |
3137 | |||
3138 | Gets (and optionally sets) the 3D coordinates of a point on the map. | ||
3139 | |||
3140 | Wraps evas_map_point_coord_set(). | ||
3141 | |||
3142 | @param x The x coordinate of the point. | ||
3143 | @param y The y coordinate of the point. | ||
3144 | @param z The z coordinate of the point. | ||
3145 | |||
3146 | Note that the arguments are optional, without them this function just queries | ||
3147 | the current values. The coordinate arguments can be separate values, or named | ||
3148 | fields in a table. | ||
3077 | 3149 | ||
3150 | @return A table with these fields: | ||
3151 | - integer x: The x coordinate of the point. | ||
3152 | - integer y: The y coordinate of the point. | ||
3153 | - integer z: The z coordinate of the point. | ||
3078 | 3154 | ||
3079 | @since 1.1.0 | 3155 | @since 1.1.0 |
3080 | */ | 3156 | */ |
@@ -3104,8 +3180,21 @@ _elua_map_coord(lua_State *L) // Stack usage [ | |||
3104 | 3180 | ||
3105 | /** | 3181 | /** |
3106 | @page luaref | 3182 | @page luaref |
3107 | @subsubsection map_lighting map_object:lighting() | 3183 | @subsubsection map_lighting map_object:lighting(x, y, z, r, g, b, ar, ag, ab) |
3184 | |||
3185 | Set the 3D lights for the map. The three triplets can be tables. | ||
3108 | 3186 | ||
3187 | Wraps evas_map_util_3d_lighting(). | ||
3188 | |||
3189 | @param x The x coordinate of the light point. | ||
3190 | @param y The y coordinate of the light point. | ||
3191 | @param z The z coordinate of the light point. | ||
3192 | @param r The new red value of the light point. | ||
3193 | @param g The new green value of the light point. | ||
3194 | @param b The new blue value of the light point. | ||
3195 | @param ar The new red value of the ambient light. | ||
3196 | @param ag The new green value of the ambient light. | ||
3197 | @param ab The new blue value of the ambient light. | ||
3109 | 3198 | ||
3110 | @since 1.1.0 | 3199 | @since 1.1.0 |
3111 | */ | 3200 | */ |
@@ -3133,8 +3222,18 @@ _elua_map_lighting(lua_State *L) // Stack usage [ | |||
3133 | 3222 | ||
3134 | /** | 3223 | /** |
3135 | @page luaref | 3224 | @page luaref |
3136 | @subsubsection map_perspective map_object:perspective() | 3225 | @subsubsection map_perspective map_object:perspective(x, y, z, f) |
3226 | |||
3227 | Apply a perspective transform to the map. | ||
3228 | |||
3229 | Wraps evas_map_util_3d_perspective(). | ||
3137 | 3230 | ||
3231 | The arguments can be separate values, or named fields in a table. | ||
3232 | |||
3233 | @param x The perspective distance X coordinate | ||
3234 | @param y The perspective distance Y coordinate | ||
3235 | @param z The "0" z plane value | ||
3236 | @param f The focal distance | ||
3138 | 3237 | ||
3139 | @since 1.1.0 | 3238 | @since 1.1.0 |
3140 | */ | 3239 | */ |
@@ -3156,8 +3255,28 @@ _elua_map_perspective(lua_State *L) // Stack usage [ | |||
3156 | 3255 | ||
3157 | /** | 3256 | /** |
3158 | @page luaref | 3257 | @page luaref |
3159 | @subsubsection map_populate map_object:populate() | 3258 | @subsubsection map_populate map_object:populate(...) |
3259 | |||
3260 | Populate the points in a map, in one of three different methods. | ||
3261 | |||
3262 | 1) Wraps evas_map_util_points_populate_from_object(). | ||
3263 | |||
3264 | @param source An evas object to copy points from. | ||
3265 | |||
3266 | 2) Wraps evas_map_util_paints_populate_from_object_full(). | ||
3267 | |||
3268 | @param source An evas object to copy points from. | ||
3269 | @param z Common Z coordinate hint for all four points. | ||
3160 | 3270 | ||
3271 | 3) Wraps evas_map_util_points_populate_from_geometry(). | ||
3272 | |||
3273 | The first four arguments can be separate values, or named fields in a table. | ||
3274 | |||
3275 | @param x Point X coordinate | ||
3276 | @param y Point Y coordinate | ||
3277 | @param w Width to use to calculate second and third points. | ||
3278 | @param h Height to use to calculate third and fourth points. | ||
3279 | @param z Common Z coordinate hint for all four points. | ||
3161 | 3280 | ||
3162 | @since 1.1.0 | 3281 | @since 1.1.0 |
3163 | */ | 3282 | */ |
@@ -3210,8 +3329,17 @@ _elua_map_populate(lua_State *L) // Stack usage [ | |||
3210 | 3329 | ||
3211 | /** | 3330 | /** |
3212 | @page luaref | 3331 | @page luaref |
3213 | @subsubsection map_rotate map_object:rotate() | 3332 | @subsubsection map_rotate map_object:rotate(degrees, x, y) |
3333 | |||
3334 | Rotate the maps coordinates in 2D. | ||
3214 | 3335 | ||
3336 | Wraps evas_map_util_rotate(). | ||
3337 | |||
3338 | The coordinates can be separate values, or named fields in a table. | ||
3339 | |||
3340 | @param degrees Amount of degrees from 0.0 to 360.0 to rotate. | ||
3341 | @param x Rotation's centre horizontal position. | ||
3342 | @param y Rotation's centre vertical position. | ||
3215 | 3343 | ||
3216 | @since 1.1.0 | 3344 | @since 1.1.0 |
3217 | */ | 3345 | */ |
@@ -3238,8 +3366,21 @@ _elua_map_rotate(lua_State *L) // Stack usage [ | |||
3238 | 3366 | ||
3239 | /** | 3367 | /** |
3240 | @page luaref | 3368 | @page luaref |
3241 | @subsubsection map_rotate3d map_object:rotate3d() | 3369 | @subsubsection map_rotate3d map_object:rotate3d(dx, dy, dz, x, y, z) |
3370 | |||
3371 | Rotate the maps coordinates in 3D. | ||
3242 | 3372 | ||
3373 | Wraps evas_map_util_3d_rotate(). | ||
3374 | |||
3375 | The coordinates can be separate values, or named fields in a table. The same | ||
3376 | with the rotation. | ||
3377 | |||
3378 | @param dx Amount of degrees from 0.0 to 360.0 to rotate around X axis. | ||
3379 | @param dy Amount of degrees from 0.0 to 360.0 to rotate around Y axis. | ||
3380 | @param dz Amount of degrees from 0.0 to 360.0 to rotate around Z axis. | ||
3381 | @param x Rotation's centre horizontal position. | ||
3382 | @param y Rotation's centre vertical position. | ||
3383 | @param z Rotation's centre vertical position. | ||
3243 | 3384 | ||
3244 | @since 1.1.0 | 3385 | @since 1.1.0 |
3245 | */ | 3386 | */ |
@@ -3265,8 +3406,18 @@ _elua_map_rotate3d(lua_State *L) // Stack usage [ | |||
3265 | 3406 | ||
3266 | /** | 3407 | /** |
3267 | @page luaref | 3408 | @page luaref |
3268 | @subsubsection map_smooth map_object:smooth() | 3409 | @subsubsection map_smooth map_object:smooth(smooth) |
3410 | |||
3411 | Get (and optionally set) the maps smooth mode. | ||
3412 | |||
3413 | Wraps evas_map_smooth_set(). | ||
3414 | |||
3415 | @param smooth The smooth mode. | ||
3416 | |||
3417 | Note that the argument is optional, without it this function just queries the | ||
3418 | current value. | ||
3269 | 3419 | ||
3420 | @return A boolean reflecting the smooth mode. | ||
3270 | 3421 | ||
3271 | @since 1.1.0 | 3422 | @since 1.1.0 |
3272 | */ | 3423 | */ |
@@ -3291,8 +3442,23 @@ _elua_map_smooth(lua_State *L) // Stack usage [ | |||
3291 | 3442 | ||
3292 | /** | 3443 | /** |
3293 | @page luaref | 3444 | @page luaref |
3294 | @subsubsection map_uv map_object:uv() | 3445 | @subsubsection map_uv map_object:uv(index, u, v) |
3446 | |||
3447 | Gets (and optionally sets) the texture U and V texture coordinates for this map. | ||
3448 | |||
3449 | Wraps evas_map_point_image_uv_set(). | ||
3450 | |||
3451 | @param index Index of the point to change. Must be smaller than map size. | ||
3452 | @param u The X coordinate within the image/texture source. | ||
3453 | @param v The Y coordinate within the image/texture source. | ||
3454 | |||
3455 | Note that the U,V arguments are optional, without them this function just queries | ||
3456 | the current values. The coordinate arguments can be separate values, or named | ||
3457 | fields in a table. | ||
3295 | 3458 | ||
3459 | @return A table with these fields: | ||
3460 | - number u: The X coordinate within the image/texture source. | ||
3461 | - number v: The Y coordinate within the image/texture source. | ||
3296 | 3462 | ||
3297 | @since 1.1.0 | 3463 | @since 1.1.0 |
3298 | */ | 3464 | */ |
@@ -3322,8 +3488,18 @@ _elua_map_uv(lua_State *L) // Stack usage [ | |||
3322 | 3488 | ||
3323 | /** | 3489 | /** |
3324 | @page luaref | 3490 | @page luaref |
3325 | @subsubsection map_zoom map_object:zoom() | 3491 | @subsubsection map_zoom map_object:zoom(x, y, x, y) |
3492 | |||
3493 | Apply a zoom to the map. | ||
3494 | |||
3495 | Wraps evas_map_util_zoom(). | ||
3326 | 3496 | ||
3497 | The arguments can be two separate values, or named fields in a table. | ||
3498 | |||
3499 | @param x The horizontal zoom amount. | ||
3500 | @param y The vertical zoom amount. | ||
3501 | @param x The X coordinate of the centre of the zoom. | ||
3502 | @param y The Y coordinate of the centre of the zoom. | ||
3327 | 3503 | ||
3328 | @since 1.1.0 | 3504 | @since 1.1.0 |
3329 | */ | 3505 | */ |
@@ -3530,7 +3706,7 @@ _elua_text_font(lua_State *L) // Stack usage [ | |||
3530 | @page luaref | 3706 | @page luaref |
3531 | @subsubsection text_text text_object:text(text) | 3707 | @subsubsection text_text text_object:text(text) |
3532 | 3708 | ||
3533 | Get (and optionally set) the actual tetx for this text object. | 3709 | Get (and optionally set) the actual text for this text object. |
3534 | 3710 | ||
3535 | Wraps evas_object_text_text_set(). | 3711 | Wraps evas_object_text_text_set(). |
3536 | 3712 | ||
@@ -3569,25 +3745,80 @@ _elua_text_text(lua_State *L) // Stack usage [ | |||
3569 | 3745 | ||
3570 | 3746 | ||
3571 | //--------------------------------------------------------------------------// | 3747 | //--------------------------------------------------------------------------// |
3748 | |||
3749 | // A metatable and functions so that calling non existant API does not crash Lua scripts. | ||
3750 | |||
3751 | static int _elua_bogan_nilfunc(lua_State *L); | ||
3752 | static int _elua_bogan_index(lua_State *L); | ||
3753 | |||
3754 | static const struct luaL_reg _elua_bogan_funcs [] = | ||
3755 | { | ||
3756 | {"nilfunc", _elua_bogan_nilfunc}, // Just return a nil. | ||
3757 | {"__index", _elua_bogan_index}, // Return the above func. | ||
3758 | |||
3759 | {NULL, NULL} // end | ||
3760 | }; | ||
3761 | |||
3762 | static int | ||
3763 | _elua_bogan_nilfunc(lua_State *L) | ||
3764 | { | ||
3765 | lua_getglobal(L, "nil"); | ||
3766 | return 1; | ||
3767 | } | ||
3768 | |||
3769 | static int | ||
3770 | _elua_bogan_index(lua_State *L) | ||
3771 | { | ||
3772 | const char *key; | ||
3773 | |||
3774 | key = lua_tostring(L, 2); | ||
3775 | LE("%s does not exist!", key); | ||
3776 | lua_pushcfunction(L, _elua_bogan_nilfunc); | ||
3777 | return 1; | ||
3778 | } | ||
3779 | |||
3780 | static void | ||
3781 | _elua_bogan_protect(lua_State *L) // Stack usage [-3, +3, m] | ||
3782 | { | ||
3783 | lua_pushnil(L); // Stack usage [-0, +1, -] | ||
3784 | luaL_newmetatable(L, "bogan"); // Stack usage [-0, +1, m] | ||
3785 | luaL_register(L, 0, _elua_bogan_funcs); // Stack usage [-1, +1, m] | ||
3786 | lua_setmetatable(L, -2); // Stack usage [-1, +0, -] | ||
3787 | lua_pop(L, 1); // Stack usage [-1, +0, -] | ||
3788 | } | ||
3789 | |||
3790 | //--------------------------------------------------------------------------// | ||
3791 | |||
3572 | // Brain dead inheritance thingy, built for speed. Kinda. Part 1. | 3792 | // Brain dead inheritance thingy, built for speed. Kinda. Part 1. |
3573 | static void | 3793 | static void |
3574 | _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] | 3794 | _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] |
3575 | { | 3795 | { |
3796 | // Create an api table, fill it full of the methods. | ||
3576 | luaL_register(L, api, funcs); // Stack usage [-0, +1, m] | 3797 | luaL_register(L, api, funcs); // Stack usage [-0, +1, m] |
3798 | // Set the api metatable to the bogan metatable. | ||
3799 | luaL_getmetatable(L, "bogan"); // Stack usage [-0, +1, -] | ||
3800 | lua_setmetatable(L, -2); // Stack usage [-1, +0, -] | ||
3801 | // Creat a meta metatable. | ||
3577 | luaL_newmetatable(L, meta); // Stack usage [-0, +1, m] | 3802 | luaL_newmetatable(L, meta); // Stack usage [-0, +1, m] |
3803 | // Put the gc functions in the metatable. | ||
3578 | luaL_register(L, 0, _elua_edje_gc_funcs); // Stack usage [-1, +1, m] | 3804 | luaL_register(L, 0, _elua_edje_gc_funcs); // Stack usage [-1, +1, m] |
3805 | // Create an __index entry in the metatable, make it point to the api table. | ||
3579 | lua_pushliteral(L, "__index"); // Stack usage [-0, +1, m] | 3806 | lua_pushliteral(L, "__index"); // Stack usage [-0, +1, m] |
3580 | lua_pushvalue(L, -3); // Stack usage [-0, +1, -] | 3807 | lua_pushvalue(L, -3); // Stack usage [-0, +1, -] |
3581 | lua_rawset(L, -3); // Stack usage [-2, +0, m] | 3808 | lua_rawset(L, -3); // Stack usage [-2, +0, m] |
3809 | // Later this metatable is used as the metatable for newly created objects of this class. | ||
3582 | 3810 | ||
3583 | if (base && parent) | 3811 | if (base && parent) |
3584 | { | 3812 | { |
3585 | // Inherit from base | 3813 | // Inherit from base |
3586 | lua_getglobal(L, base); // Stack usage [-0, +1, e] | 3814 | lua_getglobal(L, base); // Stack usage [-0, +1, e] |
3815 | // Create a new parent metatable. | ||
3587 | luaL_newmetatable(L, parent); // Stack usage [-0, +1, m] | 3816 | luaL_newmetatable(L, parent); // Stack usage [-0, +1, m] |
3817 | // Create an __index entry in the metatable, make it point to the base table. | ||
3588 | lua_pushliteral(L, "__index"); // Stack usage [-0, +1, m] | 3818 | lua_pushliteral(L, "__index"); // Stack usage [-0, +1, m] |
3589 | lua_pushvalue(L, -3); // Stack usage [-0, +1, -] | 3819 | lua_pushvalue(L, -3); // Stack usage [-0, +1, -] |
3590 | lua_rawset(L, -3); // Stack usage [-2, +0, m] | 3820 | lua_rawset(L, -3); // Stack usage [-2, +0, m] |
3821 | // Set the metatable for the api table to the parent metatable. | ||
3591 | lua_getglobal(L, api); // Stack usage [-0, +1, e] | 3822 | lua_getglobal(L, api); // Stack usage [-0, +1, e] |
3592 | luaL_getmetatable(L, parent); // Stack usage [-0, +1, -] | 3823 | luaL_getmetatable(L, parent); // Stack usage [-0, +1, -] |
3593 | lua_setmetatable(L, -2); // Stack usage [-1, +0, -] | 3824 | lua_setmetatable(L, -2); // Stack usage [-1, +0, -] |
@@ -3695,7 +3926,11 @@ _edje_lua2_script_init(Edje *ed) // Stack usage | |||
3695 | lua_call(L, 1, 0); // Stack usage [-2, +0, m] | 3926 | lua_call(L, 1, 0); // Stack usage [-2, +0, m] |
3696 | } | 3927 | } |
3697 | 3928 | ||
3929 | _elua_bogan_protect(L); // Stack usage [+3, -3, m] | ||
3930 | |||
3698 | luaL_register(L, _elua_edje_api, _elua_edje_funcs); // Stack usage [-0, +1, m] | 3931 | luaL_register(L, _elua_edje_api, _elua_edje_funcs); // Stack usage [-0, +1, m] |
3932 | luaL_getmetatable(L, "bogan"); // Stack usage [-0, +1, -] | ||
3933 | lua_setmetatable(L, -2); // Stack usage [-1, +0, -] | ||
3699 | luaL_newmetatable(L, _elua_edje_meta); // Stack usage [-0, +1, m] | 3934 | luaL_newmetatable(L, _elua_edje_meta); // Stack usage [-0, +1, m] |
3700 | luaL_register(L, 0, _elua_edje_gc_funcs); // Stack usage [-1, +1, m] | 3935 | luaL_register(L, 0, _elua_edje_gc_funcs); // Stack usage [-1, +1, m] |
3701 | 3936 | ||
@@ -3737,6 +3972,8 @@ _edje_lua2_script_init(Edje *ed) // Stack usage | |||
3737 | { | 3972 | { |
3738 | int err; | 3973 | int err; |
3739 | 3974 | ||
3975 | /* This ends up pushing a function onto the stack for the lua_pcall() below to use. | ||
3976 | * The function is the compiled code. */ | ||
3740 | err = luaL_loadbuffer(L, data, size, "edje_lua_script"); // Stack usage [-0, +1, m] | 3977 | err = luaL_loadbuffer(L, data, size, "edje_lua_script"); // Stack usage [-0, +1, m] |
3741 | if (err) | 3978 | if (err) |
3742 | { | 3979 | { |
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) | |||
22 | srand(time(NULL)); | 22 | srand(time(NULL)); |
23 | 23 | ||
24 | if (!eina_init()) | 24 | if (!eina_init()) |
25 | { | 25 | return --_edje_init_count; |
26 | fprintf(stderr, "Edje: Eina init failed"); | ||
27 | return --_edje_init_count; | ||
28 | } | ||
29 | 26 | ||
30 | _edje_default_log_dom = eina_log_domain_register | 27 | _edje_default_log_dom = eina_log_domain_register |
31 | ("edje", EDJE_DEFAULT_LOG_COLOR); | 28 | ("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, | |||
364 | } | 364 | } |
365 | if (_injob > 0) | 365 | if (_injob > 0) |
366 | { | 366 | { |
367 | if (_job_loss_timer) ecore_timer_del(_job_loss_timer); | 367 | if (!_job_loss_timer) |
368 | _job_loss_timer = ecore_timer_add(0.001, _edje_job_loss_timer, NULL); | 368 | _job_loss_timer = ecore_timer_add(0.001, _edje_job_loss_timer, NULL); |
369 | } | 369 | } |
370 | else | 370 | else |
371 | { | 371 | { |
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) | |||
136 | 136 | ||
137 | snprintf(tmp, sizeof (tmp), "%s/%s/" EDJE_MODULE_NAME, info->path, MODULE_ARCH | 137 | snprintf(tmp, sizeof (tmp), "%s/%s/" EDJE_MODULE_NAME, info->path, MODULE_ARCH |
138 | #ifdef EDJE_EXTRA_MODULE_NAME | 138 | #ifdef EDJE_EXTRA_MODULE_NAME |
139 | , ecore_file_file_get(info->path) | 139 | , info->path + info->name_start |
140 | #endif | 140 | #endif |
141 | ); | 141 | ); |
142 | 142 | ||
143 | if (ecore_file_exists(tmp)) | 143 | if (ecore_file_exists(tmp)) |
144 | result = eina_list_append(result, eina_stringshare_add(ecore_file_file_get(info->path))); | 144 | result = eina_list_append(result, eina_stringshare_add(info->path + info->name_start)); |
145 | } | 145 | } |
146 | 146 | ||
147 | eina_iterator_free(it); | 147 | 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 | |||
351 | command.type.sample.speed = speed; | 351 | command.type.sample.speed = speed; |
352 | size = write(command_pipe[1], &command, sizeof(command)); | 352 | size = write(command_pipe[1], &command, sizeof(command)); |
353 | #else | 353 | #else |
354 | ed = NULL; // warning shh | 354 | // warning shh |
355 | if (speed > 0) sample_name = NULL; // warning shh | 355 | (void) ed; |
356 | (void) sample_name; | ||
357 | (void) speed; | ||
356 | #endif | 358 | #endif |
357 | return (size == sizeof(Edje_Multisense_Sound_Action)); | 359 | return (size == sizeof(Edje_Multisense_Sound_Action)); |
358 | } | 360 | } |
@@ -371,8 +373,10 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const | |||
371 | command.type.tone.duration = duration; | 373 | command.type.tone.duration = duration; |
372 | size = write(command_pipe[1], &command, sizeof(command)); | 374 | size = write(command_pipe[1], &command, sizeof(command)); |
373 | #else | 375 | #else |
374 | ed = NULL; // warning shh | 376 | // warning shh |
375 | if (duration > 0) tone_name = NULL; // warning shh | 377 | (void) ed; |
378 | (void) duration; | ||
379 | (void) tone_name; | ||
376 | #endif | 380 | #endif |
377 | return (size == sizeof(Edje_Multisense_Sound_Action)); | 381 | return (size == sizeof(Edje_Multisense_Sound_Action)); |
378 | 382 | ||
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 | |||
192 | EDJE_ASPECT_PREFER_NONE, | 192 | EDJE_ASPECT_PREFER_NONE, |
193 | EDJE_ASPECT_PREFER_VERTICAL, | 193 | EDJE_ASPECT_PREFER_VERTICAL, |
194 | EDJE_ASPECT_PREFER_HORIZONTAL, | 194 | EDJE_ASPECT_PREFER_HORIZONTAL, |
195 | EDJE_ASPECT_PREFER_BOTH | 195 | EDJE_ASPECT_PREFER_BOTH, |
196 | EDJE_ASPECT_PREFER_SOURCE | ||
196 | } Edje_Internal_Aspect; | 197 | } Edje_Internal_Aspect; |
197 | 198 | ||
198 | struct _Edje_Perspective | 199 | struct _Edje_Perspective |
@@ -232,7 +233,7 @@ struct _Edje_Color | |||
232 | struct _Edje_Aspect_Prefer | 233 | struct _Edje_Aspect_Prefer |
233 | { | 234 | { |
234 | FLOAT_T min, max; | 235 | FLOAT_T min, max; |
235 | Edje_Internal_Aspect prefer; | 236 | char prefer; |
236 | }; | 237 | }; |
237 | 238 | ||
238 | struct _Edje_Aspect | 239 | struct _Edje_Aspect |
@@ -834,6 +835,11 @@ struct _Edje_Part_Description_Common | |||
834 | unsigned char w, h; /* width or height is fixed in side (cannot expand with Edje object size) */ | 835 | unsigned char w, h; /* width or height is fixed in side (cannot expand with Edje object size) */ |
835 | } fixed; | 836 | } fixed; |
836 | 837 | ||
838 | struct { // only during recalc | ||
839 | unsigned char have; | ||
840 | FLOAT_T w, h; | ||
841 | } minmul; | ||
842 | |||
837 | Edje_Size min, max; | 843 | Edje_Size min, max; |
838 | Edje_Position step; /* size stepping by n pixels, 0 = none */ | 844 | Edje_Position step; /* size stepping by n pixels, 0 = none */ |
839 | Edje_Aspect_Prefer aspect; | 845 | Edje_Aspect_Prefer aspect; |
@@ -1138,6 +1144,7 @@ struct _Edje | |||
1138 | unsigned int all_part_change : 1; | 1144 | unsigned int all_part_change : 1; |
1139 | #endif | 1145 | #endif |
1140 | unsigned int have_mapped_part : 1; | 1146 | unsigned int have_mapped_part : 1; |
1147 | unsigned int recalc_call : 1; | ||
1141 | }; | 1148 | }; |
1142 | 1149 | ||
1143 | struct _Edje_Calc_Params | 1150 | struct _Edje_Calc_Params |
@@ -1915,7 +1922,7 @@ void _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur); | |||
1915 | Eina_Bool _edje_entry_cursor_coord_set(Edje_Real_Part *rp, Edje_Cursor cur, int x, int y); | 1922 | Eina_Bool _edje_entry_cursor_coord_set(Edje_Real_Part *rp, Edje_Cursor cur, int x, int y); |
1916 | Eina_Bool _edje_entry_cursor_is_format_get(Edje_Real_Part *rp, Edje_Cursor cur); | 1923 | Eina_Bool _edje_entry_cursor_is_format_get(Edje_Real_Part *rp, Edje_Cursor cur); |
1917 | Eina_Bool _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur); | 1924 | Eina_Bool _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur); |
1918 | const char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); | 1925 | char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); |
1919 | void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos); | 1926 | void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos); |
1920 | int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur); | 1927 | int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur); |
1921 | void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout); | 1928 | 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 | |||
992 | break ; | 992 | break ; |
993 | 993 | ||
994 | default: | 994 | default: |
995 | fprintf(stderr, "SPANK SPANK SPANK !!!\nYou should never be here !\n"); | 995 | ERR("SPANK SPANK SPANK !!!\nYou should never be here !"); |
996 | break; | 996 | break; |
997 | } | 997 | } |
998 | } | 998 | } |
@@ -1621,6 +1621,7 @@ _edje_param_native_set(Edje_Real_Part *rp, const char *name, const Edje_External | |||
1621 | if (param->type != EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) | 1621 | if (param->type != EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) |
1622 | return EINA_FALSE; | 1622 | return EINA_FALSE; |
1623 | rp->drag->size.x = FROM_DOUBLE(CLAMP(param->d, 0.0, 1.0)); | 1623 | rp->drag->size.x = FROM_DOUBLE(CLAMP(param->d, 0.0, 1.0)); |
1624 | rp->edje->recalc_call = 1; | ||
1624 | rp->edje->dirty = 1; | 1625 | rp->edje->dirty = 1; |
1625 | #ifdef EDJE_CALC_CACHE | 1626 | #ifdef EDJE_CALC_CACHE |
1626 | rp->invalidate = 1; | 1627 | rp->invalidate = 1; |
@@ -1633,6 +1634,7 @@ _edje_param_native_set(Edje_Real_Part *rp, const char *name, const Edje_External | |||
1633 | if (param->type != EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) | 1634 | if (param->type != EDJE_EXTERNAL_PARAM_TYPE_DOUBLE) |
1634 | return EINA_FALSE; | 1635 | return EINA_FALSE; |
1635 | rp->drag->size.y = FROM_DOUBLE(CLAMP(param->d, 0.0, 1.0)); | 1636 | rp->drag->size.y = FROM_DOUBLE(CLAMP(param->d, 0.0, 1.0)); |
1637 | rp->edje->recalc_call = 1; | ||
1636 | rp->edje->dirty = 1; | 1638 | rp->edje->dirty = 1; |
1637 | #ifdef EDJE_CALC_CACHE | 1639 | #ifdef EDJE_CALC_CACHE |
1638 | rp->invalidate = 1; | 1640 | 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 | |||
438 | 438 | ||
439 | ed = eina_list_data_get(members); | 439 | ed = eina_list_data_get(members); |
440 | ed->dirty = 1; | 440 | ed->dirty = 1; |
441 | ed->recalc_call = 1; | ||
441 | #ifdef EDJE_CALC_CACHE | 442 | #ifdef EDJE_CALC_CACHE |
442 | ed->all_part_change = 1; | 443 | ed->all_part_change = 1; |
443 | #endif | 444 | #endif |
@@ -504,6 +505,7 @@ edje_color_class_del(const char *color_class) | |||
504 | 505 | ||
505 | ed = eina_list_data_get(members); | 506 | ed = eina_list_data_get(members); |
506 | ed->dirty = 1; | 507 | ed->dirty = 1; |
508 | ed->recalc_call = 1; | ||
507 | #ifdef EDJE_CALC_CACHE | 509 | #ifdef EDJE_CALC_CACHE |
508 | ed->all_part_change = 1; | 510 | ed->all_part_change = 1; |
509 | #endif | 511 | #endif |
@@ -583,6 +585,7 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in | |||
583 | cc->b3 = b3; | 585 | cc->b3 = b3; |
584 | cc->a3 = a3; | 586 | cc->a3 = a3; |
585 | ed->dirty = 1; | 587 | ed->dirty = 1; |
588 | ed->recalc_call = 1; | ||
586 | #ifdef EDJE_CALC_CACHE | 589 | #ifdef EDJE_CALC_CACHE |
587 | ed->all_part_change = 1; | 590 | ed->all_part_change = 1; |
588 | #endif | 591 | #endif |
@@ -611,6 +614,7 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in | |||
611 | cc->a3 = a3; | 614 | cc->a3 = a3; |
612 | ed->color_classes = eina_list_append(ed->color_classes, cc); | 615 | ed->color_classes = eina_list_append(ed->color_classes, cc); |
613 | ed->dirty = 1; | 616 | ed->dirty = 1; |
617 | ed->recalc_call = 1; | ||
614 | #ifdef EDJE_CALC_CACHE | 618 | #ifdef EDJE_CALC_CACHE |
615 | ed->all_part_change = 1; | 619 | ed->all_part_change = 1; |
616 | #endif | 620 | #endif |
@@ -693,6 +697,7 @@ edje_object_color_class_del(Evas_Object *obj, const char *color_class) | |||
693 | } | 697 | } |
694 | 698 | ||
695 | ed->dirty = 1; | 699 | ed->dirty = 1; |
700 | ed->recalc_call = 1; | ||
696 | #ifdef EDJE_CALC_CACHE | 701 | #ifdef EDJE_CALC_CACHE |
697 | ed->all_part_change = 1; | 702 | ed->all_part_change = 1; |
698 | #endif | 703 | #endif |
@@ -752,6 +757,7 @@ edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size siz | |||
752 | 757 | ||
753 | ed = eina_list_data_get(members); | 758 | ed = eina_list_data_get(members); |
754 | ed->dirty = 1; | 759 | ed->dirty = 1; |
760 | ed->recalc_call = 1; | ||
755 | _edje_textblock_style_all_update(ed); | 761 | _edje_textblock_style_all_update(ed); |
756 | #ifdef EDJE_CALC_CACHE | 762 | #ifdef EDJE_CALC_CACHE |
757 | ed->text_part_change = 1; | 763 | ed->text_part_change = 1; |
@@ -847,6 +853,7 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char | |||
847 | 853 | ||
848 | /* Update edje */ | 854 | /* Update edje */ |
849 | ed->dirty = 1; | 855 | ed->dirty = 1; |
856 | ed->recalc_call = 1; | ||
850 | #ifdef EDJE_CALC_CACHE | 857 | #ifdef EDJE_CALC_CACHE |
851 | ed->text_part_change = 1; | 858 | ed->text_part_change = 1; |
852 | #endif | 859 | #endif |
@@ -881,6 +888,7 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char | |||
881 | /* Add to edje's text class list */ | 888 | /* Add to edje's text class list */ |
882 | ed->text_classes = eina_list_append(ed->text_classes, tc); | 889 | ed->text_classes = eina_list_append(ed->text_classes, tc); |
883 | ed->dirty = 1; | 890 | ed->dirty = 1; |
891 | ed->recalc_call = 1; | ||
884 | #ifdef EDJE_CALC_CACHE | 892 | #ifdef EDJE_CALC_CACHE |
885 | ed->text_part_change = 1; | 893 | ed->text_part_change = 1; |
886 | #endif | 894 | #endif |
@@ -1005,6 +1013,7 @@ _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char | |||
1005 | else | 1013 | else |
1006 | if (text) rp->text.text = eina_stringshare_add(text); | 1014 | if (text) rp->text.text = eina_stringshare_add(text); |
1007 | rp->edje->dirty = 1; | 1015 | rp->edje->dirty = 1; |
1016 | rp->edje->recalc_call = 1; | ||
1008 | #ifdef EDJE_CALC_CACHE | 1017 | #ifdef EDJE_CALC_CACHE |
1009 | rp->invalidate = 1; | 1018 | rp->invalidate = 1; |
1010 | #endif | 1019 | #endif |
@@ -1039,6 +1048,7 @@ _edje_object_part_text_raw_append(Evas_Object *obj, Edje_Real_Part *rp, const ch | |||
1039 | } | 1048 | } |
1040 | } | 1049 | } |
1041 | rp->edje->dirty = 1; | 1050 | rp->edje->dirty = 1; |
1051 | rp->edje->recalc_call = 1; | ||
1042 | #ifdef EDJE_CALC_CACHE | 1052 | #ifdef EDJE_CALC_CACHE |
1043 | rp->invalidate = 1; | 1053 | rp->invalidate = 1; |
1044 | #endif | 1054 | #endif |
@@ -1307,6 +1317,7 @@ edje_object_part_text_insert(Evas_Object *obj, const char *part, const char *tex | |||
1307 | if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return; | 1317 | if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return; |
1308 | _edje_entry_text_markup_insert(rp, text); | 1318 | _edje_entry_text_markup_insert(rp, text); |
1309 | rp->edje->dirty = 1; | 1319 | rp->edje->dirty = 1; |
1320 | rp->edje->recalc_call = 1; | ||
1310 | #ifdef EDJE_CALC_CACHE | 1321 | #ifdef EDJE_CALC_CACHE |
1311 | rp->invalidate = 1; | 1322 | rp->invalidate = 1; |
1312 | #endif | 1323 | #endif |
@@ -1328,6 +1339,7 @@ edje_object_part_text_append(Evas_Object *obj, const char *part, const char *tex | |||
1328 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; | 1339 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; |
1329 | _edje_object_part_text_raw_append(obj, rp, part, text); | 1340 | _edje_object_part_text_raw_append(obj, rp, part, text); |
1330 | rp->edje->dirty = 1; | 1341 | rp->edje->dirty = 1; |
1342 | rp->edje->recalc_call = 1; | ||
1331 | #ifdef EDJE_CALC_CACHE | 1343 | #ifdef EDJE_CALC_CACHE |
1332 | rp->invalidate = 1; | 1344 | rp->invalidate = 1; |
1333 | #endif | 1345 | #endif |
@@ -1675,7 +1687,7 @@ edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const | |||
1675 | return 0; | 1687 | return 0; |
1676 | } | 1688 | } |
1677 | 1689 | ||
1678 | EAPI const char * | 1690 | EAPI char * |
1679 | edje_object_part_text_cursor_content_get(const Evas_Object *obj, const char *part, Edje_Cursor cur) | 1691 | edje_object_part_text_cursor_content_get(const Evas_Object *obj, const char *part, Edje_Cursor cur) |
1680 | { | 1692 | { |
1681 | Edje *ed; | 1693 | Edje *ed; |
@@ -1908,6 +1920,13 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw | |||
1908 | // XXX: by Sachiel, January 21th 2009, 19:30 UTC | 1920 | // XXX: by Sachiel, January 21th 2009, 19:30 UTC |
1909 | _edje_recalc_do(ed); | 1921 | _edje_recalc_do(ed); |
1910 | 1922 | ||
1923 | rp = evas_object_data_get(obj_swallow, "\377 edje.swallowing_part"); | ||
1924 | if (rp) | ||
1925 | { | ||
1926 | /* The object is already swallowed somewhere, unswallow it first */ | ||
1927 | edje_object_part_unswallow(rp->edje->obj, obj_swallow); | ||
1928 | } | ||
1929 | |||
1911 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1930 | rp = _edje_real_part_recursive_get(ed, (char *)part); |
1912 | if (!rp) return EINA_FALSE; | 1931 | if (!rp) return EINA_FALSE; |
1913 | if (rp->part->type != EDJE_PART_TYPE_SWALLOW) | 1932 | if (rp->part->type != EDJE_PART_TYPE_SWALLOW) |
@@ -1929,6 +1948,7 @@ _recalc_extern_parent(Evas_Object *obj) | |||
1929 | ed = _edje_fetch(parent); | 1948 | ed = _edje_fetch(parent); |
1930 | 1949 | ||
1931 | ed->dirty = 1; | 1950 | ed->dirty = 1; |
1951 | ed->recalc_call = 1; // ZZZ: ??? | ||
1932 | _edje_recalc(ed); | 1952 | _edje_recalc(ed); |
1933 | } | 1953 | } |
1934 | 1954 | ||
@@ -2110,11 +2130,7 @@ _edje_box_layout_external_new(const char *name, Evas_Object_Box_Layout func, voi | |||
2110 | 2130 | ||
2111 | name_len = strlen(name) + 1; | 2131 | name_len = strlen(name) + 1; |
2112 | l = malloc(sizeof(Edje_Box_Layout) + name_len); | 2132 | l = malloc(sizeof(Edje_Box_Layout) + name_len); |
2113 | if (!l) | 2133 | if (!l) return NULL; |
2114 | { | ||
2115 | perror("malloc"); | ||
2116 | return NULL; | ||
2117 | } | ||
2118 | 2134 | ||
2119 | l->func = func; | 2135 | l->func = func; |
2120 | l->layout_data_get = layout_data_get; | 2136 | l->layout_data_get = layout_data_get; |
@@ -2224,6 +2240,7 @@ edje_object_part_unswallow(Evas_Object *obj __UNUSED__, Evas_Object *obj_swallow | |||
2224 | rp->swallow_params.max.w = 0; | 2240 | rp->swallow_params.max.w = 0; |
2225 | rp->swallow_params.max.h = 0; | 2241 | rp->swallow_params.max.h = 0; |
2226 | rp->edje->dirty = 1; | 2242 | rp->edje->dirty = 1; |
2243 | rp->edje->recalc_call = 1; | ||
2227 | #ifdef EDJE_CALC_CACHE | 2244 | #ifdef EDJE_CALC_CACHE |
2228 | rp->invalidate = 1; | 2245 | rp->invalidate = 1; |
2229 | #endif | 2246 | #endif |
@@ -2684,6 +2701,7 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do | |||
2684 | rp->drag->size.x = FROM_DOUBLE(dw); | 2701 | rp->drag->size.x = FROM_DOUBLE(dw); |
2685 | rp->drag->size.y = FROM_DOUBLE(dh); | 2702 | rp->drag->size.y = FROM_DOUBLE(dh); |
2686 | rp->edje->dirty = 1; | 2703 | rp->edje->dirty = 1; |
2704 | rp->edje->recalc_call = 1; | ||
2687 | #ifdef EDJE_CALC_CACHE | 2705 | #ifdef EDJE_CALC_CACHE |
2688 | rp->invalidate = 1; | 2706 | rp->invalidate = 1; |
2689 | #endif | 2707 | #endif |
@@ -3018,6 +3036,7 @@ _edje_box_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UNUS | |||
3018 | Edje_Real_Part *rp = data; | 3036 | Edje_Real_Part *rp = data; |
3019 | 3037 | ||
3020 | rp->edje->dirty = 1; | 3038 | rp->edje->dirty = 1; |
3039 | rp->edje->recalc_call = 1; | ||
3021 | #ifdef EDJE_CALC_CACHE | 3040 | #ifdef EDJE_CALC_CACHE |
3022 | rp->invalidate = 1; | 3041 | rp->invalidate = 1; |
3023 | #endif | 3042 | #endif |
@@ -3031,6 +3050,7 @@ _edje_box_child_add(Edje_Real_Part *rp, Evas_Object *child) | |||
3031 | (child, EVAS_CALLBACK_DEL, _edje_box_child_del_cb, rp); | 3050 | (child, EVAS_CALLBACK_DEL, _edje_box_child_del_cb, rp); |
3032 | 3051 | ||
3033 | rp->edje->dirty = 1; | 3052 | rp->edje->dirty = 1; |
3053 | rp->edje->recalc_call = 1; | ||
3034 | #ifdef EDJE_CALC_CACHE | 3054 | #ifdef EDJE_CALC_CACHE |
3035 | rp->invalidate = 1; | 3055 | rp->invalidate = 1; |
3036 | #endif | 3056 | #endif |
@@ -3044,6 +3064,7 @@ _edje_box_child_remove(Edje_Real_Part *rp, Evas_Object *child) | |||
3044 | (child, EVAS_CALLBACK_DEL, _edje_box_child_del_cb, rp); | 3064 | (child, EVAS_CALLBACK_DEL, _edje_box_child_del_cb, rp); |
3045 | 3065 | ||
3046 | rp->edje->dirty = 1; | 3066 | rp->edje->dirty = 1; |
3067 | rp->edje->recalc_call = 1; | ||
3047 | #ifdef EDJE_CALC_CACHE | 3068 | #ifdef EDJE_CALC_CACHE |
3048 | rp->invalidate = 1; | 3069 | rp->invalidate = 1; |
3049 | #endif | 3070 | #endif |
@@ -3186,6 +3207,7 @@ _edje_table_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UN | |||
3186 | Edje_Real_Part *rp = data; | 3207 | Edje_Real_Part *rp = data; |
3187 | 3208 | ||
3188 | rp->edje->dirty = 1; | 3209 | rp->edje->dirty = 1; |
3210 | rp->edje->recalc_call = 1; | ||
3189 | #ifdef EDJE_CALC_CACHE | 3211 | #ifdef EDJE_CALC_CACHE |
3190 | rp->invalidate = 1; | 3212 | rp->invalidate = 1; |
3191 | #endif | 3213 | #endif |
@@ -3199,6 +3221,7 @@ _edje_table_child_add(Edje_Real_Part *rp, Evas_Object *child) | |||
3199 | (child, EVAS_CALLBACK_DEL, _edje_table_child_del_cb, rp); | 3221 | (child, EVAS_CALLBACK_DEL, _edje_table_child_del_cb, rp); |
3200 | 3222 | ||
3201 | rp->edje->dirty = 1; | 3223 | rp->edje->dirty = 1; |
3224 | rp->edje->recalc_call = 1; | ||
3202 | #ifdef EDJE_CALC_CACHE | 3225 | #ifdef EDJE_CALC_CACHE |
3203 | rp->invalidate = 1; | 3226 | rp->invalidate = 1; |
3204 | #endif | 3227 | #endif |
@@ -3212,6 +3235,7 @@ _edje_table_child_remove(Edje_Real_Part *rp, Evas_Object *child) | |||
3212 | (child, EVAS_CALLBACK_DEL, _edje_table_child_del_cb, rp); | 3235 | (child, EVAS_CALLBACK_DEL, _edje_table_child_del_cb, rp); |
3213 | 3236 | ||
3214 | rp->edje->dirty = 1; | 3237 | rp->edje->dirty = 1; |
3238 | rp->edje->recalc_call = 1; | ||
3215 | #ifdef EDJE_CALC_CACHE | 3239 | #ifdef EDJE_CALC_CACHE |
3216 | rp->invalidate = 1; | 3240 | rp->invalidate = 1; |
3217 | #endif | 3241 | #endif |
@@ -3314,6 +3338,7 @@ _edje_perspective_obj_del(void *data, __UNUSED__ Evas *e, __UNUSED__ Evas_Object | |||
3314 | if (!ed) continue; | 3338 | if (!ed) continue; |
3315 | ed->persp = NULL; | 3339 | ed->persp = NULL; |
3316 | ed->dirty = 1; | 3340 | ed->dirty = 1; |
3341 | ed->recalc_call = 1; | ||
3317 | _edje_recalc_do(ed); | 3342 | _edje_recalc_do(ed); |
3318 | } | 3343 | } |
3319 | free(ps); | 3344 | free(ps); |
@@ -3367,6 +3392,7 @@ edje_perspective_set(Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Co | |||
3367 | if (!ed->persp) | 3392 | if (!ed->persp) |
3368 | { | 3393 | { |
3369 | ed->dirty = 1; | 3394 | ed->dirty = 1; |
3395 | ed->recalc_call = 1; | ||
3370 | _edje_recalc_do(ed); | 3396 | _edje_recalc_do(ed); |
3371 | } | 3397 | } |
3372 | } | 3398 | } |
@@ -3381,6 +3407,7 @@ edje_perspective_set(Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Co | |||
3381 | if (!ed->persp) | 3407 | if (!ed->persp) |
3382 | { | 3408 | { |
3383 | ed->dirty = 1; | 3409 | ed->dirty = 1; |
3410 | ed->recalc_call = 1; | ||
3384 | _edje_recalc_do(ed); | 3411 | _edje_recalc_do(ed); |
3385 | } | 3412 | } |
3386 | } | 3413 | } |
@@ -3414,6 +3441,7 @@ edje_perspective_global_set(Edje_Perspective *ps, Eina_Bool global) | |||
3414 | if (!ed->persp) | 3441 | if (!ed->persp) |
3415 | { | 3442 | { |
3416 | ed->dirty = 1; | 3443 | ed->dirty = 1; |
3444 | ed->recalc_call = 1; | ||
3417 | _edje_recalc_do(ed); | 3445 | _edje_recalc_do(ed); |
3418 | } | 3446 | } |
3419 | } | 3447 | } |
@@ -3453,6 +3481,7 @@ edje_object_perspective_set(Evas_Object *obj, Edje_Perspective *ps) | |||
3453 | ed->persp = ps; | 3481 | ed->persp = ps; |
3454 | if (ps) ps->users = eina_list_append(ps->users, obj); | 3482 | if (ps) ps->users = eina_list_append(ps->users, obj); |
3455 | ed->dirty = 1; | 3483 | ed->dirty = 1; |
3484 | ed->recalc_call = 1; | ||
3456 | _edje_recalc_do(ed); | 3485 | _edje_recalc_do(ed); |
3457 | } | 3486 | } |
3458 | 3487 | ||
@@ -4075,6 +4104,7 @@ _edje_object_part_swallow_changed_hints_cb(void *data, __UNUSED__ Evas *e, __UNU | |||
4075 | rp = data; | 4104 | rp = data; |
4076 | _edje_real_part_swallow_hints_update(rp); | 4105 | _edje_real_part_swallow_hints_update(rp); |
4077 | rp->edje->dirty = 1; | 4106 | rp->edje->dirty = 1; |
4107 | rp->edje->recalc_call = 1; | ||
4078 | _edje_recalc(rp->edje); | 4108 | _edje_recalc(rp->edje); |
4079 | return; | 4109 | return; |
4080 | } | 4110 | } |
@@ -4096,6 +4126,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, | |||
4096 | if (hints_update) | 4126 | if (hints_update) |
4097 | _edje_real_part_swallow_hints_update(rp); | 4127 | _edje_real_part_swallow_hints_update(rp); |
4098 | rp->edje->dirty = 1; | 4128 | rp->edje->dirty = 1; |
4129 | rp->edje->recalc_call = 1; | ||
4099 | _edje_recalc(rp->edje); | 4130 | _edje_recalc(rp->edje); |
4100 | return; | 4131 | return; |
4101 | } | 4132 | } |
@@ -4139,6 +4170,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, | |||
4139 | evas_object_precise_is_inside_set(obj_swallow, 1); | 4170 | evas_object_precise_is_inside_set(obj_swallow, 1); |
4140 | 4171 | ||
4141 | rp->edje->dirty = 1; | 4172 | rp->edje->dirty = 1; |
4173 | rp->edje->recalc_call = 1; | ||
4142 | _edje_recalc(rp->edje); | 4174 | _edje_recalc(rp->edje); |
4143 | } | 4175 | } |
4144 | 4176 | ||