diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/edje/src | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to 'libraries/edje/src')
41 files changed, 2897 insertions, 1080 deletions
diff --git a/libraries/edje/src/Makefile.in b/libraries/edje/src/Makefile.in index fc05386..532d75b 100644 --- a/libraries/edje/src/Makefile.in +++ b/libraries/edje/src/Makefile.in | |||
@@ -193,6 +193,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
193 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 193 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
194 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 194 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
195 | PKG_CONFIG = @PKG_CONFIG@ | 195 | PKG_CONFIG = @PKG_CONFIG@ |
196 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
197 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
196 | PYTHON = @PYTHON@ | 198 | PYTHON = @PYTHON@ |
197 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 199 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
198 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 200 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
diff --git a/libraries/edje/src/bin/Makefile.in b/libraries/edje/src/bin/Makefile.in index 07bf025..877bcb2 100644 --- a/libraries/edje/src/bin/Makefile.in +++ b/libraries/edje/src/bin/Makefile.in | |||
@@ -291,6 +291,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
291 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 291 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
292 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 292 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
293 | PKG_CONFIG = @PKG_CONFIG@ | 293 | PKG_CONFIG = @PKG_CONFIG@ |
294 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
295 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
294 | PYTHON = @PYTHON@ | 296 | PYTHON = @PYTHON@ |
295 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 297 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
296 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 298 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
diff --git a/libraries/edje/src/bin/edje_cc.h b/libraries/edje/src/bin/edje_cc.h index d0c6d22..0291f29 100644 --- a/libraries/edje/src/bin/edje_cc.h +++ b/libraries/edje/src/bin/edje_cc.h | |||
@@ -147,6 +147,7 @@ void data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, | |||
147 | void data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest); | 147 | void data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest); |
148 | void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set); | 148 | void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set); |
149 | void data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set); | 149 | void data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set); |
150 | void data_queue_image_remove(int *dest, Eina_Bool *set); | ||
150 | void data_queue_part_slave_lookup(int *master, int *slave); | 151 | void data_queue_part_slave_lookup(int *master, int *slave); |
151 | void data_queue_image_slave_lookup(int *master, int *slave); | 152 | void data_queue_image_slave_lookup(int *master, int *slave); |
152 | void data_queue_spectrum_lookup(char *name, int *dest); | 153 | void data_queue_spectrum_lookup(char *name, int *dest); |
@@ -155,6 +156,7 @@ void data_process_lookups(void); | |||
155 | void data_process_scripts(void); | 156 | void data_process_scripts(void); |
156 | void data_process_script_lookups(void); | 157 | void data_process_script_lookups(void); |
157 | 158 | ||
159 | void part_description_image_cleanup(Edje_Part *ep); | ||
158 | 160 | ||
159 | int is_verbatim(void); | 161 | int is_verbatim(void); |
160 | void track_verbatim(int on); | 162 | void track_verbatim(int on); |
diff --git a/libraries/edje/src/bin/edje_cc_handlers.c b/libraries/edje/src/bin/edje_cc_handlers.c index f74fa12..14ac0b7 100644 --- a/libraries/edje/src/bin/edje_cc_handlers.c +++ b/libraries/edje/src/bin/edje_cc_handlers.c | |||
@@ -106,6 +106,7 @@ static void st_collections_group_script_only(void); | |||
106 | static void st_collections_group_alias(void); | 106 | static void st_collections_group_alias(void); |
107 | static void st_collections_group_min(void); | 107 | static void st_collections_group_min(void); |
108 | static void st_collections_group_max(void); | 108 | static void st_collections_group_max(void); |
109 | static void st_collections_group_broadcast_signal(void); | ||
109 | static void st_collections_group_data_item(void); | 110 | static void st_collections_group_data_item(void); |
110 | static void st_collections_group_orientation(void); | 111 | static void st_collections_group_orientation(void); |
111 | 112 | ||
@@ -317,6 +318,7 @@ New_Statement_Handler statement_handlers[] = | |||
317 | {"collections.group.alias", st_collections_group_alias}, | 318 | {"collections.group.alias", st_collections_group_alias}, |
318 | {"collections.group.min", st_collections_group_min}, | 319 | {"collections.group.min", st_collections_group_min}, |
319 | {"collections.group.max", st_collections_group_max}, | 320 | {"collections.group.max", st_collections_group_max}, |
321 | {"collections.group.broadcast_signal", st_collections_group_broadcast_signal}, | ||
320 | {"collections.group.orientation", st_collections_group_orientation}, | 322 | {"collections.group.orientation", st_collections_group_orientation}, |
321 | {"collections.group.data.item", st_collections_group_data_item}, | 323 | {"collections.group.data.item", st_collections_group_data_item}, |
322 | {"collections.group.limits.horizontal", st_collections_group_limits_horizontal}, | 324 | {"collections.group.limits.horizontal", st_collections_group_limits_horizontal}, |
@@ -833,6 +835,39 @@ _edje_part_description_fill(Edje_Part_Description_Spec_Fill *fill) | |||
833 | fill->type = EDJE_FILL_TYPE_SCALE; | 835 | fill->type = EDJE_FILL_TYPE_SCALE; |
834 | } | 836 | } |
835 | 837 | ||
838 | static void | ||
839 | _edje_part_description_image_remove(Edje_Part_Description_Image *ed) | ||
840 | { | ||
841 | unsigned int j; | ||
842 | |||
843 | if (!ed) return; | ||
844 | |||
845 | data_queue_image_remove(&(ed->image.id), &(ed->image.set)); | ||
846 | |||
847 | for (j = 0; j < ed->image.tweens_count; ++j) | ||
848 | data_queue_image_remove(&(ed->image.tweens[j]->id), | ||
849 | &(ed->image.tweens[j]->set)); | ||
850 | } | ||
851 | |||
852 | void | ||
853 | part_description_image_cleanup(Edje_Part *ep) | ||
854 | { | ||
855 | Edje_Part_Description_Image *ed; | ||
856 | unsigned int j; | ||
857 | |||
858 | if (ep->type != EDJE_PART_TYPE_IMAGE) | ||
859 | return ; | ||
860 | |||
861 | ed = (Edje_Part_Description_Image*) ep->default_desc; | ||
862 | _edje_part_description_image_remove(ed); | ||
863 | |||
864 | for (j = 0; j < ep->other.desc_count; j++) | ||
865 | { | ||
866 | ed = (Edje_Part_Description_Image*) ep->other.desc[j]; | ||
867 | _edje_part_description_image_remove(ed); | ||
868 | } | ||
869 | } | ||
870 | |||
836 | static Edje_Part_Description_Common * | 871 | static Edje_Part_Description_Common * |
837 | _edje_part_description_alloc(unsigned char type, const char *collection, const char *part) | 872 | _edje_part_description_alloc(unsigned char type, const char *collection, const char *part) |
838 | { | 873 | { |
@@ -2118,6 +2153,7 @@ ob_collections_group(void) | |||
2118 | pc = mem_alloc(SZ(Edje_Part_Collection)); | 2153 | pc = mem_alloc(SZ(Edje_Part_Collection)); |
2119 | edje_collections = eina_list_append(edje_collections, pc); | 2154 | edje_collections = eina_list_append(edje_collections, pc); |
2120 | pc->id = current_de->id; | 2155 | pc->id = current_de->id; |
2156 | pc->broadcast_signal = EINA_TRUE; /* This was the behaviour by default in Edje 1.1 */ | ||
2121 | 2157 | ||
2122 | cd = mem_alloc(SZ(Code)); | 2158 | cd = mem_alloc(SZ(Code)); |
2123 | codes = eina_list_append(codes, cd); | 2159 | codes = eina_list_append(codes, cd); |
@@ -2139,8 +2175,10 @@ ob_collections_group(void) | |||
2139 | static void | 2175 | static void |
2140 | st_collections_group_name(void) | 2176 | st_collections_group_name(void) |
2141 | { | 2177 | { |
2178 | Edje_Part_Collection_Directory_Entry *alias; | ||
2142 | Edje_Part_Collection_Directory_Entry *older; | 2179 | Edje_Part_Collection_Directory_Entry *older; |
2143 | Edje_Part_Collection *current_pc; | 2180 | Edje_Part_Collection *current_pc; |
2181 | Eina_List *l = NULL; | ||
2144 | 2182 | ||
2145 | check_arg_count(1); | 2183 | check_arg_count(1); |
2146 | 2184 | ||
@@ -2150,31 +2188,24 @@ st_collections_group_name(void) | |||
2150 | current_pc->part = current_de->entry; | 2188 | current_pc->part = current_de->entry; |
2151 | 2189 | ||
2152 | older = eina_hash_find(edje_file->collection, current_de->entry); | 2190 | older = eina_hash_find(edje_file->collection, current_de->entry); |
2191 | if (older) eina_hash_del(edje_file->collection, current_de->entry, older); | ||
2192 | eina_hash_direct_add(edje_file->collection, current_de->entry, current_de); | ||
2193 | if (!older) return; | ||
2153 | 2194 | ||
2154 | if (older) | 2195 | EINA_LIST_FOREACH(aliases, l, alias) |
2155 | { | 2196 | if (strcmp(alias->entry, current_de->entry) == 0) |
2156 | Edje_Part_Collection *pc; | 2197 | { |
2157 | Eina_List *l; | 2198 | Edje_Part_Collection *pc; |
2158 | Code *cd; | 2199 | |
2159 | int i = 0; | 2200 | pc = eina_list_nth(edje_collections, older->id); |
2160 | 2201 | INF("overriding alias ('%s' => '%s') by group '%s'", | |
2161 | pc = eina_list_nth(edje_collections, older->id); | 2202 | alias->entry, pc->part, |
2162 | cd = eina_list_nth(codes, older->id); | 2203 | current_de->entry); |
2163 | 2204 | aliases = eina_list_remove_list(aliases, l); | |
2164 | eina_hash_del(edje_file->collection, current_de->entry, older); | 2205 | free(alias); |
2165 | edje_collections = eina_list_remove(edje_collections, pc); | 2206 | break; |
2166 | codes = eina_list_remove(codes, cd); | 2207 | } |
2167 | |||
2168 | EINA_LIST_FOREACH(edje_collections, l, pc) | ||
2169 | { | ||
2170 | older = eina_hash_find(edje_file->collection, pc->part); | ||
2171 | |||
2172 | pc->id = i++; | ||
2173 | if (older) older->id = pc->id; | ||
2174 | } | ||
2175 | } | ||
2176 | 2208 | ||
2177 | eina_hash_direct_add(edje_file->collection, current_de->entry, current_de); | ||
2178 | } | 2209 | } |
2179 | 2210 | ||
2180 | typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data; | 2211 | typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data; |
@@ -2242,6 +2273,14 @@ st_collections_group_inherit(void) | |||
2242 | progname, file_in, line - 1, parent_name); | 2273 | progname, file_in, line - 1, parent_name); |
2243 | exit(-1); | 2274 | exit(-1); |
2244 | } | 2275 | } |
2276 | if (pc2 == pc) | ||
2277 | { | ||
2278 | ERR("%s: Error. parse error %s:%i. You are trying to inherit '%s' from itself. That's not possible." | ||
2279 | "If there is another group of the same name, you want to inherit from that group and have the" | ||
2280 | "same name as that group, there is a trick ! Just put the inherit before the directive that set" | ||
2281 | "the name !", progname, file_in, line - 1, parent_name); | ||
2282 | exit(-1); | ||
2283 | } | ||
2245 | 2284 | ||
2246 | if (pc2->data) | 2285 | if (pc2->data) |
2247 | { | 2286 | { |
@@ -2463,6 +2502,8 @@ static void | |||
2463 | st_collections_group_alias(void) | 2502 | st_collections_group_alias(void) |
2464 | { | 2503 | { |
2465 | Edje_Part_Collection_Directory_Entry *alias; | 2504 | Edje_Part_Collection_Directory_Entry *alias; |
2505 | Edje_Part_Collection_Directory_Entry *tmp; | ||
2506 | Eina_List *l; | ||
2466 | 2507 | ||
2467 | check_arg_count(1); | 2508 | check_arg_count(1); |
2468 | 2509 | ||
@@ -2470,6 +2511,20 @@ st_collections_group_alias(void) | |||
2470 | alias->id = current_de->id; | 2511 | alias->id = current_de->id; |
2471 | alias->entry = parse_str(0); | 2512 | alias->entry = parse_str(0); |
2472 | 2513 | ||
2514 | EINA_LIST_FOREACH(aliases, l, tmp) | ||
2515 | if (strcmp(alias->entry, tmp->entry) == 0) | ||
2516 | { | ||
2517 | Edje_Part_Collection *pc; | ||
2518 | |||
2519 | pc = eina_list_nth(edje_collections, tmp->id); | ||
2520 | INF("overriding alias ('%s' => '%s') to ('%s' => '%s')", | ||
2521 | tmp->entry, pc->part, | ||
2522 | alias->entry, current_de->entry); | ||
2523 | aliases = eina_list_remove_list(aliases, l); | ||
2524 | free(tmp); | ||
2525 | break; | ||
2526 | } | ||
2527 | |||
2473 | aliases = eina_list_append(aliases, alias); | 2528 | aliases = eina_list_append(aliases, alias); |
2474 | } | 2529 | } |
2475 | 2530 | ||
@@ -2520,6 +2575,28 @@ st_collections_group_max(void) | |||
2520 | } | 2575 | } |
2521 | 2576 | ||
2522 | /** | 2577 | /** |
2578 | @page edcref | ||
2579 | @property | ||
2580 | broadcast_signal | ||
2581 | @parameters | ||
2582 | [broadcast] | ||
2583 | @effect | ||
2584 | Signal got automatically broadcasted to all sub group part. Default to | ||
2585 | true since 1.1. | ||
2586 | @endproperty | ||
2587 | */ | ||
2588 | static void | ||
2589 | st_collections_group_broadcast_signal(void) | ||
2590 | { | ||
2591 | Edje_Part_Collection *pc; | ||
2592 | |||
2593 | check_arg_count(1); | ||
2594 | |||
2595 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
2596 | pc->broadcast_signal = parse_bool(0); | ||
2597 | } | ||
2598 | |||
2599 | /** | ||
2523 | @page edcref | 2600 | @page edcref |
2524 | @block | 2601 | @block |
2525 | script | 2602 | script |
@@ -2947,21 +3024,57 @@ st_collections_group_parts_part_name(void) | |||
2947 | static void | 3024 | static void |
2948 | st_collections_group_parts_part_type(void) | 3025 | st_collections_group_parts_part_type(void) |
2949 | { | 3026 | { |
3027 | unsigned int type; | ||
3028 | |||
2950 | check_arg_count(1); | 3029 | check_arg_count(1); |
2951 | 3030 | ||
2952 | current_part->type = parse_enum(0, | 3031 | type = parse_enum(0, |
2953 | "NONE", EDJE_PART_TYPE_NONE, | 3032 | "NONE", EDJE_PART_TYPE_NONE, |
2954 | "RECT", EDJE_PART_TYPE_RECTANGLE, | 3033 | "RECT", EDJE_PART_TYPE_RECTANGLE, |
2955 | "TEXT", EDJE_PART_TYPE_TEXT, | 3034 | "TEXT", EDJE_PART_TYPE_TEXT, |
2956 | "IMAGE", EDJE_PART_TYPE_IMAGE, | 3035 | "IMAGE", EDJE_PART_TYPE_IMAGE, |
2957 | "SWALLOW", EDJE_PART_TYPE_SWALLOW, | 3036 | "SWALLOW", EDJE_PART_TYPE_SWALLOW, |
2958 | "TEXTBLOCK", EDJE_PART_TYPE_TEXTBLOCK, | 3037 | "TEXTBLOCK", EDJE_PART_TYPE_TEXTBLOCK, |
2959 | "GROUP", EDJE_PART_TYPE_GROUP, | 3038 | "GROUP", EDJE_PART_TYPE_GROUP, |
2960 | "BOX", EDJE_PART_TYPE_BOX, | 3039 | "BOX", EDJE_PART_TYPE_BOX, |
2961 | "TABLE", EDJE_PART_TYPE_TABLE, | 3040 | "TABLE", EDJE_PART_TYPE_TABLE, |
2962 | "EXTERNAL", EDJE_PART_TYPE_EXTERNAL, | 3041 | "EXTERNAL", EDJE_PART_TYPE_EXTERNAL, |
2963 | "PROXY", EDJE_PART_TYPE_PROXY, | 3042 | "PROXY", EDJE_PART_TYPE_PROXY, |
2964 | NULL); | 3043 | NULL); |
3044 | |||
3045 | /* handle type change of inherited part */ | ||
3046 | if (type != current_part->type) | ||
3047 | { | ||
3048 | Edje_Part_Description_Common *new, *previous; | ||
3049 | Edje_Part_Collection *pc; | ||
3050 | Edje_Part *ep; | ||
3051 | unsigned int i; | ||
3052 | |||
3053 | /* we don't free old part as we don't remove all reference to them */ | ||
3054 | part_description_image_cleanup(current_part); | ||
3055 | |||
3056 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
3057 | ep = current_part; | ||
3058 | |||
3059 | previous = ep->default_desc; | ||
3060 | if (previous) | ||
3061 | { | ||
3062 | new = _edje_part_description_alloc(type, pc->part, ep->name); | ||
3063 | memcpy(new, previous, sizeof (Edje_Part_Description_Common)); | ||
3064 | |||
3065 | ep->default_desc = new; | ||
3066 | } | ||
3067 | |||
3068 | for (i = 0; i < ep->other.desc_count; i++) | ||
3069 | { | ||
3070 | previous = ep->other.desc[i]; | ||
3071 | new = _edje_part_description_alloc(type, pc->part, ep->name); | ||
3072 | memcpy(new, previous, sizeof (Edje_Part_Description_Common)); | ||
3073 | ep->other.desc[i] = new; | ||
3074 | } | ||
3075 | } | ||
3076 | |||
3077 | current_part->type = type; | ||
2965 | } | 3078 | } |
2966 | 3079 | ||
2967 | /** | 3080 | /** |
@@ -4292,6 +4405,7 @@ st_collections_group_parts_part_description_inherit(void) | |||
4292 | 4405 | ||
4293 | ied->image = iparent->image; | 4406 | ied->image = iparent->image; |
4294 | 4407 | ||
4408 | data_queue_image_remove(&ied->image.id, &ied->image.set); | ||
4295 | data_queue_copied_image_lookup(&iparent->image.id, &ied->image.id, &ied->image.set); | 4409 | data_queue_copied_image_lookup(&iparent->image.id, &ied->image.id, &ied->image.set); |
4296 | 4410 | ||
4297 | ied->image.tweens = calloc(iparent->image.tweens_count, | 4411 | ied->image.tweens = calloc(iparent->image.tweens_count, |
@@ -4303,6 +4417,7 @@ st_collections_group_parts_part_description_inherit(void) | |||
4303 | iid = iparent->image.tweens[i]; | 4417 | iid = iparent->image.tweens[i]; |
4304 | 4418 | ||
4305 | iid_new = mem_alloc(SZ(Edje_Part_Image_Id)); | 4419 | iid_new = mem_alloc(SZ(Edje_Part_Image_Id)); |
4420 | data_queue_image_remove(&ied->image.id, &ied->image.set); | ||
4306 | data_queue_copied_image_lookup(&(iid->id), &(iid_new->id), &(iid_new->set)); | 4421 | data_queue_copied_image_lookup(&(iid->id), &(iid_new->id), &(iid_new->set)); |
4307 | ied->image.tweens[i] = iid_new; | 4422 | ied->image.tweens[i] = iid_new; |
4308 | } | 4423 | } |
@@ -4445,6 +4560,9 @@ st_collections_group_parts_part_description_state(void) | |||
4445 | if ((ep->default_desc->state.name && !strcmp(s, ep->default_desc->state.name) && ed->state.value == ep->default_desc->state.value) || | 4560 | if ((ep->default_desc->state.name && !strcmp(s, ep->default_desc->state.name) && ed->state.value == ep->default_desc->state.value) || |
4446 | (!ep->default_desc->state.name && !strcmp(s, "default") && ed->state.value == ep->default_desc->state.value)) | 4561 | (!ep->default_desc->state.name && !strcmp(s, "default") && ed->state.value == ep->default_desc->state.value)) |
4447 | { | 4562 | { |
4563 | if (ep->type == EDJE_PART_TYPE_IMAGE) | ||
4564 | _edje_part_description_image_remove((Edje_Part_Description_Image*) ed); | ||
4565 | |||
4448 | free(ed); | 4566 | free(ed); |
4449 | ep->other.desc_count--; | 4567 | ep->other.desc_count--; |
4450 | ep->other.desc = realloc(ep->other.desc, | 4568 | ep->other.desc = realloc(ep->other.desc, |
@@ -4458,6 +4576,9 @@ st_collections_group_parts_part_description_state(void) | |||
4458 | { | 4576 | { |
4459 | if (!strcmp(s, ep->other.desc[i]->state.name) && ed->state.value == ep->other.desc[i]->state.value) | 4577 | if (!strcmp(s, ep->other.desc[i]->state.name) && ed->state.value == ep->other.desc[i]->state.value) |
4460 | { | 4578 | { |
4579 | if (ep->type == EDJE_PART_TYPE_IMAGE) | ||
4580 | _edje_part_description_image_remove((Edje_Part_Description_Image*) ed); | ||
4581 | |||
4461 | free(ed); | 4582 | free(ed); |
4462 | ep->other.desc_count--; | 4583 | ep->other.desc_count--; |
4463 | ep->other.desc = realloc(ep->other.desc, | 4584 | ep->other.desc = realloc(ep->other.desc, |
@@ -4538,18 +4659,38 @@ st_collections_group_parts_part_description_fixed(void) | |||
4538 | @property | 4659 | @property |
4539 | min | 4660 | min |
4540 | @parameters | 4661 | @parameters |
4541 | [width] [height] | 4662 | [width] [height] or SOURCE |
4542 | @effect | 4663 | @effect |
4543 | The minimum size of the state. | 4664 | The minimum size of the state. |
4665 | |||
4666 | When min is defined to SOURCE, it will look at the original | ||
4667 | image size and enforce it minimal size to match at least the | ||
4668 | original one. The part must be an IMAGE or a GROUP part. | ||
4544 | @endproperty | 4669 | @endproperty |
4545 | */ | 4670 | */ |
4546 | static void | 4671 | static void |
4547 | st_collections_group_parts_part_description_min(void) | 4672 | st_collections_group_parts_part_description_min(void) |
4548 | { | 4673 | { |
4549 | check_arg_count(2); | 4674 | check_min_arg_count(1); |
4675 | |||
4676 | if (is_param(1)) { | ||
4677 | current_desc->min.w = parse_float_range(0, 0, 0x7fffffff); | ||
4678 | current_desc->min.h = parse_float_range(1, 0, 0x7fffffff); | ||
4679 | } else { | ||
4680 | char *tmp; | ||
4681 | |||
4682 | tmp = parse_str(0); | ||
4683 | if ((current_part->type != EDJE_PART_TYPE_IMAGE && current_part->type != EDJE_PART_TYPE_GROUP) || | ||
4684 | !tmp || strcmp(tmp, "SOURCE") != 0) | ||
4685 | { | ||
4686 | ERR("%s: Error. parse error %s:%i. " | ||
4687 | "Only IMAGE and GROUP part can have a min: SOURCE; defined", | ||
4688 | progname, file_in, line - 1); | ||
4689 | exit(-1); | ||
4690 | } | ||
4550 | 4691 | ||
4551 | current_desc->min.w = parse_float_range(0, 0, 0x7fffffff); | 4692 | current_desc->min.limit = EINA_TRUE; |
4552 | current_desc->min.h = parse_float_range(1, 0, 0x7fffffff); | 4693 | } |
4553 | } | 4694 | } |
4554 | 4695 | ||
4555 | /** | 4696 | /** |
@@ -4578,18 +4719,38 @@ st_collections_group_parts_part_description_minmul(void) | |||
4578 | @property | 4719 | @property |
4579 | max | 4720 | max |
4580 | @parameters | 4721 | @parameters |
4581 | [width] [height] | 4722 | [width] [height] or SOURCE |
4582 | @effect | 4723 | @effect |
4583 | The maximum size of the state. A size of -1.0 means that it will be ignored in one direction. | 4724 | The maximum size of the state. A size of -1.0 means that it will be ignored in one direction. |
4725 | |||
4726 | When max is set to SOURCE, edje will enforce the part to be | ||
4727 | not more than the original image size. The part must be an | ||
4728 | IMAGE part. | ||
4584 | @endproperty | 4729 | @endproperty |
4585 | */ | 4730 | */ |
4586 | static void | 4731 | static void |
4587 | st_collections_group_parts_part_description_max(void) | 4732 | st_collections_group_parts_part_description_max(void) |
4588 | { | 4733 | { |
4589 | check_arg_count(2); | 4734 | check_min_arg_count(1); |
4735 | |||
4736 | if (is_param(1)) { | ||
4737 | current_desc->max.w = parse_float_range(0, -1.0, 0x7fffffff); | ||
4738 | current_desc->max.h = parse_float_range(1, -1.0, 0x7fffffff); | ||
4739 | } else { | ||
4740 | char *tmp; | ||
4590 | 4741 | ||
4591 | current_desc->max.w = parse_float_range(0, -1.0, 0x7fffffff); | 4742 | tmp = parse_str(0); |
4592 | current_desc->max.h = parse_float_range(1, -1.0, 0x7fffffff); | 4743 | if (current_part->type != EDJE_PART_TYPE_IMAGE || |
4744 | !tmp || strcmp(tmp, "SOURCE") != 0) | ||
4745 | { | ||
4746 | ERR("%s: Error. parse error %s:%i. " | ||
4747 | "Only IMAGE part can have a max: SOURCE; defined", | ||
4748 | progname, file_in, line - 1); | ||
4749 | exit(-1); | ||
4750 | } | ||
4751 | |||
4752 | current_desc->max.limit = EINA_TRUE; | ||
4753 | } | ||
4593 | } | 4754 | } |
4594 | 4755 | ||
4595 | /** | 4756 | /** |
@@ -5039,6 +5200,7 @@ st_collections_group_parts_part_description_image_normal(void) | |||
5039 | char *name; | 5200 | char *name; |
5040 | 5201 | ||
5041 | name = parse_str(0); | 5202 | name = parse_str(0); |
5203 | data_queue_image_remove(&(ed->image.id), &(ed->image.set)); | ||
5042 | data_queue_image_lookup(name, &(ed->image.id), &(ed->image.set)); | 5204 | data_queue_image_lookup(name, &(ed->image.id), &(ed->image.set)); |
5043 | free(name); | 5205 | free(name); |
5044 | } | 5206 | } |
@@ -5083,6 +5245,7 @@ st_collections_group_parts_part_description_image_tween(void) | |||
5083 | sizeof (Edje_Part_Image_Id*) * ed->image.tweens_count); | 5245 | sizeof (Edje_Part_Image_Id*) * ed->image.tweens_count); |
5084 | ed->image.tweens[ed->image.tweens_count - 1] = iid; | 5246 | ed->image.tweens[ed->image.tweens_count - 1] = iid; |
5085 | name = parse_str(0); | 5247 | name = parse_str(0); |
5248 | data_queue_image_remove(&(iid->id), &(iid->set)); | ||
5086 | data_queue_image_lookup(name, &(iid->id), &(iid->set)); | 5249 | data_queue_image_lookup(name, &(iid->id), &(iid->set)); |
5087 | free(name); | 5250 | free(name); |
5088 | } | 5251 | } |
diff --git a/libraries/edje/src/bin/edje_cc_mem.c b/libraries/edje/src/bin/edje_cc_mem.c index 7c1a5c9..d2d4ae0 100644 --- a/libraries/edje/src/bin/edje_cc_mem.c +++ b/libraries/edje/src/bin/edje_cc_mem.c | |||
@@ -7,12 +7,6 @@ | |||
7 | 7 | ||
8 | #include "edje_cc.h" | 8 | #include "edje_cc.h" |
9 | 9 | ||
10 | #ifdef _WIN32 | ||
11 | # define FMT_SIZE_T "%Iu" | ||
12 | #else | ||
13 | # define FMT_SIZE_T "%zu" | ||
14 | #endif | ||
15 | |||
16 | void * | 10 | void * |
17 | mem_alloc(size_t size) | 11 | mem_alloc(size_t size) |
18 | { | 12 | { |
@@ -20,7 +14,7 @@ mem_alloc(size_t size) | |||
20 | 14 | ||
21 | mem = calloc(1, size); | 15 | mem = calloc(1, size); |
22 | if (mem) return mem; | 16 | if (mem) return mem; |
23 | ERR("%s: Error. %s:%i memory allocation of " FMT_SIZE_T " bytes failed. %s", | 17 | ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s", |
24 | progname, file_in, line, size, strerror(errno)); | 18 | progname, file_in, line, size, strerror(errno)); |
25 | exit(-1); | 19 | exit(-1); |
26 | return NULL; | 20 | return NULL; |
@@ -33,7 +27,7 @@ mem_strdup(const char *s) | |||
33 | 27 | ||
34 | str = strdup(s); | 28 | str = strdup(s); |
35 | if (str) return str; | 29 | if (str) return str; |
36 | ERR("%s: Error. %s:%i memory allocation of " FMT_SIZE_T " bytes failed. %s. string being duplicated: \"%s\"", | 30 | ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"", |
37 | progname, file_in, line, strlen(s) + 1, strerror(errno), s); | 31 | progname, file_in, line, strlen(s) + 1, strerror(errno), s); |
38 | exit(-1); | 32 | exit(-1); |
39 | return NULL; | 33 | return NULL; |
diff --git a/libraries/edje/src/bin/edje_cc_out.c b/libraries/edje/src/bin/edje_cc_out.c index 5050ad4..b4c541c 100644 --- a/libraries/edje/src/bin/edje_cc_out.c +++ b/libraries/edje/src/bin/edje_cc_out.c | |||
@@ -2,21 +2,30 @@ | |||
2 | # include "config.h" | 2 | # include "config.h" |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #ifdef STDC_HEADERS | ||
6 | # include <stdlib.h> | ||
7 | # include <stddef.h> | ||
8 | #else | ||
9 | # ifdef HAVE_STDLIB_H | ||
10 | # include <stdlib.h> | ||
11 | # endif | ||
12 | #endif | ||
5 | #ifdef HAVE_ALLOCA_H | 13 | #ifdef HAVE_ALLOCA_H |
6 | # include <alloca.h> | 14 | # include <alloca.h> |
7 | #elif defined __GNUC__ | 15 | #elif !defined alloca |
8 | # define alloca __builtin_alloca | 16 | # ifdef __GNUC__ |
9 | #elif defined _AIX | 17 | # define alloca __builtin_alloca |
10 | # define alloca __alloca | 18 | # elif defined _AIX |
11 | #elif defined _MSC_VER | 19 | # define alloca __alloca |
12 | # include <malloc.h> | 20 | # elif defined _MSC_VER |
13 | # define alloca _alloca | 21 | # include <malloc.h> |
14 | #else | 22 | # define alloca _alloca |
15 | # include <stddef.h> | 23 | # elif !defined HAVE_ALLOCA |
16 | # ifdef __cplusplus | 24 | # ifdef __cplusplus |
17 | extern "C" | 25 | extern "C" |
18 | # endif | 26 | # endif |
19 | void *alloca (size_t); | 27 | void *alloca (size_t); |
28 | # endif | ||
20 | #endif | 29 | #endif |
21 | 30 | ||
22 | #include <string.h> | 31 | #include <string.h> |
@@ -102,7 +111,7 @@ struct _Code_Lookup | |||
102 | Eina_Bool set; | 111 | Eina_Bool set; |
103 | }; | 112 | }; |
104 | 113 | ||
105 | static void data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char *ptr, int len)); | 114 | static void data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char* ptr, int len)); |
106 | 115 | ||
107 | Edje_File *edje_file = NULL; | 116 | Edje_File *edje_file = NULL; |
108 | Eina_List *edje_collections = NULL; | 117 | Eina_List *edje_collections = NULL; |
@@ -500,7 +509,8 @@ data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw | |||
500 | { | 509 | { |
501 | img = &edje_file->image_dir->entries[i]; | 510 | img = &edje_file->image_dir->entries[i]; |
502 | 511 | ||
503 | if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) | 512 | if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL |
513 | || img->entry == NULL) | ||
504 | { | 514 | { |
505 | } | 515 | } |
506 | else | 516 | else |
@@ -1550,6 +1560,23 @@ data_queue_image_lookup(char *name, int *dest, Eina_Bool *set) | |||
1550 | } | 1560 | } |
1551 | 1561 | ||
1552 | void | 1562 | void |
1563 | data_queue_image_remove(int *dest, Eina_Bool *set) | ||
1564 | { | ||
1565 | Eina_List *l; | ||
1566 | Image_Lookup *il; | ||
1567 | |||
1568 | EINA_LIST_FOREACH(image_lookups, l, il) | ||
1569 | { | ||
1570 | if (il->dest == dest && il->set == set) | ||
1571 | { | ||
1572 | image_lookups = eina_list_remove_list(image_lookups, l); | ||
1573 | free(il); | ||
1574 | return ; | ||
1575 | } | ||
1576 | } | ||
1577 | } | ||
1578 | |||
1579 | void | ||
1553 | data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set) | 1580 | data_queue_copied_image_lookup(int *src, int *dest, Eina_Bool *set) |
1554 | { | 1581 | { |
1555 | Eina_List *l; | 1582 | Eina_List *l; |
@@ -1602,14 +1629,64 @@ data_process_lookups(void) | |||
1602 | Program_Lookup *program; | 1629 | Program_Lookup *program; |
1603 | Group_Lookup *group; | 1630 | Group_Lookup *group; |
1604 | Image_Lookup *image; | 1631 | Image_Lookup *image; |
1632 | Eina_List *l2; | ||
1605 | Eina_List *l; | 1633 | Eina_List *l; |
1634 | Eina_Hash *images_in_use; | ||
1606 | void *data; | 1635 | void *data; |
1636 | Eina_Bool is_lua = EINA_FALSE; | ||
1637 | |||
1638 | /* remove all unreferenced Edje_Part_Collection */ | ||
1639 | EINA_LIST_FOREACH_SAFE(edje_collections, l, l2, pc) | ||
1640 | { | ||
1641 | Edje_Part_Collection_Directory_Entry *alias; | ||
1642 | Edje_Part_Collection_Directory_Entry *find; | ||
1643 | Eina_List *l3; | ||
1644 | unsigned int id = 0; | ||
1645 | unsigned int i; | ||
1646 | |||
1647 | find = eina_hash_find(edje_file->collection, pc->part); | ||
1648 | if (find && find->id == pc->id) | ||
1649 | continue ; | ||
1650 | |||
1651 | EINA_LIST_FOREACH(aliases, l3, alias) | ||
1652 | if (alias->id == pc->id) | ||
1653 | continue ; | ||
1654 | |||
1655 | /* This Edje_Part_Collection is not used at all */ | ||
1656 | edje_collections = eina_list_remove_list(edje_collections, l); | ||
1657 | l3 = eina_list_nth_list(codes, pc->id); | ||
1658 | codes = eina_list_remove_list(codes, l3); | ||
1659 | |||
1660 | /* Unref all image used by that group */ | ||
1661 | for (i = 0; i < pc->parts_count; ++i) | ||
1662 | part_description_image_cleanup(pc->parts[i]); | ||
1663 | |||
1664 | /* Correct all id */ | ||
1665 | EINA_LIST_FOREACH(edje_collections, l3, pc) | ||
1666 | { | ||
1667 | Eina_List *l4; | ||
1668 | |||
1669 | /* Some group could be removed from the collection, but still be referenced by alias */ | ||
1670 | find = eina_hash_find(edje_file->collection, pc->part); | ||
1671 | if (pc->id != find->id) find = NULL; | ||
1672 | |||
1673 | /* Update all matching alias */ | ||
1674 | EINA_LIST_FOREACH(aliases, l4, alias) | ||
1675 | if (pc->id == alias->id) | ||
1676 | alias->id = id; | ||
1677 | |||
1678 | pc->id = id++; | ||
1679 | if (find) find->id = pc->id; | ||
1680 | } | ||
1681 | } | ||
1607 | 1682 | ||
1608 | EINA_LIST_FOREACH(edje_collections, l, pc) | 1683 | EINA_LIST_FOREACH(edje_collections, l, pc) |
1609 | { | 1684 | { |
1610 | unsigned int count = 0; | 1685 | unsigned int count = 0; |
1611 | unsigned int i; | 1686 | unsigned int i; |
1612 | 1687 | ||
1688 | if (pc->lua_script_only) | ||
1689 | is_lua = EINA_TRUE; | ||
1613 | #define PROGRAM_ID_SET(Type, Pc, It, Count) \ | 1690 | #define PROGRAM_ID_SET(Type, Pc, It, Count) \ |
1614 | for (It = 0; It < Pc->programs.Type ## _count; ++It) \ | 1691 | for (It = 0; It < Pc->programs.Type ## _count; ++It) \ |
1615 | { \ | 1692 | { \ |
@@ -1738,13 +1815,15 @@ data_process_lookups(void) | |||
1738 | free(group); | 1815 | free(group); |
1739 | } | 1816 | } |
1740 | 1817 | ||
1818 | images_in_use = eina_hash_string_superfast_new(NULL); | ||
1819 | |||
1741 | EINA_LIST_FREE(image_lookups, image) | 1820 | EINA_LIST_FREE(image_lookups, image) |
1742 | { | 1821 | { |
1743 | Edje_Image_Directory_Entry *de; | ||
1744 | Eina_Bool find = EINA_FALSE; | 1822 | Eina_Bool find = EINA_FALSE; |
1745 | 1823 | ||
1746 | if (edje_file->image_dir) | 1824 | if (edje_file->image_dir) |
1747 | { | 1825 | { |
1826 | Edje_Image_Directory_Entry *de; | ||
1748 | unsigned int i; | 1827 | unsigned int i; |
1749 | 1828 | ||
1750 | for (i = 0; i < edje_file->image_dir->entries_count; ++i) | 1829 | for (i = 0; i < edje_file->image_dir->entries_count; ++i) |
@@ -1760,6 +1839,9 @@ data_process_lookups(void) | |||
1760 | *(image->dest) = de->id; | 1839 | *(image->dest) = de->id; |
1761 | *(image->set) = EINA_FALSE; | 1840 | *(image->set) = EINA_FALSE; |
1762 | find = EINA_TRUE; | 1841 | find = EINA_TRUE; |
1842 | |||
1843 | if (!eina_hash_find(images_in_use, image->name)) | ||
1844 | eina_hash_direct_add(images_in_use, de->entry, de); | ||
1763 | break; | 1845 | break; |
1764 | } | 1846 | } |
1765 | } | 1847 | } |
@@ -1774,10 +1856,20 @@ data_process_lookups(void) | |||
1774 | 1856 | ||
1775 | if ((set->name) && (!strcmp(set->name, image->name))) | 1857 | if ((set->name) && (!strcmp(set->name, image->name))) |
1776 | { | 1858 | { |
1859 | Edje_Image_Directory_Set_Entry *child; | ||
1860 | Eina_List *lc; | ||
1861 | |||
1777 | handle_slave_lookup(image_slave_lookups, image->dest, set->id); | 1862 | handle_slave_lookup(image_slave_lookups, image->dest, set->id); |
1778 | *(image->dest) = set->id; | 1863 | *(image->dest) = set->id; |
1779 | *(image->set) = EINA_TRUE; | 1864 | *(image->set) = EINA_TRUE; |
1780 | find = EINA_TRUE; | 1865 | find = EINA_TRUE; |
1866 | |||
1867 | EINA_LIST_FOREACH(set->entries, lc, child) | ||
1868 | if (!eina_hash_find(images_in_use, child->name)) | ||
1869 | eina_hash_direct_add(images_in_use, child->name, child); | ||
1870 | |||
1871 | if (!eina_hash_find(images_in_use, image->name)) | ||
1872 | eina_hash_direct_add(images_in_use, set->name, set); | ||
1781 | break; | 1873 | break; |
1782 | } | 1874 | } |
1783 | } | 1875 | } |
@@ -1795,6 +1887,54 @@ data_process_lookups(void) | |||
1795 | free(image); | 1887 | free(image); |
1796 | } | 1888 | } |
1797 | 1889 | ||
1890 | if (edje_file->image_dir && !is_lua) | ||
1891 | { | ||
1892 | Edje_Image_Directory_Entry *de; | ||
1893 | Edje_Image_Directory_Set *set; | ||
1894 | unsigned int i; | ||
1895 | |||
1896 | for (i = 0; i < edje_file->image_dir->entries_count; ++i) | ||
1897 | { | ||
1898 | de = edje_file->image_dir->entries + i; | ||
1899 | |||
1900 | if (de->entry && eina_hash_find(images_in_use, de->entry)) | ||
1901 | continue ; | ||
1902 | |||
1903 | if (verbose) | ||
1904 | { | ||
1905 | printf("%s: Image '%s' in ressource 'edje/image/%i' will not be included as it is unused.\n", progname, de->entry, de->id); | ||
1906 | } | ||
1907 | else | ||
1908 | { | ||
1909 | INF("Image '%s' in ressource 'edje/image/%i' will not be included as it is unused.", de->entry, de->id); | ||
1910 | } | ||
1911 | |||
1912 | de->entry = NULL; | ||
1913 | } | ||
1914 | |||
1915 | for (i = 0; i < edje_file->image_dir->sets_count; ++i) | ||
1916 | { | ||
1917 | set = edje_file->image_dir->sets + i; | ||
1918 | |||
1919 | if (set->name && eina_hash_find(images_in_use, set->name)) | ||
1920 | continue ; | ||
1921 | |||
1922 | if (verbose) | ||
1923 | { | ||
1924 | printf("%s: Set '%s' will not be included as it is unused.\n", progname, set->name); | ||
1925 | } | ||
1926 | else | ||
1927 | { | ||
1928 | INF("Set '%s' will not be included as it is unused.", set->name); | ||
1929 | } | ||
1930 | |||
1931 | set->name = NULL; | ||
1932 | set->entries = NULL; | ||
1933 | } | ||
1934 | } | ||
1935 | |||
1936 | eina_hash_free(images_in_use); | ||
1937 | |||
1798 | EINA_LIST_FREE(part_slave_lookups, data) | 1938 | EINA_LIST_FREE(part_slave_lookups, data) |
1799 | free(data); | 1939 | free(data); |
1800 | 1940 | ||
diff --git a/libraries/edje/src/bin/edje_inspector.c b/libraries/edje/src/bin/edje_inspector.c index 093de86..676c829 100644 --- a/libraries/edje/src/bin/edje_inspector.c +++ b/libraries/edje/src/bin/edje_inspector.c | |||
@@ -31,12 +31,6 @@ static int _log_dom; | |||
31 | #define FLOAT_PRECISION 0.0001 | 31 | #define FLOAT_PRECISION 0.0001 |
32 | #define FDIFF(a, b) (fabs((a) - (b)) > FLOAT_PRECISION) | 32 | #define FDIFF(a, b) (fabs((a) - (b)) > FLOAT_PRECISION) |
33 | 33 | ||
34 | #ifdef _WIN32 | ||
35 | # define FMT_UCHAR "%c" | ||
36 | #else | ||
37 | # define FMT_UCHAR "%hhu" | ||
38 | #endif | ||
39 | |||
40 | /* context */ | 34 | /* context */ |
41 | static Eina_List *groups; | 35 | static Eina_List *groups; |
42 | static Ecore_Evas *ee; | 36 | static Ecore_Evas *ee; |
@@ -1588,8 +1582,8 @@ main(int argc, char **argv) | |||
1588 | goto error_getopt; | 1582 | goto error_getopt; |
1589 | } | 1583 | } |
1590 | 1584 | ||
1591 | DBG("mode=%s, detail=%d(%s), group=%s, part=%s, program=%s, api-only=" FMT_UCHAR | 1585 | DBG("mode=%s, detail=%d(%s), group=%s, part=%s, program=%s, api-only=%hhu" |
1592 | ", api-fix=" FMT_UCHAR ", machine=" FMT_UCHAR ", file=%s", | 1586 | ", api-fix=%hhu, machine=%hhu, file=%s", |
1593 | mode, detail, detail_name, | 1587 | mode, detail, detail_name, |
1594 | group ? group : "", | 1588 | group ? group : "", |
1595 | part ? part : "", | 1589 | part ? part : "", |
diff --git a/libraries/edje/src/bin/edje_player.c b/libraries/edje/src/bin/edje_player.c index 4d0c0a3..208fbb4 100644 --- a/libraries/edje/src/bin/edje_player.c +++ b/libraries/edje/src/bin/edje_player.c | |||
@@ -20,12 +20,6 @@ | |||
20 | #include <Ecore_Evas.h> | 20 | #include <Ecore_Evas.h> |
21 | #include <Edje.h> | 21 | #include <Edje.h> |
22 | 22 | ||
23 | #ifdef _WIN32 | ||
24 | # define FMT_UCHAR "%c" | ||
25 | #else | ||
26 | # define FMT_UCHAR "%hhu" | ||
27 | #endif | ||
28 | |||
29 | struct opts { | 23 | struct opts { |
30 | char *file; | 24 | char *file; |
31 | char *group; | 25 | char *group; |
@@ -554,7 +548,7 @@ static unsigned char _parse_color(__UNUSED__ const Ecore_Getopt *parser, __UNUSE | |||
554 | { | 548 | { |
555 | unsigned char *color = (unsigned char *)storage->ptrp; | 549 | unsigned char *color = (unsigned char *)storage->ptrp; |
556 | 550 | ||
557 | if (sscanf(str, FMT_UCHAR "," FMT_UCHAR "," FMT_UCHAR, color, color + 1, color + 2) != 3) | 551 | if (sscanf(str, "%hhu,%hhu,%hhu", color, color + 1, color + 2) != 3) |
558 | { | 552 | { |
559 | fprintf(stderr, "ERROR: incorrect color value '%s'\n", str); | 553 | fprintf(stderr, "ERROR: incorrect color value '%s'\n", str); |
560 | return 0; | 554 | return 0; |
diff --git a/libraries/edje/src/bin/epp/Makefile.in b/libraries/edje/src/bin/epp/Makefile.in index c1a8ee5..2ef2e56 100644 --- a/libraries/edje/src/bin/epp/Makefile.in +++ b/libraries/edje/src/bin/epp/Makefile.in | |||
@@ -225,6 +225,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
225 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 225 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
226 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 226 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
227 | PKG_CONFIG = @PKG_CONFIG@ | 227 | PKG_CONFIG = @PKG_CONFIG@ |
228 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
229 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
228 | PYTHON = @PYTHON@ | 230 | PYTHON = @PYTHON@ |
229 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 231 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
230 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 232 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
diff --git a/libraries/edje/src/examples/Makefile.am b/libraries/edje/src/examples/Makefile.am index 579f148..e3893cd 100644 --- a/libraries/edje/src/examples/Makefile.am +++ b/libraries/edje/src/examples/Makefile.am | |||
@@ -1,5 +1,10 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | 1 | MAINTAINERCLEANFILES = Makefile.in |
2 | 2 | ||
3 | EDJE_CC = @edje_cc@ | ||
4 | EDJE_CC_FLAGS_VERBOSE_0 = | ||
5 | EDJE_CC_FLAGS_VERBOSE_1 = -v | ||
6 | EDJE_CC_FLAGS = $(EDJE_CC_FLAGS_$(V)) -id $(srcdir) -fd $(srcdir) | ||
7 | |||
3 | examplesdir = $(datadir)/$(PACKAGE)/examples | 8 | examplesdir = $(datadir)/$(PACKAGE)/examples |
4 | 9 | ||
5 | if ENABLE_MULTISENSE | 10 | if ENABLE_MULTISENSE |
@@ -24,7 +29,8 @@ EDCS = \ | |||
24 | $(MULTISENSE_EDC_FILE) | 29 | $(MULTISENSE_EDC_FILE) |
25 | 30 | ||
26 | .edc.edj: | 31 | .edc.edj: |
27 | $(edje_cc) -v -fd $(srcdir) -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F) | 32 | $(EDJE_CC) $(EDJE_CC_FLAGS) $(SND_DIR) $< $(builddir)/$(@F) |
33 | |||
28 | 34 | ||
29 | EDJS = $(EDCS:%.edc=%.edj) | 35 | EDJS = $(EDCS:%.edc=%.edj) |
30 | 36 | ||
@@ -53,31 +59,33 @@ EXTRA_DIST = $(files_DATA) | |||
53 | if BUILD_EXAMPLES | 59 | if BUILD_EXAMPLES |
54 | 60 | ||
55 | AM_CPPFLAGS = \ | 61 | AM_CPPFLAGS = \ |
56 | -I. \ | 62 | -I. \ |
57 | -I$(top_srcdir)/src/lib \ | 63 | -I$(top_srcdir)/src/lib \ |
58 | -I$(top_srcdir)/src/lib/include \ | 64 | -I$(top_srcdir)/src/lib/include \ |
59 | -DPACKAGE_BIN_DIR=\"$(bindir)\" \ | 65 | -DPACKAGE_BIN_DIR=\"$(bindir)\" \ |
60 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | 66 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ |
61 | -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | 67 | -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ |
62 | -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ | 68 | @EDJE_CFLAGS@ |
63 | @EDJE_CFLAGS@ | ||
64 | 69 | ||
65 | files_DATA += $(EDJS) | 70 | files_DATA += $(EDJS) |
66 | 71 | ||
67 | examples_PROGRAMS = \ | 72 | examples_PROGRAMS = \ |
73 | edje-animations \ | ||
68 | edje-basic \ | 74 | edje-basic \ |
69 | edje-swallow \ | ||
70 | edje-text \ | ||
71 | edje-table \ | ||
72 | edje-box \ | 75 | edje-box \ |
73 | edje-box2 \ | 76 | edje-box2 \ |
74 | edje-drag\ | ||
75 | edje-signals-messages \ | ||
76 | edje-color-class \ | 77 | edje-color-class \ |
78 | edje-drag\ | ||
77 | edje-perspective \ | 79 | edje-perspective \ |
78 | edje-animations \ | 80 | edje-signals-messages \ |
81 | edje-swallow \ | ||
82 | edje-table \ | ||
83 | edje-text \ | ||
79 | sigtest | 84 | sigtest |
80 | 85 | ||
81 | LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ | 86 | LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ |
82 | 87 | ||
83 | endif | 88 | endif |
89 | |||
90 | clean-local: | ||
91 | rm -f *.edj | ||
diff --git a/libraries/edje/src/examples/Makefile.in b/libraries/edje/src/examples/Makefile.in index 7f867e0..de47940 100644 --- a/libraries/edje/src/examples/Makefile.in +++ b/libraries/edje/src/examples/Makefile.in | |||
@@ -36,14 +36,15 @@ POST_UNINSTALL = : | |||
36 | build_triplet = @build@ | 36 | build_triplet = @build@ |
37 | host_triplet = @host@ | 37 | host_triplet = @host@ |
38 | @BUILD_EXAMPLES_TRUE@am__append_1 = $(EDJS) | 38 | @BUILD_EXAMPLES_TRUE@am__append_1 = $(EDJS) |
39 | @BUILD_EXAMPLES_TRUE@examples_PROGRAMS = edje-basic$(EXEEXT) \ | 39 | @BUILD_EXAMPLES_TRUE@examples_PROGRAMS = edje-animations$(EXEEXT) \ |
40 | @BUILD_EXAMPLES_TRUE@ edje-swallow$(EXEEXT) edje-text$(EXEEXT) \ | 40 | @BUILD_EXAMPLES_TRUE@ edje-basic$(EXEEXT) edje-box$(EXEEXT) \ |
41 | @BUILD_EXAMPLES_TRUE@ edje-table$(EXEEXT) edje-box$(EXEEXT) \ | 41 | @BUILD_EXAMPLES_TRUE@ edje-box2$(EXEEXT) \ |
42 | @BUILD_EXAMPLES_TRUE@ edje-box2$(EXEEXT) edje-drag$(EXEEXT) \ | ||
43 | @BUILD_EXAMPLES_TRUE@ edje-signals-messages$(EXEEXT) \ | ||
44 | @BUILD_EXAMPLES_TRUE@ edje-color-class$(EXEEXT) \ | 42 | @BUILD_EXAMPLES_TRUE@ edje-color-class$(EXEEXT) \ |
43 | @BUILD_EXAMPLES_TRUE@ edje-drag$(EXEEXT) \ | ||
45 | @BUILD_EXAMPLES_TRUE@ edje-perspective$(EXEEXT) \ | 44 | @BUILD_EXAMPLES_TRUE@ edje-perspective$(EXEEXT) \ |
46 | @BUILD_EXAMPLES_TRUE@ edje-animations$(EXEEXT) sigtest$(EXEEXT) | 45 | @BUILD_EXAMPLES_TRUE@ edje-signals-messages$(EXEEXT) \ |
46 | @BUILD_EXAMPLES_TRUE@ edje-swallow$(EXEEXT) edje-table$(EXEEXT) \ | ||
47 | @BUILD_EXAMPLES_TRUE@ edje-text$(EXEEXT) sigtest$(EXEEXT) | ||
47 | subdir = src/examples | 48 | subdir = src/examples |
48 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | 49 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in |
49 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | 50 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
@@ -279,6 +280,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
279 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 280 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
280 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 281 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
281 | PKG_CONFIG = @PKG_CONFIG@ | 282 | PKG_CONFIG = @PKG_CONFIG@ |
283 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
284 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
282 | PYTHON = @PYTHON@ | 285 | PYTHON = @PYTHON@ |
283 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 286 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
284 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 287 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
@@ -366,6 +369,10 @@ top_srcdir = @top_srcdir@ | |||
366 | version_info = @version_info@ | 369 | version_info = @version_info@ |
367 | vimdir = @vimdir@ | 370 | vimdir = @vimdir@ |
368 | MAINTAINERCLEANFILES = Makefile.in | 371 | MAINTAINERCLEANFILES = Makefile.in |
372 | EDJE_CC = @edje_cc@ | ||
373 | EDJE_CC_FLAGS_VERBOSE_0 = | ||
374 | EDJE_CC_FLAGS_VERBOSE_1 = -v | ||
375 | EDJE_CC_FLAGS = $(EDJE_CC_FLAGS_$(V)) -id $(srcdir) -fd $(srcdir) | ||
369 | examplesdir = $(datadir)/$(PACKAGE)/examples | 376 | examplesdir = $(datadir)/$(PACKAGE)/examples |
370 | @ENABLE_MULTISENSE_TRUE@MULTISENSE_EDC_FILE = multisense.edc | 377 | @ENABLE_MULTISENSE_TRUE@MULTISENSE_EDC_FILE = multisense.edc |
371 | @ENABLE_MULTISENSE_TRUE@SND_DIR = -sd $(srcdir) | 378 | @ENABLE_MULTISENSE_TRUE@SND_DIR = -sd $(srcdir) |
@@ -394,14 +401,13 @@ files_DATA = $(EDCS) bubble.png red.png test.png Vera.ttf edje-basic.c \ | |||
394 | edje-perspective.c edje-animations.c sigtest.c $(am__append_1) | 401 | edje-perspective.c edje-animations.c sigtest.c $(am__append_1) |
395 | EXTRA_DIST = $(files_DATA) | 402 | EXTRA_DIST = $(files_DATA) |
396 | @BUILD_EXAMPLES_TRUE@AM_CPPFLAGS = \ | 403 | @BUILD_EXAMPLES_TRUE@AM_CPPFLAGS = \ |
397 | @BUILD_EXAMPLES_TRUE@ -I. \ | 404 | @BUILD_EXAMPLES_TRUE@-I. \ |
398 | @BUILD_EXAMPLES_TRUE@ -I$(top_srcdir)/src/lib \ | 405 | @BUILD_EXAMPLES_TRUE@-I$(top_srcdir)/src/lib \ |
399 | @BUILD_EXAMPLES_TRUE@ -I$(top_srcdir)/src/lib/include \ | 406 | @BUILD_EXAMPLES_TRUE@-I$(top_srcdir)/src/lib/include \ |
400 | @BUILD_EXAMPLES_TRUE@ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ | 407 | @BUILD_EXAMPLES_TRUE@-DPACKAGE_BIN_DIR=\"$(bindir)\" \ |
401 | @BUILD_EXAMPLES_TRUE@ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | 408 | @BUILD_EXAMPLES_TRUE@-DPACKAGE_LIB_DIR=\"$(libdir)\" \ |
402 | @BUILD_EXAMPLES_TRUE@ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | 409 | @BUILD_EXAMPLES_TRUE@-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \ |
403 | @BUILD_EXAMPLES_TRUE@ -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ | 410 | @BUILD_EXAMPLES_TRUE@@EDJE_CFLAGS@ |
404 | @BUILD_EXAMPLES_TRUE@ @EDJE_CFLAGS@ | ||
405 | 411 | ||
406 | @BUILD_EXAMPLES_TRUE@LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ | 412 | @BUILD_EXAMPLES_TRUE@LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ |
407 | all: all-am | 413 | all: all-am |
@@ -705,7 +711,7 @@ maintainer-clean-generic: | |||
705 | clean: clean-am | 711 | clean: clean-am |
706 | 712 | ||
707 | clean-am: clean-examplesPROGRAMS clean-generic clean-libtool \ | 713 | clean-am: clean-examplesPROGRAMS clean-generic clean-libtool \ |
708 | mostlyclean-am | 714 | clean-local mostlyclean-am |
709 | 715 | ||
710 | distclean: distclean-am | 716 | distclean: distclean-am |
711 | -rm -rf ./$(DEPDIR) | 717 | -rm -rf ./$(DEPDIR) |
@@ -776,8 +782,8 @@ uninstall-am: uninstall-examplesPROGRAMS uninstall-filesDATA | |||
776 | .MAKE: install-am install-strip | 782 | .MAKE: install-am install-strip |
777 | 783 | ||
778 | .PHONY: CTAGS GTAGS all all-am check check-am clean \ | 784 | .PHONY: CTAGS GTAGS all all-am check check-am clean \ |
779 | clean-examplesPROGRAMS clean-generic clean-libtool ctags \ | 785 | clean-examplesPROGRAMS clean-generic clean-libtool clean-local \ |
780 | distclean distclean-compile distclean-generic \ | 786 | ctags distclean distclean-compile distclean-generic \ |
781 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | 787 | distclean-libtool distclean-tags distdir dvi dvi-am html \ |
782 | html-am info info-am install install-am install-data \ | 788 | html-am info info-am install install-am install-data \ |
783 | install-data-am install-dvi install-dvi-am \ | 789 | install-data-am install-dvi install-dvi-am \ |
@@ -793,7 +799,10 @@ uninstall-am: uninstall-examplesPROGRAMS uninstall-filesDATA | |||
793 | 799 | ||
794 | 800 | ||
795 | .edc.edj: | 801 | .edc.edj: |
796 | $(edje_cc) -v -fd $(srcdir) -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F) | 802 | $(EDJE_CC) $(EDJE_CC_FLAGS) $(SND_DIR) $< $(builddir)/$(@F) |
803 | |||
804 | clean-local: | ||
805 | rm -f *.edj | ||
797 | 806 | ||
798 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | 807 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
799 | # Otherwise a system limit (for SysV at least) may be exceeded. | 808 | # Otherwise a system limit (for SysV at least) may be exceeded. |
diff --git a/libraries/edje/src/examples/edje-animations.c b/libraries/edje/src/examples/edje-animations.c index 9363471..15f2ee0 100644 --- a/libraries/edje/src/examples/edje-animations.c +++ b/libraries/edje/src/examples/edje-animations.c | |||
@@ -10,10 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef HAVE_CONFIG_H | 12 | #ifdef HAVE_CONFIG_H |
13 | #include "config.h" | 13 | # include "config.h" |
14 | #else | 14 | #else |
15 | #define PACKAGE_EXAMPLES_DIR "." | 15 | # define __UNUSED__ |
16 | #define __UNUSED__ | ||
17 | #endif | 16 | #endif |
18 | 17 | ||
19 | #include <Ecore.h> | 18 | #include <Ecore.h> |
@@ -23,34 +22,59 @@ | |||
23 | #define WIDTH (400) | 22 | #define WIDTH (400) |
24 | #define HEIGHT (300) | 23 | #define HEIGHT (300) |
25 | 24 | ||
26 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/animations.edj"; | 25 | static const char commands[] = \ |
27 | static Ecore_Evas *ee; | 26 | "commands are:\n" |
28 | static Evas_Object *bg, *edje_obj; | 27 | "\t+ - increase frametime\n" |
29 | static double frametime = 1.0/30.0; /* default value */ | 28 | "\t- - decrease frametime\n" |
29 | "\t= - status of the animation\n" | ||
30 | "\ts - pause\n" | ||
31 | "\tp - play\n" | ||
32 | "\tf - freeze one object\n" | ||
33 | "\tF - freeze all objects\n" | ||
34 | "\tt - thaw one object\n" | ||
35 | "\tT - thaw all objects\n" | ||
36 | "\ta - start animation of one object\n" | ||
37 | "\tA - stop animation of one object\n" | ||
38 | "\tEsc - exit\n" | ||
39 | "\th - print help\n"; | ||
40 | |||
41 | static double frametime = 1.0 / 30.0; /* default value */ | ||
30 | 42 | ||
31 | static void | 43 | static void |
32 | _on_delete_cb(Ecore_Evas *ee) | 44 | _on_delete_cb(Ecore_Evas *ee __UNUSED__) |
33 | { | 45 | { |
34 | ecore_main_loop_quit(); | 46 | ecore_main_loop_quit(); |
35 | } | 47 | } |
36 | 48 | ||
37 | static void | 49 | static void |
38 | _canvas_resize_cb(Ecore_Evas *ee) | 50 | _on_canvas_resize(Ecore_Evas *ee) |
39 | { | 51 | { |
40 | int w, h; | 52 | Evas_Object *bg; |
41 | 53 | Evas_Object *edje_obj; | |
42 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | 54 | int w; |
43 | evas_object_resize(bg, w, h); | 55 | int h; |
44 | evas_object_resize(edje_obj, w, h); | 56 | |
57 | bg = ecore_evas_data_get(ee, "background"); | ||
58 | edje_obj = ecore_evas_data_get(ee, "edje_obj"); | ||
59 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
60 | evas_object_resize(bg, w, h); | ||
61 | evas_object_resize(edje_obj, w, h); | ||
45 | } | 62 | } |
46 | 63 | ||
47 | static void | 64 | static void |
48 | _on_key_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info) | 65 | _on_key_down(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) |
49 | { | 66 | { |
50 | Evas_Event_Key_Down *ev = event_info; | 67 | Evas_Event_Key_Down *ev; |
51 | double ft; | 68 | double ft; |
69 | |||
70 | ev = (Evas_Event_Key_Down *)event_info; | ||
52 | 71 | ||
53 | if (!strcmp(ev->key, "plus")) | 72 | if (!strcmp(ev->keyname, "h")) |
73 | { | ||
74 | fprintf(stdout, commands); | ||
75 | return; | ||
76 | } | ||
77 | else if (!strcmp(ev->key, "plus")) | ||
54 | { | 78 | { |
55 | frametime *= 2.0; | 79 | frametime *= 2.0; |
56 | fprintf(stdout, "Increasing frametime to: %f\n", frametime); | 80 | fprintf(stdout, "Increasing frametime to: %f\n", frametime); |
@@ -109,24 +133,52 @@ _on_key_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info) | |||
109 | edje_object_animation_set(obj, EINA_FALSE); | 133 | edje_object_animation_set(obj, EINA_FALSE); |
110 | fprintf(stdout, "Stopping the animation in the Edje object\n"); | 134 | fprintf(stdout, "Stopping the animation in the Edje object\n"); |
111 | } | 135 | } |
136 | else if (!strcmp(ev->keyname, "Escape")) | ||
137 | ecore_main_loop_quit(); | ||
138 | else | ||
139 | { | ||
140 | printf("unhandled key: %s\n", ev->keyname); | ||
141 | fprintf(stdout, commands); | ||
142 | } | ||
112 | } | 143 | } |
113 | 144 | ||
114 | int | 145 | int |
115 | main(int argc, char *argv[]) | 146 | main(int argc __UNUSED__, char *argv[]) |
116 | { | 147 | { |
117 | Evas *evas; | 148 | char edje_file_path[PATH_MAX]; |
118 | 149 | const char *edje_file = "animations.edj"; | |
119 | ecore_evas_init(); | 150 | Ecore_Evas *ee; |
120 | edje_init(); | 151 | Evas *evas; |
152 | Evas_Object *bg; | ||
153 | Evas_Object *edje_obj; | ||
154 | Eina_Prefix *pfx; | ||
155 | |||
156 | if (!ecore_evas_init()) | ||
157 | return EXIT_FAILURE; | ||
158 | |||
159 | if (!edje_init()) | ||
160 | goto shutdown_ecore_evas; | ||
161 | |||
162 | pfx = eina_prefix_new(argv[0], main, | ||
163 | "EDJE_EXAMPLES", | ||
164 | "edje/examples", | ||
165 | edje_file, | ||
166 | PACKAGE_BIN_DIR, | ||
167 | PACKAGE_LIB_DIR, | ||
168 | PACKAGE_DATA_DIR, | ||
169 | PACKAGE_DATA_DIR); | ||
170 | if (!pfx) | ||
171 | goto shutdown_edje; | ||
121 | 172 | ||
122 | /* this will give you a window with an Evas canvas under the first | 173 | /* this will give you a window with an Evas canvas under the first |
123 | * engine available */ | 174 | * engine available */ |
124 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 175 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
176 | if (!ee) | ||
177 | goto free_prefix; | ||
125 | 178 | ||
126 | ecore_evas_callback_delete_request_set(ee, _on_delete_cb); | 179 | ecore_evas_callback_delete_request_set(ee, _on_delete_cb); |
127 | ecore_evas_callback_resize_set(ee, _canvas_resize_cb); | 180 | ecore_evas_callback_resize_set(ee, _on_canvas_resize); |
128 | ecore_evas_title_set(ee, "Edje Animations Example"); | 181 | ecore_evas_title_set(ee, "Edje Animations Example"); |
129 | ecore_evas_show(ee); | ||
130 | 182 | ||
131 | evas = ecore_evas_get(ee); | 183 | evas = ecore_evas_get(ee); |
132 | 184 | ||
@@ -135,22 +187,41 @@ main(int argc, char *argv[]) | |||
135 | evas_object_move(bg, 0, 0); /* at canvas' origin */ | 187 | evas_object_move(bg, 0, 0); /* at canvas' origin */ |
136 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ | 188 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ |
137 | evas_object_show(bg); | 189 | evas_object_show(bg); |
190 | ecore_evas_data_set(ee, "background", bg); | ||
138 | 191 | ||
139 | edje_obj = edje_object_add(evas); | 192 | edje_obj = edje_object_add(evas); |
140 | 193 | ||
194 | snprintf(edje_file_path, sizeof(edje_file_path), | ||
195 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); | ||
141 | edje_object_file_set(edje_obj, edje_file_path, "animations_group"); | 196 | edje_object_file_set(edje_obj, edje_file_path, "animations_group"); |
142 | evas_object_move(edje_obj, 0, 0); | 197 | evas_object_move(edje_obj, 0, 0); |
143 | evas_object_resize(edje_obj, WIDTH, HEIGHT); | 198 | evas_object_resize(edje_obj, WIDTH, HEIGHT); |
144 | evas_object_show(edje_obj); | 199 | evas_object_show(edje_obj); |
200 | ecore_evas_data_set(ee, "edje_obj", edje_obj); | ||
145 | 201 | ||
146 | evas_object_event_callback_add(edje_obj, EVAS_CALLBACK_KEY_DOWN, | 202 | evas_object_event_callback_add(edje_obj, EVAS_CALLBACK_KEY_DOWN, |
147 | _on_key_down_cb, NULL); | 203 | _on_key_down, NULL); |
148 | evas_object_focus_set(edje_obj, EINA_TRUE); | 204 | evas_object_focus_set(edje_obj, EINA_TRUE); |
149 | 205 | ||
206 | fprintf(stdout, commands); | ||
207 | |||
208 | ecore_evas_show(ee); | ||
209 | |||
150 | ecore_main_loop_begin(); | 210 | ecore_main_loop_begin(); |
151 | 211 | ||
212 | eina_prefix_free(pfx); | ||
152 | ecore_evas_free(ee); | 213 | ecore_evas_free(ee); |
153 | ecore_evas_shutdown(); | 214 | ecore_evas_shutdown(); |
154 | edje_shutdown(); | 215 | edje_shutdown(); |
155 | return 0; | 216 | |
217 | return EXIT_SUCCESS; | ||
218 | |||
219 | free_prefix: | ||
220 | eina_prefix_free(pfx); | ||
221 | shutdown_edje: | ||
222 | edje_shutdown(); | ||
223 | shutdown_ecore_evas: | ||
224 | ecore_evas_shutdown(); | ||
225 | |||
226 | return EXIT_FAILURE; | ||
156 | } | 227 | } |
diff --git a/libraries/edje/src/examples/edje-basic.c b/libraries/edje/src/examples/edje-basic.c index 2a7a862..8a85312 100644 --- a/libraries/edje/src/examples/edje-basic.c +++ b/libraries/edje/src/examples/edje-basic.c | |||
@@ -11,47 +11,46 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifdef HAVE_CONFIG_H | 13 | #ifdef HAVE_CONFIG_H |
14 | #include "config.h" | 14 | # include "config.h" |
15 | #else | 15 | #else |
16 | #define PACKAGE_EXAMPLES_DIR "." | 16 | # define __UNUSED__ |
17 | #define __UNUSED__ | ||
18 | #endif | 17 | #endif |
19 | 18 | ||
19 | #include <stdio.h> | ||
20 | |||
21 | #include <Eina.h> | ||
20 | #include <Ecore.h> | 22 | #include <Ecore.h> |
21 | #include <Ecore_Evas.h> | 23 | #include <Ecore_Evas.h> |
22 | #include <Edje.h> | 24 | #include <Edje.h> |
23 | #include <stdio.h> | ||
24 | 25 | ||
25 | #define WIDTH (300) | 26 | #define WIDTH (300) |
26 | #define HEIGHT (300) | 27 | #define HEIGHT (300) |
27 | 28 | ||
28 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
29 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/basic.edj"; | ||
30 | |||
31 | static Ecore_Evas *ee; | ||
32 | static Evas_Object *edje_obj; | ||
33 | |||
34 | static const char commands[] = \ | 29 | static const char commands[] = \ |
35 | "commands are:\n" | 30 | "commands are:\n" |
36 | "\ts - change Edje's global scaling factor\n" | 31 | "\ts - change Edje's global scaling factor\n" |
37 | "\tr - change center rectangle's scaling factor\n" | 32 | "\tr - change center rectangle's scaling factor\n" |
33 | "\tEsc - exit\n" | ||
38 | "\th - print help\n"; | 34 | "\th - print help\n"; |
39 | 35 | ||
40 | static void | 36 | static void |
41 | _on_keydown(void *data __UNUSED__, | 37 | _on_keydown(void *data, |
42 | Evas *evas __UNUSED__, | 38 | Evas *evas __UNUSED__, |
43 | Evas_Object *o __UNUSED__, | 39 | Evas_Object *o __UNUSED__, |
44 | void *einfo) | 40 | void *einfo) |
45 | { | 41 | { |
46 | Evas_Event_Key_Down *ev = einfo; | 42 | Evas_Event_Key_Down *ev; |
43 | Evas_Object *edje_obj; | ||
44 | |||
45 | ev = (Evas_Event_Key_Down *)einfo; | ||
46 | edje_obj = (Evas_Object *)data; | ||
47 | 47 | ||
48 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | 48 | if (strcmp(ev->keyname, "h") == 0) /* print help */ |
49 | { | 49 | { |
50 | fprintf(stdout, commands); | 50 | fprintf(stdout, commands); |
51 | return; | 51 | return; |
52 | } | 52 | } |
53 | 53 | else if (strcmp(ev->keyname, "s") == 0) /* global scaling factor */ | |
54 | if (strcmp(ev->keyname, "s") == 0) /* global scaling factor */ | ||
55 | { | 54 | { |
56 | double scale = edje_scale_get(); | 55 | double scale = edje_scale_get(); |
57 | 56 | ||
@@ -66,8 +65,7 @@ _on_keydown(void *data __UNUSED__, | |||
66 | 65 | ||
67 | return; | 66 | return; |
68 | } | 67 | } |
69 | 68 | else if (strcmp(ev->keyname, "r") == 0) /* individual scaling factor */ | |
70 | if (strcmp(ev->keyname, "r") == 0) /* individual scaling factor */ | ||
71 | { | 69 | { |
72 | double scale = edje_object_scale_get(edje_obj); | 70 | double scale = edje_object_scale_get(edje_obj); |
73 | 71 | ||
@@ -84,6 +82,13 @@ _on_keydown(void *data __UNUSED__, | |||
84 | 82 | ||
85 | return; | 83 | return; |
86 | } | 84 | } |
85 | else if (!strcmp(ev->keyname, "Escape")) | ||
86 | ecore_main_loop_quit(); | ||
87 | else | ||
88 | { | ||
89 | printf("unhandled key: %s\n", ev->keyname); | ||
90 | fprintf(stdout, commands); | ||
91 | } | ||
87 | } | 92 | } |
88 | 93 | ||
89 | static void | 94 | static void |
@@ -93,27 +98,47 @@ _on_delete(Ecore_Evas *ee __UNUSED__) | |||
93 | } | 98 | } |
94 | 99 | ||
95 | int | 100 | int |
96 | main(void) | 101 | main(int argc __UNUSED__, char *argv[]) |
97 | { | 102 | { |
98 | Evas_Object *border, *bg; | 103 | char border_img_path[PATH_MAX]; |
99 | int x, y, w, h; | 104 | char edje_file_path[PATH_MAX]; |
100 | Evas *evas; | 105 | const char *edje_file = "basic.edj"; |
106 | Ecore_Evas *ee; | ||
107 | Evas *evas; | ||
108 | Evas_Object *bg; | ||
109 | Evas_Object *border; | ||
110 | Evas_Object *edje_obj; | ||
111 | Eina_Prefix *pfx; | ||
112 | int x; | ||
113 | int y; | ||
114 | int w; | ||
115 | int h; | ||
101 | 116 | ||
102 | if (!ecore_evas_init()) | 117 | if (!ecore_evas_init()) |
103 | return EXIT_FAILURE; | 118 | return EXIT_FAILURE; |
104 | 119 | ||
105 | if (!edje_init()) | 120 | if (!edje_init()) |
106 | return EXIT_FAILURE; | 121 | goto shutdown_ecore_evas; |
122 | |||
123 | pfx = eina_prefix_new(argv[0], main, | ||
124 | "EDJE_EXAMPLES", | ||
125 | "edje/examples", | ||
126 | edje_file, | ||
127 | PACKAGE_BIN_DIR, | ||
128 | PACKAGE_LIB_DIR, | ||
129 | PACKAGE_DATA_DIR, | ||
130 | PACKAGE_DATA_DIR); | ||
131 | if (!pfx) | ||
132 | goto shutdown_edje; | ||
107 | 133 | ||
108 | /* this will give you a window with an Evas canvas under the first | 134 | /* this will give you a window with an Evas canvas under the first |
109 | * engine available */ | 135 | * engine available */ |
110 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 136 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
111 | if (!ee) | 137 | if (!ee) |
112 | goto error; | 138 | goto free_prefix; |
113 | 139 | ||
114 | ecore_evas_callback_delete_request_set(ee, _on_delete); | 140 | ecore_evas_callback_delete_request_set(ee, _on_delete); |
115 | ecore_evas_title_set(ee, "Edje Basics Example"); | 141 | ecore_evas_title_set(ee, "Edje Basics Example"); |
116 | ecore_evas_show(ee); | ||
117 | 142 | ||
118 | evas = ecore_evas_get(ee); | 143 | evas = ecore_evas_get(ee); |
119 | 144 | ||
@@ -125,11 +150,12 @@ main(void) | |||
125 | ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); | 150 | ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); |
126 | 151 | ||
127 | evas_object_focus_set(bg, EINA_TRUE); | 152 | evas_object_focus_set(bg, EINA_TRUE); |
128 | evas_object_event_callback_add( | ||
129 | bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
130 | 153 | ||
131 | edje_obj = edje_object_add(evas); | 154 | edje_obj = edje_object_add(evas); |
132 | 155 | ||
156 | snprintf(edje_file_path, sizeof(edje_file_path), | ||
157 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); | ||
158 | printf("%s\n", edje_file_path); | ||
133 | /* exercising Edje loading error, on purpose */ | 159 | /* exercising Edje loading error, on purpose */ |
134 | if (!edje_object_file_set(edje_obj, edje_file_path, "unexistant_group")) | 160 | if (!edje_object_file_set(edje_obj, edje_file_path, "unexistant_group")) |
135 | { | 161 | { |
@@ -147,7 +173,7 @@ main(void) | |||
147 | errmsg); | 173 | errmsg); |
148 | 174 | ||
149 | evas_object_del(edje_obj); | 175 | evas_object_del(edje_obj); |
150 | goto error_edj; | 176 | goto free_prefix; |
151 | } | 177 | } |
152 | 178 | ||
153 | fprintf(stdout, "Loaded Edje object bound to group 'example_group' from" | 179 | fprintf(stdout, "Loaded Edje object bound to group 'example_group' from" |
@@ -157,6 +183,11 @@ main(void) | |||
157 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); | 183 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); |
158 | evas_object_show(edje_obj); | 184 | evas_object_show(edje_obj); |
159 | 185 | ||
186 | evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, edje_obj); | ||
187 | |||
188 | snprintf(border_img_path, sizeof(border_img_path), | ||
189 | "%s/edje/examples/red.png", eina_prefix_data_get(pfx)); | ||
190 | |||
160 | /* this is a border around the Edje object above, here just to | 191 | /* this is a border around the Edje object above, here just to |
161 | * emphasize its geometry */ | 192 | * emphasize its geometry */ |
162 | border = evas_object_image_filled_add(evas); | 193 | border = evas_object_image_filled_add(evas); |
@@ -203,24 +234,24 @@ main(void) | |||
203 | "y = %d, w = %d, h = %d\n", x, y, w, h); | 234 | "y = %d, w = %d, h = %d\n", x, y, w, h); |
204 | 235 | ||
205 | fprintf(stdout, commands); | 236 | fprintf(stdout, commands); |
237 | |||
238 | ecore_evas_show(ee); | ||
239 | |||
206 | ecore_main_loop_begin(); | 240 | ecore_main_loop_begin(); |
207 | 241 | ||
242 | eina_prefix_free(pfx); | ||
208 | ecore_evas_free(ee); | 243 | ecore_evas_free(ee); |
209 | ecore_evas_shutdown(); | 244 | ecore_evas_shutdown(); |
210 | edje_shutdown(); | 245 | edje_shutdown(); |
211 | return 0; | ||
212 | 246 | ||
213 | error: | 247 | return EXIT_SUCCESS; |
214 | fprintf(stderr, "You got to have at least one evas engine built" | ||
215 | " and linked up to ecore-evas for this example to run" | ||
216 | " properly.\n"); | ||
217 | ecore_evas_shutdown(); | ||
218 | return -1; | ||
219 | |||
220 | error_edj: | ||
221 | fprintf(stderr, "Failed to load basic.edj!\n"); | ||
222 | 248 | ||
249 | free_prefix: | ||
250 | eina_prefix_free(pfx); | ||
251 | shutdown_edje: | ||
252 | edje_shutdown(); | ||
253 | shutdown_ecore_evas: | ||
223 | ecore_evas_shutdown(); | 254 | ecore_evas_shutdown(); |
224 | return -2; | ||
225 | } | ||
226 | 255 | ||
256 | return EXIT_FAILURE; | ||
257 | } | ||
diff --git a/libraries/edje/src/examples/edje-box.c b/libraries/edje/src/examples/edje-box.c index 7fffba3..2b0cbda 100644 --- a/libraries/edje/src/examples/edje-box.c +++ b/libraries/edje/src/examples/edje-box.c | |||
@@ -10,10 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef HAVE_CONFIG_H | 12 | #ifdef HAVE_CONFIG_H |
13 | #include "config.h" | 13 | # include "config.h" |
14 | #else | 14 | #else |
15 | #define PACKAGE_EXAMPLES_DIR "." | 15 | # define __UNUSED__ |
16 | #define __UNUSED__ | ||
17 | #endif | 16 | #endif |
18 | 17 | ||
19 | #include <Ecore.h> | 18 | #include <Ecore.h> |
@@ -28,13 +27,13 @@ | |||
28 | 27 | ||
29 | #define NRECTS 20 | 28 | #define NRECTS 20 |
30 | 29 | ||
31 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/box.edj"; | 30 | static const char commands[] = \ |
32 | 31 | "commands are:\n" | |
33 | struct _App { | 32 | "\ti - prepend rectangle\n" |
34 | Ecore_Evas *ee; | 33 | "\ta - append rectangle\n" |
35 | Evas_Object *edje; | 34 | "\tc - remove\n" |
36 | Evas_Object *bg; | 35 | "\tEsc - exit\n" |
37 | }; | 36 | "\th - print help\n"; |
38 | 37 | ||
39 | static void | 38 | static void |
40 | _on_destroy(Ecore_Evas *ee __UNUSED__) | 39 | _on_destroy(Ecore_Evas *ee __UNUSED__) |
@@ -45,32 +44,41 @@ _on_destroy(Ecore_Evas *ee __UNUSED__) | |||
45 | /* here just to keep our example's window size and background image's | 44 | /* here just to keep our example's window size and background image's |
46 | * size in synchrony */ | 45 | * size in synchrony */ |
47 | static void | 46 | static void |
48 | _canvas_resize_cb(Ecore_Evas *ee) | 47 | _on_canvas_resize(Ecore_Evas *ee) |
49 | { | 48 | { |
50 | int w, h; | 49 | Evas_Object *bg; |
51 | struct _App *app = ecore_evas_data_get(ee, "app"); | 50 | Evas_Object *edje_obj; |
51 | int w; | ||
52 | int h; | ||
52 | 53 | ||
54 | bg = ecore_evas_data_get(ee, "background"); | ||
55 | edje_obj = ecore_evas_data_get(ee, "edje_obj"); | ||
53 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | 56 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); |
54 | evas_object_resize(app->bg, w, h); | 57 | evas_object_resize(bg, w, h); |
55 | evas_object_resize(app->edje, w, h); | 58 | evas_object_resize(edje_obj, w, h); |
56 | } | 59 | } |
57 | 60 | ||
58 | static void | 61 | static void |
59 | _rect_mouse_down(void *data, Evas *e, Evas_Object *o, void *event_info) | 62 | _on_rect_mouse_down(void *data, Evas *e, Evas_Object *o, void *event_info) |
60 | { | 63 | { |
61 | struct _App *app = data; | 64 | Ecore_Evas *ee; |
62 | Evas_Event_Mouse_Down *ev = event_info; | 65 | Evas_Event_Mouse_Down *ev; |
66 | Evas_Object *edje_obj; | ||
67 | |||
68 | ee = (Ecore_Evas *)data; | ||
69 | ev = (Evas_Event_Mouse_Down *)event_info; | ||
70 | edje_obj = ecore_evas_data_get(ee, "edje_obj"); | ||
63 | 71 | ||
64 | if (ev->button == 1) | 72 | if (ev->button == 1) |
65 | { | 73 | { |
66 | printf("Removing rect %p under the mouse pointer.\n", o); | 74 | printf("Removing rect %p under the mouse pointer.\n", o); |
67 | edje_object_part_box_remove(app->edje, "example/box", o); | 75 | edje_object_part_box_remove(edje_obj, "example/box", o); |
68 | evas_object_del(o); | 76 | evas_object_del(o); |
69 | } | 77 | } |
70 | else if (ev->button == 3) | 78 | else if (ev->button == 3) |
71 | { | 79 | { |
72 | Evas_Object *rect; | 80 | Evas_Object *rect; |
73 | Eina_Bool r; | 81 | Eina_Bool r; |
74 | 82 | ||
75 | rect = evas_object_rectangle_add(e); | 83 | rect = evas_object_rectangle_add(e); |
76 | evas_object_color_set(rect, 0, 0, 255, 255); | 84 | evas_object_color_set(rect, 0, 0, 255, 255); |
@@ -78,23 +86,32 @@ _rect_mouse_down(void *data, Evas *e, Evas_Object *o, void *event_info) | |||
78 | evas_object_show(rect); | 86 | evas_object_show(rect); |
79 | 87 | ||
80 | printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect); | 88 | printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect); |
81 | r = edje_object_part_box_insert_before(app->edje, "example/box", rect, o); | 89 | r = edje_object_part_box_insert_before(edje_obj, "example/box", rect, o); |
82 | if (!r) | 90 | if (!r) |
83 | printf("An error ocurred when appending rect %p to the box.\n", rect); | 91 | printf("An error ocurred when appending rect %p to the box.\n", rect); |
84 | 92 | ||
85 | evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, app); | 93 | evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _on_rect_mouse_down, NULL); |
86 | } | 94 | } |
87 | } | 95 | } |
88 | 96 | ||
89 | static void | 97 | static void |
90 | _bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) | 98 | _on_bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) |
91 | { | 99 | { |
92 | struct _App *app = data; | 100 | Ecore_Evas *ee; |
93 | Evas_Event_Key_Down *ev = event_info; | 101 | Evas_Event_Key_Down *ev; |
94 | Evas_Object *rect; | 102 | Evas_Object *edje_obj; |
95 | Eina_Bool r; | 103 | Evas_Object *rect; |
104 | Eina_Bool r; | ||
96 | 105 | ||
106 | ee = (Ecore_Evas *)data; | ||
107 | ev = (Evas_Event_Key_Down *)event_info; | ||
108 | edje_obj = ecore_evas_data_get(ee, "edje_obj"); | ||
97 | 109 | ||
110 | if (!strcmp(ev->keyname, "h")) | ||
111 | { | ||
112 | fprintf(stdout, commands); | ||
113 | return; | ||
114 | } | ||
98 | if (!strcmp(ev->keyname, "i")) | 115 | if (!strcmp(ev->keyname, "i")) |
99 | { | 116 | { |
100 | rect = evas_object_rectangle_add(e); | 117 | rect = evas_object_rectangle_add(e); |
@@ -103,11 +120,11 @@ _bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) | |||
103 | evas_object_show(rect); | 120 | evas_object_show(rect); |
104 | 121 | ||
105 | printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect); | 122 | printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect); |
106 | r = edje_object_part_box_insert_at(app->edje, "example/box", rect, 0); | 123 | r = edje_object_part_box_insert_at(edje_obj, "example/box", rect, 0); |
107 | if (!r) | 124 | if (!r) |
108 | printf("An error ocurred when appending rect %p to the box.\n", rect); | 125 | printf("An error ocurred when appending rect %p to the box.\n", rect); |
109 | 126 | ||
110 | evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, app); | 127 | evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _on_rect_mouse_down, NULL); |
111 | } | 128 | } |
112 | else if (!strcmp(ev->keyname, "a")) | 129 | else if (!strcmp(ev->keyname, "a")) |
113 | { | 130 | { |
@@ -117,53 +134,82 @@ _bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) | |||
117 | evas_object_show(rect); | 134 | evas_object_show(rect); |
118 | 135 | ||
119 | printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect); | 136 | printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect); |
120 | r = edje_object_part_box_append(app->edje, "example/box", rect); | 137 | r = edje_object_part_box_append(edje_obj, "example/box", rect); |
121 | if (!r) | 138 | if (!r) |
122 | printf("An error ocurred when appending rect %p to the box.\n", rect); | 139 | printf("An error ocurred when appending rect %p to the box.\n", rect); |
123 | 140 | ||
124 | evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, app); | 141 | evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _on_rect_mouse_down, NULL); |
125 | } | 142 | } |
126 | else if (!strcmp(ev->keyname, "c")) | 143 | else if (!strcmp(ev->keyname, "c")) |
127 | edje_object_part_box_remove_all(app->edje, "example/box", EINA_TRUE); | 144 | edje_object_part_box_remove_all(edje_obj, "example/box", EINA_TRUE); |
145 | else if (!strcmp(ev->keyname, "Escape")) | ||
146 | ecore_main_loop_quit(); | ||
147 | else | ||
148 | { | ||
149 | printf("unhandled key: %s\n", ev->keyname); | ||
150 | fprintf(stdout, commands); | ||
151 | } | ||
128 | } | 152 | } |
129 | 153 | ||
130 | int | 154 | int |
131 | main(void) | 155 | main(int argc __UNUSED__, char *argv[]) |
132 | { | 156 | { |
133 | Evas *evas; | 157 | char edje_file_path[PATH_MAX]; |
134 | struct _App app; | 158 | const char *edje_file = "box.edj"; |
135 | int i; | 159 | Ecore_Evas *ee; |
136 | 160 | Evas *evas; | |
137 | ecore_evas_init(); | 161 | Evas_Object *bg; |
138 | edje_init(); | 162 | Evas_Object *edje_obj; |
163 | Eina_Prefix *pfx; | ||
164 | int i; | ||
165 | |||
166 | if (!ecore_evas_init()) | ||
167 | return EXIT_FAILURE; | ||
168 | |||
169 | if (!edje_init()) | ||
170 | goto shutdown_ecore_evas; | ||
171 | |||
172 | pfx = eina_prefix_new(argv[0], main, | ||
173 | "EDJE_EXAMPLES", | ||
174 | "edje/examples", | ||
175 | edje_file, | ||
176 | PACKAGE_BIN_DIR, | ||
177 | PACKAGE_LIB_DIR, | ||
178 | PACKAGE_DATA_DIR, | ||
179 | PACKAGE_DATA_DIR); | ||
180 | if (!pfx) | ||
181 | goto shutdown_edje; | ||
139 | 182 | ||
140 | /* this will give you a window with an Evas canvas under the first | 183 | /* this will give you a window with an Evas canvas under the first |
141 | * engine available */ | 184 | * engine available */ |
142 | app.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 185 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
143 | 186 | if (!ee) | |
144 | ecore_evas_callback_destroy_set(app.ee, _on_destroy); | 187 | goto free_prefix; |
145 | ecore_evas_callback_resize_set(app.ee, _canvas_resize_cb); | ||
146 | ecore_evas_title_set(app.ee, "Edje Box Example"); | ||
147 | ecore_evas_show(app.ee); | ||
148 | 188 | ||
149 | ecore_evas_data_set(app.ee, "app", &app); | 189 | ecore_evas_callback_destroy_set(ee, _on_destroy); |
190 | ecore_evas_callback_resize_set(ee, _on_canvas_resize); | ||
191 | ecore_evas_title_set(ee, "Edje Box Example"); | ||
150 | 192 | ||
151 | evas = ecore_evas_get(app.ee); | 193 | evas = ecore_evas_get(ee); |
152 | 194 | ||
153 | app.bg = evas_object_rectangle_add(evas); | 195 | bg = evas_object_rectangle_add(evas); |
154 | evas_object_color_set(app.bg, 255, 255, 255, 255); | 196 | evas_object_color_set(bg, 255, 255, 255, 255); |
155 | evas_object_resize(app.bg, WIDTH, HEIGHT); | 197 | evas_object_resize(bg, WIDTH, HEIGHT); |
156 | evas_object_focus_set(app.bg, EINA_TRUE); | 198 | evas_object_focus_set(bg, EINA_TRUE); |
157 | evas_object_show(app.bg); | 199 | evas_object_show(bg); |
200 | ecore_evas_data_set(ee, "background", bg); | ||
158 | 201 | ||
159 | evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _bg_key_down, &app); | 202 | evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_bg_key_down, ee); |
160 | 203 | ||
161 | app.edje = edje_object_add(evas); | 204 | edje_obj = edje_object_add(evas); |
162 | 205 | ||
163 | edje_object_file_set(app.edje, edje_file_path, "example/group"); | 206 | snprintf(edje_file_path, sizeof(edje_file_path), |
164 | evas_object_move(app.edje, 0, 0); | 207 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); |
165 | evas_object_resize(app.edje, WIDTH, HEIGHT); | 208 | edje_object_file_set(edje_obj, edje_file_path, "example/group"); |
166 | evas_object_show(app.edje); | 209 | evas_object_move(edje_obj, 0, 0); |
210 | evas_object_resize(edje_obj, WIDTH, HEIGHT); | ||
211 | evas_object_show(edje_obj); | ||
212 | ecore_evas_data_set(ee, "edje_obj", edje_obj); | ||
167 | 213 | ||
168 | for (i = 0; i < NRECTS; i++) | 214 | for (i = 0; i < NRECTS; i++) |
169 | { | 215 | { |
@@ -173,19 +219,34 @@ main(void) | |||
173 | rect = evas_object_rectangle_add(evas); | 219 | rect = evas_object_rectangle_add(evas); |
174 | evas_object_color_set(rect, red, 0, 0, 255); | 220 | evas_object_color_set(rect, red, 0, 0, 255); |
175 | evas_object_resize(rect, RECTW, RECTH); | 221 | evas_object_resize(rect, RECTW, RECTH); |
176 | r = edje_object_part_box_append(app.edje, "example/box", rect); | 222 | r = edje_object_part_box_append(edje_obj, "example/box", rect); |
177 | if (!r) | 223 | if (!r) |
178 | printf("An error ocurred when appending rect #%d to the box.\n", i); | 224 | printf("An error ocurred when appending rect #%d to the box.\n", i); |
179 | evas_object_show(rect); | 225 | evas_object_show(rect); |
180 | 226 | ||
181 | evas_object_event_callback_add( | 227 | evas_object_event_callback_add( |
182 | rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, &app); | 228 | rect, EVAS_CALLBACK_MOUSE_DOWN, _on_rect_mouse_down, ee); |
183 | } | 229 | } |
184 | 230 | ||
231 | fprintf(stdout, commands); | ||
232 | |||
233 | ecore_evas_show(ee); | ||
234 | |||
185 | ecore_main_loop_begin(); | 235 | ecore_main_loop_begin(); |
186 | 236 | ||
187 | ecore_evas_free(app.ee); | 237 | eina_prefix_free(pfx); |
238 | ecore_evas_free(ee); | ||
188 | ecore_evas_shutdown(); | 239 | ecore_evas_shutdown(); |
189 | edje_shutdown(); | 240 | edje_shutdown(); |
190 | return 0; | 241 | |
242 | return EXIT_SUCCESS; | ||
243 | |||
244 | free_prefix: | ||
245 | eina_prefix_free(pfx); | ||
246 | shutdown_edje: | ||
247 | edje_shutdown(); | ||
248 | shutdown_ecore_evas: | ||
249 | ecore_evas_shutdown(); | ||
250 | |||
251 | return EXIT_FAILURE; | ||
191 | } | 252 | } |
diff --git a/libraries/edje/src/examples/edje-box2.c b/libraries/edje/src/examples/edje-box2.c index b3f4e40..81f1a90 100644 --- a/libraries/edje/src/examples/edje-box2.c +++ b/libraries/edje/src/examples/edje-box2.c | |||
@@ -10,40 +10,35 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef HAVE_CONFIG_H | 12 | #ifdef HAVE_CONFIG_H |
13 | #include "config.h" | 13 | # include "config.h" |
14 | #else | 14 | #else |
15 | #define PACKAGE_EXAMPLES_DIR "." | 15 | # define __UNUSED__ |
16 | #define __UNUSED__ | ||
17 | #endif | 16 | #endif |
18 | 17 | ||
19 | #include <Ecore.h> | ||
20 | #include <Evas.h> | ||
21 | #include <Ecore_Evas.h> | ||
22 | #include <Edje.h> | ||
23 | |||
24 | #include <stdlib.h> | 18 | #include <stdlib.h> |
25 | #include <stdio.h> | 19 | #include <stdio.h> |
26 | #include <string.h> | 20 | #include <string.h> |
27 | 21 | ||
28 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/box.edj"; | 22 | #include <Ecore.h> |
29 | 23 | #include <Evas.h> | |
30 | struct _App { | 24 | #include <Ecore_Evas.h> |
31 | Ecore_Evas *ee; | 25 | #include <Edje.h> |
32 | Evas *evas; | ||
33 | Evas_Object *bg; | ||
34 | Evas_Object *box; | ||
35 | }; | ||
36 | 26 | ||
37 | static struct _App app; | 27 | static const char commands[] = \ |
28 | "commands are:\n" | ||
29 | "\tShift - remove box\n" | ||
30 | "\tCtrl - insert box\n" | ||
31 | "\tEsc - exit\n" | ||
32 | "\th - print help\n"; | ||
38 | 33 | ||
39 | static void | 34 | static void |
40 | custom_layout(Evas_Object *o, Evas_Object_Box_Data *p, void *data) | 35 | custom_layout(Evas_Object *o, Evas_Object_Box_Data *p, void *data __UNUSED__) |
41 | { | 36 | { |
37 | Evas_Object_Box_Option *opt; | ||
38 | Eina_List *l; | ||
42 | int x, y, w, h; | 39 | int x, y, w, h; |
43 | int xx, yy, ww, hh; | 40 | int xx, yy, ww, hh; |
44 | int count; | 41 | int count; |
45 | Eina_List *l; | ||
46 | Evas_Object_Box_Option *opt; | ||
47 | 42 | ||
48 | evas_object_geometry_get(o, &x, &y, &w, &h); | 43 | evas_object_geometry_get(o, &x, &y, &w, &h); |
49 | count = eina_list_count(p->children); | 44 | count = eina_list_count(p->children); |
@@ -76,129 +71,177 @@ new_greenie_block(Evas *e) | |||
76 | } | 71 | } |
77 | 72 | ||
78 | static void | 73 | static void |
79 | on_keydown(void *data, Evas *evas, Evas_Object *o, void *einfo) | 74 | on_keydown(void *data, Evas *evas, Evas_Object *o __UNUSED__, void *einfo) |
80 | { | 75 | { |
81 | struct _App *app = data; | 76 | Evas_Event_Key_Down *ev; |
82 | Evas_Event_Key_Down *ev = einfo; | 77 | Evas_Object *edje_obj; |
83 | const Evas_Modifier *mods; | 78 | const Evas_Modifier *mods; |
84 | 79 | ||
80 | ev = (Evas_Event_Key_Down *)einfo; | ||
81 | edje_obj = (Evas_Object *)data; | ||
82 | |||
85 | mods = evas_key_modifier_get(evas); | 83 | mods = evas_key_modifier_get(evas); |
84 | if (!strcmp(ev->keyname, "h")) | ||
85 | { | ||
86 | fprintf(stdout, commands); | ||
87 | return; | ||
88 | } | ||
86 | if (evas_key_modifier_is_set(mods, "Shift")) | 89 | if (evas_key_modifier_is_set(mods, "Shift")) |
87 | { | 90 | { |
88 | int pos; | 91 | int pos; |
89 | Evas_Object *obj = NULL; | 92 | Evas_Object *obj = NULL; |
90 | pos = atoi(ev->keyname); | 93 | pos = atoi(ev->keyname); |
91 | obj = edje_object_part_box_remove_at(app->box, "example/box", pos); | 94 | obj = edje_object_part_box_remove_at(edje_obj, "example/box", pos); |
92 | if (obj) | 95 | if (obj) |
93 | evas_object_del(obj); | 96 | evas_object_del(obj); |
94 | return; | 97 | return; |
95 | } | 98 | } |
96 | if (evas_key_modifier_is_set(mods, "Control")) | 99 | if (evas_key_modifier_is_set(mods, "Control")) |
97 | { | 100 | { |
98 | Evas_Object *o; | 101 | Evas_Object *obj; |
99 | int pos; | 102 | int pos; |
100 | pos = atoi(ev->keyname); | 103 | pos = atoi(ev->keyname); |
101 | o = new_greenie_block(app->evas); | 104 | obj = new_greenie_block(evas); |
102 | if (!edje_object_part_box_insert_at(app->box, "example/box", o, pos)) | 105 | if (!edje_object_part_box_insert_at(edje_obj, "example/box", obj, pos)) |
103 | edje_object_part_box_append(app->box, "example/box", o); | 106 | edje_object_part_box_append(edje_obj, "example/box", obj); |
104 | return; | 107 | return; |
105 | } | 108 | } |
106 | if (strcmp(ev->keyname, "Escape") == 0) | 109 | if (!strcmp(ev->keyname, "Escape")) |
107 | ecore_main_loop_quit(); | 110 | ecore_main_loop_quit(); |
108 | } | 111 | } |
109 | 112 | ||
110 | static Evas_Object * | 113 | static Evas_Object * |
111 | box_new(Evas *evas, const char *name, int x, int y, int w, int h) | 114 | box_new(Ecore_Evas *ee, const char *edje_file_path, const char *name, int x, int y, int w, int h) |
112 | { | 115 | { |
113 | Evas_Object *o; | 116 | Evas_Object *edje_obj; |
114 | 117 | ||
115 | o = edje_object_add(evas); | 118 | edje_obj = edje_object_add(ecore_evas_get(ee)); |
116 | evas_object_move(o, x, y); | 119 | evas_object_move(edje_obj, x, y); |
117 | evas_object_resize(o, w, h); | 120 | evas_object_resize(edje_obj, w, h); |
118 | if (!edje_object_file_set(o, edje_file_path, "example/group2")) | 121 | if (!edje_object_file_set(edje_obj, edje_file_path, "example/group2")) |
119 | { | 122 | { |
120 | printf("error: could not load file object.\n"); | 123 | printf("error: could not load file object.\n"); |
121 | } | 124 | } |
122 | evas_object_show(o); | 125 | evas_object_show(edje_obj); |
123 | 126 | evas_object_name_set(edje_obj, name); | |
124 | evas_object_name_set(o, name); | 127 | ecore_evas_data_set(ee, "edje_obj", edje_obj); |
125 | 128 | ||
126 | return o; | 129 | return edje_obj; |
127 | } | 130 | } |
128 | 131 | ||
129 | static void | 132 | static void |
130 | on_resize(Ecore_Evas *ee) | 133 | on_resize(Ecore_Evas *ee) |
131 | { | 134 | { |
132 | int w, h; | 135 | Evas_Object *bg; |
133 | 136 | Evas_Object *edje_obj; | |
134 | evas_output_viewport_get(app.evas, NULL, NULL, &w, &h); | 137 | int w; |
135 | evas_object_resize(app.bg, w, h); | 138 | int h; |
136 | evas_object_resize(app.box, w, h); | 139 | |
140 | bg = ecore_evas_data_get(ee, "background"); | ||
141 | edje_obj = ecore_evas_data_get(ee, "edje_obj"); | ||
142 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
143 | evas_object_resize(bg, w, h); | ||
144 | evas_object_resize(edje_obj, w, h); | ||
137 | } | 145 | } |
138 | 146 | ||
139 | static void | 147 | static void |
140 | on_destroy(Ecore_Evas *ee) | 148 | on_destroy(Ecore_Evas *ee __UNUSED__) |
141 | { | 149 | { |
142 | ecore_main_loop_quit(); | 150 | ecore_main_loop_quit(); |
143 | } | 151 | } |
144 | 152 | ||
145 | int | 153 | int |
146 | main(int argc, char *argv[]) | 154 | main(int argc __UNUSED__, char *argv[]) |
147 | { | 155 | { |
148 | Ecore_Evas *ee; | 156 | char edje_file_path[PATH_MAX]; |
149 | int w, h, i; | 157 | const char *edje_file = "box.edj"; |
158 | Ecore_Evas *ee; | ||
159 | Evas *evas; | ||
160 | Evas_Object *bg; | ||
161 | Evas_Object *edje_obj; | ||
150 | Evas_Object *last; | 162 | Evas_Object *last; |
151 | Evas_Object *o; | 163 | Evas_Object *o; |
152 | 164 | Eina_Prefix *pfx; | |
153 | evas_init(); | 165 | int w; |
154 | ecore_init(); | 166 | int h; |
155 | ecore_evas_init(); | 167 | int i; |
156 | edje_init(); | 168 | |
157 | 169 | if (!ecore_evas_init()) | |
170 | return EXIT_FAILURE; | ||
171 | |||
172 | if (!edje_init()) | ||
173 | goto shutdown_ecore_evas; | ||
174 | |||
175 | pfx = eina_prefix_new(argv[0], main, | ||
176 | "EDJE_EXAMPLES", | ||
177 | "edje/examples", | ||
178 | edje_file, | ||
179 | PACKAGE_BIN_DIR, | ||
180 | PACKAGE_LIB_DIR, | ||
181 | PACKAGE_DATA_DIR, | ||
182 | PACKAGE_DATA_DIR); | ||
183 | if (!pfx) | ||
184 | goto shutdown_edje; | ||
185 | |||
186 | /* this will give you a window with an Evas canvas under the first | ||
187 | * engine available */ | ||
158 | ee = ecore_evas_new(NULL, 0, 0, 640, 480, NULL); | 188 | ee = ecore_evas_new(NULL, 0, 0, 640, 480, NULL); |
159 | ecore_evas_show(ee); | 189 | if (!ee) |
160 | 190 | goto free_prefix; | |
161 | app.ee = ee; | ||
162 | app.evas = ecore_evas_get(ee); | ||
163 | 191 | ||
164 | ecore_evas_callback_resize_set(ee, on_resize); | 192 | ecore_evas_callback_resize_set(ee, on_resize); |
165 | ecore_evas_callback_destroy_set(ee, on_destroy); | 193 | ecore_evas_callback_destroy_set(ee, on_destroy); |
194 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | ||
166 | 195 | ||
167 | evas_output_viewport_get(app.evas, NULL, NULL, &w, &h); | 196 | evas = ecore_evas_get(ee); |
168 | 197 | ||
169 | app.bg = evas_object_rectangle_add(app.evas); | 198 | bg = evas_object_rectangle_add(evas); |
170 | evas_object_resize(app.bg, w, h); | 199 | evas_object_resize(bg, w, h); |
171 | evas_object_show(app.bg); | 200 | evas_object_show(bg); |
172 | evas_object_focus_set(app.bg, 1); | 201 | evas_object_focus_set(bg, 1); |
173 | evas_object_event_callback_add( | 202 | ecore_evas_data_set(ee, "background", bg); |
174 | app.bg, EVAS_CALLBACK_KEY_DOWN, on_keydown, &app); | ||
175 | 203 | ||
176 | edje_box_layout_register("custom_layout", custom_layout, NULL, NULL, NULL, NULL); | 204 | edje_box_layout_register("custom_layout", custom_layout, NULL, NULL, NULL, NULL); |
177 | 205 | ||
178 | app.box = box_new(app.evas, "box", 0, 0, w, h); | 206 | snprintf(edje_file_path, sizeof(edje_file_path), |
207 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); | ||
208 | edje_obj = box_new(ee, edje_file_path, "box", 0, 0, w, h); | ||
209 | evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, on_keydown, edje_obj); | ||
179 | 210 | ||
180 | for (i = 1; i <= 5; i++) | 211 | for (i = 1; i <= 5; i++) |
181 | { | 212 | { |
182 | o = last = evas_object_rectangle_add(app.evas); | 213 | o = last = evas_object_rectangle_add(evas); |
183 | evas_object_size_hint_min_set(o, 50, 50); | 214 | evas_object_size_hint_min_set(o, 50, 50); |
184 | evas_object_resize(o, 50, 50); | 215 | evas_object_resize(o, 50, 50); |
185 | evas_object_color_set(o, 255, 0, 0, 128); | 216 | evas_object_color_set(o, 255, 0, 0, 128); |
186 | evas_object_show(o); | 217 | evas_object_show(o); |
187 | 218 | ||
188 | if (!edje_object_part_box_append(app.box, "example/box", o)) | 219 | if (!edje_object_part_box_append(edje_obj, "example/box", o)) |
189 | { | 220 | { |
190 | fprintf(stderr, "error appending child object!\n"); | 221 | fprintf(stderr, "error appending child object!\n"); |
191 | return 1; | 222 | return 1; |
192 | } | 223 | } |
193 | } | 224 | } |
194 | 225 | ||
226 | fprintf(stdout, commands); | ||
227 | |||
228 | ecore_evas_show(ee); | ||
229 | |||
195 | ecore_main_loop_begin(); | 230 | ecore_main_loop_begin(); |
196 | 231 | ||
197 | edje_shutdown(); | 232 | eina_prefix_free(pfx); |
233 | ecore_evas_free(ee); | ||
198 | ecore_evas_shutdown(); | 234 | ecore_evas_shutdown(); |
199 | ecore_shutdown(); | 235 | edje_shutdown(); |
200 | evas_shutdown(); | 236 | |
237 | return EXIT_SUCCESS; | ||
201 | 238 | ||
239 | free_prefix: | ||
240 | eina_prefix_free(pfx); | ||
241 | shutdown_edje: | ||
242 | edje_shutdown(); | ||
243 | shutdown_ecore_evas: | ||
244 | ecore_evas_shutdown(); | ||
202 | 245 | ||
203 | return 0; | 246 | return EXIT_FAILURE; |
204 | } | 247 | } |
diff --git a/libraries/edje/src/examples/edje-color-class.c b/libraries/edje/src/examples/edje-color-class.c index 9ac8653..8d073d0 100644 --- a/libraries/edje/src/examples/edje-color-class.c +++ b/libraries/edje/src/examples/edje-color-class.c | |||
@@ -10,10 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef HAVE_CONFIG_H | 12 | #ifdef HAVE_CONFIG_H |
13 | #include "config.h" | 13 | # include "config.h" |
14 | #else | 14 | #else |
15 | #define PACKAGE_EXAMPLES_DIR "." | 15 | # define __UNUSED__ |
16 | #define __UNUSED__ | ||
17 | #endif | 16 | #endif |
18 | 17 | ||
19 | #include <Ecore.h> | 18 | #include <Ecore.h> |
@@ -23,13 +22,11 @@ | |||
23 | #define WIDTH (400) | 22 | #define WIDTH (400) |
24 | #define HEIGHT (400) | 23 | #define HEIGHT (400) |
25 | 24 | ||
26 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/color-class.edj"; | ||
27 | |||
28 | typedef int color[4]; /* rgba */ | 25 | typedef int color[4]; /* rgba */ |
29 | 26 | ||
30 | static Ecore_Evas *ee, *ee2; | 27 | static Ecore_Evas *ee1, *ee2; |
31 | static Evas *evas, *evas2; | 28 | static Evas *evas1, *evas2; |
32 | static Evas_Object *bg, *edje_obj, *bg2, *edje_obj2; | 29 | static Evas_Object *bg1, *edje_obj1, *bg2, *edje_obj2; |
33 | static const char *selected_class; | 30 | static const char *selected_class; |
34 | 31 | ||
35 | static color colors_init_data[] = | 32 | static color colors_init_data[] = |
@@ -96,21 +93,23 @@ _color_classes_print(void) | |||
96 | } | 93 | } |
97 | 94 | ||
98 | static void | 95 | static void |
99 | _on_destroy(Ecore_Evas *ee) | 96 | _on_destroy(Ecore_Evas *ee __UNUSED__) |
100 | { | 97 | { |
101 | ecore_main_loop_quit(); | 98 | ecore_main_loop_quit(); |
102 | } | 99 | } |
103 | 100 | ||
104 | static void | 101 | static void |
105 | _on_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) | 102 | _on_mouse_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info) |
106 | { | 103 | { |
107 | Evas_Event_Mouse_Down *ev = event_info; | 104 | Evas_Event_Mouse_Down *ev = event_info; |
108 | 105 | ||
109 | if (ev->button == 1) | 106 | if (ev->button == 1) |
110 | if (obj == edje_obj) | 107 | { |
111 | edje_color_class_del(selected_class); | 108 | if (obj == edje_obj1) |
112 | else | 109 | edje_color_class_del(selected_class); |
113 | edje_object_color_class_del(edje_obj2, selected_class); | 110 | else |
111 | edje_object_color_class_del(edje_obj2, selected_class); | ||
112 | } | ||
114 | } | 113 | } |
115 | 114 | ||
116 | /* here just to keep our example's window size | 115 | /* here just to keep our example's window size |
@@ -122,10 +121,10 @@ _canvas_resize_cb(Ecore_Evas *_ee) | |||
122 | 121 | ||
123 | ecore_evas_geometry_get(_ee, NULL, NULL, &w, &h); | 122 | ecore_evas_geometry_get(_ee, NULL, NULL, &w, &h); |
124 | 123 | ||
125 | if (_ee == ee) | 124 | if (_ee == ee1) |
126 | { | 125 | { |
127 | evas_object_resize(bg, w, h); | 126 | evas_object_resize(bg1, w, h); |
128 | evas_object_resize(edje_obj, w, h); | 127 | evas_object_resize(edje_obj1, w, h); |
129 | } | 128 | } |
130 | else | 129 | else |
131 | { | 130 | { |
@@ -135,8 +134,8 @@ _canvas_resize_cb(Ecore_Evas *_ee) | |||
135 | } | 134 | } |
136 | 135 | ||
137 | static void | 136 | static void |
138 | _color_class_callback_delete(void *data, Evas *evas, Evas_Object *obj, | 137 | _color_class_callback_delete(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, |
139 | const char *emission, void *source) | 138 | const char *emission, void *source __UNUSED__) |
140 | { | 139 | { |
141 | if (!strcmp(data, "process")) | 140 | if (!strcmp(data, "process")) |
142 | fprintf(stdout, "Color class: %s deleted on process level\n", emission); | 141 | fprintf(stdout, "Color class: %s deleted on process level\n", emission); |
@@ -144,32 +143,34 @@ _color_class_callback_delete(void *data, Evas *evas, Evas_Object *obj, | |||
144 | fprintf(stdout, "Color class: %s deleted on object level\n", emission); | 143 | fprintf(stdout, "Color class: %s deleted on object level\n", emission); |
145 | } | 144 | } |
146 | 145 | ||
147 | static void | 146 | static int |
148 | _create_windows(void) | 147 | _create_windows(const char *edje_file_path) |
149 | { | 148 | { |
150 | /* this will give you a window with an Evas canvas under the first | 149 | /* this will give you a window with an Evas canvas under the first |
151 | * engine available */ | 150 | * engine available */ |
152 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 151 | ee1 = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
152 | if (!ee1) | ||
153 | return 0; | ||
153 | ee2 = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 154 | ee2 = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
155 | if (!ee2) | ||
156 | return 0; | ||
154 | 157 | ||
155 | ecore_evas_callback_destroy_set(ee, _on_destroy); | 158 | ecore_evas_callback_destroy_set(ee1, _on_destroy); |
156 | ecore_evas_callback_resize_set(ee, _canvas_resize_cb); | 159 | ecore_evas_callback_resize_set(ee1, _canvas_resize_cb); |
157 | ecore_evas_title_set(ee, "Edje Color Class Example"); | 160 | ecore_evas_title_set(ee1, "Edje Color Class Example"); |
158 | ecore_evas_show(ee); | ||
159 | 161 | ||
160 | ecore_evas_callback_destroy_set(ee2, _on_destroy); | 162 | ecore_evas_callback_destroy_set(ee2, _on_destroy); |
161 | ecore_evas_callback_resize_set(ee2, _canvas_resize_cb); | 163 | ecore_evas_callback_resize_set(ee2, _canvas_resize_cb); |
162 | ecore_evas_title_set(ee2, "Edje Object Color Class Example"); | 164 | ecore_evas_title_set(ee2, "Edje Object Color Class Example"); |
163 | ecore_evas_show(ee2); | ||
164 | 165 | ||
165 | evas = ecore_evas_get(ee); | 166 | evas1 = ecore_evas_get(ee1); |
166 | evas2 = ecore_evas_get(ee2); | 167 | evas2 = ecore_evas_get(ee2); |
167 | 168 | ||
168 | bg = evas_object_rectangle_add(evas); | 169 | bg1 = evas_object_rectangle_add(evas1); |
169 | evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ | 170 | evas_object_color_set(bg1, 255, 255, 255, 255); /* white bg */ |
170 | evas_object_move(bg, 0, 0); /* at canvas' origin */ | 171 | evas_object_move(bg1, 0, 0); /* at canvas' origin */ |
171 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ | 172 | evas_object_resize(bg1, WIDTH, HEIGHT); /* covers full canvas */ |
172 | evas_object_show(bg); | 173 | evas_object_show(bg1); |
173 | 174 | ||
174 | bg2 = evas_object_rectangle_add(evas2); | 175 | bg2 = evas_object_rectangle_add(evas2); |
175 | evas_object_color_set(bg2, 255, 255, 255, 255); /* white bg */ | 176 | evas_object_color_set(bg2, 255, 255, 255, 255); /* white bg */ |
@@ -177,18 +178,18 @@ _create_windows(void) | |||
177 | evas_object_resize(bg2, WIDTH, HEIGHT); /* covers full canvas */ | 178 | evas_object_resize(bg2, WIDTH, HEIGHT); /* covers full canvas */ |
178 | evas_object_show(bg2); | 179 | evas_object_show(bg2); |
179 | 180 | ||
180 | edje_obj = edje_object_add(evas); | 181 | edje_obj1 = edje_object_add(evas1); |
181 | evas_object_event_callback_add(edje_obj, EVAS_CALLBACK_MOUSE_DOWN, | 182 | evas_object_event_callback_add(edje_obj1, EVAS_CALLBACK_MOUSE_DOWN, |
182 | _on_mouse_down, NULL); | 183 | _on_mouse_down, NULL); |
183 | 184 | ||
184 | edje_object_file_set(edje_obj, edje_file_path, "example_color_class"); | 185 | edje_object_file_set(edje_obj1, edje_file_path, "example_color_class"); |
185 | evas_object_move(edje_obj, 0, 0); /* at canvas' origin */ | 186 | evas_object_move(edje_obj1, 0, 0); /* at canvas' origin */ |
186 | evas_object_resize(edje_obj, WIDTH, HEIGHT); | 187 | evas_object_resize(edje_obj1, WIDTH, HEIGHT); |
187 | edje_object_part_text_set(edje_obj, "part_four", "EDJE EXAMPLE"); | 188 | edje_object_part_text_set(edje_obj1, "part_four", "EDJE EXAMPLE"); |
188 | edje_object_signal_callback_add(edje_obj, "color_class,del", "*", | 189 | edje_object_signal_callback_add(edje_obj1, "color_class,del", "*", |
189 | (Edje_Signal_Cb) _color_class_callback_delete, | 190 | (Edje_Signal_Cb) _color_class_callback_delete, |
190 | "process"); | 191 | "process"); |
191 | evas_object_show(edje_obj); | 192 | evas_object_show(edje_obj1); |
192 | 193 | ||
193 | edje_obj2 = edje_object_add(evas2); | 194 | edje_obj2 = edje_object_add(evas2); |
194 | evas_object_event_callback_add(edje_obj2, EVAS_CALLBACK_MOUSE_DOWN, | 195 | evas_object_event_callback_add(edje_obj2, EVAS_CALLBACK_MOUSE_DOWN, |
@@ -202,13 +203,18 @@ _create_windows(void) | |||
202 | (Edje_Signal_Cb) _color_class_callback_delete, | 203 | (Edje_Signal_Cb) _color_class_callback_delete, |
203 | "object"); | 204 | "object"); |
204 | evas_object_show(edje_obj2); | 205 | evas_object_show(edje_obj2); |
206 | |||
207 | return 1; | ||
205 | } | 208 | } |
206 | 209 | ||
207 | int | 210 | int |
208 | main(int argc, char *argv[]) | 211 | main(int argc, char *argv[]) |
209 | { | 212 | { |
210 | color c1, c2, c3; | 213 | char edje_file_path[PATH_MAX]; |
211 | int i; | 214 | const char *edje_file = "color-class.edj"; |
215 | Eina_Prefix *pfx; | ||
216 | color c1, c2, c3; | ||
217 | int i; | ||
212 | 218 | ||
213 | if (argc != 5) | 219 | if (argc != 5) |
214 | { | 220 | { |
@@ -218,7 +224,7 @@ main(int argc, char *argv[]) | |||
218 | for (i = 0; i < 8; i++) | 224 | for (i = 0; i < 8; i++) |
219 | fprintf(stderr, "%s\n", color_names[i]); | 225 | fprintf(stderr, "%s\n", color_names[i]); |
220 | 226 | ||
221 | return 1; | 227 | return EXIT_FAILURE; |
222 | } | 228 | } |
223 | 229 | ||
224 | selected_class = argv[1]; | 230 | selected_class = argv[1]; |
@@ -227,13 +233,30 @@ main(int argc, char *argv[]) | |||
227 | _get_color_from_name(argv[4], &c3))) | 233 | _get_color_from_name(argv[4], &c3))) |
228 | { | 234 | { |
229 | fprintf(stderr, "Color not available!\n"); | 235 | fprintf(stderr, "Color not available!\n"); |
230 | return 2; | 236 | return EXIT_FAILURE; |
231 | } | 237 | } |
232 | 238 | ||
233 | ecore_evas_init(); | 239 | if (!ecore_evas_init()) |
234 | edje_init(); | 240 | return EXIT_FAILURE; |
241 | |||
242 | if (!edje_init()) | ||
243 | goto shutdown_ecore_evas; | ||
244 | |||
245 | pfx = eina_prefix_new(argv[0], main, | ||
246 | "EDJE_EXAMPLES", | ||
247 | "edje/examples", | ||
248 | edje_file, | ||
249 | PACKAGE_BIN_DIR, | ||
250 | PACKAGE_LIB_DIR, | ||
251 | PACKAGE_DATA_DIR, | ||
252 | PACKAGE_DATA_DIR); | ||
253 | if (!pfx) | ||
254 | goto shutdown_edje; | ||
235 | 255 | ||
236 | _create_windows(); | 256 | snprintf(edje_file_path, sizeof(edje_file_path), |
257 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); | ||
258 | if (!_create_windows(edje_file_path)) | ||
259 | goto free_prefix; | ||
237 | 260 | ||
238 | edje_color_class_set(argv[1], /* class name */ | 261 | edje_color_class_set(argv[1], /* class name */ |
239 | c1[0], c1[1], c1[2], c1[3], /* Object color */ | 262 | c1[0], c1[1], c1[2], c1[3], /* Object color */ |
@@ -248,10 +271,25 @@ main(int argc, char *argv[]) | |||
248 | 39, 90, 187, 255); /* Text shadow */ | 271 | 39, 90, 187, 255); /* Text shadow */ |
249 | 272 | ||
250 | _color_classes_print(); | 273 | _color_classes_print(); |
274 | |||
275 | ecore_evas_show(ee1); | ||
276 | ecore_evas_show(ee2); | ||
277 | |||
251 | ecore_main_loop_begin(); | 278 | ecore_main_loop_begin(); |
252 | ecore_evas_free(ee); | 279 | |
253 | ecore_evas_free(ee2); | 280 | eina_prefix_free(pfx); |
281 | ecore_evas_free(ee1); | ||
254 | ecore_evas_shutdown(); | 282 | ecore_evas_shutdown(); |
255 | edje_shutdown(); | 283 | edje_shutdown(); |
256 | return 0; | 284 | |
285 | return EXIT_SUCCESS; | ||
286 | |||
287 | free_prefix: | ||
288 | eina_prefix_free(pfx); | ||
289 | shutdown_edje: | ||
290 | edje_shutdown(); | ||
291 | shutdown_ecore_evas: | ||
292 | ecore_evas_shutdown(); | ||
293 | |||
294 | return EXIT_FAILURE; | ||
257 | } | 295 | } |
diff --git a/libraries/edje/src/examples/edje-drag.c b/libraries/edje/src/examples/edje-drag.c index 78e2e72..bb61b68 100644 --- a/libraries/edje/src/examples/edje-drag.c +++ b/libraries/edje/src/examples/edje-drag.c | |||
@@ -10,10 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef HAVE_CONFIG_H | 12 | #ifdef HAVE_CONFIG_H |
13 | #include "config.h" | 13 | # include "config.h" |
14 | #else | 14 | #else |
15 | #define PACKAGE_EXAMPLES_DIR "." | 15 | # define __UNUSED__ |
16 | #define __UNUSED__ | ||
17 | #endif | 16 | #endif |
18 | 17 | ||
19 | #include <Ecore.h> | 18 | #include <Ecore.h> |
@@ -28,15 +27,17 @@ | |||
28 | 27 | ||
29 | #define NRECTS 20 | 28 | #define NRECTS 20 |
30 | 29 | ||
31 | static const char *PARTNAME = "example/knob"; | 30 | static const char commands[] = \ |
32 | 31 | "commands are:\n" | |
33 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/drag.edj"; | 32 | "\tDdown - set drag step to 1\n" |
33 | "\tUp - set drag step to -1\n" | ||
34 | "\tm - set drag value to 0.5\n" | ||
35 | "\tPrior - set drag page to -1\n" | ||
36 | "\tNext - set drag page to -1\n" | ||
37 | "\tEsc - exit\n" | ||
38 | "\th - print help\n"; | ||
34 | 39 | ||
35 | struct _App { | 40 | static const char *PARTNAME = "example/knob"; |
36 | Ecore_Evas *ee; | ||
37 | Evas_Object *edje; | ||
38 | Evas_Object *bg; | ||
39 | }; | ||
40 | 41 | ||
41 | static void | 42 | static void |
42 | _on_destroy(Ecore_Evas *ee __UNUSED__) | 43 | _on_destroy(Ecore_Evas *ee __UNUSED__) |
@@ -47,111 +48,163 @@ _on_destroy(Ecore_Evas *ee __UNUSED__) | |||
47 | /* here just to keep our example's window size and background image's | 48 | /* here just to keep our example's window size and background image's |
48 | * size in synchrony */ | 49 | * size in synchrony */ |
49 | static void | 50 | static void |
50 | _canvas_resize_cb(Ecore_Evas *ee) | 51 | _on_canvas_resize(Ecore_Evas *ee) |
51 | { | 52 | { |
52 | int w, h; | 53 | Evas_Object *bg; |
53 | struct _App *app = ecore_evas_data_get(ee, "app"); | 54 | Evas_Object *edje_obj; |
55 | int w; | ||
56 | int h; | ||
57 | |||
58 | bg = ecore_evas_data_get(ee, "background"); | ||
59 | edje_obj = ecore_evas_data_get(ee, "edje_obj"); | ||
54 | 60 | ||
55 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | 61 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); |
56 | evas_object_resize(app->bg, w, h); | 62 | evas_object_resize(bg, w, h); |
57 | evas_object_resize(app->edje, w, h); | 63 | evas_object_resize(edje_obj, w, h); |
58 | } | 64 | } |
59 | 65 | ||
60 | static void | 66 | static void |
61 | _bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) | 67 | _on_bg_key_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info) |
62 | { | 68 | { |
63 | struct _App *app = data; | 69 | Ecore_Evas *ee; |
64 | Evas_Event_Key_Down *ev = event_info; | 70 | Evas_Event_Key_Down *ev; |
65 | Evas_Object *rect; | 71 | Evas_Object *edje_obj; |
66 | Eina_Bool r; | ||
67 | 72 | ||
73 | ee = (Ecore_Evas *)data; | ||
74 | ev = (Evas_Event_Key_Down *)event_info; | ||
75 | edje_obj = ecore_evas_data_get(ee, "edje_obj"); | ||
68 | 76 | ||
69 | if (!strcmp(ev->keyname, "Down")) | 77 | if (!strcmp(ev->keyname, "h")) |
70 | { | 78 | { |
71 | edje_object_part_drag_step(app->edje, PARTNAME, 0, 1.0); | 79 | fprintf(stdout, commands); |
80 | return; | ||
81 | } | ||
82 | else if (!strcmp(ev->keyname, "Down")) | ||
83 | { | ||
84 | edje_object_part_drag_step(edje_obj, PARTNAME, 0, 1.0); | ||
72 | } | 85 | } |
73 | else if (!strcmp(ev->keyname, "Up")) | 86 | else if (!strcmp(ev->keyname, "Up")) |
74 | { | 87 | { |
75 | edje_object_part_drag_step(app->edje, PARTNAME, 0, -1.0); | 88 | edje_object_part_drag_step(edje_obj, PARTNAME, 0, -1.0); |
76 | } | 89 | } |
77 | else if (!strcmp(ev->keyname, "m")) | 90 | else if (!strcmp(ev->keyname, "m")) |
78 | { | 91 | { |
79 | edje_object_part_drag_value_set(app->edje, PARTNAME, 0.0, 0.5); | 92 | edje_object_part_drag_value_set(edje_obj, PARTNAME, 0.0, 0.5); |
80 | } | 93 | } |
81 | else if (!strcmp(ev->keyname, "Prior")) | 94 | else if (!strcmp(ev->keyname, "Prior")) |
82 | { | 95 | { |
83 | edje_object_part_drag_page(app->edje, PARTNAME, 0.0, -1.0); | 96 | edje_object_part_drag_page(edje_obj, PARTNAME, 0.0, -1.0); |
84 | } | 97 | } |
85 | else if (!strcmp(ev->keyname, "Next")) | 98 | else if (!strcmp(ev->keyname, "Next")) |
86 | { | 99 | { |
87 | edje_object_part_drag_page(app->edje, PARTNAME, 0.0, 1.0); | 100 | edje_object_part_drag_page(edje_obj, PARTNAME, 0.0, 1.0); |
88 | } | 101 | } |
89 | else if (!strcmp(ev->keyname, "Escape")) | 102 | else if (!strcmp(ev->keyname, "Escape")) |
90 | ecore_main_loop_quit(); | 103 | ecore_main_loop_quit(); |
91 | else | 104 | else |
92 | printf("unhandled key: %s\n", ev->keyname); | 105 | { |
106 | printf("unhandled key: %s\n", ev->keyname); | ||
107 | fprintf(stdout, commands); | ||
108 | } | ||
93 | } | 109 | } |
94 | 110 | ||
95 | static void | 111 | static void |
96 | _knob_moved_cb(void *data, Evas_Object *o, const char *emission, const char *source) | 112 | _on_knob_moved(void *data __UNUSED__, Evas_Object *o, const char *emission __UNUSED__, const char *source __UNUSED__) |
97 | { | 113 | { |
98 | double val; | 114 | double val; |
115 | |||
99 | edje_object_part_drag_value_get(o, PARTNAME, NULL, &val); | 116 | edje_object_part_drag_value_get(o, PARTNAME, NULL, &val); |
100 | printf("value changed to: %0.3f\n", val); | 117 | printf("value changed to: %0.3f\n", val); |
101 | } | 118 | } |
102 | 119 | ||
103 | int | 120 | int |
104 | main(void) | 121 | main(int argc __UNUSED__, char *argv[]) |
105 | { | 122 | { |
106 | Evas *evas; | 123 | char edje_file_path[PATH_MAX]; |
107 | struct _App app; | 124 | const char *edje_file = "drag.edj"; |
108 | int i; | 125 | Ecore_Evas *ee; |
109 | 126 | Evas *evas; | |
110 | ecore_evas_init(); | 127 | Evas_Object *bg; |
111 | edje_init(); | 128 | Evas_Object *edje_obj; |
129 | Eina_Prefix *pfx; | ||
130 | |||
131 | if (!ecore_evas_init()) | ||
132 | return EXIT_FAILURE; | ||
133 | |||
134 | if (!edje_init()) | ||
135 | goto shutdown_ecore_evas; | ||
136 | |||
137 | pfx = eina_prefix_new(argv[0], main, | ||
138 | "EDJE_EXAMPLES", | ||
139 | "edje/examples", | ||
140 | edje_file, | ||
141 | PACKAGE_BIN_DIR, | ||
142 | PACKAGE_LIB_DIR, | ||
143 | PACKAGE_DATA_DIR, | ||
144 | PACKAGE_DATA_DIR); | ||
145 | if (!pfx) | ||
146 | goto shutdown_edje; | ||
112 | 147 | ||
113 | /* this will give you a window with an Evas canvas under the first | 148 | /* this will give you a window with an Evas canvas under the first |
114 | * engine available */ | 149 | * engine available */ |
115 | app.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 150 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
116 | 151 | if (!ee) | |
117 | ecore_evas_callback_destroy_set(app.ee, _on_destroy); | 152 | goto free_prefix; |
118 | ecore_evas_callback_resize_set(app.ee, _canvas_resize_cb); | ||
119 | ecore_evas_title_set(app.ee, "Edje Box Example"); | ||
120 | ecore_evas_show(app.ee); | ||
121 | 153 | ||
122 | ecore_evas_data_set(app.ee, "app", &app); | 154 | ecore_evas_callback_destroy_set(ee, _on_destroy); |
155 | ecore_evas_callback_resize_set(ee, _on_canvas_resize); | ||
156 | ecore_evas_title_set(ee, "Edje Box Example"); | ||
123 | 157 | ||
124 | evas = ecore_evas_get(app.ee); | 158 | evas = ecore_evas_get(ee); |
125 | 159 | ||
126 | app.bg = evas_object_rectangle_add(evas); | 160 | bg = evas_object_rectangle_add(evas); |
127 | evas_object_color_set(app.bg, 255, 255, 255, 255); | 161 | evas_object_color_set(bg, 255, 255, 255, 255); |
128 | evas_object_resize(app.bg, WIDTH, HEIGHT); | 162 | evas_object_resize(bg, WIDTH, HEIGHT); |
129 | evas_object_focus_set(app.bg, EINA_TRUE); | 163 | evas_object_focus_set(bg, EINA_TRUE); |
130 | evas_object_show(app.bg); | 164 | evas_object_show(bg); |
165 | ecore_evas_data_set(ee, "background", bg); | ||
131 | 166 | ||
132 | evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _bg_key_down, &app); | 167 | evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_bg_key_down, ee); |
133 | 168 | ||
134 | app.edje = edje_object_add(evas); | 169 | edje_obj = edje_object_add(evas); |
135 | 170 | ||
136 | edje_object_file_set(app.edje, edje_file_path, "example/group"); | 171 | snprintf(edje_file_path, sizeof(edje_file_path), |
137 | evas_object_move(app.edje, 0, 0); | 172 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); |
138 | evas_object_resize(app.edje, WIDTH, HEIGHT); | 173 | edje_object_file_set(edje_obj, edje_file_path, "example/group"); |
139 | evas_object_show(app.edje); | 174 | evas_object_move(edje_obj, 0, 0); |
175 | evas_object_resize(edje_obj, WIDTH, HEIGHT); | ||
176 | evas_object_show(edje_obj); | ||
177 | ecore_evas_data_set(ee, "edje_obj", edje_obj); | ||
140 | 178 | ||
141 | edje_object_part_drag_size_set(app.edje, PARTNAME, 1.0, 0.4); | 179 | edje_object_part_drag_size_set(edje_obj, PARTNAME, 1.0, 0.4); |
142 | 180 | ||
143 | if (!edje_object_part_drag_step_set(app.edje, PARTNAME, 0.0, 0.1)) | 181 | if (!edje_object_part_drag_step_set(edje_obj, PARTNAME, 0.0, 0.1)) |
144 | printf("error when setting drag step size.\n"); | 182 | printf("error when setting drag step size.\n"); |
145 | 183 | ||
146 | if (!edje_object_part_drag_page_set(app.edje, PARTNAME, 0.0, 0.3)) | 184 | if (!edje_object_part_drag_page_set(edje_obj, PARTNAME, 0.0, 0.3)) |
147 | printf("error when setting drag page step size.\n"); | 185 | printf("error when setting drag page step size.\n"); |
148 | 186 | ||
149 | edje_object_signal_callback_add(app.edje, "drag", PARTNAME, _knob_moved_cb, &app); | 187 | edje_object_signal_callback_add(edje_obj, "drag", PARTNAME, _on_knob_moved, NULL); |
188 | |||
189 | fprintf(stdout, commands); | ||
190 | |||
191 | ecore_evas_show(ee); | ||
150 | 192 | ||
151 | ecore_main_loop_begin(); | 193 | ecore_main_loop_begin(); |
152 | 194 | ||
153 | ecore_evas_free(app.ee); | 195 | eina_prefix_free(pfx); |
196 | ecore_evas_free(ee); | ||
154 | ecore_evas_shutdown(); | 197 | ecore_evas_shutdown(); |
155 | edje_shutdown(); | 198 | edje_shutdown(); |
156 | return 0; | 199 | |
200 | return EXIT_SUCCESS; | ||
201 | |||
202 | free_prefix: | ||
203 | eina_prefix_free(pfx); | ||
204 | shutdown_edje: | ||
205 | edje_shutdown(); | ||
206 | shutdown_ecore_evas: | ||
207 | ecore_evas_shutdown(); | ||
208 | |||
209 | return EXIT_FAILURE; | ||
157 | } | 210 | } |
diff --git a/libraries/edje/src/examples/edje-perspective.c b/libraries/edje/src/examples/edje-perspective.c index 5220b74..1037043 100644 --- a/libraries/edje/src/examples/edje-perspective.c +++ b/libraries/edje/src/examples/edje-perspective.c | |||
@@ -10,10 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef HAVE_CONFIG_H | 12 | #ifdef HAVE_CONFIG_H |
13 | #include "config.h" | 13 | # include "config.h" |
14 | #else | 14 | #else |
15 | #define PACKAGE_EXAMPLES_DIR "." | 15 | # define __UNUSED__ |
16 | #define __UNUSED__ | ||
17 | #endif | 16 | #endif |
18 | 17 | ||
19 | #include <Ecore.h> | 18 | #include <Ecore.h> |
@@ -23,11 +22,21 @@ | |||
23 | #define WIDTH 480 | 22 | #define WIDTH 480 |
24 | #define HEIGHT 320 | 23 | #define HEIGHT 320 |
25 | 24 | ||
26 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/perspective.edj"; | 25 | static const char commands[] = \ |
26 | "commands are:\n" | ||
27 | "\tDown - move part down\n" | ||
28 | "\tUp - move part up\n" | ||
29 | "\tLeft - move part left\n" | ||
30 | "\tRight - move part right\n" | ||
31 | "\tPrior - move part up-left\n" | ||
32 | "\tNext - move part down-right\n" | ||
33 | "\tInsert - increase focal\n" | ||
34 | "\tSuppr - decrease focal\n" | ||
35 | "\tEsc - exit\n" | ||
36 | "\th - print help\n"; | ||
27 | 37 | ||
28 | struct _App { | 38 | struct _App { |
29 | Ecore_Evas *ee; | 39 | Evas_Object *edje_obj; |
30 | Evas_Object *edje; | ||
31 | Evas_Object *bg; | 40 | Evas_Object *bg; |
32 | Edje_Perspective *ps; | 41 | Edje_Perspective *ps; |
33 | Eina_Bool animating; | 42 | Eina_Bool animating; |
@@ -44,14 +53,14 @@ _on_destroy(Ecore_Evas *ee __UNUSED__) | |||
44 | /* here just to keep our example's window size and background image's | 53 | /* here just to keep our example's window size and background image's |
45 | * size in synchrony */ | 54 | * size in synchrony */ |
46 | static void | 55 | static void |
47 | _canvas_resize_cb(Ecore_Evas *ee) | 56 | _on_canvas_resize(Ecore_Evas *ee) |
48 | { | 57 | { |
49 | int w, h; | 58 | int w, h; |
50 | struct _App *app = ecore_evas_data_get(ee, "app"); | 59 | struct _App *app = ecore_evas_data_get(ee, "app"); |
51 | 60 | ||
52 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | 61 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); |
53 | evas_object_resize(app->bg, w, h); | 62 | evas_object_resize(app->bg, w, h); |
54 | evas_object_resize(app->edje, w, h); | 63 | evas_object_resize(app->edje_obj, w, h); |
55 | } | 64 | } |
56 | 65 | ||
57 | static void | 66 | static void |
@@ -74,20 +83,24 @@ _part_move(struct _App *app, int dx, int dy) | |||
74 | app->y = 0; | 83 | app->y = 0; |
75 | 84 | ||
76 | snprintf(emission, sizeof(emission), "move,%d,%d", app->x, app->y); | 85 | snprintf(emission, sizeof(emission), "move,%d,%d", app->x, app->y); |
77 | edje_object_signal_emit(app->edje, emission, ""); | 86 | edje_object_signal_emit(app->edje_obj, emission, ""); |
78 | app->animating = EINA_TRUE; | 87 | app->animating = EINA_TRUE; |
79 | } | 88 | } |
80 | 89 | ||
81 | 90 | ||
82 | static void | 91 | static void |
83 | _bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) | 92 | _on_bg_key_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info) |
84 | { | 93 | { |
85 | struct _App *app = data; | 94 | struct _App *app = data; |
86 | Evas_Event_Key_Down *ev = event_info; | 95 | Evas_Event_Key_Down *ev = event_info; |
87 | 96 | ||
88 | 97 | if (!strcmp(ev->keyname, "h")) | |
98 | { | ||
99 | fprintf(stdout, commands); | ||
100 | return; | ||
101 | } | ||
89 | // just moving the part and text | 102 | // just moving the part and text |
90 | if (!strcmp(ev->keyname, "Down")) | 103 | else if (!strcmp(ev->keyname, "Down")) |
91 | { | 104 | { |
92 | _part_move(app, 0, 1); | 105 | _part_move(app, 0, 1); |
93 | } | 106 | } |
@@ -116,7 +129,7 @@ _bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) | |||
116 | { | 129 | { |
117 | app->focal += 5; | 130 | app->focal += 5; |
118 | edje_perspective_set(app->ps, 240, 160, 0, app->focal); | 131 | edje_perspective_set(app->ps, 240, 160, 0, app->focal); |
119 | edje_object_calc_force(app->edje); | 132 | edje_object_calc_force(app->edje_obj); |
120 | } | 133 | } |
121 | else if (!strcmp(ev->keyname, "KP_Subtract")) | 134 | else if (!strcmp(ev->keyname, "KP_Subtract")) |
122 | { | 135 | { |
@@ -125,13 +138,16 @@ _bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) | |||
125 | app->focal = 5; | 138 | app->focal = 5; |
126 | 139 | ||
127 | edje_perspective_set(app->ps, 240, 160, 0, app->focal); | 140 | edje_perspective_set(app->ps, 240, 160, 0, app->focal); |
128 | edje_object_calc_force(app->edje); | 141 | edje_object_calc_force(app->edje_obj); |
129 | } | 142 | } |
130 | // exiting | 143 | // exiting |
131 | else if (!strcmp(ev->keyname, "Escape")) | 144 | else if (!strcmp(ev->keyname, "Escape")) |
132 | ecore_main_loop_quit(); | 145 | ecore_main_loop_quit(); |
133 | else | 146 | else |
134 | printf("unhandled key: %s\n", ev->keyname); | 147 | { |
148 | printf("unhandled key: %s\n", ev->keyname); | ||
149 | fprintf(stdout, commands); | ||
150 | } | ||
135 | } | 151 | } |
136 | 152 | ||
137 | static void | 153 | static void |
@@ -143,16 +159,33 @@ _animation_end_cb(void *data, Evas_Object *o __UNUSED__, const char *emission __ | |||
143 | } | 159 | } |
144 | 160 | ||
145 | int | 161 | int |
146 | main(void) | 162 | main(int argc __UNUSED__, char *argv[]) |
147 | { | 163 | { |
148 | Evas *evas; | 164 | char edje_file_path[PATH_MAX]; |
149 | struct _App app; | 165 | const char *edje_file = "perspective.edj"; |
150 | int i; | 166 | struct _App app; |
151 | 167 | Ecore_Evas *ee; | |
152 | ecore_evas_init(); | 168 | Evas *evas; |
153 | edje_init(); | 169 | Eina_Prefix *pfx; |
154 | 170 | ||
155 | edje_frametime_set(((double)1) / 60); | 171 | if (!ecore_evas_init()) |
172 | return EXIT_FAILURE; | ||
173 | |||
174 | if (!edje_init()) | ||
175 | goto shutdown_ecore_evas; | ||
176 | |||
177 | pfx = eina_prefix_new(argv[0], main, | ||
178 | "EDJE_EXAMPLES", | ||
179 | "edje/examples", | ||
180 | edje_file, | ||
181 | PACKAGE_BIN_DIR, | ||
182 | PACKAGE_LIB_DIR, | ||
183 | PACKAGE_DATA_DIR, | ||
184 | PACKAGE_DATA_DIR); | ||
185 | if (!pfx) | ||
186 | goto shutdown_edje; | ||
187 | |||
188 | edje_frametime_set(1.0 / 60.0); | ||
156 | 189 | ||
157 | /* this will give you a window with an Evas canvas under the first | 190 | /* this will give you a window with an Evas canvas under the first |
158 | * engine available */ | 191 | * engine available */ |
@@ -160,16 +193,18 @@ main(void) | |||
160 | app.x = 0; | 193 | app.x = 0; |
161 | app.y = 0; | 194 | app.y = 0; |
162 | app.focal = 50; | 195 | app.focal = 50; |
163 | app.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | ||
164 | 196 | ||
165 | ecore_evas_callback_destroy_set(app.ee, _on_destroy); | 197 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
166 | ecore_evas_callback_resize_set(app.ee, _canvas_resize_cb); | 198 | if (!ee) |
167 | ecore_evas_title_set(app.ee, "Edje Box Example"); | 199 | goto free_prefix; |
168 | ecore_evas_show(app.ee); | 200 | |
201 | ecore_evas_callback_destroy_set(ee, _on_destroy); | ||
202 | ecore_evas_callback_resize_set(ee, _on_canvas_resize); | ||
203 | ecore_evas_title_set(ee, "Edje Box Example"); | ||
169 | 204 | ||
170 | ecore_evas_data_set(app.ee, "app", &app); | 205 | ecore_evas_data_set(ee, "app", &app); |
171 | 206 | ||
172 | evas = ecore_evas_get(app.ee); | 207 | evas = ecore_evas_get(ee); |
173 | 208 | ||
174 | app.bg = evas_object_rectangle_add(evas); | 209 | app.bg = evas_object_rectangle_add(evas); |
175 | evas_object_color_set(app.bg, 255, 255, 255, 255); | 210 | evas_object_color_set(app.bg, 255, 255, 255, 255); |
@@ -177,25 +212,42 @@ main(void) | |||
177 | evas_object_focus_set(app.bg, EINA_TRUE); | 212 | evas_object_focus_set(app.bg, EINA_TRUE); |
178 | evas_object_show(app.bg); | 213 | evas_object_show(app.bg); |
179 | 214 | ||
180 | evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _bg_key_down, &app); | 215 | evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _on_bg_key_down, &app); |
181 | 216 | ||
182 | app.edje = edje_object_add(evas); | 217 | app.edje_obj = edje_object_add(evas); |
183 | 218 | ||
184 | edje_object_file_set(app.edje, edje_file_path, "example/group"); | 219 | snprintf(edje_file_path, sizeof(edje_file_path), |
185 | evas_object_move(app.edje, 0, 0); | 220 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); |
186 | evas_object_resize(app.edje, WIDTH, HEIGHT); | 221 | edje_object_file_set(app.edje_obj, edje_file_path, "example/group"); |
187 | evas_object_show(app.edje); | 222 | evas_object_move(app.edje_obj, 0, 0); |
223 | evas_object_resize(app.edje_obj, WIDTH, HEIGHT); | ||
224 | evas_object_show(app.edje_obj); | ||
188 | 225 | ||
189 | edje_object_signal_callback_add(app.edje, "animation,end", "", _animation_end_cb, &app); | 226 | edje_object_signal_callback_add(app.edje_obj, "animation,end", "", _animation_end_cb, &app); |
190 | 227 | ||
191 | app.ps = edje_perspective_new(evas); | 228 | app.ps = edje_perspective_new(evas); |
192 | edje_perspective_set(app.ps, 240, 160, 0, app.focal); | 229 | edje_perspective_set(app.ps, 240, 160, 0, app.focal); |
193 | edje_perspective_global_set(app.ps, EINA_TRUE); | 230 | edje_perspective_global_set(app.ps, EINA_TRUE); |
194 | 231 | ||
232 | fprintf(stdout, commands); | ||
233 | |||
234 | ecore_evas_show(ee); | ||
235 | |||
195 | ecore_main_loop_begin(); | 236 | ecore_main_loop_begin(); |
196 | 237 | ||
197 | ecore_evas_free(app.ee); | 238 | eina_prefix_free(pfx); |
239 | ecore_evas_free(ee); | ||
198 | ecore_evas_shutdown(); | 240 | ecore_evas_shutdown(); |
199 | edje_shutdown(); | 241 | edje_shutdown(); |
200 | return 0; | 242 | |
243 | return EXIT_SUCCESS; | ||
244 | |||
245 | free_prefix: | ||
246 | eina_prefix_free(pfx); | ||
247 | shutdown_edje: | ||
248 | edje_shutdown(); | ||
249 | shutdown_ecore_evas: | ||
250 | ecore_evas_shutdown(); | ||
251 | |||
252 | return EXIT_FAILURE; | ||
201 | } | 253 | } |
diff --git a/libraries/edje/src/examples/edje-signals-messages.c b/libraries/edje/src/examples/edje-signals-messages.c index 2345738..4949415 100644 --- a/libraries/edje/src/examples/edje-signals-messages.c +++ b/libraries/edje/src/examples/edje-signals-messages.c | |||
@@ -27,34 +27,32 @@ | |||
27 | #define MSG_COLOR 1 | 27 | #define MSG_COLOR 1 |
28 | #define MSG_TEXT 2 | 28 | #define MSG_TEXT 2 |
29 | 29 | ||
30 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | 30 | static const char commands[] = \ |
31 | static const char *edje_file_path = \ | ||
32 | PACKAGE_EXAMPLES_DIR "/signals-messages.edj"; | ||
33 | |||
34 | static Ecore_Evas *ee; | ||
35 | static Evas_Object *edje_obj; | ||
36 | static Eina_Bool right_rect_show = EINA_TRUE; | ||
37 | |||
38 | static const char *commands = \ | ||
39 | "commands are:\n" | 31 | "commands are:\n" |
40 | "\tt - toggle right rectangle's visibility\n" | 32 | "\tt - toggle right rectangle's visibility\n" |
33 | "\tEsc - exit\n" | ||
41 | "\th - print help\n"; | 34 | "\th - print help\n"; |
42 | 35 | ||
36 | static Eina_Bool right_rect_show = EINA_TRUE; | ||
37 | |||
43 | static void | 38 | static void |
44 | _on_keydown(void *data __UNUSED__, | 39 | _on_keydown(void *data, |
45 | Evas *evas __UNUSED__, | 40 | Evas *evas __UNUSED__, |
46 | Evas_Object *o __UNUSED__, | 41 | Evas_Object *o __UNUSED__, |
47 | void *einfo) | 42 | void *einfo) |
48 | { | 43 | { |
49 | Evas_Event_Key_Down *ev = einfo; | 44 | Evas_Event_Key_Down *ev; |
45 | Evas_Object *edje_obj; | ||
46 | |||
47 | ev = (Evas_Event_Key_Down *)einfo; | ||
48 | edje_obj = (Evas_Object *)data; | ||
50 | 49 | ||
51 | if (strcmp(ev->keyname, "h") == 0) /* print help */ | 50 | if (!strcmp(ev->keyname, "h")) /* print help */ |
52 | { | 51 | { |
53 | fprintf(stdout, commands); | 52 | fprintf(stdout, commands); |
54 | return; | 53 | return; |
55 | } | 54 | } |
56 | 55 | else if (!strcmp(ev->keyname, "t")) /* toggle right rectangle's visibility */ | |
57 | if (strcmp(ev->keyname, "t") == 0) /* toggle right rectangle's visibility */ | ||
58 | { | 56 | { |
59 | char buf[1024]; | 57 | char buf[1024]; |
60 | 58 | ||
@@ -68,6 +66,13 @@ _on_keydown(void *data __UNUSED__, | |||
68 | 66 | ||
69 | return; | 67 | return; |
70 | } | 68 | } |
69 | else if (!strcmp(ev->keyname, "Escape")) | ||
70 | ecore_main_loop_quit(); | ||
71 | else | ||
72 | { | ||
73 | printf("unhandled key: %s\n", ev->keyname); | ||
74 | fprintf(stdout, commands); | ||
75 | } | ||
71 | } | 76 | } |
72 | 77 | ||
73 | static void | 78 | static void |
@@ -85,7 +90,7 @@ _sig_print(const char *emission, | |||
85 | } | 90 | } |
86 | 91 | ||
87 | static void | 92 | static void |
88 | _mouse_wheel_cb(void *data __UNUSED__, | 93 | _on_mouse_wheel(void *data __UNUSED__, |
89 | Evas_Object *obj __UNUSED__, | 94 | Evas_Object *obj __UNUSED__, |
90 | const char *emission, | 95 | const char *emission, |
91 | const char *source) | 96 | const char *source) |
@@ -95,8 +100,8 @@ _mouse_wheel_cb(void *data __UNUSED__, | |||
95 | 100 | ||
96 | /* mouse over signals */ | 101 | /* mouse over signals */ |
97 | static void | 102 | static void |
98 | _mouse_over_cb(void *data __UNUSED__, | 103 | _on_mouse_over(void *data __UNUSED__, |
99 | Evas_Object *obj __UNUSED__, | 104 | Evas_Object *edje_obj, |
100 | const char *emission, | 105 | const char *emission, |
101 | const char *source) | 106 | const char *source) |
102 | { | 107 | { |
@@ -133,28 +138,43 @@ _message_handle(void *data __UNUSED__, | |||
133 | } | 138 | } |
134 | 139 | ||
135 | int | 140 | int |
136 | main(void) | 141 | main(int argc __UNUSED__, char *argv[]) |
137 | { | 142 | { |
138 | Evas_Object *border, *bg; | 143 | char border_img_path[PATH_MAX]; |
139 | Evas *evas; | 144 | char edje_file_path[PATH_MAX]; |
140 | 145 | const char *edje_file = "signals-messages.edj"; | |
141 | srand(time(NULL)); | 146 | Ecore_Evas *ee; |
147 | Evas *evas; | ||
148 | Evas_Object *bg; | ||
149 | Evas_Object *edje_obj; | ||
150 | Evas_Object *border; | ||
151 | Eina_Prefix *pfx; | ||
142 | 152 | ||
143 | if (!ecore_evas_init()) | 153 | if (!ecore_evas_init()) |
144 | return EXIT_FAILURE; | 154 | return EXIT_FAILURE; |
145 | 155 | ||
146 | if (!edje_init()) | 156 | if (!edje_init()) |
147 | return EXIT_FAILURE; | 157 | goto shutdown_ecore_evas; |
158 | |||
159 | pfx = eina_prefix_new(argv[0], main, | ||
160 | "EDJE_EXAMPLES", | ||
161 | "edje/examples", | ||
162 | edje_file, | ||
163 | PACKAGE_BIN_DIR, | ||
164 | PACKAGE_LIB_DIR, | ||
165 | PACKAGE_DATA_DIR, | ||
166 | PACKAGE_DATA_DIR); | ||
167 | if (!pfx) | ||
168 | goto shutdown_edje; | ||
148 | 169 | ||
149 | /* this will give you a window with an Evas canvas under the first | 170 | /* this will give you a window with an Evas canvas under the first |
150 | * engine available */ | 171 | * engine available */ |
151 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 172 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
152 | if (!ee) | 173 | if (!ee) |
153 | goto error; | 174 | goto free_prefix; |
154 | 175 | ||
155 | ecore_evas_callback_delete_request_set(ee, _on_delete); | 176 | ecore_evas_callback_delete_request_set(ee, _on_delete); |
156 | ecore_evas_title_set(ee, "Edje Basics Example"); | 177 | ecore_evas_title_set(ee, "Edje Basics Example"); |
157 | ecore_evas_show(ee); | ||
158 | 178 | ||
159 | evas = ecore_evas_get(ee); | 179 | evas = ecore_evas_get(ee); |
160 | 180 | ||
@@ -163,14 +183,13 @@ main(void) | |||
163 | evas_object_move(bg, 0, 0); /* at canvas' origin */ | 183 | evas_object_move(bg, 0, 0); /* at canvas' origin */ |
164 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ | 184 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ |
165 | evas_object_show(bg); | 185 | evas_object_show(bg); |
166 | ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); | ||
167 | |||
168 | evas_object_focus_set(bg, EINA_TRUE); | 186 | evas_object_focus_set(bg, EINA_TRUE); |
169 | evas_object_event_callback_add( | 187 | ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); |
170 | bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
171 | 188 | ||
172 | edje_obj = edje_object_add(evas); | 189 | edje_obj = edje_object_add(evas); |
173 | 190 | ||
191 | snprintf(edje_file_path, sizeof(edje_file_path), | ||
192 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); | ||
174 | if (!edje_object_file_set(edje_obj, edje_file_path, "example_group")) | 193 | if (!edje_object_file_set(edje_obj, edje_file_path, "example_group")) |
175 | { | 194 | { |
176 | int err = edje_object_load_error_get(edje_obj); | 195 | int err = edje_object_load_error_get(edje_obj); |
@@ -179,14 +198,14 @@ main(void) | |||
179 | "signals-messages.edj: %s\n", errmsg); | 198 | "signals-messages.edj: %s\n", errmsg); |
180 | 199 | ||
181 | evas_object_del(edje_obj); | 200 | evas_object_del(edje_obj); |
182 | goto error_edj; | 201 | goto free_prefix; |
183 | } | 202 | } |
184 | 203 | ||
185 | edje_object_signal_callback_add(edje_obj, "mouse,wheel,*", "part_left", | 204 | edje_object_signal_callback_add(edje_obj, "mouse,wheel,*", "part_left", |
186 | _mouse_wheel_cb, NULL); | 205 | _on_mouse_wheel, NULL); |
187 | 206 | ||
188 | edje_object_signal_callback_add(edje_obj, "mouse,over", "part_right", | 207 | edje_object_signal_callback_add(edje_obj, "mouse,over", "part_right", |
189 | _mouse_over_cb, NULL); | 208 | _on_mouse_over, NULL); |
190 | 209 | ||
191 | edje_object_message_handler_set(edje_obj, _message_handle, NULL); | 210 | edje_object_message_handler_set(edje_obj, _message_handle, NULL); |
192 | 211 | ||
@@ -194,6 +213,11 @@ main(void) | |||
194 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); | 213 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); |
195 | evas_object_show(edje_obj); | 214 | evas_object_show(edje_obj); |
196 | 215 | ||
216 | evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, edje_obj); | ||
217 | |||
218 | snprintf(border_img_path, sizeof(border_img_path), | ||
219 | "%s/edje/examples/red.png", eina_prefix_data_get(pfx)); | ||
220 | |||
197 | /* this is a border around the Edje object above, here just to | 221 | /* this is a border around the Edje object above, here just to |
198 | * emphasize its geometry */ | 222 | * emphasize its geometry */ |
199 | border = evas_object_image_filled_add(evas); | 223 | border = evas_object_image_filled_add(evas); |
@@ -207,24 +231,24 @@ main(void) | |||
207 | evas_object_show(border); | 231 | evas_object_show(border); |
208 | 232 | ||
209 | fprintf(stdout, commands); | 233 | fprintf(stdout, commands); |
234 | |||
235 | ecore_evas_show(ee); | ||
236 | |||
210 | ecore_main_loop_begin(); | 237 | ecore_main_loop_begin(); |
211 | 238 | ||
239 | eina_prefix_free(pfx); | ||
212 | ecore_evas_free(ee); | 240 | ecore_evas_free(ee); |
213 | ecore_evas_shutdown(); | 241 | ecore_evas_shutdown(); |
214 | edje_shutdown(); | 242 | edje_shutdown(); |
215 | return 0; | ||
216 | |||
217 | error: | ||
218 | fprintf(stderr, "You got to have at least one Evas engine built" | ||
219 | " and linked up to ecore-evas for this example to run" | ||
220 | " properly.\n"); | ||
221 | ecore_evas_shutdown(); | ||
222 | return -1; | ||
223 | 243 | ||
224 | error_edj: | 244 | return EXIT_SUCCESS; |
225 | fprintf(stderr, "Failed to load signals-messages.edj!\n"); | ||
226 | 245 | ||
246 | free_prefix: | ||
247 | eina_prefix_free(pfx); | ||
248 | shutdown_edje: | ||
249 | edje_shutdown(); | ||
250 | shutdown_ecore_evas: | ||
227 | ecore_evas_shutdown(); | 251 | ecore_evas_shutdown(); |
228 | return -2; | ||
229 | } | ||
230 | 252 | ||
253 | return EXIT_FAILURE; | ||
254 | } | ||
diff --git a/libraries/edje/src/examples/edje-swallow.c b/libraries/edje/src/examples/edje-swallow.c index a1d30e2..ad79ca2 100644 --- a/libraries/edje/src/examples/edje-swallow.c +++ b/libraries/edje/src/examples/edje-swallow.c | |||
@@ -10,10 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef HAVE_CONFIG_H | 12 | #ifdef HAVE_CONFIG_H |
13 | #include "config.h" | 13 | # include "config.h" |
14 | #else | 14 | #else |
15 | #define PACKAGE_EXAMPLES_DIR "." | 15 | # define __UNUSED__ |
16 | #define __UNUSED__ | ||
17 | #endif | 16 | #endif |
18 | 17 | ||
19 | #include <Ecore.h> | 18 | #include <Ecore.h> |
@@ -23,11 +22,6 @@ | |||
23 | #define WIDTH (300) | 22 | #define WIDTH (300) |
24 | #define HEIGHT (300) | 23 | #define HEIGHT (300) |
25 | 24 | ||
26 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/swallow.edj"; | ||
27 | |||
28 | static Ecore_Evas *ee; | ||
29 | static Evas_Object *bg; | ||
30 | |||
31 | static void | 25 | static void |
32 | _on_delete(Ecore_Evas *ee __UNUSED__) | 26 | _on_delete(Ecore_Evas *ee __UNUSED__) |
33 | { | 27 | { |
@@ -37,31 +31,56 @@ _on_delete(Ecore_Evas *ee __UNUSED__) | |||
37 | /* here just to keep our example's window size and background image's | 31 | /* here just to keep our example's window size and background image's |
38 | * size in synchrony */ | 32 | * size in synchrony */ |
39 | static void | 33 | static void |
40 | _canvas_resize_cb(Ecore_Evas *ee) | 34 | _on_canvas_resize(Ecore_Evas *ee) |
41 | { | 35 | { |
42 | int w, h; | 36 | Evas_Object *bg; |
37 | int w; | ||
38 | int h; | ||
43 | 39 | ||
40 | bg = ecore_evas_data_get(ee, "background"); | ||
44 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | 41 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); |
45 | evas_object_resize(bg, w, h); | 42 | evas_object_resize(bg, w, h); |
46 | } | 43 | } |
47 | 44 | ||
48 | int | 45 | int |
49 | main(void) | 46 | main(int argc __UNUSED__, char *argv[]) |
50 | { | 47 | { |
51 | Evas_Object *edje_obj, *rect, *obj; | 48 | char edje_file_path[PATH_MAX]; |
52 | Evas *evas; | 49 | const char *edje_file = "swallow.edj"; |
53 | 50 | Ecore_Evas *ee; | |
54 | ecore_evas_init(); | 51 | Evas *evas; |
55 | edje_init(); | 52 | Evas_Object *bg; |
53 | Evas_Object *rect; | ||
54 | Evas_Object *obj; | ||
55 | Evas_Object *edje_obj; | ||
56 | Eina_Prefix *pfx; | ||
57 | |||
58 | if (!ecore_evas_init()) | ||
59 | return EXIT_FAILURE; | ||
60 | |||
61 | if (!edje_init()) | ||
62 | goto shutdown_ecore_evas; | ||
63 | |||
64 | pfx = eina_prefix_new(argv[0], main, | ||
65 | "EDJE_EXAMPLES", | ||
66 | "edje/examples", | ||
67 | edje_file, | ||
68 | PACKAGE_BIN_DIR, | ||
69 | PACKAGE_LIB_DIR, | ||
70 | PACKAGE_DATA_DIR, | ||
71 | PACKAGE_DATA_DIR); | ||
72 | if (!pfx) | ||
73 | goto shutdown_edje; | ||
56 | 74 | ||
57 | /* this will give you a window with an Evas canvas under the first | 75 | /* this will give you a window with an Evas canvas under the first |
58 | * engine available */ | 76 | * engine available */ |
59 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 77 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
78 | if (!ee) | ||
79 | goto free_prefix; | ||
60 | 80 | ||
61 | ecore_evas_callback_delete_request_set(ee, _on_delete); | 81 | ecore_evas_callback_delete_request_set(ee, _on_delete); |
62 | ecore_evas_callback_resize_set(ee, _canvas_resize_cb); | 82 | ecore_evas_callback_resize_set(ee, _on_canvas_resize); |
63 | ecore_evas_title_set(ee, "Edje Swallow Example"); | 83 | ecore_evas_title_set(ee, "Edje Swallow Example"); |
64 | ecore_evas_show(ee); | ||
65 | 84 | ||
66 | evas = ecore_evas_get(ee); | 85 | evas = ecore_evas_get(ee); |
67 | 86 | ||
@@ -70,9 +89,12 @@ main(void) | |||
70 | evas_object_move(bg, 0, 0); /* at canvas' origin */ | 89 | evas_object_move(bg, 0, 0); /* at canvas' origin */ |
71 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ | 90 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ |
72 | evas_object_show(bg); | 91 | evas_object_show(bg); |
92 | ecore_evas_data_set(ee, "background", bg); | ||
73 | 93 | ||
74 | edje_obj = edje_object_add(evas); | 94 | edje_obj = edje_object_add(evas); |
75 | 95 | ||
96 | snprintf(edje_file_path, sizeof(edje_file_path), | ||
97 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); | ||
76 | edje_object_file_set(edje_obj, edje_file_path, "example_group"); | 98 | edje_object_file_set(edje_obj, edje_file_path, "example_group"); |
77 | evas_object_move(edje_obj, 20, 20); | 99 | evas_object_move(edje_obj, 20, 20); |
78 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); | 100 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); |
@@ -86,10 +108,23 @@ main(void) | |||
86 | if(obj == rect) | 108 | if(obj == rect) |
87 | printf("Swallowing worked!\n"); | 109 | printf("Swallowing worked!\n"); |
88 | 110 | ||
111 | ecore_evas_show(ee); | ||
112 | |||
89 | ecore_main_loop_begin(); | 113 | ecore_main_loop_begin(); |
90 | 114 | ||
115 | eina_prefix_free(pfx); | ||
91 | ecore_evas_free(ee); | 116 | ecore_evas_free(ee); |
92 | ecore_evas_shutdown(); | 117 | ecore_evas_shutdown(); |
93 | edje_shutdown(); | 118 | edje_shutdown(); |
94 | return 0; | 119 | |
120 | return EXIT_SUCCESS; | ||
121 | |||
122 | free_prefix: | ||
123 | eina_prefix_free(pfx); | ||
124 | shutdown_edje: | ||
125 | edje_shutdown(); | ||
126 | shutdown_ecore_evas: | ||
127 | ecore_evas_shutdown(); | ||
128 | |||
129 | return EXIT_FAILURE; | ||
95 | } | 130 | } |
diff --git a/libraries/edje/src/examples/edje-table.c b/libraries/edje/src/examples/edje-table.c index 3866d22..7780221 100644 --- a/libraries/edje/src/examples/edje-table.c +++ b/libraries/edje/src/examples/edje-table.c | |||
@@ -10,10 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef HAVE_CONFIG_H | 12 | #ifdef HAVE_CONFIG_H |
13 | #include "config.h" | 13 | # include "config.h" |
14 | #else | 14 | #else |
15 | #define PACKAGE_EXAMPLES_DIR "." | 15 | # define __UNUSED__ |
16 | #define __UNUSED__ | ||
17 | #endif | 16 | #endif |
18 | 17 | ||
19 | #include <Ecore.h> | 18 | #include <Ecore.h> |
@@ -23,12 +22,6 @@ | |||
23 | #define WIDTH (400) | 22 | #define WIDTH (400) |
24 | #define HEIGHT (400) | 23 | #define HEIGHT (400) |
25 | 24 | ||
26 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/table.edj"; | ||
27 | |||
28 | static Ecore_Evas *ee; | ||
29 | static Evas *evas; | ||
30 | static Evas_Object *bg, *edje_obj, *rects[4]; | ||
31 | |||
32 | static void | 25 | static void |
33 | _on_delete(Ecore_Evas *ee __UNUSED__) | 26 | _on_delete(Ecore_Evas *ee __UNUSED__) |
34 | { | 27 | { |
@@ -38,7 +31,7 @@ _on_delete(Ecore_Evas *ee __UNUSED__) | |||
38 | /* Try to get the number of columns and rows of the table | 31 | /* Try to get the number of columns and rows of the table |
39 | * and print them. */ | 32 | * and print them. */ |
40 | static void | 33 | static void |
41 | _columns_rows_print(void) | 34 | _columns_rows_print(Evas_Object *edje_obj) |
42 | { | 35 | { |
43 | int cols, rows; | 36 | int cols, rows; |
44 | 37 | ||
@@ -52,10 +45,18 @@ _columns_rows_print(void) | |||
52 | /* here just to keep our example's window size and table items | 45 | /* here just to keep our example's window size and table items |
53 | * size in synchrony. */ | 46 | * size in synchrony. */ |
54 | static void | 47 | static void |
55 | _canvas_resize_cb(Ecore_Evas *ee) | 48 | _on_canvas_resize(Ecore_Evas *ee) |
56 | { | 49 | { |
57 | int i, w, h; | 50 | Evas_Object *bg; |
58 | 51 | Evas_Object *edje_obj; | |
52 | Evas_Object **rects; | ||
53 | int i; | ||
54 | int w; | ||
55 | int h; | ||
56 | |||
57 | bg = ecore_evas_data_get(ee, "background"); | ||
58 | edje_obj = ecore_evas_data_get(ee, "edje_obj"); | ||
59 | rects = ecore_evas_data_get(ee, "rects"); | ||
59 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); | 60 | ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); |
60 | 61 | ||
61 | evas_object_resize(bg, w, h); | 62 | evas_object_resize(bg, w, h); |
@@ -68,9 +69,13 @@ _canvas_resize_cb(Ecore_Evas *ee) | |||
68 | /* Mouse button 1 = remove the clicked item | 69 | /* Mouse button 1 = remove the clicked item |
69 | * any other button = remove all items. */ | 70 | * any other button = remove all items. */ |
70 | static void | 71 | static void |
71 | _on_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) | 72 | _on_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) |
72 | { | 73 | { |
73 | Evas_Event_Mouse_Down *ev = event_info; | 74 | Evas_Event_Mouse_Down *ev; |
75 | Evas_Object *edje_obj; | ||
76 | |||
77 | ev = (Evas_Event_Mouse_Down *)event_info; | ||
78 | edje_obj = (Evas_Object *)data; | ||
74 | 79 | ||
75 | if (ev->button != 1) | 80 | if (ev->button != 1) |
76 | edje_object_part_table_clear(edje_obj, "table_part", EINA_TRUE); | 81 | edje_object_part_table_clear(edje_obj, "table_part", EINA_TRUE); |
@@ -78,11 +83,11 @@ _on_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) | |||
78 | fprintf(stderr, "Cannot remove the selected rectangle\n"); | 83 | fprintf(stderr, "Cannot remove the selected rectangle\n"); |
79 | 84 | ||
80 | evas_object_del(obj); | 85 | evas_object_del(obj); |
81 | _columns_rows_print(); | 86 | _columns_rows_print(edje_obj); |
82 | } | 87 | } |
83 | 88 | ||
84 | static void | 89 | static void |
85 | _rects_create(void) | 90 | _rects_create(Evas *evas, Evas_Object **rects, Evas_Object *edje_obj) |
86 | { | 91 | { |
87 | int i; | 92 | int i; |
88 | 93 | ||
@@ -93,26 +98,48 @@ _rects_create(void) | |||
93 | evas_object_size_hint_weight_set(rects[i], 1.0, 1.0); | 98 | evas_object_size_hint_weight_set(rects[i], 1.0, 1.0); |
94 | evas_object_show(rects[i]); | 99 | evas_object_show(rects[i]); |
95 | evas_object_event_callback_add(rects[i], EVAS_CALLBACK_MOUSE_DOWN, | 100 | evas_object_event_callback_add(rects[i], EVAS_CALLBACK_MOUSE_DOWN, |
96 | _on_mouse_down, NULL); | 101 | _on_mouse_down, edje_obj); |
97 | } | 102 | } |
98 | } | 103 | } |
99 | 104 | ||
100 | int | 105 | int |
101 | main(void) | 106 | main(int argc __UNUSED__, char *argv[]) |
102 | { | 107 | { |
103 | int i; | 108 | char edje_file_path[PATH_MAX]; |
104 | 109 | const char *edje_file = "table.edj"; | |
105 | ecore_evas_init(); | 110 | Ecore_Evas *ee; |
106 | edje_init(); | 111 | Evas *evas; |
112 | Evas_Object *bg; | ||
113 | Evas_Object *edje_obj; | ||
114 | Evas_Object *rects[4]; | ||
115 | Eina_Prefix *pfx; | ||
116 | |||
117 | if (!ecore_evas_init()) | ||
118 | return EXIT_FAILURE; | ||
119 | |||
120 | if (!edje_init()) | ||
121 | goto shutdown_ecore_evas; | ||
122 | |||
123 | pfx = eina_prefix_new(argv[0], main, | ||
124 | "EDJE_EXAMPLES", | ||
125 | "edje/examples", | ||
126 | edje_file, | ||
127 | PACKAGE_BIN_DIR, | ||
128 | PACKAGE_LIB_DIR, | ||
129 | PACKAGE_DATA_DIR, | ||
130 | PACKAGE_DATA_DIR); | ||
131 | if (!pfx) | ||
132 | goto shutdown_edje; | ||
107 | 133 | ||
108 | /* this will give you a window with an Evas canvas under the first | 134 | /* this will give you a window with an Evas canvas under the first |
109 | * engine available */ | 135 | * engine available */ |
110 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 136 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
137 | if (!ee) | ||
138 | goto free_prefix; | ||
111 | 139 | ||
112 | ecore_evas_callback_delete_request_set(ee, _on_delete); | 140 | ecore_evas_callback_delete_request_set(ee, _on_delete); |
113 | ecore_evas_callback_resize_set(ee, _canvas_resize_cb); | 141 | ecore_evas_callback_resize_set(ee, _on_canvas_resize); |
114 | ecore_evas_title_set(ee, "Edje Table Example"); | 142 | ecore_evas_title_set(ee, "Edje Table Example"); |
115 | ecore_evas_show(ee); | ||
116 | 143 | ||
117 | evas = ecore_evas_get(ee); | 144 | evas = ecore_evas_get(ee); |
118 | 145 | ||
@@ -121,15 +148,20 @@ main(void) | |||
121 | evas_object_move(bg, 0, 0); /* at canvas' origin */ | 148 | evas_object_move(bg, 0, 0); /* at canvas' origin */ |
122 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ | 149 | evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ |
123 | evas_object_show(bg); | 150 | evas_object_show(bg); |
151 | ecore_evas_data_set(ee, "background", bg); | ||
124 | 152 | ||
125 | edje_obj = edje_object_add(evas); | 153 | edje_obj = edje_object_add(evas); |
126 | 154 | ||
155 | snprintf(edje_file_path, sizeof(edje_file_path), | ||
156 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); | ||
127 | edje_object_file_set(edje_obj, edje_file_path, "example_table"); | 157 | edje_object_file_set(edje_obj, edje_file_path, "example_table"); |
128 | evas_object_move(edje_obj, 0, 0); /* at canvas' origin */ | 158 | evas_object_move(edje_obj, 0, 0); /* at canvas' origin */ |
129 | evas_object_resize(edje_obj, WIDTH, HEIGHT); | 159 | evas_object_resize(edje_obj, WIDTH, HEIGHT); |
130 | evas_object_show(edje_obj); | 160 | evas_object_show(edje_obj); |
161 | ecore_evas_data_set(ee, "edje_obj", edje_obj); | ||
131 | 162 | ||
132 | _rects_create(); | 163 | _rects_create(evas, rects, edje_obj); |
164 | ecore_evas_data_set(ee, "rects", rects); | ||
133 | 165 | ||
134 | /* Colouring the rectangles */ | 166 | /* Colouring the rectangles */ |
135 | evas_object_color_set(rects[0], 255, 0, 0, 255); | 167 | evas_object_color_set(rects[0], 255, 0, 0, 255); |
@@ -154,12 +186,25 @@ main(void) | |||
154 | 1, 1, 1, 1)) | 186 | 1, 1, 1, 1)) |
155 | fprintf(stderr, "Cannot add the rectangle 4 to table\n"); | 187 | fprintf(stderr, "Cannot add the rectangle 4 to table\n"); |
156 | 188 | ||
157 | _columns_rows_print(); | 189 | _columns_rows_print(edje_obj); |
190 | |||
191 | ecore_evas_show(ee); | ||
158 | 192 | ||
159 | ecore_main_loop_begin(); | 193 | ecore_main_loop_begin(); |
160 | 194 | ||
195 | eina_prefix_free(pfx); | ||
161 | ecore_evas_free(ee); | 196 | ecore_evas_free(ee); |
162 | ecore_evas_shutdown(); | 197 | ecore_evas_shutdown(); |
163 | edje_shutdown(); | 198 | edje_shutdown(); |
164 | return 0; | 199 | |
200 | return EXIT_SUCCESS; | ||
201 | |||
202 | free_prefix: | ||
203 | eina_prefix_free(pfx); | ||
204 | shutdown_edje: | ||
205 | edje_shutdown(); | ||
206 | shutdown_ecore_evas: | ||
207 | ecore_evas_shutdown(); | ||
208 | |||
209 | return EXIT_FAILURE; | ||
165 | } | 210 | } |
diff --git a/libraries/edje/src/examples/edje-text.c b/libraries/edje/src/examples/edje-text.c index 0916509..5f801a2 100644 --- a/libraries/edje/src/examples/edje-text.c +++ b/libraries/edje/src/examples/edje-text.c | |||
@@ -10,10 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifdef HAVE_CONFIG_H | 12 | #ifdef HAVE_CONFIG_H |
13 | #include "config.h" | 13 | # include "config.h" |
14 | #else | 14 | #else |
15 | #define PACKAGE_EXAMPLES_DIR "." | 15 | # define __UNUSED__ |
16 | #define __UNUSED__ | ||
17 | #endif | 16 | #endif |
18 | 17 | ||
19 | #include <Ecore.h> | 18 | #include <Ecore.h> |
@@ -23,11 +22,6 @@ | |||
23 | #define WIDTH (300) | 22 | #define WIDTH (300) |
24 | #define HEIGHT (300) | 23 | #define HEIGHT (300) |
25 | 24 | ||
26 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/text.edj"; | ||
27 | |||
28 | static Ecore_Evas *ee; | ||
29 | static Evas_Object *bg; | ||
30 | |||
31 | static void | 25 | static void |
32 | _on_delete(Ecore_Evas *ee __UNUSED__) | 26 | _on_delete(Ecore_Evas *ee __UNUSED__) |
33 | { | 27 | { |
@@ -35,27 +29,47 @@ _on_delete(Ecore_Evas *ee __UNUSED__) | |||
35 | } | 29 | } |
36 | 30 | ||
37 | static void | 31 | static void |
38 | _cb(void *data, Evas_Object *obj, const char *part) | 32 | _on_text_change(void *data __UNUSED__, Evas_Object *obj, const char *part) |
39 | { | 33 | { |
40 | printf("text: %s\n", edje_object_part_text_unescaped_get(obj, part)); | 34 | printf("text: %s\n", edje_object_part_text_unescaped_get(obj, part)); |
41 | } | 35 | } |
42 | 36 | ||
43 | int | 37 | int |
44 | main(void) | 38 | main(int argc __UNUSED__, char *argv[]) |
45 | { | 39 | { |
46 | Evas_Object *edje_obj, *rect, *obj; | 40 | char edje_file_path[PATH_MAX]; |
47 | Evas *evas; | 41 | const char *edje_file = "text.edj"; |
48 | 42 | Ecore_Evas *ee; | |
49 | ecore_evas_init(); | 43 | Evas *evas; |
50 | edje_init(); | 44 | Evas_Object *bg; |
45 | Evas_Object *edje_obj; | ||
46 | Eina_Prefix *pfx; | ||
47 | |||
48 | if (!ecore_evas_init()) | ||
49 | return EXIT_FAILURE; | ||
50 | |||
51 | if (!edje_init()) | ||
52 | goto shutdown_ecore_evas; | ||
53 | |||
54 | pfx = eina_prefix_new(argv[0], main, | ||
55 | "EDJE_EXAMPLES", | ||
56 | "edje/examples", | ||
57 | edje_file, | ||
58 | PACKAGE_BIN_DIR, | ||
59 | PACKAGE_LIB_DIR, | ||
60 | PACKAGE_DATA_DIR, | ||
61 | PACKAGE_DATA_DIR); | ||
62 | if (!pfx) | ||
63 | goto shutdown_edje; | ||
51 | 64 | ||
52 | /* this will give you a window with an Evas canvas under the first | 65 | /* this will give you a window with an Evas canvas under the first |
53 | * engine available */ | 66 | * engine available */ |
54 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 67 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
68 | if (!ee) | ||
69 | goto free_prefix; | ||
55 | 70 | ||
56 | ecore_evas_callback_delete_request_set(ee, _on_delete); | 71 | ecore_evas_callback_delete_request_set(ee, _on_delete); |
57 | ecore_evas_title_set(ee, "Edje text Example"); | 72 | ecore_evas_title_set(ee, "Edje text Example"); |
58 | ecore_evas_show(ee); | ||
59 | 73 | ||
60 | evas = ecore_evas_get(ee); | 74 | evas = ecore_evas_get(ee); |
61 | 75 | ||
@@ -68,12 +82,14 @@ main(void) | |||
68 | 82 | ||
69 | edje_obj = edje_object_add(evas); | 83 | edje_obj = edje_object_add(evas); |
70 | 84 | ||
85 | snprintf(edje_file_path, sizeof(edje_file_path), | ||
86 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); | ||
71 | edje_object_file_set(edje_obj, edje_file_path, "example_group"); | 87 | edje_object_file_set(edje_obj, edje_file_path, "example_group"); |
72 | evas_object_move(edje_obj, 20, 20); | 88 | evas_object_move(edje_obj, 20, 20); |
73 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); | 89 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); |
74 | evas_object_show(edje_obj); | 90 | evas_object_show(edje_obj); |
75 | 91 | ||
76 | edje_object_text_change_cb_set(edje_obj, _cb, NULL); | 92 | edje_object_text_change_cb_set(edje_obj, _on_text_change, NULL); |
77 | edje_object_part_text_set(edje_obj, "part_one", "one"); | 93 | edje_object_part_text_set(edje_obj, "part_one", "one"); |
78 | edje_object_part_text_set(edje_obj, "part_two", "<b>two"); | 94 | edje_object_part_text_set(edje_obj, "part_two", "<b>two"); |
79 | 95 | ||
@@ -83,10 +99,23 @@ main(void) | |||
83 | edje_object_part_text_select_none(edje_obj, "part_two"); | 99 | edje_object_part_text_select_none(edje_obj, "part_two"); |
84 | printf("selection: %s\n", edje_object_part_text_selection_get(edje_obj, "part_two")); | 100 | printf("selection: %s\n", edje_object_part_text_selection_get(edje_obj, "part_two")); |
85 | 101 | ||
102 | ecore_evas_show(ee); | ||
103 | |||
86 | ecore_main_loop_begin(); | 104 | ecore_main_loop_begin(); |
87 | 105 | ||
106 | eina_prefix_free(pfx); | ||
88 | ecore_evas_free(ee); | 107 | ecore_evas_free(ee); |
89 | ecore_evas_shutdown(); | 108 | ecore_evas_shutdown(); |
90 | edje_shutdown(); | 109 | edje_shutdown(); |
91 | return 0; | 110 | |
111 | return EXIT_SUCCESS; | ||
112 | |||
113 | free_prefix: | ||
114 | eina_prefix_free(pfx); | ||
115 | shutdown_edje: | ||
116 | edje_shutdown(); | ||
117 | shutdown_ecore_evas: | ||
118 | ecore_evas_shutdown(); | ||
119 | |||
120 | return EXIT_FAILURE; | ||
92 | } | 121 | } |
diff --git a/libraries/edje/src/examples/sigtest.c b/libraries/edje/src/examples/sigtest.c index 6e4d85f..9538e13 100644 --- a/libraries/edje/src/examples/sigtest.c +++ b/libraries/edje/src/examples/sigtest.c | |||
@@ -13,35 +13,37 @@ | |||
13 | #define WIDTH (300) | 13 | #define WIDTH (300) |
14 | #define HEIGHT (300) | 14 | #define HEIGHT (300) |
15 | 15 | ||
16 | static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; | ||
17 | static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/sigtest.edj"; | ||
18 | |||
19 | static Ecore_Evas *ee; | ||
20 | static Evas_Object *edje_obj; | ||
21 | |||
22 | static const char commands[] = \ | 16 | static const char commands[] = \ |
23 | "commands are:\n" | 17 | "commands are:\n" |
24 | "\te - change te edje base\n" | 18 | "\te - change te edje base\n" |
25 | "\tl - change to lua base\n" | 19 | "\tl - change to lua base\n" |
26 | "\tm - send message\n" | 20 | "\tm - send message\n" |
27 | "\ts - send signal\n" | 21 | "\ts - send signal\n" |
22 | "\tEsc - exit\n" | ||
28 | "\th - print help\n"; | 23 | "\th - print help\n"; |
29 | 24 | ||
30 | static void | 25 | static void |
31 | _on_keydown(void *data __UNUSED__, | 26 | _on_keydown(void *data, |
32 | Evas *evas __UNUSED__, | 27 | Evas *evas __UNUSED__, |
33 | Evas_Object *o __UNUSED__, | 28 | Evas_Object *o __UNUSED__, |
34 | void *einfo) | 29 | void *einfo) |
35 | { | 30 | { |
36 | Evas_Event_Key_Down *ev = einfo; | 31 | Ecore_Evas *ee; |
32 | Evas_Event_Key_Down *ev; | ||
33 | Evas_Object *edje_obj; | ||
34 | char *edje_file_path; | ||
35 | |||
36 | ee = (Ecore_Evas *)data; | ||
37 | ev = (Evas_Event_Key_Down *)einfo; | ||
38 | edje_obj = ecore_evas_data_get(ee, "edje_obj"); | ||
39 | edje_file_path = ecore_evas_data_get(ee, "file_path"); | ||
37 | 40 | ||
38 | if (strcmp(ev->keyname, "h") == 0) | 41 | if (!strcmp(ev->keyname, "h")) |
39 | { | 42 | { |
40 | fprintf(stdout, commands); | 43 | fprintf(stdout, commands); |
41 | return; | 44 | return; |
42 | } | 45 | } |
43 | 46 | else if (!strcmp(ev->keyname, "e")) | |
44 | if (strcmp(ev->keyname, "e") == 0) | ||
45 | { | 47 | { |
46 | if (!edje_object_file_set(edje_obj, edje_file_path, "plain/edje/group")) | 48 | if (!edje_object_file_set(edje_obj, edje_file_path, "plain/edje/group")) |
47 | { | 49 | { |
@@ -55,8 +57,7 @@ _on_keydown(void *data __UNUSED__, | |||
55 | " file sigtest.edj with success!\n"); | 57 | " file sigtest.edj with success!\n"); |
56 | return; | 58 | return; |
57 | } | 59 | } |
58 | 60 | else if (!strcmp(ev->keyname, "l")) | |
59 | if (strcmp(ev->keyname, "l") == 0) | ||
60 | { | 61 | { |
61 | if (!edje_object_file_set(edje_obj, edje_file_path, "lua_base")) | 62 | if (!edje_object_file_set(edje_obj, edje_file_path, "lua_base")) |
62 | { | 63 | { |
@@ -70,8 +71,7 @@ _on_keydown(void *data __UNUSED__, | |||
70 | " file sigtest.edj with success!\n"); | 71 | " file sigtest.edj with success!\n"); |
71 | return; | 72 | return; |
72 | } | 73 | } |
73 | 74 | else if (!strcmp(ev->keyname, "m")) | |
74 | if (strcmp(ev->keyname, "m") == 0) | ||
75 | { | 75 | { |
76 | Edje_Message_String *msg = malloc(sizeof(*msg)); | 76 | Edje_Message_String *msg = malloc(sizeof(*msg)); |
77 | 77 | ||
@@ -82,8 +82,7 @@ _on_keydown(void *data __UNUSED__, | |||
82 | fprintf(stdout, "C message sent\n"); | 82 | fprintf(stdout, "C message sent\n"); |
83 | return; | 83 | return; |
84 | } | 84 | } |
85 | 85 | else if (!strcmp(ev->keyname, "s")) | |
86 | if (strcmp(ev->keyname, "s") == 0) | ||
87 | { | 86 | { |
88 | fprintf(stdout, "\n"); | 87 | fprintf(stdout, "\n"); |
89 | edje_object_signal_emit(edje_obj, "C signal 1", "Csource"); | 88 | edje_object_signal_emit(edje_obj, "C signal 1", "Csource"); |
@@ -91,10 +90,17 @@ _on_keydown(void *data __UNUSED__, | |||
91 | fprintf(stdout, "C signal sent\n"); | 90 | fprintf(stdout, "C signal sent\n"); |
92 | return; | 91 | return; |
93 | } | 92 | } |
93 | else if (!strcmp(ev->keyname, "Escape")) | ||
94 | ecore_main_loop_quit(); | ||
95 | else | ||
96 | { | ||
97 | printf("unhandled key: %s\n", ev->keyname); | ||
98 | fprintf(stdout, commands); | ||
99 | } | ||
94 | } | 100 | } |
95 | 101 | ||
96 | static void | 102 | static void |
97 | _on_message(void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg) | 103 | _on_message(void *data __UNUSED__, Evas_Object *obj __UNUSED__, Edje_Message_Type type, int id, void *msg) |
98 | { | 104 | { |
99 | int i; | 105 | int i; |
100 | 106 | ||
@@ -207,7 +213,7 @@ _on_message(void *data, Evas_Object *obj, Edje_Message_Type type, int id, void * | |||
207 | } | 213 | } |
208 | 214 | ||
209 | static void | 215 | static void |
210 | _on_signal(void *data, Evas_Object *obj __UNUSED__, const char *emission, const char *source) | 216 | _on_signal(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *emission, const char *source) |
211 | { | 217 | { |
212 | fprintf(stdout, "C::signal sig=|%s| src=|%s|\n", emission, source); | 218 | fprintf(stdout, "C::signal sig=|%s| src=|%s|\n", emission, source); |
213 | } | 219 | } |
@@ -219,26 +225,43 @@ _on_delete(Ecore_Evas *ee __UNUSED__) | |||
219 | } | 225 | } |
220 | 226 | ||
221 | int | 227 | int |
222 | main(void) | 228 | main(int argc __UNUSED__, char *argv[]) |
223 | { | 229 | { |
224 | Evas_Object *border, *bg; | 230 | char border_img_path[PATH_MAX]; |
225 | Evas *evas; | 231 | char edje_file_path[PATH_MAX]; |
232 | const char *edje_file = "sigtest.edj"; | ||
233 | Ecore_Evas *ee; | ||
234 | Evas *evas; | ||
235 | Evas_Object *bg; | ||
236 | Evas_Object *border; | ||
237 | Evas_Object *edje_obj; | ||
238 | Eina_Prefix *pfx; | ||
226 | 239 | ||
227 | if (!ecore_evas_init()) | 240 | if (!ecore_evas_init()) |
228 | return EXIT_FAILURE; | 241 | return EXIT_FAILURE; |
229 | 242 | ||
230 | if (!edje_init()) | 243 | if (!edje_init()) |
231 | return EXIT_FAILURE; | 244 | goto shutdown_ecore_evas; |
245 | |||
246 | pfx = eina_prefix_new(argv[0], main, | ||
247 | "EDJE_EXAMPLES", | ||
248 | "edje/examples", | ||
249 | edje_file, | ||
250 | PACKAGE_BIN_DIR, | ||
251 | PACKAGE_LIB_DIR, | ||
252 | PACKAGE_DATA_DIR, | ||
253 | PACKAGE_DATA_DIR); | ||
254 | if (!pfx) | ||
255 | goto shutdown_edje; | ||
232 | 256 | ||
233 | /* this will give you a window with an Evas canvas under the first | 257 | /* this will give you a window with an Evas canvas under the first |
234 | * engine available */ | 258 | * engine available */ |
235 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | 259 | ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); |
236 | if (!ee) | 260 | if (!ee) |
237 | goto error; | 261 | goto free_prefix; |
238 | 262 | ||
239 | ecore_evas_callback_delete_request_set(ee, _on_delete); | 263 | ecore_evas_callback_delete_request_set(ee, _on_delete); |
240 | ecore_evas_title_set(ee, "Signals and wessages tester"); | 264 | ecore_evas_title_set(ee, "Signals and wessages tester"); |
241 | ecore_evas_show(ee); | ||
242 | 265 | ||
243 | evas = ecore_evas_get(ee); | 266 | evas = ecore_evas_get(ee); |
244 | 267 | ||
@@ -250,14 +273,14 @@ main(void) | |||
250 | ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); | 273 | ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); |
251 | 274 | ||
252 | evas_object_focus_set(bg, EINA_TRUE); | 275 | evas_object_focus_set(bg, EINA_TRUE); |
253 | evas_object_event_callback_add( | ||
254 | bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); | ||
255 | 276 | ||
256 | edje_obj = edje_object_add(evas); | 277 | edje_obj = edje_object_add(evas); |
257 | 278 | ||
258 | edje_object_message_handler_set(edje_obj, _on_message, NULL); | 279 | edje_object_message_handler_set(edje_obj, _on_message, NULL); |
259 | edje_object_signal_callback_add(edje_obj, "*", "*", _on_signal, NULL); | 280 | edje_object_signal_callback_add(edje_obj, "*", "*", _on_signal, NULL); |
260 | 281 | ||
282 | snprintf(edje_file_path, sizeof(edje_file_path), | ||
283 | "%s/examples/%s", eina_prefix_data_get(pfx), edje_file); | ||
261 | if (!edje_object_file_set(edje_obj, edje_file_path, "lua_base")) | 284 | if (!edje_object_file_set(edje_obj, edje_file_path, "lua_base")) |
262 | { | 285 | { |
263 | int err = edje_object_load_error_get(edje_obj); | 286 | int err = edje_object_load_error_get(edje_obj); |
@@ -266,7 +289,7 @@ main(void) | |||
266 | errmsg); | 289 | errmsg); |
267 | 290 | ||
268 | evas_object_del(edje_obj); | 291 | evas_object_del(edje_obj); |
269 | goto error_edj; | 292 | goto free_prefix; |
270 | } | 293 | } |
271 | 294 | ||
272 | fprintf(stdout, "Loaded Edje object bound to group 'lua_base' from" | 295 | fprintf(stdout, "Loaded Edje object bound to group 'lua_base' from" |
@@ -275,6 +298,13 @@ main(void) | |||
275 | evas_object_move(edje_obj, 20, 20); | 298 | evas_object_move(edje_obj, 20, 20); |
276 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); | 299 | evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); |
277 | evas_object_show(edje_obj); | 300 | evas_object_show(edje_obj); |
301 | ecore_evas_data_set(ee, "edje_obj", edje_obj); | ||
302 | ecore_evas_data_set(ee, "file_path", edje_file_path); | ||
303 | |||
304 | evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, ee); | ||
305 | |||
306 | snprintf(border_img_path, sizeof(border_img_path), | ||
307 | "%s/edje/examples/red.png", eina_prefix_data_get(pfx)); | ||
278 | 308 | ||
279 | /* this is a border around the Edje object above, here just to | 309 | /* this is a border around the Edje object above, here just to |
280 | * emphasize its geometry */ | 310 | * emphasize its geometry */ |
@@ -287,23 +317,25 @@ main(void) | |||
287 | evas_object_move(border, 20 - 2, 20 - 2); | 317 | evas_object_move(border, 20 - 2, 20 - 2); |
288 | evas_object_show(border); | 318 | evas_object_show(border); |
289 | 319 | ||
320 | fprintf(stdout, commands); | ||
321 | |||
322 | ecore_evas_show(ee); | ||
323 | |||
290 | ecore_main_loop_begin(); | 324 | ecore_main_loop_begin(); |
291 | 325 | ||
326 | eina_prefix_free(pfx); | ||
292 | ecore_evas_free(ee); | 327 | ecore_evas_free(ee); |
293 | ecore_evas_shutdown(); | 328 | ecore_evas_shutdown(); |
294 | edje_shutdown(); | 329 | edje_shutdown(); |
295 | return 0; | ||
296 | |||
297 | error: | ||
298 | fprintf(stderr, "You got to have at least one evas engine built" | ||
299 | " and linked up to ecore-evas for this example to run" | ||
300 | " properly.\n"); | ||
301 | ecore_evas_shutdown(); | ||
302 | return -1; | ||
303 | 330 | ||
304 | error_edj: | 331 | return EXIT_SUCCESS; |
305 | fprintf(stderr, "Failed to load sigtest.edj!\n"); | ||
306 | 332 | ||
333 | free_prefix: | ||
334 | eina_prefix_free(pfx); | ||
335 | shutdown_edje: | ||
336 | edje_shutdown(); | ||
337 | shutdown_ecore_evas: | ||
307 | ecore_evas_shutdown(); | 338 | ecore_evas_shutdown(); |
308 | return -2; | 339 | |
340 | return EXIT_FAILURE; | ||
309 | } | 341 | } |
diff --git a/libraries/edje/src/lib/Edje.h b/libraries/edje/src/lib/Edje.h index 6413014..1449d70 100644 --- a/libraries/edje/src/lib/Edje.h +++ b/libraries/edje/src/lib/Edje.h | |||
@@ -5,7 +5,7 @@ These routines are used for Edje. | |||
5 | 5 | ||
6 | @mainpage Edje Library Documentation | 6 | @mainpage Edje Library Documentation |
7 | @version 1.1 | 7 | @version 1.1 |
8 | @date 2003-2011 | 8 | @date 2003-2012 |
9 | 9 | ||
10 | Please see the @ref authors page for contact details. | 10 | Please see the @ref authors page for contact details. |
11 | 11 | ||
@@ -19,7 +19,7 @@ Please see the @ref authors page for contact details. | |||
19 | 19 | ||
20 | Edje is a complex graphical design & layout library. | 20 | Edje is a complex graphical design & layout library. |
21 | 21 | ||
22 | It doesn't pretend to do containing and regular layout like a widget | 22 | It doesn't intend to do containing and regular layout like a widget |
23 | set, but it is the base for such components. Based on the requirements | 23 | set, but it is the base for such components. Based on the requirements |
24 | of Enlightenment 0.17, Edje should serve all the purposes of creating | 24 | of Enlightenment 0.17, Edje should serve all the purposes of creating |
25 | visual elements (borders of windows, buttons, scrollbars, etc.) and | 25 | visual elements (borders of windows, buttons, scrollbars, etc.) and |
@@ -110,197 +110,11 @@ The application using Edje will then create an object in its Evas | |||
110 | canvas and set the bundle file to use, specifying the @b group name to | 110 | canvas and set the bundle file to use, specifying the @b group name to |
111 | use. Edje will load such information and create all the required | 111 | use. Edje will load such information and create all the required |
112 | children objects with the specified properties as defined in each @b | 112 | children objects with the specified properties as defined in each @b |
113 | part of the given group. See the following annotated example: | 113 | part of the given group. See the following example: |
114 | @include edje_example.c | ||
114 | 115 | ||
115 | @code | 116 | The above example requires the following annotated source Edje file: |
116 | 117 | @include edje_example.edc | |
117 | #include <Eina.h> | ||
118 | #include <Evas.h> | ||
119 | #include <Ecore.h> | ||
120 | #include <Ecore_Evas.h> | ||
121 | #include <Edje.h> | ||
122 | |||
123 | #define WIDTH 320 | ||
124 | #define HEIGHT 240 | ||
125 | |||
126 | static Evas_Object *create_my_group(Evas *canvas, const char *text) | ||
127 | { | ||
128 | Evas_Object *edje; | ||
129 | |||
130 | edje = edje_object_add(canvas); | ||
131 | if (!edje) | ||
132 | { | ||
133 | EINA_LOG_CRIT("could not create edje object!"); | ||
134 | return NULL; | ||
135 | } | ||
136 | |||
137 | if (!edje_object_file_set(edje, "edje_example.edj", "my_group")) | ||
138 | { | ||
139 | int err = edje_object_load_error_get(edje); | ||
140 | const char *errmsg = edje_load_error_str(err); | ||
141 | EINA_LOG_ERR("could not load 'my_group' from edje_example.edj: %s", | ||
142 | errmsg); | ||
143 | |||
144 | evas_object_del(edje); | ||
145 | return NULL; | ||
146 | } | ||
147 | |||
148 | if (text) | ||
149 | { | ||
150 | if (!edje_object_part_text_set(edje, "text", text)) | ||
151 | { | ||
152 | EINA_LOG_WARN("could not set the text. " | ||
153 | "Maybe part 'text' does not exist?"); | ||
154 | } | ||
155 | } | ||
156 | |||
157 | evas_object_move(edje, 0, 0); | ||
158 | evas_object_resize(edje, WIDTH, HEIGHT); | ||
159 | evas_object_show(edje); | ||
160 | return edje; | ||
161 | } | ||
162 | |||
163 | int main(int argc, char *argv[]) | ||
164 | { | ||
165 | Ecore_Evas *window; | ||
166 | Evas *canvas; | ||
167 | Evas_Object *edje; | ||
168 | const char *text; | ||
169 | |||
170 | eina_init(); | ||
171 | evas_init(); | ||
172 | ecore_init(); | ||
173 | ecore_evas_init(); | ||
174 | edje_init(); | ||
175 | |||
176 | window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); | ||
177 | if (!window) | ||
178 | { | ||
179 | EINA_LOG_CRIT("could not create window."); | ||
180 | return -1; | ||
181 | } | ||
182 | canvas = ecore_evas_get(window); | ||
183 | |||
184 | text = (argc > 1) ? argv[1] : NULL; | ||
185 | |||
186 | edje = create_my_group(canvas, text); | ||
187 | if (!edje) | ||
188 | return -2; | ||
189 | |||
190 | ecore_evas_show(window); | ||
191 | ecore_main_loop_begin(); | ||
192 | |||
193 | evas_object_del(edje); | ||
194 | ecore_evas_free(window); | ||
195 | |||
196 | return 0; | ||
197 | } | ||
198 | @endcode | ||
199 | |||
200 | It requires the following source Edje file: | ||
201 | @code | ||
202 | // compile: edje_cc edje_example.edc | ||
203 | collections { | ||
204 | group { | ||
205 | name: "my_group"; // must be the same as in edje_example.c | ||
206 | |||
207 | parts { | ||
208 | part { | ||
209 | name: "background"; | ||
210 | type: RECT; // plain boring rectangle | ||
211 | mouse_events: 0; // we don't need any mouse event on the background | ||
212 | |||
213 | // just one state "default" | ||
214 | description { | ||
215 | state: "default" 0.0; // must always exist | ||
216 | color: 255 255 255 255; // white | ||
217 | |||
218 | // define part coordinates: | ||
219 | |||
220 | rel1 { // top-left point at (0, 0) [WIDTH * 0 + 0, HEIGHT * 0 + 0] | ||
221 | relative: 0.0 0.0; | ||
222 | offset: 0 0; | ||
223 | } | ||
224 | rel2 { // bottom-right point at (WIDTH * 1.0 - 1, HEIGHT * 1.0 - 1) | ||
225 | relative: 1.0 1.0; | ||
226 | offset: -1 -1; | ||
227 | } | ||
228 | } | ||
229 | } | ||
230 | |||
231 | part { | ||
232 | name: "text"; | ||
233 | type: TEXT; | ||
234 | mouse_events: 1; // we want to change the color on mouse-over | ||
235 | |||
236 | // 2 states, one "default" and another "over" to be used | ||
237 | // on mouse over effect | ||
238 | |||
239 | description { | ||
240 | state: "default" 0.0; | ||
241 | color: 255 0 0 255; // red | ||
242 | |||
243 | // define part coordinates: | ||
244 | |||
245 | rel1 { // top-left at (WIDTH * 0.1 + 5, HEIGHT * 0.2 + 10) | ||
246 | relative: 0.1 0.2; | ||
247 | offset: 5 10; | ||
248 | } | ||
249 | rel2 { // bottom-right at (WIDTH * 0.9 - 6, HEIGHT * 0.8 - 11) | ||
250 | relative: 0.9 0.8; | ||
251 | offset: -6 -11; | ||
252 | } | ||
253 | |||
254 | // define text specific state details | ||
255 | text { | ||
256 | font: "Sans"; // using fontconfig name! | ||
257 | size: 10; | ||
258 | text: "hello world"; | ||
259 | } | ||
260 | } | ||
261 | |||
262 | description { | ||
263 | state: "over" 0.0; | ||
264 | inherit: "default" 0.0; // copy everything from "default" at this point | ||
265 | |||
266 | color: 0 255 0 255; // override color, now it is green | ||
267 | } | ||
268 | } | ||
269 | |||
270 | // do programs to change color on text mouse in/out (over) | ||
271 | programs { | ||
272 | program { | ||
273 | // what triggers this program: | ||
274 | signal: "mouse,in"; | ||
275 | source: "text"; | ||
276 | |||
277 | // what this program does: | ||
278 | action: STATE_SET "over" 0.0; | ||
279 | target: "text"; | ||
280 | |||
281 | // do the state-set in a nice interpolation animation | ||
282 | // using linear time in 0.1 second | ||
283 | transition: LINEAR 0.1; | ||
284 | } | ||
285 | |||
286 | program { | ||
287 | // what triggers this program: | ||
288 | signal: "mouse,out"; | ||
289 | source: "text"; | ||
290 | |||
291 | // what this program does: | ||
292 | action: STATE_SET "default" 0.0; | ||
293 | target: "text"; | ||
294 | |||
295 | // do the state-set in a nice interpolation animation | ||
296 | // using linear time in 0.1 second | ||
297 | transition: LINEAR 0.1; | ||
298 | } | ||
299 | } | ||
300 | } | ||
301 | } | ||
302 | } | ||
303 | @endcode | ||
304 | 118 | ||
305 | 119 | ||
306 | One should save these files as edje_example.c and edje_example.edc then: | 120 | One should save these files as edje_example.c and edje_example.edc then: |
@@ -452,6 +266,10 @@ param in edje programs | |||
452 | # undef EAPI | 266 | # undef EAPI |
453 | #endif | 267 | #endif |
454 | 268 | ||
269 | #ifdef HAVE_ECORE_IMF | ||
270 | #include <Ecore_IMF.h> | ||
271 | #endif | ||
272 | |||
455 | #ifdef _WIN32 | 273 | #ifdef _WIN32 |
456 | # ifdef EFL_EDJE_BUILD | 274 | # ifdef EFL_EDJE_BUILD |
457 | # ifdef DLL_EXPORT | 275 | # ifdef DLL_EXPORT |
@@ -778,7 +596,7 @@ typedef enum _Edje_External_Param_Type | |||
778 | { | 596 | { |
779 | EDJE_EXTERNAL_PARAM_TYPE_INT, /**< Parameter value is an integer. */ | 597 | EDJE_EXTERNAL_PARAM_TYPE_INT, /**< Parameter value is an integer. */ |
780 | EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, /**< Parameter value is a double. */ | 598 | EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, /**< Parameter value is a double. */ |
781 | EDJE_EXTERNAL_PARAM_TYPE_STRING, /**< Paramater value is a string. */ | 599 | EDJE_EXTERNAL_PARAM_TYPE_STRING, /**< Parameter value is a string. */ |
782 | EDJE_EXTERNAL_PARAM_TYPE_BOOL, /**< Parameter value is boolean. */ | 600 | EDJE_EXTERNAL_PARAM_TYPE_BOOL, /**< Parameter value is boolean. */ |
783 | EDJE_EXTERNAL_PARAM_TYPE_CHOICE, /**< Parameter value is one of a set of | 601 | EDJE_EXTERNAL_PARAM_TYPE_CHOICE, /**< Parameter value is one of a set of |
784 | predefined string choices. */ | 602 | predefined string choices. */ |
@@ -791,10 +609,10 @@ typedef enum _Edje_External_Param_Type | |||
791 | */ | 609 | */ |
792 | typedef enum _Edje_External_Param_Flags | 610 | typedef enum _Edje_External_Param_Flags |
793 | { | 611 | { |
794 | EDJE_EXTERNAL_PARAM_FLAGS_NONE = 0, /**< Propery is incapable of operations, this is used to catch bogus flags. */ | 612 | EDJE_EXTERNAL_PARAM_FLAGS_NONE = 0, /**< Property is incapable of operations, this is used to catch bogus flags. */ |
795 | EDJE_EXTERNAL_PARAM_FLAGS_GET = (1 << 0), /**< Property can be read/get. */ | 613 | EDJE_EXTERNAL_PARAM_FLAGS_GET = (1 << 0), /**< Property can be read/get. */ |
796 | EDJE_EXTERNAL_PARAM_FLAGS_SET = (1 << 1), /**< Property can be written/set. This only enables edje_object_part_external_param_set() and Embryo scripts. To enable the parameter being set from state description whenever it changes state, use #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */ | 614 | EDJE_EXTERNAL_PARAM_FLAGS_SET = (1 << 1), /**< Property can be written/set. This only enables edje_object_part_external_param_set() and Embryo scripts. To enable the parameter being set from state description whenever it changes state, use #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */ |
797 | EDJE_EXTERNAL_PARAM_FLAGS_STATE = (1 << 2), /**< Property can be set from state dsecription. */ | 615 | EDJE_EXTERNAL_PARAM_FLAGS_STATE = (1 << 2), /**< Property can be set from state description. */ |
798 | EDJE_EXTERNAL_PARAM_FLAGS_CONSTRUCTOR = (1 << 3), /**< This property is only set once when the object is constructed using its value from "default" 0.0 state description. Setting this overrides #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */ | 616 | EDJE_EXTERNAL_PARAM_FLAGS_CONSTRUCTOR = (1 << 3), /**< This property is only set once when the object is constructed using its value from "default" 0.0 state description. Setting this overrides #EDJE_EXTERNAL_PARAM_FLAGS_STATE. */ |
799 | EDJE_EXTERNAL_PARAM_FLAGS_REGULAR = (EDJE_EXTERNAL_PARAM_FLAGS_GET | | 617 | EDJE_EXTERNAL_PARAM_FLAGS_REGULAR = (EDJE_EXTERNAL_PARAM_FLAGS_GET | |
800 | EDJE_EXTERNAL_PARAM_FLAGS_SET | | 618 | EDJE_EXTERNAL_PARAM_FLAGS_SET | |
@@ -817,6 +635,24 @@ typedef enum _Edje_Input_Panel_Layout | |||
817 | EDJE_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */ | 635 | EDJE_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */ |
818 | } Edje_Input_Panel_Layout; | 636 | } Edje_Input_Panel_Layout; |
819 | 637 | ||
638 | typedef enum _Edje_Input_Panel_Lang | ||
639 | { | ||
640 | EDJE_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic @since 1.2 */ | ||
641 | EDJE_INPUT_PANEL_LANG_ALPHABET /**< Alphabet @since 1.2 */ | ||
642 | } Edje_Input_Panel_Lang; | ||
643 | |||
644 | typedef enum _Edje_Input_Panel_Return_Key_Type | ||
645 | { | ||
646 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */ | ||
647 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DONE, /**< Done @since 1.2 */ | ||
648 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_GO, /**< Go @since 1.2 */ | ||
649 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_JOIN, /**< Join @since 1.2 */ | ||
650 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN, /**< Login @since 1.2 */ | ||
651 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_NEXT, /**< Next @since 1.2 */ | ||
652 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH, /**< Search or magnifier icon @since 1.2 */ | ||
653 | EDJE_INPUT_PANEL_RETURN_KEY_TYPE_SEND /**< Send @since 1.2 */ | ||
654 | } Edje_Input_Panel_Return_Key_Type; | ||
655 | |||
820 | /** | 656 | /** |
821 | * @brief Converts type identifier to string nicer representation. | 657 | * @brief Converts type identifier to string nicer representation. |
822 | * | 658 | * |
@@ -886,18 +722,18 @@ struct _Edje_External_Param_Info | |||
886 | used. */ | 722 | used. */ |
887 | union { | 723 | union { |
888 | struct { | 724 | struct { |
889 | int def, /**< Default value for the paramter. */ | 725 | int def, /**< Default value for the parameter. */ |
890 | min, /**< Minimum value it can have. */ | 726 | min, /**< Minimum value it can have. */ |
891 | max, /**< Maximum value it can have. */ | 727 | max, /**< Maximum value it can have. */ |
892 | step; /**< Values will be a multiple of this. */ | 728 | step; /**< Values will be a multiple of this. */ |
893 | } i; /**< Info about integer type parametrs. Use #EDJE_EXTERNAL_INT_UNSET | 729 | } i; /**< Info about integer type parameters. Use #EDJE_EXTERNAL_INT_UNSET |
894 | on any of them to indicate they are not defined.*/ | 730 | on any of them to indicate they are not defined.*/ |
895 | struct { | 731 | struct { |
896 | double def, /**< Default value for the paramter. */ | 732 | double def, /**< Default value for the parameter. */ |
897 | min, /**< Minimum value it can have. */ | 733 | min, /**< Minimum value it can have. */ |
898 | max, /**< Maximum value it can have. */ | 734 | max, /**< Maximum value it can have. */ |
899 | step; /**< Values will be a multiple of this. */ | 735 | step; /**< Values will be a multiple of this. */ |
900 | } d; /**< Info about double type parametrs. Use | 736 | } d; /**< Info about double type parameters. Use |
901 | #EDJE_EXTERNAL_DOUBLE_UNSET on any of them to indicate they are not defined.*/ | 737 | #EDJE_EXTERNAL_DOUBLE_UNSET on any of them to indicate they are not defined.*/ |
902 | struct { | 738 | struct { |
903 | const char *def; /**< Default value. */ | 739 | const char *def; /**< Default value. */ |
@@ -1054,6 +890,7 @@ typedef void (*Edje_Signal_Cb) (void *data, Evas_Object *obj, c | |||
1054 | typedef void (*Edje_Text_Change_Cb) (void *data, Evas_Object *obj, const char *part); | 890 | typedef void (*Edje_Text_Change_Cb) (void *data, Evas_Object *obj, const char *part); |
1055 | typedef void (*Edje_Message_Handler_Cb) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg); /**< Edje message handler callback functions's prototype definition. @c data will have the auxiliary data pointer set at the time the callback registration. @c obj will be a pointer the Edje object where the message comes from. @c type will identify the type of the given message and @c msg will be a pointer the message's contents, de facto, which depend on @c type. */ | 891 | typedef void (*Edje_Message_Handler_Cb) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg); /**< Edje message handler callback functions's prototype definition. @c data will have the auxiliary data pointer set at the time the callback registration. @c obj will be a pointer the Edje object where the message comes from. @c type will identify the type of the given message and @c msg will be a pointer the message's contents, de facto, which depend on @c type. */ |
1056 | typedef void (*Edje_Text_Filter_Cb) (void *data, Evas_Object *obj, const char *part, Edje_Text_Filter_Type type, char **text); | 892 | typedef void (*Edje_Text_Filter_Cb) (void *data, Evas_Object *obj, const char *part, Edje_Text_Filter_Type type, char **text); |
893 | typedef void (*Edje_Markup_Filter_Cb) (void *data, Evas_Object *obj, const char *part, char **text); | ||
1057 | typedef Evas_Object *(*Edje_Item_Provider_Cb) (void *data, Evas_Object *obj, const char *part, const char *item); | 894 | typedef Evas_Object *(*Edje_Item_Provider_Cb) (void *data, Evas_Object *obj, const char *part, const char *item); |
1058 | 895 | ||
1059 | /** | 896 | /** |
@@ -1187,7 +1024,7 @@ EAPI const char *edje_fontset_append_get (void); | |||
1187 | * edje_object_scale_set(), that factor will @b override the global | 1024 | * edje_object_scale_set(), that factor will @b override the global |
1188 | * one. | 1025 | * one. |
1189 | * | 1026 | * |
1190 | * Scaling affects the values of mininum/maximum @b part sizes, which | 1027 | * Scaling affects the values of minimum/maximum @b part sizes, which |
1191 | * are @b multiplied by it. Font sizes are scaled, too. | 1028 | * are @b multiplied by it. Font sizes are scaled, too. |
1192 | * | 1029 | * |
1193 | * @warning Only parts which, at EDC level, had the @c "scale" | 1030 | * @warning Only parts which, at EDC level, had the @c "scale" |
@@ -1244,7 +1081,7 @@ EAPI void edje_password_show_last_timeout_set(double password_show_last_timeout) | |||
1244 | * | 1081 | * |
1245 | * @param obj A handle to an Edje object | 1082 | * @param obj A handle to an Edje object |
1246 | * @param scale The scaling factor (the default value is @c 0.0, | 1083 | * @param scale The scaling factor (the default value is @c 0.0, |
1247 | * meaning indivinual scaling @b not set) | 1084 | * meaning individual scaling @b not set) |
1248 | * | 1085 | * |
1249 | * This function sets an @b individual scaling factor on the @a obj | 1086 | * This function sets an @b individual scaling factor on the @a obj |
1250 | * Edje object. This property (or Edje's global scaling factor, when | 1087 | * Edje object. This property (or Edje's global scaling factor, when |
@@ -1663,9 +1500,9 @@ EAPI void edje_box_layout_register (const char *name, Evas_Object | |||
1663 | * | 1500 | * |
1664 | * @note You can get a callback every time edje re-calculates the object | 1501 | * @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 | 1502 | * (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 | 1503 | * in-line just after the recalculation has occurred. It is a good idea not |
1667 | * to go and delete or alter the object inside this callbacks, simply make | 1504 | * 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 | 1505 | * a note that the recalculation has taken place and then do something about |
1669 | * it outside the callback. to register a callback use code like: | 1506 | * it outside the callback. to register a callback use code like: |
1670 | * | 1507 | * |
1671 | * @code | 1508 | * @code |
@@ -1883,7 +1720,7 @@ EAPI Eina_Bool edje_object_preload (Evas_Object *obj, Eina_Bool c | |||
1883 | * buttons on an interface, you'd be registering for notifications on | 1720 | * buttons on an interface, you'd be registering for notifications on |
1884 | * events of mouse buttons being pressed down on either of those parts | 1721 | * events of mouse buttons being pressed down on either of those parts |
1885 | * (those events all have the @c "mouse,down," common prefix on their | 1722 | * (those events all have the @c "mouse,down," common prefix on their |
1886 | * names, with a suffix giving the button number). The actual emisson | 1723 | * names, with a suffix giving the button number). The actual emission |
1887 | * and source strings of an event will be passed in as the @a emission | 1724 | * and source strings of an event will be passed in as the @a emission |
1888 | * and @a source parameters of the callback function (e.g. @c | 1725 | * and @a source parameters of the callback function (e.g. @c |
1889 | * "mouse,down,2" and @c "button.close"), for each of those events. | 1726 | * "mouse,down,2" and @c "button.close"), for each of those events. |
@@ -2214,6 +2051,27 @@ EAPI Eina_Bool edje_object_text_class_set (Evas_Object *obj, const c | |||
2214 | EAPI void edje_object_size_min_get (const Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh); | 2051 | EAPI void edje_object_size_min_get (const Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh); |
2215 | 2052 | ||
2216 | /** | 2053 | /** |
2054 | * @brief Edje will automatically update the size hints on itself. | ||
2055 | * | ||
2056 | * @param obj A handle to an Edje object. | ||
2057 | * @param update Wether or not update the size hints. | ||
2058 | * | ||
2059 | * By default edje doesn't set size hints on itself. With this function | ||
2060 | * call, it will do so if update is true. Be carefully, it cost a lot to | ||
2061 | * trigger this feature as it will recalc the object every time it make | ||
2062 | * sense to be sure that's its minimal size hint is always accurate. | ||
2063 | */ | ||
2064 | EAPI void edje_object_update_hints_set(Evas_Object *obj, Eina_Bool update); | ||
2065 | |||
2066 | /** | ||
2067 | * @brief Wether or not Edje will update size hints on itself. | ||
2068 | * | ||
2069 | * @param obj A handle to an Edje object. | ||
2070 | * @return @c true if does, @c false if it doesn't. | ||
2071 | */ | ||
2072 | EAPI Eina_Bool edje_object_update_hints_get(Evas_Object *obj); | ||
2073 | |||
2074 | /** | ||
2217 | * @brief Get the maximum size specified -- as an EDC property -- for a | 2075 | * @brief Get the maximum size specified -- as an EDC property -- for a |
2218 | * given Edje object | 2076 | * given Edje object |
2219 | * | 2077 | * |
@@ -2362,12 +2220,12 @@ EAPI Eina_Bool edje_object_part_exists (const Evas_Object *obj, c | |||
2362 | * @return A pointer to the Evas object implementing the given part, | 2220 | * @return A pointer to the Evas object implementing the given part, |
2363 | * or @c NULL on failure (e.g. the given part doesn't exist) | 2221 | * or @c NULL on failure (e.g. the given part doesn't exist) |
2364 | * | 2222 | * |
2365 | * This function gets a pointer the Evas object corresponding to a | 2223 | * This function gets a pointer of the Evas object corresponding to a |
2366 | * given part in the @p obj object's group. | 2224 | * given part in the @p obj object's group. |
2367 | * | 2225 | * |
2368 | * You should @b never modify the state of the returned object (with | 2226 | * You should @b never modify the state of the returned object (with |
2369 | * @c evas_object_move() or @c evas_object_hide() for example), | 2227 | * @c evas_object_move() or @c evas_object_hide() for example), |
2370 | * because it's meant to be managed be Edje, solely. You are safe to | 2228 | * because it's meant to be managed by Edje, solely. You are safe to |
2371 | * query information about its current state (with @c | 2229 | * query information about its current state (with @c |
2372 | * evas_object_visible_get() or @c evas_object_color_get() for | 2230 | * evas_object_visible_get() or @c evas_object_color_get() for |
2373 | * example), though. | 2231 | * example), though. |
@@ -2448,6 +2306,43 @@ EAPI Eina_Bool edje_object_part_text_set (Evas_Object *obj, const c | |||
2448 | EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part); | 2306 | EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part); |
2449 | 2307 | ||
2450 | /** | 2308 | /** |
2309 | * @brief Set the style of the | ||
2310 | * | ||
2311 | * @param obj A valid Evas_Object handle | ||
2312 | * @param part The part name | ||
2313 | * @param style The style to set (textblock conventions). | ||
2314 | * | ||
2315 | * This function sets the style associated with the textblock part. | ||
2316 | * | ||
2317 | * @since 1.2.0 | ||
2318 | */ | ||
2319 | EAPI void edje_object_part_text_style_user_push(Evas_Object *obj, const char *part, const char *style); | ||
2320 | |||
2321 | /** | ||
2322 | * @brief Return the text of the object part. | ||
2323 | * | ||
2324 | * @param obj A valid Evas_Object handle | ||
2325 | * @param part The part name | ||
2326 | * | ||
2327 | * @return The text string | ||
2328 | * | ||
2329 | * This function returns the style associated with the textblock part. | ||
2330 | * | ||
2331 | * @since 1.2.0 | ||
2332 | */ | ||
2333 | EAPI const char *edje_object_part_text_style_user_peek(const Evas_Object *obj, const char *part); | ||
2334 | |||
2335 | /** | ||
2336 | * @brief Delete the top style form the user style stack. | ||
2337 | * | ||
2338 | * @param obj A valid Evas_Object handle | ||
2339 | * @param part The part name | ||
2340 | * | ||
2341 | * @since 1.2.0 | ||
2342 | */ | ||
2343 | EAPI void edje_object_part_text_style_user_pop(Evas_Object *obj, const char *part); | ||
2344 | |||
2345 | /** | ||
2451 | * @brief Sets the raw (non escaped) text for an object part. | 2346 | * @brief Sets the raw (non escaped) text for an object part. |
2452 | * | 2347 | * |
2453 | * @param obj A valid Evas Object handle | 2348 | * @param obj A valid Evas Object handle |
@@ -2615,6 +2510,15 @@ EAPI Eina_Bool edje_object_part_text_item_geometry_get (const Evas_ | |||
2615 | EAPI void edje_object_part_text_cursor_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); | 2510 | EAPI void edje_object_part_text_cursor_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); |
2616 | 2511 | ||
2617 | /** | 2512 | /** |
2513 | * @brief Deletes the selection and emits a change event. | ||
2514 | * | ||
2515 | * @param obj A valid Evas_Object handle | ||
2516 | * @param part The part name | ||
2517 | * @since 1.2.0 | ||
2518 | */ | ||
2519 | EAPI void edje_object_part_text_user_insert (const Evas_Object *obj, const char *part, const char *text); | ||
2520 | |||
2521 | /** | ||
2618 | * @brief Enables selection if the entry is an EXPLICIT selection mode | 2522 | * @brief Enables selection if the entry is an EXPLICIT selection mode |
2619 | * type. | 2523 | * type. |
2620 | * | 2524 | * |
@@ -2813,8 +2717,33 @@ EAPI void edje_object_part_text_cursor_pos_set (Evas_Ob | |||
2813 | EAPI int edje_object_part_text_cursor_pos_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); | 2717 | EAPI int edje_object_part_text_cursor_pos_get (const Evas_Object *obj, const char *part, Edje_Cursor cur); |
2814 | 2718 | ||
2815 | /** | 2719 | /** |
2720 | * @brief Reset the input method context if needed. | ||
2721 | * | ||
2722 | * This can be necessary in the case where modifying the buffer would confuse on-going input method behavior | ||
2723 | * | ||
2724 | * @param obj A valid Evas_Object handle | ||
2725 | * @param part The part name | ||
2726 | * @since 1.2.0 | ||
2727 | */ | ||
2728 | EAPI void edje_object_part_text_imf_context_reset (const Evas_Object *obj, const char *part); | ||
2729 | |||
2730 | /** | ||
2731 | * @brief Get the input method context in entry. | ||
2732 | * | ||
2733 | * If ecore_imf was not available when edje was compiled, this function returns NULL | ||
2734 | * otherwise, the returned pointer is an Ecore_IMF * | ||
2735 | * | ||
2736 | * @param obj A valid Evas_Object handle | ||
2737 | * @param part The part name | ||
2738 | * | ||
2739 | * @return The input method context (Ecore_IMF_Context *) in entry | ||
2740 | * @since 1.2.0 | ||
2741 | */ | ||
2742 | EAPI void *edje_object_part_text_imf_context_get (const Evas_Object *obj, const char *part); | ||
2743 | |||
2744 | /** | ||
2816 | * @brief Set the layout of the input panel. | 2745 | * @brief Set the layout of the input panel. |
2817 | * | 2746 | * |
2818 | * The layout of the input panel or virtual keyboard can make it easier or | 2747 | * The layout of the input panel or virtual keyboard can make it easier or |
2819 | * harder to enter content. This allows you to hint what kind of input you | 2748 | * harder to enter content. This allows you to hint what kind of input you |
2820 | * are expecting to enter and thus have the input panel automatically | 2749 | * are expecting to enter and thus have the input panel automatically |
@@ -2825,7 +2754,7 @@ EAPI int edje_object_part_text_cursor_pos_get (const E | |||
2825 | * @param layout layout type | 2754 | * @param layout layout type |
2826 | * @since 1.1 | 2755 | * @since 1.1 |
2827 | */ | 2756 | */ |
2828 | EAPI void edje_object_part_text_input_panel_layout_set (const Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout); | 2757 | EAPI void edje_object_part_text_input_panel_layout_set (Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout); |
2829 | 2758 | ||
2830 | /** | 2759 | /** |
2831 | * @brief Get the layout of the input panel. | 2760 | * @brief Get the layout of the input panel. |
@@ -2848,7 +2777,7 @@ EAPI Edje_Input_Panel_Layout edje_object_part_text_input_panel_layout_get (const | |||
2848 | * @param autocapital_type The type of autocapitalization | 2777 | * @param autocapital_type The type of autocapitalization |
2849 | * @since 1.1.0 | 2778 | * @since 1.1.0 |
2850 | */ | 2779 | */ |
2851 | EAPI void edje_object_part_text_autocapital_type_set (const Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type); | 2780 | EAPI void edje_object_part_text_autocapital_type_set (Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type); |
2852 | 2781 | ||
2853 | /** | 2782 | /** |
2854 | * @brief Retrieves the autocapitalization type | 2783 | * @brief Retrieves the autocapitalization type |
@@ -2861,6 +2790,26 @@ EAPI void edje_object_part_text_autocapital_type_set (const Evas_ | |||
2861 | EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get (const Evas_Object *obj, const char *part); | 2790 | EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get (const Evas_Object *obj, const char *part); |
2862 | 2791 | ||
2863 | /** | 2792 | /** |
2793 | * @brief Set whether the prediction is allowed or not. | ||
2794 | * | ||
2795 | * @param obj A valid Evas_Object handle | ||
2796 | * @param part The part name | ||
2797 | * @param prediction If true, the prediction feature is allowed. | ||
2798 | * @since 1.2.0 | ||
2799 | */ | ||
2800 | EAPI void edje_object_part_text_prediction_allow_set (Evas_Object *obj, const char *part, Eina_Bool prediction); | ||
2801 | |||
2802 | /** | ||
2803 | * @brief Get whether the prediction is allowed or not. | ||
2804 | * | ||
2805 | * @param obj A valid Evas_Object handle | ||
2806 | * @param part The part name | ||
2807 | * @return EINA_TRUE if prediction feature is allowed. | ||
2808 | * @since 1.2.0 | ||
2809 | */ | ||
2810 | EAPI Eina_Bool edje_object_part_text_prediction_allow_get (const Evas_Object *obj, const char *part); | ||
2811 | |||
2812 | /** | ||
2864 | * @brief Sets the attribute to show the input panel automatically. | 2813 | * @brief Sets the attribute to show the input panel automatically. |
2865 | * | 2814 | * |
2866 | * @param obj A valid Evas_Object handle | 2815 | * @param obj A valid Evas_Object handle |
@@ -2868,7 +2817,7 @@ EAPI Edje_Text_Autocapital_Type edje_object_part_text_autocapital_type_get (cons | |||
2868 | * @param enabled If true, the input panel is appeared when entry is clicked or has a focus | 2817 | * @param enabled If true, the input panel is appeared when entry is clicked or has a focus |
2869 | * @since 1.1.0 | 2818 | * @since 1.1.0 |
2870 | */ | 2819 | */ |
2871 | EAPI void edje_object_part_text_input_panel_enabled_set (const Evas_Object *obj, const char *part, Eina_Bool enabled); | 2820 | EAPI void edje_object_part_text_input_panel_enabled_set (Evas_Object *obj, const char *part, Eina_Bool enabled); |
2872 | 2821 | ||
2873 | /** | 2822 | /** |
2874 | * @brief Retrieve the attribute to show the input panel automatically. | 2823 | * @brief Retrieve the attribute to show the input panel automatically. |
@@ -2882,6 +2831,125 @@ EAPI void edje_object_part_text_input_panel_enabled_set (const Evas_ | |||
2882 | EAPI Eina_Bool edje_object_part_text_input_panel_enabled_get (const Evas_Object *obj, const char *part); | 2831 | EAPI Eina_Bool edje_object_part_text_input_panel_enabled_get (const Evas_Object *obj, const char *part); |
2883 | 2832 | ||
2884 | /** | 2833 | /** |
2834 | * @brief Show the input panel (virtual keyboard) based on the input panel property such as layout, autocapital types, and so on. | ||
2835 | * | ||
2836 | * Note that input panel is shown or hidden automatically according to the focus state. | ||
2837 | * This API can be used in the case of manually controlling by using edje_object_part_text_input_panel_enabled_set. | ||
2838 | * | ||
2839 | * @param obj A valid Evas_Object handle | ||
2840 | * @param part The part name | ||
2841 | * @since 1.2.0 | ||
2842 | */ | ||
2843 | EAPI void edje_object_part_text_input_panel_show(const Evas_Object *obj, const char *part); | ||
2844 | |||
2845 | /** | ||
2846 | * @brief Hide the input panel (virtual keyboard). | ||
2847 | * @see edje_object_part_text_input_panel_show | ||
2848 | * | ||
2849 | * Note that input panel is shown or hidden automatically according to the focus state. | ||
2850 | * This API can be used in the case of manually controlling by using edje_object_part_text_input_panel_enabled_set. | ||
2851 | * | ||
2852 | * @param obj A valid Evas_Object handle | ||
2853 | * @param part The part name | ||
2854 | * @since 1.2.0 | ||
2855 | */ | ||
2856 | EAPI void edje_object_part_text_input_panel_hide(const Evas_Object *obj, const char *part); | ||
2857 | |||
2858 | /** | ||
2859 | * Set the language mode of the input panel. | ||
2860 | * | ||
2861 | * This API can be used if you want to show the Alphabet keyboard. | ||
2862 | * | ||
2863 | * @param obj A valid Evas_Object handle | ||
2864 | * @param part The part name | ||
2865 | * @param lang the language to be set to the input panel. | ||
2866 | * @since 1.2.0 | ||
2867 | */ | ||
2868 | EAPI void edje_object_part_text_input_panel_language_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Lang lang); | ||
2869 | |||
2870 | /** | ||
2871 | * Get the language mode of the input panel. | ||
2872 | * | ||
2873 | * See @ref edje_object_part_text_input_panel_language_set for more details. | ||
2874 | * | ||
2875 | * @param obj A valid Evas_Object handle | ||
2876 | * @param part The part name | ||
2877 | * @return input panel language type | ||
2878 | * @since 1.2.0 | ||
2879 | */ | ||
2880 | EAPI Edje_Input_Panel_Lang edje_object_part_text_input_panel_language_get(const Evas_Object *obj, const char *part); | ||
2881 | |||
2882 | /** | ||
2883 | * Set the input panel-specific data to deliver to the input panel. | ||
2884 | * | ||
2885 | * This API is used by applications to deliver specific data to the input panel. | ||
2886 | * The data format MUST be negotiated by both application and the input panel. | ||
2887 | * The size and format of data are defined by the input panel. | ||
2888 | * | ||
2889 | * @param obj A valid Evas_Object handle | ||
2890 | * @param part The part name | ||
2891 | * @param data The specific data to be set to the input panel. | ||
2892 | * @param len the length of data, in bytes, to send to the input panel | ||
2893 | * @since 1.2.0 | ||
2894 | */ | ||
2895 | EAPI void edje_object_part_text_input_panel_imdata_set(Evas_Object *obj, const char *part, const void *data, int len); | ||
2896 | |||
2897 | /** | ||
2898 | * Get the specific data of the current active input panel. | ||
2899 | * | ||
2900 | * @param obj A valid Evas_Object handle | ||
2901 | * @param part The part name | ||
2902 | * @param data The specific data to be got from the input panel | ||
2903 | * @param len The length of data | ||
2904 | * @since 1.2.0 | ||
2905 | */ | ||
2906 | EAPI void edje_object_part_text_input_panel_imdata_get(const Evas_Object *obj, const char *part, void *data, int *len); | ||
2907 | |||
2908 | /** | ||
2909 | * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel. | ||
2910 | * | ||
2911 | * An input panel displays the string or icon associated with this type | ||
2912 | * | ||
2913 | * @param obj A valid Evas_Object handle | ||
2914 | * @param part The part name | ||
2915 | * @param return_key_type The type of "return" key on the input panel | ||
2916 | * @since 1.2.0 | ||
2917 | */ | ||
2918 | EAPI void edje_object_part_text_input_panel_return_key_type_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Return_Key_Type return_key_type); | ||
2919 | |||
2920 | /** | ||
2921 | * Get the "return" key type. | ||
2922 | * | ||
2923 | * @see edje_object_part_text_input_panel_return_key_type_set() for more details | ||
2924 | * | ||
2925 | * @param obj A valid Evas_Object handle | ||
2926 | * @param part The part name | ||
2927 | * @return The type of "return" key on the input panel | ||
2928 | * @since 1.2.0 | ||
2929 | */ | ||
2930 | EAPI Edje_Input_Panel_Return_Key_Type edje_object_part_text_input_panel_return_key_type_get(const Evas_Object *obj, const char *part); | ||
2931 | |||
2932 | /** | ||
2933 | * Set the return key on the input panel to be disabled. | ||
2934 | * | ||
2935 | * @param obj A valid Evas_Object handle | ||
2936 | * @param part The part name | ||
2937 | * @param disabled The state | ||
2938 | * @since 1.2.0 | ||
2939 | */ | ||
2940 | EAPI void edje_object_part_text_input_panel_return_key_disabled_set(Evas_Object *obj, const char *part, Eina_Bool disabled); | ||
2941 | |||
2942 | /** | ||
2943 | * Get whether the return key on the input panel should be disabled or not. | ||
2944 | * | ||
2945 | * @param obj A valid Evas_Object handle | ||
2946 | * @param part The part name | ||
2947 | * @return EINA_TRUE if it should be disabled | ||
2948 | * @since 1.2.0 | ||
2949 | */ | ||
2950 | EAPI Eina_Bool edje_object_part_text_input_panel_return_key_disabled_get(const Evas_Object *obj, const char *part); | ||
2951 | |||
2952 | /** | ||
2885 | * Add a filter function for newly inserted text. | 2953 | * Add a filter function for newly inserted text. |
2886 | * | 2954 | * |
2887 | * Whenever text is inserted (not the same as set) into the given @p part, | 2955 | * Whenever text is inserted (not the same as set) into the given @p part, |
@@ -2897,8 +2965,20 @@ EAPI Eina_Bool edje_object_part_text_input_panel_enabled_get (const Evas_ | |||
2897 | * will make Edje break out of the filter cycle and reject the inserted | 2965 | * will make Edje break out of the filter cycle and reject the inserted |
2898 | * text. | 2966 | * text. |
2899 | * | 2967 | * |
2968 | * @warning This function will be deprecated because of difficulty in use. | ||
2969 | * The type(format, text, or markup) of text should be always | ||
2970 | * checked in the filter function for correct filtering. | ||
2971 | * Please use edje_object_text_markup_filter_callback_add() instead. There | ||
2972 | * is no need to check the type of text in the filter function | ||
2973 | * because the text is always markup. | ||
2974 | * @warning If you use this function with | ||
2975 | * edje_object_text_markup_filter_callback_add() together, all | ||
2976 | * Edje_Text_Filter_Cb functions and Edje_Markup_Filter_Cb functions | ||
2977 | * will be executed, and then filtered text will be inserted. | ||
2978 | * | ||
2900 | * @see edje_object_text_insert_filter_callback_del | 2979 | * @see edje_object_text_insert_filter_callback_del |
2901 | * @see edje_object_text_insert_filter_callback_del_full | 2980 | * @see edje_object_text_insert_filter_callback_del_full |
2981 | * @see edje_object_text_markup_filter_callback_add | ||
2902 | * | 2982 | * |
2903 | * @param obj A valid Evas_Object handle | 2983 | * @param obj A valid Evas_Object handle |
2904 | * @param part The part name | 2984 | * @param part The part name |
@@ -2920,7 +3000,7 @@ EAPI void edje_object_text_insert_filter_callback_add (Evas_Ob | |||
2920 | * @param part The part name | 3000 | * @param part The part name |
2921 | * @param func The function callback to remove | 3001 | * @param func The function callback to remove |
2922 | * | 3002 | * |
2923 | * @return The user data pointer if succesful, or NULL otherwise | 3003 | * @return The user data pointer if successful, or NULL otherwise |
2924 | */ | 3004 | */ |
2925 | EAPI void *edje_object_text_insert_filter_callback_del (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func); | 3005 | EAPI void *edje_object_text_insert_filter_callback_del (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func); |
2926 | 3006 | ||
@@ -2939,11 +3019,82 @@ EAPI void *edje_object_text_insert_filter_callback_del (Evas_Ob | |||
2939 | * @param func The function callback to remove | 3019 | * @param func The function callback to remove |
2940 | * @param data The data passed to the callback function | 3020 | * @param data The data passed to the callback function |
2941 | * | 3021 | * |
2942 | * @return The same data pointer if succesful, or NULL otherwise | 3022 | * @return The same data pointer if successful, or NULL otherwise |
2943 | */ | 3023 | */ |
2944 | EAPI void *edje_object_text_insert_filter_callback_del_full (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data); | 3024 | EAPI void *edje_object_text_insert_filter_callback_del_full (Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data); |
2945 | 3025 | ||
2946 | /** | 3026 | /** |
3027 | * Add a markup filter function for newly inserted text. | ||
3028 | * | ||
3029 | * Whenever text is inserted (not the same as set) into the given @p part, | ||
3030 | * the list of markup filter functions will be called to decide if and how | ||
3031 | * the new text will be accepted. | ||
3032 | * The text parameter in the @p func filter is always markup. It can be | ||
3033 | * modified by the user and it's up to him to free the one passed if he's to | ||
3034 | * change the pointer. If doing so, the newly set text should be malloc'ed, | ||
3035 | * as once all the filters are called Edje will free it. | ||
3036 | * If the text is to be rejected, freeing it and setting the pointer to NULL | ||
3037 | * will make Edje break out of the filter cycle and reject the inserted | ||
3038 | * text. | ||
3039 | * This function is different from edje_object_text_insert_filter_callback_add() | ||
3040 | * in that the text parameter in the @p fucn filter is always markup. | ||
3041 | * | ||
3042 | * @warning If you use this function with | ||
3043 | * edje_object_text_insert_filter_callback_add() togehter, all | ||
3044 | * Edje_Text_Filter_Cb functions and Edje_Markup_Filter_Cb functions | ||
3045 | * will be executed, and then filtered text will be inserted. | ||
3046 | * | ||
3047 | * @see edje_object_text_markup_filter_callback_del | ||
3048 | * @see edje_object_text_markup_filter_callback_del_full | ||
3049 | * @see edje_object_text_insert_filter_callback_add | ||
3050 | * | ||
3051 | * @param obj A valid Evas_Object handle | ||
3052 | * @param part The part name | ||
3053 | * @param func The callback function that will act as markup filter | ||
3054 | * @param data User provided data to pass to the filter function | ||
3055 | * @since 1.2.0 | ||
3056 | */ | ||
3057 | EAPI void edje_object_text_markup_filter_callback_add(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func, void *data); | ||
3058 | |||
3059 | /** | ||
3060 | * Delete a function from the markup filter list. | ||
3061 | * | ||
3062 | * Delete the given @p func filter from the list in @p part. Returns | ||
3063 | * the user data pointer given when added. | ||
3064 | * | ||
3065 | * @see edje_object_text_markup_filter_callback_add | ||
3066 | * @see edje_object_text_markup_filter_callback_del_full | ||
3067 | * | ||
3068 | * @param obj A valid Evas_Object handle | ||
3069 | * @param part The part name | ||
3070 | * @param func The function callback to remove | ||
3071 | * | ||
3072 | * @return The user data pointer if successful, or NULL otherwise | ||
3073 | * @since 1.2.0 | ||
3074 | */ | ||
3075 | EAPI void *edje_object_text_markup_filter_callback_del(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func); | ||
3076 | |||
3077 | /** | ||
3078 | * Delete a function and matching user data from the markup filter list. | ||
3079 | * | ||
3080 | * Delete the given @p func filter and @p data user data from the list | ||
3081 | * in @p part. | ||
3082 | * Returns the user data pointer given when added. | ||
3083 | * | ||
3084 | * @see edje_object_text_markup_filter_callback_add | ||
3085 | * @see edje_object_text_markup_filter_callback_del | ||
3086 | * | ||
3087 | * @param obj A valid Evas_Object handle | ||
3088 | * @param part The part name | ||
3089 | * @param func The function callback to remove | ||
3090 | * @param data The data passed to the callback function | ||
3091 | * | ||
3092 | * @return The same data pointer if successful, or NULL otherwise | ||
3093 | * @since 1.2.0 | ||
3094 | */ | ||
3095 | EAPI void *edje_object_text_markup_filter_callback_del_full(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func, void *data); | ||
3096 | |||
3097 | /** | ||
2947 | * @brief Swallows an object into the edje. | 3098 | * @brief Swallows an object into the edje. |
2948 | * | 3099 | * |
2949 | * @param obj A valid Evas_Object handle | 3100 | * @param obj A valid Evas_Object handle |
@@ -3244,7 +3395,7 @@ EAPI Eina_Bool edje_object_part_external_param_set (Evas_Ob | |||
3244 | * | 3395 | * |
3245 | * Parts of type external may carry extra properties that have | 3396 | * Parts of type external may carry extra properties that have |
3246 | * meanings defined by the external plugin. For instance, it may be a | 3397 | * meanings defined by the external plugin. For instance, it may be a |
3247 | * string that defines a button label. This property can be modifed by | 3398 | * string that defines a button label. This property can be modified by |
3248 | * state parameters, by explicit calls to | 3399 | * state parameters, by explicit calls to |
3249 | * edje_object_part_external_param_set() or getting the actual object | 3400 | * edje_object_part_external_param_set() or getting the actual object |
3250 | * with edje_object_part_external_object_get() and calling native | 3401 | * with edje_object_part_external_object_get() and calling native |
@@ -3850,8 +4001,8 @@ EAPI const Edje_External_Param_Info *edje_external_param_info_get (const char | |||
3850 | * This sets the parameters of the perspective transformation. X, Y and Z | 4001 | * This sets the parameters of the perspective transformation. X, Y and Z |
3851 | * values are used. The px and py points specify the "infinite distance" point | 4002 | * values are used. The px and py points specify the "infinite distance" point |
3852 | * in the 3D conversion (where all lines converge to like when artists draw | 4003 | * in the 3D conversion (where all lines converge to like when artists draw |
3853 | * 3D by hand). The @p z0 value specifis the z value at which there is a 1:1 | 4004 | * 3D by hand). The @p z0 value specifies the z value at which there is a 1:1 |
3854 | * mapping between spatial coorinates and screen coordinates. Any points | 4005 | * mapping between spatial coordinates and screen coordinates. Any points |
3855 | * on this z value will not have their X and Y values modified in the transform. | 4006 | * on this z value will not have their X and Y values modified in the transform. |
3856 | * Those further away (Z value higher) will shrink into the distance, and | 4007 | * Those further away (Z value higher) will shrink into the distance, and |
3857 | * those less than this value will expand and become bigger. The @p foc value | 4008 | * those less than this value will expand and become bigger. The @p foc value |
@@ -3861,8 +4012,8 @@ EAPI const Edje_External_Param_Info *edje_external_param_info_get (const char | |||
3861 | * control and @p foc must be greater than 0. | 4012 | * control and @p foc must be greater than 0. |
3862 | * | 4013 | * |
3863 | * @param m map to change. | 4014 | * @param m map to change. |
3864 | * @param px The pespective distance X coordinate | 4015 | * @param px The perspective distance X coordinate |
3865 | * @param py The pespective distance Y coordinate | 4016 | * @param py The perspective distance Y coordinate |
3866 | * @param z0 The "0" z plane value | 4017 | * @param z0 The "0" z plane value |
3867 | * @param foc The focal distance | 4018 | * @param foc The focal distance |
3868 | */ | 4019 | */ |
diff --git a/libraries/edje/src/lib/Makefile.in b/libraries/edje/src/lib/Makefile.in index e67d90c..cf73390 100644 --- a/libraries/edje/src/lib/Makefile.in +++ b/libraries/edje/src/lib/Makefile.in | |||
@@ -230,6 +230,8 @@ 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@ | ||
233 | PYTHON = @PYTHON@ | 235 | PYTHON = @PYTHON@ |
234 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 236 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
235 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 237 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
diff --git a/libraries/edje/src/lib/edje_cache.c b/libraries/edje/src/lib/edje_cache.c index 0ce6b30..02d16b5 100644 --- a/libraries/edje/src/lib/edje_cache.c +++ b/libraries/edje/src/lib/edje_cache.c | |||
@@ -76,12 +76,16 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) | |||
76 | edc->references = 1; | 76 | edc->references = 1; |
77 | edc->part = ce->entry; | 77 | edc->part = ce->entry; |
78 | 78 | ||
79 | /* For Edje file build with Edje 1.0, people expect text.align to be 0.0 0.0 */ | 79 | /* For Edje file build with Edje 1.0 */ |
80 | if (edf->version <= 3 && edf->minor <= 1) | 80 | if (edf->version <= 3 && edf->minor <= 1) |
81 | { | 81 | { |
82 | /* This will preserve previous rendering */ | 82 | /* This will preserve previous rendering */ |
83 | unsigned int i; | 83 | unsigned int i; |
84 | 84 | ||
85 | /* people expect signal to not be broadcasted */ | ||
86 | edc->broadcast_signal = EINA_FALSE; | ||
87 | |||
88 | /* people expect text.align to be 0.0 0.0 */ | ||
85 | for (i = 0; i < edc->parts_count; ++i) | 89 | for (i = 0; i < edc->parts_count; ++i) |
86 | { | 90 | { |
87 | if (edc->parts[i]->type == EDJE_PART_TYPE_TEXTBLOCK) | 91 | if (edc->parts[i]->type == EDJE_PART_TYPE_TEXTBLOCK) |
diff --git a/libraries/edje/src/lib/edje_calc.c b/libraries/edje/src/lib/edje_calc.c index 213e266..6aa6336 100644 --- a/libraries/edje/src/lib/edje_calc.c +++ b/libraries/edje/src/lib/edje_calc.c | |||
@@ -66,7 +66,7 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
66 | break; | 66 | break; |
67 | case EDJE_TWEEN_MODE_DECELERATE: | 67 | case EDJE_TWEEN_MODE_DECELERATE: |
68 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), | 68 | npos = FROM_DOUBLE(ecore_animator_pos_map(TO_DOUBLE(pos), |
69 | ECORE_POS_MAP_DECELERATE, | 69 | ECORE_POS_MAP_DECELERATE, |
70 | 0.0, 0.0)); | 70 | 0.0, 0.0)); |
71 | break; | 71 | break; |
72 | case EDJE_TWEEN_MODE_LINEAR: | 72 | case EDJE_TWEEN_MODE_LINEAR: |
@@ -110,7 +110,7 @@ _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T | |||
110 | npos = fp_pos; | 110 | npos = fp_pos; |
111 | break; | 111 | break; |
112 | } | 112 | } |
113 | #endif | 113 | #endif |
114 | if (npos == ep->description_pos) return; | 114 | if (npos == ep->description_pos) return; |
115 | 115 | ||
116 | ep->description_pos = npos; | 116 | ep->description_pos = npos; |
@@ -564,7 +564,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
564 | 564 | ||
565 | _edje_real_part_rel_to_apply(ed, ep, ep->param2); | 565 | _edje_real_part_rel_to_apply(ed, ep, ep->param2); |
566 | 566 | ||
567 | if (ep->description_pos != 0.0) | 567 | if (ep->description_pos > FROM_DOUBLE(0.0)) |
568 | ep->chosen_description = epd2; | 568 | ep->chosen_description = epd2; |
569 | } | 569 | } |
570 | 570 | ||
@@ -572,6 +572,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl | |||
572 | ep->part->type == EDJE_PART_TYPE_EXTERNAL) | 572 | ep->part->type == EDJE_PART_TYPE_EXTERNAL) |
573 | _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); | 573 | _edje_external_recalc_apply(ed, ep, NULL, chosen_desc); |
574 | 574 | ||
575 | ed->recalc_hints = 1; | ||
575 | ed->dirty = 1; | 576 | ed->dirty = 1; |
576 | ed->recalc_call = 1; | 577 | ed->recalc_call = 1; |
577 | #ifdef EDJE_CALC_CACHE | 578 | #ifdef EDJE_CALC_CACHE |
@@ -650,6 +651,16 @@ _edje_recalc_do(Edje *ed) | |||
650 | else | 651 | else |
651 | evas_object_smart_need_recalculate_set(ed->obj, need_calc); | 652 | evas_object_smart_need_recalculate_set(ed->obj, need_calc); |
652 | ed->recalc_call = 0; | 653 | ed->recalc_call = 0; |
654 | |||
655 | if (ed->update_hints && ed->recalc_hints && !ed->calc_only) | ||
656 | { | ||
657 | Evas_Coord w, h; | ||
658 | |||
659 | ed->recalc_hints = 0; | ||
660 | |||
661 | edje_object_size_min_calc(ed->obj, &w, &h); | ||
662 | evas_object_size_hint_min_set(ed->obj, w, h); | ||
663 | } | ||
653 | } | 664 | } |
654 | 665 | ||
655 | void | 666 | void |
@@ -1746,7 +1757,6 @@ _edje_part_recalc_single_min_max(FLOAT_T sc, | |||
1746 | } | 1757 | } |
1747 | } | 1758 | } |
1748 | 1759 | ||
1749 | |||
1750 | /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ | 1760 | /* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */ |
1751 | if ((ep->swallow_params.max.h <= 0) || | 1761 | if ((ep->swallow_params.max.h <= 0) || |
1752 | (ep->swallow_params.max.h == EDJE_INF_MAX_H)) | 1762 | (ep->swallow_params.max.h == EDJE_INF_MAX_H)) |
@@ -1810,9 +1820,9 @@ _edje_part_recalc_single_map(Edje *ed, | |||
1810 | } | 1820 | } |
1811 | params->map.center.z = 0; | 1821 | params->map.center.z = 0; |
1812 | 1822 | ||
1813 | params->map.rotation.x = TO_DOUBLE(desc->map.rot.x); | 1823 | params->map.rotation.x = desc->map.rot.x; |
1814 | params->map.rotation.y = TO_DOUBLE(desc->map.rot.y); | 1824 | params->map.rotation.y = desc->map.rot.y; |
1815 | params->map.rotation.z = TO_DOUBLE(desc->map.rot.z); | 1825 | params->map.rotation.z = desc->map.rot.z; |
1816 | 1826 | ||
1817 | if (light) | 1827 | if (light) |
1818 | { | 1828 | { |
@@ -1907,7 +1917,7 @@ _edje_part_recalc_single(Edje *ed, | |||
1907 | sc = ed->scale; | 1917 | sc = ed->scale; |
1908 | if (sc == ZERO) sc = _edje_scale; | 1918 | if (sc == ZERO) sc = _edje_scale; |
1909 | _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); | 1919 | _edje_part_recalc_single_min_max(sc, ep, desc, &minw, &minh, &maxw, &maxh); |
1910 | 1920 | ||
1911 | /* relative coords of top left & bottom right */ | 1921 | /* relative coords of top left & bottom right */ |
1912 | _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); | 1922 | _edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params); |
1913 | 1923 | ||
@@ -1959,6 +1969,29 @@ _edje_part_recalc_single(Edje *ed, | |||
1959 | if (lminh > minh) minh = lminh; | 1969 | if (lminh > minh) minh = lminh; |
1960 | } | 1970 | } |
1961 | } | 1971 | } |
1972 | else if ((ep->part->type == EDJE_PART_TYPE_IMAGE) && | ||
1973 | (chosen_desc->min.limit || chosen_desc->max.limit)) | ||
1974 | { | ||
1975 | Evas_Coord w, h; | ||
1976 | |||
1977 | /* We only need pos to find the right image that would be displayed */ | ||
1978 | /* Yes, if someone set aspect preference to SOURCE and also max,min | ||
1979 | to SOURCE, it will be under efficient, but who cares at the | ||
1980 | moment. */ | ||
1981 | _edje_real_part_image_set(ed, ep, pos); | ||
1982 | evas_object_image_size_get(ep->object, &w, &h); | ||
1983 | |||
1984 | if (chosen_desc->min.limit) | ||
1985 | { | ||
1986 | if (w > minw) minw = w; | ||
1987 | if (h > minh) minh = h; | ||
1988 | } | ||
1989 | if (chosen_desc->max.limit) | ||
1990 | { | ||
1991 | if ((maxw <= 0) || (w < maxw)) maxw = w; | ||
1992 | if ((maxh <= 0) || (h < maxh)) maxh = h; | ||
1993 | } | ||
1994 | } | ||
1962 | 1995 | ||
1963 | /* remember what our size is BEFORE we go limit it */ | 1996 | /* remember what our size is BEFORE we go limit it */ |
1964 | params->req.x = params->x; | 1997 | params->req.x = params->x; |
@@ -2259,6 +2292,23 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2259 | #endif | 2292 | #endif |
2260 | return; | 2293 | return; |
2261 | } | 2294 | } |
2295 | |||
2296 | if (ep->part->scale && | ||
2297 | ep->part->type == EDJE_PART_TYPE_GROUP && | ||
2298 | ep->swallowed_object) | ||
2299 | { | ||
2300 | edje_object_scale_set(ep->swallowed_object, TO_DOUBLE(ed->scale)); | ||
2301 | |||
2302 | if (ep->description_pos > FROM_DOUBLE(0.5) && ep->param2) | ||
2303 | { | ||
2304 | edje_object_update_hints_set(ep->swallowed_object, ep->param2->description->min.limit); | ||
2305 | } | ||
2306 | else | ||
2307 | { | ||
2308 | edje_object_update_hints_set(ep->swallowed_object, ep->param1.description->min.limit); | ||
2309 | } | ||
2310 | } | ||
2311 | |||
2262 | #ifdef EDJE_CALC_CACHE | 2312 | #ifdef EDJE_CALC_CACHE |
2263 | if (ep->state == ed->state && !state) | 2313 | if (ep->state == ed->state && !state) |
2264 | return ; | 2314 | return ; |
@@ -2426,7 +2476,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2426 | p1, pos); | 2476 | p1, pos); |
2427 | 2477 | ||
2428 | #ifdef EDJE_CALC_CACHE | 2478 | #ifdef EDJE_CALC_CACHE |
2429 | ep->param1.state = ed->state; | 2479 | if (flags == FLAG_XY) |
2480 | ep->param1.state = ed->state; | ||
2430 | #endif | 2481 | #endif |
2431 | } | 2482 | } |
2432 | } | 2483 | } |
@@ -2478,7 +2529,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2478 | confine_to, | 2529 | confine_to, |
2479 | p2, pos); | 2530 | p2, pos); |
2480 | #ifdef EDJE_CALC_CACHE | 2531 | #ifdef EDJE_CALC_CACHE |
2481 | ep->param2->state = ed->state; | 2532 | if (flags == FLAG_XY) |
2533 | ep->param2->state = ed->state; | ||
2482 | #endif | 2534 | #endif |
2483 | } | 2535 | } |
2484 | 2536 | ||
@@ -2806,7 +2858,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
2806 | } | 2858 | } |
2807 | 2859 | ||
2808 | evas_map_util_3d_rotate(map, | 2860 | evas_map_util_3d_rotate(map, |
2809 | pf->map.rotation.x, pf->map.rotation.y, pf->map.rotation.z, | 2861 | TO_DOUBLE(pf->map.rotation.x), TO_DOUBLE(pf->map.rotation.y), TO_DOUBLE(pf->map.rotation.z), |
2810 | pf->map.center.x, pf->map.center.y, pf->map.center.z); | 2862 | pf->map.center.x, pf->map.center.y, pf->map.center.z); |
2811 | 2863 | ||
2812 | // calculate light color & position etc. if there is one | 2864 | // calculate light color & position etc. if there is one |
diff --git a/libraries/edje/src/lib/edje_data.c b/libraries/edje/src/lib/edje_data.c index 32b17b6..46fd521 100644 --- a/libraries/edje/src/lib/edje_data.c +++ b/libraries/edje/src/lib/edje_data.c | |||
@@ -456,8 +456,10 @@ _edje_edd_init(void) | |||
456 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.h", minmul.h, EDJE_T_FLOAT); \ | 456 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "minmul.h", minmul.h, EDJE_T_FLOAT); \ |
457 | 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); \ |
458 | 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); \ |
459 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.limit", min.limit, EET_T_UCHAR); \ | ||
459 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.w", max.w, EET_T_INT); \ | 460 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.w", max.w, EET_T_INT); \ |
460 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.h", max.h, EET_T_INT); \ | 461 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.h", max.h, EET_T_INT); \ |
462 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.limit", max.limit, EET_T_UCHAR); \ | ||
461 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.x", step.x, EET_T_INT); \ | 463 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.x", step.x, EET_T_INT); \ |
462 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.y", step.y, EET_T_INT); \ | 464 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.y", step.y, EET_T_INT); \ |
463 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "aspect.min", aspect.min, EDJE_T_FLOAT); \ | 465 | EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "aspect.min", aspect.min, EDJE_T_FLOAT); \ |
@@ -877,4 +879,5 @@ _edje_edd_init(void) | |||
877 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR); | 879 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR); |
878 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR); | 880 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR); |
879 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.orientation", prop.orientation, EET_T_INT); | 881 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.orientation", prop.orientation, EET_T_INT); |
882 | EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "broadcast_signal", broadcast_signal, EET_T_UCHAR); | ||
880 | } | 883 | } |
diff --git a/libraries/edje/src/lib/edje_entry.c b/libraries/edje/src/lib/edje_entry.c index 563497d..f94883f 100644 --- a/libraries/edje/src/lib/edje_entry.c +++ b/libraries/edje/src/lib/edje_entry.c | |||
@@ -12,7 +12,6 @@ typedef struct _Sel Sel; | |||
12 | typedef struct _Anchor Anchor; | 12 | typedef struct _Anchor Anchor; |
13 | 13 | ||
14 | static void _edje_entry_imf_cursor_info_set(Entry *en); | 14 | static void _edje_entry_imf_cursor_info_set(Entry *en); |
15 | static void _edje_entry_imf_context_reset(Entry *en); | ||
16 | 15 | ||
17 | struct _Entry | 16 | struct _Entry |
18 | { | 17 | { |
@@ -29,12 +28,15 @@ struct _Entry | |||
29 | Eina_List *anchorlist; | 28 | Eina_List *anchorlist; |
30 | Eina_List *itemlist; | 29 | Eina_List *itemlist; |
31 | char *selection; | 30 | char *selection; |
31 | Edje_Input_Panel_Lang input_panel_lang; | ||
32 | Eina_Bool selecting : 1; | 32 | Eina_Bool selecting : 1; |
33 | Eina_Bool have_selection : 1; | 33 | Eina_Bool have_selection : 1; |
34 | Eina_Bool select_allow : 1; | 34 | Eina_Bool select_allow : 1; |
35 | Eina_Bool select_mod_start : 1; | 35 | Eina_Bool select_mod_start : 1; |
36 | Eina_Bool select_mod_end : 1; | 36 | Eina_Bool select_mod_end : 1; |
37 | Eina_Bool had_sel : 1; | 37 | Eina_Bool had_sel : 1; |
38 | Eina_Bool input_panel_enable : 1; | ||
39 | Eina_Bool prediction_allow : 1; | ||
38 | 40 | ||
39 | #ifdef HAVE_ECORE_IMF | 41 | #ifdef HAVE_ECORE_IMF |
40 | Eina_Bool have_preedit : 1; | 42 | Eina_Bool have_preedit : 1; |
@@ -179,6 +181,27 @@ _edje_focus_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, | |||
179 | } | 181 | } |
180 | 182 | ||
181 | static void | 183 | static void |
184 | _text_filter_markup_prepend_internal(Entry *en, Evas_Textblock_Cursor *c, char *text) | ||
185 | { | ||
186 | Edje_Markup_Filter_Callback *cb; | ||
187 | Eina_List *l; | ||
188 | |||
189 | EINA_LIST_FOREACH(en->rp->edje->markup_filter_callbacks, l, cb) | ||
190 | { | ||
191 | if (!strcmp(cb->part, en->rp->part->name)) | ||
192 | { | ||
193 | cb->func(cb->data, en->rp->edje->obj, cb->part, &text); | ||
194 | if (!text) break; | ||
195 | } | ||
196 | } | ||
197 | if (text) | ||
198 | { | ||
199 | evas_object_textblock_text_markup_prepend(c, text); | ||
200 | free(text); | ||
201 | } | ||
202 | } | ||
203 | |||
204 | static void | ||
182 | _text_filter_text_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *text) | 205 | _text_filter_text_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *text) |
183 | { | 206 | { |
184 | char *text2; | 207 | char *text2; |
@@ -196,8 +219,11 @@ _text_filter_text_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *text) | |||
196 | } | 219 | } |
197 | if (text2) | 220 | if (text2) |
198 | { | 221 | { |
199 | evas_textblock_cursor_text_prepend(c, text2); | 222 | char *markup_text; |
223 | markup_text = evas_textblock_text_utf8_to_markup(NULL, text2); | ||
200 | free(text2); | 224 | free(text2); |
225 | if (markup_text) | ||
226 | _text_filter_markup_prepend_internal(en, c, markup_text); | ||
201 | } | 227 | } |
202 | } | 228 | } |
203 | 229 | ||
@@ -219,8 +245,61 @@ _text_filter_format_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *tex | |||
219 | } | 245 | } |
220 | if (text2) | 246 | if (text2) |
221 | { | 247 | { |
222 | evas_textblock_cursor_format_prepend(c, text2); | 248 | char *s, *markup_text; |
249 | |||
250 | s = text2; | ||
251 | if (*s == '+') | ||
252 | { | ||
253 | s++; | ||
254 | while (*s == ' ') s++; | ||
255 | if (!s) | ||
256 | { | ||
257 | free(text2); | ||
258 | return; | ||
259 | } | ||
260 | markup_text = (char*) malloc(strlen(s) + 3); | ||
261 | if (markup_text) | ||
262 | { | ||
263 | *(markup_text) = '<'; | ||
264 | strncpy((markup_text + 1), s, strlen(s)); | ||
265 | *(markup_text + strlen(s) + 1) = '>'; | ||
266 | *(markup_text + strlen(s) + 2) = '\0'; | ||
267 | } | ||
268 | } | ||
269 | else if (s[0] == '-') | ||
270 | { | ||
271 | s++; | ||
272 | while (*s == ' ') s++; | ||
273 | if (!s) | ||
274 | { | ||
275 | free(text2); | ||
276 | return; | ||
277 | } | ||
278 | markup_text = (char*) malloc(strlen(s) + 4); | ||
279 | if (markup_text) | ||
280 | { | ||
281 | *(markup_text) = '<'; | ||
282 | *(markup_text + 1) = '/'; | ||
283 | strncpy((markup_text + 2), s, strlen(s)); | ||
284 | *(markup_text + strlen(s) + 2) = '>'; | ||
285 | *(markup_text + strlen(s) + 3) = '\0'; | ||
286 | } | ||
287 | } | ||
288 | else | ||
289 | { | ||
290 | markup_text = (char*) malloc(strlen(s) + 4); | ||
291 | if (markup_text) | ||
292 | { | ||
293 | *(markup_text) = '<'; | ||
294 | strncpy((markup_text + 1), s, strlen(s)); | ||
295 | *(markup_text + strlen(s) + 1) = '/'; | ||
296 | *(markup_text + strlen(s) + 2) = '>'; | ||
297 | *(markup_text + strlen(s) + 3) = '\0'; | ||
298 | } | ||
299 | } | ||
223 | free(text2); | 300 | free(text2); |
301 | if (markup_text) | ||
302 | _text_filter_markup_prepend_internal(en, c, markup_text); | ||
224 | } | 303 | } |
225 | } | 304 | } |
226 | 305 | ||
@@ -241,10 +320,7 @@ _text_filter_markup_prepend(Entry *en, Evas_Textblock_Cursor *c, const char *tex | |||
241 | } | 320 | } |
242 | } | 321 | } |
243 | if (text2) | 322 | if (text2) |
244 | { | 323 | _text_filter_markup_prepend_internal(en, c, text2); |
245 | evas_object_textblock_text_markup_prepend(c, text2); | ||
246 | free(text2); | ||
247 | } | ||
248 | } | 324 | } |
249 | 325 | ||
250 | static void | 326 | static void |
@@ -397,7 +473,7 @@ static void | |||
397 | _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | 473 | _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) |
398 | { | 474 | { |
399 | if (!en->sel_end) return; | 475 | if (!en->sel_end) return; |
400 | _edje_entry_imf_context_reset(en); | 476 | _edje_entry_imf_context_reset(en->rp); |
401 | _sel_enable(c, o, en); | 477 | _sel_enable(c, o, en); |
402 | if (!evas_textblock_cursor_compare(c, en->sel_end)) return; | 478 | if (!evas_textblock_cursor_compare(c, en->sel_end)) return; |
403 | evas_textblock_cursor_copy(c, en->sel_end); | 479 | evas_textblock_cursor_copy(c, en->sel_end); |
@@ -413,7 +489,7 @@ static void | |||
413 | _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | 489 | _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) |
414 | { | 490 | { |
415 | if (!en->sel_end) return; | 491 | if (!en->sel_end) return; |
416 | _edje_entry_imf_context_reset(en); | 492 | _edje_entry_imf_context_reset(en->rp); |
417 | _sel_enable(c, o, en); | 493 | _sel_enable(c, o, en); |
418 | if (!evas_textblock_cursor_compare(c, en->sel_start)) return; | 494 | if (!evas_textblock_cursor_compare(c, en->sel_start)) return; |
419 | evas_textblock_cursor_copy(c, en->sel_start); | 495 | evas_textblock_cursor_copy(c, en->sel_start); |
@@ -882,7 +958,7 @@ _anchors_get(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | |||
882 | char *p; | 958 | char *p; |
883 | an = calloc(1, sizeof(Anchor)); | 959 | an = calloc(1, sizeof(Anchor)); |
884 | if (!an) | 960 | if (!an) |
885 | break; | 961 | break; |
886 | 962 | ||
887 | an->en = en; | 963 | an->en = en; |
888 | p = strstr(s, "href="); | 964 | p = strstr(s, "href="); |
@@ -903,7 +979,7 @@ _anchors_get(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | |||
903 | { | 979 | { |
904 | s = evas_textblock_node_format_text_get(node); | 980 | s = evas_textblock_node_format_text_get(node); |
905 | if ((!strcmp(s, "- a")) || (!strcmp(s, "-a"))) | 981 | if ((!strcmp(s, "- a")) || (!strcmp(s, "-a"))) |
906 | break; | 982 | break; |
907 | } | 983 | } |
908 | 984 | ||
909 | if (node) | 985 | if (node) |
@@ -932,7 +1008,7 @@ _anchors_get(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) | |||
932 | char *p; | 1008 | char *p; |
933 | an = calloc(1, sizeof(Anchor)); | 1009 | an = calloc(1, sizeof(Anchor)); |
934 | if (!an) | 1010 | if (!an) |
935 | break; | 1011 | break; |
936 | 1012 | ||
937 | an->en = en; | 1013 | an->en = en; |
938 | an->item = 1; | 1014 | an->item = 1; |
@@ -986,12 +1062,14 @@ _range_del_emit(Edje *ed, Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __ | |||
986 | _edje_emit(ed, "entry,changed", en->rp->part->name); | 1062 | _edje_emit(ed, "entry,changed", en->rp->part->name); |
987 | _edje_emit_full(ed, "entry,changed,user", en->rp->part->name, info, | 1063 | _edje_emit_full(ed, "entry,changed,user", en->rp->part->name, info, |
988 | _free_entry_change_info); | 1064 | _free_entry_change_info); |
1065 | _sel_clear(en->cursor, en->rp->object, en); | ||
989 | } | 1066 | } |
990 | 1067 | ||
991 | static void | 1068 | static void |
992 | _range_del(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __UNUSED__, Entry *en) | 1069 | _range_del(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __UNUSED__, Entry *en) |
993 | { | 1070 | { |
994 | evas_textblock_cursor_range_delete(en->sel_start, en->sel_end); | 1071 | evas_textblock_cursor_range_delete(en->sel_start, en->sel_end); |
1072 | _sel_clear(en->cursor, en->rp->object, en); | ||
995 | } | 1073 | } |
996 | 1074 | ||
997 | static void | 1075 | static void |
@@ -1041,7 +1119,7 @@ _edje_entry_hide_visible_password(Edje_Real_Part *rp) | |||
1041 | if (!strcmp(text, "+ password=off")) | 1119 | if (!strcmp(text, "+ password=off")) |
1042 | { | 1120 | { |
1043 | evas_textblock_node_format_remove_pair(rp->object, | 1121 | evas_textblock_node_format_remove_pair(rp->object, |
1044 | (Evas_Object_Textblock_Node_Format *) node); | 1122 | (Evas_Object_Textblock_Node_Format *) node); |
1045 | break; | 1123 | break; |
1046 | } | 1124 | } |
1047 | } | 1125 | } |
@@ -1075,7 +1153,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1075 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || | 1153 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || |
1076 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE)) | 1154 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE)) |
1077 | return; | 1155 | return; |
1078 | if (!ev->key) return; | 1156 | if (!ev->keyname) return; |
1079 | 1157 | ||
1080 | #ifdef HAVE_ECORE_IMF | 1158 | #ifdef HAVE_ECORE_IMF |
1081 | if (en->imf_context) | 1159 | if (en->imf_context) |
@@ -1089,9 +1167,9 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1089 | } | 1167 | } |
1090 | #endif | 1168 | #endif |
1091 | 1169 | ||
1092 | if ((!strcmp(ev->key, "Escape")) || | 1170 | if ((!strcmp(ev->keyname, "Escape")) || |
1093 | (!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter"))) | 1171 | (!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "KP_Enter"))) |
1094 | _edje_entry_imf_context_reset(en); | 1172 | _edje_entry_imf_context_reset(rp); |
1095 | 1173 | ||
1096 | old_cur_pos = evas_textblock_cursor_pos_get(en->cursor); | 1174 | old_cur_pos = evas_textblock_cursor_pos_get(en->cursor); |
1097 | 1175 | ||
@@ -1100,13 +1178,13 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1100 | shift = evas_key_modifier_is_set(ev->modifiers, "Shift"); | 1178 | shift = evas_key_modifier_is_set(ev->modifiers, "Shift"); |
1101 | multiline = rp->part->multiline; | 1179 | multiline = rp->part->multiline; |
1102 | cursor_changed = EINA_FALSE; | 1180 | cursor_changed = EINA_FALSE; |
1103 | if (!strcmp(ev->key, "Escape")) | 1181 | if (!strcmp(ev->keyname, "Escape")) |
1104 | { | 1182 | { |
1105 | // dead keys here. Escape for now (should emit these) | 1183 | // dead keys here. Escape for now (should emit these) |
1106 | _edje_emit(ed, "entry,key,escape", rp->part->name); | 1184 | _edje_emit(ed, "entry,key,escape", rp->part->name); |
1107 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1185 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1108 | } | 1186 | } |
1109 | else if (!strcmp(ev->key, "Up") || !strcmp(ev->key, "KP_Up")) | 1187 | else if (!strcmp(ev->keyname, "Up") || !strcmp(ev->keyname, "KP_Up")) |
1110 | { | 1188 | { |
1111 | if (multiline) | 1189 | if (multiline) |
1112 | { | 1190 | { |
@@ -1119,14 +1197,14 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1119 | if (en->select_allow) | 1197 | if (en->select_allow) |
1120 | { | 1198 | { |
1121 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1199 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1200 | else _sel_clear(en->cursor, rp->object, en); | ||
1122 | } | 1201 | } |
1123 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1202 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1124 | } | 1203 | } |
1125 | _sel_clear(en->cursor, rp->object, en); | ||
1126 | _edje_emit(ed, "entry,key,up", rp->part->name); | 1204 | _edje_emit(ed, "entry,key,up", rp->part->name); |
1127 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1205 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1128 | } | 1206 | } |
1129 | else if (!strcmp(ev->key, "Down") || !strcmp(ev->key, "KP_Down")) | 1207 | else if (!strcmp(ev->keyname, "Down") || !strcmp(ev->keyname, "KP_Down")) |
1130 | { | 1208 | { |
1131 | if (multiline) | 1209 | if (multiline) |
1132 | { | 1210 | { |
@@ -1139,14 +1217,14 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1139 | if (en->select_allow) | 1217 | if (en->select_allow) |
1140 | { | 1218 | { |
1141 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1219 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1220 | else _sel_clear(en->cursor, rp->object, en); | ||
1142 | } | 1221 | } |
1143 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1222 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1144 | } | 1223 | } |
1145 | _sel_clear(en->cursor, rp->object, en); | ||
1146 | _edje_emit(ed, "entry,key,down", rp->part->name); | 1224 | _edje_emit(ed, "entry,key,down", rp->part->name); |
1147 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1225 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1148 | } | 1226 | } |
1149 | else if (!strcmp(ev->key, "Left") || !strcmp(ev->key, "KP_Left")) | 1227 | else if (!strcmp(ev->keyname, "Left") || !strcmp(ev->keyname, "KP_Left")) |
1150 | { | 1228 | { |
1151 | if (en->select_allow) | 1229 | if (en->select_allow) |
1152 | { | 1230 | { |
@@ -1159,13 +1237,13 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1159 | if (en->select_allow) | 1237 | if (en->select_allow) |
1160 | { | 1238 | { |
1161 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1239 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1240 | else _sel_clear(en->cursor, rp->object, en); | ||
1162 | } | 1241 | } |
1163 | _sel_clear(en->cursor, rp->object, en); | ||
1164 | _edje_emit(ed, "entry,key,left", rp->part->name); | 1242 | _edje_emit(ed, "entry,key,left", rp->part->name); |
1165 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1243 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1166 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1244 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1167 | } | 1245 | } |
1168 | else if (!strcmp(ev->key, "Right") || !strcmp(ev->key, "KP_Right")) | 1246 | else if (!strcmp(ev->keyname, "Right") || !strcmp(ev->keyname, "KP_Right")) |
1169 | { | 1247 | { |
1170 | if (en->select_allow) | 1248 | if (en->select_allow) |
1171 | { | 1249 | { |
@@ -1178,13 +1256,13 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1178 | if (en->select_allow) | 1256 | if (en->select_allow) |
1179 | { | 1257 | { |
1180 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1258 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1259 | else _sel_clear(en->cursor, rp->object, en); | ||
1181 | } | 1260 | } |
1182 | _sel_clear(en->cursor, rp->object, en); | ||
1183 | _edje_emit(ed, "entry,key,right", rp->part->name); | 1261 | _edje_emit(ed, "entry,key,right", rp->part->name); |
1184 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1262 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1185 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1263 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1186 | } | 1264 | } |
1187 | else if (!strcmp(ev->key, "BackSpace")) | 1265 | else if (!strcmp(ev->keyname, "BackSpace")) |
1188 | { | 1266 | { |
1189 | if (control && !en->have_selection) | 1267 | if (control && !en->have_selection) |
1190 | { | 1268 | { |
@@ -1221,7 +1299,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1221 | _edje_emit(ed, "entry,key,backspace", rp->part->name); | 1299 | _edje_emit(ed, "entry,key,backspace", rp->part->name); |
1222 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1300 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1223 | } | 1301 | } |
1224 | else if (!strcmp(ev->key, "Delete") || !strcmp(ev->key, "KP_Delete")) | 1302 | else if (!strcmp(ev->keyname, "Delete") || !strcmp(ev->keyname, "KP_Delete")) |
1225 | { | 1303 | { |
1226 | if (control) | 1304 | if (control) |
1227 | { | 1305 | { |
@@ -1255,7 +1333,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1255 | _edje_emit(ed, "entry,key,delete", rp->part->name); | 1333 | _edje_emit(ed, "entry,key,delete", rp->part->name); |
1256 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1334 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1257 | } | 1335 | } |
1258 | else if (!strcmp(ev->key, "Home") || !strcmp(ev->key, "KP_Home")) | 1336 | else if (!strcmp(ev->keyname, "Home") || !strcmp(ev->keyname, "KP_Home")) |
1259 | { | 1337 | { |
1260 | if (en->select_allow) | 1338 | if (en->select_allow) |
1261 | { | 1339 | { |
@@ -1273,7 +1351,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1273 | _edje_emit(ed, "entry,key,home", rp->part->name); | 1351 | _edje_emit(ed, "entry,key,home", rp->part->name); |
1274 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1352 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1275 | } | 1353 | } |
1276 | else if (!strcmp(ev->key, "End") || !strcmp(ev->key, "KP_End")) | 1354 | else if (!strcmp(ev->keyname, "End") || !strcmp(ev->keyname, "KP_End")) |
1277 | { | 1355 | { |
1278 | if (en->select_allow) | 1356 | if (en->select_allow) |
1279 | { | 1357 | { |
@@ -1291,33 +1369,36 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1291 | _edje_emit(ed, "entry,key,end", rp->part->name); | 1369 | _edje_emit(ed, "entry,key,end", rp->part->name); |
1292 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1370 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1293 | } | 1371 | } |
1294 | else if ((control) && (!strcmp(ev->key, "v"))) | 1372 | else if ((control) && (!shift) && (!strcmp(ev->keyname, "v"))) |
1295 | { | 1373 | { |
1296 | _edje_emit(ed, "entry,paste,request", rp->part->name); | 1374 | _edje_emit(ed, "entry,paste,request", rp->part->name); |
1297 | _edje_emit(ed, "entry,paste,request,3", rp->part->name); | 1375 | _edje_emit(ed, "entry,paste,request,3", rp->part->name); |
1298 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1376 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1299 | } | 1377 | } |
1300 | else if ((control) && (!strcmp(ev->key, "a"))) | 1378 | else if ((control) && (!strcmp(ev->keyname, "a"))) |
1301 | { | 1379 | { |
1302 | _edje_emit(ed, "entry,selection,all,request", rp->part->name); | 1380 | if (shift) |
1303 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1381 | { |
1304 | } | 1382 | _edje_emit(ed, "entry,selection,none,request", rp->part->name); |
1305 | else if ((control) && (!strcmp(ev->key, "A"))) | 1383 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1306 | { | 1384 | } |
1307 | _edje_emit(ed, "entry,selection,none,request", rp->part->name); | 1385 | else |
1308 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1386 | { |
1387 | _edje_emit(ed, "entry,selection,all,request", rp->part->name); | ||
1388 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | ||
1389 | } | ||
1309 | } | 1390 | } |
1310 | else if ((control) && ((!strcmp(ev->key, "c") || (!strcmp(ev->key, "Insert"))))) | 1391 | else if ((control) && (((!shift) && !strcmp(ev->keyname, "c")) || !strcmp(ev->keyname, "Insert"))) |
1311 | { | 1392 | { |
1312 | _edje_emit(ed, "entry,copy,notify", rp->part->name); | 1393 | _edje_emit(ed, "entry,copy,notify", rp->part->name); |
1313 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1394 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1314 | } | 1395 | } |
1315 | else if ((control) && ((!strcmp(ev->key, "x") || (!strcmp(ev->key, "m"))))) | 1396 | else if ((control) && (!shift) && ((!strcmp(ev->keyname, "x") || (!strcmp(ev->keyname, "m"))))) |
1316 | { | 1397 | { |
1317 | _edje_emit(ed, "entry,cut,notify", rp->part->name); | 1398 | _edje_emit(ed, "entry,cut,notify", rp->part->name); |
1318 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1399 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1319 | } | 1400 | } |
1320 | else if ((control) && (!strcmp(ev->key, "z"))) | 1401 | else if ((control) && (!strcmp(ev->keyname, "z"))) |
1321 | { | 1402 | { |
1322 | if (shift) | 1403 | if (shift) |
1323 | { | 1404 | { |
@@ -1331,19 +1412,19 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1331 | } | 1412 | } |
1332 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1413 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1333 | } | 1414 | } |
1334 | else if ((control) && (!strcmp(ev->key, "y"))) | 1415 | else if ((control) && (!shift) && (!strcmp(ev->keyname, "y"))) |
1335 | { | 1416 | { |
1336 | // redo | 1417 | // redo |
1337 | _edje_emit(ed, "entry,redo,request", rp->part->name); | 1418 | _edje_emit(ed, "entry,redo,request", rp->part->name); |
1338 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1419 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1339 | } | 1420 | } |
1340 | else if ((control) && (!strcmp(ev->key, "w"))) | 1421 | else if ((control) && (!shift) && (!strcmp(ev->keyname, "w"))) |
1341 | { | 1422 | { |
1342 | _sel_clear(en->cursor, rp->object, en); | 1423 | _sel_clear(en->cursor, rp->object, en); |
1343 | // select current word? | 1424 | // select current word? |
1344 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1425 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1345 | } | 1426 | } |
1346 | else if (!strcmp(ev->key, "Tab")) | 1427 | else if (!strcmp(ev->keyname, "Tab")) |
1347 | { | 1428 | { |
1348 | if (multiline) | 1429 | if (multiline) |
1349 | { | 1430 | { |
@@ -1362,7 +1443,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1362 | _range_del_emit(ed, en->cursor, rp->object, en); | 1443 | _range_del_emit(ed, en->cursor, rp->object, en); |
1363 | info->merge = EINA_TRUE; | 1444 | info->merge = EINA_TRUE; |
1364 | } | 1445 | } |
1365 | _sel_clear(en->cursor, rp->object, en); | ||
1366 | info->change.insert.pos = | 1446 | info->change.insert.pos = |
1367 | evas_textblock_cursor_pos_get(en->cursor); | 1447 | evas_textblock_cursor_pos_get(en->cursor); |
1368 | info->change.insert.content = eina_stringshare_add("<tab/>"); | 1448 | info->change.insert.content = eina_stringshare_add("<tab/>"); |
@@ -1378,12 +1458,12 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1378 | } | 1458 | } |
1379 | _edje_emit(ed, "entry,key,tab", rp->part->name); | 1459 | _edje_emit(ed, "entry,key,tab", rp->part->name); |
1380 | } | 1460 | } |
1381 | else if ((!strcmp(ev->key, "ISO_Left_Tab")) && (multiline)) | 1461 | else if ((!strcmp(ev->keyname, "ISO_Left_Tab")) && (multiline)) |
1382 | { | 1462 | { |
1383 | // remove a tab | 1463 | // remove a tab |
1384 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1464 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1385 | } | 1465 | } |
1386 | else if (!strcmp(ev->key, "Prior") || !strcmp(ev->key, "KP_Prior")) | 1466 | else if (!strcmp(ev->keyname, "Prior") || !strcmp(ev->keyname, "KP_Prior")) |
1387 | { | 1467 | { |
1388 | if (en->select_allow) | 1468 | if (en->select_allow) |
1389 | { | 1469 | { |
@@ -1394,12 +1474,12 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1394 | if (en->select_allow) | 1474 | if (en->select_allow) |
1395 | { | 1475 | { |
1396 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1476 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1477 | else _sel_clear(en->cursor, rp->object, en); | ||
1397 | } | 1478 | } |
1398 | _sel_clear(en->cursor, rp->object, en); | ||
1399 | _edje_emit(ed, "entry,key,pgup", rp->part->name); | 1479 | _edje_emit(ed, "entry,key,pgup", rp->part->name); |
1400 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1480 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1401 | } | 1481 | } |
1402 | else if (!strcmp(ev->key, "Next") || !strcmp(ev->key, "KP_Next")) | 1482 | else if (!strcmp(ev->keyname, "Next") || !strcmp(ev->keyname, "KP_Next")) |
1403 | { | 1483 | { |
1404 | if (en->select_allow) | 1484 | if (en->select_allow) |
1405 | { | 1485 | { |
@@ -1410,12 +1490,12 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1410 | if (en->select_allow) | 1490 | if (en->select_allow) |
1411 | { | 1491 | { |
1412 | if (shift) _sel_extend(en->cursor, rp->object, en); | 1492 | if (shift) _sel_extend(en->cursor, rp->object, en); |
1493 | else _sel_clear(en->cursor, rp->object, en); | ||
1413 | } | 1494 | } |
1414 | _sel_clear(en->cursor, rp->object, en); | ||
1415 | _edje_emit(ed, "entry,key,pgdn", rp->part->name); | 1495 | _edje_emit(ed, "entry,key,pgdn", rp->part->name); |
1416 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; | 1496 | ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; |
1417 | } | 1497 | } |
1418 | else if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter"))) | 1498 | else if ((!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "KP_Enter"))) |
1419 | { | 1499 | { |
1420 | if (multiline) | 1500 | if (multiline) |
1421 | { | 1501 | { |
@@ -1427,7 +1507,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1427 | _range_del_emit(ed, en->cursor, rp->object, en); | 1507 | _range_del_emit(ed, en->cursor, rp->object, en); |
1428 | info->merge = EINA_TRUE; | 1508 | info->merge = EINA_TRUE; |
1429 | } | 1509 | } |
1430 | _sel_clear(en->cursor, rp->object, en); | ||
1431 | 1510 | ||
1432 | info->change.insert.pos = | 1511 | info->change.insert.pos = |
1433 | evas_textblock_cursor_pos_get(en->cursor); | 1512 | evas_textblock_cursor_pos_get(en->cursor); |
@@ -1470,7 +1549,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v | |||
1470 | _range_del_emit(ed, en->cursor, rp->object, en); | 1549 | _range_del_emit(ed, en->cursor, rp->object, en); |
1471 | info->merge = EINA_TRUE; | 1550 | info->merge = EINA_TRUE; |
1472 | } | 1551 | } |
1473 | _sel_clear(en->cursor, rp->object, en); | ||
1474 | 1552 | ||
1475 | info->change.insert.pos = | 1553 | info->change.insert.pos = |
1476 | evas_textblock_cursor_pos_get(en->cursor); | 1554 | evas_textblock_cursor_pos_get(en->cursor); |
@@ -1580,7 +1658,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1580 | } | 1658 | } |
1581 | #endif | 1659 | #endif |
1582 | 1660 | ||
1583 | _edje_entry_imf_context_reset(en); | 1661 | _edje_entry_imf_context_reset(rp); |
1584 | 1662 | ||
1585 | en->select_mod_start = EINA_FALSE; | 1663 | en->select_mod_start = EINA_FALSE; |
1586 | en->select_mod_end = EINA_FALSE; | 1664 | en->select_mod_end = EINA_FALSE; |
@@ -1593,8 +1671,35 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1593 | if (ev->button == 2) dosel = EINA_FALSE; | 1671 | if (ev->button == 2) dosel = EINA_FALSE; |
1594 | if (dosel) | 1672 | if (dosel) |
1595 | { | 1673 | { |
1596 | // double click -> select word | 1674 | if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK) |
1597 | // triple click -> select line | 1675 | { |
1676 | en->have_selection = EINA_FALSE; | ||
1677 | en->selecting = EINA_FALSE; | ||
1678 | _sel_clear(en->cursor, rp->object, en); | ||
1679 | tc = evas_object_textblock_cursor_new(rp->object); | ||
1680 | evas_textblock_cursor_copy(en->cursor, tc); | ||
1681 | evas_textblock_cursor_line_char_first(en->cursor); | ||
1682 | _sel_start(en->cursor, rp->object, en); | ||
1683 | evas_textblock_cursor_line_char_last(en->cursor); | ||
1684 | _sel_extend(en->cursor, rp->object, en); | ||
1685 | |||
1686 | goto end; | ||
1687 | } | ||
1688 | else if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) | ||
1689 | { | ||
1690 | en->have_selection = EINA_FALSE; | ||
1691 | en->selecting = EINA_FALSE; | ||
1692 | _sel_clear(en->cursor, rp->object, en); | ||
1693 | tc = evas_object_textblock_cursor_new(rp->object); | ||
1694 | evas_textblock_cursor_copy(en->cursor, tc); | ||
1695 | evas_textblock_cursor_word_start(en->cursor); | ||
1696 | _sel_start(en->cursor, rp->object, en); | ||
1697 | evas_textblock_cursor_word_end(en->cursor); | ||
1698 | evas_textblock_cursor_char_next(en->cursor); | ||
1699 | _sel_extend(en->cursor, rp->object, en); | ||
1700 | |||
1701 | goto end; | ||
1702 | } | ||
1598 | } | 1703 | } |
1599 | tc = evas_object_textblock_cursor_new(rp->object); | 1704 | tc = evas_object_textblock_cursor_new(rp->object); |
1600 | evas_textblock_cursor_copy(en->cursor, tc); | 1705 | evas_textblock_cursor_copy(en->cursor, tc); |
@@ -1695,13 +1800,14 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1695 | } | 1800 | } |
1696 | } | 1801 | } |
1697 | } | 1802 | } |
1803 | end: | ||
1698 | if (evas_textblock_cursor_compare(tc, en->cursor)) | 1804 | if (evas_textblock_cursor_compare(tc, en->cursor)) |
1699 | { | 1805 | { |
1700 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 1806 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
1701 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); | 1807 | _edje_emit(rp->edje, "cursor,changed,manual", rp->part->name); |
1702 | } | 1808 | } |
1703 | evas_textblock_cursor_free(tc); | 1809 | evas_textblock_cursor_free(tc); |
1704 | 1810 | ||
1705 | _edje_entry_imf_cursor_info_set(en); | 1811 | _edje_entry_imf_cursor_info_set(en); |
1706 | 1812 | ||
1707 | _edje_entry_real_part_configure(rp); | 1813 | _edje_entry_real_part_configure(rp); |
@@ -1724,6 +1830,8 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED | |||
1724 | if (ev->button != 1) return; | 1830 | if (ev->button != 1) return; |
1725 | if (!rp) return; | 1831 | if (!rp) return; |
1726 | if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; | 1832 | if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; |
1833 | if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK) return; | ||
1834 | if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) return; | ||
1727 | en = rp->entry_data; | 1835 | en = rp->entry_data; |
1728 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || | 1836 | if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || |
1729 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) | 1837 | (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) |
@@ -1741,7 +1849,7 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED | |||
1741 | } | 1849 | } |
1742 | #endif | 1850 | #endif |
1743 | 1851 | ||
1744 | _edje_entry_imf_context_reset(en); | 1852 | _edje_entry_imf_context_reset(rp); |
1745 | 1853 | ||
1746 | tc = evas_object_textblock_cursor_new(rp->object); | 1854 | tc = evas_object_textblock_cursor_new(rp->object); |
1747 | evas_textblock_cursor_copy(en->cursor, tc); | 1855 | evas_textblock_cursor_copy(en->cursor, tc); |
@@ -1911,7 +2019,7 @@ _edje_part_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS | |||
1911 | } | 2019 | } |
1912 | evas_textblock_cursor_free(tc); | 2020 | evas_textblock_cursor_free(tc); |
1913 | 2021 | ||
1914 | _edje_entry_imf_context_reset(en); | 2022 | _edje_entry_imf_context_reset(rp); |
1915 | _edje_entry_imf_cursor_info_set(en); | 2023 | _edje_entry_imf_cursor_info_set(en); |
1916 | 2024 | ||
1917 | _edje_entry_real_part_configure(rp); | 2025 | _edje_entry_real_part_configure(rp); |
@@ -2035,6 +2143,8 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) | |||
2035 | { | 2143 | { |
2036 | evas_object_show(en->cursor_bg); | 2144 | evas_object_show(en->cursor_bg); |
2037 | evas_object_show(en->cursor_fg); | 2145 | evas_object_show(en->cursor_fg); |
2146 | en->input_panel_enable = EINA_TRUE; | ||
2147 | |||
2038 | #ifdef HAVE_ECORE_IMF | 2148 | #ifdef HAVE_ECORE_IMF |
2039 | ecore_imf_init(); | 2149 | ecore_imf_init(); |
2040 | 2150 | ||
@@ -2078,6 +2188,9 @@ _edje_entry_real_part_init(Edje_Real_Part *rp) | |||
2078 | ecore_imf_context_input_mode_set(en->imf_context, | 2188 | ecore_imf_context_input_mode_set(en->imf_context, |
2079 | rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD ? | 2189 | rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD ? |
2080 | ECORE_IMF_INPUT_MODE_INVISIBLE : ECORE_IMF_INPUT_MODE_FULL); | 2190 | ECORE_IMF_INPUT_MODE_INVISIBLE : ECORE_IMF_INPUT_MODE_FULL); |
2191 | |||
2192 | if (rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) | ||
2193 | ecore_imf_context_input_panel_language_set(en->imf_context, ECORE_IMF_INPUT_PANEL_LANG_ALPHABET); | ||
2081 | #endif | 2194 | #endif |
2082 | } | 2195 | } |
2083 | #ifdef HAVE_ECORE_IMF | 2196 | #ifdef HAVE_ECORE_IMF |
@@ -2111,9 +2224,9 @@ _edje_entry_real_part_shutdown(Edje_Real_Part *rp) | |||
2111 | { | 2224 | { |
2112 | if (en->imf_context) | 2225 | if (en->imf_context) |
2113 | { | 2226 | { |
2114 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb); | 2227 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _edje_entry_imf_event_commit_cb); |
2115 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb); | 2228 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, _edje_entry_imf_event_delete_surrounding_cb); |
2116 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb); | 2229 | ecore_imf_context_event_callback_del(en->imf_context, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, _edje_entry_imf_event_preedit_changed_cb); |
2117 | 2230 | ||
2118 | ecore_imf_context_del(en->imf_context); | 2231 | ecore_imf_context_del(en->imf_context); |
2119 | en->imf_context = NULL; | 2232 | en->imf_context = NULL; |
@@ -2192,7 +2305,7 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text) | |||
2192 | { | 2305 | { |
2193 | Entry *en = rp->entry_data; | 2306 | Entry *en = rp->entry_data; |
2194 | if (!en) return; | 2307 | if (!en) return; |
2195 | _edje_entry_imf_context_reset(en); | 2308 | _edje_entry_imf_context_reset(rp); |
2196 | // set text as markup | 2309 | // set text as markup |
2197 | _sel_clear(en->cursor, rp->object, en); | 2310 | _sel_clear(en->cursor, rp->object, en); |
2198 | evas_object_textblock_text_markup_set(rp->object, text); | 2311 | evas_object_textblock_text_markup_set(rp->object, text); |
@@ -2231,12 +2344,11 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text) | |||
2231 | { | 2344 | { |
2232 | Entry *en = rp->entry_data; | 2345 | Entry *en = rp->entry_data; |
2233 | if (!en) return; | 2346 | if (!en) return; |
2234 | _edje_entry_imf_context_reset(en); | 2347 | _edje_entry_imf_context_reset(rp); |
2235 | 2348 | ||
2236 | // prepend markup @ cursor pos | 2349 | // prepend markup @ cursor pos |
2237 | if (en->have_selection) | 2350 | if (en->have_selection) |
2238 | _range_del(en->cursor, rp->object, en); | 2351 | _range_del(en->cursor, rp->object, en); |
2239 | _sel_clear(en->cursor, rp->object, en); | ||
2240 | //xx | 2352 | //xx |
2241 | // evas_object_textblock_text_markup_prepend(en->cursor, text); | 2353 | // evas_object_textblock_text_markup_prepend(en->cursor, text); |
2242 | _text_filter_markup_prepend(en, en->cursor, text); | 2354 | _text_filter_markup_prepend(en, en->cursor, text); |
@@ -2282,7 +2394,7 @@ _edje_entry_select_all(Edje_Real_Part *rp) | |||
2282 | Entry *en = rp->entry_data; | 2394 | Entry *en = rp->entry_data; |
2283 | if (!en) return; | 2395 | if (!en) return; |
2284 | 2396 | ||
2285 | _edje_entry_imf_context_reset(en); | 2397 | _edje_entry_imf_context_reset(rp); |
2286 | 2398 | ||
2287 | _sel_clear(en->cursor, rp->object, en); | 2399 | _sel_clear(en->cursor, rp->object, en); |
2288 | _curs_start(en->cursor, rp->object, en); | 2400 | _curs_start(en->cursor, rp->object, en); |
@@ -2301,7 +2413,7 @@ _edje_entry_select_begin(Edje_Real_Part *rp) | |||
2301 | Entry *en = rp->entry_data; | 2413 | Entry *en = rp->entry_data; |
2302 | if (!en) return; | 2414 | if (!en) return; |
2303 | 2415 | ||
2304 | _edje_entry_imf_context_reset(en); | 2416 | _edje_entry_imf_context_reset(rp); |
2305 | 2417 | ||
2306 | _sel_clear(en->cursor, rp->object, en); | 2418 | _sel_clear(en->cursor, rp->object, en); |
2307 | _sel_enable(en->cursor, rp->object, en); | 2419 | _sel_enable(en->cursor, rp->object, en); |
@@ -2318,7 +2430,7 @@ _edje_entry_select_extend(Edje_Real_Part *rp) | |||
2318 | { | 2430 | { |
2319 | Entry *en = rp->entry_data; | 2431 | Entry *en = rp->entry_data; |
2320 | if (!en) return; | 2432 | if (!en) return; |
2321 | _edje_entry_imf_context_reset(en); | 2433 | _edje_entry_imf_context_reset(rp); |
2322 | _sel_extend(en->cursor, rp->object, en); | 2434 | _sel_extend(en->cursor, rp->object, en); |
2323 | 2435 | ||
2324 | _edje_entry_imf_cursor_info_set(en); | 2436 | _edje_entry_imf_cursor_info_set(en); |
@@ -2440,6 +2552,35 @@ _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord * | |||
2440 | } | 2552 | } |
2441 | 2553 | ||
2442 | void | 2554 | void |
2555 | _edje_entry_user_insert(Edje_Real_Part *rp, const char *text) | ||
2556 | { | ||
2557 | Entry *en = rp->entry_data; | ||
2558 | Edje_Entry_Change_Info *info = calloc(1, sizeof(*info)); | ||
2559 | info->insert = EINA_TRUE; | ||
2560 | info->change.insert.plain_length = 1; | ||
2561 | info->change.insert.content = eina_stringshare_add(text); | ||
2562 | { | ||
2563 | char *tmp; | ||
2564 | tmp = evas_textblock_text_markup_to_utf8(rp->object, | ||
2565 | info->change.insert.content); | ||
2566 | info->change.insert.plain_length = eina_unicode_utf8_get_len(tmp); | ||
2567 | free(tmp); | ||
2568 | } | ||
2569 | |||
2570 | if (en->have_selection) | ||
2571 | { | ||
2572 | _range_del_emit(rp->edje, en->cursor, rp->object, en); | ||
2573 | info->merge = EINA_TRUE; | ||
2574 | } | ||
2575 | info->change.insert.pos = evas_textblock_cursor_pos_get(en->cursor); | ||
2576 | _text_filter_text_prepend(en, en->cursor, text); | ||
2577 | _edje_emit(rp->edje, "entry,changed", rp->part->name); | ||
2578 | _edje_emit_full(rp->edje, "entry,changed,user", rp->part->name, | ||
2579 | info, _free_entry_change_info); | ||
2580 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | ||
2581 | } | ||
2582 | |||
2583 | void | ||
2443 | _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow) | 2584 | _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow) |
2444 | { | 2585 | { |
2445 | Entry *en = rp->entry_data; | 2586 | Entry *en = rp->entry_data; |
@@ -2463,12 +2604,25 @@ _edje_entry_select_abort(Edje_Real_Part *rp) | |||
2463 | { | 2604 | { |
2464 | en->selecting = EINA_FALSE; | 2605 | en->selecting = EINA_FALSE; |
2465 | 2606 | ||
2466 | _edje_entry_imf_context_reset(en); | 2607 | _edje_entry_imf_context_reset(rp); |
2467 | _edje_entry_imf_cursor_info_set(en); | 2608 | _edje_entry_imf_cursor_info_set(en); |
2468 | _edje_entry_real_part_configure(rp); | 2609 | _edje_entry_real_part_configure(rp); |
2469 | } | 2610 | } |
2470 | } | 2611 | } |
2471 | 2612 | ||
2613 | void * | ||
2614 | _edje_entry_imf_context_get(Edje_Real_Part *rp) | ||
2615 | { | ||
2616 | Entry *en = rp->entry_data; | ||
2617 | if (!en) return NULL; | ||
2618 | |||
2619 | #ifdef HAVE_ECORE_IMF | ||
2620 | return en->imf_context; | ||
2621 | #else | ||
2622 | return NULL; | ||
2623 | #endif | ||
2624 | } | ||
2625 | |||
2472 | void | 2626 | void |
2473 | _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type) | 2627 | _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type) |
2474 | { | 2628 | { |
@@ -2499,16 +2653,37 @@ _edje_entry_autocapital_type_get(Edje_Real_Part *rp) | |||
2499 | } | 2653 | } |
2500 | 2654 | ||
2501 | void | 2655 | void |
2656 | _edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction) | ||
2657 | { | ||
2658 | Entry *en = rp->entry_data; | ||
2659 | |||
2660 | if (!en) return; | ||
2661 | en->prediction_allow = prediction; | ||
2662 | #ifdef HAVE_ECORE_IMF | ||
2663 | if (en->imf_context) | ||
2664 | ecore_imf_context_prediction_allow_set(en->imf_context, prediction); | ||
2665 | #endif | ||
2666 | } | ||
2667 | |||
2668 | Eina_Bool | ||
2669 | _edje_entry_prediction_allow_get(Edje_Real_Part *rp) | ||
2670 | { | ||
2671 | Entry *en = rp->entry_data; | ||
2672 | if (!en) return EINA_FALSE; | ||
2673 | |||
2674 | return en->prediction_allow; | ||
2675 | } | ||
2676 | |||
2677 | void | ||
2502 | _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled) | 2678 | _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled) |
2503 | { | 2679 | { |
2504 | Entry *en = rp->entry_data; | 2680 | Entry *en = rp->entry_data; |
2505 | 2681 | ||
2506 | if (!en) return; | 2682 | if (!en) return; |
2683 | en->input_panel_enable = enabled; | ||
2507 | #ifdef HAVE_ECORE_IMF | 2684 | #ifdef HAVE_ECORE_IMF |
2508 | if (en->imf_context) | 2685 | if (en->imf_context) |
2509 | ecore_imf_context_input_panel_enabled_set(en->imf_context, enabled); | 2686 | ecore_imf_context_input_panel_enabled_set(en->imf_context, enabled); |
2510 | #else | ||
2511 | (void) enabled; | ||
2512 | #endif | 2687 | #endif |
2513 | } | 2688 | } |
2514 | 2689 | ||
@@ -2517,11 +2692,121 @@ _edje_entry_input_panel_enabled_get(Edje_Real_Part *rp) | |||
2517 | { | 2692 | { |
2518 | Entry *en = rp->entry_data; | 2693 | Entry *en = rp->entry_data; |
2519 | if (!en) return EINA_FALSE; | 2694 | if (!en) return EINA_FALSE; |
2695 | |||
2696 | return en->input_panel_enable; | ||
2697 | } | ||
2698 | |||
2699 | void | ||
2700 | _edje_entry_input_panel_show(Edje_Real_Part *rp) | ||
2701 | { | ||
2702 | Entry *en = rp->entry_data; | ||
2703 | |||
2704 | if (!en) return; | ||
2705 | #ifdef HAVE_ECORE_IMF | ||
2706 | if (en->imf_context) | ||
2707 | ecore_imf_context_input_panel_show(en->imf_context); | ||
2708 | #endif | ||
2709 | } | ||
2710 | |||
2711 | void | ||
2712 | _edje_entry_input_panel_hide(Edje_Real_Part *rp) | ||
2713 | { | ||
2714 | Entry *en = rp->entry_data; | ||
2715 | |||
2716 | if (!en) return; | ||
2520 | #ifdef HAVE_ECORE_IMF | 2717 | #ifdef HAVE_ECORE_IMF |
2521 | if (en->imf_context) | 2718 | if (en->imf_context) |
2522 | return ecore_imf_context_input_panel_enabled_get(en->imf_context); | 2719 | ecore_imf_context_input_panel_hide(en->imf_context); |
2523 | #endif | 2720 | #endif |
2721 | } | ||
2722 | |||
2723 | void | ||
2724 | _edje_entry_input_panel_language_set(Edje_Real_Part *rp, Edje_Input_Panel_Lang lang) | ||
2725 | { | ||
2726 | Entry *en = rp->entry_data; | ||
2524 | 2727 | ||
2728 | if (!en) return; | ||
2729 | en->input_panel_lang = lang; | ||
2730 | #ifdef HAVE_ECORE_IMF | ||
2731 | if (en->imf_context) | ||
2732 | ecore_imf_context_input_panel_language_set(en->imf_context, lang); | ||
2733 | #endif | ||
2734 | } | ||
2735 | |||
2736 | Edje_Input_Panel_Lang | ||
2737 | _edje_entry_input_panel_language_get(Edje_Real_Part *rp) | ||
2738 | { | ||
2739 | Entry *en = rp->entry_data; | ||
2740 | if (!en) return EDJE_INPUT_PANEL_LANG_AUTOMATIC; | ||
2741 | |||
2742 | return en->input_panel_lang; | ||
2743 | } | ||
2744 | |||
2745 | void | ||
2746 | _edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data, int len) | ||
2747 | { | ||
2748 | Entry *en = rp->entry_data; | ||
2749 | if (!en) return; | ||
2750 | #ifdef HAVE_ECORE_IMF | ||
2751 | if (en->imf_context) | ||
2752 | ecore_imf_context_input_panel_imdata_set(en->imf_context, data, len); | ||
2753 | #endif | ||
2754 | } | ||
2755 | |||
2756 | void | ||
2757 | _edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data, int *len) | ||
2758 | { | ||
2759 | Entry *en = rp->entry_data; | ||
2760 | if (!en) return; | ||
2761 | #ifdef HAVE_ECORE_IMF | ||
2762 | if (en->imf_context) | ||
2763 | ecore_imf_context_input_panel_imdata_get(en->imf_context, data, len); | ||
2764 | #endif | ||
2765 | } | ||
2766 | |||
2767 | void | ||
2768 | _edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel_Return_Key_Type return_key_type) | ||
2769 | { | ||
2770 | Entry *en = rp->entry_data; | ||
2771 | if (!en) return; | ||
2772 | #ifdef HAVE_ECORE_IMF | ||
2773 | if (en->imf_context) | ||
2774 | ecore_imf_context_input_panel_return_key_type_set(en->imf_context, return_key_type); | ||
2775 | #endif | ||
2776 | } | ||
2777 | |||
2778 | Edje_Input_Panel_Return_Key_Type | ||
2779 | _edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp) | ||
2780 | { | ||
2781 | Entry *en = rp->entry_data; | ||
2782 | if (!en) return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2783 | #ifdef HAVE_ECORE_IMF | ||
2784 | if (en->imf_context) | ||
2785 | return ecore_imf_context_input_panel_return_key_type_get(en->imf_context); | ||
2786 | #endif | ||
2787 | return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2788 | } | ||
2789 | |||
2790 | void | ||
2791 | _edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled) | ||
2792 | { | ||
2793 | Entry *en = rp->entry_data; | ||
2794 | if (!en) return; | ||
2795 | #ifdef HAVE_ECORE_IMF | ||
2796 | if (en->imf_context) | ||
2797 | ecore_imf_context_input_panel_return_key_disabled_set(en->imf_context, disabled); | ||
2798 | #endif | ||
2799 | } | ||
2800 | |||
2801 | Eina_Bool | ||
2802 | _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp) | ||
2803 | { | ||
2804 | Entry *en = rp->entry_data; | ||
2805 | if (!en) return EINA_FALSE; | ||
2806 | #ifdef HAVE_ECORE_IMF | ||
2807 | if (en->imf_context) | ||
2808 | return ecore_imf_context_input_panel_return_key_disabled_get(en->imf_context); | ||
2809 | #endif | ||
2525 | return EINA_FALSE; | 2810 | return EINA_FALSE; |
2526 | } | 2811 | } |
2527 | 2812 | ||
@@ -2568,7 +2853,7 @@ _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2568 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2853 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2569 | if (!c) return EINA_FALSE; | 2854 | if (!c) return EINA_FALSE; |
2570 | 2855 | ||
2571 | _edje_entry_imf_context_reset(en); | 2856 | _edje_entry_imf_context_reset(rp); |
2572 | 2857 | ||
2573 | if (!evas_textblock_cursor_char_next(c)) | 2858 | if (!evas_textblock_cursor_char_next(c)) |
2574 | { | 2859 | { |
@@ -2589,7 +2874,7 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2589 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2874 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2590 | if (!c) return EINA_FALSE; | 2875 | if (!c) return EINA_FALSE; |
2591 | 2876 | ||
2592 | _edje_entry_imf_context_reset(en); | 2877 | _edje_entry_imf_context_reset(rp); |
2593 | 2878 | ||
2594 | if (!evas_textblock_cursor_char_prev(c)) | 2879 | if (!evas_textblock_cursor_char_prev(c)) |
2595 | { | 2880 | { |
@@ -2615,7 +2900,7 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2615 | int ln; | 2900 | int ln; |
2616 | if (!c) return EINA_FALSE; | 2901 | if (!c) return EINA_FALSE; |
2617 | 2902 | ||
2618 | _edje_entry_imf_context_reset(en); | 2903 | _edje_entry_imf_context_reset(rp); |
2619 | 2904 | ||
2620 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); | 2905 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); |
2621 | ln--; | 2906 | ln--; |
@@ -2649,7 +2934,7 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2649 | int ln; | 2934 | int ln; |
2650 | if (!c) return EINA_FALSE; | 2935 | if (!c) return EINA_FALSE; |
2651 | 2936 | ||
2652 | _edje_entry_imf_context_reset(en); | 2937 | _edje_entry_imf_context_reset(rp); |
2653 | 2938 | ||
2654 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); | 2939 | ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL); |
2655 | ln++; | 2940 | ln++; |
@@ -2679,7 +2964,7 @@ _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2679 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2964 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2680 | if (!c) return; | 2965 | if (!c) return; |
2681 | 2966 | ||
2682 | _edje_entry_imf_context_reset(en); | 2967 | _edje_entry_imf_context_reset(rp); |
2683 | 2968 | ||
2684 | evas_textblock_cursor_paragraph_first(c); | 2969 | evas_textblock_cursor_paragraph_first(c); |
2685 | _sel_update(c, rp->object, rp->entry_data); | 2970 | _sel_update(c, rp->object, rp->entry_data); |
@@ -2696,7 +2981,7 @@ _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2696 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 2981 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2697 | if (!c) return; | 2982 | if (!c) return; |
2698 | 2983 | ||
2699 | _edje_entry_imf_context_reset(en); | 2984 | _edje_entry_imf_context_reset(rp); |
2700 | 2985 | ||
2701 | _curs_end(c, rp->object, rp->entry_data); | 2986 | _curs_end(c, rp->object, rp->entry_data); |
2702 | _sel_update(c, rp->object, rp->entry_data); | 2987 | _sel_update(c, rp->object, rp->entry_data); |
@@ -2721,7 +3006,7 @@ _edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst) | |||
2721 | evas_textblock_cursor_copy(c, d); | 3006 | evas_textblock_cursor_copy(c, d); |
2722 | _sel_update(c, rp->object, rp->entry_data); | 3007 | _sel_update(c, rp->object, rp->entry_data); |
2723 | 3008 | ||
2724 | _edje_entry_imf_context_reset(en); | 3009 | _edje_entry_imf_context_reset(rp); |
2725 | _edje_entry_imf_cursor_info_set(en); | 3010 | _edje_entry_imf_cursor_info_set(en); |
2726 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); | 3011 | _edje_emit(rp->edje, "cursor,changed", rp->part->name); |
2727 | _edje_entry_real_part_configure(rp); | 3012 | _edje_entry_real_part_configure(rp); |
@@ -2733,7 +3018,7 @@ _edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2733 | Entry *en = rp->entry_data; | 3018 | Entry *en = rp->entry_data; |
2734 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 3019 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2735 | if (!c) return; | 3020 | if (!c) return; |
2736 | _edje_entry_imf_context_reset(en); | 3021 | _edje_entry_imf_context_reset(rp); |
2737 | 3022 | ||
2738 | evas_textblock_cursor_line_char_first(c); | 3023 | evas_textblock_cursor_line_char_first(c); |
2739 | _sel_update(c, rp->object, rp->entry_data); | 3024 | _sel_update(c, rp->object, rp->entry_data); |
@@ -2750,7 +3035,7 @@ _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur) | |||
2750 | Entry *en = rp->entry_data; | 3035 | Entry *en = rp->entry_data; |
2751 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); | 3036 | Evas_Textblock_Cursor *c = _cursor_get(rp, cur); |
2752 | if (!c) return; | 3037 | if (!c) return; |
2753 | _edje_entry_imf_context_reset(en); | 3038 | _edje_entry_imf_context_reset(rp); |
2754 | evas_textblock_cursor_line_char_last(c); | 3039 | evas_textblock_cursor_line_char_last(c); |
2755 | _sel_update(c, rp->object, rp->entry_data); | 3040 | _sel_update(c, rp->object, rp->entry_data); |
2756 | 3041 | ||
@@ -2810,9 +3095,9 @@ _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos) | |||
2810 | if (!c) return; | 3095 | if (!c) return; |
2811 | /* Abort if cursor position didn't really change */ | 3096 | /* Abort if cursor position didn't really change */ |
2812 | if (evas_textblock_cursor_pos_get(c) == pos) | 3097 | if (evas_textblock_cursor_pos_get(c) == pos) |
2813 | return; | 3098 | return; |
2814 | 3099 | ||
2815 | _edje_entry_imf_context_reset(en); | 3100 | _edje_entry_imf_context_reset(rp); |
2816 | evas_textblock_cursor_pos_set(c, pos); | 3101 | evas_textblock_cursor_pos_set(c, pos); |
2817 | _sel_update(c, rp->object, rp->entry_data); | 3102 | _sel_update(c, rp->object, rp->entry_data); |
2818 | 3103 | ||
@@ -2855,14 +3140,14 @@ _edje_entry_input_panel_layout_get(Edje_Real_Part *rp) | |||
2855 | return EDJE_INPUT_PANEL_LAYOUT_INVALID; | 3140 | return EDJE_INPUT_PANEL_LAYOUT_INVALID; |
2856 | } | 3141 | } |
2857 | 3142 | ||
2858 | static void | 3143 | void |
2859 | _edje_entry_imf_context_reset(Entry *en) | 3144 | _edje_entry_imf_context_reset(Edje_Real_Part *rp) |
2860 | { | 3145 | { |
3146 | Entry *en = rp->entry_data; | ||
3147 | if (!en) return; | ||
2861 | #ifdef HAVE_ECORE_IMF | 3148 | #ifdef HAVE_ECORE_IMF |
2862 | if (en->imf_context) | 3149 | if (en->imf_context) |
2863 | ecore_imf_context_reset(en->imf_context); | 3150 | ecore_imf_context_reset(en->imf_context); |
2864 | #else | ||
2865 | (void) en; | ||
2866 | #endif | 3151 | #endif |
2867 | } | 3152 | } |
2868 | 3153 | ||
@@ -3019,7 +3304,6 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx __UN | |||
3019 | { | 3304 | { |
3020 | /* delete selected characters */ | 3305 | /* delete selected characters */ |
3021 | _range_del_emit(ed, en->cursor, rp->object, en); | 3306 | _range_del_emit(ed, en->cursor, rp->object, en); |
3022 | _sel_clear(en->cursor, rp->object, en); | ||
3023 | } | 3307 | } |
3024 | 3308 | ||
3025 | /* delete preedit characters */ | 3309 | /* delete preedit characters */ |
diff --git a/libraries/edje/src/lib/edje_load.c b/libraries/edje/src/lib/edje_load.c index 8fe5842..b63cd88 100644 --- a/libraries/edje/src/lib/edje_load.c +++ b/libraries/edje/src/lib/edje_load.c | |||
@@ -132,7 +132,7 @@ edje_file_group_exists(const char *file, const char *glob) | |||
132 | edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL); | 132 | edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL); |
133 | if (!edf) | 133 | if (!edf) |
134 | return EINA_FALSE; | 134 | return EINA_FALSE; |
135 | 135 | ||
136 | for (p = glob; *p; p++) | 136 | for (p = glob; *p; p++) |
137 | { | 137 | { |
138 | if ((*p == '*') || (*p == '?') || (*p == '[')) | 138 | if ((*p == '*') || (*p == '?') || (*p == '[')) |
@@ -141,7 +141,7 @@ edje_file_group_exists(const char *file, const char *glob) | |||
141 | break; | 141 | break; |
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
145 | if (is_glob) | 145 | if (is_glob) |
146 | { | 146 | { |
147 | if (!edf->collection_patterns) | 147 | if (!edf->collection_patterns) |
@@ -149,18 +149,18 @@ edje_file_group_exists(const char *file, const char *glob) | |||
149 | Edje_Part_Collection_Directory_Entry *ce; | 149 | Edje_Part_Collection_Directory_Entry *ce; |
150 | Eina_Iterator *i; | 150 | Eina_Iterator *i; |
151 | Eina_List *l = NULL; | 151 | Eina_List *l = NULL; |
152 | 152 | ||
153 | i = eina_hash_iterator_data_new(edf->collection); | 153 | i = eina_hash_iterator_data_new(edf->collection); |
154 | 154 | ||
155 | EINA_ITERATOR_FOREACH(i, ce) | 155 | EINA_ITERATOR_FOREACH(i, ce) |
156 | l = eina_list_append(l, ce); | 156 | l = eina_list_append(l, ce); |
157 | 157 | ||
158 | eina_iterator_free(i); | 158 | eina_iterator_free(i); |
159 | 159 | ||
160 | edf->collection_patterns = edje_match_collection_dir_init(l); | 160 | edf->collection_patterns = edje_match_collection_dir_init(l); |
161 | eina_list_free(l); | 161 | eina_list_free(l); |
162 | } | 162 | } |
163 | 163 | ||
164 | succeed = edje_match_collection_dir_exec(edf->collection_patterns, glob); | 164 | succeed = edje_match_collection_dir_exec(edf->collection_patterns, glob); |
165 | if (edf->collection_patterns) | 165 | if (edf->collection_patterns) |
166 | { | 166 | { |
@@ -226,6 +226,20 @@ _edje_programs_patterns_init(Edje *ed) | |||
226 | if (ssp->signals_patterns) | 226 | if (ssp->signals_patterns) |
227 | return; | 227 | return; |
228 | 228 | ||
229 | if (getenv("EDJE_DUMP_PROGRAMS")) | ||
230 | { | ||
231 | INF("Group '%s' programs:", ed->group); | ||
232 | #define EDJE_DUMP_PROGRAM(Section) \ | ||
233 | for (i = 0; i < ed->collection->programs.Section##_count; i++) \ | ||
234 | INF(#Section" for ('%s', '%s')", ed->collection->programs.Section[i]->signal, ed->collection->programs.Section[i]->source); | ||
235 | |||
236 | EDJE_DUMP_PROGRAM(strcmp); | ||
237 | EDJE_DUMP_PROGRAM(strncmp); | ||
238 | EDJE_DUMP_PROGRAM(strrncmp); | ||
239 | EDJE_DUMP_PROGRAM(fnmatch); | ||
240 | EDJE_DUMP_PROGRAM(nocmp); | ||
241 | } | ||
242 | |||
229 | edje_match_program_hash_build(ed->collection->programs.strcmp, | 243 | edje_match_program_hash_build(ed->collection->programs.strcmp, |
230 | ed->collection->programs.strcmp_count, | 244 | ed->collection->programs.strcmp_count, |
231 | &ssp->exact_match); | 245 | &ssp->exact_match); |
@@ -294,6 +308,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g | |||
294 | 308 | ||
295 | ed->load_error = EDJE_LOAD_ERROR_NONE; | 309 | ed->load_error = EDJE_LOAD_ERROR_NONE; |
296 | _edje_file_add(ed); | 310 | _edje_file_add(ed); |
311 | ed->block_break = 0; | ||
297 | 312 | ||
298 | if (ed->file && ed->file->external_dir) | 313 | if (ed->file && ed->file->external_dir) |
299 | { | 314 | { |
diff --git a/libraries/edje/src/lib/edje_lua2.c b/libraries/edje/src/lib/edje_lua2.c index 1d167e9..fd88f31 100644 --- a/libraries/edje/src/lib/edje_lua2.c +++ b/libraries/edje/src/lib/edje_lua2.c | |||
@@ -6,11 +6,6 @@ | |||
6 | 6 | ||
7 | #define RASTER_FORGOT_WHY "this is here." | 7 | #define RASTER_FORGOT_WHY "this is here." |
8 | 8 | ||
9 | #ifdef _WIN32 | ||
10 | # define FMT_SIZE_T "%Iu" | ||
11 | #else | ||
12 | # define FMT_SIZE_T "%zu" | ||
13 | #endif | ||
14 | 9 | ||
15 | //--------------------------------------------------------------------------// | 10 | //--------------------------------------------------------------------------// |
16 | #define MAX_LUA_MEM (4 * (1024 * 1024)) | 11 | #define MAX_LUA_MEM (4 * (1024 * 1024)) |
@@ -216,7 +211,7 @@ _elua_alloc(void *ud, void *ptr, size_t osize, size_t nsize) | |||
216 | ela->cur += nsize - osize; | 211 | ela->cur += nsize - osize; |
217 | if (ela->cur > ela->max) | 212 | if (ela->cur > ela->max) |
218 | { | 213 | { |
219 | ERR("Lua memory limit of " FMT_SIZE_T " bytes reached (" FMT_SIZE_T " allocated)", | 214 | ERR("Lua memory limit of %zu bytes reached (%zu allocated)", |
220 | ela->max, ela->cur); | 215 | ela->max, ela->cur); |
221 | return NULL; | 216 | return NULL; |
222 | } | 217 | } |
@@ -228,7 +223,7 @@ _elua_alloc(void *ud, void *ptr, size_t osize, size_t nsize) | |||
228 | 223 | ||
229 | ptr2 = realloc(ptr, nsize); | 224 | ptr2 = realloc(ptr, nsize); |
230 | if (ptr2) return ptr2; | 225 | if (ptr2) return ptr2; |
231 | ERR("Lua cannot re-allocate " FMT_SIZE_T " bytes", nsize); | 226 | ERR("Lua cannot re-allocate %zu bytes", nsize); |
232 | return ptr2; | 227 | return ptr2; |
233 | } | 228 | } |
234 | 229 | ||
@@ -698,7 +693,7 @@ static int | |||
698 | _elua_echo(lua_State *L) // Stack usage [-0, +0, v] | 693 | _elua_echo(lua_State *L) // Stack usage [-0, +0, v] |
699 | { | 694 | { |
700 | const char *string = luaL_checkstring(L, 1); // Stack usage [-0, +0, v] | 695 | const char *string = luaL_checkstring(L, 1); // Stack usage [-0, +0, v] |
701 | LD("%s\n", string); | 696 | LD("%s", string); |
702 | return 0; | 697 | return 0; |
703 | } | 698 | } |
704 | 699 | ||
@@ -2657,16 +2652,16 @@ _elua_edje_file(lua_State *L) // Stack usage [ | |||
2657 | 2652 | ||
2658 | switch (err) | 2653 | switch (err) |
2659 | { | 2654 | { |
2660 | case EDJE_LOAD_ERROR_NONE : LE("Edje file loading errer %s %s - no error happened, but you should not see this.\n", obj->ed->file->path, group); break; | 2655 | case EDJE_LOAD_ERROR_NONE : LE("Edje file loading errer %s %s - no error happened, but you should not see this.", obj->ed->file->path, group); break; |
2661 | case EDJE_LOAD_ERROR_GENERIC : LE("Edje file loading errer %s %s - generic error.\n", obj->ed->file->path, group); break; | 2656 | case EDJE_LOAD_ERROR_GENERIC : LE("Edje file loading errer %s %s - generic error.", obj->ed->file->path, group); break; |
2662 | case EDJE_LOAD_ERROR_DOES_NOT_EXIST : LE("Edje file loading errer %s %s - file does not exist.\n", obj->ed->file->path, group); break; | 2657 | case EDJE_LOAD_ERROR_DOES_NOT_EXIST : LE("Edje file loading errer %s %s - file does not exist.", obj->ed->file->path, group); break; |
2663 | case EDJE_LOAD_ERROR_PERMISSION_DENIED : LE("Edje file loading errer %s %s - permission denied reading the file.\n", obj->ed->file->path, group); break; | 2658 | case EDJE_LOAD_ERROR_PERMISSION_DENIED : LE("Edje file loading errer %s %s - permission denied reading the file.", obj->ed->file->path, group); break; |
2664 | case EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED : LE("Edje file loading errer %s %s - resource allocation failed.\n", obj->ed->file->path, group); break; | 2659 | case EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED : LE("Edje file loading errer %s %s - resource allocation failed.", obj->ed->file->path, group); break; |
2665 | case EDJE_LOAD_ERROR_CORRUPT_FILE : LE("Edje file loading errer %s %s - corrupt file.\n", obj->ed->file->path, group); break; | 2660 | case EDJE_LOAD_ERROR_CORRUPT_FILE : LE("Edje file loading errer %s %s - corrupt file.", obj->ed->file->path, group); break; |
2666 | case EDJE_LOAD_ERROR_UNKNOWN_FORMAT : LE("Edje file loading errer %s %s - unknown file format.\n", obj->ed->file->path, group); break; | 2661 | case EDJE_LOAD_ERROR_UNKNOWN_FORMAT : LE("Edje file loading errer %s %s - unknown file format.", obj->ed->file->path, group); break; |
2667 | case EDJE_LOAD_ERROR_INCOMPATIBLE_FILE : LE("Edje file loading errer %s %s - incompatible file.\n", obj->ed->file->path, group); break; | 2662 | case EDJE_LOAD_ERROR_INCOMPATIBLE_FILE : LE("Edje file loading errer %s %s - incompatible file.", obj->ed->file->path, group); break; |
2668 | case EDJE_LOAD_ERROR_UNKNOWN_COLLECTION : LE("Edje file loading errer %s %s - unknown group.\n", obj->ed->file->path, group); break; | 2663 | case EDJE_LOAD_ERROR_UNKNOWN_COLLECTION : LE("Edje file loading errer %s %s - unknown group.", obj->ed->file->path, group); break; |
2669 | case EDJE_LOAD_ERROR_RECURSIVE_REFERENCE : LE("Edje file loading errer %s %s - recursive reference in group.\n", obj->ed->file->path, group); break; | 2664 | case EDJE_LOAD_ERROR_RECURSIVE_REFERENCE : LE("Edje file loading errer %s %s - recursive reference in group.", obj->ed->file->path, group); break; |
2670 | } | 2665 | } |
2671 | } | 2666 | } |
2672 | } | 2667 | } |
@@ -2865,13 +2860,14 @@ _elua_image_image(lua_State *L) // Stack usage [ | |||
2865 | } | 2860 | } |
2866 | } | 2861 | } |
2867 | 2862 | ||
2868 | /* Sandbox lua - Only allow access to images within the same edje file. I'm not so sure we need this level of sandboxing though. So leaving it here, just in case. | ||
2869 | if (-1 == id) | 2863 | if (-1 == id) |
2870 | { | 2864 | { |
2871 | LI("Image %s not found in our edje file, trying external image file %s.\n", key, file); | 2865 | LE("Image %s not found in our edje file.", key); |
2866 | /* Sandbox lua - Only allow access to images within the same edje file. I'm not so sure we need this level of sandboxing though. So leaving it here, just in case. | ||
2867 | LI("Image %s not found in our edje file, trying external image file %s.", key, file); | ||
2872 | evas_object_image_file_set(elo->evas_obj, file, key); | 2868 | evas_object_image_file_set(elo->evas_obj, file, key); |
2869 | */ | ||
2873 | } | 2870 | } |
2874 | */ | ||
2875 | } | 2871 | } |
2876 | evas_object_image_file_get(elo->evas_obj, &file, &key); | 2872 | evas_object_image_file_get(elo->evas_obj, &file, &key); |
2877 | _elua_ret(L, "$file $key", file, key); | 2873 | _elua_ret(L, "$file $key", file, key); |
diff --git a/libraries/edje/src/lib/edje_main.c b/libraries/edje/src/lib/edje_main.c index 5d011ad..f70efb9 100644 --- a/libraries/edje/src/lib/edje_main.c +++ b/libraries/edje/src/lib/edje_main.c | |||
@@ -233,6 +233,11 @@ _edje_del(Edje *ed) | |||
233 | eina_stringshare_del(cb->part); | 233 | eina_stringshare_del(cb->part); |
234 | free(cb); | 234 | free(cb); |
235 | } | 235 | } |
236 | EINA_LIST_FREE(ed->markup_filter_callbacks, cb) | ||
237 | { | ||
238 | eina_stringshare_del(cb->part); | ||
239 | free(cb); | ||
240 | } | ||
236 | 241 | ||
237 | if (ed->members.text_class) | 242 | if (ed->members.text_class) |
238 | { | 243 | { |
diff --git a/libraries/edje/src/lib/edje_multisense.c b/libraries/edje/src/lib/edje_multisense.c index f3324e7..a35b223 100644 --- a/libraries/edje/src/lib/edje_multisense.c +++ b/libraries/edje/src/lib/edje_multisense.c | |||
@@ -1,8 +1,3 @@ | |||
1 | #include "config.h" | ||
2 | #include <string.h> | ||
3 | #include <fcntl.h> | ||
4 | #include <Eina.h> | ||
5 | #include <Edje.h> | ||
6 | #include "edje_private.h" | 1 | #include "edje_private.h" |
7 | 2 | ||
8 | typedef struct _Multisense_Data | 3 | typedef struct _Multisense_Data |
diff --git a/libraries/edje/src/lib/edje_private.h b/libraries/edje/src/lib/edje_private.h index 8bf18eb..1d5aee9 100644 --- a/libraries/edje/src/lib/edje_private.h +++ b/libraries/edje/src/lib/edje_private.h | |||
@@ -9,18 +9,30 @@ | |||
9 | # define _GNU_SOURCE | 9 | # define _GNU_SOURCE |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | #ifdef STDC_HEADERS | ||
13 | # include <stdlib.h> | ||
14 | # include <stddef.h> | ||
15 | #else | ||
16 | # ifdef HAVE_STDLIB_H | ||
17 | # include <stdlib.h> | ||
18 | # endif | ||
19 | #endif | ||
12 | #ifdef HAVE_ALLOCA_H | 20 | #ifdef HAVE_ALLOCA_H |
13 | # include <alloca.h> | 21 | # include <alloca.h> |
14 | #elif defined __GNUC__ | 22 | #elif !defined alloca |
15 | # define alloca __builtin_alloca | 23 | # ifdef __GNUC__ |
16 | #elif defined _AIX | 24 | # define alloca __builtin_alloca |
17 | # define alloca __alloca | 25 | # elif defined _AIX |
18 | #elif defined _MSC_VER | 26 | # define alloca __alloca |
19 | # include <malloc.h> | 27 | # elif defined _MSC_VER |
20 | # define alloca _alloca | 28 | # include <malloc.h> |
21 | #else | 29 | # define alloca _alloca |
22 | # include <stddef.h> | 30 | # elif !defined HAVE_ALLOCA |
31 | # ifdef __cplusplus | ||
32 | extern "C" | ||
33 | # endif | ||
23 | void *alloca (size_t); | 34 | void *alloca (size_t); |
35 | # endif | ||
24 | #endif | 36 | #endif |
25 | 37 | ||
26 | #include <string.h> | 38 | #include <string.h> |
@@ -35,6 +47,8 @@ void *alloca (size_t); | |||
35 | # include <unistd.h> | 47 | # include <unistd.h> |
36 | #endif | 48 | #endif |
37 | 49 | ||
50 | #include <fcntl.h> | ||
51 | |||
38 | #include <lua.h> | 52 | #include <lua.h> |
39 | #include <lualib.h> | 53 | #include <lualib.h> |
40 | #include <lauxlib.h> | 54 | #include <lauxlib.h> |
@@ -62,7 +76,7 @@ void *alloca (size_t); | |||
62 | 76 | ||
63 | #include "Edje.h" | 77 | #include "Edje.h" |
64 | 78 | ||
65 | EAPI extern int _edje_default_log_dom ; | 79 | EAPI extern int _edje_default_log_dom ; |
66 | 80 | ||
67 | #ifdef EDJE_DEFAULT_LOG_COLOR | 81 | #ifdef EDJE_DEFAULT_LOG_COLOR |
68 | # undef EDJE_DEFAULT_LOG_COLOR | 82 | # undef EDJE_DEFAULT_LOG_COLOR |
@@ -84,6 +98,10 @@ EAPI extern int _edje_default_log_dom ; | |||
84 | # undef CRIT | 98 | # undef CRIT |
85 | #endif | 99 | #endif |
86 | #define CRIT(...) EINA_LOG_DOM_CRIT(_edje_default_log_dom, __VA_ARGS__) | 100 | #define CRIT(...) EINA_LOG_DOM_CRIT(_edje_default_log_dom, __VA_ARGS__) |
101 | #ifdef DBG | ||
102 | # undef DBG | ||
103 | #endif | ||
104 | #define DBG(...) EINA_LOG_DOM_DBG(_edje_default_log_dom, __VA_ARGS__) | ||
87 | #ifdef __GNUC__ | 105 | #ifdef __GNUC__ |
88 | # if __GNUC__ >= 4 | 106 | # if __GNUC__ >= 4 |
89 | // BROKEN in gcc 4 on amd64 | 107 | // BROKEN in gcc 4 on amd64 |
@@ -173,7 +191,7 @@ struct _Edje_Smart_Api | |||
173 | /* increment this when you add new feature to edje file format without | 191 | /* increment this when you add new feature to edje file format without |
174 | * breaking backward compatibility. | 192 | * breaking backward compatibility. |
175 | */ | 193 | */ |
176 | #define EDJE_FILE_MINOR 2 | 194 | #define EDJE_FILE_MINOR 3 |
177 | 195 | ||
178 | /* FIXME: | 196 | /* FIXME: |
179 | * | 197 | * |
@@ -218,6 +236,7 @@ struct _Edje_Position | |||
218 | struct _Edje_Size | 236 | struct _Edje_Size |
219 | { | 237 | { |
220 | int w, h; | 238 | int w, h; |
239 | Eina_Bool limit; /* should we limit ourself to the size of the source */ | ||
221 | }; | 240 | }; |
222 | 241 | ||
223 | struct _Edje_Rectangle | 242 | struct _Edje_Rectangle |
@@ -322,6 +341,7 @@ typedef struct _Edje_Var_Timer Edje_Var_Timer; | |||
322 | typedef struct _Edje_Var_Pool Edje_Var_Pool; | 341 | typedef struct _Edje_Var_Pool Edje_Var_Pool; |
323 | typedef struct _Edje_Signal_Source_Char Edje_Signal_Source_Char; | 342 | typedef struct _Edje_Signal_Source_Char Edje_Signal_Source_Char; |
324 | typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callback; | 343 | typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callback; |
344 | typedef struct _Edje_Markup_Filter_Callback Edje_Markup_Filter_Callback; | ||
325 | 345 | ||
326 | #define EDJE_INF_MAX_W 100000 | 346 | #define EDJE_INF_MAX_W 100000 |
327 | #define EDJE_INF_MAX_H 100000 | 347 | #define EDJE_INF_MAX_H 100000 |
@@ -612,6 +632,8 @@ struct _Edje_Program /* a conditional program to be run */ | |||
612 | int src; /* part where parameter is being retrieved */ | 632 | int src; /* part where parameter is being retrieved */ |
613 | int dst; /* part where parameter is being stored */ | 633 | int dst; /* part where parameter is being stored */ |
614 | } param; | 634 | } param; |
635 | |||
636 | Eina_Bool exec : 1; | ||
615 | }; | 637 | }; |
616 | 638 | ||
617 | struct _Edje_Program_Target /* the target of an action */ | 639 | struct _Edje_Program_Target /* the target of an action */ |
@@ -752,6 +774,8 @@ struct _Edje_Part_Collection | |||
752 | 774 | ||
753 | unsigned char lua_script_only; | 775 | unsigned char lua_script_only; |
754 | 776 | ||
777 | unsigned char broadcast_signal; | ||
778 | |||
755 | unsigned char checked : 1; | 779 | unsigned char checked : 1; |
756 | }; | 780 | }; |
757 | 781 | ||
@@ -839,7 +863,7 @@ struct _Edje_Part_Description_Common | |||
839 | unsigned char have; | 863 | unsigned char have; |
840 | FLOAT_T w, h; | 864 | FLOAT_T w, h; |
841 | } minmul; | 865 | } minmul; |
842 | 866 | ||
843 | Edje_Size min, max; | 867 | Edje_Size min, max; |
844 | Edje_Position step; /* size stepping by n pixels, 0 = none */ | 868 | Edje_Position step; /* size stepping by n pixels, 0 = none */ |
845 | Edje_Aspect_Prefer aspect; | 869 | Edje_Aspect_Prefer aspect; |
@@ -1074,6 +1098,7 @@ struct _Edje | |||
1074 | Edje_Real_Part *focused_part; | 1098 | Edje_Real_Part *focused_part; |
1075 | Eina_List *subobjs; | 1099 | Eina_List *subobjs; |
1076 | Eina_List *text_insert_filter_callbacks; | 1100 | Eina_List *text_insert_filter_callbacks; |
1101 | Eina_List *markup_filter_callbacks; | ||
1077 | void *script_only_data; | 1102 | void *script_only_data; |
1078 | 1103 | ||
1079 | int table_programs_size; | 1104 | int table_programs_size; |
@@ -1145,6 +1170,8 @@ struct _Edje | |||
1145 | #endif | 1170 | #endif |
1146 | unsigned int have_mapped_part : 1; | 1171 | unsigned int have_mapped_part : 1; |
1147 | unsigned int recalc_call : 1; | 1172 | unsigned int recalc_call : 1; |
1173 | unsigned int update_hints : 1; | ||
1174 | unsigned int recalc_hints : 1; | ||
1148 | }; | 1175 | }; |
1149 | 1176 | ||
1150 | struct _Edje_Calc_Params | 1177 | struct _Edje_Calc_Params |
@@ -1179,7 +1206,7 @@ struct _Edje_Calc_Params | |||
1179 | int x, y, z; | 1206 | int x, y, z; |
1180 | } center; // 12 | 1207 | } center; // 12 |
1181 | struct { | 1208 | struct { |
1182 | double x, y, z; | 1209 | FLOAT_T x, y, z; |
1183 | } rotation; // 24 | 1210 | } rotation; // 24 |
1184 | struct { | 1211 | struct { |
1185 | int x, y, z; | 1212 | int x, y, z; |
@@ -1334,6 +1361,13 @@ struct _Edje_Text_Insert_Filter_Callback | |||
1334 | void *data; | 1361 | void *data; |
1335 | }; | 1362 | }; |
1336 | 1363 | ||
1364 | struct _Edje_Markup_Filter_Callback | ||
1365 | { | ||
1366 | const char *part; | ||
1367 | Edje_Markup_Filter_Cb func; | ||
1368 | void *data; | ||
1369 | }; | ||
1370 | |||
1337 | struct _Edje_Pending_Program | 1371 | struct _Edje_Pending_Program |
1338 | { | 1372 | { |
1339 | Edje *edje; | 1373 | Edje *edje; |
@@ -1907,10 +1941,11 @@ const Eina_List *_edje_entry_anchors_list(Edje_Real_Part *rp); | |||
1907 | Eina_Bool _edje_entry_item_geometry_get(Edje_Real_Part *rp, const char *item, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); | 1941 | Eina_Bool _edje_entry_item_geometry_get(Edje_Real_Part *rp, const char *item, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); |
1908 | const Eina_List *_edje_entry_items_list(Edje_Real_Part *rp); | 1942 | const Eina_List *_edje_entry_items_list(Edje_Real_Part *rp); |
1909 | void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); | 1943 | void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); |
1944 | void _edje_entry_user_insert(Edje_Real_Part *rp, const char *text); | ||
1910 | void _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow); | 1945 | void _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow); |
1911 | Eina_Bool _edje_entry_select_allow_get(const Edje_Real_Part *rp); | 1946 | Eina_Bool _edje_entry_select_allow_get(const Edje_Real_Part *rp); |
1912 | void _edje_entry_select_abort(Edje_Real_Part *rp); | 1947 | void _edje_entry_select_abort(Edje_Real_Part *rp); |
1913 | 1948 | void *_edje_entry_imf_context_get(Edje_Real_Part *rp); | |
1914 | Eina_Bool _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur); | 1949 | Eina_Bool _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur); |
1915 | Eina_Bool _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur); | 1950 | Eina_Bool _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur); |
1916 | Eina_Bool _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur); | 1951 | Eina_Bool _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur); |
@@ -1925,12 +1960,25 @@ Eina_Bool _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Curs | |||
1925 | char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); | 1960 | char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur); |
1926 | void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos); | 1961 | void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos); |
1927 | int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur); | 1962 | int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur); |
1963 | void _edje_entry_imf_context_reset(Edje_Real_Part *rp); | ||
1928 | void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout); | 1964 | void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout); |
1929 | Edje_Input_Panel_Layout _edje_entry_input_panel_layout_get(Edje_Real_Part *rp); | 1965 | Edje_Input_Panel_Layout _edje_entry_input_panel_layout_get(Edje_Real_Part *rp); |
1930 | void _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type); | 1966 | void _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type); |
1931 | Edje_Text_Autocapital_Type _edje_entry_autocapital_type_get(Edje_Real_Part *rp); | 1967 | Edje_Text_Autocapital_Type _edje_entry_autocapital_type_get(Edje_Real_Part *rp); |
1968 | void _edje_entry_prediction_allow_set(Edje_Real_Part *rp, Eina_Bool prediction); | ||
1969 | Eina_Bool _edje_entry_prediction_allow_get(Edje_Real_Part *rp); | ||
1932 | void _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled); | 1970 | void _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled); |
1933 | Eina_Bool _edje_entry_input_panel_enabled_get(Edje_Real_Part *rp); | 1971 | Eina_Bool _edje_entry_input_panel_enabled_get(Edje_Real_Part *rp); |
1972 | void _edje_entry_input_panel_show(Edje_Real_Part *rp); | ||
1973 | void _edje_entry_input_panel_hide(Edje_Real_Part *rp); | ||
1974 | void _edje_entry_input_panel_language_set(Edje_Real_Part *rp, Edje_Input_Panel_Lang lang); | ||
1975 | Edje_Input_Panel_Lang _edje_entry_input_panel_language_get(Edje_Real_Part *rp); | ||
1976 | void _edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data, int len); | ||
1977 | void _edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data, int *len); | ||
1978 | void _edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel_Return_Key_Type return_key_type); | ||
1979 | Edje_Input_Panel_Return_Key_Type _edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp); | ||
1980 | void _edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled); | ||
1981 | Eina_Bool _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp); | ||
1934 | 1982 | ||
1935 | void _edje_external_init(); | 1983 | void _edje_external_init(); |
1936 | void _edje_external_shutdown(); | 1984 | void _edje_external_shutdown(); |
diff --git a/libraries/edje/src/lib/edje_program.c b/libraries/edje/src/lib/edje_program.c index d80c7c9..d631364 100644 --- a/libraries/edje/src/lib/edje_program.c +++ b/libraries/edje/src/lib/edje_program.c | |||
@@ -531,7 +531,7 @@ _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, | |||
531 | } | 531 | } |
532 | 532 | ||
533 | if (rp->program) | 533 | if (rp->program) |
534 | _edje_program_end(ed, rp->program); | 534 | _edje_program_end(ed, rp->program); |
535 | _edje_part_description_apply(ed, rp, | 535 | _edje_part_description_apply(ed, rp, |
536 | rp->param1.description->state.name, | 536 | rp->param1.description->state.name, |
537 | rp->param1.description->state.value, | 537 | rp->param1.description->state.value, |
@@ -570,7 +570,7 @@ _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, | |||
570 | if (rp) | 570 | if (rp) |
571 | { | 571 | { |
572 | if (rp->program) | 572 | if (rp->program) |
573 | _edje_program_end(ed, rp->program); | 573 | _edje_program_end(ed, rp->program); |
574 | _edje_part_description_apply(ed, rp, | 574 | _edje_part_description_apply(ed, rp, |
575 | pr->state, | 575 | pr->state, |
576 | pr->value, | 576 | pr->value, |
@@ -873,8 +873,11 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
873 | { | 873 | { |
874 | Edje_Message_Signal emsg; | 874 | Edje_Message_Signal emsg; |
875 | const char *sep; | 875 | const char *sep; |
876 | Eina_Bool broadcast; | ||
876 | 877 | ||
878 | if (!ed->collection) return; | ||
877 | if (ed->delete_me) return; | 879 | if (ed->delete_me) return; |
880 | broadcast = ed->collection->broadcast_signal; | ||
878 | 881 | ||
879 | sep = strchr(sig, EDJE_PART_PATH_SEPARATOR); | 882 | sep = strchr(sig, EDJE_PART_PATH_SEPARATOR); |
880 | 883 | ||
@@ -958,6 +961,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
958 | if (!ed2) goto end; | 961 | if (!ed2) goto end; |
959 | 962 | ||
960 | _edje_emit(ed2, newsig, src); | 963 | _edje_emit(ed2, newsig, src); |
964 | broadcast = EINA_FALSE; | ||
961 | break; | 965 | break; |
962 | 966 | ||
963 | case EDJE_PART_TYPE_EXTERNAL: | 967 | case EDJE_PART_TYPE_EXTERNAL: |
@@ -976,6 +980,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
976 | if (!ed2) goto end; | 980 | if (!ed2) goto end; |
977 | _edje_emit(ed2, newsig, src); | 981 | _edje_emit(ed2, newsig, src); |
978 | } | 982 | } |
983 | broadcast = EINA_FALSE; | ||
979 | break ; | 984 | break ; |
980 | 985 | ||
981 | case EDJE_PART_TYPE_BOX: | 986 | case EDJE_PART_TYPE_BOX: |
@@ -988,6 +993,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
988 | ed2 = _edje_fetch(child); | 993 | ed2 = _edje_fetch(child); |
989 | if (!ed2) goto end; | 994 | if (!ed2) goto end; |
990 | _edje_emit(ed2, newsig, src); | 995 | _edje_emit(ed2, newsig, src); |
996 | broadcast = EINA_FALSE; | ||
991 | } | 997 | } |
992 | break ; | 998 | break ; |
993 | 999 | ||
@@ -1012,7 +1018,10 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
1012 | emsg.data = NULL; | 1018 | emsg.data = NULL; |
1013 | } | 1019 | } |
1014 | /* new sends code */ | 1020 | /* new sends code */ |
1015 | edje_object_message_send(ed->obj, EDJE_MESSAGE_SIGNAL, 0, &emsg); | 1021 | if (broadcast) |
1022 | edje_object_message_send(ed->obj, EDJE_MESSAGE_SIGNAL, 0, &emsg); | ||
1023 | else | ||
1024 | _edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg); | ||
1016 | /* old send code - use api now | 1025 | /* old send code - use api now |
1017 | _edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg); | 1026 | _edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg); |
1018 | EINA_LIST_FOREACH(ed->subobjs, l, obj) | 1027 | EINA_LIST_FOREACH(ed->subobjs, l, obj) |
@@ -1037,12 +1046,8 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f | |||
1037 | 1046 | ||
1038 | struct _Edje_Program_Data | 1047 | struct _Edje_Program_Data |
1039 | { | 1048 | { |
1040 | #ifdef EDJE_PROGRAM_CACHE | ||
1041 | Eina_List *matches; | 1049 | Eina_List *matches; |
1042 | int matched; | ||
1043 | #endif | ||
1044 | Edje *ed; | 1050 | Edje *ed; |
1045 | const char *signal; | ||
1046 | const char *source; | 1051 | const char *source; |
1047 | }; | 1052 | }; |
1048 | 1053 | ||
@@ -1056,33 +1061,16 @@ static Eina_Bool _edje_glob_callback(Edje_Program *pr, void *dt) | |||
1056 | { | 1061 | { |
1057 | rp = _edje_real_part_get(data->ed, pr->filter.part ? pr->filter.part : data->source); | 1062 | rp = _edje_real_part_get(data->ed, pr->filter.part ? pr->filter.part : data->source); |
1058 | if (rp) | 1063 | if (rp) |
1059 | exec = (rp->chosen_description->state.name == pr->filter.state); | 1064 | exec = (rp->chosen_description->state.name == pr->filter.state); |
1060 | } | 1065 | } |
1061 | 1066 | ||
1062 | #ifdef EDJE_PROGRAM_CACHE | 1067 | pr->exec = exec; |
1063 | data->matched++; | ||
1064 | #endif | ||
1065 | |||
1066 | if (exec) | ||
1067 | _edje_program_run(data->ed, pr, 0, data->signal, data->source); | ||
1068 | 1068 | ||
1069 | if (_edje_block_break(data->ed)) | ||
1070 | { | ||
1071 | #ifdef EDJE_PROGRAM_CACHE | ||
1072 | eina_list_free(data->matches); | ||
1073 | data->matches = NULL; | ||
1074 | #endif | ||
1075 | return EINA_TRUE; | ||
1076 | } | ||
1077 | |||
1078 | #ifdef EDJE_PROGRAM_CACHE | ||
1079 | data->matches = eina_list_append(data->matches, pr); | 1069 | data->matches = eina_list_append(data->matches, pr); |
1080 | #endif | ||
1081 | 1070 | ||
1082 | return EINA_FALSE; | 1071 | return EINA_FALSE; |
1083 | } | 1072 | } |
1084 | 1073 | ||
1085 | |||
1086 | void | 1074 | void |
1087 | _edje_callbacks_patterns_clean(Edje *ed) | 1075 | _edje_callbacks_patterns_clean(Edje *ed) |
1088 | { | 1076 | { |
@@ -1127,7 +1115,7 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1127 | 1115 | ||
1128 | if (ed->collection && ed->L) | 1116 | if (ed->collection && ed->L) |
1129 | _edje_lua2_script_func_signal(ed, sig, src); | 1117 | _edje_lua2_script_func_signal(ed, sig, src); |
1130 | 1118 | ||
1131 | if (ed->collection) | 1119 | if (ed->collection) |
1132 | { | 1120 | { |
1133 | #ifdef EDJE_PROGRAM_CACHE | 1121 | #ifdef EDJE_PROGRAM_CACHE |
@@ -1156,11 +1144,11 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1156 | 1144 | ||
1157 | if (eina_hash_find(ec->prog_cache.no_matches, tmps)) | 1145 | if (eina_hash_find(ec->prog_cache.no_matches, tmps)) |
1158 | { | 1146 | { |
1159 | done = 1; | 1147 | done = 1; |
1160 | } | 1148 | } |
1161 | else if ((matches = eina_hash_find(ec->prog_cache.matches, tmps))) | 1149 | else if ((matches = eina_hash_find(ec->prog_cache.matches, tmps))) |
1162 | { | 1150 | { |
1163 | EINA_LIST_FOREACH(matches, l, pr) | 1151 | EINA_LIST_FOREACH(matches, l, pr) |
1164 | { | 1152 | { |
1165 | Eina_Bool exec = EINA_TRUE; | 1153 | Eina_Bool exec = EINA_TRUE; |
1166 | 1154 | ||
@@ -1169,10 +1157,12 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1169 | Edje_Real_Part *rp; | 1157 | Edje_Real_Part *rp; |
1170 | 1158 | ||
1171 | rp = _edje_real_part_get(ed, pr->filter.part ? pr->filter.part : src); | 1159 | rp = _edje_real_part_get(ed, pr->filter.part ? pr->filter.part : src); |
1172 | if (rp) | 1160 | if (rp && !rp->program) |
1173 | exec = (rp->chosen_description->state.name == pr->filter.state); | 1161 | exec = (rp->chosen_description->state.name == pr->filter.state); |
1174 | } | 1162 | } |
1175 | 1163 | ||
1164 | pr->exec = exec; | ||
1165 | #if 0 | ||
1176 | if (exec) | 1166 | if (exec) |
1177 | { | 1167 | { |
1178 | _edje_program_run(ed, pr, 0, sig, src); | 1168 | _edje_program_run(ed, pr, 0, sig, src); |
@@ -1181,7 +1171,19 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1181 | goto break_prog; | 1171 | goto break_prog; |
1182 | } | 1172 | } |
1183 | } | 1173 | } |
1174 | #endif | ||
1184 | } | 1175 | } |
1176 | |||
1177 | EINA_LIST_FOREACH(matches, l, pr) | ||
1178 | if (pr->exec) | ||
1179 | { | ||
1180 | _edje_program_run(ed, pr, 0, sig, src); | ||
1181 | if (_edje_block_break(ed)) | ||
1182 | { | ||
1183 | goto break_prog; | ||
1184 | } | ||
1185 | } | ||
1186 | |||
1185 | done = 1; | 1187 | done = 1; |
1186 | } | 1188 | } |
1187 | } | 1189 | } |
@@ -1192,11 +1194,8 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1192 | 1194 | ||
1193 | data.ed = ed; | 1195 | data.ed = ed; |
1194 | data.source = src; | 1196 | data.source = src; |
1195 | data.signal = sig; | ||
1196 | #ifdef EDJE_PROGRAM_CACHE | ||
1197 | data.matched = 0; | ||
1198 | data.matches = NULL; | 1197 | data.matches = NULL; |
1199 | #endif | 1198 | |
1200 | if (ed->table_programs_size > 0) | 1199 | if (ed->table_programs_size > 0) |
1201 | { | 1200 | { |
1202 | const Eina_List *match; | 1201 | const Eina_List *match; |
@@ -1218,12 +1217,29 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src, | |||
1218 | ed->patterns.programs.exact_match); | 1217 | ed->patterns.programs.exact_match); |
1219 | EINA_LIST_FOREACH(match, l, pr) | 1218 | EINA_LIST_FOREACH(match, l, pr) |
1220 | _edje_glob_callback(pr, &data); | 1219 | _edje_glob_callback(pr, &data); |
1220 | |||
1221 | #ifdef EDJE_PROGRAM_CACHE | ||
1222 | EINA_LIST_FOREACH(data.matches, l, pr) | ||
1223 | #else | ||
1224 | EINA_LIST_FREE(data.matches, pr) | ||
1225 | #endif | ||
1226 | { | ||
1227 | if (pr->exec) | ||
1228 | _edje_program_run(ed, pr, 0, sig, src); | ||
1229 | |||
1230 | if (_edje_block_break(ed)) | ||
1231 | { | ||
1232 | eina_list_free(data.matches); | ||
1233 | data.matches = NULL; | ||
1234 | goto break_prog; | ||
1235 | } | ||
1236 | } | ||
1221 | } | 1237 | } |
1222 | 1238 | ||
1223 | #ifdef EDJE_PROGRAM_CACHE | 1239 | #ifdef EDJE_PROGRAM_CACHE |
1224 | if (tmps) | 1240 | if (tmps) |
1225 | { | 1241 | { |
1226 | if (data.matched == 0) | 1242 | if (data.matches == NULL) |
1227 | { | 1243 | { |
1228 | if (!ec->prog_cache.no_matches) | 1244 | if (!ec->prog_cache.no_matches) |
1229 | ec->prog_cache.no_matches = eina_hash_string_superfast_new(NULL); | 1245 | ec->prog_cache.no_matches = eina_hash_string_superfast_new(NULL); |
diff --git a/libraries/edje/src/lib/edje_util.c b/libraries/edje/src/lib/edje_util.c index 2205ba3..4ce22b5 100644 --- a/libraries/edje/src/lib/edje_util.c +++ b/libraries/edje/src/lib/edje_util.c | |||
@@ -905,7 +905,7 @@ edje_object_part_exists(const Evas_Object *obj, const char *part) | |||
905 | 905 | ||
906 | ed = _edje_fetch(obj); | 906 | ed = _edje_fetch(obj); |
907 | if ((!ed) || (!part)) return EINA_FALSE; | 907 | if ((!ed) || (!part)) return EINA_FALSE; |
908 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 908 | rp = _edje_real_part_recursive_get(ed, part); |
909 | if (!rp) return EINA_FALSE; | 909 | if (!rp) return EINA_FALSE; |
910 | return EINA_TRUE; | 910 | return EINA_TRUE; |
911 | } | 911 | } |
@@ -922,7 +922,7 @@ edje_object_part_object_get(const Evas_Object *obj, const char *part) | |||
922 | /* Need to recalc before providing the object. */ | 922 | /* Need to recalc before providing the object. */ |
923 | _edje_recalc_do(ed); | 923 | _edje_recalc_do(ed); |
924 | 924 | ||
925 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 925 | rp = _edje_real_part_recursive_get(ed, part); |
926 | if (!rp) return NULL; | 926 | if (!rp) return NULL; |
927 | return rp->object; | 927 | return rp->object; |
928 | } | 928 | } |
@@ -946,7 +946,7 @@ edje_object_part_geometry_get(const Evas_Object *obj, const char *part, Evas_Coo | |||
946 | /* Need to recalc before providing the object. */ | 946 | /* Need to recalc before providing the object. */ |
947 | _edje_recalc_do(ed); | 947 | _edje_recalc_do(ed); |
948 | 948 | ||
949 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 949 | rp = _edje_real_part_recursive_get(ed, part); |
950 | if (!rp) | 950 | if (!rp) |
951 | { | 951 | { |
952 | if (x) *x = 0; | 952 | if (x) *x = 0; |
@@ -1014,6 +1014,7 @@ _edje_object_part_text_raw_set(Evas_Object *obj, Edje_Real_Part *rp, const char | |||
1014 | if (text) rp->text.text = eina_stringshare_add(text); | 1014 | if (text) rp->text.text = eina_stringshare_add(text); |
1015 | rp->edje->dirty = 1; | 1015 | rp->edje->dirty = 1; |
1016 | rp->edje->recalc_call = 1; | 1016 | rp->edje->recalc_call = 1; |
1017 | rp->edje->recalc_hints = 1; | ||
1017 | #ifdef EDJE_CALC_CACHE | 1018 | #ifdef EDJE_CALC_CACHE |
1018 | rp->invalidate = 1; | 1019 | rp->invalidate = 1; |
1019 | #endif | 1020 | #endif |
@@ -1058,6 +1059,63 @@ _edje_object_part_text_raw_append(Evas_Object *obj, Edje_Real_Part *rp, const ch | |||
1058 | return EINA_TRUE; | 1059 | return EINA_TRUE; |
1059 | } | 1060 | } |
1060 | 1061 | ||
1062 | EAPI void | ||
1063 | edje_object_part_text_style_user_push(Evas_Object *obj, const char *part, | ||
1064 | const char *style) | ||
1065 | { | ||
1066 | Edje *ed; | ||
1067 | Edje_Real_Part *rp; | ||
1068 | Evas_Textblock_Style *ts; | ||
1069 | |||
1070 | ed = _edje_fetch(obj); | ||
1071 | if ((!ed) || (!part) || (!style)) return; | ||
1072 | rp = _edje_real_part_recursive_get(ed, part); | ||
1073 | if (!rp) return; | ||
1074 | if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return; | ||
1075 | |||
1076 | ts = evas_textblock_style_new(); | ||
1077 | evas_textblock_style_set(ts, style); | ||
1078 | evas_object_textblock_style_user_push(rp->object, ts); | ||
1079 | evas_textblock_style_free(ts); | ||
1080 | ed->recalc_hints = 1; | ||
1081 | } | ||
1082 | |||
1083 | EAPI void | ||
1084 | edje_object_part_text_style_user_pop(Evas_Object *obj, const char *part) | ||
1085 | { | ||
1086 | Edje *ed; | ||
1087 | Edje_Real_Part *rp; | ||
1088 | |||
1089 | ed = _edje_fetch(obj); | ||
1090 | if ((!ed) || (!part)) return; | ||
1091 | rp = _edje_real_part_recursive_get(ed, part); | ||
1092 | if (!rp) return; | ||
1093 | if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return; | ||
1094 | |||
1095 | evas_object_textblock_style_user_pop(rp->object); | ||
1096 | ed->recalc_hints = 1; | ||
1097 | } | ||
1098 | |||
1099 | EAPI const char * | ||
1100 | edje_object_part_text_style_user_peek(const Evas_Object *obj, const char *part) | ||
1101 | { | ||
1102 | Edje *ed; | ||
1103 | Edje_Real_Part *rp; | ||
1104 | const Evas_Textblock_Style *ts; | ||
1105 | |||
1106 | ed = _edje_fetch(obj); | ||
1107 | if ((!ed) || (!part)) return NULL; | ||
1108 | rp = _edje_real_part_recursive_get(ed, part); | ||
1109 | if (!rp) return NULL; | ||
1110 | if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return NULL; | ||
1111 | |||
1112 | ts = evas_object_textblock_style_user_peek(rp->object); | ||
1113 | if (ts) | ||
1114 | return evas_textblock_style_get(ts); | ||
1115 | else | ||
1116 | return NULL; | ||
1117 | } | ||
1118 | |||
1061 | EAPI Eina_Bool | 1119 | EAPI Eina_Bool |
1062 | edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text) | 1120 | edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text) |
1063 | { | 1121 | { |
@@ -1066,7 +1124,7 @@ edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text) | |||
1066 | 1124 | ||
1067 | ed = _edje_fetch(obj); | 1125 | ed = _edje_fetch(obj); |
1068 | if ((!ed) || (!part)) return EINA_FALSE; | 1126 | if ((!ed) || (!part)) return EINA_FALSE; |
1069 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1127 | rp = _edje_real_part_recursive_get(ed, part); |
1070 | if (!rp) return EINA_FALSE; | 1128 | if (!rp) return EINA_FALSE; |
1071 | if ((rp->part->type != EDJE_PART_TYPE_TEXT) && | 1129 | if ((rp->part->type != EDJE_PART_TYPE_TEXT) && |
1072 | (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return EINA_FALSE; | 1130 | (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return EINA_FALSE; |
@@ -1085,7 +1143,7 @@ edje_object_part_text_get(const Evas_Object *obj, const char *part) | |||
1085 | /* Need to recalc before providing the object. */ | 1143 | /* Need to recalc before providing the object. */ |
1086 | _edje_recalc_do(ed); | 1144 | _edje_recalc_do(ed); |
1087 | 1145 | ||
1088 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1146 | rp = _edje_real_part_recursive_get(ed, part); |
1089 | if (!rp) return NULL; | 1147 | if (!rp) return NULL; |
1090 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1148 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1091 | return _edje_entry_text_get(rp); | 1149 | return _edje_entry_text_get(rp); |
@@ -1241,7 +1299,7 @@ edje_object_part_text_unescaped_get(const Evas_Object *obj, const char *part) | |||
1241 | /* Need to recalc before providing the object. */ | 1299 | /* Need to recalc before providing the object. */ |
1242 | _edje_recalc_do(ed); | 1300 | _edje_recalc_do(ed); |
1243 | 1301 | ||
1244 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1302 | rp = _edje_real_part_recursive_get(ed, part); |
1245 | if (!rp) return NULL; | 1303 | if (!rp) return NULL; |
1246 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1304 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1247 | { | 1305 | { |
@@ -1268,7 +1326,7 @@ edje_object_part_text_selection_get(const Evas_Object *obj, const char *part) | |||
1268 | 1326 | ||
1269 | ed = _edje_fetch(obj); | 1327 | ed = _edje_fetch(obj); |
1270 | if ((!ed) || (!part)) return NULL; | 1328 | if ((!ed) || (!part)) return NULL; |
1271 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1329 | rp = _edje_real_part_recursive_get(ed, part); |
1272 | if (!rp) return NULL; | 1330 | if (!rp) return NULL; |
1273 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1331 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1274 | return _edje_entry_selection_get(rp); | 1332 | return _edje_entry_selection_get(rp); |
@@ -1283,7 +1341,7 @@ edje_object_part_text_select_none(const Evas_Object *obj, const char *part) | |||
1283 | 1341 | ||
1284 | ed = _edje_fetch(obj); | 1342 | ed = _edje_fetch(obj); |
1285 | if ((!ed) || (!part)) return; | 1343 | if ((!ed) || (!part)) return; |
1286 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1344 | rp = _edje_real_part_recursive_get(ed, part); |
1287 | if (!rp) return; | 1345 | if (!rp) return; |
1288 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1346 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1289 | _edje_entry_select_none(rp); | 1347 | _edje_entry_select_none(rp); |
@@ -1297,7 +1355,7 @@ edje_object_part_text_select_all(const Evas_Object *obj, const char *part) | |||
1297 | 1355 | ||
1298 | ed = _edje_fetch(obj); | 1356 | ed = _edje_fetch(obj); |
1299 | if ((!ed) || (!part)) return; | 1357 | if ((!ed) || (!part)) return; |
1300 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1358 | rp = _edje_real_part_recursive_get(ed, part); |
1301 | if (!rp) return; | 1359 | if (!rp) return; |
1302 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1360 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1303 | _edje_entry_select_all(rp); | 1361 | _edje_entry_select_all(rp); |
@@ -1311,13 +1369,14 @@ edje_object_part_text_insert(Evas_Object *obj, const char *part, const char *tex | |||
1311 | 1369 | ||
1312 | ed = _edje_fetch(obj); | 1370 | ed = _edje_fetch(obj); |
1313 | if ((!ed) || (!part)) return; | 1371 | if ((!ed) || (!part)) return; |
1314 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1372 | rp = _edje_real_part_recursive_get(ed, part); |
1315 | if (!rp) return; | 1373 | if (!rp) return; |
1316 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; | 1374 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; |
1317 | if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return; | 1375 | if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return; |
1318 | _edje_entry_text_markup_insert(rp, text); | 1376 | _edje_entry_text_markup_insert(rp, text); |
1319 | rp->edje->dirty = 1; | 1377 | rp->edje->dirty = 1; |
1320 | rp->edje->recalc_call = 1; | 1378 | rp->edje->recalc_call = 1; |
1379 | rp->edje->recalc_hints = 1; | ||
1321 | #ifdef EDJE_CALC_CACHE | 1380 | #ifdef EDJE_CALC_CACHE |
1322 | rp->invalidate = 1; | 1381 | rp->invalidate = 1; |
1323 | #endif | 1382 | #endif |
@@ -1334,12 +1393,13 @@ edje_object_part_text_append(Evas_Object *obj, const char *part, const char *tex | |||
1334 | 1393 | ||
1335 | ed = _edje_fetch(obj); | 1394 | ed = _edje_fetch(obj); |
1336 | if ((!ed) || (!part)) return; | 1395 | if ((!ed) || (!part)) return; |
1337 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1396 | rp = _edje_real_part_recursive_get(ed, part); |
1338 | if (!rp) return; | 1397 | if (!rp) return; |
1339 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; | 1398 | if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return; |
1340 | _edje_object_part_text_raw_append(obj, rp, part, text); | 1399 | _edje_object_part_text_raw_append(obj, rp, part, text); |
1341 | rp->edje->dirty = 1; | 1400 | rp->edje->dirty = 1; |
1342 | rp->edje->recalc_call = 1; | 1401 | rp->edje->recalc_call = 1; |
1402 | rp->edje->recalc_hints = 1; | ||
1343 | #ifdef EDJE_CALC_CACHE | 1403 | #ifdef EDJE_CALC_CACHE |
1344 | rp->invalidate = 1; | 1404 | rp->invalidate = 1; |
1345 | #endif | 1405 | #endif |
@@ -1356,7 +1416,7 @@ edje_object_part_text_anchor_list_get(const Evas_Object *obj, const char *part) | |||
1356 | 1416 | ||
1357 | ed = _edje_fetch(obj); | 1417 | ed = _edje_fetch(obj); |
1358 | if ((!ed) || (!part)) return NULL; | 1418 | if ((!ed) || (!part)) return NULL; |
1359 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1419 | rp = _edje_real_part_recursive_get(ed, part); |
1360 | if (!rp) return NULL; | 1420 | if (!rp) return NULL; |
1361 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1421 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1362 | return _edje_entry_anchors_list(rp); | 1422 | return _edje_entry_anchors_list(rp); |
@@ -1371,7 +1431,7 @@ edje_object_part_text_anchor_geometry_get(const Evas_Object *obj, const char *pa | |||
1371 | 1431 | ||
1372 | ed = _edje_fetch(obj); | 1432 | ed = _edje_fetch(obj); |
1373 | if ((!ed) || (!part)) return NULL; | 1433 | if ((!ed) || (!part)) return NULL; |
1374 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1434 | rp = _edje_real_part_recursive_get(ed, part); |
1375 | if (!rp) return NULL; | 1435 | if (!rp) return NULL; |
1376 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1436 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1377 | return _edje_entry_anchor_geometry_get(rp, anchor); | 1437 | return _edje_entry_anchor_geometry_get(rp, anchor); |
@@ -1386,7 +1446,7 @@ edje_object_part_text_item_list_get(const Evas_Object *obj, const char *part) | |||
1386 | 1446 | ||
1387 | ed = _edje_fetch(obj); | 1447 | ed = _edje_fetch(obj); |
1388 | if ((!ed) || (!part)) return NULL; | 1448 | if ((!ed) || (!part)) return NULL; |
1389 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1449 | rp = _edje_real_part_recursive_get(ed, part); |
1390 | if (!rp) return NULL; | 1450 | if (!rp) return NULL; |
1391 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1451 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1392 | return _edje_entry_items_list(rp); | 1452 | return _edje_entry_items_list(rp); |
@@ -1401,7 +1461,7 @@ edje_object_part_text_item_geometry_get(const Evas_Object *obj, const char *part | |||
1401 | 1461 | ||
1402 | ed = _edje_fetch(obj); | 1462 | ed = _edje_fetch(obj); |
1403 | if ((!ed) || (!part)) return EINA_FALSE; | 1463 | if ((!ed) || (!part)) return EINA_FALSE; |
1404 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1464 | rp = _edje_real_part_recursive_get(ed, part); |
1405 | if (!rp) return EINA_FALSE; | 1465 | if (!rp) return EINA_FALSE; |
1406 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1466 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1407 | return _edje_entry_item_geometry_get(rp, item, cx, cy, cw, ch); | 1467 | return _edje_entry_item_geometry_get(rp, item, cx, cy, cw, ch); |
@@ -1420,7 +1480,7 @@ edje_object_part_text_cursor_geometry_get(const Evas_Object *obj, const char *pa | |||
1420 | if (w) *w = 0; | 1480 | if (w) *w = 0; |
1421 | if (h) *h = 0; | 1481 | if (h) *h = 0; |
1422 | if ((!ed) || (!part)) return; | 1482 | if ((!ed) || (!part)) return; |
1423 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1483 | rp = _edje_real_part_recursive_get(ed, part); |
1424 | if (!rp) return; | 1484 | if (!rp) return; |
1425 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1485 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1426 | { | 1486 | { |
@@ -1432,6 +1492,20 @@ edje_object_part_text_cursor_geometry_get(const Evas_Object *obj, const char *pa | |||
1432 | } | 1492 | } |
1433 | 1493 | ||
1434 | EAPI void | 1494 | EAPI void |
1495 | edje_object_part_text_user_insert(const Evas_Object *obj, const char *part, const char *text) | ||
1496 | { | ||
1497 | Edje *ed; | ||
1498 | Edje_Real_Part *rp; | ||
1499 | |||
1500 | ed = _edje_fetch(obj); | ||
1501 | if ((!ed) || (!part)) return; | ||
1502 | rp = _edje_real_part_recursive_get(ed, part); | ||
1503 | if (!rp) return; | ||
1504 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1505 | _edje_entry_user_insert(rp, text); | ||
1506 | } | ||
1507 | |||
1508 | EAPI void | ||
1435 | edje_object_part_text_select_allow_set(const Evas_Object *obj, const char *part, Eina_Bool allow) | 1509 | edje_object_part_text_select_allow_set(const Evas_Object *obj, const char *part, Eina_Bool allow) |
1436 | { | 1510 | { |
1437 | Edje *ed; | 1511 | Edje *ed; |
@@ -1439,7 +1513,7 @@ edje_object_part_text_select_allow_set(const Evas_Object *obj, const char *part, | |||
1439 | 1513 | ||
1440 | ed = _edje_fetch(obj); | 1514 | ed = _edje_fetch(obj); |
1441 | if ((!ed) || (!part)) return; | 1515 | if ((!ed) || (!part)) return; |
1442 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1516 | rp = _edje_real_part_recursive_get(ed, part); |
1443 | if (!rp) return; | 1517 | if (!rp) return; |
1444 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1518 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1445 | _edje_entry_select_allow_set(rp, allow); | 1519 | _edje_entry_select_allow_set(rp, allow); |
@@ -1453,7 +1527,7 @@ edje_object_part_text_select_abort(const Evas_Object *obj, const char *part) | |||
1453 | 1527 | ||
1454 | ed = _edje_fetch(obj); | 1528 | ed = _edje_fetch(obj); |
1455 | if ((!ed) || (!part)) return; | 1529 | if ((!ed) || (!part)) return; |
1456 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1530 | rp = _edje_real_part_recursive_get(ed, part); |
1457 | if (!rp) return; | 1531 | if (!rp) return; |
1458 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1532 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1459 | _edje_entry_select_abort(rp); | 1533 | _edje_entry_select_abort(rp); |
@@ -1467,7 +1541,7 @@ edje_object_part_text_select_begin(const Evas_Object *obj, const char *part) | |||
1467 | 1541 | ||
1468 | ed = _edje_fetch(obj); | 1542 | ed = _edje_fetch(obj); |
1469 | if ((!ed) || (!part)) return; | 1543 | if ((!ed) || (!part)) return; |
1470 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1544 | rp = _edje_real_part_recursive_get(ed, part); |
1471 | if (!rp) return; | 1545 | if (!rp) return; |
1472 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1546 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1473 | _edje_entry_select_begin(rp); | 1547 | _edje_entry_select_begin(rp); |
@@ -1481,12 +1555,30 @@ edje_object_part_text_select_extend(const Evas_Object *obj, const char *part) | |||
1481 | 1555 | ||
1482 | ed = _edje_fetch(obj); | 1556 | ed = _edje_fetch(obj); |
1483 | if ((!ed) || (!part)) return; | 1557 | if ((!ed) || (!part)) return; |
1484 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1558 | rp = _edje_real_part_recursive_get(ed, part); |
1485 | if (!rp) return; | 1559 | if (!rp) return; |
1486 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1560 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1487 | _edje_entry_select_extend(rp); | 1561 | _edje_entry_select_extend(rp); |
1488 | } | 1562 | } |
1489 | 1563 | ||
1564 | EAPI void * | ||
1565 | edje_object_part_text_imf_context_get(const Evas_Object *obj, const char *part) | ||
1566 | { | ||
1567 | Edje *ed; | ||
1568 | Edje_Real_Part *rp; | ||
1569 | |||
1570 | ed = _edje_fetch(obj); | ||
1571 | if ((!ed) || (!part)) return NULL; | ||
1572 | |||
1573 | rp = _edje_real_part_recursive_get(ed, (char *)part); | ||
1574 | if (!rp) return NULL; | ||
1575 | |||
1576 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1577 | return _edje_entry_imf_context_get(rp); | ||
1578 | else | ||
1579 | return NULL; | ||
1580 | } | ||
1581 | |||
1490 | EAPI Eina_Bool | 1582 | EAPI Eina_Bool |
1491 | edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Cursor cur) | 1583 | edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Cursor cur) |
1492 | { | 1584 | { |
@@ -1495,7 +1587,7 @@ edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Curso | |||
1495 | 1587 | ||
1496 | ed = _edje_fetch(obj); | 1588 | ed = _edje_fetch(obj); |
1497 | if ((!ed) || (!part)) return EINA_FALSE; | 1589 | if ((!ed) || (!part)) return EINA_FALSE; |
1498 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1590 | rp = _edje_real_part_recursive_get(ed, part); |
1499 | if (!rp) return EINA_FALSE; | 1591 | if (!rp) return EINA_FALSE; |
1500 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1592 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1501 | { | 1593 | { |
@@ -1512,7 +1604,7 @@ edje_object_part_text_cursor_prev(Evas_Object *obj, const char *part, Edje_Curso | |||
1512 | 1604 | ||
1513 | ed = _edje_fetch(obj); | 1605 | ed = _edje_fetch(obj); |
1514 | if ((!ed) || (!part)) return EINA_FALSE; | 1606 | if ((!ed) || (!part)) return EINA_FALSE; |
1515 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1607 | rp = _edje_real_part_recursive_get(ed, part); |
1516 | if (!rp) return EINA_FALSE; | 1608 | if (!rp) return EINA_FALSE; |
1517 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1609 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1518 | { | 1610 | { |
@@ -1529,7 +1621,7 @@ edje_object_part_text_cursor_up(Evas_Object *obj, const char *part, Edje_Cursor | |||
1529 | 1621 | ||
1530 | ed = _edje_fetch(obj); | 1622 | ed = _edje_fetch(obj); |
1531 | if ((!ed) || (!part)) return EINA_FALSE; | 1623 | if ((!ed) || (!part)) return EINA_FALSE; |
1532 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1624 | rp = _edje_real_part_recursive_get(ed, part); |
1533 | if (!rp) return EINA_FALSE; | 1625 | if (!rp) return EINA_FALSE; |
1534 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1626 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1535 | { | 1627 | { |
@@ -1546,7 +1638,7 @@ edje_object_part_text_cursor_down(Evas_Object *obj, const char *part, Edje_Curso | |||
1546 | 1638 | ||
1547 | ed = _edje_fetch(obj); | 1639 | ed = _edje_fetch(obj); |
1548 | if ((!ed) || (!part)) return EINA_FALSE; | 1640 | if ((!ed) || (!part)) return EINA_FALSE; |
1549 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1641 | rp = _edje_real_part_recursive_get(ed, part); |
1550 | if (!rp) return EINA_FALSE; | 1642 | if (!rp) return EINA_FALSE; |
1551 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1643 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1552 | { | 1644 | { |
@@ -1563,7 +1655,7 @@ edje_object_part_text_cursor_begin_set(Evas_Object *obj, const char *part, Edje_ | |||
1563 | 1655 | ||
1564 | ed = _edje_fetch(obj); | 1656 | ed = _edje_fetch(obj); |
1565 | if ((!ed) || (!part)) return; | 1657 | if ((!ed) || (!part)) return; |
1566 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1658 | rp = _edje_real_part_recursive_get(ed, part); |
1567 | if (!rp) return; | 1659 | if (!rp) return; |
1568 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1660 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1569 | { | 1661 | { |
@@ -1579,7 +1671,7 @@ edje_object_part_text_cursor_end_set(Evas_Object *obj, const char *part, Edje_Cu | |||
1579 | 1671 | ||
1580 | ed = _edje_fetch(obj); | 1672 | ed = _edje_fetch(obj); |
1581 | if ((!ed) || (!part)) return; | 1673 | if ((!ed) || (!part)) return; |
1582 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1674 | rp = _edje_real_part_recursive_get(ed, part); |
1583 | if (!rp) return; | 1675 | if (!rp) return; |
1584 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1676 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1585 | { | 1677 | { |
@@ -1595,7 +1687,7 @@ edje_object_part_text_cursor_copy(Evas_Object *obj, const char *part, Edje_Curso | |||
1595 | 1687 | ||
1596 | ed = _edje_fetch(obj); | 1688 | ed = _edje_fetch(obj); |
1597 | if ((!ed) || (!part)) return; | 1689 | if ((!ed) || (!part)) return; |
1598 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1690 | rp = _edje_real_part_recursive_get(ed, part); |
1599 | if (!rp) return; | 1691 | if (!rp) return; |
1600 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1692 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1601 | { | 1693 | { |
@@ -1611,7 +1703,7 @@ edje_object_part_text_cursor_line_begin_set(Evas_Object *obj, const char *part, | |||
1611 | 1703 | ||
1612 | ed = _edje_fetch(obj); | 1704 | ed = _edje_fetch(obj); |
1613 | if ((!ed) || (!part)) return; | 1705 | if ((!ed) || (!part)) return; |
1614 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1706 | rp = _edje_real_part_recursive_get(ed, part); |
1615 | if (!rp) return; | 1707 | if (!rp) return; |
1616 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1708 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1617 | { | 1709 | { |
@@ -1627,7 +1719,7 @@ edje_object_part_text_cursor_line_end_set(Evas_Object *obj, const char *part, Ed | |||
1627 | 1719 | ||
1628 | ed = _edje_fetch(obj); | 1720 | ed = _edje_fetch(obj); |
1629 | if ((!ed) || (!part)) return; | 1721 | if ((!ed) || (!part)) return; |
1630 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1722 | rp = _edje_real_part_recursive_get(ed, part); |
1631 | if (!rp) return; | 1723 | if (!rp) return; |
1632 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1724 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1633 | { | 1725 | { |
@@ -1644,7 +1736,7 @@ edje_object_part_text_cursor_coord_set(Evas_Object *obj, const char *part, | |||
1644 | 1736 | ||
1645 | ed = _edje_fetch(obj); | 1737 | ed = _edje_fetch(obj); |
1646 | if ((!ed) || (!part)) return EINA_FALSE; | 1738 | if ((!ed) || (!part)) return EINA_FALSE; |
1647 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1739 | rp = _edje_real_part_recursive_get(ed, part); |
1648 | if (!rp) return EINA_FALSE; | 1740 | if (!rp) return EINA_FALSE; |
1649 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1741 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1650 | { | 1742 | { |
@@ -1661,7 +1753,7 @@ edje_object_part_text_cursor_is_format_get(const Evas_Object *obj, const char *p | |||
1661 | 1753 | ||
1662 | ed = _edje_fetch(obj); | 1754 | ed = _edje_fetch(obj); |
1663 | if ((!ed) || (!part)) return EINA_FALSE; | 1755 | if ((!ed) || (!part)) return EINA_FALSE; |
1664 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1756 | rp = _edje_real_part_recursive_get(ed, part); |
1665 | if (!rp) return EINA_FALSE; | 1757 | if (!rp) return EINA_FALSE; |
1666 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1758 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1667 | { | 1759 | { |
@@ -1678,7 +1770,7 @@ edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const | |||
1678 | 1770 | ||
1679 | ed = _edje_fetch(obj); | 1771 | ed = _edje_fetch(obj); |
1680 | if ((!ed) || (!part)) return 0; | 1772 | if ((!ed) || (!part)) return 0; |
1681 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1773 | rp = _edje_real_part_recursive_get(ed, part); |
1682 | if (!rp) return 0; | 1774 | if (!rp) return 0; |
1683 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1775 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1684 | { | 1776 | { |
@@ -1738,7 +1830,7 @@ edje_object_part_text_cursor_pos_get(const Evas_Object *obj, const char *part, E | |||
1738 | } | 1830 | } |
1739 | 1831 | ||
1740 | EAPI void | 1832 | EAPI void |
1741 | edje_object_part_text_input_panel_layout_set(const Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout) | 1833 | edje_object_part_text_imf_context_reset(const Evas_Object *obj, const char *part) |
1742 | { | 1834 | { |
1743 | Edje *ed; | 1835 | Edje *ed; |
1744 | Edje_Real_Part *rp; | 1836 | Edje_Real_Part *rp; |
@@ -1749,7 +1841,23 @@ edje_object_part_text_input_panel_layout_set(const Evas_Object *obj, const char | |||
1749 | if (!rp) return; | 1841 | if (!rp) return; |
1750 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1842 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1751 | { | 1843 | { |
1752 | return _edje_entry_input_panel_layout_set(rp, layout); | 1844 | _edje_entry_imf_context_reset(rp); |
1845 | } | ||
1846 | } | ||
1847 | |||
1848 | EAPI void | ||
1849 | edje_object_part_text_input_panel_layout_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout) | ||
1850 | { | ||
1851 | Edje *ed; | ||
1852 | Edje_Real_Part *rp; | ||
1853 | |||
1854 | ed = _edje_fetch(obj); | ||
1855 | if ((!ed) || (!part)) return; | ||
1856 | rp = _edje_real_part_recursive_get(ed, part); | ||
1857 | if (!rp) return; | ||
1858 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1859 | { | ||
1860 | _edje_entry_input_panel_layout_set(rp, layout); | ||
1753 | } | 1861 | } |
1754 | } | 1862 | } |
1755 | 1863 | ||
@@ -1771,14 +1879,14 @@ edje_object_part_text_input_panel_layout_get(const Evas_Object *obj, const char | |||
1771 | } | 1879 | } |
1772 | 1880 | ||
1773 | EAPI void | 1881 | EAPI void |
1774 | edje_object_part_text_autocapital_type_set(const Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type) | 1882 | edje_object_part_text_autocapital_type_set(Evas_Object *obj, const char *part, Edje_Text_Autocapital_Type autocapital_type) |
1775 | { | 1883 | { |
1776 | Edje *ed; | 1884 | Edje *ed; |
1777 | Edje_Real_Part *rp; | 1885 | Edje_Real_Part *rp; |
1778 | 1886 | ||
1779 | ed = _edje_fetch(obj); | 1887 | ed = _edje_fetch(obj); |
1780 | if ((!ed) || (!part)) return; | 1888 | if ((!ed) || (!part)) return; |
1781 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1889 | rp = _edje_real_part_recursive_get(ed, part); |
1782 | if (!rp) return; | 1890 | if (!rp) return; |
1783 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1891 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1784 | { | 1892 | { |
@@ -1794,7 +1902,7 @@ edje_object_part_text_autocapital_type_get(const Evas_Object *obj, const char *p | |||
1794 | 1902 | ||
1795 | ed = _edje_fetch(obj); | 1903 | ed = _edje_fetch(obj); |
1796 | if ((!ed) || (!part)) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE; | 1904 | if ((!ed) || (!part)) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE; |
1797 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 1905 | rp = _edje_real_part_recursive_get(ed, part); |
1798 | if (!rp) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE; | 1906 | if (!rp) return EDJE_TEXT_AUTOCAPITAL_TYPE_NONE; |
1799 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1907 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1800 | { | 1908 | { |
@@ -1804,7 +1912,40 @@ edje_object_part_text_autocapital_type_get(const Evas_Object *obj, const char *p | |||
1804 | } | 1912 | } |
1805 | 1913 | ||
1806 | EAPI void | 1914 | EAPI void |
1807 | edje_object_part_text_input_panel_enabled_set(const Evas_Object *obj, const char *part, Eina_Bool enabled) | 1915 | edje_object_part_text_prediction_allow_set(Evas_Object *obj, const char *part, Eina_Bool prediction) |
1916 | { | ||
1917 | Edje *ed; | ||
1918 | Edje_Real_Part *rp; | ||
1919 | |||
1920 | ed = _edje_fetch(obj); | ||
1921 | if ((!ed) || (!part)) return; | ||
1922 | rp = _edje_real_part_recursive_get(ed, part); | ||
1923 | if (!rp) return; | ||
1924 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1925 | { | ||
1926 | _edje_entry_prediction_allow_set(rp, prediction); | ||
1927 | } | ||
1928 | } | ||
1929 | |||
1930 | EAPI Eina_Bool | ||
1931 | edje_object_part_text_prediction_allow_get(const Evas_Object *obj, const char *part) | ||
1932 | { | ||
1933 | Edje *ed; | ||
1934 | Edje_Real_Part *rp; | ||
1935 | |||
1936 | ed = _edje_fetch(obj); | ||
1937 | if ((!ed) || (!part)) return EINA_FALSE; | ||
1938 | rp = _edje_real_part_recursive_get(ed, part); | ||
1939 | if (!rp) return EINA_FALSE; | ||
1940 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1941 | { | ||
1942 | return _edje_entry_prediction_allow_get(rp); | ||
1943 | } | ||
1944 | return EINA_FALSE; | ||
1945 | } | ||
1946 | |||
1947 | EAPI void | ||
1948 | edje_object_part_text_input_panel_enabled_set(Evas_Object *obj, const char *part, Eina_Bool enabled) | ||
1808 | { | 1949 | { |
1809 | Edje *ed; | 1950 | Edje *ed; |
1810 | Edje_Real_Part *rp; | 1951 | Edje_Real_Part *rp; |
@@ -1815,7 +1956,7 @@ edje_object_part_text_input_panel_enabled_set(const Evas_Object *obj, const char | |||
1815 | if (!rp) return; | 1956 | if (!rp) return; |
1816 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | 1957 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) |
1817 | { | 1958 | { |
1818 | return _edje_entry_input_panel_enabled_set(rp, enabled); | 1959 | _edje_entry_input_panel_enabled_set(rp, enabled); |
1819 | } | 1960 | } |
1820 | } | 1961 | } |
1821 | 1962 | ||
@@ -1837,6 +1978,165 @@ edje_object_part_text_input_panel_enabled_get(const Evas_Object *obj, const char | |||
1837 | } | 1978 | } |
1838 | 1979 | ||
1839 | EAPI void | 1980 | EAPI void |
1981 | edje_object_part_text_input_panel_show(const Evas_Object *obj, const char *part) | ||
1982 | { | ||
1983 | Edje *ed; | ||
1984 | Edje_Real_Part *rp; | ||
1985 | |||
1986 | ed = _edje_fetch(obj); | ||
1987 | if ((!ed) || (!part)) return; | ||
1988 | rp = _edje_real_part_recursive_get(ed, part); | ||
1989 | if (!rp) return; | ||
1990 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
1991 | _edje_entry_input_panel_show(rp); | ||
1992 | } | ||
1993 | |||
1994 | EAPI void | ||
1995 | edje_object_part_text_input_panel_hide(const Evas_Object *obj, const char *part) | ||
1996 | { | ||
1997 | Edje *ed; | ||
1998 | Edje_Real_Part *rp; | ||
1999 | |||
2000 | ed = _edje_fetch(obj); | ||
2001 | if ((!ed) || (!part)) return; | ||
2002 | rp = _edje_real_part_recursive_get(ed, part); | ||
2003 | if (!rp) return; | ||
2004 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2005 | _edje_entry_input_panel_hide(rp); | ||
2006 | } | ||
2007 | |||
2008 | EAPI void | ||
2009 | edje_object_part_text_input_panel_language_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Lang lang) | ||
2010 | { | ||
2011 | Edje *ed; | ||
2012 | Edje_Real_Part *rp; | ||
2013 | |||
2014 | ed = _edje_fetch(obj); | ||
2015 | if ((!ed) || (!part)) return; | ||
2016 | rp = _edje_real_part_recursive_get(ed, part); | ||
2017 | if (!rp) return; | ||
2018 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2019 | { | ||
2020 | _edje_entry_input_panel_language_set(rp, lang); | ||
2021 | } | ||
2022 | } | ||
2023 | |||
2024 | EAPI Edje_Input_Panel_Lang | ||
2025 | edje_object_part_text_input_panel_language_get(const Evas_Object *obj, const char *part) | ||
2026 | { | ||
2027 | Edje *ed; | ||
2028 | Edje_Real_Part *rp; | ||
2029 | |||
2030 | ed = _edje_fetch(obj); | ||
2031 | if ((!ed) || (!part)) return EDJE_INPUT_PANEL_LANG_AUTOMATIC; | ||
2032 | rp = _edje_real_part_recursive_get(ed, part); | ||
2033 | if (!rp) return EDJE_INPUT_PANEL_LANG_AUTOMATIC; | ||
2034 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2035 | { | ||
2036 | return _edje_entry_input_panel_language_get(rp); | ||
2037 | } | ||
2038 | return EDJE_INPUT_PANEL_LANG_AUTOMATIC; | ||
2039 | } | ||
2040 | |||
2041 | EAPI void | ||
2042 | edje_object_part_text_input_panel_imdata_set(Evas_Object *obj, const char *part, const void *data, int len) | ||
2043 | { | ||
2044 | Edje *ed; | ||
2045 | Edje_Real_Part *rp; | ||
2046 | |||
2047 | ed = _edje_fetch(obj); | ||
2048 | if ((!ed) || (!part)) return; | ||
2049 | rp = _edje_real_part_recursive_get(ed, part); | ||
2050 | if (!rp) return; | ||
2051 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2052 | { | ||
2053 | _edje_entry_input_panel_imdata_set(rp, data, len); | ||
2054 | } | ||
2055 | } | ||
2056 | |||
2057 | EAPI void | ||
2058 | edje_object_part_text_input_panel_imdata_get(const Evas_Object *obj, const char *part, void *data, int *len) | ||
2059 | { | ||
2060 | Edje *ed; | ||
2061 | Edje_Real_Part *rp; | ||
2062 | |||
2063 | ed = _edje_fetch(obj); | ||
2064 | if ((!ed) || (!part)) return; | ||
2065 | rp = _edje_real_part_recursive_get(ed, part); | ||
2066 | if (!rp) return; | ||
2067 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2068 | { | ||
2069 | _edje_entry_input_panel_imdata_get(rp, data, len); | ||
2070 | } | ||
2071 | } | ||
2072 | |||
2073 | EAPI void | ||
2074 | edje_object_part_text_input_panel_return_key_type_set(Evas_Object *obj, const char *part, Edje_Input_Panel_Return_Key_Type return_key_type) | ||
2075 | { | ||
2076 | Edje *ed; | ||
2077 | Edje_Real_Part *rp; | ||
2078 | |||
2079 | ed = _edje_fetch(obj); | ||
2080 | if ((!ed) || (!part)) return; | ||
2081 | rp = _edje_real_part_recursive_get(ed, part); | ||
2082 | if (!rp) return; | ||
2083 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2084 | { | ||
2085 | _edje_entry_input_panel_return_key_type_set(rp, return_key_type); | ||
2086 | } | ||
2087 | } | ||
2088 | |||
2089 | EAPI Edje_Input_Panel_Return_Key_Type | ||
2090 | edje_object_part_text_input_panel_return_key_type_get(const Evas_Object *obj, const char *part) | ||
2091 | { | ||
2092 | Edje *ed; | ||
2093 | Edje_Real_Part *rp; | ||
2094 | |||
2095 | ed = _edje_fetch(obj); | ||
2096 | if ((!ed) || (!part)) return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2097 | rp = _edje_real_part_recursive_get(ed, part); | ||
2098 | if (!rp) return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2099 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2100 | { | ||
2101 | return _edje_entry_input_panel_return_key_type_get(rp); | ||
2102 | } | ||
2103 | return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT; | ||
2104 | } | ||
2105 | |||
2106 | EAPI void | ||
2107 | edje_object_part_text_input_panel_return_key_disabled_set(Evas_Object *obj, const char *part, Eina_Bool disabled) | ||
2108 | { | ||
2109 | Edje *ed; | ||
2110 | Edje_Real_Part *rp; | ||
2111 | |||
2112 | ed = _edje_fetch(obj); | ||
2113 | if ((!ed) || (!part)) return; | ||
2114 | rp = _edje_real_part_recursive_get(ed, part); | ||
2115 | if (!rp) return; | ||
2116 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2117 | { | ||
2118 | _edje_entry_input_panel_return_key_disabled_set(rp, disabled); | ||
2119 | } | ||
2120 | } | ||
2121 | |||
2122 | EAPI Eina_Bool | ||
2123 | edje_object_part_text_input_panel_return_key_disabled_get(const Evas_Object *obj, const char *part) | ||
2124 | { | ||
2125 | Edje *ed; | ||
2126 | Edje_Real_Part *rp; | ||
2127 | |||
2128 | ed = _edje_fetch(obj); | ||
2129 | if ((!ed) || (!part)) return EINA_FALSE; | ||
2130 | rp = _edje_real_part_recursive_get(ed, part); | ||
2131 | if (!rp) return EINA_FALSE; | ||
2132 | if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) | ||
2133 | { | ||
2134 | return _edje_entry_input_panel_return_key_disabled_get(rp); | ||
2135 | } | ||
2136 | return EINA_FALSE; | ||
2137 | } | ||
2138 | |||
2139 | EAPI void | ||
1840 | edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data) | 2140 | edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data) |
1841 | { | 2141 | { |
1842 | Edje *ed; | 2142 | Edje *ed; |
@@ -1901,6 +2201,71 @@ edje_object_text_insert_filter_callback_del_full(Evas_Object *obj, const char *p | |||
1901 | return NULL; | 2201 | return NULL; |
1902 | } | 2202 | } |
1903 | 2203 | ||
2204 | EAPI void | ||
2205 | edje_object_text_markup_filter_callback_add(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func, void *data) | ||
2206 | { | ||
2207 | Edje *ed; | ||
2208 | Edje_Markup_Filter_Callback *cb; | ||
2209 | |||
2210 | ed = _edje_fetch(obj); | ||
2211 | if ((!ed) || (!part)) return; | ||
2212 | cb = calloc(1, sizeof(Edje_Markup_Filter_Callback)); | ||
2213 | cb->part = eina_stringshare_add(part); | ||
2214 | cb->func = func; | ||
2215 | cb->data = (void *)data; | ||
2216 | ed->markup_filter_callbacks = | ||
2217 | eina_list_append(ed->markup_filter_callbacks, cb); | ||
2218 | } | ||
2219 | |||
2220 | EAPI void * | ||
2221 | edje_object_text_markup_filter_callback_del(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func) | ||
2222 | { | ||
2223 | Edje *ed; | ||
2224 | Edje_Markup_Filter_Callback *cb; | ||
2225 | Eina_List *l; | ||
2226 | |||
2227 | ed = _edje_fetch(obj); | ||
2228 | if ((!ed) || (!part)) return NULL; | ||
2229 | EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb) | ||
2230 | { | ||
2231 | if ((!strcmp(cb->part, part)) && (cb->func == func)) | ||
2232 | { | ||
2233 | void *data = cb->data; | ||
2234 | ed->markup_filter_callbacks = | ||
2235 | eina_list_remove_list(ed->markup_filter_callbacks, l); | ||
2236 | eina_stringshare_del(cb->part); | ||
2237 | free(cb); | ||
2238 | return data; | ||
2239 | } | ||
2240 | } | ||
2241 | return NULL; | ||
2242 | } | ||
2243 | |||
2244 | EAPI void * | ||
2245 | edje_object_text_markup_filter_callback_del_full(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func, void *data) | ||
2246 | { | ||
2247 | Edje *ed; | ||
2248 | Edje_Markup_Filter_Callback *cb; | ||
2249 | Eina_List *l; | ||
2250 | |||
2251 | ed = _edje_fetch(obj); | ||
2252 | if ((!ed) || (!part)) return NULL; | ||
2253 | EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb) | ||
2254 | { | ||
2255 | if ((!strcmp(cb->part, part)) && (cb->func == func) && | ||
2256 | (cb->data == data)) | ||
2257 | { | ||
2258 | void *tmp = cb->data; | ||
2259 | ed->markup_filter_callbacks = | ||
2260 | eina_list_remove_list(ed->markup_filter_callbacks, l); | ||
2261 | eina_stringshare_del(cb->part); | ||
2262 | free(cb); | ||
2263 | return tmp; | ||
2264 | } | ||
2265 | } | ||
2266 | return NULL; | ||
2267 | } | ||
2268 | |||
1904 | EAPI Eina_Bool | 2269 | EAPI Eina_Bool |
1905 | edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_swallow) | 2270 | edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_swallow) |
1906 | { | 2271 | { |
@@ -1927,8 +2292,12 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw | |||
1927 | edje_object_part_unswallow(rp->edje->obj, obj_swallow); | 2292 | edje_object_part_unswallow(rp->edje->obj, obj_swallow); |
1928 | } | 2293 | } |
1929 | 2294 | ||
1930 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2295 | rp = _edje_real_part_recursive_get(ed, part); |
1931 | if (!rp) return EINA_FALSE; | 2296 | if (!rp) |
2297 | { | ||
2298 | DBG("cannot swallow part %s: part not exist!", part); | ||
2299 | return EINA_FALSE; | ||
2300 | } | ||
1932 | if (rp->part->type != EDJE_PART_TYPE_SWALLOW) | 2301 | if (rp->part->type != EDJE_PART_TYPE_SWALLOW) |
1933 | { | 2302 | { |
1934 | ERR("cannot swallow part %s: not swallow type!", rp->part->name); | 2303 | ERR("cannot swallow part %s: not swallow type!", rp->part->name); |
@@ -2261,7 +2630,7 @@ edje_object_part_swallow_get(const Evas_Object *obj, const char *part) | |||
2261 | /* Need to recalc before providing the object. */ | 2630 | /* Need to recalc before providing the object. */ |
2262 | _edje_recalc_do(ed); | 2631 | _edje_recalc_do(ed); |
2263 | 2632 | ||
2264 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2633 | rp = _edje_real_part_recursive_get(ed, part); |
2265 | if (!rp) return NULL; | 2634 | if (!rp) return NULL; |
2266 | return rp->swallowed_object; | 2635 | return rp->swallowed_object; |
2267 | } | 2636 | } |
@@ -2353,8 +2722,8 @@ EAPI Eina_Bool | |||
2353 | edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) | 2722 | edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) |
2354 | { | 2723 | { |
2355 | Edje *ed; | 2724 | Edje *ed; |
2356 | Evas_Coord x1 = INT_MAX, y1 = INT_MAX; | 2725 | Evas_Coord xx1 = INT_MAX, yy1 = INT_MAX; |
2357 | Evas_Coord x2 = 0, y2 = 0; | 2726 | Evas_Coord xx2 = 0, yy2 = 0; |
2358 | unsigned int i; | 2727 | unsigned int i; |
2359 | 2728 | ||
2360 | ed = _edje_fetch(obj); | 2729 | ed = _edje_fetch(obj); |
@@ -2386,18 +2755,18 @@ edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, E | |||
2386 | rpx2 = rpx1 + rp->w; | 2755 | rpx2 = rpx1 + rp->w; |
2387 | rpy2 = rpy1 + rp->h; | 2756 | rpy2 = rpy1 + rp->h; |
2388 | 2757 | ||
2389 | if (x1 > rpx1) x1 = rpx1; | 2758 | if (xx1 > rpx1) xx1 = rpx1; |
2390 | if (y1 > rpy1) y1 = rpy1; | 2759 | if (yy1 > rpy1) yy1 = rpy1; |
2391 | if (x2 < rpx2) x2 = rpx2; | 2760 | if (xx2 < rpx2) xx2 = rpx2; |
2392 | if (y2 < rpy2) y2 = rpy2; | 2761 | if (yy2 < rpy2) yy2 = rpy2; |
2393 | } | 2762 | } |
2394 | 2763 | ||
2395 | ed->calc_only = 0; | 2764 | ed->calc_only = 0; |
2396 | 2765 | ||
2397 | if (x) *x = x1; | 2766 | if (x) *x = xx1; |
2398 | if (y) *y = y1; | 2767 | if (y) *y = yy1; |
2399 | if (w) *w = x2 - x1; | 2768 | if (w) *w = xx2 - xx1; |
2400 | if (h) *h = y2 - y1; | 2769 | if (h) *h = yy2 - yy1; |
2401 | 2770 | ||
2402 | return EINA_TRUE; | 2771 | return EINA_TRUE; |
2403 | } | 2772 | } |
@@ -2448,6 +2817,7 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co | |||
2448 | maxh = 0; | 2817 | maxh = 0; |
2449 | } | 2818 | } |
2450 | pep = NULL; | 2819 | pep = NULL; |
2820 | has_non_fixed_tb = EINA_FALSE; | ||
2451 | for (i = 0; i < ed->table_parts_size; i++) | 2821 | for (i = 0; i < ed->table_parts_size; i++) |
2452 | { | 2822 | { |
2453 | Edje_Real_Part *ep; | 2823 | Edje_Real_Part *ep; |
@@ -2569,7 +2939,7 @@ edje_object_part_state_get(const Evas_Object *obj, const char *part, double *val | |||
2569 | /* Need to recalc before providing the object. */ | 2939 | /* Need to recalc before providing the object. */ |
2570 | _edje_recalc_do(ed); | 2940 | _edje_recalc_do(ed); |
2571 | 2941 | ||
2572 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2942 | rp = _edje_real_part_recursive_get(ed, part); |
2573 | if (!rp) | 2943 | if (!rp) |
2574 | { | 2944 | { |
2575 | if (val_ret) *val_ret = 0; | 2945 | if (val_ret) *val_ret = 0; |
@@ -2609,7 +2979,7 @@ edje_object_part_drag_dir_get(const Evas_Object *obj, const char *part) | |||
2609 | /* Need to recalc before providing the object. */ | 2979 | /* Need to recalc before providing the object. */ |
2610 | _edje_recalc_do(ed); | 2980 | _edje_recalc_do(ed); |
2611 | 2981 | ||
2612 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2982 | rp = _edje_real_part_recursive_get(ed, part); |
2613 | if (!rp) return EDJE_DRAG_DIR_NONE; | 2983 | if (!rp) return EDJE_DRAG_DIR_NONE; |
2614 | if ((rp->part->dragable.x) && (rp->part->dragable.y)) return EDJE_DRAG_DIR_XY; | 2984 | if ((rp->part->dragable.x) && (rp->part->dragable.y)) return EDJE_DRAG_DIR_XY; |
2615 | else if (rp->part->dragable.x) return EDJE_DRAG_DIR_X; | 2985 | else if (rp->part->dragable.x) return EDJE_DRAG_DIR_X; |
@@ -2625,7 +2995,7 @@ edje_object_part_drag_value_set(Evas_Object *obj, const char *part, double dx, d | |||
2625 | 2995 | ||
2626 | ed = _edje_fetch(obj); | 2996 | ed = _edje_fetch(obj); |
2627 | if ((!ed) || (!part)) return EINA_FALSE; | 2997 | if ((!ed) || (!part)) return EINA_FALSE; |
2628 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 2998 | rp = _edje_real_part_recursive_get(ed, part); |
2629 | if (!rp) return EINA_FALSE; | 2999 | if (!rp) return EINA_FALSE; |
2630 | if (!rp->drag) return EINA_FALSE; | 3000 | if (!rp->drag) return EINA_FALSE; |
2631 | if (rp->drag->down.count > 0) return EINA_FALSE; | 3001 | if (rp->drag->down.count > 0) return EINA_FALSE; |
@@ -2666,7 +3036,7 @@ edje_object_part_drag_value_get(const Evas_Object *obj, const char *part, double | |||
2666 | /* Need to recalc before providing the object. */ | 3036 | /* Need to recalc before providing the object. */ |
2667 | _edje_recalc_do(ed); | 3037 | _edje_recalc_do(ed); |
2668 | 3038 | ||
2669 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3039 | rp = _edje_real_part_recursive_get(ed, part); |
2670 | if (!rp || !rp->drag) | 3040 | if (!rp || !rp->drag) |
2671 | { | 3041 | { |
2672 | if (dx) *dx = 0; | 3042 | if (dx) *dx = 0; |
@@ -2690,7 +3060,7 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do | |||
2690 | 3060 | ||
2691 | ed = _edje_fetch(obj); | 3061 | ed = _edje_fetch(obj); |
2692 | if ((!ed) || (!part)) return EINA_FALSE; | 3062 | if ((!ed) || (!part)) return EINA_FALSE; |
2693 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3063 | rp = _edje_real_part_recursive_get(ed, part); |
2694 | if (!rp) return EINA_FALSE; | 3064 | if (!rp) return EINA_FALSE; |
2695 | if (!rp->drag) return EINA_FALSE; | 3065 | if (!rp->drag) return EINA_FALSE; |
2696 | if (dw < 0.0) dw = 0.0; | 3066 | if (dw < 0.0) dw = 0.0; |
@@ -2726,7 +3096,7 @@ edje_object_part_drag_size_get(const Evas_Object *obj, const char *part, double | |||
2726 | /* Need to recalc before providing the object. */ | 3096 | /* Need to recalc before providing the object. */ |
2727 | _edje_recalc_do(ed); | 3097 | _edje_recalc_do(ed); |
2728 | 3098 | ||
2729 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3099 | rp = _edje_real_part_recursive_get(ed, part); |
2730 | if (!rp || !rp->drag) | 3100 | if (!rp || !rp->drag) |
2731 | { | 3101 | { |
2732 | if (dw) *dw = 0; | 3102 | if (dw) *dw = 0; |
@@ -2746,7 +3116,7 @@ edje_object_part_drag_step_set(Evas_Object *obj, const char *part, double dx, do | |||
2746 | 3116 | ||
2747 | ed = _edje_fetch(obj); | 3117 | ed = _edje_fetch(obj); |
2748 | if ((!ed) || (!part)) return EINA_FALSE; | 3118 | if ((!ed) || (!part)) return EINA_FALSE; |
2749 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3119 | rp = _edje_real_part_recursive_get(ed, part); |
2750 | if (!rp) return EINA_FALSE; | 3120 | if (!rp) return EINA_FALSE; |
2751 | if (!rp->drag) return EINA_FALSE; | 3121 | if (!rp->drag) return EINA_FALSE; |
2752 | if (dx < 0.0) dx = 0.0; | 3122 | if (dx < 0.0) dx = 0.0; |
@@ -2778,7 +3148,7 @@ edje_object_part_drag_step_get(const Evas_Object *obj, const char *part, double | |||
2778 | /* Need to recalc before providing the object. */ | 3148 | /* Need to recalc before providing the object. */ |
2779 | _edje_recalc_do(ed); | 3149 | _edje_recalc_do(ed); |
2780 | 3150 | ||
2781 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3151 | rp = _edje_real_part_recursive_get(ed, part); |
2782 | if (!rp || !rp->drag) | 3152 | if (!rp || !rp->drag) |
2783 | { | 3153 | { |
2784 | if (dx) *dx = 0; | 3154 | if (dx) *dx = 0; |
@@ -2798,7 +3168,7 @@ edje_object_part_drag_page_set(Evas_Object *obj, const char *part, double dx, do | |||
2798 | 3168 | ||
2799 | ed = _edje_fetch(obj); | 3169 | ed = _edje_fetch(obj); |
2800 | if ((!ed) || (!part)) return EINA_FALSE; | 3170 | if ((!ed) || (!part)) return EINA_FALSE; |
2801 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3171 | rp = _edje_real_part_recursive_get(ed, part); |
2802 | if (!rp) return EINA_FALSE; | 3172 | if (!rp) return EINA_FALSE; |
2803 | if (!rp->drag) return EINA_FALSE; | 3173 | if (!rp->drag) return EINA_FALSE; |
2804 | if (dx < 0.0) dx = 0.0; | 3174 | if (dx < 0.0) dx = 0.0; |
@@ -2830,7 +3200,7 @@ edje_object_part_drag_page_get(const Evas_Object *obj, const char *part, double | |||
2830 | /* Need to recalc before providing the object. */ | 3200 | /* Need to recalc before providing the object. */ |
2831 | _edje_recalc_do(ed); | 3201 | _edje_recalc_do(ed); |
2832 | 3202 | ||
2833 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3203 | rp = _edje_real_part_recursive_get(ed, part); |
2834 | if (!rp || !rp->drag) | 3204 | if (!rp || !rp->drag) |
2835 | { | 3205 | { |
2836 | if (dx) *dx = 0; | 3206 | if (dx) *dx = 0; |
@@ -2851,7 +3221,7 @@ edje_object_part_drag_step(Evas_Object *obj, const char *part, double dx, double | |||
2851 | 3221 | ||
2852 | ed = _edje_fetch(obj); | 3222 | ed = _edje_fetch(obj); |
2853 | if ((!ed) || (!part)) return EINA_FALSE; | 3223 | if ((!ed) || (!part)) return EINA_FALSE; |
2854 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3224 | rp = _edje_real_part_recursive_get(ed, part); |
2855 | if (!rp) return EINA_FALSE; | 3225 | if (!rp) return EINA_FALSE; |
2856 | if (!rp->drag) return EINA_FALSE; | 3226 | if (!rp->drag) return EINA_FALSE; |
2857 | if (rp->drag->down.count > 0) return EINA_FALSE; | 3227 | if (rp->drag->down.count > 0) return EINA_FALSE; |
@@ -2881,7 +3251,7 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double | |||
2881 | 3251 | ||
2882 | ed = _edje_fetch(obj); | 3252 | ed = _edje_fetch(obj); |
2883 | if ((!ed) || (!part)) return EINA_FALSE; | 3253 | if ((!ed) || (!part)) return EINA_FALSE; |
2884 | rp = _edje_real_part_recursive_get(ed, (char *)part); | 3254 | rp = _edje_real_part_recursive_get(ed, part); |
2885 | if (!rp) return EINA_FALSE; | 3255 | if (!rp) return EINA_FALSE; |
2886 | if (!rp->drag) return EINA_FALSE; | 3256 | if (!rp->drag) return EINA_FALSE; |
2887 | if (rp->drag->down.count > 0) return EINA_FALSE; | 3257 | if (rp->drag->down.count > 0) return EINA_FALSE; |
@@ -3557,9 +3927,21 @@ edje_object_preload(Evas_Object *obj, Eina_Bool cancel) | |||
3557 | else if (ep->type == EDJE_PART_TYPE_GROUP) | 3927 | else if (ep->type == EDJE_PART_TYPE_GROUP) |
3558 | { | 3928 | { |
3559 | if (rp->swallowed_object) { | 3929 | if (rp->swallowed_object) { |
3560 | edje_object_signal_callback_del(rp->swallowed_object, EDJE_PRELOAD_EMISSION, EDJE_PRELOAD_SOURCE, _edje_object_signal_preload_cb); | 3930 | char *tmp; |
3561 | edje_object_signal_callback_add(rp->swallowed_object, EDJE_PRELOAD_EMISSION, EDJE_PRELOAD_SOURCE, _edje_object_signal_preload_cb, ed); | 3931 | |
3562 | edje_object_preload(rp->swallowed_object, cancel); | 3932 | if (rp->part->name) |
3933 | { | ||
3934 | tmp = alloca(strlen(rp->part->name) + 2); | ||
3935 | sprintf(tmp, "%s:", rp->part->name); | ||
3936 | |||
3937 | edje_object_signal_callback_del(obj, EDJE_PRELOAD_EMISSION, tmp, _edje_object_signal_preload_cb); | ||
3938 | edje_object_signal_callback_add(obj, EDJE_PRELOAD_EMISSION, tmp, _edje_object_signal_preload_cb, ed); | ||
3939 | edje_object_preload(rp->swallowed_object, cancel); | ||
3940 | } | ||
3941 | else | ||
3942 | { | ||
3943 | ed->preload_count--; | ||
3944 | } | ||
3563 | 3945 | ||
3564 | count--; | 3946 | count--; |
3565 | } | 3947 | } |
@@ -3574,6 +3956,30 @@ edje_object_preload(Evas_Object *obj, Eina_Bool cancel) | |||
3574 | return EINA_TRUE; | 3956 | return EINA_TRUE; |
3575 | } | 3957 | } |
3576 | 3958 | ||
3959 | EAPI void | ||
3960 | edje_object_update_hints_set(Evas_Object *obj, Eina_Bool update) | ||
3961 | { | ||
3962 | Edje *ed; | ||
3963 | |||
3964 | ed = _edje_fetch(obj); | ||
3965 | if (!ed) return ; | ||
3966 | if (ed->update_hints == !!update) return ; | ||
3967 | |||
3968 | ed->update_hints = !!update; | ||
3969 | if (update) ed->recalc_hints = 1; | ||
3970 | } | ||
3971 | |||
3972 | EAPI Eina_Bool | ||
3973 | edje_object_update_hints_get(Evas_Object *obj) | ||
3974 | { | ||
3975 | Edje *ed; | ||
3976 | |||
3977 | ed = _edje_fetch(obj); | ||
3978 | if (!ed) return EINA_FALSE; | ||
3979 | |||
3980 | return ed->update_hints; | ||
3981 | } | ||
3982 | |||
3577 | Eina_Bool | 3983 | Eina_Bool |
3578 | _edje_real_part_table_pack(Edje_Real_Part *rp, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) | 3984 | _edje_real_part_table_pack(Edje_Real_Part *rp, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) |
3579 | { | 3985 | { |
@@ -4037,9 +4443,11 @@ _edje_real_part_swallow_hints_update(Edje_Real_Part *rp) | |||
4037 | { | 4443 | { |
4038 | Evas_Coord w, h; | 4444 | Evas_Coord w, h; |
4039 | 4445 | ||
4446 | #if 0 | ||
4040 | edje_object_size_min_get(rp->swallowed_object, &w, &h); | 4447 | edje_object_size_min_get(rp->swallowed_object, &w, &h); |
4041 | rp->swallow_params.min.w = w; | 4448 | rp->swallow_params.min.w = w; |
4042 | rp->swallow_params.min.h = h; | 4449 | rp->swallow_params.min.h = h; |
4450 | #endif | ||
4043 | edje_object_size_max_get(rp->swallowed_object, &w, &h); | 4451 | edje_object_size_max_get(rp->swallowed_object, &w, &h); |
4044 | rp->swallow_params.max.w = w; | 4452 | rp->swallow_params.max.w = w; |
4045 | rp->swallow_params.max.h = h; | 4453 | rp->swallow_params.max.h = h; |
@@ -4050,8 +4458,10 @@ _edje_real_part_swallow_hints_update(Edje_Real_Part *rp) | |||
4050 | Evas_Coord w, h; | 4458 | Evas_Coord w, h; |
4051 | 4459 | ||
4052 | evas_object_geometry_get(rp->swallowed_object, NULL, NULL, &w, &h); | 4460 | evas_object_geometry_get(rp->swallowed_object, NULL, NULL, &w, &h); |
4461 | #if 0 | ||
4053 | rp->swallow_params.min.w = w; | 4462 | rp->swallow_params.min.w = w; |
4054 | rp->swallow_params.min.h = h; | 4463 | rp->swallow_params.min.h = h; |
4464 | #endif | ||
4055 | rp->swallow_params.max.w = w; | 4465 | rp->swallow_params.max.w = w; |
4056 | rp->swallow_params.max.h = h; | 4466 | rp->swallow_params.max.h = h; |
4057 | } | 4467 | } |
@@ -4127,6 +4537,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, | |||
4127 | _edje_real_part_swallow_hints_update(rp); | 4537 | _edje_real_part_swallow_hints_update(rp); |
4128 | rp->edje->dirty = 1; | 4538 | rp->edje->dirty = 1; |
4129 | rp->edje->recalc_call = 1; | 4539 | rp->edje->recalc_call = 1; |
4540 | rp->edje->recalc_hints = 1; | ||
4130 | _edje_recalc(rp->edje); | 4541 | _edje_recalc(rp->edje); |
4131 | return; | 4542 | return; |
4132 | } | 4543 | } |
@@ -4171,6 +4582,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp, | |||
4171 | 4582 | ||
4172 | rp->edje->dirty = 1; | 4583 | rp->edje->dirty = 1; |
4173 | rp->edje->recalc_call = 1; | 4584 | rp->edje->recalc_call = 1; |
4585 | rp->edje->recalc_hints = 1; | ||
4174 | _edje_recalc(rp->edje); | 4586 | _edje_recalc(rp->edje); |
4175 | } | 4587 | } |
4176 | 4588 | ||
diff --git a/libraries/edje/src/modules/Makefile.in b/libraries/edje/src/modules/Makefile.in index 5e81050..55c47d6 100644 --- a/libraries/edje/src/modules/Makefile.in +++ b/libraries/edje/src/modules/Makefile.in | |||
@@ -193,6 +193,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
193 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 193 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
194 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 194 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
195 | PKG_CONFIG = @PKG_CONFIG@ | 195 | PKG_CONFIG = @PKG_CONFIG@ |
196 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
197 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
196 | PYTHON = @PYTHON@ | 198 | PYTHON = @PYTHON@ |
197 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 199 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
198 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 200 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
diff --git a/libraries/edje/src/modules/alsa_snd_player/Makefile.in b/libraries/edje/src/modules/alsa_snd_player/Makefile.in index 1fe2fb1..ce68f41 100644 --- a/libraries/edje/src/modules/alsa_snd_player/Makefile.in +++ b/libraries/edje/src/modules/alsa_snd_player/Makefile.in | |||
@@ -210,6 +210,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
210 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 210 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
211 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 211 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
212 | PKG_CONFIG = @PKG_CONFIG@ | 212 | PKG_CONFIG = @PKG_CONFIG@ |
213 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
214 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
213 | PYTHON = @PYTHON@ | 215 | PYTHON = @PYTHON@ |
214 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 216 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
215 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 217 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
diff --git a/libraries/edje/src/modules/eet_snd_reader/Makefile.in b/libraries/edje/src/modules/eet_snd_reader/Makefile.in index 12d0487..f4d99bb 100644 --- a/libraries/edje/src/modules/eet_snd_reader/Makefile.in +++ b/libraries/edje/src/modules/eet_snd_reader/Makefile.in | |||
@@ -211,6 +211,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
211 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 211 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
212 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 212 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
213 | PKG_CONFIG = @PKG_CONFIG@ | 213 | PKG_CONFIG = @PKG_CONFIG@ |
214 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
215 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
214 | PYTHON = @PYTHON@ | 216 | PYTHON = @PYTHON@ |
215 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 217 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
216 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 218 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
diff --git a/libraries/edje/src/modules/multisense_factory/Makefile.in b/libraries/edje/src/modules/multisense_factory/Makefile.in index 8fbc0aa..ed0c3e4 100644 --- a/libraries/edje/src/modules/multisense_factory/Makefile.in +++ b/libraries/edje/src/modules/multisense_factory/Makefile.in | |||
@@ -208,6 +208,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
208 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 208 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
209 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 209 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
210 | PKG_CONFIG = @PKG_CONFIG@ | 210 | PKG_CONFIG = @PKG_CONFIG@ |
211 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
212 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
211 | PYTHON = @PYTHON@ | 213 | PYTHON = @PYTHON@ |
212 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 214 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
213 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 215 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |
diff --git a/libraries/edje/src/tests/Makefile.in b/libraries/edje/src/tests/Makefile.in index ff5193e..f610548 100644 --- a/libraries/edje/src/tests/Makefile.in +++ b/libraries/edje/src/tests/Makefile.in | |||
@@ -189,6 +189,8 @@ PACKAGE_URL = @PACKAGE_URL@ | |||
189 | PACKAGE_VERSION = @PACKAGE_VERSION@ | 189 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
190 | PATH_SEPARATOR = @PATH_SEPARATOR@ | 190 | PATH_SEPARATOR = @PATH_SEPARATOR@ |
191 | PKG_CONFIG = @PKG_CONFIG@ | 191 | PKG_CONFIG = @PKG_CONFIG@ |
192 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
193 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
192 | PYTHON = @PYTHON@ | 194 | PYTHON = @PYTHON@ |
193 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ | 195 | PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ |
194 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ | 196 | PYTHON_PLATFORM = @PYTHON_PLATFORM@ |