egl: Fix compilation for EGL native

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).
This commit is contained in:
Damien Lespiau 2010-08-12 09:05:01 -04:00 committed by Damien Lespiau
parent 12a5bf2e06
commit af983faccd
3 changed files with 16 additions and 4 deletions

View 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"

View 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 ();

View 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;