diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2015-04-06 20:24:19 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2015-04-06 20:43:49 -0400 |
commit | b8fe6d8cc70a9bccd53a98e7a39ed96163f8f933 (patch) | |
tree | 986eab90f524a9edf2089349343dccc3bc3a1b03 /src/bin/edje/edje_cc_handlers.c | |
parent | 509304645a38131dfcef5c0cda927d9fa3846a86 (diff) |
edje: add part.desc.rel.{to,to_x,to_y} keywords
it was annoying to have to type two lines for setting parts relative to
each other, so now only one is needed
@feature
Diffstat (limited to '')
-rw-r--r-- | src/bin/edje/edje_cc_handlers.c | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 0ce303bea1..a8d9d3199a 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c | |||
@@ -309,6 +309,9 @@ static void st_collections_group_parts_part_description_max(void); | |||
309 | static void st_collections_group_parts_part_description_step(void); | 309 | static void st_collections_group_parts_part_description_step(void); |
310 | static void st_collections_group_parts_part_description_aspect(void); | 310 | static void st_collections_group_parts_part_description_aspect(void); |
311 | static void st_collections_group_parts_part_description_aspect_preference(void); | 311 | static void st_collections_group_parts_part_description_aspect_preference(void); |
312 | static void st_collections_group_parts_part_description_rel_to(void); | ||
313 | static void st_collections_group_parts_part_description_rel_to_x(void); | ||
314 | static void st_collections_group_parts_part_description_rel_to_y(void); | ||
312 | static void st_collections_group_parts_part_description_rel1_relative(void); | 315 | static void st_collections_group_parts_part_description_rel1_relative(void); |
313 | static void st_collections_group_parts_part_description_rel1_offset(void); | 316 | static void st_collections_group_parts_part_description_rel1_offset(void); |
314 | static void st_collections_group_parts_part_description_rel1_to_set(const char *name); | 317 | static void st_collections_group_parts_part_description_rel1_to_set(const char *name); |
@@ -746,6 +749,9 @@ New_Statement_Handler statement_handlers[] = | |||
746 | {"collections.group.parts.part.description.step", st_collections_group_parts_part_description_step}, | 749 | {"collections.group.parts.part.description.step", st_collections_group_parts_part_description_step}, |
747 | {"collections.group.parts.part.description.aspect", st_collections_group_parts_part_description_aspect}, | 750 | {"collections.group.parts.part.description.aspect", st_collections_group_parts_part_description_aspect}, |
748 | {"collections.group.parts.part.description.aspect_preference", st_collections_group_parts_part_description_aspect_preference}, | 751 | {"collections.group.parts.part.description.aspect_preference", st_collections_group_parts_part_description_aspect_preference}, |
752 | {"collections.group.parts.part.description.rel.to", st_collections_group_parts_part_description_rel_to}, | ||
753 | {"collections.group.parts.part.description.rel.to_x", st_collections_group_parts_part_description_rel_to_x}, | ||
754 | {"collections.group.parts.part.description.rel.to_y", st_collections_group_parts_part_description_rel_to_y}, | ||
749 | {"collections.group.parts.part.description.rel1.relative", st_collections_group_parts_part_description_rel1_relative}, | 755 | {"collections.group.parts.part.description.rel1.relative", st_collections_group_parts_part_description_rel1_relative}, |
750 | {"collections.group.parts.part.description.rel1.offset", st_collections_group_parts_part_description_rel1_offset}, | 756 | {"collections.group.parts.part.description.rel1.offset", st_collections_group_parts_part_description_rel1_offset}, |
751 | {"collections.group.parts.part.description.rel1.to", st_collections_group_parts_part_description_rel1_to}, | 757 | {"collections.group.parts.part.description.rel1.to", st_collections_group_parts_part_description_rel1_to}, |
@@ -7194,7 +7200,7 @@ st_collections_group_parts_part_description_color3(void) | |||
7194 | /** | 7200 | /** |
7195 | @page edcref | 7201 | @page edcref |
7196 | @block | 7202 | @block |
7197 | rel1/rel2 | 7203 | rel1/rel2/rel |
7198 | @context | 7204 | @context |
7199 | description { | 7205 | description { |
7200 | .. | 7206 | .. |
@@ -7208,11 +7214,16 @@ st_collections_group_parts_part_description_color3(void) | |||
7208 | offset: -1 -1; | 7214 | offset: -1 -1; |
7209 | } | 7215 | } |
7210 | .. | 7216 | .. |
7217 | rel { | ||
7218 | to: "somepart"; | ||
7219 | } | ||
7220 | .. | ||
7211 | } | 7221 | } |
7212 | @description | 7222 | @description |
7213 | The rel1 and rel2 blocks are used to define the position of each corner | 7223 | The rel1 and rel2 blocks are used to define the position of each corner |
7214 | of the part's container. With rel1 being the left-up corner and rel2 | 7224 | of the part's container. With rel1 being the left-up corner and rel2 |
7215 | being the right-down corner. | 7225 | being the right-down corner; rel (no number) is equivalent to setting both |
7226 | rel1 AND rel2 since 1.14. | ||
7216 | @endblock | 7227 | @endblock |
7217 | 7228 | ||
7218 | @property | 7229 | @property |
@@ -7275,6 +7286,20 @@ st_collections_group_parts_part_description_rel1_to_set(const char *name) | |||
7275 | } | 7286 | } |
7276 | 7287 | ||
7277 | static void | 7288 | static void |
7289 | st_collections_group_parts_part_description_rel_to(void) | ||
7290 | { | ||
7291 | check_arg_count(1); | ||
7292 | |||
7293 | { | ||
7294 | char *name; | ||
7295 | name = parse_str(0); | ||
7296 | st_collections_group_parts_part_description_rel1_to_set(name); | ||
7297 | st_collections_group_parts_part_description_rel2_to_set(name); | ||
7298 | free(name); | ||
7299 | } | ||
7300 | } | ||
7301 | |||
7302 | static void | ||
7278 | st_collections_group_parts_part_description_rel1_to(void) | 7303 | st_collections_group_parts_part_description_rel1_to(void) |
7279 | { | 7304 | { |
7280 | check_arg_count(1); | 7305 | check_arg_count(1); |
@@ -7300,6 +7325,25 @@ st_collections_group_parts_part_description_rel1_to(void) | |||
7300 | @endproperty | 7325 | @endproperty |
7301 | */ | 7326 | */ |
7302 | static void | 7327 | static void |
7328 | st_collections_group_parts_part_description_rel_to_x(void) | ||
7329 | { | ||
7330 | Edje_Part_Collection *pc; | ||
7331 | |||
7332 | check_arg_count(1); | ||
7333 | |||
7334 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7335 | |||
7336 | { | ||
7337 | char *name; | ||
7338 | |||
7339 | name = parse_str(0); | ||
7340 | data_queue_part_lookup(pc, name, &(current_desc->rel1.id_x)); | ||
7341 | data_queue_part_lookup(pc, name, &(current_desc->rel2.id_x)); | ||
7342 | free(name); | ||
7343 | } | ||
7344 | } | ||
7345 | |||
7346 | static void | ||
7303 | st_collections_group_parts_part_description_rel1_to_x(void) | 7347 | st_collections_group_parts_part_description_rel1_to_x(void) |
7304 | { | 7348 | { |
7305 | Edje_Part_Collection *pc; | 7349 | Edje_Part_Collection *pc; |
@@ -7330,6 +7374,25 @@ st_collections_group_parts_part_description_rel1_to_x(void) | |||
7330 | @endproperty | 7374 | @endproperty |
7331 | */ | 7375 | */ |
7332 | static void | 7376 | static void |
7377 | st_collections_group_parts_part_description_rel_to_y(void) | ||
7378 | { | ||
7379 | Edje_Part_Collection *pc; | ||
7380 | |||
7381 | check_arg_count(1); | ||
7382 | |||
7383 | pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
7384 | |||
7385 | { | ||
7386 | char *name; | ||
7387 | |||
7388 | name = parse_str(0); | ||
7389 | data_queue_part_lookup(pc, name, &(current_desc->rel1.id_y)); | ||
7390 | data_queue_part_lookup(pc, name, &(current_desc->rel2.id_y)); | ||
7391 | free(name); | ||
7392 | } | ||
7393 | } | ||
7394 | |||
7395 | static void | ||
7333 | st_collections_group_parts_part_description_rel1_to_y(void) | 7396 | st_collections_group_parts_part_description_rel1_to_y(void) |
7334 | { | 7397 | { |
7335 | Edje_Part_Collection *pc; | 7398 | Edje_Part_Collection *pc; |