From 2f790b0165688161ec7ca3cf88d67587ea6b6e86 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 16 Oct 2008 12:50:01 +0100 Subject: [PATCH] This changes the meta_compositor_clutter namespacing to simply "mutter" which helps makes code much more readable. --- configure.in | 2 +- src/Makefile.am | 22 +- .../compositor-clutter-plugin-manager.h | 58 ---- src/compositor/clutter/shaped-texture.h | 96 ------ src/compositor/compositor.c | 4 +- .../compositor-mutter.c} | 323 +++++++++--------- .../mutter-plugin-manager.c} | 221 ++++++------ src/compositor/mutter/mutter-plugin-manager.h | 58 ++++ .../mutter-shaped-texture.c} | 194 +++++------ src/compositor/mutter/mutter-shaped-texture.h | 96 ++++++ .../plugins}/Makefile.am | 3 +- .../clutter-plugins => mutter/plugins}/README | 0 .../plugins}/default.c | 152 +++++---- .../plugins}/moblin.c | 173 +++++----- .../tidy}/tidy-texture-frame.c | 0 .../tidy}/tidy-texture-frame.h | 0 src/include/compositor-clutter.h | 73 ---- src/include/compositor-mutter.h | 73 ++++ ...sitor-clutter-plugin.h => mutter-plugin.h} | 56 +-- 19 files changed, 801 insertions(+), 803 deletions(-) delete mode 100644 src/compositor/clutter/compositor-clutter-plugin-manager.h delete mode 100644 src/compositor/clutter/shaped-texture.h rename src/compositor/{clutter/compositor-clutter.c => mutter/compositor-mutter.c} (87%) rename src/compositor/{clutter/compositor-clutter-plugin-manager.c => mutter/mutter-plugin-manager.c} (67%) create mode 100644 src/compositor/mutter/mutter-plugin-manager.h rename src/compositor/{clutter/shaped-texture.c => mutter/mutter-shaped-texture.c} (69%) create mode 100644 src/compositor/mutter/mutter-shaped-texture.h rename src/compositor/{clutter/clutter-plugins => mutter/plugins}/Makefile.am (99%) rename src/compositor/{clutter/clutter-plugins => mutter/plugins}/README (100%) rename src/compositor/{clutter/clutter-plugins => mutter/plugins}/default.c (81%) rename src/compositor/{clutter/clutter-plugins => mutter/plugins}/moblin.c (80%) rename src/compositor/{clutter => mutter/tidy}/tidy-texture-frame.c (100%) rename src/compositor/{clutter => mutter/tidy}/tidy-texture-frame.h (100%) delete mode 100644 src/include/compositor-clutter.h create mode 100644 src/include/compositor-mutter.h rename src/include/{compositor-clutter-plugin.h => mutter-plugin.h} (78%) diff --git a/configure.in b/configure.in index cfa3126a8..f04eba8f6 100644 --- a/configure.in +++ b/configure.in @@ -535,7 +535,7 @@ src/wm-tester/Makefile src/libmetacity-private.pc src/tools/Makefile src/themes/Makefile -src/compositor/clutter/clutter-plugins/Makefile +src/compositor/mutter/plugins/Makefile po/Makefile.in ]) diff --git a/src/Makefile.am b/src/Makefile.am index 227a7abbe..61632df5f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,7 +3,7 @@ lib_LTLIBRARIES = libmetacity-private.la SUBDIRS=wm-tester tools themes if WITH_CLUTTER -SUBDIRS += compositor/clutter/clutter-plugins +SUBDIRS += compositor/mutter/plugins endif INCLUDES=@METACITY_CFLAGS@ -I $(srcdir)/include -I$(srcdir)/compositor -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1 -DMETACITY_MAJOR_VERSION=$(METACITY_MAJOR_VERSION) -DMETACITY_MINOR_VERSION=$(METACITY_MINOR_VERSION) -DMETACITY_MICRO_VERSION=$(METACITY_MICRO_VERSION) -DMETACITY_CLUTTER_PLUGIN_API_VERSION=$(METACITY_CLUTTER_PLUGIN_API_VERSION) -DMETACITY_PKGLIBDIR=\"$(pkglibdir)\" @@ -103,16 +103,16 @@ metacity_SOURCES= \ ui/ui.c if WITH_CLUTTER -metacity_SOURCES += \ - compositor/clutter/compositor-clutter.c \ - compositor/clutter/compositor-clutter.h \ - compositor/clutter/tidy-texture-frame.c \ - compositor/clutter/tidy-texture-frame.h \ - compositor/clutter/shaped-texture.c \ - compositor/clutter/shaped-texture.h \ - include/compositor-clutter-plugin.h \ - compositor/clutter/compositor-clutter-plugin-manager.c \ - compositor/clutter/compositor-clutter-plugin-manager.h +metacity_SOURCES += \ + compositor/mutter/compositor-mutter.c \ + compositor/mutter/compositor-mutter.h \ + compositor/mutter/mutter-shaped-texture.c \ + compositor/mutter/mutter-shaped-texture.h \ + compositor/mutter/mutter-plugin-manager.c \ + compositor/mutter/mutter-plugin-manager.h \ + compositor/mutter/tidy/tidy-texture-frame.c \ + compositor/mutter/tidy/tidy-texture-frame.h \ + include/mutter-plugin.h endif # by setting libmetacity_private_la_CFLAGS, the files shared with diff --git a/src/compositor/clutter/compositor-clutter-plugin-manager.h b/src/compositor/clutter/compositor-clutter-plugin-manager.h deleted file mode 100644 index 6e75470ed..000000000 --- a/src/compositor/clutter/compositor-clutter-plugin-manager.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ - -/* - * Copyright (c) 2008 Intel Corp. - * - * Author: Tomas Frydrych - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef META_COMPOSITOR_CLUTTER_PLUGIN_MANAGER_H_ -#define META_COMPOSITOR_CLUTTER_PLUGIN_MANAGER_H_ - -#include "types.h" -#include "screen.h" -#include "compositor-clutter-plugin.h" - -typedef struct MetaCompositorClutterPluginManager MetaCompositorClutterPluginManager; - -MetaCompositorClutterPluginManager * meta_compositor_clutter_plugin_manager_new (MetaScreen *screen); -gboolean meta_compositor_clutter_plugin_manager_event_simple (MetaCompositorClutterPluginManager *mgr, - MetaCompWindow *actor, - unsigned long event); - -gboolean meta_compositor_clutter_plugin_manager_event_maximize (MetaCompositorClutterPluginManager *mgr, - MetaCompWindow *actor, - unsigned long event, - gint target_x, - gint target_y, - gint target_width, - gint target_height); -void meta_compositor_clutter_plugin_manager_update_workspaces (MetaCompositorClutterPluginManager *mgr); - -void meta_compositor_clutter_plugin_manager_update_workspace (MetaCompositorClutterPluginManager *mgr, MetaWorkspace *w); - -gboolean meta_compositor_clutter_plugin_manager_switch_workspace (MetaCompositorClutterPluginManager *mgr, - const GList **actors, - gint from, - gint to, - MetaMotionDirection direction); - -gboolean meta_compositor_clutter_plugin_manager_xevent_filter (MetaCompositorClutterPluginManager *mgr, - XEvent *xev); - -#endif diff --git a/src/compositor/clutter/shaped-texture.h b/src/compositor/clutter/shaped-texture.h deleted file mode 100644 index 188eedda6..000000000 --- a/src/compositor/clutter/shaped-texture.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * shaped texture - * - * An actor to draw a texture clipped to a list of rectangles - * - * Authored By Neil Roberts - * - * Copyright (C) 2008 Intel Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef __META_SHAPED_TEXTURE_H__ -#define __META_SHAPED_TEXTURE_H__ - -#include -#include -#ifdef HAVE_GLX_TEXTURE_PIXMAP -#include -#endif /* HAVE_GLX_TEXTURE_PIXMAP */ - -G_BEGIN_DECLS - -#define META_TYPE_SHAPED_TEXTURE \ - (meta_shaped_texture_get_type()) -#define META_SHAPED_TEXTURE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - META_TYPE_SHAPED_TEXTURE, \ - MetaShapedTexture)) -#define META_SHAPED_TEXTURE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - META_TYPE_SHAPED_TEXTURE, \ - MetaShapedTextureClass)) -#define META_IS_SHAPED_TEXTURE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - META_TYPE_SHAPED_TEXTURE)) -#define META_IS_SHAPED_TEXTURE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - META_TYPE_SHAPED_TEXTURE)) -#define META_SHAPED_TEXTURE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - META_TYPE_SHAPED_TEXTURE, \ - MetaShapedTextureClass)) - -typedef struct _MetaShapedTexture MetaShapedTexture; -typedef struct _MetaShapedTextureClass MetaShapedTextureClass; -typedef struct _MetaShapedTexturePrivate MetaShapedTexturePrivate; - -struct _MetaShapedTextureClass -{ -#ifdef HAVE_GLX_TEXTURE_PIXMAP - ClutterGLXTexturePixmapClass parent_class; -#else - ClutterX11TexturePixmapClass parent_class; -#endif -}; - -struct _MetaShapedTexture -{ -#ifdef HAVE_GLX_TEXTURE_PIXMAP - ClutterGLXTexturePixmap parent; -#else - ClutterX11TexturePixmap parent; -#endif - - MetaShapedTexturePrivate *priv; -}; - -GType meta_shaped_texture_get_type (void) G_GNUC_CONST; - -ClutterActor *meta_shaped_texture_new (void); - -void meta_shaped_texture_clear_rectangles (MetaShapedTexture *stex); - -void meta_shaped_texture_add_rectangle (MetaShapedTexture *stex, - const XRectangle *rect); -void meta_shaped_texture_add_rectangles (MetaShapedTexture *stex, - size_t num_rects, - const XRectangle *rects); - -G_END_DECLS - -#endif /* __META_SHAPED_TEXTURE_H__ */ diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 0c21d5e91..7dc48c66c 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -22,7 +22,7 @@ #include #include "compositor-private.h" #include "compositor-xrender.h" -#include "compositor-clutter.h" +#include "compositor-mutter.h" #include "prefs.h" #ifdef WITH_CLUTTER @@ -37,7 +37,7 @@ meta_compositor_new (MetaDisplay *display) /* At some point we would have a way to select between backends */ /* return meta_compositor_xrender_new (display); */ if (meta_compositor_can_use_clutter__ && !meta_prefs_get_clutter_disabled ()) - return meta_compositor_clutter_new (display); + return mutter_new (display); else #endif return meta_compositor_xrender_new (display); diff --git a/src/compositor/clutter/compositor-clutter.c b/src/compositor/mutter/compositor-mutter.c similarity index 87% rename from src/compositor/clutter/compositor-clutter.c rename to src/compositor/mutter/compositor-mutter.c index 38f223c8d..960af110c 100644 --- a/src/compositor/clutter/compositor-clutter.c +++ b/src/compositor/mutter/compositor-mutter.c @@ -16,12 +16,11 @@ #include "errors.h" #include "window.h" #include "compositor-private.h" -#include "compositor-clutter.h" -#include "compositor-clutter-plugin-manager.h" -#include "tidy-texture-frame.h" +#include "compositor-mutter.h" +#include "mutter-plugin-manager.h" +#include "tidy/tidy-texture-frame.h" #include "xprops.h" -#include "shaped-texture.h" -#include "tidy-texture-frame.h" +#include "mutter-shaped-texture.h" #include #include #include @@ -49,7 +48,7 @@ /* * Register GType wrapper for XWindowAttributes, so we do not have to - * query window attributes in the MetaCompWindow constructor but can pass + * query window attributes in the MutterWindow constructor but can pass * them as a property to the constructor (so we can gracefully handle the case * where no attributes can be retrieved). * @@ -109,7 +108,7 @@ composite_at_least_version (MetaDisplay *display, int maj, int min) } #endif -typedef struct _MetaCompositorClutter +typedef struct _Mutter { MetaCompositor compositor; MetaDisplay *display; @@ -122,7 +121,7 @@ typedef struct _MetaCompositorClutter gboolean show_redraw : 1; gboolean debug : 1; -} MetaCompositorClutter; +} Mutter; typedef struct _MetaCompScreen { @@ -137,13 +136,13 @@ typedef struct _MetaCompScreen gint switch_workspace_in_progress; - MetaCompositorClutterPluginManager *plugin_mgr; + MutterPluginManager *plugin_mgr; } MetaCompScreen; /* - * MetaCompWindow implementation + * MutterWindow implementation */ -struct _MetaCompWindowPrivate +struct _MutterWindowPrivate { XWindowAttributes attrs; @@ -155,7 +154,7 @@ struct _MetaCompWindowPrivate ClutterActor *shadow; Pixmap back_pixmap; - MetaCompWindowType type; + MetaCompWindowType type; Damage damage; guint8 opacity; @@ -192,37 +191,37 @@ enum PROP_MCW_X_WINDOW_ATTRIBUTES }; -static void meta_comp_window_class_init (MetaCompWindowClass *klass); -static void meta_comp_window_init (MetaCompWindow *self); -static void meta_comp_window_dispose (GObject *object); -static void meta_comp_window_finalize (GObject *object); -static void meta_comp_window_constructed (GObject *object); -static void meta_comp_window_set_property (GObject *object, +static void mutter_window_class_init (MutterWindowClass *klass); +static void mutter_window_init (MutterWindow *self); +static void mutter_window_dispose (GObject *object); +static void mutter_window_finalize (GObject *object); +static void mutter_window_constructed (GObject *object); +static void mutter_window_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void meta_comp_window_get_property (GObject *object, +static void mutter_window_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void meta_comp_window_query_window_type (MetaCompWindow *self); -static void meta_comp_window_detach (MetaCompWindow *self); +static void mutter_window_query_window_type (MutterWindow *self); +static void mutter_window_detach (MutterWindow *self); -G_DEFINE_TYPE (MetaCompWindow, meta_comp_window, CLUTTER_TYPE_GROUP); +G_DEFINE_TYPE (MutterWindow, mutter_window, CLUTTER_TYPE_GROUP); static void -meta_comp_window_class_init (MetaCompWindowClass *klass) +mutter_window_class_init (MutterWindowClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *pspec; - g_type_class_add_private (klass, sizeof (MetaCompWindowPrivate)); + g_type_class_add_private (klass, sizeof (MutterWindowPrivate)); - object_class->dispose = meta_comp_window_dispose; - object_class->finalize = meta_comp_window_finalize; - object_class->set_property = meta_comp_window_set_property; - object_class->get_property = meta_comp_window_get_property; - object_class->constructed = meta_comp_window_constructed; + object_class->dispose = mutter_window_dispose; + object_class->finalize = mutter_window_finalize; + object_class->set_property = mutter_window_set_property; + object_class->get_property = mutter_window_get_property; + object_class->constructed = mutter_window_constructed; pspec = g_param_spec_pointer ("meta-window", "MetaWindow", @@ -266,33 +265,33 @@ meta_comp_window_class_init (MetaCompWindowClass *klass) } static void -meta_comp_window_init (MetaCompWindow *self) +mutter_window_init (MutterWindow *self) { - MetaCompWindowPrivate *priv; + MutterWindowPrivate *priv; priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - META_TYPE_COMP_WINDOW, - MetaCompWindowPrivate); + MUTTER_TYPE_COMP_WINDOW, + MutterWindowPrivate); priv->opacity = 0xff; } static gboolean is_shaped (MetaDisplay *display, Window xwindow); -static gboolean meta_comp_window_has_shadow (MetaCompWindow *self); -static void update_shape (MetaCompositorClutter *compositor, - MetaCompWindow *cw); +static gboolean mutter_window_has_shadow (MutterWindow *self); +static void update_shape (Mutter *compositor, + MutterWindow *cw); static void -meta_comp_window_constructed (GObject *object) +mutter_window_constructed (GObject *object) { - MetaCompWindow *self = META_COMP_WINDOW (object); - MetaCompWindowPrivate *priv = self->priv; + MutterWindow *self = MUTTER_WINDOW (object); + MutterWindowPrivate *priv = self->priv; MetaScreen *screen = priv->screen; MetaDisplay *display = meta_screen_get_display (screen); Window xwindow = priv->xwindow; Display *xdisplay = meta_display_get_xdisplay (display); XRenderPictFormat *format; - meta_comp_window_query_window_type (self); + mutter_window_query_window_type (self); #ifdef HAVE_SHAPE /* Listen for ShapeNotify events on the window */ @@ -312,10 +311,10 @@ meta_comp_window_constructed (GObject *object) if (format && format->type == PictTypeDirect && format->direct.alphaMask) priv->argb32 = TRUE; - if (meta_comp_window_has_shadow (self)) + if (mutter_window_has_shadow (self)) { - MetaCompositorClutter *compositor = - (MetaCompositorClutter*)meta_display_get_compositor (display); + Mutter *compositor = + (Mutter*)meta_display_get_compositor (display); priv->shadow = tidy_texture_frame_new (CLUTTER_TEXTURE (compositor->shadow_src), @@ -329,19 +328,19 @@ meta_comp_window_constructed (GObject *object) clutter_container_add_actor (CLUTTER_CONTAINER (self), priv->shadow); } - priv->actor = meta_shaped_texture_new (); + priv->actor = mutter_shaped_texture_new (); clutter_container_add_actor (CLUTTER_CONTAINER (self), priv->actor); - update_shape ((MetaCompositorClutter *) + update_shape ((Mutter *) meta_display_get_compositor (display), self); } static void -meta_comp_window_dispose (GObject *object) +mutter_window_dispose (GObject *object) { - MetaCompWindow *self = META_COMP_WINDOW (object); - MetaCompWindowPrivate *priv = self->priv; + MutterWindow *self = MUTTER_WINDOW (object); + MutterWindowPrivate *priv = self->priv; MetaScreen *screen; MetaDisplay *display; Display *xdisplay; @@ -357,7 +356,7 @@ meta_comp_window_dispose (GObject *object) xdisplay = meta_display_get_xdisplay (display); info = meta_screen_get_compositor_data (screen); - meta_comp_window_detach (self); + mutter_window_detach (self); if (priv->damage != None) { @@ -377,22 +376,22 @@ meta_comp_window_dispose (GObject *object) info->windows = g_list_remove (info->windows, (gconstpointer) self); g_hash_table_remove (info->windows_by_xid, (gpointer) priv->xwindow); - G_OBJECT_CLASS (meta_comp_window_parent_class)->dispose (object); + G_OBJECT_CLASS (mutter_window_parent_class)->dispose (object); } static void -meta_comp_window_finalize (GObject *object) +mutter_window_finalize (GObject *object) { - G_OBJECT_CLASS (meta_comp_window_parent_class)->finalize (object); + G_OBJECT_CLASS (mutter_window_parent_class)->finalize (object); } static void -meta_comp_window_set_property (GObject *object, +mutter_window_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - MetaCompWindowPrivate *priv = META_COMP_WINDOW (object)->priv; + MutterWindowPrivate *priv = MUTTER_WINDOW (object)->priv; switch (prop_id) { @@ -415,12 +414,12 @@ meta_comp_window_set_property (GObject *object, } static void -meta_comp_window_get_property (GObject *object, +mutter_window_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - MetaCompWindowPrivate *priv = META_COMP_WINDOW (object)->priv; + MutterWindowPrivate *priv = MUTTER_WINDOW (object)->priv; switch (prop_id) { @@ -442,7 +441,7 @@ meta_comp_window_get_property (GObject *object, } } -static MetaCompWindow* +static MutterWindow* find_window_for_screen (MetaScreen *screen, Window xwindow) { MetaCompScreen *info = meta_screen_get_compositor_data (screen); @@ -453,7 +452,7 @@ find_window_for_screen (MetaScreen *screen, Window xwindow) return g_hash_table_lookup (info->windows_by_xid, (gpointer) xwindow); } -static MetaCompWindow * +static MutterWindow * find_window_in_display (MetaDisplay *display, Window xwindow) { GSList *index; @@ -462,7 +461,7 @@ find_window_in_display (MetaDisplay *display, Window xwindow) index; index = index->next) { - MetaCompWindow *cw = find_window_for_screen (index->data, xwindow); + MutterWindow *cw = find_window_for_screen (index->data, xwindow); if (cw != NULL) return cw; @@ -471,7 +470,7 @@ find_window_in_display (MetaDisplay *display, Window xwindow) return NULL; } -static MetaCompWindow * +static MutterWindow * find_window_for_child_window_in_display (MetaDisplay *display, Window xwindow) { Window ignored1, *ignored2, parent; @@ -487,9 +486,9 @@ find_window_for_child_window_in_display (MetaDisplay *display, Window xwindow) } static void -meta_comp_window_query_window_type (MetaCompWindow *self) +mutter_window_query_window_type (MutterWindow *self) { - MetaCompWindowPrivate *priv = self->priv; + MutterWindowPrivate *priv = self->priv; MetaScreen *screen = priv->screen; MetaDisplay *display = meta_screen_get_display (screen); Window xwindow = priv->xwindow; @@ -596,9 +595,9 @@ is_shaped (MetaDisplay *display, Window xwindow) } static gboolean -meta_comp_window_has_shadow (MetaCompWindow *self) +mutter_window_has_shadow (MutterWindow *self) { - MetaCompWindowPrivate * priv = self->priv; + MutterWindowPrivate * priv = self->priv; /* * Do not add shadows to ARGB windows (since they are probably transparent) @@ -683,7 +682,7 @@ meta_comp_window_has_shadow (MetaCompWindow *self) } Window -meta_comp_window_get_x_window (MetaCompWindow *mcw) +mutter_window_get_x_window (MutterWindow *mcw) { if (!mcw) return None; @@ -692,7 +691,7 @@ meta_comp_window_get_x_window (MetaCompWindow *mcw) } MetaCompWindowType -meta_comp_window_get_window_type (MetaCompWindow *mcw) +mutter_window_get_window_type (MutterWindow *mcw) { if (!mcw) return 0; @@ -701,9 +700,9 @@ meta_comp_window_get_window_type (MetaCompWindow *mcw) } gint -meta_comp_window_get_workspace (MetaCompWindow *mcw) +mutter_window_get_workspace (MutterWindow *mcw) { - MetaCompWindowPrivate *priv; + MutterWindowPrivate *priv; MetaWorkspace *workspace; if (!mcw) @@ -719,20 +718,20 @@ meta_comp_window_get_workspace (MetaCompWindow *mcw) return meta_workspace_index (workspace); } -static void repair_win (MetaCompWindow *cw); -static void map_win (MetaCompWindow *cw); -static void unmap_win (MetaCompWindow *cw); +static void repair_win (MutterWindow *cw); +static void map_win (MutterWindow *cw); +static void unmap_win (MutterWindow *cw); static void -meta_compositor_clutter_finish_workspace_switch (MetaCompScreen *info) +mutter_finish_workspace_switch (MetaCompScreen *info) { GList *last = g_list_last (info->windows); GList *l = last; while (l) { - MetaCompWindow *cw = l->data; - MetaCompWindowPrivate *priv = cw->priv; + MutterWindow *cw = l->data; + MutterWindowPrivate *priv = cw->priv; if (priv->needs_map && !priv->needs_unmap) { @@ -773,17 +772,17 @@ meta_compositor_clutter_finish_workspace_switch (MetaCompScreen *info) } void -meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw, +mutter_window_effect_completed (MutterWindow *cw, gulong event) { - MetaCompWindowPrivate *priv = cw->priv; + MutterWindowPrivate *priv = cw->priv; MetaScreen *screen = priv->screen; MetaCompScreen *info = meta_screen_get_compositor_data (screen); ClutterActor *actor = CLUTTER_ACTOR (cw); switch (event) { - case META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE: + case MUTTER_PLUGIN_MINIMIZE: { ClutterActor *a = CLUTTER_ACTOR (cw); gint height = clutter_actor_get_height (a); @@ -802,7 +801,7 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw, } } break; - case META_COMPOSITOR_CLUTTER_PLUGIN_MAP: + case MUTTER_PLUGIN_MAP: /* * Make sure that the actor is at the correct place in case * the plugin fscked. @@ -823,7 +822,7 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw, clutter_actor_show_all (actor); } break; - case META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY: + case MUTTER_PLUGIN_DESTROY: priv->destroy_in_progress--; if (priv->destroy_in_progress < 0) @@ -837,7 +836,7 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw, clutter_actor_destroy (actor); } break; - case META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE: + case MUTTER_PLUGIN_UNMAXIMIZE: priv->unmaximize_in_progress--; if (priv->unmaximize_in_progress < 0) { @@ -848,11 +847,11 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw, if (!priv->unmaximize_in_progress) { clutter_actor_set_position (actor, priv->attrs.x, priv->attrs.y); - meta_comp_window_detach (cw); + mutter_window_detach (cw); repair_win (cw); } break; - case META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE: + case MUTTER_PLUGIN_MAXIMIZE: priv->maximize_in_progress--; if (priv->maximize_in_progress < 0) { @@ -863,11 +862,11 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw, if (!priv->maximize_in_progress) { clutter_actor_set_position (actor, priv->attrs.x, priv->attrs.y); - meta_comp_window_detach (cw); + mutter_window_detach (cw); repair_win (cw); } break; - case META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE: + case MUTTER_PLUGIN_SWITCH_WORKSPACE: /* FIXME -- must redo stacking order */ info->switch_workspace_in_progress--; if (info->switch_workspace_in_progress < 0) @@ -877,7 +876,7 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw, } if (!info->switch_workspace_in_progress) - meta_compositor_clutter_finish_workspace_switch (info); + mutter_finish_workspace_switch (info); break; default: ; } @@ -897,9 +896,9 @@ clutter_cmp_destroy (MetaCompositor *compositor) * backing pixmap has actually changed. */ static void -meta_comp_window_detach (MetaCompWindow *self) +mutter_window_detach (MutterWindow *self) { - MetaCompWindowPrivate *priv = self->priv; + MutterWindowPrivate *priv = self->priv; MetaScreen *screen = priv->screen; MetaDisplay *display = meta_screen_get_display (screen); Display *xdisplay = meta_display_get_xdisplay (display); @@ -914,7 +913,7 @@ meta_comp_window_detach (MetaCompWindow *self) static void destroy_win (MetaDisplay *display, Window xwindow) { - MetaCompWindow *cw; + MutterWindow *cw; cw = find_window_in_display (display, xwindow); @@ -925,9 +924,9 @@ destroy_win (MetaDisplay *display, Window xwindow) } static void -restack_win (MetaCompWindow *cw, Window above) +restack_win (MutterWindow *cw, Window above) { - MetaCompWindowPrivate *priv = cw->priv; + MutterWindowPrivate *priv = cw->priv; MetaScreen *screen = priv->screen; MetaCompScreen *info = meta_screen_get_compositor_data (screen); Window previous_above; @@ -939,7 +938,7 @@ restack_win (MetaCompWindow *cw, Window above) if (next) { - MetaCompWindow *ncw = next->data; + MutterWindow *ncw = next->data; previous_above = ncw->priv->xwindow; } @@ -961,7 +960,7 @@ restack_win (MetaCompWindow *cw, Window above) for (index = info->windows; index; index = index->next) { - MetaCompWindow *cw2 = (MetaCompWindow *) index->data; + MutterWindow *cw2 = (MutterWindow *) index->data; if (cw2->priv->xwindow == above) break; } @@ -980,7 +979,7 @@ restack_win (MetaCompWindow *cw, Window above) } static void -resize_win (MetaCompWindow *cw, +resize_win (MutterWindow *cw, int x, int y, int width, @@ -988,10 +987,10 @@ resize_win (MetaCompWindow *cw, int border_width, gboolean override_redirect) { - MetaCompWindowPrivate *priv = cw->priv; + MutterWindowPrivate *priv = cw->priv; if (priv->attrs.width != width || priv->attrs.height != height) - meta_comp_window_detach (cw); + mutter_window_detach (cw); priv->attrs.width = width; priv->attrs.height = height; @@ -1009,9 +1008,9 @@ resize_win (MetaCompWindow *cw, } static void -map_win (MetaCompWindow *cw) +map_win (MutterWindow *cw) { - MetaCompWindowPrivate *priv; + MutterWindowPrivate *priv; MetaCompScreen *info; if (cw == NULL) @@ -1030,7 +1029,7 @@ map_win (MetaCompWindow *cw) * before we run any effects on it. */ priv->needs_map = FALSE; - meta_comp_window_detach (cw); + mutter_window_detach (cw); repair_win (cw); /* @@ -1051,9 +1050,9 @@ map_win (MetaCompWindow *cw) * type is present, destroy the actor. */ if (info->switch_workspace_in_progress || !info->plugin_mgr || - !meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr, + !mutter_plugin_manager_event_simple (info->plugin_mgr, cw, - META_COMPOSITOR_CLUTTER_PLUGIN_MAP)) + MUTTER_PLUGIN_MAP)) { clutter_actor_show_all (CLUTTER_ACTOR (cw)); priv->map_in_progress--; @@ -1062,9 +1061,9 @@ map_win (MetaCompWindow *cw) } static void -unmap_win (MetaCompWindow *cw) +unmap_win (MutterWindow *cw) { - MetaCompWindowPrivate *priv; + MutterWindowPrivate *priv; MetaCompScreen *info; if (cw == NULL) @@ -1111,8 +1110,8 @@ add_win (MetaScreen *screen, MetaWindow *window, Window xwindow) { MetaDisplay *display = meta_screen_get_display (screen); MetaCompScreen *info = meta_screen_get_compositor_data (screen); - MetaCompWindow *cw; - MetaCompWindowPrivate *priv; + MutterWindow *cw; + MutterWindowPrivate *priv; Display *xdisplay = meta_display_get_xdisplay (display); XWindowAttributes attrs; @@ -1139,7 +1138,7 @@ add_win (MetaScreen *screen, MetaWindow *window, Window xwindow) meta_verbose ("add window: Meta %p, xwin 0x%x\n", window, (guint) xwindow); - cw = g_object_new (META_TYPE_COMP_WINDOW, + cw = g_object_new (MUTTER_TYPE_COMP_WINDOW, "meta-window", window, "x-window", xwindow, "meta-screen", screen, @@ -1206,9 +1205,9 @@ add_win (MetaScreen *screen, MetaWindow *window, Window xwindow) } static void -repair_win (MetaCompWindow *cw) +repair_win (MutterWindow *cw) { - MetaCompWindowPrivate *priv = cw->priv; + MutterWindowPrivate *priv = cw->priv; MetaScreen *screen = priv->screen; MetaDisplay *display = meta_screen_get_display (screen); Display *xdisplay = meta_display_get_xdisplay (display); @@ -1331,7 +1330,7 @@ repair_win (MetaCompWindow *cw) static void -process_create (MetaCompositorClutter *compositor, +process_create (Mutter *compositor, XCreateWindowEvent *event, MetaWindow *window) { @@ -1351,7 +1350,7 @@ process_create (MetaCompositorClutter *compositor, } static void -process_reparent (MetaCompositorClutter *compositor, +process_reparent (Mutter *compositor, XReparentEvent *event, MetaWindow *window) { @@ -1374,21 +1373,21 @@ process_reparent (MetaCompositorClutter *compositor, } static void -process_destroy (MetaCompositorClutter *compositor, +process_destroy (Mutter *compositor, XDestroyWindowEvent *event) { destroy_win (compositor->display, event->window); } static void -process_damage (MetaCompositorClutter *compositor, +process_damage (Mutter *compositor, XDamageNotifyEvent *event) { XEvent next; Display *dpy = event->display; Drawable drawable = event->drawable; - MetaCompWindowPrivate *priv; - MetaCompWindow *cw = find_window_in_display (compositor->display, drawable); + MutterWindowPrivate *priv; + MutterWindow *cw = find_window_in_display (compositor->display, drawable); if (!cw) return; @@ -1420,12 +1419,12 @@ process_damage (MetaCompositorClutter *compositor, } static void -update_shape (MetaCompositorClutter *compositor, - MetaCompWindow *cw) +update_shape (Mutter *compositor, + MutterWindow *cw) { - MetaCompWindowPrivate *priv = cw->priv; + MutterWindowPrivate *priv = cw->priv; - meta_shaped_texture_clear_rectangles (META_SHAPED_TEXTURE (priv->actor)); + mutter_shaped_texture_clear_rectangles (MUTTER_SHAPED_TEXTURE (priv->actor)); #ifdef HAVE_SHAPE if (priv->shaped) @@ -1442,7 +1441,7 @@ update_shape (MetaCompositorClutter *compositor, if (rects) { - meta_shaped_texture_add_rectangles (META_SHAPED_TEXTURE (priv->actor), + mutter_shaped_texture_add_rectangles (MUTTER_SHAPED_TEXTURE (priv->actor), n_rects, rects); XFree (rects); @@ -1453,12 +1452,12 @@ update_shape (MetaCompositorClutter *compositor, #ifdef HAVE_SHAPE static void -process_shape (MetaCompositorClutter *compositor, +process_shape (Mutter *compositor, XShapeEvent *event) { - MetaCompWindow *cw = find_window_in_display (compositor->display, + MutterWindow *cw = find_window_in_display (compositor->display, event->window); - MetaCompWindowPrivate *priv = cw->priv; + MutterWindowPrivate *priv = cw->priv; if (cw == NULL) return; @@ -1472,11 +1471,11 @@ process_shape (MetaCompositorClutter *compositor, #endif static void -process_configure_notify (MetaCompositorClutter *compositor, +process_configure_notify (Mutter *compositor, XConfigureEvent *event) { MetaDisplay *display = compositor->display; - MetaCompWindow *cw = find_window_in_display (display, event->window); + MutterWindow *cw = find_window_in_display (display, event->window); if (cw) { @@ -1518,15 +1517,15 @@ process_configure_notify (MetaCompositorClutter *compositor, } static void -process_circulate_notify (MetaCompositorClutter *compositor, +process_circulate_notify (Mutter *compositor, XCirculateEvent *event) { - MetaCompWindow *cw = find_window_in_display (compositor->display, + MutterWindow *cw = find_window_in_display (compositor->display, event->window); - MetaCompWindow *top; + MutterWindow *top; MetaCompScreen *info; Window above; - MetaCompWindowPrivate *priv; + MutterWindowPrivate *priv; if (!cw) return; @@ -1545,10 +1544,10 @@ process_circulate_notify (MetaCompositorClutter *compositor, } static void -process_unmap (MetaCompositorClutter *compositor, +process_unmap (Mutter *compositor, XUnmapEvent *event) { - MetaCompWindow *cw; + MutterWindow *cw; Window xwin = event->window; Display *dpy = event->display; @@ -1563,7 +1562,7 @@ process_unmap (MetaCompositorClutter *compositor, if (cw) { XEvent next; - MetaCompWindowPrivate *priv = cw->priv; + MutterWindowPrivate *priv = cw->priv; if (priv->attrs.map_state == IsUnmapped || priv->destroy_pending) return; @@ -1581,11 +1580,11 @@ process_unmap (MetaCompositorClutter *compositor, } static void -process_map (MetaCompositorClutter *compositor, +process_map (Mutter *compositor, XMapEvent *event, MetaWindow *window) { - MetaCompWindow *cw = find_window_in_display (compositor->display, + MutterWindow *cw = find_window_in_display (compositor->display, event->window); if (cw) @@ -1593,7 +1592,7 @@ process_map (MetaCompositorClutter *compositor, } static void -process_property_notify (MetaCompositorClutter *compositor, +process_property_notify (Mutter *compositor, XPropertyEvent *event) { MetaDisplay *display = compositor->display; @@ -1601,7 +1600,7 @@ process_property_notify (MetaCompositorClutter *compositor, /* Check for the opacity changing */ if (event->atom == compositor->atom_net_wm_window_opacity) { - MetaCompWindow *cw = find_window_in_display (display, event->window); + MutterWindow *cw = find_window_in_display (display, event->window); gulong value; if (!cw) @@ -1633,12 +1632,12 @@ process_property_notify (MetaCompositorClutter *compositor, else if (event->atom == meta_display_get_atom (display, META_ATOM__NET_WM_WINDOW_TYPE)) { - MetaCompWindow *cw = find_window_in_display (display, event->window); + MutterWindow *cw = find_window_in_display (display, event->window); if (!cw) return; - meta_comp_window_query_window_type (cw); + mutter_window_query_window_type (cw); return; } } @@ -1674,7 +1673,7 @@ get_output_window (MetaScreen *screen) } ClutterActor * -meta_compositor_clutter_get_stage_for_screen (MetaScreen *screen) +mutter_get_stage_for_screen (MetaScreen *screen) { MetaCompScreen *info = meta_screen_get_compositor_data (screen); @@ -1685,7 +1684,7 @@ meta_compositor_clutter_get_stage_for_screen (MetaScreen *screen) } ClutterActor * -meta_compositor_clutter_get_overlay_group_for_screen (MetaScreen *screen) +mutter_get_overlay_group_for_screen (MetaScreen *screen) { MetaCompScreen *info = meta_screen_get_compositor_data (screen); @@ -1768,7 +1767,7 @@ clutter_cmp_manage_screen (MetaCompositor *compositor, info->plugin_mgr = - meta_compositor_clutter_plugin_manager_new (screen); + mutter_plugin_manager_new (screen); clutter_actor_show_all (info->stage); clutter_actor_show_all (info->overlay_group); @@ -1794,7 +1793,7 @@ clutter_cmp_add_window (MetaCompositor *compositor, XWindowAttributes *attrs) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaCompositorClutter *xrc = (MetaCompositorClutter *) compositor; + Mutter *xrc = (Mutter *) compositor; MetaScreen *screen = meta_screen_for_x_screen (attrs->screen); meta_error_trap_push (xrc->display); @@ -1828,7 +1827,7 @@ clutter_cmp_process_event (MetaCompositor *compositor, MetaWindow *window) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaCompositorClutter *xrc = (MetaCompositorClutter *) compositor; + Mutter *xrc = (Mutter *) compositor; if (window) { @@ -1838,7 +1837,7 @@ clutter_cmp_process_event (MetaCompositor *compositor, screen = meta_window_get_screen (window); info = meta_screen_get_compositor_data (screen); - if (meta_compositor_clutter_plugin_manager_xevent_filter + if (mutter_plugin_manager_xevent_filter (info->plugin_mgr, event) == TRUE) return; @@ -1938,11 +1937,11 @@ clutter_cmp_destroy_window (MetaCompositor *compositor, MetaWindow *window) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaCompWindow *cw = NULL; + MutterWindow *cw = NULL; MetaScreen *screen = meta_window_get_screen (window); MetaCompScreen *info = meta_screen_get_compositor_data (screen); MetaFrame *f = meta_window_get_frame (window); - MetaCompWindowPrivate *priv; + MutterWindowPrivate *priv; /* Chances are we actually get the window frame here */ cw = find_window_for_screen (screen, @@ -1969,9 +1968,9 @@ clutter_cmp_destroy_window (MetaCompositor *compositor, priv->destroy_in_progress++; if (!info->plugin_mgr || - !meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr, + !mutter_plugin_manager_event_simple (info->plugin_mgr, cw, - META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY)) + MUTTER_PLUGIN_DESTROY)) { priv->destroy_in_progress--; clutter_actor_destroy (CLUTTER_ACTOR (cw)); @@ -1983,7 +1982,7 @@ static void clutter_cmp_minimize_window (MetaCompositor *compositor, MetaWindow *window) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaCompWindow *cw; + MutterWindow *cw; MetaCompScreen *info; MetaScreen *screen; MetaFrame *f = meta_window_get_frame (window); @@ -2005,9 +2004,9 @@ clutter_cmp_minimize_window (MetaCompositor *compositor, MetaWindow *window) cw->priv->minimize_in_progress++; if (!info->plugin_mgr || - !meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr, + !mutter_plugin_manager_event_simple (info->plugin_mgr, cw, - META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE)) + MUTTER_PLUGIN_MINIMIZE)) { ClutterActor *a = CLUTTER_ACTOR (cw); gint height = clutter_actor_get_height (a); @@ -2024,7 +2023,7 @@ clutter_cmp_maximize_window (MetaCompositor *compositor, MetaWindow *window, gint x, gint y, gint width, gint height) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaCompWindow *cw; + MutterWindow *cw; MetaCompScreen *info; MetaScreen *screen; MetaFrame *f = meta_window_get_frame (window); @@ -2042,9 +2041,9 @@ clutter_cmp_maximize_window (MetaCompositor *compositor, MetaWindow *window, cw->priv->maximize_in_progress++; if (!info->plugin_mgr || - !meta_compositor_clutter_plugin_manager_event_maximize (info->plugin_mgr, + !mutter_plugin_manager_event_maximize (info->plugin_mgr, cw, - META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE, + MUTTER_PLUGIN_MAXIMIZE, x, y, width, height)) { cw->priv->maximize_in_progress--; @@ -2057,7 +2056,7 @@ clutter_cmp_unmaximize_window (MetaCompositor *compositor, MetaWindow *window, gint x, gint y, gint width, gint height) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MetaCompWindow *cw; + MutterWindow *cw; MetaCompScreen *info; MetaScreen *screen; MetaFrame *f = meta_window_get_frame (window); @@ -2075,9 +2074,9 @@ clutter_cmp_unmaximize_window (MetaCompositor *compositor, MetaWindow *window, cw->priv->unmaximize_in_progress++; if (!info->plugin_mgr || - !meta_compositor_clutter_plugin_manager_event_maximize (info->plugin_mgr, + !mutter_plugin_manager_event_maximize (info->plugin_mgr, cw, - META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE, + MUTTER_PLUGIN_UNMAXIMIZE, x, y, width, height)) { cw->priv->unmaximize_in_progress--; @@ -2092,7 +2091,7 @@ clutter_cmp_update_workspace_geometry (MetaCompositor *compositor, #ifdef HAVE_COMPOSITE_EXTENSIONS MetaScreen *screen = meta_workspace_get_screen (workspace); MetaCompScreen *info; - MetaCompositorClutterPluginManager *mgr; + MutterPluginManager *mgr; info = meta_screen_get_compositor_data (screen); mgr = info->plugin_mgr; @@ -2100,7 +2099,7 @@ clutter_cmp_update_workspace_geometry (MetaCompositor *compositor, if (!mgr || !workspace) return; - meta_compositor_clutter_plugin_manager_update_workspace (mgr, workspace); + mutter_plugin_manager_update_workspace (mgr, workspace); #endif } @@ -2125,7 +2124,7 @@ clutter_cmp_switch_workspace (MetaCompositor *compositor, l = info->windows; while (l) { - MetaCompWindow *cw = l->data; + MutterWindow *cw = l->data; MetaWindow *mw = cw->priv->window; gboolean sticky; gint workspace = -1; @@ -2160,7 +2159,7 @@ clutter_cmp_switch_workspace (MetaCompositor *compositor, info->switch_workspace_in_progress++; if (!info->plugin_mgr || - !meta_compositor_clutter_plugin_manager_switch_workspace ( + !mutter_plugin_manager_switch_workspace ( info->plugin_mgr, (const GList **)&info->windows, from_indx, @@ -2192,7 +2191,7 @@ static MetaCompositor comp_info = { }; MetaCompositor * -meta_compositor_clutter_new (MetaDisplay *display) +mutter_new (MetaDisplay *display) { #ifdef HAVE_COMPOSITE_EXTENSIONS char *atom_names[] = { @@ -2201,7 +2200,7 @@ meta_compositor_clutter_new (MetaDisplay *display) "_NET_WM_WINDOW_OPACITY", }; Atom atoms[G_N_ELEMENTS(atom_names)]; - MetaCompositorClutter *clc; + Mutter *clc; MetaCompositor *compositor; Display *xdisplay = meta_display_get_xdisplay (display); guchar *data; @@ -2209,7 +2208,7 @@ meta_compositor_clutter_new (MetaDisplay *display) if (!composite_at_least_version (display, 0, 3)) return NULL; - clc = g_new0 (MetaCompositorClutter, 1); + clc = g_new0 (Mutter, 1); clc->compositor = comp_info; compositor = (MetaCompositor *) clc; diff --git a/src/compositor/clutter/compositor-clutter-plugin-manager.c b/src/compositor/mutter/mutter-plugin-manager.c similarity index 67% rename from src/compositor/clutter/compositor-clutter-plugin-manager.c rename to src/compositor/mutter/mutter-plugin-manager.c index 616797f2f..0d39c4d85 100644 --- a/src/compositor/clutter/compositor-clutter-plugin-manager.c +++ b/src/compositor/mutter/mutter-plugin-manager.c @@ -21,8 +21,7 @@ * 02111-1307, USA. */ -#include "compositor-clutter-plugin-manager.h" -#include "compositor-clutter.h" +#include "mutter-plugin-manager.h" #include "prefs.h" #include "errors.h" #include "workspace.h" @@ -30,10 +29,10 @@ #include #include -static gboolean meta_compositor_clutter_plugin_manager_reload ( - MetaCompositorClutterPluginManager *plugin_mgr); +static gboolean mutter_plugin_manager_reload ( + MutterPluginManager *plugin_mgr); -struct MetaCompositorClutterPluginManager +struct MutterPluginManager { MetaScreen *screen; @@ -43,19 +42,19 @@ struct MetaCompositorClutterPluginManager guint idle_unload_id; }; -typedef struct MetaCompositorClutterPluginPrivate +typedef struct MutterPluginPrivate { char *name; - MetaCompositorClutterPluginManager *self; + MutterPluginManager *self; GModule *module; gulong features; gboolean disabled : 1; -} MetaCompositorClutterPluginPrivate; +} MutterPluginPrivate; static void -free_plugin_workspaces (MetaCompositorClutterPlugin *plugin) +free_plugin_workspaces (MutterPlugin *plugin) { GList *l; @@ -81,7 +80,7 @@ free_plugin_workspaces (MetaCompositorClutterPlugin *plugin) */ static void update_plugin_workspaces (MetaScreen *screen, - MetaCompositorClutterPlugin *plugin) + MutterPlugin *plugin) { GList *l, *l2 = NULL; @@ -132,22 +131,22 @@ parse_disable_params (const char *params, gulong features) *p = 0; if (strstr (d, "minimize")) - features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE; + features &= ~ MUTTER_PLUGIN_MINIMIZE; if (strstr (d, "maximize")) - features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE; + features &= ~ MUTTER_PLUGIN_MAXIMIZE; if (strstr (d, "unmaximize")) - features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE; + features &= ~ MUTTER_PLUGIN_UNMAXIMIZE; if (strstr (d, "map")) - features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MAP; + features &= ~ MUTTER_PLUGIN_MAP; if (strstr (d, "destroy")) - features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY; + features &= ~ MUTTER_PLUGIN_DESTROY; if (strstr (d, "switch-workspace")) - features &= ~META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE; + features &= ~MUTTER_PLUGIN_SWITCH_WORKSPACE; g_free (d); } @@ -158,21 +157,21 @@ parse_disable_params (const char *params, gulong features) * Checks that the plugin is compatible with the WM and sets up the plugin * struct. */ -static MetaCompositorClutterPlugin * -meta_compositor_clutter_plugin_load ( - MetaCompositorClutterPluginManager *plugin_mgr, +static MutterPlugin * +mutter_plugin_load ( + MutterPluginManager *plugin_mgr, GModule *module, const gchar *params) { - MetaCompositorClutterPlugin *plugin; + MutterPlugin *plugin; - if (g_module_symbol (module, "metacity_plugin", (gpointer *)&plugin)) + if (g_module_symbol (module, "mutter_plugin", (gpointer *)&plugin)) { if (plugin->version_api == METACITY_CLUTTER_PLUGIN_API_VERSION) { - MetaCompositorClutterPluginPrivate *priv; + MutterPluginPrivate *priv; - priv = g_new0 (MetaCompositorClutterPluginPrivate, 1); + priv = g_new0 (MutterPluginPrivate, 1); priv->name = _(plugin->name); priv->module = module; priv->self = plugin_mgr; @@ -213,9 +212,9 @@ meta_compositor_clutter_plugin_load ( * removal later. */ static gboolean -meta_compositor_clutter_plugin_unload (MetaCompositorClutterPlugin *plugin) +mutter_plugin_unload (MutterPlugin *plugin) { - MetaCompositorClutterPluginPrivate *priv; + MutterPluginPrivate *priv; GModule *module; priv = plugin->manager_private; @@ -240,17 +239,17 @@ meta_compositor_clutter_plugin_unload (MetaCompositorClutterPlugin *plugin) * pending for removal. */ static gboolean -meta_compositor_clutter_plugin_manager_idle_unload ( - MetaCompositorClutterPluginManager *plugin_mgr) +mutter_plugin_manager_idle_unload ( + MutterPluginManager *plugin_mgr) { GList *l = plugin_mgr->unload; gboolean dont_remove = TRUE; while (l) { - MetaCompositorClutterPlugin *plugin = l->data; + MutterPlugin *plugin = l->data; - if (meta_compositor_clutter_plugin_unload (plugin)) + if (mutter_plugin_unload (plugin)) { /* Remove from list */ GList *p = l->prev; @@ -286,24 +285,24 @@ meta_compositor_clutter_plugin_manager_idle_unload ( * Unloads all plugins */ static void -meta_compositor_clutter_plugin_manager_unload ( - MetaCompositorClutterPluginManager *plugin_mgr) +mutter_plugin_manager_unload ( + MutterPluginManager *plugin_mgr) { GList *plugins = plugin_mgr->plugins; while (plugins) { - MetaCompositorClutterPlugin *plugin = plugins->data; + MutterPlugin *plugin = plugins->data; /* If the plugin could not be removed, move it to the unload list */ - if (!meta_compositor_clutter_plugin_unload (plugin)) + if (!mutter_plugin_unload (plugin)) { plugin_mgr->unload = g_list_prepend (plugin_mgr->unload, plugin); if (!plugin_mgr->idle_unload_id) { plugin_mgr->idle_unload_id = g_idle_add ((GSourceFunc) - meta_compositor_clutter_plugin_manager_idle_unload, + mutter_plugin_manager_idle_unload, plugin_mgr); } } @@ -319,15 +318,15 @@ static void prefs_changed_callback (MetaPreference pref, void *data) { - MetaCompositorClutterPluginManager *plugin_mgr = data; + MutterPluginManager *plugin_mgr = data; if (pref == META_PREF_CLUTTER_PLUGINS) { - meta_compositor_clutter_plugin_manager_reload (plugin_mgr); + mutter_plugin_manager_reload (plugin_mgr); } else if (pref == META_PREF_NUM_WORKSPACES) { - meta_compositor_clutter_plugin_manager_update_workspaces (plugin_mgr); + mutter_plugin_manager_update_workspaces (plugin_mgr); } } @@ -335,8 +334,7 @@ prefs_changed_callback (MetaPreference pref, * Loads all plugins listed in gconf registry. */ static gboolean -meta_compositor_clutter_plugin_manager_load ( - MetaCompositorClutterPluginManager *plugin_mgr) +mutter_plugin_manager_load (MutterPluginManager *plugin_mgr) { const gchar *dpath = METACITY_PKGLIBDIR "/plugins/clutter/"; GSList *plugins, *fallback = NULL; @@ -376,10 +374,9 @@ meta_compositor_clutter_plugin_manager_load ( if ((plugin = g_module_open (path, 0))) { - MetaCompositorClutterPlugin *p; + MutterPlugin *p; - if ((p = meta_compositor_clutter_plugin_load (plugin_mgr, - plugin, params))) + if ((p = mutter_plugin_load (plugin_mgr, plugin, params))) plugin_mgr->plugins = g_list_prepend (plugin_mgr->plugins, p); else { @@ -414,27 +411,27 @@ meta_compositor_clutter_plugin_manager_load ( * Reloads all plugins */ static gboolean -meta_compositor_clutter_plugin_manager_reload ( - MetaCompositorClutterPluginManager *plugin_mgr) +mutter_plugin_manager_reload ( + MutterPluginManager *plugin_mgr) { /* TODO -- brute force; should we build a list of plugins to load and list of * plugins to unload? We are probably not going to have large numbers of * plugins loaded at the same time, so it might not be worth it. */ - meta_compositor_clutter_plugin_manager_unload (plugin_mgr); - return meta_compositor_clutter_plugin_manager_load (plugin_mgr); + mutter_plugin_manager_unload (plugin_mgr); + return mutter_plugin_manager_load (plugin_mgr); } static gboolean -meta_compositor_clutter_plugin_manager_init ( - MetaCompositorClutterPluginManager *plugin_mgr) +mutter_plugin_manager_init ( + MutterPluginManager *plugin_mgr) { - return meta_compositor_clutter_plugin_manager_load (plugin_mgr); + return mutter_plugin_manager_load (plugin_mgr); } void -meta_compositor_clutter_plugin_manager_update_workspace ( - MetaCompositorClutterPluginManager *plugin_mgr, MetaWorkspace *workspace) +mutter_plugin_manager_update_workspace ( + MutterPluginManager *plugin_mgr, MetaWorkspace *workspace) { GList *l; gint index; @@ -444,7 +441,7 @@ meta_compositor_clutter_plugin_manager_update_workspace ( while (l) { - MetaCompositorClutterPlugin *plugin = l->data; + MutterPlugin *plugin = l->data; MetaRectangle *rect = g_list_nth_data (plugin->work_areas, index); if (rect) @@ -463,15 +460,15 @@ meta_compositor_clutter_plugin_manager_update_workspace ( } void -meta_compositor_clutter_plugin_manager_update_workspaces ( - MetaCompositorClutterPluginManager *plugin_mgr) +mutter_plugin_manager_update_workspaces ( + MutterPluginManager *plugin_mgr) { GList *l; l = plugin_mgr->plugins; while (l) { - MetaCompositorClutterPlugin *plugin = l->data; + MutterPlugin *plugin = l->data; update_plugin_workspaces (plugin_mgr->screen, plugin); @@ -479,16 +476,16 @@ meta_compositor_clutter_plugin_manager_update_workspaces ( } } -MetaCompositorClutterPluginManager * -meta_compositor_clutter_plugin_manager_new (MetaScreen *screen) +MutterPluginManager * +mutter_plugin_manager_new (MetaScreen *screen) { - MetaCompositorClutterPluginManager *plugin_mgr; + MutterPluginManager *plugin_mgr; - plugin_mgr = g_new0 (MetaCompositorClutterPluginManager, 1); + plugin_mgr = g_new0 (MutterPluginManager, 1); plugin_mgr->screen = screen; - if (!meta_compositor_clutter_plugin_manager_init (plugin_mgr)) + if (!mutter_plugin_manager_init (plugin_mgr)) { g_free (plugin_mgr); plugin_mgr = NULL; @@ -498,17 +495,17 @@ meta_compositor_clutter_plugin_manager_new (MetaScreen *screen) } static void -meta_compositor_clutter_plugin_manager_kill_effect ( - MetaCompositorClutterPluginManager *plugin_mgr, - MetaCompWindow *actor, +mutter_plugin_manager_kill_effect ( + MutterPluginManager *plugin_mgr, + MutterWindow *actor, unsigned long events) { GList *l = plugin_mgr->plugins; while (l) { - MetaCompositorClutterPlugin *plugin = l->data; - MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; + MutterPlugin *plugin = l->data; + MutterPluginPrivate *priv = plugin->manager_private; if (!priv->disabled && (plugin->features & events) @@ -520,8 +517,8 @@ meta_compositor_clutter_plugin_manager_kill_effect ( } #define ALL_BUT_SWITCH \ - META_COMPOSITOR_CLUTTER_PLUGIN_ALL_EFFECTS & \ - ~META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE + MUTTER_PLUGIN_ALL_EFFECTS & \ + ~MUTTER_PLUGIN_SWITCH_WORKSPACE /* * Public method that the compositor hooks into for events that require * no additional parameters. @@ -532,9 +529,9 @@ meta_compositor_clutter_plugin_manager_kill_effect ( * appropriate post-effect cleanup is carried out. */ gboolean -meta_compositor_clutter_plugin_manager_event_simple ( - MetaCompositorClutterPluginManager *plugin_mgr, - MetaCompWindow *actor, +mutter_plugin_manager_event_simple ( + MutterPluginManager *plugin_mgr, + MutterWindow *actor, unsigned long event) { GList *l = plugin_mgr->plugins; @@ -542,8 +539,8 @@ meta_compositor_clutter_plugin_manager_event_simple ( while (l) { - MetaCompositorClutterPlugin *plugin = l->data; - MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; + MutterPlugin *plugin = l->data; + MutterPluginPrivate *priv = plugin->manager_private; if (!priv->disabled && (plugin->features & event)) { @@ -551,10 +548,10 @@ meta_compositor_clutter_plugin_manager_event_simple ( switch (event) { - case META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE: + case MUTTER_PLUGIN_MINIMIZE: if (plugin->minimize) { - meta_compositor_clutter_plugin_manager_kill_effect ( + mutter_plugin_manager_kill_effect ( plugin_mgr, actor, ALL_BUT_SWITCH); @@ -562,10 +559,10 @@ meta_compositor_clutter_plugin_manager_event_simple ( plugin->minimize (actor); } break; - case META_COMPOSITOR_CLUTTER_PLUGIN_MAP: + case MUTTER_PLUGIN_MAP: if (plugin->map) { - meta_compositor_clutter_plugin_manager_kill_effect ( + mutter_plugin_manager_kill_effect ( plugin_mgr, actor, ALL_BUT_SWITCH); @@ -573,7 +570,7 @@ meta_compositor_clutter_plugin_manager_event_simple ( plugin->map (actor); } break; - case META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY: + case MUTTER_PLUGIN_DESTROY: if (plugin->destroy) { plugin->destroy (actor); @@ -600,9 +597,9 @@ meta_compositor_clutter_plugin_manager_event_simple ( * appropriate post-effect cleanup is carried out. */ gboolean -meta_compositor_clutter_plugin_manager_event_maximize ( - MetaCompositorClutterPluginManager *plugin_mgr, - MetaCompWindow *actor, +mutter_plugin_manager_event_maximize ( + MutterPluginManager *plugin_mgr, + MutterWindow *actor, unsigned long event, gint target_x, gint target_y, @@ -614,8 +611,8 @@ meta_compositor_clutter_plugin_manager_event_maximize ( while (l) { - MetaCompositorClutterPlugin *plugin = l->data; - MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; + MutterPlugin *plugin = l->data; + MutterPluginPrivate *priv = plugin->manager_private; if (!priv->disabled && (plugin->features & event)) { @@ -623,10 +620,10 @@ meta_compositor_clutter_plugin_manager_event_maximize ( switch (event) { - case META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE: + case MUTTER_PLUGIN_MAXIMIZE: if (plugin->maximize) { - meta_compositor_clutter_plugin_manager_kill_effect ( + mutter_plugin_manager_kill_effect ( plugin_mgr, actor, ALL_BUT_SWITCH); @@ -636,10 +633,10 @@ meta_compositor_clutter_plugin_manager_event_maximize ( target_width, target_height); } break; - case META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE: + case MUTTER_PLUGIN_UNMAXIMIZE: if (plugin->unmaximize) { - meta_compositor_clutter_plugin_manager_kill_effect ( + mutter_plugin_manager_kill_effect ( plugin_mgr, actor, ALL_BUT_SWITCH); @@ -668,8 +665,8 @@ meta_compositor_clutter_plugin_manager_event_maximize ( * appropriate post-effect cleanup is carried out. */ gboolean -meta_compositor_clutter_plugin_manager_switch_workspace ( - MetaCompositorClutterPluginManager *plugin_mgr, +mutter_plugin_manager_switch_workspace ( + MutterPluginManager *plugin_mgr, const GList **actors, gint from, gint to, @@ -680,20 +677,20 @@ meta_compositor_clutter_plugin_manager_switch_workspace ( while (l) { - MetaCompositorClutterPlugin *plugin = l->data; - MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; + MutterPlugin *plugin = l->data; + MutterPluginPrivate *priv = plugin->manager_private; if (!priv->disabled && - (plugin->features & META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE) && + (plugin->features & MUTTER_PLUGIN_SWITCH_WORKSPACE) && (actors && *actors)) { if (plugin->switch_workspace) { retval = TRUE; - meta_compositor_clutter_plugin_manager_kill_effect ( + mutter_plugin_manager_kill_effect ( plugin_mgr, - META_COMP_WINDOW ((*actors)->data), - META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); + MUTTER_WINDOW ((*actors)->data), + MUTTER_PLUGIN_SWITCH_WORKSPACE); plugin->switch_workspace (actors, from, to, direction); } @@ -714,8 +711,8 @@ meta_compositor_clutter_plugin_manager_switch_workspace ( * appropriate post-effect cleanup is carried out. */ gboolean -meta_compositor_clutter_plugin_manager_xevent_filter ( - MetaCompositorClutterPluginManager *plugin_mgr, XEvent *xev) +mutter_plugin_manager_xevent_filter ( + MutterPluginManager *plugin_mgr, XEvent *xev) { GList *l; @@ -726,7 +723,7 @@ meta_compositor_clutter_plugin_manager_xevent_filter ( while (l) { - MetaCompositorClutterPlugin *plugin = l->data; + MutterPlugin *plugin = l->data; if (plugin->xevent_filter) { @@ -741,29 +738,29 @@ meta_compositor_clutter_plugin_manager_xevent_filter ( } /* - * Public accessors for plugins, exposed from compositor-clutter-plugin.h + * Public accessors for plugins, exposed from mutter-plugin.h */ ClutterActor * -meta_comp_clutter_plugin_get_overlay_group (MetaCompositorClutterPlugin *plugin) +meta_comp_clutter_plugin_get_overlay_group (MutterPlugin *plugin) { - MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; - MetaCompositorClutterPluginManager *plugin_mgr = priv->self; + MutterPluginPrivate *priv = plugin->manager_private; + MutterPluginManager *plugin_mgr = priv->self; - return meta_compositor_clutter_get_overlay_group_for_screen (plugin_mgr->screen); + return mutter_get_overlay_group_for_screen (plugin_mgr->screen); } ClutterActor * -meta_comp_clutter_plugin_get_stage (MetaCompositorClutterPlugin *plugin) +meta_comp_clutter_plugin_get_stage (MutterPlugin *plugin) { - MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; - MetaCompositorClutterPluginManager *plugin_mgr = priv->self; + MutterPluginPrivate *priv = plugin->manager_private; + MutterPluginManager *plugin_mgr = priv->self; - return meta_compositor_clutter_get_stage_for_screen (plugin_mgr->screen); + return mutter_get_stage_for_screen (plugin_mgr->screen); } void -meta_comp_clutter_plugin_effect_completed (MetaCompositorClutterPlugin *plugin, - MetaCompWindow *actor, +meta_comp_clutter_plugin_effect_completed (MutterPlugin *plugin, + MutterWindow *actor, unsigned long event) { if (!actor) @@ -772,16 +769,16 @@ meta_comp_clutter_plugin_effect_completed (MetaCompositorClutterPlugin *plugin, (plugin && plugin->name) ? plugin->name : "unknown"); } - meta_compositor_clutter_window_effect_completed (actor, event); + mutter_window_effect_completed (actor, event); } void -meta_comp_clutter_plugin_query_screen_size (MetaCompositorClutterPlugin *plugin, +meta_comp_clutter_plugin_query_screen_size (MutterPlugin *plugin, int *width, int *height) { - MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; - MetaCompositorClutterPluginManager *plugin_mgr = priv->self; + MutterPluginPrivate *priv = plugin->manager_private; + MutterPluginManager *plugin_mgr = priv->self; meta_screen_get_size (plugin_mgr->screen, width, height); } diff --git a/src/compositor/mutter/mutter-plugin-manager.h b/src/compositor/mutter/mutter-plugin-manager.h new file mode 100644 index 000000000..d7bfe0684 --- /dev/null +++ b/src/compositor/mutter/mutter-plugin-manager.h @@ -0,0 +1,58 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* + * Copyright (c) 2008 Intel Corp. + * + * Author: Tomas Frydrych + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef MUTTER_PLUGIN_MANAGER_H_ +#define MUTTER_PLUGIN_MANAGER_H_ + +#include "types.h" +#include "screen.h" +#include "mutter-plugin.h" + +typedef struct MutterPluginManager MutterPluginManager; + +MutterPluginManager * mutter_plugin_manager_new (MetaScreen *screen); +gboolean mutter_plugin_manager_event_simple (MutterPluginManager *mgr, + MutterWindow *actor, + unsigned long event); + +gboolean mutter_plugin_manager_event_maximize (MutterPluginManager *mgr, + MutterWindow *actor, + unsigned long event, + gint target_x, + gint target_y, + gint target_width, + gint target_height); +void mutter_plugin_manager_update_workspaces (MutterPluginManager *mgr); + +void mutter_plugin_manager_update_workspace (MutterPluginManager *mgr, MetaWorkspace *w); + +gboolean mutter_plugin_manager_switch_workspace (MutterPluginManager *mgr, + const GList **actors, + gint from, + gint to, + MetaMotionDirection direction); + +gboolean mutter_plugin_manager_xevent_filter (MutterPluginManager *mgr, + XEvent *xev); + +#endif diff --git a/src/compositor/clutter/shaped-texture.c b/src/compositor/mutter/mutter-shaped-texture.c similarity index 69% rename from src/compositor/clutter/shaped-texture.c rename to src/compositor/mutter/mutter-shaped-texture.c index 8ca9aa866..19e850eba 100644 --- a/src/compositor/clutter/shaped-texture.c +++ b/src/compositor/mutter/mutter-shaped-texture.c @@ -33,28 +33,28 @@ #include #include -#include "shaped-texture.h" +#include "mutter-shaped-texture.h" -static void meta_shaped_texture_dispose (GObject *object); -static void meta_shaped_texture_finalize (GObject *object); +static void mutter_shaped_texture_dispose (GObject *object); +static void mutter_shaped_texture_finalize (GObject *object); -static void meta_shaped_texture_paint (ClutterActor *actor); -static void meta_shaped_texture_pick (ClutterActor *actor, - const ClutterColor *color); +static void mutter_shaped_texture_paint (ClutterActor *actor); +static void mutter_shaped_texture_pick (ClutterActor *actor, + const ClutterColor *color); -static void meta_shaped_texture_dirty_mask (MetaShapedTexture *stex); +static void mutter_shaped_texture_dirty_mask (MutterShapedTexture *stex); #ifdef HAVE_GLX_TEXTURE_PIXMAP -G_DEFINE_TYPE (MetaShapedTexture, meta_shaped_texture, +G_DEFINE_TYPE (MutterShapedTexture, mutter_shaped_texture, CLUTTER_GLX_TYPE_TEXTURE_PIXMAP); #else /* HAVE_GLX_TEXTURE_PIXMAP */ -G_DEFINE_TYPE (MetaShapedTexture, meta_shaped_texture, +G_DEFINE_TYPE (MutterShapedTexture, mutter_shaped_texture, CLUTTER_X11_TYPE_TEXTURE_PIXMAP); #endif /* HAVE_GLX_TEXTURE_PIXMAP */ -#define META_SHAPED_TEXTURE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_SHAPED_TEXTURE, \ - MetaShapedTexturePrivate)) +#define MUTTER_SHAPED_TEXTURE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MUTTER_TYPE_SHAPED_TEXTURE, \ + MutterShapedTexturePrivate)) enum TstMultiTexSupport { @@ -72,7 +72,7 @@ typedef void (* TstClientActiveTextureFunc) (GLenum texture); static TstActiveTextureFunc tst_active_texture; static TstClientActiveTextureFunc tst_client_active_texture; -struct _MetaShapedTexturePrivate +struct _MutterShapedTexturePrivate { CoglHandle mask_texture; @@ -84,26 +84,26 @@ struct _MetaShapedTexturePrivate }; static void -meta_shaped_texture_class_init (MetaShapedTextureClass *klass) +mutter_shaped_texture_class_init (MutterShapedTextureClass *klass) { GObjectClass *gobject_class = (GObjectClass *) klass; ClutterActorClass *actor_class = (ClutterActorClass *) klass; - gobject_class->dispose = meta_shaped_texture_dispose; - gobject_class->finalize = meta_shaped_texture_finalize; + gobject_class->dispose = mutter_shaped_texture_dispose; + gobject_class->finalize = mutter_shaped_texture_finalize; - actor_class->paint = meta_shaped_texture_paint; - actor_class->pick = meta_shaped_texture_pick; + actor_class->paint = mutter_shaped_texture_paint; + actor_class->pick = mutter_shaped_texture_pick; - g_type_class_add_private (klass, sizeof (MetaShapedTexturePrivate)); + g_type_class_add_private (klass, sizeof (MutterShapedTexturePrivate)); } static void -meta_shaped_texture_init (MetaShapedTexture *self) +mutter_shaped_texture_init (MutterShapedTexture *self) { - MetaShapedTexturePrivate *priv; + MutterShapedTexturePrivate *priv; - priv = self->priv = META_SHAPED_TEXTURE_GET_PRIVATE (self); + priv = self->priv = MUTTER_SHAPED_TEXTURE_GET_PRIVATE (self); priv->rectangles = g_array_new (FALSE, FALSE, sizeof (XRectangle)); @@ -111,30 +111,30 @@ meta_shaped_texture_init (MetaShapedTexture *self) } static void -meta_shaped_texture_dispose (GObject *object) +mutter_shaped_texture_dispose (GObject *object) { - MetaShapedTexture *self = (MetaShapedTexture *) object; + MutterShapedTexture *self = (MutterShapedTexture *) object; - meta_shaped_texture_dirty_mask (self); + mutter_shaped_texture_dirty_mask (self); - G_OBJECT_CLASS (meta_shaped_texture_parent_class)->dispose (object); + G_OBJECT_CLASS (mutter_shaped_texture_parent_class)->dispose (object); } static void -meta_shaped_texture_finalize (GObject *object) +mutter_shaped_texture_finalize (GObject *object) { - MetaShapedTexture *self = (MetaShapedTexture *) object; - MetaShapedTexturePrivate *priv = self->priv; + MutterShapedTexture *self = (MutterShapedTexture *) object; + MutterShapedTexturePrivate *priv = self->priv; g_array_free (priv->rectangles, TRUE); - G_OBJECT_CLASS (meta_shaped_texture_parent_class)->finalize (object); + G_OBJECT_CLASS (mutter_shaped_texture_parent_class)->finalize (object); } static void -meta_shaped_texture_dirty_mask (MetaShapedTexture *stex) +mutter_shaped_texture_dirty_mask (MutterShapedTexture *stex) { - MetaShapedTexturePrivate *priv = stex->priv; + MutterShapedTexturePrivate *priv = stex->priv; if (priv->mask_texture != COGL_INVALID_HANDLE) { @@ -144,7 +144,7 @@ meta_shaped_texture_dirty_mask (MetaShapedTexture *stex) } static gboolean -meta_shaped_texture_is_multi_tex_supported (void) +mutter_shaped_texture_is_multi_tex_supported (void) { const gchar *extensions; GLint max_tex_units = 0; @@ -179,9 +179,9 @@ meta_shaped_texture_is_multi_tex_supported (void) } static void -meta_shaped_texture_set_coord_array (GLfloat x1, GLfloat y1, - GLfloat x2, GLfloat y2, - GLfloat *coords) +mutter_shaped_texture_set_coord_array (GLfloat x1, GLfloat y1, + GLfloat x2, GLfloat y2, + GLfloat *coords) { coords[0] = x1; coords[1] = y2; @@ -194,9 +194,9 @@ meta_shaped_texture_set_coord_array (GLfloat x1, GLfloat y1, } static void -meta_shaped_texture_get_gl_size (CoglHandle tex, - guint *width, - guint *height) +mutter_shaped_texture_get_gl_size (CoglHandle tex, + guint *width, + guint *height) { /* glGetTexLevelParameteriv isn't supported on GL ES so we need to calculate the size that Cogl has used */ @@ -227,9 +227,9 @@ meta_shaped_texture_get_gl_size (CoglHandle tex, } static void -meta_shaped_texture_ensure_mask (MetaShapedTexture *stex) +mutter_shaped_texture_ensure_mask (MutterShapedTexture *stex) { - MetaShapedTexturePrivate *priv = stex->priv; + MutterShapedTexturePrivate *priv = stex->priv; CoglHandle paint_tex; guint tex_width, tex_height; GLuint mask_gl_tex; @@ -246,7 +246,7 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex) recreate it */ if (priv->mask_texture != COGL_INVALID_HANDLE && (priv->mask_width != tex_width || priv->mask_height != tex_height)) - meta_shaped_texture_dirty_mask (stex); + mutter_shaped_texture_dirty_mask (stex); /* If we don't have a mask texture yet then create one */ if (priv->mask_texture == COGL_INVALID_HANDLE) @@ -293,29 +293,29 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex) cogl_texture_get_gl_texture (priv->mask_texture, &mask_gl_tex, NULL); - meta_shaped_texture_get_gl_size (priv->mask_texture, - &priv->mask_gl_width, - &priv->mask_gl_height); + mutter_shaped_texture_get_gl_size (priv->mask_texture, + &priv->mask_gl_width, + &priv->mask_gl_height); if ((guint) priv->mask_gl_width == tex_width && (guint) priv->mask_gl_height == tex_height) - meta_shaped_texture_set_coord_array (0.0f, 0.0f, 1.0f, 1.0f, - priv->mask_tex_coords); + mutter_shaped_texture_set_coord_array (0.0f, 0.0f, 1.0f, 1.0f, + priv->mask_tex_coords); else - meta_shaped_texture_set_coord_array (0.0f, 0.0f, - tex_width - / (GLfloat) priv->mask_gl_width, - tex_height - / (GLfloat) priv->mask_gl_height, - priv->mask_tex_coords); + mutter_shaped_texture_set_coord_array (0.0f, 0.0f, + tex_width + / (GLfloat) priv->mask_gl_width, + tex_height + / (GLfloat) priv->mask_gl_height, + priv->mask_tex_coords); } } static void -meta_shaped_texture_paint (ClutterActor *actor) +mutter_shaped_texture_paint (ClutterActor *actor) { - MetaShapedTexture *stex = (MetaShapedTexture *) actor; - MetaShapedTexturePrivate *priv = stex->priv; + MutterShapedTexture *stex = (MutterShapedTexture *) actor; + MutterShapedTexturePrivate *priv = stex->priv; CoglHandle paint_tex; guint tex_width, tex_height; GLboolean texture_was_enabled, blend_was_enabled; @@ -330,9 +330,9 @@ meta_shaped_texture_paint (ClutterActor *actor) /* If there are no rectangles or multi-texturing isn't supported, fallback to the regular paint method */ if (priv->rectangles->len < 1 - || !meta_shaped_texture_is_multi_tex_supported ()) + || !mutter_shaped_texture_is_multi_tex_supported ()) { - CLUTTER_ACTOR_CLASS (meta_shaped_texture_parent_class) + CLUTTER_ACTOR_CLASS (mutter_shaped_texture_parent_class) ->paint (actor); return; } @@ -348,7 +348,7 @@ meta_shaped_texture_paint (ClutterActor *actor) /* If the texture is sliced then the multitexturing won't work */ if (cogl_texture_is_sliced (paint_tex)) { - CLUTTER_ACTOR_CLASS (meta_shaped_texture_parent_class) + CLUTTER_ACTOR_CLASS (mutter_shaped_texture_parent_class) ->paint (actor); return; } @@ -356,7 +356,7 @@ meta_shaped_texture_paint (ClutterActor *actor) tex_width = cogl_texture_get_width (paint_tex); tex_height = cogl_texture_get_height (paint_tex); - meta_shaped_texture_ensure_mask (stex); + mutter_shaped_texture_ensure_mask (stex); cogl_texture_get_gl_texture (paint_tex, &paint_gl_tex, NULL); cogl_texture_get_gl_texture (priv->mask_texture, &mask_gl_tex, NULL); @@ -384,7 +384,7 @@ meta_shaped_texture_paint (ClutterActor *actor) /* We need the actual size of the texture so that we can calculate the right texture coordinates if NPOTs textures are not supported and Cogl has oversized the texture */ - meta_shaped_texture_get_gl_size (paint_tex, + mutter_shaped_texture_get_gl_size (paint_tex, &paint_gl_width, &paint_gl_height); @@ -412,24 +412,24 @@ meta_shaped_texture_paint (ClutterActor *actor) clutter_actor_get_allocation_box (actor, &alloc); - meta_shaped_texture_set_coord_array (0, 0, - CLUTTER_UNITS_TO_FLOAT (alloc.x2 - - alloc.x1), - CLUTTER_UNITS_TO_FLOAT (alloc.y2 - - alloc.y1), - vertex_coords); + mutter_shaped_texture_set_coord_array (0, 0, + CLUTTER_UNITS_TO_FLOAT (alloc.x2 + - alloc.x1), + CLUTTER_UNITS_TO_FLOAT (alloc.y2 + - alloc.y1), + vertex_coords); if ((guint) paint_gl_width == tex_width && (guint) paint_gl_height == tex_height) - meta_shaped_texture_set_coord_array (0.0f, 0.0f, 1.0f, 1.0f, + mutter_shaped_texture_set_coord_array (0.0f, 0.0f, 1.0f, 1.0f, paint_tex_coords); else - meta_shaped_texture_set_coord_array (0.0f, 0.0f, - tex_width - / (GLfloat) paint_gl_width, - tex_height - / (GLfloat) paint_gl_height, - paint_tex_coords); + mutter_shaped_texture_set_coord_array (0.0f, 0.0f, + tex_width + / (GLfloat) paint_gl_width, + tex_height + / (GLfloat) paint_gl_height, + paint_tex_coords); glDrawArrays (GL_TRIANGLE_STRIP, 0, 4); @@ -455,16 +455,16 @@ meta_shaped_texture_paint (ClutterActor *actor) } static void -meta_shaped_texture_pick (ClutterActor *actor, - const ClutterColor *color) +mutter_shaped_texture_pick (ClutterActor *actor, + const ClutterColor *color) { - MetaShapedTexture *stex = (MetaShapedTexture *) actor; - MetaShapedTexturePrivate *priv = stex->priv; + MutterShapedTexture *stex = (MutterShapedTexture *) actor; + MutterShapedTexturePrivate *priv = stex->priv; /* If there are no rectangles then use the regular pick */ if (priv->rectangles->len < 1 - || !meta_shaped_texture_is_multi_tex_supported ()) - CLUTTER_ACTOR_CLASS (meta_shaped_texture_parent_class) + || !mutter_shaped_texture_is_multi_tex_supported ()) + CLUTTER_ACTOR_CLASS (mutter_shaped_texture_parent_class) ->pick (actor, color); else if (clutter_actor_should_pick_paint (actor)) { @@ -476,7 +476,7 @@ meta_shaped_texture_pick (ClutterActor *actor, if (paint_tex == COGL_INVALID_HANDLE) return; - meta_shaped_texture_ensure_mask (stex); + mutter_shaped_texture_ensure_mask (stex); cogl_color (color); @@ -492,49 +492,49 @@ meta_shaped_texture_pick (ClutterActor *actor, } ClutterActor * -meta_shaped_texture_new (void) +mutter_shaped_texture_new (void) { - ClutterActor *self = g_object_new (META_TYPE_SHAPED_TEXTURE, NULL); + ClutterActor *self = g_object_new (MUTTER_TYPE_SHAPED_TEXTURE, NULL); return self; } void -meta_shaped_texture_clear_rectangles (MetaShapedTexture *stex) +mutter_shaped_texture_clear_rectangles (MutterShapedTexture *stex) { - MetaShapedTexturePrivate *priv; + MutterShapedTexturePrivate *priv; - g_return_if_fail (META_IS_SHAPED_TEXTURE (stex)); + g_return_if_fail (MUTTER_IS_SHAPED_TEXTURE (stex)); priv = stex->priv; g_array_set_size (priv->rectangles, 0); - meta_shaped_texture_dirty_mask (stex); + mutter_shaped_texture_dirty_mask (stex); clutter_actor_queue_redraw (CLUTTER_ACTOR (stex)); } void -meta_shaped_texture_add_rectangle (MetaShapedTexture *stex, - const XRectangle *rect) +mutter_shaped_texture_add_rectangle (MutterShapedTexture *stex, + const XRectangle *rect) { - g_return_if_fail (META_IS_SHAPED_TEXTURE (stex)); + g_return_if_fail (MUTTER_IS_SHAPED_TEXTURE (stex)); - meta_shaped_texture_add_rectangles (stex, 1, rect); + mutter_shaped_texture_add_rectangles (stex, 1, rect); } void -meta_shaped_texture_add_rectangles (MetaShapedTexture *stex, - size_t num_rects, - const XRectangle *rects) +mutter_shaped_texture_add_rectangles (MutterShapedTexture *stex, + size_t num_rects, + const XRectangle *rects) { - MetaShapedTexturePrivate *priv; + MutterShapedTexturePrivate *priv; - g_return_if_fail (META_IS_SHAPED_TEXTURE (stex)); + g_return_if_fail (MUTTER_IS_SHAPED_TEXTURE (stex)); priv = stex->priv; g_array_append_vals (priv->rectangles, rects, num_rects); - meta_shaped_texture_dirty_mask (stex); + mutter_shaped_texture_dirty_mask (stex); clutter_actor_queue_redraw (CLUTTER_ACTOR (stex)); } diff --git a/src/compositor/mutter/mutter-shaped-texture.h b/src/compositor/mutter/mutter-shaped-texture.h new file mode 100644 index 000000000..1cac287e6 --- /dev/null +++ b/src/compositor/mutter/mutter-shaped-texture.h @@ -0,0 +1,96 @@ +/* + * shaped texture + * + * An actor to draw a texture clipped to a list of rectangles + * + * Authored By Neil Roberts + * + * Copyright (C) 2008 Intel Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __MUTTER_SHAPED_TEXTURE_H__ +#define __MUTTER_SHAPED_TEXTURE_H__ + +#include +#include +#ifdef HAVE_GLX_TEXTURE_PIXMAP +#include +#endif /* HAVE_GLX_TEXTURE_PIXMAP */ + +G_BEGIN_DECLS + +#define MUTTER_TYPE_SHAPED_TEXTURE \ + (mutter_shaped_texture_get_type()) +#define MUTTER_SHAPED_TEXTURE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + MUTTER_TYPE_SHAPED_TEXTURE, \ + MutterShapedTexture)) +#define MUTTER_SHAPED_TEXTURE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + MUTTER_TYPE_SHAPED_TEXTURE, \ + MutterShapedTextureClass)) +#define MUTTER_IS_SHAPED_TEXTURE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + MUTTER_TYPE_SHAPED_TEXTURE)) +#define MUTTER_IS_SHAPED_TEXTURE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + MUTTER_TYPE_SHAPED_TEXTURE)) +#define MUTTER_SHAPED_TEXTURE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + MUTTER_TYPE_SHAPED_TEXTURE, \ + MutterShapedTextureClass)) + +typedef struct _MutterShapedTexture MutterShapedTexture; +typedef struct _MutterShapedTextureClass MutterShapedTextureClass; +typedef struct _MutterShapedTexturePrivate MutterShapedTexturePrivate; + +struct _MutterShapedTextureClass +{ +#ifdef HAVE_GLX_TEXTURE_PIXMAP + ClutterGLXTexturePixmapClass parent_class; +#else + ClutterX11TexturePixmapClass parent_class; +#endif +}; + +struct _MutterShapedTexture +{ +#ifdef HAVE_GLX_TEXTURE_PIXMAP + ClutterGLXTexturePixmap parent; +#else + ClutterX11TexturePixmap parent; +#endif + + MutterShapedTexturePrivate *priv; +}; + +GType mutter_shaped_texture_get_type (void) G_GNUC_CONST; + +ClutterActor *mutter_shaped_texture_new (void); + +void mutter_shaped_texture_clear_rectangles (MutterShapedTexture *stex); + +void mutter_shaped_texture_add_rectangle (MutterShapedTexture *stex, + const XRectangle *rect); +void mutter_shaped_texture_add_rectangles (MutterShapedTexture *stex, + size_t num_rects, + const XRectangle *rects); + +G_END_DECLS + +#endif /* __MUTTER_SHAPED_TEXTURE_H__ */ diff --git a/src/compositor/clutter/clutter-plugins/Makefile.am b/src/compositor/mutter/plugins/Makefile.am similarity index 99% rename from src/compositor/clutter/clutter-plugins/Makefile.am rename to src/compositor/mutter/plugins/Makefile.am index 05fad571d..c822eee9a 100644 --- a/src/compositor/clutter/clutter-plugins/Makefile.am +++ b/src/compositor/mutter/plugins/Makefile.am @@ -5,11 +5,12 @@ if WITH_CLUTTER INCLUDES=@METACITY_CFLAGS@ -I $(top_srcdir)/src/include -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1 -DMETACITY_MAJOR_VERSION=$(METACITY_MAJOR_VERSION) -DMETACITY_MINOR_VERSION=$(METACITY_MINOR_VERSION) -DMETACITY_MICRO_VERSION=$(METACITY_MICRO_VERSION) -DMETACITY_CLUTTER_PLUGIN_API_VERSION=$(METACITY_CLUTTER_PLUGIN_API_VERSION) -DMETACITY_PKGLIBDIR=\"$(pkglibdir)\" +pkglib_LTLIBRARIES = default.la + default_la_CFLAGS = -fPIC default_la_SOURCES = default.c default_la_LDFLAGS = -module -avoid-version -no-undefined default_la_LIBADD = @CLUTTER_LIBS@ -pkglib_LTLIBRARIES = default.la # post-install hook to remove the .la and .a files we are not interested in # (There is no way to stop libtool generating static libs locally, and we diff --git a/src/compositor/clutter/clutter-plugins/README b/src/compositor/mutter/plugins/README similarity index 100% rename from src/compositor/clutter/clutter-plugins/README rename to src/compositor/mutter/plugins/README diff --git a/src/compositor/clutter/clutter-plugins/default.c b/src/compositor/mutter/plugins/default.c similarity index 81% rename from src/compositor/clutter/clutter-plugins/default.c rename to src/compositor/mutter/plugins/default.c index d342d71d3..e0db90e15 100644 --- a/src/compositor/clutter/clutter-plugins/default.c +++ b/src/compositor/mutter/plugins/default.c @@ -21,9 +21,8 @@ * 02111-1307, USA. */ -#define META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN 1 -#include "compositor-clutter-plugin.h" -#include "compositor-clutter.h" +#define MUTTER_BUILDING_PLUGIN 1 +#include "mutter-plugin.h" #include #define _(x) dgettext (GETTEXT_PACKAGE, x) @@ -43,18 +42,18 @@ static GQuark actor_data_quark = 0; static gboolean do_init (const char *params); -static void minimize (MetaCompWindow *actor); -static void map (MetaCompWindow *actor); -static void destroy (MetaCompWindow *actor); -static void maximize (MetaCompWindow *actor, +static void minimize (MutterWindow *actor); +static void map (MutterWindow *actor); +static void destroy (MutterWindow *actor); +static void maximize (MutterWindow *actor, gint x, gint y, gint width, gint height); -static void unmaximize (MetaCompWindow *actor, +static void unmaximize (MutterWindow *actor, gint x, gint y, gint width, gint height); static void switch_workspace (const GList **actors, gint from, gint to, MetaMotionDirection direction); -static void kill_effect (MetaCompWindow *actor, gulong event); +static void kill_effect (MutterWindow *actor, gulong event); static gboolean reload (const char *params); @@ -64,7 +63,7 @@ static gboolean reload (const char *params); * Any dynamically allocated data should be initialized in the * init () function below. */ -G_MODULE_EXPORT MetaCompositorClutterPlugin metacity_plugin = +G_MODULE_EXPORT MutterPlugin mutter_plugin = { /* * These are predefined values; do not modify. @@ -81,12 +80,12 @@ G_MODULE_EXPORT MetaCompositorClutterPlugin metacity_plugin = .do_init = do_init, /* Which types of events this plugin supports */ - .features = META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE | - META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY | - META_COMPOSITOR_CLUTTER_PLUGIN_MAP | - META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE | - META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE | - META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE, + .features = MUTTER_PLUGIN_MINIMIZE | + MUTTER_PLUGIN_DESTROY | + MUTTER_PLUGIN_MAP | + MUTTER_PLUGIN_MAXIMIZE | + MUTTER_PLUGIN_UNMAXIMIZE | + MUTTER_PLUGIN_SWITCH_WORKSPACE, /* And the corresponding handlers */ @@ -153,7 +152,7 @@ free_actor_private (gpointer data) } static ActorPrivate * -get_actor_private (MetaCompWindow *actor) +get_actor_private (MutterWindow *actor) { ActorPrivate *priv = g_object_get_qdata (G_OBJECT (actor), actor_data_quark); @@ -177,12 +176,12 @@ on_switch_workspace_effect_complete (ClutterActor *group, gpointer data) { DefaultPluginState *state = plugin_state; GList *l = *((GList**)data); - MetaCompWindow *actor_for_cb = l->data; + MutterWindow *actor_for_cb = l->data; while (l) { ClutterActor *a = l->data; - MetaCompWindow *mc_window = META_COMP_WINDOW (a); + MutterWindow *mc_window = MUTTER_WINDOW (a); ActorPrivate *priv = get_actor_private (mc_window); if (priv->orig_parent) @@ -203,15 +202,15 @@ on_switch_workspace_effect_complete (ClutterActor *group, gpointer data) state->desktop1 = NULL; state->desktop2 = NULL; - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, actor_for_cb, - META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, actor_for_cb, + MUTTER_PLUGIN_SWITCH_WORKSPACE); } static void switch_workspace (const GList **actors, gint from, gint to, MetaMotionDirection direction) { - MetaCompositorClutterPlugin *plugin = &metacity_plugin; + MutterPlugin *plugin = &mutter_plugin; DefaultPluginState *state = plugin_state; GList *l; gint n_workspaces; @@ -239,8 +238,8 @@ switch_workspace (const GList **actors, gint from, gint to, if (from == to) { - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, NULL, - META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, NULL, + MUTTER_PLUGIN_SWITCH_WORKSPACE); return; } @@ -250,12 +249,12 @@ switch_workspace (const GList **actors, gint from, gint to, while (l) { - MetaCompWindow *mc_window = l->data; + MutterWindow *mc_window = l->data; ActorPrivate *priv = get_actor_private (mc_window); ClutterActor *window = CLUTTER_ACTOR (mc_window); gint win_workspace; - win_workspace = meta_comp_window_get_workspace (mc_window); + win_workspace = mutter_window_get_workspace (mc_window); if (win_workspace == to || win_workspace == from) { @@ -316,9 +315,9 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data) * that the restoration will not be visible. */ ActorPrivate *apriv; - MetaCompWindow *mc_window = META_COMP_WINDOW (actor); + MutterWindow *mc_window = MUTTER_WINDOW (actor); - apriv = get_actor_private (META_COMP_WINDOW (actor)); + apriv = get_actor_private (MUTTER_WINDOW (actor)); apriv->tml_minimize = NULL; clutter_actor_hide (actor); @@ -330,10 +329,10 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data) CLUTTER_GRAVITY_NORTH_WEST); /* Decrease the running effect counter */ - metacity_plugin.running--; + mutter_plugin.running--; /* Now notify the manager that we are done with this effect */ - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, - META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window, + MUTTER_PLUGIN_MINIMIZE); } /* @@ -341,13 +340,13 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data) * completion). */ static void -minimize (MetaCompWindow *mc_window) +minimize (MutterWindow *mc_window) { DefaultPluginState *state = plugin_state; MetaCompWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mc_window); - type = meta_comp_window_get_window_type (mc_window); + type = mutter_window_get_window_type (mc_window); if (type == META_COMP_WINDOW_NORMAL) { @@ -358,7 +357,7 @@ minimize (MetaCompWindow *mc_window) clutter_actor_move_anchor_point_from_gravity (actor, CLUTTER_GRAVITY_CENTER); - metacity_plugin.running++; + mutter_plugin.running++; apriv->tml_minimize = clutter_effect_scale (state->minimize_effect, actor, @@ -369,8 +368,8 @@ minimize (MetaCompWindow *mc_window) NULL); } else - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, - META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window, + MUTTER_PLUGIN_MINIMIZE); } /* @@ -383,7 +382,7 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data) /* * Must reverse the effect of the effect. */ - MetaCompWindow *mc_window = META_COMP_WINDOW (actor); + MutterWindow *mc_window = MUTTER_WINDOW (actor); ActorPrivate *apriv = get_actor_private (mc_window); apriv->tml_maximize = NULL; @@ -394,11 +393,11 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data) CLUTTER_GRAVITY_NORTH_WEST); /* Decrease the running effect counter */ - metacity_plugin.running--; + mutter_plugin.running--; /* Now notify the manager that we are done with this effect */ - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, - META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window, + MUTTER_PLUGIN_MAXIMIZE); } /* @@ -410,7 +409,7 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data) * (Something like a sound would be more appropriate.) */ static void -maximize (MetaCompWindow *mc_window, +maximize (MutterWindow *mc_window, gint end_x, gint end_y, gint end_width, gint end_height) { MetaCompWindowType type; @@ -421,7 +420,7 @@ maximize (MetaCompWindow *mc_window, gint anchor_x = 0; gint anchor_y = 0; - type = meta_comp_window_get_window_type (mc_window); + type = mutter_window_get_window_type (mc_window); if (type == META_COMP_WINDOW_NORMAL) { @@ -460,8 +459,8 @@ maximize (MetaCompWindow *mc_window, return; } - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, - META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window, + MUTTER_PLUGIN_MAXIMIZE); } /* @@ -470,10 +469,10 @@ maximize (MetaCompWindow *mc_window, * (Just a skeleton code.) */ static void -unmaximize (MetaCompWindow *mc_window, +unmaximize (MutterWindow *mc_window, gint end_x, gint end_y, gint end_width, gint end_height) { - MetaCompWindowType type = meta_comp_window_get_window_type (mc_window); + MetaCompWindowType type = mutter_window_get_window_type (mc_window); if (type == META_COMP_WINDOW_NORMAL) { @@ -483,8 +482,8 @@ unmaximize (MetaCompWindow *mc_window, } /* Do this conditionally, if the effect requires completion callback. */ - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, - META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window, + MUTTER_PLUGIN_UNMAXIMIZE); } static void @@ -493,7 +492,7 @@ on_map_effect_complete (ClutterActor *actor, gpointer data) /* * Must reverse the effect of the effect. */ - MetaCompWindow *mc_window = META_COMP_WINDOW (actor); + MutterWindow *mc_window = MUTTER_WINDOW (actor); ActorPrivate *apriv = get_actor_private (mc_window); apriv->tml_map = NULL; @@ -502,11 +501,11 @@ on_map_effect_complete (ClutterActor *actor, gpointer data) CLUTTER_GRAVITY_NORTH_WEST); /* Decrease the running effect counter */ - metacity_plugin.running--; + mutter_plugin.running--; /* Now notify the manager that we are done with this effect */ - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, - META_COMPOSITOR_CLUTTER_PLUGIN_MAP); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window, + MUTTER_PLUGIN_MAP); } /* @@ -514,12 +513,12 @@ on_map_effect_complete (ClutterActor *actor, gpointer data) * completion). */ static void -map (MetaCompWindow *mc_window) +map (MutterWindow *mc_window) { MetaCompWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mc_window); - type = meta_comp_window_get_window_type (mc_window); + type = mutter_window_get_window_type (mc_window); if (type == META_COMP_WINDOW_NORMAL) { @@ -528,7 +527,7 @@ map (MetaCompWindow *mc_window) clutter_actor_move_anchor_point_from_gravity (actor, CLUTTER_GRAVITY_CENTER); - metacity_plugin.running++; + mutter_plugin.running++; clutter_actor_set_scale (actor, 0.0, 0.0); clutter_actor_show (actor); @@ -545,8 +544,8 @@ map (MetaCompWindow *mc_window) } else - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, - META_COMPOSITOR_CLUTTER_PLUGIN_MAP); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window, + MUTTER_PLUGIN_MAP); } /* @@ -557,28 +556,28 @@ map (MetaCompWindow *mc_window) static void on_destroy_effect_complete (ClutterActor *actor, gpointer data) { - MetaCompositorClutterPlugin *plugin = &metacity_plugin; - MetaCompWindow *mc_window = META_COMP_WINDOW (actor); + MutterPlugin *plugin = &mutter_plugin; + MutterWindow *mc_window = MUTTER_WINDOW (actor); ActorPrivate *apriv = get_actor_private (mc_window); apriv->tml_destroy = NULL; - metacity_plugin.running--; + mutter_plugin.running--; meta_comp_clutter_plugin_effect_completed (plugin, mc_window, - META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY); + MUTTER_PLUGIN_DESTROY); } /* * Simple TV-out like effect. */ static void -destroy (MetaCompWindow *mc_window) +destroy (MutterWindow *mc_window) { MetaCompWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mc_window); - type = meta_comp_window_get_window_type (mc_window); + type = mutter_window_get_window_type (mc_window); if (type == META_COMP_WINDOW_NORMAL) { @@ -587,7 +586,7 @@ destroy (MetaCompWindow *mc_window) clutter_actor_move_anchor_point_from_gravity (actor, CLUTTER_GRAVITY_CENTER); - metacity_plugin.running++; + mutter_plugin.running++; apriv->tml_destroy = clutter_effect_scale (plugin_state->destroy_effect, actor, @@ -598,14 +597,14 @@ destroy (MetaCompWindow *mc_window) NULL); } else - meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, - META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY); + meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window, + MUTTER_PLUGIN_DESTROY); } static void -kill_effect (MetaCompWindow *mc_window, gulong event) +kill_effect (MutterWindow *mc_window, gulong event) { - MetaCompositorClutterPlugin *plugin = &metacity_plugin; + MutterPlugin *plugin = &mutter_plugin; ActorPrivate *apriv; ClutterActor *actor = CLUTTER_ACTOR (mc_window); @@ -615,7 +614,7 @@ kill_effect (MetaCompWindow *mc_window, gulong event) return; } - if (event & META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE) + if (event & MUTTER_PLUGIN_SWITCH_WORKSPACE) { DefaultPluginState *state = plugin_state; @@ -626,7 +625,7 @@ kill_effect (MetaCompWindow *mc_window, gulong event) on_switch_workspace_effect_complete (state->desktop1, state->actors); } - if (!(event & ~META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE)) + if (!(event & ~MUTTER_PLUGIN_SWITCH_WORKSPACE)) { /* Workspace switch only, nothing more to do */ return; @@ -635,25 +634,25 @@ kill_effect (MetaCompWindow *mc_window, gulong event) apriv = get_actor_private (mc_window); - if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE) && apriv->tml_minimize) + if ((event & MUTTER_PLUGIN_MINIMIZE) && apriv->tml_minimize) { clutter_timeline_stop (apriv->tml_minimize); on_minimize_effect_complete (actor, NULL); } - if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE) && apriv->tml_maximize) + if ((event & MUTTER_PLUGIN_MAXIMIZE) && apriv->tml_maximize) { clutter_timeline_stop (apriv->tml_maximize); on_maximize_effect_complete (actor, NULL); } - if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_MAP) && apriv->tml_map) + if ((event & MUTTER_PLUGIN_MAP) && apriv->tml_map) { clutter_timeline_stop (apriv->tml_map); on_map_effect_complete (actor, NULL); } - if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY) && apriv->tml_destroy) + if ((event & MUTTER_PLUGIN_DESTROY) && apriv->tml_destroy) { clutter_timeline_stop (apriv->tml_destroy); on_destroy_effect_complete (actor, NULL); @@ -696,7 +695,7 @@ do_init (const char *params) { if (strstr (params, "debug")) { - g_debug ("%s: Entering debug mode.", metacity_plugin.name); + g_debug ("%s: Entering debug mode.", mutter_plugin.name); plugin_state->debug_mode = TRUE; @@ -743,6 +742,9 @@ do_init (const char *params) static void free_plugin_private (DefaultPluginState *state) { + if (!state) + return; + g_object_unref (state->destroy_effect); g_object_unref (state->minimize_effect); g_object_unref (state->maximize_effect); diff --git a/src/compositor/clutter/clutter-plugins/moblin.c b/src/compositor/mutter/plugins/moblin.c similarity index 80% rename from src/compositor/clutter/clutter-plugins/moblin.c rename to src/compositor/mutter/plugins/moblin.c index c237a2b2d..42c416147 100644 --- a/src/compositor/clutter/clutter-plugins/moblin.c +++ b/src/compositor/mutter/plugins/moblin.c @@ -21,9 +21,8 @@ * 02111-1307, USA. */ -#define META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN 1 -#include "compositor-clutter-plugin.h" -#include "compositor-clutter.h" +#define MUTTER_BUILDING_PLUGIN 1 +#include "mutter-plugin.h" #include #define _(x) dgettext (GETTEXT_PACKAGE, x) @@ -44,18 +43,18 @@ typedef struct PluginPrivate PluginPrivate; typedef struct ActorPrivate ActorPrivate; -static void minimize (MetaCompWindow *actor); -static void map (MetaCompWindow *actor); -static void destroy (MetaCompWindow *actor); -static void maximize (MetaCompWindow *actor, +static void minimize (MutterWindow *actor); +static void map (MutterWindow *actor); +static void destroy (MutterWindow *actor); +static void maximize (MutterWindow *actor, gint x, gint y, gint width, gint height); -static void unmaximize (MetaCompWindow *actor, +static void unmaximize (MutterWindow *actor, gint x, gint y, gint width, gint height); static void switch_workspace (const GList **actors, gint from, gint to, MetaMotionDirection direction); -static void kill_effect (MetaCompWindow *actor, gulong event); +static void kill_effect (MutterWindow *actor, gulong event); static gboolean reload (void); @@ -64,7 +63,7 @@ static gboolean reload (void); * Any dynamically allocated data should be initialized in the * init () function below. */ -MetaCompositorClutterPlugin META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT = +MutterPlugin MUTTER_PLUGIN_STRUCT = { /* * These are predefined values; do not modify. @@ -78,12 +77,12 @@ MetaCompositorClutterPlugin META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT = .name = "Default Effects", /* Which types of events this plugin supports */ - .features = META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE | - META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY | - META_COMPOSITOR_CLUTTER_PLUGIN_MAP | - META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE | - META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE | - META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE, + .features = MUTTER_PLUGIN_MINIMIZE | + MUTTER_PLUGIN_DESTROY | + MUTTER_PLUGIN_MAP | + MUTTER_PLUGIN_MAXIMIZE | + MUTTER_PLUGIN_UNMAXIMIZE | + MUTTER_PLUGIN_SWITCH_WORKSPACE, /* And the corresponding handlers */ @@ -141,7 +140,7 @@ struct ActorPrivate * Actor private data accessor */ static ActorPrivate * -get_actor_private (MetaCompWindow *actor) +get_actor_private (MutterWindow *actor) { ActorPrivate * priv = g_object_get_data (G_OBJECT (actor), ACTOR_DATA_KEY); @@ -155,24 +154,24 @@ get_actor_private (MetaCompWindow *actor) } static inline -MetaCompositorClutterPlugin * +MutterPlugin * get_plugin () { - return &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT; + return &MUTTER_PLUGIN_STRUCT; } static void on_switch_workspace_effect_complete (ClutterActor *group, gpointer data) { - MetaCompositorClutterPlugin *plugin = get_plugin (); + MutterPlugin *plugin = get_plugin (); PluginPrivate *ppriv = plugin->plugin_private; GList *l = *((GList**)data); - MetaCompWindow *actor_for_cb = l->data; + MutterWindow *actor_for_cb = l->data; while (l) { ClutterActor *a = l->data; - MetaCompWindow *mcw = META_COMP_WINDOW (a); + MutterWindow *mcw = MUTTER_WINDOW (a); ActorPrivate *priv = get_actor_private (mcw); if (priv->orig_parent) @@ -194,14 +193,14 @@ on_switch_workspace_effect_complete (ClutterActor *group, gpointer data) ppriv->desktop2 = NULL; meta_comp_clutter_plugin_effect_completed (plugin, actor_for_cb, - META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); + MUTTER_PLUGIN_SWITCH_WORKSPACE); } static void switch_workspace (const GList **actors, gint from, gint to, MetaMotionDirection direction) { - MetaCompositorClutterPlugin *plugin = get_plugin (); + MutterPlugin *plugin = get_plugin (); PluginPrivate *ppriv = plugin->plugin_private; GList *l; gint n_workspaces; @@ -228,7 +227,7 @@ switch_workspace (const GList **actors, gint from, gint to, if (from == to) { meta_comp_clutter_plugin_effect_completed (plugin, NULL, - META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); + MUTTER_PLUGIN_SWITCH_WORKSPACE); return; } @@ -238,7 +237,7 @@ switch_workspace (const GList **actors, gint from, gint to, while (l) { - MetaCompWindow *mcw = l->data; + MutterWindow *mcw = l->data; ActorPrivate *priv = get_actor_private (mcw); ClutterActor *a = CLUTTER_ACTOR (mcw); gint workspace; @@ -302,11 +301,11 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data) * Must reverse the effect of the effect; must hide it first to ensure * that the restoration will not be visible. */ - MetaCompositorClutterPlugin *plugin = get_plugin (); + MutterPlugin *plugin = get_plugin (); ActorPrivate *apriv; - MetaCompWindow *mcw = META_COMP_WINDOW (actor); + MutterWindow *mcw = MUTTER_WINDOW (actor); - apriv = get_actor_private (META_COMP_WINDOW (actor)); + apriv = get_actor_private (MUTTER_WINDOW (actor)); apriv->tml_minimize = NULL; clutter_actor_hide (actor); @@ -320,7 +319,7 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data) /* Now notify the manager that we are done with this effect */ meta_comp_clutter_plugin_effect_completed (plugin, mcw, - META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE); + MUTTER_PLUGIN_MINIMIZE); } /* @@ -328,17 +327,17 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data) * completion). */ static void -minimize (MetaCompWindow *mcw) +minimize (MutterWindow *mcw) { - MetaCompositorClutterPlugin *plugin = get_plugin (); + MutterPlugin *plugin = get_plugin (); PluginPrivate *priv = plugin->plugin_private; - MetaCompWindowType type; + MutterWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mcw); type = meta_comp_window_get_window_type (mcw); - if (type == META_COMP_WINDOW_NORMAL) + if (type == MUTTER_WINDOW_NORMAL) { ActorPrivate *apriv = get_actor_private (mcw); @@ -347,7 +346,7 @@ minimize (MetaCompWindow *mcw) clutter_actor_move_anchor_point_from_gravity (actor, CLUTTER_GRAVITY_CENTER); - META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.running++; + MUTTER_PLUGIN_STRUCT.running++; apriv->tml_minimize = clutter_effect_scale (priv->minimize_effect, actor, @@ -359,7 +358,7 @@ minimize (MetaCompWindow *mcw) } else meta_comp_clutter_plugin_effect_completed (plugin, mcw, - META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE); + MUTTER_PLUGIN_MINIMIZE); } /* @@ -372,8 +371,8 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data) /* * Must reverse the effect of the effect. */ - MetaCompositorClutterPlugin *plugin = get_plugin (); - MetaCompWindow *mcw = META_COMP_WINDOW (actor); + MutterPlugin *plugin = get_plugin (); + MutterWindow *mcw = MUTTER_WINDOW (actor); ActorPrivate *apriv = get_actor_private (mcw); apriv->tml_maximize = NULL; @@ -387,7 +386,7 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data) /* Now notify the manager that we are done with this effect */ meta_comp_clutter_plugin_effect_completed (plugin, mcw, - META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE); + MUTTER_PLUGIN_MAXIMIZE); } /* @@ -399,12 +398,12 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data) * (Something like a sound would be more appropriate.) */ static void -maximize (MetaCompWindow *mcw, +maximize (MutterWindow *mcw, gint end_x, gint end_y, gint end_width, gint end_height) { - MetaCompositorClutterPlugin *plugin = get_plugin (); + MutterPlugin *plugin = get_plugin (); PluginPrivate *priv = plugin->plugin_private; - MetaCompWindowType type; + MutterWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mcw); gdouble scale_x = 1.0; @@ -414,7 +413,7 @@ maximize (MetaCompWindow *mcw, type = meta_comp_window_get_window_type (mcw); - if (type == META_COMP_WINDOW_NORMAL) + if (type == MUTTER_WINDOW_NORMAL) { ActorPrivate *apriv = get_actor_private (mcw); guint width, height; @@ -451,7 +450,7 @@ maximize (MetaCompWindow *mcw, } meta_comp_clutter_plugin_effect_completed (plugin, mcw, - META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE); + MUTTER_PLUGIN_MAXIMIZE); } /* @@ -460,15 +459,15 @@ maximize (MetaCompWindow *mcw, * (Just a skeleton code.) */ static void -unmaximize (MetaCompWindow *mcw, +unmaximize (MutterWindow *mcw, gint end_x, gint end_y, gint end_width, gint end_height) { - MetaCompositorClutterPlugin *plugin = get_plugin (); - MetaCompWindowType type; + MutterPlugin *plugin = get_plugin (); + MutterWindowType type; type = meta_comp_window_get_window_type (mcw); - if (type == META_COMP_WINDOW_NORMAL) + if (type == MUTTER_WINDOW_NORMAL) { ActorPrivate *apriv = get_actor_private (mcw); @@ -477,7 +476,7 @@ unmaximize (MetaCompWindow *mcw, /* Do this conditionally, if the effect requires completion callback. */ meta_comp_clutter_plugin_effect_completed (plugin, mcw, - META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE); + MUTTER_PLUGIN_UNMAXIMIZE); } static void @@ -486,8 +485,8 @@ on_map_effect_complete (ClutterActor *actor, gpointer data) /* * Must reverse the effect of the effect. */ - MetaCompositorClutterPlugin *plugin = get_plugin (); - MetaCompWindow *mcw = META_COMP_WINDOW (actor); + MutterPlugin *plugin = get_plugin (); + MutterWindow *mcw = MUTTER_WINDOW (actor); ActorPrivate *apriv = get_actor_private (mcw); apriv->tml_map = NULL; @@ -500,7 +499,7 @@ on_map_effect_complete (ClutterActor *actor, gpointer data) /* Now notify the manager that we are done with this effect */ meta_comp_clutter_plugin_effect_completed (plugin, mcw, - META_COMPOSITOR_CLUTTER_PLUGIN_MAP); + MUTTER_PLUGIN_MAP); } /* @@ -508,23 +507,23 @@ on_map_effect_complete (ClutterActor *actor, gpointer data) * completion). */ static void -map (MetaCompWindow *mcw) +map (MutterWindow *mcw) { - MetaCompositorClutterPlugin *plugin = get_plugin (); + MutterPlugin *plugin = get_plugin (); PluginPrivate *priv = plugin->plugin_private; - MetaCompWindowType type; + MutterWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mcw); type = meta_comp_window_get_window_type (mcw); - if (type == META_COMP_WINDOW_NORMAL) + if (type == MUTTER_WINDOW_NORMAL) { ActorPrivate *apriv = get_actor_private (mcw); clutter_actor_move_anchor_point_from_gravity (actor, CLUTTER_GRAVITY_CENTER); - META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.running++; + MUTTER_PLUGIN_STRUCT.running++; clutter_actor_set_scale (actor, 0.0, 0.0); clutter_actor_show (actor); @@ -542,7 +541,7 @@ map (MetaCompWindow *mcw) } else meta_comp_clutter_plugin_effect_completed (plugin, mcw, - META_COMPOSITOR_CLUTTER_PLUGIN_MAP); + MUTTER_PLUGIN_MAP); } /* @@ -553,8 +552,8 @@ map (MetaCompWindow *mcw) static void on_destroy_effect_complete (ClutterActor *actor, gpointer data) { - MetaCompositorClutterPlugin *plugin = get_plugin (); - MetaCompWindow *mcw = META_COMP_WINDOW (actor); + MutterPlugin *plugin = get_plugin (); + MutterWindow *mcw = MUTTER_WINDOW (actor); ActorPrivate *apriv = get_actor_private (mcw); apriv->tml_destroy = NULL; @@ -562,23 +561,23 @@ on_destroy_effect_complete (ClutterActor *actor, gpointer data) plugin->running--; meta_comp_clutter_plugin_effect_completed (plugin, mcw, - META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY); + MUTTER_PLUGIN_DESTROY); } /* * Simple TV-out like effect. */ static void -destroy (MetaCompWindow *mcw) +destroy (MutterWindow *mcw) { - MetaCompositorClutterPlugin *plugin = get_plugin (); + MutterPlugin *plugin = get_plugin (); PluginPrivate *priv = plugin->plugin_private; - MetaCompWindowType type; + MutterWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mcw); type = meta_comp_window_get_window_type (mcw); - if (type == META_COMP_WINDOW_NORMAL) + if (type == MUTTER_WINDOW_NORMAL) { ActorPrivate *apriv = get_actor_private (mcw); @@ -597,13 +596,13 @@ destroy (MetaCompWindow *mcw) } else meta_comp_clutter_plugin_effect_completed (plugin, mcw, - META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY); + MUTTER_PLUGIN_DESTROY); } static void -kill_effect (MetaCompWindow *mcw, gulong event) +kill_effect (MutterWindow *mcw, gulong event) { - MetaCompositorClutterPlugin *plugin = get_plugin (); + MutterPlugin *plugin = get_plugin (); ActorPrivate *apriv; ClutterActor *actor = CLUTTER_ACTOR (mcw); @@ -613,7 +612,7 @@ kill_effect (MetaCompWindow *mcw, gulong event) return; } - if (event & META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE) + if (event & MUTTER_PLUGIN_SWITCH_WORKSPACE) { PluginPrivate *ppriv = plugin->plugin_private; @@ -624,7 +623,7 @@ kill_effect (MetaCompWindow *mcw, gulong event) on_switch_workspace_effect_complete (ppriv->desktop1, ppriv->actors); } - if (!(event & ~META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE)) + if (!(event & ~MUTTER_PLUGIN_SWITCH_WORKSPACE)) { /* Workspace switch only, nothing more to do */ return; @@ -633,25 +632,25 @@ kill_effect (MetaCompWindow *mcw, gulong event) apriv = get_actor_private (mcw); - if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE) && apriv->tml_minimize) + if ((event & MUTTER_PLUGIN_MINIMIZE) && apriv->tml_minimize) { clutter_timeline_stop (apriv->tml_minimize); on_minimize_effect_complete (actor, NULL); } - if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE) && apriv->tml_maximize) + if ((event & MUTTER_PLUGIN_MAXIMIZE) && apriv->tml_maximize) { clutter_timeline_stop (apriv->tml_maximize); on_maximize_effect_complete (actor, NULL); } - if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_MAP) && apriv->tml_map) + if ((event & MUTTER_PLUGIN_MAP) && apriv->tml_map) { clutter_timeline_stop (apriv->tml_map); on_map_effect_complete (actor, NULL); } - if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY) && apriv->tml_destroy) + if ((event & MUTTER_PLUGIN_DESTROY) && apriv->tml_destroy) { clutter_timeline_stop (apriv->tml_destroy); on_destroy_effect_complete (actor, NULL); @@ -682,7 +681,7 @@ g_module_check_init (GModule *module) static gboolean do_init () { - MetaCompositorClutterPlugin *plugin = get_plugin (); + MutterPlugin *plugin = get_plugin (); PluginPrivate *priv = g_new0 (PluginPrivate, 1); const gchar *params; @@ -707,7 +706,7 @@ do_init () if (strstr (params, "debug")) { g_debug ("%s: Entering debug mode.", - META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.name); + MUTTER_PLUGIN_STRUCT.name); priv->debug_mode = TRUE; @@ -731,22 +730,22 @@ do_init () *p = 0; if (strstr (d, "minimize")) - plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE; + plugin->features &= ~ MUTTER_PLUGIN_MINIMIZE; if (strstr (d, "maximize")) - plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE; + plugin->features &= ~ MUTTER_PLUGIN_MAXIMIZE; if (strstr (d, "unmaximize")) - plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE; + plugin->features &= ~ MUTTER_PLUGIN_UNMAXIMIZE; if (strstr (d, "map")) - plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MAP; + plugin->features &= ~ MUTTER_PLUGIN_MAP; if (strstr (d, "destroy")) - plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY; + plugin->features &= ~ MUTTER_PLUGIN_DESTROY; if (strstr (d, "switch-workspace")) - plugin->features &= ~META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE; + plugin->features &= ~MUTTER_PLUGIN_SWITCH_WORKSPACE; g_free (d); } @@ -781,7 +780,7 @@ do_init () return TRUE; } -META_COMPOSITOR_CLUTTER_PLUGIN_INIT_FUNC +MUTTER_PLUGIN_INIT_FUNC { return do_init (); } @@ -796,7 +795,7 @@ free_plugin_private (PluginPrivate *priv) g_free (priv); - META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.plugin_private = NULL; + MUTTER_PLUGIN_STRUCT.plugin_private = NULL; } /* @@ -808,7 +807,7 @@ reload () { PluginPrivate *priv; - priv = META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.plugin_private; + priv = MUTTER_PLUGIN_STRUCT.plugin_private; if (do_init ()) { @@ -819,7 +818,7 @@ reload () else { /* Fail -- fall back to the old private. */ - META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.plugin_private = priv; + MUTTER_PLUGIN_STRUCT.plugin_private = priv; } return FALSE; @@ -833,7 +832,7 @@ void g_module_unload (GModule *module) { PluginPrivate *priv; - priv = META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.plugin_private; + priv = MUTTER_PLUGIN_STRUCT.plugin_private; free_plugin_private (priv); } diff --git a/src/compositor/clutter/tidy-texture-frame.c b/src/compositor/mutter/tidy/tidy-texture-frame.c similarity index 100% rename from src/compositor/clutter/tidy-texture-frame.c rename to src/compositor/mutter/tidy/tidy-texture-frame.c diff --git a/src/compositor/clutter/tidy-texture-frame.h b/src/compositor/mutter/tidy/tidy-texture-frame.h similarity index 100% rename from src/compositor/clutter/tidy-texture-frame.h rename to src/compositor/mutter/tidy/tidy-texture-frame.h diff --git a/src/include/compositor-clutter.h b/src/include/compositor-clutter.h deleted file mode 100644 index 0663ef9de..000000000 --- a/src/include/compositor-clutter.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ - -/* - * Copyright (C) 2008 Matthew Allum - * Copyright (C) 2007 Iain Holmes - * Based on xcompmgr - (c) 2003 Keith Packard - * xfwm4 - (c) 2005-2007 Olivier Fourdan - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef META_COMPOSITOR_CLUTTER_H_ -#define META_COMPOSITOR_CLUTTER_H_ - -#include - -#include "types.h" - -/* - * MetaCompWindow object (ClutterGroup sub-class) - */ -#define META_TYPE_COMP_WINDOW (meta_comp_window_get_type ()) -#define META_COMP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_COMP_WINDOW, MetaCompWindow)) -#define META_COMP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_COMP_WINDOW, MetaCompWindowClass)) -#define IS_META_COMP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_COMP_WINDOW_TYPE)) -#define META_IS_COMP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_COMP_WINDOW)) -#define META_COMP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_COMP_WINDOW, MetaCompWindowClass)) - -typedef struct _MetaCompWindow MetaCompWindow; -typedef struct _MetaCompWindowClass MetaCompWindowClass; -typedef struct _MetaCompWindowPrivate MetaCompWindowPrivate; - -struct _MetaCompWindowClass -{ - ClutterGroupClass parent_class; -}; - -struct _MetaCompWindow -{ - ClutterGroup parent; - - MetaCompWindowPrivate *priv; -}; - -GType meta_comp_window_get_type (void); - -Window meta_comp_window_get_x_window (MetaCompWindow *mcw); -MetaCompWindowType meta_comp_window_get_window_type (MetaCompWindow *mcw); -gint meta_comp_window_get_workspace (MetaCompWindow *mcw); - - -/* Compositor API */ -MetaCompositor *meta_compositor_clutter_new (MetaDisplay *display); - -void meta_compositor_clutter_window_effect_completed (MetaCompWindow *actor, gulong event); - -ClutterActor * meta_compositor_clutter_get_stage_for_screen (MetaScreen *screen); -ClutterActor * meta_compositor_clutter_get_overlay_group_for_screen (MetaScreen *screen); - -#endif diff --git a/src/include/compositor-mutter.h b/src/include/compositor-mutter.h new file mode 100644 index 000000000..23060b07f --- /dev/null +++ b/src/include/compositor-mutter.h @@ -0,0 +1,73 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* + * Copyright (C) 2008 Matthew Allum + * Copyright (C) 2007 Iain Holmes + * Based on xcompmgr - (c) 2003 Keith Packard + * xfwm4 - (c) 2005-2007 Olivier Fourdan + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef MUTTER_H_ +#define MUTTER_H_ + +#include + +#include "types.h" + +/* + * MutterWindow object (ClutterGroup sub-class) + */ +#define MUTTER_TYPE_COMP_WINDOW (mutter_window_get_type ()) +#define MUTTER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUTTER_TYPE_COMP_WINDOW, MutterWindow)) +#define MUTTER_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUTTER_TYPE_COMP_WINDOW, MutterWindowClass)) +#define IS_MUTTER_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUTTER_WINDOW_TYPE)) +#define MUTTER_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUTTER_TYPE_COMP_WINDOW)) +#define MUTTER_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUTTER_TYPE_COMP_WINDOW, MutterWindowClass)) + +typedef struct _MutterWindow MutterWindow; +typedef struct _MutterWindowClass MutterWindowClass; +typedef struct _MutterWindowPrivate MutterWindowPrivate; + +struct _MutterWindowClass +{ + ClutterGroupClass parent_class; +}; + +struct _MutterWindow +{ + ClutterGroup parent; + + MutterWindowPrivate *priv; +}; + +GType mutter_window_get_type (void); + +Window mutter_window_get_x_window (MutterWindow *mcw); +MetaCompWindowType mutter_window_get_window_type (MutterWindow *mcw); +gint mutter_window_get_workspace (MutterWindow *mcw); + + +/* Compositor API */ +MetaCompositor *mutter_new (MetaDisplay *display); + +void mutter_window_effect_completed (MutterWindow *actor, gulong event); + +ClutterActor * mutter_get_stage_for_screen (MetaScreen *screen); +ClutterActor * mutter_get_overlay_group_for_screen (MetaScreen *screen); + +#endif diff --git a/src/include/compositor-clutter-plugin.h b/src/include/mutter-plugin.h similarity index 78% rename from src/include/compositor-clutter-plugin.h rename to src/include/mutter-plugin.h index 8abcb5c15..d01990315 100644 --- a/src/include/compositor-clutter-plugin.h +++ b/src/include/mutter-plugin.h @@ -21,13 +21,13 @@ * 02111-1307, USA. */ -#ifndef META_COMPOSITOR_CLUTTER_PLUGIN_H_ -#define META_COMPOSITOR_CLUTTER_PLUGIN_H_ +#ifndef MUTTER_PLUGIN_H_ +#define MUTTER_PLUGIN_H_ #include "types.h" #include "config.h" #include "compositor.h" -#include "compositor-clutter.h" +#include "compositor-mutter.h" #include @@ -38,25 +38,25 @@ * recommended that the GModule API is used (otherwise you are on your own to * do proper plugin clean up when the module is unloaded). * - * The plugin interface is exported via the MetaCompositorClutterPlugin struct. + * The plugin interface is exported via the MutterPlugin struct. */ -typedef struct MetaCompositorClutterPlugin MetaCompositorClutterPlugin; +typedef struct MutterPlugin MutterPlugin; /* * Feature flags: identify events that the plugin can handle; a plugin can * handle one or more events. */ -#define META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE (1<<0) -#define META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE (1<<1) -#define META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE (1<<2) -#define META_COMPOSITOR_CLUTTER_PLUGIN_MAP (1<<3) -#define META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY (1<<4) -#define META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE (1<<5) +#define MUTTER_PLUGIN_MINIMIZE (1<<0) +#define MUTTER_PLUGIN_MAXIMIZE (1<<1) +#define MUTTER_PLUGIN_UNMAXIMIZE (1<<2) +#define MUTTER_PLUGIN_MAP (1<<3) +#define MUTTER_PLUGIN_DESTROY (1<<4) +#define MUTTER_PLUGIN_SWITCH_WORKSPACE (1<<5) -#define META_COMPOSITOR_CLUTTER_PLUGIN_ALL_EFFECTS (~0) +#define MUTTER_PLUGIN_ALL_EFFECTS (~0) -struct MetaCompositorClutterPlugin +struct MutterPlugin { /* * Version information; the first three numbers match the Metacity version @@ -74,7 +74,7 @@ struct MetaCompositorClutterPlugin */ guint version_api; -#ifndef META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN +#ifndef MUTTER_BUILDING_PLUGIN const #endif gchar *name; /* Human-readable name for UI */ @@ -134,29 +134,29 @@ struct MetaCompositorClutterPlugin * On completion, each event handler must call the manager completed() * callback function. */ - void (*minimize) (MetaCompWindow *actor); + void (*minimize) (MutterWindow *actor); - void (*maximize) (MetaCompWindow *actor, + void (*maximize) (MutterWindow *actor, gint x, gint y, gint width, gint height); - void (*unmaximize) (MetaCompWindow *actor, + void (*unmaximize) (MutterWindow *actor, gint x, gint y, gint width, gint height); - void (*map) (MetaCompWindow *actor); + void (*map) (MutterWindow *actor); - void (*destroy) (MetaCompWindow *actor); + void (*destroy) (MutterWindow *actor); /* * Each actor in the list has a workspace number attached to it using - * g_object_set_data() with key META_COMPOSITOR_CLUTTER_PLUGIN_WORKSPACE_KEY; + * g_object_set_data() with key MUTTER_PLUGIN_WORKSPACE_KEY; * workspace < 0 indicates the window is sticky (i.e., on all desktops). - * TODO: Add accessor for sticky bit in new MetaCompWindow structure + * TODO: Add accessor for sticky bit in new MutterWindow structure */ void (*switch_workspace) (const GList **actors, gint from, @@ -169,7 +169,7 @@ struct MetaCompositorClutterPlugin * The events parameter is a bitmask indicating which effects are to be * killed. */ - void (*kill_effect) (MetaCompWindow *actor, + void (*kill_effect) (MutterWindow *actor, gulong events); /* @@ -202,19 +202,19 @@ struct MetaCompositorClutterPlugin }; void -meta_comp_clutter_plugin_effect_completed (MetaCompositorClutterPlugin *plugin, - MetaCompWindow *actor, +meta_comp_clutter_plugin_effect_completed (MutterPlugin *plugin, + MutterWindow *actor, unsigned long event); ClutterActor * -meta_comp_clutter_plugin_get_overlay_group (MetaCompositorClutterPlugin *plugin); +meta_comp_clutter_plugin_get_overlay_group (MutterPlugin *plugin); ClutterActor * -meta_comp_clutter_plugin_get_stage (MetaCompositorClutterPlugin *plugin); +meta_comp_clutter_plugin_get_stage (MutterPlugin *plugin); void -meta_comp_clutter_plugin_query_screen_size (MetaCompositorClutterPlugin *plugin, +meta_comp_clutter_plugin_query_screen_size (MutterPlugin *plugin, int *width, int *height); -#endif /* META_COMPOSITOR_CLUTTER_PLUGIN_H_ */ +#endif /* MUTTER_PLUGIN_H_ */