forked from enlightenment/efl
Elm: use evas_object_event_callback_del_full() everywhere and improve elm_notify
SVN revision: 43217
This commit is contained in:
parent
210a6bec9d
commit
7be1d94aa2
|
@ -3950,6 +3950,7 @@ collections {
|
|||
part { name: "elm.swallow.content";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
align: 0.0 0.0;
|
||||
rel1 {
|
||||
to_y: "elm.text";
|
||||
relative: 0.0 1.0;
|
||||
|
@ -5385,6 +5386,80 @@ collections {
|
|||
}
|
||||
}
|
||||
|
||||
group { name: "elm/entry/base-charwrap/default";
|
||||
styles
|
||||
{
|
||||
style { name: "entry_textblock_style_charwrap";
|
||||
base: "font=Sans font_size=10 align=left color=#000 wrap=char";
|
||||
tag: "br" "\n";
|
||||
tag: "tab" "\t";
|
||||
tag: "em" "+ font=Sans:style=Oblique";
|
||||
tag: "b" "+ font=Sans:style=Bold";
|
||||
tag: "link" "+ color=#800 underline=on underline_color=#8008";
|
||||
tag: "hilight" "+ font=Sans:style=Bold";
|
||||
}
|
||||
style { name: "entry_textblock_disabled_style_charwrap";
|
||||
base: "font=Sans font_size=10 align=left color=#00000080 wrap=char";
|
||||
tag: "br" "\n";
|
||||
tag: "tab" "\t";
|
||||
tag: "em" "+ font=Sans:style=Oblique";
|
||||
tag: "b" "+ font=Sans:style=Bold";
|
||||
tag: "link" "+ color=#00000080 underline=on underline_color=#00000080";
|
||||
tag: "hilight" "+ font=Sans:style=Bold";
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "elm.text";
|
||||
type: TEXTBLOCK;
|
||||
mouse_events: 1;
|
||||
scale: 1;
|
||||
entry_mode: EDITABLE;
|
||||
select_mode: EXPLICIT;
|
||||
multiline: 1;
|
||||
source: "elm/entry/selection/default"; // selection under
|
||||
// source2: "X"; // selection over
|
||||
// source3: "X"; // cursor under
|
||||
source4: "elm/entry/cursor/default"; // cursorover
|
||||
source5: "elm/entry/anchor/default"; // anchor under
|
||||
// source6: "X"; // anchor over
|
||||
description { state: "default" 0.0;
|
||||
text {
|
||||
style: "entry_textblock_style_charwrap";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
text {
|
||||
style: "entry_textblock_disabled_style_charwrap";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "focus";
|
||||
signal: "load";
|
||||
source: "";
|
||||
action: FOCUS_SET;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "disable";
|
||||
signal: "elm,state,disabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "enable";
|
||||
signal: "elm,state,enabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
group { name: "elm/entry/base-nowrap/default";
|
||||
parts {
|
||||
part { name: "elm.text";
|
||||
|
@ -5629,6 +5704,53 @@ collections {
|
|||
}
|
||||
}
|
||||
|
||||
group { name: "elm/entry/base-noedit-charwrap/default";
|
||||
parts {
|
||||
part { name: "elm.text";
|
||||
type: TEXTBLOCK;
|
||||
mouse_events: 1;
|
||||
scale: 1;
|
||||
entry_mode: PLAIN;
|
||||
select_mode: EXPLICIT;
|
||||
multiline: 1;
|
||||
source: "elm/entry/selection/default"; // selection under
|
||||
source5: "elm/entry/anchor/default"; // anchor under
|
||||
description { state: "default" 0.0;
|
||||
text {
|
||||
style: "entry_textblock_style_charwrap";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
text {
|
||||
style: "entry_textblock_disabled_style_charwrap";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "focus";
|
||||
signal: "load";
|
||||
source: "";
|
||||
action: FOCUS_SET;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "disable";
|
||||
signal: "elm,state,disabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "enable";
|
||||
signal: "elm,state,enabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "elm/entry/base-nowrap-noedit/default";
|
||||
parts {
|
||||
part { name: "elm.text";
|
||||
|
@ -6903,7 +7025,18 @@ collections {
|
|||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
group { name: "elm/notify/block_events/default";
|
||||
parts {
|
||||
part { name: "block_events";
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
color: 0 0 0 64;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
group { name: "elm/notify/base/default";
|
||||
//this group is a design similar to the inwin group
|
||||
images {
|
||||
|
@ -7867,6 +8000,15 @@ collections {
|
|||
rel2.to: "image_2_whole";
|
||||
}
|
||||
}
|
||||
part { name: "events_catcher";
|
||||
type: RECT;
|
||||
repeat_events: 1;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
visible: 1;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "fade_next";
|
||||
|
|
|
@ -21,7 +21,7 @@ _bt_close(void *data, Evas_Object *obj, void *event_info)
|
|||
void
|
||||
test_notify(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Object *win, *bg, *bx, *bx2, *notify, *bt, *lb;
|
||||
Evas_Object *win, *bg, *bx, *tb, *notify, *bt, *lb;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
win = elm_win_add(NULL, "Notify", ELM_WIN_BASIC);
|
||||
|
@ -33,13 +33,14 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_show(bg);
|
||||
|
||||
bx2 = elm_box_add(win);
|
||||
evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, bx2);
|
||||
evas_object_show(bx2);
|
||||
tb = elm_table_add(win);
|
||||
elm_win_resize_object_add(win, tb);
|
||||
evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_show(tb);
|
||||
|
||||
|
||||
|
||||
notify = elm_notify_add(win);
|
||||
elm_win_resize_object_add(win, notify);
|
||||
evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
|
||||
bx = elm_box_add(win);
|
||||
|
@ -61,11 +62,11 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
bt = elm_button_add(win);
|
||||
elm_button_label_set(bt, "Top");
|
||||
evas_object_smart_callback_add(bt, "clicked", _bt, notify);
|
||||
elm_box_pack_end(bx2, bt);
|
||||
elm_table_pack(tb, bt, 1, 0, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
notify = elm_notify_add(win);
|
||||
elm_win_resize_object_add(win, notify);
|
||||
elm_notify_repeat_events_set(notify, EINA_FALSE);
|
||||
evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
|
||||
elm_notify_timeout_set(notify, 5);
|
||||
|
@ -76,7 +77,8 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
evas_object_show(bx);
|
||||
|
||||
lb = elm_label_add(win);
|
||||
elm_label_label_set(lb, "Bottom position. This notify use a timeout of 5 sec.");
|
||||
elm_label_label_set(lb, "Bottom position. This notify use a timeout of 5 sec.<br>"
|
||||
"<b>The events outside the window are blocked.</b>");
|
||||
elm_box_pack_end(bx, lb);
|
||||
evas_object_show(lb);
|
||||
|
||||
|
@ -89,11 +91,10 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
bt = elm_button_add(win);
|
||||
elm_button_label_set(bt, "Bottom");
|
||||
evas_object_smart_callback_add(bt, "clicked", _bt, notify);
|
||||
elm_box_pack_end(bx2, bt);
|
||||
elm_table_pack(tb, bt, 1, 2, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
notify = elm_notify_add(win);
|
||||
elm_win_resize_object_add(win, notify);
|
||||
evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_LEFT);
|
||||
elm_notify_timeout_set(notify, 10);
|
||||
|
@ -117,11 +118,10 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
bt = elm_button_add(win);
|
||||
elm_button_label_set(bt, "Left");
|
||||
evas_object_smart_callback_add(bt, "clicked", _bt, notify);
|
||||
elm_box_pack_end(bx2, bt);
|
||||
elm_table_pack(tb, bt, 0, 1, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
notify = elm_notify_add(win);
|
||||
elm_win_resize_object_add(win, notify);
|
||||
evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_RIGHT);
|
||||
|
||||
|
@ -144,11 +144,10 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
bt = elm_button_add(win);
|
||||
elm_button_label_set(bt, "Right");
|
||||
evas_object_smart_callback_add(bt, "clicked", _bt, notify);
|
||||
elm_box_pack_end(bx2, bt);
|
||||
elm_table_pack(tb, bt, 2, 1, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
notify = elm_notify_add(win);
|
||||
elm_win_resize_object_add(win, notify);
|
||||
evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_TOP_LEFT);
|
||||
|
||||
|
@ -171,11 +170,10 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
bt = elm_button_add(win);
|
||||
elm_button_label_set(bt, "Top Left");
|
||||
evas_object_smart_callback_add(bt, "clicked", _bt, notify);
|
||||
elm_box_pack_end(bx2, bt);
|
||||
elm_table_pack(tb, bt, 0, 0, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
notify = elm_notify_add(win);
|
||||
elm_win_resize_object_add(win, notify);
|
||||
evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_TOP_RIGHT);
|
||||
|
||||
|
@ -198,11 +196,10 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
bt = elm_button_add(win);
|
||||
elm_button_label_set(bt, "Top Right");
|
||||
evas_object_smart_callback_add(bt, "clicked", _bt, notify);
|
||||
elm_box_pack_end(bx2, bt);
|
||||
elm_table_pack(tb, bt, 2, 0, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
notify = elm_notify_add(win);
|
||||
elm_win_resize_object_add(win, notify);
|
||||
evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM_LEFT);
|
||||
|
||||
|
@ -225,11 +222,10 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
bt = elm_button_add(win);
|
||||
elm_button_label_set(bt, "Bottom Left");
|
||||
evas_object_smart_callback_add(bt, "clicked", _bt, notify);
|
||||
elm_box_pack_end(bx2, bt);
|
||||
elm_table_pack(tb, bt, 0, 2, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
notify = elm_notify_add(win);
|
||||
elm_win_resize_object_add(win, notify);
|
||||
evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM_RIGHT);
|
||||
|
||||
|
@ -252,9 +248,12 @@ test_notify(void *data, Evas_Object *obj, void *event_info)
|
|||
bt = elm_button_add(win);
|
||||
elm_button_label_set(bt, "Bottom Right");
|
||||
evas_object_smart_callback_add(bt, "clicked", _bt, notify);
|
||||
elm_box_pack_end(bx2, bt);
|
||||
elm_table_pack(tb, bt, 2, 2, 1, 1);
|
||||
evas_object_show(bt);
|
||||
|
||||
evas_object_show(win);
|
||||
evas_object_resize(win, 300, 350);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -81,11 +81,9 @@ static Evas_Object *
|
|||
_get(void *data, Evas_Object *obj)
|
||||
{
|
||||
int w, h;
|
||||
Evas_Object *photo = evas_object_image_add(evas_object_evas_get(obj));
|
||||
evas_object_image_file_set(photo, data, NULL);
|
||||
evas_object_image_filled_set(photo, 1);
|
||||
evas_object_image_size_get(photo, &w, &h);
|
||||
evas_object_size_hint_aspect_set(photo, EVAS_ASPECT_CONTROL_BOTH, w, h);
|
||||
Evas_Object *photo = elm_photocam_add(obj);
|
||||
elm_photocam_file_set(photo, data);
|
||||
elm_photocam_zoom_mode_set(photo, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
|
||||
return photo;
|
||||
}
|
||||
|
||||
|
|
|
@ -403,6 +403,7 @@ extern "C" {
|
|||
EAPI Evas_Object *elm_table_add(Evas_Object *parent);
|
||||
EAPI void elm_table_homogenous_set(Evas_Object *obj, Eina_Bool homogenous);
|
||||
EAPI void elm_table_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h);
|
||||
EAPI void elm_table_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertical);
|
||||
/* smart callbacks called:
|
||||
*/
|
||||
|
||||
|
@ -439,6 +440,8 @@ extern "C" {
|
|||
EAPI void elm_notify_orient_set(Evas_Object *obj, Elm_Notify_Orient orient);
|
||||
EAPI void elm_notify_timeout_set(Evas_Object *obj, int timeout);
|
||||
EAPI void elm_notify_timer_init(Evas_Object *obj);
|
||||
EAPI void elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat);
|
||||
EAPI void elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent);
|
||||
/* smart callbacks called:
|
||||
*/
|
||||
typedef enum _Elm_Hover_Axis
|
||||
|
@ -486,6 +489,7 @@ extern "C" {
|
|||
EAPI const char *elm_entry_selection_get(const Evas_Object *obj);
|
||||
EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry);
|
||||
EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap);
|
||||
EAPI void elm_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap);
|
||||
EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable);
|
||||
EAPI void elm_entry_select_none(Evas_Object *obj);
|
||||
EAPI void elm_entry_select_all(Evas_Object *obj);
|
||||
|
@ -648,9 +652,9 @@ extern "C" {
|
|||
EAPI void elm_menu_item_del(Elm_Menu_Item *item);
|
||||
EAPI const Eina_List *elm_menu_item_subitems_get(Elm_Menu_Item *item);
|
||||
/* smart callbacks called:
|
||||
* "clicked" - the user clicked the empty space in the menu to dismiss. event_info is NULL.
|
||||
*/
|
||||
|
||||
|
||||
typedef enum _Elm_List_Mode
|
||||
{
|
||||
ELM_LIST_COMPRESS,
|
||||
|
@ -873,12 +877,17 @@ extern "C" {
|
|||
EAPI Evas_Object *elm_fileselector_add(Evas_Object *parent);
|
||||
EAPI void elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save);
|
||||
EAPI Eina_Bool elm_fileselector_is_save_get(Evas_Object *obj);
|
||||
EAPI void elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only);
|
||||
EAPI Eina_Bool elm_fileselector_folder_only_get(Evas_Object *obj);
|
||||
EAPI void elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool buttons);
|
||||
EAPI Eina_Bool elm_fileselector_buttons_ok_cancel_get(Evas_Object *obj);
|
||||
EAPI void elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand);
|
||||
EAPI void elm_fileselector_path_set(Evas_Object *obj, const char *path);
|
||||
EAPI const char *elm_fileselector_path_get(Evas_Object *obj);
|
||||
EAPI const char *elm_fileselector_selected_get(Evas_Object *obj);
|
||||
/* smart callbacks called:
|
||||
* "selected" - the user click on a file
|
||||
* "directory,open" - the list is populate with a new content. event_info is a directory.
|
||||
* "done" - the user click on the ok or cancel buttons
|
||||
*/
|
||||
|
||||
|
|
|
@ -35,9 +35,8 @@ static void
|
|||
_del_pre_hook(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
evas_object_event_callback_del(wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints);
|
||||
evas_object_event_callback_del_full(wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
elm_anchorblock_hover_end(obj);
|
||||
elm_anchorblock_hover_parent_set(obj, NULL);
|
||||
}
|
||||
|
@ -96,7 +95,7 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info)
|
|||
evas_object_resize(wd->pop, info->w, info->h);
|
||||
|
||||
wd->hover = elm_hover_add(obj);
|
||||
if (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;
|
||||
|
@ -219,7 +218,7 @@ elm_anchorblock_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (wd->hover_parent)
|
||||
evas_object_event_callback_del(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del);
|
||||
evas_object_event_callback_del_full(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del, obj);
|
||||
wd->hover_parent = parent;
|
||||
if (wd->hover_parent)
|
||||
evas_object_event_callback_add(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del, obj);
|
||||
|
|
|
@ -205,7 +205,7 @@ elm_anchorview_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (wd->hover_parent)
|
||||
evas_object_event_callback_del(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del);
|
||||
evas_object_event_callback_del_full(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del, obj);
|
||||
wd->hover_parent = parent;
|
||||
if (wd->hover_parent)
|
||||
evas_object_event_callback_add(wd->hover_parent, EVAS_CALLBACK_DEL, _parent_del, obj);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* TODO
|
||||
* userdefined icon/label cb
|
||||
* show/hide/add buttons ???
|
||||
|
@ -20,7 +20,15 @@ struct _Widget_Data
|
|||
Evas_Object *vbox, *entry, *entry2, *list, *scr2;
|
||||
const char *path;
|
||||
const char *selection;
|
||||
Eina_Bool only_folder;
|
||||
Eina_Bool expand;
|
||||
|
||||
struct
|
||||
{
|
||||
Evas_Object *bx;
|
||||
Evas_Object *ok;
|
||||
Evas_Object *cancel;
|
||||
} buttons;
|
||||
};
|
||||
|
||||
Elm_Genlist_Item_Class itc;
|
||||
|
@ -80,7 +88,7 @@ _itc_icon_get(const void *data, Evas_Object *obj, const char *source)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
static Eina_Bool
|
||||
_itc_state_get(const void *data, Evas_Object *obj, const char *source)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
|
@ -214,7 +222,7 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info)
|
|||
eina_stringshare_del(p);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_do_anchors(Evas_Object *obj, const char *path)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -243,7 +251,7 @@ _do_anchors(Evas_Object *obj, const char *path)
|
|||
}
|
||||
free(tok[0]);
|
||||
free(tok);
|
||||
|
||||
|
||||
//~ printf("ANCHOR: %s\n", buf);
|
||||
elm_entry_entry_set(wd->entry, buf);
|
||||
}
|
||||
|
@ -264,6 +272,8 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
|
|||
dir = opendir(path);
|
||||
if (!dir) return;
|
||||
|
||||
evas_object_smart_callback_call(obj, "directory,open", (void*)path);
|
||||
|
||||
if (!parent)
|
||||
{
|
||||
elm_genlist_clear(wd->list);
|
||||
|
@ -271,7 +281,7 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
|
|||
wd->path = eina_stringshare_add(path);
|
||||
_do_anchors(obj, path);
|
||||
}
|
||||
|
||||
|
||||
if (wd->entry2)
|
||||
elm_entry_entry_set(wd->entry2, "");
|
||||
|
||||
|
@ -283,7 +293,7 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
|
|||
real = ecore_file_realpath(buf); //TODO this will resolv symlinks...I dont like it
|
||||
if (ecore_file_is_dir(real))
|
||||
dirs = eina_list_append(dirs, real);
|
||||
else
|
||||
else if(!wd->only_folder)
|
||||
files = eina_list_append(files, real);
|
||||
}
|
||||
closedir(dir);
|
||||
|
@ -303,7 +313,7 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
|
|||
free(real);
|
||||
}
|
||||
eina_list_free(dirs);
|
||||
|
||||
|
||||
EINA_LIST_FOREACH(files, l, real)
|
||||
{
|
||||
//~ printf("FILE: %s [%p]\n", real, wd->list);
|
||||
|
@ -346,7 +356,7 @@ elm_fileselector_add(Evas_Object *parent)
|
|||
elm_box_pack_end(wd->vbox, box);
|
||||
evas_object_size_hint_align_set(box, 0.0, 0.0);
|
||||
evas_object_show(box);
|
||||
|
||||
|
||||
// up btn
|
||||
ic = elm_icon_add(parent);
|
||||
elm_icon_standard_set(ic, "arrow_up");
|
||||
|
@ -359,7 +369,7 @@ elm_fileselector_add(Evas_Object *parent)
|
|||
elm_box_pack_end(box, bt);
|
||||
evas_object_smart_callback_add(bt, "clicked", _up, obj);
|
||||
evas_object_show(bt);
|
||||
|
||||
|
||||
// home btn
|
||||
ic = elm_icon_add(parent);
|
||||
elm_icon_standard_set(ic, "home");
|
||||
|
@ -398,7 +408,8 @@ elm_fileselector_add(Evas_Object *parent)
|
|||
wd->entry = elm_entry_add(parent);
|
||||
elm_widget_sub_object_add(obj, wd->entry);
|
||||
elm_entry_editable_set(wd->entry, 0);
|
||||
elm_entry_single_line_set(wd->entry, EINA_TRUE);
|
||||
elm_entry_single_line_set(wd->entry, EINA_FALSE);
|
||||
elm_entry_line_char_wrap_set(wd->entry, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, 0.0);
|
||||
elm_box_pack_end(wd->vbox, wd->entry);
|
||||
|
@ -413,30 +424,9 @@ elm_fileselector_add(Evas_Object *parent)
|
|||
evas_object_size_hint_align_set(wd->scr2, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(wd->vbox, wd->scr2);
|
||||
evas_object_show(wd->scr2);
|
||||
|
||||
// buttons box
|
||||
box = elm_box_add(parent);
|
||||
elm_box_horizontal_set(box, 1);
|
||||
elm_widget_sub_object_add(obj, box);
|
||||
elm_box_pack_end(wd->vbox, box);
|
||||
evas_object_show(box);
|
||||
|
||||
elm_fileselector_buttons_ok_cancel_set(obj, 1);
|
||||
|
||||
// cancel btn
|
||||
bt = elm_button_add(parent);
|
||||
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(parent);
|
||||
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);
|
||||
|
||||
// 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,
|
||||
|
@ -477,6 +467,74 @@ elm_fileselector_is_save_get(Evas_Object *obj)
|
|||
return wd->entry2 ? EINA_TRUE : EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
if(wd->only_folder == only) return ;
|
||||
|
||||
wd->only_folder = only;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_fileselector_only_folder_get(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
return wd->only_folder;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool only)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Object *box, *bt;
|
||||
|
||||
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);
|
||||
|
||||
// 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);
|
||||
wd->buttons.bx = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_fileselector_ok_cancel_get(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
return wd->buttons.bx ? EINA_TRUE : EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand)
|
||||
{
|
||||
|
@ -502,7 +560,7 @@ elm_fileselector_selected_get(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Elm_Genlist_Item *it;
|
||||
|
||||
|
||||
if (wd->entry2)
|
||||
{
|
||||
const char *name;
|
||||
|
@ -515,7 +573,7 @@ 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);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* A hoversel is a button that pops up a list of items (automatically
|
||||
* choosing the direction to display) that have a lable and/or an icon to
|
||||
* select from. It is a convenience widget to avoid the need to do all the
|
||||
* piecing together yourself. It is intended for a small numbr of items in
|
||||
* piecing together yourself. It is intended for a small number of items in
|
||||
* the hoversel menu (no more than 8), though is capable of many more.
|
||||
*
|
||||
* Signals that you can add callbacks for are:
|
||||
|
@ -151,7 +151,7 @@ _activate(Evas_Object *obj)
|
|||
bx = elm_box_add(wd->hover);
|
||||
elm_box_homogenous_set(bx, 1);
|
||||
|
||||
snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s",
|
||||
snprintf(buf, sizeof(buf), "hoversel_vertical_entry/%s",
|
||||
elm_widget_style_get(obj));
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
|
@ -177,7 +177,7 @@ _activate(Evas_Object *obj)
|
|||
}
|
||||
|
||||
elm_hover_content_set(wd->hover,
|
||||
elm_hover_best_content_location_get(wd->hover,
|
||||
elm_hover_best_content_location_get(wd->hover,
|
||||
ELM_HOVER_AXIS_VERTICAL),
|
||||
bx);
|
||||
evas_object_show(bx);
|
||||
|
@ -253,11 +253,11 @@ elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
|
|||
|
||||
if (!wd) return;
|
||||
if (wd->hover_parent)
|
||||
evas_object_event_callback_del(wd->hover_parent, EVAS_CALLBACK_DEL,
|
||||
_parent_del);
|
||||
evas_object_event_callback_del_full(wd->hover_parent, EVAS_CALLBACK_DEL,
|
||||
_parent_del, obj);
|
||||
wd->hover_parent = parent;
|
||||
if (wd->hover_parent)
|
||||
evas_object_event_callback_add(wd->hover_parent, EVAS_CALLBACK_DEL,
|
||||
evas_object_event_callback_add(wd->hover_parent, EVAS_CALLBACK_DEL,
|
||||
_parent_del, obj);
|
||||
}
|
||||
|
||||
|
@ -383,7 +383,7 @@ elm_hoversel_hover_end(Evas_Object *obj)
|
|||
*
|
||||
* This will remove all the children items from the hoversel. (should not be
|
||||
* called while the hoversel is active).
|
||||
*
|
||||
*
|
||||
* @param obj The hoversel object
|
||||
*
|
||||
* @ingroup Hoversel
|
||||
|
|
|
@ -67,8 +67,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Object *sub = event_info;
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -67,8 +67,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Object *sub = event_info;
|
||||
|
||||
evas_object_event_callback_del(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints);
|
||||
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
if (sub == wd->content) wd->content = NULL;
|
||||
else if (sub == wd->icon) wd->icon = NULL;
|
||||
_sizing_eval(obj);
|
||||
|
@ -186,7 +186,7 @@ elm_bubble_content_set(Evas_Object *obj, Evas_Object *content)
|
|||
{
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
edje_object_part_swallow(wd->bbl, "elm.swallow.content", content);
|
||||
evas_object_event_callback_add(content,
|
||||
evas_object_event_callback_add(content,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ elm_bubble_content_set(Evas_Object *obj, Evas_Object *content)
|
|||
* @param obj The given evas pointer
|
||||
* @param icon The given icon for the bubble
|
||||
*
|
||||
* This function sets the icon showed on the top left of bubble.
|
||||
* This function sets the icon showed on the top left of bubble.
|
||||
*
|
||||
* @ingroup Bubble
|
||||
*/
|
||||
|
|
|
@ -97,8 +97,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
if (sub == wd->icon)
|
||||
{
|
||||
edje_object_signal_emit(wd->btn, "elm,state,icon,hidden", "elm");
|
||||
evas_object_event_callback_del(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints);
|
||||
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
wd->icon = NULL;
|
||||
edje_object_message_signal_process(wd->btn);
|
||||
_sizing_eval(obj);
|
||||
|
|
|
@ -111,8 +111,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
if (sub == wd->icon)
|
||||
{
|
||||
edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm");
|
||||
evas_object_event_callback_del(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints);
|
||||
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
wd->icon = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -178,11 +178,11 @@ elm_check_add(Evas_Object *parent)
|
|||
|
||||
wd->chk = edje_object_add(e);
|
||||
_elm_theme_set(wd->chk, "check", "base", "default");
|
||||
edje_object_signal_callback_add(wd->chk, "elm,action,check,on", "",
|
||||
edje_object_signal_callback_add(wd->chk, "elm,action,check,on", "",
|
||||
_signal_check_on, obj);
|
||||
edje_object_signal_callback_add(wd->chk, "elm,action,check,off", "",
|
||||
edje_object_signal_callback_add(wd->chk, "elm,action,check,off", "",
|
||||
_signal_check_off, obj);
|
||||
edje_object_signal_callback_add(wd->chk, "elm,action,check,toggle", "",
|
||||
edje_object_signal_callback_add(wd->chk, "elm,action,check,toggle", "",
|
||||
_signal_check_toggle, obj);
|
||||
elm_widget_resize_object_set(obj, wd->chk);
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ struct _Widget_Data
|
|||
Eina_List *items;
|
||||
Eina_Bool changed : 1;
|
||||
Eina_Bool linewrap : 1;
|
||||
Eina_Bool char_linewrap : 1;
|
||||
Eina_Bool single_line : 1;
|
||||
Eina_Bool password : 1;
|
||||
Eina_Bool editable : 1;
|
||||
|
@ -145,7 +146,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
Evas_Coord resw, resh, minminw;
|
||||
|
||||
if (wd->linewrap)
|
||||
if (wd->linewrap || wd->char_linewrap)
|
||||
{
|
||||
evas_object_geometry_get(wd->ent, NULL, NULL, &resw, &resh);
|
||||
if ((resw == wd->lastw) && (!wd->changed)) return;
|
||||
|
@ -223,7 +224,7 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
|
||||
if (wd->linewrap) _sizing_eval(data);
|
||||
if (wd->linewrap || wd->char_linewrap) _sizing_eval(data);
|
||||
if (wd->hoversel) _hoversel_position(data);
|
||||
// Evas_Coord ww, hh;
|
||||
// evas_object_geometry_get(wd->ent, NULL, NULL, &ww, &hh);
|
||||
|
@ -351,25 +352,25 @@ _long_press(void *data)
|
|||
evas_object_smart_callback_add(wd->hoversel, "dismissed", _dismissed, data);
|
||||
if (!wd->selmode)
|
||||
{
|
||||
elm_hoversel_item_add(wd->hoversel, "Select", NULL, ELM_ICON_NONE,
|
||||
elm_hoversel_item_add(wd->hoversel, "Select", NULL, ELM_ICON_NONE,
|
||||
_select, data);
|
||||
if (wd->editable)
|
||||
elm_hoversel_item_add(wd->hoversel, "Paste", NULL, ELM_ICON_NONE,
|
||||
elm_hoversel_item_add(wd->hoversel, "Paste", NULL, ELM_ICON_NONE,
|
||||
_paste, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
elm_hoversel_item_add(wd->hoversel, "Copy", NULL, ELM_ICON_NONE,
|
||||
elm_hoversel_item_add(wd->hoversel, "Copy", NULL, ELM_ICON_NONE,
|
||||
_copy, data);
|
||||
if (wd->editable)
|
||||
elm_hoversel_item_add(wd->hoversel, "Cut", NULL, ELM_ICON_NONE,
|
||||
elm_hoversel_item_add(wd->hoversel, "Cut", NULL, ELM_ICON_NONE,
|
||||
_cut, data);
|
||||
elm_hoversel_item_add(wd->hoversel, "Cancel", NULL, ELM_ICON_NONE,
|
||||
elm_hoversel_item_add(wd->hoversel, "Cancel", NULL, ELM_ICON_NONE,
|
||||
_cancel, data);
|
||||
}
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
elm_hoversel_item_add(wd->hoversel, it->label, it->icon_file,
|
||||
elm_hoversel_item_add(wd->hoversel, it->label, it->icon_file,
|
||||
it->icon_type, _item_clicked, it);
|
||||
}
|
||||
if (wd->hoversel)
|
||||
|
@ -483,6 +484,7 @@ _getbase(Evas_Object *obj)
|
|||
else
|
||||
{
|
||||
if (wd->linewrap) return "base";
|
||||
else if (wd->char_linewrap) return "base-charwrap";
|
||||
else return "base-nowrap";
|
||||
}
|
||||
}
|
||||
|
@ -496,6 +498,7 @@ _getbase(Evas_Object *obj)
|
|||
else
|
||||
{
|
||||
if (wd->linewrap) return "base-noedit";
|
||||
else if (wd->char_linewrap) return "base-noedit-charwrap";
|
||||
else return "base-nowrap-noedit";
|
||||
}
|
||||
}
|
||||
|
@ -664,15 +667,15 @@ _text_to_mkup(const char *text)
|
|||
pos = pos2;
|
||||
pos2 = evas_string_char_next_get((unsigned char *)(text), pos2, &ch);
|
||||
if ((ch <= 0) || (pos2 <= 0)) break;
|
||||
if (ch == '\n')
|
||||
if (ch == '\n')
|
||||
str = _str_append(str, "<br>", &str_len, &str_alloc);
|
||||
else if (ch == '\t')
|
||||
else if (ch == '\t')
|
||||
str = _str_append(str, "<\t>", &str_len, &str_alloc);
|
||||
else if (ch == '<')
|
||||
else if (ch == '<')
|
||||
str = _str_append(str, "<", &str_len, &str_alloc);
|
||||
else if (ch == '>')
|
||||
else if (ch == '>')
|
||||
str = _str_append(str, ">", &str_len, &str_alloc);
|
||||
else if (ch == '&')
|
||||
else if (ch == '&')
|
||||
str = _str_append(str, "&", &str_len, &str_alloc);
|
||||
else
|
||||
{
|
||||
|
@ -720,7 +723,7 @@ _signal_selection_start(void *data, Evas_Object *obj, const char *emission, cons
|
|||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
ecore_x_selection_primary_set(elm_win_xwindow_get(top), txt,
|
||||
ecore_x_selection_primary_set(elm_win_xwindow_get(top), txt,
|
||||
strlen(txt));
|
||||
#endif
|
||||
free(txt);
|
||||
|
@ -746,7 +749,7 @@ _signal_selection_changed(void *data, Evas_Object *obj, const char *emission, co
|
|||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
ecore_x_selection_primary_set(elm_win_xwindow_get(top), txt,
|
||||
ecore_x_selection_primary_set(elm_win_xwindow_get(top), txt,
|
||||
strlen(txt));
|
||||
#endif
|
||||
free(txt);
|
||||
|
@ -777,7 +780,7 @@ _signal_selection_cleared(void *data, Evas_Object *obj, const char *emission, co
|
|||
t = _mkup_to_text(wd->cut_sel);
|
||||
if (t)
|
||||
{
|
||||
ecore_x_selection_primary_set(elm_win_xwindow_get(top),
|
||||
ecore_x_selection_primary_set(elm_win_xwindow_get(top),
|
||||
t, strlen(t));
|
||||
free(t);
|
||||
}
|
||||
|
@ -856,7 +859,7 @@ _signal_cursor_changed(void *data, Evas_Object *obj, const char *emission, const
|
|||
Evas_Coord cx, cy, cw, ch;
|
||||
|
||||
evas_object_smart_callback_call(data, "cursor,changed", NULL);
|
||||
edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
|
||||
edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (!wd->deferred_recalc_job)
|
||||
elm_widget_show_region_set(data, cx, cy, cw, ch);
|
||||
|
@ -903,7 +906,7 @@ _signal_anchor_up(void *data, Evas_Object *obj, const char *emission, const char
|
|||
ei.name = n;
|
||||
ei.button = atoi(buf2);
|
||||
ei.x = ei.y = ei.w = ei.h = 0;
|
||||
geoms =
|
||||
geoms =
|
||||
edje_object_part_text_anchor_geometry_get(wd->ent, "elm.text", ei.name);
|
||||
if (geoms)
|
||||
{
|
||||
|
@ -1025,6 +1028,7 @@ elm_entry_add(Evas_Object *parent)
|
|||
elm_widget_can_focus_set(obj, 1);
|
||||
|
||||
wd->linewrap = EINA_TRUE;
|
||||
wd->char_linewrap= EINA_FALSE;
|
||||
wd->editable = EINA_TRUE;
|
||||
wd->disabled = EINA_FALSE;
|
||||
wd->context_menu = EINA_TRUE;
|
||||
|
@ -1032,41 +1036,41 @@ elm_entry_add(Evas_Object *parent)
|
|||
wd->ent = edje_object_add(e);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOVE, _move, obj);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_RESIZE, _resize, obj);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_mouse_down, obj);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_UP,
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_UP,
|
||||
_mouse_up, obj);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_mouse_move, obj);
|
||||
|
||||
_elm_theme_set(wd->ent, "entry", "base", "default");
|
||||
edje_object_signal_callback_add(wd->ent, "entry,changed", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "entry,changed", "elm.text",
|
||||
_signal_entry_changed, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "selection,start", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "selection,start", "elm.text",
|
||||
_signal_selection_start, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "selection,changed", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "selection,changed", "elm.text",
|
||||
_signal_selection_changed, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "selection,cleared", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "selection,cleared", "elm.text",
|
||||
_signal_selection_cleared, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "entry,paste,request", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "entry,paste,request", "elm.text",
|
||||
_signal_entry_paste_request, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "entry,copy,notify", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "entry,copy,notify", "elm.text",
|
||||
_signal_entry_copy_notify, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "entry,cut,notify", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "entry,cut,notify", "elm.text",
|
||||
_signal_entry_cut_notify, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "cursor,changed", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "cursor,changed", "elm.text",
|
||||
_signal_cursor_changed, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,down,*", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,down,*", "elm.text",
|
||||
_signal_anchor_down, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,up,*", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,up,*", "elm.text",
|
||||
_signal_anchor_up, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,move,*", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,move,*", "elm.text",
|
||||
_signal_anchor_move, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,in,*", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,in,*", "elm.text",
|
||||
_signal_anchor_in, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,out,*", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "anchor,mouse,out,*", "elm.text",
|
||||
_signal_anchor_out, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "entry,key,enter", "elm.text",
|
||||
edje_object_signal_callback_add(wd->ent, "entry,key,enter", "elm.text",
|
||||
_signal_key_enter, obj);
|
||||
edje_object_part_text_set(wd->ent, "elm.text", "<br>");
|
||||
elm_widget_resize_object_set(obj, wd->ent);
|
||||
|
@ -1098,6 +1102,7 @@ elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
|
|||
if (wd->single_line == single_line) return;
|
||||
wd->single_line = single_line;
|
||||
wd->linewrap = EINA_FALSE;
|
||||
wd->char_linewrap = EINA_FALSE;
|
||||
t = eina_stringshare_add(elm_entry_entry_get(obj));
|
||||
_elm_theme_set(wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
|
||||
elm_entry_entry_set(obj, t);
|
||||
|
@ -1115,6 +1120,7 @@ elm_entry_password_set(Evas_Object *obj, Eina_Bool password)
|
|||
wd->password = password;
|
||||
wd->single_line = EINA_TRUE;
|
||||
wd->linewrap = EINA_FALSE;
|
||||
wd->char_linewrap = EINA_FALSE;
|
||||
t = eina_stringshare_add(elm_entry_entry_get(obj));
|
||||
_elm_theme_set(wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
|
||||
elm_entry_entry_set(obj, t);
|
||||
|
@ -1180,6 +1186,25 @@ elm_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
|
|||
|
||||
if (wd->linewrap == wrap) return;
|
||||
wd->linewrap = wrap;
|
||||
if(wd->linewrap)
|
||||
wd->char_linewrap = EINA_FALSE;
|
||||
t = eina_stringshare_add(elm_entry_entry_get(obj));
|
||||
_elm_theme_set(wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
|
||||
elm_entry_entry_set(obj, t);
|
||||
eina_stringshare_del(t);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
const char *t;
|
||||
|
||||
if (wd->char_linewrap == wrap) return;
|
||||
wd->char_linewrap = wrap;
|
||||
if(wd->char_linewrap)
|
||||
wd->linewrap = EINA_FALSE;
|
||||
t = eina_stringshare_add(elm_entry_entry_get(obj));
|
||||
_elm_theme_set(wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
|
||||
elm_entry_entry_set(obj, t);
|
||||
|
@ -1274,7 +1299,7 @@ elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
|
|||
if (!wd) return;
|
||||
if (wd->context_menu == !disabled) return;
|
||||
wd->context_menu = !disabled;
|
||||
|
||||
|
||||
if (wd->context_menu)
|
||||
{
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, obj);
|
||||
|
@ -1282,8 +1307,8 @@ elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
|
|||
}
|
||||
else
|
||||
{
|
||||
evas_object_event_callback_del(wd->ent, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down);
|
||||
evas_object_event_callback_del(wd->ent, EVAS_CALLBACK_MOUSE_UP, _mouse_up);
|
||||
evas_object_event_callback_del_full(wd->ent, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, obj);
|
||||
evas_object_event_callback_del_full(wd->ent, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,10 +40,10 @@ _del_pre_hook(Evas_Object *obj)
|
|||
evas_object_smart_callback_call(obj, "clicked", NULL);
|
||||
elm_hover_target_set(obj, NULL);
|
||||
elm_hover_parent_set(obj, NULL);
|
||||
evas_object_event_callback_del(wd->hov, EVAS_CALLBACK_MOVE, _hov_move);
|
||||
evas_object_event_callback_del(wd->hov, EVAS_CALLBACK_RESIZE, _hov_resize);
|
||||
evas_object_event_callback_del(wd->hov, EVAS_CALLBACK_SHOW, _hov_show);
|
||||
evas_object_event_callback_del(wd->hov, EVAS_CALLBACK_HIDE, _hov_hide);
|
||||
evas_object_event_callback_del_full(wd->hov, EVAS_CALLBACK_MOVE, _hov_move, obj);
|
||||
evas_object_event_callback_del_full(wd->hov, EVAS_CALLBACK_RESIZE, _hov_resize, obj);
|
||||
evas_object_event_callback_del_full(wd->hov, EVAS_CALLBACK_SHOW, _hov_show, obj);
|
||||
evas_object_event_callback_del_full(wd->hov, EVAS_CALLBACK_HIDE, _hov_hide, obj);
|
||||
|
||||
EINA_LIST_FREE(wd->subs, si)
|
||||
{
|
||||
|
@ -299,8 +299,8 @@ elm_hover_target_set(Evas_Object *obj, Evas_Object *target)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
if (wd->target)
|
||||
evas_object_event_callback_del(wd->target, EVAS_CALLBACK_DEL,
|
||||
_target_del);
|
||||
evas_object_event_callback_del_full(wd->target, EVAS_CALLBACK_DEL,
|
||||
_target_del, obj);
|
||||
wd->target = target;
|
||||
if (wd->target)
|
||||
{
|
||||
|
@ -318,16 +318,16 @@ elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
|
|||
|
||||
if (wd->parent)
|
||||
{
|
||||
evas_object_event_callback_del(wd->parent, EVAS_CALLBACK_MOVE,
|
||||
_parent_move);
|
||||
evas_object_event_callback_del(wd->parent, EVAS_CALLBACK_RESIZE,
|
||||
_parent_resize);
|
||||
evas_object_event_callback_del(wd->parent, EVAS_CALLBACK_SHOW,
|
||||
_parent_show);
|
||||
evas_object_event_callback_del(wd->parent, EVAS_CALLBACK_HIDE,
|
||||
_parent_hide);
|
||||
evas_object_event_callback_del(wd->parent, EVAS_CALLBACK_DEL,
|
||||
_parent_del);
|
||||
evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_MOVE,
|
||||
_parent_move, obj);
|
||||
evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_RESIZE,
|
||||
_parent_resize, obj);
|
||||
evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_SHOW,
|
||||
_parent_show, obj);
|
||||
evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_HIDE,
|
||||
_parent_hide, obj);
|
||||
evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_DEL,
|
||||
_parent_del, obj);
|
||||
}
|
||||
wd->parent = parent;
|
||||
if (wd->parent)
|
||||
|
|
|
@ -50,7 +50,7 @@ _theme_hook(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
edje_object_scale_set(wd->lay, elm_widget_scale_get(obj) *
|
||||
edje_object_scale_set(wd->lay, elm_widget_scale_get(obj) *
|
||||
_elm_config->scale);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -85,9 +85,10 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
if (si->obj == sub)
|
||||
{
|
||||
evas_object_event_callback_del(sub,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints);
|
||||
evas_object_event_callback_del_full(sub,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints,
|
||||
obj);
|
||||
wd->subs = eina_list_remove_list(wd->subs, l);
|
||||
eina_stringshare_del(si->swallow);
|
||||
free(si);
|
||||
|
@ -179,7 +180,7 @@ elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conte
|
|||
{
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
edje_object_part_swallow(wd->lay, swallow, content);
|
||||
evas_object_event_callback_add(content,
|
||||
evas_object_event_callback_add(content,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
si = ELM_NEW(Subinfo);
|
||||
|
|
|
@ -107,9 +107,9 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
if (it->icon == sub) it->icon = NULL;
|
||||
if (it->end == sub) it->end = NULL;
|
||||
evas_object_event_callback_del(sub,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints);
|
||||
evas_object_event_callback_del_full(sub,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
_fix_items(obj);
|
||||
_sizing_eval(obj);
|
||||
break;
|
||||
|
@ -518,7 +518,7 @@ elm_list_add(Evas_Object *parent)
|
|||
evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
|
||||
evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
|
||||
evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
|
|
@ -52,13 +52,14 @@ static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *eve
|
|||
static void _submenu_hide(Elm_Menu_Item *item);
|
||||
static void _submenu_open(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _parent_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _menu_hide(void *data, Evas_Object *obj, void *event_info);
|
||||
|
||||
static void
|
||||
_del_pre_hook(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
evas_object_event_callback_del(wd->parent, EVAS_CALLBACK_RESIZE, _parent_resize);
|
||||
evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_RESIZE, _parent_resize, obj);
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,21 +78,16 @@ _del_hook(Evas_Object *obj)
|
|||
EINA_LIST_FREE(l, item)
|
||||
{
|
||||
ll = eina_list_append(ll, item->items);
|
||||
if (item->label)
|
||||
eina_stringshare_del(item->label);
|
||||
if (item->hv)
|
||||
{
|
||||
evas_object_del(item->hv);
|
||||
evas_object_del(item->location);
|
||||
}
|
||||
if (item->label) eina_stringshare_del(item->label);
|
||||
if (item->icon) evas_object_del(item->icon);
|
||||
if (item->hv) evas_object_del(item->hv);
|
||||
if (item->location) evas_object_del(item->location);
|
||||
if (item->o) evas_object_del(item->o);
|
||||
free(item);
|
||||
}
|
||||
}
|
||||
if (wd->hv)
|
||||
{
|
||||
evas_object_del(wd->hv);
|
||||
evas_object_del(wd->location);
|
||||
}
|
||||
if (wd->hv) evas_object_del(wd->hv);
|
||||
if (wd->location) evas_object_del(wd->location);
|
||||
free(wd);
|
||||
}
|
||||
|
||||
|
@ -111,18 +107,18 @@ _theme_hook(Evas_Object *obj)
|
|||
{
|
||||
ll = eina_list_append(ll, item->items);
|
||||
if (item->separator)
|
||||
_elm_theme_set(item->o, "menu", "separator",
|
||||
_elm_theme_set(item->o, "menu", "separator",
|
||||
elm_widget_style_get(obj));
|
||||
else if (item->bx)
|
||||
{
|
||||
_elm_theme_set(item->o, "menu", "item_with_submenu",
|
||||
{
|
||||
_elm_theme_set(item->o, "menu", "item_with_submenu",
|
||||
elm_widget_style_get(obj));
|
||||
elm_menu_item_label_set(item, item->label);
|
||||
elm_menu_item_icon_set(item, item->icon);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_elm_theme_set(item->o, "menu", "item",
|
||||
_elm_theme_set(item->o, "menu", "item",
|
||||
elm_widget_style_get(obj));
|
||||
elm_menu_item_label_set(item, item->label);
|
||||
elm_menu_item_icon_set(item, item->icon);
|
||||
|
@ -132,7 +128,7 @@ _theme_hook(Evas_Object *obj)
|
|||
else
|
||||
edje_object_signal_emit(item->o, "elm,state,enabled", "elm");
|
||||
edje_object_message_signal_process(item->o);
|
||||
edje_object_scale_set(item->o, elm_widget_scale_get(obj) *
|
||||
edje_object_scale_set(item->o, elm_widget_scale_get(obj) *
|
||||
_elm_config->scale);
|
||||
}
|
||||
}
|
||||
|
@ -270,6 +266,13 @@ _item_move_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
_hover_clicked_cb(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
_menu_hide(data, obj, event_info);
|
||||
evas_object_smart_callback_call(data, "clicked", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_menu_hide(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
@ -364,7 +367,7 @@ _show(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
evas_object_show(wd->hv);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_item_obj_create(Elm_Menu_Item *item)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(item->menu);
|
||||
|
@ -372,14 +375,14 @@ _item_obj_create(Elm_Menu_Item *item)
|
|||
evas_object_size_hint_weight_set(item->o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_fill_set(item->o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
_elm_theme_set(item->o, "menu", "item", elm_widget_style_get(item->menu));
|
||||
edje_object_signal_callback_add(item->o, "elm,action,click", "",
|
||||
_menu_item_select, item);
|
||||
edje_object_signal_callback_add(item->o, "elm,action,activate", "",
|
||||
edje_object_signal_callback_add(item->o, "elm,action,click", "",
|
||||
_menu_item_select, item);
|
||||
edje_object_signal_callback_add(item->o, "elm,action,activate", "",
|
||||
_menu_item_activate, item);
|
||||
evas_object_show(item->o);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_item_separator_obj_create(Elm_Menu_Item *item)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(item->menu);
|
||||
|
@ -387,12 +390,12 @@ _item_separator_obj_create(Elm_Menu_Item *item)
|
|||
evas_object_size_hint_weight_set(item->o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_fill_set(item->o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
_elm_theme_set(item->o, "menu", "separator", elm_widget_style_get(item->menu));
|
||||
edje_object_signal_callback_add(item->o, "elm,action,activate", "",
|
||||
edje_object_signal_callback_add(item->o, "elm,action,activate", "",
|
||||
_menu_item_activate, item);
|
||||
evas_object_show(item->o);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_item_submenu_obj_create(Elm_Menu_Item *item)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(item->menu);
|
||||
|
@ -414,7 +417,7 @@ _item_submenu_obj_create(Elm_Menu_Item *item)
|
|||
elm_menu_item_label_set(item, item->label);
|
||||
elm_menu_item_icon_set(item, item->icon);
|
||||
|
||||
edje_object_signal_callback_add(item->o, "elm,action,open", "",
|
||||
edje_object_signal_callback_add(item->o, "elm,action,open", "",
|
||||
_submenu_open, item);
|
||||
evas_object_event_callback_add(item->o, EVAS_CALLBACK_MOVE, _item_move_resize, item);
|
||||
evas_object_event_callback_add(item->o, EVAS_CALLBACK_RESIZE, _item_move_resize, item);
|
||||
|
@ -453,7 +456,7 @@ elm_menu_add(Evas_Object *parent)
|
|||
elm_hover_parent_set(wd->hv, parent);
|
||||
elm_hover_target_set(wd->hv, wd->location);
|
||||
elm_object_style_set(wd->hv, "menu");
|
||||
evas_object_smart_callback_add(wd->hv, "clicked", _menu_hide, obj);
|
||||
evas_object_smart_callback_add(wd->hv, "clicked", _hover_clicked_cb, obj);
|
||||
|
||||
wd->bx = elm_box_add(obj);
|
||||
evas_object_event_callback_add(wd->bx, EVAS_CALLBACK_RESIZE, _menu_resize, obj);
|
||||
|
@ -475,7 +478,7 @@ elm_menu_add(Evas_Object *parent)
|
|||
* @param obj The menu object.
|
||||
* @param parent The new parent.
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent)
|
||||
{
|
||||
Eina_List *l, *_l, *ll = NULL;
|
||||
|
@ -505,12 +508,12 @@ elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent)
|
|||
|
||||
/*
|
||||
* Move the menu to a new position
|
||||
*
|
||||
*
|
||||
* @param obj The menu object.
|
||||
* @param x The new position.
|
||||
* @param y The new position.
|
||||
*/
|
||||
EAPI void
|
||||
EAPI void
|
||||
elm_menu_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -553,7 +556,7 @@ elm_menu_item_add(Evas_Object *obj, Elm_Menu_Item *parent, Evas_Object *icon, co
|
|||
if (parent)
|
||||
{
|
||||
if (!parent->bx)
|
||||
_item_submenu_obj_create(parent);
|
||||
_item_submenu_obj_create(parent);
|
||||
elm_box_pack_end(parent->bx, subitem->o);
|
||||
parent->items = eina_list_append(parent->items, subitem);
|
||||
}
|
||||
|
@ -588,7 +591,7 @@ elm_menu_item_label_set(Elm_Menu_Item *item, const char *label)
|
|||
_sizing_eval(item->menu);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
EAPI const char *
|
||||
elm_menu_item_label_get(Elm_Menu_Item *item)
|
||||
{
|
||||
if (!item) return ;
|
||||
|
@ -653,7 +656,7 @@ elm_menu_item_separator_add(Evas_Object *obj, Elm_Menu_Item *parent)
|
|||
else
|
||||
{
|
||||
if (!parent->bx)
|
||||
_item_submenu_obj_create(parent);
|
||||
_item_submenu_obj_create(parent);
|
||||
elm_box_pack_end(parent->bx, subitem->o);
|
||||
parent->items = eina_list_append(parent->items, subitem);
|
||||
}
|
||||
|
|
|
@ -16,9 +16,11 @@ typedef struct _Widget_Data Widget_Data;
|
|||
|
||||
struct _Widget_Data
|
||||
{
|
||||
Evas_Object *notify, *content;
|
||||
Evas_Object *notify, *content, *parent;
|
||||
|
||||
Elm_Notify_Orient orient;
|
||||
Eina_Bool repeat_events;
|
||||
Evas_Object *block_events;
|
||||
|
||||
int timeout;
|
||||
Ecore_Timer *timer;
|
||||
|
@ -40,10 +42,10 @@ _del_pre_hook(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
evas_object_event_callback_del(obj, EVAS_CALLBACK_RESIZE, _resize);
|
||||
evas_object_event_callback_del(obj, EVAS_CALLBACK_MOVE, _resize);
|
||||
evas_object_event_callback_del(obj, EVAS_CALLBACK_SHOW, _show);
|
||||
evas_object_event_callback_del(obj, EVAS_CALLBACK_HIDE, _hide);
|
||||
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
|
||||
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_MOVE, _resize, obj);
|
||||
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_SHOW, _show, obj);
|
||||
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_HIDE, _hide, obj);
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,6 +54,14 @@ _del_hook(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
elm_notify_content_set(obj, NULL);
|
||||
elm_notify_parent_set(obj, NULL);
|
||||
elm_notify_repeat_events_set(obj, EINA_TRUE);
|
||||
if (wd->timer)
|
||||
{
|
||||
ecore_timer_del(wd->timer);
|
||||
wd->timer = NULL;
|
||||
}
|
||||
free(wd);
|
||||
}
|
||||
|
||||
|
@ -62,7 +72,9 @@ _theme_hook(Evas_Object *obj)
|
|||
|
||||
if (!wd) return;
|
||||
_elm_theme_set(wd->notify, "notify", "base", "default");
|
||||
edje_object_scale_set(wd->notify, elm_widget_scale_get(obj) *
|
||||
if(wd->block_events)
|
||||
_elm_theme_set(wd->block_events, "notify", "block_events", "default");
|
||||
edje_object_scale_set(wd->notify, elm_widget_scale_get(obj) *
|
||||
_elm_config->scale);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -70,11 +82,13 @@ _theme_hook(Evas_Object *obj)
|
|||
static void
|
||||
_sizing_eval(Evas_Object *obj)
|
||||
{
|
||||
//Widget_Data *wd = elm_widget_data_get(obj);
|
||||
//Evas_Coord minw = -1, minh = -1;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord x,y,w,h;
|
||||
if(!wd->parent) return ;
|
||||
|
||||
//edje_object_size_min_calc(wd->notify, &minw, &minh);
|
||||
//evas_object_size_hint_min_set(obj, minw, minh);
|
||||
evas_object_geometry_get(wd->parent, &x, &y, &w, &h);
|
||||
evas_object_resize(obj, w, h);
|
||||
evas_object_move(obj, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -90,15 +104,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
evas_object_event_callback_del(wd->content,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints);
|
||||
evas_object_del(wd->content);
|
||||
if (wd->timer)
|
||||
{
|
||||
ecore_timer_del(wd->timer);
|
||||
wd->timer = NULL;
|
||||
}
|
||||
if(event_info == wd->content)
|
||||
wd->content = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -113,7 +120,7 @@ _content_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
_calc(data);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_calc(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -122,6 +129,7 @@ _calc(Evas_Object *obj)
|
|||
|
||||
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
||||
edje_object_size_min_calc(wd->notify, &minw, &minh);
|
||||
|
||||
if (wd->content)
|
||||
{
|
||||
int offx = (w - minw) / 2;
|
||||
|
@ -176,6 +184,9 @@ _show(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
evas_object_show(wd->notify);
|
||||
|
||||
if(!wd->repeat_events)
|
||||
evas_object_show(wd->block_events);
|
||||
if (wd->timer)
|
||||
{
|
||||
ecore_timer_del(wd->timer);
|
||||
|
@ -191,7 +202,8 @@ _hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
evas_object_hide(wd->notify);
|
||||
|
||||
if(!wd->repeat_events)
|
||||
evas_object_hide(wd->block_events);
|
||||
if (wd->timer)
|
||||
{
|
||||
ecore_timer_del(wd->timer);
|
||||
|
@ -199,6 +211,24 @@ _hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
wd->parent = NULL;
|
||||
evas_object_hide(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_parent_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
wd->parent = NULL;
|
||||
evas_object_hide(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new notify to the parent
|
||||
*
|
||||
|
@ -224,6 +254,8 @@ elm_notify_add(Evas_Object *parent)
|
|||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
wd->repeat_events = EINA_TRUE;
|
||||
|
||||
wd->notify = edje_object_add(e);
|
||||
elm_notify_orient_set(obj, ELM_NOTIFY_ORIENT_TOP);
|
||||
|
||||
|
@ -233,6 +265,8 @@ elm_notify_add(Evas_Object *parent)
|
|||
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, obj);
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, obj);
|
||||
|
||||
elm_notify_parent_set(obj, parent);
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -250,20 +284,86 @@ elm_notify_content_set(Evas_Object *obj, Evas_Object *content)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
if (wd->content)
|
||||
elm_widget_sub_object_del(obj, wd->content);
|
||||
if(wd->content)
|
||||
{
|
||||
evas_object_event_callback_del_full(wd->content,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
evas_object_event_callback_del_full(wd->content,
|
||||
EVAS_CALLBACK_RESIZE,
|
||||
_content_resize, obj);
|
||||
evas_object_del(wd->content);
|
||||
wd->content = NULL;
|
||||
}
|
||||
|
||||
if (content)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
edje_object_part_swallow(wd->notify, "elm.swallow.content", content);
|
||||
evas_object_event_callback_add(content,
|
||||
evas_object_event_callback_add(content,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
evas_object_event_callback_add(content,
|
||||
evas_object_event_callback_add(content,
|
||||
EVAS_CALLBACK_RESIZE,
|
||||
_content_resize, obj);
|
||||
wd->content = content;
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
_calc(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the notify parent
|
||||
*
|
||||
* @param obj The notify object
|
||||
* @param content The new parent
|
||||
*
|
||||
* @ingroup Notify
|
||||
*/
|
||||
EAPI void
|
||||
elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
if(wd->parent)
|
||||
{
|
||||
evas_object_event_callback_del_full(wd->parent,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
evas_object_event_callback_del_full(wd->parent,
|
||||
EVAS_CALLBACK_RESIZE,
|
||||
_changed_size_hints, obj);
|
||||
evas_object_event_callback_del_full(wd->parent,
|
||||
EVAS_CALLBACK_MOVE,
|
||||
_changed_size_hints, obj);
|
||||
evas_object_event_callback_del_full(wd->parent,
|
||||
EVAS_CALLBACK_DEL,
|
||||
_parent_del, obj);
|
||||
evas_object_event_callback_del_full(wd->parent,
|
||||
EVAS_CALLBACK_HIDE,
|
||||
_parent_hide, obj);
|
||||
wd->parent = NULL;
|
||||
}
|
||||
|
||||
if (parent)
|
||||
{
|
||||
edje_object_part_swallow(wd->notify, "elm.swallow.parent", parent);
|
||||
evas_object_event_callback_add(parent,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
evas_object_event_callback_add(parent,
|
||||
EVAS_CALLBACK_RESIZE,
|
||||
_changed_size_hints, obj);
|
||||
evas_object_event_callback_add(parent,
|
||||
EVAS_CALLBACK_MOVE,
|
||||
_changed_size_hints, obj);
|
||||
evas_object_event_callback_add(parent,
|
||||
EVAS_CALLBACK_DEL,
|
||||
_parent_del, obj);
|
||||
evas_object_event_callback_add(parent,
|
||||
EVAS_CALLBACK_HIDE,
|
||||
_parent_hide, obj);
|
||||
wd->parent = parent;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
_calc(obj);
|
||||
|
@ -343,3 +443,33 @@ elm_notify_timer_init(Evas_Object *obj)
|
|||
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* When true if the user clicks outside the window the events will be
|
||||
* catch by the others widgets, else the events are block and the signal
|
||||
* dismiss will be sent when the user click outside the window.
|
||||
*
|
||||
* @note The default value is EINA_TRUE.
|
||||
*
|
||||
* @param obj The notify object
|
||||
* @param repeats EINA_TRUE Events are repeats, else no
|
||||
*/
|
||||
EAPI void
|
||||
elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
if(repeat == wd->repeat_events) return;
|
||||
|
||||
wd->repeat_events = repeat;
|
||||
if(!repeat)
|
||||
{
|
||||
wd->block_events = edje_object_add(evas_object_evas_get(obj));
|
||||
_elm_theme_set(wd->block_events, "notify", "block_events", "default");
|
||||
elm_widget_resize_object_set(obj,wd->block_events);
|
||||
}
|
||||
else
|
||||
{
|
||||
evas_object_del(wd->block_events);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,8 +144,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
if (it->content == sub)
|
||||
{
|
||||
wd->stack = eina_list_remove_list(wd->stack, l);
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, it);
|
||||
evas_object_del(it->base);
|
||||
_eval_top(it->obj);
|
||||
free(it);
|
||||
|
|
|
@ -64,6 +64,9 @@ static void
|
|||
_theme_hook(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
edje_object_part_unswallow(NULL, wd->spacer);
|
||||
|
||||
if (wd->horizontal)
|
||||
_elm_theme_set(wd->progressbar, "progressbar", "horizontal", elm_widget_style_get(obj));
|
||||
else
|
||||
|
@ -94,8 +97,8 @@ _theme_hook(Evas_Object *obj)
|
|||
else
|
||||
evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
|
||||
|
||||
edje_object_part_swallow(wd->progressbar, "elm.swallow.bar", wd->spacer);
|
||||
|
||||
_units_set(obj);
|
||||
edje_object_message_signal_process(wd->progressbar);
|
||||
edje_object_scale_set(wd->progressbar, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
|
@ -130,8 +133,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
if (sub == wd->icon)
|
||||
{
|
||||
edje_object_signal_emit(wd->progressbar, "elm,state,icon,hidden", "elm");
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
wd->icon = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -172,7 +175,7 @@ _units_set(Evas_Object *obj)
|
|||
if (wd->units)
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
|
||||
snprintf(buf, sizeof(buf), wd->units, 100 * wd->val);
|
||||
edje_object_part_text_set(wd->progressbar, "elm.text.status", buf);
|
||||
}
|
||||
|
|
|
@ -136,8 +136,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
if (sub == wd->icon)
|
||||
{
|
||||
edje_object_signal_emit(wd->chk, "elm,state,icon,hidden", "elm");
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
wd->icon = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
|
|
@ -9,25 +9,25 @@
|
|||
* region around, allowing to move through a much larger object that is
|
||||
* contained in the scroller. The scroiller will always have a small minimum
|
||||
* size by default as it won't be limited by the contents of the scroller.
|
||||
*
|
||||
*
|
||||
* Signals that you can add callbacks for are:
|
||||
*
|
||||
*
|
||||
* edge,left - the left edge of the content has been reached
|
||||
*
|
||||
*
|
||||
* edge,right - the right edge of the content has been reached
|
||||
*
|
||||
*
|
||||
* edge,top - the top edge of the content has been reached
|
||||
*
|
||||
*
|
||||
* edge,bottom - the bottom edge of the content has been reached
|
||||
*
|
||||
*
|
||||
* scroll - the content has been scrolled (moved)
|
||||
*
|
||||
*
|
||||
* scroll,anim,start - scrolling animation has started
|
||||
*
|
||||
*
|
||||
* scroll,anim,stop - scrolling animation has stopped
|
||||
*
|
||||
*
|
||||
* scroll,drag,start - dragging the contents around has started
|
||||
*
|
||||
*
|
||||
* scroll,drag,stop - dragging the contents around has stopped
|
||||
*/
|
||||
typedef struct _Widget_Data Widget_Data;
|
||||
|
@ -125,8 +125,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
if (sub == wd->content)
|
||||
{
|
||||
elm_widget_on_show_region_hook_set(wd->content, NULL, NULL);
|
||||
evas_object_event_callback_del(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints);
|
||||
evas_object_event_callback_del_full (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
wd->content = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coor
|
|||
/**
|
||||
* Set the scroller scrollbar policy
|
||||
*
|
||||
* This sets the scrollbar visibility policy for the given scroller.
|
||||
* This sets the scrollbar visibility policy for the given scroller.
|
||||
* ELM_SMART_SCROLLER_POLICY_AUTO means the scrollber is made visible if it
|
||||
* is needed, and otherwise kept hidden. ELM_SMART_SCROLLER_POLICY_ON turns
|
||||
* it on all the time, and ELM_SMART_SCROLLER_POLICY_OFF always keeps it off.
|
||||
|
@ -447,7 +447,7 @@ elm_scroller_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
|||
y Y coordinate of the region
|
||||
w Width of the region
|
||||
h Height of the region
|
||||
|
||||
|
||||
EAPI void elm_scroller_region_show ( Evas_Object * obj, * @param v_bounce Will the scroller bounce vertically or not
|
||||
*
|
||||
* @ingroup Scroller
|
||||
|
@ -473,7 +473,7 @@ elm_scroller_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce
|
|||
* is "half a viewport". Sane usable valus are normally between 0.0 and 1.0
|
||||
* including 1.0. If you only want 1 axis to be page "limited", use 0.0 for
|
||||
* the other axis.
|
||||
*
|
||||
*
|
||||
* @param obj The scroller object
|
||||
* @param h_pagerel The horizontal page relative size
|
||||
* @param v_pagerel The vertical page relative size
|
||||
|
@ -497,7 +497,7 @@ elm_scroller_page_relative_set(Evas_Object *obj, double h_pagerel, double v_page
|
|||
* See also elm_scroller_page_relative_set(). This, instead of a page size
|
||||
* being relaive to the viewport, sets it to an absolute fixed value, with
|
||||
* 0 turning it off for that axis.
|
||||
*
|
||||
*
|
||||
* @param obj The scroller object
|
||||
* @param h_pagesize The horizontal page size
|
||||
* @param v_pagesize The vertical page size
|
||||
|
|
|
@ -135,8 +135,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
if (sub == wd->icon)
|
||||
{
|
||||
edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
wd->icon = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
|
|
@ -129,8 +129,6 @@ _end(void *data, Evas_Object *obj, const char *emission, const char *source)
|
|||
|
||||
edje_object_part_unswallow(NULL, item->o);
|
||||
edje_object_part_swallow(wd->slideshow, "elm.swallow.1", item->o);
|
||||
if(wd->timeout>0)
|
||||
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -277,8 +275,9 @@ elm_slideshow_next(Evas_Object *obj)
|
|||
_end(obj, obj, NULL, NULL);
|
||||
|
||||
if (wd->timer) ecore_timer_del(wd->timer);
|
||||
wd->timer = NULL;
|
||||
|
||||
if(wd->timeout>0)
|
||||
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
|
||||
|
||||
if(!next->o && next->itc->func.get)
|
||||
{
|
||||
next->o = next->itc->func.get((void*)next->data, obj);
|
||||
|
@ -322,7 +321,8 @@ elm_slideshow_previous(Evas_Object *obj)
|
|||
_end(obj, obj, NULL, NULL);
|
||||
|
||||
if (wd->timer) ecore_timer_del(wd->timer);
|
||||
wd->timer = NULL;
|
||||
if(wd->timeout>0)
|
||||
wd->timer = ecore_timer_add(wd->timeout, _timer_cb, obj);
|
||||
|
||||
if(!prev->o && prev->itc->func.get)
|
||||
{
|
||||
|
|
|
@ -97,8 +97,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
if (sub == wd->icon)
|
||||
{
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,icon,hidden", "elm");
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
wd->icon = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -145,9 +145,9 @@ elm_toggle_add(Evas_Object *parent)
|
|||
_elm_theme_set(wd->tgl, "toggle", "base", "default");
|
||||
wd->ontext = eina_stringshare_add("ON");
|
||||
wd->offtext = eina_stringshare_add("OFF");
|
||||
edje_object_signal_callback_add(wd->tgl, "elm,action,toggle,on", "",
|
||||
edje_object_signal_callback_add(wd->tgl, "elm,action,toggle,on", "",
|
||||
_signal_toggle_on, obj);
|
||||
edje_object_signal_callback_add(wd->tgl, "elm,action,toggle,off", "",
|
||||
edje_object_signal_callback_add(wd->tgl, "elm,action,toggle,off", "",
|
||||
_signal_toggle_off, obj);
|
||||
elm_widget_resize_object_set(obj, wd->tgl);
|
||||
edje_object_part_text_set(wd->tgl, "elm.ontext", wd->ontext);
|
||||
|
|
|
@ -28,7 +28,7 @@ struct _Elm_Toolbar_Item
|
|||
Eina_Bool selected : 1;
|
||||
Eina_Bool disabled : 1;
|
||||
Eina_Bool separator : 1;
|
||||
|
||||
|
||||
Eina_Bool menu;
|
||||
Evas_Object *o_menu;
|
||||
};
|
||||
|
@ -83,9 +83,9 @@ _item_select(Elm_Toolbar_Item *it)
|
|||
if(it->menu)
|
||||
{
|
||||
evas_object_show(it->o_menu);
|
||||
evas_object_event_callback_add(it->base, EVAS_CALLBACK_RESIZE,
|
||||
evas_object_event_callback_add(it->base, EVAS_CALLBACK_RESIZE,
|
||||
_menu_move_resize, it);
|
||||
evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOVE,
|
||||
evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOVE,
|
||||
_menu_move_resize, it);
|
||||
|
||||
_menu_move_resize(it, NULL, NULL, NULL);
|
||||
|
@ -104,13 +104,14 @@ _menu_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
static void
|
||||
_menu_move_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Elm_Toolbar_Item *it = data;
|
||||
Evas_Coord x, y, w, h;
|
||||
Widget_Data *wd = elm_widget_data_get(it->obj);
|
||||
Elm_Toolbar_Item *it = data;
|
||||
Evas_Coord x,y,w,h;
|
||||
Widget_Data *wd = elm_widget_data_get(it->obj);
|
||||
|
||||
if ((!wd) || (!wd->menu_parent)) return;
|
||||
evas_object_geometry_get(it->base, &x, &y, &w, &h);
|
||||
elm_menu_move(it->o_menu, x, y + h);
|
||||
if (!wd || !wd->menu_parent) return;
|
||||
|
||||
evas_object_geometry_get(it->base, &x, &y, &w, &h);
|
||||
elm_menu_move(it->o_menu, x, y+h);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -312,7 +313,7 @@ elm_toolbar_add(Evas_Object *parent)
|
|||
wd->scrollable = EINA_TRUE;
|
||||
wd->homogeneous = EINA_TRUE;
|
||||
wd->align = 0.5;
|
||||
|
||||
|
||||
wd->bx = evas_object_box_add(e);
|
||||
evas_object_size_hint_align_set(wd->bx, wd->align, 0.5);
|
||||
evas_object_box_layout_set(wd->bx, _layout, wd, NULL);
|
||||
|
@ -530,7 +531,7 @@ elm_toolbar_item_unselect_all(Evas_Object *obj)
|
|||
* Set if the alignment of the items.
|
||||
*
|
||||
* @param obj The toolbar object
|
||||
* @param align The new alignment. (left) 0.0 ... 1.0 (right)
|
||||
* @param align The new alignment. (left) 0.0 ... 1.0 (right)
|
||||
*/
|
||||
EAPI void
|
||||
elm_toolbar_align_set(Evas_Object *obj, double align)
|
||||
|
@ -559,13 +560,13 @@ elm_toolbar_item_menu_set(Elm_Toolbar_Item *item, Eina_Bool menu)
|
|||
item->o_menu = elm_menu_add(item->base);
|
||||
if (wd->menu_parent)
|
||||
elm_menu_parent_set(item->o_menu, wd->menu_parent);
|
||||
evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_HIDE,
|
||||
evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_HIDE,
|
||||
_menu_hide, item);
|
||||
}
|
||||
else if (item->o_menu)
|
||||
{
|
||||
evas_object_event_callback_del(item->o_menu, EVAS_CALLBACK_HIDE,
|
||||
_menu_hide);
|
||||
evas_object_event_callback_del_full(item->o_menu, EVAS_CALLBACK_HIDE,
|
||||
_menu_hide, item);
|
||||
evas_object_del(item->o_menu);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ _sub_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
|
||||
if (obj == sd->resize_obj)
|
||||
sd->resize_obj = NULL;
|
||||
else if (obj == sd->hover_obj)
|
||||
else if (obj == sd->hover_obj)
|
||||
sd->hover_obj = NULL;
|
||||
else
|
||||
sd->subobjs = eina_list_remove(sd->subobjs, obj);
|
||||
|
@ -213,7 +213,7 @@ elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj)
|
|||
Smart_Data *sd2 = evas_object_smart_data_get(sobj);
|
||||
if (sd2)
|
||||
{
|
||||
if (sd2->parent_obj)
|
||||
if (sd2->parent_obj)
|
||||
elm_widget_sub_object_del(sd2->parent_obj, sobj);
|
||||
sd2->parent_obj = obj;
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ elm_widget_sub_object_del(Evas_Object *obj, Evas_Object *sobj)
|
|||
Smart_Data *sd2 = evas_object_smart_data_get(sobj);
|
||||
if (sd2) sd2->parent_obj = NULL;
|
||||
}
|
||||
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
|
||||
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
|
||||
evas_object_smart_callback_call(obj, "sub-object-del", sobj);
|
||||
}
|
||||
|
||||
|
@ -253,10 +253,10 @@ elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj)
|
|||
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
|
||||
if (sd2) sd2->parent_obj = NULL;
|
||||
}
|
||||
evas_object_event_callback_del(sd->resize_obj, EVAS_CALLBACK_DEL,
|
||||
_sub_obj_del);
|
||||
evas_object_event_callback_del(sd->resize_obj, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_sub_obj_mouse_down);
|
||||
evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_DEL,
|
||||
_sub_obj_del, sd);
|
||||
evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_sub_obj_mouse_down, sd);
|
||||
evas_object_smart_member_del(sd->resize_obj);
|
||||
}
|
||||
sd->resize_obj = sobj;
|
||||
|
@ -270,7 +270,7 @@ elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj)
|
|||
evas_object_clip_set(sobj, evas_object_clip_get(obj));
|
||||
evas_object_smart_member_add(sobj, obj);
|
||||
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
|
||||
evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_sub_obj_mouse_down, sd);
|
||||
_smart_reconfigure(sd);
|
||||
evas_object_smart_callback_call(obj, "sub-object-add", sobj);
|
||||
|
@ -282,8 +282,10 @@ elm_widget_hover_object_set(Evas_Object *obj, Evas_Object *sobj)
|
|||
{
|
||||
API_ENTRY return;
|
||||
if (sd->hover_obj)
|
||||
evas_object_event_callback_del(sd->hover_obj, EVAS_CALLBACK_DEL,
|
||||
_sub_obj_del);
|
||||
{
|
||||
evas_object_event_callback_del_full(sd->hover_obj, EVAS_CALLBACK_DEL,
|
||||
_sub_obj_del, sd);
|
||||
}
|
||||
sd->hover_obj = sobj;
|
||||
if (sd->hover_obj)
|
||||
{
|
||||
|
@ -379,7 +381,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
{
|
||||
/* the previous focused item was unfocused - so focus
|
||||
* the next one (that can be focused) */
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward))
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward))
|
||||
return 1;
|
||||
else noloop = 1;
|
||||
}
|
||||
|
@ -388,7 +390,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
if (elm_widget_focus_get(sd->resize_obj))
|
||||
{
|
||||
/* jump to the next focused item or focus this item */
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward))
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward))
|
||||
return 1;
|
||||
/* it returned 0 - it got to the last item and is past it */
|
||||
focus_next = 1;
|
||||
|
@ -408,7 +410,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
{
|
||||
/* the previous focused item was unfocused - so focus
|
||||
* the next one (that can be focused) */
|
||||
if (elm_widget_focus_jump(child, forward))
|
||||
if (elm_widget_focus_jump(child, forward))
|
||||
return 1;
|
||||
else break;
|
||||
}
|
||||
|
@ -417,7 +419,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
/* jump to the next focused item or focus this item */
|
||||
if (elm_widget_focus_jump(child, forward))
|
||||
if (elm_widget_focus_jump(child, forward))
|
||||
return 1;
|
||||
/* it returned 0 - it got to the last item and is past it */
|
||||
focus_next = 1;
|
||||
|
@ -441,7 +443,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
{
|
||||
/* the previous focused item was unfocused - so focus
|
||||
* the next one (that can be focused) */
|
||||
if (elm_widget_focus_jump(child, forward))
|
||||
if (elm_widget_focus_jump(child, forward))
|
||||
return 1;
|
||||
else break;
|
||||
}
|
||||
|
@ -450,7 +452,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
/* jump to the next focused item or focus this item */
|
||||
if (elm_widget_focus_jump(child, forward))
|
||||
if (elm_widget_focus_jump(child, forward))
|
||||
return 1;
|
||||
/* it returned 0 - it got to the last item and is past it */
|
||||
focus_next = 1;
|
||||
|
@ -467,7 +469,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
{
|
||||
/* the previous focused item was unfocused - so focus
|
||||
* the next one (that can be focused) */
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward))
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward))
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
@ -475,7 +477,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
if (elm_widget_focus_get(sd->resize_obj))
|
||||
{
|
||||
/* jump to the next focused item or focus this item */
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward))
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward))
|
||||
return 1;
|
||||
/* it returned 0 - it got to the last item and is past it */
|
||||
focus_next = 1;
|
||||
|
@ -703,7 +705,7 @@ elm_widget_show_region_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Co
|
|||
sd->ry = y;
|
||||
sd->rw = w;
|
||||
sd->rh = h;
|
||||
if (sd->on_show_region_func)
|
||||
if (sd->on_show_region_func)
|
||||
sd->on_show_region_func(sd->on_show_region_data, obj);
|
||||
}
|
||||
|
||||
|
@ -882,7 +884,7 @@ _smart_del(Evas_Object *obj)
|
|||
{
|
||||
sobj = sd->resize_obj;
|
||||
sd->resize_obj = NULL;
|
||||
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
|
||||
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sd->resize_obj);
|
||||
evas_object_del(sobj);
|
||||
}
|
||||
|
@ -890,13 +892,13 @@ _smart_del(Evas_Object *obj)
|
|||
{
|
||||
sobj = sd->resize_obj;
|
||||
sd->hover_obj = NULL;
|
||||
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
|
||||
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
|
||||
evas_object_del(sobj);
|
||||
}
|
||||
EINA_LIST_FREE(sd->subobjs, sobj)
|
||||
{
|
||||
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
|
||||
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
|
||||
evas_object_del(sobj);
|
||||
}
|
||||
|
|
|
@ -442,8 +442,8 @@ elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj)
|
|||
if(strcmp(elm_widget_type_get(obj), "win")) return;
|
||||
win = elm_widget_data_get(obj);
|
||||
if (!win) return;
|
||||
evas_object_event_callback_del(subobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _elm_win_subobj_callback_changed_size_hints);
|
||||
evas_object_event_callback_del(subobj, EVAS_CALLBACK_DEL, _elm_win_subobj_callback_del);
|
||||
evas_object_event_callback_del_full(subobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _elm_win_subobj_callback_changed_size_hints, obj);
|
||||
evas_object_event_callback_del_full(subobj, EVAS_CALLBACK_DEL, _elm_win_subobj_callback_del, obj);
|
||||
win->subobjs = eina_list_remove(win->subobjs, subobj);
|
||||
elm_widget_sub_object_del(obj, subobj);
|
||||
_elm_win_eval_subobjs(obj);
|
||||
|
@ -836,8 +836,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
Evas_Object *sub = event_info;
|
||||
if (sub == wd->content)
|
||||
{
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
evas_object_event_callback_del_full
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
|
||||
wd->content = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
typedef struct _Smart_Data Smart_Data;
|
||||
|
||||
struct _Smart_Data
|
||||
{
|
||||
{
|
||||
Evas_Object *smart_obj;
|
||||
Evas_Object *child_obj;
|
||||
Evas_Coord x, y, w, h;
|
||||
Evas_Coord child_w, child_h, px, py;
|
||||
};
|
||||
};
|
||||
|
||||
/* local subsystem functions */
|
||||
static void _smart_child_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
@ -50,15 +50,15 @@ _elm_smart_pan_child_set(Evas_Object *obj, Evas_Object *child)
|
|||
{
|
||||
evas_object_clip_unset(sd->child_obj);
|
||||
evas_object_smart_member_del(sd->child_obj);
|
||||
evas_object_event_callback_del(sd->child_obj, EVAS_CALLBACK_FREE, _smart_child_del_hook);
|
||||
evas_object_event_callback_del(sd->child_obj, EVAS_CALLBACK_RESIZE, _smart_child_resize_hook);
|
||||
evas_object_event_callback_del_full(sd->child_obj, EVAS_CALLBACK_FREE, _smart_child_del_hook, sd);
|
||||
evas_object_event_callback_del_full(sd->child_obj, EVAS_CALLBACK_RESIZE, _smart_child_resize_hook, sd);
|
||||
sd->child_obj = NULL;
|
||||
}
|
||||
if (child)
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
int r, g, b, a;
|
||||
|
||||
|
||||
sd->child_obj = child;
|
||||
evas_object_smart_member_add(sd->child_obj, sd->smart_obj);
|
||||
evas_object_geometry_get(sd->child_obj, NULL, NULL, &w, &h);
|
||||
|
@ -135,7 +135,7 @@ static void
|
|||
_smart_child_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Smart_Data *sd;
|
||||
|
||||
|
||||
sd = data;
|
||||
sd->child_obj = NULL;
|
||||
evas_object_smart_callback_call(sd->smart_obj, "changed", NULL);
|
||||
|
@ -146,7 +146,7 @@ _smart_child_resize_hook(void *data, Evas *e, Evas_Object *obj, void *event_info
|
|||
{
|
||||
Smart_Data *sd;
|
||||
Evas_Coord w, h;
|
||||
|
||||
|
||||
sd = data;
|
||||
evas_object_geometry_get(sd->child_obj, NULL, NULL, &w, &h);
|
||||
if ((w != sd->child_w) || (h != sd->child_h))
|
||||
|
@ -168,7 +168,7 @@ static void
|
|||
_smart_add(Evas_Object *obj)
|
||||
{
|
||||
Smart_Data *sd;
|
||||
|
||||
|
||||
sd = calloc(1, sizeof(Smart_Data));
|
||||
if (!sd) return;
|
||||
sd->smart_obj = obj;
|
||||
|
@ -239,7 +239,7 @@ _smart_clip_unset(Evas_Object *obj)
|
|||
{
|
||||
INTERNAL_ENTRY;
|
||||
evas_object_clip_unset(sd->child_obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* never need to touch this */
|
||||
|
||||
|
@ -253,7 +253,7 @@ _smart_init(void)
|
|||
SMART_NAME,
|
||||
EVAS_SMART_CLASS_VERSION,
|
||||
_smart_add,
|
||||
_smart_del,
|
||||
_smart_del,
|
||||
_smart_move,
|
||||
_smart_resize,
|
||||
_smart_show,
|
||||
|
|
|
@ -76,10 +76,10 @@ struct _Smart_Data
|
|||
Ecore_Animator *animator;
|
||||
} x, y;
|
||||
} scrollto;
|
||||
|
||||
|
||||
double pagerel_h, pagerel_v;
|
||||
Evas_Coord pagesize_h, pagesize_v;
|
||||
|
||||
|
||||
unsigned char hbar_visible : 1;
|
||||
unsigned char vbar_visible : 1;
|
||||
unsigned char extern_pan : 1;
|
||||
|
@ -149,7 +149,7 @@ elm_smart_scroller_child_set(Evas_Object *obj, Evas_Object *child)
|
|||
if (sd->child_obj)
|
||||
{
|
||||
_elm_smart_pan_child_set(sd->pan_obj, NULL);
|
||||
evas_object_event_callback_del(sd->child_obj, EVAS_CALLBACK_DEL, _smart_child_del_hook);
|
||||
evas_object_event_callback_del_full(sd->child_obj, EVAS_CALLBACK_DEL, _smart_child_del_hook, sd);
|
||||
}
|
||||
|
||||
sd->child_obj = child;
|
||||
|
@ -278,7 +278,7 @@ _smart_scrollto_x_animator(void *data)
|
|||
Smart_Data *sd = data;
|
||||
Evas_Coord px, py;
|
||||
double t, tt;
|
||||
|
||||
|
||||
t = ecore_loop_time_get();
|
||||
tt = (t - sd->scrollto.x.t_start) / (sd->scrollto.x.t_end - sd->scrollto.x.t_start);
|
||||
tt = 1.0 - tt;
|
||||
|
@ -343,7 +343,7 @@ _smart_scrollto_y_animator(void *data)
|
|||
Smart_Data *sd = data;
|
||||
Evas_Coord px, py;
|
||||
double t, tt;
|
||||
|
||||
|
||||
t = ecore_loop_time_get();
|
||||
tt = (t - sd->scrollto.y.t_start) / (sd->scrollto.y.t_end - sd->scrollto.y.t_start);
|
||||
tt = 1.0 - tt;
|
||||
|
@ -415,13 +415,13 @@ static Evas_Coord
|
|||
_smart_page_x_get(Smart_Data *sd, int offset)
|
||||
{
|
||||
Evas_Coord x, y, w, h, cw, ch;
|
||||
|
||||
|
||||
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
|
||||
elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h);
|
||||
sd->pan_func.child_size_get(sd->pan_obj, &cw, &ch);
|
||||
|
||||
|
||||
x += offset;
|
||||
|
||||
|
||||
if (sd->pagerel_h > 0.0)
|
||||
{
|
||||
x = x + (w * sd->pagerel_h * 0.5);
|
||||
|
@ -443,13 +443,13 @@ static Evas_Coord
|
|||
_smart_page_y_get(Smart_Data *sd, int offset)
|
||||
{
|
||||
Evas_Coord x, y, w, h, cw, ch;
|
||||
|
||||
|
||||
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
|
||||
elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h);
|
||||
sd->pan_func.child_size_get(sd->pan_obj, &cw, &ch);
|
||||
|
||||
|
||||
y += offset;
|
||||
|
||||
|
||||
if (sd->pagerel_v > 0.0)
|
||||
{
|
||||
y = y + (h * sd->pagerel_v * 0.5);
|
||||
|
@ -471,14 +471,14 @@ static void
|
|||
_smart_page_adjust(Smart_Data *sd)
|
||||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
|
||||
|
||||
if (!_smart_do_page(sd)) return;
|
||||
|
||||
|
||||
elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, &h);
|
||||
|
||||
|
||||
x = _smart_page_x_get(sd, 0);
|
||||
y = _smart_page_y_get(sd, 0);
|
||||
|
||||
|
||||
elm_smart_scroller_child_region_show(sd->smart_obj, x, y, w, h);
|
||||
}
|
||||
|
||||
|
@ -1290,11 +1290,11 @@ _smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
sd->down.sy = y;
|
||||
sd->down.locked = 0;
|
||||
memset(&(sd->down.history[0]), 0, sizeof(sd->down.history[0]) * 20);
|
||||
#ifdef EVTIME
|
||||
#ifdef EVTIME
|
||||
sd->down.history[0].timestamp = ev->timestamp / 1000.0;
|
||||
#else
|
||||
#else
|
||||
sd->down.history[0].timestamp = ecore_loop_time_get();
|
||||
#endif
|
||||
#endif
|
||||
sd->down.history[0].x = ev->canvas.x;
|
||||
sd->down.history[0].y = ev->canvas.y;
|
||||
}
|
||||
|
@ -1345,25 +1345,25 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
|
||||
#ifdef EVTIME
|
||||
t = ev->timestamp / 1000.0;
|
||||
#else
|
||||
#else
|
||||
t = ecore_loop_time_get();
|
||||
#endif
|
||||
#endif
|
||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
||||
ax = ev->canvas.x;
|
||||
ay = ev->canvas.y;
|
||||
at = 0.0;
|
||||
#ifdef SCROLLDBG
|
||||
#ifdef SCROLLDBG
|
||||
printf("------\n");
|
||||
#endif
|
||||
#endif
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
dt = t - sd->down.history[i].timestamp;
|
||||
if (dt > 0.2) break;
|
||||
#ifdef SCROLLDBG
|
||||
printf("H: %i %i @ %1.3f\n",
|
||||
sd->down.history[i].x,
|
||||
#ifdef SCROLLDBG
|
||||
printf("H: %i %i @ %1.3f\n",
|
||||
sd->down.history[i].x,
|
||||
sd->down.history[i].y, dt);
|
||||
#endif
|
||||
#endif
|
||||
at += dt;
|
||||
ax += sd->down.history[i].x;
|
||||
ay += sd->down.history[i].y;
|
||||
|
@ -1411,7 +1411,7 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
if (_smart_do_page(sd))
|
||||
{
|
||||
Evas_Coord pgx, pgy;
|
||||
|
||||
|
||||
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
|
||||
pgx = _smart_page_x_get(sd, ox);
|
||||
if (pgx != x) _smart_scrollto_x(sd, _elm_config->page_scroll_friction, pgx);
|
||||
|
@ -1424,7 +1424,7 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
if (_smart_do_page(sd))
|
||||
{
|
||||
Evas_Coord pgx, pgy;
|
||||
|
||||
|
||||
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
|
||||
pgx = _smart_page_x_get(sd, ox);
|
||||
if (pgx != x) _smart_scrollto_x(sd, _elm_config->page_scroll_friction, pgx);
|
||||
|
@ -1489,11 +1489,11 @@ _smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
|
||||
memmove(&(sd->down.history[1]), &(sd->down.history[0]),
|
||||
sizeof(sd->down.history[0]) * 19);
|
||||
#ifdef EVTIME
|
||||
#ifdef EVTIME
|
||||
sd->down.history[0].timestamp = ev->timestamp / 1000.0;
|
||||
#else
|
||||
#else
|
||||
sd->down.history[0].timestamp = ecore_loop_time_get();
|
||||
#endif
|
||||
#endif
|
||||
sd->down.history[0].x = ev->cur.canvas.x;
|
||||
sd->down.history[0].y = ev->cur.canvas.y;
|
||||
|
||||
|
|
Loading…
Reference in New Issue