static void st_collections_group_parts_part_source6(void);
static void st_collections_group_parts_part_entry_mode(void);
static void st_collections_group_parts_part_select_mode(void);
+static void st_collections_group_parts_part_cursor_mode(void);
static void st_collections_group_parts_part_multiline(void);
static void st_collections_group_parts_part_dragable_x(void);
static void st_collections_group_parts_part_dragable_y(void);
{"collections.group.parts.part.dragable.events", st_collections_group_parts_part_dragable_events},
{"collections.group.parts.part.entry_mode", st_collections_group_parts_part_entry_mode},
{"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode},
+ {"collections.group.parts.part.cursor_mode", st_collections_group_parts_part_cursor_mode},
{"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline},
{"collections.group.parts.part.image", st_images_image}, /* dup */
{"collections.group.parts.part.set.name", st_images_set_name},
/**
@page edcref
@property
+ cursor_mode
+ @parameters
+ [MODE]
+ @effect
+ Sets the cursor mode for a textblock part to one of:
+ @li UNDER
+ @li BEFORE
+ UNDER cursor mode means the cursor will draw below the character pointed
+ at. That's the default.
+ BEFORE cursor mode means the cursor is drawn as a vertical line before
+ the current character, just like many other GUI toolkits handle it.
+ @endproperty
+*/
+static void
+st_collections_group_parts_part_cursor_mode(void)
+{
+ Edje_Part_Collection *pc;
+ Edje_Part *ep;
+
+ check_arg_count(1);
+
+ pc = eina_list_data_get(eina_list_last(edje_collections));
+ ep = pc->parts[pc->parts_count - 1];
+ ep->cursor_mode = parse_enum(0,
+ "UNDER", EDJE_ENTRY_CURSOR_MODE_UNDER,
+ "BEFORE", EDJE_ENTRY_CURSOR_MODE_BEFORE,
+ NULL);
+}
+
+/**
+ @page edcref
+ @property
multiline
@parameters
[1 or 0]
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "pointer_mode", pointer_mode, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "entry_mode", entry_mode, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "select_mode", select_mode, EET_T_UCHAR);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "cursor_mode", cursor_mode, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "multiline", multiline, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.name", api.name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.description", api.description, EET_T_STRING);
_curs_update_from_curs(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, Entry *en)
{
Evas_Coord cx, cy, cw, ch;
+ Evas_Textblock_Cursor_Type cur_type;
if (c != en->cursor) return;
- evas_textblock_cursor_geometry_get(c, &cx, &cy, &cw, &ch, NULL, EVAS_TEXTBLOCK_CURSOR_UNDER);
+ switch (en->rp->part->cursor_mode)
+ {
+ case EDJE_ENTRY_CURSOR_MODE_BEFORE:
+ cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
+ break;
+ case EDJE_ENTRY_CURSOR_MODE_UNDER:
+ /* no break for a resaon */
+ default:
+ cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
+ }
+ evas_textblock_cursor_geometry_get(c, &cx, &cy, &cw, &ch, NULL, cur_type);
en->cx = cx + (cw / 2);
en->cy = cy + (ch / 2);
}
{
Evas_Coord x, y, w, h, xx, yy, ww, hh;
Entry *en = rp->entry_data;
+ Evas_Textblock_Cursor_Type cur_type;
if (!en) return;
+ switch (rp->part->cursor_mode)
+ {
+ case EDJE_ENTRY_CURSOR_MODE_BEFORE:
+ cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
+ break;
+ case EDJE_ENTRY_CURSOR_MODE_UNDER:
+ /* no break for a resaon */
+ default:
+ cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
+ }
_sel_update(en->cursor, rp->object, en);
_anchors_update(en->cursor, rp->object, en);
x = y = w = h = -1;
xx = yy = ww = hh = -1;
evas_object_geometry_get(rp->object, &x, &y, &w, &h);
- evas_textblock_cursor_geometry_get(en->cursor, &xx, &yy, &ww, &hh, NULL, EVAS_TEXTBLOCK_CURSOR_UNDER);
+ evas_textblock_cursor_geometry_get(en->cursor, &xx, &yy, &ww, &hh, NULL, cur_type);
if (ww < 1) ww = 1;
if (hh < 1) ww = 1;
if (en->cursor_bg)
{
Evas_Coord x, y, w, h, xx, yy, ww, hh;
Entry *en = rp->entry_data;
+ Evas_Textblock_Cursor_Type cur_type;
if (!en) return;
+ switch (rp->part->cursor_mode)
+ {
+ case EDJE_ENTRY_CURSOR_MODE_BEFORE:
+ cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE;
+ break;
+ case EDJE_ENTRY_CURSOR_MODE_UNDER:
+ /* no break for a resaon */
+ default:
+ cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER;
+ }
x = y = w = h = -1;
xx = yy = ww = hh = -1;
evas_object_geometry_get(rp->object, &x, &y, &w, &h);
- evas_textblock_cursor_geometry_get(en->cursor, &xx, &yy, &ww, &hh, NULL, EVAS_TEXTBLOCK_CURSOR_UNDER);
+ evas_textblock_cursor_geometry_get(en->cursor, &xx, &yy, &ww, &hh, NULL, cur_type);
if (ww < 1) ww = 1;
if (hh < 1) ww = 1;
if (cx) *cx = x + xx;