make some parts of the stage-window interface optional

Some parts of the StageWindow interface aren't meaningful for all window
systems. This makes stage_window_set_title/fullscreen/cursor_visible
optional instead of requiring those window systems to implement empty
stubs. Notably the empty stubs we had in the Cogl backend (previously
the EGL backend) used g_warning to report the feature as unsupported and
that was causing conformance test failures.
This commit is contained in:
Robert Bragg
2011-05-11 19:59:52 +01:00
parent dd6392ba20
commit d90c849e80
2 changed files with 12 additions and 34 deletions

View File

@ -27,23 +27,30 @@ void
_clutter_stage_window_set_title (ClutterStageWindow *window,
const gchar *title)
{
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->set_title (window, title);
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->set_title)
iface->set_title (window, title);
}
void
_clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
gboolean is_fullscreen)
{
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->set_fullscreen (window,
is_fullscreen);
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->set_fullscreen)
iface->set_fullscreen (window, is_fullscreen);
}
void
_clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
gboolean is_visible)
{
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->set_cursor_visible (window,
is_visible);
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->set_cursor_visible)
iface->set_cursor_visible (window, is_visible);
}
void