} shot;
Eina_Bool autodel : 1;
int *autodel_clear, rot;
+ int show_count;
struct {
int x, y;
} screen;
static const char SIG_FOCUS_OUT[] = "focus,out";
static const char SIG_FOCUS_IN[] = "focus,in";
static const char SIG_MOVED[] = "moved";
+static const char SIG_THEME_CHANGED[] = "theme,changed";
static const Evas_Smart_Cb_Description _signals[] = {
{SIG_DELETE_REQUEST, ""},
sprintf(repname + (dotptr - tmp), "%03i",
win->shot.shot_counter + 1);
strcat(repname, dotptr);
+ free(tmp);
return repname;
}
}
if (!obj) return;
win = elm_widget_data_get(obj);
if (!win) return;
- if (!elm_widget_focus_get(win->win_obj))
+ _elm_widget_top_win_focused_set(win->win_obj, EINA_TRUE);
+ if (win->show_count == 1)
+ {
+ elm_object_focus_set(win->win_obj, EINA_TRUE);
+ win->show_count++;
+ }
+ else
elm_widget_focus_restore(win->win_obj);
evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_IN, NULL);
win->focus_highlight.cur.visible = EINA_TRUE;
win = elm_widget_data_get(obj);
if (!win) return;
elm_object_focus_set(win->win_obj, EINA_FALSE);
+ _elm_widget_top_win_focused_set(win->win_obj, EINA_FALSE);
evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_OUT, NULL);
win->focus_highlight.cur.visible = EINA_FALSE;
_elm_win_focus_highlight_reconfigure_job_start(win);
}
static void
-_elm_win_obj_callback_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+_elm_win_obj_callback_show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Elm_Win *win = data;
- elm_object_focus_set(obj, EINA_TRUE);
+ if (!win->show_count) win->show_count++;
if (win->shot.info) _shot_handle(win);
}
if (win->deferred_child_eval_job) ecore_job_del(win->deferred_child_eval_job);
if (win->shot.info) eina_stringshare_del(win->shot.info);
if (win->shot.timer) ecore_timer_del(win->shot.timer);
+ evas_object_event_callback_del_full(win->win_obj, EVAS_CALLBACK_DEL,
+ _elm_win_obj_callback_del, win);
while (((child = evas_object_bottom_get(win->evas))) &&
(child != obj))
{
int w, h;
win->deferred_resize_job = NULL;
- ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
+ ecore_evas_request_geometry_get(win->ee, NULL, NULL, &w, &h);
evas_object_resize(win->win_obj, w, h);
if (win->frame_obj)
{
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
- ENGINE_COMPARE(ELM_OPENGL_SDL))
+ ENGINE_COMPARE(ELM_OPENGL_SDL) ||
+ ENGINE_COMPARE(ELM_OPENGL_COCOA))
{
}
else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
}
}
+void
+_elm_win_translate(void)
+{
+ const Eina_List *l;
+ Evas_Object *obj;
+
+ EINA_LIST_FOREACH(_elm_win_list, l, obj)
+ elm_widget_translate(obj);
+}
+
#ifdef HAVE_ELEMENTARY_X
static Eina_Bool
_elm_win_client_message(void *data, int type __UNUSED__, void *event)
win = ELM_NEW(Elm_Win);
-#define FALLBACK_TRY(engine) \
- if (!win->ee) \
- do { \
- CRITICAL(engine " engine creation failed. Trying software X11."); \
- elm_engine_set(ELM_SOFTWARE_X11); \
- win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1); \
+#define FALLBACK_TRY(engine) \
+ if (!win->ee) \
+ do { \
+ CRITICAL(engine " engine creation failed. Trying default."); \
+ win->ee = ecore_evas_new(NULL, 0, 0, 1, 1, NULL); \
+ if (win->ee) \
+ elm_engine_set(ecore_evas_engine_name_get(win->ee)); \
} while (0)
#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
win->client_message_handler = ecore_event_handler_add
(ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
#endif
+ FALLBACK_TRY("Sofware X11");
}
else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
{
win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
FALLBACK_TRY("OpenGL SDL");
}
+ else if (ENGINE_COMPARE(ELM_OPENGL_COCOA))
+ {
+ win->ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
+ FALLBACK_TRY("OpenGL Cocoa");
+ }
else if (ENGINE_COMPARE(ELM_BUFFER))
{
win->ee = ecore_evas_buffer_new(1, 1);
}
+ else if (ENGINE_COMPARE(ELM_EWS))
+ {
+ win->ee = ecore_evas_ews_new(0, 0, 1, 1);
+ }
else if (!strncmp(_elm_config->engine, "shot:", 5))
{
win->ee = ecore_evas_buffer_new(1, 1);
return win->win_obj;
}
+EAPI Evas_Object *
+elm_win_util_standard_add(const char *name, const char *title)
+{
+ Evas_Object *win, *bg;
+
+ win = elm_win_add(NULL, name, ELM_WIN_BASIC);
+ if (!win) return NULL;
+ elm_win_title_set(win, title);
+ bg = elm_bg_add(win);
+ if (!bg)
+ {
+ evas_object_del(win);
+ return NULL;
+ }
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, bg);
+ evas_object_show(bg);
+ return win;
+}
+
EAPI void
elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj)
{
else if (win->img_obj)
{
evas_object_image_alpha_set(win->img_obj, alpha);
+ ecore_evas_alpha_set(win->ee, alpha);
}
else
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
win = elm_widget_data_get(obj);
if (!win) return EINA_FALSE;
+ if (win->frame_obj)
+ {
+ }
+ else if (win->img_obj)
+ {
+ return evas_object_image_alpha_get(win->img_obj);
+ }
return ecore_evas_alpha_get(win->ee);
}
if (wd->content)
edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->content);
_sizing_eval(obj);
+
+ evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
}
static Eina_Bool
if (!wd->content) return NULL;
Evas_Object *content = wd->content;
elm_widget_sub_object_del(obj, wd->content);
+ evas_object_event_callback_del_full(wd->content,
+ EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints, obj);
edje_object_part_unswallow(wd->frm, wd->content);
wd->content = NULL;
return content;
if (!obj) return 0;
type = elm_widget_type_get(obj);
- if (!type) return 0;
- if (type != widtype) return _elm_ee_win_get(obj);
+ if ((!type) || (type != widtype)) return _elm_ee_win_get(obj);
#ifdef HAVE_ELEMENTARY_X
win = elm_widget_data_get(obj);
if (!win) return 0;
if (win->parent) return elm_win_xwindow_get(win->parent);
#endif
return 0;
- win = NULL;
}