dragables are about complete now.. with new actions, page and step values....
authorCarsten Haitzler <raster@rasterman.com>
Mon, 1 Sep 2003 02:53:08 +0000 (02:53 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Mon, 1 Sep 2003 02:53:08 +0000 (02:53 +0000)
all happy & smelly.

SVN revision: 7395

legacy/edje/data/src/e_logo.edc
legacy/edje/data/src/test.edc
legacy/edje/src/bin/edje_cc_handlers.c
legacy/edje/src/bin/edje_main.c
legacy/edje/src/lib/Edje.h
legacy/edje/src/lib/edje_calc.c
legacy/edje/src/lib/edje_data.c
legacy/edje/src/lib/edje_load.c
legacy/edje/src/lib/edje_private.h
legacy/edje/src/lib/edje_program.c
legacy/edje/src/lib/edje_util.c

index 4458359ba8ebf6df4c5148a9ec6e04a9ec750f12..c89ff894fc4c69090da65bc2535efff94159a42b 100644 (file)
@@ -398,8 +398,8 @@ collections {
            mouse_events,  1;
            dragable {
               // drag in: DIR, ON/OFF STEPPING COUNT;
-              x,       1 1 0;
-              y,       1 1 0;
+              x,       -1 1 0;
+              y,        1 1 0;
               confine, "background";
            }
            description {
@@ -476,6 +476,20 @@ collections {
            in,         1.0 5.0;
            action,     SIGNAL_EMIT "do_random" "the_source";
         }
+        program {
+           name,       "logo_click_d1";
+           signal,     "mouse,down,1";
+           source,     "logo";
+           action,     DRAG_VAL_STEP 1.0 1.0;
+           target,     "dragable";
+        }
+        program {
+           name,       "logo_click_d2";
+           signal,     "mouse,down,3";
+           source,     "logo";
+           action,     DRAG_VAL_STEP -1.0 -1.0;
+           target,     "dragable";
+        }
       }
    }
 }
index bbf3dccd1ec05eb6f145c09a607fea7e7a8478e4..79eee4c4ea51f485a5caae37a4e3b49e49120983 100644 (file)
@@ -170,7 +170,7 @@ collections
                  name,       "logo_click";
                  signal,     "mouse-down-1";
                  source,     "logo";
-// STATE_SET ot ACTION_STOP here
+// STATE_SET, ACTION_STOP, SIGNAL_EMIT, DRAG_VAL_SET, DRAG_VAL_STEP, DRAG_VAL_PAGE
                  action,     STATE_SET "clicked" 0.0;
 // LINEAR, SINUSOIDAL, ACCELERATE, DECELERATE, + seconds to transition over
 //               transition, LINEAR 0.0;
index a3cff4094118a18fd29e75dc7bba3f912afeba4c..06c2203e8d4ccbad98b4e4785db46b7dbee80d68 100644 (file)
@@ -241,7 +241,8 @@ statement_handler_num(void)
 static void
 ob_images(void)
 {
-   edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
+   if (!edje_file->image_dir)
+     edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
 }
 
 static void
@@ -306,7 +307,8 @@ st_data_item(void)
 static void
 ob_collections(void)
 {
-   edje_file->collection_dir = mem_alloc(SZ(Edje_Part_Collection_Directory));
+   if (!edje_file->collection_dir)
+     edje_file->collection_dir = mem_alloc(SZ(Edje_Part_Collection_Directory));
 }
 
 static void
@@ -479,7 +481,7 @@ st_collections_group_parts_part_dragable_x(void)
 
    pc = evas_list_data(evas_list_last(edje_collections));
    ep = evas_list_data(evas_list_last(pc->parts));
-   ep->dragable.x = parse_int_range(0, 0, 1);
+   ep->dragable.x = parse_int_range(0, -1, 1);
    ep->dragable.step_x = parse_int_range(1, 0, 0x7fffffff);
    ep->dragable.count_x = parse_int_range(2, 0, 0x7fffffff);
 }
@@ -492,7 +494,7 @@ st_collections_group_parts_part_dragable_y(void)
 
    pc = evas_list_data(evas_list_last(edje_collections));
    ep = evas_list_data(evas_list_last(pc->parts));
-   ep->dragable.y = parse_int_range(0, 0, 1);
+   ep->dragable.y = parse_int_range(0, -1, 1);
    ep->dragable.step_y = parse_int_range(1, 0, 0x7fffffff);
    ep->dragable.count_y = parse_int_range(2, 0, 0x7fffffff);
 }
@@ -1229,6 +1231,9 @@ st_collections_group_programs_program_action(void)
                           "STATE_SET", EDJE_ACTION_TYPE_STATE_SET,
                           "ACTION_STOP", EDJE_ACTION_TYPE_ACTION_STOP,
                           "SIGNAL_EMIT", EDJE_ACTION_TYPE_SIGNAL_EMIT,
+                          "DRAG_VAL_SET", EDJE_ACTION_TYPE_DRAG_VAL_SET,
+                          "DRAG_VAL_STEP", EDJE_ACTION_TYPE_DRAG_VAL_STEP,
+                          "DRAG_VAL_PAGE", EDJE_ACTION_TYPE_DRAG_VAL_PAGE,
                           NULL);
    if (ep->action == EDJE_ACTION_TYPE_STATE_SET)
      {
@@ -1240,6 +1245,21 @@ st_collections_group_programs_program_action(void)
        ep->state = parse_str(1);
        ep->state2 = parse_str(2);
      }
+   else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_SET)
+     {
+       ep->value = parse_float(1);
+       ep->value2 = parse_float(2);
+     }
+   else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP)
+     {
+       ep->value = parse_float(1);
+       ep->value2 = parse_float(2);
+     }
+   else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE)
+     {
+       ep->value = parse_float(1);
+       ep->value2 = parse_float(2);
+     }
 }
 
 static void
@@ -1279,6 +1299,12 @@ st_collections_group_programs_program_target(void)
          data_queue_part_lookup(pc, name, &(et->id));
        else if (ep->action == EDJE_ACTION_TYPE_ACTION_STOP)
          data_queue_program_lookup(pc, name, &(et->id));
+       else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_SET)
+         data_queue_part_lookup(pc, name, &(et->id));
+       else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP)
+         data_queue_part_lookup(pc, name, &(et->id));
+       else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE)
+         data_queue_part_lookup(pc, name, &(et->id));
        else
          {
             /* FIXME: not type specified. guess */
index 452345d83b27a6cafa67234faf041569c222e1b8..5b80bf5ee49f7d7a851d9dd9d2bf861b1326649c 100644 (file)
@@ -447,7 +447,7 @@ list_head_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 static void
 cb (void *data, Evas_Object *o, const char *sig, const char *src)
 {
-//   printf("CALLBACK for %p %p \"%s\" \"%s\"\n", data, o, sig, src);
+   printf("CALLBACK for %p %p \"%s\" \"%s\"\n", data, o, sig, src);
    if (!strcmp(sig, "drag"))
      {
        double x, y;
@@ -687,9 +687,11 @@ test_setup(char *file, char *name)
    edje_object_file_set(o, file, name);
 //   edje_object_signal_callback_add(o, "do_it", "the_source", cb, NULL);
 //   edje_object_signal_callback_add(o, "mouse,*", "logo", cb, NULL);
-//   edje_object_signal_callback_add(o, "*", "*", cb, NULL);
-//   edje_object_part_drag_size_set(o, "dragable", 0.01, 0.5);
+   edje_object_signal_callback_add(o, "*", "*", cb, NULL);
+   edje_object_part_drag_size_set(o, "dragable", 0.01, 0.5);
 //   edje_object_part_drag_value_set(o, "dragable", 0.5, 0.5);
+edje_object_part_drag_step_set(o, "dragable", 0.1, 0.1);
+edje_object_part_drag_page_set(o, "dragable", 0.2, 0.2);
    evas_object_move(o, 10 + 10, 10 + 20);
    evas_object_show(o);
    edje_object_size_min_get(o, &(de->minw), &(de->minh));
index 217665b1c1f53347527aa2ac6357323ba3e84c12..1e41eec41d7dee2497c9c58e3f14eb7435c5b748 100644 (file)
@@ -56,6 +56,12 @@ extern "C" {
    void         edje_object_part_drag_value_get (Evas_Object *o, const char *part, double *dx, double *dy);
    void         edje_object_part_drag_size_set  (Evas_Object *o, const char *part, double dw, double dh);
    void         edje_object_part_drag_size_get  (Evas_Object *o, const char *part, double *dw, double *dh);
+   void         edje_object_part_drag_step_set  (Evas_Object *o, const char *part, double dx, double dy);
+   void         edje_object_part_drag_step_get  (Evas_Object *o, const char *part, double *dx, double *dy);
+   void         edje_object_part_drag_page_set  (Evas_Object *o, const char *part, double dx, double dy);
+   void         edje_object_part_drag_page_get  (Evas_Object *o, const char *part, double *dx, double *dy);
+   void         edje_object_part_drag_step      (Evas_Object *o, const char *part, double dx, double dy);
+   void         edje_object_part_drag_page      (Evas_Object *o, const char *part, double dx, double dy);
        
 #ifdef __cplusplus
 }
index a38ba0ce453f79303f152d4bb4ee99a1fd243ebb..b536247a6d5226ef6ee6eb08384f2d2018ee39e3 100644 (file)
@@ -213,7 +213,7 @@ _edje_recalc(Edje *ed)
 int
 _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, double *x, double *y)
 {
-   if ((ep->part->dragable.x) || (ep->part->dragable.y))
+   if ((ep->part->dragable.x != 0) || (ep->part->dragable.y != 0))
      {
        if (ep->confine_to)
          {
@@ -221,9 +221,10 @@ _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, double *x, double *y)
             int ret;
             
             ret = 0;
-            if ((ep->part->dragable.x) && (ep->part->dragable.y)) ret = 3;
-            else if (ep->part->dragable.x) ret = 1;
-            else if (ep->part->dragable.y) ret = 2;
+            if ((ep->part->dragable.x != 0) && 
+                (ep->part->dragable.y != 0 )) ret = 3;
+            else if (ep->part->dragable.x != 0) ret = 1;
+            else if (ep->part->dragable.y != 0) ret = 2;
             
             dx = ep->x - ep->confine_to->x;
             dw = ep->confine_to->w - ep->w;
@@ -725,7 +726,6 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep)
        dx = 0;
        dy = 0;
        _edje_part_dragable_calc(ed, ep, &dx, &dy);
-       printf("%3.3f %3.3f\n", dx, dy);
         ep->drag.x = dx;
        ep->drag.y = dy;
        ep->drag.tmp.x = 0;
index 9674cb4b0104aa85bf8b61a3e1446320eb1297e8..b1734124f493250bc9b98ee8f779a9464e3f2ce9 100644 (file)
@@ -87,6 +87,7 @@ _edje_edd_setup(void)
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "state", state, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "state2", state2, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "value", value, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "value2", value2, EET_T_DOUBLE);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "tween.mode", tween.mode, EET_T_INT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "tween.time", tween.time, EET_T_DOUBLE);
    EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_program, Edje_Program, "targets", targets, _edje_edd_edje_program_target);
index c64275e878c70357e67e944257847efe83e097b4..903cdbf0b17323deaef7fa584a6797ae6a15be83 100644 (file)
@@ -173,6 +173,9 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
             rp = l->data;
             evas_object_show(rp->object);
             if (_edje_block_break(ed)) break;
+            if (rp->part->dragable.x < 0) rp->drag.val.x = 1.0;
+            if (rp->part->dragable.y < 0) rp->drag.val.x = 1.0;
+            _edje_dragable_pos_set(ed, rp, 1.0, 1.0);
          }
        ed->dirty = 1;
        if ((ed->parts) && (evas_object_visible_get(obj)))
index b56db9450de70630249000998b3a19118b7380d0..790d8bb8454ab766ef904b45695f01a8a19d30f1 100644 (file)
 #include <fnmatch.h>
 
 /* FIXME:
- * 
- * recursions, unsafe callbacks outside edje etc. with freeze, ref/unref and blobk/unblock and break_programs needs to be redesigned & fixed
- * all unsafe calls that may result in callbacks must be marked and dealt with
- * 
- * dragable needs to be able to reverse value affect for "other direction" drag
- * dragable relative value needs to be able to be set or ++/-- by actions
- * dragable needs to be able to affect rel/abs values of other parts
- * dragable relative value needs to be able to be applied to other part vals.
  * 
  * more example edje files
  * 
@@ -63,6 +55,9 @@
  * ? add containering (hbox, vbox, table, wrapping multi-line hbox & vbox)
  * ? text entry widget (single line only)
  * ? reduce linked list walking and list_nth calls
+ * 
+ * ? recursions, unsafe callbacks outside edje etc. with freeze, ref/unref and blobk/unblock and break_programs needs to be redesigned & fixed
+ * ? all unsafe calls that may result in callbacks must be marked and dealt with
  */
 
 typedef struct _Edje_File                            Edje_File;
@@ -102,11 +97,14 @@ typedef struct _Edje_Part_Description                Edje_Part_Description;
 #define EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW 7
 #define EDJE_TEXT_EFFECT_LAST                8
 
-#define EDJE_ACTION_TYPE_NONE        0
-#define EDJE_ACTION_TYPE_STATE_SET   1
-#define EDJE_ACTION_TYPE_ACTION_STOP 2
-#define EDJE_ACTION_TYPE_SIGNAL_EMIT 3
-#define EDJE_ACTION_TYPE_LAST        4
+#define EDJE_ACTION_TYPE_NONE          0
+#define EDJE_ACTION_TYPE_STATE_SET     1
+#define EDJE_ACTION_TYPE_ACTION_STOP   2
+#define EDJE_ACTION_TYPE_SIGNAL_EMIT   3
+#define EDJE_ACTION_TYPE_DRAG_VAL_SET  4
+#define EDJE_ACTION_TYPE_DRAG_VAL_STEP 5
+#define EDJE_ACTION_TYPE_DRAG_VAL_PAGE 6
+#define EDJE_ACTION_TYPE_LAST          7
 
 #define EDJE_TWEEN_MODE_NONE       0
 #define EDJE_TWEEN_MODE_LINEAR     1
@@ -171,6 +169,7 @@ struct _Edje_Program /* a conditional program to be run */
    char      *state; /* what state of alternates to apply, NULL = default */
    char      *state2; /* what other state to use - for signal emit action */
    double     value; /* value of state to apply (if multiple names match) */
+   double     value2; /* other value for drag actions */
    
    struct {
       int     mode; /* how to tween - linear, sinusoidal etc. */
@@ -429,7 +428,7 @@ struct _Edje_Real_Part
       char need_reset : 1;
       struct {
         double x, y;
-      } val, size;
+      } val, size, step, page;
    } drag;
    struct {
       char                  *text;
index 7947b95fdc8581f19f166339689aee9c334b06c8..c3fbe04b2b3014b24cd3367be42a33454b18815f 100644 (file)
@@ -496,7 +496,89 @@ _edje_program_run(Edje *ed, Edje_Program *pr, int force)
        _edje_emit(ed, "program,stop", pr->name);
        if (_edje_block_break(ed)) goto break_prog;
      }
-   if (pr->action != EDJE_ACTION_TYPE_STATE_SET)
+   else if (pr->action == EDJE_ACTION_TYPE_DRAG_VAL_SET)
+     {
+       _edje_emit(ed, "program,start", pr->name);
+       if (_edje_block_break(ed)) goto break_prog;
+       for (l = pr->targets; l; l = l->next)
+         {
+            Edje_Real_Part *rp;
+            Edje_Program_Target *pt;
+            
+            pt = l->data;
+            rp = evas_list_nth(ed->parts, pt->id);
+            if ((rp) && (rp->drag.down.count == 0))
+              {
+                 rp->drag.val.x = pr->value;
+                 rp->drag.val.y = pr->value2;
+                 if      (rp->drag.val.x < 0.0) rp->drag.val.x = 0.0;
+                 else if (rp->drag.val.x > 1.0) rp->drag.val.x = 1.0;
+                 if      (rp->drag.val.y < 0.0) rp->drag.val.y = 0.0;
+                 else if (rp->drag.val.y > 1.0) rp->drag.val.y = 1.0;
+                 _edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
+                 _edje_emit(ed, "drag,set", rp->part->name);
+                 if (_edje_block_break(ed)) goto break_prog;
+              }
+         }
+       _edje_emit(ed, "program,stop", pr->name);
+       if (_edje_block_break(ed)) goto break_prog;
+     }
+   else if (pr->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP)
+     {
+       _edje_emit(ed, "program,start", pr->name);
+       if (_edje_block_break(ed)) goto break_prog;
+       for (l = pr->targets; l; l = l->next)
+         {
+            Edje_Real_Part *rp;
+            Edje_Program_Target *pt;
+            
+            pt = l->data;
+            rp = evas_list_nth(ed->parts, pt->id);
+            if ((rp) && (rp->drag.down.count == 0))
+              {
+                 rp->drag.val.x += pr->value * rp->drag.step.x * rp->part->dragable.x;
+                 rp->drag.val.y += pr->value2 * rp->drag.step.y * rp->part->dragable.y;
+                 if      (rp->drag.val.x < 0.0) rp->drag.val.x = 0.0;
+                 else if (rp->drag.val.x > 1.0) rp->drag.val.x = 1.0;
+                 if      (rp->drag.val.y < 0.0) rp->drag.val.y = 0.0;
+                 else if (rp->drag.val.y > 1.0) rp->drag.val.y = 1.0;
+                 _edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
+                 _edje_emit(ed, "drag,step", rp->part->name);
+                 if (_edje_block_break(ed)) goto break_prog;
+              }
+         }
+       _edje_emit(ed, "program,stop", pr->name);
+       if (_edje_block_break(ed)) goto break_prog;
+     }
+   else if (pr->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE)
+     {
+       _edje_emit(ed, "program,start", pr->name);
+       if (_edje_block_break(ed)) goto break_prog;
+       for (l = pr->targets; l; l = l->next)
+         {
+            Edje_Real_Part *rp;
+            Edje_Program_Target *pt;
+            
+            pt = l->data;
+            rp = evas_list_nth(ed->parts, pt->id);
+            if ((rp) && (rp->drag.down.count == 0))
+              {
+                 rp->drag.val.x += pr->value * rp->drag.page.x * rp->part->dragable.x;
+                 rp->drag.val.y += pr->value2 * rp->drag.step.y * rp->part->dragable.y;
+                 if      (rp->drag.val.x < 0.0) rp->drag.val.x = 0.0;
+                 else if (rp->drag.val.x > 1.0) rp->drag.val.x = 1.0;
+                 if      (rp->drag.val.y < 0.0) rp->drag.val.y = 0.0;
+                 else if (rp->drag.val.y > 1.0) rp->drag.val.y = 1.0;
+                 _edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
+                 _edje_emit(ed, "drag,page", rp->part->name);
+                 if (_edje_block_break(ed)) goto break_prog;
+              }
+         }
+       _edje_emit(ed, "program,stop", pr->name);
+       if (_edje_block_break(ed)) goto break_prog;
+     }
+   if (!((pr->action == EDJE_ACTION_TYPE_STATE_SET) &&
+        (pr->tween.time > 0.0) && (!ed->no_anim)))
      {
        if (pr->after >= 0)
          {
index bd64c07ffbd77810da578f7ccb9feef3db9c2b7f..00959f5ef073fbc26472d09975553722fc50bf08 100644 (file)
@@ -606,9 +606,13 @@ edje_object_part_drag_value_set(Evas_Object *obj, const char *part, double dx, d
    else if (dx > 1.0) dx = 1.0;
    if (dy < 0.0) dy = 0.0;
    else if (dy > 1.0) dy = 1.0;
+   if (rp->part->dragable.x < 0) dx = 1.0 - dx;
+   if (rp->part->dragable.y < 0) dy = 1.0 - dy;
+   if ((rp->drag.val.x == dx) && (rp->drag.val.y == dy)) return;
    rp->drag.val.x = dx;
    rp->drag.val.y = dy;
    _edje_dragable_pos_set(ed, rp, dx, dy);
+   _edje_emit(ed, "drag,set", rp->part->name);   
 }
 
 void
@@ -616,6 +620,7 @@ edje_object_part_drag_value_get(Evas_Object *obj, const char *part, double *dx,
 {
    Edje *ed;
    Edje_Real_Part *rp;
+   double ddx, ddy;
 
    ed = _edje_fetch(obj);   
    if ((!ed) || (!part))
@@ -631,8 +636,12 @@ edje_object_part_drag_value_get(Evas_Object *obj, const char *part, double *dx,
        if (dy) *dy = 0;
        return;
      }
-   if (dx) *dx = rp->drag.val.x;
-   if (dy) *dy = rp->drag.val.y;
+   ddx = rp->drag.val.x;
+   ddy = rp->drag.val.y;
+   if (rp->part->dragable.x < 0) ddx = 1.0 - ddx;
+   if (rp->part->dragable.y < 0) ddy = 1.0 - ddy;
+   if (dx) *dx = ddx;
+   if (dy) *dy = ddy;
 }
 
 void
@@ -655,6 +664,7 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do
    else if (dw > 1.0) dw = 1.0;
    if (dh < 0.0) dh = 0.0;
    else if (dh > 1.0) dh = 1.0;
+   if ((rp->drag.size.x == dw) && (rp->drag.size.y == dh)) return;
    rp->drag.size.x = dw;
    rp->drag.size.y = dh;
    ed->dirty = 1;
@@ -685,6 +695,166 @@ edje_object_part_drag_size_get(Evas_Object *obj, const char *part, double *dw, d
    if (dh) *dh = rp->drag.size.y;
 }
 
+void
+edje_object_part_drag_step_set(Evas_Object *obj, const char *part, double dx, double dy)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);   
+   if ((!ed) || (!part))
+     {
+       return;
+     }
+   rp = _edje_real_part_get(ed, (char *)part);
+   if (!rp)
+     {
+       return;
+     }
+   if (rp->drag.down.count > 0) return;
+   if (dx < 0.0) dx = 0.0;
+   else if (dx > 1.0) dx = 1.0;
+   if (dy < 0.0) dy = 0.0;
+   else if (dy > 1.0) dy = 1.0;
+   rp->drag.step.x = dx;
+   rp->drag.step.y = dy;
+}
+
+void
+edje_object_part_drag_step_get(Evas_Object *obj, const char *part, double *dx, double *dy)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);   
+   if ((!ed) || (!part))
+     {
+       if (dx) *dx = 0;
+       if (dy) *dy = 0;
+       return;
+     }
+   rp = _edje_real_part_get(ed, (char *)part);
+   if (!rp)
+     {
+       if (dx) *dx = 0;
+       if (dy) *dy = 0;
+       return;
+     }
+   if (dx) *dx = rp->drag.step.x;
+   if (dy) *dy = rp->drag.step.y;
+}
+
+void
+edje_object_part_drag_page_set(Evas_Object *obj, const char *part, double dx, double dy)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);   
+   if ((!ed) || (!part))
+     {
+       return;
+     }
+   rp = _edje_real_part_get(ed, (char *)part);
+   if (!rp)
+     {
+       return;
+     }
+   if (rp->drag.down.count > 0) return;
+   if (dx < 0.0) dx = 0.0;
+   else if (dx > 1.0) dx = 1.0;
+   if (dy < 0.0) dy = 0.0;
+   else if (dy > 1.0) dy = 1.0;
+   rp->drag.page.x = dx;
+   rp->drag.page.y = dy;
+}
+
+void
+edje_object_part_drag_page_get(Evas_Object *obj, const char *part, double *dx, double *dy)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);   
+   if ((!ed) || (!part))
+     {
+       if (dx) *dx = 0;
+       if (dy) *dy = 0;
+       return;
+     }
+   rp = _edje_real_part_get(ed, (char *)part);
+   if (!rp)
+     {
+       if (dx) *dx = 0;
+       if (dy) *dy = 0;
+       return;
+     }
+   if (dx) *dx = rp->drag.page.x;
+   if (dy) *dy = rp->drag.page.y;
+}
+
+void
+edje_object_part_drag_step(Evas_Object *obj, const char *part, double dx, double dy)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+   double px, py;
+
+   ed = _edje_fetch(obj);   
+   if ((!ed) || (!part))
+     {
+       return;
+     }
+   rp = _edje_real_part_get(ed, (char *)part);
+   if (!rp)
+     {
+       return;
+     }
+   if (rp->drag.down.count > 0) return;
+   px = rp->drag.val.x;
+   py = rp->drag.val.y;
+   rp->drag.val.x += dx * rp->drag.step.x * rp->part->dragable.x;
+   rp->drag.val.y += dy * rp->drag.step.y * rp->part->dragable.y;
+   if      (rp->drag.val.x < 0.0) rp->drag.val.x = 0.0;
+   else if (rp->drag.val.x > 1.0) rp->drag.val.x = 1.0;
+   if      (rp->drag.val.y < 0.0) rp->drag.val.y = 0.0;
+   else if (rp->drag.val.y > 1.0) rp->drag.val.y = 1.0;
+   if ((px == rp->drag.val.x) && (py == rp->drag.val.y)) return;
+   _edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
+   _edje_emit(ed, "drag,step", rp->part->name);   
+}
+
+void
+edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double dy)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+   double px, py;
+
+   ed = _edje_fetch(obj);   
+   if ((!ed) || (!part))
+     {
+       return;
+     }
+   rp = _edje_real_part_get(ed, (char *)part);
+   if (!rp)
+     {
+       return;
+     }
+   if (rp->drag.down.count > 0) return;
+   px = rp->drag.val.x;
+   py = rp->drag.val.y;
+   rp->drag.val.x += dx * rp->drag.page.x * rp->part->dragable.x;
+   rp->drag.val.y += dy * rp->drag.page.y * rp->part->dragable.y;
+   if      (rp->drag.val.x < 0.0) rp->drag.val.x = 0.0;
+   else if (rp->drag.val.x > 1.0) rp->drag.val.x = 1.0;
+   if      (rp->drag.val.y < 0.0) rp->drag.val.y = 0.0;
+   else if (rp->drag.val.y > 1.0) rp->drag.val.y = 1.0;
+   if ((px == rp->drag.val.x) && (py == rp->drag.val.y)) return;
+   _edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
+   _edje_emit(ed, "drag,page", rp->part->name);   
+}
+
 Edje_Real_Part *
 _edje_real_part_get(Edje *ed, char *part)
 {
@@ -809,4 +979,3 @@ _edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *e
    edje_obj = data;
    edje_object_part_unswallow(edje_obj, obj);
 }
-