diff --git a/.gitignore b/.gitignore index 76a32df98..a9bec3094 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ stamp-marshal /clutter/clutter-version.h /clutter/gcov-report.txt /clutter/clutter-json.h -/clutter/cogl/clutter-cex100.h +/clutter/egl/clutter-cex100.h /build/autotools/*.m4 !/build/autotools/introspection.m4 !/build/autotools/as-linguas.m4 diff --git a/README.in b/README.in index 36b29baf6..3a10eaec9 100644 --- a/README.in +++ b/README.in @@ -25,12 +25,6 @@ On X11, Clutter depends on the following extensions • XInput (1.x or 2.x) • XKB -When running the OpenGL flavor, Clutter requires at least version 1.3 -or 1.2 with the multitexturing extension. However to build Clutter -you will need the latest GL headers which can be obtained from: - - http://www.khronos.org - If you are building the API reference you will also need: • GTK-Doc ≥ @GTK_DOC_REQ_VERSION@ @@ -76,6 +70,7 @@ The Clutter Cookbook is available at: New releases of Clutter are available at: http://source.clutter-project.org/sources/clutter/ + http://download.gnome.org/sources/clutter/ The Clutter blog is available at: @@ -114,7 +109,7 @@ See also the wiki page: Clutter has additional command line options for the configure script: - --enable-debug=[no/minimum/yes] + --enable-debug=[no/minimum/yes/error] Controls Clutter debugging level: yes: @@ -156,38 +151,38 @@ Clutter has additional command line options for the configure script: --enable-conform=[yes/no] Build the Clutter conformance test suite. + --enable-deprecated=[yes/no] + Whether deprecated symbols should be available when compiling Clutter. + --disable-Bsymbolic Disable linking with -Bsymbolic. - --with-flavour - Select the Clutter backend: (default=glx) + --enable-x11-backend=[yes/no/check] + Enable the X11 backend. (default=check) - glx: - Fully featured GLX backend. + --enable-win32-backend=[yes/no/check] + Enable the native Microsoft Windows backend. (default=check) - opengl-egl-xlib: - EGL/Open GL backend for X11. + --enable-quartz-backend=[yes/no/check] + Enable the native Quartz backend. (default=check) - wayland: - EGL/Open GL backend for Wayland. (EXPERIMENTAL) + --enable-gdk-backend=[yes/no/check] + Enable the GDK backend. (default=check) - eglx: - EGL/Open GL|ES backend for X11. + --enable-wayland-backend=[yes/no] + Enable the Wayland client backend. (default=no) - eglnative: - EGL/Open GL|ES backend on 'native windowing system' - i.e - raw framebuffer. Expects the EGL implementation to provide - a createNativeWindow() call. + --enable-egl-backend=[yes/no] + Enable the EGL framebuffer backend. (default=no) - cex100: - EGL/Open GL|ES backend on Intel CE3100 and CE4100 platforms. - Requires libgdl. + --with-tslib=[yes/no] + Use TSLib for the input events. (default=yes) - osx: - OS X backend. (EXPERIMENTAL) + --with-evdev=[yes/no] + Use evdev for the input events. (default=yes) - win32: - Microsoft Windows(tm) WGL backend. + --with-gdl=[yes/no] + Use libgdl for CEx100 platforms. (default=no) See also the INSTALL file generated by autotools for further information. diff --git a/clutter/Makefile.am b/clutter/Makefile.am index 5b3d714ba..7742a927d 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -14,8 +14,6 @@ lib_LTLIBRARIES = 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) \ @@ -92,7 +90,6 @@ source_h = \ $(srcdir)/clutter-input-device.h \ $(srcdir)/clutter-interval.h \ $(srcdir)/clutter-keysyms.h \ - $(srcdir)/clutter-keysyms-compat.h \ $(srcdir)/clutter-layout-manager.h \ $(srcdir)/clutter-layout-meta.h \ $(srcdir)/clutter-list-model.h \ @@ -233,6 +230,8 @@ source_c_priv = \ # deprecated installed headers deprecated_h = \ + $(srcdir)/deprecated/clutter-actor.h \ + $(srcdir)/deprecated/clutter-backend.h \ $(srcdir)/deprecated/clutter-behaviour.h \ $(srcdir)/deprecated/clutter-behaviour-depth.h \ $(srcdir)/deprecated/clutter-behaviour-ellipse.h \ @@ -242,9 +241,13 @@ deprecated_h = \ $(srcdir)/deprecated/clutter-behaviour-scale.h \ $(srcdir)/deprecated/clutter-fixed.h \ $(srcdir)/deprecated/clutter-frame-source.h \ + $(srcdir)/deprecated/clutter-group.h \ + $(srcdir)/deprecated/clutter-keysyms.h \ + $(srcdir)/deprecated/clutter-main.h \ $(srcdir)/deprecated/clutter-timeout-pool.h \ $(srcdir)/deprecated/clutter-score.h \ $(srcdir)/deprecated/clutter-shader.h \ + $(srcdir)/deprecated/clutter-stage.h \ $(NULL) # deprecated source code @@ -298,6 +301,13 @@ EXTRA_DIST += clutter-keysyms-update.pl 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 @@ -365,14 +375,13 @@ backend_source_c_priv += $(x11_source_c_priv) # the list of files we want to introspect on X11 x11_introspection = $(x11_source_c) $(x11_source_h) -# pkg-config file for the X11 meta-backend +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 - -clutterx11_includedir = $(clutter_includedir)/x11 -clutterx11_include_HEADERS = $(x11_source_h) endif # SUPPORT_X11 # Shared cogl backend files @@ -390,14 +399,31 @@ cogl_source_h_priv = \ cogl_source_c_priv = -if SUPPORT_X11 -# For compatability with the old GLX backend +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 + +# 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)/cogl/clutter-glx-texture-pixmap.c -glx_source_h = $(srcdir)/cogl/clutter-glx-texture-pixmap.h \ - $(srcdir)/cogl/clutter-glx.h +# 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) @@ -405,13 +431,49 @@ clutter-glx-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc $(QUIET_GEN)cp -f $< $(@F) pc_files += clutter-glx-$(CLUTTER_API_VERSION).pc + +compat_libs += \ + libclutter-glx-$(CLUTTER_API_VERSION).so \ + $(NULL) 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 +# GDK backend rules +gdk_source_c = \ + $(srcdir)/gdk/clutter-backend-gdk.c \ + $(srcdir)/gdk/clutter-device-manager-gdk.c \ + $(srcdir)/gdk/clutter-input-device-gdk.c \ + $(srcdir)/gdk/clutter-event-gdk.c \ + $(srcdir)/gdk/clutter-stage-gdk.c \ + $(NULL) + +gdk_source_h = \ + $(srcdir)/gdk/clutter-gdk.h \ + $(NULL) + +gdk_source_h_priv = \ + $(srcdir)/gdk/clutter-settings-gdk.h \ + $(srcdir)/gdk/clutter-backend-gdk.h \ + $(srcdir)/gdk/clutter-device-manager-gdk.h \ + $(srcdir)/gdk/clutter-input-device-gdk.h \ + $(srcdir)/gdk/clutter-event-gdk.h \ + $(srcdir)/gdk/clutter-stage-gdk.h \ + $(NULL) + +if SUPPORT_GDK +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 win32_source_c = \ @@ -452,6 +514,11 @@ backend_source_h_priv += $(win32_source_h_priv) 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 += \ @@ -461,11 +528,16 @@ EXTRA_DIST += \ # EGL backend rules egl_source_h = \ - $(srcdir)/cogl/clutter-egl-headers.h \ - $(srcdir)/cogl/clutter-egl.h \ + $(srcdir)/egl/clutter-egl-headers.h \ + $(srcdir)/egl/clutter-egl.h \ $(NULL) -egl_tslib_c = $(srcdir)/cogl/clutter-event-tslib.c +egl_source_h_priv = $(srcdir)/egl/clutter-backend-eglnative.h +egl_source_c = $(srcdir)/egl/clutter-backend-eglnative.c +egl_source_c_priv = + +egl_tslib_h = $(srcdir)/tslib/clutter-event-tslib.h +egl_tslib_c = $(srcdir)/tslib/clutter-event-tslib.c evdev_c_priv = \ $(srcdir)/evdev/clutter-xkb-utils.c \ @@ -478,31 +550,45 @@ evdev_h_priv = \ $(srcdir)/evdev/clutter-input-device-evdev.h \ $(NULL) -cex_h = cogl/clutter-cex100.h +cex_h = egl/clutter-cex100.h BUILT_SOURCES += $(cex_h) EXTRA_DIST += $(srcdir)/$(cex_h).in if USE_TSLIB -backend_source_c_priv += $(egl_tslib_c) +egl_source_c_priv += $(egl_tslib_c) +egl_source_h_priv += $(egl_tslib_h) endif # SUPPORT_TSLIB -if SUPPORT_EVDEV -backend_source_c_priv += $(evdev_c_priv) -backend_source_h_priv += $(evdev_h_priv) +if USE_EVDEV +egl_source_c_priv += $(evdev_c_priv) +egl_source_h_priv += $(evdev_h_priv) endif # SUPPORT_EVDEV if SUPPORT_CEX100 -backend_source_h += $(cex_h) +egl_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 \ + $(NULL) 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) +backend_source_c += $(egl_source_c) +backend_source_h_priv += $(egl_source_h_priv) 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 @@ -538,6 +624,11 @@ backend_source_c_priv += $(osx_source_c_priv) 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 @@ -559,6 +650,15 @@ backend_source_c += \ 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 \ + $(NULL) endif # SUPPORT_WAYLAND # cally @@ -614,12 +714,6 @@ glib_enum_c = clutter-enum-types.c 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) @@ -632,17 +726,17 @@ nodist_clutter_include_HEADERS = \ 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) \ @@ -660,12 +754,12 @@ libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_SOURCES = \ $(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) \ @@ -717,15 +811,33 @@ EXTRA_DIST += \ # Let the VS9/VS10 Project files be cleared out before they are re-expanded... DISTCLEANFILES += ../build/win32/vs9/clutter.vcproj ../build/win32/vs10/clutter.vcxproj ../build/win32/vs10/clutter.vcxproj.filters +install-exec-local: + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + for lib in `echo $(compat_libs)`; do \ + (cd $(DESTDIR)$(libdir) && \ + rm -f $$lib.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION); \ + ) ; \ + (cd $(DESTDIR)$(libdir) && \ + { ln -s -f libclutter-$(CLUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0 || \ + { rm -f $$lib.0 && ln -s libclutter-1.0.so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0; }; \ + } \ + ) ; \ + (cd $(DESTDIR)$(libdir) && \ + { ln -s -f libclutter-$(CLUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib || \ + { rm -f $$lib && ln -s libclutter-1.0.so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$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) \ @@ -733,7 +845,7 @@ Clutter_@CLUTTER_API_VERSION_AM@_gir_FILES = \ $(source_c) \ $(deprecated_c) \ $(built_source_c) -Clutter_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) -UCLUTTER_DISABLE_DEPRECATED +Clutter_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) Clutter_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = GL-1.0 GObject-2.0 cairo-1.0 Cogl-1.0 CoglPango-1.0 Atk-1.0 Json-1.0 Clutter_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \ --warn-all \ @@ -746,9 +858,9 @@ Cally-@CLUTTER_API_VERSION@.gir: Makefile Clutter-@CLUTTER_API_VERSION@.gir 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_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) Cally_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \ --identifier-prefix=Cally \ --symbol-prefix=cally \ @@ -768,13 +880,30 @@ ClutterX11_@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 +ClutterX11_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) 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) + +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 diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h index 380d92b69..41ea9ab36 100644 --- a/clutter/clutter-actor.h +++ b/clutter/clutter-actor.h @@ -397,11 +397,6 @@ void clutter_actor_set_name (ClutterActor const gchar *name); const gchar * clutter_actor_get_name (ClutterActor *self); -#ifndef CLUTTER_DISABLE_DEPRECATED -CLUTTER_DEPRECATED -guint32 clutter_actor_get_gid (ClutterActor *self); -#endif - void clutter_actor_set_clip (ClutterActor *self, gfloat xoff, gfloat yoff, @@ -470,35 +465,6 @@ gboolean clutter_actor_event (ClutterActor ClutterEvent *event, gboolean capture); -#ifndef CLUTTER_DISABLE_DEPRECATED -CLUTTER_DEPRECATED -ClutterActor * clutter_get_actor_by_gid (guint32 id_); -#endif - -#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION) -CLUTTER_DEPRECATED_FOR(clutter_actor_add_effect) -gboolean clutter_actor_set_shader (ClutterActor *self, - ClutterShader *shader); - -CLUTTER_DEPRECATED_FOR(clutter_actor_get_effect) -ClutterShader * clutter_actor_get_shader (ClutterActor *self); - -CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform_value) -void clutter_actor_set_shader_param (ClutterActor *self, - const gchar *param, - const GValue *value); - -CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform) -void clutter_actor_set_shader_param_int (ClutterActor *self, - const gchar *param, - gint value); - -CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform) -void clutter_actor_set_shader_param_float (ClutterActor *self, - const gchar *param, - gfloat value); -#endif /* CLUTTER_DISABLE_DEPRECATED */ - void clutter_actor_set_anchor_point (ClutterActor *self, gfloat anchor_x, gfloat anchor_y); diff --git a/clutter/clutter-animatable.h b/clutter/clutter-animatable.h index 5be9437c3..8bd3d37a8 100644 --- a/clutter/clutter-animatable.h +++ b/clutter/clutter-animatable.h @@ -97,7 +97,6 @@ struct _ClutterAnimatableIface GType clutter_animatable_get_type (void) G_GNUC_CONST; -#ifndef CLUTTER_DISABLE_DEPRECATED CLUTTER_DEPRECATED_FOR(clutter_animatable_interpolate_value) gboolean clutter_animatable_animate_property (ClutterAnimatable *animatable, ClutterAnimation *animation, @@ -106,7 +105,6 @@ gboolean clutter_animatable_animate_property (ClutterAnimatable *animatable, const GValue *final_value, gdouble progress, GValue *value); -#endif /* CLUTTER_DISABLE_DEPRECATED */ GParamSpec *clutter_animatable_find_property (ClutterAnimatable *animatable, const gchar *property_name); diff --git a/clutter/clutter-backend-private.h b/clutter/clutter-backend-private.h index 3374bbca1..71b80a332 100644 --- a/clutter/clutter-backend-private.h +++ b/clutter/clutter-backend-private.h @@ -23,6 +23,9 @@ #define __CLUTTER_BACKEND_PRIVATE_H__ #include +#include +#include + #include "clutter-event-translator.h" #define CLUTTER_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND, ClutterBackendClass)) @@ -87,9 +90,6 @@ struct _ClutterBackendClass 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, diff --git a/clutter/clutter-backend.h b/clutter/clutter-backend.h index 22707fc65..bea507cf7 100644 --- a/clutter/clutter-backend.h +++ b/clutter/clutter-backend.h @@ -29,18 +29,14 @@ #define __CLUTTER_BACKEND_H__ #include -#include #include + #ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API #include #endif -#include -#include -#include -#include -#include -#include +#include +#include G_BEGIN_DECLS @@ -63,33 +59,6 @@ GType clutter_backend_get_type (void) G_GNUC_CONST; ClutterBackend *clutter_get_default_backend (void); -#ifndef CLUTTER_DISABLE_DEPRECATED -CLUTTER_DEPRECATED_FOR(ClutterSettings:font_dpi) -void clutter_backend_set_resolution (ClutterBackend *backend, - gdouble dpi); - -CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time) -void clutter_backend_set_double_click_time (ClutterBackend *backend, - guint msec); - -CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time) -guint clutter_backend_get_double_click_time (ClutterBackend *backend); - -CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance) -void clutter_backend_set_double_click_distance (ClutterBackend *backend, - guint distance); - -CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance) -guint clutter_backend_get_double_click_distance (ClutterBackend *backend); - -CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name) -void clutter_backend_set_font_name (ClutterBackend *backend, - const gchar *font_name); - -CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name) -const gchar * clutter_backend_get_font_name (ClutterBackend *backend); -#endif /* CLUTTER_DISABLE_DEPRECATED */ - gdouble clutter_backend_get_resolution (ClutterBackend *backend); void clutter_backend_set_font_options (ClutterBackend *backend, diff --git a/clutter/clutter-cairo-texture.c b/clutter/clutter-cairo-texture.c index a6a5b88d9..199f212f2 100644 --- a/clutter/clutter-cairo-texture.c +++ b/clutter/clutter-cairo-texture.c @@ -464,8 +464,8 @@ clutter_cairo_texture_allocate (ClutterActor *self, clutter_actor_box_get_size (allocation, &width, &height); - priv->surface_width = ceilf (width + 0.5); - priv->surface_height = ceilf (height + 0.5); + priv->surface_width = ceilf (width); + priv->surface_height = ceilf (height); clutter_cairo_texture_surface_resize_internal (texture); clutter_cairo_texture_invalidate (texture); @@ -757,49 +757,19 @@ intersect_rectangles (cairo_rectangle_int_t *a, } } -/** - * clutter_cairo_texture_create_region: - * @self: a #ClutterCairoTexture - * @x_offset: offset of the region on the X axis - * @y_offset: offset of the region on the Y axis - * @width: width of the region, or -1 for the full surface width - * @height: height of the region, or -1 for the full surface height - * - * Creates a new Cairo context that will updat the region defined - * by @x_offset, @y_offset, @width and @height. - * - * Do not call this function within the paint virtual - * function or from a callback to the #ClutterActor::paint - * signal. - * - * Return value: a newly created Cairo context. Use cairo_destroy() - * to upload the contents of the context when done drawing - * - * Since: 1.0 - * - * Deprecated: 1.8: Use the #ClutterCairoTexture::draw signal and - * clutter_cairo_texture_invalidate_rectangle() to obtain a - * clipped Cairo context for 2D drawing. - */ -cairo_t * -clutter_cairo_texture_create_region (ClutterCairoTexture *self, - gint x_offset, - gint y_offset, - gint width, - gint height) +static cairo_t * +clutter_cairo_texture_create_region_internal (ClutterCairoTexture *self, + gint x_offset, + gint y_offset, + gint width, + gint height) { - ClutterCairoTexturePrivate *priv; - DrawContext *ctxt; + ClutterCairoTexturePrivate *priv = self->priv; cairo_rectangle_int_t region, area, inter; cairo_surface_t *surface; + DrawContext *ctxt; cairo_t *cr; - g_return_val_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self), NULL); - - clutter_warn_if_paint_fail (self); - - priv = self->priv; - if (width < 0) width = priv->surface_width; @@ -842,6 +812,46 @@ clutter_cairo_texture_create_region (ClutterCairoTexture *self, return cr; } +/** + * clutter_cairo_texture_create_region: + * @self: a #ClutterCairoTexture + * @x_offset: offset of the region on the X axis + * @y_offset: offset of the region on the Y axis + * @width: width of the region, or -1 for the full surface width + * @height: height of the region, or -1 for the full surface height + * + * Creates a new Cairo context that will updat the region defined + * by @x_offset, @y_offset, @width and @height. + * + * Do not call this function within the paint virtual + * function or from a callback to the #ClutterActor::paint + * signal. + * + * Return value: a newly created Cairo context. Use cairo_destroy() + * to upload the contents of the context when done drawing + * + * Since: 1.0 + * + * Deprecated: 1.8: Use the #ClutterCairoTexture::draw signal and + * clutter_cairo_texture_invalidate_rectangle() to obtain a + * clipped Cairo context for 2D drawing. + */ +cairo_t * +clutter_cairo_texture_create_region (ClutterCairoTexture *self, + gint x_offset, + gint y_offset, + gint width, + gint height) +{ + g_return_val_if_fail (CLUTTER_IS_CAIRO_TEXTURE (self), NULL); + + clutter_warn_if_paint_fail (self); + + return clutter_cairo_texture_create_region_internal (self, + x_offset, y_offset, + width, height); +} + /** * clutter_cairo_texture_invalidate_rectangle: * @self: a #ClutterCairoTexture @@ -953,7 +963,7 @@ clutter_cairo_texture_create (ClutterCairoTexture *self) clutter_warn_if_paint_fail (self); - return clutter_cairo_texture_create_region (self, 0, 0, -1, -1); + return clutter_cairo_texture_create_region_internal (self, 0, 0, -1, -1); } /** diff --git a/clutter/clutter-cairo-texture.h b/clutter/clutter-cairo-texture.h index feae77c99..e3936e04c 100644 --- a/clutter/clutter-cairo-texture.h +++ b/clutter/clutter-cairo-texture.h @@ -116,7 +116,6 @@ GType clutter_cairo_texture_get_type (void) G_GNUC_CONST; ClutterActor * clutter_cairo_texture_new (guint width, guint height); -#ifndef CLUTTER_DISABLE_DEPRECATED CLUTTER_DEPRECATED_FOR(clutter_cairo_texture_invalidate_rectangle) cairo_t * clutter_cairo_texture_create_region (ClutterCairoTexture *self, gint x_offset, @@ -126,7 +125,6 @@ cairo_t * clutter_cairo_texture_create_region (ClutterCairoTex CLUTTER_DEPRECATED_FOR(clutter_cairo_texture_invalidate) cairo_t * clutter_cairo_texture_create (ClutterCairoTexture *self); -#endif /* CLUTTER_DISABLE_DEPRECATED */ void clutter_cairo_texture_set_surface_size (ClutterCairoTexture *self, guint width, diff --git a/clutter/clutter-deprecated.h b/clutter/clutter-deprecated.h index 9ac1504f9..7b4da4cbf 100644 --- a/clutter/clutter-deprecated.h +++ b/clutter/clutter-deprecated.h @@ -3,6 +3,8 @@ #define __CLUTTER_DEPRECATED_H_INSIDE__ +#include "deprecated/clutter-actor.h" +#include "deprecated/clutter-backend.h" #include "deprecated/clutter-behaviour.h" #include "deprecated/clutter-behaviour-depth.h" #include "deprecated/clutter-behaviour-ellipse.h" @@ -12,9 +14,13 @@ #include "deprecated/clutter-behaviour-scale.h" #include "deprecated/clutter-fixed.h" #include "deprecated/clutter-frame-source.h" -#include "deprecated/clutter-timeout-pool.h" +#include "deprecated/clutter-group.h" +#include "deprecated/clutter-keysyms.h" +#include "deprecated/clutter-main.h" #include "deprecated/clutter-score.h" #include "deprecated/clutter-shader.h" +#include "deprecated/clutter-stage.h" +#include "deprecated/clutter-timeout-pool.h" #undef __CLUTTER_DEPRECATED_H_INSIDE__ diff --git a/clutter/clutter-group.c b/clutter/clutter-group.c index 41cb7d097..04ca50265 100644 --- a/clutter/clutter-group.c +++ b/clutter/clutter-group.c @@ -353,7 +353,7 @@ clutter_group_dispose (GObject *object) /* Note: we are careful to consider that destroying children could * have the side-effect of destroying other children so * priv->children may be modified during clutter_actor_destroy. */ - while (priv->children) + while (priv->children != NULL) { ClutterActor *child = priv->children->data; priv->children = g_list_delete_link (priv->children, priv->children); @@ -463,24 +463,27 @@ clutter_group_new (void) /** * clutter_group_remove_all: - * @group: A #ClutterGroup + * @self: A #ClutterGroup * * Removes all children actors from the #ClutterGroup. */ void -clutter_group_remove_all (ClutterGroup *group) +clutter_group_remove_all (ClutterGroup *self) { + ClutterContainer *container; GList *children; - g_return_if_fail (CLUTTER_IS_GROUP (group)); + g_return_if_fail (CLUTTER_IS_GROUP (self)); - children = group->priv->children; - while (children) + container = CLUTTER_CONTAINER (self); + children = self->priv->children; + + while (children != NULL) { ClutterActor *child = children->data; children = children->next; - clutter_container_remove_actor (CLUTTER_CONTAINER (group), child); + clutter_container_remove_actor (container, child); } } diff --git a/clutter/clutter-group.h b/clutter/clutter-group.h index 9b270a3d2..0d177922d 100644 --- a/clutter/clutter-group.h +++ b/clutter/clutter-group.h @@ -34,31 +34,16 @@ G_BEGIN_DECLS -#define CLUTTER_TYPE_GROUP clutter_group_get_type() +#define CLUTTER_TYPE_GROUP (clutter_group_get_type ()) +#define CLUTTER_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_GROUP, ClutterGroup)) +#define CLUTTER_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_GROUP, ClutterGroupClass)) +#define CLUTTER_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_GROUP)) +#define CLUTTER_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_GROUP)) +#define CLUTTER_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_GROUP, ClutterGroupClass)) -#define CLUTTER_GROUP(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_GROUP, ClutterGroup)) - -#define CLUTTER_GROUP_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_GROUP, ClutterGroupClass)) - -#define CLUTTER_IS_GROUP(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_GROUP)) - -#define CLUTTER_IS_GROUP_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_GROUP)) - -#define CLUTTER_GROUP_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_GROUP, ClutterGroupClass)) - -typedef struct _ClutterGroup ClutterGroup; -typedef struct _ClutterGroupClass ClutterGroupClass; -typedef struct _ClutterGroupPrivate ClutterGroupPrivate; +typedef struct _ClutterGroup ClutterGroup; +typedef struct _ClutterGroupClass ClutterGroupClass; +typedef struct _ClutterGroupPrivate ClutterGroupPrivate; /** * ClutterGroup: @@ -97,25 +82,13 @@ struct _ClutterGroupClass void (*_clutter_reserved6) (void); }; -GType clutter_group_get_type (void) G_GNUC_CONST; -ClutterActor *clutter_group_new (void); -ClutterActor *clutter_group_get_nth_child (ClutterGroup *self, - gint index_); -gint clutter_group_get_n_children (ClutterGroup *self); -void clutter_group_remove_all (ClutterGroup *group); +GType clutter_group_get_type (void) G_GNUC_CONST; -#ifndef CLUTTER_DISABLE_DEPRECATED - -/* for Mr. Mallum only */ -#define clutter_group_add(group,actor) G_STMT_START { \ - ClutterActor *_actor = (ClutterActor *) (actor); \ - if (CLUTTER_IS_GROUP ((group)) && CLUTTER_IS_ACTOR ((_actor))) \ - { \ - ClutterContainer *_container = (ClutterContainer *) (group); \ - clutter_container_add_actor (_container, _actor); \ - } } G_STMT_END - -#endif /* CLUTTER_DISABLE_DEPRECATED */ +ClutterActor * clutter_group_new (void); +ClutterActor * clutter_group_get_nth_child (ClutterGroup *self, + gint index_); +gint clutter_group_get_n_children (ClutterGroup *self); +void clutter_group_remove_all (ClutterGroup *self); G_END_DECLS diff --git a/clutter/clutter-keysyms-update.pl b/clutter/clutter-keysyms-update.pl index c05322af0..e834bbe81 100755 --- a/clutter/clutter-keysyms-update.pl +++ b/clutter/clutter-keysyms-update.pl @@ -58,9 +58,9 @@ die "Could not open file keysymdef.h: $!\n" die "Could not open file clutter-keysyms.h: $!\n" unless open(OUT_KEYSYMS, ">:utf8", "clutter-keysyms.h"); -# Output: clutter/clutter/clutter-keysyms-compat.h +# Output: clutter/clutter/deprecated/clutter-keysyms.h die "Could not open file clutter-keysyms-compat.h: $!\n" - unless open(OUT_KEYSYMS_COMPAT, ">:utf8", "clutter-keysyms-compat.h"); + unless open(OUT_KEYSYMS_COMPAT, ">:utf8", "deprecated/clutter-keysyms.h"); my $LICENSE_HEADER= < - * * * * #ClutterLayoutManager is available since Clutter 1.2 diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 0f0e88a67..be520fd7f 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -100,6 +100,7 @@ #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" @@ -114,6 +115,25 @@ #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 #include @@ -1293,7 +1313,54 @@ _clutter_context_is_initialized (void) return ClutterCntx->is_initialized; } -static inline ClutterMainContext * +static ClutterBackend * +clutter_create_backend (void) +{ + const char *backend = g_getenv ("CLUTTER_BACKEND"); + ClutterBackend *retval = NULL; + + if (backend != NULL) + backend = g_intern_string (backend); + +#ifdef CLUTTER_WINDOWING_OSX + if (backend == NULL || backend == I_(CLUTTER_WINDOWING_OSX)) + retval = g_object_new (CLUTTER_TYPE_BACKEND_OSX, NULL); + else +#endif +#ifdef CLUTTER_WINDOWING_WIN32 + if (backend == NULL || backend == I_(CLUTTER_WINDOWING_WIN32)) + retval = g_object_new (CLUTTER_TYPE_BACKEND_WIN32, NULL); + else +#endif +#ifdef CLUTTER_WINDOWING_WAYLAND + if (backend == NULL || backend == I_(CLUTTER_WINDOWING_WAYLAND)) + retval = g_object_new (CLUTTER_TYPE_BACKEND_WAYLAND, NULL); + else +#endif +#ifdef CLUTTER_WINDOWING_EGL + if (backend == NULL || backend == I_(CLUTTER_WINDOWING_EGL)) + retval = g_object_new (CLUTTER_TYPE_BACKEND_EGL_NATIVE, NULL); + else +#endif +#ifdef CLUTTER_WINDOWING_X11 + if (backend == NULL || backend == I_(CLUTTER_WINDOWING_X11)) + retval = g_object_new (CLUTTER_TYPE_BACKEND_X11, NULL); + else +#endif +#ifdef CLUTTER_WINDOWING_GDK + if (backend == NULL || backend == I_(CLUTTER_WINDOWING_GDK)) + retval = g_object_new (CLUTTER_TYPE_BACKEND_GDK, NULL); + else +#endif + if (backend == NULL) + g_error ("No default Clutter backend found."); + else + g_error ("Unsupported Clutter backend: '%s'", backend); + + return retval; +} + +static ClutterMainContext * clutter_context_get_default_unlocked (void) { if (G_UNLIKELY (ClutterCntx == NULL)) @@ -1302,11 +1369,10 @@ clutter_context_get_default_unlocked (void) ClutterCntx = ctx = g_new0 (ClutterMainContext, 1); - /* create the default backend */ - ctx->backend = g_object_new (_clutter_backend_impl_get_type (), NULL); - ctx->is_initialized = FALSE; - ctx->motion_events_per_actor = TRUE; + + /* create the windowing system backend */ + ctx->backend = clutter_create_backend (); /* create the default settings object, and store a back pointer to * the backend singleton @@ -1319,6 +1385,7 @@ clutter_context_get_default_unlocked (void) g_timer_start (ctx->timer); #endif + ctx->motion_events_per_actor = TRUE; ctx->last_repaint_id = 1; } @@ -3551,3 +3618,87 @@ _clutter_context_get_motion_events_enabled (void) return context->motion_events_per_actor; } + +/** + * clutter_check_windowing_backend: + * @backend_type: the name of the backend to check + * + * Checks the run-time name of the Clutter windowing system backend, using + * the symbolic macros like %CLUTTER_WINDOWING_WIN32 or + * %CLUTTER_WINDOWING_X11. + * + * This function should be used in conjuction with the compile-time macros + * inside applications and libraries that are using the platform-specific + * windowing system API, to ensure that they are running on the correct + * windowing system; for instance: + * + * |[ + * #ifdef CLUTTER_WINDOWING_X11 + * if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11)) + * { + * /* it is safe to use the clutter_x11_* API */ + * } + * else + * #endif + * #ifdef CLUTTER_WINDOWING_WIN32 + * if (clutter_check_windowing_backend (CLUTTER_WINDOWING_WIN32)) + * { + * /* it is safe to use the clutter_win32_* API */ + * } + * else + * #endif + * g_error ("Unknown Clutter backend."); + * ]| + * + * Return value: %TRUE if the current Clutter windowing system backend is + * the one checked, and %FALSE otherwise + * + * Since: 1.10 + */ +gboolean +clutter_check_windowing_backend (const char *backend_type) +{ + ClutterMainContext *context = _clutter_context_get_default (); + + g_return_val_if_fail (backend_type != NULL, FALSE); + + backend_type = g_intern_string (backend_type); + +#ifdef CLUTTER_WINDOWING_OSX + if (backend_type == I_(CLUTTER_WINDOWING_OSX) && + CLUTTER_IS_BACKEND_OSX (context->backend)) + return TRUE; + else +#endif +#ifdef CLUTTER_WINDOWING_WIN32 + if (backend_type == I_(CLUTTER_WINDOWING_WIN32) && + CLUTTER_IS_BACKEND_WIN32 (context->backend)) + return TRUE; + else +#endif +#ifdef CLUTTER_WINDOWING_WAYLAND + if (backend_type == I_(CLUTTER_WINDOWING_WAYLAND) && + CLUTTER_IS_BACKEND_WAYLAND (context->backend)) + return TRUE; + else +#endif +#ifdef CLUTTER_WINDOWING_EGL + if (backend_type == I_(CLUTTER_WINDOWING_EGL) && + CLUTTER_IS_BACKEND_EGL_NATIVE (context->backend)) + return TRUE; + else +#endif +#ifdef CLUTTER_WINDOWING_GDK + if (backend_type == I_(CLUTTER_WINDOWING_GDK) && + CLUTTER_IS_BACKEND_GDK (context->backend)) + return TRUE; + else +#endif +#ifdef CLUTTER_WINDOWING_X11 + if (backend_type == I_(CLUTTER_WINDOWING_X11) && + CLUTTER_IS_BACKEND_X11 (context->backend)) + return TRUE; + else +#endif + return FALSE; +} diff --git a/clutter/clutter-main.h b/clutter/clutter-main.h index a50405ad1..3cd784690 100644 --- a/clutter/clutter-main.h +++ b/clutter/clutter-main.h @@ -77,126 +77,69 @@ GQuark clutter_init_error_quark (void); #define CLUTTER_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 50) /* Initialisation */ -void clutter_base_init (void); -ClutterInitError clutter_init (int *argc, - char ***argv) - G_GNUC_WARN_UNUSED_RESULT; -ClutterInitError clutter_init_with_args (int *argc, - char ***argv, - const char *parameter_string, - GOptionEntry *entries, - const char *translation_domain, - GError **error) - G_GNUC_WARN_UNUSED_RESULT; -GOptionGroup * clutter_get_option_group (void); -GOptionGroup * clutter_get_option_group_without_init (void); +void clutter_base_init (void); +ClutterInitError clutter_init (int *argc, + char ***argv) G_GNUC_WARN_UNUSED_RESULT; +ClutterInitError clutter_init_with_args (int *argc, + char ***argv, + const char *parameter_string, + GOptionEntry *entries, + const char *translation_domain, + GError **error) G_GNUC_WARN_UNUSED_RESULT; + +GOptionGroup * clutter_get_option_group (void); +GOptionGroup * clutter_get_option_group_without_init (void); /* Mainloop */ -void clutter_main (void); -void clutter_main_quit (void); -gint clutter_main_level (void); +void clutter_main (void); +void clutter_main_quit (void); +gint clutter_main_level (void); -#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION) -CLUTTER_DEPRECATED_FOR(clutter_stage_ensure_redraw) -void clutter_redraw (ClutterStage *stage); -#endif - -void clutter_do_event (ClutterEvent *event); +void clutter_do_event (ClutterEvent *event); /* Debug utility functions */ -gboolean clutter_get_debug_enabled (void); -gboolean clutter_get_show_fps (void); -gulong clutter_get_timestamp (void); -gboolean clutter_get_accessibility_enabled (void); +gboolean clutter_get_debug_enabled (void); +gboolean clutter_get_show_fps (void); +gulong clutter_get_timestamp (void); +gboolean clutter_get_accessibility_enabled (void); /* Threading functions */ -#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION) -CLUTTER_DEPRECATED -void clutter_threads_init (void); -#endif +void clutter_threads_enter (void); +void clutter_threads_leave (void); +void clutter_threads_set_lock_functions (GCallback enter_fn, + GCallback leave_fn); +guint clutter_threads_add_idle (GSourceFunc func, + gpointer data); +guint clutter_threads_add_idle_full (gint priority, + GSourceFunc func, + gpointer data, + GDestroyNotify notify); +guint clutter_threads_add_timeout (guint interval, + GSourceFunc func, + gpointer data); +guint clutter_threads_add_timeout_full (gint priority, + guint interval, + GSourceFunc func, + gpointer data, + GDestroyNotify notify); +guint clutter_threads_add_repaint_func (GSourceFunc func, + gpointer data, + GDestroyNotify notify); +void clutter_threads_remove_repaint_func (guint handle_id); -void clutter_threads_enter (void); -void clutter_threads_leave (void); -void clutter_threads_set_lock_functions (GCallback enter_fn, - GCallback leave_fn); -guint clutter_threads_add_idle (GSourceFunc func, - gpointer data); -guint clutter_threads_add_idle_full (gint priority, - GSourceFunc func, - gpointer data, - GDestroyNotify notify); -guint clutter_threads_add_timeout (guint interval, - GSourceFunc func, - gpointer data); -guint clutter_threads_add_timeout_full (gint priority, - guint interval, - GSourceFunc func, - gpointer data, - GDestroyNotify notify); +void clutter_set_default_frame_rate (guint frames_per_sec); +guint clutter_get_default_frame_rate (void); -#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION) -CLUTTER_DEPRECATED -guint clutter_threads_add_frame_source (guint fps, - GSourceFunc func, - gpointer data); -CLUTTER_DEPRECATED -guint clutter_threads_add_frame_source_full (gint priority, - guint fps, - GSourceFunc func, - gpointer data, - GDestroyNotify notify); -#endif /* CLUTTER_DISABLE_DEPRECATED */ +void clutter_grab_pointer (ClutterActor *actor); +void clutter_ungrab_pointer (void); +ClutterActor * clutter_get_pointer_grab (void); +void clutter_grab_keyboard (ClutterActor *actor); +void clutter_ungrab_keyboard (void); +ClutterActor * clutter_get_keyboard_grab (void); -guint clutter_threads_add_repaint_func (GSourceFunc func, - gpointer data, - GDestroyNotify notify); -void clutter_threads_remove_repaint_func (guint handle_id); +PangoFontMap * clutter_get_font_map (void); -#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION) -CLUTTER_DEPRECATED_FOR(clutter_stage_set_motion_events_enabled) -void clutter_set_motion_events_enabled (gboolean enable); - -CLUTTER_DEPRECATED_FOR(clutter_stage_get_motion_events_enabled) -gboolean clutter_get_motion_events_enabled (void); -#endif /* CLUTTER_DISABLE_DEPRECATED */ - -void clutter_set_default_frame_rate (guint frames_per_sec); -guint clutter_get_default_frame_rate (void); - -void clutter_grab_pointer (ClutterActor *actor); -void clutter_ungrab_pointer (void); -ClutterActor * clutter_get_pointer_grab (void); - -void clutter_grab_keyboard (ClutterActor *actor); -void clutter_ungrab_keyboard (void); -ClutterActor * clutter_get_keyboard_grab (void); - -#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION) -CLUTTER_DEPRECATED_FOR(cogl_pango_font_map_clear_glyph_cache) -void clutter_clear_glyph_cache (void); - -CLUTTER_DEPRECATED_FOR(clutter_backend_set_font_options) -void clutter_set_font_flags (ClutterFontFlags flags); - -CLUTTER_DEPRECATED_FOR(clutter_backend_get_font_options) -ClutterFontFlags clutter_get_font_flags (void); -#endif /* CLUTTER_DISABLE_DEPRECATED */ - -#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION) -CLUTTER_DEPRECATED_FOR(clutter_device_manager_get_device) -ClutterInputDevice *clutter_get_input_device_for_id (gint id_); - -CLUTTER_DEPRECATED_FOR(clutter_input_device_grab) -void clutter_grab_pointer_for_device (ClutterActor *actor, - gint id_); - -CLUTTER_DEPRECATED_FOR(clutter_input_device_ungrab) -void clutter_ungrab_pointer_for_device (gint id_); -#endif /* CLUTTER_DISABLE_DEPRECATED */ - -PangoFontMap * clutter_get_font_map (void); - -ClutterTextDirection clutter_get_default_text_direction (void); +ClutterTextDirection clutter_get_default_text_direction (void); G_END_DECLS diff --git a/clutter/clutter-profile.c b/clutter/clutter-profile.c index de1115682..d12850c2c 100644 --- a/clutter/clutter-profile.c +++ b/clutter/clutter-profile.c @@ -1,6 +1,7 @@ - #ifdef CLUTTER_ENABLE_PROFILE +/* XXX - we need this for g_atexit() */ +#define G_DISABLE_DEPRECATION_WARNINGS #include "clutter-profile.h" #include diff --git a/clutter/clutter-stage-manager.h b/clutter/clutter-stage-manager.h index 6cb9c5171..4baf184fe 100644 --- a/clutter/clutter-stage-manager.h +++ b/clutter/clutter-stage-manager.h @@ -77,10 +77,9 @@ ClutterStage * clutter_stage_manager_get_default_stage (ClutterStageManage GSList * clutter_stage_manager_list_stages (ClutterStageManager *stage_manager); const GSList * clutter_stage_manager_peek_stages (ClutterStageManager *stage_manager); -#ifndef CLUTTER_DISABLE_DEPRECATED +CLUTTER_DEPRECATED void clutter_stage_manager_set_default_stage (ClutterStageManager *stage_manager, ClutterStage *stage); -#endif G_END_DECLS diff --git a/clutter/clutter-stage-window.c b/clutter/clutter-stage-window.c index 1b61a1d59..7ca171ee4 100644 --- a/clutter/clutter-stage-window.c +++ b/clutter/clutter-stage-window.c @@ -234,3 +234,17 @@ _clutter_stage_window_get_active_framebuffer (ClutterStageWindow *window) else return NULL; } + +gboolean +_clutter_stage_window_can_clip_redraws (ClutterStageWindow *window) +{ + ClutterStageWindowIface *iface; + + g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE); + + iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window); + if (iface->can_clip_redraws != NULL) + return iface->can_clip_redraws (window); + + return FALSE; +} diff --git a/clutter/clutter-stage-window.h b/clutter/clutter-stage-window.h index 8fa0ddfab..a715ecdd1 100644 --- a/clutter/clutter-stage-window.h +++ b/clutter/clutter-stage-window.h @@ -75,6 +75,8 @@ struct _ClutterStageWindowIface void (* redraw) (ClutterStageWindow *stage_window); CoglFramebuffer *(* get_active_framebuffer) (ClutterStageWindow *stage_window); + + gboolean (* can_clip_redraws) (ClutterStageWindow *stage_window); }; GType clutter_stage_window_get_type (void) G_GNUC_CONST; @@ -118,6 +120,8 @@ void _clutter_stage_window_redraw (ClutterStageWin CoglFramebuffer *_clutter_stage_window_get_active_framebuffer (ClutterStageWindow *window); +gboolean _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window); + G_END_DECLS #endif /* __CLUTTER_STAGE_WINDOW_H__ */ diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h index 029dbced0..4606d5200 100644 --- a/clutter/clutter-stage.h +++ b/clutter/clutter-stage.h @@ -46,32 +46,6 @@ G_BEGIN_DECLS #define CLUTTER_IS_STAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_STAGE)) #define CLUTTER_STAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_STAGE, ClutterStageClass)) -#ifndef CLUTTER_DISABLE_DEPRECATED - -/** - * CLUTTER_STAGE_WIDTH: - * - * Macro that evaluates to the width of the default stage - * - * Since: 0.2 - * - * Deprecated: 1.2: Use clutter_actor_get_width() instead - */ -#define CLUTTER_STAGE_WIDTH() (clutter_actor_get_width (clutter_stage_get_default ())) - -/** - * CLUTTER_STAGE_HEIGHT: - * - * Macro that evaluates to the height of the default stage - * - * Since: 0.2 - * - * Deprecated: 1.2: use clutter_actor_get_height() instead - */ -#define CLUTTER_STAGE_HEIGHT() (clutter_actor_get_height (clutter_stage_get_default ())) - -#endif /* !CLUTTER_DISABLE_DEPRECATED */ - typedef struct _ClutterPerspective ClutterPerspective; typedef struct _ClutterFog ClutterFog; @@ -255,19 +229,6 @@ void clutter_stage_set_motion_events_enabled (ClutterStage *sta gboolean enabled); gboolean clutter_stage_get_motion_events_enabled (ClutterStage *stage); -#ifndef CLUTTER_DISABLE_DEPRECATED - -/* Commodity macro, for mallum only */ -#define clutter_stage_add(stage,actor) G_STMT_START { \ - if (CLUTTER_IS_STAGE ((stage)) && CLUTTER_IS_ACTOR ((actor))) \ - { \ - ClutterContainer *_container = (ClutterContainer *) (stage); \ - ClutterActor *_actor = (ClutterActor *) (actor); \ - clutter_container_add_actor (_container, _actor); \ - } } G_STMT_END - -#endif /* CLUTTER_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __CLUTTER_STAGE_H__ */ diff --git a/clutter/clutter-texture.h b/clutter/clutter-texture.h index 8c9431ae2..c766a3ded 100644 --- a/clutter/clutter-texture.h +++ b/clutter/clutter-texture.h @@ -127,10 +127,8 @@ ClutterActor * clutter_texture_new (void); ClutterActor * clutter_texture_new_from_file (const gchar *filename, GError **error); -#ifndef CLUTTER_DISABLE_DEPRECATED CLUTTER_DEPRECATED_FOR(ClutterOffscreenEffect) ClutterActor * clutter_texture_new_from_actor (ClutterActor *actor); -#endif /* CLUTTER_DISABLE_DEPRECATED */ gboolean clutter_texture_set_from_file (ClutterTexture *texture, const gchar *filename, diff --git a/clutter/clutter-types.h b/clutter/clutter-types.h index 0ce665500..69665c076 100644 --- a/clutter/clutter-types.h +++ b/clutter/clutter-types.h @@ -72,18 +72,15 @@ typedef struct _ClutterEffect ClutterEffect; typedef struct _ClutterPath ClutterPath; -#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION) -typedef struct _ClutterBehaviour ClutterBehaviour; - -typedef struct _ClutterShader ClutterShader; -#endif /* DISABLE_DEPRECATED */ - typedef struct _ClutterActorBox ClutterActorBox; typedef struct _ClutterColor ClutterColor; typedef struct _ClutterGeometry ClutterGeometry; typedef struct _ClutterKnot ClutterKnot; typedef struct _ClutterVertex ClutterVertex; +typedef struct _ClutterBehaviour ClutterBehaviour; +typedef struct _ClutterShader ClutterShader; + typedef union _ClutterEvent ClutterEvent; /** diff --git a/clutter/clutter-util.h b/clutter/clutter-util.h index 63a382358..26fb7d860 100644 --- a/clutter/clutter-util.h +++ b/clutter/clutter-util.h @@ -32,13 +32,9 @@ G_BEGIN_DECLS -#ifndef CLUTTER_DISABLE_DEPRECATED - CLUTTER_DEPRECATED gint clutter_util_next_p2 (gint a); -#endif /* CLUTTER_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __CLUTTER_UTIL_H__ */ diff --git a/clutter/clutter-version.h.in b/clutter/clutter-version.h.in index 73df000da..a08d768aa 100644 --- a/clutter/clutter-version.h.in +++ b/clutter/clutter-version.h.in @@ -103,6 +103,12 @@ G_BEGIN_DECLS * 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@" @@ -113,6 +119,9 @@ G_BEGIN_DECLS * "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@" @@ -122,6 +131,11 @@ G_BEGIN_DECLS * 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@ @@ -181,6 +195,8 @@ gboolean clutter_check_version (guint major, guint minor, guint micro); +gboolean clutter_check_windowing_backend (const char *backend_type); + G_END_DECLS #endif /* __CLUTTER_VERSION_H__ */ diff --git a/clutter/clutter.h b/clutter/clutter.h index 7c5c85d9f..231f688f3 100644 --- a/clutter/clutter.h +++ b/clutter/clutter.h @@ -103,9 +103,7 @@ #include "clutter-enum-types.h" -#ifndef CLUTTER_DISABLE_DEPRECATED #include "clutter-deprecated.h" -#endif #undef __CLUTTER_H_INSIDE__ diff --git a/clutter/clutter.pc.in b/clutter/clutter.pc.in index 4a5afe904..0abf62fdd 100644 --- a/clutter/clutter.pc.in +++ b/clutter/clutter.pc.in @@ -4,18 +4,19 @@ libdir=@libdir@ 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} diff --git a/clutter/cogl/clutter-backend-cogl.c b/clutter/cogl/clutter-backend-cogl.c index 1ca885025..af0ad1400 100644 --- a/clutter/cogl/clutter-backend-cogl.c +++ b/clutter/cogl/clutter-backend-cogl.c @@ -39,44 +39,16 @@ #include "clutter-backend-cogl.h" #include "clutter-stage-cogl.h" -#ifdef HAVE_EVDEV -#include "clutter-device-manager-evdev.h" -#endif - #include "clutter-debug.h" #include "clutter-private.h" #include "clutter-main.h" #include "clutter-stage-private.h" -#ifdef COGL_HAS_EGL_SUPPORT -#include "clutter-egl.h" -#endif -#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT -#include "clutter-cex100.h" -#endif - static ClutterBackendCogl *backend_singleton = NULL; static gchar *clutter_vblank = NULL; -/* FIXME: We should have CLUTTER_ define for this... */ -#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT -static gdl_plane_id_t gdl_plane = GDL_PLANE_ID_UPP_C; -static guint gdl_n_buffers = CLUTTER_CEX100_TRIPLE_BUFFERING; -#endif - -#ifdef COGL_HAS_X11_SUPPORT -G_DEFINE_TYPE (ClutterBackendCogl, _clutter_backend_cogl, CLUTTER_TYPE_BACKEND_X11); -#else G_DEFINE_TYPE (ClutterBackendCogl, _clutter_backend_cogl, CLUTTER_TYPE_BACKEND); -#endif - -static void -clutter_backend_at_exit (void) -{ - if (backend_singleton) - g_object_run_dispose (G_OBJECT (backend_singleton)); -} const gchar* _clutter_backend_cogl_get_vblank (void) @@ -92,13 +64,6 @@ clutter_backend_cogl_pre_parse (ClutterBackend *backend, GError **error) { const gchar *env_string; -#ifdef COGL_HAS_X11_SUPPORT - ClutterBackendClass *parent_class = - CLUTTER_BACKEND_CLASS (_clutter_backend_cogl_parent_class); - - if (!parent_class->pre_parse (backend, error)) - return FALSE; -#endif env_string = g_getenv ("CLUTTER_VBLANK"); if (env_string) @@ -114,56 +79,7 @@ static gboolean clutter_backend_cogl_post_parse (ClutterBackend *backend, GError **error) { -#ifdef COGL_HAS_X11_SUPPORT - ClutterBackendClass *parent_class = - CLUTTER_BACKEND_CLASS (_clutter_backend_cogl_parent_class); - - if (!parent_class->post_parse (backend, error)) - return FALSE; - return TRUE; -#endif - - g_atexit (clutter_backend_at_exit); - - return TRUE; -} - -#ifndef COGL_HAS_XLIB_SUPPORT -static ClutterDeviceManager * -clutter_backend_cogl_get_device_manager (ClutterBackend *backend) -{ - ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (backend); - - if (G_UNLIKELY (backend_cogl->device_manager == NULL)) - { -#ifdef HAVE_EVDEV - backend_cogl->device_manager = - g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_EVDEV, - "backend", backend_cogl, - NULL); -#endif - } - - return backend_cogl->device_manager; -} -#endif - -static void -clutter_backend_cogl_init_events (ClutterBackend *backend) -{ -#ifdef HAVE_TSLIB - /* XXX: This should be renamed to _clutter_events_tslib_init */ - _clutter_events_tslib_init (CLUTTER_BACKEND_COGL (backend)); -#endif -#ifdef HAVE_EVDEV - _clutter_events_evdev_init (CLUTTER_BACKEND (backend)); -#endif -#ifdef COGL_HAS_X11_SUPPORT - /* Chain up to the X11 backend */ - CLUTTER_BACKEND_CLASS (_clutter_backend_cogl_parent_class)-> - init_events (backend); -#endif } static void @@ -179,14 +95,6 @@ static void clutter_backend_cogl_dispose (GObject *gobject) { ClutterBackend *backend = CLUTTER_BACKEND (gobject); -#ifdef HAVE_TSLIB - ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (gobject); -#endif - - /* We chain up before disposing our CoglContext so that we will - * destroy all of the stages first. Otherwise the actors may try to - * make Cogl calls during destruction which would cause a crash */ - G_OBJECT_CLASS (_clutter_backend_cogl_parent_class)->dispose (gobject); if (backend->cogl_context) { @@ -194,16 +102,7 @@ clutter_backend_cogl_dispose (GObject *gobject) backend->cogl_context = NULL; } -#ifdef HAVE_TSLIB - /* XXX: This should be renamed to _clutter_events_tslib_uninit */ - _clutter_events_egl_uninit (backend_cogl); - - if (backend_cogl->event_timer != NULL) - { - g_timer_destroy (backend_cogl->event_timer); - backend_cogl->event_timer = NULL; - } -#endif + G_OBJECT_CLASS (_clutter_backend_cogl_parent_class)->dispose (gobject); } static GObject * @@ -214,7 +113,7 @@ clutter_backend_cogl_constructor (GType gtype, GObjectClass *parent_class; GObject *retval; - if (!backend_singleton) + if (backend_singleton == NULL) { parent_class = G_OBJECT_CLASS (_clutter_backend_cogl_parent_class); retval = parent_class->constructor (gtype, n_params, params); @@ -234,17 +133,8 @@ static ClutterFeatureFlags clutter_backend_cogl_get_features (ClutterBackend *backend) { ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (backend); -#ifdef COGL_HAS_XLIB_SUPPORT - ClutterBackendClass *parent_class; -#endif ClutterFeatureFlags flags = 0; -#ifdef COGL_HAS_XLIB_SUPPORT - parent_class = CLUTTER_BACKEND_CLASS (_clutter_backend_cogl_parent_class); - - flags = parent_class->get_features (backend); -#endif - if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_MULTIPLE_ONSCREEN)) { CLUTTER_NOTE (BACKEND, "Cogl supports multiple onscreen framebuffers"); @@ -279,150 +169,6 @@ clutter_backend_cogl_get_features (ClutterBackend *backend) return flags; } -#ifdef COGL_HAS_XLIB_SUPPORT -static XVisualInfo * -clutter_backend_cogl_get_visual_info (ClutterBackendX11 *backend_x11) -{ - return cogl_clutter_winsys_xlib_get_visual_info (); -} -#endif - -static gboolean -clutter_backend_cogl_create_context (ClutterBackend *backend, - GError **error) -{ -#ifdef COGL_HAS_XLIB_SUPPORT - ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend); -#endif - CoglSwapChain *swap_chain = NULL; - CoglOnscreenTemplate *onscreen_template = NULL; - - if (backend->cogl_context) - return TRUE; - - backend->cogl_renderer = cogl_renderer_new (); -#ifdef COGL_HAS_XLIB_SUPPORT - cogl_xlib_renderer_set_foreign_display (backend->cogl_renderer, - backend_x11->xdpy); -#endif - if (!cogl_renderer_connect (backend->cogl_renderer, error)) - goto error; - - swap_chain = cogl_swap_chain_new (); -#ifdef COGL_HAS_XLIB_SUPPORT - cogl_swap_chain_set_has_alpha (swap_chain, - clutter_x11_get_use_argb_visual ()); -#endif - -#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT - cogl_swap_chain_set_length (swap_chain, gdl_n_buffers); -#endif - - onscreen_template = cogl_onscreen_template_new (swap_chain); - cogl_object_unref (swap_chain); - - /* XXX: I have some doubts that this is a good design. - * Conceptually should we be able to check an onscreen_template - * without more details about the CoglDisplay configuration? - */ - if (!cogl_renderer_check_onscreen_template (backend->cogl_renderer, - onscreen_template, - error)) - goto error; - - 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 - - cogl_object_unref (backend->cogl_renderer); - cogl_object_unref (onscreen_template); - - if (!cogl_display_setup (backend->cogl_display, error)) - goto error; - - backend->cogl_context = cogl_context_new (backend->cogl_display, error); - if (!backend->cogl_context) - goto error; - - return TRUE; - -error: - if (backend->cogl_display) - { - cogl_object_unref (backend->cogl_display); - backend->cogl_display = NULL; - } - - if (onscreen_template) - cogl_object_unref (onscreen_template); - if (swap_chain) - cogl_object_unref (swap_chain); - - if (backend->cogl_renderer) - { - cogl_object_unref (backend->cogl_renderer); - backend->cogl_renderer = NULL; - } - return FALSE; -} - -static ClutterStageWindow * -clutter_backend_cogl_create_stage (ClutterBackend *backend, - ClutterStage *wrapper, - GError **error) -{ -#ifdef COGL_HAS_XLIB_SUPPORT - ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend); - ClutterEventTranslator *translator; - ClutterStageWindow *stage; - ClutterStageX11 *stage_x11; - - stage = g_object_new (CLUTTER_TYPE_STAGE_COGL, NULL); - - /* copy backend data into the stage */ - stage_x11 = CLUTTER_STAGE_X11 (stage); - stage_x11->wrapper = wrapper; - stage_x11->backend = backend_x11; - - translator = CLUTTER_EVENT_TRANSLATOR (stage_x11); - _clutter_backend_add_event_translator (backend, translator); - - CLUTTER_NOTE (MISC, "Cogl stage created (display:%p, screen:%d, root:%u)", - backend_x11->xdpy, - backend_x11->xscreen_num, - (unsigned int) backend_x11->xwin_root); - -#else /* COGL_HAS_XLIB_SUPPORT */ - - ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (backend); - ClutterStageWindow *stage; - ClutterStageCogl *stage_cogl; - - if (G_UNLIKELY (backend_cogl->stage != NULL)) - { - g_set_error (error, CLUTTER_INIT_ERROR, - CLUTTER_INIT_ERROR_BACKEND, - "The Cogl backend does not support multiple " - "onscreen windows"); - return backend_cogl->stage; - } - - stage = g_object_new (CLUTTER_TYPE_STAGE_COGL, NULL); - - stage_cogl = CLUTTER_STAGE_COGL (stage); - stage_cogl->backend = backend_cogl; - stage_cogl->wrapper = wrapper; - - backend_cogl->stage = stage; - -#endif /* COGL_HAS_XLIB_SUPPORT */ - - return stage; -} - static void clutter_backend_cogl_ensure_context (ClutterBackend *backend, ClutterStage *stage) @@ -444,86 +190,18 @@ _clutter_backend_cogl_class_init (ClutterBackendCoglClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass); -#ifdef COGL_HAS_X11_SUPPORT - ClutterBackendX11Class *backendx11_class = CLUTTER_BACKEND_X11_CLASS (klass); -#endif gobject_class->constructor = clutter_backend_cogl_constructor; - gobject_class->dispose = clutter_backend_cogl_dispose; - gobject_class->finalize = clutter_backend_cogl_finalize; + gobject_class->dispose = clutter_backend_cogl_dispose; + gobject_class->finalize = clutter_backend_cogl_finalize; - backend_class->pre_parse = clutter_backend_cogl_pre_parse; - backend_class->post_parse = clutter_backend_cogl_post_parse; - backend_class->get_features = clutter_backend_cogl_get_features; -#ifndef COGL_HAS_XLIB_SUPPORT - backend_class->get_device_manager = clutter_backend_cogl_get_device_manager; -#endif - backend_class->init_events = clutter_backend_cogl_init_events; - backend_class->create_stage = clutter_backend_cogl_create_stage; - backend_class->create_context = clutter_backend_cogl_create_context; - backend_class->ensure_context = clutter_backend_cogl_ensure_context; - -#ifdef COGL_HAS_XLIB_SUPPORT - backendx11_class->get_visual_info = clutter_backend_cogl_get_visual_info; -#endif + backend_class->pre_parse = clutter_backend_cogl_pre_parse; + backend_class->post_parse = clutter_backend_cogl_post_parse; + backend_class->get_features = clutter_backend_cogl_get_features; + backend_class->ensure_context = clutter_backend_cogl_ensure_context; } static void _clutter_backend_cogl_init (ClutterBackendCogl *backend_cogl) { -#ifdef HAVE_TSLIB - backend_cogl->event_timer = g_timer_new (); -#endif } - -GType -_clutter_backend_impl_get_type (void) -{ - return _clutter_backend_cogl_get_type (); -} - -#ifdef COGL_HAS_EGL_SUPPORT -EGLDisplay -clutter_eglx_display (void) -{ - return clutter_egl_get_egl_display (); -} - -EGLDisplay -clutter_egl_display (void) -{ - return clutter_egl_get_egl_display (); -} - -EGLDisplay -clutter_egl_get_egl_display (void) -{ - if (backend_singleton == NULL) - { - g_critical ("%s has been called before clutter_init()", G_STRFUNC); - return 0; - } - - return cogl_egl_context_get_egl_display (backend_singleton->cogl_context); -} -#endif - -/* FIXME we should have a CLUTTER_ define for this */ -#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT -void -clutter_cex100_set_plane (gdl_plane_id_t plane) -{ - g_return_if_fail (plane >= GDL_PLANE_ID_UPP_A && plane <= GDL_PLANE_ID_UPP_E); - - gdl_plane = plane; -} - -void -clutter_cex100_set_buffering_mode (ClutterCex100BufferingMode mode) -{ - g_return_if_fail (mode == CLUTTER_CEX100_DOUBLE_BUFFERING || - mode == CLUTTER_CEX100_TRIPLE_BUFFERING); - - gdl_n_buffers = mode; -} -#endif diff --git a/clutter/cogl/clutter-backend-cogl.h b/clutter/cogl/clutter-backend-cogl.h index c1563d390..2467d9d9e 100644 --- a/clutter/cogl/clutter-backend-cogl.h +++ b/clutter/cogl/clutter-backend-cogl.h @@ -37,10 +37,6 @@ #include "clutter-backend-private.h" -#ifdef COGL_HAS_X11_SUPPORT -#include "../x11/clutter-backend-x11.h" -#endif - G_BEGIN_DECLS #define CLUTTER_TYPE_BACKEND_COGL (_clutter_backend_cogl_get_type ()) @@ -55,47 +51,18 @@ typedef struct _ClutterBackendCoglClass ClutterBackendCoglClass; struct _ClutterBackendCogl { -#ifdef COGL_HAS_XLIB_SUPPORT - ClutterBackendX11 parent_instance; - -#else /* COGL_HAS_X11_SUPPORT */ ClutterBackend parent_instance; - /* main stage singleton */ - ClutterStageWindow *stage; - - /* device manager (ie evdev) */ - ClutterDeviceManager *device_manager; - - /* event source */ - GSource *event_source; - - /* event timer */ - GTimer *event_timer; - -#endif /* COGL_HAS_X11_SUPPORT */ - - CoglContext *cogl_context; - gboolean can_blit_sub_buffer; }; struct _ClutterBackendCoglClass { -#ifdef COGL_HAS_XLIB_SUPPORT - ClutterBackendX11Class parent_class; -#else ClutterBackendClass parent_class; -#endif }; GType _clutter_backend_cogl_get_type (void) G_GNUC_CONST; -#ifdef HAVE_TSLIB -void _clutter_events_tslib_init (ClutterBackendCogl *backend); -void _clutter_events_tslib_uninit (ClutterBackendCogl *backend); -#endif - const gchar *_clutter_backend_cogl_get_vblank (void); G_END_DECLS diff --git a/clutter/cogl/clutter-stage-cogl.c b/clutter/cogl/clutter-stage-cogl.c index 0acec4bef..80801443f 100644 --- a/clutter/cogl/clutter-stage-cogl.c +++ b/clutter/cogl/clutter-stage-cogl.c @@ -30,6 +30,8 @@ #include "config.h" #endif +#include "clutter-config.h" + #include "clutter-stage-cogl.h" #include "clutter-backend-cogl.h" @@ -43,22 +45,21 @@ #include "clutter-stage-private.h" #include "clutter-util.h" -#ifdef COGL_HAS_X11_SUPPORT -static ClutterStageWindowIface *clutter_stage_window_parent_iface = NULL; -#endif - static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface); G_DEFINE_TYPE_WITH_CODE (ClutterStageCogl, _clutter_stage_cogl, -#ifdef COGL_HAS_X11_SUPPORT - CLUTTER_TYPE_STAGE_X11, -#else G_TYPE_OBJECT, -#endif G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW, clutter_stage_window_iface_init)); +enum { + PROP_0, + PROP_WRAPPER, + PROP_BACKEND, + PROP_LAST +}; + static void clutter_stage_cogl_unrealize (ClutterStageWindow *stage_window) { @@ -66,11 +67,6 @@ clutter_stage_cogl_unrealize (ClutterStageWindow *stage_window) CLUTTER_NOTE (BACKEND, "Unrealizing Cogl stage [%p]", stage_cogl); -#ifdef COGL_HAS_XLIB_SUPPORT - /* chain up to the StageX11 implementation */ - clutter_stage_window_parent_iface->unrealize (stage_window); -#endif - if (stage_cogl->onscreen != NULL) { cogl_object_unref (stage_cogl->onscreen); @@ -101,9 +97,6 @@ static gboolean clutter_stage_cogl_realize (ClutterStageWindow *stage_window) { ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); -#ifdef COGL_HAS_XLIB_SUPPORT - ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); -#endif ClutterBackend *backend; CoglFramebuffer *framebuffer; GError *error = NULL; @@ -117,23 +110,11 @@ clutter_stage_cogl_realize (ClutterStageWindow *stage_window) backend = clutter_get_default_backend (); -#ifdef COGL_HAS_XLIB_SUPPORT - clutter_actor_get_size (CLUTTER_ACTOR (stage_x11->wrapper), &width, &height); -#endif - - stage_cogl->onscreen = cogl_onscreen_new (backend->cogl_context, - width, height); - -#ifdef COGL_HAS_XLIB_SUPPORT - if (stage_x11->xwin != None) + if (stage_cogl->onscreen == NULL) { - cogl_x11_onscreen_set_foreign_window_xid (stage_cogl->onscreen, - stage_x11->xwin, - _clutter_stage_x11_update_foreign_event_mask, - stage_x11); - + stage_cogl->onscreen = cogl_onscreen_new (backend->cogl_context, + width, height); } -#endif clutter_vblank = _clutter_backend_cogl_get_vblank (); if (clutter_vblank && strcmp (clutter_vblank, "none") == 0) @@ -149,7 +130,7 @@ clutter_stage_cogl_realize (ClutterStageWindow *stage_window) return FALSE; } - /* FIXME: for fullscreen Cogl platforms then the size we gave above + /* FIXME: for fullscreen Cogl platforms then the size we gave * will be ignored, so we need to make sure the stage size is * updated to this size. */ @@ -161,14 +142,7 @@ clutter_stage_cogl_realize (ClutterStageWindow *stage_window) stage_cogl); } -#ifdef COGL_HAS_XLIB_SUPPORT - if (stage_x11->xwin == None) - stage_x11->xwin = cogl_x11_onscreen_get_window_xid (stage_cogl->onscreen); - - return clutter_stage_window_parent_iface->realize (stage_window); -#else return TRUE; -#endif } static int @@ -179,8 +153,6 @@ clutter_stage_cogl_get_pending_swaps (ClutterStageWindow *stage_window) return stage_cogl->pending_swaps; } -#ifndef COGL_HAS_XLIB_SUPPORT - static ClutterActor * clutter_stage_cogl_get_wrapper (ClutterStageWindow *stage_window) { @@ -189,7 +161,7 @@ clutter_stage_cogl_get_wrapper (ClutterStageWindow *stage_window) static void clutter_stage_cogl_show (ClutterStageWindow *stage_window, - gboolean do_raise) + gboolean do_raise) { ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); @@ -238,8 +210,6 @@ clutter_stage_cogl_resize (ClutterStageWindow *stage_window, { } -#endif /* COGL_HAS_XLIB_SUPPORT */ - static gboolean clutter_stage_cogl_has_redraw_clips (ClutterStageWindow *stage_window) { @@ -368,13 +338,7 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window) "The time spent in blit_sub_buffer", 0 /* no application private data */); -#ifdef COGL_HAS_X11_SUPPORT - ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_cogl); - - wrapper = CLUTTER_ACTOR (stage_x11->wrapper); -#else wrapper = CLUTTER_ACTOR (stage_cogl->wrapper); -#endif if (!stage_cogl->onscreen) return; @@ -384,24 +348,17 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window) CLUTTER_TIMER_START (_clutter_uprof_context, painting_timer); - if (G_LIKELY (backend_cogl->can_blit_sub_buffer) && + may_use_clipped_redraw = FALSE; + if (_clutter_stage_window_can_clip_redraws (stage_window) && + 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) -#ifdef COGL_HAS_X11_SUPPORT - /* While resizing a window clipped redraws are disabled to avoid - * artefacts. See clutter-event-x11.c:event_translate for a - * detailed explanation */ - && G_LIKELY (stage_x11->clipped_redraws_cool_off == 0) -#endif - ) + G_LIKELY (stage_cogl->frame_count > 3)) { may_use_clipped_redraw = TRUE; } - else - may_use_clipped_redraw = FALSE; if (may_use_clipped_redraw && G_LIKELY (!(clutter_paint_debug_flags & @@ -564,16 +521,6 @@ clutter_stage_cogl_get_active_framebuffer (ClutterStageWindow *stage_window) static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface) { -#ifdef COGL_HAS_X11_SUPPORT - clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface); - - iface->realize = clutter_stage_cogl_realize; - iface->unrealize = clutter_stage_cogl_unrealize; - - /* the rest is inherited from ClutterStageX11 */ - -#else /* COGL_HAS_X11_SUPPORT */ - iface->realize = clutter_stage_cogl_realize; iface->unrealize = clutter_stage_cogl_unrealize; iface->get_wrapper = clutter_stage_cogl_get_wrapper; @@ -581,9 +528,6 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface) iface->resize = clutter_stage_cogl_resize; iface->show = clutter_stage_cogl_show; iface->hide = clutter_stage_cogl_hide; - -#endif /* COGL_HAS_X11_SUPPORT */ - iface->get_pending_swaps = clutter_stage_cogl_get_pending_swaps; iface->add_redraw_clip = clutter_stage_cogl_add_redraw_clip; iface->has_redraw_clips = clutter_stage_cogl_has_redraw_clips; @@ -593,11 +537,28 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface) iface->get_active_framebuffer = clutter_stage_cogl_get_active_framebuffer; } -#ifdef COGL_HAS_X11_SUPPORT static void -clutter_stage_cogl_dispose (GObject *gobject) +clutter_stage_cogl_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { - G_OBJECT_CLASS (_clutter_stage_cogl_parent_class)->dispose (gobject); + ClutterStageCogl *self = CLUTTER_STAGE_COGL (gobject); + + switch (prop_id) + { + case PROP_WRAPPER: + self->wrapper = CLUTTER_STAGE (g_value_get_object (value)); + break; + + case PROP_BACKEND: + self->backend = CLUTTER_BACKEND_COGL (g_value_get_object (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } } static void @@ -605,14 +566,22 @@ _clutter_stage_cogl_class_init (ClutterStageCoglClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - gobject_class->dispose = clutter_stage_cogl_dispose; + gobject_class->set_property = clutter_stage_cogl_set_property; + + g_object_class_install_property (gobject_class, PROP_WRAPPER, + g_param_spec_object ("wrapper", + "Wrapper", + "ClutterStage wrapping this native stage", + CLUTTER_TYPE_STAGE, + CLUTTER_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + + g_object_class_install_property (gobject_class, PROP_BACKEND, + g_param_spec_object ("backend", + "ClutterBackend", + "The Clutter backend singleton", + CLUTTER_TYPE_BACKEND_COGL, + CLUTTER_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); } -#else -static void -_clutter_stage_cogl_class_init (ClutterStageCoglClass *klass) -{ -} -#endif /* COGL_HAS_X11_SUPPORT */ static void _clutter_stage_cogl_init (ClutterStageCogl *stage) diff --git a/clutter/cogl/clutter-stage-cogl.h b/clutter/cogl/clutter-stage-cogl.h index 73bfb06e0..d3a9b9806 100644 --- a/clutter/cogl/clutter-stage-cogl.h +++ b/clutter/cogl/clutter-stage-cogl.h @@ -1,10 +1,6 @@ #ifndef __CLUTTER_STAGE_COGL_H__ #define __CLUTTER_STAGE_COGL_H__ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include #include @@ -13,7 +9,6 @@ #include #include #include -#include "../x11/clutter-stage-x11.h" #endif #include "clutter-backend-cogl.h" @@ -32,12 +27,6 @@ typedef struct _ClutterStageCoglClass ClutterStageCoglClass; struct _ClutterStageCogl { -#ifdef COGL_HAS_X11_SUPPORT - - ClutterStageX11 parent_instance; - -#else - GObject parent_instance; /* the stage wrapper */ @@ -46,8 +35,6 @@ struct _ClutterStageCogl /* back pointer to the backend */ ClutterBackendCogl *backend; -#endif - CoglOnscreen *onscreen; gint pending_swaps; @@ -69,11 +56,7 @@ struct _ClutterStageCogl struct _ClutterStageCoglClass { -#ifdef COGL_HAS_X11_SUPPORT - ClutterStageX11Class parent_class; -#else GObjectClass parent_class; -#endif }; GType _clutter_stage_cogl_get_type (void) G_GNUC_CONST; diff --git a/clutter/deprecated/clutter-actor.h b/clutter/deprecated/clutter-actor.h new file mode 100644 index 000000000..9d9f001fa --- /dev/null +++ b/clutter/deprecated/clutter-actor.h @@ -0,0 +1,16 @@ +#ifndef __CLUTTER_ACTOR_DEPRECATED_H__ +#define __CLUTTER_ACTOR_DEPRECATED_H__ + +#include + +G_BEGIN_DECLS + +CLUTTER_DEPRECATED +guint32 clutter_actor_get_gid (ClutterActor *self); + +CLUTTER_DEPRECATED +ClutterActor * clutter_get_actor_by_gid (guint32 id_); + +G_END_DECLS + +#endif /* __CLUTTER_ACTOR_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-backend.h b/clutter/deprecated/clutter-backend.h new file mode 100644 index 000000000..d4aca207a --- /dev/null +++ b/clutter/deprecated/clutter-backend.h @@ -0,0 +1,36 @@ +#ifndef __CLUTTER_BACKEND_DEPRECATED_H__ +#define __CLUTTER_BACKEND_DEPRECATED_H__ + +#include + +G_BEGIN_DECLS + +CLUTTER_DEPRECATED_FOR(ClutterSettings:font_dpi) +void clutter_backend_set_resolution (ClutterBackend *backend, + gdouble dpi); + +CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time) +void clutter_backend_set_double_click_time (ClutterBackend *backend, + guint msec); + +CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time) +guint clutter_backend_get_double_click_time (ClutterBackend *backend); + +CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance) +void clutter_backend_set_double_click_distance (ClutterBackend *backend, + guint distance); + +CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance) +guint clutter_backend_get_double_click_distance (ClutterBackend *backend); + +CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name) +void clutter_backend_set_font_name (ClutterBackend *backend, + const gchar *font_name); + +CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name) +const gchar * clutter_backend_get_font_name (ClutterBackend *backend); + + +G_END_DECLS + +#endif /* __CLUTTER_BACKEND_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-group.h b/clutter/deprecated/clutter-group.h new file mode 100644 index 000000000..0f0536c22 --- /dev/null +++ b/clutter/deprecated/clutter-group.h @@ -0,0 +1,23 @@ +#ifndef __CLUTTER_GROUP_DEPRECATED_H__ +#define __CLUTTER_GROUP_DEPRECATED_H__ + +#include + +G_BEGIN_DECLS + +#ifndef CLUTTER_DISABLE_DEPRECATED + +/* for Mr. Mallum only */ +#define clutter_group_add(group,actor) G_STMT_START { \ + ClutterActor *_actor = (ClutterActor *) (actor); \ + if (CLUTTER_IS_GROUP ((group)) && CLUTTER_IS_ACTOR ((_actor))) \ + { \ + ClutterContainer *_container = (ClutterContainer *) (group); \ + clutter_container_add_actor (_container, _actor); \ + } } G_STMT_END + +#endif /* CLUTTER_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* __CLUTTER_GROUP_DEPRECATED_H__ */ diff --git a/clutter/clutter-keysyms-compat.h b/clutter/deprecated/clutter-keysyms.h similarity index 99% rename from clutter/clutter-keysyms-compat.h rename to clutter/deprecated/clutter-keysyms.h index 17e16b1ab..8c7611331 100644 --- a/clutter/clutter-keysyms-compat.h +++ b/clutter/deprecated/clutter-keysyms.h @@ -26,8 +26,10 @@ * instead. */ -#ifndef __CLUTTER_KEYSYMS_COMPAT_H__ -#define __CLUTTER_KEYSYMS_COMPAT_H__ +#ifndef __CLUTTER_KEYSYMS_DEPRECATED_H__ +#define __CLUTTER_KEYSYMS_DEPRECATED_H__ + +#ifndef CLUTTER_DISABLE_DEPRECATED #define CLUTTER_VoidSymbol 0xffffff #define CLUTTER_BackSpace 0xff08 @@ -334,6 +336,12 @@ #define CLUTTER_Pointer_Accelerate 0xfefa #define CLUTTER_Pointer_DfltBtnNext 0xfefb #define CLUTTER_Pointer_DfltBtnPrev 0xfefc +#define CLUTTER_ch 0xfea0 +#define CLUTTER_Ch 0xfea1 +#define CLUTTER_CH 0xfea2 +#define CLUTTER_c_h 0xfea3 +#define CLUTTER_C_h 0xfea4 +#define CLUTTER_C_H 0xfea5 #define CLUTTER_3270_Duplicate 0xfd01 #define CLUTTER_3270_FieldMark 0xfd02 #define CLUTTER_3270_Right2 0xfd03 @@ -2286,5 +2294,9 @@ #define CLUTTER_ClearGrab 0x1008fe21 #define CLUTTER_Next_VMode 0x1008fe22 #define CLUTTER_Prev_VMode 0x1008fe23 +#define CLUTTER_LogWindowTree 0x1008fe24 +#define CLUTTER_LogGrabInfo 0x1008fe25 -#endif /* __CLUTTER_KEYSYMS_COMPAT_H__ */ +#endif /* CLUTTER_DISABLE_DEPRECATED */ + +#endif /* __CLUTTER_KEYSYMS_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-main.h b/clutter/deprecated/clutter-main.h new file mode 100644 index 000000000..342d42d55 --- /dev/null +++ b/clutter/deprecated/clutter-main.h @@ -0,0 +1,53 @@ +#ifndef __CLUTTER_MAIN_DEPRECATED_H__ +#define __CLUTTER_MAIN_DEPRECATED_H__ + +#include +#include + +G_BEGIN_DECLS + +CLUTTER_DEPRECATED +void clutter_threads_init (void); + +CLUTTER_DEPRECATED +guint clutter_threads_add_frame_source (guint fps, + GSourceFunc func, + gpointer data); +CLUTTER_DEPRECATED +guint clutter_threads_add_frame_source_full (gint priority, + guint fps, + GSourceFunc func, + gpointer data, + GDestroyNotify notify); + +CLUTTER_DEPRECATED_FOR(clutter_stage_set_motion_events_enabled) +void clutter_set_motion_events_enabled (gboolean enable); + +CLUTTER_DEPRECATED_FOR(clutter_stage_get_motion_events_enabled) +gboolean clutter_get_motion_events_enabled (void); + +CLUTTER_DEPRECATED_FOR(clutter_stage_ensure_redraw) +void clutter_redraw (ClutterStage *stage); + +CLUTTER_DEPRECATED_FOR(cogl_pango_font_map_clear_glyph_cache) +void clutter_clear_glyph_cache (void); + +CLUTTER_DEPRECATED_FOR(clutter_backend_set_font_options) +void clutter_set_font_flags (ClutterFontFlags flags); + +CLUTTER_DEPRECATED_FOR(clutter_backend_get_font_options) +ClutterFontFlags clutter_get_font_flags (void); + +CLUTTER_DEPRECATED_FOR(clutter_device_manager_get_device) +ClutterInputDevice * clutter_get_input_device_for_id (gint id_); + +CLUTTER_DEPRECATED_FOR(clutter_input_device_grab) +void clutter_grab_pointer_for_device (ClutterActor *actor, + gint id_); + +CLUTTER_DEPRECATED_FOR(clutter_input_device_ungrab) +void clutter_ungrab_pointer_for_device (gint id_); + +G_END_DECLS + +#endif /* __CLUTTER_MAIN_DEPRECATED_H__ */ diff --git a/clutter/deprecated/clutter-shader.h b/clutter/deprecated/clutter-shader.h index ae24caf16..37c8e6422 100644 --- a/clutter/deprecated/clutter-shader.h +++ b/clutter/deprecated/clutter-shader.h @@ -150,6 +150,30 @@ CoglHandle clutter_shader_get_cogl_fragment_shader (ClutterShader CLUTTER_DEPRECATED_FOR(ClutterShaderEffect) CoglHandle clutter_shader_get_cogl_vertex_shader (ClutterShader *shader); +/* ClutterActor methods */ + +CLUTTER_DEPRECATED_FOR(clutter_actor_add_effect) +gboolean clutter_actor_set_shader (ClutterActor *self, + ClutterShader *shader); + +CLUTTER_DEPRECATED_FOR(clutter_actor_get_effect) +ClutterShader * clutter_actor_get_shader (ClutterActor *self); + +CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform_value) +void clutter_actor_set_shader_param (ClutterActor *self, + const gchar *param, + const GValue *value); + +CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform) +void clutter_actor_set_shader_param_int (ClutterActor *self, + const gchar *param, + gint value); + +CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform) +void clutter_actor_set_shader_param_float (ClutterActor *self, + const gchar *param, + gfloat value); + G_END_DECLS #endif /* __CLUTTER_SHADER_H__ */ diff --git a/clutter/deprecated/clutter-stage.h b/clutter/deprecated/clutter-stage.h new file mode 100644 index 000000000..98d16da76 --- /dev/null +++ b/clutter/deprecated/clutter-stage.h @@ -0,0 +1,45 @@ +#ifndef __CLUTTER_STAGE_DEPRECATED_H__ +#define __CLUTTER_STAGE_DEPRECATED_H__ + +#include + +G_BEGIN_DECLS + +#ifndef CLUTTER_DISABLE_DEPRECATED + +/** + * CLUTTER_STAGE_WIDTH: + * + * Macro that evaluates to the width of the default stage + * + * Since: 0.2 + * + * Deprecated: 1.2: Use clutter_actor_get_width() instead + */ +#define CLUTTER_STAGE_WIDTH() (clutter_actor_get_width (clutter_stage_get_default ())) + +/** + * CLUTTER_STAGE_HEIGHT: + * + * Macro that evaluates to the height of the default stage + * + * Since: 0.2 + * + * Deprecated: 1.2: use clutter_actor_get_height() instead + */ +#define CLUTTER_STAGE_HEIGHT() (clutter_actor_get_height (clutter_stage_get_default ())) + +/* Commodity macro, for mallum only */ +#define clutter_stage_add(stage,actor) G_STMT_START { \ + if (CLUTTER_IS_STAGE ((stage)) && CLUTTER_IS_ACTOR ((actor))) \ + { \ + ClutterContainer *_container = (ClutterContainer *) (stage); \ + ClutterActor *_actor = (ClutterActor *) (actor); \ + clutter_container_add_actor (_container, _actor); \ + } } G_STMT_END + +#endif /* CLUTTER_DISABLE_DEPRECATED */ + +G_END_DECLS + +#endif /* __CLUTTER_STAGE_DEPRECATED_H__ */ diff --git a/clutter/egl/clutter-backend-eglnative.c b/clutter/egl/clutter-backend-eglnative.c new file mode 100644 index 000000000..573582022 --- /dev/null +++ b/clutter/egl/clutter-backend-eglnative.c @@ -0,0 +1,368 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2010,2011 Intel Corporation. + * 2011 Giovanni Campagna + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + + * Authors: + * Matthew Allum + * Emmanuele Bassi + * Robert Bragg + * Neil Roberts + */ + +#include "config.h" + +#include +#include +#include +#include + +#include + +#include "clutter-backend-eglnative.h" + +/* This is a Cogl based backend */ +#include "cogl/clutter-stage-cogl.h" + +#ifdef HAVE_EVDEV +#include "clutter-device-manager-evdev.h" +#endif + +#ifdef HAVE_TSLIB +#include "clutter-event-tslib.h" +#endif + +#include "clutter-debug.h" +#include "clutter-private.h" +#include "clutter-main.h" +#include "clutter-stage-private.h" + +#ifdef COGL_HAS_EGL_SUPPORT +#include "clutter-egl.h" +#endif + +#ifdef CLUTTER_EGL_BACKEND_CEX100 +#include "clutter-cex100.h" +#endif + +#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 + +#define clutter_backend_egl_native_get_type _clutter_backend_egl_native_get_type + +G_DEFINE_TYPE (ClutterBackendEglNative, clutter_backend_egl_native, CLUTTER_TYPE_BACKEND_COGL); + +static ClutterDeviceManager * +clutter_backend_egl_native_get_device_manager (ClutterBackend *backend) +{ + ClutterBackendEglNative *backend_egl_native = CLUTTER_BACKEND_EGL_NATIVE (backend); + + if (G_UNLIKELY (backend_egl_native->device_manager == NULL)) + { +#ifdef HAVE_EVDEV + backend_egl_native->device_manager = + g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_EVDEV, + "backend", backend_egl_native, + NULL); +#endif + } + + return backend_egl_native->device_manager; +} + +static void +clutter_backend_egl_native_init_events (ClutterBackend *backend) +{ + const char *input_backend = NULL; + + input_backend = g_getenv ("CLUTTER_INPUT_BACKEND"); + +#ifdef HAVE_EVDEV + if (input_backend != NULL && + strcmp (input_backend, CLUTTER_EVDEV_INPUT_BACKEND) == 0) + _clutter_events_evdev_init (CLUTTER_BACKEND (backend)); + else +#endif +#ifdef HAVE_TSLIB + if (input_backend != NULL && + strcmp (input_backend, CLUTTER_TSLIB_INPUT_BACKEND) == 0) + _clutter_events_tslib_init (CLUTTER_BACKEND (backend)); + else +#endif + if (input_backend != NULL) + g_error ("Unrecognized input backend '%s'", input_backend); + else + g_error ("Unknown input backend"); +} + +static void +clutter_backend_egl_native_dispose (GObject *gobject) +{ + ClutterBackendEglNative *backend_egl_native = CLUTTER_BACKEND_EGL_NATIVE (gobject); + + if (backend_egl_native->event_timer != NULL) + { + g_timer_destroy (backend_egl_native->event_timer); + backend_egl_native->event_timer = NULL; + } + +#ifdef HAVE_TSLIB + _clutter_events_tslib_uninit (CLUTTER_BACKEND (gobject)); +#endif + +#ifdef HAVE_EVDEV + _clutter_events_evdev_uninit (CLUTTER_BACKEND (gobject)); + + if (backend_egl_native->device_manager != NULL) + { + g_object_unref (backend_egl_native->device_manager); + backend_egl_native->device_manager = NULL; + } +#endif + + G_OBJECT_CLASS (clutter_backend_egl_native_parent_class)->dispose (gobject); +} + +static ClutterStageWindow * +clutter_backend_egl_native_create_stage (ClutterBackend *backend, + ClutterStage *wrapper, + GError **error) +{ + ClutterBackendEglNative *backend_egl_native = CLUTTER_BACKEND_EGL_NATIVE (backend); + ClutterStageWindow *stage; + + if (G_UNLIKELY (backend_egl_native->stage != NULL)) + { + g_set_error (error, CLUTTER_INIT_ERROR, + CLUTTER_INIT_ERROR_BACKEND, + "The EglNative backend does not support multiple " + "onscreen windows"); + return backend_egl_native->stage; + } + + stage = g_object_new (CLUTTER_TYPE_STAGE_COGL, + "backend", backend, + "wrapper", wrapper, + NULL); + backend_egl_native->stage = stage; + + return stage; +} + +static gboolean +clutter_backend_egl_native_create_context (ClutterBackend *backend, + GError **error) +{ + CoglSwapChain *swap_chain = NULL; + CoglOnscreenTemplate *onscreen_template = NULL; + + if (backend->cogl_context != NULL) + return TRUE; + + backend->cogl_renderer = cogl_renderer_new (); + if (!cogl_renderer_connect (backend->cogl_renderer, error)) + goto error; + + swap_chain = cogl_swap_chain_new (); + +#if defined(CLUTTER_EGL_BACKEND_CEX100) && defined(COGL_HAS_GDL_SUPPORT) + cogl_swap_chain_set_length (swap_chain, gdl_n_buffers); +#endif + + onscreen_template = cogl_onscreen_template_new (swap_chain); + cogl_object_unref (swap_chain); + + /* XXX: I have some doubts that this is a good design. + * Conceptually should we be able to check an onscreen_template + * without more details about the CoglDisplay configuration? + */ + if (!cogl_renderer_check_onscreen_template (backend->cogl_renderer, + onscreen_template, + error)) + goto error; + + backend->cogl_display = cogl_display_new (backend->cogl_renderer, + onscreen_template); + +#if defined(CLUTTER_EGL_BACKEND_CEX100) && defined(COGL_HAS_GDL_SUPPORT) + 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); + + if (!cogl_display_setup (backend->cogl_display, error)) + goto error; + + backend->cogl_context = cogl_context_new (backend->cogl_display, error); + if (backend->cogl_context == NULL) + goto error; + + return TRUE; + +error: + if (backend->cogl_display != NULL) + { + cogl_object_unref (backend->cogl_display); + backend->cogl_display = NULL; + } + + if (onscreen_template != NULL) + cogl_object_unref (onscreen_template); + + if (swap_chain != NULL) + cogl_object_unref (swap_chain); + + if (backend->cogl_renderer != NULL) + { + cogl_object_unref (backend->cogl_renderer); + backend->cogl_renderer = NULL; + } + + return FALSE; +} + +static void +clutter_backend_egl_native_class_init (ClutterBackendEglNativeClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass); + + gobject_class->dispose = clutter_backend_egl_native_dispose; + + backend_class->get_device_manager = clutter_backend_egl_native_get_device_manager; + backend_class->init_events = clutter_backend_egl_native_init_events; + backend_class->create_stage = clutter_backend_egl_native_create_stage; + backend_class->create_context = clutter_backend_egl_native_create_context; +} + +static void +clutter_backend_egl_native_init (ClutterBackendEglNative *backend_egl_native) +{ + backend_egl_native->event_timer = g_timer_new (); +} + +#ifdef CLUTTER_EGL_BACKEND_CEX100 +/** + * clutter_cex100_set_plane: + * @plane: FIXME + * + * FIXME + * + * Since: + */ +void +clutter_cex100_set_plane (gdl_plane_id_t plane) +{ + g_return_if_fail (plane >= GDL_PLANE_ID_UPP_A && plane <= GDL_PLANE_ID_UPP_E); + + gdl_plane = plane; +} +#endif + +#ifdef CLUTTER_EGL_BACKEND_CEX100 +/** + * clutter_cex100_set_plane: + * @mode: FIXME + * + * FIXME + * + * Since: + */ +void +clutter_cex100_set_buffering_mode (ClutterCex100BufferingMode mode) +{ + g_return_if_fail (mode == CLUTTER_CEX100_DOUBLE_BUFFERING || + mode == CLUTTER_CEX100_TRIPLE_BUFFERING); + + gdl_n_buffers = mode; +} +#endif + +/** + * clutter_eglx_display: + * + * Retrieves the EGL display used by Clutter. + * + * Return value: the EGL display, or 0 + * + * Since: 0.6 + * + * Deprecated: 1.6: Use clutter_egl_get_egl_display() instead. + */ +EGLDisplay +clutter_eglx_display (void) +{ + return clutter_egl_get_egl_display (); +} + +/** + * clutter_egl_display: + * + * Retrieves the EGL display used by Clutter. + * + * Return value: the EGL display used by Clutter, or 0 + * + * Since: 0.6 + * + * Deprecated: 1.6: Use clutter_egl_get_egl_display() instead. + */ +EGLDisplay +clutter_egl_display (void) +{ + return clutter_egl_get_egl_display (); +} + +/** + * clutter_egl_get_egl_display: + * + * Retrieves the EGL display used by Clutter, if it supports the + * EGL windowing system and if it is running using an EGL backend. + * + * Return value: the EGL display used by Clutter, or 0 + * + * Since: 1.6 + */ +EGLDisplay +clutter_egl_get_egl_display (void) +{ + ClutterBackend *backend; + + if (!_clutter_context_is_initialized ()) + { + g_critical ("The Clutter backend has not been initialized yet"); + return 0; + } + + backend = clutter_get_default_backend (); + + if (!CLUTTER_IS_BACKEND_EGL_NATIVE (backend)) + { + g_critical ("The Clutter backend is not an EGL backend"); + return 0; + } + +#if COGL_HAS_EGL_SUPPORT + return cogl_egl_context_get_egl_display (backend->cogl_context); +#else + return 0; +#endif +} diff --git a/clutter/egl/clutter-backend-eglnative.h b/clutter/egl/clutter-backend-eglnative.h new file mode 100644 index 000000000..5156339e9 --- /dev/null +++ b/clutter/egl/clutter-backend-eglnative.h @@ -0,0 +1,75 @@ +/* Clutter. + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2006, 2007 OpenedHand + * Copyright (C) 2010 Intel Corp + * 2011 Giovanni Campagna + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * Authors: + * Matthew Allum + * Robert Bragg + */ + +#ifndef __CLUTTER_BACKEND_EGL_NATIVE_H__ +#define __CLUTTER_BACKEND_EGL_NATIVE_H__ + +#include +#include +#include +#include + +#include "clutter-backend-private.h" +#include "cogl/clutter-backend-cogl.h" + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_BACKEND_EGL_NATIVE (_clutter_backend_egl_native_get_type ()) +#define CLUTTER_BACKEND_EGL_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BACKEND_EGL_NATIVE, ClutterBackendEglNative)) +#define CLUTTER_IS_BACKEND_EGL_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BACKEND_EGL_NATIVE)) +#define CLUTTER_BACKEND_EGL_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND_EGL_NATIVE, ClutterBackendEglNativeClass)) +#define CLUTTER_IS_BACKEND_EGL_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND_EGL_NATIVE)) +#define CLUTTER_BACKEND_EGL_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND_EGL_NATIVE, ClutterBackendEglNativeClass)) + +typedef struct _ClutterBackendEglNative ClutterBackendEglNative; +typedef struct _ClutterBackendEglNativeClass ClutterBackendEglNativeClass; + +struct _ClutterBackendEglNative +{ + ClutterBackendCogl parent_instance; + + /* main stage singleton */ + ClutterStageWindow *stage; + + /* device manager (ie evdev) */ + ClutterDeviceManager *device_manager; + + /* event source */ + GSource *event_source; + + /* event timer */ + GTimer *event_timer; +}; + +struct _ClutterBackendEglNativeClass +{ + ClutterBackendCoglClass parent_class; +}; + +GType _clutter_backend_egl_native_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __CLUTTER_BACKEND_EGL_NATIVE_H__ */ diff --git a/clutter/cogl/clutter-cex100.h.in b/clutter/egl/clutter-cex100.h.in similarity index 100% rename from clutter/cogl/clutter-cex100.h.in rename to clutter/egl/clutter-cex100.h.in diff --git a/clutter/cogl/clutter-egl-headers.h b/clutter/egl/clutter-egl-headers.h similarity index 100% rename from clutter/cogl/clutter-egl-headers.h rename to clutter/egl/clutter-egl-headers.h diff --git a/clutter/cogl/clutter-egl.h b/clutter/egl/clutter-egl.h similarity index 96% rename from clutter/cogl/clutter-egl.h rename to clutter/egl/clutter-egl.h index 93710392e..193290a54 100644 --- a/clutter/cogl/clutter-egl.h +++ b/clutter/egl/clutter-egl.h @@ -49,6 +49,9 @@ G_BEGIN_DECLS +#define CLUTTER_TSLIB_INPUT_BACKEND "tslib" +#define CLUTTER_EVDEV_INPUT_BACKEND "evdev" + #ifndef CLUTTER_DISABLE_DEPRECATED /** * clutter_eglx_display: diff --git a/clutter/evdev/clutter-device-manager-evdev.c b/clutter/evdev/clutter-device-manager-evdev.c index 03d08be06..edc01bf58 100644 --- a/clutter/evdev/clutter-device-manager-evdev.c +++ b/clutter/evdev/clutter-device-manager-evdev.c @@ -855,17 +855,16 @@ clutter_device_manager_evdev_init (ClutterDeviceManagerEvdev *self) void _clutter_events_evdev_init (ClutterBackend *backend) { + ClutterDeviceManager *dummy G_GNUC_UNUSED; + CLUTTER_NOTE (EVENT, "Initializing evdev backend"); - /* We just have to create the singleon here */ - clutter_device_manager_get_default (); + /* we need to create the device manager here */ + dummy = clutter_device_manager_get_default (); } void _clutter_events_evdev_uninit (ClutterBackend *backend) { - ClutterDeviceManager *manager; - - manager = clutter_device_manager_get_default (); - g_object_unref (manager); + CLUTTER_NOTE (EVENT, "Uninitializing evdev backend"); } diff --git a/clutter/gdk/clutter-backend-gdk-private.h b/clutter/gdk/clutter-backend-gdk-private.h new file mode 100644 index 000000000..18c53facd --- /dev/null +++ b/clutter/gdk/clutter-backend-gdk-private.h @@ -0,0 +1,32 @@ +/* An OpenGL based 'interactive canvas' library. + * Authored By Matthew Allum + * Copyright (C) 2006-2007 OpenedHand + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * + */ + +#ifndef __CLUTTER_BACKEND_PRIVATE_X11_H__ +#define __CLUTTER_BACKEND_PRIVATE_X11_H__ + + +G_BEGIN_DECLS + +void _clutter_backend_x11_events_init (ClutterBackend *backend); +void _clutter_backend_x11_events_uninit (ClutterBackend *backend); + +G_END_DECLS + +#endif diff --git a/clutter/gdk/clutter-backend-gdk.c b/clutter/gdk/clutter-backend-gdk.c new file mode 100644 index 000000000..e89e01749 --- /dev/null +++ b/clutter/gdk/clutter-backend-gdk.c @@ -0,0 +1,470 @@ +/* Clutter. + * An OpenGL based 'interactive canvas' library. + * Authored By Matthew Allum + * Copyright (C) 2006-2007 OpenedHand + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#ifdef GDK_WINDOWING_WIN32 +#include +#endif + +#include "clutter-backend-gdk.h" +#include "clutter-device-manager-gdk.h" +#include "clutter-settings-gdk.h" +#include "clutter-stage-gdk.h" +#include "clutter-gdk.h" + +#include "clutter-backend.h" +#include "clutter-debug.h" +#include "clutter-device-manager-private.h" +#include "clutter-event-private.h" +#include "clutter-main.h" +#include "clutter-private.h" + +#define clutter_backend_gdk_get_type _clutter_backend_gdk_get_type +G_DEFINE_TYPE (ClutterBackendGdk, clutter_backend_gdk, CLUTTER_TYPE_BACKEND_COGL); + +/* global for pre init setup calls */ +static GdkDisplay *_foreign_dpy = NULL; + +static gboolean disable_event_retrieval = FALSE; + +static void +clutter_backend_gdk_init_settings (ClutterBackendGdk *backend_gdk) +{ + ClutterSettings *settings = clutter_settings_get_default (); + int i; + + for (i = 0; i < G_N_ELEMENTS (_clutter_settings_map); i++) + { + GValue val = G_VALUE_INIT; + + g_value_init (&val, CLUTTER_SETTING_TYPE(i)); + gdk_screen_get_setting (backend_gdk->screen, + CLUTTER_SETTING_GDK_NAME(i), + &val); + g_object_set_property (G_OBJECT (settings), + CLUTTER_SETTING_PROPERTY(i), + &val); + g_value_unset (&val); + } +} + +void +_clutter_backend_gdk_update_setting (ClutterBackendGdk *backend_gdk, + const gchar *setting_name) +{ + ClutterSettings *settings = clutter_settings_get_default (); + int i; + + for (i = 0; i < G_N_ELEMENTS (_clutter_settings_map); i++) + { + if (g_strcmp0 (CLUTTER_SETTING_GDK_NAME (i), setting_name) == 0) + { + GValue val = G_VALUE_INIT; + + g_value_init (&val, CLUTTER_SETTING_TYPE (i)); + gdk_screen_get_setting (backend_gdk->screen, + CLUTTER_SETTING_GDK_NAME (i), + &val); + g_object_set_property (G_OBJECT (settings), + CLUTTER_SETTING_PROPERTY (i), + &val); + g_value_unset (&val); + + break; + } + } +} + +static GdkFilterReturn +cogl_gdk_filter (GdkXEvent *xevent, + GdkEvent *event, + gpointer data) +{ +#ifdef GDK_WINDOWING_X11 + CoglFilterReturn ret; + + ret = cogl_xlib_handle_event ((XEvent*)xevent); + switch (ret) + { + case COGL_FILTER_REMOVE: + return GDK_FILTER_REMOVE; + + case COGL_FILTER_CONTINUE: + default: + return GDK_FILTER_CONTINUE; + } +#endif +} + +static gboolean +_clutter_backend_gdk_post_parse (ClutterBackend *backend, + GError **error) +{ + ClutterBackendGdk *backend_gdk = CLUTTER_BACKEND_GDK (backend); + + if (_foreign_dpy != NULL) + backend_gdk->display = _foreign_dpy; + + /* Init Gdk, if outside code did not already */ + if (!gdk_init_check (NULL, NULL)) + return FALSE; + + /* + * Only open connection if not already set by prior call to + * clutter_gdk_set_display() + */ + if (backend_gdk->display == NULL) + backend_gdk->display = g_object_ref (gdk_display_get_default ()); + + g_assert (backend_gdk->display != NULL); + +#ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY (backend_gdk->display)) + { + /* Cogl needs to know the Xlib display connection for + CoglTexturePixmapX11 */ + cogl_xlib_set_display (gdk_x11_display_get_xdisplay (backend_gdk->display)); + } +#endif + + backend_gdk->screen = gdk_display_get_default_screen (backend_gdk->display); + + /* add event filter for Cogl events */ + gdk_window_add_filter (NULL, cogl_gdk_filter, NULL); + + clutter_backend_gdk_init_settings (backend_gdk); + + CLUTTER_NOTE (BACKEND, + "Gdk Display '%s' opened", + gdk_display_get_name (backend_gdk->display)); + + return CLUTTER_BACKEND_CLASS (clutter_backend_gdk_parent_class)->post_parse (backend, + error); +} + + +static void +clutter_backend_gdk_init_events (ClutterBackend *backend) +{ + CLUTTER_NOTE (EVENT, "initialising the event loop"); + + if (!disable_event_retrieval) + _clutter_backend_gdk_events_init (backend); +} + +static void +clutter_backend_gdk_finalize (GObject *gobject) +{ + ClutterBackendGdk *backend_gdk = CLUTTER_BACKEND_GDK (gobject); + + gdk_window_remove_filter (NULL, cogl_gdk_filter, NULL); + g_object_unref (backend_gdk->display); + + G_OBJECT_CLASS (clutter_backend_gdk_parent_class)->finalize (gobject); +} + +static void +clutter_backend_gdk_dispose (GObject *gobject) +{ + ClutterBackendGdk *backend_gdk = CLUTTER_BACKEND_GDK (gobject); + ClutterStageManager *stage_manager; + + CLUTTER_NOTE (BACKEND, "Disposing the of stages"); + stage_manager = clutter_stage_manager_get_default (); + + g_object_unref (stage_manager); + + CLUTTER_NOTE (BACKEND, "Removing the event source"); + _clutter_backend_gdk_events_uninit (CLUTTER_BACKEND (backend_gdk)); + + G_OBJECT_CLASS (clutter_backend_gdk_parent_class)->dispose (gobject); +} + +static ClutterFeatureFlags +clutter_backend_gdk_get_features (ClutterBackend *backend) +{ + ClutterFeatureFlags flags = CLUTTER_FEATURE_STAGE_USER_RESIZE | CLUTTER_FEATURE_STAGE_CURSOR; + + flags |= CLUTTER_BACKEND_CLASS (clutter_backend_gdk_parent_class)->get_features (backend); + + return flags; +} + +static void +clutter_backend_gdk_copy_event_data (ClutterBackend *backend, + const ClutterEvent *src, + ClutterEvent *dest) +{ + GdkEvent *gdk_event; + + gdk_event = _clutter_event_get_platform_data (src); + if (gdk_event != NULL) + _clutter_event_set_platform_data (dest, gdk_event_copy (gdk_event)); +} + +static void +clutter_backend_gdk_free_event_data (ClutterBackend *backend, + ClutterEvent *event) +{ + GdkEvent *gdk_event; + + gdk_event = _clutter_event_get_platform_data (event); + if (gdk_event != NULL) + gdk_event_free (gdk_event); +} + +static ClutterDeviceManager * +clutter_backend_gdk_get_device_manager (ClutterBackend *backend) +{ + ClutterBackendGdk *backend_gdk = CLUTTER_BACKEND_GDK (backend); + + if (G_UNLIKELY (backend_gdk->device_manager == NULL)) + { + backend_gdk->device_manager = g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_GDK, + "backend", backend_gdk, + "gdk-display", backend_gdk->display, + NULL); + } + + return backend_gdk->device_manager; +} + +static gboolean +clutter_backend_gdk_create_context (ClutterBackend *backend, + GError **error) +{ + ClutterBackendGdk *backend_gdk = CLUTTER_BACKEND_GDK (backend); + CoglSwapChain *swap_chain = NULL; + CoglOnscreenTemplate *onscreen_template = NULL; + GdkVisual *rgba_visual = NULL; + + if (backend->cogl_context != NULL) + return TRUE; + + backend->cogl_renderer = cogl_renderer_new (); + +#if defined(GDK_WINDOWING_X11) && defined(COGL_HAS_XLIB_SUPPORT) + if (GDK_IS_X11_DISPLAY (backend_gdk->display)) + { + cogl_xlib_renderer_set_foreign_display (backend->cogl_renderer, + gdk_x11_display_get_xdisplay (backend_gdk->display)); + } + else +#endif +#if defined(GDK_WINDOWING_WIN32) + if (GDK_IS_WIN32_DISPLAY (backend_gdk->display)) + { + /* Force a WGL winsys on windows */ + cogl_renderer_set_winsys_id (backend_cogl->cogl_renderer, COGL_WINSYS_ID_WGL); + } + else +#endif + { + g_set_error (error, CLUTTER_INIT_ERROR, + CLUTTER_INIT_ERROR_BACKEND, + "Could not find a suitable CoglWinsys for" + "a GdkDisplay of type %s", G_OBJECT_TYPE_NAME (backend_gdk->display)); + goto error; + } + + + if (!cogl_renderer_connect (backend->cogl_renderer, error)) + goto error; + + swap_chain = cogl_swap_chain_new (); + + rgba_visual = gdk_screen_get_rgba_visual (backend_gdk->screen); + cogl_swap_chain_set_has_alpha (swap_chain, rgba_visual != NULL); + + onscreen_template = cogl_onscreen_template_new (swap_chain); + cogl_object_unref (swap_chain); + + /* XXX: I have some doubts that this is a good design. + * Conceptually should we be able to check an onscreen_template + * without more details about the CoglDisplay configuration? + */ + if (!cogl_renderer_check_onscreen_template (backend->cogl_renderer, + onscreen_template, + error)) + goto error; + + backend->cogl_display = cogl_display_new (backend->cogl_renderer, + onscreen_template); + + cogl_object_unref (backend->cogl_renderer); + cogl_object_unref (onscreen_template); + + if (!cogl_display_setup (backend->cogl_display, error)) + goto error; + + backend->cogl_context = cogl_context_new (backend->cogl_display, error); + if (backend->cogl_context == NULL) + goto error; + + return TRUE; + +error: + if (backend->cogl_display != NULL) + { + cogl_object_unref (backend->cogl_display); + backend->cogl_display = NULL; + } + + if (onscreen_template != NULL) + cogl_object_unref (onscreen_template); + if (swap_chain != NULL) + cogl_object_unref (swap_chain); + + if (backend->cogl_renderer != NULL) + { + cogl_object_unref (backend->cogl_renderer); + backend->cogl_renderer = NULL; + } + return FALSE; +} + +static ClutterStageWindow * +clutter_backend_gdk_create_stage (ClutterBackend *backend, + ClutterStage *wrapper, + GError **error) +{ + return g_object_new (CLUTTER_TYPE_STAGE_GDK, + "backend", backend, + "wrapper", wrapper, + NULL); +} + +static void +clutter_backend_gdk_class_init (ClutterBackendGdkClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass); + + gobject_class->dispose = clutter_backend_gdk_dispose; + gobject_class->finalize = clutter_backend_gdk_finalize; + + backend_class->post_parse = _clutter_backend_gdk_post_parse; + backend_class->init_events = clutter_backend_gdk_init_events; + backend_class->get_features = clutter_backend_gdk_get_features; + backend_class->get_device_manager = clutter_backend_gdk_get_device_manager; + backend_class->copy_event_data = clutter_backend_gdk_copy_event_data; + backend_class->free_event_data = clutter_backend_gdk_free_event_data; + backend_class->create_context = clutter_backend_gdk_create_context; + backend_class->create_stage = clutter_backend_gdk_create_stage; +} + +static void +clutter_backend_gdk_init (ClutterBackendGdk *backend_gdk) +{ + /* nothing to do here */ +} + +/** + * clutter_gdk_get_default_display: + * + * Retrieves the pointer to the default display. + * + * Return value: (transfer none): the default display + * + * Since: 0.6 + */ +GdkDisplay * +clutter_gdk_get_default_display (void) +{ + ClutterBackend *backend = clutter_get_default_backend (); + + if (backend == NULL) + { + 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; + } + + return CLUTTER_BACKEND_GDK (backend)->display; +} + +/** + * clutter_gdk_set_display: + * @display: pointer to a GDK display connection. + * + * Sets the display connection Clutter should use; must be called + * before clutter_init(), clutter_init_with_args() or other functions + * pertaining Clutter's initialization process. + * + * If you are parsing the command line arguments by retrieving Clutter's + * #GOptionGroup with clutter_get_option_group() and calling + * g_option_context_parse() yourself, you should also call + * clutter_gdk_set_display() before g_option_context_parse(). + * + * Since: 0.8 + */ +void +clutter_gdk_set_display (GdkDisplay *display) +{ + if (_clutter_context_is_initialized ()) + { + g_warning ("%s() can only be used before calling clutter_init()", + G_STRFUNC); + return; + } + + _foreign_dpy = g_object_ref (display); +} + +void +clutter_gdk_disable_event_retrieval (void) +{ + if (_clutter_context_is_initialized ()) + { + g_warning ("%s() can only be used before calling clutter_init()", + G_STRFUNC); + return; + } + + disable_event_retrieval = TRUE; +} diff --git a/clutter/gdk/clutter-backend-gdk.h b/clutter/gdk/clutter-backend-gdk.h new file mode 100644 index 000000000..73d8de190 --- /dev/null +++ b/clutter/gdk/clutter-backend-gdk.h @@ -0,0 +1,73 @@ +/* Clutter. + * An OpenGL based 'interactive canvas' library. + * Authored By Matthew Allum + * Copyright (C) 2006-2007 OpenedHand + * 2011 Giovanni Campagna + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * + */ + +#ifndef __CLUTTER_BACKEND_GDK_H__ +#define __CLUTTER_BACKEND_GDK_H__ + +#include +#include +#include + +#include "clutter-gdk.h" + +#include "clutter-backend-private.h" +#include "cogl/clutter-backend-cogl.h" + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_BACKEND_GDK (_clutter_backend_gdk_get_type ()) +#define CLUTTER_BACKEND_GDK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BACKEND_GDK, ClutterBackendGdk)) +#define CLUTTER_IS_BACKEND_GDK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BACKEND_GDK)) +#define CLUTTER_BACKEND_GDK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND_GDK, ClutterBackendGdkClass)) +#define CLUTTER_IS_BACKEND_GDK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND_GDK)) +#define CLUTTER_BACKEND_GDK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND_GDK, ClutterBackendGdkClass)) + +typedef struct _ClutterBackendGdk ClutterBackendGdk; +typedef struct _ClutterBackendGdkClass ClutterBackendGdkClass; + +struct _ClutterBackendGdk +{ + ClutterBackendCogl parent_instance; + + GdkDisplay *display; + GdkScreen *screen; + + ClutterDeviceManager *device_manager; +}; + +struct _ClutterBackendGdkClass +{ + ClutterBackendCoglClass parent_class; + + /* nothing here, for now */ +}; + +GType _clutter_backend_gdk_get_type (void) G_GNUC_CONST; + +void _clutter_backend_gdk_events_init (ClutterBackend *backend); +void _clutter_backend_gdk_events_uninit (ClutterBackend *backend); + +void _clutter_backend_gdk_update_setting (ClutterBackendGdk *backend, const gchar *name); + +G_END_DECLS + +#endif /* __CLUTTER_BACKEND_GDK_H__ */ diff --git a/clutter/gdk/clutter-device-manager-gdk.c b/clutter/gdk/clutter-device-manager-gdk.c new file mode 100644 index 000000000..5175bbab5 --- /dev/null +++ b/clutter/gdk/clutter-device-manager-gdk.c @@ -0,0 +1,249 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright © 2011 Intel Corp. + * 2011 Giovanni Campagna + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * Author: Emmanuele Bassi + */ + +#include "config.h" + +#include + +#include "clutter-device-manager-gdk.h" + +#include "clutter-backend-gdk.h" +#include "clutter-input-device-gdk.h" +#include "clutter-stage-gdk.h" + +#include "clutter-backend.h" +#include "clutter-debug.h" +#include "clutter-device-manager-private.h" +#include "clutter-event-private.h" +#include "clutter-event-translator.h" +#include "clutter-stage-private.h" +#include "clutter-private.h" + +#define clutter_device_manager_gdk_get_type _clutter_device_manager_gdk_get_type + +G_DEFINE_TYPE (ClutterDeviceManagerGdk, clutter_device_manager_gdk, CLUTTER_TYPE_DEVICE_MANAGER) + +enum { + PROP_0, + PROP_GDK_DISPLAY, + PROP_LAST +}; + +ClutterInputDevice * +_clutter_device_manager_gdk_lookup_device (ClutterDeviceManager *manager, + GdkDevice *device) +{ + ClutterDeviceManagerGdk *manager_gdk = CLUTTER_DEVICE_MANAGER_GDK (manager); + ClutterInputDevice *clutter_device; + + clutter_device = g_object_get_data (G_OBJECT (device), "clutter-device"); + if (clutter_device != NULL) + return clutter_device; + + clutter_device = _clutter_input_device_gdk_new (manager, device); + g_object_set_data_full (G_OBJECT (device), "clutter-device", clutter_device, g_object_unref); + + manager_gdk->device_cache = g_slist_prepend (manager_gdk->device_cache, g_object_ref (clutter_device)); + g_hash_table_replace (manager_gdk->device_by_id, + GINT_TO_POINTER (clutter_input_device_get_device_id (clutter_device)), + g_object_ref (clutter_device)); + + return clutter_device; +} + +static void +clutter_device_manager_gdk_add_device (ClutterDeviceManager *manager, + ClutterInputDevice *device) +{ + /* XXX implement */ +} + +static void +clutter_device_manager_gdk_remove_device (ClutterDeviceManager *manager, + ClutterInputDevice *device) +{ + /* XXX implement */ +} + +static const GSList * +clutter_device_manager_gdk_get_devices (ClutterDeviceManager *manager) +{ + ClutterDeviceManagerGdk *manager_gdk = CLUTTER_DEVICE_MANAGER_GDK (manager); + + return manager_gdk->device_cache; +} + +static ClutterInputDevice * +clutter_device_manager_gdk_get_device (ClutterDeviceManager *manager, + gint id) +{ + ClutterDeviceManagerGdk *manager_gdk = CLUTTER_DEVICE_MANAGER_GDK (manager); + + return g_hash_table_lookup (manager_gdk->device_by_id, GINT_TO_POINTER (id)); +} + +static ClutterInputDevice * +clutter_device_manager_gdk_get_core_device (ClutterDeviceManager *manager, + ClutterInputDeviceType device_type) +{ + ClutterDeviceManagerGdk *manager_gdk = CLUTTER_DEVICE_MANAGER_GDK (manager); + GdkDevice *gdk_device; + + gdk_device = gdk_device_manager_get_client_pointer (manager_gdk->device_manager); + + g_assert (gdk_device != NULL); + + if (device_type == CLUTTER_KEYBOARD_DEVICE) + gdk_device = gdk_device_get_associated_device (gdk_device); + else if (device_type != CLUTTER_POINTER_DEVICE) + return NULL; + + return _clutter_device_manager_gdk_lookup_device (manager, gdk_device); +} + +static void +gdk_device_added (GdkDeviceManager *gdk_manager, + GdkDevice *device, + ClutterDeviceManager *self) +{ + /* this will do the right thing if the device is not there */ + ClutterInputDevice *clutter_device = _clutter_device_manager_gdk_lookup_device (self, device); + + _clutter_device_manager_add_device (self, clutter_device); +} + +static void +gdk_device_removed (GdkDeviceManager *gdk_manager, + GdkDevice *device, + ClutterDeviceManagerGdk *self) +{ + ClutterInputDevice *clutter_device = g_object_get_data (G_OBJECT (device), "clutter-device"); + + if (clutter_device == NULL) + return; + + self->device_cache = g_slist_remove (self->device_cache, clutter_device); + g_object_unref (clutter_device); + + g_hash_table_remove (self->device_by_id, + GINT_TO_POINTER (clutter_input_device_get_device_id (clutter_device))); + + _clutter_device_manager_remove_device (CLUTTER_DEVICE_MANAGER (self), clutter_device); +} + +static void +gdk_device_foreach_cb (gpointer data, + gpointer user_data) +{ + _clutter_device_manager_gdk_lookup_device (user_data, data); +} + +static void +clutter_device_manager_gdk_constructed (GObject *gobject) +{ + ClutterDeviceManagerGdk *manager_gdk = CLUTTER_DEVICE_MANAGER_GDK (gobject); + GList *all_devices; + + g_assert (manager_gdk->device_manager != NULL); + + all_devices = gdk_device_manager_list_devices (manager_gdk->device_manager, + GDK_DEVICE_TYPE_MASTER); + g_list_foreach (all_devices, gdk_device_foreach_cb, manager_gdk); + g_list_free (all_devices); + + all_devices = gdk_device_manager_list_devices (manager_gdk->device_manager, + GDK_DEVICE_TYPE_SLAVE); + g_list_foreach (all_devices, gdk_device_foreach_cb, manager_gdk); + g_list_free (all_devices); + + all_devices = gdk_device_manager_list_devices (manager_gdk->device_manager, + GDK_DEVICE_TYPE_FLOATING); + g_list_foreach (all_devices, gdk_device_foreach_cb, manager_gdk); + g_list_free (all_devices); + + g_object_connect (manager_gdk->device_manager, + "object-signal::device-added", gdk_device_added, gobject, + "object-signal::device-removed", gdk_device_removed, gobject, + NULL); + + if (G_OBJECT_CLASS (clutter_device_manager_gdk_parent_class)->constructed) + G_OBJECT_CLASS (clutter_device_manager_gdk_parent_class)->constructed (gobject); +} + +static void +clutter_device_manager_gdk_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ClutterDeviceManagerGdk *manager_gdk = CLUTTER_DEVICE_MANAGER_GDK (gobject); + GdkDisplay *gdk_display; + + switch (prop_id) + { + case PROP_GDK_DISPLAY: + gdk_display = GDK_DISPLAY (g_value_get_object (value)); + manager_gdk->device_manager = gdk_display_get_device_manager (gdk_display); + g_object_ref (manager_gdk->device_manager); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_device_manager_gdk_class_init (ClutterDeviceManagerGdkClass *klass) +{ + ClutterDeviceManagerClass *manager_class; + GObjectClass *gobject_class; + GParamSpec *pspec; + + gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->constructed = clutter_device_manager_gdk_constructed; + gobject_class->set_property = clutter_device_manager_gdk_set_property; + + manager_class = CLUTTER_DEVICE_MANAGER_CLASS (klass); + manager_class->add_device = clutter_device_manager_gdk_add_device; + manager_class->remove_device = clutter_device_manager_gdk_remove_device; + manager_class->get_devices = clutter_device_manager_gdk_get_devices; + manager_class->get_core_device = clutter_device_manager_gdk_get_core_device; + manager_class->get_device = clutter_device_manager_gdk_get_device; + + pspec = g_param_spec_object ("gdk-display", + "GdkDisplay", + "The GDK display", + GDK_TYPE_DISPLAY, + CLUTTER_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (gobject_class, PROP_GDK_DISPLAY, pspec); +} + +static void +clutter_device_manager_gdk_init (ClutterDeviceManagerGdk *self) +{ + self->device_by_id = g_hash_table_new_full (NULL, NULL, + NULL, (GDestroyNotify) g_object_unref); +} diff --git a/clutter/gdk/clutter-device-manager-gdk.h b/clutter/gdk/clutter-device-manager-gdk.h new file mode 100644 index 000000000..ade24cd89 --- /dev/null +++ b/clutter/gdk/clutter-device-manager-gdk.h @@ -0,0 +1,63 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright © 2011 Intel Corp. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * Author: Emmanuele Bassi + */ + +#ifndef __CLUTTER_DEVICE_MANAGER_GDK_H__ +#define __CLUTTER_DEVICE_MANAGER_GDK_H__ + +#include +#include + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_DEVICE_MANAGER_GDK (_clutter_device_manager_gdk_get_type ()) +#define CLUTTER_DEVICE_MANAGER_GDK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DEVICE_MANAGER_GDK, ClutterDeviceManagerGdk)) +#define CLUTTER_IS_DEVICE_MANAGER_GDK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DEVICE_MANAGER_GDK)) +#define CLUTTER_DEVICE_MANAGER_GDK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DEVICE_MANAGER_GDK, ClutterDeviceManagerGdkClass)) +#define CLUTTER_IS_DEVICE_MANAGER_GDK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DEVICE_MANAGER_GDK)) +#define CLUTTER_DEVICE_MANAGER_GDK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DEVICE_MANAGER_GDK, ClutterDeviceManagerGdkClass)) + +typedef struct _ClutterDeviceManagerGdk ClutterDeviceManagerGdk; +typedef struct _ClutterDeviceManagerGdkClass ClutterDeviceManagerGdkClass; + +struct _ClutterDeviceManagerGdk +{ + ClutterDeviceManager parent_instance; + + GdkDeviceManager *device_manager; + GSList *device_cache; + GHashTable *device_by_id; +}; + +struct _ClutterDeviceManagerGdkClass +{ + ClutterDeviceManagerClass parent_class; +}; + +GType _clutter_device_manager_gdk_get_type (void) G_GNUC_CONST; + +ClutterInputDevice * _clutter_device_manager_gdk_lookup_device (ClutterDeviceManager *manager, + GdkDevice *device); + +G_END_DECLS + +#endif /* __CLUTTER_DEVICE_MANAGER_GDK_H__ */ diff --git a/clutter/gdk/clutter-event-gdk.c b/clutter/gdk/clutter-event-gdk.c new file mode 100644 index 000000000..540d7d42a --- /dev/null +++ b/clutter/gdk/clutter-event-gdk.c @@ -0,0 +1,346 @@ +/* Clutter. + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd + * Copyright (C) 2009, 2010 Intel Corp. + * 2011 Giovanni Campagna + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * + * + * Authored by: + * Matthew Allum + * Emmanuele Bassi + */ + +#include "config.h" + +#include "clutter-gdk.h" +#include "clutter-backend-gdk.h" +#include "clutter-device-manager-gdk.h" + +#include "clutter-actor-private.h" +#include "clutter-backend-private.h" +#include "clutter-debug.h" +#include "clutter-event-private.h" +#include "clutter-main.h" +#include "clutter-paint-volume-private.h" +#include "clutter-stage-private.h" + +#include + +#include + +static void +gdk_event_handler (GdkEvent *event, + gpointer user_data) +{ + clutter_gdk_handle_event (event); +} + +void +_clutter_backend_gdk_events_init (ClutterBackend *backend) +{ + gdk_event_handler_set (gdk_event_handler, NULL, NULL); + + CLUTTER_NOTE (EVENT, "GDK event handler set"); +} + +void +_clutter_backend_gdk_events_uninit (ClutterBackend *backend) +{ + gdk_event_handler_set (NULL, NULL, NULL); +} + +/** + * clutter_gdk_handle_event: + * @event: a #GdkEvent + * + * This function processes a single GDK event; it can be used to hook + * into external event processing + * + * Return value: #GdkFilterReturn. %GDK_FILTER_REMOVE indicates that + * Clutter has internally handled the event and the caller should do + * no further processing. %GDK_FILTER_CONTINUE indicates that Clutter + * is either not interested in the event, or has used the event to + * update internal state without taking any exclusive action. + * %GDK_FILTER_TRANSLATE will not occur. + * + */ +GdkFilterReturn +clutter_gdk_handle_event (GdkEvent *gdk_event) +{ + ClutterDeviceManager *device_manager; + ClutterBackendGdk *backend_gdk; + ClutterBackend *backend; + ClutterStage *stage = NULL; + ClutterEvent *event = NULL; + gint spin = 0; + GdkFilterReturn result = GDK_FILTER_CONTINUE; + ClutterInputDevice *device, *source_device; + GdkDevice *gdk_device; + + backend = clutter_get_default_backend (); + if (!CLUTTER_IS_BACKEND_GDK (backend)) + return GDK_FILTER_CONTINUE; + + if (gdk_event->any.window == NULL) + return GDK_FILTER_CONTINUE; + + backend_gdk = CLUTTER_BACKEND_GDK (backend); + stage = clutter_gdk_get_stage_from_window (gdk_event->any.window); + device_manager = clutter_device_manager_get_default (); + + gdk_device = gdk_event_get_device (gdk_event); + if (gdk_device != NULL) + device = _clutter_device_manager_gdk_lookup_device (device_manager, + gdk_device); + else + device = NULL; + + gdk_device = gdk_event_get_source_device (gdk_event); + if (gdk_device != NULL) + source_device = _clutter_device_manager_gdk_lookup_device (device_manager, + gdk_device); + else + source_device = NULL; + + if (stage == NULL) + return GDK_FILTER_CONTINUE; + + clutter_threads_enter (); + + switch (gdk_event->type) + { + case GDK_DELETE: + event = clutter_event_new (CLUTTER_DELETE); + break; + + case GDK_DESTROY: + event = clutter_event_new (CLUTTER_DESTROY_NOTIFY); + break; + + case GDK_EXPOSE: + { + ClutterPaintVolume clip; + ClutterVertex origin; + + CLUTTER_NOTE (EVENT, "Expose for stage '%s' [%p] { %d, %d - %d x %d }", + _clutter_actor_get_debug_name (CLUTTER_ACTOR (stage)), + stage, + gdk_event->expose.area.x, + gdk_event->expose.area.y, + gdk_event->expose.area.width, + gdk_event->expose.area.height); + + origin.x = gdk_event->expose.area.x; + origin.y = gdk_event->expose.area.y; + origin.z = 0; + + _clutter_paint_volume_init_static (&clip, CLUTTER_ACTOR (stage)); + + clutter_paint_volume_set_origin (&clip, &origin); + clutter_paint_volume_set_width (&clip, gdk_event->expose.area.width); + clutter_paint_volume_set_height (&clip, gdk_event->expose.area.height); + + _clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stage), 0, &clip); + + clutter_paint_volume_free (&clip); + } + break; + + case GDK_DAMAGE: + /* This is handled by cogl */ + break; + + case GDK_MOTION_NOTIFY: + event = clutter_event_new (CLUTTER_MOTION); + event->motion.time = gdk_event->motion.time; + event->motion.x = gdk_event->motion.x; + event->motion.y = gdk_event->motion.y; + event->motion.axes = NULL; + /* It's all X in the end, right? */ + event->motion.modifier_state = gdk_event->motion.state; + clutter_event_set_device (event, device); + clutter_event_set_source_device (event, source_device); + CLUTTER_NOTE (EVENT, "Motion notifiy [%.2f, %.2f]", + event->motion.x, + event->motion.y); + break; + + case GDK_BUTTON_PRESS: + case GDK_BUTTON_RELEASE: + event = clutter_event_new (gdk_event->type == GDK_BUTTON_PRESS ? + CLUTTER_BUTTON_PRESS : + CLUTTER_BUTTON_RELEASE); + event->button.time = gdk_event->button.time; + event->button.x = gdk_event->button.x; + event->button.y = gdk_event->button.y; + event->button.axes = NULL; + event->button.modifier_state = gdk_event->button.state; + event->button.button = gdk_event->button.button; + event->button.click_count = 1; + clutter_event_set_device (event, device); + clutter_event_set_source_device (event, source_device); + CLUTTER_NOTE (EVENT, "Button %d %s [%.2f, %.2f]", + event->button.button, + event->type == CLUTTER_BUTTON_PRESS ? "press" : "release", + event->button.x, + event->button.y); + break; + + case GDK_2BUTTON_PRESS: + case GDK_3BUTTON_PRESS: + /* these are handled by clutter-main.c updating click_count */ + break; + + case GDK_KEY_PRESS: + case GDK_KEY_RELEASE: + event = clutter_event_new (gdk_event->type == GDK_KEY_PRESS ? + CLUTTER_KEY_PRESS : + CLUTTER_KEY_RELEASE); + event->key.time = gdk_event->key.time; + event->key.modifier_state = gdk_event->key.state; + event->key.keyval = gdk_event->key.keyval; + event->key.hardware_keycode = gdk_event->key.hardware_keycode; + event->key.unicode_value = g_utf8_get_char (gdk_event->key.string); + clutter_event_set_device (event, device); + clutter_event_set_source_device (event, source_device); + CLUTTER_NOTE (EVENT, "Key %d %s", + event->key.keyval, + event->type == CLUTTER_KEY_PRESS ? "press" : "release"); + break; + + case GDK_ENTER_NOTIFY: + case GDK_LEAVE_NOTIFY: + event = clutter_event_new (gdk_event->type == GDK_ENTER_NOTIFY ? + CLUTTER_ENTER : + CLUTTER_LEAVE); + event->crossing.source = CLUTTER_ACTOR (stage); + event->crossing.time = gdk_event_get_time (gdk_event); + event->crossing.x = gdk_event->crossing.x; + event->crossing.y = gdk_event->crossing.y; + + /* XXX: no better fallback here? */ + clutter_event_set_device (event, device); + clutter_event_set_source_device (event, source_device); + if (gdk_event->type == GDK_ENTER_NOTIFY) + _clutter_stage_add_device (stage, clutter_event_get_device (event)); + else + _clutter_stage_remove_device (stage, clutter_event_get_device (event)); + CLUTTER_NOTE (EVENT, "Crossing %s [%.2f, %.2f]", + event->type == CLUTTER_ENTER ? "enter" : "leave", + event->crossing.x, + event->crossing.y); + break; + + case GDK_FOCUS_CHANGE: + event = clutter_event_new (CLUTTER_STAGE_STATE); + event->stage_state.time = 0; /* XXX: there is no timestamp in this GdkEvent */ + event->stage_state.changed_mask = CLUTTER_STAGE_STATE_ACTIVATED; + event->stage_state.new_state = gdk_event->focus_change.in + ? CLUTTER_STAGE_STATE_ACTIVATED + : 0; + break; + + case GDK_CONFIGURE: + { + gfloat w, h; + + clutter_actor_get_size (CLUTTER_ACTOR (stage), &w, &h); + + if (w != gdk_event->configure.width || + h != gdk_event->configure.height) + { + clutter_actor_set_size (CLUTTER_ACTOR (stage), + gdk_event->configure.width, + gdk_event->configure.height); + } + } + break; + + case GDK_SCROLL: + event = clutter_event_new (CLUTTER_SCROLL); + event->scroll.time = gdk_event->scroll.time; + event->scroll.x = gdk_event->scroll.x; + event->scroll.y = gdk_event->scroll.y; + event->scroll.modifier_state = gdk_event->scroll.state; + event->scroll.axes = NULL; + event->scroll.direction = gdk_event->scroll.direction; + clutter_event_set_device (event, device); + clutter_event_set_source_device (event, source_device); + break; + + case GDK_WINDOW_STATE: + event = clutter_event_new (CLUTTER_STAGE_STATE); + event->stage_state.changed_mask = 0; + event->stage_state.new_state = 0; + if (gdk_event->window_state.changed_mask & GDK_WINDOW_STATE_WITHDRAWN) + { + event->stage_state.changed_mask |= CLUTTER_STAGE_STATE_OFFSCREEN; + event->stage_state.new_state |= (gdk_event->window_state.new_window_state & GDK_WINDOW_STATE_WITHDRAWN) + ? CLUTTER_STAGE_STATE_OFFSCREEN + : 0; + } + + if (gdk_event->window_state.changed_mask & GDK_WINDOW_STATE_FULLSCREEN) + { + event->stage_state.changed_mask |= CLUTTER_STAGE_STATE_FULLSCREEN; + event->stage_state.new_state |= (gdk_event->window_state.new_window_state & GDK_WINDOW_STATE_FULLSCREEN) + ? CLUTTER_STAGE_STATE_FULLSCREEN + : 0; + } + break; + + case GDK_SETTING: + _clutter_backend_gdk_update_setting (backend_gdk, gdk_event->setting.name); + break; + + default: + break; + } + + if (event != NULL) + { + event->any.stage = stage; + + if (gdk_event->any.send_event) + event->any.flags = CLUTTER_EVENT_FLAG_SYNTHETIC; + + _clutter_event_push (event, FALSE); + + spin = 1; + + CLUTTER_NOTE (EVENT, "Translated one event from Gdk"); + + /* handle also synthetic enter/leave events */ + if (event->type == CLUTTER_MOTION) + spin += 2; + + while (spin > 0 && (event = clutter_event_get ())) + { + /* forward the event into clutter for emission etc. */ + clutter_do_event (event); + clutter_event_free (event); + --spin; + } + + result = GDK_FILTER_REMOVE; + } + + clutter_threads_leave (); + + return result; +} diff --git a/clutter/gdk/clutter-gdk.h b/clutter/gdk/clutter-gdk.h new file mode 100644 index 000000000..36724bd72 --- /dev/null +++ b/clutter/gdk/clutter-gdk.h @@ -0,0 +1,58 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Matthew Allum + * + * Copyright (C) 2006 OpenedHand + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * + */ + +/** + * SECTION:clutter-gdk + * @short_description: GDK specific API + * + * The GDK backend for Clutter provides some specific API, allowing + * integration with the GDK API for manipulating the stage window and + * handling events outside of Clutter. + */ + +#ifndef __CLUTTER_GDK_H__ +#define __CLUTTER_GDK_H__ + +#include +#include +#include + +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); + +GdkFilterReturn clutter_gdk_handle_event (GdkEvent *event); + +ClutterStage * clutter_gdk_get_stage_from_window (GdkWindow *window); + +void clutter_gdk_disable_event_retrieval (void); + +G_END_DECLS + +#endif /* __CLUTTER_GDK_H__ */ diff --git a/clutter/gdk/clutter-input-device-gdk.c b/clutter/gdk/clutter-input-device-gdk.c new file mode 100644 index 000000000..44150ff5c --- /dev/null +++ b/clutter/gdk/clutter-input-device-gdk.c @@ -0,0 +1,160 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright © 2011 Intel Corp. + * 2011 Giovanni Campagna + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * Author: Emmanuele Bassi + */ + +#include "config.h" + +#include "clutter-input-device-gdk.h" + +#include "clutter-debug.h" +#include "clutter-device-manager-private.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" + +#include "clutter-backend-gdk.h" +#include "clutter-stage-gdk.h" + +typedef struct _ClutterInputDeviceClass ClutterInputDeviceGdkClass; + +#define clutter_input_device_gdk_get_type _clutter_input_device_gdk_get_type + +G_DEFINE_TYPE (ClutterInputDeviceGdk, + clutter_input_device_gdk, + CLUTTER_TYPE_INPUT_DEVICE); + +static int device_int_counter; + +enum { + PROP_0, + PROP_GDK_DEVICE, + PROP_LAST +}; + +static void +clutter_input_device_gdk_set_property (GObject *gobject, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + ClutterInputDeviceGdk *self = CLUTTER_INPUT_DEVICE_GDK (gobject); + + switch (prop_id) + { + case PROP_GDK_DEVICE: + self->gdk_device = GDK_DEVICE (g_value_get_object (value)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); + break; + } +} + +static void +clutter_input_device_gdk_class_init (ClutterInputDeviceGdkClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->set_property = clutter_input_device_gdk_set_property; + + g_object_class_install_property (gobject_class, PROP_GDK_DEVICE, + g_param_spec_object ("gdk-device", + "GdkDevice", + "The GDK device", + GDK_TYPE_DEVICE, + CLUTTER_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); +} + +static void +clutter_input_device_gdk_init (ClutterInputDeviceGdk *self) +{ +} + +ClutterInputDevice* +_clutter_input_device_gdk_new (ClutterDeviceManager *manager, + GdkDevice *device) +{ + ClutterBackend *backend; + ClutterInputDevice *clutter_device; + ClutterInputMode input_mode = CLUTTER_INPUT_MODE_FLOATING; + ClutterInputDeviceType device_type = CLUTTER_EXTENSION_DEVICE; + gboolean has_cursor = FALSE; + const gchar *name; + gboolean is_enabled = FALSE; + + g_object_get (manager, "backend", &backend, NULL); + + /* yay for name consistency */ + switch (gdk_device_get_device_type (device)) + { + case GDK_DEVICE_TYPE_MASTER: + input_mode = CLUTTER_INPUT_MODE_MASTER; + is_enabled = TRUE; + break; + case GDK_DEVICE_TYPE_SLAVE: + input_mode = CLUTTER_INPUT_MODE_SLAVE; + is_enabled = FALSE; + break; + case GDK_DEVICE_TYPE_FLOATING: + input_mode = CLUTTER_INPUT_MODE_FLOATING; + is_enabled = FALSE; + break; + } + + switch (gdk_device_get_source (device)) + { + case GDK_SOURCE_MOUSE: + device_type = CLUTTER_POINTER_DEVICE; + break; + case GDK_SOURCE_PEN: + device_type = CLUTTER_PEN_DEVICE; + break; + case GDK_SOURCE_ERASER: + device_type = CLUTTER_ERASER_DEVICE; + break; + case GDK_SOURCE_CURSOR: + device_type = CLUTTER_CURSOR_DEVICE; + break; + case GDK_SOURCE_KEYBOARD: + device_type = CLUTTER_KEYBOARD_DEVICE; + break; + } + + if (device_type != CLUTTER_KEYBOARD_DEVICE) + has_cursor = gdk_device_get_has_cursor (device); + + name = gdk_device_get_name (device); + + clutter_device = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_GDK, + "backend", backend, + "device-manager", manager, + "device-mode", input_mode, + "device-type", device_type, + "has-cursor", has_cursor, + "gdk-device", device, + "id", device_int_counter++, + "name", name, + "enabled", is_enabled, + NULL); + return clutter_device; +} diff --git a/clutter/gdk/clutter-input-device-gdk.h b/clutter/gdk/clutter-input-device-gdk.h new file mode 100644 index 000000000..bcc57183a --- /dev/null +++ b/clutter/gdk/clutter-input-device-gdk.h @@ -0,0 +1,55 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright © 2011 Intel Corp. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * Author: Emmanuele Bassi + */ + +#ifndef __CLUTTER_INPUT_DEVICE_GDK_H__ +#define __CLUTTER_INPUT_DEVICE_GDK_H__ + +#include +#include + +#include "clutter-backend.h" +#include "clutter-device-manager-private.h" + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_INPUT_DEVICE_GDK (_clutter_input_device_gdk_get_type ()) +#define CLUTTER_INPUT_DEVICE_GDK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_INPUT_DEVICE_GDK, ClutterInputDeviceGdk)) +#define CLUTTER_IS_INPUT_DEVICE_GDK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_INPUT_DEVICE_GDK)) + +typedef struct _ClutterInputDeviceGdk ClutterInputDeviceGdk; + +struct _ClutterInputDeviceGdk +{ + ClutterInputDevice parent; + + GdkDevice *gdk_device; +}; + +GType _clutter_input_device_gdk_get_type (void) G_GNUC_CONST; + +ClutterInputDevice * _clutter_input_device_gdk_new (ClutterDeviceManager *manager, + GdkDevice *device); + +G_END_DECLS + +#endif /* __CLUTTER_INPUT_DEVICE_GDK_H__ */ diff --git a/clutter/gdk/clutter-settings-gdk.h b/clutter/gdk/clutter-settings-gdk.h new file mode 100644 index 000000000..c2b576e01 --- /dev/null +++ b/clutter/gdk/clutter-settings-gdk.h @@ -0,0 +1,28 @@ +#ifndef __CLUTTER_SETTINGS_GDK_H__ +#define __CLUTTER_SETTINGS_GDK_H__ + +/* XSETTINGS key names to ClutterSettings properties */ +static const struct { + const char *gdk_setting_name; + const char *settings_property; + GType type; +} _clutter_settings_map[] = { + { "gtk-double-click-time", "double-click-time", G_TYPE_INT }, + { "gtk-double-click-distance", "double-click-distance", G_TYPE_INT }, + { "gtk-dnd-drag-threshold", "dnd-drag-threshold", G_TYPE_INT }, + { "gtk-font-name", "font-name", G_TYPE_STRING }, + { "gtk-xft-antialias", "font-antialias", G_TYPE_INT }, + { "gtk-xft-dpi", "font-dpi", G_TYPE_INT }, + { "gtk-xft-hinting", "font-hinting", G_TYPE_INT }, + { "gtk-xft-hintstyle", "font-hint-style", G_TYPE_STRING }, + { "gtk-xft-rgba", "font-subpixel-order", G_TYPE_STRING }, + { "gtk-fontconfig-timestamp", "fontconfig-timestamp", G_TYPE_UINT }, +}; + +static const gint _n_clutter_settings_map = G_N_ELEMENTS (_clutter_settings_map); + +#define CLUTTER_SETTING_TYPE(id) (_clutter_settings_map[(id)].type) +#define CLUTTER_SETTING_GDK_NAME(id) (_clutter_settings_map[(id)].gdk_setting_name) +#define CLUTTER_SETTING_PROPERTY(id) (_clutter_settings_map[(id)].settings_property) + +#endif /* __CLUTTER_SETTINGS_GDK_H__ */ diff --git a/clutter/gdk/clutter-stage-gdk.c b/clutter/gdk/clutter-stage-gdk.c new file mode 100644 index 000000000..28c95e327 --- /dev/null +++ b/clutter/gdk/clutter-stage-gdk.c @@ -0,0 +1,605 @@ +/* Clutter. + * An OpenGL based 'interactive canvas' library. + * Authored By Matthew Allum + * Copyright (C) 2006-2007 OpenedHand + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * + */ + +#include "config.h" + +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#include +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif +#ifdef GDK_WINDOWING_WIN32 +#include +#endif + +#include "clutter-backend-gdk.h" +#include "clutter-stage-gdk.h" +#include "clutter-gdk.h" + +#include "clutter-actor-private.h" +#include "clutter-debug.h" +#include "clutter-device-manager-private.h" +#include "clutter-enum-types.h" +#include "clutter-event-translator.h" +#include "clutter-event-private.h" +#include "clutter-feature.h" +#include "clutter-main.h" +#include "clutter-paint-volume-private.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" + +static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface); + +static ClutterStageWindowIface *clutter_stage_window_parent_iface = NULL; + +#define clutter_stage_gdk_get_type _clutter_stage_gdk_get_type + +G_DEFINE_TYPE_WITH_CODE (ClutterStageGdk, + clutter_stage_gdk, + CLUTTER_TYPE_STAGE_COGL, + G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW, + clutter_stage_window_iface_init)); + +static void +clutter_stage_gdk_update_foreign_event_mask (CoglOnscreen *onscreen, + guint32 event_mask, + void *user_data) +{ + ClutterStageGdk *stage_gdk = user_data; + + /* we assume that a GDK event mask is bitwise compatible with X11 + event masks */ + gdk_window_set_events (stage_gdk->window, event_mask | CLUTTER_STAGE_GDK_EVENT_MASK); +} + + +static void +clutter_stage_gdk_set_gdk_geometry (ClutterStageGdk *stage) +{ + GdkGeometry geometry; + ClutterStage *wrapper = CLUTTER_STAGE_COGL (stage)->wrapper; + gboolean resize = clutter_stage_get_user_resizable (wrapper); + + if (!resize) + { + geometry.min_width = geometry.max_width = gdk_window_get_width (stage->window); + geometry.min_height = geometry.max_height = gdk_window_get_height (stage->window); + + gdk_window_set_geometry_hints (stage->window, + &geometry, + GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE); + } + else + { + clutter_stage_get_minimum_size (wrapper, + (guint *)&geometry.min_width, + (guint *)&geometry.min_height); + + gdk_window_set_geometry_hints (stage->window, + &geometry, + GDK_HINT_MIN_SIZE); + } +} + +static void +clutter_stage_gdk_get_geometry (ClutterStageWindow *stage_window, + cairo_rectangle_int_t *geometry) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + + if (stage_gdk->window != NULL) + { + geometry->width = gdk_window_get_width (stage_gdk->window); + geometry->height = gdk_window_get_height (stage_gdk->window); + } + else + { + geometry->width = 640; + geometry->height = 480; + } +} + +static void +clutter_stage_gdk_resize (ClutterStageWindow *stage_window, + gint width, + gint height) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + + if (width == 0 || height == 0) + { + /* Should not happen, if this turns up we need to debug it and + * determine the cleanest way to fix. + */ + g_warning ("GDK stage not allowed to have 0 width or height"); + width = 1; + height = 1; + } + + CLUTTER_NOTE (BACKEND, "New size received: (%d, %d)", width, height); + + CLUTTER_SET_PRIVATE_FLAGS (CLUTTER_STAGE_COGL (stage_gdk)->wrapper, + CLUTTER_IN_RESIZE); + + gdk_window_resize (stage_gdk->window, width, height); +} + +static void +clutter_stage_gdk_unrealize (ClutterStageWindow *stage_window) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + + if (stage_gdk->window != NULL) + { + g_object_set_data (G_OBJECT (stage_gdk->window), + "clutter-stage-window", NULL); + + if (stage_gdk->foreign_window) + g_object_unref (stage_gdk->window); + else + gdk_window_destroy (stage_gdk->window); + + stage_gdk->window = NULL; + } + + return clutter_stage_window_parent_iface->unrealize (stage_window); +} + +static gboolean +clutter_stage_gdk_realize (ClutterStageWindow *stage_window) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); + ClutterBackend *backend = CLUTTER_BACKEND (stage_cogl->backend); + ClutterBackendGdk *backend_gdk = CLUTTER_BACKEND_GDK (backend); + GdkWindowAttr attributes; + gboolean cursor_visible; + gboolean use_alpha; + gfloat width, height; + + if (!stage_gdk->foreign_window) + { + if (stage_gdk->window != NULL) + { + /* complete realizing the stage */ + cairo_rectangle_int_t geometry; + + clutter_stage_gdk_get_geometry (stage_window, &geometry); + clutter_actor_set_size (CLUTTER_ACTOR (stage_cogl->wrapper), + geometry.width, + geometry.height); + + gdk_window_ensure_native (stage_gdk->window); + gdk_window_set_events (stage_gdk->window, CLUTTER_STAGE_GDK_EVENT_MASK); + + return TRUE; + } + else + { + attributes.title = NULL; + g_object_get (stage_cogl->wrapper, + "cursor-visible", &cursor_visible, + "title", &attributes.title, + "width", &width, + "height", &height, + "use-alpha", &use_alpha, + NULL); + + attributes.width = width; + attributes.height = height; + attributes.wclass = GDK_INPUT_OUTPUT; + attributes.window_type = GDK_WINDOW_TOPLEVEL; + attributes.event_mask = CLUTTER_STAGE_GDK_EVENT_MASK; + + attributes.cursor = NULL; + if (!cursor_visible) + { + if (stage_gdk->blank_cursor == NULL) + stage_gdk->blank_cursor = gdk_cursor_new (GDK_BLANK_CURSOR); + + attributes.cursor = stage_gdk->blank_cursor; + } + + attributes.visual = NULL; + if (use_alpha) + { + attributes.visual = gdk_screen_get_rgba_visual (backend_gdk->screen); + + if (attributes.visual == NULL) + clutter_stage_set_use_alpha (stage_cogl->wrapper, FALSE); + } + + if (attributes.visual == NULL) + { + /* This could still be an RGBA visual, although normally it's not */ + attributes.visual = gdk_screen_get_system_visual (backend_gdk->screen); + } + + stage_gdk->foreign_window = FALSE; + stage_gdk->window = gdk_window_new (NULL, &attributes, + GDK_WA_TITLE | GDK_WA_CURSOR | GDK_WA_VISUAL); + + g_free (attributes.title); + } + + clutter_stage_gdk_set_gdk_geometry (stage_gdk); + } + + gdk_window_ensure_native (stage_gdk->window); + + g_object_set_data (G_OBJECT (stage_gdk->window), + "clutter-stage-window", stage_gdk); + + stage_cogl->onscreen = cogl_onscreen_new (backend->cogl_context, + width, height); + +#if defined(GDK_WINDOWING_X11) && defined(COGL_HAS_XLIB_SUPPORT) + if (GDK_IS_X11_WINDOW (stage_gdk->window)) + { + cogl_x11_onscreen_set_foreign_window_xid (stage_cogl->onscreen, + GDK_WINDOW_XID (stage_gdk->window), + clutter_stage_gdk_update_foreign_event_mask, + stage_gdk); + } + else +#endif +#if defined(GDK_WINDOWING_WIN32) && defined(COGL_HAS_WIN32_SUPPORT) + if (GDK_IS_WIN32_WINDOW (stage_gdk->window)) + { + cogl_win32_onscreen_set_foreign_window (stage_cogl->onscreen, + gdk_win32_window_get_handle (stage_gdk->window)); + } + else +#endif + { + g_warning ("Cannot find an appropriate CoglWinsys for a " + "GdkWindow of type %s", G_OBJECT_TYPE_NAME (stage_gdk->window)); + + cogl_object_unref (stage_cogl->onscreen); + stage_cogl->onscreen = NULL; + + if (!stage_gdk->foreign_window) + gdk_window_destroy (stage_gdk->window); + + stage_gdk->window = NULL; + + return FALSE; + } + + return clutter_stage_window_parent_iface->realize (stage_window); +} + +static void +clutter_stage_gdk_set_fullscreen (ClutterStageWindow *stage_window, + gboolean is_fullscreen) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + ClutterStage *stage = CLUTTER_STAGE_COGL (stage_window)->wrapper; + + if (stage == NULL || CLUTTER_ACTOR_IN_DESTRUCTION (stage)) + return; + + if (stage_gdk->window == NULL) + return; + + CLUTTER_NOTE (BACKEND, "%ssetting fullscreen", is_fullscreen ? "" : "un"); + + if (is_fullscreen) + gdk_window_fullscreen (stage_gdk->window); + else + gdk_window_unfullscreen (stage_gdk->window); +} + +static void +clutter_stage_gdk_set_cursor_visible (ClutterStageWindow *stage_window, + gboolean cursor_visible) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + + if (stage_gdk->window == NULL) + return; + + if (cursor_visible) + { + gdk_window_set_cursor (stage_gdk->window, NULL); + } + else + { + if (stage_gdk->blank_cursor == NULL) + stage_gdk->blank_cursor = gdk_cursor_new (GDK_BLANK_CURSOR); + + gdk_window_set_cursor (stage_gdk->window, stage_gdk->blank_cursor); + } +} + +static void +clutter_stage_gdk_set_title (ClutterStageWindow *stage_window, + const gchar *title) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + + if (stage_gdk->window == NULL) + return; + + gdk_window_set_title (stage_gdk->window, title); +} + +static void +clutter_stage_gdk_set_user_resizable (ClutterStageWindow *stage_window, + gboolean is_resizable) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + GdkWMFunction function; + + if (stage_gdk->window == NULL) + return; + + function = GDK_FUNC_MOVE | GDK_FUNC_MINIMIZE | GDK_FUNC_CLOSE; + if (is_resizable) + function |= GDK_FUNC_RESIZE | GDK_FUNC_MAXIMIZE; + + gdk_window_set_functions (stage_gdk->window, function); + + clutter_stage_gdk_set_gdk_geometry (stage_gdk); +} + +static void +clutter_stage_gdk_set_accept_focus (ClutterStageWindow *stage_window, + gboolean accept_focus) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + + if (stage_gdk->window == NULL) + return; + + gdk_window_set_accept_focus (stage_gdk->window, accept_focus); +} + +static void +clutter_stage_gdk_show (ClutterStageWindow *stage_window, + gboolean do_raise) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + + g_return_if_fail (stage_gdk->window != NULL); + + clutter_actor_map (CLUTTER_ACTOR (CLUTTER_STAGE_COGL (stage_gdk)->wrapper)); + + if (do_raise) + gdk_window_show (stage_gdk->window); + else + gdk_window_show_unraised (stage_gdk->window); +} + +static void +clutter_stage_gdk_hide (ClutterStageWindow *stage_window) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); + + g_return_if_fail (stage_gdk->window != NULL); + + clutter_actor_unmap (CLUTTER_ACTOR (CLUTTER_STAGE_COGL (stage_gdk)->wrapper)); + gdk_window_hide (stage_gdk->window); +} + +static gboolean +clutter_stage_gdk_can_clip_redraws (ClutterStageWindow *stage_window) +{ + return TRUE; +} + +static void +clutter_stage_gdk_dispose (GObject *gobject) +{ + ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (gobject); + + if (stage_gdk->window != NULL) + { + g_object_set_data (G_OBJECT (stage_gdk->window), + "clutter-stage-window", NULL); + if (stage_gdk->foreign_window) + g_object_unref (stage_gdk->window); + else + gdk_window_destroy (stage_gdk->window); + stage_gdk->window = NULL; + } + + if (stage_gdk->blank_cursor != NULL) + { + g_object_unref (stage_gdk->blank_cursor); + stage_gdk->blank_cursor = NULL; + } + + G_OBJECT_CLASS (clutter_stage_gdk_parent_class)->dispose (gobject); +} + +static void +clutter_stage_gdk_class_init (ClutterStageGdkClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->dispose = clutter_stage_gdk_dispose; +} + +static void +clutter_stage_gdk_init (ClutterStageGdk *stage) +{ + /* nothing to do here */ +} + +static void +clutter_stage_window_iface_init (ClutterStageWindowIface *iface) +{ + clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface); + + iface->set_title = clutter_stage_gdk_set_title; + iface->set_fullscreen = clutter_stage_gdk_set_fullscreen; + iface->set_cursor_visible = clutter_stage_gdk_set_cursor_visible; + iface->set_user_resizable = clutter_stage_gdk_set_user_resizable; + iface->set_accept_focus = clutter_stage_gdk_set_accept_focus; + iface->show = clutter_stage_gdk_show; + iface->hide = clutter_stage_gdk_hide; + iface->resize = clutter_stage_gdk_resize; + iface->get_geometry = clutter_stage_gdk_get_geometry; + iface->realize = clutter_stage_gdk_realize; + iface->unrealize = clutter_stage_gdk_unrealize; + iface->can_clip_redraws = clutter_stage_gdk_can_clip_redraws; +} + +/** + * clutter_gdk_get_stage_window: + * @stage: a #ClutterStage + * + * Gets the stages GdkWindow. + * + * Return value: (transfer none): A GdkWindow* for the stage window. + * + * Since: 1.10 + */ +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); + if (!CLUTTER_IS_STAGE_GDK (impl)) + { + g_critical ("The Clutter backend is not a GDK backend"); + return NULL; + } + + return CLUTTER_STAGE_GDK (impl)->window; +} + +/** + * clutter_gdk_get_stage_from_window: + * @window: a #GtkWindow + * + * Gets the stage for a particular X window. + * + * Return value: (transfer none): A #ClutterStage, or% NULL if a stage + * does not exist for the window + * + * Since: 1.10 + */ +ClutterStage * +clutter_gdk_get_stage_from_window (GdkWindow *window) +{ + ClutterStageGdk *stage_gdk = g_object_get_data (G_OBJECT (window), "clutter-stage-window"); + + if (stage_gdk != NULL && CLUTTER_IS_STAGE_GDK (stage_gdk)) + return CLUTTER_STAGE_COGL (stage_gdk)->wrapper; + + return NULL; +} + +typedef struct +{ + ClutterStageGdk *stage_gdk; + GdkWindow *window; +} ForeignWindowClosure; + +static void +set_foreign_window_callback (ClutterActor *actor, + void *data) +{ + ForeignWindowClosure *closure = data; + ClutterStageGdk *stage_gdk = closure->stage_gdk; + + stage_gdk->window = closure->window; + stage_gdk->foreign_window = TRUE; + + /* calling this with the stage unrealized will unset the stage + * from the GL context; once the stage is realized the GL context + * will be set again + */ + clutter_stage_ensure_current (CLUTTER_STAGE (actor)); +} + +/** + * clutter_gdk_set_stage_foreign: + * @stage: a #ClutterStage + * @window: an existing #GdkWindow + * + * Target the #ClutterStage to use an existing external #GdkWindow + * + * Return value: %TRUE if foreign window is valid + * + * Since: 1.10 + */ +gboolean +clutter_gdk_set_stage_foreign (ClutterStage *stage, + GdkWindow *window) +{ + ForeignWindowClosure closure; + ClutterStageGdk *stage_gdk; + ClutterStageWindow *impl; + ClutterActor *actor; + + g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE); + g_return_val_if_fail (!CLUTTER_ACTOR_IN_DESTRUCTION (stage), FALSE); + 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) + { + g_critical ("The provided GdkWindow is already in use by another ClutterStage"); + return FALSE; + } + + closure.stage_gdk = stage_gdk; + closure.window = g_object_ref (window); + + actor = CLUTTER_ACTOR (stage); + + _clutter_actor_rerealize (actor, + set_foreign_window_callback, + &closure); + + /* Queue a relayout - so the stage will be allocated the new + * window size. + * + * Note also that when the stage gets allocated the new + * window size that will result in the stage's + * priv->viewport being changed, which will in turn result + * in the Cogl viewport changing when _clutter_do_redraw + * calls _clutter_stage_maybe_setup_viewport(). + */ + clutter_actor_queue_relayout (actor); + + return TRUE; +} diff --git a/clutter/gdk/clutter-stage-gdk.h b/clutter/gdk/clutter-stage-gdk.h new file mode 100644 index 000000000..8c4cb207d --- /dev/null +++ b/clutter/gdk/clutter-stage-gdk.h @@ -0,0 +1,81 @@ +/* Clutter. + * An OpenGL based 'interactive canvas' library. + * Authored By Matthew Allum + * Copyright (C) 2006-2007 OpenedHand + * 2011 Giovanni Campagna + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * + */ + +#ifndef __CLUTTER_STAGE_GDK_H__ +#define __CLUTTER_STAGE_GDK_H__ + +#include +#include +#include + +#include "clutter-backend-gdk.h" +#include "cogl/clutter-stage-cogl.h" + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_STAGE_GDK (_clutter_stage_gdk_get_type ()) +#define CLUTTER_STAGE_GDK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_GDK, ClutterStageGdk)) +#define CLUTTER_IS_STAGE_GDK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_GDK)) +#define CLUTTER_STAGE_GDK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_STAGE_GDK, ClutterStageGdkClass)) +#define CLUTTER_IS_STAGE_GDK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_STAGE_GDK)) +#define CLUTTER_STAGE_GDK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_STAGE_GDK, ClutterStageGdkClass)) + +typedef struct _ClutterStageGdk ClutterStageGdk; +typedef struct _ClutterStageGdkClass ClutterStageGdkClass; + +struct _ClutterStageGdk +{ + ClutterStageCogl parent_instance; + + GdkWindow *window; + GdkCursor *blank_cursor; + + gboolean foreign_window; +}; + +struct _ClutterStageGdkClass +{ + ClutterStageCoglClass parent_class; +}; + +#define CLUTTER_STAGE_GDK_EVENT_MASK \ + (GDK_STRUCTURE_MASK | \ + GDK_FOCUS_CHANGE_MASK | \ + GDK_EXPOSURE_MASK | \ + GDK_PROPERTY_CHANGE_MASK | \ + GDK_ENTER_NOTIFY_MASK | \ + GDK_LEAVE_NOTIFY_MASK | \ + GDK_KEY_PRESS_MASK | \ + GDK_KEY_RELEASE_MASK | \ + GDK_BUTTON_PRESS_MASK | \ + GDK_BUTTON_RELEASE_MASK | \ + GDK_POINTER_MOTION_MASK) + +GType _clutter_stage_gdk_get_type (void) G_GNUC_CONST; + +void _clutter_stage_gdk_update_foreign_event_mask (CoglOnscreen *onscreen, + guint32 event_mask, + void *user_data); + +G_END_DECLS + +#endif /* __CLUTTER_STAGE_H__ */ diff --git a/clutter/osx/clutter-backend-osx.c b/clutter/osx/clutter-backend-osx.c index 520f53134..9590724da 100644 --- a/clutter/osx/clutter-backend-osx.c +++ b/clutter/osx/clutter-backend-osx.c @@ -253,9 +253,3 @@ clutter_backend_osx_class_init (ClutterBackendOSXClass *klass) 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 (); -} diff --git a/clutter/osx/clutter-stage-osx.h b/clutter/osx/clutter-stage-osx.h index 45943d137..6c4bad7b2 100644 --- a/clutter/osx/clutter-stage-osx.h +++ b/clutter/osx/clutter-stage-osx.h @@ -22,8 +22,9 @@ #ifndef __CLUTTER_STAGE_OSX_H__ #define __CLUTTER_STAGE_OSX_H__ -#include #include +#include +#include #import #import diff --git a/clutter/cogl/clutter-event-tslib.c b/clutter/tslib/clutter-event-tslib.c similarity index 94% rename from clutter/cogl/clutter-event-tslib.c rename to clutter/tslib/clutter-event-tslib.c index de04fd80d..045412fe9 100644 --- a/clutter/cogl/clutter-event-tslib.c +++ b/clutter/tslib/clutter-event-tslib.c @@ -19,11 +19,8 @@ * */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif -#include "clutter-stage-egl.h" #include "clutter-backend-egl.h" #include "clutter-egl.h" @@ -37,9 +34,7 @@ #include -#ifdef HAVE_TSLIB #include -#endif typedef struct _ClutterEventSource ClutterEventSource; @@ -50,13 +45,9 @@ struct _ClutterEventSource ClutterBackendEGL *backend; GPollFD event_poll_fd; -#ifdef HAVE_TSLIB - struct tsdev *ts_device; -#endif + struct tsdev *ts_device; }; -#ifdef HAVE_TSLIB - static gboolean clutter_event_prepare (GSource *source, gint *timeout); static gboolean clutter_event_check (GSource *source); @@ -93,16 +84,17 @@ get_backend_time (void) return g_timer_elapsed (backend_egl->event_timer, NULL) * 1000; } -#endif void -_clutter_events_tslib_init (ClutterBackendEGL *backend_egl) +_clutter_events_tslib_init (ClutterBackend *backend) { -#ifdef HAVE_TSLIB + ClutterBackendEglNative *backend_egl; ClutterEventSource *event_source; const char *device_name; GSource *source; + backend_egl = CLUTTER_BACKEND_EGL (backend); + CLUTTER_NOTE (EVENT, "Starting timer"); g_assert (backend_egl->event_timer != NULL); g_timer_start (backend_egl->event_timer); @@ -148,13 +140,11 @@ _clutter_events_tslib_init (ClutterBackendEGL *backend_egl) g_warning ("Unable to open '%s'", device_name); g_source_unref (source); } -#endif /* HAVE_TSLIB */ } void -_clutter_events_egl_uninit (ClutterBackendEGL *backend_egl) +_clutter_events_egl_uninit (ClutterBackendEglNative *backend_egl) { -#ifdef HAVE_TSLIB if (backend_egl->event_timer != NULL) { CLUTTER_NOTE (EVENT, "Stopping the timer"); @@ -175,11 +165,8 @@ _clutter_events_egl_uninit (ClutterBackendEGL *backend_egl) g_source_unref (backend_egl->event_source); backend_egl->event_source = NULL; } -#endif /* HAVE_TSLIB */ } -#ifdef HAVE_TSLIB - static gboolean clutter_event_prepare (GSource *source, gint *timeout) @@ -227,7 +214,7 @@ clutter_event_dispatch (GSource *source, if ((!clutter_events_pending()) && (ts_read(event_source->ts_device, &tsevent, 1) == 1)) { - static gint last_x = 0, last_y = 0; + static gint last_x = 0, last_y = 0; static gboolean clicked = FALSE; /* Avoid sending too many events which are just pressure changes. @@ -290,5 +277,3 @@ out: return TRUE; } - -#endif diff --git a/clutter/tslib/clutter-event-tslib.h b/clutter/tslib/clutter-event-tslib.h new file mode 100644 index 000000000..423633a27 --- /dev/null +++ b/clutter/tslib/clutter-event-tslib.h @@ -0,0 +1,35 @@ +/* Clutter. + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2006, 2007 OpenedHand + * Copyright (C) 2008, 2009, 2010, 2011 Intel Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + * + * + */ + +#ifndef __CLUTTER_EVENT_TSLIB_H__ +#define __CLUTTER_EVENT_TSLIB_H__ + +#include + +G_BEGIN_DECLS + +void _clutter_events_tslib_init (ClutterBackend *backend); +void _clutter_events_tslib_uninit (ClutterBackend *backend); + +G_END_DECLS + +#endif /* __CLUTTER_EVENT_TSLIB_H__ */ diff --git a/clutter/wayland/clutter-backend-wayland.c b/clutter/wayland/clutter-backend-wayland.c index 56c23a251..361de4e48 100644 --- a/clutter/wayland/clutter-backend-wayland.c +++ b/clutter/wayland/clutter-backend-wayland.c @@ -52,13 +52,6 @@ static ClutterBackendWayland *backend_singleton = NULL; G_DEFINE_TYPE (ClutterBackendWayland, _clutter_backend_wayland, CLUTTER_TYPE_BACKEND); -static void -clutter_backend_at_exit (void) -{ - if (backend_singleton) - g_object_run_dispose (G_OBJECT (backend_singleton)); -} - static gboolean clutter_backend_wayland_pre_parse (ClutterBackend *backend, GError **error) @@ -281,8 +274,6 @@ clutter_backend_wayland_post_parse (ClutterBackend *backend, ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend); EGLBoolean status; - g_atexit (clutter_backend_at_exit); - /* TODO: expose environment variable/commandline option for this... */ backend_wayland->wayland_display = wl_display_connect (NULL); if (!backend_wayland->wayland_display) @@ -659,12 +650,6 @@ _clutter_backend_wayland_init (ClutterBackendWayland *backend_wayland) 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) { diff --git a/clutter/win32/clutter-backend-win32.c b/clutter/win32/clutter-backend-win32.c index 1fb121428..c8fb092f3 100644 --- a/clutter/win32/clutter-backend-win32.c +++ b/clutter/win32/clutter-backend-win32.c @@ -378,12 +378,6 @@ clutter_backend_win32_init (ClutterBackendWin32 *backend_win32) timeBeginPeriod (1); } -GType -_clutter_backend_impl_get_type (void) -{ - return clutter_backend_win32_get_type (); -} - BOOL WINAPI DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved) { diff --git a/clutter/win32/clutter-stage-win32.c b/clutter/win32/clutter-stage-win32.c index a309d2512..573b0138c 100644 --- a/clutter/win32/clutter-stage-win32.c +++ b/clutter/win32/clutter-stage-win32.c @@ -733,9 +733,13 @@ clutter_win32_set_stage_foreign (ClutterStage *stage, 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)) @@ -758,6 +762,8 @@ clutter_win32_set_stage_foreign (ClutterStage *stage, 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); diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c index ab1cde264..97b77da9b 100644 --- a/clutter/x11/clutter-backend-x11.c +++ b/clutter/x11/clutter-backend-x11.c @@ -59,6 +59,7 @@ #endif #include +#include #include "clutter-backend.h" #include "clutter-debug.h" @@ -69,7 +70,7 @@ #define clutter_backend_x11_get_type _clutter_backend_x11_get_type -G_DEFINE_TYPE (ClutterBackendX11, clutter_backend_x11, CLUTTER_TYPE_BACKEND); +G_DEFINE_TYPE (ClutterBackendX11, clutter_backend_x11, CLUTTER_TYPE_BACKEND_COGL); /* atoms; remember to add the code that assigns the atom value to * the member of the ClutterBackendX11 structure if you add an @@ -91,9 +92,6 @@ static const gchar *atom_names[] = { #define N_ATOM_NAMES G_N_ELEMENTS (atom_names) -/* singleton object */ -static ClutterBackendX11 *backend_singleton = NULL; - /* various flags corresponding to pre init setup calls */ static gboolean _no_xevent_retrieval = FALSE; static gboolean clutter_enable_xinput = FALSE; @@ -333,7 +331,8 @@ _clutter_backend_x11_pre_parse (ClutterBackend *backend, env_string = NULL; } - return TRUE; + return CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class)->pre_parse (backend, + error); } gboolean @@ -341,11 +340,14 @@ _clutter_backend_x11_post_parse (ClutterBackend *backend, GError **error) { ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend); + ClutterSettings *settings; + Atom atoms[N_ATOM_NAMES]; + double dpi; if (_foreign_dpy) backend_x11->xdpy = _foreign_dpy; - /* - * Only open connection if not already set by prior call to + + /* Only open connection if not already set by prior call to * clutter_x11_set_display() */ if (backend_x11->xdpy == NULL) @@ -378,78 +380,72 @@ _clutter_backend_x11_post_parse (ClutterBackend *backend, g_assert (backend_x11->xdpy != NULL); - { - ClutterSettings *settings; - Atom atoms[N_ATOM_NAMES]; - double dpi; + CLUTTER_NOTE (BACKEND, "Getting the X screen"); - CLUTTER_NOTE (BACKEND, "Getting the X screen"); + settings = clutter_settings_get_default (); - settings = clutter_settings_get_default (); + /* Cogl needs to know the Xlib display connection for + CoglTexturePixmapX11 */ + cogl_xlib_set_display (backend_x11->xdpy); - /* Cogl needs to know the Xlib display connection for - CoglTexturePixmapX11 */ - cogl_xlib_set_display (backend_x11->xdpy); + /* add event filter for Cogl events */ + clutter_x11_add_filter (cogl_xlib_filter, NULL); - /* add event filter for Cogl events */ - clutter_x11_add_filter (cogl_xlib_filter, NULL); + if (clutter_screen == -1) + backend_x11->xscreen = DefaultScreenOfDisplay (backend_x11->xdpy); + else + backend_x11->xscreen = ScreenOfDisplay (backend_x11->xdpy, + clutter_screen); - if (clutter_screen == -1) - backend_x11->xscreen = DefaultScreenOfDisplay (backend_x11->xdpy); - else - backend_x11->xscreen = ScreenOfDisplay (backend_x11->xdpy, - clutter_screen); + backend_x11->xscreen_num = XScreenNumberOfScreen (backend_x11->xscreen); + backend_x11->xscreen_width = WidthOfScreen (backend_x11->xscreen); + backend_x11->xscreen_height = HeightOfScreen (backend_x11->xscreen); - backend_x11->xscreen_num = XScreenNumberOfScreen (backend_x11->xscreen); - backend_x11->xscreen_width = WidthOfScreen (backend_x11->xscreen); - backend_x11->xscreen_height = HeightOfScreen (backend_x11->xscreen); + backend_x11->xwin_root = RootWindow (backend_x11->xdpy, + backend_x11->xscreen_num); - backend_x11->xwin_root = RootWindow (backend_x11->xdpy, - backend_x11->xscreen_num); + backend_x11->display_name = g_strdup (clutter_display_name); - backend_x11->display_name = g_strdup (clutter_display_name); + dpi = (((double) DisplayHeight (backend_x11->xdpy, backend_x11->xscreen_num) * 25.4) + / (double) DisplayHeightMM (backend_x11->xdpy, backend_x11->xscreen_num)); - dpi = (((double) DisplayHeight (backend_x11->xdpy, backend_x11->xscreen_num) * 25.4) - / (double) DisplayHeightMM (backend_x11->xdpy, backend_x11->xscreen_num)); + g_object_set (settings, "font-dpi", (int) dpi * 1024, NULL); - g_object_set (settings, "font-dpi", (int) dpi * 1024, NULL); + /* create the device manager */ + clutter_backend_x11_create_device_manager (backend_x11); - /* create the device manager */ - clutter_backend_x11_create_device_manager (backend_x11); + /* register keymap */ + clutter_backend_x11_create_keymap (backend_x11); - /* register keymap */ - clutter_backend_x11_create_keymap (backend_x11); + /* create XSETTINGS client */ + backend_x11->xsettings = + _clutter_xsettings_client_new (backend_x11->xdpy, + backend_x11->xscreen_num, + clutter_backend_x11_xsettings_notify, + NULL, + backend_x11); - /* create XSETTINGS client */ - backend_x11->xsettings = - _clutter_xsettings_client_new (backend_x11->xdpy, - backend_x11->xscreen_num, - clutter_backend_x11_xsettings_notify, - NULL, - backend_x11); + /* add event filter for XSETTINGS events */ + clutter_x11_add_filter (xsettings_filter, backend_x11); - /* add event filter for XSETTINGS events */ - clutter_x11_add_filter (xsettings_filter, backend_x11); + if (clutter_synchronise) + XSynchronize (backend_x11->xdpy, True); - if (clutter_synchronise) - XSynchronize (backend_x11->xdpy, True); + XInternAtoms (backend_x11->xdpy, + (char **) atom_names, N_ATOM_NAMES, + False, atoms); - XInternAtoms (backend_x11->xdpy, - (char **) atom_names, N_ATOM_NAMES, - False, atoms); - - backend_x11->atom_NET_WM_PID = atoms[0]; - backend_x11->atom_NET_WM_PING = atoms[1]; - backend_x11->atom_NET_WM_STATE = atoms[2]; - backend_x11->atom_NET_WM_STATE_FULLSCREEN = atoms[3]; - backend_x11->atom_NET_WM_USER_TIME = atoms[4]; - backend_x11->atom_WM_PROTOCOLS = atoms[5]; - backend_x11->atom_WM_DELETE_WINDOW = atoms[6]; - backend_x11->atom_XEMBED = atoms[7]; - backend_x11->atom_XEMBED_INFO = atoms[8]; - backend_x11->atom_NET_WM_NAME = atoms[9]; - backend_x11->atom_UTF8_STRING = atoms[10]; - } + backend_x11->atom_NET_WM_PID = atoms[0]; + backend_x11->atom_NET_WM_PING = atoms[1]; + backend_x11->atom_NET_WM_STATE = atoms[2]; + backend_x11->atom_NET_WM_STATE_FULLSCREEN = atoms[3]; + backend_x11->atom_NET_WM_USER_TIME = atoms[4]; + backend_x11->atom_WM_PROTOCOLS = atoms[5]; + backend_x11->atom_WM_DELETE_WINDOW = atoms[6]; + backend_x11->atom_XEMBED = atoms[7]; + backend_x11->atom_XEMBED_INFO = atoms[8]; + backend_x11->atom_NET_WM_NAME = atoms[9]; + backend_x11->atom_UTF8_STRING = atoms[10]; g_free (clutter_display_name); @@ -461,7 +457,8 @@ _clutter_backend_x11_post_parse (ClutterBackend *backend, (unsigned int) backend_x11->xwin_root, clutter_backend_get_resolution (backend)); - return TRUE; + return CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class)->post_parse (backend, + error); } @@ -525,9 +522,6 @@ clutter_backend_x11_finalize (GObject *gobject) XCloseDisplay (backend_x11->xdpy); - if (backend_singleton) - backend_singleton = NULL; - G_OBJECT_CLASS (clutter_backend_x11_parent_class)->finalize (gobject); } @@ -548,34 +542,15 @@ clutter_backend_x11_dispose (GObject *gobject) G_OBJECT_CLASS (clutter_backend_x11_parent_class)->dispose (gobject); } -static GObject * -clutter_backend_x11_constructor (GType gtype, - guint n_params, - GObjectConstructParam *params) -{ - GObjectClass *parent_class; - GObject *retval; - - if (backend_singleton == NULL) - { - parent_class = G_OBJECT_CLASS (clutter_backend_x11_parent_class); - retval = parent_class->constructor (gtype, n_params, params); - - backend_singleton = CLUTTER_BACKEND_X11 (retval); - - return retval; - } - - g_warning ("Attempting to create a new backend object. This should " - "never happen, so we return the singleton instance."); - - return g_object_ref (backend_singleton); -} - static ClutterFeatureFlags clutter_backend_x11_get_features (ClutterBackend *backend) { - return CLUTTER_FEATURE_STAGE_USER_RESIZE | CLUTTER_FEATURE_STAGE_CURSOR; + ClutterFeatureFlags flags = CLUTTER_FEATURE_STAGE_USER_RESIZE + | CLUTTER_FEATURE_STAGE_CURSOR; + + flags |= CLUTTER_BACKEND_CLASS (clutter_backend_x11_parent_class)->get_features (backend); + + return flags; } static void @@ -705,13 +680,146 @@ clutter_backend_x11_translate_event (ClutterBackend *backend, return parent_class->translate_event (backend, native, event); } +static gboolean +clutter_backend_x11_create_context (ClutterBackend *backend, + GError **error) +{ + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend); + CoglOnscreenTemplate *onscreen_template = NULL; + CoglSwapChain *swap_chain = NULL; + GError *internal_error = NULL; + gboolean status; + + if (backend->cogl_context != NULL) + return TRUE; + + backend->cogl_renderer = cogl_renderer_new (); + cogl_xlib_renderer_set_foreign_display (backend->cogl_renderer, + backend_x11->xdpy); + if (!cogl_renderer_connect (backend->cogl_renderer, &internal_error)) + goto error; + + swap_chain = cogl_swap_chain_new (); + cogl_swap_chain_set_has_alpha (swap_chain, clutter_enable_argb); + + onscreen_template = cogl_onscreen_template_new (swap_chain); + cogl_object_unref (swap_chain); + + /* XXX: I have some doubts that this is a good design. + * + * Conceptually should we be able to check an onscreen_template + * without more details about the CoglDisplay configuration? + */ + status = cogl_renderer_check_onscreen_template (backend->cogl_renderer, + onscreen_template, + &internal_error); + if (!status && clutter_enable_argb) + { + CLUTTER_NOTE (BACKEND, + "Creation of a context with a ARGB visual failed: %s", + internal_error != NULL ? internal_error->message + : "Unknown reason"); + + g_clear_error (&internal_error); + + /* It's possible that the current renderer doesn't support transparency + * in a swap_chain so lets see if we can fallback to not having any + * transparency... + * + * XXX: It might be nice to have a CoglRenderer feature we could + * explicitly check for ahead of time. + */ + clutter_enable_argb = FALSE; + cogl_swap_chain_set_has_alpha (swap_chain, FALSE); + status = cogl_renderer_check_onscreen_template (backend->cogl_renderer, + onscreen_template, + &internal_error); + } + + if (!status) + goto error; + + backend->cogl_display = cogl_display_new (backend->cogl_renderer, + onscreen_template); + + cogl_object_unref (backend->cogl_renderer); + cogl_object_unref (onscreen_template); + + if (!cogl_display_setup (backend->cogl_display, &internal_error)) + goto error; + + backend->cogl_context = cogl_context_new (backend->cogl_display, + &internal_error); + if (backend->cogl_context == NULL) + goto error; + + return TRUE; + +error: + if (internal_error != NULL) + { + CLUTTER_NOTE (BACKEND, "Backend creation failed: %s", + internal_error->message); + + g_set_error_literal (error, CLUTTER_INIT_ERROR, + CLUTTER_INIT_ERROR_BACKEND, + internal_error->message); + g_error_free (internal_error); + } + + if (backend->cogl_display != NULL) + { + cogl_object_unref (backend->cogl_display); + backend->cogl_display = NULL; + } + + if (onscreen_template != NULL) + cogl_object_unref (onscreen_template); + + if (swap_chain != NULL) + cogl_object_unref (swap_chain); + + if (backend->cogl_renderer != NULL) + { + cogl_object_unref (backend->cogl_renderer); + backend->cogl_renderer = NULL; + } + + return FALSE; +} + +static ClutterStageWindow * +clutter_backend_x11_create_stage (ClutterBackend *backend, + ClutterStage *wrapper, + GError **error) +{ + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend); + ClutterEventTranslator *translator; + ClutterStageWindow *stage; + + stage = g_object_new (CLUTTER_TYPE_STAGE_X11, + "backend", backend, + "wrapper", wrapper, + NULL); + + /* the X11 stage does event translation */ + translator = CLUTTER_EVENT_TRANSLATOR (stage); + _clutter_backend_add_event_translator (backend, translator); + + CLUTTER_NOTE (MISC, "X11 stage created (display:%p, screen:%d, root:%u)", + backend_x11->xdpy, + backend_x11->xscreen_num, + (unsigned int) backend_x11->xwin_root); + + return stage; +} + static void clutter_backend_x11_class_init (ClutterBackendX11Class *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass); - gobject_class->constructor = clutter_backend_x11_constructor; gobject_class->dispose = clutter_backend_x11_dispose; gobject_class->finalize = clutter_backend_x11_finalize; @@ -724,6 +832,8 @@ clutter_backend_x11_class_init (ClutterBackendX11Class *klass) backend_class->copy_event_data = clutter_backend_x11_copy_event_data; backend_class->free_event_data = clutter_backend_x11_free_event_data; backend_class->translate_event = clutter_backend_x11_translate_event; + backend_class->create_context = clutter_backend_x11_create_context; + backend_class->create_stage = clutter_backend_x11_create_stage; } static void @@ -783,13 +893,21 @@ clutter_x11_untrap_x_errors (void) Display * clutter_x11_get_default_display (void) { - if (!backend_singleton) + ClutterBackend *backend = clutter_get_default_backend (); + + if (backend == NULL) { - g_critical ("X11 backend has not been initialised"); + g_critical ("The Clutter backend has not been initialised"); return NULL; } - return backend_singleton->xdpy; + if (!CLUTTER_IS_BACKEND_X11 (backend)) + { + g_critical ("The Clutter backend is not a X11 backend"); + return NULL; + } + + return CLUTTER_BACKEND_X11 (backend)->xdpy; } /** @@ -912,13 +1030,21 @@ clutter_x11_has_event_retrieval (void) int clutter_x11_get_default_screen (void) { - if (!backend_singleton) + ClutterBackend *backend = clutter_get_default_backend (); + + if (backend == NULL) { - g_critical ("X11 backend has not been initialised"); + g_critical ("The Clutter backend has not been initialised"); return 0; } - return backend_singleton->xscreen_num; + if (!CLUTTER_IS_BACKEND_X11 (backend)) + { + g_critical ("The Clutter backend is not a X11 backend"); + return 0; + } + + return CLUTTER_BACKEND_X11 (backend)->xscreen_num; } /** @@ -933,13 +1059,21 @@ clutter_x11_get_default_screen (void) Window clutter_x11_get_root_window (void) { - if (!backend_singleton) + ClutterBackend *backend = clutter_get_default_backend (); + + if (backend == NULL) { - g_critical ("X11 backend has not been initialised"); + g_critical ("The Clutter backend has not been initialised"); return None; } - return backend_singleton->xwin_root; + if (!CLUTTER_IS_BACKEND_X11 (backend)) + { + g_critical ("The Clutter backend is not a X11 backend"); + return None; + } + + return CLUTTER_BACKEND_X11 (backend)->xwin_root; } /** @@ -956,21 +1090,31 @@ clutter_x11_add_filter (ClutterX11FilterFunc func, gpointer data) { ClutterX11EventFilter *filter; + ClutterBackend *backend = clutter_get_default_backend (); + ClutterBackendX11 *backend_x11; g_return_if_fail (func != NULL); - if (!backend_singleton) + 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; + } + + backend_x11 = CLUTTER_BACKEND_X11 (backend); + filter = g_new0 (ClutterX11EventFilter, 1); filter->func = func; filter->data = data; - backend_singleton->event_filters = - g_slist_append (backend_singleton->event_filters, filter); + backend_x11->event_filters = + g_slist_append (backend_x11->event_filters, filter); return; } @@ -990,10 +1134,26 @@ clutter_x11_remove_filter (ClutterX11FilterFunc func, { GSList *tmp_list, *this; ClutterX11EventFilter *filter; + ClutterBackend *backend = clutter_get_default_backend (); + ClutterBackendX11 *backend_x11; g_return_if_fail (func != NULL); - tmp_list = backend_singleton->event_filters; + if (backend == NULL) + { + 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; + } + + backend_x11 = CLUTTER_BACKEND_X11 (backend); + + tmp_list = backend_x11->event_filters; while (tmp_list) { @@ -1003,8 +1163,8 @@ clutter_x11_remove_filter (ClutterX11FilterFunc func, if (filter->func == func && filter->data == data) { - backend_singleton->event_filters = - g_slist_remove_link (backend_singleton->event_filters, this); + backend_x11->event_filters = + g_slist_remove_link (backend_x11->event_filters, this); g_slist_free_1 (this); g_free (filter); @@ -1051,10 +1211,21 @@ gboolean clutter_x11_has_xinput (void) { #if defined(HAVE_XINPUT) || defined(HAVE_XINPUT_2) - if (backend_singleton != NULL) - return backend_singleton->has_xinput; + ClutterBackend *backend = clutter_get_default_backend (); - return FALSE; + if (backend == NULL) + { + 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; + } + + return CLUTTER_BACKEND_X11 (backend)->has_xinput; #else return FALSE; #endif @@ -1086,6 +1257,8 @@ clutter_x11_has_composite_extension (void) } dpy = clutter_x11_get_default_display(); + if (dpy == NULL) + return FALSE; if (XCompositeQueryExtension (dpy, &event, &error)) { @@ -1158,15 +1331,7 @@ clutter_x11_get_use_argb_visual (void) XVisualInfo * _clutter_backend_x11_get_visual_info (ClutterBackendX11 *backend_x11) { - ClutterBackendX11Class *klass; - - g_return_val_if_fail (CLUTTER_IS_BACKEND_X11 (backend_x11), NULL); - - klass = CLUTTER_BACKEND_X11_GET_CLASS (backend_x11); - if (klass->get_visual_info) - return klass->get_visual_info (backend_x11); - - return NULL; + return cogl_clutter_winsys_xlib_get_visual_info (); } /** @@ -1185,8 +1350,16 @@ XVisualInfo * 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); } diff --git a/clutter/x11/clutter-backend-x11.h b/clutter/x11/clutter-backend-x11.h index 0c4a5d8cc..701328577 100644 --- a/clutter/x11/clutter-backend-x11.h +++ b/clutter/x11/clutter-backend-x11.h @@ -31,6 +31,7 @@ #include "clutter-backend-private.h" #include "clutter-keymap-x11.h" +#include "cogl/clutter-backend-cogl.h" #include "xsettings/xsettings-client.h" @@ -67,7 +68,7 @@ struct _ClutterEventX11 struct _ClutterBackendX11 { - ClutterBackend parent_instance; + ClutterBackendCogl parent_instance; Display *xdpy; gchar *display_name; @@ -112,14 +113,7 @@ struct _ClutterBackendX11 struct _ClutterBackendX11Class { - ClutterBackendClass parent_class; - - /* - * To support foreign stage windows the we need a way to ask for an - * XVisualInfo that may be used by toolkits to create an XWindow, and this - * may need to be handled differently for different backends. - */ - XVisualInfo *(* get_visual_info) (ClutterBackendX11 *backend); + ClutterBackendCoglClass parent_class; }; void _clutter_backend_x11_events_init (ClutterBackend *backend); diff --git a/clutter/cogl/clutter-glx-texture-pixmap.c b/clutter/x11/clutter-glx-texture-pixmap.c similarity index 100% rename from clutter/cogl/clutter-glx-texture-pixmap.c rename to clutter/x11/clutter-glx-texture-pixmap.c diff --git a/clutter/cogl/clutter-glx-texture-pixmap.h b/clutter/x11/clutter-glx-texture-pixmap.h similarity index 100% rename from clutter/cogl/clutter-glx-texture-pixmap.h rename to clutter/x11/clutter-glx-texture-pixmap.h diff --git a/clutter/cogl/clutter-glx.h b/clutter/x11/clutter-glx.h similarity index 100% rename from clutter/cogl/clutter-glx.h rename to clutter/x11/clutter-glx.h diff --git a/clutter/x11/clutter-stage-x11.c b/clutter/x11/clutter-stage-x11.c index 410afd769..ac8463902 100644 --- a/clutter/x11/clutter-stage-x11.c +++ b/clutter/x11/clutter-stage-x11.c @@ -27,6 +27,8 @@ #include #endif +#include + #include "clutter-backend-x11.h" #include "clutter-stage-x11.h" #include "clutter-x11.h" @@ -43,14 +45,14 @@ #include "clutter-private.h" #include "clutter-stage-private.h" -#include "cogl/cogl.h" - #ifdef HAVE_XFIXES #include #endif #define STAGE_X11_IS_MAPPED(s) ((((ClutterStageX11 *) (s))->wm_state & STAGE_X11_WITHDRAWN) == 0) +static ClutterStageWindowIface *clutter_stage_window_parent_iface = NULL; + static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface); static void clutter_event_translator_iface_init (ClutterEventTranslatorIface *iface); @@ -60,7 +62,7 @@ static GHashTable *clutter_stages_by_xid = NULL; G_DEFINE_TYPE_WITH_CODE (ClutterStageX11, clutter_stage_x11, - G_TYPE_OBJECT, + CLUTTER_TYPE_STAGE_COGL, G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW, clutter_stage_window_iface_init) G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_EVENT_TRANSLATOR, @@ -129,7 +131,8 @@ clutter_stage_x11_fix_window_size (ClutterStageX11 *stage_x11, gint new_width, gint new_height) { - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); if (stage_x11->xwin != None && !stage_x11->is_foreign_xwin) { @@ -137,11 +140,11 @@ clutter_stage_x11_fix_window_size (ClutterStageX11 *stage_x11, XSizeHints *size_hints; gboolean resize; - resize = clutter_stage_get_user_resizable (stage_x11->wrapper); + resize = clutter_stage_get_user_resizable (stage_cogl->wrapper); size_hints = XAllocSizeHints(); - clutter_stage_get_minimum_size (stage_x11->wrapper, + clutter_stage_get_minimum_size (stage_cogl->wrapper, &min_width, &min_height); @@ -182,7 +185,8 @@ clutter_stage_x11_fix_window_size (ClutterStageX11 *stage_x11, static void clutter_stage_x11_set_wm_protocols (ClutterStageX11 *stage_x11) { - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); Atom protocols[2]; int n = 0; @@ -197,7 +201,8 @@ clutter_stage_x11_get_geometry (ClutterStageWindow *stage_window, cairo_rectangle_int_t *geometry) { ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); /* If we're fullscreen, return the size of the display. */ if ((stage_x11->state & CLUTTER_STAGE_STATE_FULLSCREEN) && @@ -219,7 +224,8 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window, gint height) { ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); if (stage_x11->is_foreign_xwin) { @@ -229,7 +235,7 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window, */ stage_x11->xwin_width = width; stage_x11->xwin_height = height; - clutter_actor_queue_relayout (CLUTTER_ACTOR (stage_x11->wrapper)); + clutter_actor_queue_relayout (CLUTTER_ACTOR (stage_cogl->wrapper)); return; } @@ -262,7 +268,7 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window, width, height); - CLUTTER_SET_PRIVATE_FLAGS (stage_x11->wrapper, + CLUTTER_SET_PRIVATE_FLAGS (stage_cogl->wrapper, CLUTTER_IN_RESIZE); /* XXX: in this case we can rely on a subsequent @@ -280,7 +286,8 @@ clutter_stage_x11_resize (ClutterStageWindow *stage_window, static inline void set_wm_pid (ClutterStageX11 *stage_x11) { - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); long pid; if (stage_x11->xwin == None || stage_x11->is_foreign_xwin) @@ -304,7 +311,8 @@ set_wm_pid (ClutterStageX11 *stage_x11) static inline void set_wm_title (ClutterStageX11 *stage_x11) { - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); if (stage_x11->xwin == None || stage_x11->is_foreign_xwin) return; @@ -331,7 +339,8 @@ set_wm_title (ClutterStageX11 *stage_x11) static inline void set_cursor_visible (ClutterStageX11 *stage_x11) { - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); if (stage_x11->xwin == None) return; @@ -385,6 +394,8 @@ clutter_stage_x11_unrealize (ClutterStageWindow *stage_window) g_hash_table_remove (clutter_stages_by_xid, GINT_TO_POINTER (stage_x11->xwin)); } + + clutter_stage_window_parent_iface->unrealize (stage_window); } void @@ -393,7 +404,8 @@ _clutter_stage_x11_update_foreign_event_mask (CoglOnscreen *onscreen, void *user_data) { ClutterStageX11 *stage_x11 = user_data; - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = user_data; + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); XSetWindowAttributes attrs; attrs.event_mask = event_mask | CLUTTER_STAGE_X11_EVENT_MASK; @@ -408,9 +420,36 @@ static gboolean clutter_stage_x11_realize (ClutterStageWindow *stage_window) { ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); + ClutterBackend *backend = CLUTTER_BACKEND (stage_cogl->backend); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend); ClutterDeviceManager *device_manager; int event_flags; + gfloat width, height; + + clutter_actor_get_size (CLUTTER_ACTOR (stage_cogl->wrapper), + &width, &height); + + stage_cogl->onscreen = cogl_onscreen_new (backend->cogl_context, + width, height); + + if (stage_x11->xwin != None) + { + cogl_x11_onscreen_set_foreign_window_xid (stage_cogl->onscreen, + stage_x11->xwin, + _clutter_stage_x11_update_foreign_event_mask, + stage_x11); + + } + + /* Chain to the parent class now. ClutterStageCogl will call cogl_framebuffer_allocate, + which will create the X Window we need */ + + if (!(clutter_stage_window_parent_iface->realize (stage_window))) + return FALSE; + + if (stage_x11->xwin == None) + stage_x11->xwin = cogl_x11_onscreen_get_window_xid (stage_cogl->onscreen); if (clutter_stages_by_xid == NULL) clutter_stages_by_xid = g_hash_table_new (NULL, NULL); @@ -456,7 +495,7 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window) */ device_manager = clutter_device_manager_get_default (); _clutter_device_manager_select_stage_events (device_manager, - stage_x11->wrapper, + stage_cogl->wrapper, event_flags); /* no user resize.. */ @@ -475,8 +514,9 @@ clutter_stage_x11_set_fullscreen (ClutterStageWindow *stage_window, gboolean is_fullscreen) { ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); - ClutterBackendX11 *backend_x11 = stage_x11->backend; - ClutterStage *stage = stage_x11->wrapper; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); + ClutterStage *stage = stage_cogl->wrapper; gboolean was_fullscreen; if (stage == NULL || CLUTTER_ACTOR_IN_DESTRUCTION (stage)) @@ -611,7 +651,8 @@ clutter_stage_x11_set_user_resizable (ClutterStageWindow *stage_window, static inline void update_wm_hints (ClutterStageX11 *stage_x11) { - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); XWMHints wm_hints; if (stage_x11->wm_state & STAGE_X11_WITHDRAWN) @@ -661,7 +702,8 @@ clutter_stage_x11_show (ClutterStageWindow *stage_window, gboolean do_raise) { ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); if (stage_x11->xwin != None) { @@ -689,7 +731,7 @@ clutter_stage_x11_show (ClutterStageWindow *stage_window, g_assert (STAGE_X11_IS_MAPPED (stage_x11)); - clutter_actor_map (CLUTTER_ACTOR (stage_x11->wrapper)); + clutter_actor_map (CLUTTER_ACTOR (stage_cogl->wrapper)); if (!stage_x11->is_foreign_xwin) XMapWindow (backend_x11->xdpy, stage_x11->xwin); @@ -700,7 +742,8 @@ static void clutter_stage_x11_hide (ClutterStageWindow *stage_window) { ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); if (stage_x11->xwin != None) { @@ -709,17 +752,23 @@ clutter_stage_x11_hide (ClutterStageWindow *stage_window) g_assert (!STAGE_X11_IS_MAPPED (stage_x11)); - clutter_actor_unmap (CLUTTER_ACTOR (stage_x11->wrapper)); + clutter_actor_unmap (CLUTTER_ACTOR (stage_cogl->wrapper)); if (!stage_x11->is_foreign_xwin) XWithdrawWindow (backend_x11->xdpy, stage_x11->xwin, 0); } } -static ClutterActor * -clutter_stage_x11_get_wrapper (ClutterStageWindow *stage_window) +static gboolean +clutter_stage_x11_can_clip_redraws (ClutterStageWindow *stage_window) { - return CLUTTER_ACTOR (CLUTTER_STAGE_X11 (stage_window)->wrapper); + ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); + + /* while resizing a window, clipped redraws are disabled in order to + * avoid artefacts. see clutter-event-x11.c:event_translate for a more + * detailed explanation + */ + return stage_x11->clipped_redraws_cool_off == 0; } static void @@ -736,7 +785,7 @@ static void clutter_stage_x11_dispose (GObject *gobject) { ClutterEventTranslator *translator = CLUTTER_EVENT_TRANSLATOR (gobject); - ClutterBackendX11 *backend = CLUTTER_STAGE_X11 (gobject)->backend; + ClutterBackendCogl *backend = CLUTTER_STAGE_COGL (gobject)->backend; _clutter_backend_remove_event_translator (CLUTTER_BACKEND (backend), translator); @@ -768,14 +817,13 @@ clutter_stage_x11_init (ClutterStageX11 *stage) stage->accept_focus = TRUE; stage->title = NULL; - - stage->wrapper = NULL; } static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface) { - iface->get_wrapper = clutter_stage_x11_get_wrapper; + clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface); + iface->set_title = clutter_stage_x11_set_title; iface->set_fullscreen = clutter_stage_x11_set_fullscreen; iface->set_cursor_visible = clutter_stage_x11_set_cursor_visible; @@ -787,6 +835,7 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface) iface->get_geometry = clutter_stage_x11_get_geometry; iface->realize = clutter_stage_x11_realize; iface->unrealize = clutter_stage_x11_unrealize; + iface->can_clip_redraws = clutter_stage_x11_can_clip_redraws; } static inline void @@ -810,6 +859,7 @@ handle_wm_protocols_event (ClutterBackendX11 *backend_x11, ClutterStageX11 *stage_x11, XEvent *xevent) { + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); Atom atom = (Atom) xevent->xclient.data.l[0]; if (atom == backend_x11->atom_WM_DELETE_WINDOW && @@ -821,8 +871,8 @@ handle_wm_protocols_event (ClutterBackendX11 *backend_x11, * handle the request */ CLUTTER_NOTE (EVENT, "Delete stage %s[%p], win:0x%x", - _clutter_actor_get_debug_name (CLUTTER_ACTOR (stage_x11->wrapper)), - stage_x11->wrapper, + _clutter_actor_get_debug_name (CLUTTER_ACTOR (stage_cogl->wrapper)), + stage_cogl->wrapper, (unsigned int) stage_x11->xwin); set_user_time (backend_x11, stage_x11, xevent->xclient.data.l[1]); @@ -862,8 +912,9 @@ clutter_stage_x11_translate_event (ClutterEventTranslator *translator, ClutterEvent *event) { ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (translator); + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (translator); ClutterTranslateReturn res = CLUTTER_TRANSLATE_CONTINUE; - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); Window stage_xwindow = stage_x11->xwin; XEvent *xevent = native; ClutterStage *stage; @@ -901,7 +952,7 @@ clutter_stage_x11_translate_event (ClutterEventTranslator *translator, xevent->xconfigure.width, xevent->xconfigure.height); - CLUTTER_UNSET_PRIVATE_FLAGS (stage_x11->wrapper, CLUTTER_IN_RESIZE); + CLUTTER_UNSET_PRIVATE_FLAGS (stage_cogl->wrapper, CLUTTER_IN_RESIZE); if (size_changed) { @@ -1171,16 +1222,16 @@ clutter_x11_get_stage_window (ClutterStage *stage) ClutterStage * clutter_x11_get_stage_from_window (Window win) { - ClutterStageX11 *stage_x11; + ClutterStageCogl *stage_cogl; if (clutter_stages_by_xid == NULL) return NULL; - stage_x11 = g_hash_table_lookup (clutter_stages_by_xid, - GINT_TO_POINTER (win)); + stage_cogl = g_hash_table_lookup (clutter_stages_by_xid, + GINT_TO_POINTER (win)); - if (stage_x11 != NULL) - return stage_x11->wrapper; + if (stage_cogl != NULL) + return stage_cogl->wrapper; return NULL; } @@ -1228,7 +1279,8 @@ set_foreign_window_callback (ClutterActor *actor, void *data) { ForeignWindowData *fwd = data; - ClutterBackendX11 *backend_x11 = fwd->stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (fwd->stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); CLUTTER_NOTE (BACKEND, "Setting foreign window (0x%x)", (unsigned int) fwd->xwindow); @@ -1279,6 +1331,7 @@ clutter_x11_set_stage_foreign (ClutterStage *stage, { ClutterBackendX11 *backend_x11; ClutterStageX11 *stage_x11; + ClutterStageCogl *stage_cogl; ClutterStageWindow *impl; ClutterActor *actor; gint x, y; @@ -1294,7 +1347,8 @@ clutter_x11_set_stage_foreign (ClutterStage *stage, impl = _clutter_stage_get_window (stage); stage_x11 = CLUTTER_STAGE_X11 (impl); - backend_x11 = stage_x11->backend; + stage_cogl = CLUTTER_STAGE_COGL (impl); + backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); xvisinfo = _clutter_backend_x11_get_visual_info (backend_x11); g_return_val_if_fail (xvisinfo != NULL, FALSE); @@ -1369,7 +1423,10 @@ void _clutter_stage_x11_set_user_time (ClutterStageX11 *stage_x11, guint32 user_time) { - set_user_time (stage_x11->backend, stage_x11, user_time); + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); + + set_user_time (backend_x11, stage_x11, user_time); } gboolean @@ -1377,7 +1434,8 @@ _clutter_stage_x11_get_root_coords (ClutterStageX11 *stage_x11, gint *root_x, gint *root_y) { - ClutterBackendX11 *backend_x11 = stage_x11->backend; + ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11); + ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend); gint return_val; Window child; gint tx, ty; diff --git a/clutter/x11/clutter-stage-x11.h b/clutter/x11/clutter-stage-x11.h index a070c589f..3e2ae2776 100644 --- a/clutter/x11/clutter-stage-x11.h +++ b/clutter/x11/clutter-stage-x11.h @@ -28,6 +28,7 @@ #include #include "clutter-backend-x11.h" +#include "cogl/clutter-stage-cogl.h" G_BEGIN_DECLS @@ -48,7 +49,7 @@ typedef enum struct _ClutterStageX11 { - GObject parent_instance; + ClutterStageCogl parent_instance; Window xwin; gint xwin_width; @@ -62,10 +63,6 @@ struct _ClutterStageX11 ClutterStageX11State wm_state; - /* backpointers */ - ClutterStage *wrapper; - ClutterBackendX11 *backend; - guint is_foreign_xwin : 1; guint fullscreening : 1; guint is_cursor_visible : 1; @@ -75,7 +72,7 @@ struct _ClutterStageX11 struct _ClutterStageX11Class { - GObjectClass parent_class; + ClutterStageCoglClass parent_class; }; #define CLUTTER_STAGE_X11_EVENT_MASK \ diff --git a/clutter/x11/clutter-x11-texture-pixmap.c b/clutter/x11/clutter-x11-texture-pixmap.c index 0b459fc04..265b1379f 100644 --- a/clutter/x11/clutter-x11-texture-pixmap.c +++ b/clutter/x11/clutter-x11-texture-pixmap.c @@ -529,7 +529,6 @@ clutter_x11_texture_pixmap_class_init (ClutterX11TexturePixmapClass *klass) 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)); @@ -714,15 +713,6 @@ clutter_x11_texture_pixmap_class_init (ClutterX11TexturePixmapClass *klass) 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 @@ -954,13 +944,17 @@ clutter_x11_texture_pixmap_set_window (ClutterX11TexturePixmap *texture, { 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; @@ -1058,7 +1052,7 @@ clutter_x11_texture_pixmap_sync_window_internal (ClutterX11TexturePixmap *textur 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); @@ -1148,12 +1142,15 @@ clutter_x11_texture_pixmap_sync_window (ClutterX11TexturePixmap *texture) 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); diff --git a/configure.ac b/configure.ac index 9cd0d74e5..86b5b6ecf 100644 --- a/configure.ac +++ b/configure.ac @@ -77,10 +77,20 @@ CLUTTER_LT_REV=lt_revision 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 +dnl = Preliminary platform checks ============================================= + 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*], @@ -89,18 +99,24 @@ AS_CASE([$host], 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 ======================================================================== +AC_CACHE_SAVE + +dnl = Dependencies ========================================================= # Checks for programs. AM_PROG_CC_C_O @@ -114,7 +130,7 @@ AC_HEADER_STDC # required versions for dependencies m4_define([glib_req_version], [2.31.0]) -m4_define([cogl_req_version], [1.8.0]) +m4_define([cogl_req_version], [1.9.1]) m4_define([json_glib_req_version], [0.12.0]) m4_define([atk_req_version], [2.1.5]) m4_define([cairo_req_version], [1.10]) @@ -124,6 +140,7 @@ m4_define([uprof_req_version], [0.3]) m4_define([gtk_doc_req_version], [1.15]) m4_define([xfixes_req_version], [3]) m4_define([xcomposite_req_version], [0.4]) +m4_define([gdk_req_version], [3.0.0]) AC_SUBST([GLIB_REQ_VERSION], [glib_req_version]) AC_SUBST([COGL_REQ_VERSION], [cogl_req_version]) @@ -136,6 +153,7 @@ AC_SUBST([UPROF_REQ_VERSION], [uprof_req_version]) AC_SUBST([GTK_DOC_REQ_VERSION], [gtk_doc_req_version]) AC_SUBST([XFIXES_REQ_VERSION], [xfixes_req_version]) AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version]) +AC_SUBST([GDK_REQ_VERSION], [gdk_req_version]) # Checks for typedefs, structures, and compiler characteristics. AM_PATH_GLIB_2_0([glib_req_version], @@ -167,26 +185,16 @@ AC_ARG_ENABLE([Bsymbolic], AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions]) AC_SUBST(CLUTTER_LINK_FLAGS) -dnl ======================================================================== +AC_CACHE_SAVE -# defaults -AS_IF([test "x$platform_win32" = "xyes"], [CLUTTER_FLAVOUR=win32], - [test "x$platform_quartz" = "xyes"], [CLUTTER_FLAVOUR=osx], - [CLUTTER_FLAVOUR=glx]) +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" @@ -195,195 +203,75 @@ BACKEND_PC_FILES="" dnl === Clutter windowing system backend ====================================== -AS_CASE([$CLUTTER_FLAVOUR], +AC_ARG_ENABLE([x11-backend], + [AS_HELP_STRING([--enable-x11-backend=@<:@yes/no@:>@], [Enable the X11 backend (default=check)])], + [enable_x11=$enableval], + [enable_x11=check]) +AC_ARG_ENABLE([win32-backend], + [AS_HELP_STRING([--enable-win32-backend=@<:@yes/no@:>@], [Enable the Windows backend (default=check)])], + [enable_win32=$enableval], + [enable_win32=check]) +AC_ARG_ENABLE([quartz-backend], + [AS_HELP_STRING([--enable-quartz-backend=@<:@yes/no@:>@], [Enable the OS X backend (default=check)])], + [enable_osx=$enableval], + [enable_osx=check]) +AC_ARG_ENABLE([gdk-backend], + [AS_HELP_STRING([--enable-gdk-backend=@<:@yes/no@:>@], [Enable the GDK backend (default=check)])], + [enable_gdk=$enableval], + [enable_gdk=check]) +AC_ARG_ENABLE([wayland-backend], + [AS_HELP_STRING([--enable-wayland-backend=@<:@yes/no@:>@], [Enable the Wayland client backend (default=no)])], + [enable_wayland=$enableval], + [enable_wayland=no]) +AC_ARG_ENABLE([egl-backend], + [AS_HELP_STRING([--enable-egl-backend=@<:@yes/no@:>@], [Enable the EGL framebuffer backend (default=no)])], + [enable_egl=$enableval], + [enable_egl=no]) - [glx], - [ - CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_GLX" - - SUPPORT_X11=1 - SUPPORT_XLIB=1 - SUPPORT_GLX=1 - - CLUTTER_WINSYS=cogl - CLUTTER_WINSYS_BASE=x11 - CLUTTER_WINSYS_BASE_LIB="x11/libclutter-x11.la" - 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" - ], - []) - ], - - [opengl-egl-xlib], - [ - CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL" - CLUTTER_EGL_BACKEND="generic" - - SUPPORT_X11=1 - SUPPORT_XLIB=1 - SUPPORT_EGL=1 - SUPPORT_EGL_PLATFORM_POWERVR_X11=1 - - CLUTTER_WINSYS=cogl - CLUTTER_WINSYS_BASE=x11 - CLUTTER_WINSYS_BASE_LIB="x11/libclutter-x11.la" - # 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"], []) - ], - - [wayland], - [ - experimental_backend="yes" - CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_WAYLAND" - - SUPPORT_WAYLAND=1 - - CLUTTER_WINSYS=wayland - CLUTTER_SONAME_INFIX=wayland - - 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"], []) - ], - - [eglx], - [ - CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL" - CLUTTER_EGL_BACKEND="generic" - - SUPPORT_X11=1 - SUPPORT_XLIB=1 - SUPPORT_EGL=1 - SUPPORT_EGL_PLATFORM_POWERVR_X11=1 - - CLUTTER_WINSYS=cogl - CLUTTER_WINSYS_BASE=x11 - CLUTTER_WINSYS_BASE_LIB="x11/libclutter-x11.la" - CLUTTER_SONAME_INFIX=eglx - ], - - [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 - ], - - [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) - - AS_IF([test x"$found_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])]) - - # 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])] - ) - - FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $EVDEV_CFLAGS" - FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl $EVDEV_LIBS" - ], - - [osx], - [ - CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_OSX" - - AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend]) - - FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL" - - CLUTTER_WINSYS=osx - CLUTTER_SONAME_INFIX=osx - ], - - [win32], - [ - CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_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, no) - if test "$WINDRES" = no; then - AC_MSG_ERROR([*** windres is required]) - fi - - CLUTTER_WINSYS=win32 - CLUTTER_SONAME_INFIX=win32 - ], - - [AC_MSG_ERROR([Invalid backend for Clutter])] -) - -AS_IF([test "x$SUPPORT_X11" = "x1"], +dnl Define default values +AS_IF([test "x$enable_x11" = "xcheck"], [ + AS_IF([test "x$platform_glx" = "xyes"], [enable_x11=yes], [enable_x11=no]) + ]) + +AS_IF([test "x$enable_win32" = "xcheck"], + [ + AS_IF([test "x$platform_win32" = "xyes"], [enable_win32=yes], [enable_win32=no]) + ]) + +AS_IF([test "x$enable_osx" = "xcheck"], + [ + AS_IF([test "x$platform_quartz" = "xyes"], [enable_osx=yes], [enable_osx=no]) + ]) + +AS_IF([test "x$enable_gdk" = "xcheck"], + [ + PKG_CHECK_EXISTS([gdk-3.0 >= gdk_req_version], [enable_gdk=yes], [enable_gdk=no]) + ]) + +dnl Per-backend rules +AS_IF([test "x$enable_x11" = "xyes"], + [ + CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11" + + SUPPORT_X11=1 + SUPPORT_GLX=1 + SUPPORT_COGL=1 + + # 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"]) + + # 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" + ], + []) + # we use fontconfig API and pango-fc when the fontconfig # configuration changes PKG_CHECK_EXISTS([pangoft2], @@ -392,44 +280,173 @@ AS_IF([test "x$SUPPORT_X11" = "x1"], BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2" ], []) - ]) -AS_IF([test "x$SUPPORT_GLX" = "x1"], - [ AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend]) ]) -AS_IF([test "x$SUPPORT_WAYLAND" = "x1"], +AS_IF([test "x$enable_gdk" = "xyes"], [ + CLUTTER_BACKENDS="$CLUTTER_BACKENDS gdk" + + SUPPORT_GDK=1 + SUPPORT_COGL=1 + + BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0" + PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], []) + ]) + +AS_IF([test "x$enable_wayland" = "xyes"], + [ + CLUTTER_BACKENDS="$CLUTTER_BACKENDS wayland" + + experimental_backend="yes" + + SUPPORT_WAYLAND=1 + SUPPORT_EVDEV=1 + + 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"], + []) + AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend]) ]) -AS_IF([test "x$SUPPORT_EGL" = "x1"], +AS_IF([test "x$enable_egl" = "xyes"], [ + CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl" + + SUPPORT_EGL=1 + SUPPORT_COGL=1 + + # if Mesa has support for egl, we can use it as well + PKG_CHECK_EXISTS([egl], + [ + BACKEND_PC_FILES="$BACKEND_PC_FILES egl" + ], + []) + + AC_ARG_WITH([tslib], + [AS_HELP_STRING([--with-tslib=@<:@yes/no@:>@], [Use TSLib for events (default=no)])], + [], + [with_tslib=no]) + + AC_ARG_WITH([evdev], + [AS_HELP_STRING([--with-evdev=@<:@yes/no@:>@], [Use evdev for events (default=yes)])], + [], + [with_evdev=yes]) + + AC_ARG_WITH([gdl], + [AS_HELP_STRING([--with-gdl=@<:@yes/no@:>@], [Use libgdl for CE3100/CE4100 support (default=no)])], + [], + [with_gdl=no]) + + 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]) + SUPPORT_TSLIB=1 + ]) + ], + [have_tslib=no]) + + 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]) + SUPPORT_EVDEV=1 + ]) + ], + [have_evdev=no]) + + AS_IF([test "x$with_gdl" = "xyes"], + [ + have_gdl=no + + AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes]) + + 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_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX) + + 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]) + ], + [have_gdl=no]) + + 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$CLUTTER_EGL_BACKEND" = "xgeneric"], - AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])) +AS_IF([test "x$enable_osx" = "xyes"], + [ + CLUTTER_BACKENDS="$CLUTTER_BACKENDS osx" -AS_IF([test "x$CLUTTER_EGL_BACKEND" = "xcex100"], - AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend])) + AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX 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_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"]) + FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL" + SUPPORT_OSX=1 + ]) + +AS_IF([test "x$enable_win32" = "xyes"], + [ + 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$CLUTTER_BACKENDS" = "x"], + [ + AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.]) + ]) + +# 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 @@ -438,61 +455,68 @@ dnl other tools such as glib-mkenums and gir-scanner don't end up 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) + +AC_CACHE_SAVE + 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"]) +#define CLUTTER_WINDOWING_X11 \"x11\""]) +AS_IF([test "x$SUPPORT_GDK" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_WINDOWING_GDK \"gdk\""]) AS_IF([test "x$SUPPORT_GLX" = "x1"], [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES -#define CLUTTER_WINDOWING_GLX 1"]) +#define CLUTTER_WINDOWING_GLX \"glx\""]) 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"], +#define CLUTTER_WINDOWING_EGL \"eglnative\""]) +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"], +#define CLUTTER_WINDOWING_WAYLAND \"wayland\""]) +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"], +#define CLUTTER_WINDOWING_OSX \"osx\""]) +AS_IF([test "x$SUPPORT_WIN32" = "x1"], [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES -#define CLUTTER_WINDOWING_WIN32 1"]) +#define CLUTTER_WINDOWING_WIN32 \"win32\""]) AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"], [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES -#define CLUTTER_WINDOWING_CEX100 1"]) +#define CLUTTER_WINDOWING_CEX100 \"cex100\""]) +AS_IF([test "x$SUPPORT_EVDEV" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_INPUT_EVDEV \"evdev\""]) +AS_IF([test "x$SUPPORT_TSLIB" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_INPUT_TSLIB \"tslib\""]) 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_WINSYS_BASE_LIB]) -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="" dnl === X11 checks, only for X11-based backends =============================== X11_PC_FILES="" +X11_EXTS="" 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]) @@ -537,6 +561,7 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"], X11_LIBS="$X11_LIBS -lXext" X11_PC_FILES="$X11_PC_FILES xext" + X11_EXTS="$X11_EXTS xext" AC_MSG_RESULT([found]) ], @@ -552,6 +577,7 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"], X11_LIBS="$X11_LIBS -lXfixes" X11_PC_FILES="$X11_PC_FILES xfixes >= $XFIXES_REQ_VERSION" + X11_EXTS="$X11_EXTS xfixes" AC_MSG_RESULT([found]) ], @@ -567,6 +593,7 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"], X11_LIBS="$X11_LIBS -lXdamage" X11_PC_FILES="$X11_PC_FILES xdamage" + X11_EXTS="$X11_EXTS xdamage" AC_MSG_RESULT([found]) ], @@ -582,6 +609,7 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"], X11_LIBS="$X11_LIBS -lXcomposite" X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION" + X11_EXTS="$X11_EXTS xcomposite" AC_MSG_RESULT([found]) ], @@ -600,6 +628,7 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"], [ AC_DEFINE([HAVE_XGE], [1], [Define to 1 if X Generic Extensions is available]) have_xge=yes + X11_EXTS="$X11_EXTS xge" ]) CPPFLAGS="$clutter_save_CPPFLAGS" @@ -639,6 +668,7 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"], X11_LIBS="$X11_LIBS $XINPUT_LIBS" X11_PC_FILES="$X11_PC_FILES xi" + X11_EXTS="$X11_EXTS xi" ], [no], @@ -660,6 +690,8 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"], [ AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]) have_xkb=yes + + X11_EXTS="$X11_EXTS xkb" ]) CPPFLAGS="$clutter_save_CPPFLAGS" @@ -673,7 +705,11 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"], ) 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"]) + +X11_EXTS=${X11_EXTS#* } + +AC_CACHE_SAVE dnl === Enable debug level ==================================================== @@ -721,7 +757,7 @@ AS_CASE([$enable_deprecated], [no], [ - CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED -DCLUTTER_DISABLE_DEPRECATED" + CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED" ], [yes], @@ -961,7 +997,7 @@ AC_CONFIG_FILES([ clutter/cally/cally-$CLUTTER_API_VERSION.pc:clutter/cally/cally.pc.in - clutter/cogl/clutter-cex100.h + clutter/egl/clutter-cex100.h tests/Makefile tests/accessibility/Makefile @@ -1000,8 +1036,6 @@ echo " • Global:" echo " Prefix: ${prefix}" echo " Libdir: ${libdir}" echo " Sysconfdir: ${sysconfdir}" -echo " Flavour: ${CLUTTER_WINSYS}" -echo " Target library: ${CLUTTER_WINSYS_LIB}" # Compiler/Debug related flags echo "" @@ -1023,24 +1057,31 @@ echo "" echo " • Extra:" echo " Build introspection data: ${enable_introspection}" echo " Build conformance test suite: ${enable_conformance}" +echo " Build X11-specific tests: ${x11_tests}" # 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 -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}" +if test "x$SUPPORT_X11" = "x1"; then +echo "" +echo " - X11 backend options:" +echo " Enabled extensions: ${X11_EXTS}" +echo " Build X11-specific tests: ${x11_tests}" +fi + +if test "x$SUPPORT_EGL" = "x1"; then +echo "" +echo " - EGL backend options:" +echo " Enable TSLib: ${have_tslib}" +echo " Enable evdev: ${have_evdev}" +echo " Enable GDL: ${have_gdl}" fi echo "" @@ -1048,11 +1089,13 @@ echo "" # General warning about experimental features if test "x$experimental_backend" = "xyes"; then echo "" -echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠" -echo " *WARNING*" +echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠" +echo "*WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING*" echo "" echo " The stability of your build might be affected by one or more" echo " experimental backends or experimental and unsupported features" -echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠" +echo "" +echo "*WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING*" +echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠" echo "" fi diff --git a/doc/cookbook/examples/Makefile.am b/doc/cookbook/examples/Makefile.am index 22694436f..ada764c32 100644 --- a/doc/cookbook/examples/Makefile.am +++ b/doc/cookbook/examples/Makefile.am @@ -57,14 +57,14 @@ INCLUDES = \ -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) AM_CPPFLAGS = \ -DG_DISABLE_SINGLE_INCLUDES \ -DCOGL_DISABLE_DEPRECATED \ - -DCLUTTER_DISABLE_DEPRECATED \ + -DCLUTTER_DISABLE_DEPRECATION_WARNINGS \ -DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\" AM_LDFLAGS = $(CLUTTER_LIBS) -export-dynamic diff --git a/doc/reference/cally/Makefile.am b/doc/reference/cally/Makefile.am index 34c408bff..797d463e6 100644 --- a/doc/reference/cally/Makefile.am +++ b/doc/reference/cally/Makefile.am @@ -79,7 +79,7 @@ expand_content_files= \ # 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 diff --git a/doc/reference/clutter/Makefile.am b/doc/reference/clutter/Makefile.am index 7dc39eeca..3a83b62ec 100644 --- a/doc/reference/clutter/Makefile.am +++ b/doc/reference/clutter/Makefile.am @@ -52,16 +52,19 @@ HFILE_GLOB=\ $(top_builddir)/clutter/*.h \ $(top_srcdir)/clutter/x11/clutter-x11.h \ $(top_srcdir)/clutter/x11/clutter-x11-texture-pixmap.h \ - $(top_srcdir)/clutter/cogl/clutter-glx-texture-pixmap.h \ - $(top_srcdir)/clutter/cogl/clutter-egl.h \ - $(top_srcdir)/clutter/cogl/clutter-cex100.h \ - $(top_srcdir)/clutter/win32/clutter-win32.h + $(top_srcdir)/clutter/x11/clutter-glx-texture-pixmap.h \ + $(top_srcdir)/clutter/egl/clutter-egl.h \ + $(top_srcdir)/clutter/egl/clutter-cex100.h \ + $(top_srcdir)/clutter/win32/clutter-win32.h \ + $(top_srcdir)/clutter/gdk/clutter-gdk.h CFILE_GLOB=\ $(top_srcdir)/clutter/*.c \ $(top_srcdir)/clutter/cogl/*.c \ $(top_srcdir)/clutter/x11/*.c \ - $(top_srcdir)/clutter/win32/*.c + $(top_srcdir)/clutter/win32/*.c \ + $(top_srcdir)/clutter/gdk/*.c \ + $(top_srcdir)/clutter/egl/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h @@ -96,8 +99,11 @@ IGNORE_HFILES=\ clutter-timeout-interval.h \ cally \ cogl \ + egl \ evdev \ + gdk \ osx \ + tslib \ x11 \ wayland \ win32 @@ -105,11 +111,12 @@ IGNORE_HFILES=\ EXTRA_HFILES=\ $(top_srcdir)/clutter/x11/clutter-x11.h \ $(top_srcdir)/clutter/x11/clutter-x11-texture-pixmap.h \ - $(top_srcdir)/clutter/cogl/clutter-glx-texture-pixmap.h \ - $(top_srcdir)/clutter/cogl/clutter-egl.h \ - $(top_srcdir)/clutter/cogl/clutter-cex100.h \ + $(top_srcdir)/clutter/x11/clutter-glx-texture-pixmap.h \ + $(top_srcdir)/clutter/egl/clutter-egl.h \ + $(top_srcdir)/clutter/egl/clutter-cex100.h \ $(top_srcdir)/clutter/wayland/clutter-wayland.h \ - $(top_srcdir)/clutter/win32/clutter-win32.h + $(top_srcdir)/clutter/win32/clutter-win32.h \ + $(top_srcdir)/clutter/gdk/clutter-gdk.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png @@ -162,7 +169,7 @@ expand_content_files= \ # 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 diff --git a/doc/reference/clutter/running-clutter.xml b/doc/reference/clutter/running-clutter.xml index 73b1d34bf..371edcd24 100644 --- a/doc/reference/clutter/running-clutter.xml +++ b/doc/reference/clutter/running-clutter.xml @@ -203,6 +203,7 @@ Backend-related notes, including initialization of the backend features and GL context creation + event Event handling notes diff --git a/po/bg.po b/po/bg.po new file mode 100644 index 000000000..dcba4fece --- /dev/null +++ b/po/bg.po @@ -0,0 +1,2227 @@ +# Bulgarian translation of clutter po-file. +# Copyright (C) 2011 Free Software Foundation, Inc. +# This file is distributed under the same license as the clutter package. +# Alexander Shopov , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: clutter master\n" +"Report-Msgid-Bugs-To: http://bugzilla.clutter-project.org/enter_bug.cgi?" +"product=clutter\n" +"POT-Creation-Date: 2011-10-30 17:07+0200\n" +"PO-Revision-Date: 2011-10-30 17:07+0200\n" +"Last-Translator: Alexander Shopov \n" +"Language-Team: Bulgarian \n" +"Language: bg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#: ../clutter/clutter-actor.c:3886 +msgid "X coordinate" +msgstr "Координата по X" + +#: ../clutter/clutter-actor.c:3887 +msgid "X coordinate of the actor" +msgstr "Координата по X на участника" + +#: ../clutter/clutter-actor.c:3902 +msgid "Y coordinate" +msgstr "Координата по Y" + +#: ../clutter/clutter-actor.c:3903 +msgid "Y coordinate of the actor" +msgstr "Координата по Y на участника" + +#: ../clutter/clutter-actor.c:3918 +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:479 +msgid "Width" +msgstr "Широчина" + +#: ../clutter/clutter-actor.c:3919 +msgid "Width of the actor" +msgstr "Широчина на участника" + +#: ../clutter/clutter-actor.c:3933 +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:495 +msgid "Height" +msgstr "Височина" + +#: ../clutter/clutter-actor.c:3934 +msgid "Height of the actor" +msgstr "Височина на участника" + +#: ../clutter/clutter-actor.c:3952 +msgid "Fixed X" +msgstr "Прикрепяне по X" + +#: ../clutter/clutter-actor.c:3953 +msgid "Forced X position of the actor" +msgstr "Положението по X на участника не се променя" + +#: ../clutter/clutter-actor.c:3971 +msgid "Fixed Y" +msgstr "Прикрепяне по Y" + +#: ../clutter/clutter-actor.c:3972 +msgid "Forced Y position of the actor" +msgstr "Положението по Y на участника не се променя" + +#: ../clutter/clutter-actor.c:3988 +msgid "Fixed position set" +msgstr "Непроменимо положение" + +#: ../clutter/clutter-actor.c:3989 +msgid "Whether to use fixed positioning for the actor" +msgstr "Дали положението на участника да не се променя" + +#: ../clutter/clutter-actor.c:4011 +msgid "Min Width" +msgstr "Минимална широчина" + +#: ../clutter/clutter-actor.c:4012 +msgid "Forced minimum width request for the actor" +msgstr "Минимална широчина на участника" + +#: ../clutter/clutter-actor.c:4031 +msgid "Min Height" +msgstr "Минимална височина" + +#: ../clutter/clutter-actor.c:4032 +msgid "Forced minimum height request for the actor" +msgstr "Минимална височина за участника" + +#: ../clutter/clutter-actor.c:4051 +msgid "Natural Width" +msgstr "Естествена широчина" + +#: ../clutter/clutter-actor.c:4052 +msgid "Forced natural width request for the actor" +msgstr "Естествена широчина за участника" + +#: ../clutter/clutter-actor.c:4071 +msgid "Natural Height" +msgstr "Естествена височина" + +#: ../clutter/clutter-actor.c:4072 +msgid "Forced natural height request for the actor" +msgstr "Естествена височина за участника" + +#: ../clutter/clutter-actor.c:4088 +msgid "Minimum width set" +msgstr "Задаване на минимална широчина" + +#: ../clutter/clutter-actor.c:4089 +msgid "Whether to use the min-width property" +msgstr "Дали да се ползва свойството за минимална широчина" + +#: ../clutter/clutter-actor.c:4104 +msgid "Minimum height set" +msgstr "Задаване на минимална височина" + +#: ../clutter/clutter-actor.c:4105 +msgid "Whether to use the min-height property" +msgstr "Дали да се ползва свойството за минимална височина" + +#: ../clutter/clutter-actor.c:4120 +msgid "Natural width set" +msgstr "Задаване на естествена широчина" + +#: ../clutter/clutter-actor.c:4121 +msgid "Whether to use the natural-width property" +msgstr "Дали да се ползва свойството за естествена широчина" + +#: ../clutter/clutter-actor.c:4138 +msgid "Natural height set" +msgstr "Задаване на естествена височина" + +#: ../clutter/clutter-actor.c:4139 +msgid "Whether to use the natural-height property" +msgstr "Дали да се ползва свойството за естествена височина" + +#: ../clutter/clutter-actor.c:4158 +msgid "Allocation" +msgstr "Заделяне" + +#: ../clutter/clutter-actor.c:4159 +msgid "The actor's allocation" +msgstr "Заделяне за участника" + +#: ../clutter/clutter-actor.c:4215 +msgid "Request Mode" +msgstr "Режим на заявка" + +#: ../clutter/clutter-actor.c:4216 +msgid "The actor's request mode" +msgstr "Режимът на заявка на участника" + +#: ../clutter/clutter-actor.c:4231 +msgid "Depth" +msgstr "Дълбочина" + +#: ../clutter/clutter-actor.c:4232 +msgid "Position on the Z axis" +msgstr "Положение по ос Z" + +#: ../clutter/clutter-actor.c:4246 +msgid "Opacity" +msgstr "Непрозрачност" + +#: ../clutter/clutter-actor.c:4247 +msgid "Opacity of an actor" +msgstr "Непрозрачност на участника" + +#: ../clutter/clutter-actor.c:4266 +msgid "Offscreen redirect" +msgstr "Пренасочване извън екрана" + +#: ../clutter/clutter-actor.c:4267 +msgid "Flags controlling when to flatten the actor into a single image" +msgstr "Флагове за момента на композирането на участника в едно изображение" + +#: ../clutter/clutter-actor.c:4285 +msgid "Visible" +msgstr "Видим" + +#: ../clutter/clutter-actor.c:4286 +msgid "Whether the actor is visible or not" +msgstr "Дали участникът е видим или не" + +#: ../clutter/clutter-actor.c:4301 +msgid "Mapped" +msgstr "Изобразен" + +#: ../clutter/clutter-actor.c:4302 +msgid "Whether the actor will be painted" +msgstr "Дали участникът ще бъде изобразен" + +#: ../clutter/clutter-actor.c:4316 +msgid "Realized" +msgstr "Реализиран" + +#: ../clutter/clutter-actor.c:4317 +msgid "Whether the actor has been realized" +msgstr "Дали участникът ще бъде реализиран" + +#: ../clutter/clutter-actor.c:4333 +msgid "Reactive" +msgstr "Реагиращ" + +#: ../clutter/clutter-actor.c:4334 +msgid "Whether the actor is reactive to events" +msgstr "Дали участникът ще реагира на събития" + +#: ../clutter/clutter-actor.c:4346 +msgid "Has Clip" +msgstr "Изрязан" + +#: ../clutter/clutter-actor.c:4347 +msgid "Whether the actor has a clip set" +msgstr "Дали участникът е със зададена област за изрязване" + +#: ../clutter/clutter-actor.c:4362 +msgid "Clip" +msgstr "Област за изрязване" + +#: ../clutter/clutter-actor.c:4363 +msgid "The clip region for the actor" +msgstr "Областта за изрязване на участника" + +#: ../clutter/clutter-actor.c:4377 ../clutter/clutter-actor-meta.c:207 +#: ../clutter/clutter-binding-pool.c:319 ../clutter/clutter-input-device.c:236 +msgid "Name" +msgstr "Име" + +#: ../clutter/clutter-actor.c:4378 +msgid "Name of the actor" +msgstr "Име на участника" + +#: ../clutter/clutter-actor.c:4392 +msgid "Scale X" +msgstr "Мащабиране по X" + +#: ../clutter/clutter-actor.c:4393 +msgid "Scale factor on the X axis" +msgstr "Коефициент на мащабиране по ос X" + +#: ../clutter/clutter-actor.c:4408 +msgid "Scale Y" +msgstr "Мащабиране по Y" + +#: ../clutter/clutter-actor.c:4409 +msgid "Scale factor on the Y axis" +msgstr "Коефициент на мащабиране по ос Y" + +#: ../clutter/clutter-actor.c:4424 +msgid "Scale Center X" +msgstr "Център за мащабиране — X" + +#: ../clutter/clutter-actor.c:4425 +msgid "Horizontal scale center" +msgstr "Координата по X на центъра за мащабиране" + +#: ../clutter/clutter-actor.c:4440 +msgid "Scale Center Y" +msgstr "Център за мащабиране — Y" + +#: ../clutter/clutter-actor.c:4441 +msgid "Vertical scale center" +msgstr "Координата по Y на центъра за мащабиране" + +#: ../clutter/clutter-actor.c:4456 +msgid "Scale Gravity" +msgstr "Гравитация при мащабирането" + +#: ../clutter/clutter-actor.c:4457 +msgid "The center of scaling" +msgstr "Центърът на мащабирането" + +#: ../clutter/clutter-actor.c:4474 +msgid "Rotation Angle X" +msgstr "Ъгъл на завъртане по X" + +#: ../clutter/clutter-actor.c:4475 +msgid "The rotation angle on the X axis" +msgstr "Ъгъл на завъртане по оста X" + +#: ../clutter/clutter-actor.c:4490 +msgid "Rotation Angle Y" +msgstr "Ъгъл на завъртане по Y" + +#: ../clutter/clutter-actor.c:4491 +msgid "The rotation angle on the Y axis" +msgstr "Ъгъл на завъртане по оста Y" + +#: ../clutter/clutter-actor.c:4506 +msgid "Rotation Angle Z" +msgstr "Ъгъл на завъртане по Z" + +#: ../clutter/clutter-actor.c:4507 +msgid "The rotation angle on the Z axis" +msgstr "Ъгъл на завъртане по оста Z" + +#: ../clutter/clutter-actor.c:4522 +msgid "Rotation Center X" +msgstr "X на центъра на завъртане" + +#: ../clutter/clutter-actor.c:4523 +msgid "The rotation center on the X axis" +msgstr "Центърът на завъртане по оста X" + +#: ../clutter/clutter-actor.c:4539 +msgid "Rotation Center Y" +msgstr "Y на центъра на завъртане" + +#: ../clutter/clutter-actor.c:4540 +msgid "The rotation center on the Y axis" +msgstr "Центърът на завъртане по оста X" + +#: ../clutter/clutter-actor.c:4556 +msgid "Rotation Center Z" +msgstr "Z на центъра на завъртане" + +#: ../clutter/clutter-actor.c:4557 +msgid "The rotation center on the Z axis" +msgstr "Центърът на завъртане по оста Z" + +#: ../clutter/clutter-actor.c:4573 +msgid "Rotation Center Z Gravity" +msgstr "Гравитация по Z на центъра на завъртане" + +#: ../clutter/clutter-actor.c:4574 +msgid "Center point for rotation around the Z axis" +msgstr "Централна точка за завъртането по оста Z" + +#: ../clutter/clutter-actor.c:4592 +msgid "Anchor X" +msgstr "Прикрепяне по X" + +#: ../clutter/clutter-actor.c:4593 +msgid "X coordinate of the anchor point" +msgstr "Координата по X на точката на прикрепяне" + +#: ../clutter/clutter-actor.c:4609 +msgid "Anchor Y" +msgstr "Прикрепяне по Y" + +#: ../clutter/clutter-actor.c:4610 +msgid "Y coordinate of the anchor point" +msgstr "Координата по Y на точката на прикрепяне" + +#: ../clutter/clutter-actor.c:4625 +msgid "Anchor Gravity" +msgstr "Гравитация на прикрепянето" + +#: ../clutter/clutter-actor.c:4626 +msgid "The anchor point as a ClutterGravity" +msgstr "Точката на прикрепяне като структура ClutterGravity" + +#: ../clutter/clutter-actor.c:4645 +msgid "Show on set parent" +msgstr "Показване при зададен родител" + +#: ../clutter/clutter-actor.c:4646 +msgid "Whether the actor is shown when parented" +msgstr "Дали участникът се показва, когато има родител" + +#: ../clutter/clutter-actor.c:4666 +msgid "Clip to Allocation" +msgstr "Изрязване по заделената област" + +#: ../clutter/clutter-actor.c:4667 +msgid "Sets the clip region to track the actor's allocation" +msgstr "Областта за изрязване да повтаря заделената област на участника" + +#: ../clutter/clutter-actor.c:4677 +msgid "Text Direction" +msgstr "Посока на текста" + +#: ../clutter/clutter-actor.c:4678 +msgid "Direction of the text" +msgstr "Посоката на текста" + +#: ../clutter/clutter-actor.c:4696 +msgid "Has Pointer" +msgstr "С показалец" + +#: ../clutter/clutter-actor.c:4697 +msgid "Whether the actor contains the pointer of an input device" +msgstr "Дали участникът съдържа показалеца на входно устройство" + +#: ../clutter/clutter-actor.c:4714 +msgid "Actions" +msgstr "Действия" + +#: ../clutter/clutter-actor.c:4715 +msgid "Adds an action to the actor" +msgstr "Добавя действие към участник" + +#: ../clutter/clutter-actor.c:4729 +msgid "Constraints" +msgstr "Ограничения" + +#: ../clutter/clutter-actor.c:4730 +msgid "Adds a constraint to the actor" +msgstr "Добавяне на ограничение към участник" + +#: ../clutter/clutter-actor.c:4744 +msgid "Effect" +msgstr "Ефект" + +#: ../clutter/clutter-actor.c:4745 +msgid "Add an effect to be applied on the actor" +msgstr "Добавя ефект към участник" + +#: ../clutter/clutter-actor-meta.c:193 ../clutter/clutter-child-meta.c:142 +msgid "Actor" +msgstr "Участник" + +#: ../clutter/clutter-actor-meta.c:194 +msgid "The actor attached to the meta" +msgstr "Участникът прикрепен към модификатора" + +#: ../clutter/clutter-actor-meta.c:208 +msgid "The name of the meta" +msgstr "Името на модификатора" + +#: ../clutter/clutter-actor-meta.c:221 ../clutter/clutter-input-device.c:315 +#: ../clutter/deprecated/clutter-shader.c:309 +msgid "Enabled" +msgstr "Включен" + +#: ../clutter/clutter-actor-meta.c:222 +msgid "Whether the meta is enabled" +msgstr "Дали модификаторът е включен" + +#: ../clutter/clutter-align-constraint.c:281 +#: ../clutter/clutter-bind-constraint.c:349 ../clutter/clutter-clone.c:345 +#: ../clutter/clutter-snap-constraint.c:321 +msgid "Source" +msgstr "Източник" + +#: ../clutter/clutter-align-constraint.c:282 +msgid "The source of the alignment" +msgstr "Източникът на подравняването" + +#: ../clutter/clutter-align-constraint.c:295 +msgid "Align Axis" +msgstr "Ос за подравняване" + +#: ../clutter/clutter-align-constraint.c:296 +msgid "The axis to align the position to" +msgstr "Оста, към която да се подравни положението" + +#: ../clutter/clutter-align-constraint.c:315 +#: ../clutter/clutter-desaturate-effect.c:304 +msgid "Factor" +msgstr "Коефициент" + +#: ../clutter/clutter-align-constraint.c:316 +msgid "The alignment factor, between 0.0 and 1.0" +msgstr "Коефициент на подравняване — [0.0; 1.0]" + +#: ../clutter/clutter-alpha.c:345 ../clutter/clutter-animation.c:538 +#: ../clutter/clutter-animator.c:1802 +msgid "Timeline" +msgstr "Време" + +#: ../clutter/clutter-alpha.c:346 +msgid "Timeline used by the alpha" +msgstr "Времето използвано от прозрачността" + +#: ../clutter/clutter-alpha.c:361 +msgid "Alpha value" +msgstr "Прозрачност" + +#: ../clutter/clutter-alpha.c:362 +msgid "Alpha value as computed by the alpha" +msgstr "Изчислената прозрачност" + +#: ../clutter/clutter-alpha.c:382 ../clutter/clutter-animation.c:494 +msgid "Mode" +msgstr "Режим" + +#: ../clutter/clutter-alpha.c:383 +msgid "Progress mode" +msgstr "Режим на напредъка" + +#: ../clutter/clutter-animation.c:478 +msgid "Object" +msgstr "Обект" + +#: ../clutter/clutter-animation.c:479 +msgid "Object to which the animation applies" +msgstr "Обектът, към който е приложена анимацията" + +#: ../clutter/clutter-animation.c:495 +msgid "The mode of the animation" +msgstr "Режимът на анимацията" + +#: ../clutter/clutter-animation.c:509 ../clutter/clutter-animator.c:1786 +#: ../clutter/clutter-media.c:194 ../clutter/clutter-state.c:1486 +#: ../clutter/clutter-timeline.c:294 +msgid "Duration" +msgstr "Продължителност" + +#: ../clutter/clutter-animation.c:510 +msgid "Duration of the animation, in milliseconds" +msgstr "Продължителност на анимацията в милисекунди" + +#: ../clutter/clutter-animation.c:524 ../clutter/clutter-timeline.c:263 +msgid "Loop" +msgstr "Повтаряне" + +#: ../clutter/clutter-animation.c:525 +msgid "Whether the animation should loop" +msgstr "Дали анимацията да се повтаря непрекъснато" + +#: ../clutter/clutter-animation.c:539 +msgid "The timeline used by the animation" +msgstr "Времето за анимацията" + +#: ../clutter/clutter-animation.c:552 +#: ../clutter/deprecated/clutter-behaviour.c:240 +msgid "Alpha" +msgstr "Прозрачност" + +#: ../clutter/clutter-animation.c:553 +msgid "The alpha used by the animation" +msgstr "Прозрачността на анимацията" + +#: ../clutter/clutter-animator.c:1787 +msgid "The duration of the animation" +msgstr "Продължителност на анимацията" + +#: ../clutter/clutter-animator.c:1803 +msgid "The timeline of the animation" +msgstr "Времето на анимацията" + +#: ../clutter/deprecated/clutter-behaviour.c:241 +msgid "Alpha Object to drive the behaviour" +msgstr "Обектът за прозрачност, който управлява поведението" + +#: ../clutter/deprecated/clutter-behaviour-depth.c:180 +msgid "Start Depth" +msgstr "Начална дълбочина" + +#: ../clutter/deprecated/clutter-behaviour-depth.c:181 +msgid "Initial depth to apply" +msgstr "Началната дълбочина, която да се приложи" + +#: ../clutter/deprecated/clutter-behaviour-depth.c:196 +msgid "End Depth" +msgstr "Крайна дълбочина" + +#: ../clutter/deprecated/clutter-behaviour-depth.c:197 +msgid "Final depth to apply" +msgstr "Крайната дълбочина, която да се приложи" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:399 +msgid "Start Angle" +msgstr "Начален ъгъл" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:400 +#: ../clutter/deprecated/clutter-behaviour-rotate.c:282 +msgid "Initial angle" +msgstr "Начален ъгъл" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:415 +msgid "End Angle" +msgstr "Краен ъгъл" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:416 +#: ../clutter/deprecated/clutter-behaviour-rotate.c:300 +msgid "Final angle" +msgstr "Краен ъгъл" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:431 +msgid "Angle x tilt" +msgstr "Ъгъл на наклона по X" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:432 +msgid "Tilt of the ellipse around x axis" +msgstr "Наклон на оста на елипсата по оста X" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:447 +msgid "Angle y tilt" +msgstr "Ъгъл на наклона по Y" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:448 +msgid "Tilt of the ellipse around y axis" +msgstr "Наклон на оста на елипсата по оста Y" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:463 +msgid "Angle z tilt" +msgstr "Ъгъл на наклона по Z" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:464 +msgid "Tilt of the ellipse around z axis" +msgstr "Наклон на оста на елипсата по оста Z" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:480 +msgid "Width of the ellipse" +msgstr "Широчина на елипсата" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:496 +msgid "Height of ellipse" +msgstr "Височина на елипсата" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:511 +msgid "Center" +msgstr "Център" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:512 +msgid "Center of ellipse" +msgstr "Център на елипсата" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:526 +#: ../clutter/deprecated/clutter-behaviour-rotate.c:335 +#: ../clutter/clutter-timeline.c:310 +msgid "Direction" +msgstr "Посока" + +#: ../clutter/deprecated/clutter-behaviour-ellipse.c:527 +#: ../clutter/deprecated/clutter-behaviour-rotate.c:336 +msgid "Direction of rotation" +msgstr "Посока на въртене" + +#: ../clutter/deprecated/clutter-behaviour-opacity.c:183 +msgid "Opacity Start" +msgstr "Начална непрозрачност" + +#: ../clutter/deprecated/clutter-behaviour-opacity.c:184 +msgid "Initial opacity level" +msgstr "Начално ниво на непрозрачността" + +#: ../clutter/deprecated/clutter-behaviour-opacity.c:201 +msgid "Opacity End" +msgstr "Крайна непрозрачност" + +#: ../clutter/deprecated/clutter-behaviour-opacity.c:202 +msgid "Final opacity level" +msgstr "Крайно ниво на непрозрачността" + +#: ../clutter/deprecated/clutter-behaviour-path.c:224 +#: ../clutter/clutter-path-constraint.c:212 +msgid "Path" +msgstr "Път" + +#: ../clutter/deprecated/clutter-behaviour-path.c:225 +msgid "The ClutterPath object representing the path to animate along" +msgstr "Обектът ClutterPath за пътя, по който върви анимацията" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:281 +msgid "Angle Begin" +msgstr "Начален ъгъл" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:299 +msgid "Angle End" +msgstr "Краен ъгъл" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:317 +msgid "Axis" +msgstr "Ос" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:318 +msgid "Axis of rotation" +msgstr "Ос на въртенето" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:353 +msgid "Center X" +msgstr "Център по X" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:354 +msgid "X coordinate of the center of rotation" +msgstr "Координатата X на центъра на въртене" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:371 +msgid "Center Y" +msgstr "Център по Y" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:372 +msgid "Y coordinate of the center of rotation" +msgstr "Координатата Y на центъра на въртене" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:389 +msgid "Center Z" +msgstr "Център по Z" + +#: ../clutter/deprecated/clutter-behaviour-rotate.c:390 +msgid "Z coordinate of the center of rotation" +msgstr "Координатата Z на центъра на въртене" + +#: ../clutter/deprecated/clutter-behaviour-scale.c:224 +msgid "X Start Scale" +msgstr "Начално мащабиране по X" + +#: ../clutter/deprecated/clutter-behaviour-scale.c:225 +msgid "Initial scale on the X axis" +msgstr "Начално мащабиране по оста X" + +#: ../clutter/deprecated/clutter-behaviour-scale.c:243 +msgid "X End Scale" +msgstr "Крайно мащабиране по X" + +#: ../clutter/deprecated/clutter-behaviour-scale.c:244 +msgid "Final scale on the X axis" +msgstr "Крайно мащабиране по оста X" + +#: ../clutter/deprecated/clutter-behaviour-scale.c:262 +msgid "Y Start Scale" +msgstr "Начално мащабиране по Y" + +#: ../clutter/deprecated/clutter-behaviour-scale.c:263 +msgid "Initial scale on the Y axis" +msgstr "Начално мащабиране по оста Y" + +#: ../clutter/deprecated/clutter-behaviour-scale.c:281 +msgid "Y End Scale" +msgstr "Крайно мащабиране по Y" + +#: ../clutter/deprecated/clutter-behaviour-scale.c:282 +msgid "Final scale on the Y axis" +msgstr "Крайно мащабиране по оста Y" + +#: ../clutter/clutter-bind-constraint.c:350 +msgid "The source of the binding" +msgstr "Източник на обвързването" + +#: ../clutter/clutter-bind-constraint.c:363 +msgid "Coordinate" +msgstr "Координата" + +#: ../clutter/clutter-bind-constraint.c:364 +msgid "The coordinate to bind" +msgstr "Координата за обвързване" + +#: ../clutter/clutter-bind-constraint.c:378 +#: ../clutter/clutter-path-constraint.c:226 +#: ../clutter/clutter-snap-constraint.c:366 +msgid "Offset" +msgstr "Отместване" + +#: ../clutter/clutter-bind-constraint.c:379 +msgid "The offset in pixels to apply to the binding" +msgstr "Отместване в пиксели за обвързването" + +#: ../clutter/clutter-binding-pool.c:320 +msgid "The unique name of the binding pool" +msgstr "Уникалното име за областта за обвързване" + +#: ../clutter/clutter-bin-layout.c:261 ../clutter/clutter-bin-layout.c:585 +#: ../clutter/clutter-box-layout.c:395 ../clutter/clutter-table-layout.c:652 +msgid "Horizontal Alignment" +msgstr "Хоризонтално подравняване" + +#: ../clutter/clutter-bin-layout.c:262 +msgid "Horizontal alignment for the actor inside the layout manager" +msgstr "Хоризонтално подравняване на участника за мениджъра на подредбата" + +#: ../clutter/clutter-bin-layout.c:270 ../clutter/clutter-bin-layout.c:602 +#: ../clutter/clutter-box-layout.c:404 ../clutter/clutter-table-layout.c:667 +msgid "Vertical Alignment" +msgstr "Вертикално подравняване" + +#: ../clutter/clutter-bin-layout.c:271 +msgid "Vertical alignment for the actor inside the layout manager" +msgstr "Вертикално подравняване на участника за мениджъра на подредбата" + +#: ../clutter/clutter-bin-layout.c:586 +msgid "Default horizontal alignment for the actors inside the layout manager" +msgstr "" +"Стандартно хоризонтално подравняване на участника за мениджъра на подредбата" + +#: ../clutter/clutter-bin-layout.c:603 +msgid "Default vertical alignment for the actors inside the layout manager" +msgstr "" +"Стандартно вертикално подравняване на участника за мениджъра на подредбата" + +#: ../clutter/clutter-box.c:544 +msgid "Layout Manager" +msgstr "Мениджър на подредбата" + +#: ../clutter/clutter-box.c:545 +msgid "The layout manager used by the box" +msgstr "Мениджърът на подредбата в кутията" + +#: ../clutter/clutter-box.c:564 ../clutter/clutter-rectangle.c:267 +#: ../clutter/clutter-stage.c:1790 +msgid "Color" +msgstr "Цвят" + +#: ../clutter/clutter-box.c:565 +msgid "The background color of the box" +msgstr "Цветът на фона на кутията" + +#: ../clutter/clutter-box.c:579 +msgid "Color Set" +msgstr "Зададен цвят" + +#: ../clutter/clutter-box.c:580 +msgid "Whether the background color is set" +msgstr "Дали фоновият цвят е зададен" + +#: ../clutter/clutter-box-layout.c:370 +msgid "Expand" +msgstr "Разширяване" + +#: ../clutter/clutter-box-layout.c:371 +msgid "Allocate extra space for the child" +msgstr "Задаване на допълнително място за наследника" + +#: ../clutter/clutter-box-layout.c:377 ../clutter/clutter-table-layout.c:631 +msgid "Horizontal Fill" +msgstr "Хоризонтално запълване" + +#: ../clutter/clutter-box-layout.c:378 ../clutter/clutter-table-layout.c:632 +msgid "" +"Whether the child should receive priority when the container is allocating " +"spare space on the horizontal axis" +msgstr "" +"Дали наследникът да е с приоритет, когато контейнерът дава допълнително " +"място по хоризонталната ос" + +#: ../clutter/clutter-box-layout.c:386 ../clutter/clutter-table-layout.c:638 +msgid "Vertical Fill" +msgstr "Вертикално запълване" + +#: ../clutter/clutter-box-layout.c:387 ../clutter/clutter-table-layout.c:639 +msgid "" +"Whether the child should receive priority when the container is allocating " +"spare space on the vertical axis" +msgstr "" +"Дали наследникът да е с приоритет, когато контейнерът дава допълнително " +"място по вертикалната ос" + +#: ../clutter/clutter-box-layout.c:396 ../clutter/clutter-table-layout.c:653 +msgid "Horizontal alignment of the actor within the cell" +msgstr "Хоризонтално запълване на участника в клетката" + +#: ../clutter/clutter-box-layout.c:405 ../clutter/clutter-table-layout.c:668 +msgid "Vertical alignment of the actor within the cell" +msgstr "Вертикално запълване на участника в клетката" + +#: ../clutter/clutter-box-layout.c:1303 +msgid "Vertical" +msgstr "Вертикално" + +#: ../clutter/clutter-box-layout.c:1304 +msgid "Whether the layout should be vertical, rather than horizontal" +msgstr "Дали подредбата да е вертикална, а не хоризонтална" + +#: ../clutter/clutter-box-layout.c:1319 ../clutter/clutter-flow-layout.c:901 +msgid "Homogeneous" +msgstr "По равно" + +#: ../clutter/clutter-box-layout.c:1320 +msgid "" +"Whether the layout should be homogeneous, i.e. all childs get the same size" +msgstr "Дали подредбата да е хомогенна — всички деца да са с еднакъв размер" + +#: ../clutter/clutter-box-layout.c:1335 +msgid "Pack Start" +msgstr "Пакетиране в началото" + +#: ../clutter/clutter-box-layout.c:1336 +msgid "Whether to pack items at the start of the box" +msgstr "Дали елементите да се пакетират в началото на кутията" + +#: ../clutter/clutter-box-layout.c:1349 +msgid "Spacing" +msgstr "Отстояние" + +#: ../clutter/clutter-box-layout.c:1350 +msgid "Spacing between children" +msgstr "Отстояние между децата" + +#: ../clutter/clutter-box-layout.c:1364 ../clutter/clutter-table-layout.c:1742 +msgid "Use Animations" +msgstr "Използване на анимации" + +#: ../clutter/clutter-box-layout.c:1365 ../clutter/clutter-table-layout.c:1743 +msgid "Whether layout changes should be animated" +msgstr "Дали промените в подредбата да са анимирани" + +#: ../clutter/clutter-box-layout.c:1386 ../clutter/clutter-table-layout.c:1764 +msgid "Easing Mode" +msgstr "Режим на преход" + +#: ../clutter/clutter-box-layout.c:1387 ../clutter/clutter-table-layout.c:1765 +msgid "The easing mode of the animations" +msgstr "Режимът на преход на анимациите" + +#: ../clutter/clutter-box-layout.c:1404 ../clutter/clutter-table-layout.c:1782 +msgid "Easing Duration" +msgstr "Продължителност на преход" + +#: ../clutter/clutter-box-layout.c:1405 ../clutter/clutter-table-layout.c:1783 +msgid "The duration of the animations" +msgstr "Продължителност на анимациите" + +#: ../clutter/clutter-cairo-texture.c:582 +msgid "Surface Width" +msgstr "Широчина на повърхността" + +#: ../clutter/clutter-cairo-texture.c:583 +msgid "The width of the Cairo surface" +msgstr "Широчина на повърхността на Cairo" + +#: ../clutter/clutter-cairo-texture.c:597 +msgid "Surface Height" +msgstr "Височина на повърхността" + +#: ../clutter/clutter-cairo-texture.c:598 +msgid "The height of the Cairo surface" +msgstr "Височината на повърхността на Cairo" + +#: ../clutter/clutter-cairo-texture.c:615 +msgid "Auto Resize" +msgstr "Автоматично преоразмеряване" + +#: ../clutter/clutter-cairo-texture.c:616 +msgid "Whether the surface should match the allocation" +msgstr "Дали повърхността да отговаря по размер на заделеното" + +#: ../clutter/clutter-child-meta.c:127 +msgid "Container" +msgstr "Контейнер" + +#: ../clutter/clutter-child-meta.c:128 +msgid "The container that created this data" +msgstr "Контейнерът, който е създал тази повърхност" + +#: ../clutter/clutter-child-meta.c:143 +msgid "The actor wrapped by this data" +msgstr "Участникът в тези данни" + +#: ../clutter/clutter-click-action.c:542 +msgid "Pressed" +msgstr "Натиснат" + +#: ../clutter/clutter-click-action.c:543 +msgid "Whether the clickable should be in pressed state" +msgstr "Дали елементът за натискане е в натиснато състояние" + +#: ../clutter/clutter-click-action.c:556 +msgid "Held" +msgstr "С дръжка" + +#: ../clutter/clutter-click-action.c:557 +msgid "Whether the clickable has a grab" +msgstr "Дали елементът за натискане има дръжка" + +#: ../clutter/clutter-click-action.c:574 ../clutter/clutter-settings.c:598 +msgid "Long Press Duration" +msgstr "Време на продължителното натискане" + +#: ../clutter/clutter-click-action.c:575 +msgid "The minimum duration of a long press to recognize the gesture" +msgstr "" +"Минимално време на натиска, за да се разпознае натискането като продължително" + +#: ../clutter/clutter-click-action.c:593 +msgid "Long Press Threshold" +msgstr "Праг на продължителното натискане" + +#: ../clutter/clutter-click-action.c:594 +msgid "The maximum threshold before a long press is cancelled" +msgstr "Максималното време преди отмяната на продължително натискане" + +#: ../clutter/clutter-clone.c:346 +msgid "Specifies the actor to be cloned" +msgstr "Указва участника за клониране" + +#: ../clutter/clutter-colorize-effect.c:307 +msgid "Tint" +msgstr "Нюансиране" + +#: ../clutter/clutter-colorize-effect.c:308 +msgid "The tint to apply" +msgstr "Приложеното нюансиране" + +#: ../clutter/clutter-deform-effect.c:547 +msgid "Horizontal Tiles" +msgstr "Хоризонтални плочки" + +#: ../clutter/clutter-deform-effect.c:548 +msgid "The number of horizontal tiles" +msgstr "Броят на хоризонталните плочки" + +#: ../clutter/clutter-deform-effect.c:563 +msgid "Vertical Tiles" +msgstr "Вертикални плочки" + +#: ../clutter/clutter-deform-effect.c:564 +msgid "The number of vertical tiles" +msgstr "Броят на вертикалните плочки" + +#: ../clutter/clutter-deform-effect.c:581 +msgid "Back Material" +msgstr "Материал на основата" + +#: ../clutter/clutter-deform-effect.c:582 +msgid "The material to be used when painting the back of the actor" +msgstr "Материалът, върху който се изрисува участникът" + +#: ../clutter/clutter-desaturate-effect.c:305 +msgid "The desaturation factor" +msgstr "Коефициент на разводняване" + +#: ../clutter/clutter-device-manager.c:131 +#: ../clutter/clutter-input-device.c:344 +#: ../clutter/x11/clutter-keymap-x11.c:316 +msgid "Backend" +msgstr "Ядро" + +#: ../clutter/clutter-device-manager.c:132 +msgid "The ClutterBackend of the device manager" +msgstr "Обектът ClutterBackend на управлението на устройства" + +#: ../clutter/clutter-drag-action.c:596 +msgid "Horizontal Drag Threshold" +msgstr "Праг на хоризонталното влачене" + +#: ../clutter/clutter-drag-action.c:597 +msgid "The horizontal amount of pixels required to start dragging" +msgstr "Преместване по хоризонтала в брой пиксели, за да се счете за влачене" + +#: ../clutter/clutter-drag-action.c:624 +msgid "Vertical Drag Threshold" +msgstr "Праг на вертикалното влачене" + +#: ../clutter/clutter-drag-action.c:625 +msgid "The vertical amount of pixels required to start dragging" +msgstr "Преместване по вертикала в брой пиксели, за да се счете за влачене" + +#: ../clutter/clutter-drag-action.c:646 +msgid "Drag Handle" +msgstr "Дръжка за влачене" + +#: ../clutter/clutter-drag-action.c:647 +msgid "The actor that is being dragged" +msgstr "Участникът, който бива влачен" + +#: ../clutter/clutter-drag-action.c:660 +msgid "Drag Axis" +msgstr "Влачене по ос" + +#: ../clutter/clutter-drag-action.c:661 +msgid "Constraints the dragging to an axis" +msgstr "Ограничаване на влаченето по ос" + +#: ../clutter/clutter-flow-layout.c:885 +msgid "Orientation" +msgstr "Посока" + +#: ../clutter/clutter-flow-layout.c:886 +msgid "The orientation of the layout" +msgstr "Посока на подредбата" + +#: ../clutter/clutter-flow-layout.c:902 +msgid "Whether each item should receive the same allocation" +msgstr "Дали всеки елемент да получава еднакво място" + +#: ../clutter/clutter-flow-layout.c:917 ../clutter/clutter-table-layout.c:1713 +msgid "Column Spacing" +msgstr "Отстояние на колоните" + +#: ../clutter/clutter-flow-layout.c:918 +msgid "The spacing between columns" +msgstr "Пространството между колоните" + +#: ../clutter/clutter-flow-layout.c:934 ../clutter/clutter-table-layout.c:1727 +msgid "Row Spacing" +msgstr "Отстояние на редовете" + +#: ../clutter/clutter-flow-layout.c:935 +msgid "The spacing between rows" +msgstr "Пространство между редовете" + +#: ../clutter/clutter-flow-layout.c:949 +msgid "Minimum Column Width" +msgstr "Минимална широчина на колоните" + +#: ../clutter/clutter-flow-layout.c:950 +msgid "Minimum width for each column" +msgstr "Минимална широчина за всяка от колоните" + +#: ../clutter/clutter-flow-layout.c:965 +msgid "Maximum Column Width" +msgstr "Максимална широчина на колоните" + +#: ../clutter/clutter-flow-layout.c:966 +msgid "Maximum width for each column" +msgstr "Максимална широчина за всяка от колоните" + +#: ../clutter/clutter-flow-layout.c:980 +msgid "Minimum Row Height" +msgstr "Минимална височина на редовете" + +#: ../clutter/clutter-flow-layout.c:981 +msgid "Minimum height for each row" +msgstr "Минимална височина за всеки от редовете" + +#: ../clutter/clutter-flow-layout.c:996 +msgid "Maximum Row Height" +msgstr "Максимална височина на редовете" + +#: ../clutter/clutter-flow-layout.c:997 +msgid "Maximum height for each row" +msgstr "Максимална височина за всеки от редовете" + +#: ../clutter/clutter-input-device.c:220 +msgid "Id" +msgstr "Идентификатор" + +#: ../clutter/clutter-input-device.c:221 +msgid "Unique identifier of the device" +msgstr "Уникален идентификатор на устройството" + +#: ../clutter/clutter-input-device.c:237 +msgid "The name of the device" +msgstr "Името на устройството" + +#: ../clutter/clutter-input-device.c:251 +msgid "Device Type" +msgstr "Вид устройство" + +#: ../clutter/clutter-input-device.c:252 +msgid "The type of the device" +msgstr "Видът на устройството" + +#: ../clutter/clutter-input-device.c:267 +msgid "Device Manager" +msgstr "Управление на устройствата" + +#: ../clutter/clutter-input-device.c:268 +msgid "The device manager instance" +msgstr "Стартираната програма за управление на устройствата" + +#: ../clutter/clutter-input-device.c:281 +msgid "Device Mode" +msgstr "Режим на устройството" + +#: ../clutter/clutter-input-device.c:282 +msgid "The mode of the device" +msgstr "Режимът на устройството" + +#: ../clutter/clutter-input-device.c:296 +msgid "Has Cursor" +msgstr "Има показалец" + +#: ../clutter/clutter-input-device.c:297 +msgid "Whether the device has a cursor" +msgstr "Дали устройството има показалец" + +#: ../clutter/clutter-input-device.c:316 +msgid "Whether the device is enabled" +msgstr "Дали устройството е включено" + +#: ../clutter/clutter-input-device.c:329 +msgid "Number of Axes" +msgstr "Брой оси" + +#: ../clutter/clutter-input-device.c:330 +msgid "The number of axes on the device" +msgstr "Броят на осите на устройството" + +#: ../clutter/clutter-input-device.c:345 +msgid "The backend instance" +msgstr "Стартираното ядро" + +#: ../clutter/clutter-interval.c:397 +msgid "Value Type" +msgstr "Вид стойност" + +#: ../clutter/clutter-interval.c:398 +msgid "The type of the values in the interval" +msgstr "Типът на стойностите в интервала" + +#: ../clutter/clutter-layout-meta.c:117 +msgid "Manager" +msgstr "Източник" + +#: ../clutter/clutter-layout-meta.c:118 +msgid "The manager that created this data" +msgstr "Програмата, която е създала данните" + +#. Translators: Leave this UNTRANSLATED if your language is +#. * left-to-right. If your language is right-to-left +#. * (e.g. Hebrew, Arabic), translate it to "default:RTL". +#. * +#. * Do NOT translate it to non-English e.g. "predefinito:LTR"! If +#. * it isn't default:LTR or default:RTL it will not work. +#. +#: ../clutter/clutter-main.c:719 +msgid "default:LTR" +msgstr "default:LTR" + +#: ../clutter/clutter-main.c:1530 +msgid "Show frames per second" +msgstr "Показване на кадрите в секунда" + +#: ../clutter/clutter-main.c:1532 +msgid "Default frame rate" +msgstr "Стандартни кадри в секунда" + +#: ../clutter/clutter-main.c:1534 +msgid "Make all warnings fatal" +msgstr "Всички предупреждения да са фатални" + +#: ../clutter/clutter-main.c:1537 +msgid "Direction for the text" +msgstr "Посока на текста" + +#: ../clutter/clutter-main.c:1540 +msgid "Disable mipmapping on text" +msgstr "Изключване на опростеното текстуриране на текста" + +#: ../clutter/clutter-main.c:1543 +msgid "Use 'fuzzy' picking" +msgstr "Използване на приблизително напасване" + +#: ../clutter/clutter-main.c:1546 +msgid "Clutter debugging flags to set" +msgstr "Флагове за изчистване на грешки на clutter, които да се включат" + +#: ../clutter/clutter-main.c:1548 +msgid "Clutter debugging flags to unset" +msgstr "Флагове за изчистване на грешки на clutter, които да се изключат" + +#: ../clutter/clutter-main.c:1552 +msgid "Clutter profiling flags to set" +msgstr "Флагове за профилиране на clutter, които да се включат" + +#: ../clutter/clutter-main.c:1554 +msgid "Clutter profiling flags to unset" +msgstr "Флагове за профилиране на clutter, които да се изключат" + +#: ../clutter/clutter-main.c:1557 +msgid "Enable accessibility" +msgstr "Включване на достъпността" + +#: ../clutter/clutter-main.c:1745 +msgid "Clutter Options" +msgstr "Опции на clutter" + +#: ../clutter/clutter-main.c:1746 +msgid "Show Clutter Options" +msgstr "Показване на опциите на clutter" + +#: ../clutter/clutter-media.c:77 +msgid "URI" +msgstr "Адрес" + +#: ../clutter/clutter-media.c:78 +msgid "URI of a media file" +msgstr "Адрес на медиен файл" + +#: ../clutter/clutter-media.c:91 +msgid "Playing" +msgstr "Изпълнява" + +#: ../clutter/clutter-media.c:92 +msgid "Whether the actor is playing" +msgstr "Дали участникът изпълнява медия" + +#: ../clutter/clutter-media.c:106 +msgid "Progress" +msgstr "Напредък" + +#: ../clutter/clutter-media.c:107 +msgid "Current progress of the playback" +msgstr "Позиция в изпълняваната медия" + +#: ../clutter/clutter-media.c:120 +msgid "Subtitle URI" +msgstr "Адрес на субтитрите" + +#: ../clutter/clutter-media.c:121 +msgid "URI of a subtitle file" +msgstr "Адрес на файла със субтитрите" + +#: ../clutter/clutter-media.c:136 +msgid "Subtitle Font Name" +msgstr "Име на шрифта за субтитрите" + +#: ../clutter/clutter-media.c:137 +msgid "The font used to display subtitles" +msgstr "Шрифтът за показване на субтитрите" + +#: ../clutter/clutter-media.c:151 +msgid "Audio Volume" +msgstr "Сила на звука" + +#: ../clutter/clutter-media.c:152 +msgid "The volume of the audio" +msgstr "Силата на аудио сигнала" + +#: ../clutter/clutter-media.c:165 +msgid "Can Seek" +msgstr "Може да се превърта" + +#: ../clutter/clutter-media.c:166 +msgid "Whether the current stream is seekable" +msgstr "Дали текущият поток може да се превърта до позиция" + +#: ../clutter/clutter-media.c:180 +msgid "Buffer Fill" +msgstr "Ниво на буфера" + +#: ../clutter/clutter-media.c:181 +msgid "The fill level of the buffer" +msgstr "Ниво на запълване на буфера" + +#: ../clutter/clutter-media.c:195 +msgid "The duration of the stream, in seconds" +msgstr "Продължителност на потока в секунди" + +#: ../clutter/clutter-path-constraint.c:213 +msgid "The path used to constrain an actor" +msgstr "Пътят ограничаващ участник" + +#: ../clutter/clutter-path-constraint.c:227 +msgid "The offset along the path, between -1.0 and 2.0" +msgstr "Отместването по пътя — [-1.0; 2.0]" + +#: ../clutter/clutter-rectangle.c:268 +msgid "The color of the rectangle" +msgstr "Цветът на правоъгълника" + +#: ../clutter/clutter-rectangle.c:281 +msgid "Border Color" +msgstr "Цвят на контура" + +#: ../clutter/clutter-rectangle.c:282 +msgid "The color of the border of the rectangle" +msgstr "Цветът на контура на правоъгълника" + +#: ../clutter/clutter-rectangle.c:297 +msgid "Border Width" +msgstr "Широчина на контура" + +#: ../clutter/clutter-rectangle.c:298 +msgid "The width of the border of the rectangle" +msgstr "Широчината на контура на правоъгълника" + +#: ../clutter/clutter-rectangle.c:312 +msgid "Has Border" +msgstr "С контур" + +#: ../clutter/clutter-rectangle.c:313 +msgid "Whether the rectangle should have a border" +msgstr "Дали правоъгълникът да има контур" + +#: ../clutter/clutter-script.c:434 +msgid "Filename Set" +msgstr "Зададено име на файл" + +#: ../clutter/clutter-script.c:435 +msgid "Whether the :filename property is set" +msgstr "Дали свойството „:filename“ е зададено" + +#: ../clutter/clutter-script.c:449 ../clutter/clutter-texture.c:1071 +msgid "Filename" +msgstr "Има на файла" + +#: ../clutter/clutter-script.c:450 +msgid "The path of the currently parsed file" +msgstr "Пътят на текущо анализирания файл" + +#: ../clutter/clutter-settings.c:439 +msgid "Double Click Time" +msgstr "Време за двойно натискане" + +#: ../clutter/clutter-settings.c:440 +msgid "The time between clicks necessary to detect a multiple click" +msgstr "Времето между натисканията за засичане на двойно натискане" + +#: ../clutter/clutter-settings.c:455 +msgid "Double Click Distance" +msgstr "Разстояние при двойно натискане" + +#: ../clutter/clutter-settings.c:456 +msgid "The distance between clicks necessary to detect a multiple click" +msgstr "Разстоянието между натисканията за засичане на двойно натискане" + +#: ../clutter/clutter-settings.c:471 +msgid "Drag Threshold" +msgstr "Праг на влачене" + +#: ../clutter/clutter-settings.c:472 +msgid "The distance the cursor should travel before starting to drag" +msgstr "Разстоянието, които показалецът трябва да мине, за да започне влачене" + +#: ../clutter/clutter-settings.c:487 ../clutter/clutter-text.c:2995 +msgid "Font Name" +msgstr "Име на шрифт" + +#: ../clutter/clutter-settings.c:488 +msgid "" +"The description of the default font, as one that could be parsed by Pango" +msgstr "Описанието на стандартния шрифт във формат за Pango" + +#: ../clutter/clutter-settings.c:503 +msgid "Font Antialias" +msgstr "Заглаждане на шрифтовете" + +#: ../clutter/clutter-settings.c:504 +msgid "" +"Whether to use antialiasing (1 to enable, 0 to disable, and -1 to use the " +"default)" +msgstr "" +"Да се използва ли заглаждане на шрифтовете (1 — да, 0 — не, -1 — както " +"останалия GNOME)" + +#: ../clutter/clutter-settings.c:520 +msgid "Font DPI" +msgstr "Разделителна способност за шрифтовете" + +#: ../clutter/clutter-settings.c:521 +msgid "" +"The resolution of the font, in 1024 * dots/inch, or -1 to use the default" +msgstr "" +"Разделителна способност за шрифта, кратно на 1024 точки на инч, -1 както " +"останалия GNOME" + +#: ../clutter/clutter-settings.c:537 +msgid "Font Hinting" +msgstr "Шрифтови подсказки" + +#: ../clutter/clutter-settings.c:538 +msgid "" +"Whether to use hinting (1 to enable, 0 to disable and -1 to use the default)" +msgstr "" +"Да се използват ли шрифтови подсказки (1 — да, 0 — не, -1 — както останалия " +"GNOME)" + +#: ../clutter/clutter-settings.c:559 +msgid "Font Hint Style" +msgstr "Стил на подсказките" + +#: ../clutter/clutter-settings.c:560 +msgid "The style of hinting (hintnone, hintslight, hintmedium, hintfull)" +msgstr "" +"Видът на шрифтовите подсказки при изобразяване на шрифтове. Възможни " +"стойности са „hintnone“ (без подсказки), „hintslight“ (леки), " +"„hintmedium“ (средни) и „hintfull“ (пълни)" + +#: ../clutter/clutter-settings.c:581 +msgid "Font Subpixel Order" +msgstr "Редът на подпикселните елементи за шрифтове" + +#: ../clutter/clutter-settings.c:582 +msgid "The type of subpixel antialiasing (none, rgb, bgr, vrgb, vbgr)" +msgstr "" +"Видът подредба на подпикселните елементи за заглаждането на шрифтове. " +"Възможни стойности са „none“ (без), „rgb“ (за червено отляво), „bgr“ (за " +"червено отдясно), „vrgb“ (за червено отгоре) и „vbgr“ (за червено отдолу)" + +#: ../clutter/clutter-settings.c:599 +msgid "The minimum duration for a long press gesture to be recognized" +msgstr "" +"Минимално време на натискане, за да се задейства събитието за продължително " +"натискане" + +#: ../clutter/clutter-settings.c:606 +msgid "Fontconfig configuration timestamp" +msgstr "Време на последна промяна на настройките на fontconfig" + +#: ../clutter/clutter-settings.c:607 +msgid "Timestamp of the current fontconfig configuration" +msgstr "Време на последна промяна на текущите настройки на fontconfig" + +#: ../clutter/clutter-settings.c:624 +msgid "Password Hint Time" +msgstr "Време на разкриване" + +#: ../clutter/clutter-settings.c:625 +msgid "How long to show the last input character in hidden entries" +msgstr "" +"Колко време да се показва последният знак в маскираната последователност" + +#: ../clutter/deprecated/clutter-shader.c:257 +msgid "Vertex Source" +msgstr "Код за обработка на върхове" + +#: ../clutter/deprecated/clutter-shader.c:258 +msgid "Source of vertex shader" +msgstr "Код на програмата за обработка на върхове" + +#: ../clutter/deprecated/clutter-shader.c:274 +msgid "Fragment Source" +msgstr "Код за обработка на фрагменти" + +#: ../clutter/deprecated/clutter-shader.c:275 +msgid "Source of fragment shader" +msgstr "Код на програмата за обработка на фрагменти" + +#: ../clutter/deprecated/clutter-shader.c:292 +msgid "Compiled" +msgstr "Компилирана" + +#: ../clutter/deprecated/clutter-shader.c:293 +msgid "Whether the shader is compiled and linked" +msgstr "Дали програмата за графична обработка е компилирана и свързана" + +#: ../clutter/deprecated/clutter-shader.c:310 +msgid "Whether the shader is enabled" +msgstr "Дали програмата за графична обработка е включена" + +#: ../clutter/deprecated/clutter-shader.c:521 +#, c-format +msgid "%s compilation failed: %s" +msgstr "%s неуспешно компилиране: %s" + +#: ../clutter/deprecated/clutter-shader.c:522 +msgid "Vertex shader" +msgstr "Програма за графична обработка на върхове" + +#: ../clutter/deprecated/clutter-shader.c:523 +msgid "Fragment shader" +msgstr "Програма за графична обработка на фрагменти" + +#: ../clutter/clutter-shader-effect.c:482 +msgid "Shader Type" +msgstr "Вид програма за графична обработка" + +#: ../clutter/clutter-shader-effect.c:483 +msgid "The type of shader used" +msgstr "Видът на използваната програма за графична обработка" + +#: ../clutter/clutter-snap-constraint.c:322 +msgid "The source of the constraint" +msgstr "Източникът на ограничението" + +#: ../clutter/clutter-snap-constraint.c:335 +msgid "From Edge" +msgstr "Подвижен ръб" + +#: ../clutter/clutter-snap-constraint.c:336 +msgid "The edge of the actor that should be snapped" +msgstr "Ръбът на участника, който трябва да бъде прилепен" + +#: ../clutter/clutter-snap-constraint.c:350 +msgid "To Edge" +msgstr "Целеви ръб" + +#: ../clutter/clutter-snap-constraint.c:351 +msgid "The edge of the source that should be snapped" +msgstr "Ръбът на източника, който трябва да бъде прилепен" + +#: ../clutter/clutter-snap-constraint.c:367 +msgid "The offset in pixels to apply to the constraint" +msgstr "Отместване в пиксели, което да се приложи към ограничението" + +#: ../clutter/clutter-stage.c:1732 +msgid "Fullscreen Set" +msgstr "На цял екран" + +#: ../clutter/clutter-stage.c:1733 +msgid "Whether the main stage is fullscreen" +msgstr "Дали основната сцена е на цял екран" + +#: ../clutter/clutter-stage.c:1749 +msgid "Offscreen" +msgstr "Извън екрана" + +#: ../clutter/clutter-stage.c:1750 +msgid "Whether the main stage should be rendered offscreen" +msgstr "Дали основната сцена предварително да се изобразява извън екрана" + +#: ../clutter/clutter-stage.c:1762 ../clutter/clutter-text.c:3108 +msgid "Cursor Visible" +msgstr "Видим показалец" + +#: ../clutter/clutter-stage.c:1763 +msgid "Whether the mouse pointer is visible on the main stage" +msgstr "Дали показалецът на мишката да се вижда на основната сцена" + +#: ../clutter/clutter-stage.c:1777 +msgid "User Resizable" +msgstr "Преоразмерима" + +#: ../clutter/clutter-stage.c:1778 +msgid "Whether the stage is able to be resized via user interaction" +msgstr "Дали сцената може да се преоразмери от потребителя" + +#: ../clutter/clutter-stage.c:1791 +msgid "The color of the stage" +msgstr "Цветът на сцената" + +#: ../clutter/clutter-stage.c:1805 +msgid "Perspective" +msgstr "Перспектива" + +#: ../clutter/clutter-stage.c:1806 +msgid "Perspective projection parameters" +msgstr "Параметри на перспективната проекция" + +#: ../clutter/clutter-stage.c:1821 +msgid "Title" +msgstr "Заглавие" + +#: ../clutter/clutter-stage.c:1822 +msgid "Stage Title" +msgstr "Заглавие на сцената" + +#: ../clutter/clutter-stage.c:1837 +msgid "Use Fog" +msgstr "Замъгляване" + +#: ../clutter/clutter-stage.c:1838 +msgid "Whether to enable depth cueing" +msgstr "Дали да се включи подсказването на дълбочина" + +#: ../clutter/clutter-stage.c:1852 +msgid "Fog" +msgstr "Настройки на замъгляването" + +#: ../clutter/clutter-stage.c:1853 +msgid "Settings for the depth cueing" +msgstr "Настройки на подсказването на дълбочина" + +#: ../clutter/clutter-stage.c:1869 +msgid "Use Alpha" +msgstr "Канал за прозрачност" + +#: ../clutter/clutter-stage.c:1870 +msgid "Whether to honour the alpha component of the stage color" +msgstr "Дали да се зачита компонентът за прозрачност на цвета на сцената" + +#: ../clutter/clutter-stage.c:1886 +msgid "Key Focus" +msgstr "Фокус за клавиатурата" + +#: ../clutter/clutter-stage.c:1887 +msgid "The currently key focused actor" +msgstr "Участникът, който в момента държи фокуса на клавиатурата" + +#: ../clutter/clutter-stage.c:1903 +msgid "No Clear Hint" +msgstr "Без изчистване" + +#: ../clutter/clutter-stage.c:1904 +msgid "Whether the stage should clear its contents" +msgstr "Дали сцената да изчисти съдържанието си" + +#: ../clutter/clutter-stage.c:1917 +msgid "Accept Focus" +msgstr "Приемане на фокуса" + +#: ../clutter/clutter-stage.c:1918 +msgid "Whether the stage should accept focus on show" +msgstr "Дали сцената да взема фокуса при показване" + +#: ../clutter/clutter-state.c:1472 +msgid "State" +msgstr "Състояние" + +#: ../clutter/clutter-state.c:1473 +msgid "Currently set state, (transition to this state might not be complete)" +msgstr "Текущо зададеното състояние (преходът към него може да не е завършил)" + +#: ../clutter/clutter-state.c:1487 +msgid "Default transition duration" +msgstr "Стандартна продължителност на прехода" + +#: ../clutter/clutter-table-layout.c:585 +msgid "Column Number" +msgstr "Номер на колона" + +#: ../clutter/clutter-table-layout.c:586 +msgid "The column the widget resides in" +msgstr "В коя поред колона е графичният обект" + +#: ../clutter/clutter-table-layout.c:593 +msgid "Row Number" +msgstr "Номер на ред" + +#: ../clutter/clutter-table-layout.c:594 +msgid "The row the widget resides in" +msgstr "В кой поред ред е графичният обект" + +#: ../clutter/clutter-table-layout.c:601 +msgid "Column Span" +msgstr "Брой колони" + +#: ../clutter/clutter-table-layout.c:602 +msgid "The number of columns the widget should span" +msgstr "В колко колони да се разпростира графичният обект" + +#: ../clutter/clutter-table-layout.c:609 +msgid "Row Span" +msgstr "Брой редове" + +#: ../clutter/clutter-table-layout.c:610 +msgid "The number of rows the widget should span" +msgstr "В колко реда да се разпростира графичният обект" + +#: ../clutter/clutter-table-layout.c:617 +msgid "Horizontal Expand" +msgstr "Хоризонтално разширяване" + +#: ../clutter/clutter-table-layout.c:618 +msgid "Allocate extra space for the child in horizontal axis" +msgstr "" +"Заделяне на допълнително пространство за наследника по хоризонталната ос" + +#: ../clutter/clutter-table-layout.c:624 +msgid "Vertical Expand" +msgstr "Вертикално разширяване" + +#: ../clutter/clutter-table-layout.c:625 +msgid "Allocate extra space for the child in vertical axis" +msgstr "" +"Заделяне на допълнително пространство за наследника по хоризонталната ос" + +#: ../clutter/clutter-table-layout.c:1714 +msgid "Spacing between columns" +msgstr "Разредка между колоните" + +#: ../clutter/clutter-table-layout.c:1728 +msgid "Spacing between rows" +msgstr "Разредка между редовете" + +#: ../clutter/clutter-text.c:2996 +msgid "The font to be used by the text" +msgstr "Шрифтът за текста" + +#: ../clutter/clutter-text.c:3013 +msgid "Font Description" +msgstr "Описание на шрифта" + +#: ../clutter/clutter-text.c:3014 +msgid "The font description to be used" +msgstr "Описанието на използвания шрифт" + +#: ../clutter/clutter-text.c:3030 +msgid "Text" +msgstr "Текст" + +#: ../clutter/clutter-text.c:3031 +msgid "The text to render" +msgstr "Текстът, който да се изобрази" + +#: ../clutter/clutter-text.c:3045 +msgid "Font Color" +msgstr "Цвят на шрифта" + +#: ../clutter/clutter-text.c:3046 +msgid "Color of the font used by the text" +msgstr "Цветът на шрифта на текста" + +#: ../clutter/clutter-text.c:3060 +msgid "Editable" +msgstr "Редактируем" + +#: ../clutter/clutter-text.c:3061 +msgid "Whether the text is editable" +msgstr "Дали текстът може да се редактира" + +#: ../clutter/clutter-text.c:3076 +msgid "Selectable" +msgstr "Изберим" + +#: ../clutter/clutter-text.c:3077 +msgid "Whether the text is selectable" +msgstr "Дали текстът може да се избира" + +#: ../clutter/clutter-text.c:3091 +msgid "Activatable" +msgstr "Активен" + +#: ../clutter/clutter-text.c:3092 +msgid "Whether pressing return causes the activate signal to be emitted" +msgstr "Дали натискането на „Enter“ кара излъчването на сигнал за активност" + +#: ../clutter/clutter-text.c:3109 +msgid "Whether the input cursor is visible" +msgstr "Дали курсорът се вижда" + +#: ../clutter/clutter-text.c:3123 ../clutter/clutter-text.c:3124 +msgid "Cursor Color" +msgstr "Цвят на курсора" + +#: ../clutter/clutter-text.c:3138 +msgid "Cursor Color Set" +msgstr "Зададен цвят на курсора" + +#: ../clutter/clutter-text.c:3139 +msgid "Whether the cursor color has been set" +msgstr "Дали цветът на курсора е зададен" + +#: ../clutter/clutter-text.c:3154 +msgid "Cursor Size" +msgstr "Размер на курсора" + +#: ../clutter/clutter-text.c:3155 +msgid "The width of the cursor, in pixels" +msgstr "Широчина на курсора в пиксели" + +#: ../clutter/clutter-text.c:3169 +msgid "Cursor Position" +msgstr "Положение на курсора" + +#: ../clutter/clutter-text.c:3170 +msgid "The cursor position" +msgstr "Координатите на курсора" + +#: ../clutter/clutter-text.c:3185 +msgid "Selection-bound" +msgstr "Според избраното" + +#: ../clutter/clutter-text.c:3186 +msgid "The cursor position of the other end of the selection" +msgstr "Място на курсора в другия край на избраното" + +#: ../clutter/clutter-text.c:3201 ../clutter/clutter-text.c:3202 +msgid "Selection Color" +msgstr "Цвят на избраното" + +#: ../clutter/clutter-text.c:3216 +msgid "Selection Color Set" +msgstr "Зададен цвят на избраното" + +#: ../clutter/clutter-text.c:3217 +msgid "Whether the selection color has been set" +msgstr "Дали цветът на избраното е зададен" + +#: ../clutter/clutter-text.c:3232 +msgid "Attributes" +msgstr "Атрибути" + +#: ../clutter/clutter-text.c:3233 +msgid "A list of style attributes to apply to the contents of the actor" +msgstr "" +"Списък със стилови атрибути, които да се приложат към съдържанието на " +"участника" + +#: ../clutter/clutter-text.c:3255 +msgid "Use markup" +msgstr "Маркиран текст" + +#: ../clutter/clutter-text.c:3256 +msgid "Whether or not the text includes Pango markup" +msgstr "Дали да се използва маркиране на текста по Pango" + +#: ../clutter/clutter-text.c:3272 +msgid "Line wrap" +msgstr "Пренасяне на редове" + +#: ../clutter/clutter-text.c:3273 +msgid "If set, wrap the lines if the text becomes too wide" +msgstr "Указва дали прекалено дългите редове текст да се пренасят" + +#: ../clutter/clutter-text.c:3288 +msgid "Line wrap mode" +msgstr "Режим на пренос на редовете" + +#: ../clutter/clutter-text.c:3289 +msgid "Control how line-wrapping is done" +msgstr "Как де се пренасят редовете" + +#: ../clutter/clutter-text.c:3304 +msgid "Ellipsize" +msgstr "Съкращаване" + +#: ../clutter/clutter-text.c:3305 +msgid "The preferred place to ellipsize the string" +msgstr "Предпочитаното място за съкращаване на низа" + +#: ../clutter/clutter-text.c:3321 +msgid "Line Alignment" +msgstr "Подравняване на редовете" + +#: ../clutter/clutter-text.c:3322 +msgid "The preferred alignment for the string, for multi-line text" +msgstr "Предпочитаното подравняване на текста" + +#: ../clutter/clutter-text.c:3338 +msgid "Justify" +msgstr "Двустранно подравняване" + +#: ../clutter/clutter-text.c:3339 +msgid "Whether the text should be justified" +msgstr "Дали текстът да бъде подреден двустранно" + +#: ../clutter/clutter-text.c:3354 +msgid "Password Character" +msgstr "Знак за пароли" + +#: ../clutter/clutter-text.c:3355 +msgid "If non-zero, use this character to display the actor's contents" +msgstr "" +"Ако е зададен, ще се използва като знак за извеждането на съдържанието на " +"участника" + +#: ../clutter/clutter-text.c:3369 +msgid "Max Length" +msgstr "Максимална дължина" + +#: ../clutter/clutter-text.c:3370 +msgid "Maximum length of the text inside the actor" +msgstr "Максимална дължина на текста в участника" + +#: ../clutter/clutter-text.c:3393 +msgid "Single Line Mode" +msgstr "Едноредов режим" + +#: ../clutter/clutter-text.c:3394 +msgid "Whether the text should be a single line" +msgstr "Дали текстът да е само на един ред" + +#: ../clutter/clutter-text.c:3408 ../clutter/clutter-text.c:3409 +msgid "Selected Text Color" +msgstr "Цвят на избрания текст" + +#: ../clutter/clutter-text.c:3423 +msgid "Selected Text Color Set" +msgstr "Зададен цвят на избран текст" + +#: ../clutter/clutter-text.c:3424 +msgid "Whether the selected text color has been set" +msgstr "Дали цветът на избран текст e зададен" + +#: ../clutter/clutter-texture.c:985 +msgid "Sync size of actor" +msgstr "Синхронизиран размер" + +#: ../clutter/clutter-texture.c:986 +msgid "Auto sync size of actor to underlying pixbuf dimensions" +msgstr "" +"Автоматично синхронизиране на участника към размерите на прилежащия буфер с " +"пиксели" + +#: ../clutter/clutter-texture.c:993 +msgid "Disable Slicing" +msgstr "Изключване на нарязването" + +#: ../clutter/clutter-texture.c:994 +msgid "" +"Forces the underlying texture to be singular and not made of smaller space " +"saving individual textures" +msgstr "" +"Текстурата да е цяла и единствена, а не нарязана на малки съставящи парчета " +"за пестене на място" + +#: ../clutter/clutter-texture.c:1003 +msgid "Tile Waste" +msgstr "Загуба при нарязване" + +#: ../clutter/clutter-texture.c:1004 +msgid "Maximum waste area of a sliced texture" +msgstr "Максималната неизползваема площ при нарязана текстура" + +#: ../clutter/clutter-texture.c:1012 +msgid "Horizontal repeat" +msgstr "Повтаряне по хоризонтала" + +#: ../clutter/clutter-texture.c:1013 +msgid "Repeat the contents rather than scaling them horizontally" +msgstr "Повтаряне, а не разпъване на текстурата по хоризонтала" + +#: ../clutter/clutter-texture.c:1020 +msgid "Vertical repeat" +msgstr "Повтаряне по вертикала" + +#: ../clutter/clutter-texture.c:1021 +msgid "Repeat the contents rather than scaling them vertically" +msgstr "Повтаряне, а не разпъване на текстурата по хоризонтала" + +#: ../clutter/clutter-texture.c:1028 +msgid "Filter Quality" +msgstr "Качество на филтриране" + +#: ../clutter/clutter-texture.c:1029 +msgid "Rendering quality used when drawing the texture" +msgstr "Качество на изобразяване на текстурата" + +#: ../clutter/clutter-texture.c:1037 +msgid "Pixel Format" +msgstr "Формат на пикселите" + +#: ../clutter/clutter-texture.c:1038 +msgid "The Cogl pixel format to use" +msgstr "Форматът на пиксели в Cogl, който да се ползва" + +#: ../clutter/clutter-texture.c:1046 +msgid "Cogl Texture" +msgstr "Текстура на Cogl" + +#: ../clutter/clutter-texture.c:1047 +msgid "The underlying Cogl texture handle used to draw this actor" +msgstr "Указател към текстурата на Cogl за изобразяването на този участник" + +#: ../clutter/clutter-texture.c:1054 +msgid "Cogl Material" +msgstr "Материал на Cogl" + +#: ../clutter/clutter-texture.c:1055 +msgid "The underlying Cogl material handle used to draw this actor" +msgstr "Указател към материала на Cogl за изобразяването на този участник" + +#: ../clutter/clutter-texture.c:1072 +msgid "The path of the file containing the image data" +msgstr "Пътят към файла с изображението" + +#: ../clutter/clutter-texture.c:1079 +msgid "Keep Aspect Ratio" +msgstr "Запазване на отношението на страните" + +#: ../clutter/clutter-texture.c:1080 +msgid "" +"Keep the aspect ratio of the texture when requesting the preferred width or " +"height" +msgstr "" +"Запазване на отношението на страните при заявяване на предпочитана широчина " +"или височина" + +#: ../clutter/clutter-texture.c:1106 +msgid "Load asynchronously" +msgstr "Асинхронно зареждане" + +#: ../clutter/clutter-texture.c:1107 +msgid "" +"Load files inside a thread to avoid blocking when loading images from disk" +msgstr "" +"Зареждане на файловете в отделна нишка, за да се избегне блокирането при " +"зареждането на големи изображения от диска" + +#: ../clutter/clutter-texture.c:1123 +msgid "Load data asynchronously" +msgstr "Асинхронно декодиране на изображенията" + +#: ../clutter/clutter-texture.c:1124 +msgid "" +"Decode image data files inside a thread to reduce blocking when loading " +"images from disk" +msgstr "" +"Декодиране на изображенията от файловете в отделна нишка, за да се избегне " +"блокирането при зареждането на големи изображения от диска" + +#: ../clutter/clutter-texture.c:1148 +msgid "Pick With Alpha" +msgstr "Прилагане на прозрачност" + +#: ../clutter/clutter-texture.c:1149 +msgid "Shape actor with alpha channel when picking" +msgstr "Прилагане на алфа канала към участника" + +#: ../clutter/clutter-texture.c:1547 ../clutter/clutter-texture.c:1930 +#: ../clutter/clutter-texture.c:2024 ../clutter/clutter-texture.c:2305 +#, c-format +msgid "Failed to load the image data" +msgstr "Неуспешно зареждане на данните на изображението" + +#: ../clutter/clutter-texture.c:1693 +#, c-format +msgid "YUV textures are not supported" +msgstr "Не се поддържат текстури във формат YUV" + +#: ../clutter/clutter-texture.c:1702 +#, c-format +msgid "YUV2 textues are not supported" +msgstr "Не се поддържат текстури във формат YUV2" + +#: ../clutter/clutter-timeline.c:264 +msgid "Should the timeline automatically restart" +msgstr "Ако изпълнението автоматично се повтаря, да се:" + +#: ../clutter/clutter-timeline.c:278 +msgid "Delay" +msgstr "забави" + +#: ../clutter/clutter-timeline.c:279 +msgid "Delay before start" +msgstr "забави преди стартиране" + +#: ../clutter/clutter-timeline.c:295 +msgid "Duration of the timeline in milliseconds" +msgstr "Продължителност на изпълнението в милисекунди" + +#: ../clutter/clutter-timeline.c:311 +msgid "Direction of the timeline" +msgstr "Посока на изпълнение" + +#: ../clutter/clutter-timeline.c:326 +msgid "Auto Reverse" +msgstr "Автоматична смяна на посоката" + +#: ../clutter/clutter-timeline.c:327 +msgid "Whether the direction should be reversed when reaching the end" +msgstr "Дали посоката да се обръща при стигането на края" + +#: ../clutter/evdev/clutter-input-device-evdev.c:147 +msgid "sysfs Path" +msgstr "Път в sysfs" + +#: ../clutter/evdev/clutter-input-device-evdev.c:148 +msgid "Path of the device in sysfs" +msgstr "Път до устройството в sysfs" + +#: ../clutter/evdev/clutter-input-device-evdev.c:163 +msgid "Device Path" +msgstr "Път до устройството" + +#: ../clutter/evdev/clutter-input-device-evdev.c:164 +msgid "Path of the device node" +msgstr "Път до възела на устройството" + +#: ../clutter/x11/clutter-backend-x11.c:483 +msgid "X display to use" +msgstr "Кой дисплей на X да се ползва" + +#: ../clutter/x11/clutter-backend-x11.c:489 +msgid "X screen to use" +msgstr "Кой екран на X да се ползва" + +#: ../clutter/x11/clutter-backend-x11.c:494 +msgid "Make X calls synchronous" +msgstr "Синхронни извиквания на X" + +#: ../clutter/x11/clutter-backend-x11.c:501 +msgid "Enable XInput support" +msgstr "Включване на поддръжката на XInput" + +#: ../clutter/x11/clutter-keymap-x11.c:317 +msgid "The Clutter backend" +msgstr "Ядро на Clutter" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:545 +msgid "Pixmap" +msgstr "Поле с пиксели" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:546 +msgid "The X11 Pixmap to be bound" +msgstr "Кое поле с пиксели на X11 да се ползва" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:554 +msgid "Pixmap width" +msgstr "Широчина на полето" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:555 +msgid "The width of the pixmap bound to this texture" +msgstr "Широчината на полето с пиксели за тази текстура" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:563 +msgid "Pixmap height" +msgstr "Височина на полето" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:564 +msgid "The height of the pixmap bound to this texture" +msgstr "Височина на полето с пиксели за тази текстура" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:572 +msgid "Pixmap Depth" +msgstr "Битове на пиксел за полето" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:573 +msgid "The depth (in number of bits) of the pixmap bound to this texture" +msgstr "Дълбочината на цвета в битове за пиксел за тази текстура" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:581 +msgid "Automatic Updates" +msgstr "Автоматично обновяване" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:582 +msgid "If the texture should be kept in sync with any pixmap changes." +msgstr "Дали текстурата да се синхронизира към промените на полето с пиксели" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:590 +msgid "Window" +msgstr "Прозорец" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:591 +msgid "The X11 Window to be bound" +msgstr "Съответният прозорец на X11" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:599 +msgid "Window Redirect Automatic" +msgstr "Автоматично пренасочване на прозореца" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:600 +msgid "If composite window redirects are set to Automatic (or Manual if false)" +msgstr "" +"Дали пренасочванията на наслагвания прозорец са автоматични (или са изрични)" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:610 +msgid "Window Mapped" +msgstr "За изобразяване" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:611 +msgid "If window is mapped" +msgstr "Дали прозорецът да се изобрази заедно със сцената си" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:620 +msgid "Destroyed" +msgstr "Унищожен" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:621 +msgid "If window has been destroyed" +msgstr "Дали прозорецът е унищожен" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:629 +msgid "Window X" +msgstr "X на прозореца" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:630 +msgid "X position of window on screen according to X11" +msgstr "Хоризонтално положение на прозореца по X11" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:638 +msgid "Window Y" +msgstr "Y на прозореца" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:639 +msgid "Y position of window on screen according to X11" +msgstr "Вертикално положение на прозореца по X11" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:646 +msgid "Window Override Redirect" +msgstr "Изрично пренасочване на прозореца" + +#: ../clutter/x11/clutter-x11-texture-pixmap.c:647 +msgid "If this is an override-redirect window" +msgstr "Дали прозорецът е с изрично пренасочване" diff --git a/tests/accessibility/Makefile.am b/tests/accessibility/Makefile.am index 85aa43a7c..7d8572e94 100644 --- a/tests/accessibility/Makefile.am +++ b/tests/accessibility/Makefile.am @@ -1,7 +1,7 @@ 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 \ diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am index 190fdcb48..1cd6f2ef3 100644 --- a/tests/conform/Makefile.am +++ b/tests/conform/Makefile.am @@ -170,7 +170,7 @@ test_conformance_CPPFLAGS = \ 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 diff --git a/tests/conform/test-behaviours.c b/tests/conform/test-behaviours.c index 7df5e131e..ad0ac16a1 100644 --- a/tests/conform/test-behaviours.c +++ b/tests/conform/test-behaviours.c @@ -1,6 +1,4 @@ #include - -#undef CLUTTER_DISABLE_DEPRECATED #include #include "test-conform-common.h" diff --git a/tests/conform/test-cogl-texture-pixmap-x11.c b/tests/conform/test-cogl-texture-pixmap-x11.c index abdef1298..36f86d458 100644 --- a/tests/conform/test-cogl-texture-pixmap-x11.c +++ b/tests/conform/test-cogl-texture-pixmap-x11.c @@ -4,7 +4,7 @@ static const ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff }; -#ifdef COGL_HAS_XLIB +#ifdef CLUTTER_WINDOWING_X11 #include #include @@ -195,13 +195,13 @@ queue_redraw (gpointer stage) return TRUE; } -#endif /* COGL_HAS_XLIB */ +#endif /* CLUTTER_WINDOWING_X11 */ void test_cogl_texture_pixmap_x11 (TestConformSimpleFixture *fixture, gconstpointer data) { -#ifdef COGL_HAS_XLIB +#ifdef CLUTTER_WINDOWING_X11 TestState state; guint idle_handler; @@ -235,11 +235,11 @@ test_cogl_texture_pixmap_x11 (TestConformSimpleFixture *fixture, if (g_test_verbose ()) g_print ("OK\n"); -#else /* COGL_HAS_XLIB */ +#else /* CLUTTER_WINDOWING_X11 */ if (g_test_verbose ()) g_print ("Skipping\n"); -#endif /* COGL_HAS_XLIB */ +#endif /* CLUTTER_WINDOWING_X11 */ } diff --git a/tests/conform/test-conform-common.c b/tests/conform/test-conform-common.c index 484c010bb..e7cd42bc4 100644 --- a/tests/conform/test-conform-common.c +++ b/tests/conform/test-conform-common.c @@ -3,7 +3,7 @@ #include #include -#ifdef COGL_HAS_XLIB +#ifdef CLUTTER_WINDOWING_X11 #include #include #endif @@ -48,7 +48,7 @@ test_conform_simple_fixture_setup (TestConformSimpleFixture *fixture, g_assert (clutter_init (shared_state->argc_addr, shared_state->argv_addr) == CLUTTER_INIT_SUCCESS); -#ifdef COGL_HAS_XLIB +#ifdef CLUTTER_WINDOWING_X11 /* A lot of the tests depend on a specific stage / framebuffer size * when they read pixels back to verify the results of the test. * diff --git a/tests/conform/test-score.c b/tests/conform/test-score.c index 8756942c3..65384f10c 100644 --- a/tests/conform/test-score.c +++ b/tests/conform/test-score.c @@ -1,5 +1,3 @@ -#undef CLUTTER_DISABLE_DEPRECATED - #include #include #include diff --git a/tests/conform/test-script-parser.c b/tests/conform/test-script-parser.c index 44abe09cd..b378e74eb 100644 --- a/tests/conform/test-script-parser.c +++ b/tests/conform/test-script-parser.c @@ -1,7 +1,5 @@ #include #include - -#undef CLUTTER_DISABLE_DEPRECATED #include #include "test-conform-common.h" diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am index 4e6cd5c84..114622ad5 100644 --- a/tests/interactive/Makefile.am +++ b/tests/interactive/Makefile.am @@ -59,10 +59,11 @@ UNIT_TESTS = \ test-path-constraint.c \ test-snap-constraint.c \ test-state-script.c \ - test-drop.c + test-drop.c \ + test-devices.c if X11_TESTS -UNIT_TESTS += test-pixmap.c test-devices.c +UNIT_TESTS += test-pixmap.c endif if OS_WIN32 @@ -147,7 +148,7 @@ INCLUDES = \ -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 diff --git a/tests/interactive/test-actor-clone.c b/tests/interactive/test-actor-clone.c index 6e191a954..ec4f392d7 100644 --- a/tests/interactive/test-actor-clone.c +++ b/tests/interactive/test-actor-clone.c @@ -1,4 +1,3 @@ -#undef CLUTTER_DISABLE_DEPRECATED #include #include diff --git a/tests/interactive/test-actors.c b/tests/interactive/test-actors.c index 4ce782aeb..950798c7a 100644 --- a/tests/interactive/test-actors.c +++ b/tests/interactive/test-actors.c @@ -1,4 +1,3 @@ -#undef CLUTTER_DISABLE_DEPRECATED #include #include diff --git a/tests/interactive/test-behave.c b/tests/interactive/test-behave.c index 0ec4e1e07..c6b75907c 100644 --- a/tests/interactive/test-behave.c +++ b/tests/interactive/test-behave.c @@ -5,7 +5,6 @@ #include #include -#undef CLUTTER_DISABLE_DEPRECATED #include static gboolean diff --git a/tests/interactive/test-depth.c b/tests/interactive/test-depth.c index 0f2ed76f1..7684d5d88 100644 --- a/tests/interactive/test-depth.c +++ b/tests/interactive/test-depth.c @@ -1,7 +1,5 @@ #include #include - -#undef CLUTTER_DISABLE_DEPRECATED #include /* each time the timeline animating the label completes, swap the direction */ diff --git a/tests/interactive/test-devices.c b/tests/interactive/test-devices.c index 1d252dc8a..547317433 100644 --- a/tests/interactive/test-devices.c +++ b/tests/interactive/test-devices.c @@ -1,7 +1,10 @@ #include #include #include + +#ifdef CLUTTER_WINDOWING_X11 #include +#endif typedef struct { ClutterActor *stage; @@ -218,8 +221,10 @@ test_devices_main (int argc, char **argv) ClutterDeviceManager *manager; const GSList *stage_devices, *l; +#ifdef CLUTTER_WINDOWING_X11 /* force enabling X11 support */ clutter_x11_enable_xinput (); +#endif if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS) return 1; diff --git a/tests/interactive/test-multistage.c b/tests/interactive/test-multistage.c index f9130cc11..3a877fc81 100644 --- a/tests/interactive/test-multistage.c +++ b/tests/interactive/test-multistage.c @@ -1,6 +1,4 @@ #include - -#undef CLUTTER_DISABLE_DEPRECATED #include static GList *stages = NULL; diff --git a/tests/interactive/test-paint-wrapper.c b/tests/interactive/test-paint-wrapper.c index bbc8fa490..b51562a4c 100644 --- a/tests/interactive/test-paint-wrapper.c +++ b/tests/interactive/test-paint-wrapper.c @@ -1,6 +1,5 @@ #include -#undef CLUTTER_DISABLE_DEPRECATED #include #if defined (_MSC_VER) && !defined (_USE_MATH_DEFINES) diff --git a/tests/interactive/test-pixmap.c b/tests/interactive/test-pixmap.c index 9bdf95097..b6ce2daa2 100644 --- a/tests/interactive/test-pixmap.c +++ b/tests/interactive/test-pixmap.c @@ -1,24 +1,22 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include #include -#undef CLUTTER_DISABLE_DEPRECATED +#include + +#ifdef CAIRO_HAS_XLIB_SURFACE +#include +#endif + #include #ifdef CLUTTER_WINDOWING_X11 +#include +#include -# include -# include - -# include -# include - -# include -# include +#include +#include +#endif #define IMAGE TESTS_DATADIR G_DIR_SEPARATOR_S "redhand.png" @@ -127,6 +125,7 @@ stage_button_press_cb (ClutterActor *actor, gpointer data) { draw_arc ((Pixmap)data); + return FALSE; } @@ -172,9 +171,12 @@ create_pixmap (guint *width, guint *height, guint *depth) cairo_paint (cr); cairo_surface_destroy (image); - if (width) *width = w; - if (height) *height = h; - if (depth) *depth = 32; + if (width) + *width = w; + if (height) + *height = h; + if (depth) + *depth = 32; return pixmap; } @@ -210,6 +212,11 @@ test_pixmap_main (int argc, char **argv) if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS) return 1; +#ifdef CLUTTER_WINDOWING_X11 + if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11)) + g_error ("test-pixmap requires the X11 Clutter backend."); +#endif + xdpy = clutter_x11_get_default_display (); XSynchronize (xdpy, True); @@ -308,13 +315,3 @@ test_pixmap_main (int argc, char **argv) return EXIT_SUCCESS; } - -#else - -int -test_pixmap_main (int argc, char **argv) -{ - return EXIT_SUCCESS; -}; - -#endif /* CLUTTER_WINDOWING_X11 */ diff --git a/tests/interactive/test-scale.c b/tests/interactive/test-scale.c index 23a63542d..506948ba5 100644 --- a/tests/interactive/test-scale.c +++ b/tests/interactive/test-scale.c @@ -1,7 +1,5 @@ #include #include - -#undef CLUTTER_DISABLE_DEPRECATED #include static const ClutterGravity gravities[] = { diff --git a/tests/interactive/test-script.c b/tests/interactive/test-script.c index e98019697..e30de3dcf 100644 --- a/tests/interactive/test-script.c +++ b/tests/interactive/test-script.c @@ -5,8 +5,6 @@ #include #include - -#undef CLUTTER_DISABLE_DEPRECATED #include static ClutterScript *script = NULL; diff --git a/tests/interactive/test-texture-quality.c b/tests/interactive/test-texture-quality.c index eb0463036..fd765045a 100644 --- a/tests/interactive/test-texture-quality.c +++ b/tests/interactive/test-texture-quality.c @@ -1,7 +1,5 @@ #include #include - -#undef CLUTTER_DISABLE_DEPRECATED #include /* each time the timeline animating the label completes, swap the direction */ diff --git a/tests/interactive/test-threads.c b/tests/interactive/test-threads.c index 01ca8a766..16359f959 100644 --- a/tests/interactive/test-threads.c +++ b/tests/interactive/test-threads.c @@ -1,8 +1,6 @@ #include #include #include - -#undef CLUTTER_DISABLE_DEPRECATED #include /* our thread-specific data */ diff --git a/tests/micro-bench/Makefile.am b/tests/micro-bench/Makefile.am index 4824bb213..8739da6cc 100644 --- a/tests/micro-bench/Makefile.am +++ b/tests/micro-bench/Makefile.am @@ -1,6 +1,6 @@ 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 \ diff --git a/tests/performance/Makefile.am b/tests/performance/Makefile.am index 337cf66a8..14a4415e4 100644 --- a/tests/performance/Makefile.am +++ b/tests/performance/Makefile.am @@ -14,7 +14,7 @@ INCLUDES = \ -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