* @todo finish api documentation
*/
+/* BiDi exposed stuff */
+ /*FIXME: document */
+ typedef enum _Evas_BiDi_Direction {
+ EVAS_BIDI_DIRECTION_NATURAL,
+ EVAS_BIDI_DIRECTION_LTR,
+ EVAS_BIDI_DIRECTION_RTL
+ } Evas_BiDi_Direction;
/**
* Identifier of callbacks to be used with object or canvas.
EAPI char *evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE;
EAPI char *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
- EAPI int evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Textblock_Cursor_Type ctype) EINA_ARG_NONNULL(1);
+ EAPI int evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype) EINA_ARG_NONNULL(1);
EAPI int evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
EAPI int evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
EAPI Eina_Bool evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
EAPI Eina_Bool evas_object_key_grab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
EAPI void evas_object_key_ungrab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers) EINA_ARG_NONNULL(1, 2);
-
+
+
#ifdef __cplusplus
}
#endif
* @param cy the y of the cursor
* @param cw the w of the cursor
* @param ch the h of the cursor
+ * @param dir the direction of the cursor, can be NULL.
+ * @param ctype the type of the cursor.
* @return line number of the char on success, -1 on error.
*/
EAPI int
-evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Textblock_Cursor_Type ctype)
+evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype)
{
+ int ret = -1;
if (ctype == EVAS_TEXTBLOCK_CURSOR_UNDER)
{
- return evas_textblock_cursor_char_geometry_get(cur, cx, cy, cw, ch);
+ ret = evas_textblock_cursor_char_geometry_get(cur, cx, cy, cw, ch);
}
else if (ctype == EVAS_TEXTBLOCK_CURSOR_BEFORE)
{
* of just after the previous char (which in bidi text may not be
* just before the current char). */
Evas_Coord x, y, h, w;
- int ret;
if (cur->pos > 0)
{
if (cw) *cw = 0;
if (ch) *ch = 0;
}
- return ret;
}
- return -1;
+ if (dir && cur && cur->node)
+ {
+#ifdef BIDI_SUPPORT
+ Evas_BiDi_Props props;
+ props.props = cur->node->bidi_props;
+ props.start = 0;
+
+ *dir = (evas_bidi_is_rtl_char(&props, cur->pos)) ?
+ EVAS_BIDI_DIRECTION_RTL : EVAS_BIDI_DIRECTION_LTR;
+#else
+ *dir = EVAS_BIDI_DIRECTION_LTR;
+#endif
+ }
+ return ret;
}