/**
* @defgroup Conformant Conformant
- *
- * The aim is to provide a widget that can be used in elementary apps to
- * account for space taken up by the indicator & softkey windows when running
+ *
+ * The aim is to provide a widget that can be used in elementary apps to
+ * account for space taken up by the indicator & softkey windows when running
* the illume2 module of E17.
*/
typedef struct _Widget_Data Widget_Data;
-struct _Widget_Data
+struct _Widget_Data
{
Evas_Object *base;
Evas_Object *shelf, *panel;
Evas_Object *content;
Ecore_Event_Handler *prop_hdl;
struct {
- Ecore_Animator *animator; // animaton timer
- double start; // time started
- Evas_Coord auto_x, auto_y; // desired delta
- Evas_Coord x, y; // current delta
+ Ecore_Animator *animator; // animaton timer
+ double start; // time started
+ Evas_Coord auto_x, auto_y; // desired delta
+ Evas_Coord x, y; // current delta
} delta;
};
static Eina_Bool _prop_change(void *data, int type, void *event);
/* local functions */
-static void
-_del_hook(Evas_Object *obj)
+static void
+_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
free(wd);
}
-static void
+static void
_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
{
Widget_Data *wd = elm_widget_data_get(obj);
edje_object_mirrored_set(wd->base, rtl);
}
-static void
-_theme_hook(Evas_Object *obj)
+static void
+_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
_sizing_eval(obj);
}
-static void
-_sizing_eval(Evas_Object *obj)
+static void
+_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord mw = -1, mh = -1;
* visible when the vkbd comes and goes by moving the conformant obj (and thus
* its children) to show the focused widget (and if focus changes follow)
-static Evas_Object *
-_focus_object_get(const Evas_Object *obj)
-{
- Evas_Object *win, *foc;
-
- win = elm_widget_top_get(obj);
- if (!win) return NULL;
- foc = elm_widget_top_get(win);
-}
-
-static void
-_focus_object_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
-{
- evas_object_geometry_get(obj, x, y, w, h);
-}
-
-static void
-_focus_change_del(void *data, Evas_Object *obj, void *event_info)
-{
- // called from toplevel when the focused window shanges
+ static Evas_Object *
+ _focus_object_get(const Evas_Object *obj)
+ {
+ Evas_Object *win, *foc;
+
+ win = elm_widget_top_get(obj);
+ if (!win) return NULL;
+ foc = elm_widget_top_get(win);
+ }
+
+ static void
+ _focus_object_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+ {
+ evas_object_geometry_get(obj, x, y, w, h);
+ }
+
+ static void
+ _focus_change_del(void *data, Evas_Object *obj, void *event_info)
+ {
+// called from toplevel when the focused window shanges
}
static void
_autoscroll_move(Evas_Object *obj)
{
- // move conformant edje by delta to show focused widget
+// move conformant edje by delta to show focused widget
}
static void
_autoscroll_mode_enable(Evas_Object *obj)
{
- // called when autoscroll mode should be on - content area smaller than
- // its min size
- // 1. get focused object
- // 2. if not in visible conformant area calculate delta needed to
- // get it in
- // 3. store delta and call _autoscroll_move() which either asanimates
- // or jumps right there
+// called when autoscroll mode should be on - content area smaller than
+// its min size
+// 1. get focused object
+// 2. if not in visible conformant area calculate delta needed to
+// get it in
+// 3. store delta and call _autoscroll_move() which either asanimates
+// or jumps right there
}
static void
_autoscroll_mode_disable(Evas_Object *obj)
{
- // called when autoscroll mode should be off - set delta to 0 and
- // call _autoscroll_move()
+// called when autoscroll mode should be off - set delta to 0 and
+// call _autoscroll_move()
}
-*/
+ */
static Eina_Bool
-_prop_change(void *data, int type __UNUSED__, void *event)
+_prop_change(void *data, int type __UNUSED__, void *event)
{
#ifdef HAVE_ELEMENTARY_X
Ecore_X_Event_Window_Property *ev;
Widget_Data *wd = elm_widget_data_get(data);
if (!wd) return ECORE_CALLBACK_PASS_ON;
ev = event;
- if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE)
+ if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE)
{
Ecore_X_Window zone;
int sh = -1;
evas_object_size_hint_min_set(wd->panel, -1, sh);
evas_object_size_hint_max_set(wd->panel, -1, sh);
}
- else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY)
+ else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY)
{
Ecore_X_Window zone;
int sh = -1;
evas_object_size_hint_min_set(wd->shelf, -1, sh);
evas_object_size_hint_max_set(wd->shelf, -1, sh);
}
- else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY)
+ else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY)
{
Ecore_X_Window zone;
int sh = -1;
evas_object_size_hint_min_set(wd->panel, -1, sh);
evas_object_size_hint_max_set(wd->panel, -1, sh);
}
- else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY)
+ else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY)
{
Ecore_X_Window zone;
int ky = -1;
/**
* Add a new Conformant object
- *
+ *
* @param parent The parent object
* @return The new conformant object or NULL if it cannot be created
- *
+ *
* @ingroup Conformant
*/
EAPI Evas_Object *
-elm_conformant_add(Evas_Object *parent)
+elm_conformant_add(Evas_Object *parent)
{
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "conformant");
elm_widget_type_set(obj, "conformant");
elm_widget_sub_object_add(parent, obj);
evas_object_size_hint_max_set(wd->panel, -1, sh);
edje_object_part_swallow(wd->base, "elm.swallow.panel", wd->panel);
- wd->prop_hdl = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
+ wd->prop_hdl = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
_prop_change, obj);
// FIXME: get kbd region prop
#endif
wd->content = content;
if (content)
{
- elm_widget_sub_object_add(obj, content);
- evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, obj);
- edje_object_part_swallow(wd->base, "elm.swallow.content", content);
+ elm_widget_sub_object_add(obj, content);
+ evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints, obj);
+ edje_object_part_swallow(wd->base, "elm.swallow.content", content);
}
_sizing_eval(obj);
}
static const char *widtype = NULL;
-#define ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, ...) \
+#define ELM_DISKSELECTOR_ITEM_CHECK_OR_RETURN(it, ...) \
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \
ELM_CHECK_WIDTYPE(it->base.widget, widtype) __VA_ARGS__;
evas_object_show(it->base.view);
if (it->label)
- edje_object_part_text_set(it->base.view, "elm.text", it->label);
+ edje_object_part_text_set(it->base.view, "elm.text", it->label);
if (it->icon)
{
evas_object_size_hint_min_set(it->icon, 24, 24);
if (elm_widget_focus_get(obj))
{
- edje_object_signal_emit(wd->self, "elm,action,focus", "elm");
- evas_object_focus_set(wd->self, EINA_TRUE);
+ edje_object_signal_emit(wd->self, "elm,action,focus", "elm");
+ evas_object_focus_set(wd->self, EINA_TRUE);
}
else
{
- edje_object_signal_emit(wd->self, "elm,action,unfocus", "elm");
- evas_object_focus_set(wd->self, EINA_FALSE);
+ edje_object_signal_emit(wd->self, "elm,action,unfocus", "elm");
+ evas_object_focus_set(wd->self, EINA_FALSE);
}
}
len = eina_stringshare_strlen(it->label);
if (x <= ox + 5)
- edje_object_signal_emit(it->base.view, "elm,state,left_side",
- "elm");
+ edje_object_signal_emit(it->base.view, "elm,state,left_side",
+ "elm");
else if (x + w >= ox + ow - 5)
- edje_object_signal_emit(it->base.view, "elm,state,right_side",
- "elm");
+ edje_object_signal_emit(it->base.view, "elm,state,right_side",
+ "elm");
else
{
if ((wd->len_threshold) && (len > wd->len_threshold))
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "diskselector");
elm_widget_type_set(obj, "diskselector");
elm_widget_sub_object_add(parent, obj);
_theme_hook(obj);
elm_widget_resize_object_set(obj, wd->scroller);
elm_smart_scroller_policy_set(wd->scroller, ELM_SMART_SCROLLER_POLICY_OFF,
- ELM_SMART_SCROLLER_POLICY_OFF);
+ ELM_SMART_SCROLLER_POLICY_OFF);
elm_smart_scroller_bounce_allow_set(wd->scroller, EINA_TRUE, EINA_FALSE);
evas_object_smart_callback_add(wd->scroller, "scroll", _scroller_move_cb,
wd);
static const char SIG_CURSOR_CHANGED[] = "cursor,changed";
static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked";
static const Evas_Smart_Cb_Description _signals[] = {
- {SIG_CHANGED, ""},
- {SIG_ACTIVATED, ""},
- {SIG_PRESS, ""},
- {SIG_LONGPRESSED, ""},
- {SIG_CLICKED, ""},
- {SIG_CLICKED_DOUBLE, ""},
- {SIG_FOCUSED, ""},
- {SIG_UNFOCUSED, ""},
- {SIG_SELECTION_PASTE, ""},
- {SIG_SELECTION_COPY, ""},
- {SIG_SELECTION_CUT, ""},
- {SIG_SELECTION_START, ""},
- {SIG_SELECTION_CHANGED, ""},
- {SIG_SELECTION_CLEARED, ""},
- {SIG_CURSOR_CHANGED, ""},
- {SIG_ANCHOR_CLICKED, ""},
- {NULL, NULL}
+ {SIG_CHANGED, ""},
+ {SIG_ACTIVATED, ""},
+ {SIG_PRESS, ""},
+ {SIG_LONGPRESSED, ""},
+ {SIG_CLICKED, ""},
+ {SIG_CLICKED_DOUBLE, ""},
+ {SIG_FOCUSED, ""},
+ {SIG_UNFOCUSED, ""},
+ {SIG_SELECTION_PASTE, ""},
+ {SIG_SELECTION_COPY, ""},
+ {SIG_SELECTION_CUT, ""},
+ {SIG_SELECTION_START, ""},
+ {SIG_SELECTION_CHANGED, ""},
+ {SIG_SELECTION_CLEARED, ""},
+ {SIG_CURSOR_CHANGED, ""},
+ {SIG_ANCHOR_CLICKED, ""},
+ {NULL, NULL}
};
static Eina_List *entries = NULL;
m->api = malloc(sizeof(Mod_Api));
if (!m->api) return NULL;
((Mod_Api *)(m->api) )->obj_hook = // called on creation
- _elm_module_symbol_get(m, "obj_hook");
+ _elm_module_symbol_get(m, "obj_hook");
((Mod_Api *)(m->api) )->obj_unhook = // called on deletion
- _elm_module_symbol_get(m, "obj_unhook");
+ _elm_module_symbol_get(m, "obj_unhook");
((Mod_Api *)(m->api) )->obj_longpress = // called on long press menu
- _elm_module_symbol_get(m, "obj_longpress");
- ok: // ok - return api
+ _elm_module_symbol_get(m, "obj_longpress");
+ok: // ok - return api
return m->api;
}
return NULL;
}
if (as->accepted)
- as2->accepted = eina_stringshare_add(as->accepted);
+ as2->accepted = eina_stringshare_add(as->accepted);
else
- as2->accepted = NULL;
+ as2->accepted = NULL;
if (as->rejected)
- as2->rejected = eina_stringshare_add(as->rejected);
+ as2->rejected = eina_stringshare_add(as->rejected);
else
- as2->rejected = NULL;
+ as2->rejected = NULL;
tf->data = as2;
}
else
- tf->data = data;
+ tf->data = data;
return tf;
}
elm_entry_entry_set(obj, t);
eina_stringshare_del(t);
if (elm_widget_disabled_get(obj))
- edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm");
+ edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm");
elm_entry_cursor_pos_set(obj, wd->cursor_pos);
if (elm_widget_focus_get(obj))
edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
_sizing_eval(data);
}
if (wd->hoversel) _hoversel_position(data);
-// Evas_Coord ww, hh;
-// evas_object_geometry_get(wd->ent, NULL, NULL, &ww, &hh);
+ // Evas_Coord ww, hh;
+ // evas_object_geometry_get(wd->ent, NULL, NULL, &ww, &hh);
}
static void
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
elm_widget_scroll_hold_pop(data);
_store_selection(ELM_SEL_CLIPBOARD, data);
-// edje_object_part_text_select_none(wd->ent, "elm.text");
+ // edje_object_part_text_select_none(wd->ent, "elm.text");
}
static void
else elm_widget_scroll_freeze_push(data);
wd->hoversel = elm_hoversel_add(data);
context_menu_orientation = edje_object_data_get
- (wd->ent, "context_menu_orientation");
+ (wd->ent, "context_menu_orientation");
if ((context_menu_orientation) &&
(!strcmp(context_menu_orientation, "horizontal")))
elm_hoversel_horizontal_set(wd->hoversel, EINA_TRUE);
Ecore_X_Event_Selection_Notify *ev = event;
if (!wd) return ECORE_CALLBACK_PASS_ON;
if ((!wd->selection_asked) && (!wd->drag_selection_asked))
- return ECORE_CALLBACK_PASS_ON;
+ return ECORE_CALLBACK_PASS_ON;
if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) ||
(ev->selection == ECORE_X_SELECTION_PRIMARY))
{
- Ecore_X_Selection_Data_Text *text_data;
-
- text_data = ev->data;
- if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT)
- {
- if (text_data->text)
- {
- char *txt = _elm_util_text_to_mkup(text_data->text);
-
- if (txt)
- {
- elm_entry_entry_insert(data, txt);
- free(txt);
- }
- }
- }
- wd->selection_asked = EINA_FALSE;
+ Ecore_X_Selection_Data_Text *text_data;
+
+ text_data = ev->data;
+ if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT)
+ {
+ if (text_data->text)
+ {
+ char *txt = _elm_util_text_to_mkup(text_data->text);
+
+ if (txt)
+ {
+ elm_entry_entry_insert(data, txt);
+ free(txt);
+ }
+ }
+ }
+ wd->selection_asked = EINA_FALSE;
}
else if (ev->selection == ECORE_X_SELECTION_XDND)
{
- Ecore_X_Selection_Data_Text *text_data;
-
- text_data = ev->data;
- if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT)
- {
- if (text_data->text)
- {
- char *txt = _elm_util_text_to_mkup(text_data->text);
-
- if (txt)
- {
- /* Massive FIXME: this should be at the drag point */
- elm_entry_entry_insert(data, txt);
- free(txt);
- }
- }
- }
- wd->drag_selection_asked = EINA_FALSE;
+ Ecore_X_Selection_Data_Text *text_data;
+
+ text_data = ev->data;
+ if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT)
+ {
+ if (text_data->text)
+ {
+ char *txt = _elm_util_text_to_mkup(text_data->text);
+
+ if (txt)
+ {
+ /* Massive FIXME: this should be at the drag point */
+ elm_entry_entry_insert(data, txt);
+ free(txt);
+ }
+ }
+ }
+ wd->drag_selection_asked = EINA_FALSE;
ecore_x_dnd_send_finished();
static Eina_Bool
_event_selection_clear(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
{
-/*
- Widget_Data *wd = elm_widget_data_get(data);
- Ecore_X_Event_Selection_Clear *ev = event;
- if (!wd) return ECORE_CALLBACK_PASS_ON;
- if (!wd->have_selection) return ECORE_CALLBACK_PASS_ON;
- if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) ||
- (ev->selection == ECORE_X_SELECTION_PRIMARY))
- {
- elm_entry_select_none(data);
- }
- return 1;*/
+ /*
+ Widget_Data *wd = elm_widget_data_get(data);
+ Ecore_X_Event_Selection_Clear *ev = event;
+ if (!wd) return ECORE_CALLBACK_PASS_ON;
+ if (!wd->have_selection) return ECORE_CALLBACK_PASS_ON;
+ if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) ||
+ (ev->selection == ECORE_X_SELECTION_PRIMARY))
+ {
+ elm_entry_select_none(data);
+ }
+ return 1;*/
return ECORE_CALLBACK_PASS_ON;
}
edje_object_part_text_cursor_copy(wd->ent, "elm.text",
EDJE_CURSOR_MAIN,/*->*/EDJE_CURSOR_USER);
rv = edje_object_part_text_cursor_coord_set(wd->ent,"elm.text",
- EDJE_CURSOR_MAIN,drop->x,drop->y);
+ EDJE_CURSOR_MAIN,drop->x,drop->y);
if (!rv) printf("Warning: Failed to position cursor: paste anyway\n");
elm_entry_entry_insert(obj, drop->data);
edje_object_part_text_cursor_copy(wd->ent, "elm.text",
if (!strncmp(item, "file://", 7))
{
const char *fname = item + 7;
-
+
o = evas_object_image_filled_add(evas_object_evas_get(data));
evas_object_image_file_set(o, fname, NULL);
if (evas_object_image_load_error_get(o) == EVAS_LOAD_ERROR_NONE)
{
tf->func(tf->data, data, text);
if (!*text)
- break;
+ break;
}
}
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "entry");
elm_widget_type_set(obj, "entry");
elm_widget_sub_object_add(parent, obj);
top = elm_widget_top_get(obj);
if ((top) && (elm_win_xwindow_get(top)))
{
- wd->sel_notify_handler =
- ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,
- _event_selection_notify, obj);
- wd->sel_clear_handler =
- ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR,
- _event_selection_clear, obj);
+ wd->sel_notify_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,
+ _event_selection_notify, obj);
+ wd->sel_clear_handler =
+ ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR,
+ _event_selection_clear, obj);
}
elm_drop_target_add(obj, ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE,
- _drag_drop_cb, NULL);
+ _drag_drop_cb, NULL);
#endif
entries = eina_list_prepend(entries, obj);
text = edje_object_part_text_get(wd->ent, "elm.text");
if (!text)
{
- ERR("text=NULL for edje %p, part 'elm.text'", wd->ent);
- return NULL;
+ ERR("text=NULL for edje %p, part 'elm.text'", wd->ent);
+ return NULL;
}
eina_stringshare_replace(&wd->text, text);
return wd->text;
* otherwise it is. */
tb = edje_object_part_object_get(wd->ent, "elm.text");
cur = evas_object_textblock_cursor_new((Evas_Object *) tb); /* This is
- actually, ok for the time being, thsese hackish stuff will be removed
- once evas 1.0 is out*/
+ actually, ok for the time being, thsese hackish stuff will be removed
+ once evas 1.0 is out*/
evas_textblock_cursor_pos_set(cur, 0);
ret = evas_textblock_cursor_char_next(cur);
evas_textblock_cursor_free(cur);
/**
* This inserts text in @p entry where the current cursor position.
- *
- * This inserts text at the cursor position is as if it was typed
+ *
+ * This inserts text at the cursor position is as if it was typed
* by the user (note this also allows markup which a user
* can't just "type" as it would be converted to escaped text, so this
* call can be used to insert things like emoticon items or bold push/pop
if (wd->linewrap == wrap) return;
wd->linewrap = wrap;
if(wd->linewrap)
- wd->char_linewrap = EINA_FALSE;
+ wd->char_linewrap = EINA_FALSE;
_theme_hook(obj);
}
if (wd->char_linewrap == wrap) return;
wd->char_linewrap = wrap;
if(wd->char_linewrap)
- wd->linewrap = EINA_FALSE;
+ wd->linewrap = EINA_FALSE;
_theme_hook(obj);
}
#ifdef HAVE_ELEMENTARY_X
if (editable)
- elm_drop_target_add(obj, ELM_SEL_FORMAT_MARKUP, _drag_drop_cb, NULL);
+ elm_drop_target_add(obj, ELM_SEL_FORMAT_MARKUP, _drag_drop_cb, NULL);
else
- elm_drop_target_del(obj);
+ elm_drop_target_del(obj);
#endif
}
if (!wd) return;
if (wd->selmode)
{
- wd->selmode = EINA_FALSE;
- edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
- edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
+ wd->selmode = EINA_FALSE;
+ edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
+ edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
}
wd->have_selection = EINA_FALSE;
edje_object_part_text_select_none(wd->ent, "elm.text");
if (!wd) return;
if (wd->selmode)
{
- wd->selmode = EINA_FALSE;
- edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
- edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
+ wd->selmode = EINA_FALSE;
+ edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
+ edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
}
wd->have_selection = EINA_TRUE;
edje_object_part_text_select_all(wd->ent, "elm.text");
* and object to do this), then this object is used to replace that item. If
* not the next provider is called until one provides an item object, or the
* default provider in entry does.
- *
+ *
* @param obj The entry object
* @param func The function called to provide the item object
* @param data The data passed to @p func
*
* This prepends the given callback. See elm_entry_item_provider_append() for
* more information
- *
+ *
* @param obj The entry object
* @param func The function called to provide the item object
* @param data The data passed to @p func
*
* This removes the given callback. See elm_entry_item_provider_append() for
* more information
- *
+ *
* @param obj The entry object
* @param func The function called to provide the item object
* @param data The data passed to @p func
wd = elm_widget_data_get(obj);
EINA_SAFETY_ON_NULL_RETURN(func);
-
+
tf = _filter_new(func, data);
if (!tf) return;
-
+
wd->text_filters = eina_list_append(wd->text_filters, tf);
}
tf = _filter_new(func, data);
if (!tf) return;
-
+
wd->text_filters = eina_list_prepend(wd->text_filters, tf);
}
* scrolled_entry */
widget_type = elm_widget_type_get(entry);
if (!strcmp(widget_type, "entry"))
- text_get = elm_entry_entry_get;
+ text_get = elm_entry_entry_get;
else if (!strcmp(widget_type, "scrolled_entry"))
- text_get = elm_scrolled_entry_entry_get;
+ text_get = elm_scrolled_entry_entry_get;
else /* huh? */
- return;
+ return;
current = elm_entry_markup_to_utf8(text_get(entry));
newlen -= (newlen - p);
}
if (newlen)
- (*text)[newlen] = 0;
+ (*text)[newlen] = 0;
else
{
free(*text);
EINA_SAFETY_ON_NULL_RETURN(text);
if ((!as->accepted) && (!as->rejected))
- return;
+ return;
if (as->accepted)
{
int size = read_idx - last_read_idx;
const char *src = (*text) + last_read_idx;
if (src != insert)
- memcpy(insert, *text + last_read_idx, size);
+ memcpy(insert, *text + last_read_idx, size);
insert += size;
}
last_read_idx = read_idx;
if (!wd) return;
if (wd->delay_write)
{
- ecore_timer_del(wd->delay_write);
- wd->delay_write = NULL;
+ ecore_timer_del(wd->delay_write);
+ wd->delay_write = NULL;
}
if (wd->autosave) _save(obj);
eina_stringshare_replace(&wd->file, file);
if (!wd) return;
if (wd->delay_write)
{
- ecore_timer_del(wd->delay_write);
- wd->delay_write = NULL;
+ ecore_timer_del(wd->delay_write);
+ wd->delay_write = NULL;
}
_save(obj);
wd->delay_write = ecore_timer_add(2.0, _delay_write, obj);
Elm_Flip_Mode mode;
Evas_Object *clip;
struct {
- Evas_Object *content, *clip;
+ Evas_Object *content, *clip;
} front, back;
Eina_Bool state : 1;
};
evas_object_size_hint_max_get(wd->front.content, &maxw, &maxh);
if (wd->back.content)
evas_object_size_hint_max_get(wd->back.content, &maxw2, &maxh2);
-
+
if (minw2 > minw) minw = minw2;
if (minh2 > minh) minh = minh2;
if ((maxw2 >= 0) && (maxw2 < maxw)) maxw = maxw2;
if ((maxh2 >= 0) && (maxh2 < maxh)) maxh = maxh2;
-
+
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
if (!wd) return;
if (sub == wd->front.content)
{
- evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
- wd->front.content = NULL;
+ wd->front.content = NULL;
evas_object_hide(wd->front.clip);
- _sizing_eval(obj);
+ _sizing_eval(obj);
}
else if (sub == wd->back.content)
{
- evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
- wd->back.content = NULL;
+ wd->back.content = NULL;
evas_object_hide(wd->back.clip);
- _sizing_eval(obj);
+ _sizing_eval(obj);
}
}
if (elm_flip_front_get(obj))
{
if (wd->front.content)
- evas_object_show(wd->front.clip);
+ evas_object_show(wd->front.clip);
else
- evas_object_hide(wd->front.clip);
+ evas_object_hide(wd->front.clip);
if (wd->back.content)
- evas_object_hide(wd->back.clip);
+ evas_object_hide(wd->back.clip);
else
- evas_object_hide(wd->back.clip);
+ evas_object_hide(wd->back.clip);
}
else
{
if (wd->front.content)
- evas_object_hide(wd->front.clip);
+ evas_object_hide(wd->front.clip);
else
- evas_object_hide(wd->front.clip);
+ evas_object_hide(wd->front.clip);
if (wd->back.content)
- evas_object_show(wd->back.clip);
+ evas_object_show(wd->back.clip);
else
- evas_object_hide(wd->back.clip);
+ evas_object_hide(wd->back.clip);
}
}
evas_object_geometry_get(wd->back.content, &x, &y, &w, &h);
evas_map_util_points_populate_from_geometry(mb, x, y, w, h, 0);
}
-
+
evas_object_geometry_get(obj, &x, &y, &w, &h);
-
+
cx = x + (w / 2);
cy = y + (h / 2);
px = x + (w / 2);
py = y + (h / 2);
foc = 2048;
-
+
lx = cx;
ly = cy;
lz = -10000;
lar = 0;
lag = 0;
lab = 0;
-
+
switch (wd->mode)
{
- case ELM_FLIP_ROTATE_Y_CENTER_AXIS:
- p = 1.0 - t;
- p = 1.0 - (p * p);
- if (wd->state) deg = 180.0 * p;
- else deg = 180 + (180.0 * p);
- evas_map_util_3d_rotate(mf, 0.0, deg, 0.0, cx, cy, 0);
- evas_map_util_3d_rotate(mb, 0.0, deg + 180.0, 0.0, cx, cy, 0);
- break;
- case ELM_FLIP_ROTATE_X_CENTER_AXIS:
- p = 1.0 - t;
- p = 1.0 - (p * p);
- if (wd->state) deg = 180.0 * p;
- else deg = 180 + (180.0 * p);
- evas_map_util_3d_rotate(mf, deg, 0.0, 0.0, cx, cy, 0);
- evas_map_util_3d_rotate(mb, deg + 180.0, 0.0, 0.0, cx, cy, 0);
- break;
- case ELM_FLIP_ROTATE_XZ_CENTER_AXIS:
- p = 1.0 - t;
- p = 1.0 - (p * p);
- if (wd->state) deg = 180.0 * p;
- else deg = 180 + (180.0 * p);
- evas_map_util_3d_rotate(mf, deg, 0.0, deg, cx, cy, 0);
- evas_map_util_3d_rotate(mb, deg + 180.0, 0.0, deg + 180.0, cx, cy, 0);
- break;
- case ELM_FLIP_ROTATE_YZ_CENTER_AXIS:
- p = 1.0 - t;
- p = 1.0 - (p * p);
- if (wd->state) deg = 180.0 * p;
- else deg = 180 + (180.0 * p);
- evas_map_util_3d_rotate(mf, 0.0, deg, deg, cx, cy, 0);
- evas_map_util_3d_rotate(mb, 0.0, deg + 180.0, deg + 180.0, cx, cy, 0);
- break;
- case ELM_FLIP_CUBE_LEFT:
- p = 1.0 - t;
- p = 1.0 - (p * p);
- deg = -90.0 * p;
- if (wd->state)
- {
- evas_map_util_3d_rotate(mf, 0.0, deg, 0.0, cx, cy, w / 2);
- evas_map_util_3d_rotate(mb, 0.0, deg + 90, 0.0, cx, cy, w / 2);
- }
- else
- {
- evas_map_util_3d_rotate(mf, 0.0, deg + 90, 0.0, cx, cy, w / 2);
- evas_map_util_3d_rotate(mb, 0.0, deg, 0.0, cx, cy, w / 2);
- }
- break;
- case ELM_FLIP_CUBE_RIGHT:
- p = 1.0 - t;
- p = 1.0 - (p * p);
- deg = 90.0 * p;
- if (wd->state)
- {
- evas_map_util_3d_rotate(mf, 0.0, deg, 0.0, cx, cy, w / 2);
- evas_map_util_3d_rotate(mb, 0.0, deg - 90, 0.0, cx, cy, w / 2);
- }
- else
- {
- evas_map_util_3d_rotate(mf, 0.0, deg - 90, 0.0, cx, cy, w / 2);
- evas_map_util_3d_rotate(mb, 0.0, deg, 0.0, cx, cy, w / 2);
- }
- break;
- case ELM_FLIP_CUBE_UP:
- p = 1.0 - t;
- p = 1.0 - (p * p);
- deg = -90.0 * p;
- if (wd->state)
- {
- evas_map_util_3d_rotate(mf, deg, 0.0, 0.0, cx, cy, h / 2);
- evas_map_util_3d_rotate(mb, deg + 90, 0.0, 0.0, cx, cy, h / 2);
- }
- else
- {
- evas_map_util_3d_rotate(mf, deg + 90, 0.0, 0.0, cx, cy, h / 2);
- evas_map_util_3d_rotate(mb, deg, 0.0, 0.0, cx, cy, h / 2);
- }
- break;
- case ELM_FLIP_CUBE_DOWN:
- p = 1.0 - t;
- p = 1.0 - (p * p);
- deg = 90.0 * p;
- if (wd->state)
- {
- evas_map_util_3d_rotate(mf, deg, 0.0, 0.0, cx, cy, h / 2);
- evas_map_util_3d_rotate(mb, deg - 90, 0.0, 0.0, cx, cy, h / 2);
- }
- else
- {
- evas_map_util_3d_rotate(mf, deg - 90, 0.0, 0.0, cx, cy, h / 2);
- evas_map_util_3d_rotate(mb, deg, 0.0, 0.0, cx, cy, h / 2);
- }
- break;
- default:
- break;
+ case ELM_FLIP_ROTATE_Y_CENTER_AXIS:
+ p = 1.0 - t;
+ p = 1.0 - (p * p);
+ if (wd->state) deg = 180.0 * p;
+ else deg = 180 + (180.0 * p);
+ evas_map_util_3d_rotate(mf, 0.0, deg, 0.0, cx, cy, 0);
+ evas_map_util_3d_rotate(mb, 0.0, deg + 180.0, 0.0, cx, cy, 0);
+ break;
+ case ELM_FLIP_ROTATE_X_CENTER_AXIS:
+ p = 1.0 - t;
+ p = 1.0 - (p * p);
+ if (wd->state) deg = 180.0 * p;
+ else deg = 180 + (180.0 * p);
+ evas_map_util_3d_rotate(mf, deg, 0.0, 0.0, cx, cy, 0);
+ evas_map_util_3d_rotate(mb, deg + 180.0, 0.0, 0.0, cx, cy, 0);
+ break;
+ case ELM_FLIP_ROTATE_XZ_CENTER_AXIS:
+ p = 1.0 - t;
+ p = 1.0 - (p * p);
+ if (wd->state) deg = 180.0 * p;
+ else deg = 180 + (180.0 * p);
+ evas_map_util_3d_rotate(mf, deg, 0.0, deg, cx, cy, 0);
+ evas_map_util_3d_rotate(mb, deg + 180.0, 0.0, deg + 180.0, cx, cy, 0);
+ break;
+ case ELM_FLIP_ROTATE_YZ_CENTER_AXIS:
+ p = 1.0 - t;
+ p = 1.0 - (p * p);
+ if (wd->state) deg = 180.0 * p;
+ else deg = 180 + (180.0 * p);
+ evas_map_util_3d_rotate(mf, 0.0, deg, deg, cx, cy, 0);
+ evas_map_util_3d_rotate(mb, 0.0, deg + 180.0, deg + 180.0, cx, cy, 0);
+ break;
+ case ELM_FLIP_CUBE_LEFT:
+ p = 1.0 - t;
+ p = 1.0 - (p * p);
+ deg = -90.0 * p;
+ if (wd->state)
+ {
+ evas_map_util_3d_rotate(mf, 0.0, deg, 0.0, cx, cy, w / 2);
+ evas_map_util_3d_rotate(mb, 0.0, deg + 90, 0.0, cx, cy, w / 2);
+ }
+ else
+ {
+ evas_map_util_3d_rotate(mf, 0.0, deg + 90, 0.0, cx, cy, w / 2);
+ evas_map_util_3d_rotate(mb, 0.0, deg, 0.0, cx, cy, w / 2);
+ }
+ break;
+ case ELM_FLIP_CUBE_RIGHT:
+ p = 1.0 - t;
+ p = 1.0 - (p * p);
+ deg = 90.0 * p;
+ if (wd->state)
+ {
+ evas_map_util_3d_rotate(mf, 0.0, deg, 0.0, cx, cy, w / 2);
+ evas_map_util_3d_rotate(mb, 0.0, deg - 90, 0.0, cx, cy, w / 2);
+ }
+ else
+ {
+ evas_map_util_3d_rotate(mf, 0.0, deg - 90, 0.0, cx, cy, w / 2);
+ evas_map_util_3d_rotate(mb, 0.0, deg, 0.0, cx, cy, w / 2);
+ }
+ break;
+ case ELM_FLIP_CUBE_UP:
+ p = 1.0 - t;
+ p = 1.0 - (p * p);
+ deg = -90.0 * p;
+ if (wd->state)
+ {
+ evas_map_util_3d_rotate(mf, deg, 0.0, 0.0, cx, cy, h / 2);
+ evas_map_util_3d_rotate(mb, deg + 90, 0.0, 0.0, cx, cy, h / 2);
+ }
+ else
+ {
+ evas_map_util_3d_rotate(mf, deg + 90, 0.0, 0.0, cx, cy, h / 2);
+ evas_map_util_3d_rotate(mb, deg, 0.0, 0.0, cx, cy, h / 2);
+ }
+ break;
+ case ELM_FLIP_CUBE_DOWN:
+ p = 1.0 - t;
+ p = 1.0 - (p * p);
+ deg = 90.0 * p;
+ if (wd->state)
+ {
+ evas_map_util_3d_rotate(mf, deg, 0.0, 0.0, cx, cy, h / 2);
+ evas_map_util_3d_rotate(mb, deg - 90, 0.0, 0.0, cx, cy, h / 2);
+ }
+ else
+ {
+ evas_map_util_3d_rotate(mf, deg - 90, 0.0, 0.0, cx, cy, h / 2);
+ evas_map_util_3d_rotate(mb, deg, 0.0, 0.0, cx, cy, h / 2);
+ }
+ break;
+ default:
+ break;
}
-
+
if (wd->front.content)
{
evas_map_util_3d_lighting(mf, lx, ly, lz, lr, lg, lb, lar, lag, lab);
if (evas_map_util_clockwise_get(mf)) evas_object_show(wd->front.clip);
else evas_object_hide(wd->front.clip);
}
-
+
if (wd->back.content)
{
evas_map_util_3d_lighting(mb, lx, ly, lz, lr, lg, lb, lar, lag, lab);
if (evas_map_util_clockwise_get(mb)) evas_object_show(wd->back.clip);
else evas_object_hide(wd->back.clip);
}
-
+
evas_map_free(mf);
evas_map_free(mb);
-
+
if (t >= 1.0)
{
evas_object_map_enable_set(wd->front.content, 0);
static void
_resize(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
-{
+{
_configure(obj);
}
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "flip");
elm_widget_type_set(obj, "flip");
elm_widget_sub_object_add(parent, obj);
elm_widget_sub_object_add(obj, wd->clip);
evas_object_clip_set(wd->clip, evas_object_clip_get(obj));
evas_object_smart_member_add(wd->clip, obj);
-
+
wd->front.clip = evas_object_rectangle_add(e);
evas_object_static_clip_set(wd->front.clip, 1);
evas_object_data_set(wd->front.clip, "_elm_leaveme", obj);
elm_widget_sub_object_add(obj, wd->front.clip);
evas_object_smart_member_add(wd->front.clip, obj);
evas_object_clip_set(wd->front.clip, wd->clip);
-
+
wd->back.clip = evas_object_rectangle_add(e);
evas_object_static_clip_set(wd->back.clip, 1);
evas_object_data_set(wd->back.clip, "_elm_leaveme", obj);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, NULL);
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, NULL);
-
+
wd->state = 1;
-
+
_sizing_eval(obj);
return obj;
}
wd->front.content = content;
if (content)
{
- elm_widget_sub_object_add(obj, content);
+ elm_widget_sub_object_add(obj, content);
evas_object_smart_member_add(content, obj);
evas_object_clip_set(content, wd->front.clip);
- evas_object_event_callback_add(content,
+ evas_object_event_callback_add(content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, obj);
- _sizing_eval(obj);
+ _changed_size_hints, obj);
+ _sizing_eval(obj);
}
// force calc to contents are the right size before transition
evas_smart_objects_calculate(evas_object_evas_get(obj));
wd->back.content = content;
if (content)
{
- elm_widget_sub_object_add(obj, content);
+ elm_widget_sub_object_add(obj, content);
evas_object_smart_member_add(content, obj);
evas_object_clip_set(content, wd->back.clip);
- evas_object_event_callback_add(content,
+ evas_object_event_callback_add(content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, obj);
- _sizing_eval(obj);
+ _changed_size_hints, obj);
+ _sizing_eval(obj);
}
// force calc to contents are the right size before transition
evas_smart_objects_calculate(evas_object_evas_get(obj));
* ELM_FLIP_ROTATE_YZ_CENTER_AXIS
* ELM_FLIP_CUBE_LEFT
* ELM_FLIP_CUBE_RIGHT
- *
+ *
* FIXME: add - ELM_FLIP_CUBE_UP
* FIXMEL add - ELM_FLIP_CUBE_DOWN
*
{NULL, NULL}
};
-#define ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(it, ...) \
+#define ELM_FLIPSELECTOR_ITEM_CHECK_DELETED_RETURN(it, ...) \
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, __VA_ARGS__); \
- if (it->deleted) \
- { \
- ERR(""#it" has been DELETED.\n"); \
- return __VA_ARGS__; \
- } \
+ if (it->deleted) \
+ { \
+ ERR(""#it" has been DELETED.\n"); \
+ return __VA_ARGS__; \
+ } \
static Elm_Flipselector_Item *
_item_new(Evas_Object *obj, const char *label, Evas_Smart_Cb func, const void *data)
ERR("flipselector deleted while walking.\n");
EINA_LIST_FREE(wd->items, item)
- _item_free(item);
+ _item_free(item);
if (wd->spin) ecore_timer_del(wd->spin);
free(wd);
return;
_elm_theme_object_set(obj, wd->base, "flipselector", "base",
- elm_widget_style_get(obj));
+ elm_widget_style_get(obj));
edje_object_scale_set(wd->base,
- elm_widget_scale_get(obj) * _elm_config->scale);
+ elm_widget_scale_get(obj) * _elm_config->scale);
max_len = edje_object_data_get(wd->base, "max_len");
if (!max_len)
wd->max_len = MAX_LEN_DEFAULT;
else
{
- wd->max_len = atoi(max_len);
- if (!wd->max_len)
- wd->max_len = MAX_LEN_DEFAULT;
+ wd->max_len = atoi(max_len);
+ if (!wd->max_len)
+ wd->max_len = MAX_LEN_DEFAULT;
}
_update_view(obj);
if (!wd->items)
{
- wd->sentinel = NULL;
- return;
+ wd->sentinel = NULL;
+ return;
}
wd->sentinel = wd->items;
EINA_LIST_FOREACH(wd->items, l, it)
{
- if (strlen(elm_flipselector_item_label_get(it)) >
- strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel))))
- wd->sentinel = l;
+ if (strlen(elm_flipselector_item_label_get(it)) >
+ strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel))))
+ wd->sentinel = l;
}
}
EINA_LIST_FOREACH(wd->items, l, it)
{
- if (!it->deleted)
- continue;
+ if (!it->deleted)
+ continue;
- if (wd->current == l)
- {
- if (wd->current == wd->sentinel)
- sentinel_eval = EINA_TRUE;
+ if (wd->current == l)
+ {
+ if (wd->current == wd->sentinel)
+ sentinel_eval = EINA_TRUE;
- wd->current = eina_list_prev(wd->current);
- }
- wd->items = eina_list_remove(wd->items, it);
+ wd->current = eina_list_prev(wd->current);
+ }
+ wd->items = eina_list_remove(wd->items, it);
- if (!wd->current)
- wd->current = wd->items;
+ if (!wd->current)
+ wd->current = wd->items;
_item_free(it);
- skip = EINA_FALSE;
+ skip = EINA_FALSE;
- if (eina_list_count(wd->items) <= 1)
- edje_object_signal_emit(wd->base, "elm,state,button,hidden", "elm");
- else
- edje_object_signal_emit(wd->base, "elm,state,button,visible", "elm");
+ if (eina_list_count(wd->items) <= 1)
+ edje_object_signal_emit(wd->base, "elm,state,button,hidden", "elm");
+ else
+ edje_object_signal_emit(wd->base, "elm,state,button,visible", "elm");
}
if (!skip)
{
if (wd->walking < 0)
{
- ERR("walking was negative. fixed!\n");
- wd->walking = 0;
+ ERR("walking was negative. fixed!\n");
+ wd->walking = 0;
}
wd->walking++;
}
wd->walking--;
if (wd->walking < 0)
{
- ERR("walking became negative. fixed!\n");
- wd->walking = 0;
+ ERR("walking became negative. fixed!\n");
+ wd->walking = 0;
}
if (wd->walking)
/* FIXME: no treatment of this signal so far */
if (elm_widget_focus_get(obj))
{
- edje_object_signal_emit(wd->base, "elm,action,focus", "elm");
- evas_object_focus_set(wd->base, EINA_TRUE);
+ edje_object_signal_emit(wd->base, "elm,action,focus", "elm");
+ evas_object_focus_set(wd->base, EINA_TRUE);
}
else
{
- edje_object_signal_emit(wd->base, "elm,action,unfocus", "elm");
- evas_object_focus_set(wd->base, EINA_FALSE);
+ edje_object_signal_emit(wd->base, "elm,action,unfocus", "elm");
+ evas_object_focus_set(wd->base, EINA_FALSE);
}
}
if (wd->sentinel)
{
- const char *label = \
- elm_flipselector_item_label_get(DATA_GET(wd->sentinel));
+ const char *label = \
+ elm_flipselector_item_label_get(DATA_GET(wd->sentinel));
- tmp = edje_object_part_text_get(wd->base, "top");
- edje_object_part_text_set(wd->base, "top", label);
+ tmp = edje_object_part_text_get(wd->base, "top");
+ edje_object_part_text_set(wd->base, "top", label);
}
edje_object_size_min_restricted_calc(wd->base, &minw, &minh, minw, minh);
if (wd->current == wd->items)
{
- wd->current = eina_list_last(wd->items);
- evas_object_smart_callback_call(wd->self, SIG_UNDERFLOWED, NULL);
+ wd->current = eina_list_last(wd->items);
+ evas_object_smart_callback_call(wd->self, SIG_UNDERFLOWED, NULL);
}
else
wd->current = eina_list_prev(wd->current);
return ECORE_CALLBACK_RENEW;
- val_up_exit_on_error:
+val_up_exit_on_error:
return ECORE_CALLBACK_CANCEL;
}
wd->current = eina_list_next(wd->current);
if (!wd->current)
{
- wd->current = wd->items;
- evas_object_smart_callback_call(wd->self, SIG_OVERFLOWED, NULL);
+ wd->current = wd->items;
+ evas_object_smart_callback_call(wd->self, SIG_OVERFLOWED, NULL);
}
item = DATA_GET(wd->current);
return ECORE_CALLBACK_RENEW;
- val_down_exit_on_error:
+val_down_exit_on_error:
return ECORE_CALLBACK_CANCEL;
}
Widget_Data *wd = elm_widget_data_get(obj);
edje_object_signal_callback_add(wd->base, "elm,action,up,start",
- "", _signal_val_up_start, obj);
+ "", _signal_val_up_start, obj);
edje_object_signal_callback_add(wd->base, "elm,action,up,stop",
- "", _signal_val_change_stop, obj);
+ "", _signal_val_change_stop, obj);
edje_object_signal_callback_add(wd->base, "elm,action,down,start",
- "", _signal_val_down_start, obj);
+ "", _signal_val_down_start, obj);
edje_object_signal_callback_add(wd->base, "elm,action,down,stop",
- "", _signal_val_change_stop, obj);
+ "", _signal_val_change_stop, obj);
}
/**
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "flipselector");
elm_widget_type_set(obj, "flipselector");
elm_widget_sub_object_add(parent, obj);
wd->items = eina_list_append(wd->items, item);
if (!wd->current) {
- wd->current = wd->items;
- _update_view(obj);
+ wd->current = wd->items;
+ _update_view(obj);
}
if (!wd->sentinel ||
(strlen(elm_flipselector_item_label_get(item)) >
- strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel)))))
+ strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel)))))
{
- wd->sentinel = eina_list_last(wd->items);
- _sizing_eval(obj);
+ wd->sentinel = eina_list_last(wd->items);
+ _sizing_eval(obj);
}
if (eina_list_count(wd->items) >= 2)
wd->items = eina_list_prepend(wd->items, item);
if (!wd->current) {
- wd->current = wd->items;
- _update_view(obj);
+ wd->current = wd->items;
+ _update_view(obj);
}
if (!wd->sentinel ||
(strlen(elm_flipselector_item_label_get(item)) >
- strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel)))))
+ strlen(elm_flipselector_item_label_get(DATA_GET(wd->sentinel)))))
{
- wd->sentinel = wd->items;
- _sizing_eval(obj);
+ wd->sentinel = wd->items;
+ _sizing_eval(obj);
}
if (eina_list_count(wd->items) >= 2)
EINA_LIST_FOREACH(wd->items, l, it)
{
- if (it->deleted)
- continue;
+ if (it->deleted)
+ continue;
- return it;
+ return it;
}
return NULL;
EINA_LIST_REVERSE_FOREACH(wd->items, l, it)
{
- if (it->deleted)
- continue;
+ if (it->deleted)
+ continue;
- return it;
+ return it;
}
return NULL;
EINA_LIST_FOREACH(wd->items, l, _item)
{
- if (_item == cur)
+ if (_item == cur)
flipside = MSG_FLIP_DOWN;
- if (_item == item)
- {
- wd->current = l;
+ if (_item == item)
+ {
+ wd->current = l;
_send_msg(wd, flipside, (char *)item->label);
- break;
- }
+ break;
+ }
}
_flipselector_unwalk(wd);
if (wd->walking > 0)
{
- item->deleted = EINA_TRUE;
- return;
+ item->deleted = EINA_TRUE;
+ return;
}
_flipselector_walk(wd);
return NULL;
EINA_LIST_FOREACH(wd->items, l, _item)
- if (_item == item)
- return item->label;
+ if (_item == item)
+ return item->label;
return NULL;
}
if (wd->current == l)
{
- _update_view(item->base.widget);
- _sizing_eval(wd->self);
+ _update_view(item->base.widget);
+ _sizing_eval(wd->self);
}
return;
return NULL;
EINA_LIST_FOREACH(wd->items, l, _item)
- if (_item == item)
- {
- l = eina_list_prev(l);
- if (!l)
- return NULL;
- return DATA_GET(l);
- }
+ if (_item == item)
+ {
+ l = eina_list_prev(l);
+ if (!l)
+ return NULL;
+ return DATA_GET(l);
+ }
return NULL;
}
return NULL;
EINA_LIST_FOREACH(wd->items, l, _item)
- if (_item == item)
- {
- l = eina_list_next(l);
- if (!l)
- return NULL;
- return DATA_GET(l);
- }
+ if (_item == item)
+ {
+ l = eina_list_next(l);
+ if (!l)
+ return NULL;
+ return DATA_GET(l);
+ }
return NULL;
}
if (!wd) return;
if (sub == wd->content)
{
- evas_object_event_callback_del_full(sub, EVAS_CALLBACK_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);
+ wd->content = NULL;
+ _sizing_eval(obj);
}
}
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "frame");
elm_widget_type_set(obj, "frame");
elm_widget_sub_object_add(parent, obj);
wd->content = content;
if (content)
{
- elm_widget_sub_object_add(obj, content);
- evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, obj);
- edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
+ elm_widget_sub_object_add(obj, content);
+ evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints, obj);
+ edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
}
_sizing_eval(obj);
}
*
* Signals that you can add callbacks for are:
*
- * clicked - The user has double-clicked or pressed enter on
- * a item. The event_infoparameter is the Gengrid item
+ * clicked - The user has double-clicked or pressed enter on
+ * a item. The event_infoparameter is the Gengrid item
* that was double-clicked.
*
* selected - The user has made an item selected. The event_info
* * Handle non-homogeneous objects too.
*/
-typedef struct _Widget_Data Widget_Data;
-typedef struct _Pan Pan;
+ typedef struct _Widget_Data Widget_Data;
+ typedef struct _Pan Pan;
#define PRELOAD 1
-struct _Elm_Gengrid_Item
+ struct _Elm_Gengrid_Item
{
Elm_Widget_Item base;
EINA_INLIST;
Widget_Data *wd;
Eina_List *labels, *icons, *states, *icon_objs;
struct
- {
- Evas_Smart_Cb func;
- const void *data;
- } func;
+ {
+ Evas_Smart_Cb func;
+ const void *data;
+ } func;
Evas_Coord x, y, dx, dy;
int relcount;
int walking;
struct
- {
- const void *data;
- Elm_Tooltip_Item_Content_Cb content_cb;
- Evas_Smart_Cb del_cb;
- const char *style;
- } tooltip;
+ {
+ const void *data;
+ Elm_Tooltip_Item_Content_Cb content_cb;
+ Evas_Smart_Cb del_cb;
+ const char *style;
+ } tooltip;
const char *mouse_cursor;
};
#define ELM_GENGRID_ITEM_FROM_INLIST(item) \
- ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Gengrid_Item) : NULL)
+ ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Gengrid_Item) : NULL)
struct _Pan
{
{
if (dx < 0)
evas_object_smart_callback_call(item->wd->self,
- left_drag, item);
+ left_drag, item);
}
}
else
{
if (dx < 0)
evas_object_smart_callback_call(item->wd->self,
- left_drag, item);
+ left_drag, item);
else
evas_object_smart_callback_call(item->wd->self,
- right_drag, item);
+ right_drag, item);
}
}
}
Elm_Gengrid_Item *item2;
EINA_LIST_FOREACH_SAFE(item->wd->selected, l, l_next, item2)
- if (item2 != item) _item_unselect(item2);
+ if (item2 != item) _item_unselect(item2);
}
_item_hilight(item);
_item_select(item);
_elm_theme_object_set(item->wd->self, item->base.view, "gengrid", style,
elm_widget_style_get(item->wd->self));
item->spacer =
- evas_object_rectangle_add(evas_object_evas_get(item->wd->self));
+ evas_object_rectangle_add(evas_object_evas_get(item->wd->self));
evas_object_color_set(item->spacer, 0, 0, 0, 0);
elm_widget_sub_object_add(item->wd->self, item->spacer);
evas_object_size_hint_min_set(item->spacer, 2 * _elm_config->scale, 1);
const char *key;
item->labels =
- elm_widget_stringlist_get(edje_object_data_get(item->base.view,
- "labels"));
+ elm_widget_stringlist_get(edje_object_data_get(item->base.view,
+ "labels"));
EINA_LIST_FOREACH(item->labels, l, key)
{
char *s = item->gic->func.label_get
- ((void *)item->base.data, item->wd->self, l->data);
+ ((void *)item->base.data, item->wd->self, l->data);
if (s)
{
edje_object_part_text_set(item->base.view, l->data, s);
const char *key;
item->icons =
- elm_widget_stringlist_get(edje_object_data_get(item->base.view,
- "icons"));
+ elm_widget_stringlist_get(edje_object_data_get(item->base.view,
+ "icons"));
EINA_LIST_FOREACH(item->icons, l, key)
{
Evas_Object *ic = item->gic->func.icon_get
- ((void *)item->base.data, item->wd->self, l->data);
+ ((void *)item->base.data, item->wd->self, l->data);
if (ic)
{
item->icon_objs = eina_list_append(item->icon_objs, ic);
const char *key;
item->states =
- elm_widget_stringlist_get(edje_object_data_get(item->base.view,
- "states"));
+ elm_widget_stringlist_get(edje_object_data_get(item->base.view,
+ "states"));
EINA_LIST_FOREACH(item->states, l, key)
{
Eina_Bool on = item->gic->func.state_get
- ((void *)item->base.data, item->wd->self, l->data);
+ ((void *)item->base.data, item->wd->self, l->data);
if (on)
{
snprintf(buf, sizeof(buf), "elm,state,%s,active", key);
item->states = NULL;
EINA_LIST_FREE(item->icon_objs, icon)
- evas_object_del(icon);
+ evas_object_del(icon);
item->realized = EINA_FALSE;
item->want_unrealize = EINA_FALSE;
if (!sd->wd->nmax) return;
EINA_INLIST_FOREACH(sd->wd->items, item)
- {
- _item_place(item, cx, cy);
- if (sd->wd->horizontal)
- {
- cy = (cy + 1) % sd->wd->nmax;
- if (!cy) cx++;
- }
- else
- {
- cx = (cx + 1) % sd->wd->nmax;
- if (!cx) cy++;
- }
- }
+ {
+ _item_place(item, cx, cy);
+ if (sd->wd->horizontal)
+ {
+ cy = (cy + 1) % sd->wd->nmax;
+ if (!cy) cx++;
+ }
+ else
+ {
+ cx = (cx + 1) % sd->wd->nmax;
+ if (!cx) cy++;
+ }
+ }
evas_object_smart_callback_call(sd->wd->self, "changed", NULL);
}
Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "gengrid");
elm_widget_type_set(obj, "gengrid");
elm_widget_sub_object_add(parent, obj);
item = _item_create(wd, gic, data, func, func_data);
if (!item) return NULL;
wd->items = eina_inlist_prepend_relative
- (wd->items, EINA_INLIST_GET(item), EINA_INLIST_GET(relative));
+ (wd->items, EINA_INLIST_GET(item), EINA_INLIST_GET(relative));
if (wd->calc_job) ecore_job_del(wd->calc_job);
wd->calc_job = ecore_job_add(_calc_job, wd);
item = _item_create(wd, gic, data, func, func_data);
if (!item) return NULL;
wd->items = eina_inlist_append_relative
- (wd->items, EINA_INLIST_GET(item), EINA_INLIST_GET(relative));
+ (wd->items, EINA_INLIST_GET(item), EINA_INLIST_GET(relative));
if (wd->calc_job) ecore_job_del(wd->calc_job);
wd->calc_job = ecore_job_add(_calc_job, wd);
Elm_Gengrid_Item *item;
wd->clear_me = 1;
EINA_INLIST_FOREACH(wd->items, item)
- item->delete_me = 1;
+ item->delete_me = 1;
return;
}
wd->clear_me = 0;
Elm_Genlist_Item *group_item;
Elm_Genlist_Item_Flags flags;
struct
- {
- Evas_Smart_Cb func;
- const void *data;
- } func;
+ {
+ Evas_Smart_Cb func;
+ const void *data;
+ } func;
Evas_Object *spacer;
Eina_List *labels, *icons, *states, *icon_objs;
Elm_Genlist_Item *rel;
struct
- {
- const void *data;
- Elm_Tooltip_Item_Content_Cb content_cb;
- Evas_Smart_Cb del_cb;
- const char *style;
- } tooltip;
+ {
+ const void *data;
+ Elm_Tooltip_Item_Content_Cb content_cb;
+ Evas_Smart_Cb del_cb;
+ const char *style;
+ } tooltip;
const char *mouse_cursor;
};
#define ELM_GENLIST_ITEM_FROM_INLIST(item) \
- ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Genlist_Item) : NULL)
+ ((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Genlist_Item) : NULL)
struct _Pan
{
_mirrored_set(obj, elm_widget_mirrored_get(obj));
elm_smart_scroller_object_theme_set(obj, wd->scr, "genlist", "base",
elm_widget_style_get(obj));
-// edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
+ // edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
wd->item_width = wd->item_height = 0;
wd->group_item_width = wd->group_item_height = 0;
wd->minw = wd->minh = wd->realminw = 0;
if (itb->realized) _item_block_unrealize(itb);
EINA_LIST_FOREACH(itb->items, l, it)
- it->mincalcd = EINA_FALSE;
+ it->mincalcd = EINA_FALSE;
itb->changed = EINA_TRUE;
}
else if ((maxw > 0) && (vw > maxw))
vw = maxw;
edje_object_size_min_calc
- (elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
+ (elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
minw = vmw + minw;
}
else
Evas_Coord vmw, vmh;
edje_object_size_min_calc
- (elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
+ (elm_smart_scroller_edje_object_get(wd->scr), &vmw, &vmh);
minw = vmw;
minh = vmh;
}
itbn->changed = EINA_TRUE;
}
it->wd->blocks =
- eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb));
+ eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb));
free(itb);
}
}
Elm_Genlist_Item *it2;
EINA_LIST_FOREACH_SAFE(it->wd->selected, l, l_next, it2)
- if (it2 != it) _item_unselect(it2);
+ if (it2 != it) _item_unselect(it2);
//_item_highlight(it);
//_item_select(it);
}
edje_object_mirrored_set(it->base.view,
elm_widget_mirrored_get(it->base.widget));
it->spacer =
- evas_object_rectangle_add(evas_object_evas_get(it->base.widget));
+ evas_object_rectangle_add(evas_object_evas_get(it->base.widget));
evas_object_color_set(it->spacer, 0, 0, 0, 0);
elm_widget_sub_object_add(it->base.widget, it->spacer);
}
const char *key;
it->labels =
- elm_widget_stringlist_get(edje_object_data_get(it->base.view,
- "labels"));
+ elm_widget_stringlist_get(edje_object_data_get(it->base.view,
+ "labels"));
EINA_LIST_FOREACH(it->labels, l, key)
{
char *s = it->itc->func.label_get
- ((void *)it->base.data, it->base.widget, l->data);
+ ((void *)it->base.data, it->base.widget, l->data);
if (s)
{
const char *key;
it->icons =
- elm_widget_stringlist_get(edje_object_data_get(it->base.view,
- "icons"));
+ elm_widget_stringlist_get(edje_object_data_get(it->base.view,
+ "icons"));
EINA_LIST_FOREACH(it->icons, l, key)
{
Evas_Object *ic = it->itc->func.icon_get
- ((void *)it->base.data, it->base.widget, l->data);
+ ((void *)it->base.data, it->base.widget, l->data);
if (ic)
{
const char *key;
it->states =
- elm_widget_stringlist_get(edje_object_data_get(it->base.view,
- "states"));
+ elm_widget_stringlist_get(edje_object_data_get(it->base.view,
+ "states"));
EINA_LIST_FOREACH(it->states, l, key)
{
Eina_Bool on = it->itc->func.state_get
- ((void *)it->base.data, it->base.widget, l->data);
+ ((void *)it->base.data, it->base.widget, l->data);
if (on)
{
it->mincalcd = EINA_TRUE;
if ((!it->wd->group_item_width) && (it->flags == ELM_GENLIST_ITEM_GROUP))
- {
- it->wd->group_item_width = mw;
- it->wd->group_item_height = mh;
- }
+ {
+ it->wd->group_item_width = mw;
+ it->wd->group_item_height = mh;
+ }
else if ((!it->wd->item_width) && (it->flags == ELM_GENLIST_ITEM_NONE))
{
it->wd->item_width = mw;
elm_widget_stringlist_free(it->states);
EINA_LIST_FREE(it->icon_objs, icon)
- evas_object_del(icon);
+ evas_object_del(icon);
it->states = NULL;
it->realized = EINA_FALSE;
if (wd->w != ow)
{
wd->w = ow;
-// if (wd->height_for_width) changed = EINA_TRUE;
+ // if (wd->height_for_width) changed = EINA_TRUE;
}
EINA_INLIST_FOREACH(wd->blocks, itb)
Eina_List *l;
Elm_Genlist_Item *it;
EINA_LIST_FOREACH(itb->items, l, it)
- if (it->mincalcd) it->mincalcd = EINA_FALSE;
+ if (it->mincalcd) it->mincalcd = EINA_FALSE;
itb->changed = EINA_TRUE;
if (itb->must_recalc) did_must_recalc = EINA_TRUE;
itb->must_recalc = EINA_FALSE;
Pan *sd = evas_object_smart_data_get(obj);
Item_Block *itb;
-// Evas_Coord ow, oh;
-// evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
-// ow = sd->wd->minw - ow;
-// if (ow < 0) ow = 0;
-// oh = sd->wd->minh - oh;
-// if (oh < 0) oh = 0;
-// if (x < 0) x = 0;
-// if (y < 0) y = 0;
-// if (x > ow) x = ow;
-// if (y > oh) y = oh;
+ // Evas_Coord ow, oh;
+ // evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
+ // ow = sd->wd->minw - ow;
+ // if (ow < 0) ow = 0;
+ // oh = sd->wd->minh - oh;
+ // if (oh < 0) oh = 0;
+ // if (x < 0) x = 0;
+ // if (y < 0) y = 0;
+ // if (x > ow) x = ow;
+ // if (y > oh) y = oh;
if ((x == sd->wd->pan_x) && (y == sd->wd->pan_y)) return;
sd->wd->pan_x = x;
sd->wd->pan_y = y;
sc.calculate = _pan_calculate;
if (!(smart = evas_smart_class_new(&sc))) return NULL;
}
-
+
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "genlist");
elm_widget_type_set(obj, "genlist");
elm_widget_sub_object_add(parent, obj);
if (!it->rel->block)
{
wd->blocks =
- eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb));
+ eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb));
itb->items = eina_list_append(itb->items, it);
}
else
if (it->before)
{
wd->blocks = eina_inlist_prepend_relative
- (wd->blocks, EINA_INLIST_GET(itb),
+ (wd->blocks, EINA_INLIST_GET(itb),
EINA_INLIST_GET(it->rel->block));
itb->items =
- eina_list_prepend_relative(itb->items, it, it->rel);
+ eina_list_prepend_relative(itb->items, it, it->rel);
}
else
{
wd->blocks = eina_inlist_append_relative
- (wd->blocks, EINA_INLIST_GET(itb),
+ (wd->blocks, EINA_INLIST_GET(itb),
EINA_INLIST_GET(it->rel->block));
itb->items =
- eina_list_append_relative(itb->items, it, it->rel);
+ eina_list_append_relative(itb->items, it, it->rel);
}
}
}
if (!itb) return;
itb->wd = wd;
wd->blocks =
- eina_inlist_prepend(wd->blocks,
- EINA_INLIST_GET(itb));
+ eina_inlist_prepend(wd->blocks,
+ EINA_INLIST_GET(itb));
}
}
else
if (!itb) return;
itb->wd = wd;
wd->blocks =
- eina_inlist_prepend(wd->blocks, EINA_INLIST_GET(itb));
+ eina_inlist_prepend(wd->blocks, EINA_INLIST_GET(itb));
}
itb->items = eina_list_prepend(itb->items, it);
}
if (!itb) return;
itb->wd = wd;
wd->blocks =
- eina_inlist_append(wd->blocks,
- EINA_INLIST_GET(itb));
+ eina_inlist_append(wd->blocks,
+ EINA_INLIST_GET(itb));
}
}
else
if (!itb) return;
itb->wd = wd;
wd->blocks =
- eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb));
+ eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb));
}
itb->items = eina_list_append(itb->items, it);
}
if (!itb2) return;
itb2->wd = wd;
wd->blocks =
- eina_inlist_append_relative(wd->blocks, EINA_INLIST_GET(itb2),
- EINA_INLIST_GET(itb));
+ eina_inlist_append_relative(wd->blocks, EINA_INLIST_GET(itb2),
+ EINA_INLIST_GET(itb));
itb2->changed = EINA_TRUE;
while ((itb->count > newc) && (itb->items))
{
it->parent->items = eina_list_append(it->parent->items, it);
if (!it2) it2 = it->parent;
wd->items =
- eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
- EINA_INLIST_GET(it2));
+ eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
+ EINA_INLIST_GET(it2));
it->rel = it2;
it->rel->relcount++;
it->parent->items = eina_list_prepend(it->parent->items, it);
if (!it2) it2 = it->parent;
wd->items =
- eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
- EINA_INLIST_GET(it2));
+ eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
+ EINA_INLIST_GET(it2));
it->rel = it2;
it->rel->relcount++;
}
wd->anchor_item = ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
if (!wd->anchor_item)
wd->anchor_item =
- ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
+ ELM_GENLIST_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
}
wd->items = eina_inlist_remove(wd->items, wd->items);
if (it->flags & ELM_GENLIST_ITEM_GROUP)
Elm_Genlist_Item *it2;
EINA_LIST_FOREACH(it->items, l, it2)
- tl = eina_list_append(tl, it2);
+ tl = eina_list_append(tl, it2);
EINA_LIST_FREE(tl, it2)
- elm_genlist_item_del(it2);
+ elm_genlist_item_del(it2);
}
/**
static const char SIG_CLICKED[] = "clicked";
static const char SIG_SMART_LOCATION_CHANGED[] = "smart,changed";
static const Evas_Smart_Cb_Description _signals[] = {
- {SIG_CLICKED, ""},
- {SIG_SMART_LOCATION_CHANGED, ""},
- {NULL, NULL}
+ {SIG_CLICKED, ""},
+ {SIG_SMART_LOCATION_CHANGED, ""},
+ {NULL, NULL}
};
static void
if (!wd) return;
if (elm_widget_focus_get(obj))
{
- edje_object_signal_emit(wd->cov, "elm,action,focus", "elm");
- evas_object_focus_set(wd->cov, EINA_TRUE);
+ edje_object_signal_emit(wd->cov, "elm,action,focus", "elm");
+ evas_object_focus_set(wd->cov, EINA_TRUE);
}
else
{
- edje_object_signal_emit(wd->cov, "elm,action,unfocus", "elm");
- evas_object_focus_set(wd->cov, EINA_FALSE);
+ edje_object_signal_emit(wd->cov, "elm,action,unfocus", "elm");
+ evas_object_focus_set(wd->cov, EINA_FALSE);
}
}
_elm_config->scale);
if (wd->smt_sub)
- _elm_hover_sub_obj_placement_eval(obj);
+ _elm_hover_sub_obj_placement_eval(obj);
else
- _reval_content(obj);
+ _reval_content(obj);
_sizing_eval(obj);
if (evas_object_visible_get(wd->cov)) _hov_show_do(obj);
}
if (wd->smt_sub)
{
if (wd->smt_sub == sub)
- wd->smt_sub = NULL;
+ wd->smt_sub = NULL;
}
else
{
if (wd->cov)
{
- evas_object_show(wd->cov);
- edje_object_signal_emit(wd->cov, "elm,action,show", "elm");
+ evas_object_show(wd->cov);
+ edje_object_signal_emit(wd->cov, "elm,action,show", "elm");
}
ELM_HOVER_PARTS_FOREACH
{
- char buf[1024];
-
- if (wd->subs[i].obj)
- {
- snprintf(buf, sizeof(buf), "elm,action,slot,%s,show",
- wd->subs[i].swallow);
- edje_object_signal_emit(wd->cov, buf, "elm");
- }
+ char buf[1024];
+
+ if (wd->subs[i].obj)
+ {
+ snprintf(buf, sizeof(buf), "elm,action,slot,%s,show",
+ wd->subs[i].swallow);
+ edje_object_signal_emit(wd->cov, buf, "elm");
+ }
}
}
if (!wd) return;
if (wd->cov)
{
- edje_object_signal_emit(wd->cov, "elm,action,hide", "elm");
- evas_object_hide(wd->cov);
+ edje_object_signal_emit(wd->cov, "elm,action,hide", "elm");
+ evas_object_hide(wd->cov);
}
ELM_HOVER_PARTS_FOREACH
{
- char buf[1024];
-
- if (wd->subs[i].obj)
- {
- snprintf(buf, sizeof(buf), "elm,action,slot,%s,hide",
- wd->subs[i].swallow);
- edje_object_signal_emit(wd->cov, buf, "elm");
- }
+ char buf[1024];
+
+ if (wd->subs[i].obj)
+ {
+ snprintf(buf, sizeof(buf), "elm,action,slot,%s,hide",
+ wd->subs[i].swallow);
+ edje_object_signal_emit(wd->cov, buf, "elm");
+ }
}
}
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "hover");
elm_widget_type_set(obj, "hover");
elm_widget_sub_object_add(parent, obj);
elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
ELM_HOVER_PARTS_FOREACH
- wd->subs[i].swallow = _directions[i];
-
+ wd->subs[i].swallow = _directions[i];
+
wd->hov = evas_object_rectangle_add(e);
evas_object_pass_events_set(wd->hov, EINA_TRUE);
evas_object_color_set(wd->hov, 0, 0, 0, 0);
wd->target = target;
if (wd->target)
{
- evas_object_event_callback_add(wd->target, EVAS_CALLBACK_DEL,
+ evas_object_event_callback_add(wd->target, EVAS_CALLBACK_DEL,
_target_del, obj);
- evas_object_event_callback_add(wd->target, EVAS_CALLBACK_MOVE,
+ evas_object_event_callback_add(wd->target, EVAS_CALLBACK_MOVE,
_target_move, obj);
- elm_widget_hover_object_set(target, obj);
- _sizing_eval(obj);
+ elm_widget_hover_object_set(target, obj);
+ _sizing_eval(obj);
}
}
if (!wd) return;
if (wd->parent)
{
- 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);
+ 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)
{
- evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_MOVE,
+ evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_MOVE,
_parent_move, obj);
- evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_RESIZE,
+ evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_RESIZE,
_parent_resize, obj);
- evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_SHOW,
+ evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_SHOW,
_parent_show, obj);
- evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_HIDE,
+ evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_HIDE,
_parent_hide, obj);
- evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_DEL,
+ evas_object_event_callback_add(wd->parent, EVAS_CALLBACK_DEL,
_parent_del, obj);
-// elm_widget_sub_object_add(parent, obj);
+ // elm_widget_sub_object_add(parent, obj);
}
_sizing_eval(obj);
}
{
ELM_HOVER_PARTS_FOREACH
{
- if (wd->subs[i].obj)
- {
+ if (wd->subs[i].obj)
+ {
evas_object_del(wd->subs[i].obj);
wd->subs[i].obj = NULL;
- }
+ }
}
}
ELM_HOVER_PARTS_FOREACH
{
- if (!strcmp(swallow, wd->subs[i].swallow))
- {
- if (content == wd->subs[i].obj)
+ if (!strcmp(swallow, wd->subs[i].swallow))
+ {
+ if (content == wd->subs[i].obj)
return;
- evas_object_del(wd->subs[i].obj);
+ evas_object_del(wd->subs[i].obj);
wd->subs[i].obj = NULL;
if (content)
edje_object_part_swallow(wd->cov, buf, content);
wd->subs[i].obj = content;
}
- break;
- }
+ break;
+ }
}
- end:
+end:
_sizing_eval(obj);
}
return wd->smt_sub;
ELM_HOVER_PARTS_FOREACH
- if (!strcmp(swallow, wd->subs[i].swallow))
- return wd->subs[i].obj;
+ if (!strcmp(swallow, wd->subs[i].swallow))
+ return wd->subs[i].obj;
return NULL;
}
ELM_HOVER_PARTS_FOREACH
{
- if (!strcmp(swallow, wd->subs[i].swallow))
- {
- Evas_Object *content;
+ if (!strcmp(swallow, wd->subs[i].swallow))
+ {
+ Evas_Object *content;
- if (!wd->subs[i].obj)
+ if (!wd->subs[i].obj)
return NULL;
- content = wd->subs[i].obj;
- elm_widget_sub_object_del(obj, wd->subs[i].obj);
- edje_object_part_unswallow(wd->cov, wd->subs[i].obj);
- wd->subs[i].obj = NULL;
+ content = wd->subs[i].obj;
+ elm_widget_sub_object_del(obj, wd->subs[i].obj);
+ edje_object_part_unswallow(wd->cov, wd->subs[i].obj);
+ wd->subs[i].obj = NULL;
- return content;
- }
+ return content;
+ }
}
return NULL;
if (pref_axis == ELM_HOVER_AXIS_HORIZONTAL)
{
- if (spc_l < spc_r) return _HOV_RIGHT;
- else return _HOV_LEFT;
+ if (spc_l < spc_r) return _HOV_RIGHT;
+ else return _HOV_LEFT;
}
else if (pref_axis == ELM_HOVER_AXIS_VERTICAL)
{
- if (spc_t < spc_b) return _HOV_BOTTOM;
- else return _HOV_TOP;
+ if (spc_t < spc_b) return _HOV_BOTTOM;
+ else return _HOV_TOP;
}
if (spc_l < spc_r)
Elm_Icon_Lookup_Order lookup_order;
#ifdef ELM_EFREET
struct {
- int requested_size;
- Eina_Bool use : 1;
+ int requested_size;
+ Eina_Bool use : 1;
} freedesktop;
#endif
Eina_Bool scale_up : 1;
/* This icon has been set to a freedesktop icon, and the requested
appears to have a different size than the requested size, so try to
request another, higher resolution, icon.
- FIXME: Find a better heuristic to determine if there should be
- an icon with a different resolution. */
+FIXME: Find a better heuristic to determine if there should be
+an icon with a different resolution. */
_icon_freedesktop_set(wd, obj, wd->stdicon, w);
}
#endif
if (wd->no_scale) _els_smart_icon_scale_set(wd->img, 1.0);
else
{
- _els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) *
- _elm_config->scale);
- _els_smart_icon_size_get(wd->img, &w, &h);
+ _els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) *
+ _elm_config->scale);
+ _els_smart_icon_size_get(wd->img, &w, &h);
}
if (!wd->scale_down)
{
- minw = w;
- minh = h;
+ minw = w;
+ minh = h;
}
if (!wd->scale_up)
{
- maxw = w;
- maxh = h;
+ maxw = w;
+ maxh = h;
}
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "icon");
elm_widget_type_set(obj, "icon");
elm_widget_can_focus_set(obj, EINA_FALSE);
wd->lookup_order = ELM_ICON_LOOKUP_THEME_FDO;
wd->img = _els_smart_icon_add(e);
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP,
- _mouse_up, obj);
+ _mouse_up, obj);
evas_object_repeat_events_set(wd->img, EINA_TRUE);
elm_widget_resize_object_set(obj, wd->img);
/* try locating the icon using the specified lookup order */
switch (wd->lookup_order)
- {
- case ELM_ICON_LOOKUP_FDO:
- ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img));
- break;
- case ELM_ICON_LOOKUP_THEME:
- ret = _icon_standard_set(wd, obj, name);
- break;
- case ELM_ICON_LOOKUP_THEME_FDO:
- ret = _icon_standard_set(wd, obj, name) ||
+ {
+ case ELM_ICON_LOOKUP_FDO:
+ ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img));
+ break;
+ case ELM_ICON_LOOKUP_THEME:
+ ret = _icon_standard_set(wd, obj, name);
+ break;
+ case ELM_ICON_LOOKUP_THEME_FDO:
+ ret = _icon_standard_set(wd, obj, name) ||
_icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img));
- break;
- case ELM_ICON_LOOKUP_FDO_THEME:
- default:
- ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img)) ||
+ break;
+ case ELM_ICON_LOOKUP_FDO_THEME:
+ default:
+ ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img)) ||
_icon_standard_set(wd, obj, name);
- break;
- }
+ break;
+ }
if (ret)
{
}
if (_path_is_absolute(name))
- return _icon_file_set(wd, obj, name);
+ return _icon_file_set(wd, obj, name);
/* if that fails, see if icon name is in the format size/name. if so,
try locating a fallback without the size specification */
* arrows etc.) or a custom file (PNG, JPG, EDJE etc.) used for an
* icon. The Icon may scale or not and of course... support alpha
* channels.
- *
+ *
* Signals that you can add callbacks for are:
*
* - clicked: This is called when a user has clicked the image
if (wd->no_scale) _els_smart_icon_scale_set(wd->img, 1.0);
else
{
- _els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) * _elm_config->scale);
- _els_smart_icon_size_get(wd->img, &w, &h);
+ _els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) * _elm_config->scale);
+ _els_smart_icon_size_get(wd->img, &w, &h);
}
if (!wd->scale_down)
{
- minw = w;
- minh = h;
+ minw = w;
+ minh = h;
}
if (!wd->scale_up)
{
- maxw = w;
- maxh = h;
+ maxw = w;
+ maxh = h;
}
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "image");
elm_widget_type_set(obj, "image");
elm_widget_sub_object_add(parent, obj);
wd->img = _els_smart_icon_add(e);
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP,
- _mouse_up, obj);
+ _mouse_up, obj);
evas_object_repeat_events_set(wd->img, EINA_TRUE);
elm_widget_resize_object_set(obj, wd->img);
{
if (!wd->bx[1])
{
- wd->bx[1] = evas_object_box_add(evas_object_evas_get(wd->base));
- evas_object_box_layout_set(wd->bx[1], _layout, wd, NULL);
+ wd->bx[1] = evas_object_box_add(evas_object_evas_get(wd->base));
+ evas_object_box_layout_set(wd->bx[1], _layout, wd, NULL);
elm_widget_sub_object_add(obj, wd->bx[1]);
}
edje_object_part_swallow(wd->base, "elm.swallow.index.1", wd->bx[1]);
Elm_Index_Item *it;
if (!wd) return NULL;
EINA_LIST_FOREACH(wd->items, l, it)
- if (it->base.data == item) return it;
+ if (it->base.data == item) return it;
return NULL;
}
if ((x < dist) || (!it_closest))
{
if (wd->horizontal)
- cdv = (double)(xx - bx) / (double)bw;
+ cdv = (double)(xx - bx) / (double)bw;
else
cdv = (double)(yy - by) / (double)bh;
it_closest = it;
}
}
if ((!i) && (!wd->level))
- edje_object_part_drag_value_set(wd->base, "elm.dragable.index.1",
+ edje_object_part_drag_value_set(wd->base, "elm.dragable.index.1",
cdv, cdv);
if (it_closest) it_closest->selected = 1;
if (it_closest != it_last)
free(last);
}
-static void
+static void
_wheel(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
-// Evas_Event_Mouse_Wheel *ev = event_info;
-// Evas_Object *obj = o;
+ // Evas_Event_Mouse_Wheel *ev = event_info;
+ // Evas_Object *obj = o;
if (!wd) return;
}
-static void
+static void
_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
wd->dy = ev->canvas.y - y;
elm_index_active_set(data, 1);
_sel_eval(data, ev->canvas.x, ev->canvas.y);
- edje_object_part_drag_value_set(wd->base, "elm.dragable.pointer",
- (!edje_object_mirrored_get(wd->base)) ? wd->dx : (wd->dx - w), wd->dy);
+ edje_object_part_drag_value_set(wd->base, "elm.dragable.pointer",
+ (!edje_object_mirrored_get(wd->base)) ? wd->dx : (wd->dx - w), wd->dy);
}
-static void
+static void
_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
edje_object_signal_emit(wd->base, "elm,state,level,0", "elm");
}
-static void
+static void
_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(data);
adx = dx;
if (adx < 0) adx = -dx;
edje_object_part_drag_value_set(wd->base, "elm.dragable.pointer"
- , (!edje_object_mirrored_get(wd->base)) ? x : (x - w), y);
+ , (!edje_object_mirrored_get(wd->base)) ? x : (x - w), y);
if (!wd->horizontal)
{
if (adx > minw)
{
if (!wd->level)
- {
+ {
wd->level = 1;
snprintf(buf, sizeof(buf), "elm,state,level,%i", wd->level);
edje_object_signal_emit(wd->base, buf, "elm");
Evas_Coord minw, minh;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "index");
elm_widget_type_set(obj, "index");
elm_widget_sub_object_add(parent, obj);
if (edje_object_part_exists(wd->base, "elm.swallow.index.1"))
{
wd->bx[1] = evas_object_box_add(e);
- evas_object_box_layout_set(wd->bx[1], _layout, wd, NULL);
+ evas_object_box_layout_set(wd->bx[1], _layout, wd, NULL);
elm_widget_sub_object_add(obj, wd->bx[1]);
edje_object_part_swallow(wd->base, "elm.swallow.index.1", wd->bx[1]);
evas_object_show(wd->bx[1]);
Elm_Index_Item *it;
if (!wd) return NULL;
EINA_LIST_FOREACH(wd->items, l, it)
- if ((it->selected) && (it->level == level))
- return elm_widget_item_data_get(it);
+ if ((it->selected) && (it->level == level))
+ return elm_widget_item_data_get(it);
return NULL;
}
wd->items = eina_list_prepend_relative_list(wd->items, it, lnear);
else
{
- /* If cmp_data_func is not provided, append a duplicated item */
- if (!cmp_data_func)
- wd->items = eina_list_append_relative_list(wd->items, it, lnear);
- else
- {
- Elm_Index_Item *p_it = eina_list_data_get(lnear);
- if (cmp_data_func(p_it->base.data, it->base.data) >= 0)
- p_it->base.data = it->base.data;
- _item_free(it);
- }
+ /* If cmp_data_func is not provided, append a duplicated item */
+ if (!cmp_data_func)
+ wd->items = eina_list_append_relative_list(wd->items, it, lnear);
+ else
+ {
+ Elm_Index_Item *p_it = eina_list_data_get(lnear);
+ if (cmp_data_func(p_it->base.data, it->base.data) >= 0)
+ p_it->base.data = it->base.data;
+ _item_free(it);
+ }
}
_index_box_clear(obj, wd->bx[wd->level], wd->level);
resh = 0;
edje_object_size_min_restricted_calc(wd->lbl, &minw, &minh, 0, 0);
minminw = minw;
- if (wd->wrap_w >= resw)
+ if (wd->wrap_w >= resw)
{
resw = wd->wrap_w;
edje_object_size_min_restricted_calc(wd->lbl, &minw, &minh, resw, 0);
evas_object_size_hint_min_set(data, minminw, minh);
}
- if ((wd->ellipsis) && (wd->linewrap) && (wd->wrap_h > 0) &&
+ if ((wd->ellipsis) && (wd->linewrap) && (wd->wrap_h > 0) &&
(_is_width_over(data, 1) == 1))
_ellipsis_label_to_width(data, 1);
if (wd->linewrap)
{
if (wd->ellipsis)
- _elm_theme_object_set(obj, wd->lbl, "label", "base_wrap_ellipsis",
+ _elm_theme_object_set(obj, wd->lbl, "label", "base_wrap_ellipsis",
elm_widget_style_get(obj));
else
- _elm_theme_object_set(obj, wd->lbl, "label", "base_wrap",
+ _elm_theme_object_set(obj, wd->lbl, "label", "base_wrap",
elm_widget_style_get(obj));
}
else
- _elm_theme_object_set(obj, wd->lbl, "label", "base",
+ _elm_theme_object_set(obj, wd->lbl, "label", "base",
elm_widget_style_get(obj));
}
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_theme_change(obj);
edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
- edje_object_scale_set(wd->lbl, elm_widget_scale_get(obj) *
+ edje_object_scale_set(wd->lbl, elm_widget_scale_get(obj) *
_elm_config->scale);
_label_sliding_change(obj);
_sizing_eval(obj);
wd->changed = EINA_FALSE;
wd->lastw = resw;
_elm_win_recalc_job(obj);
-// FIXME: works ok. but NOT for genlist. what should genlist do?
-// if (wd->deferred_recalc_job) ecore_job_del(wd->deferred_recalc_job);
-// wd->deferred_recalc_job = ecore_job_add(_elm_win_recalc_job, obj);
+ // FIXME: works ok. but NOT for genlist. what should genlist do?
+ // if (wd->deferred_recalc_job) ecore_job_del(wd->deferred_recalc_job);
+ // wd->deferred_recalc_job = ecore_job_add(_elm_win_recalc_job, obj);
}
else
{
maxh = minh;
evas_object_size_hint_max_set(obj, maxw, maxh);
if ((wd->ellipsis) && (_is_width_over(obj, 0) == 1))
- _ellipsis_label_to_width(obj, 0);
+ _ellipsis_label_to_width(obj, 0);
}
}
-static void
+static void
_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Widget_Data *wd = elm_widget_data_get(data);
{
char *curlocater, *starttag, *endtag;
int firstindex = 0, foundflag = -1;
-
+
curlocater = strstr(oldstring, key);
if (curlocater)
{
firstindex = abs(oldstring - curlocater);
firstindex += key_len + 1; // strlen("key") + strlen("=")
*value = (char *)oldstring + firstindex;
-
+
while (oldstring != starttag)
{
if (*starttag == '>')
foundflag = 0;
break;
}
- if (*starttag == '<')
+ if (*starttag == '<')
break;
- else
+ else
starttag--;
if (!starttag) break;
}
-
+
while (endtag)
{
if (*endtag == '<')
foundflag = 0;
break;
}
- if (*endtag == '>')
+ if (*endtag == '>')
break;
- else
+ else
endtag++;
if (!endtag) break;
}
-
+
if ((foundflag) && (*starttag == '<') && (*endtag == '>'))
foundflag = 1;
- else
+ else
foundflag = 0;
}
else
{
foundflag = 0;
}
-
+
if (foundflag == 1) return 0;
-
+
return -1;
}
char *curlocater, *replocater;
char *starttag, *endtag;
int tagtxtlen = 0, insertflag = 0;
-
+
srcstring = eina_strbuf_string_get(srcbuf);
curlocater = strstr(srcstring, key);
-
+
if (!curlocater)
insertflag = 1;
else
{
int key_len = strlen(key);
- do
+ do
{
starttag = strchr(srcstring, '<');
endtag = strchr(srcstring, '>');
else
break;
} while (strlen(srcstring) > 1);
-
+
if ((starttag) && (endtag) && (tagtxtlen > key_len))
{
char *eqchar = NULL;
// key=value
// ^ : move to here
replocater = eqchar + 1;
- while ((*replocater) &&
- (*replocater != ' ') &&
+ while ((*replocater) &&
+ (*replocater != ' ') &&
(*replocater != '>'))
replocater++;
-
+
if ((replocater - curlocater) > key_len)
- eina_strbuf_append_n(diffbuf, curlocater,
+ eina_strbuf_append_n(diffbuf, curlocater,
replocater-curlocater);
else
insertflag = 1;
eina_strbuf_reset(repbuf);
}
else
- insertflag = 1;
+ insertflag = 1;
}
-
+
if (!repbuf) repbuf = eina_strbuf_new();
if (!diffbuf) diffbuf = eina_strbuf_new();
-
+
if (insertflag)
{
eina_strbuf_append_printf(repbuf, "<%s=%s>", key, value);
if (repbuf) eina_strbuf_free(repbuf);
if (diffbuf) eina_strbuf_free(diffbuf);
-
- return 0;
+
+ return 0;
}
static int
_stringshare_key_value_replace(const char **srcstring, const char *key, const char *value, int deleteflag)
{
- Eina_Strbuf *sharebuf = NULL;
-
+ Eina_Strbuf *sharebuf = NULL;
+
sharebuf = eina_strbuf_new();
eina_strbuf_append(sharebuf, *srcstring);
_strbuf_key_value_replace(sharebuf, key, value, deleteflag);
if ((wd->wrap_w > 0) && (wd->wrap_w < w))
{
Evas_Coord minw, minh;
-
+
edje_object_size_min_calc(wd->lbl, &minw, &minh);
if (minw < wd->wrap_w) return 0; // min insufficient
else return 1;
{
if (((x >= 0) || (y >= 0)) && (h > wd->wrap_h)) return 1;
}
-
+
return 0;
}
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return EINA_FALSE;
const char *ellipsis_string = "...";
- int mincount = sizeof(ellipsis_string) - 1;
+ int mincount = sizeof(ellipsis_string) - 1;
Evas_Coord w, h;
Evas_Textblock_Cursor *tc1, *tc2;
char *cutstr, *elstr;
{
Evas_Coord cx, cy, cw, ch;
int eolpos = evas_textblock_cursor_paragraph_text_length_get(tc1);
-
+
for (i = eolpos; i > mincount; i--)
{
evas_textblock_cursor_pos_set(tc2, i);
for (i = 0; i <= mincount; i++) evas_textblock_cursor_char_prev(tc2);
cutstr = evas_textblock_cursor_range_text_get(tc1, tc2, EVAS_TEXTBLOCK_TEXT_PLAIN);
if (!cutstr) return EINA_FALSE;
-
+
lencutstr = strlen(cutstr);
elstr = alloca(sizeof(char) * (lencutstr + mincount + 1));
strcpy(elstr, cutstr);
evas_textblock_cursor_free(tc1);
evas_textblock_cursor_free(tc2);
-
+
return EINA_TRUE;
}
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return EINA_FALSE;
const char *ellipsis_string = "...";
- int mincount = sizeof(ellipsis_string) - 1;
+ int mincount = sizeof(ellipsis_string) - 1;
Evas_Coord w, h;
Evas_Textblock_Cursor *tc1, *tc2;
int linenum = 0, cutline = 0;
tc2 = evas_object_textblock_cursor_new((Evas_Object *)edje_object_part_object_get(wd->lbl, "elm.text"));
// goto last paragraph
while (evas_textblock_cursor_paragraph_next(tc2) == EINA_TRUE);
-
+
evas_textblock_cursor_paragraph_last(tc2);
// get total linenumber
linenum = evas_textblock_cursor_line_geometry_get(tc2, NULL, NULL, NULL, NULL);
else limith = h;
cutline = limith / lineheight;
if (cutline < 1) cutline = 1;
-
+
evas_textblock_cursor_pos_set(tc1, 0);
evas_textblock_cursor_line_set(tc2, cutline - 1);
evas_textblock_cursor_line_char_last(tc2);
for (i = 0; i <= mincount; i++) evas_textblock_cursor_char_prev(tc2);
cutstr = evas_textblock_cursor_range_text_get(tc1, tc2, EVAS_TEXTBLOCK_TEXT_PLAIN);
if (!cutstr) return EINA_FALSE;
-
+
lencutstr = strlen(cutstr);
elstr = alloca(sizeof(char) * (lencutstr + mincount + 1));
strcpy(elstr, cutstr);
else cur_fontsize = 1;
if (minfontsize > maxfontsize || cur_fontsize == 1) return; // theme is not ready for ellipsis
if (eina_stringshare_strlen(wd->label) <= 0) return;
-
+
if (_get_value_in_key_string(wd->label, "font_size", &kvalue) == 0)
{
if (kvalue != NULL) cur_fontsize = atoi(kvalue);
}
-
+
while (_is_width_over(obj, multiline))
{
if (cur_fontsize > minfontsize)
if (!wd) return;
char *plaintxt;
int plainlen = 0;
-
+
// dosen't support multiline sliding effect
if (wd->linewrap)
- {
+ {
wd->slidingmode = EINA_FALSE;
return;
}
if (wd->slidingmode)
{
Edje_Message_Float_Set *msg = alloca(sizeof(Edje_Message_Float_Set) + (sizeof(double)));
-
+
if (wd->ellipsis)
{
wd->slidingellipsis = EINA_TRUE;
elm_label_ellipsis_set(obj, EINA_FALSE);
}
-
+
msg->count = 1;
msg->val[0] = wd->slide_duration;
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "label");
elm_widget_type_set(obj, "label");
elm_widget_sub_object_add(parent, obj);
wd->bgcolor = EINA_FALSE;
wd->bg = evas_object_rectangle_add(e);
evas_object_color_set(wd->bg, 0, 0, 0, 0);
-
+
wd->linewrap = EINA_FALSE;
wd->ellipsis = EINA_FALSE;
wd->slidingmode = EINA_FALSE;
/**
* Set the font size on the label object.
- *
+ *
* NEVER use this. It is for hyper-special cases only. use styles instead. e.g.
* "big", "medium", "small" - or better name them by use:
* "title", "footnote", "quote" etc.
* "title", "footnote", "quote" etc.
*
* @param obj The label object
- * @param r Red property background color of The label object
- * @param g Green property background color of The label object
- * @param b Blue property background color of The label object
- * @param a Alpha property background alpha of The label object
+ * @param r Red property background color of The label object
+ * @param g Green property background color of The label object
+ * @param b Blue property background color of The label object
+ * @param a Alpha property background alpha of The label object
*
* @ingroup Label
*/
if (!wd) return;
EINA_LIST_FREE(wd->subs, si)
{
- eina_stringshare_del(si->part);
+ eina_stringshare_del(si->part);
if (si->type == TEXT)
eina_stringshare_del(si->p.text.text);
- free(si);
+ free(si);
}
EINA_LIST_FREE(wd->parts_cursors, pc) _part_cursor_free(pc);
free(wd);
if (!wd) return;
if (wd->needs_size_calc)
{
- _sizing_eval(wd);
- wd->needs_size_calc = 0;
+ _sizing_eval(wd);
+ wd->needs_size_calc = 0;
}
}
}
return elm_widget_focus_list_next_get(obj, items, list_data_get, dir,
- next);
+ next);
}
static void
EINA_LIST_FOREACH(wd->parts_cursors, l, pc)
{
Evas_Object *obj = (Evas_Object *)edje_object_part_object_get
- (wd->lay, pc->part);
+ (wd->lay, pc->part);
if (!obj)
{
if (!wd) return;
EINA_LIST_FOREACH(wd->subs, l, si)
{
- if (si->obj == sub)
- {
- evas_object_event_callback_del_full(sub,
- EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints,
- wd);
- wd->subs = eina_list_remove_list(wd->subs, l);
- eina_stringshare_del(si->part);
- free(si);
- break;
- }
+ if (si->obj == sub)
+ {
+ evas_object_event_callback_del_full(sub,
+ EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints,
+ wd);
+ wd->subs = eina_list_remove_list(wd->subs, l);
+ eina_stringshare_del(si->part);
+ free(si);
+ break;
+ }
}
}
Widget_Data *wd;
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
-
+
ELM_SET_WIDTYPE(widtype, "layout");
elm_widget_type_set(obj, "layout");
elm_widget_sub_object_add(parent, obj);
elm_widget_resize_object_set(obj, wd->lay);
edje_object_signal_callback_add(wd->lay, "size,eval", "elm",
_signal_size_eval, wd);
-
+
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
_mirrored_set(obj, elm_widget_mirrored_get(obj));
if (!wd) return;
EINA_LIST_FOREACH(wd->subs, l, si)
{
- if ((si->type == SWALLOW) && (!strcmp(swallow, si->part)))
- {
- if (content == si->obj) return;
- evas_object_del(si->obj);
- break;
- }
+ if ((si->type == SWALLOW) && (!strcmp(swallow, si->part)))
+ {
+ if (content == si->obj) return;
+ evas_object_del(si->obj);
+ break;
+ }
}
if (content)
{
- elm_widget_sub_object_add(obj, content);
- evas_object_event_callback_add(content,
+ elm_widget_sub_object_add(obj, content);
+ evas_object_event_callback_add(content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, wd);
- if (!edje_object_part_swallow(wd->lay, swallow, content))
+ _changed_size_hints, wd);
+ if (!edje_object_part_swallow(wd->lay, swallow, content))
WRN("could not swallow %p into part '%s'", content, swallow);
- si = ELM_NEW(Subinfo);
+ si = ELM_NEW(Subinfo);
si->type = SWALLOW;
- si->part = eina_stringshare_add(swallow);
- si->obj = content;
- wd->subs = eina_list_append(wd->subs, si);
+ si->part = eina_stringshare_add(swallow);
+ si->obj = content;
+ wd->subs = eina_list_append(wd->subs, si);
}
_request_sizing_eval(wd);
}
if (!wd) return NULL;
EINA_LIST_FOREACH(wd->subs, l, si)
{
- if ((si->type == SWALLOW) && (!strcmp(swallow, si->part)))
- {
- Evas_Object *content;
- if (!si->obj) return NULL;
- content = si->obj; /* si will die in _sub_del due elm_widget_sub_object_del() */
- elm_widget_sub_object_del(obj, content);
- edje_object_part_unswallow(wd->lay, content);
- return content;
- }
+ if ((si->type == SWALLOW) && (!strcmp(swallow, si->part)))
+ {
+ Evas_Object *content;
+ if (!si->obj) return NULL;
+ content = si->obj; /* si will die in _sub_del due elm_widget_sub_object_del() */
+ elm_widget_sub_object_del(obj, content);
+ edje_object_part_unswallow(wd->lay, content);
+ return content;
+ }
}
return NULL;
}
WRN("child %p could not be appended to box part '%s'", child, part);
elm_widget_sub_object_add(obj, child);
evas_object_event_callback_add
- (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
+ (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
si = ELM_NEW(Subinfo);
si->type = BOX_APPEND;
WRN("child %p could not be prepended to box part '%s'", child, part);
elm_widget_sub_object_add(obj, child);
evas_object_event_callback_add
- (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
+ (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
si = ELM_NEW(Subinfo);
si->type = BOX_PREPEND;
elm_widget_sub_object_add(obj, child);
evas_object_event_callback_add
- (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
+ (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
evas_object_event_callback_add
- ((Evas_Object *)reference, EVAS_CALLBACK_DEL, _box_reference_del, si);
+ ((Evas_Object *)reference, EVAS_CALLBACK_DEL, _box_reference_del, si);
wd->subs = eina_list_append(wd->subs, si);
_request_sizing_eval(wd);
elm_widget_sub_object_add(obj, child);
evas_object_event_callback_add
- (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
+ (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
si = ELM_NEW(Subinfo);
si->type = BOX_INSERT_AT;
if (si->type == BOX_INSERT_BEFORE)
evas_object_event_callback_del_full
- ((Evas_Object *)si->p.box.reference,
- EVAS_CALLBACK_DEL, _box_reference_del, si);
+ ((Evas_Object *)si->p.box.reference,
+ EVAS_CALLBACK_DEL, _box_reference_del, si);
child = si->obj; /* si will die in _sub_del due elm_widget_sub_object_del() */
edje_object_part_box_remove(wd->lay, si->part, child);
elm_widget_sub_object_add(obj, child);
evas_object_event_callback_add
- (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
+ (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, wd);
si = ELM_NEW(Subinfo);
si->type = TABLE_PACK;
* Get the edje layout
*
* @param obj The layout object
- *
+ *
* This returns the edje object. It is not expected to be used to then swallow
- * objects via edje_object_part_swallow() for example. Use
+ * objects via edje_object_part_swallow() for example. Use
* elm_layout_content_set() instead so child object handling and sizing is
* done properly. This is more intended for setting text, emitting signals,
* hooking to signal callbacks etc.