EAPI void e_obj_dialog_show(E_Obj_Dialog *od) { Evas_Coord w, h, mw, mh; const char *s; E_OBJECT_CHECK(od); E_OBJECT_TYPE_CHECK(od, E_OBJ_DIALOG_TYPE); edje_object_size_min_get(od->bg_object, &mw, &mh); edje_object_size_min_restricted_calc(od->bg_object, &mw, &mh, mw, mh); evas_object_resize(od->bg_object, mw, mh); e_win_resize(od->win, mw, mh); e_win_size_min_set(od->win, mw, mh); edje_object_size_max_get(od->bg_object, &w, &h); if ((w > 0) && (h > 0)) { if (w < mw) w = mw; if (h < mh) h = mh; e_win_size_max_set(od->win, w, h); } s = edje_object_data_get(od->bg_object, "borderless"); if (s && (!strcmp(s, "1"))) e_win_borderless_set(od->win, 1); s = edje_object_data_get(od->bg_object, "shaped"); if (s && (!strcmp(s, "1"))) e_win_shaped_set(od->win, 1); e_win_show(od->win); }
void on_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Object *object = (Evas_Object*)data; int col, row; char buf[5]; col = atoi(edje_object_data_get(object, "col")); row = atoi(edje_object_data_get(object, "row")); if(mouse_down == EINA_TRUE) { snprintf(buf, 5, ",%dx%d", col, row); eina_strbuf_append(password, buf); printf(_("Password is '%s'\n"), eina_strbuf_string_get(password)); } printf(_("Mouse in on %dx%d\n"), col, row); }
static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; _elm_widget_mirrored_reload(obj); if (wd->scr) { Evas_Object *edj; const char *str; _mirrored_set(obj, elm_widget_mirrored_get(obj)); elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", elm_widget_style_get(obj)); // scale = (elm_widget_scale_get(obj) * _elm_config->scale); // edje_object_scale_set(wd->scr, scale); edj = elm_smart_scroller_edje_object_get(wd->scr); str = edje_object_data_get(edj, "focus_highlight"); if ((str) && (!strcmp(str, "on"))) elm_widget_highlight_in_theme_set(obj, EINA_TRUE); else elm_widget_highlight_in_theme_set(obj, EINA_FALSE); } _sizing_eval(obj); }
void on_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Object *object = (Evas_Object*)data; int col, row; col = atoi(edje_object_data_get(object, "col")); row = atoi(edje_object_data_get(object, "row")); mouse_down=EINA_FALSE; printf(_("Mouse up on %dx%d\n"), col, row); printf(_("Final password is '%s'\n"), eina_strbuf_string_get(password)); if(strcmp(stored_password, eina_strbuf_string_get(password)) == 0) { printf("Passwords match!\n"); exit(0); } }
void eyelight_viewer_slideshow_start(Eyelight_Viewer* pres,int select) { Evas_Object *o; int w_win, h_win; const char* data; evas_output_viewport_get(pres->evas, NULL, NULL, &w_win, &h_win); pres->state = EYELIGHT_VIEWER_STATE_SLIDESHOW; pres->slideshow_current = select; o = edje_object_add(pres->evas); pres->slideshow_background = o; if(edje_object_file_set(o, pres->theme, "eyelight/slideshow") == 0) WARN("eyelight_viewer_slideshow_start(), edje_object_file_set() erreur!"); data = edje_object_data_get(o, "nb_slides"); pres->slideshow_nb_slides = atoi(data); evas_object_show(o); evas_object_resize(o, pres->current_size_w, pres->current_size_h); edje_object_scale_set(o, pres->current_scale); evas_object_smart_member_add(o, pres->smart_obj); evas_object_move(o, pres->current_pos_x, pres->current_pos_y); evas_object_clip_set(o, pres->current_clip); edje_object_signal_callback_add(o,"slideshow,slide,next","eyelight",_eyelight_viewer_slideshow_next_cb,pres); edje_object_signal_callback_add(o,"slideshow,slide,previous","eyelight",_eyelight_viewer_slideshow_previous_cb,pres); edje_object_signal_callback_add(o,"slideshow,next,end","eyelight",_eyelight_viewer_slideshow_next_end_cb,pres); edje_object_signal_callback_add(o,"slideshow,previous,end","eyelight",_eyelight_viewer_slideshow_previous_end_cb,pres); _eyelight_viewer_slideshow_slides_load(pres); edje_object_signal_emit(pres->slideshow_background, "show","eyelight"); }
EAPI void e_popup_edje_bg_object_set(E_Popup *pop, Evas_Object *o) { const char *shape_option; E_OBJECT_CHECK(pop); E_OBJECT_TYPE_CHECK(pop, E_POPUP_TYPE); shape_option = edje_object_data_get(o, "shaped"); if (shape_option) { if (!strcmp(shape_option, "1")) pop->shaped = 1; else pop->shaped = 0; if (e_config->use_composite) { ecore_evas_alpha_set(pop->ecore_evas, pop->shaped); eina_hash_del(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop); pop->evas_win = ecore_evas_software_x11_window_get(pop->ecore_evas); eina_hash_add(_e_popup_hash, e_util_winid_str_get(pop->evas_win), pop); e_container_window_raise(pop->zone->container, pop->evas_win, pop->layer); } else ecore_evas_shaped_set(pop->ecore_evas, pop->shaped); } }
void on_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Object *object = (Evas_Object*)data; int col, row; char buf[4]; if(password) eina_strbuf_reset(password); else password = eina_strbuf_new(); col = atoi(edje_object_data_get(object, "col")); row = atoi(edje_object_data_get(object, "row")); snprintf(buf, 4, "%dx%d", col, row); eina_strbuf_append(password, buf); mouse_down=EINA_TRUE; printf(_("Mouse down on %dx%d\n"), col, row); printf(_("Password is '%s'\n"), eina_strbuf_string_get(password)); }
void Widget::applyCursor() { const char *file; Evas_Coord x, y; String theme = edjeThemeRecursive(); if (!theme.isNull()) file = edjeThemeRecursive().utf8().data(); m_data->m_cursorObject = edje_object_add(evas()); if (!edje_object_file_set(m_data->m_cursorObject, file, m_data->m_cursorGroup.utf8().data())) { evas_object_del(m_data->m_cursorObject); m_data->m_cursorObject = 0; ecore_evas_object_cursor_set(ecoreEvas(), 0, 0, 0, 0); applyFallbackCursor(); } else { Evas_Coord w, h; const char *d; edje_object_size_min_get(m_data->m_cursorObject, &w, &h); if ((w <= 0) || (h <= 0)) edje_object_size_min_calc(m_data->m_cursorObject, &w, &h); if ((w <= 0) || (h <= 0)) w = h = 16; evas_object_resize(m_data->m_cursorObject, w, h); d = edje_object_data_get(m_data->m_cursorObject, "hot.x"); x = d ? atoi(d) : 0; d = edje_object_data_get(m_data->m_cursorObject, "hot.y"); y = d ? atoi(d) : 0; ecore_evas_object_cursor_set(ecoreEvas(), m_data->m_cursorObject, EVAS_LAYER_MAX, x, y); } }
/** * Sets the theme group to be used by the editable object. * This function has to be called, or the cursor and the selection won't be * visible. * * @param editable an editable object * @param category the theme category to use for the editable object * @param group the theme group to use for the editable object */ EAPI void e_editable_theme_set(Evas_Object *editable, const char *category, const char *group) { E_Editable_Smart_Data *sd; char *obj_group; const char *data; if (evas_object_smart_smart_get(editable) != _e_editable_smart) SMARTERRNR(); if ((!editable) || (!(sd = evas_object_smart_data_get(editable)))) return; if ((!category) || (!group)) return; obj_group = alloca(strlen(group) + strlen("/selection") + 1); /* Gets the theme for the text object */ sprintf(obj_group, "%s/text", group); e_theme_edje_object_set(sd->text_object, category, obj_group); sd->average_char_w = -1; sd->average_char_h = -1; /* Gets the theme for the cursor */ sprintf(obj_group, "%s/cursor", group); e_theme_edje_object_set(sd->cursor_object, category, obj_group); edje_object_size_min_get(sd->cursor_object, &sd->cursor_width, NULL); if (sd->cursor_width < 1) sd->cursor_width = 1; /* Gets the theme for the selection */ sprintf(obj_group, "%s/selection", group); e_theme_edje_object_set(sd->selection_object, category, obj_group); data = edje_object_data_get(sd->selection_object, "on_foreground"); if ((data) && (strcmp(data, "1") == 0)) { sd->selection_on_fg = 1; evas_object_stack_above(sd->selection_object, sd->text_object); } else { sd->selection_on_fg = 0; evas_object_stack_below(sd->selection_object, sd->text_object); } _e_editable_text_update(editable); _e_editable_cursor_update(editable); }
void eyelight_viewer_tableofcontents_start(Eyelight_Viewer* pres,int select) { Evas_Object *o; int w_win, h_win; const char* data; evas_output_viewport_get(pres->evas, NULL, NULL, &w_win, &h_win); pres->state = EYELIGHT_VIEWER_STATE_TABLEOFCONTENTS; pres->tableofcontents_current = select; o = edje_object_add(pres->evas); pres->tableofcontents_background = o; if(edje_object_file_set(o, pres->theme, "eyelight/tableofcontents") == 0) { WARN("table of contents is not supported by the theme"); return ; } data = edje_object_data_get(o, "nb_slides"); pres->tableofcontents_nb_slides = atoi(data); evas_object_show(o); evas_object_resize(o, pres->current_size_w, pres->current_size_h); edje_object_scale_set(o, pres->current_scale); evas_object_move(o, pres->current_pos_x, pres->current_pos_y); evas_object_smart_member_add(o,pres->smart_obj); evas_object_clip_set(o, pres->current_clip); edje_object_signal_callback_add(o,"tableofcontents,slide,next","eyelight",_eyelight_viewer_tableofcontents_next_cb,pres); edje_object_signal_callback_add(o,"tableofcontents,slide,previous","eyelight",_eyelight_viewer_tableofcontents_previous_cb,pres); edje_object_signal_callback_add(o,"tableofcontents,next,end","eyelight",_eyelight_viewer_tableofcontents_next_end_cb,pres); edje_object_signal_callback_add(o,"tableofcontents,previous,end","eyelight",_eyelight_viewer_tableofcontents_previous_end_cb,pres); _eyelight_viewer_tableofcontents_slides_load(pres); edje_object_signal_emit(pres->tableofcontents_background, "show","eyelight"); }
static Eina_Bool _elm_fileselector_smart_theme(Evas_Object *obj) { const char *style; const char *data; char buf[1024]; ELM_FILESELECTOR_DATA_GET(obj, sd); if (!ELM_WIDGET_CLASS(_elm_fileselector_parent_sc)->theme(obj)) return EINA_FALSE; style = elm_widget_style_get(obj); _mirrored_set(obj, elm_widget_mirrored_get(obj)); data = edje_object_data_get (ELM_WIDGET_DATA(sd)->resize_obj, "path_separator"); if (data) sd->path_separator = data; else sd->path_separator = "/"; snprintf(buf, sizeof(buf), "fileselector/%s", style); #define SWALLOW(part_name, object_ptn) \ if (object_ptn) \ { \ elm_widget_style_set(object_ptn, buf); \ if (!elm_layout_content_set(obj, part_name, object_ptn)) \ evas_object_hide(object_ptn); \ } SWALLOW("elm.swallow.up", sd->up_button); SWALLOW("elm.swallow.home", sd->home_button); SWALLOW("elm.swallow.spinner", sd->spinner); elm_object_style_set(sd->spinner, "wheel"); if (sd->mode == ELM_FILESELECTOR_LIST) { if (elm_layout_content_set(obj, "elm.swallow.files", sd->files_list)) evas_object_hide(sd->files_grid); else evas_object_hide(sd->files_list); } else { if (elm_layout_content_set(obj, "elm.swallow.files", sd->files_grid)) evas_object_hide(sd->files_list); else evas_object_hide(sd->files_grid); } SWALLOW("elm.swallow.filename", sd->filename_entry); SWALLOW("elm.swallow.path", sd->path_entry); snprintf(buf, sizeof(buf), "fileselector/actions/%s", style); SWALLOW("elm.swallow.cancel", sd->cancel_button); SWALLOW("elm.swallow.ok", sd->ok_button); #undef SWALLOW edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj); elm_layout_sizing_eval(obj); return EINA_TRUE; }