Hi, I was creating a theme with edje and missed some functions to
resize a dragable part with embryo inside the .edc

Looking at the code of edje I verified that these functions were
already implemented, so all that would be needed to do was to create a
binding for embryo that pointed to these functions.

I made a patch that create these bindings, and called these functions
set_drag_size and get_drag_size. It works fine for me.

[]'s

Rafael Antognolli
Index: data/include/edje.inc
===================================================================
RCS file: /var/cvs/e17/libs/edje/data/include/edje.inc,v
retrieving revision 1.24
diff -u -r1.24 edje.inc
--- data/include/edje.inc       11 Apr 2008 23:36:35 -0000      1.24
+++ data/include/edje.inc       13 May 2008 21:59:26 -0000
@@ -90,6 +90,8 @@
 native       get_drag_dir     (part_id);
 native       get_drag         (part_id, &Float:dx, &Float:dy);
 native       set_drag         (part_id, Float:dx, Float:dy);
+native       get_drag_size    (part_id, &Float:dx, &Float:dy);
+native       set_drag_size    (part_id, Float:dx, Float:dy);
 native       get_drag_step    (part_id, &Float:dx, &Float:dy);
 native       set_drag_step    (part_id, Float:dx, Float:dy);
 native       get_drag_page    (part_id, &Float:dx, &Float:dy);
Index: src/lib/edje_embryo.c
===================================================================
RCS file: /var/cvs/e17/libs/edje/src/lib/edje_embryo.c,v
retrieving revision 1.60
diff -u -r1.60 edje_embryo.c
--- src/lib/edje_embryo.c       11 Apr 2008 23:36:35 -0000      1.60
+++ src/lib/edje_embryo.c       13 May 2008 21:59:26 -0000
@@ -80,6 +80,8 @@
  * Direction:get_drag_dir(part_id)
  * get_drag(part_id, &Float:dx, &Float:&dy)
  * set_drag(part_id, Float:dx, Float:dy)
+ * get_drag_size(part_id, &Float:dx, &Float:&dy)
+ * set_drag_size(part_id, Float:dx, Float:dy)
  * set_text(part_id, str[])
  * get_text(part_id, dst[], maxlen)
  * get_min_size(w, h)
@@ -998,6 +1000,46 @@
    return(0);
 }
 
+/* get_drag_size(part_id, &Float:dx, &Float:dy) */
+static Embryo_Cell
+_edje_embryo_fn_get_drag_size(Embryo_Program *ep, Embryo_Cell *params)
+{
+   Edje *ed;
+   int part_id = 0;
+   Edje_Real_Part *rp;
+   double dx = 0.0, dy = 0.0;
+
+   CHKPARAM(3);
+   ed = embryo_program_data_get(ep);
+   part_id = params[1];
+   if (part_id < 0) return 0;
+   rp = ed->table_parts[part_id % ed->table_parts_size];
+   edje_object_part_drag_size_get(ed->obj, rp->part->name, &dx, &dy);
+   SETFLOAT(dx, params[2]);
+   SETFLOAT(dy, params[3]);
+
+   return 0;
+}
+
+/* set_drag_size(part_id, Float:dx, Float:dy) */
+static Embryo_Cell
+_edje_embryo_fn_set_drag_size(Embryo_Program *ep, Embryo_Cell *params)
+{
+   Edje *ed;
+   int part_id = 0;
+   Edje_Real_Part *rp;
+
+   CHKPARAM(3);
+   ed = embryo_program_data_get(ep);
+   part_id = params[1];
+   if (part_id < 0) return 0;
+   rp = ed->table_parts[part_id % ed->table_parts_size];
+   edje_object_part_drag_size_set(ed->obj, rp->part->name,
+                                  (double)EMBRYO_CELL_TO_FLOAT(params[2]),
+                                  (double)EMBRYO_CELL_TO_FLOAT(params[3]));
+   return(0);
+}
+
 /* set_text(part_id, str[]) */
 static Embryo_Cell
 _edje_embryo_fn_set_text(Embryo_Program *ep, Embryo_Cell *params)
@@ -2216,6 +2258,8 @@
    embryo_program_native_call_add(ep, "get_drag_dir", 
_edje_embryo_fn_get_drag_dir);
    embryo_program_native_call_add(ep, "get_drag", _edje_embryo_fn_get_drag);
    embryo_program_native_call_add(ep, "set_drag", _edje_embryo_fn_set_drag);
+   embryo_program_native_call_add(ep, "get_drag_size", 
_edje_embryo_fn_get_drag_size);
+   embryo_program_native_call_add(ep, "set_drag_size", 
_edje_embryo_fn_set_drag_size);
    embryo_program_native_call_add(ep, "set_text", _edje_embryo_fn_set_text);
    embryo_program_native_call_add(ep, "get_text", _edje_embryo_fn_get_text);
    embryo_program_native_call_add(ep, "get_min_size", 
_edje_embryo_fn_get_min_size);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to