* @param obj Object being edited.
* @param part Part to set if should be dragged horizontally.
* @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.
*
* @param obj Object being edited.
* @param part Part to set if should be dragged vertically.
* @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.
*
* @param obj Object being edited.
* @param part Part to set the drag horizontal step value.
* @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.
*
* @param obj Object being edited.
* @param part Part to set the drag vertical step value.
* @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.
*
* @param obj Object being edited.
* @param part Part to set the drag horizontal 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.
*
* @param obj Object being edited.
* @param part Part to set the drag vertical 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.
*
*/
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);
+
//@}
/******************************************************************************/
edje_edit_part_drag_x_get(Evas_Object *obj, const char *part)
{
GET_RP_OR_RETURN(0);
- //printf("Get dragX for part: %s\n", part);
return rp->part->dragable.x;
}
-EAPI void
+EAPI Eina_Bool
edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag)
{
- GET_RP_OR_RETURN();
- //printf("Set dragX for part: %s\n", part);
+ GET_RP_OR_RETURN(EINA_FALSE);
rp->part->dragable.x = drag;
if (!drag && !rp->part->dragable.y)
{
- free(rp->drag);
- rp->drag = NULL;
- return;
+ free(rp->drag);
+ rp->drag = NULL;
+ return EINA_TRUE;
}
- if (rp->drag) return;
+ if (rp->drag) return EINA_TRUE;
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.y = rp->part->dragable.step_y;
+ return EINA_TRUE;
}
EAPI int
edje_edit_part_drag_y_get(Evas_Object *obj, const char *part)
{
GET_RP_OR_RETURN(0);
- //printf("Get dragY for part: %s\n", part);
return rp->part->dragable.y;
}
-EAPI void
+EAPI Eina_Bool
edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag)
{
- GET_RP_OR_RETURN();
- //printf("Set dragY for part: %s\n", part);
+ GET_RP_OR_RETURN(EINA_FALSE);
rp->part->dragable.y = drag;
if (!drag && !rp->part->dragable.x)
{
- free(rp->drag);
- rp->drag = NULL;
- return;
+ free(rp->drag);
+ rp->drag = NULL;
+ return EINA_TRUE;
}
- if (rp->drag) return;
+ if (rp->drag) return EINA_TRUE;
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.y = rp->part->dragable.step_y;
+ return EINA_TRUE;
}
-#define FUNC_PART_DRAG_INT(Class, Value) \
- EAPI int \
+#define FUNC_PART_DRAG_INT(Class, Value) \
+ EAPI int \
edje_edit_part_drag_##Class##_##Value##_get(Evas_Object *obj, const char *part) \
- { \
- GET_RP_OR_RETURN(0); \
- return rp->part->dragable.Class##_##Value; \
- } \
- EAPI void \
+ { \
+ GET_RP_OR_RETURN(0); \
+ return rp->part->dragable.Class##_##Value; \
+ } \
+ EAPI Eina_Bool \
edje_edit_part_drag_##Class##_##Value##_set(Evas_Object *obj, const char *part, int v) \
- { \
- GET_RP_OR_RETURN(); \
- rp->part->dragable.Class##_##Value = v; \
+ { \
+ GET_RP_OR_RETURN(EINA_FALSE); \
+ rp->part->dragable.Class##_##Value = v; \
+ return EINA_TRUE; \
}
FUNC_PART_DRAG_INT(step, x);
FUNC_PART_DRAG_ID(confine);
FUNC_PART_DRAG_ID(event);
+FUNC_PART_DRAG_ID(threshold);
/*********************/
/* PART STATES API */