[pinpoint] clutter: Provide a default set/get_fullscreen on non X11 platforms



commit 7d15582081261b245439391cf52d08ad6991c73f
Author: Damien Lespiau <damien lespiau intel com>
Date:   Mon May 23 22:12:47 2011 +0100

    clutter: Provide a default set/get_fullscreen on non X11 platforms
    
    Default to clutter_stage_set/get_fullscreen when you can't abuse X11 and its
    window managers.

 configure.ac |    5 +++++
 pp-clutter.c |   24 +++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 35a168d..4a95bd5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,6 +14,11 @@ PINPOINT_DEPS="clutter-1.0 >= 1.4 gio-2.0 cairo-pdf pangocairo gdk-pixbuf-2.0"
 
 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [-Wall])
 
+# Do we have clutter compiled for x11?
+PKG_CHECK_EXISTS([clutter-x11-1.0],
+		 [AC_DEFINE([HAVE_CLUTTER_X11], [1],
+			    [Whether clutter is compiled for x11])])
+
 # PDF output support
 AC_ARG_ENABLE([pdf],
 	      [AS_HELP_STRING([--enable-pdf=@<:no/auto/yes:>@],
diff --git a/pp-clutter.c b/pp-clutter.c
index 2b72480..7fddf3a 100644
--- a/pp-clutter.c
+++ b/pp-clutter.c
@@ -21,8 +21,15 @@
  *             Emmanuele Bassi <ebassi linux intel com>
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "pinpoint.h"
+
+#if HAVE_CLUTTER_X11
 #include <clutter/x11/clutter-x11.h>
+#endif
 #include <gio/gio.h>
 #ifdef USE_CLUTTER_GST
 #include <clutter-gst/clutter-gst.h>
@@ -98,7 +105,7 @@ static gboolean key_pressed   (ClutterActor     *actor,
                                ClutterEvent     *event,
                                ClutterRenderer  *renderer);
 
-
+#ifdef HAVE_CLUTTER_X11
 static void pp_set_fullscreen (ClutterStage  *stage,
                                gboolean       fullscreen)
 {
@@ -158,6 +165,21 @@ static gboolean pp_get_fullscreen (ClutterStage *stage)
     return clutter_stage_get_fullscreen (stage);
   return pp_fullscreen;
 }
+#else
+
+static void
+pp_set_fullscreen (ClutterStage  *stage,
+                   gboolean       fullscreen)
+{
+  return clutter_stage_set_fullscreen (stage, fullscreen);
+}
+
+static gboolean
+pp_get_fullscreen (ClutterStage *stage)
+{
+  return clutter_stage_get_fullscreen (stage);
+}
+#endif
 
 static void
 _destroy_surface (gpointer data)



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