INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/clutter \
- -I$(top_srcdir)/clutter/$(CLUTTER_WINSYS) \
- -I$(top_srcdir)/clutter/$(CLUTTER_WINSYS_BASE) \
-I$(top_srcdir)/clutter/deprecated \
-I$(top_srcdir)/clutter/cally \
-I$(top_builddir) \
pc_files += clutter-$(CLUTTER_API_VERSION).pc
+# in order to be compatible with Clutter < 1.10, when we shipped a single
+# shared library whose name was determined by the single backend it
+# supported, we need to install symbolic links so that existing applications
+# using Clutter won't break in the Brave New World of multi-backend support
+# in the same shared object.
+compat_libs =
+
# backends source listings
#
# backend_source_c := source code
clutterx11_includedir = $(clutter_includedir)/x11
clutterx11_include_HEADERS = $(x11_source_h)
+
+clutter-x11-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-x11-$(CLUTTER_API_VERSION).pc
endif # SUPPORT_X11
# Shared cogl backend files
cogl_source_c_priv =
+if USE_COGL
+backend_source_h += $(cogl_source_h)
+backend_source_c += $(cogl_source_c)
+backend_source_h_priv += $(cogl_source_h_priv)
+backend_source_c_priv += $(cogl_source_c_priv)
+
# pkg-config file for the cogl meta-backend
clutter-cogl-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
$(QUIET_GEN)cp -f $< $(@F)
pc_files += clutter-cogl-$(CLUTTER_API_VERSION).pc
+endif
-if SUPPORT_X11
-# For compatability with the old GLX backend
+# For compatibility with the old GLX backend
#
# Note: there wasn't actually anything GLX specific so we can add
-# the compatability if clutter supports x11
-backend_source_c += $(srcdir)/x11/clutter-glx-texture-pixmap.c
+# the compatibility if clutter supports x11
+glx_source_c = $(srcdir)/x11/clutter-glx-texture-pixmap.c
glx_source_h = $(srcdir)/x11/clutter-glx-texture-pixmap.h \
$(srcdir)/x11/clutter-glx.h
+
+if SUPPORT_X11
+backend_source_h += $(glx_source_h)
+backend_source_c += $(glx_source_c)
+
clutterglx_includedir = $(clutter_includedir)/glx
clutterglx_include_HEADERS = $(glx_source_h)
$(QUIET_GEN)cp -f $< $(@F)
pc_files += clutter-glx-$(CLUTTER_API_VERSION).pc
-endif
-if SUPPORT_GLX
-backend_source_h += $(cogl_source_h) $(glx_source_h)
-backend_source_c += $(cogl_source_c) $(glx_source_c)
-backend_source_h_priv += $(cogl_source_h_priv)
-endif # SUPPORT_GLX
+compat_libs += libclutter-glx-$(CLUTTER_API_VERSION).so.0
+endif
# GDK backend rules
gdk_source_c = \
$(NULL)
if SUPPORT_GDK
-backend_source_h += $(cogl_source_h) $(gdk_source_h)
-backend_source_c += $(cogl_source_c) $(gdk_source_c)
-backend_source_h_priv += $(cogl_source_h_priv) $(gdk_source_h_priv)
+backend_source_h += $(gdk_source_h)
+backend_source_c += $(gdk_source_c)
+backend_source_h_priv += $(gdk_source_h_priv)
cluttergdk_includedir = $(clutter_includedir)/gdk
cluttergdk_include_HEADERS = $(gdk_source_h)
+
+clutter-gdk-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-gdk-$(CLUTTER_API_VERSION).pc
+
+gdk_introspection = $(gdk_source_c) $(gdk_source_h)
endif # SUPPORT_GDK
# Windows backend rules
clutterwin_includedir = $(clutter_includedir)/win32
clutterwin_include_HEADERS = $(win32_source_h)
+
+clutter-win32-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-win32-$(CLUTTER_API_VERSION).pc
endif # SUPPORT_WIN32
EXTRA_DIST += \
backend_source_c_priv += $(egl_tslib_c)
endif # SUPPORT_TSLIB
-if SUPPORT_EVDEV
+if USE_EVDEV
backend_source_c_priv += $(evdev_c_priv)
backend_source_h_priv += $(evdev_h_priv)
endif # SUPPORT_EVDEV
if SUPPORT_CEX100
backend_source_h += $(cex_h)
+
+clutter-cex100-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-cex100-$(CLUTTER_API_VERSION).pc
+
+compat_libs += libclutter-cex100-$(CLUTTER_API_VERSION).so.0
endif # SUPPORT_CEX100
if SUPPORT_EGL
-backend_source_h += $(cogl_source_h) $(egl_source_h)
-backend_source_c += $(cogl_source_c)
-backend_source_h_priv += $(cogl_source_h_priv)
-backend_source_c_priv += $(cogl_source_c_priv)
+backend_source_h += $(egl_source_h)
clutteregl_includedir = $(clutter_includedir)/egl
clutteregl_include_HEADERS = $(egl_source_h)
+
+clutter-egl-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-egl-$(CLUTTER_API_VERSION).pc
endif # SUPPORT_EGL
# OSX backend rules
clutterosx_includedir = $(clutter_includedir)/osx
clutterosx_include_HEADERS = $(osx_source_h)
+
+clutter-osx-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-osx-$(CLUTTER_API_VERSION).pc
endif # SUPPORT_OSX
# Wayland backend rules
clutterwayland_includedir = $(clutter_includedir)/wayland
clutterwayland_include_HEADERS = $(wayland_source_h)
+
+clutter-wayland-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-wayland-$(CLUTTER_API_VERSION).pc
+
+compat_libs += libclutter-wayland-$(CLUTTER_API_VERSION).so.0
endif # SUPPORT_WAYLAND
# cally
glib_enum_headers = $(source_h) $(backend_source_h)
include $(top_srcdir)/build/autotools/Makefile.am.enums
-# backend-specific pkg-config file
-clutter-$(CLUTTER_WINSYS)-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
- $(QUIET_GEN)cp -f $< $(@F)
-
-pc_files += clutter-$(CLUTTER_WINSYS)-$(CLUTTER_API_VERSION).pc
-
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
DISTCLEANFILES += $(pc_files)
clutter_deprecated_HEADERS = $(deprecated_h)
-lib_LTLIBRARIES += libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
+lib_LTLIBRARIES += libclutter-@CLUTTER_API_VERSION@.la
-libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_LIBADD = \
+libclutter_@CLUTTER_API_VERSION@_la_LIBADD = \
-lm \
$(CLUTTER_LIBS) \
$(CLUTTER_PROFILE_LIBS)
-libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \
+libclutter_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \
$(win32_resources)
-libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_SOURCES = \
+libclutter_@CLUTTER_API_VERSION@_la_SOURCES = \
$(backend_source_c) \
$(backend_source_h) \
$(backend_source_c_priv) \
$(cally_sources_private) \
$(NULL)
-nodist_libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_SOURCES = \
+nodist_libclutter_@CLUTTER_API_VERSION@_la_SOURCES = \
$(backend_source_built) \
$(built_source_c) \
$(built_source_h)
-libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_LDFLAGS = \
+libclutter_@CLUTTER_API_VERSION@_la_LDFLAGS = \
$(CLUTTER_LINK_FLAGS) \
$(CLUTTER_LT_LDFLAGS) \
$(GCOV_LDFLAGS) \
$(win32_resources_ldflag) \
$(NULL)
+install-exec-local:
+ for lib in "$(compat_libs)"; do \
+ rm -f $(DESTDIR)$(libdir)/$$lib ; \
+ ln -s libclutter-$(CLUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $(DESTDIR)$(libdir)/$$lib ; \
+ done
+
# gobject-introspection rules
-include $(INTROSPECTION_MAKEFILE)
if HAVE_INTROSPECTION
-Clutter-@CLUTTER_API_VERSION@.gir: libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la Makefile
+Clutter-@CLUTTER_API_VERSION@.gir: libclutter-@CLUTTER_API_VERSION@.la Makefile
Clutter_@CLUTTER_API_VERSION_AM@_gir_NAMESPACE = Clutter
Clutter_@CLUTTER_API_VERSION_AM@_gir_VERSION = @CLUTTER_API_VERSION@
-Clutter_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
+Clutter_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_API_VERSION@.la
Clutter_@CLUTTER_API_VERSION_AM@_gir_FILES = \
$(clutter_include_HEADERS) \
$(clutter_deprecated_HEADERS) \
Cally_@CLUTTER_API_VERSION_AM@_gir_NAMESPACE = Cally
Cally_@CLUTTER_API_VERSION_AM@_gir_VERSION = @CLUTTER_API_VERSION@
-Cally_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
+Cally_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_API_VERSION@.la
Cally_@CLUTTER_API_VERSION_AM@_gir_FILES = $(cally_sources_h) $(cally_sources_c)
Cally_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) -UCLUTTER_DISABLE_DEPRECATED
Cally_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
--pkg-export=clutter-x11-@CLUTTER_API_VERSION@ \
--include-uninstalled=$(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = xlib-2.0
-ClutterX11_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
+ClutterX11_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_API_VERSION@.la
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_FILES = $(x11_introspection)
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) -UCLUTTER_DISABLE_DEPRECATED
INTROSPECTION_GIRS += ClutterX11-@CLUTTER_API_VERSION@.gir
endif # SUPPORT_X11
+if SUPPORT_GDK
+ClutterGdk-@CLUTTER_API_VERSION@.gir: Makefile Clutter-@CLUTTER_API_VERSION@.gir
+
+ClutterGdk_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
+ --identifier-prefix=ClutterGdk \
+ --symbol-prefix=clutter_gdk \
+ --c-include='clutter/gdk/clutter-gdk.h' \
+ --pkg-export=clutter-gdk-@CLUTTER_API_VERSION@ \
+ --include-uninstalled=$(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir
+ClutterGdk_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = Gdk-3.0
+ClutterGdk_@CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter-@CLUTTER_API_VERSION@.la
+ClutterGdk_@CLUTTER_API_VERSION_AM@_gir_FILES = $(gdk_introspection)
+ClutterGdk_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) -UCLUTTER_DISABLE_DEPRECATED
+
+INTROSPECTION_GIRS += ClutterGdk-@CLUTTER_API_VERSION@.gir
+endif # SUPPORT_GDK
+
# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
# install anything - we need to install inside our prefix.
girdir = $(datadir)/gir-1.0
void (* settings_changed) (ClutterBackend *backend);
};
-/* vfuncs implemented by backend */
-GType _clutter_backend_impl_get_type (void);
-
void _clutter_backend_redraw (ClutterBackend *backend,
ClutterStage *stage);
ClutterStageWindow *_clutter_backend_create_stage (ClutterBackend *backend,
#include "clutter-actor.h"
#include "clutter-backend-private.h"
+#include "clutter-config.h"
#include "clutter-debug.h"
#include "clutter-device-manager-private.h"
#include "clutter-event.h"
#include "clutter-stage-private.h"
#include "clutter-version.h" /* For flavour define */
+#ifdef CLUTTER_WINDOWING_OSX
+#include "osx/clutter-backend-osx.h"
+#endif
+#ifdef CLUTTER_WINDOWING_WIN32
+#include "win32/clutter-backend-win32.h"
+#endif
+#ifdef CLUTTER_WINDOWING_GDK
+#include "gdk/clutter-backend-gdk.h"
+#endif
+#ifdef CLUTTER_WINDOWING_X11
+#include "x11/clutter-backend-x11.h"
+#endif
+#ifdef CLUTTER_WINDOWING_EGL
+#include "egl/clutter-backend-eglnative.h"
+#endif
+#ifdef CLUTTER_WINDOWING_WAYLAND
+#include "wayland/clutter-backend-wayland.h"
+#endif
+
#include <cogl/cogl.h>
#include <cogl-pango/cogl-pango.h>
if (G_UNLIKELY (ClutterCntx == NULL))
{
ClutterMainContext *ctx;
+ const char *backend;
ClutterCntx = ctx = g_new0 (ClutterMainContext, 1);
- /* create the default backend */
- ctx->backend = g_object_new (_clutter_backend_impl_get_type (), NULL);
+ backend = g_getenv ("CLUTTER_BACKEND");
+
+#ifdef CLUTTER_WINDOWING_OSX
+ if (backend == NULL || strcmp (backend, "osx") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_OSX, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_WIN32
+ if (backend == NULL || strcmp (backend, "win32") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_WIN32, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_WAYLAND
+ if (backend == NULL || strcmp (backend, "wayland") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_WAYLAND, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_EGL
+ if (backend == NULL || strcmp (backend, "eglnative") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_EGLNATIVE, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_X11
+ if (backend == NULL || strcmp (backend, "x11") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_X11, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_GDK
+ if (backend == NULL || strcmp (backend, "gdk") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_GDK, NULL);
+ else
+#endif
+ if (backend != NULL)
+ g_error ("Unsupported Clutter backend: '%s'", backend);
+ else
+ g_error ("No default Clutter backend found.");
ctx->is_initialized = FALSE;
ctx->motion_events_per_actor = TRUE;
#endif
ctx->last_repaint_id = 1;
+
+ CLUTTER_NOTE (BACKEND, "Backend type: '%s' (requested: '%s')",
+ G_OBJECT_TYPE_NAME (ctx->backend),
+ backend != NULL ? backend : "<default>");
}
return ClutterCntx;
* GL Windowing system used
*
* Since: 0.4
+ *
+ * Deprecated: 1.10: The macro evaluates to "deprecated" as Clutter can be
+ * compiled with multiple windowing system backends. Use the various
+ * CLUTTER_WINDOWING_* macros to detect the windowing system that Clutter
+ * is being compiled against, and the type check macros for the
+ * #ClutterBackend for a run-time check.
*/
#define CLUTTER_FLAVOUR "@CLUTTER_FLAVOUR@"
* "gles" currently
*
* Since: 0.4
+ *
+ * Deprecated: 1.10: The macro evaluates to "deprecated" as Cogl can be
+ * compiled against multiple GL implementations.
*/
#define CLUTTER_COGL "@CLUTTER_COGL@"
* The default GObject type for the Clutter stage.
*
* Since: 0.8
+ *
+ * Deprecated: 1.10: The macro evaluates to "deprecated" as Clutter can
+ * be compiled against multiple windowing systems. You can use the
+ * CLUTTER_WINDOWING_* macros for compile-time checks, and the type
+ * check macros for run-time checks.
*/
#define CLUTTER_STAGE_TYPE @CLUTTER_STAGE_TYPE@
includedir=@includedir@
apiversion=@CLUTTER_API_VERSION@
-winsys=@CLUTTER_WINSYS@
-soname_infix=@CLUTTER_SONAME_INFIX@
-cogl_driver=@COGL_DRIVER@
requires=@CLUTTER_REQUIRES@
+backends=@CLUTTER_BACKENDS@
# only kept for backward compatibility
+soname_infix=@CLUTTER_SONAME_INFIX@
+winsys=@CLUTTER_WINSYS@
cogl=@COGL_DRIVER@
+cogl_driver=@COGL_DRIVER@
backend=@CLUTTER_WINSYS@
Name: Clutter
-Description: Clutter Core Library (${winsys}/${cogl_driver} backend)
+Description: Clutter Core Library
Version: @VERSION@
-Libs: -L${libdir} -lclutter-${soname_infix}-${apiversion}
+Libs: -L${libdir} -lclutter-${apiversion}
Cflags: -I${includedir}/clutter-${apiversion}
Requires: ${requires}
#include "clutter-util.h"
#ifdef CLUTTER_WINDOWING_X11
-/* needed for a small check in redraw() */
+/* FIXME: needed for a small check in redraw(), needs to be moved */
#include "x11/clutter-stage-x11.h"
#endif
CLUTTER_TIMER_START (_clutter_uprof_context, painting_timer);
+ may_use_clipped_redraw = FALSE;
if (G_LIKELY (backend_cogl->can_blit_sub_buffer) &&
/* NB: a zero width redraw clip == full stage redraw */
stage_cogl->bounding_redraw_clip.width != 0 &&
/* some drivers struggle to get going and produce some junk
* frames when starting up... */
- G_LIKELY (stage_cogl->frame_count > 3)
+ G_LIKELY (stage_cogl->frame_count > 3))
+ {
#if defined(CLUTTER_WINDOWING_X11)
+ /* FIXME - move this to a StageWindow vfunc */
+
/* While resizing a window clipped redraws are disabled to avoid
* artefacts. See clutter-event-x11.c:event_translate for a
* detailed explanation */
- && G_LIKELY (CLUTTER_STAGE_X11 (stage_cogl)->clipped_redraws_cool_off == 0)
+ if (CLUTTER_IS_STAGE_X11 (stage_cogl) &&
+ (CLUTTER_STAGE_X11 (stage_cogl)->clipped_redraws_cool_off == 0))
+ {
+ may_use_clipped_redraw = TRUE;
+ }
#endif
- )
- {
- may_use_clipped_redraw = TRUE;
}
- else
- may_use_clipped_redraw = FALSE;
if (may_use_clipped_redraw &&
G_LIKELY (!(clutter_paint_debug_flags &
#include <errno.h>
#include "clutter-backend-eglnative.h"
+
/* This is a Cogl based backend */
#include "cogl/clutter-stage-cogl.h"
#ifdef COGL_HAS_EGL_SUPPORT
#include "clutter-egl.h"
#endif
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
+#ifdef CLUTTER_EGL_BACKEND_CEX100
#include "clutter-cex100.h"
#endif
-static gchar *clutter_vblank = NULL;
-
-/* FIXME: We should have CLUTTER_ define for this... */
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
+#ifdef CLUTTER_EGL_BACKEND_CEX100
static gdl_plane_id_t gdl_plane = GDL_PLANE_ID_UPP_C;
static guint gdl_n_buffers = CLUTTER_CEX100_TRIPLE_BUFFERING;
#endif
+static gboolean gdl_plane_set = FALSE;
+static gboolean gdl_n_buffers_set = FALSE;
+
G_DEFINE_TYPE (ClutterBackendEglNative, _clutter_backend_egl_native, CLUTTER_TYPE_BACKEND_COGL);
static ClutterDeviceManager *
#ifdef HAVE_TSLIB
_clutter_events_tslib_init (CLUTTER_BACKEND_EGL (backend));
#endif
+
#ifdef HAVE_EVDEV
_clutter_events_evdev_init (CLUTTER_BACKEND (backend));
#endif
swap_chain = cogl_swap_chain_new ();
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
- cogl_swap_chain_set_length (swap_chain, gdl_n_buffers);
-#endif
+ if (gdl_n_buffers_set)
+ cogl_swap_chain_set_length (swap_chain, gdl_n_buffers);
onscreen_template = cogl_onscreen_template_new (swap_chain);
cogl_object_unref (swap_chain);
backend->cogl_display = cogl_display_new (backend->cogl_renderer,
onscreen_template);
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
- cogl_gdl_display_set_plane (backend->cogl_display, gdl_plane);
-#endif
+#ifdef CLUTTER_EGL_BACKEND_CEX100
+ if (gdl_plane_set)
+ cogl_gdl_display_set_plane (backend->cogl_display, gdl_plane);
+#endif /* CLUTTER_EGL_BACKEND_CEX100 */
cogl_object_unref (backend->cogl_renderer);
cogl_object_unref (onscreen_template);
#endif
}
-GType
-_clutter_backend_impl_get_type (void)
-{
- return _clutter_backend_egl_native_get_type ();
-}
-
-/* FIXME we should have a CLUTTER_ define for this */
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
+/**
+ * clutter_cex100_set_plane:
+ * @plane: FIXME
+ *
+ * FIXME
+ *
+ * Since:
+ */
void
clutter_cex100_set_plane (gdl_plane_id_t plane)
{
+#ifdef CLUTTER_EGL_BACKEND_CEX100
g_return_if_fail (plane >= GDL_PLANE_ID_UPP_A && plane <= GDL_PLANE_ID_UPP_E);
gdl_plane = plane;
+ gdl_plane_set = TRUE;
+#endif
}
+/**
+ * clutter_cex100_set_plane:
+ * @mode: FIXME
+ *
+ * FIXME
+ *
+ * Since:
+ */
void
clutter_cex100_set_buffering_mode (ClutterCex100BufferingMode mode)
{
+#ifdef CLUTTER_EGL_BACKEND_CEX100
g_return_if_fail (mode == CLUTTER_CEX100_DOUBLE_BUFFERING ||
mode == CLUTTER_CEX100_TRIPLE_BUFFERING);
gdl_n_buffers = mode;
-}
+ gdl_n_buffers_set = TRUE;
#endif
+}
{
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_GDK (backend))
+ if (backend == NULL)
{
- g_critical ("GDK backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return NULL;
+ }
+
+ if (!CLUTTER_IS_BACKEND_GDK (backend))
+ {
+ g_critical ("The Clutter backend is not a GDK backend");
return NULL;
}
_foreign_dpy = g_object_ref (display);
}
-
-GType
-_clutter_backend_impl_get_type (void)
-{
- return _clutter_backend_gdk_get_type ();
-}
G_BEGIN_DECLS
-void clutter_gdk_set_display (GdkDisplay *display);
-GdkWindow *clutter_gdk_get_stage_window (ClutterStage *stage);
-gboolean clutter_gdk_set_stage_foreign (ClutterStage *stage,
- GdkWindow *window);
+void clutter_gdk_set_display (GdkDisplay *display);
-GdkFilterReturn clutter_gdk_handle_event (GdkEvent *event);
+GdkWindow * clutter_gdk_get_stage_window (ClutterStage *stage);
+gboolean clutter_gdk_set_stage_foreign (ClutterStage *stage,
+ GdkWindow *window);
-ClutterStage *clutter_gdk_get_stage_from_window (GdkWindow *window);
+GdkFilterReturn clutter_gdk_handle_event (GdkEvent *event);
+
+ClutterStage * clutter_gdk_get_stage_from_window (GdkWindow *window);
G_END_DECLS
*
* Since: 0.4
*/
-GdkWindow*
+GdkWindow *
clutter_gdk_get_stage_window (ClutterStage *stage)
{
ClutterStageWindow *impl;
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), None);
impl = _clutter_stage_get_window (stage);
- g_assert (CLUTTER_IS_STAGE_GDK (impl));
+ if (!CLUTTER_IS_STAGE_GDK (impl))
+ {
+ g_critical ("The Clutter backend is not a GDK backend");
+ return NULL;
+ }
return CLUTTER_STAGE_GDK (impl)->window;
}
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
impl = _clutter_stage_get_window (stage);
+ if (!CLUTTER_IS_STAGE_GDK (impl))
+ {
+ g_critical ("The Clutter backend is not a GDK backend");
+ return FALSE;
+ }
+
stage_gdk = CLUTTER_STAGE_GDK (impl);
if (g_object_get_data (G_OBJECT (window), "clutter-stage-window") != NULL)
backend_class->init_events = clutter_backend_osx_init_events;
backend_class->get_device_manager = clutter_backend_osx_get_device_manager;
}
-
-GType
-_clutter_backend_impl_get_type (void)
-{
- return clutter_backend_osx_get_type ();
-}
backend_wayland->drm_fd = -1;
}
-GType
-_clutter_backend_impl_get_type (void)
-{
- return _clutter_backend_wayland_get_type ();
-}
-
EGLDisplay
clutter_wayland_get_egl_display (void)
{
timeBeginPeriod (1);
}
-GType
-_clutter_backend_impl_get_type (void)
-{
- return clutter_backend_win32_get_type ();
-}
-
BOOL WINAPI
DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
{
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
g_return_val_if_fail (hwnd != NULL, FALSE);
- actor = CLUTTER_ACTOR (stage);
-
impl = _clutter_stage_get_window (stage);
+ if (!CLUTTER_IS_STAGE_WIN32 (impl))
+ {
+ g_critical ("The Clutter backend is not a Windows backend");
+ return FALSE;
+ }
+
stage_win32 = CLUTTER_STAGE_WIN32 (impl);
if (!GetClientRect (hwnd, &client_rect))
fwd.geom.width = client_rect.right - client_rect.left;
fwd.geom.height = client_rect.bottom - client_rect.top;
+ actor = CLUTTER_ACTOR (stage);
+
_clutter_actor_rerealize (actor,
set_foreign_window_callback,
&fwd);
{
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return NULL;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return NULL;
}
{
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return 0;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return 0;
}
{
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return None;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return None;
}
g_return_if_fail (func != NULL);
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return;
}
g_return_if_fail (func != NULL);
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return;
}
#if defined(HAVE_XINPUT) || defined(HAVE_XINPUT_2)
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return FALSE;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend.");
return FALSE;
}
}
dpy = clutter_x11_get_default_display();
+ if (dpy == NULL)
+ return FALSE;
if (XCompositeQueryExtension (dpy, &event, &error))
{
clutter_x11_get_visual_info (void)
{
ClutterBackendX11 *backend_x11;
+ ClutterBackend *backend;
- backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
+ backend = clutter_get_default_backend ();
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend.");
+ return NULL;
+ }
+
+ backend_x11 = CLUTTER_BACKEND_X11 (backend);
return _clutter_backend_x11_get_visual_info (backend_x11);
}
return TRUE;
}
-
-GType
-_clutter_backend_impl_get_type (void)
-{
- return _clutter_backend_x11_get_type ();
-}
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
GParamSpec *pspec;
- ClutterBackend *default_backend;
g_type_class_add_private (klass, sizeof (ClutterX11TexturePixmapPrivate));
g_signal_override_class_handler ("queue-damage-redraw",
CLUTTER_X11_TYPE_TEXTURE_PIXMAP,
G_CALLBACK (clutter_x11_texture_pixmap_real_queue_damage_redraw));
-
- default_backend = clutter_get_default_backend ();
-
- if (!CLUTTER_IS_BACKEND_X11 (default_backend))
- {
- g_critical ("ClutterX11TexturePixmap instantiated with a "
- "non-X11 backend");
- return;
- }
}
static void
{
ClutterX11TexturePixmapPrivate *priv;
XWindowAttributes attr;
- Display *dpy = clutter_x11_get_default_display ();
+ Display *dpy;
g_return_if_fail (CLUTTER_X11_IS_TEXTURE_PIXMAP (texture));
if (!clutter_x11_has_composite_extension ())
return;
+ dpy = clutter_x11_get_default_display ();
+ if (dpy == NULL)
+ return;
+
#if HAVE_XCOMPOSITE
priv = texture->priv;
priv->window_height = height;
priv->override_redirect = override_redirect;
- if (!clutter_x11_has_composite_extension())
+ if (!clutter_x11_has_composite_extension ())
{
/* FIXME: this should just be an error, this is unlikely to work worth anything */
clutter_x11_texture_pixmap_set_pixmap (texture, priv->window);
if (priv->destroyed)
return;
- if (priv->window)
+ if (priv->window != None)
{
- XWindowAttributes attr;
Display *dpy = clutter_x11_get_default_display ();
+ XWindowAttributes attr;
Status status;
+ if (dpy == NULL)
+ return;
+
clutter_x11_trap_x_errors ();
status = XGetWindowAttributes (dpy, priv->window, &attr);
CLUTTER_LT_AGE=lt_age
CLUTTER_LT_VERSION="$CLUTTER_LT_CURRENT:$CLUTTER_LT_REV:$CLUTTER_LT_AGE"
CLUTTER_LT_LDFLAGS="-version-info $CLUTTER_LT_VERSION"
+AC_SUBST([CLUTTER_LT_CURRENT], [lt_current])
+AC_SUBST([CLUTTER_LT_REVISION], [lt_revision])
+AC_SUBST([CLUTTER_LT_VERSION], [$CLUTTER_LT_VERSION])
AC_PROG_SED
AC_CANONICAL_HOST
+
+platform_win32=no
+platform_quartz=no
+platform_linux=no
+
AC_MSG_CHECKING([if building for some Win32 platform])
AS_CASE([$host],
[*-*-mingw*|*-*-cygwin*],
platform_win32=yes
],
- [platform_win32=no]
+ []
)
AC_MSG_RESULT([$platform_win32])
+
AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
-AC_SUBST(CLUTTER_LT_VERSION)
+AC_CHECK_HEADER([GL/glx.h], [platform_glx=yes], [platform_glx=no])
+AC_CHECK_LIB([GL], [glXCreateContext], [platform_glx=yes], [platform_glx=no])
+AM_CONDITIONAL(OS_GLX, [test "$platform_glx" = "yes"])
+
AC_SUBST(CLUTTER_LT_LDFLAGS)
dnl ========================================================================
FLAVOUR_LIBS=""
FLAVOUR_CFLAGS=""
-CLUTTER_WINSYS_BASE=
-CLUTTER_WINSYS_BASE_LIB=
-CLUTTER_WINSYS=
+CLUTTER_BACKENDS=""
experimental_backend=no
-AC_ARG_WITH([flavour],
- [AS_HELP_STRING([--with-flavour=@<:@glx/opengl-egl-xlib/wayland/eglx/eglnative/osx/win32/cex100@:>@],
- [Select the Clutter window system backend])],
- [CLUTTER_FLAVOUR=$with_flavour])
-
# base dependencies for core
CLUTTER_BASE_PC_FILES="cogl-1.0 >= $COGL_REQ_VERSION cairo-gobject >= $CAIRO_REQ_VERSION atk >= $ATK_REQ_VERSION pangocairo >= $PANGO_REQ_VERSION cogl-pango-1.0 json-glib-1.0 >= $JSON_GLIB_REQ_VERSION"
dnl === Clutter windowing system backend ======================================
-AS_CASE([$CLUTTER_FLAVOUR],
+AC_ARG_ENABLE([x11],
+ [AS_HELP_STRING([--enable-x11=@<:@yes/no@:>@], [Enable the X11 backend (default=no)])],
+ [],
+ [enable_x11=maybe])
+AC_ARG_ENABLE([win32],
+ [AS_HELP_STRING([--enable-win32=@<:@yes/no@:>@], [Enable the Windows backend (default=no)])],
+ [],
+ [enable_win32=maybe])
+AC_ARG_ENABLE([osx],
+ [AS_HELP_STRING([--enable-osx=@<:@yes/no@:>@], [Enable the OS X backend (default=no)])],
+ [],
+ [enable_osx=maybe])
+AC_ARG_ENABLE([gdk],
+ [AS_HELP_STRING([--enable-gdk=@<:@yes/no@:>@], [Enable the GDK backend (default=no)])],
+ [],
+ [enable_gdk=no])
+AC_ARG_ENABLE([wayland],
+ [AS_HELP_STRING([--enable-wayland=@<:@yes/no@:>@], [Enable the Wayland client backend (default=no)])],
+ [],
+ [enable_wayland=no])
+AC_ARG_ENABLE([egl],
+ [AS_HELP_STRING([--enable-egl=@<:@yes/no@:>@], [Enable the EGL framebuffer backend (default=no)])]
+ [],
+ [enable_egl=no])
- [glx],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_X11"
-
- SUPPORT_X11=1
- SUPPORT_XLIB=1
- SUPPORT_GLX=1
-
- CLUTTER_WINSYS=x11
- CLUTTER_WINSYS_BASE=cogl
- CLUTTER_SONAME_INFIX=glx
-
- # Mesa 7.3 added a GL pkg-config file, finally
- PKG_CHECK_EXISTS([gl],
- [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"],
- # if a pkg-config file isn't found just add -lGL
- # and hope for the best.
- [FLAVOUR_LIBS="$FLAVOUR_LIBS -lGL"])
-
- # We might fall back to DRM for sync-to-vblank on GLX
- PKG_CHECK_EXISTS([libdrm],
- [
- AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
- BACKEND_PC_FILES="$BACKEND_PC_FILES libdrm"
- ],
- [])
- ],
+dnl Define default values
+AS_IF([test "x$platform_glx" = "xyes"], [enable_x11=yes])
+AS_IF([test "x$platform_win32" = "xyes"], [enable_win32=yes])
+AS_IF([test "x$platform_quartz" = "xyes"], [enable_osx=yes])
- [gdk],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_GDK"
+dnl Per-backend rules
+AS_IF([test "x$enable_x11" = "xyes"],
+ [
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11"
- # We don't claim to support X11 (even though that's the preferred
- # GDK backend), to avoid building all the ClutterX11 stuff
- SUPPORT_GDK=1
+ SUPPORT_X11=1
+ SUPPORT_GLX=1
+ SUPPORT_COGL=1
- CLUTTER_WINSYS=gdk
- CLUTTER_WINSYS_BASE=cogl
- CLUTTER_SONAME_INFIX=gdk
+ # Mesa 7.3 added a GL pkg-config file, finally, but if a pkg-config
+ # file isn't found just add -lGL and hope for the best.
+ PKG_CHECK_EXISTS([gl],
+ [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"],
+ [FLAVOUR_LIBS="$FLAVOUR_LIBS -lGL"])
- BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
- PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
- ],
+ # if Mesa has support for egl, we can use it as well
+ PKG_CHECK_EXISTS([egl],
+ [
+ BACKEND_PC_FILES="$BACKEND_PC_FILES egl"
+ SUPPORT_EGL=1
+ ],
+ [])
- [opengl-egl-xlib],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_X11"
- CLUTTER_EGL_BACKEND="generic"
-
- SUPPORT_X11=1
- SUPPORT_XLIB=1
- SUPPORT_EGL=1
- SUPPORT_EGL_PLATFORM_POWERVR_X11=1
-
- CLUTTER_WINSYS=x11
- CLUTTER_WINSYS_BASE=cogl
- # I think this winsys can be API and ABI compatible with the
- # glx flavour so we can also be cheeky and use the same soname
- CLUTTER_SONAME_INFIX=glx
-
- PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
- PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
- ],
+ # We might fall back to DRM for sync-to-vblank on GLX
+ PKG_CHECK_EXISTS([libdrm],
+ [
+ AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
+ BACKEND_PC_FILES="$BACKEND_PC_FILES libdrm"
+ ],
+ [])
- [wayland],
- [
- experimental_backend="yes"
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_WAYLAND"
+ # we use fontconfig API and pango-fc when the fontconfig
+ # configuration changes
+ PKG_CHECK_EXISTS([pangoft2],
+ [
+ AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
+ BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
+ ],
+ [])
- SUPPORT_WAYLAND=1
+ AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
+ ])
- CLUTTER_WINSYS=wayland
- CLUTTER_SONAME_INFIX=wayland
+AS_IF([test "x$enable_gdk" = "xyes"],
+ [
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS gdk"
- PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
- PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
- PKG_CHECK_EXISTS([wayland-client xkbcommon],
- [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"], [])
- ],
+ SUPPORT_GDK=1
+ SUPPORT_COGL=1
- [eglx],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_X11"
- CLUTTER_EGL_BACKEND="generic"
+ BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
+ PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
+ ])
- SUPPORT_X11=1
- SUPPORT_XLIB=1
- SUPPORT_EGL=1
- SUPPORT_EGL_PLATFORM_POWERVR_X11=1
+AS_IF([test "x$enable_wayland" = "xyes"],
+ [
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS wayland"
- CLUTTER_WINSYS=x11
- CLUTTER_WINSYS_BASE=cogl
- CLUTTER_SONAME_INFIX=eglx
- ],
+ experimental_backend="yes"
- [eglnative],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL"
- CLUTTER_EGL_BACKEND="generic"
-
- SUPPORT_EGL=1
- SUPPORT_EGL_PLATFORM_POWERVR_NULL=1
-
- PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
- AS_IF([test "x$have_tslib" = "xyes"],
- [AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])]
- )
-
- # evdev
- PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon],
- [have_evdev=yes], [have_evdev=no])
- AS_IF([test "x$have_evdev" = "xyes"],
- [AC_DEFINE([HAVE_EVDEV], 1,
- [Have evdev support for input handling])]
- )
-
- # Make sure we don't enable tslib and evdev at the same time, we
- # don't support multiple event backends yet.
- AS_IF([test "x$have_tslib" = "xyes" -a "x$have_evdev" = "xyes"],
- [AC_MSG_ERROR([Cannot enable both tslib and evdev events])])
-
- FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
- FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
-
- CLUTTER_WINSYS=cogl
- CLUTTER_SONAME_INFIX=eglnative
- ],
+ SUPPORT_WAYLAND=1
- [cex100],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL"
- CLUTTER_EGL_BACKEND="cex100"
-
- SUPPORT_EGL=1
- SUPPORT_EGL_PLATFORM_GDL=1
-
- # The cex100 is a small specialization of the EGL backend
- CLUTTER_WINSYS=cogl
- CLUTTER_SONAME_INFIX=cex100
-
- found_gdl=no
- AC_CHECK_HEADERS([libgdl.h], [found_gdl=yes])
- AS_IF([test "x$found_gdl" = "xno"],
- [AC_CHECK_HEADERS([CE4100/libgdl.h],
- [
- FLAVOUR_CFLAGS="-I/usr/include/CE4100"
- found_gdl=yes
- CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
- ])
- ])
- AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
+ PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
+ PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
+ PKG_CHECK_EXISTS([wayland-client xkbcommon],
+ [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"],
+ [])
- AS_IF([test x"$found_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])])
+ AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
+ ])
- # evdev
- PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon],
- [have_evdev=yes], [have_evdev=no])
- AS_IF([test "x$have_evdev" = "xyes"],
- [AC_DEFINE([HAVE_EVDEV], 1,
- [Have evdev support for input handling])]
- )
+AS_IF([test "x$enable_egl" = "xyes"],
+ [
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
- FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $EVDEV_CFLAGS"
- FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl $EVDEV_LIBS"
- ],
+ SUPPORT_EGL=1
+ SUPPORT_COGL=1
- [osx],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_OSX"
+ AC_ARG_WITH([tslib],
+ [AS_HELP_STRING([--with-tslib=@<:@yes/no@:>@], [Use TSLib for events])],
+ [],
+ [with_tslib=yes])
- AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
+ AC_ARG_WITH([evdev],
+ [AS_HELP_STRING([--with-evdev=@<:@yes/no@:>@], [Use evdev for events])],
+ [],
+ [with_evdev=yes])
- FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
+ AC_ARG_WITH([gdl],
+ [AS_HELP_STRING([--with-gdl=@<:@yes/no@:>@], [Use libgdl for CE3100/CE4100 support])],
+ [],
+ [with_gdl=no])
- CLUTTER_WINSYS=osx
- CLUTTER_SONAME_INFIX=osx
- ],
+ AS_IF([test "x$with_tslib" = "xyes"],
+ [
+ PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
+ AS_IF([test "x$have_tslib" = "xyes"],
+ [
+ AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])
+ ])
+ ])
- [win32],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_WIN32"
- AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
+ AS_IF([test "x$with_evdev" = "xyes"],
+ [
+ PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon], [have_evdev=yes], [have_evdev=no])
+ AS_IF([test "x$have_evdev" = "xyes"],
+ [
+ AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
+ ])
+ ])
- FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
- FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
+ AS_IF([test "x$with_gdl" = "xyes"],
+ [
+ have_gdl=no
- AC_CHECK_TOOL(WINDRES, windres, no)
- if test "$WINDRES" = no; then
- AC_MSG_ERROR([*** windres is required])
- fi
+ AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes])
- CLUTTER_WINSYS=win32
- CLUTTER_SONAME_INFIX=win32
- ],
+ AS_IF([test "x$have_gdl" = "xno"],
+ [
+ AC_CHECK_HEADERS([CE4100/libgdl.h],
+ [
+ FLAVOUR_CFLAGS="-I/usr/include/CE4100"
+ have_gdl=yes
+ CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
+ ])
+ ])
- [AC_MSG_ERROR([Invalid backend for Clutter])]
-)
+ AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
-AS_IF([test "x$SUPPORT_X11" = "x1"],
- [
- # we use fontconfig API and pango-fc when the fontconfig
- # configuration changes
- PKG_CHECK_EXISTS([pangoft2],
- [
- AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
- BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
- ],
- [])
+ AS_IF([test "x$have_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])])
+
+ FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl"
+
+ SUPPORT_EGL_PLATFORM_GDL=1
+
+ AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend])
+ ])
+
+ # Make sure we don't enable tslib and evdev at the same time, we
+ # don't support multiple event backends yet.
+ AS_IF([test "x$have_tslib" = "xyes" -a "x$have_evdev" = "xyes"],
+ [
+ AC_MSG_ERROR([Cannot enable both tslib and evdev events])
+ ])
+
+ FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
+ FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
+
+ AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
+
+ AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
])
-AS_IF([test "x$SUPPORT_GLX" = "x1"],
+AS_IF([test "x$enable_osx" = "xyes"],
[
- AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS osx"
+
+ AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
+
+ FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
+
+ SUPPORT_OSX=1
])
-AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
+AS_IF([test "x$enable_win32" = "xyes"],
[
- AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS win32"
+
+ AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
+
+ FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
+ FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
+
+ AC_CHECK_TOOL(WINDRES, [windres], [AC_MSG_ERROR([*** windres is required])])
+
+ SUPPORT_WIN32=1
])
-AS_IF([test "x$SUPPORT_EGL" = "x1"],
+AS_IF([test "x$CLUTTER_BACKENDS" = "x"],
[
- AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
+ AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.])
])
-AS_IF([test "x$CLUTTER_EGL_BACKEND" = "xgeneric"],
- AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend]))
-
-AS_IF([test "x$CLUTTER_EGL_BACKEND" = "xcex100"],
- AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend]))
-
-# winsys conditionals for use in automake files...
-AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "x1"])
-AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "x1"])
-AM_CONDITIONAL(SUPPORT_XLIB, [test "x$SUPPORT_XLIB" = "x1"])
-AM_CONDITIONAL(SUPPORT_GDK, [test "x$SUPPORT_GDK" = "x1"])
-AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "x1"])
-AM_CONDITIONAL(SUPPORT_OSX, [test "x$CLUTTER_WINSYS" = "xosx"])
-AM_CONDITIONAL(SUPPORT_WIN32, [test "x$CLUTTER_WINSYS" = "xwin32"])
-AM_CONDITIONAL(SUPPORT_CEX100, [test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"])
-AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$CLUTTER_WINSYS" = "xwayland"])
-AM_CONDITIONAL(SUPPORT_STUB, [test "x$CLUTTER_WINSYS" = "xwin32" -o \
- "x$CLUTTER_WINSYS" = "xosx" -o \
- "x$CLUTTER_WINSYS" = "xwayland"])
-
+# conditionals for use in automake files...
+AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "x1"])
+AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "x1"])
+AM_CONDITIONAL(SUPPORT_GDK, [test "x$SUPPORT_GDK" = "x1"])
+AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "x1"])
+AM_CONDITIONAL(SUPPORT_OSX, [test "x$SUPPORT_OSX" = "x1"])
+AM_CONDITIONAL(SUPPORT_WIN32, [test "x$SUPPORT_WIN32" = "x1"])
+AM_CONDITIONAL(SUPPORT_CEX100, [test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"])
+AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$SUPPORT_WAYLAND" = "x1"])
+AM_CONDITIONAL(SUPPORT_STUB, [test "x$SUPPORT_WIN32" = "x1" -o \
+ "x$SUPPORT_OSX" = "x1" -o \
+ "x$SUPPORT_WAYLAND" = "x1"])
+
+AM_CONDITIONAL(USE_COGL, [test "x$SUPPORT_COGL" = "x1"])
AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
-AM_CONDITIONAL(SUPPORT_EVDEV, [test "x$have_evdev" = "xyes"])
+AM_CONDITIONAL(USE_EVDEV, [test "x$have_evdev" = "xyes"])
+AM_CONDITIONAL(USE_GLD, [test "x$have_gdl" = "xyes"])
dnl Instead of using AM_CFLAGS to ensure
dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
dnl using the define also.
AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally])
+dnl strip leading spaces
+CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
+AC_SUBST(CLUTTER_BACKENDS)
+
dnl === Clutter configuration =================================================
CLUTTER_CONFIG_DEFINES=
# windowing systems
-AS_IF([test "x$SUPPORT_XLIB" = "x1"],
+AS_IF([test "x$SUPPORT_X11" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_X11 1"])
AS_IF([test "x$SUPPORT_GDK" = "x1"],
AS_IF([test "x$SUPPORT_EGL" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_EGL 1"])
-AS_IF([test "x$CLUTTER_WINSYS" = "xwayland"],
+AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_WAYLAND 1"])
-AS_IF([test "x$CLUTTER_WINSYS" = "xosx"],
+AS_IF([test "x$SUPPORT_OSX" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_OSX 1"])
-AS_IF([test "x$CLUTTER_WINSYS" = "xwin32"],
+AS_IF([test "x$SUPPORT_WIN32" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_WIN32 1"])
AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"],
AC_SUBST([CLUTTER_CONFIG_DEFINES])
-dnl === Clutter substitutions =================================================
-# Eventually the idea of a winsys should be hidden from Clutter and moved
-# into Cogl, but for now we have CLUTTER_WINSYS...
-AC_SUBST([CLUTTER_WINSYS])
-# The same goes for the winsys-base...
-AC_SUBST([CLUTTER_WINSYS_BASE])
-AC_SUBST(CLUTTER_STAGE_TYPE)
-AC_SUBST(CLUTTER_SONAME_INFIX)
-
-CLUTTER_WINSYS_LIB=libclutter-$CLUTTER_SONAME_INFIX-$CLUTTER_API_VERSION.la
-AC_SUBST([CLUTTER_WINSYS_LIB])
-
dnl === Clutter substitutions kept for backwards compatibility ================
-AC_SUBST([CLUTTER_FLAVOUR])
-CLUTTER_COGL=undefined
-AC_SUBST([CLUTTER_COGL])
+AC_SUBST([CLUTTER_WINSYS], [deprecated])
+AC_SUBST([CLUTTER_WINSYS_BASE], [deprecated])
+AC_SUBST([CLUTTER_STAGE_TYPE], [deprecated])
+AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
+AC_SUBST([CLUTTER_FLAVOUR], [deprecated])
+AC_SUBST([CLUTTER_COGL], [deprecated])
+AC_SUBST([COGL_DRIVER], [deprecated])
dnl === Image loading backend =================================================
IMAGE_PC_FILES=""
X11_PC_FILES=""
x11_tests=no
-AS_IF([test "x$SUPPORT_XLIB" = "x1"],
+AS_IF([test "x$SUPPORT_X11" = "x1"],
[
# base X11 includes and libraries
AC_MSG_CHECKING([for X11])
)
AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
-AM_CONDITIONAL(X11_TESTS, [test "x$x11_tests" = "xyes"])
+AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
dnl === Enable debug level ====================================================
echo " Prefix: ${prefix}"
echo " Libdir: ${libdir}"
echo " Sysconfdir: ${sysconfdir}"
-echo " Flavour: ${CLUTTER_WINSYS}"
-echo " Target library: ${CLUTTER_WINSYS_LIB}"
# Compiler/Debug related flags
echo ""
# Clutter backend related flags
echo ""
-echo " • Clutter Backend:"
+echo " • Clutter Backends:"
if test "x$experimental_backend" = "xno"; then
-echo " Windowing system: ${CLUTTER_WINSYS}"
+echo " Windowing systems: ${CLUTTER_BACKENDS}"
else
-echo " Windowing system: ${CLUTTER_WINSYS} (WARNING: Experimental)"
+echo " Windowing systems: ${CLUTTER_BACKENDS} (WARNING: Experimental backends enabled)"
fi
-if test "x$SUPPORT_XLIB" = "x1"; then
+if test "x$SUPPORT_X11" = "x1"; then
+echo ""
echo " Enable XComposite: ${have_xcomposite}"
echo " Enable XInput: ${have_xinput}"
echo " Enable Xge: ${have_xge}"
echo " Enable XI2: ${have_xinput2}"
echo " Enable XKB: ${have_xkb}"
-echo " Enable X11 tests: ${x11_tests}"
+echo " Build X11-specific tests: ${x11_tests}"
+fi
+
+if test "x$SUPPORT_EGL" = "x1"; then
+echo ""
+echo " Enable TSLib: ${have_tslib}"
+echo " Enable evdev: ${have_evdev}"
+echo " Enable GDL: ${have_gdl}"
fi
echo ""
-I$(top_builddir)/clutter \
$(NULL)
-LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
+LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/clutter -I$(top_srcdir)/clutter/cogl -I$(top_builddir) -I$(top_builddir)/clutter -I$(top_builddir)/clutter/cogl $(CLUTTER_CFLAGS)
-GTKDOC_LIBS=$(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
+GTKDOC_LIBS=$(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/clutter -I$(top_srcdir)/clutter/cogl -I$(top_builddir) -I$(top_builddir)/clutter -I$(top_builddir)/clutter/cogl $(CLUTTER_CFLAGS)
-GTKDOC_LIBS=$(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
+GTKDOC_LIBS=$(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
include $(top_srcdir)/build/autotools/Makefile.am.silent
common_ldadd = \
- $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
+ $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la
common_sources = \
cally-examples-util.c \
test_conformance_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
-test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
+test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
test_conformance_LDFLAGS = -export-dynamic
-I$(top_builddir)/clutter \
-I$(top_builddir)/clutter/cogl
-common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
+common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la
noinst_PROGRAMS = test-interactive
include $(top_srcdir)/build/autotools/Makefile.am.silent
-common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
+common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la
noinst_PROGRAMS = \
test-text \
-I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter
-common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la
+common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la
LDADD = $(common_ldadd) $(CLUTTER_LIBS) -lm