Exemplo n.º 1
0
EOLIAN static Eina_Bool
_elm_notify_elm_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd)
{
   Eina_Bool int_ret = EINA_FALSE;
   eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
   if (!int_ret) return EINA_FALSE;

   _mirrored_set(obj, elm_widget_mirrored_get(obj));

   _notify_theme_apply(obj);
   if (sd->block_events) _block_events_theme_apply(obj);

   edje_object_scale_set
     (sd->notify, elm_widget_scale_get(obj) * elm_config_scale_get());

   _sizing_eval(obj);

   return EINA_TRUE;
}
Exemplo n.º 2
0
Arquivo: elm_photo.c Projeto: tasn/efl
static void
_sizing_eval(Evas_Object *obj)
{
   Evas_Coord minw = 0, minh = 0, maxw = -1, maxh = -1;
   double scale;

   ELM_PHOTO_DATA_GET(obj, sd);
   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);

   if (sd->size <= 0) return;

   scale = (sd->size * efl_gfx_entity_scale_get(obj) * elm_config_scale_get());

   evas_object_size_hint_min_set(sd->icon, scale, scale);
   elm_coords_finger_size_adjust(1, &minw, 1, &minh);
   edje_object_size_min_restricted_calc
     (wd->resize_obj, &minw, &minh, minw, minh);
   maxw = minw;
   maxh = minh;
   evas_object_size_hint_min_set(obj, minw, minh);
   evas_object_size_hint_max_set(obj, maxw, maxh);
}
Exemplo n.º 3
0
static void
_elm_notify_smart_theme(Eo *obj, void *_pd, va_list *list)
{
   Elm_Notify_Smart_Data *sd = _pd;
   Eina_Bool *ret = va_arg(*list, Eina_Bool *);
   if (ret) *ret = EINA_FALSE;
   Eina_Bool int_ret = EINA_FALSE;

   eo_do_super(obj, MY_CLASS, elm_wdg_theme(&int_ret));
   if (!int_ret) return;

   _mirrored_set(obj, elm_widget_mirrored_get(obj));

   _notify_theme_apply(obj);
   if (sd->block_events) _block_events_theme_apply(obj);

   edje_object_scale_set
     (sd->notify, elm_widget_scale_get(obj) * elm_config_scale_get());

   _sizing_eval(obj);

   if (ret) *ret = EINA_TRUE;
}
Exemplo n.º 4
0
static Eina_Bool
_elm_photo_smart_theme(Evas_Object *obj)
{
   ELM_PHOTO_DATA_GET(obj, sd);

   if (!ELM_WIDGET_CLASS(_elm_photo_parent_sc)->theme(obj))
     return EINA_FALSE;

   edje_object_mirrored_set
     (ELM_WIDGET_DATA(sd)->resize_obj, elm_widget_mirrored_get(obj));

   elm_widget_theme_object_set
     (obj, ELM_WIDGET_DATA(sd)->resize_obj, "photo", "base",
     elm_widget_style_get(obj));

   elm_object_scale_set(sd->icon, elm_widget_scale_get(obj));

   edje_object_scale_set(ELM_WIDGET_DATA(sd)->resize_obj,
                         elm_widget_scale_get(obj) * elm_config_scale_get());
   _sizing_eval(obj);

   return EINA_TRUE;
}
Exemplo n.º 5
0
static void
_sizing_eval(Evas_Object *obj)
{
   Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
   double scale;

   ELM_PHOTO_DATA_GET(obj, sd);
   Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);

   if (sd->size <= 0) return;

   scale = (sd->size * elm_widget_scale_get(obj) * elm_config_scale_get());

   evas_object_size_hint_min_set(sd->icon, scale, scale);
   elm_coords_finger_size_adjust(1, &minw, 1, &minh);
   edje_object_size_min_restricted_calc
     (wd->resize_obj, &minw, &minh, minw, minh);
   elm_coords_finger_size_adjust(1, &minw, 1, &minh);
   maxw = minw;
   maxh = minh;
   evas_object_size_hint_min_set(obj, minw, minh);
   evas_object_size_hint_max_set(obj, maxw, maxh);
}
Exemplo n.º 6
0
Arquivo: elm_photo.c Projeto: tasn/efl
EOLIAN static Eina_Error
_elm_photo_efl_ui_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd)
{
   Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC;
   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);

   int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
   if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;

   edje_object_mirrored_set
     (wd->resize_obj, efl_ui_mirrored_get(obj));

   elm_widget_theme_object_set
     (obj, wd->resize_obj, "photo", "base",
     elm_widget_style_get(obj));

   elm_object_scale_set(sd->icon, efl_gfx_entity_scale_get(obj));

   edje_object_scale_set(wd->resize_obj,
                         efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
   _sizing_eval(obj);

   return int_ret;
}
Exemplo n.º 7
0
EOLIAN static Elm_Theme_Apply
_elm_photo_elm_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd)
{
   Elm_Theme_Apply int_ret = ELM_THEME_APPLY_FAILED;
   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);

   int_ret = elm_obj_widget_theme_apply(efl_super(obj, MY_CLASS));
   if (!int_ret) return ELM_THEME_APPLY_FAILED;

   edje_object_mirrored_set
     (wd->resize_obj, elm_widget_mirrored_get(obj));

   elm_widget_theme_object_set
     (obj, wd->resize_obj, "photo", "base",
     elm_widget_style_get(obj));

   elm_object_scale_set(sd->icon, elm_widget_scale_get(obj));

   edje_object_scale_set(wd->resize_obj,
                         elm_widget_scale_get(obj) * elm_config_scale_get());
   _sizing_eval(obj);

   return int_ret;
}
Exemplo n.º 8
0
Arquivo: em_gui.c Projeto: Limsik/e17
/* public functions */
EM_INTERN Eina_Bool
em_gui_init(void)
{
   Evas_Object *o, *oo;

   /* allocate our object */
   gui = EM_OBJECT_ALLOC(Em_Gui, EM_GUI_TYPE, _em_gui_cb_free);
   if (!gui) return EINA_FALSE;

   /* create window */
   gui->w_win = elm_win_add(NULL, "emote", ELM_WIN_BASIC);
   elm_win_title_set(gui->w_win, "Emote");
   elm_win_keyboard_mode_set(gui->w_win, ELM_WIN_KEYBOARD_ALPHA);
   evas_object_smart_callback_add(gui->w_win, "delete,request",
                                  _em_gui_cb_win_del, NULL);

   /* create background */
   o = elm_bg_add(gui->w_win);
   evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(gui->w_win, o);
   evas_object_show(o);

   o = elm_box_add(gui->w_win);
   elm_box_homogeneous_set(o, EINA_FALSE);
   elm_win_resize_object_add(gui->w_win, o);
   evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_box_align_set(o, 0.5, 0.5);
   evas_object_show(o);

   /* create main toolbar */
   gui->w_tb = elm_toolbar_add(gui->w_win);
   elm_toolbar_icon_size_set(gui->w_tb, (8 * elm_config_scale_get()));
   elm_toolbar_align_set(gui->w_tb, 1.0);
   elm_toolbar_shrink_mode_set(gui->w_tb, ELM_TOOLBAR_SHRINK_SCROLL);
   elm_toolbar_item_append(gui->w_tb, "preferences-system", _("Settings"),
                        _em_gui_cb_settings, NULL);
   elm_toolbar_item_append(gui->w_tb, "application-exit", _("Quit"),
                        _em_gui_cb_quit, NULL);
   evas_object_size_hint_weight_set(gui->w_tb, EVAS_HINT_EXPAND, 0.0);
   evas_object_size_hint_align_set(gui->w_tb, EVAS_HINT_FILL, 0.0);
   evas_object_show(gui->w_tb);
   elm_box_pack_start(o, gui->w_tb);

   /* create packing box */
   gui->w_box = elm_panes_add(gui->w_win);
   elm_panes_fixed_set(gui->w_box, EINA_FALSE);
   elm_panes_horizontal_set(gui->w_box, EINA_FALSE);
   elm_panes_content_left_size_set(gui->w_box, 0.20);
   evas_object_size_hint_weight_set(gui->w_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(gui->w_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_box_pack_end(o, gui->w_box);
   evas_object_show(gui->w_box);

   gui->w_chansel_itc = elm_genlist_item_class_new();
   gui->w_chansel_itc->item_style = "default";
   gui->w_chansel_itc->func.text_get = _em_gui_chansel_cb_label_get;
   gui->w_chansel_itc->func.content_get = NULL;
   gui->w_chansel_itc->func.state_get = NULL;
   gui->w_chansel_itc->func.del = NULL;

   /* create channel selector w/ frame */
   gui->w_chansel = elm_genlist_add(gui->w_win);
   elm_genlist_mode_set(gui->w_chansel, ELM_LIST_SCROLL);
   evas_object_size_hint_min_set(gui->w_chansel, 200, MIN_WIN_HEIGHT);
   evas_object_size_hint_weight_set(gui->w_chansel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(gui->w_chansel);

   o = elm_frame_add(gui->w_win);
   elm_object_part_text_set(o, "default", "Channels");
   oo = elm_frame_add(gui->w_win);
   elm_object_style_set(oo, "pad_small");
   elm_object_part_content_set(o, "default", oo);
   elm_object_part_content_set(oo, "default", gui->w_chansel);
   elm_object_part_content_set(gui->w_box, "left", o);
   evas_object_show(oo);
   evas_object_show(o);

   /* set min size of window and show it */
   evas_object_show(gui->w_win);
   evas_object_resize(gui->w_win, MIN_WIN_WIDTH, MIN_WIN_HEIGHT);

   gui->servers = eina_hash_string_small_new(_em_gui_server_del);

   return EINA_TRUE;
}