This changes the meta_compositor_clutter namespacing to simply "mutter" which

helps makes code much more readable.
This commit is contained in:
Robert Bragg 2008-10-16 12:50:01 +01:00
parent c4fe54d004
commit 2f790b0165
19 changed files with 801 additions and 803 deletions

View File

@ -535,7 +535,7 @@ src/wm-tester/Makefile
src/libmetacity-private.pc src/libmetacity-private.pc
src/tools/Makefile src/tools/Makefile
src/themes/Makefile src/themes/Makefile
src/compositor/clutter/clutter-plugins/Makefile src/compositor/mutter/plugins/Makefile
po/Makefile.in po/Makefile.in
]) ])

View File

@ -3,7 +3,7 @@ lib_LTLIBRARIES = libmetacity-private.la
SUBDIRS=wm-tester tools themes SUBDIRS=wm-tester tools themes
if WITH_CLUTTER if WITH_CLUTTER
SUBDIRS += compositor/clutter/clutter-plugins SUBDIRS += compositor/mutter/plugins
endif 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)\" 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 ui/ui.c
if WITH_CLUTTER if WITH_CLUTTER
metacity_SOURCES += \ metacity_SOURCES += \
compositor/clutter/compositor-clutter.c \ compositor/mutter/compositor-mutter.c \
compositor/clutter/compositor-clutter.h \ compositor/mutter/compositor-mutter.h \
compositor/clutter/tidy-texture-frame.c \ compositor/mutter/mutter-shaped-texture.c \
compositor/clutter/tidy-texture-frame.h \ compositor/mutter/mutter-shaped-texture.h \
compositor/clutter/shaped-texture.c \ compositor/mutter/mutter-plugin-manager.c \
compositor/clutter/shaped-texture.h \ compositor/mutter/mutter-plugin-manager.h \
include/compositor-clutter-plugin.h \ compositor/mutter/tidy/tidy-texture-frame.c \
compositor/clutter/compositor-clutter-plugin-manager.c \ compositor/mutter/tidy/tidy-texture-frame.h \
compositor/clutter/compositor-clutter-plugin-manager.h include/mutter-plugin.h
endif endif
# by setting libmetacity_private_la_CFLAGS, the files shared with # by setting libmetacity_private_la_CFLAGS, the files shared with

View File

@ -1,58 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (c) 2008 Intel Corp.
*
* Author: Tomas Frydrych <tf@linux.intel.com>
*
* 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

View File

@ -1,96 +0,0 @@
/*
* shaped texture
*
* An actor to draw a texture clipped to a list of rectangles
*
* Authored By Neil Roberts <neil@linux.intel.com>
*
* 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 <clutter/clutter-texture.h>
#include <clutter/x11/clutter-x11.h>
#ifdef HAVE_GLX_TEXTURE_PIXMAP
#include <clutter/glx/clutter-glx.h>
#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__ */

View File

@ -22,7 +22,7 @@
#include <config.h> #include <config.h>
#include "compositor-private.h" #include "compositor-private.h"
#include "compositor-xrender.h" #include "compositor-xrender.h"
#include "compositor-clutter.h" #include "compositor-mutter.h"
#include "prefs.h" #include "prefs.h"
#ifdef WITH_CLUTTER #ifdef WITH_CLUTTER
@ -37,7 +37,7 @@ meta_compositor_new (MetaDisplay *display)
/* At some point we would have a way to select between backends */ /* At some point we would have a way to select between backends */
/* return meta_compositor_xrender_new (display); */ /* return meta_compositor_xrender_new (display); */
if (meta_compositor_can_use_clutter__ && !meta_prefs_get_clutter_disabled ()) if (meta_compositor_can_use_clutter__ && !meta_prefs_get_clutter_disabled ())
return meta_compositor_clutter_new (display); return mutter_new (display);
else else
#endif #endif
return meta_compositor_xrender_new (display); return meta_compositor_xrender_new (display);

View File

@ -16,12 +16,11 @@
#include "errors.h" #include "errors.h"
#include "window.h" #include "window.h"
#include "compositor-private.h" #include "compositor-private.h"
#include "compositor-clutter.h" #include "compositor-mutter.h"
#include "compositor-clutter-plugin-manager.h" #include "mutter-plugin-manager.h"
#include "tidy-texture-frame.h" #include "tidy/tidy-texture-frame.h"
#include "xprops.h" #include "xprops.h"
#include "shaped-texture.h" #include "mutter-shaped-texture.h"
#include "tidy-texture-frame.h"
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/Xlibint.h> #include <X11/Xlibint.h>
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
@ -49,7 +48,7 @@
/* /*
* Register GType wrapper for XWindowAttributes, so we do not have to * 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 * them as a property to the constructor (so we can gracefully handle the case
* where no attributes can be retrieved). * where no attributes can be retrieved).
* *
@ -109,7 +108,7 @@ composite_at_least_version (MetaDisplay *display, int maj, int min)
} }
#endif #endif
typedef struct _MetaCompositorClutter typedef struct _Mutter
{ {
MetaCompositor compositor; MetaCompositor compositor;
MetaDisplay *display; MetaDisplay *display;
@ -122,7 +121,7 @@ typedef struct _MetaCompositorClutter
gboolean show_redraw : 1; gboolean show_redraw : 1;
gboolean debug : 1; gboolean debug : 1;
} MetaCompositorClutter; } Mutter;
typedef struct _MetaCompScreen typedef struct _MetaCompScreen
{ {
@ -137,13 +136,13 @@ typedef struct _MetaCompScreen
gint switch_workspace_in_progress; gint switch_workspace_in_progress;
MetaCompositorClutterPluginManager *plugin_mgr; MutterPluginManager *plugin_mgr;
} MetaCompScreen; } MetaCompScreen;
/* /*
* MetaCompWindow implementation * MutterWindow implementation
*/ */
struct _MetaCompWindowPrivate struct _MutterWindowPrivate
{ {
XWindowAttributes attrs; XWindowAttributes attrs;
@ -155,7 +154,7 @@ struct _MetaCompWindowPrivate
ClutterActor *shadow; ClutterActor *shadow;
Pixmap back_pixmap; Pixmap back_pixmap;
MetaCompWindowType type; MetaCompWindowType type;
Damage damage; Damage damage;
guint8 opacity; guint8 opacity;
@ -192,37 +191,37 @@ enum
PROP_MCW_X_WINDOW_ATTRIBUTES PROP_MCW_X_WINDOW_ATTRIBUTES
}; };
static void meta_comp_window_class_init (MetaCompWindowClass *klass); static void mutter_window_class_init (MutterWindowClass *klass);
static void meta_comp_window_init (MetaCompWindow *self); static void mutter_window_init (MutterWindow *self);
static void meta_comp_window_dispose (GObject *object); static void mutter_window_dispose (GObject *object);
static void meta_comp_window_finalize (GObject *object); static void mutter_window_finalize (GObject *object);
static void meta_comp_window_constructed (GObject *object); static void mutter_window_constructed (GObject *object);
static void meta_comp_window_set_property (GObject *object, static void mutter_window_set_property (GObject *object,
guint prop_id, guint prop_id,
const GValue *value, const GValue *value,
GParamSpec *pspec); GParamSpec *pspec);
static void meta_comp_window_get_property (GObject *object, static void mutter_window_get_property (GObject *object,
guint prop_id, guint prop_id,
GValue *value, GValue *value,
GParamSpec *pspec); GParamSpec *pspec);
static void meta_comp_window_query_window_type (MetaCompWindow *self); static void mutter_window_query_window_type (MutterWindow *self);
static void meta_comp_window_detach (MetaCompWindow *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 static void
meta_comp_window_class_init (MetaCompWindowClass *klass) mutter_window_class_init (MutterWindowClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
GParamSpec *pspec; 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->dispose = mutter_window_dispose;
object_class->finalize = meta_comp_window_finalize; object_class->finalize = mutter_window_finalize;
object_class->set_property = meta_comp_window_set_property; object_class->set_property = mutter_window_set_property;
object_class->get_property = meta_comp_window_get_property; object_class->get_property = mutter_window_get_property;
object_class->constructed = meta_comp_window_constructed; object_class->constructed = mutter_window_constructed;
pspec = g_param_spec_pointer ("meta-window", pspec = g_param_spec_pointer ("meta-window",
"MetaWindow", "MetaWindow",
@ -266,33 +265,33 @@ meta_comp_window_class_init (MetaCompWindowClass *klass)
} }
static void 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, priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
META_TYPE_COMP_WINDOW, MUTTER_TYPE_COMP_WINDOW,
MetaCompWindowPrivate); MutterWindowPrivate);
priv->opacity = 0xff; priv->opacity = 0xff;
} }
static gboolean is_shaped (MetaDisplay *display, Window xwindow); static gboolean is_shaped (MetaDisplay *display, Window xwindow);
static gboolean meta_comp_window_has_shadow (MetaCompWindow *self); static gboolean mutter_window_has_shadow (MutterWindow *self);
static void update_shape (MetaCompositorClutter *compositor, static void update_shape (Mutter *compositor,
MetaCompWindow *cw); MutterWindow *cw);
static void static void
meta_comp_window_constructed (GObject *object) mutter_window_constructed (GObject *object)
{ {
MetaCompWindow *self = META_COMP_WINDOW (object); MutterWindow *self = MUTTER_WINDOW (object);
MetaCompWindowPrivate *priv = self->priv; MutterWindowPrivate *priv = self->priv;
MetaScreen *screen = priv->screen; MetaScreen *screen = priv->screen;
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
Window xwindow = priv->xwindow; Window xwindow = priv->xwindow;
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
XRenderPictFormat *format; XRenderPictFormat *format;
meta_comp_window_query_window_type (self); mutter_window_query_window_type (self);
#ifdef HAVE_SHAPE #ifdef HAVE_SHAPE
/* Listen for ShapeNotify events on the window */ /* 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) if (format && format->type == PictTypeDirect && format->direct.alphaMask)
priv->argb32 = TRUE; priv->argb32 = TRUE;
if (meta_comp_window_has_shadow (self)) if (mutter_window_has_shadow (self))
{ {
MetaCompositorClutter *compositor = Mutter *compositor =
(MetaCompositorClutter*)meta_display_get_compositor (display); (Mutter*)meta_display_get_compositor (display);
priv->shadow = priv->shadow =
tidy_texture_frame_new (CLUTTER_TEXTURE (compositor->shadow_src), 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); 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); clutter_container_add_actor (CLUTTER_CONTAINER (self), priv->actor);
update_shape ((MetaCompositorClutter *) update_shape ((Mutter *)
meta_display_get_compositor (display), meta_display_get_compositor (display),
self); self);
} }
static void static void
meta_comp_window_dispose (GObject *object) mutter_window_dispose (GObject *object)
{ {
MetaCompWindow *self = META_COMP_WINDOW (object); MutterWindow *self = MUTTER_WINDOW (object);
MetaCompWindowPrivate *priv = self->priv; MutterWindowPrivate *priv = self->priv;
MetaScreen *screen; MetaScreen *screen;
MetaDisplay *display; MetaDisplay *display;
Display *xdisplay; Display *xdisplay;
@ -357,7 +356,7 @@ meta_comp_window_dispose (GObject *object)
xdisplay = meta_display_get_xdisplay (display); xdisplay = meta_display_get_xdisplay (display);
info = meta_screen_get_compositor_data (screen); info = meta_screen_get_compositor_data (screen);
meta_comp_window_detach (self); mutter_window_detach (self);
if (priv->damage != None) if (priv->damage != None)
{ {
@ -377,22 +376,22 @@ meta_comp_window_dispose (GObject *object)
info->windows = g_list_remove (info->windows, (gconstpointer) self); info->windows = g_list_remove (info->windows, (gconstpointer) self);
g_hash_table_remove (info->windows_by_xid, (gpointer) priv->xwindow); 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 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 static void
meta_comp_window_set_property (GObject *object, mutter_window_set_property (GObject *object,
guint prop_id, guint prop_id,
const GValue *value, const GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
MetaCompWindowPrivate *priv = META_COMP_WINDOW (object)->priv; MutterWindowPrivate *priv = MUTTER_WINDOW (object)->priv;
switch (prop_id) switch (prop_id)
{ {
@ -415,12 +414,12 @@ meta_comp_window_set_property (GObject *object,
} }
static void static void
meta_comp_window_get_property (GObject *object, mutter_window_get_property (GObject *object,
guint prop_id, guint prop_id,
GValue *value, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
MetaCompWindowPrivate *priv = META_COMP_WINDOW (object)->priv; MutterWindowPrivate *priv = MUTTER_WINDOW (object)->priv;
switch (prop_id) 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) find_window_for_screen (MetaScreen *screen, Window xwindow)
{ {
MetaCompScreen *info = meta_screen_get_compositor_data (screen); 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); return g_hash_table_lookup (info->windows_by_xid, (gpointer) xwindow);
} }
static MetaCompWindow * static MutterWindow *
find_window_in_display (MetaDisplay *display, Window xwindow) find_window_in_display (MetaDisplay *display, Window xwindow)
{ {
GSList *index; GSList *index;
@ -462,7 +461,7 @@ find_window_in_display (MetaDisplay *display, Window xwindow)
index; index;
index = index->next) index = index->next)
{ {
MetaCompWindow *cw = find_window_for_screen (index->data, xwindow); MutterWindow *cw = find_window_for_screen (index->data, xwindow);
if (cw != NULL) if (cw != NULL)
return cw; return cw;
@ -471,7 +470,7 @@ find_window_in_display (MetaDisplay *display, Window xwindow)
return NULL; return NULL;
} }
static MetaCompWindow * static MutterWindow *
find_window_for_child_window_in_display (MetaDisplay *display, Window xwindow) find_window_for_child_window_in_display (MetaDisplay *display, Window xwindow)
{ {
Window ignored1, *ignored2, parent; Window ignored1, *ignored2, parent;
@ -487,9 +486,9 @@ find_window_for_child_window_in_display (MetaDisplay *display, Window xwindow)
} }
static void 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; MetaScreen *screen = priv->screen;
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
Window xwindow = priv->xwindow; Window xwindow = priv->xwindow;
@ -596,9 +595,9 @@ is_shaped (MetaDisplay *display, Window xwindow)
} }
static gboolean 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) * Do not add shadows to ARGB windows (since they are probably transparent)
@ -683,7 +682,7 @@ meta_comp_window_has_shadow (MetaCompWindow *self)
} }
Window Window
meta_comp_window_get_x_window (MetaCompWindow *mcw) mutter_window_get_x_window (MutterWindow *mcw)
{ {
if (!mcw) if (!mcw)
return None; return None;
@ -692,7 +691,7 @@ meta_comp_window_get_x_window (MetaCompWindow *mcw)
} }
MetaCompWindowType MetaCompWindowType
meta_comp_window_get_window_type (MetaCompWindow *mcw) mutter_window_get_window_type (MutterWindow *mcw)
{ {
if (!mcw) if (!mcw)
return 0; return 0;
@ -701,9 +700,9 @@ meta_comp_window_get_window_type (MetaCompWindow *mcw)
} }
gint gint
meta_comp_window_get_workspace (MetaCompWindow *mcw) mutter_window_get_workspace (MutterWindow *mcw)
{ {
MetaCompWindowPrivate *priv; MutterWindowPrivate *priv;
MetaWorkspace *workspace; MetaWorkspace *workspace;
if (!mcw) if (!mcw)
@ -719,20 +718,20 @@ meta_comp_window_get_workspace (MetaCompWindow *mcw)
return meta_workspace_index (workspace); return meta_workspace_index (workspace);
} }
static void repair_win (MetaCompWindow *cw); static void repair_win (MutterWindow *cw);
static void map_win (MetaCompWindow *cw); static void map_win (MutterWindow *cw);
static void unmap_win (MetaCompWindow *cw); static void unmap_win (MutterWindow *cw);
static void static void
meta_compositor_clutter_finish_workspace_switch (MetaCompScreen *info) mutter_finish_workspace_switch (MetaCompScreen *info)
{ {
GList *last = g_list_last (info->windows); GList *last = g_list_last (info->windows);
GList *l = last; GList *l = last;
while (l) while (l)
{ {
MetaCompWindow *cw = l->data; MutterWindow *cw = l->data;
MetaCompWindowPrivate *priv = cw->priv; MutterWindowPrivate *priv = cw->priv;
if (priv->needs_map && !priv->needs_unmap) if (priv->needs_map && !priv->needs_unmap)
{ {
@ -773,17 +772,17 @@ meta_compositor_clutter_finish_workspace_switch (MetaCompScreen *info)
} }
void void
meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw, mutter_window_effect_completed (MutterWindow *cw,
gulong event) gulong event)
{ {
MetaCompWindowPrivate *priv = cw->priv; MutterWindowPrivate *priv = cw->priv;
MetaScreen *screen = priv->screen; MetaScreen *screen = priv->screen;
MetaCompScreen *info = meta_screen_get_compositor_data (screen); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
ClutterActor *actor = CLUTTER_ACTOR (cw); ClutterActor *actor = CLUTTER_ACTOR (cw);
switch (event) switch (event)
{ {
case META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE: case MUTTER_PLUGIN_MINIMIZE:
{ {
ClutterActor *a = CLUTTER_ACTOR (cw); ClutterActor *a = CLUTTER_ACTOR (cw);
gint height = clutter_actor_get_height (a); gint height = clutter_actor_get_height (a);
@ -802,7 +801,7 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw,
} }
} }
break; break;
case META_COMPOSITOR_CLUTTER_PLUGIN_MAP: case MUTTER_PLUGIN_MAP:
/* /*
* Make sure that the actor is at the correct place in case * Make sure that the actor is at the correct place in case
* the plugin fscked. * the plugin fscked.
@ -823,7 +822,7 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw,
clutter_actor_show_all (actor); clutter_actor_show_all (actor);
} }
break; break;
case META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY: case MUTTER_PLUGIN_DESTROY:
priv->destroy_in_progress--; priv->destroy_in_progress--;
if (priv->destroy_in_progress < 0) if (priv->destroy_in_progress < 0)
@ -837,7 +836,7 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw,
clutter_actor_destroy (actor); clutter_actor_destroy (actor);
} }
break; break;
case META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE: case MUTTER_PLUGIN_UNMAXIMIZE:
priv->unmaximize_in_progress--; priv->unmaximize_in_progress--;
if (priv->unmaximize_in_progress < 0) if (priv->unmaximize_in_progress < 0)
{ {
@ -848,11 +847,11 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw,
if (!priv->unmaximize_in_progress) if (!priv->unmaximize_in_progress)
{ {
clutter_actor_set_position (actor, priv->attrs.x, priv->attrs.y); clutter_actor_set_position (actor, priv->attrs.x, priv->attrs.y);
meta_comp_window_detach (cw); mutter_window_detach (cw);
repair_win (cw); repair_win (cw);
} }
break; break;
case META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE: case MUTTER_PLUGIN_MAXIMIZE:
priv->maximize_in_progress--; priv->maximize_in_progress--;
if (priv->maximize_in_progress < 0) if (priv->maximize_in_progress < 0)
{ {
@ -863,11 +862,11 @@ meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw,
if (!priv->maximize_in_progress) if (!priv->maximize_in_progress)
{ {
clutter_actor_set_position (actor, priv->attrs.x, priv->attrs.y); clutter_actor_set_position (actor, priv->attrs.x, priv->attrs.y);
meta_comp_window_detach (cw); mutter_window_detach (cw);
repair_win (cw); repair_win (cw);
} }
break; break;
case META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE: case MUTTER_PLUGIN_SWITCH_WORKSPACE:
/* FIXME -- must redo stacking order */ /* FIXME -- must redo stacking order */
info->switch_workspace_in_progress--; info->switch_workspace_in_progress--;
if (info->switch_workspace_in_progress < 0) 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) if (!info->switch_workspace_in_progress)
meta_compositor_clutter_finish_workspace_switch (info); mutter_finish_workspace_switch (info);
break; break;
default: ; default: ;
} }
@ -897,9 +896,9 @@ clutter_cmp_destroy (MetaCompositor *compositor)
* backing pixmap has actually changed. * backing pixmap has actually changed.
*/ */
static void 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; MetaScreen *screen = priv->screen;
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
@ -914,7 +913,7 @@ meta_comp_window_detach (MetaCompWindow *self)
static void static void
destroy_win (MetaDisplay *display, Window xwindow) destroy_win (MetaDisplay *display, Window xwindow)
{ {
MetaCompWindow *cw; MutterWindow *cw;
cw = find_window_in_display (display, xwindow); cw = find_window_in_display (display, xwindow);
@ -925,9 +924,9 @@ destroy_win (MetaDisplay *display, Window xwindow)
} }
static void 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; MetaScreen *screen = priv->screen;
MetaCompScreen *info = meta_screen_get_compositor_data (screen); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
Window previous_above; Window previous_above;
@ -939,7 +938,7 @@ restack_win (MetaCompWindow *cw, Window above)
if (next) if (next)
{ {
MetaCompWindow *ncw = next->data; MutterWindow *ncw = next->data;
previous_above = ncw->priv->xwindow; previous_above = ncw->priv->xwindow;
} }
@ -961,7 +960,7 @@ restack_win (MetaCompWindow *cw, Window above)
for (index = info->windows; index; index = index->next) for (index = info->windows; index; index = index->next)
{ {
MetaCompWindow *cw2 = (MetaCompWindow *) index->data; MutterWindow *cw2 = (MutterWindow *) index->data;
if (cw2->priv->xwindow == above) if (cw2->priv->xwindow == above)
break; break;
} }
@ -980,7 +979,7 @@ restack_win (MetaCompWindow *cw, Window above)
} }
static void static void
resize_win (MetaCompWindow *cw, resize_win (MutterWindow *cw,
int x, int x,
int y, int y,
int width, int width,
@ -988,10 +987,10 @@ resize_win (MetaCompWindow *cw,
int border_width, int border_width,
gboolean override_redirect) gboolean override_redirect)
{ {
MetaCompWindowPrivate *priv = cw->priv; MutterWindowPrivate *priv = cw->priv;
if (priv->attrs.width != width || priv->attrs.height != height) if (priv->attrs.width != width || priv->attrs.height != height)
meta_comp_window_detach (cw); mutter_window_detach (cw);
priv->attrs.width = width; priv->attrs.width = width;
priv->attrs.height = height; priv->attrs.height = height;
@ -1009,9 +1008,9 @@ resize_win (MetaCompWindow *cw,
} }
static void static void
map_win (MetaCompWindow *cw) map_win (MutterWindow *cw)
{ {
MetaCompWindowPrivate *priv; MutterWindowPrivate *priv;
MetaCompScreen *info; MetaCompScreen *info;
if (cw == NULL) if (cw == NULL)
@ -1030,7 +1029,7 @@ map_win (MetaCompWindow *cw)
* before we run any effects on it. * before we run any effects on it.
*/ */
priv->needs_map = FALSE; priv->needs_map = FALSE;
meta_comp_window_detach (cw); mutter_window_detach (cw);
repair_win (cw); repair_win (cw);
/* /*
@ -1051,9 +1050,9 @@ map_win (MetaCompWindow *cw)
* type is present, destroy the actor. * type is present, destroy the actor.
*/ */
if (info->switch_workspace_in_progress || !info->plugin_mgr || 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, cw,
META_COMPOSITOR_CLUTTER_PLUGIN_MAP)) MUTTER_PLUGIN_MAP))
{ {
clutter_actor_show_all (CLUTTER_ACTOR (cw)); clutter_actor_show_all (CLUTTER_ACTOR (cw));
priv->map_in_progress--; priv->map_in_progress--;
@ -1062,9 +1061,9 @@ map_win (MetaCompWindow *cw)
} }
static void static void
unmap_win (MetaCompWindow *cw) unmap_win (MutterWindow *cw)
{ {
MetaCompWindowPrivate *priv; MutterWindowPrivate *priv;
MetaCompScreen *info; MetaCompScreen *info;
if (cw == NULL) if (cw == NULL)
@ -1111,8 +1110,8 @@ add_win (MetaScreen *screen, MetaWindow *window, Window xwindow)
{ {
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
MetaCompScreen *info = meta_screen_get_compositor_data (screen); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
MetaCompWindow *cw; MutterWindow *cw;
MetaCompWindowPrivate *priv; MutterWindowPrivate *priv;
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
XWindowAttributes attrs; 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); 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, "meta-window", window,
"x-window", xwindow, "x-window", xwindow,
"meta-screen", screen, "meta-screen", screen,
@ -1206,9 +1205,9 @@ add_win (MetaScreen *screen, MetaWindow *window, Window xwindow)
} }
static void static void
repair_win (MetaCompWindow *cw) repair_win (MutterWindow *cw)
{ {
MetaCompWindowPrivate *priv = cw->priv; MutterWindowPrivate *priv = cw->priv;
MetaScreen *screen = priv->screen; MetaScreen *screen = priv->screen;
MetaDisplay *display = meta_screen_get_display (screen); MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
@ -1331,7 +1330,7 @@ repair_win (MetaCompWindow *cw)
static void static void
process_create (MetaCompositorClutter *compositor, process_create (Mutter *compositor,
XCreateWindowEvent *event, XCreateWindowEvent *event,
MetaWindow *window) MetaWindow *window)
{ {
@ -1351,7 +1350,7 @@ process_create (MetaCompositorClutter *compositor,
} }
static void static void
process_reparent (MetaCompositorClutter *compositor, process_reparent (Mutter *compositor,
XReparentEvent *event, XReparentEvent *event,
MetaWindow *window) MetaWindow *window)
{ {
@ -1374,21 +1373,21 @@ process_reparent (MetaCompositorClutter *compositor,
} }
static void static void
process_destroy (MetaCompositorClutter *compositor, process_destroy (Mutter *compositor,
XDestroyWindowEvent *event) XDestroyWindowEvent *event)
{ {
destroy_win (compositor->display, event->window); destroy_win (compositor->display, event->window);
} }
static void static void
process_damage (MetaCompositorClutter *compositor, process_damage (Mutter *compositor,
XDamageNotifyEvent *event) XDamageNotifyEvent *event)
{ {
XEvent next; XEvent next;
Display *dpy = event->display; Display *dpy = event->display;
Drawable drawable = event->drawable; Drawable drawable = event->drawable;
MetaCompWindowPrivate *priv; MutterWindowPrivate *priv;
MetaCompWindow *cw = find_window_in_display (compositor->display, drawable); MutterWindow *cw = find_window_in_display (compositor->display, drawable);
if (!cw) if (!cw)
return; return;
@ -1420,12 +1419,12 @@ process_damage (MetaCompositorClutter *compositor,
} }
static void static void
update_shape (MetaCompositorClutter *compositor, update_shape (Mutter *compositor,
MetaCompWindow *cw) 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 #ifdef HAVE_SHAPE
if (priv->shaped) if (priv->shaped)
@ -1442,7 +1441,7 @@ update_shape (MetaCompositorClutter *compositor,
if (rects) 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); n_rects, rects);
XFree (rects); XFree (rects);
@ -1453,12 +1452,12 @@ update_shape (MetaCompositorClutter *compositor,
#ifdef HAVE_SHAPE #ifdef HAVE_SHAPE
static void static void
process_shape (MetaCompositorClutter *compositor, process_shape (Mutter *compositor,
XShapeEvent *event) XShapeEvent *event)
{ {
MetaCompWindow *cw = find_window_in_display (compositor->display, MutterWindow *cw = find_window_in_display (compositor->display,
event->window); event->window);
MetaCompWindowPrivate *priv = cw->priv; MutterWindowPrivate *priv = cw->priv;
if (cw == NULL) if (cw == NULL)
return; return;
@ -1472,11 +1471,11 @@ process_shape (MetaCompositorClutter *compositor,
#endif #endif
static void static void
process_configure_notify (MetaCompositorClutter *compositor, process_configure_notify (Mutter *compositor,
XConfigureEvent *event) XConfigureEvent *event)
{ {
MetaDisplay *display = compositor->display; MetaDisplay *display = compositor->display;
MetaCompWindow *cw = find_window_in_display (display, event->window); MutterWindow *cw = find_window_in_display (display, event->window);
if (cw) if (cw)
{ {
@ -1518,15 +1517,15 @@ process_configure_notify (MetaCompositorClutter *compositor,
} }
static void static void
process_circulate_notify (MetaCompositorClutter *compositor, process_circulate_notify (Mutter *compositor,
XCirculateEvent *event) XCirculateEvent *event)
{ {
MetaCompWindow *cw = find_window_in_display (compositor->display, MutterWindow *cw = find_window_in_display (compositor->display,
event->window); event->window);
MetaCompWindow *top; MutterWindow *top;
MetaCompScreen *info; MetaCompScreen *info;
Window above; Window above;
MetaCompWindowPrivate *priv; MutterWindowPrivate *priv;
if (!cw) if (!cw)
return; return;
@ -1545,10 +1544,10 @@ process_circulate_notify (MetaCompositorClutter *compositor,
} }
static void static void
process_unmap (MetaCompositorClutter *compositor, process_unmap (Mutter *compositor,
XUnmapEvent *event) XUnmapEvent *event)
{ {
MetaCompWindow *cw; MutterWindow *cw;
Window xwin = event->window; Window xwin = event->window;
Display *dpy = event->display; Display *dpy = event->display;
@ -1563,7 +1562,7 @@ process_unmap (MetaCompositorClutter *compositor,
if (cw) if (cw)
{ {
XEvent next; XEvent next;
MetaCompWindowPrivate *priv = cw->priv; MutterWindowPrivate *priv = cw->priv;
if (priv->attrs.map_state == IsUnmapped || priv->destroy_pending) if (priv->attrs.map_state == IsUnmapped || priv->destroy_pending)
return; return;
@ -1581,11 +1580,11 @@ process_unmap (MetaCompositorClutter *compositor,
} }
static void static void
process_map (MetaCompositorClutter *compositor, process_map (Mutter *compositor,
XMapEvent *event, XMapEvent *event,
MetaWindow *window) MetaWindow *window)
{ {
MetaCompWindow *cw = find_window_in_display (compositor->display, MutterWindow *cw = find_window_in_display (compositor->display,
event->window); event->window);
if (cw) if (cw)
@ -1593,7 +1592,7 @@ process_map (MetaCompositorClutter *compositor,
} }
static void static void
process_property_notify (MetaCompositorClutter *compositor, process_property_notify (Mutter *compositor,
XPropertyEvent *event) XPropertyEvent *event)
{ {
MetaDisplay *display = compositor->display; MetaDisplay *display = compositor->display;
@ -1601,7 +1600,7 @@ process_property_notify (MetaCompositorClutter *compositor,
/* Check for the opacity changing */ /* Check for the opacity changing */
if (event->atom == compositor->atom_net_wm_window_opacity) 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; gulong value;
if (!cw) if (!cw)
@ -1633,12 +1632,12 @@ process_property_notify (MetaCompositorClutter *compositor,
else if (event->atom == meta_display_get_atom (display, else if (event->atom == meta_display_get_atom (display,
META_ATOM__NET_WM_WINDOW_TYPE)) 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) if (!cw)
return; return;
meta_comp_window_query_window_type (cw); mutter_window_query_window_type (cw);
return; return;
} }
} }
@ -1674,7 +1673,7 @@ get_output_window (MetaScreen *screen)
} }
ClutterActor * 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); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
@ -1685,7 +1684,7 @@ meta_compositor_clutter_get_stage_for_screen (MetaScreen *screen)
} }
ClutterActor * 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); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
@ -1768,7 +1767,7 @@ clutter_cmp_manage_screen (MetaCompositor *compositor,
info->plugin_mgr = 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->stage);
clutter_actor_show_all (info->overlay_group); clutter_actor_show_all (info->overlay_group);
@ -1794,7 +1793,7 @@ clutter_cmp_add_window (MetaCompositor *compositor,
XWindowAttributes *attrs) XWindowAttributes *attrs)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaCompositorClutter *xrc = (MetaCompositorClutter *) compositor; Mutter *xrc = (Mutter *) compositor;
MetaScreen *screen = meta_screen_for_x_screen (attrs->screen); MetaScreen *screen = meta_screen_for_x_screen (attrs->screen);
meta_error_trap_push (xrc->display); meta_error_trap_push (xrc->display);
@ -1828,7 +1827,7 @@ clutter_cmp_process_event (MetaCompositor *compositor,
MetaWindow *window) MetaWindow *window)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaCompositorClutter *xrc = (MetaCompositorClutter *) compositor; Mutter *xrc = (Mutter *) compositor;
if (window) if (window)
{ {
@ -1838,7 +1837,7 @@ clutter_cmp_process_event (MetaCompositor *compositor,
screen = meta_window_get_screen (window); screen = meta_window_get_screen (window);
info = meta_screen_get_compositor_data (screen); info = meta_screen_get_compositor_data (screen);
if (meta_compositor_clutter_plugin_manager_xevent_filter if (mutter_plugin_manager_xevent_filter
(info->plugin_mgr, (info->plugin_mgr,
event) == TRUE) event) == TRUE)
return; return;
@ -1938,11 +1937,11 @@ clutter_cmp_destroy_window (MetaCompositor *compositor,
MetaWindow *window) MetaWindow *window)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaCompWindow *cw = NULL; MutterWindow *cw = NULL;
MetaScreen *screen = meta_window_get_screen (window); MetaScreen *screen = meta_window_get_screen (window);
MetaCompScreen *info = meta_screen_get_compositor_data (screen); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
MetaFrame *f = meta_window_get_frame (window); MetaFrame *f = meta_window_get_frame (window);
MetaCompWindowPrivate *priv; MutterWindowPrivate *priv;
/* Chances are we actually get the window frame here */ /* Chances are we actually get the window frame here */
cw = find_window_for_screen (screen, cw = find_window_for_screen (screen,
@ -1969,9 +1968,9 @@ clutter_cmp_destroy_window (MetaCompositor *compositor,
priv->destroy_in_progress++; priv->destroy_in_progress++;
if (!info->plugin_mgr || if (!info->plugin_mgr ||
!meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr, !mutter_plugin_manager_event_simple (info->plugin_mgr,
cw, cw,
META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY)) MUTTER_PLUGIN_DESTROY))
{ {
priv->destroy_in_progress--; priv->destroy_in_progress--;
clutter_actor_destroy (CLUTTER_ACTOR (cw)); clutter_actor_destroy (CLUTTER_ACTOR (cw));
@ -1983,7 +1982,7 @@ static void
clutter_cmp_minimize_window (MetaCompositor *compositor, MetaWindow *window) clutter_cmp_minimize_window (MetaCompositor *compositor, MetaWindow *window)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaCompWindow *cw; MutterWindow *cw;
MetaCompScreen *info; MetaCompScreen *info;
MetaScreen *screen; MetaScreen *screen;
MetaFrame *f = meta_window_get_frame (window); MetaFrame *f = meta_window_get_frame (window);
@ -2005,9 +2004,9 @@ clutter_cmp_minimize_window (MetaCompositor *compositor, MetaWindow *window)
cw->priv->minimize_in_progress++; cw->priv->minimize_in_progress++;
if (!info->plugin_mgr || if (!info->plugin_mgr ||
!meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr, !mutter_plugin_manager_event_simple (info->plugin_mgr,
cw, cw,
META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE)) MUTTER_PLUGIN_MINIMIZE))
{ {
ClutterActor *a = CLUTTER_ACTOR (cw); ClutterActor *a = CLUTTER_ACTOR (cw);
gint height = clutter_actor_get_height (a); 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) gint x, gint y, gint width, gint height)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaCompWindow *cw; MutterWindow *cw;
MetaCompScreen *info; MetaCompScreen *info;
MetaScreen *screen; MetaScreen *screen;
MetaFrame *f = meta_window_get_frame (window); MetaFrame *f = meta_window_get_frame (window);
@ -2042,9 +2041,9 @@ clutter_cmp_maximize_window (MetaCompositor *compositor, MetaWindow *window,
cw->priv->maximize_in_progress++; cw->priv->maximize_in_progress++;
if (!info->plugin_mgr || if (!info->plugin_mgr ||
!meta_compositor_clutter_plugin_manager_event_maximize (info->plugin_mgr, !mutter_plugin_manager_event_maximize (info->plugin_mgr,
cw, cw,
META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE, MUTTER_PLUGIN_MAXIMIZE,
x, y, width, height)) x, y, width, height))
{ {
cw->priv->maximize_in_progress--; 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) gint x, gint y, gint width, gint height)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaCompWindow *cw; MutterWindow *cw;
MetaCompScreen *info; MetaCompScreen *info;
MetaScreen *screen; MetaScreen *screen;
MetaFrame *f = meta_window_get_frame (window); MetaFrame *f = meta_window_get_frame (window);
@ -2075,9 +2074,9 @@ clutter_cmp_unmaximize_window (MetaCompositor *compositor, MetaWindow *window,
cw->priv->unmaximize_in_progress++; cw->priv->unmaximize_in_progress++;
if (!info->plugin_mgr || if (!info->plugin_mgr ||
!meta_compositor_clutter_plugin_manager_event_maximize (info->plugin_mgr, !mutter_plugin_manager_event_maximize (info->plugin_mgr,
cw, cw,
META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE, MUTTER_PLUGIN_UNMAXIMIZE,
x, y, width, height)) x, y, width, height))
{ {
cw->priv->unmaximize_in_progress--; cw->priv->unmaximize_in_progress--;
@ -2092,7 +2091,7 @@ clutter_cmp_update_workspace_geometry (MetaCompositor *compositor,
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
MetaScreen *screen = meta_workspace_get_screen (workspace); MetaScreen *screen = meta_workspace_get_screen (workspace);
MetaCompScreen *info; MetaCompScreen *info;
MetaCompositorClutterPluginManager *mgr; MutterPluginManager *mgr;
info = meta_screen_get_compositor_data (screen); info = meta_screen_get_compositor_data (screen);
mgr = info->plugin_mgr; mgr = info->plugin_mgr;
@ -2100,7 +2099,7 @@ clutter_cmp_update_workspace_geometry (MetaCompositor *compositor,
if (!mgr || !workspace) if (!mgr || !workspace)
return; return;
meta_compositor_clutter_plugin_manager_update_workspace (mgr, workspace); mutter_plugin_manager_update_workspace (mgr, workspace);
#endif #endif
} }
@ -2125,7 +2124,7 @@ clutter_cmp_switch_workspace (MetaCompositor *compositor,
l = info->windows; l = info->windows;
while (l) while (l)
{ {
MetaCompWindow *cw = l->data; MutterWindow *cw = l->data;
MetaWindow *mw = cw->priv->window; MetaWindow *mw = cw->priv->window;
gboolean sticky; gboolean sticky;
gint workspace = -1; gint workspace = -1;
@ -2160,7 +2159,7 @@ clutter_cmp_switch_workspace (MetaCompositor *compositor,
info->switch_workspace_in_progress++; info->switch_workspace_in_progress++;
if (!info->plugin_mgr || if (!info->plugin_mgr ||
!meta_compositor_clutter_plugin_manager_switch_workspace ( !mutter_plugin_manager_switch_workspace (
info->plugin_mgr, info->plugin_mgr,
(const GList **)&info->windows, (const GList **)&info->windows,
from_indx, from_indx,
@ -2192,7 +2191,7 @@ static MetaCompositor comp_info = {
}; };
MetaCompositor * MetaCompositor *
meta_compositor_clutter_new (MetaDisplay *display) mutter_new (MetaDisplay *display)
{ {
#ifdef HAVE_COMPOSITE_EXTENSIONS #ifdef HAVE_COMPOSITE_EXTENSIONS
char *atom_names[] = { char *atom_names[] = {
@ -2201,7 +2200,7 @@ meta_compositor_clutter_new (MetaDisplay *display)
"_NET_WM_WINDOW_OPACITY", "_NET_WM_WINDOW_OPACITY",
}; };
Atom atoms[G_N_ELEMENTS(atom_names)]; Atom atoms[G_N_ELEMENTS(atom_names)];
MetaCompositorClutter *clc; Mutter *clc;
MetaCompositor *compositor; MetaCompositor *compositor;
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
guchar *data; guchar *data;
@ -2209,7 +2208,7 @@ meta_compositor_clutter_new (MetaDisplay *display)
if (!composite_at_least_version (display, 0, 3)) if (!composite_at_least_version (display, 0, 3))
return NULL; return NULL;
clc = g_new0 (MetaCompositorClutter, 1); clc = g_new0 (Mutter, 1);
clc->compositor = comp_info; clc->compositor = comp_info;
compositor = (MetaCompositor *) clc; compositor = (MetaCompositor *) clc;

View File

@ -21,8 +21,7 @@
* 02111-1307, USA. * 02111-1307, USA.
*/ */
#include "compositor-clutter-plugin-manager.h" #include "mutter-plugin-manager.h"
#include "compositor-clutter.h"
#include "prefs.h" #include "prefs.h"
#include "errors.h" #include "errors.h"
#include "workspace.h" #include "workspace.h"
@ -30,10 +29,10 @@
#include <gmodule.h> #include <gmodule.h>
#include <string.h> #include <string.h>
static gboolean meta_compositor_clutter_plugin_manager_reload ( static gboolean mutter_plugin_manager_reload (
MetaCompositorClutterPluginManager *plugin_mgr); MutterPluginManager *plugin_mgr);
struct MetaCompositorClutterPluginManager struct MutterPluginManager
{ {
MetaScreen *screen; MetaScreen *screen;
@ -43,19 +42,19 @@ struct MetaCompositorClutterPluginManager
guint idle_unload_id; guint idle_unload_id;
}; };
typedef struct MetaCompositorClutterPluginPrivate typedef struct MutterPluginPrivate
{ {
char *name; char *name;
MetaCompositorClutterPluginManager *self; MutterPluginManager *self;
GModule *module; GModule *module;
gulong features; gulong features;
gboolean disabled : 1; gboolean disabled : 1;
} MetaCompositorClutterPluginPrivate; } MutterPluginPrivate;
static void static void
free_plugin_workspaces (MetaCompositorClutterPlugin *plugin) free_plugin_workspaces (MutterPlugin *plugin)
{ {
GList *l; GList *l;
@ -81,7 +80,7 @@ free_plugin_workspaces (MetaCompositorClutterPlugin *plugin)
*/ */
static void static void
update_plugin_workspaces (MetaScreen *screen, update_plugin_workspaces (MetaScreen *screen,
MetaCompositorClutterPlugin *plugin) MutterPlugin *plugin)
{ {
GList *l, *l2 = NULL; GList *l, *l2 = NULL;
@ -132,22 +131,22 @@ parse_disable_params (const char *params, gulong features)
*p = 0; *p = 0;
if (strstr (d, "minimize")) if (strstr (d, "minimize"))
features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE; features &= ~ MUTTER_PLUGIN_MINIMIZE;
if (strstr (d, "maximize")) if (strstr (d, "maximize"))
features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE; features &= ~ MUTTER_PLUGIN_MAXIMIZE;
if (strstr (d, "unmaximize")) if (strstr (d, "unmaximize"))
features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE; features &= ~ MUTTER_PLUGIN_UNMAXIMIZE;
if (strstr (d, "map")) if (strstr (d, "map"))
features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MAP; features &= ~ MUTTER_PLUGIN_MAP;
if (strstr (d, "destroy")) if (strstr (d, "destroy"))
features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY; features &= ~ MUTTER_PLUGIN_DESTROY;
if (strstr (d, "switch-workspace")) if (strstr (d, "switch-workspace"))
features &= ~META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE; features &= ~MUTTER_PLUGIN_SWITCH_WORKSPACE;
g_free (d); 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 * Checks that the plugin is compatible with the WM and sets up the plugin
* struct. * struct.
*/ */
static MetaCompositorClutterPlugin * static MutterPlugin *
meta_compositor_clutter_plugin_load ( mutter_plugin_load (
MetaCompositorClutterPluginManager *plugin_mgr, MutterPluginManager *plugin_mgr,
GModule *module, GModule *module,
const gchar *params) 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) 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->name = _(plugin->name);
priv->module = module; priv->module = module;
priv->self = plugin_mgr; priv->self = plugin_mgr;
@ -213,9 +212,9 @@ meta_compositor_clutter_plugin_load (
* removal later. * removal later.
*/ */
static gboolean static gboolean
meta_compositor_clutter_plugin_unload (MetaCompositorClutterPlugin *plugin) mutter_plugin_unload (MutterPlugin *plugin)
{ {
MetaCompositorClutterPluginPrivate *priv; MutterPluginPrivate *priv;
GModule *module; GModule *module;
priv = plugin->manager_private; priv = plugin->manager_private;
@ -240,17 +239,17 @@ meta_compositor_clutter_plugin_unload (MetaCompositorClutterPlugin *plugin)
* pending for removal. * pending for removal.
*/ */
static gboolean static gboolean
meta_compositor_clutter_plugin_manager_idle_unload ( mutter_plugin_manager_idle_unload (
MetaCompositorClutterPluginManager *plugin_mgr) MutterPluginManager *plugin_mgr)
{ {
GList *l = plugin_mgr->unload; GList *l = plugin_mgr->unload;
gboolean dont_remove = TRUE; gboolean dont_remove = TRUE;
while (l) 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 */ /* Remove from list */
GList *p = l->prev; GList *p = l->prev;
@ -286,24 +285,24 @@ meta_compositor_clutter_plugin_manager_idle_unload (
* Unloads all plugins * Unloads all plugins
*/ */
static void static void
meta_compositor_clutter_plugin_manager_unload ( mutter_plugin_manager_unload (
MetaCompositorClutterPluginManager *plugin_mgr) MutterPluginManager *plugin_mgr)
{ {
GList *plugins = plugin_mgr->plugins; GList *plugins = plugin_mgr->plugins;
while (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 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); plugin_mgr->unload = g_list_prepend (plugin_mgr->unload, plugin);
if (!plugin_mgr->idle_unload_id) if (!plugin_mgr->idle_unload_id)
{ {
plugin_mgr->idle_unload_id = g_idle_add ((GSourceFunc) plugin_mgr->idle_unload_id = g_idle_add ((GSourceFunc)
meta_compositor_clutter_plugin_manager_idle_unload, mutter_plugin_manager_idle_unload,
plugin_mgr); plugin_mgr);
} }
} }
@ -319,15 +318,15 @@ static void
prefs_changed_callback (MetaPreference pref, prefs_changed_callback (MetaPreference pref,
void *data) void *data)
{ {
MetaCompositorClutterPluginManager *plugin_mgr = data; MutterPluginManager *plugin_mgr = data;
if (pref == META_PREF_CLUTTER_PLUGINS) 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) 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. * Loads all plugins listed in gconf registry.
*/ */
static gboolean static gboolean
meta_compositor_clutter_plugin_manager_load ( mutter_plugin_manager_load (MutterPluginManager *plugin_mgr)
MetaCompositorClutterPluginManager *plugin_mgr)
{ {
const gchar *dpath = METACITY_PKGLIBDIR "/plugins/clutter/"; const gchar *dpath = METACITY_PKGLIBDIR "/plugins/clutter/";
GSList *plugins, *fallback = NULL; GSList *plugins, *fallback = NULL;
@ -376,10 +374,9 @@ meta_compositor_clutter_plugin_manager_load (
if ((plugin = g_module_open (path, 0))) if ((plugin = g_module_open (path, 0)))
{ {
MetaCompositorClutterPlugin *p; MutterPlugin *p;
if ((p = meta_compositor_clutter_plugin_load (plugin_mgr, if ((p = mutter_plugin_load (plugin_mgr, plugin, params)))
plugin, params)))
plugin_mgr->plugins = g_list_prepend (plugin_mgr->plugins, p); plugin_mgr->plugins = g_list_prepend (plugin_mgr->plugins, p);
else else
{ {
@ -414,27 +411,27 @@ meta_compositor_clutter_plugin_manager_load (
* Reloads all plugins * Reloads all plugins
*/ */
static gboolean static gboolean
meta_compositor_clutter_plugin_manager_reload ( mutter_plugin_manager_reload (
MetaCompositorClutterPluginManager *plugin_mgr) MutterPluginManager *plugin_mgr)
{ {
/* TODO -- brute force; should we build a list of plugins to load and list of /* 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 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. * plugins loaded at the same time, so it might not be worth it.
*/ */
meta_compositor_clutter_plugin_manager_unload (plugin_mgr); mutter_plugin_manager_unload (plugin_mgr);
return meta_compositor_clutter_plugin_manager_load (plugin_mgr); return mutter_plugin_manager_load (plugin_mgr);
} }
static gboolean static gboolean
meta_compositor_clutter_plugin_manager_init ( mutter_plugin_manager_init (
MetaCompositorClutterPluginManager *plugin_mgr) MutterPluginManager *plugin_mgr)
{ {
return meta_compositor_clutter_plugin_manager_load (plugin_mgr); return mutter_plugin_manager_load (plugin_mgr);
} }
void void
meta_compositor_clutter_plugin_manager_update_workspace ( mutter_plugin_manager_update_workspace (
MetaCompositorClutterPluginManager *plugin_mgr, MetaWorkspace *workspace) MutterPluginManager *plugin_mgr, MetaWorkspace *workspace)
{ {
GList *l; GList *l;
gint index; gint index;
@ -444,7 +441,7 @@ meta_compositor_clutter_plugin_manager_update_workspace (
while (l) while (l)
{ {
MetaCompositorClutterPlugin *plugin = l->data; MutterPlugin *plugin = l->data;
MetaRectangle *rect = g_list_nth_data (plugin->work_areas, index); MetaRectangle *rect = g_list_nth_data (plugin->work_areas, index);
if (rect) if (rect)
@ -463,15 +460,15 @@ meta_compositor_clutter_plugin_manager_update_workspace (
} }
void void
meta_compositor_clutter_plugin_manager_update_workspaces ( mutter_plugin_manager_update_workspaces (
MetaCompositorClutterPluginManager *plugin_mgr) MutterPluginManager *plugin_mgr)
{ {
GList *l; GList *l;
l = plugin_mgr->plugins; l = plugin_mgr->plugins;
while (l) while (l)
{ {
MetaCompositorClutterPlugin *plugin = l->data; MutterPlugin *plugin = l->data;
update_plugin_workspaces (plugin_mgr->screen, plugin); update_plugin_workspaces (plugin_mgr->screen, plugin);
@ -479,16 +476,16 @@ meta_compositor_clutter_plugin_manager_update_workspaces (
} }
} }
MetaCompositorClutterPluginManager * MutterPluginManager *
meta_compositor_clutter_plugin_manager_new (MetaScreen *screen) 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; plugin_mgr->screen = screen;
if (!meta_compositor_clutter_plugin_manager_init (plugin_mgr)) if (!mutter_plugin_manager_init (plugin_mgr))
{ {
g_free (plugin_mgr); g_free (plugin_mgr);
plugin_mgr = NULL; plugin_mgr = NULL;
@ -498,17 +495,17 @@ meta_compositor_clutter_plugin_manager_new (MetaScreen *screen)
} }
static void static void
meta_compositor_clutter_plugin_manager_kill_effect ( mutter_plugin_manager_kill_effect (
MetaCompositorClutterPluginManager *plugin_mgr, MutterPluginManager *plugin_mgr,
MetaCompWindow *actor, MutterWindow *actor,
unsigned long events) unsigned long events)
{ {
GList *l = plugin_mgr->plugins; GList *l = plugin_mgr->plugins;
while (l) while (l)
{ {
MetaCompositorClutterPlugin *plugin = l->data; MutterPlugin *plugin = l->data;
MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; MutterPluginPrivate *priv = plugin->manager_private;
if (!priv->disabled if (!priv->disabled
&& (plugin->features & events) && (plugin->features & events)
@ -520,8 +517,8 @@ meta_compositor_clutter_plugin_manager_kill_effect (
} }
#define ALL_BUT_SWITCH \ #define ALL_BUT_SWITCH \
META_COMPOSITOR_CLUTTER_PLUGIN_ALL_EFFECTS & \ MUTTER_PLUGIN_ALL_EFFECTS & \
~META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE ~MUTTER_PLUGIN_SWITCH_WORKSPACE
/* /*
* Public method that the compositor hooks into for events that require * Public method that the compositor hooks into for events that require
* no additional parameters. * no additional parameters.
@ -532,9 +529,9 @@ meta_compositor_clutter_plugin_manager_kill_effect (
* appropriate post-effect cleanup is carried out. * appropriate post-effect cleanup is carried out.
*/ */
gboolean gboolean
meta_compositor_clutter_plugin_manager_event_simple ( mutter_plugin_manager_event_simple (
MetaCompositorClutterPluginManager *plugin_mgr, MutterPluginManager *plugin_mgr,
MetaCompWindow *actor, MutterWindow *actor,
unsigned long event) unsigned long event)
{ {
GList *l = plugin_mgr->plugins; GList *l = plugin_mgr->plugins;
@ -542,8 +539,8 @@ meta_compositor_clutter_plugin_manager_event_simple (
while (l) while (l)
{ {
MetaCompositorClutterPlugin *plugin = l->data; MutterPlugin *plugin = l->data;
MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; MutterPluginPrivate *priv = plugin->manager_private;
if (!priv->disabled && (plugin->features & event)) if (!priv->disabled && (plugin->features & event))
{ {
@ -551,10 +548,10 @@ meta_compositor_clutter_plugin_manager_event_simple (
switch (event) switch (event)
{ {
case META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE: case MUTTER_PLUGIN_MINIMIZE:
if (plugin->minimize) if (plugin->minimize)
{ {
meta_compositor_clutter_plugin_manager_kill_effect ( mutter_plugin_manager_kill_effect (
plugin_mgr, plugin_mgr,
actor, actor,
ALL_BUT_SWITCH); ALL_BUT_SWITCH);
@ -562,10 +559,10 @@ meta_compositor_clutter_plugin_manager_event_simple (
plugin->minimize (actor); plugin->minimize (actor);
} }
break; break;
case META_COMPOSITOR_CLUTTER_PLUGIN_MAP: case MUTTER_PLUGIN_MAP:
if (plugin->map) if (plugin->map)
{ {
meta_compositor_clutter_plugin_manager_kill_effect ( mutter_plugin_manager_kill_effect (
plugin_mgr, plugin_mgr,
actor, actor,
ALL_BUT_SWITCH); ALL_BUT_SWITCH);
@ -573,7 +570,7 @@ meta_compositor_clutter_plugin_manager_event_simple (
plugin->map (actor); plugin->map (actor);
} }
break; break;
case META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY: case MUTTER_PLUGIN_DESTROY:
if (plugin->destroy) if (plugin->destroy)
{ {
plugin->destroy (actor); plugin->destroy (actor);
@ -600,9 +597,9 @@ meta_compositor_clutter_plugin_manager_event_simple (
* appropriate post-effect cleanup is carried out. * appropriate post-effect cleanup is carried out.
*/ */
gboolean gboolean
meta_compositor_clutter_plugin_manager_event_maximize ( mutter_plugin_manager_event_maximize (
MetaCompositorClutterPluginManager *plugin_mgr, MutterPluginManager *plugin_mgr,
MetaCompWindow *actor, MutterWindow *actor,
unsigned long event, unsigned long event,
gint target_x, gint target_x,
gint target_y, gint target_y,
@ -614,8 +611,8 @@ meta_compositor_clutter_plugin_manager_event_maximize (
while (l) while (l)
{ {
MetaCompositorClutterPlugin *plugin = l->data; MutterPlugin *plugin = l->data;
MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; MutterPluginPrivate *priv = plugin->manager_private;
if (!priv->disabled && (plugin->features & event)) if (!priv->disabled && (plugin->features & event))
{ {
@ -623,10 +620,10 @@ meta_compositor_clutter_plugin_manager_event_maximize (
switch (event) switch (event)
{ {
case META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE: case MUTTER_PLUGIN_MAXIMIZE:
if (plugin->maximize) if (plugin->maximize)
{ {
meta_compositor_clutter_plugin_manager_kill_effect ( mutter_plugin_manager_kill_effect (
plugin_mgr, plugin_mgr,
actor, actor,
ALL_BUT_SWITCH); ALL_BUT_SWITCH);
@ -636,10 +633,10 @@ meta_compositor_clutter_plugin_manager_event_maximize (
target_width, target_height); target_width, target_height);
} }
break; break;
case META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE: case MUTTER_PLUGIN_UNMAXIMIZE:
if (plugin->unmaximize) if (plugin->unmaximize)
{ {
meta_compositor_clutter_plugin_manager_kill_effect ( mutter_plugin_manager_kill_effect (
plugin_mgr, plugin_mgr,
actor, actor,
ALL_BUT_SWITCH); ALL_BUT_SWITCH);
@ -668,8 +665,8 @@ meta_compositor_clutter_plugin_manager_event_maximize (
* appropriate post-effect cleanup is carried out. * appropriate post-effect cleanup is carried out.
*/ */
gboolean gboolean
meta_compositor_clutter_plugin_manager_switch_workspace ( mutter_plugin_manager_switch_workspace (
MetaCompositorClutterPluginManager *plugin_mgr, MutterPluginManager *plugin_mgr,
const GList **actors, const GList **actors,
gint from, gint from,
gint to, gint to,
@ -680,20 +677,20 @@ meta_compositor_clutter_plugin_manager_switch_workspace (
while (l) while (l)
{ {
MetaCompositorClutterPlugin *plugin = l->data; MutterPlugin *plugin = l->data;
MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; MutterPluginPrivate *priv = plugin->manager_private;
if (!priv->disabled && if (!priv->disabled &&
(plugin->features & META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE) && (plugin->features & MUTTER_PLUGIN_SWITCH_WORKSPACE) &&
(actors && *actors)) (actors && *actors))
{ {
if (plugin->switch_workspace) if (plugin->switch_workspace)
{ {
retval = TRUE; retval = TRUE;
meta_compositor_clutter_plugin_manager_kill_effect ( mutter_plugin_manager_kill_effect (
plugin_mgr, plugin_mgr,
META_COMP_WINDOW ((*actors)->data), MUTTER_WINDOW ((*actors)->data),
META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); MUTTER_PLUGIN_SWITCH_WORKSPACE);
plugin->switch_workspace (actors, from, to, direction); 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. * appropriate post-effect cleanup is carried out.
*/ */
gboolean gboolean
meta_compositor_clutter_plugin_manager_xevent_filter ( mutter_plugin_manager_xevent_filter (
MetaCompositorClutterPluginManager *plugin_mgr, XEvent *xev) MutterPluginManager *plugin_mgr, XEvent *xev)
{ {
GList *l; GList *l;
@ -726,7 +723,7 @@ meta_compositor_clutter_plugin_manager_xevent_filter (
while (l) while (l)
{ {
MetaCompositorClutterPlugin *plugin = l->data; MutterPlugin *plugin = l->data;
if (plugin->xevent_filter) 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 * ClutterActor *
meta_comp_clutter_plugin_get_overlay_group (MetaCompositorClutterPlugin *plugin) meta_comp_clutter_plugin_get_overlay_group (MutterPlugin *plugin)
{ {
MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; MutterPluginPrivate *priv = plugin->manager_private;
MetaCompositorClutterPluginManager *plugin_mgr = priv->self; 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 * ClutterActor *
meta_comp_clutter_plugin_get_stage (MetaCompositorClutterPlugin *plugin) meta_comp_clutter_plugin_get_stage (MutterPlugin *plugin)
{ {
MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; MutterPluginPrivate *priv = plugin->manager_private;
MetaCompositorClutterPluginManager *plugin_mgr = priv->self; 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 void
meta_comp_clutter_plugin_effect_completed (MetaCompositorClutterPlugin *plugin, meta_comp_clutter_plugin_effect_completed (MutterPlugin *plugin,
MetaCompWindow *actor, MutterWindow *actor,
unsigned long event) unsigned long event)
{ {
if (!actor) if (!actor)
@ -772,16 +769,16 @@ meta_comp_clutter_plugin_effect_completed (MetaCompositorClutterPlugin *plugin,
(plugin && plugin->name) ? plugin->name : "unknown"); (plugin && plugin->name) ? plugin->name : "unknown");
} }
meta_compositor_clutter_window_effect_completed (actor, event); mutter_window_effect_completed (actor, event);
} }
void void
meta_comp_clutter_plugin_query_screen_size (MetaCompositorClutterPlugin *plugin, meta_comp_clutter_plugin_query_screen_size (MutterPlugin *plugin,
int *width, int *width,
int *height) int *height)
{ {
MetaCompositorClutterPluginPrivate *priv = plugin->manager_private; MutterPluginPrivate *priv = plugin->manager_private;
MetaCompositorClutterPluginManager *plugin_mgr = priv->self; MutterPluginManager *plugin_mgr = priv->self;
meta_screen_get_size (plugin_mgr->screen, width, height); meta_screen_get_size (plugin_mgr->screen, width, height);
} }

View File

@ -0,0 +1,58 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (c) 2008 Intel Corp.
*
* Author: Tomas Frydrych <tf@linux.intel.com>
*
* 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

View File

@ -33,28 +33,28 @@
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include <string.h> #include <string.h>
#include "shaped-texture.h" #include "mutter-shaped-texture.h"
static void meta_shaped_texture_dispose (GObject *object); static void mutter_shaped_texture_dispose (GObject *object);
static void meta_shaped_texture_finalize (GObject *object); static void mutter_shaped_texture_finalize (GObject *object);
static void meta_shaped_texture_paint (ClutterActor *actor); static void mutter_shaped_texture_paint (ClutterActor *actor);
static void meta_shaped_texture_pick (ClutterActor *actor, static void mutter_shaped_texture_pick (ClutterActor *actor,
const ClutterColor *color); 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 #ifdef HAVE_GLX_TEXTURE_PIXMAP
G_DEFINE_TYPE (MetaShapedTexture, meta_shaped_texture, G_DEFINE_TYPE (MutterShapedTexture, mutter_shaped_texture,
CLUTTER_GLX_TYPE_TEXTURE_PIXMAP); CLUTTER_GLX_TYPE_TEXTURE_PIXMAP);
#else /* HAVE_GLX_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); CLUTTER_X11_TYPE_TEXTURE_PIXMAP);
#endif /* HAVE_GLX_TEXTURE_PIXMAP */ #endif /* HAVE_GLX_TEXTURE_PIXMAP */
#define META_SHAPED_TEXTURE_GET_PRIVATE(obj) \ #define MUTTER_SHAPED_TEXTURE_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_SHAPED_TEXTURE, \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MUTTER_TYPE_SHAPED_TEXTURE, \
MetaShapedTexturePrivate)) MutterShapedTexturePrivate))
enum TstMultiTexSupport enum TstMultiTexSupport
{ {
@ -72,7 +72,7 @@ typedef void (* TstClientActiveTextureFunc) (GLenum texture);
static TstActiveTextureFunc tst_active_texture; static TstActiveTextureFunc tst_active_texture;
static TstClientActiveTextureFunc tst_client_active_texture; static TstClientActiveTextureFunc tst_client_active_texture;
struct _MetaShapedTexturePrivate struct _MutterShapedTexturePrivate
{ {
CoglHandle mask_texture; CoglHandle mask_texture;
@ -84,26 +84,26 @@ struct _MetaShapedTexturePrivate
}; };
static void static void
meta_shaped_texture_class_init (MetaShapedTextureClass *klass) mutter_shaped_texture_class_init (MutterShapedTextureClass *klass)
{ {
GObjectClass *gobject_class = (GObjectClass *) klass; GObjectClass *gobject_class = (GObjectClass *) klass;
ClutterActorClass *actor_class = (ClutterActorClass *) klass; ClutterActorClass *actor_class = (ClutterActorClass *) klass;
gobject_class->dispose = meta_shaped_texture_dispose; gobject_class->dispose = mutter_shaped_texture_dispose;
gobject_class->finalize = meta_shaped_texture_finalize; gobject_class->finalize = mutter_shaped_texture_finalize;
actor_class->paint = meta_shaped_texture_paint; actor_class->paint = mutter_shaped_texture_paint;
actor_class->pick = meta_shaped_texture_pick; 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 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)); priv->rectangles = g_array_new (FALSE, FALSE, sizeof (XRectangle));
@ -111,30 +111,30 @@ meta_shaped_texture_init (MetaShapedTexture *self)
} }
static void 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 static void
meta_shaped_texture_finalize (GObject *object) mutter_shaped_texture_finalize (GObject *object)
{ {
MetaShapedTexture *self = (MetaShapedTexture *) object; MutterShapedTexture *self = (MutterShapedTexture *) object;
MetaShapedTexturePrivate *priv = self->priv; MutterShapedTexturePrivate *priv = self->priv;
g_array_free (priv->rectangles, TRUE); 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 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) if (priv->mask_texture != COGL_INVALID_HANDLE)
{ {
@ -144,7 +144,7 @@ meta_shaped_texture_dirty_mask (MetaShapedTexture *stex)
} }
static gboolean static gboolean
meta_shaped_texture_is_multi_tex_supported (void) mutter_shaped_texture_is_multi_tex_supported (void)
{ {
const gchar *extensions; const gchar *extensions;
GLint max_tex_units = 0; GLint max_tex_units = 0;
@ -179,9 +179,9 @@ meta_shaped_texture_is_multi_tex_supported (void)
} }
static void static void
meta_shaped_texture_set_coord_array (GLfloat x1, GLfloat y1, mutter_shaped_texture_set_coord_array (GLfloat x1, GLfloat y1,
GLfloat x2, GLfloat y2, GLfloat x2, GLfloat y2,
GLfloat *coords) GLfloat *coords)
{ {
coords[0] = x1; coords[0] = x1;
coords[1] = y2; coords[1] = y2;
@ -194,9 +194,9 @@ meta_shaped_texture_set_coord_array (GLfloat x1, GLfloat y1,
} }
static void static void
meta_shaped_texture_get_gl_size (CoglHandle tex, mutter_shaped_texture_get_gl_size (CoglHandle tex,
guint *width, guint *width,
guint *height) guint *height)
{ {
/* glGetTexLevelParameteriv isn't supported on GL ES so we need to /* glGetTexLevelParameteriv isn't supported on GL ES so we need to
calculate the size that Cogl has used */ calculate the size that Cogl has used */
@ -227,9 +227,9 @@ meta_shaped_texture_get_gl_size (CoglHandle tex,
} }
static void 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; CoglHandle paint_tex;
guint tex_width, tex_height; guint tex_width, tex_height;
GLuint mask_gl_tex; GLuint mask_gl_tex;
@ -246,7 +246,7 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex)
recreate it */ recreate it */
if (priv->mask_texture != COGL_INVALID_HANDLE if (priv->mask_texture != COGL_INVALID_HANDLE
&& (priv->mask_width != tex_width || priv->mask_height != tex_height)) && (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 we don't have a mask texture yet then create one */
if (priv->mask_texture == COGL_INVALID_HANDLE) 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); cogl_texture_get_gl_texture (priv->mask_texture, &mask_gl_tex, NULL);
meta_shaped_texture_get_gl_size (priv->mask_texture, mutter_shaped_texture_get_gl_size (priv->mask_texture,
&priv->mask_gl_width, &priv->mask_gl_width,
&priv->mask_gl_height); &priv->mask_gl_height);
if ((guint) priv->mask_gl_width == tex_width if ((guint) priv->mask_gl_width == tex_width
&& (guint) priv->mask_gl_height == tex_height) && (guint) priv->mask_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,
priv->mask_tex_coords); priv->mask_tex_coords);
else else
meta_shaped_texture_set_coord_array (0.0f, 0.0f, mutter_shaped_texture_set_coord_array (0.0f, 0.0f,
tex_width tex_width
/ (GLfloat) priv->mask_gl_width, / (GLfloat) priv->mask_gl_width,
tex_height tex_height
/ (GLfloat) priv->mask_gl_height, / (GLfloat) priv->mask_gl_height,
priv->mask_tex_coords); priv->mask_tex_coords);
} }
} }
static void static void
meta_shaped_texture_paint (ClutterActor *actor) mutter_shaped_texture_paint (ClutterActor *actor)
{ {
MetaShapedTexture *stex = (MetaShapedTexture *) actor; MutterShapedTexture *stex = (MutterShapedTexture *) actor;
MetaShapedTexturePrivate *priv = stex->priv; MutterShapedTexturePrivate *priv = stex->priv;
CoglHandle paint_tex; CoglHandle paint_tex;
guint tex_width, tex_height; guint tex_width, tex_height;
GLboolean texture_was_enabled, blend_was_enabled; 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, /* If there are no rectangles or multi-texturing isn't supported,
fallback to the regular paint method */ fallback to the regular paint method */
if (priv->rectangles->len < 1 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); ->paint (actor);
return; return;
} }
@ -348,7 +348,7 @@ meta_shaped_texture_paint (ClutterActor *actor)
/* If the texture is sliced then the multitexturing won't work */ /* If the texture is sliced then the multitexturing won't work */
if (cogl_texture_is_sliced (paint_tex)) 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); ->paint (actor);
return; return;
} }
@ -356,7 +356,7 @@ meta_shaped_texture_paint (ClutterActor *actor)
tex_width = cogl_texture_get_width (paint_tex); tex_width = cogl_texture_get_width (paint_tex);
tex_height = cogl_texture_get_height (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 (paint_tex, &paint_gl_tex, NULL);
cogl_texture_get_gl_texture (priv->mask_texture, &mask_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 /* We need the actual size of the texture so that we can calculate
the right texture coordinates if NPOTs textures are not supported the right texture coordinates if NPOTs textures are not supported
and Cogl has oversized the texture */ 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_width,
&paint_gl_height); &paint_gl_height);
@ -412,24 +412,24 @@ meta_shaped_texture_paint (ClutterActor *actor)
clutter_actor_get_allocation_box (actor, &alloc); clutter_actor_get_allocation_box (actor, &alloc);
meta_shaped_texture_set_coord_array (0, 0, mutter_shaped_texture_set_coord_array (0, 0,
CLUTTER_UNITS_TO_FLOAT (alloc.x2 CLUTTER_UNITS_TO_FLOAT (alloc.x2
- alloc.x1), - alloc.x1),
CLUTTER_UNITS_TO_FLOAT (alloc.y2 CLUTTER_UNITS_TO_FLOAT (alloc.y2
- alloc.y1), - alloc.y1),
vertex_coords); vertex_coords);
if ((guint) paint_gl_width == tex_width if ((guint) paint_gl_width == tex_width
&& (guint) paint_gl_height == tex_height) && (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); paint_tex_coords);
else else
meta_shaped_texture_set_coord_array (0.0f, 0.0f, mutter_shaped_texture_set_coord_array (0.0f, 0.0f,
tex_width tex_width
/ (GLfloat) paint_gl_width, / (GLfloat) paint_gl_width,
tex_height tex_height
/ (GLfloat) paint_gl_height, / (GLfloat) paint_gl_height,
paint_tex_coords); paint_tex_coords);
glDrawArrays (GL_TRIANGLE_STRIP, 0, 4); glDrawArrays (GL_TRIANGLE_STRIP, 0, 4);
@ -455,16 +455,16 @@ meta_shaped_texture_paint (ClutterActor *actor)
} }
static void static void
meta_shaped_texture_pick (ClutterActor *actor, mutter_shaped_texture_pick (ClutterActor *actor,
const ClutterColor *color) const ClutterColor *color)
{ {
MetaShapedTexture *stex = (MetaShapedTexture *) actor; MutterShapedTexture *stex = (MutterShapedTexture *) actor;
MetaShapedTexturePrivate *priv = stex->priv; MutterShapedTexturePrivate *priv = stex->priv;
/* If there are no rectangles then use the regular pick */ /* If there are no rectangles then use the regular pick */
if (priv->rectangles->len < 1 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)
->pick (actor, color); ->pick (actor, color);
else if (clutter_actor_should_pick_paint (actor)) else if (clutter_actor_should_pick_paint (actor))
{ {
@ -476,7 +476,7 @@ meta_shaped_texture_pick (ClutterActor *actor,
if (paint_tex == COGL_INVALID_HANDLE) if (paint_tex == COGL_INVALID_HANDLE)
return; return;
meta_shaped_texture_ensure_mask (stex); mutter_shaped_texture_ensure_mask (stex);
cogl_color (color); cogl_color (color);
@ -492,49 +492,49 @@ meta_shaped_texture_pick (ClutterActor *actor,
} }
ClutterActor * 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; return self;
} }
void 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; priv = stex->priv;
g_array_set_size (priv->rectangles, 0); 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)); clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
} }
void void
meta_shaped_texture_add_rectangle (MetaShapedTexture *stex, mutter_shaped_texture_add_rectangle (MutterShapedTexture *stex,
const XRectangle *rect) 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 void
meta_shaped_texture_add_rectangles (MetaShapedTexture *stex, mutter_shaped_texture_add_rectangles (MutterShapedTexture *stex,
size_t num_rects, size_t num_rects,
const XRectangle *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; priv = stex->priv;
g_array_append_vals (priv->rectangles, rects, num_rects); 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)); clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
} }

View File

@ -0,0 +1,96 @@
/*
* shaped texture
*
* An actor to draw a texture clipped to a list of rectangles
*
* Authored By Neil Roberts <neil@linux.intel.com>
*
* 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 <clutter/clutter-texture.h>
#include <clutter/x11/clutter-x11.h>
#ifdef HAVE_GLX_TEXTURE_PIXMAP
#include <clutter/glx/clutter-glx.h>
#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__ */

View File

@ -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)\" 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_CFLAGS = -fPIC
default_la_SOURCES = default.c default_la_SOURCES = default.c
default_la_LDFLAGS = -module -avoid-version -no-undefined default_la_LDFLAGS = -module -avoid-version -no-undefined
default_la_LIBADD = @CLUTTER_LIBS@ default_la_LIBADD = @CLUTTER_LIBS@
pkglib_LTLIBRARIES = default.la
# post-install hook to remove the .la and .a files we are not interested in # 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 # (There is no way to stop libtool generating static libs locally, and we

View File

@ -21,9 +21,8 @@
* 02111-1307, USA. * 02111-1307, USA.
*/ */
#define META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN 1 #define MUTTER_BUILDING_PLUGIN 1
#include "compositor-clutter-plugin.h" #include "mutter-plugin.h"
#include "compositor-clutter.h"
#include <libintl.h> #include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x) #define _(x) dgettext (GETTEXT_PACKAGE, x)
@ -43,18 +42,18 @@
static GQuark actor_data_quark = 0; static GQuark actor_data_quark = 0;
static gboolean do_init (const char *params); static gboolean do_init (const char *params);
static void minimize (MetaCompWindow *actor); static void minimize (MutterWindow *actor);
static void map (MetaCompWindow *actor); static void map (MutterWindow *actor);
static void destroy (MetaCompWindow *actor); static void destroy (MutterWindow *actor);
static void maximize (MetaCompWindow *actor, static void maximize (MutterWindow *actor,
gint x, gint y, gint width, gint height); 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); gint x, gint y, gint width, gint height);
static void switch_workspace (const GList **actors, gint from, gint to, static void switch_workspace (const GList **actors, gint from, gint to,
MetaMotionDirection direction); MetaMotionDirection direction);
static void kill_effect (MetaCompWindow *actor, gulong event); static void kill_effect (MutterWindow *actor, gulong event);
static gboolean reload (const char *params); 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 * Any dynamically allocated data should be initialized in the
* init () function below. * init () function below.
*/ */
G_MODULE_EXPORT MetaCompositorClutterPlugin metacity_plugin = G_MODULE_EXPORT MutterPlugin mutter_plugin =
{ {
/* /*
* These are predefined values; do not modify. * These are predefined values; do not modify.
@ -81,12 +80,12 @@ G_MODULE_EXPORT MetaCompositorClutterPlugin metacity_plugin =
.do_init = do_init, .do_init = do_init,
/* Which types of events this plugin supports */ /* Which types of events this plugin supports */
.features = META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE | .features = MUTTER_PLUGIN_MINIMIZE |
META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY | MUTTER_PLUGIN_DESTROY |
META_COMPOSITOR_CLUTTER_PLUGIN_MAP | MUTTER_PLUGIN_MAP |
META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE | MUTTER_PLUGIN_MAXIMIZE |
META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE | MUTTER_PLUGIN_UNMAXIMIZE |
META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE, MUTTER_PLUGIN_SWITCH_WORKSPACE,
/* And the corresponding handlers */ /* And the corresponding handlers */
@ -153,7 +152,7 @@ free_actor_private (gpointer data)
} }
static ActorPrivate * static ActorPrivate *
get_actor_private (MetaCompWindow *actor) get_actor_private (MutterWindow *actor)
{ {
ActorPrivate *priv = g_object_get_qdata (G_OBJECT (actor), actor_data_quark); 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; DefaultPluginState *state = plugin_state;
GList *l = *((GList**)data); GList *l = *((GList**)data);
MetaCompWindow *actor_for_cb = l->data; MutterWindow *actor_for_cb = l->data;
while (l) while (l)
{ {
ClutterActor *a = l->data; ClutterActor *a = l->data;
MetaCompWindow *mc_window = META_COMP_WINDOW (a); MutterWindow *mc_window = MUTTER_WINDOW (a);
ActorPrivate *priv = get_actor_private (mc_window); ActorPrivate *priv = get_actor_private (mc_window);
if (priv->orig_parent) if (priv->orig_parent)
@ -203,15 +202,15 @@ on_switch_workspace_effect_complete (ClutterActor *group, gpointer data)
state->desktop1 = NULL; state->desktop1 = NULL;
state->desktop2 = NULL; state->desktop2 = NULL;
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, actor_for_cb, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, actor_for_cb,
META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); MUTTER_PLUGIN_SWITCH_WORKSPACE);
} }
static void static void
switch_workspace (const GList **actors, gint from, gint to, switch_workspace (const GList **actors, gint from, gint to,
MetaMotionDirection direction) MetaMotionDirection direction)
{ {
MetaCompositorClutterPlugin *plugin = &metacity_plugin; MutterPlugin *plugin = &mutter_plugin;
DefaultPluginState *state = plugin_state; DefaultPluginState *state = plugin_state;
GList *l; GList *l;
gint n_workspaces; gint n_workspaces;
@ -239,8 +238,8 @@ switch_workspace (const GList **actors, gint from, gint to,
if (from == to) if (from == to)
{ {
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, NULL, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, NULL,
META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); MUTTER_PLUGIN_SWITCH_WORKSPACE);
return; return;
} }
@ -250,12 +249,12 @@ switch_workspace (const GList **actors, gint from, gint to,
while (l) while (l)
{ {
MetaCompWindow *mc_window = l->data; MutterWindow *mc_window = l->data;
ActorPrivate *priv = get_actor_private (mc_window); ActorPrivate *priv = get_actor_private (mc_window);
ClutterActor *window = CLUTTER_ACTOR (mc_window); ClutterActor *window = CLUTTER_ACTOR (mc_window);
gint win_workspace; 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) 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. * that the restoration will not be visible.
*/ */
ActorPrivate *apriv; 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; apriv->tml_minimize = NULL;
clutter_actor_hide (actor); clutter_actor_hide (actor);
@ -330,10 +329,10 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data)
CLUTTER_GRAVITY_NORTH_WEST); CLUTTER_GRAVITY_NORTH_WEST);
/* Decrease the running effect counter */ /* Decrease the running effect counter */
metacity_plugin.running--; mutter_plugin.running--;
/* Now notify the manager that we are done with this effect */ /* Now notify the manager that we are done with this effect */
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window,
META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE); MUTTER_PLUGIN_MINIMIZE);
} }
/* /*
@ -341,13 +340,13 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data)
* completion). * completion).
*/ */
static void static void
minimize (MetaCompWindow *mc_window) minimize (MutterWindow *mc_window)
{ {
DefaultPluginState *state = plugin_state; DefaultPluginState *state = plugin_state;
MetaCompWindowType type; MetaCompWindowType type;
ClutterActor *actor = CLUTTER_ACTOR (mc_window); 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) if (type == META_COMP_WINDOW_NORMAL)
{ {
@ -358,7 +357,7 @@ minimize (MetaCompWindow *mc_window)
clutter_actor_move_anchor_point_from_gravity (actor, clutter_actor_move_anchor_point_from_gravity (actor,
CLUTTER_GRAVITY_CENTER); CLUTTER_GRAVITY_CENTER);
metacity_plugin.running++; mutter_plugin.running++;
apriv->tml_minimize = clutter_effect_scale (state->minimize_effect, apriv->tml_minimize = clutter_effect_scale (state->minimize_effect,
actor, actor,
@ -369,8 +368,8 @@ minimize (MetaCompWindow *mc_window)
NULL); NULL);
} }
else else
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window,
META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE); MUTTER_PLUGIN_MINIMIZE);
} }
/* /*
@ -383,7 +382,7 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data)
/* /*
* Must reverse the effect of the effect. * 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); ActorPrivate *apriv = get_actor_private (mc_window);
apriv->tml_maximize = NULL; apriv->tml_maximize = NULL;
@ -394,11 +393,11 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data)
CLUTTER_GRAVITY_NORTH_WEST); CLUTTER_GRAVITY_NORTH_WEST);
/* Decrease the running effect counter */ /* Decrease the running effect counter */
metacity_plugin.running--; mutter_plugin.running--;
/* Now notify the manager that we are done with this effect */ /* Now notify the manager that we are done with this effect */
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window,
META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE); MUTTER_PLUGIN_MAXIMIZE);
} }
/* /*
@ -410,7 +409,7 @@ on_maximize_effect_complete (ClutterActor *actor, gpointer data)
* (Something like a sound would be more appropriate.) * (Something like a sound would be more appropriate.)
*/ */
static void static void
maximize (MetaCompWindow *mc_window, maximize (MutterWindow *mc_window,
gint end_x, gint end_y, gint end_width, gint end_height) gint end_x, gint end_y, gint end_width, gint end_height)
{ {
MetaCompWindowType type; MetaCompWindowType type;
@ -421,7 +420,7 @@ maximize (MetaCompWindow *mc_window,
gint anchor_x = 0; gint anchor_x = 0;
gint anchor_y = 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) if (type == META_COMP_WINDOW_NORMAL)
{ {
@ -460,8 +459,8 @@ maximize (MetaCompWindow *mc_window,
return; return;
} }
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window,
META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE); MUTTER_PLUGIN_MAXIMIZE);
} }
/* /*
@ -470,10 +469,10 @@ maximize (MetaCompWindow *mc_window,
* (Just a skeleton code.) * (Just a skeleton code.)
*/ */
static void static void
unmaximize (MetaCompWindow *mc_window, unmaximize (MutterWindow *mc_window,
gint end_x, gint end_y, gint end_width, gint end_height) 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) if (type == META_COMP_WINDOW_NORMAL)
{ {
@ -483,8 +482,8 @@ unmaximize (MetaCompWindow *mc_window,
} }
/* Do this conditionally, if the effect requires completion callback. */ /* Do this conditionally, if the effect requires completion callback. */
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window,
META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE); MUTTER_PLUGIN_UNMAXIMIZE);
} }
static void static void
@ -493,7 +492,7 @@ on_map_effect_complete (ClutterActor *actor, gpointer data)
/* /*
* Must reverse the effect of the effect. * 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); ActorPrivate *apriv = get_actor_private (mc_window);
apriv->tml_map = NULL; apriv->tml_map = NULL;
@ -502,11 +501,11 @@ on_map_effect_complete (ClutterActor *actor, gpointer data)
CLUTTER_GRAVITY_NORTH_WEST); CLUTTER_GRAVITY_NORTH_WEST);
/* Decrease the running effect counter */ /* Decrease the running effect counter */
metacity_plugin.running--; mutter_plugin.running--;
/* Now notify the manager that we are done with this effect */ /* Now notify the manager that we are done with this effect */
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window,
META_COMPOSITOR_CLUTTER_PLUGIN_MAP); MUTTER_PLUGIN_MAP);
} }
/* /*
@ -514,12 +513,12 @@ on_map_effect_complete (ClutterActor *actor, gpointer data)
* completion). * completion).
*/ */
static void static void
map (MetaCompWindow *mc_window) map (MutterWindow *mc_window)
{ {
MetaCompWindowType type; MetaCompWindowType type;
ClutterActor *actor = CLUTTER_ACTOR (mc_window); 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) if (type == META_COMP_WINDOW_NORMAL)
{ {
@ -528,7 +527,7 @@ map (MetaCompWindow *mc_window)
clutter_actor_move_anchor_point_from_gravity (actor, clutter_actor_move_anchor_point_from_gravity (actor,
CLUTTER_GRAVITY_CENTER); CLUTTER_GRAVITY_CENTER);
metacity_plugin.running++; mutter_plugin.running++;
clutter_actor_set_scale (actor, 0.0, 0.0); clutter_actor_set_scale (actor, 0.0, 0.0);
clutter_actor_show (actor); clutter_actor_show (actor);
@ -545,8 +544,8 @@ map (MetaCompWindow *mc_window)
} }
else else
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window,
META_COMPOSITOR_CLUTTER_PLUGIN_MAP); MUTTER_PLUGIN_MAP);
} }
/* /*
@ -557,28 +556,28 @@ map (MetaCompWindow *mc_window)
static void static void
on_destroy_effect_complete (ClutterActor *actor, gpointer data) on_destroy_effect_complete (ClutterActor *actor, gpointer data)
{ {
MetaCompositorClutterPlugin *plugin = &metacity_plugin; MutterPlugin *plugin = &mutter_plugin;
MetaCompWindow *mc_window = META_COMP_WINDOW (actor); MutterWindow *mc_window = MUTTER_WINDOW (actor);
ActorPrivate *apriv = get_actor_private (mc_window); ActorPrivate *apriv = get_actor_private (mc_window);
apriv->tml_destroy = NULL; apriv->tml_destroy = NULL;
metacity_plugin.running--; mutter_plugin.running--;
meta_comp_clutter_plugin_effect_completed (plugin, mc_window, meta_comp_clutter_plugin_effect_completed (plugin, mc_window,
META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY); MUTTER_PLUGIN_DESTROY);
} }
/* /*
* Simple TV-out like effect. * Simple TV-out like effect.
*/ */
static void static void
destroy (MetaCompWindow *mc_window) destroy (MutterWindow *mc_window)
{ {
MetaCompWindowType type; MetaCompWindowType type;
ClutterActor *actor = CLUTTER_ACTOR (mc_window); 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) if (type == META_COMP_WINDOW_NORMAL)
{ {
@ -587,7 +586,7 @@ destroy (MetaCompWindow *mc_window)
clutter_actor_move_anchor_point_from_gravity (actor, clutter_actor_move_anchor_point_from_gravity (actor,
CLUTTER_GRAVITY_CENTER); CLUTTER_GRAVITY_CENTER);
metacity_plugin.running++; mutter_plugin.running++;
apriv->tml_destroy = clutter_effect_scale (plugin_state->destroy_effect, apriv->tml_destroy = clutter_effect_scale (plugin_state->destroy_effect,
actor, actor,
@ -598,14 +597,14 @@ destroy (MetaCompWindow *mc_window)
NULL); NULL);
} }
else else
meta_comp_clutter_plugin_effect_completed (&metacity_plugin, mc_window, meta_comp_clutter_plugin_effect_completed (&mutter_plugin, mc_window,
META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY); MUTTER_PLUGIN_DESTROY);
} }
static void 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; ActorPrivate *apriv;
ClutterActor *actor = CLUTTER_ACTOR (mc_window); ClutterActor *actor = CLUTTER_ACTOR (mc_window);
@ -615,7 +614,7 @@ kill_effect (MetaCompWindow *mc_window, gulong event)
return; return;
} }
if (event & META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE) if (event & MUTTER_PLUGIN_SWITCH_WORKSPACE)
{ {
DefaultPluginState *state = plugin_state; DefaultPluginState *state = plugin_state;
@ -626,7 +625,7 @@ kill_effect (MetaCompWindow *mc_window, gulong event)
on_switch_workspace_effect_complete (state->desktop1, state->actors); 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 */ /* Workspace switch only, nothing more to do */
return; return;
@ -635,25 +634,25 @@ kill_effect (MetaCompWindow *mc_window, gulong event)
apriv = get_actor_private (mc_window); 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); clutter_timeline_stop (apriv->tml_minimize);
on_minimize_effect_complete (actor, NULL); 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); clutter_timeline_stop (apriv->tml_maximize);
on_maximize_effect_complete (actor, NULL); 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); clutter_timeline_stop (apriv->tml_map);
on_map_effect_complete (actor, NULL); 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); clutter_timeline_stop (apriv->tml_destroy);
on_destroy_effect_complete (actor, NULL); on_destroy_effect_complete (actor, NULL);
@ -696,7 +695,7 @@ do_init (const char *params)
{ {
if (strstr (params, "debug")) 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; plugin_state->debug_mode = TRUE;
@ -743,6 +742,9 @@ do_init (const char *params)
static void static void
free_plugin_private (DefaultPluginState *state) free_plugin_private (DefaultPluginState *state)
{ {
if (!state)
return;
g_object_unref (state->destroy_effect); g_object_unref (state->destroy_effect);
g_object_unref (state->minimize_effect); g_object_unref (state->minimize_effect);
g_object_unref (state->maximize_effect); g_object_unref (state->maximize_effect);

View File

@ -21,9 +21,8 @@
* 02111-1307, USA. * 02111-1307, USA.
*/ */
#define META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN 1 #define MUTTER_BUILDING_PLUGIN 1
#include "compositor-clutter-plugin.h" #include "mutter-plugin.h"
#include "compositor-clutter.h"
#include <libintl.h> #include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x) #define _(x) dgettext (GETTEXT_PACKAGE, x)
@ -44,18 +43,18 @@
typedef struct PluginPrivate PluginPrivate; typedef struct PluginPrivate PluginPrivate;
typedef struct ActorPrivate ActorPrivate; typedef struct ActorPrivate ActorPrivate;
static void minimize (MetaCompWindow *actor); static void minimize (MutterWindow *actor);
static void map (MetaCompWindow *actor); static void map (MutterWindow *actor);
static void destroy (MetaCompWindow *actor); static void destroy (MutterWindow *actor);
static void maximize (MetaCompWindow *actor, static void maximize (MutterWindow *actor,
gint x, gint y, gint width, gint height); 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); gint x, gint y, gint width, gint height);
static void switch_workspace (const GList **actors, gint from, gint to, static void switch_workspace (const GList **actors, gint from, gint to,
MetaMotionDirection direction); MetaMotionDirection direction);
static void kill_effect (MetaCompWindow *actor, gulong event); static void kill_effect (MutterWindow *actor, gulong event);
static gboolean reload (void); static gboolean reload (void);
@ -64,7 +63,7 @@ static gboolean reload (void);
* Any dynamically allocated data should be initialized in the * Any dynamically allocated data should be initialized in the
* init () function below. * init () function below.
*/ */
MetaCompositorClutterPlugin META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT = MutterPlugin MUTTER_PLUGIN_STRUCT =
{ {
/* /*
* These are predefined values; do not modify. * These are predefined values; do not modify.
@ -78,12 +77,12 @@ MetaCompositorClutterPlugin META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT =
.name = "Default Effects", .name = "Default Effects",
/* Which types of events this plugin supports */ /* Which types of events this plugin supports */
.features = META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE | .features = MUTTER_PLUGIN_MINIMIZE |
META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY | MUTTER_PLUGIN_DESTROY |
META_COMPOSITOR_CLUTTER_PLUGIN_MAP | MUTTER_PLUGIN_MAP |
META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE | MUTTER_PLUGIN_MAXIMIZE |
META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE | MUTTER_PLUGIN_UNMAXIMIZE |
META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE, MUTTER_PLUGIN_SWITCH_WORKSPACE,
/* And the corresponding handlers */ /* And the corresponding handlers */
@ -141,7 +140,7 @@ struct ActorPrivate
* Actor private data accessor * Actor private data accessor
*/ */
static ActorPrivate * static ActorPrivate *
get_actor_private (MetaCompWindow *actor) get_actor_private (MutterWindow *actor)
{ {
ActorPrivate * priv = g_object_get_data (G_OBJECT (actor), ACTOR_DATA_KEY); ActorPrivate * priv = g_object_get_data (G_OBJECT (actor), ACTOR_DATA_KEY);
@ -155,24 +154,24 @@ get_actor_private (MetaCompWindow *actor)
} }
static inline static inline
MetaCompositorClutterPlugin * MutterPlugin *
get_plugin () get_plugin ()
{ {
return &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT; return &MUTTER_PLUGIN_STRUCT;
} }
static void static void
on_switch_workspace_effect_complete (ClutterActor *group, gpointer data) on_switch_workspace_effect_complete (ClutterActor *group, gpointer data)
{ {
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
PluginPrivate *ppriv = plugin->plugin_private; PluginPrivate *ppriv = plugin->plugin_private;
GList *l = *((GList**)data); GList *l = *((GList**)data);
MetaCompWindow *actor_for_cb = l->data; MutterWindow *actor_for_cb = l->data;
while (l) while (l)
{ {
ClutterActor *a = l->data; ClutterActor *a = l->data;
MetaCompWindow *mcw = META_COMP_WINDOW (a); MutterWindow *mcw = MUTTER_WINDOW (a);
ActorPrivate *priv = get_actor_private (mcw); ActorPrivate *priv = get_actor_private (mcw);
if (priv->orig_parent) if (priv->orig_parent)
@ -194,14 +193,14 @@ on_switch_workspace_effect_complete (ClutterActor *group, gpointer data)
ppriv->desktop2 = NULL; ppriv->desktop2 = NULL;
meta_comp_clutter_plugin_effect_completed (plugin, actor_for_cb, meta_comp_clutter_plugin_effect_completed (plugin, actor_for_cb,
META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); MUTTER_PLUGIN_SWITCH_WORKSPACE);
} }
static void static void
switch_workspace (const GList **actors, gint from, gint to, switch_workspace (const GList **actors, gint from, gint to,
MetaMotionDirection direction) MetaMotionDirection direction)
{ {
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
PluginPrivate *ppriv = plugin->plugin_private; PluginPrivate *ppriv = plugin->plugin_private;
GList *l; GList *l;
gint n_workspaces; gint n_workspaces;
@ -228,7 +227,7 @@ switch_workspace (const GList **actors, gint from, gint to,
if (from == to) if (from == to)
{ {
meta_comp_clutter_plugin_effect_completed (plugin, NULL, meta_comp_clutter_plugin_effect_completed (plugin, NULL,
META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE); MUTTER_PLUGIN_SWITCH_WORKSPACE);
return; return;
} }
@ -238,7 +237,7 @@ switch_workspace (const GList **actors, gint from, gint to,
while (l) while (l)
{ {
MetaCompWindow *mcw = l->data; MutterWindow *mcw = l->data;
ActorPrivate *priv = get_actor_private (mcw); ActorPrivate *priv = get_actor_private (mcw);
ClutterActor *a = CLUTTER_ACTOR (mcw); ClutterActor *a = CLUTTER_ACTOR (mcw);
gint workspace; 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 * Must reverse the effect of the effect; must hide it first to ensure
* that the restoration will not be visible. * that the restoration will not be visible.
*/ */
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
ActorPrivate *apriv; 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; apriv->tml_minimize = NULL;
clutter_actor_hide (actor); 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 */ /* Now notify the manager that we are done with this effect */
meta_comp_clutter_plugin_effect_completed (plugin, mcw, 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). * completion).
*/ */
static void static void
minimize (MetaCompWindow *mcw) minimize (MutterWindow *mcw)
{ {
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
PluginPrivate *priv = plugin->plugin_private; PluginPrivate *priv = plugin->plugin_private;
MetaCompWindowType type; MutterWindowType type;
ClutterActor *actor = CLUTTER_ACTOR (mcw); ClutterActor *actor = CLUTTER_ACTOR (mcw);
type = meta_comp_window_get_window_type (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); ActorPrivate *apriv = get_actor_private (mcw);
@ -347,7 +346,7 @@ minimize (MetaCompWindow *mcw)
clutter_actor_move_anchor_point_from_gravity (actor, clutter_actor_move_anchor_point_from_gravity (actor,
CLUTTER_GRAVITY_CENTER); CLUTTER_GRAVITY_CENTER);
META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.running++; MUTTER_PLUGIN_STRUCT.running++;
apriv->tml_minimize = clutter_effect_scale (priv->minimize_effect, apriv->tml_minimize = clutter_effect_scale (priv->minimize_effect,
actor, actor,
@ -359,7 +358,7 @@ minimize (MetaCompWindow *mcw)
} }
else else
meta_comp_clutter_plugin_effect_completed (plugin, mcw, 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. * Must reverse the effect of the effect.
*/ */
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
MetaCompWindow *mcw = META_COMP_WINDOW (actor); MutterWindow *mcw = MUTTER_WINDOW (actor);
ActorPrivate *apriv = get_actor_private (mcw); ActorPrivate *apriv = get_actor_private (mcw);
apriv->tml_maximize = NULL; 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 */ /* Now notify the manager that we are done with this effect */
meta_comp_clutter_plugin_effect_completed (plugin, mcw, 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.) * (Something like a sound would be more appropriate.)
*/ */
static void static void
maximize (MetaCompWindow *mcw, maximize (MutterWindow *mcw,
gint end_x, gint end_y, gint end_width, gint end_height) 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; PluginPrivate *priv = plugin->plugin_private;
MetaCompWindowType type; MutterWindowType type;
ClutterActor *actor = CLUTTER_ACTOR (mcw); ClutterActor *actor = CLUTTER_ACTOR (mcw);
gdouble scale_x = 1.0; gdouble scale_x = 1.0;
@ -414,7 +413,7 @@ maximize (MetaCompWindow *mcw,
type = meta_comp_window_get_window_type (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); ActorPrivate *apriv = get_actor_private (mcw);
guint width, height; guint width, height;
@ -451,7 +450,7 @@ maximize (MetaCompWindow *mcw,
} }
meta_comp_clutter_plugin_effect_completed (plugin, 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.) * (Just a skeleton code.)
*/ */
static void static void
unmaximize (MetaCompWindow *mcw, unmaximize (MutterWindow *mcw,
gint end_x, gint end_y, gint end_width, gint end_height) gint end_x, gint end_y, gint end_width, gint end_height)
{ {
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
MetaCompWindowType type; MutterWindowType type;
type = meta_comp_window_get_window_type (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); ActorPrivate *apriv = get_actor_private (mcw);
@ -477,7 +476,7 @@ unmaximize (MetaCompWindow *mcw,
/* Do this conditionally, if the effect requires completion callback. */ /* Do this conditionally, if the effect requires completion callback. */
meta_comp_clutter_plugin_effect_completed (plugin, mcw, meta_comp_clutter_plugin_effect_completed (plugin, mcw,
META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE); MUTTER_PLUGIN_UNMAXIMIZE);
} }
static void static void
@ -486,8 +485,8 @@ on_map_effect_complete (ClutterActor *actor, gpointer data)
/* /*
* Must reverse the effect of the effect. * Must reverse the effect of the effect.
*/ */
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
MetaCompWindow *mcw = META_COMP_WINDOW (actor); MutterWindow *mcw = MUTTER_WINDOW (actor);
ActorPrivate *apriv = get_actor_private (mcw); ActorPrivate *apriv = get_actor_private (mcw);
apriv->tml_map = NULL; 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 */ /* Now notify the manager that we are done with this effect */
meta_comp_clutter_plugin_effect_completed (plugin, mcw, 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). * completion).
*/ */
static void static void
map (MetaCompWindow *mcw) map (MutterWindow *mcw)
{ {
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
PluginPrivate *priv = plugin->plugin_private; PluginPrivate *priv = plugin->plugin_private;
MetaCompWindowType type; MutterWindowType type;
ClutterActor *actor = CLUTTER_ACTOR (mcw); ClutterActor *actor = CLUTTER_ACTOR (mcw);
type = meta_comp_window_get_window_type (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); ActorPrivate *apriv = get_actor_private (mcw);
clutter_actor_move_anchor_point_from_gravity (actor, clutter_actor_move_anchor_point_from_gravity (actor,
CLUTTER_GRAVITY_CENTER); CLUTTER_GRAVITY_CENTER);
META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.running++; MUTTER_PLUGIN_STRUCT.running++;
clutter_actor_set_scale (actor, 0.0, 0.0); clutter_actor_set_scale (actor, 0.0, 0.0);
clutter_actor_show (actor); clutter_actor_show (actor);
@ -542,7 +541,7 @@ map (MetaCompWindow *mcw)
} }
else else
meta_comp_clutter_plugin_effect_completed (plugin, mcw, 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 static void
on_destroy_effect_complete (ClutterActor *actor, gpointer data) on_destroy_effect_complete (ClutterActor *actor, gpointer data)
{ {
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
MetaCompWindow *mcw = META_COMP_WINDOW (actor); MutterWindow *mcw = MUTTER_WINDOW (actor);
ActorPrivate *apriv = get_actor_private (mcw); ActorPrivate *apriv = get_actor_private (mcw);
apriv->tml_destroy = NULL; apriv->tml_destroy = NULL;
@ -562,23 +561,23 @@ on_destroy_effect_complete (ClutterActor *actor, gpointer data)
plugin->running--; plugin->running--;
meta_comp_clutter_plugin_effect_completed (plugin, mcw, meta_comp_clutter_plugin_effect_completed (plugin, mcw,
META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY); MUTTER_PLUGIN_DESTROY);
} }
/* /*
* Simple TV-out like effect. * Simple TV-out like effect.
*/ */
static void static void
destroy (MetaCompWindow *mcw) destroy (MutterWindow *mcw)
{ {
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
PluginPrivate *priv = plugin->plugin_private; PluginPrivate *priv = plugin->plugin_private;
MetaCompWindowType type; MutterWindowType type;
ClutterActor *actor = CLUTTER_ACTOR (mcw); ClutterActor *actor = CLUTTER_ACTOR (mcw);
type = meta_comp_window_get_window_type (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); ActorPrivate *apriv = get_actor_private (mcw);
@ -597,13 +596,13 @@ destroy (MetaCompWindow *mcw)
} }
else else
meta_comp_clutter_plugin_effect_completed (plugin, mcw, meta_comp_clutter_plugin_effect_completed (plugin, mcw,
META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY); MUTTER_PLUGIN_DESTROY);
} }
static void static void
kill_effect (MetaCompWindow *mcw, gulong event) kill_effect (MutterWindow *mcw, gulong event)
{ {
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
ActorPrivate *apriv; ActorPrivate *apriv;
ClutterActor *actor = CLUTTER_ACTOR (mcw); ClutterActor *actor = CLUTTER_ACTOR (mcw);
@ -613,7 +612,7 @@ kill_effect (MetaCompWindow *mcw, gulong event)
return; return;
} }
if (event & META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE) if (event & MUTTER_PLUGIN_SWITCH_WORKSPACE)
{ {
PluginPrivate *ppriv = plugin->plugin_private; PluginPrivate *ppriv = plugin->plugin_private;
@ -624,7 +623,7 @@ kill_effect (MetaCompWindow *mcw, gulong event)
on_switch_workspace_effect_complete (ppriv->desktop1, ppriv->actors); 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 */ /* Workspace switch only, nothing more to do */
return; return;
@ -633,25 +632,25 @@ kill_effect (MetaCompWindow *mcw, gulong event)
apriv = get_actor_private (mcw); 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); clutter_timeline_stop (apriv->tml_minimize);
on_minimize_effect_complete (actor, NULL); 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); clutter_timeline_stop (apriv->tml_maximize);
on_maximize_effect_complete (actor, NULL); 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); clutter_timeline_stop (apriv->tml_map);
on_map_effect_complete (actor, NULL); 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); clutter_timeline_stop (apriv->tml_destroy);
on_destroy_effect_complete (actor, NULL); on_destroy_effect_complete (actor, NULL);
@ -682,7 +681,7 @@ g_module_check_init (GModule *module)
static gboolean static gboolean
do_init () do_init ()
{ {
MetaCompositorClutterPlugin *plugin = get_plugin (); MutterPlugin *plugin = get_plugin ();
PluginPrivate *priv = g_new0 (PluginPrivate, 1); PluginPrivate *priv = g_new0 (PluginPrivate, 1);
const gchar *params; const gchar *params;
@ -707,7 +706,7 @@ do_init ()
if (strstr (params, "debug")) if (strstr (params, "debug"))
{ {
g_debug ("%s: Entering debug mode.", g_debug ("%s: Entering debug mode.",
META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.name); MUTTER_PLUGIN_STRUCT.name);
priv->debug_mode = TRUE; priv->debug_mode = TRUE;
@ -731,22 +730,22 @@ do_init ()
*p = 0; *p = 0;
if (strstr (d, "minimize")) if (strstr (d, "minimize"))
plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE; plugin->features &= ~ MUTTER_PLUGIN_MINIMIZE;
if (strstr (d, "maximize")) if (strstr (d, "maximize"))
plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE; plugin->features &= ~ MUTTER_PLUGIN_MAXIMIZE;
if (strstr (d, "unmaximize")) if (strstr (d, "unmaximize"))
plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE; plugin->features &= ~ MUTTER_PLUGIN_UNMAXIMIZE;
if (strstr (d, "map")) if (strstr (d, "map"))
plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_MAP; plugin->features &= ~ MUTTER_PLUGIN_MAP;
if (strstr (d, "destroy")) if (strstr (d, "destroy"))
plugin->features &= ~ META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY; plugin->features &= ~ MUTTER_PLUGIN_DESTROY;
if (strstr (d, "switch-workspace")) if (strstr (d, "switch-workspace"))
plugin->features &= ~META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE; plugin->features &= ~MUTTER_PLUGIN_SWITCH_WORKSPACE;
g_free (d); g_free (d);
} }
@ -781,7 +780,7 @@ do_init ()
return TRUE; return TRUE;
} }
META_COMPOSITOR_CLUTTER_PLUGIN_INIT_FUNC MUTTER_PLUGIN_INIT_FUNC
{ {
return do_init (); return do_init ();
} }
@ -796,7 +795,7 @@ free_plugin_private (PluginPrivate *priv)
g_free (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; PluginPrivate *priv;
priv = META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.plugin_private; priv = MUTTER_PLUGIN_STRUCT.plugin_private;
if (do_init ()) if (do_init ())
{ {
@ -819,7 +818,7 @@ reload ()
else else
{ {
/* Fail -- fall back to the old private. */ /* Fail -- fall back to the old private. */
META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.plugin_private = priv; MUTTER_PLUGIN_STRUCT.plugin_private = priv;
} }
return FALSE; return FALSE;
@ -833,7 +832,7 @@ void g_module_unload (GModule *module)
{ {
PluginPrivate *priv; PluginPrivate *priv;
priv = META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT.plugin_private; priv = MUTTER_PLUGIN_STRUCT.plugin_private;
free_plugin_private (priv); free_plugin_private (priv);
} }

View File

@ -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 <clutter/clutter.h>
#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

View File

@ -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 <clutter/clutter.h>
#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

View File

@ -21,13 +21,13 @@
* 02111-1307, USA. * 02111-1307, USA.
*/ */
#ifndef META_COMPOSITOR_CLUTTER_PLUGIN_H_ #ifndef MUTTER_PLUGIN_H_
#define META_COMPOSITOR_CLUTTER_PLUGIN_H_ #define MUTTER_PLUGIN_H_
#include "types.h" #include "types.h"
#include "config.h" #include "config.h"
#include "compositor.h" #include "compositor.h"
#include "compositor-clutter.h" #include "compositor-mutter.h"
#include <clutter/clutter.h> #include <clutter/clutter.h>
@ -38,25 +38,25 @@
* recommended that the GModule API is used (otherwise you are on your own to * recommended that the GModule API is used (otherwise you are on your own to
* do proper plugin clean up when the module is unloaded). * 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 * Feature flags: identify events that the plugin can handle; a plugin can
* handle one or more events. * handle one or more events.
*/ */
#define META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE (1<<0) #define MUTTER_PLUGIN_MINIMIZE (1<<0)
#define META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE (1<<1) #define MUTTER_PLUGIN_MAXIMIZE (1<<1)
#define META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE (1<<2) #define MUTTER_PLUGIN_UNMAXIMIZE (1<<2)
#define META_COMPOSITOR_CLUTTER_PLUGIN_MAP (1<<3) #define MUTTER_PLUGIN_MAP (1<<3)
#define META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY (1<<4) #define MUTTER_PLUGIN_DESTROY (1<<4)
#define META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE (1<<5) #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 * Version information; the first three numbers match the Metacity version
@ -74,7 +74,7 @@ struct MetaCompositorClutterPlugin
*/ */
guint version_api; guint version_api;
#ifndef META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN #ifndef MUTTER_BUILDING_PLUGIN
const const
#endif #endif
gchar *name; /* Human-readable name for UI */ gchar *name; /* Human-readable name for UI */
@ -134,29 +134,29 @@ struct MetaCompositorClutterPlugin
* On completion, each event handler must call the manager completed() * On completion, each event handler must call the manager completed()
* callback function. * callback function.
*/ */
void (*minimize) (MetaCompWindow *actor); void (*minimize) (MutterWindow *actor);
void (*maximize) (MetaCompWindow *actor, void (*maximize) (MutterWindow *actor,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height); gint height);
void (*unmaximize) (MetaCompWindow *actor, void (*unmaximize) (MutterWindow *actor,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height); 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 * 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). * 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, void (*switch_workspace) (const GList **actors,
gint from, gint from,
@ -169,7 +169,7 @@ struct MetaCompositorClutterPlugin
* The events parameter is a bitmask indicating which effects are to be * The events parameter is a bitmask indicating which effects are to be
* killed. * killed.
*/ */
void (*kill_effect) (MetaCompWindow *actor, void (*kill_effect) (MutterWindow *actor,
gulong events); gulong events);
/* /*
@ -202,19 +202,19 @@ struct MetaCompositorClutterPlugin
}; };
void void
meta_comp_clutter_plugin_effect_completed (MetaCompositorClutterPlugin *plugin, meta_comp_clutter_plugin_effect_completed (MutterPlugin *plugin,
MetaCompWindow *actor, MutterWindow *actor,
unsigned long event); unsigned long event);
ClutterActor * ClutterActor *
meta_comp_clutter_plugin_get_overlay_group (MetaCompositorClutterPlugin *plugin); meta_comp_clutter_plugin_get_overlay_group (MutterPlugin *plugin);
ClutterActor * ClutterActor *
meta_comp_clutter_plugin_get_stage (MetaCompositorClutterPlugin *plugin); meta_comp_clutter_plugin_get_stage (MutterPlugin *plugin);
void void
meta_comp_clutter_plugin_query_screen_size (MetaCompositorClutterPlugin *plugin, meta_comp_clutter_plugin_query_screen_size (MutterPlugin *plugin,
int *width, int *width,
int *height); int *height);
#endif /* META_COMPOSITOR_CLUTTER_PLUGIN_H_ */ #endif /* MUTTER_PLUGIN_H_ */