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>
This commit is contained in:
parent
848cc1d1ea
commit
3973ecf2e8
|
@ -4369,7 +4369,8 @@ st_collections_group_parts_part_access(void)
|
||||||
enabled, 1 will set the starting point at 0.0 and -1 at 1.0. The second
|
enabled, 1 will set the starting point at 0.0 and -1 at 1.0. The second
|
||||||
parameter takes any integer and will limit movement to values
|
parameter takes any integer and will limit movement to values
|
||||||
divisible by it, causing the part to jump from position to position.
|
divisible by it, causing the part to jump from position to position.
|
||||||
The third parameter, (question from the author: What is count for?).
|
If step is set to 0 it is calculated as width of confine part divided by
|
||||||
|
count.
|
||||||
@endproperty
|
@endproperty
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
@ -4394,7 +4395,8 @@ st_collections_group_parts_part_dragable_x(void)
|
||||||
enabled, 1 will set the starting point at 0.0 and -1 at 1.0. The second
|
enabled, 1 will set the starting point at 0.0 and -1 at 1.0. The second
|
||||||
parameter takes any integer and will limit movement to values
|
parameter takes any integer and will limit movement to values
|
||||||
divisibles by it, causing the part to jump from position to position.
|
divisibles by it, causing the part to jump from position to position.
|
||||||
The third parameter, (question from the author: What is count for?).
|
If step is set to 0 it is calculated as height of confine part divided by
|
||||||
|
count.
|
||||||
@endproperty
|
@endproperty
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1026,8 +1026,10 @@ EAPI int edje_edit_part_drag_x_get(Evas_Object *obj, const char *part);
|
||||||
* @param obj Object being edited.
|
* @param obj Object being edited.
|
||||||
* @param part Part to set if should be dragged horizontally.
|
* @param part Part to set if should be dragged horizontally.
|
||||||
* @param drag 1 (or -1) if the part should be dragged horizontally, 0 otherwise.
|
* @param drag 1 (or -1) if the part should be dragged horizontally, 0 otherwise.
|
||||||
|
*
|
||||||
|
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
EAPI void edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag);
|
EAPI Eina_Bool edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag);
|
||||||
|
|
||||||
/** Get vertical dragable state for part.
|
/** Get vertical dragable state for part.
|
||||||
*
|
*
|
||||||
|
@ -1043,8 +1045,10 @@ EAPI int edje_edit_part_drag_y_get(Evas_Object *obj, const char *part);
|
||||||
* @param obj Object being edited.
|
* @param obj Object being edited.
|
||||||
* @param part Part to set if should be dragged vertically.
|
* @param part Part to set if should be dragged vertically.
|
||||||
* @param drag 1 (or -1) of the part shpuld be dragged vertically, 0 otherwise.
|
* @param drag 1 (or -1) of the part shpuld be dragged vertically, 0 otherwise.
|
||||||
|
*
|
||||||
|
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
EAPI void edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag);
|
EAPI Eina_Bool edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag);
|
||||||
|
|
||||||
/** Get horizontal dragable step for part.
|
/** Get horizontal dragable step for part.
|
||||||
*
|
*
|
||||||
|
@ -1060,8 +1064,10 @@ EAPI int edje_edit_part_drag_step_x_get(Evas_Object *obj, const char *part);
|
||||||
* @param obj Object being edited.
|
* @param obj Object being edited.
|
||||||
* @param part Part to set the drag horizontal step value.
|
* @param part Part to set the drag horizontal step value.
|
||||||
* @param step The step the will be dragged.
|
* @param step The step the will be dragged.
|
||||||
|
*
|
||||||
|
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
EAPI void edje_edit_part_drag_step_x_set(Evas_Object *obj, const char *part, int step);
|
EAPI Eina_Bool edje_edit_part_drag_step_x_set(Evas_Object *obj, const char *part, int step);
|
||||||
|
|
||||||
/** Get vertical dragable step for part.
|
/** Get vertical dragable step for part.
|
||||||
*
|
*
|
||||||
|
@ -1077,8 +1083,10 @@ EAPI int edje_edit_part_drag_step_y_get(Evas_Object *obj, const char *part);
|
||||||
* @param obj Object being edited.
|
* @param obj Object being edited.
|
||||||
* @param part Part to set the drag vertical step value.
|
* @param part Part to set the drag vertical step value.
|
||||||
* @param step The step the will be dragged.
|
* @param step The step the will be dragged.
|
||||||
|
*
|
||||||
|
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
EAPI void edje_edit_part_drag_step_y_set(Evas_Object *obj, const char *part, int step);
|
EAPI Eina_Bool edje_edit_part_drag_step_y_set(Evas_Object *obj, const char *part, int step);
|
||||||
|
|
||||||
/** Get horizontal dragable count for part.
|
/** Get horizontal dragable count for part.
|
||||||
*
|
*
|
||||||
|
@ -1092,8 +1100,10 @@ EAPI int edje_edit_part_drag_count_x_get(Evas_Object *obj, const char *part);
|
||||||
* @param obj Object being edited.
|
* @param obj Object being edited.
|
||||||
* @param part Part to set the drag horizontal count value.
|
* @param part Part to set the drag horizontal count value.
|
||||||
* @param count The count value.
|
* @param count The count value.
|
||||||
|
*
|
||||||
|
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
EAPI void edje_edit_part_drag_count_x_set(Evas_Object *obj, const char *part, int count);
|
EAPI Eina_Bool edje_edit_part_drag_count_x_set(Evas_Object *obj, const char *part, int count);
|
||||||
|
|
||||||
/** Get vertical dragable count for part.
|
/** Get vertical dragable count for part.
|
||||||
*
|
*
|
||||||
|
@ -1107,8 +1117,10 @@ EAPI int edje_edit_part_drag_count_y_get(Evas_Object *obj, const char *part);
|
||||||
* @param obj Object being edited.
|
* @param obj Object being edited.
|
||||||
* @param part Part to set the drag vertical count value.
|
* @param part Part to set the drag vertical count value.
|
||||||
* @param count The count value.
|
* @param count The count value.
|
||||||
|
*
|
||||||
|
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
EAPI void edje_edit_part_drag_count_y_set(Evas_Object *obj, const char *part, int count);
|
EAPI Eina_Bool edje_edit_part_drag_count_y_set(Evas_Object *obj, const char *part, int count);
|
||||||
|
|
||||||
/** Get the name of the part that is used as 'confine' for the given draggies.
|
/** Get the name of the part that is used as 'confine' for the given draggies.
|
||||||
*
|
*
|
||||||
|
@ -1148,6 +1160,25 @@ EAPI const char * edje_edit_part_drag_event_get(Evas_Object *obj, const char *pa
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Bool edje_edit_part_drag_event_set(Evas_Object *obj, const char *part, const char *event);
|
EAPI Eina_Bool edje_edit_part_drag_event_set(Evas_Object *obj, const char *part, const char *event);
|
||||||
|
|
||||||
|
/** Get the name of the part that is used as 'threshold' for the given draggies.
|
||||||
|
*
|
||||||
|
* @param obj Object being edited.
|
||||||
|
* @param part Part to get the name that is used as 'threshold' for the given draggies.
|
||||||
|
*
|
||||||
|
* @return The name of the threshold part or NULL (if unset).
|
||||||
|
*/
|
||||||
|
EAPI const char * edje_edit_part_drag_threshold_get(Evas_Object *obj, const char *part);
|
||||||
|
|
||||||
|
/** Set the name of the part that is used as 'threshold' for the given draggies.
|
||||||
|
*
|
||||||
|
* @param obj Object being edited.
|
||||||
|
* @param part Part to set the name that is used as 'threshold' for the given draggies.
|
||||||
|
* @param confine The name of the threshold part or NULL to unset confine.
|
||||||
|
*
|
||||||
|
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
|
||||||
|
*/
|
||||||
|
EAPI Eina_Bool edje_edit_part_drag_threshold_set(Evas_Object *obj, const char *part, const char *threshold);
|
||||||
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
|
@ -2506,76 +2506,75 @@ EAPI int
|
||||||
edje_edit_part_drag_x_get(Evas_Object *obj, const char *part)
|
edje_edit_part_drag_x_get(Evas_Object *obj, const char *part)
|
||||||
{
|
{
|
||||||
GET_RP_OR_RETURN(0);
|
GET_RP_OR_RETURN(0);
|
||||||
//printf("Get dragX for part: %s\n", part);
|
|
||||||
return rp->part->dragable.x;
|
return rp->part->dragable.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI Eina_Bool
|
||||||
edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag)
|
edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag)
|
||||||
{
|
{
|
||||||
GET_RP_OR_RETURN();
|
GET_RP_OR_RETURN(EINA_FALSE);
|
||||||
//printf("Set dragX for part: %s\n", part);
|
|
||||||
rp->part->dragable.x = drag;
|
rp->part->dragable.x = drag;
|
||||||
|
|
||||||
if (!drag && !rp->part->dragable.y)
|
if (!drag && !rp->part->dragable.y)
|
||||||
{
|
{
|
||||||
free(rp->drag);
|
free(rp->drag);
|
||||||
rp->drag = NULL;
|
rp->drag = NULL;
|
||||||
return;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rp->drag) return;
|
if (rp->drag) return EINA_TRUE;
|
||||||
|
|
||||||
rp->drag = _alloc(sizeof (Edje_Real_Part_Drag));
|
rp->drag = _alloc(sizeof (Edje_Real_Part_Drag));
|
||||||
if (!rp->drag) return;
|
if (!rp->drag) return EINA_FALSE;
|
||||||
|
|
||||||
rp->drag->step.x = rp->part->dragable.step_x;
|
rp->drag->step.x = rp->part->dragable.step_x;
|
||||||
rp->drag->step.y = rp->part->dragable.step_y;
|
rp->drag->step.y = rp->part->dragable.step_y;
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
edje_edit_part_drag_y_get(Evas_Object *obj, const char *part)
|
edje_edit_part_drag_y_get(Evas_Object *obj, const char *part)
|
||||||
{
|
{
|
||||||
GET_RP_OR_RETURN(0);
|
GET_RP_OR_RETURN(0);
|
||||||
//printf("Get dragY for part: %s\n", part);
|
|
||||||
return rp->part->dragable.y;
|
return rp->part->dragable.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI Eina_Bool
|
||||||
edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag)
|
edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag)
|
||||||
{
|
{
|
||||||
GET_RP_OR_RETURN();
|
GET_RP_OR_RETURN(EINA_FALSE);
|
||||||
//printf("Set dragY for part: %s\n", part);
|
|
||||||
rp->part->dragable.y = drag;
|
rp->part->dragable.y = drag;
|
||||||
|
|
||||||
if (!drag && !rp->part->dragable.x)
|
if (!drag && !rp->part->dragable.x)
|
||||||
{
|
{
|
||||||
free(rp->drag);
|
free(rp->drag);
|
||||||
rp->drag = NULL;
|
rp->drag = NULL;
|
||||||
return;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rp->drag) return;
|
if (rp->drag) return EINA_TRUE;
|
||||||
|
|
||||||
rp->drag = _alloc(sizeof (Edje_Real_Part_Drag));
|
rp->drag = _alloc(sizeof (Edje_Real_Part_Drag));
|
||||||
if (!rp->drag) return;
|
if (!rp->drag) return EINA_FALSE;
|
||||||
|
|
||||||
rp->drag->step.x = rp->part->dragable.step_x;
|
rp->drag->step.x = rp->part->dragable.step_x;
|
||||||
rp->drag->step.y = rp->part->dragable.step_y;
|
rp->drag->step.y = rp->part->dragable.step_y;
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FUNC_PART_DRAG_INT(Class, Value) \
|
#define FUNC_PART_DRAG_INT(Class, Value) \
|
||||||
EAPI int \
|
EAPI int \
|
||||||
edje_edit_part_drag_##Class##_##Value##_get(Evas_Object *obj, const char *part) \
|
edje_edit_part_drag_##Class##_##Value##_get(Evas_Object *obj, const char *part) \
|
||||||
{ \
|
{ \
|
||||||
GET_RP_OR_RETURN(0); \
|
GET_RP_OR_RETURN(0); \
|
||||||
return rp->part->dragable.Class##_##Value; \
|
return rp->part->dragable.Class##_##Value; \
|
||||||
} \
|
} \
|
||||||
EAPI void \
|
EAPI Eina_Bool \
|
||||||
edje_edit_part_drag_##Class##_##Value##_set(Evas_Object *obj, const char *part, int v) \
|
edje_edit_part_drag_##Class##_##Value##_set(Evas_Object *obj, const char *part, int v) \
|
||||||
{ \
|
{ \
|
||||||
GET_RP_OR_RETURN(); \
|
GET_RP_OR_RETURN(EINA_FALSE); \
|
||||||
rp->part->dragable.Class##_##Value = v; \
|
rp->part->dragable.Class##_##Value = v; \
|
||||||
|
return EINA_TRUE; \
|
||||||
}
|
}
|
||||||
|
|
||||||
FUNC_PART_DRAG_INT(step, x);
|
FUNC_PART_DRAG_INT(step, x);
|
||||||
|
@ -2620,6 +2619,7 @@ FUNC_PART_DRAG_INT(count, y);
|
||||||
|
|
||||||
FUNC_PART_DRAG_ID(confine);
|
FUNC_PART_DRAG_ID(confine);
|
||||||
FUNC_PART_DRAG_ID(event);
|
FUNC_PART_DRAG_ID(event);
|
||||||
|
FUNC_PART_DRAG_ID(threshold);
|
||||||
|
|
||||||
/*********************/
|
/*********************/
|
||||||
/* PART STATES API */
|
/* PART STATES API */
|
||||||
|
|
Loading…
Reference in New Issue