summaryrefslogtreecommitdiff
path: root/src/shell-wm.c
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@src.gnome.org>2008-12-29 04:44:03 +0000
committerJonathan Matthew <jmatthew@src.gnome.org>2008-12-29 04:44:03 +0000
commit85c22e484d0e32aa2e9d8618f7654fd3409b6154 (patch)
treeaf6eddfdbadf7be2c24a5c83308e9a35f496e490 /src/shell-wm.c
parentb3aaf2ced5bc8fccaf857672135bb9223d4ed21f (diff)
implement some basic window management effects. #563844
svn path=/trunk/; revision=139
Diffstat (limited to 'src/shell-wm.c')
-rw-r--r--src/shell-wm.c226
1 files changed, 217 insertions, 9 deletions
diff --git a/src/shell-wm.c b/src/shell-wm.c
index 5fed2c32..7b77a041 100644
--- a/src/shell-wm.c
+++ b/src/shell-wm.c
@@ -14,7 +14,6 @@ struct _ShellWM {
/* Signals */
enum
{
-#ifdef NOT_YET
MINIMIZE,
KILL_MINIMIZE,
MAXIMIZE,
@@ -25,7 +24,6 @@ enum
KILL_MAP,
DESTROY,
KILL_DESTROY,
-#endif
SWITCH_WORKSPACE,
KILL_SWITCH_WORKSPACE,
@@ -61,6 +59,96 @@ shell_wm_class_init (ShellWMClass *klass)
gobject_class->finalize = shell_wm_finalize;
+ shell_wm_signals[MINIMIZE] =
+ g_signal_new ("minimize",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ MUTTER_TYPE_COMP_WINDOW);
+ shell_wm_signals[KILL_MINIMIZE] =
+ g_signal_new ("kill-minimize",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ MUTTER_TYPE_COMP_WINDOW);
+ shell_wm_signals[MAXIMIZE] =
+ g_signal_new ("maximize",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ _shell_marshal_VOID__OBJECT_INT_INT_INT_INT,
+ G_TYPE_NONE, 5,
+ MUTTER_TYPE_COMP_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
+ shell_wm_signals[KILL_MAXIMIZE] =
+ g_signal_new ("kill-maximize",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ MUTTER_TYPE_COMP_WINDOW);
+ shell_wm_signals[UNMAXIMIZE] =
+ g_signal_new ("unmaximize",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ _shell_marshal_VOID__OBJECT_INT_INT_INT_INT,
+ G_TYPE_NONE, 1,
+ MUTTER_TYPE_COMP_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
+ shell_wm_signals[KILL_UNMAXIMIZE] =
+ g_signal_new ("kill-unmaximize",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ MUTTER_TYPE_COMP_WINDOW);
+ shell_wm_signals[MAP] =
+ g_signal_new ("map",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ MUTTER_TYPE_COMP_WINDOW);
+ shell_wm_signals[KILL_MAP] =
+ g_signal_new ("kill-map",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ MUTTER_TYPE_COMP_WINDOW);
+ shell_wm_signals[DESTROY] =
+ g_signal_new ("destroy",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ MUTTER_TYPE_COMP_WINDOW);
+ shell_wm_signals[KILL_DESTROY] =
+ g_signal_new ("kill-destroy",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ MUTTER_TYPE_COMP_WINDOW);
shell_wm_signals[SWITCH_WORKSPACE] =
g_signal_new ("switch-workspace",
G_TYPE_FROM_CLASS (klass),
@@ -148,29 +236,149 @@ shell_wm_completed_switch_workspace (ShellWM *wm)
shell_wm_set_switch_workspace_actors (wm, NULL);
}
+/**
+ * shell_wm_completed_minimize
+ * @wm: the ShellWM
+ * @actor: the MutterWindow actor
+ *
+ * The plugin must call this when it has completed a window minimize effect.
+ **/
+void
+shell_wm_completed_minimize (ShellWM *wm,
+ MutterWindow *actor)
+{
+ mutter_plugin_effect_completed (wm->plugin,
+ actor,
+ MUTTER_PLUGIN_MINIMIZE);
+}
+
+/**
+ * shell_wm_completed_maximize
+ * @wm: the ShellWM
+ * @actor: the MutterWindow actor
+ *
+ * The plugin must call this when it has completed a window maximize effect.
+ **/
+void
+shell_wm_completed_maximize (ShellWM *wm,
+ MutterWindow *actor)
+{
+ mutter_plugin_effect_completed (wm->plugin,
+ actor,
+ MUTTER_PLUGIN_MAXIMIZE);
+}
+
+/**
+ * shell_wm_completed_unmaximize
+ * @wm: the ShellWM
+ * @actor: the MutterWindow actor
+ *
+ * The plugin must call this when it has completed a window unmaximize effect.
+ **/
+void
+shell_wm_completed_unmaximize (ShellWM *wm,
+ MutterWindow *actor)
+{
+ mutter_plugin_effect_completed (wm->plugin,
+ actor,
+ MUTTER_PLUGIN_UNMAXIMIZE);
+}
+
+/**
+ * shell_wm_completed_map
+ * @wm: the ShellWM
+ * @actor: the MutterWindow actor
+ *
+ * The plugin must call this when it has completed a window map effect.
+ **/
+void
+shell_wm_completed_map (ShellWM *wm,
+ MutterWindow *actor)
+{
+ mutter_plugin_effect_completed (wm->plugin,
+ actor,
+ MUTTER_PLUGIN_MAP);
+}
+
+/**
+ * shell_wm_completed_destroy
+ * @wm: the ShellWM
+ * @actor: the MutterWindow actor
+ *
+ * The plugin must call this when it has completed a window destroy effect.
+ **/
+void
+shell_wm_completed_destroy (ShellWM *wm,
+ MutterWindow *actor)
+{
+ mutter_plugin_effect_completed (wm->plugin,
+ actor,
+ MUTTER_PLUGIN_DESTROY);
+}
void
_shell_wm_kill_effect (ShellWM *wm,
MutterWindow *actor,
gulong events)
{
-#ifdef NOT_YET
if (events & MUTTER_PLUGIN_MINIMIZE)
- g_signal_emit (wm, shell_wm_signals[KILL_MINIMIZE], 0);
+ g_signal_emit (wm, shell_wm_signals[KILL_MINIMIZE], 0, actor);
if (events & MUTTER_PLUGIN_MAXIMIZE)
- g_signal_emit (wm, shell_wm_signals[KILL_MAXIMIZE], 0);
+ g_signal_emit (wm, shell_wm_signals[KILL_MAXIMIZE], 0, actor);
if (events & MUTTER_PLUGIN_UNMAXIMIZE)
- g_signal_emit (wm, shell_wm_signals[KILL_UNMAXIMIZE], 0);
+ g_signal_emit (wm, shell_wm_signals[KILL_UNMAXIMIZE], 0, actor);
if (events & MUTTER_PLUGIN_MAP)
- g_signal_emit (wm, shell_wm_signals[KILL_MAP], 0);
+ g_signal_emit (wm, shell_wm_signals[KILL_MAP], 0, actor);
if (events & MUTTER_PLUGIN_DESTROY)
- g_signal_emit (wm, shell_wm_signals[KILL_DESTROY], 0);
-#endif
+ g_signal_emit (wm, shell_wm_signals[KILL_DESTROY], 0, actor);
if (events & MUTTER_PLUGIN_SWITCH_WORKSPACE)
g_signal_emit (wm, shell_wm_signals[KILL_SWITCH_WORKSPACE], 0);
}
+void
+_shell_wm_minimize (ShellWM *wm,
+ MutterWindow *actor)
+{
+ g_signal_emit (wm, shell_wm_signals[MINIMIZE], 0, actor);
+}
+
+void
+_shell_wm_maximize (ShellWM *wm,
+ MutterWindow *actor,
+ int target_x,
+ int target_y,
+ int target_width,
+ int target_height)
+{
+ g_signal_emit (wm, shell_wm_signals[MAXIMIZE], 0, actor, target_x, target_y, target_width, target_height);
+}
+
+void
+_shell_wm_unmaximize (ShellWM *wm,
+ MutterWindow *actor,
+ int target_x,
+ int target_y,
+ int target_width,
+ int target_height)
+{
+ g_signal_emit (wm, shell_wm_signals[UNMAXIMIZE], 0, actor, target_x, target_y, target_width, target_height);
+}
+
+void
+_shell_wm_map (ShellWM *wm,
+ MutterWindow *actor)
+{
+ g_signal_emit (wm, shell_wm_signals[MAP], 0, actor);
+}
+
+void
+_shell_wm_destroy (ShellWM *wm,
+ MutterWindow *actor)
+{
+ g_signal_emit (wm, shell_wm_signals[DESTROY], 0, actor);
+}
+
/**
* shell_wm_new:
* @plugin: the #MutterPlugin