summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/edje/Edje_Edit.h19
-rw-r--r--src/lib/edje/edje_callbacks.c42
-rw-r--r--src/lib/edje/edje_convert.c1
-rw-r--r--src/lib/edje/edje_convert.h1
-rw-r--r--src/lib/edje/edje_data.c1
-rw-r--r--src/lib/edje/edje_edit.c23
-rw-r--r--src/lib/edje/edje_entry.c5
-rw-r--r--src/lib/edje/edje_private.h1
8 files changed, 80 insertions, 13 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 1fda09351e..0e0bb321f5 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -1592,6 +1592,25 @@ EAPI Evas_Event_Flags edje_edit_part_ignore_flags_get(Evas_Object *obj, const ch
1592 */ 1592 */
1593EAPI Eina_Bool edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags); 1593EAPI Eina_Bool edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags);
1594 1594
1595/** Get mask_flags for part.
1596 *
1597 * @param obj Object being edited.
1598 * @param part Part to get which event_flags are being masked.
1599 *
1600 * @return The Event flags set to the part.
1601 */
1602EAPI Evas_Event_Flags edje_edit_part_mask_flags_get(Evas_Object *obj, const char *part);
1603
1604/** Set mask_flags for part.
1605 *
1606 * @param obj Object being edited.
1607 * @param part Part to set which event flags will be masked.
1608 * @param mask_flags The Event flags to be masked by the part.
1609 *
1610 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
1611 */
1612EAPI Eina_Bool edje_edit_part_mask_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags mask_flags);
1613
1595/** Get pointer_mode of a part. 1614/** Get pointer_mode of a part.
1596 * 1615 *
1597 * @param obj Object being edited. 1616 * @param obj Object being edited.
diff --git a/src/lib/edje/edje_callbacks.c b/src/lib/edje/edje_callbacks.c
index f24b7c42d1..39a6255d1a 100644
--- a/src/lib/edje/edje_callbacks.c
+++ b/src/lib/edje/edje_callbacks.c
@@ -61,10 +61,13 @@ _edje_mouse_in_signal_cb(void *data, Eo *obj, const Eo_Event_Description *desc E
61 ev = event_info; 61 ev = event_info;
62 ed = data; 62 ed = data;
63 rp = evas_object_data_get(obj, "real_part"); 63 rp = evas_object_data_get(obj, "real_part");
64 if ((!rp) || 64 if (rp)
65 ((ev->event_flags) && 65 {
66 (rp->part->ignore_flags & ev->event_flags))) return EO_CALLBACK_CONTINUE; 66 if (!(ev->event_flags) || !(rp->part->ignore_flags & ev->event_flags))
67 _edje_emit(ed, "mouse,in", rp->part->name); 67 _edje_emit(ed, "mouse,in", rp->part->name);
68
69 ev->event_flags |= rp->part->mask_flags;
70 }
68 71
69 return EO_CALLBACK_CONTINUE; 72 return EO_CALLBACK_CONTINUE;
70} 73}
@@ -79,10 +82,13 @@ _edje_mouse_out_signal_cb(void *data, Eo *obj, const Eo_Event_Description *desc
79 ev = event_info; 82 ev = event_info;
80 ed = data; 83 ed = data;
81 rp = evas_object_data_get(obj, "real_part"); 84 rp = evas_object_data_get(obj, "real_part");
82 if ((!rp) || 85 if (rp)
83 ((ev->event_flags) && 86 {
84 (rp->part->ignore_flags & ev->event_flags))) return EO_CALLBACK_CONTINUE; 87 if (!(ev->event_flags) || !(rp->part->ignore_flags & ev->event_flags))
85 _edje_emit(ed, "mouse,out", rp->part->name); 88 _edje_emit(ed, "mouse,out", rp->part->name);
89
90 ev->event_flags |= rp->part->mask_flags;
91 }
86 92
87 return EO_CALLBACK_CONTINUE; 93 return EO_CALLBACK_CONTINUE;
88} 94}
@@ -153,6 +159,8 @@ _edje_mouse_down_signal_cb(void *data, Eo *obj, const Eo_Event_Description *desc
153 _edje_util_thaw(ed); 159 _edje_util_thaw(ed);
154 _edje_unref(ed); 160 _edje_unref(ed);
155 161
162 ev->event_flags |= rp->part->mask_flags;
163
156 return EO_CALLBACK_CONTINUE; 164 return EO_CALLBACK_CONTINUE;
157} 165}
158 166
@@ -226,6 +234,8 @@ _edje_mouse_up_signal_cb(void *data, Eo *obj, const Eo_Event_Description *desc E
226 _edje_util_thaw(ed); 234 _edje_util_thaw(ed);
227 _edje_unref(ed); 235 _edje_unref(ed);
228 236
237 ev->event_flags |= rp->part->mask_flags;
238
229 return EO_CALLBACK_CONTINUE; 239 return EO_CALLBACK_CONTINUE;
230} 240}
231 241
@@ -323,6 +333,8 @@ _edje_mouse_move_signal_cb(void *data, Eo *obj, const Eo_Event_Description *desc
323 _edje_unref(ed); 333 _edje_unref(ed);
324 _edje_util_thaw(ed); 334 _edje_util_thaw(ed);
325 335
336 ev->event_flags |= rp->part->mask_flags;
337
326 return EO_CALLBACK_CONTINUE; 338 return EO_CALLBACK_CONTINUE;
327} 339}
328 340
@@ -337,12 +349,16 @@ _edje_mouse_wheel_signal_cb(void *data, Eo *obj, const Eo_Event_Description *des
337 ev = event_info; 349 ev = event_info;
338 ed = data; 350 ed = data;
339 rp = evas_object_data_get(obj, "real_part"); 351 rp = evas_object_data_get(obj, "real_part");
340 if ((!rp) || 352 if (rp)
341 ((ev->event_flags) && 353 {
342 (!(rp->part->ignore_flags & ev->event_flags)))) return EO_CALLBACK_CONTINUE; 354 if (!(ev->event_flags) || !(rp->part->ignore_flags & ev->event_flags))
355 {
356 snprintf(buf, sizeof(buf), "mouse,wheel,%i,%i", ev->direction, (ev->z < 0) ? (-1) : (1));
357 _edje_emit(ed, buf, rp->part->name);
358 }
343 359
344 snprintf(buf, sizeof(buf), "mouse,wheel,%i,%i", ev->direction, (ev->z < 0) ? (-1) : (1)); 360 ev->event_flags |= rp->part->mask_flags;
345 _edje_emit(ed, buf, rp->part->name); 361 }
346 362
347 return EO_CALLBACK_CONTINUE; 363 return EO_CALLBACK_CONTINUE;
348} 364}
diff --git a/src/lib/edje/edje_convert.c b/src/lib/edje/edje_convert.c
index da2a74563a..43160043c4 100644
--- a/src/lib/edje/edje_convert.c
+++ b/src/lib/edje/edje_convert.c
@@ -392,6 +392,7 @@ case EDJE_PART_TYPE_##Tp: \
392 replacement->mouse_events = part->mouse_events; 392 replacement->mouse_events = part->mouse_events;
393 replacement->repeat_events = part->repeat_events; 393 replacement->repeat_events = part->repeat_events;
394 replacement->ignore_flags = part->ignore_flags; 394 replacement->ignore_flags = part->ignore_flags;
395 replacement->mask_flags = part->mask_flags;
395 replacement->scale = part->scale; 396 replacement->scale = part->scale;
396 replacement->precise_is_inside = part->precise_is_inside; 397 replacement->precise_is_inside = part->precise_is_inside;
397 replacement->use_alternate_font_metrics = part->use_alternate_font_metrics; 398 replacement->use_alternate_font_metrics = part->use_alternate_font_metrics;
diff --git a/src/lib/edje/edje_convert.h b/src/lib/edje/edje_convert.h
index 951d0c6f24..e387e265d4 100644
--- a/src/lib/edje/edje_convert.h
+++ b/src/lib/edje/edje_convert.h
@@ -127,6 +127,7 @@ struct _Old_Edje_Part
127 unsigned char mouse_events; /**< it will affect/respond to mouse events */ 127 unsigned char mouse_events; /**< it will affect/respond to mouse events */
128 unsigned char repeat_events; /**< it will repeat events to objects below */ 128 unsigned char repeat_events; /**< it will repeat events to objects below */
129 Evas_Event_Flags ignore_flags; /**< ignore flags */ 129 Evas_Event_Flags ignore_flags; /**< ignore flags */
130 Evas_Event_Flags mask_flags; /**< mask flags */
130 unsigned char scale; /**< should certain properties scale with edje scale factor? */ 131 unsigned char scale; /**< should certain properties scale with edje scale factor? */
131 unsigned char precise_is_inside; /**< whether is precisely inside */ 132 unsigned char precise_is_inside; /**< whether is precisely inside */
132 unsigned char use_alternate_font_metrics; /**< use alternate font metrics */ 133 unsigned char use_alternate_font_metrics; /**< use alternate font metrics */
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index d6a08f7a05..55f06ba65c 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -1222,6 +1222,7 @@ _edje_edd_init(void)
1222 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "anti_alias", anti_alias, EET_T_UCHAR); 1222 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "anti_alias", anti_alias, EET_T_UCHAR);
1223 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "repeat_events", repeat_events, EET_T_UCHAR); 1223 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "repeat_events", repeat_events, EET_T_UCHAR);
1224 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "ignore_flags", ignore_flags, EET_T_INT); 1224 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "ignore_flags", ignore_flags, EET_T_INT);
1225 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "mask_flags", mask_flags, EET_T_INT);
1225 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "scale", scale, EET_T_UCHAR); 1226 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "scale", scale, EET_T_UCHAR);
1226 EET_DATA_DESCRIPTOR_ADD_SUB_NESTED(_edje_edd_edje_part, Edje_Part, "scale_3d", scale_3d, _edje_edd_edje_part_description_3d_vec); 1227 EET_DATA_DESCRIPTOR_ADD_SUB_NESTED(_edje_edd_edje_part, Edje_Part, "scale_3d", scale_3d, _edje_edd_edje_part_description_3d_vec);
1227 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "precise_is_inside", precise_is_inside, EET_T_UCHAR); 1228 EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "precise_is_inside", precise_is_inside, EET_T_UCHAR);
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 4e6b94f98d..fb5b54690d 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -3094,6 +3094,7 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type
3094 ep->repeat_events = 0; 3094 ep->repeat_events = 0;
3095 ep->anti_alias = 1; 3095 ep->anti_alias = 1;
3096 ep->ignore_flags = EVAS_EVENT_FLAG_NONE; 3096 ep->ignore_flags = EVAS_EVENT_FLAG_NONE;
3097 ep->mask_flags = EVAS_EVENT_FLAG_NONE;
3097 ep->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB; 3098 ep->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
3098 ep->precise_is_inside = 0; 3099 ep->precise_is_inside = 0;
3099 ep->use_alternate_font_metrics = 0; 3100 ep->use_alternate_font_metrics = 0;
@@ -3366,6 +3367,7 @@ edje_edit_part_copy(Evas_Object *obj, const char *part, const char *new_copy)
3366 _PARAM_PART_COPY(mouse_events) 3367 _PARAM_PART_COPY(mouse_events)
3367 _PARAM_PART_COPY(repeat_events) 3368 _PARAM_PART_COPY(repeat_events)
3368 _PARAM_PART_COPY(ignore_flags) 3369 _PARAM_PART_COPY(ignore_flags)
3370 _PARAM_PART_COPY(mask_flags)
3369 _PARAM_PART_COPY(pointer_mode) 3371 _PARAM_PART_COPY(pointer_mode)
3370 _PARAM_PART_COPY(precise_is_inside) 3372 _PARAM_PART_COPY(precise_is_inside)
3371 _PARAM_PART_COPY(use_alternate_font_metrics) 3373 _PARAM_PART_COPY(use_alternate_font_metrics)
@@ -3878,6 +3880,25 @@ edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_F
3878 return EINA_TRUE; 3880 return EINA_TRUE;
3879} 3881}
3880 3882
3883EAPI Evas_Event_Flags
3884edje_edit_part_mask_flags_get(Evas_Object *obj, const char *part)
3885{
3886 GET_RP_OR_RETURN(0);
3887
3888 return rp->part->mask_flags;
3889}
3890
3891EAPI Eina_Bool
3892edje_edit_part_mask_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags mask_flags)
3893{
3894 GET_RP_OR_RETURN(EINA_FALSE);
3895
3896 if (!rp->object) return EINA_FALSE;
3897
3898 rp->part->mask_flags = mask_flags;
3899 return EINA_TRUE;
3900}
3901
3881EAPI Evas_Object_Pointer_Mode 3902EAPI Evas_Object_Pointer_Mode
3882edje_edit_part_pointer_mode_get(Evas_Object *obj, const char *part) 3903edje_edit_part_pointer_mode_get(Evas_Object *obj, const char *part)
3883{ 3904{
@@ -11354,6 +11375,8 @@ _edje_generate_source_of_part(Evas_Object *obj, Edje_Part *ep, Eina_Strbuf *buf)
11354 11375
11355 if (rp->part->ignore_flags) 11376 if (rp->part->ignore_flags)
11356 BUF_APPENDF(I4 "ignore_flags: \"ON_HOLD\";\n"); 11377 BUF_APPENDF(I4 "ignore_flags: \"ON_HOLD\";\n");
11378 if (rp->part->mask_flags)
11379 BUF_APPENDF(I4 "mask_flags: \"ON_HOLD\";\n");
11357 if (rp->part->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB) 11380 if (rp->part->pointer_mode == EVAS_OBJECT_POINTER_MODE_NOGRAB)
11358 BUF_APPEND(I4 "pointer_mode: NOGRAB;\n"); 11381 BUF_APPEND(I4 "pointer_mode: NOGRAB;\n");
11359 if (rp->part->precise_is_inside) 11382 if (rp->part->precise_is_inside)
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 42945585bf..4a57d566b0 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -746,6 +746,7 @@ _edje_anchor_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EIN
746 snprintf(buf, len, "anchor,mouse,down,%i,%s", ev->button, n); 746 snprintf(buf, len, "anchor,mouse,down,%i,%s", ev->button, n);
747 _edje_emit(ed, buf, rp->part->name); 747 _edje_emit(ed, buf, rp->part->name);
748 } 748 }
749 ev->event_flags |= rp->part->mask_flags;
749} 750}
750 751
751static void 752static void
@@ -783,6 +784,7 @@ _edje_anchor_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
783 snprintf(buf, len, "anchor,mouse,clicked,%i,%s", ev->button, n); 784 snprintf(buf, len, "anchor,mouse,clicked,%i,%s", ev->button, n);
784 _edje_emit(ed, buf, rp->part->name); 785 _edje_emit(ed, buf, rp->part->name);
785 } 786 }
787 ev->event_flags |= rp->part->mask_flags;
786} 788}
787 789
788static void 790static void
@@ -814,6 +816,7 @@ _edje_anchor_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EIN
814 snprintf(buf, len, "anchor,mouse,move,%s", n); 816 snprintf(buf, len, "anchor,mouse,move,%s", n);
815 _edje_emit(ed, buf, rp->part->name); 817 _edje_emit(ed, buf, rp->part->name);
816 } 818 }
819 ev->event_flags |= rp->part->mask_flags;
817} 820}
818 821
819static void 822static void
@@ -841,6 +844,7 @@ _edje_anchor_mouse_in_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
841 snprintf(buf, len, "anchor,mouse,in,%s", n); 844 snprintf(buf, len, "anchor,mouse,in,%s", n);
842 _edje_emit(ed, buf, rp->part->name); 845 _edje_emit(ed, buf, rp->part->name);
843 } 846 }
847 ev->event_flags |= rp->part->mask_flags;
844} 848}
845 849
846static void 850static void
@@ -868,6 +872,7 @@ _edje_anchor_mouse_out_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
868 snprintf(buf, len, "anchor,mouse,out,%s", n); 872 snprintf(buf, len, "anchor,mouse,out,%s", n);
869 _edje_emit(ed, buf, rp->part->name); 873 _edje_emit(ed, buf, rp->part->name);
870 } 874 }
875 ev->event_flags |= rp->part->mask_flags;
871} 876}
872 877
873static void 878static void
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 2b1ec6b43a..824d2c436e 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1130,6 +1130,7 @@ struct _Edje_Part
1130 unsigned char repeat_events; /* it will repeat events to objects below */ 1130 unsigned char repeat_events; /* it will repeat events to objects below */
1131 unsigned char anti_alias; 1131 unsigned char anti_alias;
1132 Evas_Event_Flags ignore_flags; 1132 Evas_Event_Flags ignore_flags;
1133 Evas_Event_Flags mask_flags;
1133 unsigned char scale; /* should certain properties scale with edje scale factor? */ 1134 unsigned char scale; /* should certain properties scale with edje scale factor? */
1134 Edje_3D_Vec scale_3d; 1135 Edje_3D_Vec scale_3d;
1135 unsigned char precise_is_inside; 1136 unsigned char precise_is_inside;