Ecore_Evas: introduce ecore_evas_screen_geometry_get()

This common interface allows engines to provide whole screen
information to users.

Right now just X is implemented and it queries the size of the default
screen. I hope this is fine.



SVN revision: 59761
This commit is contained in:
Gustavo Sverzut Barbieri 2011-05-27 19:31:11 +00:00
parent 7233dba9d8
commit 89971de866
11 changed files with 58 additions and 7 deletions

View File

@ -198,3 +198,7 @@
(_ecore_main_loop_iterate_internal). This fixes fd handler pending
issue when ecore_idler callback adds ecore_job/event.
* Ecore ecore_main.c: Refactoring _ecore_main_loop_iterate_internal().
2011-05-27 Gustavo Sverzut Barbieri (k-s)
* Ecore_Evas: introduce ecore_evas_screen_geometry_get()

View File

@ -350,6 +350,8 @@ EAPI Eina_Bool ecore_evas_comp_sync_get(const Ecore_Evas *ee);
EAPI Ecore_Window ecore_evas_window_get(const Ecore_Evas *ee);
EAPI void ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
EAPI Eina_Bool ecore_evas_object_associate(Ecore_Evas *ee, Evas_Object *obj, Ecore_Evas_Object_Associate_Flags flags);
EAPI Eina_Bool ecore_evas_object_dissociate(Ecore_Evas *ee, Evas_Object *obj);
EAPI Evas_Object *ecore_evas_object_associate_get(const Ecore_Evas *ee);

View File

@ -2675,6 +2675,35 @@ ecore_evas_window_get(const Ecore_Evas *ee)
return ee->prop.window;
}
/**
* Get whole screen geometry associated with this Ecore_Evas.
*
* @param ee The Ecore_Evas whose window's to query container screen geometry.
* @param x where to return the horizontal offset value. May be NULL.
* @param y where to return the vertical offset value. May be NULL.
* @param w where to return the width value. May be NULL.
* @param h where to return the height value. May be NULL.
*
* @since 1.1
*/
EAPI void
ecore_evas_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h)
{
if (x) *x = 0;
if (y) *y = 0;
if (w) *w = 0;
if (h) *h = 0;
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"ecore_evas_screen_geometry_get");
return;
}
IFC(ee, fn_screen_geometry_get) (ee, x, y, w, h);
IFE;
}
/* fps debug calls - for debugging how much time your app actually spends */
/* rendering graphics... :) */

View File

@ -491,7 +491,8 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
NULL,
NULL, //transparent
NULL // render
NULL, // render
NULL // screen_geometry_get
};
#endif

View File

@ -486,7 +486,8 @@ static Ecore_Evas_Engine_Func _ecore_directfb_engine_func =
NULL, /* alpha */
NULL, //transparent
NULL // render
NULL, // render
NULL // screen_geometry_get
};
#endif

View File

@ -572,7 +572,8 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
NULL,
NULL, //transparent
NULL // render
NULL, // render
NULL // screen_geometry_get
};
#endif

View File

@ -186,6 +186,7 @@ struct _Ecore_Evas_Engine_Func
void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
int (*fn_render) (Ecore_Evas *ee);
void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
};
struct _Ecore_Evas_Engine

View File

@ -333,7 +333,8 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
NULL,
NULL, //transparent
NULL // render
NULL, // render
NULL screen_geometry_get
};
static Ecore_Evas*

View File

@ -925,7 +925,8 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
NULL, /* _ecore_evas_x_alpha_set */
NULL, //transparent
NULL // render
NULL, // render
NULL //screen_geometry_get
};
#endif /* BUILD_ECORE_EVAS_WIN32 */

View File

@ -721,7 +721,8 @@ static Ecore_Evas_Engine_Func _ecore_wince_engine_func =
NULL, /* _ecore_evas_x_alpha_set */
NULL, //transparent
NULL // render
NULL, // render
NULL // screen_geometry_get
};
/* API */

View File

@ -2912,6 +2912,14 @@ _ecore_evas_x_avoid_damage_set(Ecore_Evas *ee, int on)
}
}
static void
_ecore_evas_x_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h)
{
if (x) *x = 0;
if (y) *y = 0;
ecore_x_screen_size_get(ecore_x_default_screen_get(), w, h);
}
int
_ecore_evas_x_shutdown(void)
{
@ -2980,7 +2988,8 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
_ecore_evas_x_alpha_set,
_ecore_evas_x_transparent_set,
NULL // render
NULL, // render
_ecore_evas_x_screen_geometry_get
};
#endif /* BUILD_ECORE_EVAS_X11 */