2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-backend.c: (clutter_backend_get_display_size): Provide a fallback for backends not implementing get_display_size(). * clutter/clutter-stage.c: (clutter_stage_allocate): Add debug messages. * clutter/sdl/clutter-backend-sdl.c: (clutter_backend_sdl_get_display_size), (clutter_backend_sdl_class_init): Implement get_display_size() on the SDL backend.
This commit is contained in:
@ -167,6 +167,32 @@ clutter_backend_sdl_get_features (ClutterBackend *backend)
|
||||
return CLUTTER_FEATURE_STAGE_CURSOR;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_backend_sdl_get_display_size (ClutterBackend *backend,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
SDL_Surface *surface;
|
||||
|
||||
surface = SDL_GetVideoSurface ();
|
||||
if (!surface)
|
||||
{
|
||||
if (width)
|
||||
*width = 0;
|
||||
|
||||
if (height)
|
||||
*height = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (width)
|
||||
*width = surface->w;
|
||||
|
||||
if (height)
|
||||
*height = surface->h;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_backend_sdl_class_init (ClutterBackendSDLClass *klass)
|
||||
{
|
||||
@ -177,13 +203,14 @@ clutter_backend_sdl_class_init (ClutterBackendSDLClass *klass)
|
||||
gobject_class->dispose = clutter_backend_sdl_dispose;
|
||||
gobject_class->finalize = clutter_backend_sdl_finalize;
|
||||
|
||||
backend_class->pre_parse = clutter_backend_sdl_pre_parse;
|
||||
backend_class->post_parse = clutter_backend_sdl_post_parse;
|
||||
backend_class->init_events = clutter_backend_sdl_init_events;
|
||||
backend_class->create_stage = clutter_backend_sdl_create_stage;
|
||||
backend_class->ensure_context = clutter_backend_sdl_ensure_context;
|
||||
backend_class->redraw = clutter_backend_sdl_redraw;
|
||||
backend_class->get_features = clutter_backend_sdl_get_features;
|
||||
backend_class->pre_parse = clutter_backend_sdl_pre_parse;
|
||||
backend_class->post_parse = clutter_backend_sdl_post_parse;
|
||||
backend_class->init_events = clutter_backend_sdl_init_events;
|
||||
backend_class->create_stage = clutter_backend_sdl_create_stage;
|
||||
backend_class->ensure_context = clutter_backend_sdl_ensure_context;
|
||||
backend_class->redraw = clutter_backend_sdl_redraw;
|
||||
backend_class->get_features = clutter_backend_sdl_get_features;
|
||||
backend_class->get_display_size = clutter_backend_sdl_get_display_size;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user