mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
Refactored plugin API to use MetaCompWindow.
This commit is contained in:
parent
c5d59254af
commit
60695fd89a
@ -7,7 +7,7 @@ INCLUDES=@METACITY_CFLAGS@ -I $(top_srcdir)/src/include -DMETACITY_LIBEXECDIR=\"
|
|||||||
|
|
||||||
default_la_CFLAGS = -fPIC
|
default_la_CFLAGS = -fPIC
|
||||||
default_la_SOURCES = default.c
|
default_la_SOURCES = default.c
|
||||||
default_la_LDFLAGS = -module -avoid-version
|
default_la_LDFLAGS = -module -avoid-version -no-undefined
|
||||||
default_la_LIBADD = @CLUTTER_LIBS@
|
default_la_LIBADD = @CLUTTER_LIBS@
|
||||||
pkglib_LTLIBRARIES = default.la
|
pkglib_LTLIBRARIES = default.la
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#define META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN 1
|
#define META_COMPOSITOR_CLUTTER_BUILDING_PLUGIN 1
|
||||||
#include "compositor-clutter-plugin.h"
|
#include "compositor-clutter-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,22 +44,17 @@
|
|||||||
typedef struct PluginPrivate PluginPrivate;
|
typedef struct PluginPrivate PluginPrivate;
|
||||||
typedef struct ActorPrivate ActorPrivate;
|
typedef struct ActorPrivate ActorPrivate;
|
||||||
|
|
||||||
static void minimize (ClutterActor *actor, MetaCompWindowType type,
|
static void minimize (MetaCompWindow *actor);
|
||||||
gint workspace);
|
static void map (MetaCompWindow *actor);
|
||||||
static void map (ClutterActor *actor, MetaCompWindowType type,
|
static void destroy (MetaCompWindow *actor);
|
||||||
gint workspace);
|
static void maximize (MetaCompWindow *actor,
|
||||||
static void destroy (ClutterActor *actor, MetaCompWindowType type,
|
|
||||||
gint workspace);
|
|
||||||
static void maximize (ClutterActor *actor, MetaCompWindowType type,
|
|
||||||
gint workspace,
|
|
||||||
gint x, gint y, gint width, gint height);
|
gint x, gint y, gint width, gint height);
|
||||||
static void unmaximize (ClutterActor *actor, MetaCompWindowType type,
|
static void unmaximize (MetaCompWindow *actor,
|
||||||
gint workspace,
|
|
||||||
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);
|
||||||
|
|
||||||
static void kill_effect (ClutterActor *actor, gulong event);
|
static void kill_effect (MetaCompWindow *actor, gulong event);
|
||||||
|
|
||||||
static gboolean reload (void);
|
static gboolean reload (void);
|
||||||
|
|
||||||
@ -146,7 +142,7 @@ struct ActorPrivate
|
|||||||
* Actor private data accessor
|
* Actor private data accessor
|
||||||
*/
|
*/
|
||||||
static ActorPrivate *
|
static ActorPrivate *
|
||||||
get_actor_private (ClutterActor *actor)
|
get_actor_private (MetaCompWindow *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);
|
||||||
|
|
||||||
@ -165,12 +161,13 @@ on_switch_workspace_effect_complete (ClutterActor *group, gpointer data)
|
|||||||
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
PluginPrivate *ppriv = plugin->plugin_private;
|
PluginPrivate *ppriv = plugin->plugin_private;
|
||||||
GList *l = *((GList**)data);
|
GList *l = *((GList**)data);
|
||||||
ClutterActor *actor_for_cb = l->data;
|
MetaCompWindow *actor_for_cb = l->data;
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
ClutterActor *a = l->data;
|
ClutterActor *a = l->data;
|
||||||
ActorPrivate *priv = get_actor_private (a);
|
MetaCompWindow *mcw = META_COMP_WINDOW (a);
|
||||||
|
ActorPrivate *priv = get_actor_private (mcw);
|
||||||
|
|
||||||
if (priv->orig_parent)
|
if (priv->orig_parent)
|
||||||
{
|
{
|
||||||
@ -234,12 +231,12 @@ switch_workspace (const GList **actors, gint from, gint to)
|
|||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
ClutterActor *a = l->data;
|
MetaCompWindow *mcw = l->data;
|
||||||
ActorPrivate *priv = get_actor_private (a);
|
ActorPrivate *priv = get_actor_private (mcw);
|
||||||
gint workspace;
|
ClutterActor *a = CLUTTER_ACTOR (mcw);
|
||||||
|
gint workspace;
|
||||||
|
|
||||||
workspace = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (a),
|
workspace = meta_comp_window_get_workspace (mcw);
|
||||||
META_COMPOSITOR_CLUTTER_PLUGIN_WORKSPACE_KEY));
|
|
||||||
|
|
||||||
priv->workspace = workspace;
|
priv->workspace = workspace;
|
||||||
|
|
||||||
@ -301,8 +298,10 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data)
|
|||||||
* that the restoration will not be visible.
|
* that the restoration will not be visible.
|
||||||
*/
|
*/
|
||||||
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
ActorPrivate *apriv = get_actor_private (actor);
|
ActorPrivate *apriv;
|
||||||
|
MetaCompWindow *mcw = META_COMP_WINDOW (actor);
|
||||||
|
|
||||||
|
apriv = get_actor_private (META_COMP_WINDOW (actor));
|
||||||
apriv->tml_minimize = NULL;
|
apriv->tml_minimize = NULL;
|
||||||
|
|
||||||
clutter_actor_hide (actor);
|
clutter_actor_hide (actor);
|
||||||
@ -316,7 +315,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 */
|
||||||
if (plugin->completed)
|
if (plugin->completed)
|
||||||
plugin->completed (plugin, actor, META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE);
|
plugin->completed (plugin, mcw, META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -324,15 +323,21 @@ on_minimize_effect_complete (ClutterActor *actor, gpointer data)
|
|||||||
* completion).
|
* completion).
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
minimize (ClutterActor *actor, MetaCompWindowType type, gint workspace)
|
minimize (MetaCompWindow *mcw)
|
||||||
|
|
||||||
{
|
{
|
||||||
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
PluginPrivate *priv = plugin->plugin_private;
|
PluginPrivate *priv = plugin->plugin_private;
|
||||||
|
MetaCompWindowType type;
|
||||||
|
ClutterActor *actor = CLUTTER_ACTOR (mcw);
|
||||||
|
|
||||||
|
type = meta_comp_window_get_window_type (mcw);
|
||||||
|
|
||||||
if (type == META_COMP_WINDOW_NORMAL)
|
if (type == META_COMP_WINDOW_NORMAL)
|
||||||
{
|
{
|
||||||
ActorPrivate *apriv = get_actor_private (actor);
|
ActorPrivate *apriv = get_actor_private (mcw);
|
||||||
|
|
||||||
|
printf ("running minimize effect\n");
|
||||||
|
|
||||||
apriv->is_minimized = TRUE;
|
apriv->is_minimized = TRUE;
|
||||||
|
|
||||||
@ -350,7 +355,7 @@ minimize (ClutterActor *actor, MetaCompWindowType type, gint workspace)
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
else if (plugin->completed)
|
else if (plugin->completed)
|
||||||
plugin->completed (plugin, actor, META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE);
|
plugin->completed (plugin, mcw, META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -364,7 +369,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 = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
ActorPrivate *apriv = get_actor_private (actor);
|
MetaCompWindow *mcw = META_COMP_WINDOW (actor);
|
||||||
|
ActorPrivate *apriv = get_actor_private (mcw);
|
||||||
|
|
||||||
apriv->tml_maximize = NULL;
|
apriv->tml_maximize = NULL;
|
||||||
|
|
||||||
@ -377,7 +383,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 */
|
||||||
if (plugin->completed)
|
if (plugin->completed)
|
||||||
plugin->completed (plugin, actor, META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE);
|
plugin->completed (plugin, mcw, META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -389,20 +395,24 @@ 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 (ClutterActor *actor, MetaCompWindowType type, gint workspace,
|
maximize (MetaCompWindow *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 = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
PluginPrivate *priv = plugin->plugin_private;
|
PluginPrivate *priv = plugin->plugin_private;
|
||||||
|
MetaCompWindowType type;
|
||||||
|
ClutterActor *actor = CLUTTER_ACTOR (mcw);
|
||||||
|
|
||||||
gdouble scale_x = 1.0;
|
gdouble scale_x = 1.0;
|
||||||
gdouble scale_y = 1.0;
|
gdouble scale_y = 1.0;
|
||||||
gint anchor_x = 0;
|
gint anchor_x = 0;
|
||||||
gint anchor_y = 0;
|
gint anchor_y = 0;
|
||||||
|
|
||||||
|
type = meta_comp_window_get_window_type (mcw);
|
||||||
|
|
||||||
if (type == META_COMP_WINDOW_NORMAL)
|
if (type == META_COMP_WINDOW_NORMAL)
|
||||||
{
|
{
|
||||||
ActorPrivate *apriv = get_actor_private (actor);
|
ActorPrivate *apriv = get_actor_private (mcw);
|
||||||
guint width, height;
|
guint width, height;
|
||||||
gint x, y;
|
gint x, y;
|
||||||
|
|
||||||
@ -437,7 +447,7 @@ maximize (ClutterActor *actor, MetaCompWindowType type, gint workspace,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (plugin->completed)
|
if (plugin->completed)
|
||||||
plugin->completed (plugin, actor, META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE);
|
plugin->completed (plugin, mcw, META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -446,14 +456,17 @@ maximize (ClutterActor *actor, MetaCompWindowType type, gint workspace,
|
|||||||
* (Just a skeleton code.)
|
* (Just a skeleton code.)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
unmaximize (ClutterActor *actor, MetaCompWindowType type, gint workspace,
|
unmaximize (MetaCompWindow *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 = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
|
MetaCompWindowType type;
|
||||||
|
|
||||||
|
type = meta_comp_window_get_window_type (mcw);
|
||||||
|
|
||||||
if (type == META_COMP_WINDOW_NORMAL)
|
if (type == META_COMP_WINDOW_NORMAL)
|
||||||
{
|
{
|
||||||
ActorPrivate *apriv = get_actor_private (actor);
|
ActorPrivate *apriv = get_actor_private (mcw);
|
||||||
|
|
||||||
apriv->is_maximized = FALSE;
|
apriv->is_maximized = FALSE;
|
||||||
|
|
||||||
@ -462,7 +475,7 @@ unmaximize (ClutterActor *actor, MetaCompWindowType type, gint workspace,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Do this conditionally, if the effect requires completion callback. */
|
/* Do this conditionally, if the effect requires completion callback. */
|
||||||
plugin->completed (plugin, actor, META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE);
|
plugin->completed (plugin, mcw, META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -472,7 +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 = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
ActorPrivate *apriv = get_actor_private (actor);
|
MetaCompWindow *mcw = META_COMP_WINDOW (actor);
|
||||||
|
ActorPrivate *apriv = get_actor_private (mcw);
|
||||||
|
|
||||||
apriv->tml_map = NULL;
|
apriv->tml_map = NULL;
|
||||||
|
|
||||||
@ -484,7 +498,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 */
|
||||||
if (plugin->completed)
|
if (plugin->completed)
|
||||||
plugin->completed (plugin, actor, META_COMPOSITOR_CLUTTER_PLUGIN_MAP);
|
plugin->completed (plugin, mcw, META_COMPOSITOR_CLUTTER_PLUGIN_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -492,14 +506,18 @@ on_map_effect_complete (ClutterActor *actor, gpointer data)
|
|||||||
* completion).
|
* completion).
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
map (ClutterActor *actor, MetaCompWindowType type, gint workspace)
|
map (MetaCompWindow *mcw)
|
||||||
{
|
{
|
||||||
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
PluginPrivate *priv = plugin->plugin_private;
|
PluginPrivate *priv = plugin->plugin_private;
|
||||||
|
MetaCompWindowType type;
|
||||||
|
ClutterActor *actor = CLUTTER_ACTOR (mcw);
|
||||||
|
|
||||||
|
type = meta_comp_window_get_window_type (mcw);
|
||||||
|
|
||||||
if (type == META_COMP_WINDOW_NORMAL)
|
if (type == META_COMP_WINDOW_NORMAL)
|
||||||
{
|
{
|
||||||
ActorPrivate *apriv = get_actor_private (actor);
|
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);
|
||||||
@ -521,7 +539,7 @@ map (ClutterActor *actor, MetaCompWindowType type, gint workspace)
|
|||||||
|
|
||||||
}
|
}
|
||||||
else if (plugin->completed)
|
else if (plugin->completed)
|
||||||
plugin->completed (plugin, actor, META_COMPOSITOR_CLUTTER_PLUGIN_MAP);
|
plugin->completed (plugin, mcw, META_COMPOSITOR_CLUTTER_PLUGIN_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -533,28 +551,33 @@ static void
|
|||||||
on_destroy_effect_complete (ClutterActor *actor, gpointer data)
|
on_destroy_effect_complete (ClutterActor *actor, gpointer data)
|
||||||
{
|
{
|
||||||
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
ActorPrivate *apriv = get_actor_private (actor);
|
MetaCompWindow *mcw = META_COMP_WINDOW (actor);
|
||||||
|
ActorPrivate *apriv = get_actor_private (mcw);
|
||||||
|
|
||||||
apriv->tml_destroy = NULL;
|
apriv->tml_destroy = NULL;
|
||||||
|
|
||||||
plugin->running--;
|
plugin->running--;
|
||||||
|
|
||||||
if (plugin->completed)
|
if (plugin->completed)
|
||||||
plugin->completed (plugin, actor, META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY);
|
plugin->completed (plugin, mcw, META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Simple TV-out like effect.
|
* Simple TV-out like effect.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
destroy (ClutterActor *actor, MetaCompWindowType type, gint workspace)
|
destroy (MetaCompWindow *mcw)
|
||||||
{
|
{
|
||||||
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
PluginPrivate *priv = plugin->plugin_private;
|
PluginPrivate *priv = plugin->plugin_private;
|
||||||
|
MetaCompWindowType type;
|
||||||
|
ClutterActor *actor = CLUTTER_ACTOR (mcw);
|
||||||
|
|
||||||
|
type = meta_comp_window_get_window_type (mcw);
|
||||||
|
|
||||||
if (type == META_COMP_WINDOW_NORMAL)
|
if (type == META_COMP_WINDOW_NORMAL)
|
||||||
{
|
{
|
||||||
ActorPrivate *apriv = get_actor_private (actor);
|
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);
|
||||||
@ -570,14 +593,15 @@ destroy (ClutterActor *actor, MetaCompWindowType type, gint workspace)
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
else if (plugin->completed)
|
else if (plugin->completed)
|
||||||
plugin->completed (plugin, actor, META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY);
|
plugin->completed (plugin, mcw, META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
kill_effect (ClutterActor *actor, gulong event)
|
kill_effect (MetaCompWindow *mcw, gulong event)
|
||||||
{
|
{
|
||||||
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
MetaCompositorClutterPlugin *plugin = &META_COMPOSITOR_CLUTTER_PLUGIN_STRUCT;
|
||||||
ActorPrivate *apriv;
|
ActorPrivate *apriv;
|
||||||
|
ClutterActor *actor = CLUTTER_ACTOR (mcw);
|
||||||
|
|
||||||
if (!(plugin->features & event))
|
if (!(plugin->features & event))
|
||||||
{
|
{
|
||||||
@ -603,7 +627,7 @@ kill_effect (ClutterActor *actor, gulong event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apriv = get_actor_private (actor);
|
apriv = get_actor_private (mcw);
|
||||||
|
|
||||||
if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE) && apriv->tml_minimize)
|
if ((event & META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE) && apriv->tml_minimize)
|
||||||
{
|
{
|
||||||
|
@ -58,7 +58,7 @@ struct MetaCompositorClutterPluginPrivate
|
|||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
meta_compositor_clutter_effect_completed (MetaCompositorClutterPlugin *plugin,
|
meta_compositor_clutter_effect_completed (MetaCompositorClutterPlugin *plugin,
|
||||||
ClutterActor *actor,
|
MetaCompWindow *actor,
|
||||||
unsigned long event)
|
unsigned long event)
|
||||||
{
|
{
|
||||||
if (!actor)
|
if (!actor)
|
||||||
@ -347,8 +347,13 @@ meta_compositor_clutter_plugin_manager_load (MetaCompositorClutterPluginManager
|
|||||||
plg, params)))
|
plg, params)))
|
||||||
mgr->plugins = g_list_prepend (mgr->plugins, p);
|
mgr->plugins = g_list_prepend (mgr->plugins, p);
|
||||||
else
|
else
|
||||||
g_module_close (plg);
|
{
|
||||||
|
g_message ("Plugin load for [%s] failed\n", path);
|
||||||
|
g_module_close (plg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
g_message ("Unable to load plugin [%s]\n", path);
|
||||||
|
|
||||||
g_free (path);
|
g_free (path);
|
||||||
g_free (plg_string);
|
g_free (plg_string);
|
||||||
@ -451,10 +456,10 @@ meta_compositor_clutter_plugin_manager_new (MetaScreen *screen,
|
|||||||
return mgr;
|
return mgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
meta_compositor_clutter_plugin_manager_kill_effect (MetaCompositorClutterPluginManager *mgr,
|
meta_compositor_clutter_plugin_manager_kill_effect (MetaCompositorClutterPluginManager *mgr,
|
||||||
ClutterActor *actor,
|
MetaCompWindow *actor,
|
||||||
unsigned long events)
|
unsigned long events)
|
||||||
{
|
{
|
||||||
GList *l = mgr->plugins;
|
GList *l = mgr->plugins;
|
||||||
|
|
||||||
@ -484,10 +489,8 @@ meta_compositor_clutter_plugin_manager_kill_effect (MetaCompositorClutterPluginM
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
meta_compositor_clutter_plugin_manager_event_simple (MetaCompositorClutterPluginManager *mgr,
|
meta_compositor_clutter_plugin_manager_event_simple (MetaCompositorClutterPluginManager *mgr,
|
||||||
ClutterActor *actor,
|
MetaCompWindow *actor,
|
||||||
unsigned long event,
|
unsigned long event)
|
||||||
MetaCompWindowType type,
|
|
||||||
gint workspace)
|
|
||||||
{
|
{
|
||||||
GList *l = mgr->plugins;
|
GList *l = mgr->plugins;
|
||||||
gboolean retval = FALSE;
|
gboolean retval = FALSE;
|
||||||
@ -509,7 +512,7 @@ meta_compositor_clutter_plugin_manager_event_simple (MetaCompositorClutterPlugin
|
|||||||
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
||||||
actor,
|
actor,
|
||||||
ALL_BUT_SWITCH);
|
ALL_BUT_SWITCH);
|
||||||
plg->minimize (actor, type, workspace);
|
plg->minimize (actor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case META_COMPOSITOR_CLUTTER_PLUGIN_MAP:
|
case META_COMPOSITOR_CLUTTER_PLUGIN_MAP:
|
||||||
@ -518,13 +521,13 @@ meta_compositor_clutter_plugin_manager_event_simple (MetaCompositorClutterPlugin
|
|||||||
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
||||||
actor,
|
actor,
|
||||||
ALL_BUT_SWITCH);
|
ALL_BUT_SWITCH);
|
||||||
plg->map (actor, type, workspace);
|
plg->map (actor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY:
|
case META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY:
|
||||||
if (plg->destroy)
|
if (plg->destroy)
|
||||||
{
|
{
|
||||||
plg->destroy (actor, type, workspace);
|
plg->destroy (actor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -549,14 +552,12 @@ meta_compositor_clutter_plugin_manager_event_simple (MetaCompositorClutterPlugin
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
meta_compositor_clutter_plugin_manager_event_maximize (MetaCompositorClutterPluginManager *mgr,
|
meta_compositor_clutter_plugin_manager_event_maximize (MetaCompositorClutterPluginManager *mgr,
|
||||||
ClutterActor *actor,
|
MetaCompWindow *actor,
|
||||||
unsigned long event,
|
unsigned long event,
|
||||||
MetaCompWindowType type,
|
gint target_x,
|
||||||
gint workspace,
|
gint target_y,
|
||||||
gint target_x,
|
gint target_width,
|
||||||
gint target_y,
|
gint target_height)
|
||||||
gint target_width,
|
|
||||||
gint target_height)
|
|
||||||
{
|
{
|
||||||
GList *l = mgr->plugins;
|
GList *l = mgr->plugins;
|
||||||
gboolean retval = FALSE;
|
gboolean retval = FALSE;
|
||||||
@ -578,7 +579,7 @@ meta_compositor_clutter_plugin_manager_event_maximize (MetaCompositorClutterPlug
|
|||||||
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
||||||
actor,
|
actor,
|
||||||
ALL_BUT_SWITCH);
|
ALL_BUT_SWITCH);
|
||||||
plg->maximize (actor, type, workspace,
|
plg->maximize (actor,
|
||||||
target_x, target_y,
|
target_x, target_y,
|
||||||
target_width, target_height);
|
target_width, target_height);
|
||||||
}
|
}
|
||||||
@ -589,7 +590,7 @@ meta_compositor_clutter_plugin_manager_event_maximize (MetaCompositorClutterPlug
|
|||||||
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
||||||
actor,
|
actor,
|
||||||
ALL_BUT_SWITCH);
|
ALL_BUT_SWITCH);
|
||||||
plg->unmaximize (actor, type, workspace,
|
plg->unmaximize (actor,
|
||||||
target_x, target_y,
|
target_x, target_y,
|
||||||
target_width, target_height);
|
target_width, target_height);
|
||||||
}
|
}
|
||||||
@ -635,7 +636,7 @@ meta_compositor_clutter_plugin_manager_switch_workspace (MetaCompositorClutterPl
|
|||||||
{
|
{
|
||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
meta_compositor_clutter_plugin_manager_kill_effect (mgr,
|
||||||
CLUTTER_ACTOR ((*actors)->data),
|
META_COMP_WINDOW ((*actors)->data),
|
||||||
META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE);
|
META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE);
|
||||||
plg->switch_workspace (actors, from, to);
|
plg->switch_workspace (actors, from, to);
|
||||||
}
|
}
|
||||||
@ -659,7 +660,12 @@ gboolean
|
|||||||
meta_compositor_clutter_plugin_manager_xevent_filter
|
meta_compositor_clutter_plugin_manager_xevent_filter
|
||||||
(MetaCompositorClutterPluginManager *mgr, XEvent *xev)
|
(MetaCompositorClutterPluginManager *mgr, XEvent *xev)
|
||||||
{
|
{
|
||||||
GList *l = mgr->plugins;
|
GList *l;
|
||||||
|
|
||||||
|
if (!mgr)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
l = mgr->plugins;
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
|
@ -32,19 +32,15 @@ typedef struct MetaCompositorClutterPluginManager MetaCompositorClutterPluginMan
|
|||||||
|
|
||||||
MetaCompositorClutterPluginManager * meta_compositor_clutter_plugin_manager_new (MetaScreen *screen, ClutterActor *stage);
|
MetaCompositorClutterPluginManager * meta_compositor_clutter_plugin_manager_new (MetaScreen *screen, ClutterActor *stage);
|
||||||
gboolean meta_compositor_clutter_plugin_manager_event_simple (MetaCompositorClutterPluginManager *mgr,
|
gboolean meta_compositor_clutter_plugin_manager_event_simple (MetaCompositorClutterPluginManager *mgr,
|
||||||
ClutterActor *actor,
|
MetaCompWindow *actor,
|
||||||
unsigned long event,
|
unsigned long event);
|
||||||
MetaCompWindowType type,
|
|
||||||
gint workspace);
|
|
||||||
|
|
||||||
gboolean meta_compositor_clutter_plugin_manager_event_maximize (MetaCompositorClutterPluginManager *mgr,
|
gboolean meta_compositor_clutter_plugin_manager_event_maximize (MetaCompositorClutterPluginManager *mgr,
|
||||||
ClutterActor *actor,
|
MetaCompWindow *actor,
|
||||||
unsigned long event,
|
unsigned long event,
|
||||||
MetaCompWindowType type,
|
gint target_x,
|
||||||
gint workspace,
|
gint target_y,
|
||||||
gint target_x,
|
gint target_width,
|
||||||
gint target_y,
|
|
||||||
gint target_width,
|
|
||||||
gint target_height);
|
gint target_height);
|
||||||
void meta_compositor_clutter_plugin_manager_update_workspaces (MetaCompositorClutterPluginManager *mgr);
|
void meta_compositor_clutter_plugin_manager_update_workspaces (MetaCompositorClutterPluginManager *mgr);
|
||||||
|
|
||||||
|
@ -772,13 +772,13 @@ meta_compositor_clutter_finish_workspace_switch (MetaCompScreen *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_compositor_clutter_window_effect_completed (ClutterActor *actor,
|
meta_compositor_clutter_window_effect_completed (MetaCompWindow *cw,
|
||||||
gulong event)
|
gulong event)
|
||||||
{
|
{
|
||||||
MetaCompWindow *cw = META_COMP_WINDOW (actor);
|
|
||||||
MetaCompWindowPrivate *priv = cw->priv;
|
MetaCompWindowPrivate *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);
|
||||||
|
|
||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
@ -1051,9 +1051,8 @@ map_win (MetaCompWindow *cw)
|
|||||||
*/
|
*/
|
||||||
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,
|
!meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr,
|
||||||
CLUTTER_ACTOR (cw),
|
cw,
|
||||||
META_COMPOSITOR_CLUTTER_PLUGIN_MAP,
|
META_COMPOSITOR_CLUTTER_PLUGIN_MAP))
|
||||||
cw->priv->type, 0))
|
|
||||||
{
|
{
|
||||||
clutter_actor_show_all (CLUTTER_ACTOR (cw));
|
clutter_actor_show_all (CLUTTER_ACTOR (cw));
|
||||||
priv->map_in_progress--;
|
priv->map_in_progress--;
|
||||||
@ -1947,9 +1946,8 @@ clutter_cmp_destroy_window (MetaCompositor *compositor,
|
|||||||
|
|
||||||
if (!info->plugin_mgr ||
|
if (!info->plugin_mgr ||
|
||||||
!meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr,
|
!meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr,
|
||||||
CLUTTER_ACTOR (cw),
|
cw,
|
||||||
META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY,
|
META_COMPOSITOR_CLUTTER_PLUGIN_DESTROY))
|
||||||
cw->priv->type, 0))
|
|
||||||
{
|
{
|
||||||
priv->destroy_in_progress--;
|
priv->destroy_in_progress--;
|
||||||
clutter_actor_destroy (CLUTTER_ACTOR (cw));
|
clutter_actor_destroy (CLUTTER_ACTOR (cw));
|
||||||
@ -1984,9 +1982,8 @@ clutter_cmp_minimize_window (MetaCompositor *compositor, MetaWindow *window)
|
|||||||
|
|
||||||
if (!info->plugin_mgr ||
|
if (!info->plugin_mgr ||
|
||||||
!meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr,
|
!meta_compositor_clutter_plugin_manager_event_simple (info->plugin_mgr,
|
||||||
CLUTTER_ACTOR (cw),
|
cw,
|
||||||
META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE,
|
META_COMPOSITOR_CLUTTER_PLUGIN_MINIMIZE))
|
||||||
cw->priv->type, 0))
|
|
||||||
{
|
{
|
||||||
ClutterActor *a = CLUTTER_ACTOR (cw);
|
ClutterActor *a = CLUTTER_ACTOR (cw);
|
||||||
gint height = clutter_actor_get_height (a);
|
gint height = clutter_actor_get_height (a);
|
||||||
@ -2022,9 +2019,9 @@ clutter_cmp_maximize_window (MetaCompositor *compositor, MetaWindow *window,
|
|||||||
|
|
||||||
if (!info->plugin_mgr ||
|
if (!info->plugin_mgr ||
|
||||||
!meta_compositor_clutter_plugin_manager_event_maximize (info->plugin_mgr,
|
!meta_compositor_clutter_plugin_manager_event_maximize (info->plugin_mgr,
|
||||||
CLUTTER_ACTOR (cw),
|
cw,
|
||||||
META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE,
|
META_COMPOSITOR_CLUTTER_PLUGIN_MAXIMIZE,
|
||||||
cw->priv->type, 0, x, y, width, height))
|
x, y, width, height))
|
||||||
{
|
{
|
||||||
cw->priv->maximize_in_progress--;
|
cw->priv->maximize_in_progress--;
|
||||||
}
|
}
|
||||||
@ -2055,9 +2052,9 @@ clutter_cmp_unmaximize_window (MetaCompositor *compositor, MetaWindow *window,
|
|||||||
|
|
||||||
if (!info->plugin_mgr ||
|
if (!info->plugin_mgr ||
|
||||||
!meta_compositor_clutter_plugin_manager_event_maximize (info->plugin_mgr,
|
!meta_compositor_clutter_plugin_manager_event_maximize (info->plugin_mgr,
|
||||||
CLUTTER_ACTOR (cw),
|
cw,
|
||||||
META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE,
|
META_COMPOSITOR_CLUTTER_PLUGIN_UNMAXIMIZE,
|
||||||
cw->priv->type, 0, x, y, width, height))
|
x, y, width, height))
|
||||||
{
|
{
|
||||||
cw->priv->unmaximize_in_progress--;
|
cw->priv->unmaximize_in_progress--;
|
||||||
}
|
}
|
||||||
@ -2130,13 +2127,6 @@ clutter_cmp_switch_workspace (MetaCompositor *compositor,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Attach workspace number to the actor, so the plugin can use it.
|
|
||||||
*/
|
|
||||||
g_object_set_data (G_OBJECT (cw),
|
|
||||||
META_COMPOSITOR_CLUTTER_PLUGIN_WORKSPACE_KEY,
|
|
||||||
GINT_TO_POINTER (workspace));
|
|
||||||
|
|
||||||
l = l->next;
|
l = l->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "compositor.h"
|
#include "compositor.h"
|
||||||
|
#include "compositor-clutter.h"
|
||||||
|
|
||||||
#include <clutter/clutter.h>
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
@ -93,12 +94,6 @@ typedef struct MetaCompositorClutterPlugin MetaCompositorClutterPlugin;
|
|||||||
|
|
||||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_ALL_EFFECTS 0xffffffffUL
|
#define META_COMPOSITOR_CLUTTER_PLUGIN_ALL_EFFECTS 0xffffffffUL
|
||||||
|
|
||||||
/*
|
|
||||||
* A key that the switch_workspace() handler can use to retrive workspace
|
|
||||||
* the actor is on.
|
|
||||||
*/
|
|
||||||
#define META_COMPOSITOR_CLUTTER_PLUGIN_WORKSPACE_KEY "MCCP-Manager-workspace"
|
|
||||||
|
|
||||||
struct MetaCompositorClutterPlugin
|
struct MetaCompositorClutterPlugin
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -136,33 +131,23 @@ 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) (ClutterActor *actor,
|
void (*minimize) (MetaCompWindow *actor);
|
||||||
MetaCompWindowType type,
|
|
||||||
gint workspace);
|
|
||||||
|
|
||||||
void (*maximize) (ClutterActor *actor,
|
void (*maximize) (MetaCompWindow *actor,
|
||||||
MetaCompWindowType type,
|
|
||||||
gint workspace,
|
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gint width,
|
gint width,
|
||||||
gint height);
|
gint height);
|
||||||
|
|
||||||
void (*unmaximize) (ClutterActor *actor,
|
void (*unmaximize) (MetaCompWindow *actor,
|
||||||
MetaCompWindowType type,
|
|
||||||
gint workspace,
|
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gint width,
|
gint width,
|
||||||
gint height);
|
gint height);
|
||||||
|
|
||||||
void (*map) (ClutterActor *actor,
|
void (*map) (MetaCompWindow *actor);
|
||||||
MetaCompWindowType type,
|
|
||||||
gint workspace);
|
|
||||||
|
|
||||||
void (*destroy) (ClutterActor *actor,
|
void (*destroy) (MetaCompWindow *actor);
|
||||||
MetaCompWindowType type,
|
|
||||||
gint workspace);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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
|
||||||
@ -179,7 +164,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) (ClutterActor *actor,
|
void (*kill_effect) (MetaCompWindow *actor,
|
||||||
gulong events);
|
gulong events);
|
||||||
|
|
||||||
|
|
||||||
@ -253,7 +238,7 @@ struct MetaCompositorClutterPlugin
|
|||||||
* actor list, but the actor parameter must not be NULL.
|
* actor list, but the actor parameter must not be NULL.
|
||||||
*/
|
*/
|
||||||
void (*completed) (MetaCompositorClutterPlugin *plugin,
|
void (*completed) (MetaCompositorClutterPlugin *plugin,
|
||||||
ClutterActor *actor,
|
MetaCompWindow *actor,
|
||||||
unsigned long event);
|
unsigned long event);
|
||||||
|
|
||||||
/* Private; manager private data. */
|
/* Private; manager private data. */
|
||||||
|
@ -25,12 +25,9 @@
|
|||||||
#ifndef META_COMPOSITOR_CLUTTER_H_
|
#ifndef META_COMPOSITOR_CLUTTER_H_
|
||||||
#define META_COMPOSITOR_CLUTTER_H_
|
#define META_COMPOSITOR_CLUTTER_H_
|
||||||
|
|
||||||
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "compositor-clutter-plugin.h"
|
|
||||||
|
|
||||||
MetaCompositor *meta_compositor_clutter_new (MetaDisplay *display);
|
|
||||||
|
|
||||||
void meta_compositor_clutter_window_effect_completed (ClutterActor *actor, gulong event);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MetaCompWindow object (ClutterGroup sub-class)
|
* MetaCompWindow object (ClutterGroup sub-class)
|
||||||
@ -64,4 +61,11 @@ Window meta_comp_window_get_x_window (MetaCompWindow *mcw);
|
|||||||
MetaCompWindowType meta_comp_window_get_window_type (MetaCompWindow *mcw);
|
MetaCompWindowType meta_comp_window_get_window_type (MetaCompWindow *mcw);
|
||||||
gint meta_comp_window_get_workspace (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);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user