static void
_del_hook(Evas_Object *obj)
{
-
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
if (wd->label) eina_stringshare_del(wd->label);
if (wd->ontext) eina_stringshare_del(wd->ontext);
if (wd->offtext) eina_stringshare_del(wd->offtext);
static void
_disable_hook(Evas_Object *obj)
{
-
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
if (elm_widget_disabled_get(obj))
edje_object_signal_emit(wd->tgl, "elm,state,disabled", "elm");
else
static void
_theme_hook(Evas_Object *obj)
{
-
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
_elm_theme_set(wd->tgl, "toggle", "base", elm_widget_style_get(obj));
if (wd->icon)
edje_object_signal_emit(wd->tgl, "elm,state,icon,visible", "elm");
static void
_sizing_eval(Evas_Object *obj)
{
-
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord minw = -1, minh = -1;
+ if (!wd) return;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc(wd->tgl, &minw, &minh, minw, minh);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
static void
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
-
Widget_Data *wd = elm_widget_data_get(data);
+ if (!wd) return;
if (obj != wd->icon) return;
_sizing_eval(data);
}
static void
_sub_del(void *data, Evas_Object *obj, void *event_info)
{
-
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Object *sub = event_info;
-
+ if (!wd) return;
if (sub == wd->icon)
{
edje_object_signal_emit(wd->tgl, "elm,state,icon,hidden", "elm");
static void
_signal_toggle_off(void *data, Evas_Object *obj, const char *emission, const char *source)
{
-
Widget_Data *wd = elm_widget_data_get(data);
-
+ if (!wd) return;
wd->state = 0;
if (wd->statep) *wd->statep = wd->state;
evas_object_smart_callback_call(data, "changed", NULL);
static void
_signal_toggle_on(void *data, Evas_Object *obj, const char *emission, const char *source)
{
-
Widget_Data *wd = elm_widget_data_get(data);
-
+ if (!wd) return;
wd->state = 1;
if (wd->statep) *wd->statep = wd->state;
evas_object_smart_callback_call(data, "changed", NULL);
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
-
+ if (!wd) return;
if (wd->label) eina_stringshare_del(wd->label);
if (label)
{
_sizing_eval(obj);
}
-EAPI const char*
+EAPI const char *
elm_toggle_label_get(Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
-
if (!wd) return NULL;
return wd->label;
}
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
-
+ if (!wd) return;
if ((wd->icon != icon) && (wd->icon))
elm_widget_sub_object_del(obj, wd->icon);
wd->icon = icon;
EAPI Evas_Object *
elm_toggle_icon_get(Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
-
if (!wd) return NULL;
return wd->icon;
}
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
-
+ if (!wd) return;
if (wd->ontext) eina_stringshare_del(wd->ontext);
if (wd->offtext) eina_stringshare_del(wd->offtext);
if (onlabel) wd->ontext = eina_stringshare_add(onlabel);
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
-
+ if (!wd) return;
if (state != wd->state)
{
wd->state = state;
EAPI Eina_Bool
elm_toggle_state_get(const Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
-
+ if (!wd) return EINA_FALSE;
return wd->state;
}
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
-
+ if (!wd) return;
if (statep)
{
wd->statep = statep;
Evas_Object *obj = ecore_evas_object_associate_get(ee);
Elm_Win *win;
int x, y;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
+ if (!obj) return;
win = elm_widget_data_get(obj);
if (!win) return;
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
{
Evas_Object *obj = ecore_evas_object_associate_get(ee);
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
+ if (!obj) return;
win = elm_widget_data_get(obj);
if (!win) return;
if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
{
Evas_Object *obj = ecore_evas_object_associate_get(ee);
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
+ if (!obj) return;
win = elm_widget_data_get(obj);
if (!win) return;
/*NB: Why two different "focus signals" here ??? */
{
Evas_Object *obj = ecore_evas_object_associate_get(ee);
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
+ if (!obj) return;
win = elm_widget_data_get(obj);
if (!win) return;
evas_object_smart_callback_call(win->win_obj, "focus-out", NULL); // FIXME: remove me
{
Evas_Coord w, h;
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_title_set(Evas_Object *obj, const char *title)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_activate(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_lower(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_raise(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_borderless_set(Evas_Object *obj, Eina_Bool borderless)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_borderless_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
return ecore_evas_borderless_get(win->ee);
elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_shaped_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
return ecore_evas_shaped_get(win->ee);
elm_win_alpha_set(Evas_Object *obj, Eina_Bool alpha)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_alpha_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
return ecore_evas_alpha_get(win->ee);
elm_win_transparent_set(Evas_Object *obj, Eina_Bool transparent)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_transparent_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
elm_win_override_set(Evas_Object *obj, Eina_Bool override)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_override_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
return ecore_evas_override_get(win->ee);
elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_fullscreen_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
switch (_elm_config->engine)
elm_win_maximized_set(Evas_Object *obj, Eina_Bool maximized)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_maximized_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
return ecore_evas_maximized_get(win->ee);
elm_win_iconified_set(Evas_Object *obj, Eina_Bool iconified)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_iconified_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
return ecore_evas_iconified_get(win->ee);
elm_win_layer_set(Evas_Object *obj, int layer)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_layer_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return -1;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) -1;
win = elm_widget_data_get(obj);
if (!win) return -1;
return ecore_evas_layer_get(win->ee);
elm_win_rotation_set(Evas_Object *obj, int rotation)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_rotation_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return -1;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) -1;
win = elm_widget_data_get(obj);
if (!win) return -1;
return win->rot;
elm_win_sticky_set(Evas_Object *obj, Eina_Bool sticky)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_sticky_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
return ecore_evas_sticky_get(win->ee);
elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_screen_position_get(Evas_Object *obj, int *x, int *y)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_conformant_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
_elm_win_xwindow_get(win);
elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_quickpanel_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return EINA_FALSE;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
_elm_win_xwindow_get(win);
elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_quickpanel_priority_major_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return -1;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) -1;
win = elm_widget_data_get(obj);
if (!win) return -1;
_elm_win_xwindow_get(win);
elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
elm_win_quickpanel_priority_minor_get(Evas_Object *obj)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return -1;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) -1;
win = elm_widget_data_get(obj);
if (!win) return -1;
_elm_win_xwindow_get(win);
elm_win_quickpanel_zone_set(Evas_Object *obj, int zone)
{
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return;
ELM_CHECK_WIDTYPE(obj, widtype);
win = elm_widget_data_get(obj);
if (!win) return;
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _sub_del(void *data, Evas_Object *obj, void *event_info);
+static const char *widtype2 = NULL;
+
static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd;
Elm_Win *win;
- if (strcmp(elm_widget_type_get(obj), "win")) return NULL;
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
win = elm_widget_data_get(obj);
if (!win) return NULL;
wd = ELM_NEW(Widget_Data);
obj2 = elm_widget_add(win->evas);
elm_widget_type_set(obj2, "inwin");
+ ELM_SET_WIDTYPE(widtype2, "inwin");
elm_widget_sub_object_add(obj, obj2);
evas_object_size_hint_weight_set(obj2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(obj2, EVAS_HINT_FILL, EVAS_HINT_FILL);
EAPI void
elm_win_inwin_activate(Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype2);
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
evas_object_raise(obj);
evas_object_show(obj);
edje_object_signal_emit(wd->frm, "elm,action,show", "elm");
EAPI void
elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
+ ELM_CHECK_WIDTYPE(obj, widtype2);
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
if ((wd->content) && (wd->content != content))
elm_widget_sub_object_del(obj, wd->content);
wd->content = content;
{
Ecore_X_Window xwin = 0;
Ecore_Evas *ee = NULL;
-
+
+ if (!obj) return 0;
ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
if (ee) xwin = (Ecore_X_Window)ecore_evas_window_get(ee);
return xwin;