Ecore_Evas: dpi_get() for Windows (XP and CE)

SVN revision: 73537
This commit is contained in:
Vincent Torri 2012-07-10 16:13:26 +00:00
parent 3c0a939785
commit 229b07a3b9
2 changed files with 40 additions and 3 deletions

View File

@ -1023,6 +1023,24 @@ _ecore_evas_win32_alpha_set(Ecore_Evas *ee, int alpha)
}
}
static void
_ecore_evas_win32_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi)
{
HDC dc;
dc = GetDC(NULL);
if (!dc)
{
if (xdpi) *xdpi = 0;
if (ydpi) *ydpi = 0;
return;
}
if (xdpi) *xdpi = GetDeviceCaps(dc, LOGPIXELSX);
if (ydpi) *ydpi = GetDeviceCaps(dc, LOGPIXELSY);
ReleaseDC(NULL, dc);
}
static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
{
@ -1082,8 +1100,8 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
NULL,
NULL, // render
NULL, //screen_geometry_get
NULL // screen_dpi_get
NULL, // screen_geometry_get
_ecore_evas_win32_screen_dpi_get
};
#endif /* BUILD_ECORE_EVAS_WIN32 */

View File

@ -724,6 +724,25 @@ _ecore_evas_wince_fullscreen_set(Ecore_Evas *ee, int on)
}
}
static void
_ecore_evas_wince_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi)
{
HDC dc;
dc = GetDC(NULL);
if (!dc)
{
if (xdpi) *xdpi = 0;
if (ydpi) *ydpi = 0;
return;
}
if (xdpi) *xdpi = GetDeviceCaps(dc, LOGPIXELSX);
if (ydpi) *ydpi = GetDeviceCaps(dc, LOGPIXELSY);
ReleaseDC(NULL, dc);
}
static Ecore_Evas_Engine_Func _ecore_wince_engine_func =
{
_ecore_evas_wince_free,
@ -783,7 +802,7 @@ static Ecore_Evas_Engine_Func _ecore_wince_engine_func =
NULL, // render
NULL, // screen_geometry_get
NULL // screen_dpi_get
_ecore_evas_wince_screen_dpi_get
};
/* API */