egl: Fix compilation for EGL native
authorDamien Lespiau <damien.lespiau@gmail.com>
Thu, 12 Aug 2010 13:05:01 +0000 (09:05 -0400)
committerDamien Lespiau <damien.lespiau@intel.com>
Fri, 3 Sep 2010 10:13:35 +0000 (11:13 +0100)
Some minor fixes here and there: missing include, wrongly placed #endif,
unused variable warning fixes, missing #ifdef.

Make ClutterStageEGL a subclass of either ClutterStageX11 or GObject
depending if you compile with X11 support (EGLX) or not (native).

clutter/cogl/cogl/cogl-material-glsl.c
clutter/egl/clutter-backend-egl.c
clutter/egl/clutter-stage-egl.h

index c41fd68..9f0f6fc 100644 (file)
@@ -38,6 +38,7 @@
 #include "cogl-internal.h"
 #include "cogl-context.h"
 #include "cogl-handle.h"
+#include "cogl-shader-private.h"
 
 #ifndef HAVE_COGL_GLES
 #include "cogl-program.h"
index 7c2d9e9..d5e8ad5 100644 (file)
@@ -765,7 +765,6 @@ static void
 _clutter_backend_egl_init (ClutterBackendEGL *backend_egl)
 {
 #ifndef COGL_HAS_XLIB_SUPPORT
-  ClutterBackend *backend = CLUTTER_BACKEND (backend_egl);
 
 #ifdef HAVE_TSLIB
   backend_egl->event_timer = g_timer_new ();
index a20f4ed..df8ebcf 100644 (file)
@@ -1,17 +1,23 @@
 #ifndef __CLUTTER_STAGE_EGL_H__
 #define __CLUTTER_STAGE_EGL_H__
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <glib-object.h>
 #include <clutter/clutter-stage.h>
 
+#ifdef COGL_HAS_X11_SUPPORT
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
 #include <X11/Xutil.h>
+#include "../x11/clutter-stage-x11.h"
+#endif
 
 #include "clutter-egl-headers.h"
 #include "clutter-backend-egl.h"
 
-#include "../x11/clutter-stage-x11.h"
 
 #define CLUTTER_TYPE_STAGE_EGL                  (_clutter_stage_egl_get_type ())
 #define CLUTTER_STAGE_EGL(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_EGL, ClutterStageEGL))
@@ -25,14 +31,16 @@ typedef struct _ClutterStageEGLClass    ClutterStageEGLClass;
 
 struct _ClutterStageEGL
 {
-  ClutterStageX11 parent_instance;
-
 #ifdef COGL_HAS_X11_SUPPORT
 
+  ClutterStageX11 parent_instance;
+
   EGLSurface egl_surface;
 
 #else
 
+  GObject parent_instance;
+
  /* the stage wrapper */
   ClutterStage      *wrapper;
 
@@ -44,7 +52,11 @@ struct _ClutterStageEGL
 
 struct _ClutterStageEGLClass
 {
+#ifdef COGL_HAS_X11_SUPPORT
   ClutterStageX11Class parent_class;
+#else
+  GObjectClass parent_class;
+#endif
 };
 
 GType _clutter_stage_egl_get_type (void) G_GNUC_CONST;