allow you to set and get table pack position/size in cells.
authorCarsten Haitzler <raster@rasterman.com>
Fri, 17 Jun 2011 11:36:08 +0000 (11:36 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Fri, 17 Jun 2011 11:36:08 +0000 (11:36 +0000)
SVN revision: 60448

src/lib/Elementary.h.in
src/lib/elm_table.c

index 70e832a..488bc21 100644 (file)
@@ -1446,7 +1446,9 @@ extern "C" {
    EAPI void         elm_table_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
    EAPI void         elm_table_unpack(Evas_Object *obj, Evas_Object *subobj) EINA_ARG_NONNULL(1);
    EAPI void         elm_table_clear(Evas_Object *obj, Eina_Bool clear) EINA_ARG_NONNULL(1);
-
+   EAPI void         elm_table_pack_set(Evas_Object *subobj, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
+   EAPI void         elm_table_pack_get(Evas_Object *subobj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1);
+         
    /* gengrid */
    typedef struct _Elm_Gengrid_Item_Class Elm_Gengrid_Item_Class;
    typedef struct _Elm_Gengrid_Item_Class_Func Elm_Gengrid_Item_Class_Func;
index b22e00a..884de9b 100644 (file)
@@ -290,6 +290,53 @@ elm_table_unpack(Evas_Object *obj, Evas_Object *subobj)
 }
 
 /**
+ * Set the packing location of an existing child of the table
+ *
+ * @param subobj The subobject to be modified in the table
+ * @param x Coordinate to X axis
+ * @param y Coordinate to Y axis
+ * @param w Horizontal length
+ * @param h Vertical length
+ *
+ * @ingroup Table
+ */
+EAPI void
+elm_table_pack_set(Evas_Object *subobj, int x, int y, int w, int h)
+{
+   Evas_Object *obj = elm_widget_parent_widget_get(subobj);
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   evas_object_table_pack(wd->tbl, subobj, x, y, w, h);
+}
+
+/**
+ * Set the packing location of an existing child of the table
+ *
+ * @param subobj The subobject to be modified in the table
+ * @param x Coordinate to X axis
+ * @param y Coordinate to Y axis
+ * @param w Horizontal length
+ * @param h Vertical length
+ *
+ * @ingroup Table
+ */
+EAPI void
+elm_table_pack_get(Evas_Object *subobj, int *x, int *y, int *w, int *h)
+{
+   Evas_Object *obj = elm_widget_parent_widget_get(subobj);
+   unsigned short ix, iy, iw, ih;
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   evas_object_table_pack_get(wd->tbl, subobj, &ix, &iy, &iw, &ih);
+   if (x) *x = ix;
+   if (y) *y = iy;
+   if (w) *w = iw;
+   if (h) *h = ih;
+}
+
+/**
  * Faster way to remove all child objects from a table object.
  *
  * @param obj The table object