rot = rot % 360;
while (rot < 0) rot += 360;
while (rot >= 360) rot -= 360;
- IFC(ee, fn_rotation_set) (ee, rot);
+ IFC(ee, fn_rotation_set) (ee, rot, 0);
+ /* make sure everything gets redrawn */
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
+ IFE;
+}
+
+/**
+ * Set the rotation of an Ecore_Evas' window
+ *
+ * @param ee The Ecore_Evas
+ * @param rot the angle (in degrees) of rotation.
+ *
+ * The allowed values of @p rot depend on the engine being used. Most only
+ * allow multiples of 90.
+ */
+EAPI void
+ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_rotation_set");
+ return;
+ }
+ rot = rot % 360;
+ while (rot < 0) rot += 360;
+ while (rot >= 360) rot -= 360;
+ IFC(ee, fn_rotation_set) (ee, rot, 1);
/* make sure everything gets redrawn */
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
}
static void
-_ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int rotation,
+_ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int rotation, int resize,
Evas_Engine_Info *einfo)
{
int rot_dif;
int minw, minh, maxw, maxh, basew, baseh, stepw, steph;
evas_engine_info_set(ee->evas, einfo);
- if (!ee->prop.fullscreen)
- {
- ecore_x_window_resize(ee->prop.window, ee->h, ee->w);
- ee->expecting_resize.w = ee->h;
- ee->expecting_resize.h = ee->w;
- }
+
+ if (!resize)
+ {
+ if (!ee->prop.fullscreen)
+ {
+ ecore_x_window_resize(ee->prop.window, ee->h, ee->w);
+ ee->expecting_resize.w = ee->h;
+ ee->expecting_resize.h = ee->w;
+ }
+ else
+ {
+ int w, h;
+
+ ecore_x_window_size_get(ee->prop.window, &w, &h);
+ ecore_x_window_resize(ee->prop.window, h, w);
+ if ((rotation == 0) || (rotation == 180))
+ {
+ evas_output_size_set(ee->evas, ee->w, ee->h);
+ evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
+ }
+ else
+ {
+ evas_output_size_set(ee->evas, ee->h, ee->w);
+ evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
+ }
+ if (ee->func.fn_resize) ee->func.fn_resize(ee);
+ }
+ }
else
- {
+ {
int w, h;
-
+
ecore_x_window_size_get(ee->prop.window, &w, &h);
- ecore_x_window_resize(ee->prop.window, h, w);
if ((rotation == 0) || (rotation == 180))
{
evas_output_size_set(ee->evas, ee->w, ee->h);
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
}
if (ee->func.fn_resize) ee->func.fn_resize(ee);
- }
+ }
ecore_evas_size_min_get(ee, &minw, &minh);
ecore_evas_size_max_get(ee, &maxw, &maxh);
ecore_evas_size_base_get(ee, &basew, &baseh);
}
static void
-_ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation)
+_ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize)
{
if (ee->rotation == rotation) return;
if (!strcmp(ee->driver, "opengl_x11")) return;
if (!einfo) return;
einfo->info.rotation = rotation;
_ecore_evas_x_rotation_set_internal
- (ee, rotation, (Evas_Engine_Info *)einfo);
+ (ee, rotation, resize, (Evas_Engine_Info *)einfo);
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
}
else if (!strcmp(ee->driver, "software_16_x11"))
if (!einfo) return;
einfo->info.rotation = rotation;
_ecore_evas_x_rotation_set_internal
- (ee, rotation, (Evas_Engine_Info *)einfo);
+ (ee, rotation, resize, (Evas_Engine_Info *)einfo);
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
}
}