summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAndrii Kroitor <an.kroitor@samsung.com>2013-11-01 11:30:23 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-11-01 11:31:47 +0900
commitd00721a3d79699637e935472d6e80f21ec055c73 (patch)
tree1ad7402972f660980d08b0c819cbf7fc2d15afb6 /src/lib
parent6f8b1c1b02e4b59da437e40acd2f3434e78d1c7a (diff)
edje: make mouse_events, repeat_events, ignore_flags and scale setters return Eina_Bool.
Make the following function return Eina_Bool so the caller can detect errors : edje_edit_part_mouse_events_set edje_edit_part_repeat_events_set edje_edit_part_ignore_flags_set edje_edit_part_scale_set Reviewers: cedric, seoz Reviewed By: cedric CC: reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D303 Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/edje/Edje_Edit.h22
-rw-r--r--src/lib/edje/edje_edit.c45
2 files changed, 36 insertions, 31 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 2a2f5e1bc2..917dd79e94 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -946,7 +946,7 @@ EAPI Eina_Bool edje_edit_part_selected_state_set(Evas_Object *obj, const char *p
946 * @param obj Object being edited. 946 * @param obj Object being edited.
947 * @param part Part to get if the mouse events is accepted. 947 * @param part Part to get if the mouse events is accepted.
948 * 948 *
949 * @return EINA_TRUE if successful, EINA_FALSE otherwise. 949 * @return EINA_TRUE if part will accept mouse events, EINA_FALSE otherwise.
950 */ 950 */
951EAPI Eina_Bool edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part); 951EAPI Eina_Bool edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part);
952 952
@@ -955,15 +955,17 @@ EAPI Eina_Bool edje_edit_part_mouse_events_get(Evas_Object *obj, const char *par
955 * @param obj Object being edited. 955 * @param obj Object being edited.
956 * @param part The part to set if the mouse events is accepted. 956 * @param part The part to set if the mouse events is accepted.
957 * @param mouse_events EINA_TRUE if part will accept mouse events, EINA_FALSE otherwise. 957 * @param mouse_events EINA_TRUE if part will accept mouse events, EINA_FALSE otherwise.
958 *
959 * @return EINA_TRUE if successful, EINA_FALSE otherwise.
958 */ 960 */
959EAPI void edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events); 961EAPI Eina_Bool edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events);
960 962
961/** Get repeat_events for part. 963/** Get repeat_events for part.
962 * 964 *
963 * @param obj Object being edited. 965 * @param obj Object being edited.
964 * @param part Part to set if will pass all events to the other parts. 966 * @param part Part to get if it will pass all events to the other parts.
965 * 967 *
966 * @return EINA_TRUE if successful, EINA_FALSE otherwise. 968 * @return EINA_TRUE if the events received will propagate to other parts, EINA_FALSE otherwise
967 */ 969 */
968EAPI Eina_Bool edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part); 970EAPI Eina_Bool edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part);
969 971
@@ -972,8 +974,10 @@ EAPI Eina_Bool edje_edit_part_repeat_events_get(Evas_Object *obj, const char *pa
972 * @param obj Object being edited. 974 * @param obj Object being edited.
973 * @param part Part to set if will repeat all the received mouse events to other parts. 975 * @param part Part to set if will repeat all the received mouse events to other parts.
974 * @param repeat_events EINA_TRUE if the events received will propagate to other parts, EINA_FALSE otherwise 976 * @param repeat_events EINA_TRUE if the events received will propagate to other parts, EINA_FALSE otherwise
977 *
978 * @return EINA_TRUE if successful, EINA_FALSE otherwise.
975 */ 979 */
976EAPI void edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events); 980EAPI Eina_Bool edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events);
977 981
978/** Get ignore_flags for part. 982/** Get ignore_flags for part.
979 * 983 *
@@ -989,8 +993,10 @@ EAPI Evas_Event_Flags edje_edit_part_ignore_flags_get(Evas_Object *obj, const ch
989 * @param obj Object being edited. 993 * @param obj Object being edited.
990 * @param part Part to set which event flags will be ignored. 994 * @param part Part to set which event flags will be ignored.
991 * @param ignore_flags The Event flags to be ignored by the part. 995 * @param ignore_flags The Event flags to be ignored by the part.
996 *
997 * @return EINA_TRUE if successful, EINA_FALSE otherwise.
992 */ 998 */
993EAPI void edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags); 999EAPI Eina_Bool edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags);
994 1000
995/** Set scale property for the part. 1001/** Set scale property for the part.
996 * 1002 *
@@ -1000,8 +1006,10 @@ EAPI void edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Ev
1000 * @param obj Object being edited. 1006 * @param obj Object being edited.
1001 * @param part Part to set scale for. 1007 * @param part Part to set scale for.
1002 * @param scale Scale value to set. 1008 * @param scale Scale value to set.
1009 *
1010 * @return EINA_TRUE if successful, EINA_FALSE otherwise.
1003 */ 1011 */
1004EAPI void edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale); 1012EAPI Eina_Bool edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale);
1005 1013
1006/** Get scale for the part. 1014/** Get scale for the part.
1007 * 1015 *
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index d75b55f707..038414d9d2 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -2371,50 +2371,44 @@ EAPI Eina_Bool
2371edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part) 2371edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part)
2372{ 2372{
2373 GET_RP_OR_RETURN(EINA_FALSE); 2373 GET_RP_OR_RETURN(EINA_FALSE);
2374 //printf("Get mouse_events for part: %s [%d]\n", part, rp->part->mouse_events);
2375 return rp->part->mouse_events; 2374 return rp->part->mouse_events;
2376} 2375}
2377 2376
2378EAPI void 2377EAPI Eina_Bool
2379edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events) 2378edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events)
2380{ 2379{
2381 GET_RP_OR_RETURN(); 2380 GET_RP_OR_RETURN(EINA_FALSE);
2382
2383 if (!rp->object) return;
2384 2381
2385 //printf("Set mouse_events for part: %s [%d]\n", part, mouse_events); 2382 if (!rp->object) return EINA_FALSE;
2386 2383
2387 rp->part->mouse_events = mouse_events ? 1 : 0; 2384 rp->part->mouse_events = mouse_events ? 1 : 0;
2388 2385
2389 if (mouse_events) 2386 if (mouse_events)
2390 { 2387 {
2391 evas_object_pass_events_set(rp->object, 0); 2388 evas_object_pass_events_set(rp->object, 0);
2392 _edje_callbacks_add(rp->object, ed, rp); 2389 _edje_callbacks_add(rp->object, ed, rp);
2393 } 2390 }
2394 else 2391 else
2395 { 2392 {
2396 evas_object_pass_events_set(rp->object, 1); 2393 evas_object_pass_events_set(rp->object, 1);
2397 _edje_callbacks_del(rp->object, ed); 2394 _edje_callbacks_del(rp->object, ed);
2398 } 2395 }
2396 return EINA_TRUE;
2399} 2397}
2400 2398
2401EAPI Eina_Bool 2399EAPI Eina_Bool
2402edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part) 2400edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part)
2403{ 2401{
2404 GET_RP_OR_RETURN(EINA_FALSE); 2402 GET_RP_OR_RETURN(EINA_FALSE);
2405
2406 //printf("Get repeat_events for part: %s [%d]\n", part, rp->part->repeat_events);
2407 return rp->part->repeat_events; 2403 return rp->part->repeat_events;
2408} 2404}
2409 2405
2410EAPI void 2406EAPI Eina_Bool
2411edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events) 2407edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events)
2412{ 2408{
2413 GET_RP_OR_RETURN(); 2409 GET_RP_OR_RETURN(EINA_FALSE);
2414
2415 if (!rp->object) return;
2416 2410
2417 //printf("Set repeat_events for part: %s [%d]\n", part, repeat_events); 2411 if (!rp->object) return EINA_FALSE;
2418 2412
2419 rp->part->repeat_events = repeat_events ? 1 : 0; 2413 rp->part->repeat_events = repeat_events ? 1 : 0;
2420 2414
@@ -2422,6 +2416,8 @@ edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool r
2422 evas_object_repeat_events_set(rp->object, 1); 2416 evas_object_repeat_events_set(rp->object, 1);
2423 else 2417 else
2424 evas_object_repeat_events_set(rp->object, 0); 2418 evas_object_repeat_events_set(rp->object, 0);
2419
2420 return EINA_TRUE;
2425} 2421}
2426 2422
2427EAPI Evas_Event_Flags 2423EAPI Evas_Event_Flags
@@ -2432,24 +2428,25 @@ edje_edit_part_ignore_flags_get(Evas_Object *obj, const char *part)
2432 return rp->part->ignore_flags; 2428 return rp->part->ignore_flags;
2433} 2429}
2434 2430
2435EAPI void 2431EAPI Eina_Bool
2436edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags) 2432edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags)
2437{ 2433{
2438 GET_RP_OR_RETURN(); 2434 GET_RP_OR_RETURN(EINA_FALSE);
2439 2435
2440 if (!rp->object) return; 2436 if (!rp->object) return EINA_FALSE;
2441 //printf("Set ignore_flags for part: %s [%#x]\n", part, ignore_flags);
2442 2437
2443 rp->part->ignore_flags = ignore_flags; 2438 rp->part->ignore_flags = ignore_flags;
2439 return EINA_TRUE;
2444} 2440}
2445 2441
2446EAPI void 2442EAPI Eina_Bool
2447edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale) 2443edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale)
2448{ 2444{
2449 GET_RP_OR_RETURN(); 2445 GET_RP_OR_RETURN(EINA_FALSE);
2450 2446
2451 rp->part->scale = scale; 2447 rp->part->scale = scale ? 1 : 0;
2452 edje_object_calc_force(obj); 2448 edje_object_calc_force(obj);
2449 return EINA_TRUE;
2453} 2450}
2454 2451
2455EAPI Eina_Bool 2452EAPI Eina_Bool