summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajackson@src.gnome.org>2006-05-23 21:42:34 +0000
committerAdam Jackson <ajackson@src.gnome.org>2006-05-23 21:42:34 +0000
commit22bc36eb3b6444c5901ca68b48ffe193983de335 (patch)
tree84725751a41d5868e0ad456f0145b2106522773a
parent7592470dab8805f65ff6ab820400c13e4c2c5902 (diff)
downloadmetacity-22bc36eb3b6444c5901ca68b48ffe193983de335.tar.gz
Move shrink effect code from compositor.c to c-window.c. Stubs for
restore effect. Notes in various places for where to hook in other effects.
-rw-r--r--ChangeLog12
-rw-r--r--src/c-window.c348
-rw-r--r--src/c-window.h4
-rw-r--r--src/compositor.c337
-rw-r--r--src/effects.c45
-rw-r--r--src/effects.h12
-rw-r--r--src/window.c4
7 files changed, 423 insertions, 339 deletions
diff --git a/ChangeLog b/ChangeLog
index 4e8bf5a3..6151562e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-05-23 Adam Jackson <ajax@freedesktop.org>
+
+ * src/c-window.c:
+ * src/c-window.h:
+ * src/compositor.c:
+ * src/effects.c:
+ * src/effects.h:
+ * src/window.c:
+ Move shrink effect code from compositor.c to c-window.c. Stubs for
+ restore effect. Notes in various places for where to hook in
+ other effects.
+
Tue May 23 16:36:04 2006 Søren Sandmann <sandmann@redhat.com>
* src/compositor.c (do_effect): Also use explode when windows close.
diff --git a/src/c-window.c b/src/c-window.c
index d44aed5e..97a5fc69 100644
--- a/src/c-window.c
+++ b/src/c-window.c
@@ -634,3 +634,351 @@ meta_comp_window_explode (MetaCompWindow *comp_window,
}
#endif
+
+/* new shrinkydink code */
+
+#define SHRINK_TIME 1.0
+
+typedef struct
+{
+ MetaEffect *effect;
+ MetaCompWindow *window;
+ gdouble elapsed;
+ GTimer * timer;
+} ShrinkInfo;
+
+static gboolean
+update_shrink (gpointer data)
+{
+ ShrinkInfo *info = data;
+ CmDrawableNode *node = (CmDrawableNode *)info->window->node;
+ gdouble elapsed = g_timer_elapsed (info->timer, NULL);
+
+ if (elapsed > SHRINK_TIME)
+ {
+ meta_effect_end (info->effect);
+
+ cm_drawable_node_set_viewable (node, FALSE);
+ // cm_drawable_node_set_explosion_level (node, 0.0);
+ return FALSE;
+ }
+ else
+ {
+ gdouble t = elapsed / SHRINK_TIME;
+
+ // cm_drawable_node_set_explosion_level (node, transform (t));
+ return TRUE;
+ }
+}
+
+void
+meta_comp_window_shrink (MetaCompWindow *comp_window,
+ MetaEffect *effect)
+{
+ ShrinkInfo *info = g_new0 (ShrinkInfo, 1);
+
+ info->window = comp_window;
+ info->effect = effect;
+ info->timer = g_timer_new ();
+
+ g_idle_add (update_shrink, info);
+}
+
+#if 0
+/* old shrinkydink minimize effect */
+
+#ifdef HAVE_COMPOSITE_EXTENSIONS
+
+static gdouble
+interpolate (gdouble t, gdouble begin, gdouble end, double power)
+{
+ return (begin + (end - begin) * pow (t, power));
+}
+
+static void
+interpolate_rectangle (gdouble t,
+ WsRectangle * from,
+ WsRectangle * to,
+ WsRectangle * result)
+{
+ if (!result)
+ return;
+
+ result->x = interpolate (t, from->x, to->x, 2);
+ result->y = interpolate (t, from->y, to->y, 0.5);
+ result->width = interpolate (t, from->width, to->width, 0.7);
+ result->height = interpolate (t, from->height, to->height, 0.7);
+}
+
+#endif
+
+typedef struct
+{
+ MetaWindow *window;
+ GTimer *timer;
+
+ MetaCompositor *compositor;
+ MetaCompScreen *scr_info;
+
+ MetaAnimationFinishedFunc finished_func;
+ gpointer finished_data;
+
+ gdouble aspect_ratio;
+
+ WsRectangle current_geometry;
+ WsRectangle target_geometry;
+ gdouble current_alpha;
+ gdouble target_alpha;
+
+ int button_x;
+ int button_y;
+ int button_width;
+ int button_height;
+
+ /* FIXME: maybe would be simpler if all of this was an array */
+ gboolean phase_1_started;
+ gboolean phase_2_started;
+ gboolean phase_3_started;
+ gboolean phase_4_started;
+ gboolean phase_5_started;
+} MiniInfo;
+
+static void
+set_geometry (MiniInfo *info, gdouble elapsed)
+{
+ WsRectangle rect;
+
+ interpolate_rectangle (elapsed, &info->current_geometry, &info->target_geometry, &rect);
+
+ g_print ("y: %d %d (%f => %d)\n", info->current_geometry.y, info->target_geometry.y,
+ elapsed, rect.y);
+
+ g_print ("setting: %d %d %d %d\n", rect.x, rect.y, rect.width, rect.height);
+
+ meta_comp_screen_set_target_rect (info->scr_info,
+ get_xid (info->window), &rect);
+}
+
+static int
+center (gdouble what, gdouble in)
+{
+ return (in - what) / 2.0 + 0.5;
+}
+
+static void
+run_phase_1 (MiniInfo *info, gdouble elapsed)
+{
+ if (!info->phase_1_started)
+ {
+#if 0
+ g_print ("starting phase 1\n");
+#endif
+ info->phase_1_started = TRUE;
+
+ meta_comp_screen_get_real_size (info->scr_info, get_xid (info->window),
+ &info->current_geometry);
+
+#if 0
+ info->current_geometry.x = info->node->real_x;
+ info->current_geometry.y = info->node->real_y;
+ info->current_geometry.width = info->node->real_width;
+ info->current_geometry.height = info->node->real_height;
+#endif
+
+ info->target_geometry.height = info->button_height;
+ info->target_geometry.width = info->button_height * info->aspect_ratio;
+ info->target_geometry.x = info->button_x + center (info->target_geometry.width, info->button_width);
+ info->target_geometry.y = info->current_geometry.y + center (info->button_height, info->current_geometry.height);
+ }
+
+ set_geometry (info, elapsed);
+}
+
+static void
+run_phase_2 (MiniInfo *info, gdouble elapsed)
+{
+#define WOBBLE_FACTOR 3
+
+ if (!info->phase_2_started)
+ {
+ WsRectangle cur = info->target_geometry;
+
+ g_print ("starting phase 2\n");
+
+ info->phase_2_started = TRUE;
+
+ info->current_geometry = cur;
+
+ info->target_geometry.x = cur.x + center (WOBBLE_FACTOR * cur.width, cur.width);
+ info->target_geometry.y = cur.y + center (WOBBLE_FACTOR * cur.height, cur.height);
+ info->target_geometry.width = cur.width * WOBBLE_FACTOR;
+ info->target_geometry.height = cur.height * WOBBLE_FACTOR;
+ }
+
+ set_geometry (info, elapsed);
+}
+
+static void
+run_phase_3 (MiniInfo *info, gdouble elapsed)
+{
+ if (!info->phase_3_started)
+ {
+ WsRectangle cur = info->target_geometry;
+ WsRectangle real;
+
+ meta_comp_screen_get_real_size (info->scr_info, get_xid (info->window),
+ &real);
+
+ g_print ("starting phase 3\n");
+ info->phase_3_started = TRUE;
+
+ info->current_geometry = cur;
+
+ info->target_geometry.height = info->button_height;
+ info->target_geometry.width = info->button_height * info->aspect_ratio;
+ info->target_geometry.x = info->button_x + center (info->target_geometry.width, info->button_width);
+ info->target_geometry.y = real.y + center (info->button_height, real.height);
+ }
+
+ set_geometry (info, elapsed);
+}
+
+static void
+run_phase_4 (MiniInfo *info, gdouble elapsed)
+{
+ if (!info->phase_4_started)
+ {
+ WsRectangle cur = info->target_geometry;
+
+ g_print ("starting phase 4\n");
+ info->phase_4_started = TRUE;
+
+ info->current_geometry = cur;
+
+ info->target_geometry.height = info->button_height;
+ info->target_geometry.width = info->button_height * info->aspect_ratio;
+ info->target_geometry.x = cur.x;
+ g_print ("button y: %d\n", info->button_y);
+ info->target_geometry.y = info->button_y;
+ }
+
+ set_geometry (info, elapsed);
+}
+
+static void
+run_phase_5 (MiniInfo *info, gdouble elapsed)
+{
+ if (!info->phase_5_started)
+ {
+ WsRectangle cur = info->target_geometry;
+
+ g_print ("starting phase 5\n");
+ info->phase_5_started = TRUE;
+
+ info->current_geometry = cur;
+ info->target_geometry.x = info->button_x;
+ info->target_geometry.y = info->button_y;
+ info->target_geometry.width = info->button_width;
+ info->target_geometry.height = info->button_height;
+ }
+
+ set_geometry (info, elapsed);
+
+ meta_comp_screen_set_alpha (info->scr_info,
+ get_xid (info->window), 1 - elapsed);
+}
+
+static gboolean
+run_animation_01 (gpointer data)
+{
+ MiniInfo *info = data;
+ gdouble elapsed;
+
+ elapsed = g_timer_elapsed (info->timer, NULL);
+
+#define PHASE_0 0.0
+#define PHASE_1 0.225 /* scale to size of button */
+#define PHASE_2 0.325 /* scale up a little */
+#define PHASE_3 0.425 /* scale back a little */
+#define PHASE_4 0.650 /* move to button */
+#define PHASE_5 1.0 /* fade out */
+
+ if (elapsed < PHASE_1)
+ {
+ /* phase one */
+ run_phase_1 (info, (elapsed - PHASE_0)/(PHASE_1 - PHASE_0));
+ }
+ else if (elapsed < PHASE_2)
+ {
+ /* phase two */
+ run_phase_2 (info, (elapsed - PHASE_1)/(PHASE_2 - PHASE_1));
+ }
+ else if (elapsed < PHASE_3)
+ {
+ /* phase three */
+ run_phase_3 (info, (elapsed - PHASE_2)/(PHASE_3 - PHASE_2));
+ }
+ else if (elapsed < PHASE_4)
+ {
+ /* phase four */
+ run_phase_4 (info, (elapsed - PHASE_3)/(PHASE_4 - PHASE_3));
+ }
+ else if (elapsed < PHASE_5)
+ {
+ /* phase five */
+ run_phase_5 (info, (elapsed - PHASE_4)/(PHASE_5 - PHASE_4));
+ }
+ else
+ {
+ if (info->finished_func)
+ info->finished_func (info->finished_data);
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+void
+meta_compositor_minimize (MetaCompositor *compositor,
+ MetaWindow *window,
+ int x,
+ int y,
+ int width,
+ int height,
+ MetaAnimationFinishedFunc finished,
+ gpointer data)
+{
+ MiniInfo *info = g_new (MiniInfo, 1);
+ WsRectangle start;
+ MetaScreen *screen = window->screen;
+
+ info->window = window;
+ info->timer = g_timer_new ();
+
+ info->finished_func = finished;
+ info->finished_data = data;
+
+ info->phase_1_started = FALSE;
+ info->phase_2_started = FALSE;
+ info->phase_3_started = FALSE;
+ info->phase_4_started = FALSE;
+ info->phase_5_started = FALSE;
+
+ info->button_x = x;
+ info->button_y = y;
+ info->button_width = width;
+ info->button_height = height;
+
+ info->compositor = compositor;
+ info->scr_info = screen->compositor_data;
+
+#if 0
+ cm_drawable_node_set_deformation_func (node, minimize_deformation, info);
+#endif
+
+ info->aspect_ratio = 1.3;
+
+ g_idle_add (run_animation_01, info);
+}
+#endif
diff --git a/src/c-window.h b/src/c-window.h
index a5a526ce..54705e48 100644
--- a/src/c-window.h
+++ b/src/c-window.h
@@ -39,6 +39,10 @@ void meta_comp_window_set_updates (MetaCompWindow *comp_window,
void meta_comp_window_explode (MetaCompWindow *comp_window,
MetaEffect *effect);
+void meta_comp_window_shrink (MetaCompWindow *comp_window,
+ MetaEffect *effect);
+void meta_comp_window_unshrink (MetaCompWindow *comp_window,
+ MetaEffect *effect);
#if 0
void meta_comp_window_set_explode (MetaCompWindow *comp_window,
diff --git a/src/compositor.c b/src/compositor.c
index aeffb294..5935c701 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -109,6 +109,7 @@ static void
do_effect (MetaEffect *effect,
gpointer data)
{
+ /* XXX screen and window should be easier to get than this... */
switch (effect->type)
{
case META_EFFECT_MINIMIZE:
@@ -118,9 +119,21 @@ do_effect (MetaEffect *effect,
MetaCompWindow *window =
meta_comp_screen_lookup_window (screen, effect->u.minimize.window->frame->xwindow);
+ /* meta_comp_window_shrink (window, effect); */
meta_comp_window_explode (window, effect);
break;
}
+#if 0
+ case META_EFFECT_RESTORE:
+ {
+ MetaCompScreen *screen = meta_comp_screen_get_by_xwindow (
+ get_xid (effect->u.restore.window));
+ MetaCompWindow *window = meta_comp_screen_lookup_window (
+ screen, effect->u.restore.window->frame->xwindow);
+ meta_comp_window_unshrink (window, effect);
+ break;
+ }
+#endif
case META_EFFECT_CLOSE:
{
MetaCompScreen *screen = meta_comp_screen_get_by_xwindow (
@@ -690,330 +703,6 @@ minimize_deformation (gdouble time,
}
#endif
-#ifdef HAVE_COMPOSITE_EXTENSIONS
-
-static gdouble
-interpolate (gdouble t, gdouble begin, gdouble end, double power)
-{
- return (begin + (end - begin) * pow (t, power));
-}
-
-static void
-interpolate_rectangle (gdouble t,
- WsRectangle * from,
- WsRectangle * to,
- WsRectangle * result)
-{
- if (!result)
- return;
-
- result->x = interpolate (t, from->x, to->x, 1);
- result->y = interpolate (t, from->y, to->y, 1);
- result->width = interpolate (t, from->width, to->width, 1);
- result->height = interpolate (t, from->height, to->height, 1);
-}
-
-#endif
-
-#define MINIMIZE_STYLE 1
-
-#ifndef HAVE_COMPOSITE_EXTENSIONS
-#undef MINIMIZE_STYLE
-#define MINIMIZE_STYLE 0
-#endif
-
-#if MINIMIZE_STYLE == 0
-
-#if 0
-void
-meta_compositor_minimize (MetaCompositor *compositor,
- MetaWindow *window,
- int x,
- int y,
- int width,
- int height,
- MetaAnimationFinishedFunc finished,
- gpointer data)
-{
-}
-#endif
-
-#elif MINIMIZE_STYLE == 1
-
-typedef struct
-{
- MetaWindow *window;
- GTimer *timer;
-
- MetaCompositor *compositor;
- MetaCompScreen *scr_info;
-
- MetaAnimationFinishedFunc finished_func;
- gpointer finished_data;
-
- gdouble aspect_ratio;
-
- WsRectangle current_geometry;
- WsRectangle target_geometry;
- gdouble current_alpha;
- gdouble target_alpha;
-
- int button_x;
- int button_y;
- int button_width;
- int button_height;
-
- /* FIXME: maybe would be simpler if all of this was an array */
- gboolean phase_1_started;
- gboolean phase_2_started;
- gboolean phase_3_started;
- gboolean phase_4_started;
- gboolean phase_5_started;
-} MiniInfo;
-
-static void
-set_geometry (MiniInfo *info, gdouble elapsed)
-{
- WsRectangle rect;
-
- interpolate_rectangle (elapsed, &info->current_geometry, &info->target_geometry, &rect);
-
- g_print ("y: %d %d (%f => %d)\n", info->current_geometry.y, info->target_geometry.y,
- elapsed, rect.y);
-
- g_print ("setting: %d %d %d %d\n", rect.x, rect.y, rect.width, rect.height);
-
- meta_comp_screen_set_target_rect (info->scr_info,
- get_xid (info->window), &rect);
-}
-
-static int
-center (gdouble what, gdouble in)
-{
- return (in - what) / 2.0 + 0.5;
-}
-
-static void
-run_phase_1 (MiniInfo *info, gdouble elapsed)
-{
- if (!info->phase_1_started)
- {
-#if 0
- g_print ("starting phase 1\n");
-#endif
- info->phase_1_started = TRUE;
-
- meta_comp_screen_get_real_size (info->scr_info, get_xid (info->window),
- &info->current_geometry);
-
-#if 0
- info->current_geometry.x = info->node->real_x;
- info->current_geometry.y = info->node->real_y;
- info->current_geometry.width = info->node->real_width;
- info->current_geometry.height = info->node->real_height;
-#endif
-
- info->target_geometry.height = info->button_height;
- info->target_geometry.width = info->button_height * info->aspect_ratio;
- info->target_geometry.x = info->button_x + center (info->target_geometry.width, info->button_width);
- info->target_geometry.y = info->current_geometry.y + center (info->button_height, info->current_geometry.height);
- }
-
- set_geometry (info, elapsed);
-}
-
-static void
-run_phase_2 (MiniInfo *info, gdouble elapsed)
-{
-#define WOBBLE_FACTOR 3
-
- if (!info->phase_2_started)
- {
- WsRectangle cur = info->target_geometry;
-
- g_print ("starting phase 2\n");
-
- info->phase_2_started = TRUE;
-
- info->current_geometry = cur;
-
- info->target_geometry.x = cur.x + center (WOBBLE_FACTOR * cur.width, cur.width);
- info->target_geometry.y = cur.y + center (WOBBLE_FACTOR * cur.height, cur.height);
- info->target_geometry.width = cur.width * WOBBLE_FACTOR;
- info->target_geometry.height = cur.height * WOBBLE_FACTOR;
- }
-
- set_geometry (info, elapsed);
-}
-
-static void
-run_phase_3 (MiniInfo *info, gdouble elapsed)
-{
- if (!info->phase_3_started)
- {
- WsRectangle cur = info->target_geometry;
- WsRectangle real;
-
- meta_comp_screen_get_real_size (info->scr_info, get_xid (info->window),
- &real);
-
- g_print ("starting phase 3\n");
- info->phase_3_started = TRUE;
-
- info->current_geometry = cur;
-
- info->target_geometry.height = info->button_height;
- info->target_geometry.width = info->button_height * info->aspect_ratio;
- info->target_geometry.x = info->button_x + center (info->target_geometry.width, info->button_width);
- info->target_geometry.y = real.y + center (info->button_height, real.height);
- }
-
- set_geometry (info, elapsed);
-}
-
-static void
-run_phase_4 (MiniInfo *info, gdouble elapsed)
-{
- if (!info->phase_4_started)
- {
- WsRectangle cur = info->target_geometry;
-
- g_print ("starting phase 4\n");
- info->phase_4_started = TRUE;
-
- info->current_geometry = cur;
-
- info->target_geometry.height = info->button_height;
- info->target_geometry.width = info->button_height * info->aspect_ratio;
- info->target_geometry.x = cur.x;
- g_print ("button y: %d\n", info->button_y);
- info->target_geometry.y = info->button_y;
- }
-
- set_geometry (info, elapsed);
-}
-
-static void
-run_phase_5 (MiniInfo *info, gdouble elapsed)
-{
- if (!info->phase_5_started)
- {
- WsRectangle cur = info->target_geometry;
-
- g_print ("starting phase 5\n");
- info->phase_5_started = TRUE;
-
- info->current_geometry = cur;
- info->target_geometry.x = info->button_x;
- info->target_geometry.y = info->button_y;
- info->target_geometry.width = info->button_width;
- info->target_geometry.height = info->button_height;
- }
-
- set_geometry (info, elapsed);
-
- meta_comp_screen_set_alpha (info->scr_info,
- get_xid (info->window), 1 - elapsed);
-}
-
-static gboolean
-run_animation_01 (gpointer data)
-{
- MiniInfo *info = data;
- gdouble elapsed;
-
- elapsed = g_timer_elapsed (info->timer, NULL);
-
-#define PHASE_0 0.0
-#define PHASE_1 0.225 /* scale to size of button */
-#define PHASE_2 0.325 /* scale up a little */
-#define PHASE_3 0.425 /* scale back a little */
-#define PHASE_4 0.650 /* move to button */
-#define PHASE_5 1.0 /* fade out */
-
- if (elapsed < PHASE_1)
- {
- /* phase one */
- run_phase_1 (info, (elapsed - PHASE_0)/(PHASE_1 - PHASE_0));
- }
- else if (elapsed < PHASE_2)
- {
- /* phase two */
- run_phase_2 (info, (elapsed - PHASE_1)/(PHASE_2 - PHASE_1));
- }
- else if (elapsed < PHASE_3)
- {
- /* phase three */
- run_phase_3 (info, (elapsed - PHASE_2)/(PHASE_3 - PHASE_2));
- }
- else if (elapsed < PHASE_4)
- {
- /* phase four */
- run_phase_4 (info, (elapsed - PHASE_3)/(PHASE_4 - PHASE_3));
- }
- else if (elapsed < PHASE_5)
- {
- /* phase five */
- run_phase_5 (info, (elapsed - PHASE_4)/(PHASE_5 - PHASE_4));
- }
- else
- {
- if (info->finished_func)
- info->finished_func (info->finished_data);
-
- return FALSE;
- }
-
- return TRUE;
-}
-
-#if 0
-void
-meta_compositor_minimize (MetaCompositor *compositor,
- MetaWindow *window,
- int x,
- int y,
- int width,
- int height,
- MetaAnimationFinishedFunc finished,
- gpointer data)
-{
- MiniInfo *info = g_new (MiniInfo, 1);
- WsRectangle start;
- MetaScreen *screen = window->screen;
-
- info->window = window;
- info->timer = g_timer_new ();
-
- info->finished_func = finished;
- info->finished_data = data;
-
- info->phase_1_started = FALSE;
- info->phase_2_started = FALSE;
- info->phase_3_started = FALSE;
- info->phase_4_started = FALSE;
- info->phase_5_started = FALSE;
-
- info->button_x = x;
- info->button_y = y;
- info->button_width = width;
- info->button_height = height;
-
- info->compositor = compositor;
- info->scr_info = screen->compositor_data;
-
-#if 0
- cm_drawable_node_set_deformation_func (node, minimize_deformation, info);
-#endif
-
- info->aspect_ratio = 1.3;
-
- g_idle_add (run_animation_01, info);
-}
-#endif
-
-#endif
-
void
meta_compositor_set_updates (MetaCompositor *compositor,
MetaWindow *window,
diff --git a/src/effects.c b/src/effects.c
index 6bd2055a..c43fc4ac 100644
--- a/src/effects.c
+++ b/src/effects.c
@@ -116,6 +116,16 @@ create_effect (MetaEffectType type,
}
void
+meta_effect_end (MetaEffect *effect)
+{
+ if (effect->priv->finished)
+ effect->priv->finished (effect, effect->priv->finished_data);
+
+ g_free (effect->priv);
+ g_free (effect);
+}
+
+void
meta_effect_run_minimize (MetaWindow *window,
MetaRectangle *window_rect,
MetaRectangle *icon_rect,
@@ -127,8 +137,7 @@ meta_effect_run_minimize (MetaWindow *window,
g_return_if_fail (window != NULL);
g_return_if_fail (icon_rect != NULL);
- effect = create_effect (META_EFFECT_MINIMIZE,
- finished, data);
+ effect = create_effect (META_EFFECT_MINIMIZE, finished, data);
effect->u.minimize.window = window;
effect->u.minimize.window_rect = *window_rect;
@@ -138,6 +147,27 @@ meta_effect_run_minimize (MetaWindow *window,
}
void
+meta_effect_run_restore (MetaWindow *window,
+ MetaRectangle *window_rect,
+ MetaRectangle *icon_rect,
+ MetaEffectFinished finished,
+ gpointer data)
+{
+ MetaEffect *effect;
+
+ g_return_if_fail (window != NULL);
+ g_return_if_fail (icon_rect != NULL);
+
+ effect = create_effect (META_EFFECT_RESTORE, finished, data);
+
+ effect->u.restore.window = window;
+ effect->u.restore.window_rect = *window_rect;
+ effect->u.restore.icon_rect = *icon_rect;
+
+ run_handler (effect);
+}
+
+void
meta_effect_run_close (MetaWindow *window,
MetaEffectFinished finished,
gpointer data)
@@ -154,15 +184,8 @@ meta_effect_run_close (MetaWindow *window,
run_handler (effect);
}
-void
-meta_effect_end (MetaEffect *effect)
-{
- if (effect->priv->finished)
- effect->priv->finished (effect, effect->priv->finished_data);
-
- g_free (effect->priv);
- g_free (effect);
-}
+
+/* old ugly minimization effect */
static void
update_wireframe_window (MetaDisplay *display,
diff --git a/src/effects.h b/src/effects.h
index 09774a77..3c4cff91 100644
--- a/src/effects.h
+++ b/src/effects.h
@@ -48,9 +48,12 @@ typedef enum
META_EFFECT_DIALOG_UNMAP,
META_EFFECT_TOPLEVEL_MAP,
META_EFFECT_TOPLEVEL_UNMAP,
- META_EFFECT_ALT_TAB,
+ META_EFFECT_WIREFRAME_BEGIN,
+ META_EFFECT_WIREFRAME_UPDATE,
+ META_EFFECT_WIREFRAME_END,
META_EFFECT_FOCUS,
META_EFFECT_CLOSE,
+ META_NUM_EFFECTS
} MetaEffectType;
typedef void (* MetaEffectHandler) (MetaEffect *effect,
@@ -63,7 +66,7 @@ typedef struct
MetaWindow *window;
MetaRectangle window_rect;
MetaRectangle icon_rect;
-} MetaMinimizeEffect;
+} MetaMinimizeEffect, MetaRestoreEffect; /* same data for both */
typedef struct
{
@@ -77,8 +80,9 @@ struct MetaEffect
union
{
- MetaMinimizeEffect minimize;
- MetaCloseEffect close;
+ MetaMinimizeEffect minimize;
+ MetaRestoreEffect restore;
+ MetaCloseEffect close;
} u;
MetaEffectPriv *priv;
diff --git a/src/window.c b/src/window.c
index bc922c5e..732ab2c2 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1821,6 +1821,7 @@ windows_overlap (const MetaWindow *w1, const MetaWindow *w2)
return meta_rectangle_overlap (&w1rect, &w2rect);
}
+/* XXX META_EFFECT_*_MAP */
void
meta_window_show (MetaWindow *window)
{
@@ -2030,6 +2031,7 @@ meta_window_show (MetaWindow *window)
}
}
+/* XXX META_EFFECT_*_UNMAP */
static void
meta_window_hide (MetaWindow *window)
{
@@ -3544,6 +3546,7 @@ meta_window_get_wireframe_geometry (MetaWindow *window,
*height /= window->display->grab_window->size_hints.height_inc;
}
+/* XXX META_EFFECT_ALT_TAB, well, this and others */
void
meta_window_begin_wireframe (MetaWindow *window)
{
@@ -3662,6 +3665,7 @@ get_modal_transient (MetaWindow *window)
return modal_transient;
}
+/* XXX META_EFFECT_FOCUS */
void
meta_window_focus (MetaWindow *window,
Time timestamp)