[clutter] make some parts of the stage-window interface optional



commit d90c849e80b88c3dd00fa03b9b71b940001505b9
Author: Robert Bragg <robert linux intel com>
Date:   Wed May 11 19:59:52 2011 +0100

    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.

 clutter/clutter-stage-window.c    |   17 ++++++++++++-----
 clutter/cogl/clutter-stage-cogl.c |   29 -----------------------------
 2 files changed, 12 insertions(+), 34 deletions(-)
---
diff --git a/clutter/clutter-stage-window.c b/clutter/clutter-stage-window.c
index d4e2bb5..93d522a 100644
--- a/clutter/clutter-stage-window.c
+++ b/clutter/clutter-stage-window.c
@@ -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
diff --git a/clutter/cogl/clutter-stage-cogl.c b/clutter/cogl/clutter-stage-cogl.c
index 494909c..1e3fe29 100644
--- a/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/cogl/clutter-stage-cogl.c
@@ -179,32 +179,6 @@ clutter_stage_cogl_get_pending_swaps (ClutterStageWindow *stage_window)
 
 #ifndef COGL_HAS_XLIB_SUPPORT
 
-/* FIXME: Move this warnings up into clutter-stage.c */
-
-static void
-clutter_stage_cogl_set_fullscreen (ClutterStageWindow *stage_window,
-                                  gboolean            fullscreen)
-{
-  g_warning ("Stage of type '%s' do not support ClutterStage::set_fullscreen",
-             G_OBJECT_TYPE_NAME (stage_window));
-}
-
-static void
-clutter_stage_cogl_set_title (ClutterStageWindow *stage_window,
-                             const gchar        *title)
-{
-  g_warning ("Stage of type '%s' do not support ClutterStage::set_title",
-             G_OBJECT_TYPE_NAME (stage_window));
-}
-
-static void
-clutter_stage_cogl_set_cursor_visible (ClutterStageWindow *stage_window,
-                                      gboolean            cursor_visible)
-{
-  g_warning ("Stage of type '%s' do not support ClutterStage::set_cursor_visible",
-             G_OBJECT_TYPE_NAME (stage_window));
-}
-
 static ClutterActor *
 clutter_stage_cogl_get_wrapper (ClutterStageWindow *stage_window)
 {
@@ -583,9 +557,6 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
 
   iface->realize = clutter_stage_cogl_realize;
   iface->unrealize = clutter_stage_cogl_unrealize;
-  iface->set_fullscreen = clutter_stage_cogl_set_fullscreen;
-  iface->set_title = clutter_stage_cogl_set_title;
-  iface->set_cursor_visible = clutter_stage_cogl_set_cursor_visible;
   iface->get_wrapper = clutter_stage_cogl_get_wrapper;
   iface->get_geometry = clutter_stage_cogl_get_geometry;
   iface->resize = clutter_stage_cogl_resize;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]