From: 이상진 <lsj119@samsung.com>

Patch for rotate with resize

(fixed formatting a bit)



SVN revision: 46046
This commit is contained in:
이상진 2010-02-10 14:35:07 +00:00 committed by Carsten Haitzler
parent 7fb7677794
commit fb352ec80f
6 changed files with 69 additions and 19 deletions

View File

@ -279,6 +279,7 @@ EAPI void ecore_evas_resize(Ecore_Evas *ee, int w, int h);
EAPI void ecore_evas_move_resize(Ecore_Evas *ee, int x, int y, int w, int h);
EAPI void ecore_evas_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
EAPI void ecore_evas_rotation_set(Ecore_Evas *ee, int rot);
EAPI void ecore_evas_rotation_with_resize_set(Ecore_Evas *ee, int rot);
EAPI int ecore_evas_rotation_get(const Ecore_Evas *ee);
EAPI void ecore_evas_shaped_set(Ecore_Evas *ee, int shaped);
EAPI int ecore_evas_shaped_get(const Ecore_Evas *ee);

View File

@ -1408,7 +1408,35 @@ ecore_evas_rotation_set(Ecore_Evas *ee, int rot)
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);

View File

@ -353,7 +353,7 @@ _ecore_evas_move_resize(Ecore_Evas *ee, int x __UNUSED__, int y __UNUSED__, int
}
static void
_ecore_evas_rotation_set(Ecore_Evas *ee, int rotation)
_ecore_evas_rotation_set(Ecore_Evas *ee, int rotation, int resize)
{
Evas_Engine_Info_FB *einfo;
int rot_dif;

View File

@ -157,7 +157,7 @@ struct _Ecore_Evas_Engine_Func
void (*fn_managed_move) (Ecore_Evas *ee, int x, int y);
void (*fn_resize) (Ecore_Evas *ee, int w, int h);
void (*fn_move_resize) (Ecore_Evas *ee, int x, int y, int w, int h);
void (*fn_rotation_set) (Ecore_Evas *ee, int rot);
void (*fn_rotation_set) (Ecore_Evas *ee, int rot, int resize);
void (*fn_shaped_set) (Ecore_Evas *ee, int shaped);
void (*fn_show) (Ecore_Evas *ee);
void (*fn_hide) (Ecore_Evas *ee);

View File

@ -530,7 +530,7 @@ _ecore_evas_win32_rotation_set_internal(Ecore_Evas *ee, int rotation)
}
static void
_ecore_evas_win32_rotation_set(Ecore_Evas *ee, int rotation)
_ecore_evas_win32_rotation_set(Ecore_Evas *ee, int rotation, int resize)
{
INF("ecore evas rotation: %s", rotation ? "yes" : "no");

View File

@ -1311,7 +1311,7 @@ _ecore_evas_x_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
}
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;
@ -1324,18 +1324,39 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int rotation,
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;
}
else
{
int w, h;
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);
@ -1347,7 +1368,7 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int rotation,
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);
@ -1376,7 +1397,7 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int rotation,
}
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;
@ -1390,7 +1411,7 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation)
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"))
@ -1402,7 +1423,7 @@ _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation)
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 */
}
}