entry_example.c
/*
* gcc -o entry_example entry_example.c `pkg-config --cflags --libs elementary`
*/
#include <Elementary.h>
typedef struct
{
Evas_Object *win;
Evas_Object *edit_buffer;
} App_Data;
typedef struct
{
Evas_Object *inwin;
Evas_Object *naviframe;
Evas_Object *grid;
Evas_Object *settings;
int size;
int vsize;
int width, height;
const char *emo;
App_Data *ad;
} App_Inwin_Data;
static void
_edit_buffer_insert(Evas_Object *e, const char *text)
{
elm_entry_entry_insert(e, text);
elm_object_focus_set(e, EINA_TRUE);
}
static void
_it_sel_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event)
{
App_Inwin_Data *aid = data;
Elm_Object_Item *gg_it = event;
aid->emo = elm_object_item_data_get(gg_it);
elm_naviframe_item_simple_promote(aid->naviframe, aid->settings);
}
static char *
_emo_label_get(void *data, Evas_Object *obj EINA_UNUSED,
const char *part EINA_UNUSED)
{
return strdup(data);
}
static Evas_Object *
_emo_content_get(void *data, Evas_Object *obj, const char *part)
{
Evas_Object *o;
if (strcmp(part, "elm.swallow.icon"))
return NULL;
o = elm_layout_add(obj);
if (!elm_layout_theme_set(o, "entry/emoticon", data, "default"))
{
fprintf(stderr, "Failed to set layout");
return NULL;
}
return o;
}
static void
_emo_del(void *data, Evas_Object *obj EINA_UNUSED)
{
free(data);
}
static Evas_Object *
_page_grid_add(Evas_Object *parent, App_Inwin_Data *aid)
{
Evas_Object *grid;
char *theme, *emo;
Eina_List *emos, *it;
static Elm_Gengrid_Item_Class *it_class;
it_class = elm_gengrid_item_class_new();
it_class->item_style = "default";
it_class->func. text_get = _emo_label_get;
it_class->func. content_get = _emo_content_get;
it_class->func. del = _emo_del;
theme = elm_theme_list_item_path_get("default", NULL);
if (!theme) return NULL;
emos = edje_file_collection_list(theme);
free(theme);
if (!emos) return NULL;
grid = elm_gengrid_add(parent);
elm_gengrid_item_size_set(grid, 64, 80);
evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
EINA_LIST_FOREACH(emos, it, emo)
{
char name[512];
if (strncmp(emo, "elm/entry/emoticon/", 19))
continue;
sscanf(emo, "elm/entry/emoticon/%[^/]/default", name);
elm_gengrid_item_append(grid, it_class, strdup(name), _it_sel_cb, aid);
}
edje_file_collection_list_free(emos);
elm_gengrid_item_class_free(it_class);
return grid;
}
static void
_btn_insert_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
App_Inwin_Data *aid = data;
const char *size[] = {
"size",
"absize",
"relsize"
};
const char *vsize[] = {
"full",
"ascent"
};
char buf[512];
snprintf(buf, sizeof(buf), "<item %s=%dx%d vsize=%s href=emoticon/%s>"
"</item>", size[aid->size], aid->width, aid->height,
vsize[aid->vsize], aid->emo);
_edit_buffer_insert(aid->ad->edit_buffer, buf);
evas_object_del(aid->inwin);
}
static void
_width_changed_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
{
App_Inwin_Data *aid = data;
aid->width = atoi(elm_object_text_get(obj));
}
static void
_height_changed_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
{
App_Inwin_Data *aid = data;
aid->height = atoi(elm_object_text_get(obj));
}
static Evas_Object *
_page_settings_add(Evas_Object *parent, App_Inwin_Data *aid)
{
Evas_Object *box, *sizeopts, *box2, *sizebox, *vsizebox,
*rsize, *rabsize, *rrelsize, *rvfull, *rvascent,
*fwidth, *ewidth, *fheight, *eheight,
*binsert;
char buf[100];
static Elm_Entry_Filter_Accept_Set accept_set = {
.accepted = "0123456789",
.rejected = NULL
};
static Elm_Entry_Filter_Limit_Size limit_size = {
.max_char_count = 5,
.max_byte_count = 0
};
box = elm_box_add(parent);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
sizeopts = elm_frame_add(parent);
elm_object_text_set(sizeopts, "Size");
evas_object_size_hint_weight_set(sizeopts, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(sizeopts, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box, sizeopts);
evas_object_show(sizeopts);
box2 = elm_box_add(parent);
evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_content_set(sizeopts, box2);
evas_object_show(box2);
sizebox = elm_box_add(parent);
elm_box_horizontal_set(sizebox, EINA_TRUE);
evas_object_size_hint_weight_set(sizebox, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(sizebox, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box2, sizebox);
evas_object_show(sizebox);
rsize = elm_radio_add(parent);
elm_object_text_set(rsize, "Scale adjusted (size)");
elm_radio_state_value_set(rsize, 0);
elm_radio_value_pointer_set(rsize, &aid->size);
elm_box_pack_end(sizebox, rsize);
evas_object_show(rsize);
rabsize = elm_radio_add(parent);
elm_object_text_set(rabsize, "Absolute size (absize)");
elm_radio_state_value_set(rabsize, 1);
elm_radio_value_pointer_set(rabsize, &aid->size);
elm_radio_group_add(rabsize, rsize);
elm_box_pack_end(sizebox, rabsize);
evas_object_show(rabsize);
rrelsize = elm_radio_add(parent);
elm_object_text_set(rrelsize, "Relative to line (relsize)");
elm_radio_state_value_set(rrelsize, 2);
elm_radio_value_pointer_set(rrelsize, &aid->size);
elm_radio_group_add(rrelsize, rsize);
elm_box_pack_end(sizebox, rrelsize);
evas_object_show(rrelsize);
vsizebox = elm_box_add(parent);
elm_box_horizontal_set(vsizebox, EINA_TRUE);
evas_object_size_hint_weight_set(vsizebox, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(vsizebox, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box2, vsizebox);
evas_object_show(vsizebox);
rvfull = elm_radio_add(parent);
elm_object_text_set(rvfull, "Full height (vsize=full)");
elm_radio_state_value_set(rvfull, 0);
elm_radio_value_pointer_set(rvfull, &aid->vsize);
elm_box_pack_end(vsizebox, rvfull);
evas_object_show(rvfull);
rvascent = elm_radio_add(parent);
elm_object_text_set(rvascent, "Ascent only (vsize=ascent)");
elm_radio_state_value_set(rvascent, 1);
elm_radio_value_pointer_set(rvascent, &aid->vsize);
elm_radio_group_add(rvascent, rvfull);
elm_box_pack_end(vsizebox, rvascent);
evas_object_show(rvascent);
fwidth = elm_frame_add(parent);
elm_object_text_set(fwidth, "Width");
evas_object_size_hint_weight_set(fwidth, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(fwidth, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box2, fwidth);
evas_object_show(fwidth);
snprintf(buf, sizeof(buf), "%d", aid->width);
ewidth = elm_entry_add(parent);
elm_entry_single_line_set(ewidth, EINA_TRUE);
elm_entry_markup_filter_append(ewidth, elm_entry_filter_accept_set,
&accept_set);
elm_entry_markup_filter_append(ewidth, elm_entry_filter_limit_size,
&limit_size);
elm_object_text_set(ewidth, buf);
evas_object_size_hint_weight_set(ewidth, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(ewidth, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_content_set(fwidth, ewidth);
evas_object_show(ewidth);
evas_object_smart_callback_add(ewidth, "changed", _width_changed_cb, aid);
fheight = elm_frame_add(parent);
elm_object_text_set(fheight, "Height");
evas_object_size_hint_weight_set(fheight, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(fheight, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box2, fheight);
evas_object_show(fheight);
snprintf(buf, sizeof(buf), "%d", aid->height);
eheight = elm_entry_add(parent);
elm_entry_single_line_set(eheight, EINA_TRUE);
elm_entry_markup_filter_append(eheight, elm_entry_filter_accept_set,
&accept_set);
elm_entry_markup_filter_append(eheight, elm_entry_filter_limit_size,
&limit_size);
elm_object_text_set(eheight, buf);
evas_object_size_hint_weight_set(eheight, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(eheight, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_content_set(fheight, eheight);
evas_object_show(eheight);
evas_object_smart_callback_add(eheight, "changed", _height_changed_cb, aid);
binsert = elm_button_add(parent);
elm_object_text_set(binsert, "Insert");
elm_box_pack_end(box, binsert);
evas_object_show(binsert);
evas_object_smart_callback_add(binsert, "clicked", _btn_insert_cb, aid);
return box;
}
static void
_insert_cancel_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event EINA_UNUSED)
{
App_Inwin_Data *aid = data;
evas_object_del(aid->inwin);
}
static void
_inwin_del_cb(void *data, Evas *e EINA_UNUSED,
Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
free(data);
}
static void
_image_insert_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event EINA_UNUSED)
{
App_Data *ad = data;
App_Inwin_Data *aid;
Evas_Object *inwin, *box, *box2, *naviframe, *o;
aid = calloc(1, sizeof(App_Inwin_Data));
if (!aid) return;
aid->ad = ad;
aid->size = 1;
aid->vsize = 1;
aid->width = 64;
aid->height = 64;
inwin = elm_win_inwin_add(ad->win);
evas_object_size_hint_weight_set(inwin, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(inwin, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(inwin);
evas_object_event_callback_add(inwin, EVAS_CALLBACK_DEL, _inwin_del_cb,
aid);
box = elm_box_add(ad->win);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_inwin_content_set(inwin, box);
evas_object_show(box);
naviframe = elm_naviframe_add(ad->win);
evas_object_size_hint_weight_set(naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box, naviframe);
evas_object_show(naviframe);
o = _page_grid_add(ad->win, aid);
elm_naviframe_item_simple_push(naviframe, o);
aid->grid = o;
o = _page_settings_add(ad->win, aid);
elm_naviframe_item_simple_push(naviframe, o);
aid->settings = o;
elm_naviframe_item_simple_promote(naviframe, aid->grid);
box2 = elm_box_add(ad->win);
elm_box_horizontal_set(box2, EINA_TRUE);
evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box, box2);
evas_object_show(box2);
o = elm_button_add(ad->win);
elm_object_text_set(o, "Cancel");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box2, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "clicked", _insert_cancel_cb, aid);
aid->inwin = inwin;
aid->naviframe = naviframe;
}
static void
_format_change_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
{
App_Data *ad = data;
char fmt_open[5], fmt_close[6];
const char *sel;
int cursor;
char *s;
const char *ptr, *what;
Eina_Strbuf *buf = NULL;
sel = elm_object_text_get(obj);
snprintf(fmt_open, sizeof(fmt_open), "<%s>", sel);
snprintf(fmt_close, sizeof(fmt_close), "</%s>", sel);
buf = eina_strbuf_new();
cursor = elm_entry_cursor_pos_get(ad->edit_buffer);
elm_entry_cursor_begin_set(ad->edit_buffer);
elm_entry_cursor_selection_begin(ad->edit_buffer);
elm_entry_cursor_pos_set(ad->edit_buffer, cursor);
elm_entry_cursor_selection_end(ad->edit_buffer);
sel = elm_entry_selection_get(ad->edit_buffer);
if (!sel || !sel[0])
{
eina_strbuf_append(buf, fmt_open);
goto all_done;
}
what = fmt_open;
ptr = sel;
while ((s = strstr(ptr, what)))
{
ptr = s + strlen(what);
if (what == fmt_open) what = fmt_close;
else what = fmt_open;
}
eina_strbuf_append(buf, what);
if (what == fmt_close)
{
elm_entry_cursor_selection_begin(ad->edit_buffer);
elm_entry_cursor_end_set(ad->edit_buffer);
elm_entry_cursor_selection_end(ad->edit_buffer);
sel = elm_entry_selection_get(ad->edit_buffer);
if (sel)
{
Eina_Strbuf *buf2 = eina_strbuf_new();
eina_strbuf_append(buf2, sel);
eina_strbuf_replace_first(buf2, fmt_close, "");
elm_entry_entry_insert(ad->edit_buffer,
eina_strbuf_string_get(buf2));
eina_strbuf_free(buf2);
}
}
elm_entry_select_none(ad->edit_buffer);
elm_entry_cursor_pos_set(ad->edit_buffer, cursor);
all_done:
_edit_buffer_insert(ad->edit_buffer, eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
}
static void
_autosave_change_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
{
App_Data *ad = data;
Eina_Bool state = elm_check_state_get(obj);
elm_entry_autosave_set(ad->edit_buffer, state);
if (state) elm_entry_file_save(ad->edit_buffer);
}
static void
_edit_dblclick_cb(void *data EINA_UNUSED, Evas_Object *obj,
void *event EINA_UNUSED)
{
int current_cursor;
current_cursor = elm_entry_cursor_pos_get(obj);
while (elm_entry_cursor_prev(obj))
{
const char *content;
if (elm_entry_cursor_is_visible_format_get(obj))
break;
content = elm_entry_cursor_content_get(obj);
if (content && (content[0] == ' '))
break;
}
if (current_cursor == elm_entry_cursor_pos_get(obj))
return;
elm_entry_cursor_next(obj);
elm_entry_cursor_selection_begin(obj);
elm_entry_cursor_pos_set(obj, current_cursor);
while (elm_entry_cursor_next(obj))
{
const char *content;
if (elm_entry_cursor_is_visible_format_get(obj))
break;
content = elm_entry_cursor_content_get(obj);
if (content && (content[0] == ' '))
break;
}
elm_entry_cursor_selection_end(obj);
}
static void
_edit_tplclick_cb(void *data EINA_UNUSED, Evas_Object *obj,
void *event EINA_UNUSED)
{
elm_entry_cursor_line_begin_set(obj);
elm_entry_cursor_selection_begin(obj);
elm_entry_cursor_line_end_set(obj);
elm_entry_cursor_selection_end(obj);
}
EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
Evas_Object *win, *box, *tb, *en, *o, *icon;
App_Data app;
memset(&app, 0, sizeof(app));
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("entry-example", "Emacs Lite");
elm_win_autodel_set(win, EINA_TRUE);
box = elm_box_add(win);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, box);
evas_object_show(box);
tb = elm_box_add(win);
elm_box_horizontal_set(tb, EINA_TRUE);
evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_weight_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box, tb);
evas_object_show(tb);
o = elm_check_add(win);
elm_check_state_set(o, EINA_FALSE);
elm_object_text_set(o, "Autosave");
elm_box_pack_end(tb, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed", _autosave_change_cb, &app);
o = elm_button_add(win);
elm_object_text_set(o, "b");
elm_box_pack_end(tb, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "clicked", _format_change_cb, &app);
o = elm_button_add(win);
elm_object_text_set(o, "em");
elm_box_pack_end(tb, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "clicked", _format_change_cb, &app);
o = elm_button_add(win);
elm_box_pack_end(tb, o);
evas_object_show(o);
icon = elm_layout_add(win);
if (!elm_layout_theme_set(
icon, "entry", "emoticon/haha", "default"))
fprintf(stderr, "Failed to set layout");
elm_object_part_content_set(o, "icon", icon);
evas_object_smart_callback_add(o, "clicked", _image_insert_cb, &app);
en = elm_entry_add(win);
elm_entry_autosave_set(en, EINA_FALSE);
elm_entry_file_set(en, "/tmp/da_test.txt", ELM_TEXT_FORMAT_MARKUP_UTF8);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box, en);
evas_object_show(en);
app.win = win;
app.edit_buffer = en;
evas_object_smart_callback_add(en, "clicked,double", _edit_dblclick_cb,
NULL);
evas_object_smart_callback_add(en, "clicked,triple", _edit_tplclick_cb,
NULL);
elm_object_focus_set(app.edit_buffer, EINA_TRUE);
evas_object_resize(win, 300, 780);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
EVAS_HINT_EXPAND
#define EVAS_HINT_EXPAND
Use with evas_object_size_hint_weight_set(), evas_object_size_hint_weight_get(), evas_object_size_hin...
Definition: Evas_Common.h:297
EVAS_CALLBACK_DEL
@ EVAS_CALLBACK_DEL
Object Being Deleted (called before Free)
Definition: Evas_Common.h:439
EVAS_HINT_FILL
#define EVAS_HINT_FILL
Use with evas_object_size_hint_align_set(), evas_object_size_hint_align_get(), evas_object_size_hint_...
Definition: Evas_Common.h:298
edje_file_collection_list_free
void edje_file_collection_list_free(Eina_List *lst)
Frees file collection list.
Definition: edje_load.c:195
edje_file_collection_list
Eina_List * edje_file_collection_list(const char *file)
Gets a list of groups in an edje file.
Definition: edje_load.c:175
EINA_LIST_FOREACH
#define EINA_LIST_FOREACH(list, l, _data)
Definition for the macro to iterate over a list.
Definition: eina_list.h:1415
eina_strbuf_new
EINA_API Eina_Strbuf * eina_strbuf_new(void)
Creates a new string buffer.
eina_strbuf_string_get
EINA_API const char * eina_strbuf_string_get(const Eina_Strbuf *buf)
Retrieves a pointer to the contents of a string buffer.
eina_strbuf_free
EINA_API void eina_strbuf_free(Eina_Strbuf *buf)
Frees a string buffer.
eina_strbuf_append
EINA_API Eina_Bool eina_strbuf_append(Eina_Strbuf *buf, const char *str)
Appends a string to a buffer, reallocating as necessary.
eina_strbuf_replace_first
#define eina_strbuf_replace_first(buf, str, with)
Replaces the first occurrence of a substring with another string.
Definition: eina_strbuf.h:609
EINA_TRUE
#define EINA_TRUE
boolean value TRUE (numerical value 1)
Definition: eina_types.h:539
EINA_FALSE
#define EINA_FALSE
boolean value FALSE (numerical value 0)
Definition: eina_types.h:533
Eina_Bool
unsigned char Eina_Bool
Type to mimic a boolean.
Definition: eina_types.h:527
EINA_UNUSED
#define EINA_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339
elm_box_add
Evas_Object * elm_box_add(Evas_Object *parent)
Add a new box to the parent.
Definition: elm_box.c:363
elm_box_horizontal_set
void elm_box_horizontal_set(Elm_Box *obj, Eina_Bool horizontal)
Set the horizontal orientation.
Definition: elm_box_eo.legacy.c:27
elm_box_pack_end
void elm_box_pack_end(Elm_Box *obj, Efl_Canvas_Object *subobj)
Add an object at the end of the pack list.
Definition: elm_box_eo.legacy.c:57
elm_button_add
Evas_Object * elm_button_add(Evas_Object *parent)
Add a new button to the parent's canvas.
Definition: efl_ui_button.c:459
elm_check_state_get
Eina_Bool elm_check_state_get(const Evas_Object *obj)
Get the state of the check object.
Definition: efl_ui_check.c:381
elm_check_add
Evas_Object * elm_check_add(Evas_Object *parent)
Add a new Check object.
Definition: efl_ui_check.c:516
elm_check_state_set
void elm_check_state_set(Evas_Object *obj, Eina_Bool state)
Set the on/off state of the check object.
Definition: efl_ui_check.c:372
elm_entry_cursor_selection_end
void elm_entry_cursor_selection_end(Elm_Entry *obj)
This ends a selection within the entry as though the user had just released the mouse button while ma...
Definition: elm_entry_eo.legacy.c:513
elm_entry_cursor_pos_set
void elm_entry_cursor_pos_set(Elm_Entry *obj, int pos)
Sets the cursor position in the entry to the given value.
Definition: elm_entry_eo.legacy.c:255
elm_entry_markup_filter_append
void elm_entry_markup_filter_append(Elm_Entry *obj, Elm_Entry_Filter_Cb func, void *data)
Append a markup filter function for text inserted in the entry.
Definition: elm_entry_eo.legacy.c:543
elm_entry_filter_accept_set
void elm_entry_filter_accept_set(void *data, Evas_Object *entry, char **text)
Filter inserted text based on accepted or rejected sets of characters.
Definition: elm_entry.c:4926
elm_entry_cursor_content_get
char * elm_entry_cursor_content_get(const Elm_Entry *obj)
Get the character pointed by the cursor at its current position.
Definition: elm_entry_eo.legacy.c:345
elm_entry_cursor_line_end_set
void elm_entry_cursor_line_end_set(Elm_Entry *obj)
This moves the cursor to the end of the current line.
Definition: elm_entry_eo.legacy.c:273
elm_entry_cursor_end_set
void elm_entry_cursor_end_set(Elm_Entry *obj)
This moves the cursor to the end of the entry.
Definition: elm_entry_eo.legacy.c:315
elm_entry_cursor_is_visible_format_get
Eina_Bool elm_entry_cursor_is_visible_format_get(const Elm_Entry *obj)
Get if the current cursor position holds a visible format node.
Definition: elm_entry_eo.legacy.c:357
elm_entry_cursor_pos_get
int elm_entry_cursor_pos_get(const Elm_Entry *obj)
Get the current position of the cursor in the entry.
Definition: elm_entry_eo.legacy.c:261
elm_entry_file_set
Eina_Bool elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format)
This sets the file (and implicitly loads it) for the text to display and then edit.
Definition: elm_entry.c:5054
elm_entry_cursor_begin_set
void elm_entry_cursor_begin_set(Elm_Entry *obj)
This moves the cursor to the beginning of the entry.
Definition: elm_entry_eo.legacy.c:303
elm_entry_cursor_prev
Eina_Bool elm_entry_cursor_prev(Elm_Entry *obj)
This moves the cursor one place to the left within the entry.
Definition: elm_entry_eo.legacy.c:375
elm_entry_single_line_set
void elm_entry_single_line_set(Elm_Entry *obj, Eina_Bool single_line)
Sets the entry to single line mode.
Definition: elm_entry_eo.legacy.c:123
elm_entry_add
Evas_Object * elm_entry_add(Evas_Object *parent)
This adds an entry to parent object.
Definition: elm_entry.c:4184
elm_entry_file_save
void elm_entry_file_save(Elm_Entry *obj)
This function writes any changes made to the file set with elm_entry_file_set.
Definition: elm_entry_eo.legacy.c:423
elm_entry_selection_get
const char * elm_entry_selection_get(const Elm_Entry *obj)
Get any selected text within the entry.
Definition: elm_entry_eo.legacy.c:351
elm_entry_select_none
void elm_entry_select_none(Elm_Entry *obj)
This drops any existing text selection within the entry.
Definition: elm_entry_eo.legacy.c:495
elm_entry_cursor_selection_begin
void elm_entry_cursor_selection_begin(Elm_Entry *obj)
This begins a selection within the entry as though the user were holding down the mouse button to mak...
Definition: elm_entry_eo.legacy.c:411
elm_entry_cursor_next
Eina_Bool elm_entry_cursor_next(Elm_Entry *obj)
This moves the cursor one place to the right within the entry.
Definition: elm_entry_eo.legacy.c:489
elm_entry_entry_insert
void elm_entry_entry_insert(Elm_Entry *obj, const char *entry)
Inserts the given text into the entry at the current cursor position.
Definition: elm_entry_eo.legacy.c:465
elm_entry_filter_limit_size
void elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text)
Filter inserted text based on user defined character and byte limits.
Definition: elm_entry.c:4866
elm_entry_autosave_set
void elm_entry_autosave_set(Elm_Entry *obj, Eina_Bool auto_save)
This sets the entry object to 'autosave' the loaded text file or not.
Definition: elm_entry_eo.legacy.c:159
elm_entry_cursor_line_begin_set
void elm_entry_cursor_line_begin_set(Elm_Entry *obj)
This moves the cursor to the beginning of the current line.
Definition: elm_entry_eo.legacy.c:309
elm_object_focus_set
void elm_object_focus_set(Evas_Object *obj, Eina_Bool focus)
Set/unset focus to a given Elementary object.
Definition: elm_focus_legacy.c:374
elm_frame_add
Evas_Object * elm_frame_add(Evas_Object *parent)
Add a new frame to the parent.
Definition: efl_ui_frame.c:274
elm_object_part_content_set
void elm_object_part_content_set(Evas_Object *obj, const char *part, Evas_Object *content)
Set the content on part of a given container widget.
Definition: elm_main.c:1562
Elm_Object_Item
Eo Elm_Object_Item
An Elementary Object item handle.
Definition: elm_object_item.h:6
elm_object_item_data_get
void * elm_object_item_data_get(const Elm_Object_Item *it)
Get the data associated with an object item.
Definition: efl_ui_widget.c:3796
ELM_MAIN
#define ELM_MAIN()
macro to be used after the elm_main() function
Definition: elm_general.h:556
elm_policy_set
Eina_Bool elm_policy_set(unsigned int policy, int value)
Set a new policy's value (for a given policy group/identifier).
Definition: elm_main.c:1380
elm_run
void elm_run(void)
Run Elementary's main loop.
Definition: elm_main.c:1357
ELM_TEXT_FORMAT_MARKUP_UTF8
@ ELM_TEXT_FORMAT_MARKUP_UTF8
Markup UTF8 type.
Definition: elm_general.h:328
ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
@ ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
quit when the application's last window is closed
Definition: elm_general.h:248
ELM_POLICY_QUIT
@ ELM_POLICY_QUIT
under which circumstances the application should quit automatically.
Definition: elm_general.h:227
elm_gengrid_item_class_free
void elm_gengrid_item_class_free(Elm_Gengrid_Item_Class *itc)
Remove an item class in a given gengrid widget.
Definition: elm_gengrid.c:5424
elm_gengrid_add
Evas_Object * elm_gengrid_add(Evas_Object *parent)
Add a new gengrid widget to the given parent Elementary (container) object.
Definition: elm_gengrid.c:4254
elm_gengrid_item_class_new
Elm_Gengrid_Item_Class * elm_gengrid_item_class_new(void)
Add a new gengrid item class in a given gengrid widget.
Definition: elm_gengrid.c:5409
elm_gengrid_item_append
Elm_Widget_Item * elm_gengrid_item_append(Elm_Gengrid *obj, const Elm_Gengrid_Item_Class *itc, const void *data, Evas_Smart_Cb func, const void *func_data)
Append a new item in a given gengrid widget.
Definition: elm_gengrid_eo.legacy.c:189
elm_gengrid_item_size_set
void elm_gengrid_item_size_set(Elm_Gengrid *obj, int w, int h)
Set the size for the items of a given gengrid widget.
Definition: elm_gengrid_eo.legacy.c:93
elm_win_inwin_content_set
void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
Set the content of an inwin object.
Definition: elm_inwin.c:93
elm_win_inwin_add
Evas_Object * elm_win_inwin_add(Evas_Object *parent)
Adds an inwin to the current window.
Definition: elm_inwin.c:50
elm_layout_theme_set
Eina_Bool elm_layout_theme_set(Evas_Object *obj, const char *klass, const char *group, const char *style)
Set the edje group from the elementary theme that will be used as layout.
Definition: efl_ui_layout.c:3400
elm_layout_add
Evas_Object * elm_layout_add(Evas_Object *parent)
Add a new layout to the parent.
Definition: efl_ui_layout.c:3067
elm_naviframe_item_simple_promote
void elm_naviframe_item_simple_promote(Elm_Naviframe *obj, Efl_Canvas_Object *content)
Simple version of item_promote.
Definition: elm_naviframe_eo.legacy.c:75
elm_naviframe_add
Evas_Object * elm_naviframe_add(Evas_Object *parent)
Add a new Naviframe object to the parent.
Definition: elc_naviframe.c:1605
elm_radio_group_add
void elm_radio_group_add(Efl_Ui_Radio *obj, Efl_Ui_Radio *group)
Add this radio to a group of other radio objects.
Definition: efl_ui_radio.c:465
elm_radio_add
Evas_Object * elm_radio_add(Evas_Object *parent)
Add a new radio to the parent.
Definition: efl_ui_radio.c:401
elm_radio_state_value_set
void elm_radio_state_value_set(Efl_Ui_Radio *obj, int value)
Set the integer value that this radio object represents.
Definition: efl_ui_radio_eo.legacy.c:3
elm_radio_value_pointer_set
void elm_radio_value_pointer_set(Efl_Ui_Radio *obj, int *valuep)
Set a convenience pointer to an integer, which changes when radio group value changes.
Definition: efl_ui_radio.c:428
elm_theme_list_item_path_get
char * elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path)
Return the full path for a theme element.
Definition: elm_theme.c:810
elm_win_resize_object_add
void elm_win_resize_object_add(Eo *obj, Evas_Object *subobj)
Add subobj as a resize object of window obj.
Definition: efl_ui_win.c:8992
elm_win_autodel_set
void elm_win_autodel_set(Eo *obj, Eina_Bool autodel)
Set the window's autodel state.
Definition: efl_ui_win.c:6189
elm_win_util_standard_add
Evas_Object * elm_win_util_standard_add(const char *name, const char *title)
Adds a window object with standard setup.
Definition: efl_ui_win.c:9576
Evas
Eo Evas
An opaque handle to an Evas canvas.
Definition: Evas_Common.h:163
evas_object_show
EVAS_API void evas_object_show(Evas_Object *eo_obj)
Makes the given Evas object visible.
Definition: evas_object_main.c:1814
evas_object_del
EVAS_API void evas_object_del(Evas_Object *obj)
Marks the given Evas object for deletion (when Evas will free its memory).
Definition: evas_object_main.c:928
evas_object_event_callback_add
EVAS_API void evas_object_event_callback_add(Evas_Object *eo_obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
Add (register) a callback function to a given Evas object event.
Definition: evas_callbacks.c:478
evas_object_size_hint_weight_set
EVAS_API void evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y)
Sets the hints for an object's weight.
Definition: evas_object_main.c:2638
Evas_Object
Efl_Canvas_Object Evas_Object
An Evas Object handle.
Definition: Evas_Common.h:185
evas_object_size_hint_align_set
EVAS_API void evas_object_size_hint_align_set(Evas_Object *obj, double x, double y)
Sets the hints for an object's alignment.
Definition: evas_object_main.c:2650
evas_object_resize
EVAS_API void evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
Changes the size of the given Evas object.
Definition: evas_object_main.c:1236
evas_object_smart_callback_add
EVAS_API void evas_object_smart_callback_add(Evas_Object *eo_obj, const char *event, Evas_Smart_Cb func, const void *data)
Add (register) a callback function to the smart event specified by event on the smart object obj.
Definition: evas_object_smart.c:1040
_Eina_List
Type for a generic double linked list.
Definition: eina_list.h:318
_Eina_Strbuf
String buffer to facilitate string operations.
Definition: eina_strbuf_common.h:15
_Elm_Entry_Filter_Accept_Set
Data for the elm_entry_filter_accept_set() entry filter.
Definition: elm_entry_common.h:228
_Elm_Entry_Filter_Accept_Set::accepted
const char * accepted
Set of characters accepted in the entry.
Definition: elm_entry_common.h:229
_Elm_Entry_Filter_Limit_Size
Data for the elm_entry_filter_limit_size() entry filter.
Definition: elm_entry_common.h:184
_Elm_Entry_Filter_Limit_Size::max_char_count
int max_char_count
The maximum number of characters allowed.
Definition: elm_entry_common.h:185
_Elm_Gen_Item_Class_Functions::del
Elm_Gen_Item_Del_Cb del
Deletion class function for genlist/gengrid item classes.
Definition: elm_gen.h:102
_Elm_Gen_Item_Class_Functions::content_get
Elm_Gen_Item_Content_Get_Cb content_get
Content fetching class function for genlist/gengrid item classes.
Definition: elm_gen.h:100
_Elm_Gen_Item_Class_Functions::text_get
Elm_Gen_Item_Text_Get_Cb text_get
Text fetching class function for genlist/gengrid item classes.
Definition: elm_gen.h:99
_Elm_Gen_Item_Class
Gengrid or Genlist item class definition.
Definition: elm_gen.h:109
_Elm_Gen_Item_Class::func
Elm_Gen_Item_Class_Functions func
Set of callbacks.
Definition: elm_gen.h:126
_Elm_Gen_Item_Class::item_style
const char * item_style
Name of the visual style to use for this item.
Definition: elm_gen.h:118