Eina_Bool animate_supported : 1; /* set true when the focus highlight animate is supported by theme */
Eina_Bool geometry_changed : 1;
} focus_highlight;
+ struct
+ {
+ int preferred_rot; // specified by app
+ int *rots; // available rotations
+ unsigned int count; // number of elements in available rotations
+ Eina_Bool wm_supported : 1;
+ Eina_Bool use : 1;
+ } wm_rot;
Evas_Object *icon;
const char *title;
static const char SIG_PROFILE_CHANGED[] = "profile,changed";
static const char SIG_FOCUSED[] = "focused";
static const char SIG_UNFOCUSED[] = "unfocused";
+static const char SIG_WM_ROTATION_CHANGED[] = "wm,rotation,changed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_DELETE_REQUEST, ""},
{SIG_PROFILE_CHANGED, ""},
{SIG_FOCUSED, ""},
{SIG_UNFOCUSED, ""},
+ {SIG_WM_ROTATION_CHANGED, ""},
{NULL, NULL}
};
Evas *e,
Evas_Object *obj,
void *event_info);
+static void _elm_win_resize_objects_eval(Evas_Object *obj);
+#ifdef HAVE_ELEMENTARY_X
+static void _elm_win_xwin_update(Elm_Win_Smart_Data *sd);
+#endif
EAPI double _elm_startup_time = 0;
Eina_Bool ch_fullscreen = EINA_FALSE;
Eina_Bool ch_maximized = EINA_FALSE;
Eina_Bool ch_profile = EINA_FALSE;
+ Eina_Bool ch_wm_rotation = EINA_FALSE;
const char *profile;
EINA_SAFETY_ON_NULL_RETURN(sd);
+ ERR("win changed");
+
obj = sd->obj;
if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
sd->maximized = ecore_evas_maximized_get(sd->ee);
ch_maximized = EINA_TRUE;
}
+ ERR("sd->wm_rot.use=%d", sd->wm_rot.use);
+ if (sd->wm_rot.use)
+ {
+ ERR("sd->rot=%d ecore_evas_rotation_get(sd->ee)=%d", sd->rot, ecore_evas_rotation_get(sd->ee));
+ if (sd->rot != ecore_evas_rotation_get(sd->ee))
+ {
+ sd->rot = ecore_evas_rotation_get(sd->ee);
+ ch_wm_rotation = EINA_TRUE;
+ ERR("rotate %d", sd->rot);
+ }
+ }
profile = ecore_evas_window_profile_get(sd->ee);
{
_elm_win_profile_update(sd);
}
+ if (ch_wm_rotation)
+ {
+ evas_object_size_hint_min_set(obj, -1, -1);
+ evas_object_size_hint_max_set(obj, -1, -1);
+ _elm_win_resize_objects_eval(obj);
+#ifdef HAVE_ELEMENTARY_X
+ _elm_win_xwin_update(sd);
+#endif
+ elm_widget_orientation_set(obj, sd->rot);
+ evas_object_smart_callback_call(obj, SIG_ROTATION_CHANGED, NULL);
+ evas_object_smart_callback_call(obj, SIG_WM_ROTATION_CHANGED, NULL);
+ }
}
static void
if (sd->role) eina_stringshare_del(sd->role);
if (sd->icon) evas_object_del(sd->icon);
+ if (sd->wm_rot.rots) free(sd->wm_rot.rots);
+ sd->wm_rot.rots = NULL;
+
if (sd->main_menu) evas_object_del(sd->main_menu);
_elm_win_profile_del(sd);
edje_object_update_hints_set(sd->layout, EINA_TRUE);
evas_object_event_callback_add(sd->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_elm_win_on_resize_obj_changed_size_hints, obj);
+
+ sd->wm_rot.wm_supported = ecore_evas_wm_rotation_supported_get(sd->ee);
+ sd->wm_rot.preferred_rot = -1; // it means that elm_win doesn't use preferred rotation.
+
evas_object_show(sd->layout);
}
return ret;
}
+EAPI Eina_Bool
+elm_win_wm_rotation_supported_get(const Evas_Object *obj)
+{
+ ELM_WIN_CHECK(obj) EINA_FALSE;
+ ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ ERR("wm_supported=%d", sd->wm_rot.wm_supported);
+ return sd->wm_rot.wm_supported;
+}
+
+/* This will unset a preferred rotation, if given preferred rotation is '-1'.
+ */
+EAPI void
+elm_win_wm_rotation_preferred_rotation_set(Evas_Object *obj,
+ const int rotation)
+{
+ int rot;
+
+ ELM_WIN_CHECK(obj);
+ ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+
+ if (!sd->wm_rot.use)
+ sd->wm_rot.use = EINA_TRUE;
+
+ // '-1' means that elm_win doesn't use preferred rotation.
+ if (rotation == -1)
+ rot = -1;
+ else
+ rot = _win_rotation_degree_check(rotation);
+
+ if (sd->wm_rot.preferred_rot == rot) return;
+ sd->wm_rot.preferred_rot = rot;
+
+ ecore_evas_wm_rotation_preferred_rotation_set(sd->ee, rot);
+}
+
+EAPI int
+elm_win_wm_rotation_preferred_rotation_get(const Evas_Object *obj)
+{
+ ELM_WIN_CHECK(obj) -1;
+ ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
+ if (!sd->wm_rot.use) return -1;
+ return sd->wm_rot.preferred_rot;
+}
+
+EAPI void
+elm_win_wm_rotation_available_rotations_set(Evas_Object *obj,
+ const int *rotations,
+ unsigned int count)
+{
+ unsigned int i;
+ int r;
+
+ ELM_WIN_CHECK(obj);
+ ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+
+ if (!sd->wm_rot.use)
+ sd->wm_rot.use = EINA_TRUE;
+
+ if (sd->wm_rot.rots) free(sd->wm_rot.rots);
+
+ sd->wm_rot.rots = NULL;
+ sd->wm_rot.count = 0;
+
+ if (count > 0)
+ {
+ sd->wm_rot.rots = calloc(count, sizeof(int));
+ if (!sd->wm_rot.rots) return;
+ for (i = 0; i < count; i++)
+ {
+ r = _win_rotation_degree_check(rotations[i]);
+ sd->wm_rot.rots[i] = r;
+ }
+ }
+
+ sd->wm_rot.count = count;
+
+ ecore_evas_wm_rotation_available_rotations_set(sd->ee,
+ sd->wm_rot.rots,
+ sd->wm_rot.count);
+}
+
+EAPI Eina_Bool
+elm_win_wm_rotation_available_rotations_get(const Evas_Object *obj,
+ int **rotations,
+ unsigned int *count)
+{
+ ELM_WIN_CHECK(obj) EINA_FALSE;
+ ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ if (!sd->wm_rot.use) return EINA_FALSE;
+
+ if (sd->wm_rot.count > 0)
+ {
+ if ((rotations) && (*rotations))
+ {
+ *rotations = calloc(sd->wm_rot.count, sizeof(int));
+ if (*rotations)
+ {
+ memcpy(*rotations,
+ sd->wm_rot.rots,
+ sizeof(int) * sd->wm_rot.count);
+ }
+ }
+ }
+
+ if (count) *count = sd->wm_rot.count;
+
+ return EINA_TRUE;
+}
+
static void
_rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{