Evas text: Added API to query text object's text direction.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:45:00 +0000 (10:45 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:45:00 +0000 (10:45 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@56534 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Evas.h
src/lib/canvas/evas_object_text.c

index 13731d2..a763bdb 100644 (file)
@@ -1338,6 +1338,7 @@ typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
    EAPI void              evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
    EAPI void              evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
    EAPI void              evas_object_text_style_pad_get    (const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1);
+   EAPI Evas_BiDi_Direction evas_object_text_direction_get  (const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
 
 /**
  * @defgroup Evas_Object_Textblock Textblock Object Functions
index 04a6825..333b50e 100644 (file)
@@ -739,6 +739,31 @@ evas_object_text_text_get(const Evas_Object *obj)
 }
 
 /**
+ * Retrieves the direction of the text currently being displayed in the
+ * text object.
+ * @param  obj The given evas text object.
+ * @return the direction of the text
+ */
+EAPI Evas_BiDi_Direction
+evas_object_text_direction_get(const Evas_Object *obj)
+{
+   Evas_Object_Text *o;
+
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return EVAS_BIDI_DIRECTION_NATURAL;
+   MAGIC_CHECK_END();
+   o = (Evas_Object_Text *)(obj->object_data);
+   MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+   return EVAS_BIDI_DIRECTION_NATURAL;
+   MAGIC_CHECK_END();
+   if (o->items)
+     {
+        return o->items->text_props.bidi.dir;
+     }
+   return EVAS_BIDI_DIRECTION_NATURAL;
+}
+
+/**
  * To be documented.
  *
  * FIXME: To be fixed.