summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_edit.c
diff options
context:
space:
mode:
authorAndrii Kroitor <an.kroitor@samsung.com>2013-11-01 11:03:30 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-11-01 11:03:34 +0900
commit3973ecf2e80b0546bcd26cc7a56b6719f0263fee (patch)
tree127d70372d911e2260ecb0304e6e9dc24af98e3d /src/lib/edje/edje_edit.c
parent848cc1d1ea1fc99bf5c8181a6735a414c178076f (diff)
edje: make functions return Eina_Bool and fix documentation.
Make the following functions return Eina_Bool so the caller can detect errors: edje_edit_part_drag_x_set edje_edit_part_drag_y_set edje_edit_part_drag_step_x_set edje_edit_part_drag_step_y_set edje_edit_part_drag_count_x_set edje_edit_part_drag_count_y_set Added functions for threshold: edje_edit_part_drag_threshold_set edje_edit_part_drag_threshold_get Fixed description of 'count' parameter of dragable.x/y Reviewers: cedric, seoz Reviewed By: cedric CC: reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D304 Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/edje/edje_edit.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 2699604d1b..46ad74c97d 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -2506,76 +2506,75 @@ EAPI int
2506edje_edit_part_drag_x_get(Evas_Object *obj, const char *part) 2506edje_edit_part_drag_x_get(Evas_Object *obj, const char *part)
2507{ 2507{
2508 GET_RP_OR_RETURN(0); 2508 GET_RP_OR_RETURN(0);
2509 //printf("Get dragX for part: %s\n", part);
2510 return rp->part->dragable.x; 2509 return rp->part->dragable.x;
2511} 2510}
2512 2511
2513EAPI void 2512EAPI Eina_Bool
2514edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag) 2513edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag)
2515{ 2514{
2516 GET_RP_OR_RETURN(); 2515 GET_RP_OR_RETURN(EINA_FALSE);
2517 //printf("Set dragX for part: %s\n", part);
2518 rp->part->dragable.x = drag; 2516 rp->part->dragable.x = drag;
2519 2517
2520 if (!drag && !rp->part->dragable.y) 2518 if (!drag && !rp->part->dragable.y)
2521 { 2519 {
2522 free(rp->drag); 2520 free(rp->drag);
2523 rp->drag = NULL; 2521 rp->drag = NULL;
2524 return; 2522 return EINA_TRUE;
2525 } 2523 }
2526 2524
2527 if (rp->drag) return; 2525 if (rp->drag) return EINA_TRUE;
2528 2526
2529 rp->drag = _alloc(sizeof (Edje_Real_Part_Drag)); 2527 rp->drag = _alloc(sizeof (Edje_Real_Part_Drag));
2530 if (!rp->drag) return; 2528 if (!rp->drag) return EINA_FALSE;
2531 2529
2532 rp->drag->step.x = rp->part->dragable.step_x; 2530 rp->drag->step.x = rp->part->dragable.step_x;
2533 rp->drag->step.y = rp->part->dragable.step_y; 2531 rp->drag->step.y = rp->part->dragable.step_y;
2532 return EINA_TRUE;
2534} 2533}
2535 2534
2536EAPI int 2535EAPI int
2537edje_edit_part_drag_y_get(Evas_Object *obj, const char *part) 2536edje_edit_part_drag_y_get(Evas_Object *obj, const char *part)
2538{ 2537{
2539 GET_RP_OR_RETURN(0); 2538 GET_RP_OR_RETURN(0);
2540 //printf("Get dragY for part: %s\n", part);
2541 return rp->part->dragable.y; 2539 return rp->part->dragable.y;
2542} 2540}
2543 2541
2544EAPI void 2542EAPI Eina_Bool
2545edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag) 2543edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag)
2546{ 2544{
2547 GET_RP_OR_RETURN(); 2545 GET_RP_OR_RETURN(EINA_FALSE);
2548 //printf("Set dragY for part: %s\n", part);
2549 rp->part->dragable.y = drag; 2546 rp->part->dragable.y = drag;
2550 2547
2551 if (!drag && !rp->part->dragable.x) 2548 if (!drag && !rp->part->dragable.x)
2552 { 2549 {
2553 free(rp->drag); 2550 free(rp->drag);
2554 rp->drag = NULL; 2551 rp->drag = NULL;
2555 return; 2552 return EINA_TRUE;
2556 } 2553 }
2557 2554
2558 if (rp->drag) return; 2555 if (rp->drag) return EINA_TRUE;
2559 2556
2560 rp->drag = _alloc(sizeof (Edje_Real_Part_Drag)); 2557 rp->drag = _alloc(sizeof (Edje_Real_Part_Drag));
2561 if (!rp->drag) return; 2558 if (!rp->drag) return EINA_FALSE;
2562 2559
2563 rp->drag->step.x = rp->part->dragable.step_x; 2560 rp->drag->step.x = rp->part->dragable.step_x;
2564 rp->drag->step.y = rp->part->dragable.step_y; 2561 rp->drag->step.y = rp->part->dragable.step_y;
2562 return EINA_TRUE;
2565} 2563}
2566 2564
2567#define FUNC_PART_DRAG_INT(Class, Value) \ 2565#define FUNC_PART_DRAG_INT(Class, Value) \
2568 EAPI int \ 2566 EAPI int \
2569 edje_edit_part_drag_##Class##_##Value##_get(Evas_Object *obj, const char *part) \ 2567 edje_edit_part_drag_##Class##_##Value##_get(Evas_Object *obj, const char *part) \
2570 { \ 2568 { \
2571 GET_RP_OR_RETURN(0); \ 2569 GET_RP_OR_RETURN(0); \
2572 return rp->part->dragable.Class##_##Value; \ 2570 return rp->part->dragable.Class##_##Value; \
2573 } \ 2571 } \
2574 EAPI void \ 2572 EAPI Eina_Bool \
2575 edje_edit_part_drag_##Class##_##Value##_set(Evas_Object *obj, const char *part, int v) \ 2573 edje_edit_part_drag_##Class##_##Value##_set(Evas_Object *obj, const char *part, int v) \
2576 { \ 2574 { \
2577 GET_RP_OR_RETURN(); \ 2575 GET_RP_OR_RETURN(EINA_FALSE); \
2578 rp->part->dragable.Class##_##Value = v; \ 2576 rp->part->dragable.Class##_##Value = v; \
2577 return EINA_TRUE; \
2579 } 2578 }
2580 2579
2581FUNC_PART_DRAG_INT(step, x); 2580FUNC_PART_DRAG_INT(step, x);
@@ -2620,6 +2619,7 @@ FUNC_PART_DRAG_INT(count, y);
2620 2619
2621FUNC_PART_DRAG_ID(confine); 2620FUNC_PART_DRAG_ID(confine);
2622FUNC_PART_DRAG_ID(event); 2621FUNC_PART_DRAG_ID(event);
2622FUNC_PART_DRAG_ID(threshold);
2623 2623
2624/*********************/ 2624/*********************/
2625/* PART STATES API */ 2625/* PART STATES API */