summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJee-Yong Um <conr2d@gmail.com>2015-06-25 16:02:41 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-06-25 17:21:09 +0200
commit2b29f4dfbf901d40aee552345ae5285b1c2e484c (patch)
tree365f8641593657adaac8000f3979e39227a0d490 /src/bin
parentef491e697e60a6e79bec27164342bfb103d2c95a (diff)
edje: add "mask_flags" instruction for "part" block
Summary: Elementary widgets dealing with Evas Events usually mask event_flags with EVAS_EVENT_FLAG_ON_HOLD, to show that this event is already handled. However, widget like Elm_Button, it does not handle EVAS_CALLBACK_MOUSE_DOWN directly, but it handles Edje_Signal instead, so there's no chance to mask event_flags. Developers can block event propagation by putting rectangle the very last part of EDC, but this instruction can help the case making elementary widget with only Edje_Signal handling. This is not required essentially, so please check the necessity of this function. Reviewers: Hermet, cedric Reviewed By: cedric Subscribers: cedric, Hermet Differential Revision: https://phab.enlightenment.org/D2764 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/edje/edje_cc_handlers.c32
-rw-r--r--src/bin/edje/edje_convert.c1
-rw-r--r--src/bin/edje/edje_convert.h1
-rw-r--r--src/bin/edje/edje_data_convert.c1
4 files changed, 35 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index f6458f867a..7834ffbbee 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -253,6 +253,7 @@ static void st_collections_group_parts_part_mouse_events(void);
253static void st_collections_group_parts_part_anti_alias(void); 253static void st_collections_group_parts_part_anti_alias(void);
254static void st_collections_group_parts_part_repeat_events(void); 254static void st_collections_group_parts_part_repeat_events(void);
255static void st_collections_group_parts_part_ignore_flags(void); 255static void st_collections_group_parts_part_ignore_flags(void);
256static void st_collections_group_parts_part_mask_flags(void);
256static void st_collections_group_parts_part_scale(void); 257static void st_collections_group_parts_part_scale(void);
257static void st_collections_group_parts_part_pointer_mode(void); 258static void st_collections_group_parts_part_pointer_mode(void);
258static void st_collections_group_parts_part_precise_is_inside(void); 259static void st_collections_group_parts_part_precise_is_inside(void);
@@ -691,6 +692,7 @@ New_Statement_Handler statement_handlers[] =
691 {"collections.group.parts.part.anti_alias", st_collections_group_parts_part_anti_alias}, 692 {"collections.group.parts.part.anti_alias", st_collections_group_parts_part_anti_alias},
692 {"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events}, 693 {"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events},
693 {"collections.group.parts.part.ignore_flags", st_collections_group_parts_part_ignore_flags}, 694 {"collections.group.parts.part.ignore_flags", st_collections_group_parts_part_ignore_flags},
695 {"collections.group.parts.part.mask_flags", st_collections_group_parts_part_mask_flags},
694 {"collections.group.parts.part.scale", st_collections_group_parts_part_scale}, 696 {"collections.group.parts.part.scale", st_collections_group_parts_part_scale},
695 {"collections.group.parts.part.pointer_mode", st_collections_group_parts_part_pointer_mode}, 697 {"collections.group.parts.part.pointer_mode", st_collections_group_parts_part_pointer_mode},
696 {"collections.group.parts.part.precise_is_inside", st_collections_group_parts_part_precise_is_inside}, 698 {"collections.group.parts.part.precise_is_inside", st_collections_group_parts_part_precise_is_inside},
@@ -983,6 +985,7 @@ New_Statement_Handler statement_handlers[] =
983 before -> insert_before 985 before -> insert_before
984 after -> insert_after 986 after -> insert_after
985 ignore -> ignore_flags 987 ignore -> ignore_flags
988 mask -> mask_flags
986 pointer -> pointer_mode 989 pointer -> pointer_mode
987 alt_font -> use_alternate_font_metrics 990 alt_font -> use_alternate_font_metrics
988 clip -> clip_to 991 clip -> clip_to
@@ -1006,6 +1009,7 @@ New_Statement_Handler statement_handlers_short[] =
1006 {"collections.group.parts.part.before", st_collections_group_parts_part_insert_before}, 1009 {"collections.group.parts.part.before", st_collections_group_parts_part_insert_before},
1007 {"collections.group.parts.part.after", st_collections_group_parts_part_insert_after}, 1010 {"collections.group.parts.part.after", st_collections_group_parts_part_insert_after},
1008 {"collections.group.parts.part.ignore", st_collections_group_parts_part_ignore_flags}, 1011 {"collections.group.parts.part.ignore", st_collections_group_parts_part_ignore_flags},
1012 {"collections.group.parts.part.mask", st_collections_group_parts_part_mask_flags},
1009 {"collections.group.parts.part.pointer", st_collections_group_parts_part_pointer_mode}, 1013 {"collections.group.parts.part.pointer", st_collections_group_parts_part_pointer_mode},
1010 {"collections.group.parts.part.alt_font", st_collections_group_parts_part_use_alternate_font_metrics}, 1014 {"collections.group.parts.part.alt_font", st_collections_group_parts_part_use_alternate_font_metrics},
1011 {"collections.group.parts.part.clip", st_collections_group_parts_part_clip_to_id}, 1015 {"collections.group.parts.part.clip", st_collections_group_parts_part_clip_to_id},
@@ -3433,6 +3437,7 @@ _part_copy(Edje_Part *ep, Edje_Part *ep2)
3433 ep->anti_alias = ep2->anti_alias; 3437 ep->anti_alias = ep2->anti_alias;
3434 ep->repeat_events = ep2->repeat_events; 3438 ep->repeat_events = ep2->repeat_events;
3435 ep->ignore_flags = ep2->ignore_flags; 3439 ep->ignore_flags = ep2->ignore_flags;
3440 ep->mask_flags = ep2->mask_flags;
3436 ep->scale = ep2->scale; 3441 ep->scale = ep2->scale;
3437 ep->pointer_mode = ep2->pointer_mode; 3442 ep->pointer_mode = ep2->pointer_mode;
3438 ep->precise_is_inside = ep2->precise_is_inside; 3443 ep->precise_is_inside = ep2->precise_is_inside;
@@ -4422,6 +4427,7 @@ st_collections_group_parts_alias(void)
4422 mouse_events: 1; 4427 mouse_events: 1;
4423 repeat_events: 0; 4428 repeat_events: 0;
4424 ignore_flags: NONE; 4429 ignore_flags: NONE;
4430 mask_flags: NONE;
4425 clip_to: "anotherpart"; 4431 clip_to: "anotherpart";
4426 source: "groupname"; 4432 source: "groupname";
4427 pointer_mode: AUTOGRAB; 4433 pointer_mode: AUTOGRAB;
@@ -4473,6 +4479,7 @@ edje_cc_handlers_part_make(int id)
4473 ep->anti_alias = 1; 4479 ep->anti_alias = 1;
4474 ep->repeat_events = 0; 4480 ep->repeat_events = 0;
4475 ep->ignore_flags = EVAS_EVENT_FLAG_NONE; 4481 ep->ignore_flags = EVAS_EVENT_FLAG_NONE;
4482 ep->mask_flags = EVAS_EVENT_FLAG_NONE;
4476 ep->scale = 0; 4483 ep->scale = 0;
4477 ep->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB; 4484 ep->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
4478 ep->precise_is_inside = 0; 4485 ep->precise_is_inside = 0;
@@ -5264,6 +5271,31 @@ st_collections_group_parts_part_ignore_flags(void)
5264/** 5271/**
5265 @page edcref 5272 @page edcref
5266 @property 5273 @property
5274 mask_flags
5275 @parameters
5276 [FLAG] ...
5277 @effect
5278 Masks event flags with the given value, so event propagating from this part
5279 will go with masked flags. Other library, like Elementary, can determine
5280 whether it handles this event. Possible flags:
5281 @li NONE (default value, no event will be masked)
5282 @li ON_HOLD
5283 @endproperty
5284*/
5285static void
5286st_collections_group_parts_part_mask_flags(void)
5287{
5288 check_min_arg_count(1);
5289
5290 current_part->mask_flags = parse_flags(0,
5291 "NONE", EVAS_EVENT_FLAG_NONE,
5292 "ON_HOLD", EVAS_EVENT_FLAG_ON_HOLD,
5293 NULL);
5294}
5295
5296/**
5297 @page edcref
5298 @property
5267 scale 5299 scale
5268 @parameters 5300 @parameters
5269 [1 or 0] 5301 [1 or 0]
diff --git a/src/bin/edje/edje_convert.c b/src/bin/edje/edje_convert.c
index fc98722a7b..25afe10dfa 100644
--- a/src/bin/edje/edje_convert.c
+++ b/src/bin/edje/edje_convert.c
@@ -351,6 +351,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
351 replacement->mouse_events = part->mouse_events; 351 replacement->mouse_events = part->mouse_events;
352 replacement->repeat_events = part->repeat_events; 352 replacement->repeat_events = part->repeat_events;
353 replacement->ignore_flags = part->ignore_flags; 353 replacement->ignore_flags = part->ignore_flags;
354 replacement->mask_flags = part->mask_flags;
354 replacement->scale = part->scale; 355 replacement->scale = part->scale;
355 replacement->precise_is_inside = part->precise_is_inside; 356 replacement->precise_is_inside = part->precise_is_inside;
356 replacement->use_alternate_font_metrics = part->use_alternate_font_metrics; 357 replacement->use_alternate_font_metrics = part->use_alternate_font_metrics;
diff --git a/src/bin/edje/edje_convert.h b/src/bin/edje/edje_convert.h
index 0bbb38eb42..fe2bff182d 100644
--- a/src/bin/edje/edje_convert.h
+++ b/src/bin/edje/edje_convert.h
@@ -102,6 +102,7 @@ struct _Old_Edje_Part
102 unsigned char mouse_events; /* it will affect/respond to mouse events */ 102 unsigned char mouse_events; /* it will affect/respond to mouse events */
103 unsigned char repeat_events; /* it will repeat events to objects below */ 103 unsigned char repeat_events; /* it will repeat events to objects below */
104 Evas_Event_Flags ignore_flags; 104 Evas_Event_Flags ignore_flags;
105 Evas_Event_Flags mask_flags;
105 unsigned char scale; /* should certain properties scale with edje scale factor? */ 106 unsigned char scale; /* should certain properties scale with edje scale factor? */
106 unsigned char precise_is_inside; 107 unsigned char precise_is_inside;
107 unsigned char use_alternate_font_metrics; 108 unsigned char use_alternate_font_metrics;
diff --git a/src/bin/edje/edje_data_convert.c b/src/bin/edje/edje_data_convert.c
index ac7d52d5b3..bea6eeb7e5 100644
--- a/src/bin/edje/edje_data_convert.c
+++ b/src/bin/edje/edje_data_convert.c
@@ -399,6 +399,7 @@ _edje_edd_old_init(void)
399 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "anti_alias", anti_alias, EET_T_UCHAR); 399 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "anti_alias", anti_alias, EET_T_UCHAR);
400 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "repeat_events", repeat_events, EET_T_UCHAR); 400 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "repeat_events", repeat_events, EET_T_UCHAR);
401 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "ignore_flags", ignore_flags, EET_T_INT); 401 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "ignore_flags", ignore_flags, EET_T_INT);
402 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "mask_flags", mask_flags, EET_T_INT);
402 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "scale", scale, EET_T_UCHAR); 403 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "scale", scale, EET_T_UCHAR);
403 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "pointer_mode", pointer_mode, EET_T_UCHAR); 404 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "pointer_mode", pointer_mode, EET_T_UCHAR);
404 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "precise_is_inside", precise_is_inside, EET_T_UCHAR); 405 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "precise_is_inside", precise_is_inside, EET_T_UCHAR);