and some more warning--

SVN revision: 47097
This commit is contained in:
Carsten Haitzler 2010-03-10 03:47:33 +00:00
parent df611db335
commit 310810413c
7 changed files with 125 additions and 137 deletions

View File

@ -36,8 +36,9 @@ static void
_del_pre_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
evas_object_event_callback_del_full(wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
_changed_size_hints, obj);
elm_anchorblock_hover_end(obj);
elm_anchorblock_hover_parent_set(obj, NULL);
}
@ -46,7 +47,7 @@ static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover_style) eina_stringshare_del(wd->hover_style);
free(wd);
}
@ -56,7 +57,7 @@ _sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
if (!wd) return;
evas_object_size_hint_min_get(wd->entry, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
@ -72,7 +73,7 @@ static void
_hover_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
wd->hover = NULL;
}
@ -90,11 +91,10 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info)
Evas_Object *hover_parent;
Elm_Entry_Anchorblock_Info ei;
Evas_Coord x, w, y, h, px, py;
if (!wd) return;
wd->pop = elm_icon_add(obj);
evas_object_move(wd->pop, info->x, info->y);
evas_object_resize(wd->pop, info->w, info->h);
wd->hover = elm_hover_add(obj);
if (wd->hover_style)
elm_object_style_set(wd->hover, wd->hover_style);
@ -102,7 +102,6 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info)
if (!hover_parent) hover_parent = obj;
elm_hover_parent_set(wd->hover, hover_parent);
elm_hover_target_set(wd->hover, wd->pop);
ei.name = info->name;
ei.button = info->button;
ei.hover = wd->hover;
@ -134,6 +133,7 @@ static void
_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
wd->hover_parent = NULL;
}
@ -197,6 +197,7 @@ elm_anchorblock_text_set(Evas_Object *obj, const char *text)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
elm_entry_entry_set(wd->entry, text);
if (wd->hover) evas_object_del(wd->hover);
if (wd->pop) evas_object_del(wd->pop);
@ -221,6 +222,7 @@ elm_anchorblock_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover_parent)
evas_object_event_callback_del_full(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del, obj);
wd->hover_parent = parent;
@ -244,6 +246,7 @@ elm_anchorblock_hover_style_set(Evas_Object *obj, const char *style)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover_style) eina_stringshare_del(wd->hover_style);
wd->hover_style = NULL;
if (style) wd->hover_style = eina_stringshare_add(style);
@ -263,6 +266,7 @@ elm_anchorblock_hover_end(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover) evas_object_del(wd->hover);
if (wd->pop) evas_object_del(wd->pop);
wd->hover = NULL;

View File

@ -40,6 +40,7 @@ static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover_style) eina_stringshare_del(wd->hover_style);
free(wd);
}
@ -49,7 +50,7 @@ _sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
if (!wd) return;
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
@ -74,19 +75,16 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info)
Evas_Object *hover_parent;
Elm_Entry_Anchorview_Info ei;
Evas_Coord x, w, y, h, px, py;
if (!wd) return;
wd->pop = elm_icon_add(obj);
evas_object_move(wd->pop, info->x, info->y);
evas_object_resize(wd->pop, info->w, info->h);
wd->hover = elm_hover_add(obj);
if (wd->hover_style)
elm_object_style_set(wd->hover, wd->hover_style);
if (wd->hover_style) elm_object_style_set(wd->hover, wd->hover_style);
hover_parent = wd->hover_parent;
if (!hover_parent) hover_parent = obj;
elm_hover_parent_set(wd->hover, hover_parent);
elm_hover_target_set(wd->hover, wd->pop);
ei.name = info->name;
ei.button = info->button;
ei.hover = wd->hover;
@ -118,6 +116,7 @@ static void
_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
wd->hover_parent = NULL;
}
@ -184,6 +183,7 @@ elm_anchorview_text_set(Evas_Object *obj, const char *text)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
elm_entry_entry_set(wd->entry, text);
if (wd->hover) evas_object_del(wd->hover);
if (wd->pop) evas_object_del(wd->pop);
@ -208,6 +208,7 @@ elm_anchorview_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover_parent)
evas_object_event_callback_del_full(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del, obj);
wd->hover_parent = parent;
@ -231,6 +232,7 @@ elm_anchorview_hover_style_set(Evas_Object *obj, const char *style)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover_style) eina_stringshare_del(wd->hover_style);
wd->hover_style = NULL;
if (style) wd->hover_style = eina_stringshare_add(style);
@ -250,6 +252,7 @@ elm_anchorview_hover_end(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover) evas_object_del(wd->hover);
if (wd->pop) evas_object_del(wd->pop);
wd->hover = NULL;
@ -273,5 +276,6 @@ elm_anchorview_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_boun
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
elm_scroller_bounce_set(wd->scroller, h_bounce, v_bounce);
}

View File

@ -41,6 +41,7 @@ static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->path) eina_stringshare_del(wd->path);
if (wd->selection) eina_stringshare_del(wd->selection);
free(wd);
@ -51,10 +52,9 @@ _sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord minw = -1, minh = -1;
if (!wd) return;
evas_object_size_hint_min_get(wd->vbox, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
// printf("***** SIZING EVAL [min %d %d] *************\n", minw, minh);
}
@ -72,7 +72,6 @@ _itc_icon_get(const void *data, Evas_Object *obj, const char *source)
Evas_Object *ic;
//~ printf("ICON GET for %s (source: %s)\n", (char*)data, source);
if (!strcmp(source, "elm.swallow.icon"))
{
ic = elm_icon_add(obj);
@ -84,7 +83,6 @@ _itc_icon_get(const void *data, Evas_Object *obj, const char *source)
evas_object_show(ic);
return ic;
}
return NULL;
}
@ -106,7 +104,6 @@ _expand_done(void *data, Evas_Object *obj __UNUSED__, void *event_info)
{
Elm_Genlist_Item *it = event_info;
const char *path = elm_genlist_item_data_get(it);
// printf("EXPAND %s\n", path);
_populate(data, path, it);
}
@ -115,8 +112,7 @@ static void
_contract_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Elm_Genlist_Item *it = event_info;
const char *path = elm_genlist_item_data_get(it);
// const char *path = elm_genlist_item_data_get(it);
// printf("CONTRACT %s\n", path);
elm_genlist_item_subitems_clear(it);
}
@ -143,23 +139,23 @@ _sel(void *data, Evas_Object *obj __UNUSED__, void *event_info)
Widget_Data *wd = elm_widget_data_get(fs);
const char *path = elm_genlist_item_data_get(event_info);
const char *p;
if (!wd) return;
if (ecore_file_is_dir(path))
{
// printf("SELECTED DIR: %s\n", path);
if (wd->expand)
{
_do_anchors(fs, path);
if (wd->entry2) elm_entry_entry_set(wd->entry2, "");
}
else
{
// keep a ref to path 'couse it will be destroyed by _populate
p = eina_stringshare_add(path);
_populate(fs, p, NULL);
eina_stringshare_del(p);
}
return;
if (wd->expand)
{
_do_anchors(fs, path);
if (wd->entry2) elm_entry_entry_set(wd->entry2, "");
}
else
{
// keep a ref to path 'couse it will be destroyed by _populate
p = eina_stringshare_add(path);
_populate(fs, p, NULL);
eina_stringshare_del(p);
}
return;
}
else
{
@ -167,7 +163,7 @@ _sel(void *data, Evas_Object *obj __UNUSED__, void *event_info)
if (wd->entry2)
elm_entry_entry_set(wd->entry2, ecore_file_file_get(path));
}
evas_object_smart_callback_call(fs, "selected", (void*)path);
}
@ -176,8 +172,8 @@ _up(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *fs = data;
Widget_Data *wd = elm_widget_data_get(fs);
if (!wd) return;
char *parent = ecore_file_dir_get(wd->path);
_populate(fs, parent, NULL);
free(parent);
}
@ -211,13 +207,11 @@ _anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info)
Widget_Data *wd = elm_widget_data_get(fs);
Elm_Entry_Anchor_Info *info = event_info;
const char *p;
if (!wd) return;
//~ printf("ANCHOR CLICKED %s\n", info->name);
// keep a ref to path 'couse it will be destroyed by _populate
p = eina_stringshare_add(info->name);
_populate(fs, p, NULL);
evas_object_smart_callback_call(data, "selected", (void*)p);
eina_stringshare_del(p);
}
@ -228,9 +222,8 @@ _do_anchors(Evas_Object *obj, const char *path)
Widget_Data *wd = elm_widget_data_get(obj);
char **tok, buf[PATH_MAX*3];
int i, j;
if (!wd) return;
//~ printf("ANCHORIZE...\n");
buf[0] = '\0';
tok = eina_str_split(path, "/", 0);
for (i = 0; tok[i]; i++)
@ -260,7 +253,6 @@ static void
_populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
{
Widget_Data *wd = elm_widget_data_get(obj);
DIR *dir;
struct dirent *dp;
char buf[PATH_MAX];
@ -268,12 +260,9 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
Eina_List *files = NULL, *dirs = NULL, *l;
if ((!wd) || (!ecore_file_is_dir(path))) return;
dir = opendir(path);
if (!dir) return;
evas_object_smart_callback_call(obj, "directory,open", (void*)path);
if (!parent)
{
elm_genlist_clear(wd->list);
@ -282,9 +271,7 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
_do_anchors(obj, path);
}
if (wd->entry2)
elm_entry_entry_set(wd->entry2, "");
if (wd->entry2) elm_entry_entry_set(wd->entry2, "");
while ((dp = readdir(dir)) != NULL)
{
if (dp->d_name[0] == '.') continue; // TODO make this configurable
@ -300,7 +287,6 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
files = eina_list_sort(files, eina_list_count(files), EINA_COMPARE_CB(strcoll));
dirs = eina_list_sort(dirs, eina_list_count(dirs), EINA_COMPARE_CB(strcoll));
EINA_LIST_FOREACH(dirs, l, real)
{
//~ printf("DIR: %s\n", real);
@ -308,7 +294,7 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
eina_stringshare_add(real), /* item data */
parent,
wd->expand ? ELM_GENLIST_ITEM_SUBITEMS :
ELM_GENLIST_ITEM_NONE,
ELM_GENLIST_ITEM_NONE,
NULL, NULL);
free(real);
}
@ -431,8 +417,7 @@ elm_fileselector_add(Evas_Object *parent)
// Is this the right way to show sub-objs ?? or use the show/hide cbs ??
//~ evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, obj);
//~ evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
//~ _changed_size_hints, obj);
//~ _changed_size_hints, obj);
_sizing_eval(obj);
return obj;
}
@ -442,7 +427,7 @@ elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (is_save)
{
if (wd->entry2) return;
@ -465,8 +450,9 @@ elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save)
EAPI Eina_Bool
elm_fileselector_is_save_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return EINA_FALSE;
return wd->entry2 ? EINA_TRUE : EINA_FALSE;
}
@ -475,17 +461,17 @@ elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if(wd->only_folder == only) return ;
if (!wd) return;
if (wd->only_folder == only) return;
wd->only_folder = only;
}
EAPI Eina_Bool
elm_fileselector_only_folder_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return EINA_FALSE;
return wd->only_folder;
}
@ -495,41 +481,41 @@ elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool only)
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Object *box, *bt;
if (!wd) return;
if (only)
{
if (wd->buttons.bx) return;
// buttons box
box = elm_box_add(obj);
wd->buttons.bx = box;
elm_box_horizontal_set(box, 1);
elm_widget_sub_object_add(obj, box);
elm_box_pack_end(wd->vbox, box);
evas_object_show(box);
// buttons box
box = elm_box_add(obj);
wd->buttons.bx = box;
elm_box_horizontal_set(box, 1);
elm_widget_sub_object_add(obj, box);
elm_box_pack_end(wd->vbox, box);
evas_object_show(box);
// cancel btn
bt = elm_button_add(obj);
wd->buttons.cancel = bt;
elm_button_label_set(bt, "Cancel");
elm_widget_sub_object_add(obj, bt);
elm_box_pack_end(box, bt);
evas_object_smart_callback_add(bt, "clicked", _canc, obj);
evas_object_show(bt);
// ok btn
bt = elm_button_add(obj);
wd->buttons.ok = bt;
elm_button_label_set(bt, "OK");
elm_widget_sub_object_add(obj, bt);
elm_box_pack_end(box, bt);
evas_object_smart_callback_add(bt, "clicked", _ok, obj);
evas_object_show(bt);
// cancel btn
bt = elm_button_add(obj);
wd->buttons.cancel = bt;
elm_button_label_set(bt, "Cancel");
elm_widget_sub_object_add(obj, bt);
elm_box_pack_end(box, bt);
evas_object_smart_callback_add(bt, "clicked", _canc, obj);
evas_object_show(bt);
// ok btn
bt = elm_button_add(obj);
wd->buttons.ok = bt;
elm_button_label_set(bt, "OK");
elm_widget_sub_object_add(obj, bt);
elm_box_pack_end(box, bt);
evas_object_smart_callback_add(bt, "clicked", _ok, obj);
evas_object_show(bt);
}
else
{
evas_object_del(wd->buttons.bx);
evas_object_del(wd->buttons.ok);
evas_object_del(wd->buttons.cancel);
evas_object_del(wd->buttons.bx);
evas_object_del(wd->buttons.ok);
evas_object_del(wd->buttons.cancel);
wd->buttons.bx = NULL;
}
}
@ -537,8 +523,9 @@ elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool only)
EAPI Eina_Bool
elm_fileselector_ok_cancel_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return EINA_FALSE;
return wd->buttons.bx ? EINA_TRUE : EINA_FALSE;
}
@ -547,6 +534,7 @@ elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
wd->expand = expand;
}
@ -559,23 +547,24 @@ elm_fileselector_path_set(Evas_Object *obj, const char *path)
EAPI const char *
elm_fileselector_path_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
return wd->path;
}
EAPI const char*
EAPI const char *
elm_fileselector_selected_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
Elm_Genlist_Item *it;
if (!wd) return NULL;
if (wd->entry2)
{
const char *name;
char buf[PATH_MAX];
name = elm_entry_entry_get(wd->entry2);
//TODO remove <br>
snprintf(buf, sizeof(buf), "%s/%s", wd->path, name);
@ -583,9 +572,9 @@ elm_fileselector_selected_get(Evas_Object *obj)
wd->selection = eina_stringshare_add(buf);
return wd->selection;
}
it = elm_genlist_selected_item_get(wd->list);
if (it) return elm_genlist_item_data_get(it);
return wd->path;
}

View File

@ -54,7 +54,7 @@ _del_pre_hook(Evas_Object *obj)
{
Elm_Hoversel_Item *it;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
elm_hoversel_hover_end(obj);
elm_hoversel_hover_parent_set(obj, NULL);
EINA_LIST_FREE(wd->items, it)
@ -71,6 +71,7 @@ static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
free(wd);
}
@ -79,7 +80,6 @@ _theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
char buf[4096];
if (!wd) return;
elm_hoversel_hover_end(obj);
if (wd->horizontal)
@ -93,7 +93,7 @@ static void
_disable_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (elm_widget_disabled_get(obj))
elm_widget_disabled_set(wd->btn, 1);
else
@ -105,7 +105,6 @@ _sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
if (!wd) return;
evas_object_size_hint_min_get(wd->btn, &minw, &minh);
evas_object_size_hint_max_get(wd->btn, &maxw, &maxh);
@ -147,7 +146,6 @@ _activate(Evas_Object *obj)
if (!wd) return;
if (elm_widget_disabled_get(obj)) return;
wd->hover = elm_hover_add(obj);
if (wd->horizontal)
snprintf(buf, sizeof(buf), "hoversel_horizontal/%s", elm_widget_style_get(obj));
@ -160,7 +158,7 @@ _activate(Evas_Object *obj)
bx = elm_box_add(wd->hover);
elm_box_homogenous_set(bx, 1);
elm_box_horizontal_set(bx, wd->horizontal);
if (wd->horizontal)
@ -213,14 +211,13 @@ _activate(Evas_Object *obj)
static void
_button_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
_activate(data);
_activate(data);
}
static void
_parent_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
wd->hover_parent = NULL;
}
@ -282,7 +279,6 @@ elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover_parent)
evas_object_event_callback_del_full(wd->hover_parent, EVAS_CALLBACK_DEL,
@ -309,7 +305,6 @@ elm_hoversel_label_set(Evas_Object *obj, const char *label)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
elm_button_label_set(wd->btn, label);
}
@ -319,6 +314,7 @@ elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
wd->horizontal = !!horizontal;
}
@ -330,12 +326,11 @@ elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
*
* @ingroup Hoversel
*/
EAPI const char*
EAPI const char *
elm_hoversel_label_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if ((!wd) || (!wd->btn)) return NULL;
return elm_button_label_get(wd->btn);
}
@ -356,7 +351,6 @@ elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
elm_button_icon_set(wd->btn, icon);
}
@ -375,9 +369,8 @@ elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon)
EAPI Evas_Object *
elm_hoversel_icon_get(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if ((!wd) || (!wd->btn)) return NULL;
return elm_button_icon_get(wd->btn);
}
@ -396,7 +389,6 @@ elm_hoversel_hover_begin(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->hover) return;
_activate(obj);
@ -416,7 +408,6 @@ elm_hoversel_hover_end(Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (!wd->hover) return;
evas_object_del(wd->hover);
@ -441,10 +432,8 @@ elm_hoversel_clear(Evas_Object *obj)
Eina_List *l, *ll;
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
EINA_LIST_FOREACH_SAFE(wd->items, l, ll, it)
elm_hoversel_item_del(it);
EINA_LIST_FOREACH_SAFE(wd->items, l, ll, it) elm_hoversel_item_del(it);
}
/**
@ -458,11 +447,8 @@ elm_hoversel_clear(Evas_Object *obj)
EAPI const Eina_List *
elm_hoversel_items_get(Evas_Object *obj)
{
Elm_Hoversel_Item *it;
Eina_List *l, *ll;
ELM_CHECK_WIDTYPE(obj, widtype);
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
return wd->items;
}
@ -488,7 +474,7 @@ elm_hoversel_items_get(Evas_Object *obj)
EAPI Elm_Hoversel_Item *
elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data)
{
ELM_CHECK_WIDTYPE(obj, widtype);
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
Elm_Hoversel_Item *it = calloc(1, sizeof(Elm_Hoversel_Item));
@ -516,8 +502,8 @@ elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file
EAPI void
elm_hoversel_item_del(Elm_Hoversel_Item *it)
{
if (!it) return;
Widget_Data *wd = elm_widget_data_get(it->obj);
if (it->del_cb) it->del_cb((void *)it->data, it->obj, it);
if (!wd) return;
elm_hoversel_hover_end(it->obj);
@ -539,6 +525,7 @@ elm_hoversel_item_del(Elm_Hoversel_Item *it)
EAPI void
elm_hoversel_item_del_cb_set(Elm_Hoversel_Item *it, void (*func)(void *data, Evas_Object *obj, void *event_info))
{
if (!it) return;
it->del_cb = func;
}
@ -596,13 +583,10 @@ EAPI void
elm_hoversel_item_icon_set(Elm_Hoversel_Item *it, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type)
{
if (!it) return;
if (it->icon_file) eina_stringshare_del(it->icon_file);
it->icon_file = eina_stringshare_add(icon_file);
if (it->icon_group) eina_stringshare_del(it->icon_group);
it->icon_group = eina_stringshare_add(icon_group);
it->icon_type = icon_type;
}
@ -622,7 +606,6 @@ EAPI void
elm_hoversel_item_icon_get(Elm_Hoversel_Item *it, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type)
{
if (!it) return;
if (icon_file) *icon_file = it->icon_file;
if (icon_group) *icon_group = it->icon_group;
if (icon_type) *icon_type = it->icon_type;

View File

@ -39,6 +39,7 @@ static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->file) eina_stringshare_del(wd->file);
if (wd->delay_write)
{
@ -52,7 +53,7 @@ static void
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
evas_object_size_hint_min_set(obj, -1, -1);
evas_object_size_hint_max_set(obj, -1, -1);
}
@ -61,8 +62,8 @@ static void
_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (elm_widget_focus_get(obj))
elm_widget_focus_steal(wd->entry);
if (!wd) return;
if (elm_widget_focus_get(obj)) elm_widget_focus_steal(wd->entry);
}
static char *
@ -120,7 +121,7 @@ _load(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
char *text;
if (!wd) return;
if (!wd->file)
{
elm_entry_entry_set(wd->entry, "");
@ -128,13 +129,13 @@ _load(Evas_Object *obj)
}
switch (wd->format)
{
case ELM_TEXT_FORMAT_PLAIN_UTF8:
case ELM_TEXT_FORMAT_PLAIN_UTF8:
text = _load_plain(wd->file);
break;
case ELM_TEXT_FORMAT_MARKUP_UTF8:
case ELM_TEXT_FORMAT_MARKUP_UTF8:
text = _load_file(wd->file);
break;
default:
default:
elm_entry_entry_set(wd->entry, "Unknown Text Format");
text = NULL;
}
@ -151,7 +152,7 @@ static void
_save_markup_utf8(const char *file, const char *text)
{
FILE *f;
if ((!text) || (text[0] == 0))
{
ecore_file_unlink(file);
@ -171,7 +172,7 @@ static void
_save_plain_utf8(const char *file, const char *text)
{
char *text2;
text2 = elm_entry_markup_to_utf8(text);
if (text2)
{
@ -184,6 +185,7 @@ static void
_save(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (!wd->file) return;
switch (wd->format)
{
@ -202,6 +204,7 @@ static int
_delay_write(void *data)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return 0;
_save(data);
wd->delay_write = NULL;
return 0;
@ -211,6 +214,7 @@ static void
_entry_changed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return;
if (wd->delay_write)
{
ecore_timer_del(wd->delay_write);
@ -317,6 +321,7 @@ elm_notepad_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->delay_write)
{
ecore_timer_del(wd->delay_write);
@ -347,5 +352,6 @@ elm_notepad_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
elm_scroller_bounce_set(wd->scr, h_bounce, v_bounce);
}

View File

@ -195,6 +195,8 @@ _els_smart_icon_orient_set(Evas_Object *obj, Elm_Image_Orient orient)
case ELM_IMAGE_ROTATE_180_CW:
_els_smart_icon_rotate_180(sd);
return;
default:
return;
}
evas_object_image_size_get(sd->obj, &iw, &ih);

View File

@ -487,7 +487,7 @@ static int
_smart_bounce_x_animator(void *data)
{
Smart_Data *sd;
Evas_Coord x, y, dx, dy/*, ox, oy*/;
Evas_Coord x, y, dx;
double t, p, dt;
sd = data;
@ -519,7 +519,7 @@ static int
_smart_bounce_y_animator(void *data)
{
Smart_Data *sd;
Evas_Coord x, y, dx, dy;
Evas_Coord x, y, dy;
double t, p, dt;
sd = data;
@ -1446,7 +1446,7 @@ _smart_onhold_animator(void *data)
Smart_Data *sd;
double t, td;
double vx, vy;
Evas_Coord x, y, ox, oy, dx, dy;
Evas_Coord x, y, ox, oy;
sd = data;
t = ecore_loop_time_get();