Go to the source code of this file.
Data Structures | |
| struct | BoxAnimationContext |
| struct | MetaMinimizeEffect |
| Information we need to know during a maximise or minimise effect. More... | |
| struct | MetaEffectPriv |
| struct | MetaEffect |
Defines | |
| #define | META_MINIMIZE_ANIMATION_LENGTH 0.25 |
| #define | META_SHADE_ANIMATION_LENGTH 0.2 |
| #define | OUTLINE_WIDTH 3 |
| #define | LINE_WIDTH META_WIREFRAME_XOR_LINE_WIDTH |
Typedefs | |
| typedef struct MetaEffect | MetaEffect |
| typedef struct MetaEffectPriv | MetaEffectPriv |
| typedef struct MetaMinimizeEffect | MetaUnminimizeEffect |
Functions | |
| static void | run_default_effect_handler (MetaEffect *effect) |
| static void | run_handler (MetaEffect *effect) |
| static void | effect_free (MetaEffect *effect) |
| Destroys an effect. | |
| static MetaEffect * | create_effect (MetaEffectType type, MetaWindow *window, MetaEffectFinished finished, gpointer finished_data) |
| Creates an effect. | |
| static void | draw_box_animation (MetaScreen *screen, MetaRectangle *initial_rect, MetaRectangle *destination_rect, double seconds_duration) |
| void | meta_effect_run_focus (MetaWindow *window, MetaEffectFinished finished, gpointer data) |
| Performs the focus effect. | |
| void | meta_effect_run_minimize (MetaWindow *window, MetaRectangle *window_rect, MetaRectangle *icon_rect, MetaEffectFinished finished, gpointer data) |
| Performs the minimize effect. | |
| void | meta_effect_run_unminimize (MetaWindow *window, MetaRectangle *window_rect, MetaRectangle *icon_rect, MetaEffectFinished finished, gpointer data) |
| Performs the unminimize effect. | |
| void | meta_effect_run_close (MetaWindow *window, MetaEffectFinished finished, gpointer data) |
| Performs the close effect. | |
| static void | update_wireframe_window (MetaDisplay *display, Window xwindow, const MetaRectangle *rect) |
| static void | graphics_sync (BoxAnimationContext *context) |
| A hack to force the X server to synchronize with the graphics hardware. | |
| static gboolean | effects_draw_box_animation_timeout (BoxAnimationContext *context) |
| void | meta_effects_begin_wireframe (MetaScreen *screen, const MetaRectangle *rect, int width, int height) |
| Grabs the server and paints a wireframe rectangle on the screen. | |
| static void | draw_xor_rect (MetaScreen *screen, const MetaRectangle *rect, int width, int height) |
| void | meta_effects_update_wireframe (MetaScreen *screen, const MetaRectangle *old_rect, int old_width, int old_height, const MetaRectangle *new_rect, int new_width, int new_height) |
| Moves a wireframe rectangle around after its creation by meta_effects_begin_wireframe(). | |
| void | meta_effects_end_wireframe (MetaScreen *screen, const MetaRectangle *old_rect, int old_width, int old_height) |
| Removes a wireframe rectangle from the screen and ends the grab started by meta_effects_begin_wireframe(). | |
Before we had a serious compositor, we supported swooping rectangles for minimising and so on. These are still supported today, even when the compositor is enabled. The file contains two parts:
1) A set of functions, each of which implements a special effect. (Only the minimize function does anything interesting; we should probably get rid of the rest.)
2) A set of functions for moving a highlighted wireframe box around the screen, optionally with height and width shown in the middle. This is used for moving and resizing when reduced_resources is set.
There was formerly a system which allowed callers to drop in their own handlers for various things; it was never used (people who want their own handlers can just modify this file, after all) and it added a good deal of extra complexity, so it has been removed. If you want it, it can be found in svn r3769.
Once upon a time there were three different ways of drawing the box animation: window wireframe, window opaque, and root. People who had the shape extension theoretically had the choice of all three, and people who didn't weren't given the choice of the wireframe option. In practice, though, the opaque animation was never perfect, so it came down to the wireframe option for those who had the extension and the root option for those who didn't; there was actually no way of choosing any other option anyway. Work on the opaque animation stopped in 2002; anyone who wants something like that these days will be using the compositor anyway.
In svn r3769 this was made explicit.
Definition in file effects.c.
| #define LINE_WIDTH META_WIREFRAME_XOR_LINE_WIDTH |
Referenced by draw_xor_rect().
| #define META_MINIMIZE_ANIMATION_LENGTH 0.25 |
| #define OUTLINE_WIDTH 3 |
Referenced by meta_screen_ensure_tab_popup(), and update_wireframe_window().
| typedef struct MetaEffect MetaEffect |
| typedef struct MetaEffectPriv MetaEffectPriv |
| typedef struct MetaMinimizeEffect MetaUnminimizeEffect |
| static MetaEffect * create_effect | ( | MetaEffectType | type, | |
| MetaWindow * | window, | |||
| MetaEffectFinished | finished, | |||
| gpointer | finished_data | |||
| ) | [static] |
Creates an effect.
Definition at line 159 of file effects.c.
References MetaEffectPriv::finished, MetaEffectPriv::finished_data, MetaEffect::priv, MetaEffect::type, and MetaEffect::window.
Referenced by meta_effect_run_close(), meta_effect_run_focus(), meta_effect_run_minimize(), and meta_effect_run_unminimize().
| void draw_box_animation | ( | MetaScreen * | screen, | |
| MetaRectangle * | initial_rect, | |||
| MetaRectangle * | destination_rect, | |||
| double | seconds_duration | |||
| ) | [static] |
Definition at line 430 of file effects.c.
References _MetaScreen::display, effects_draw_box_animation_timeout(), BoxAnimationContext::end_rect, _MetaRectangle::height, meta_display_grab(), meta_ui_push_delay_exposes(), BoxAnimationContext::millisecs_duration, _MetaScreen::number, BoxAnimationContext::screen, BoxAnimationContext::start_rect, BoxAnimationContext::start_time, TRUE, _MetaScreen::ui, update_wireframe_window(), _MetaRectangle::width, BoxAnimationContext::wireframe_xwindow, _MetaRectangle::x, _MetaDisplay::xdisplay, _MetaScreen::xroot, and _MetaRectangle::y.
Referenced by run_default_effect_handler().
| static void draw_xor_rect | ( | MetaScreen * | screen, | |
| const MetaRectangle * | rect, | |||
| int | width, | |||
| int | height | |||
| ) | [static] |
Definition at line 532 of file effects.c.
References _MetaScreen::display, _MetaRectangle::height, LINE_WIDTH, NULL, _MetaScreen::root_xor_gc, _MetaRectangle::width, _MetaRectangle::x, _MetaDisplay::xdisplay, _MetaScreen::xroot, and _MetaRectangle::y.
Referenced by meta_effects_update_wireframe().
| static void effect_free | ( | MetaEffect * | effect | ) | [static] |
Destroys an effect.
If the effect has a "finished" hook, it will be called before cleanup.
| effect | The effect. |
Definition at line 182 of file effects.c.
References MetaEffectPriv::finished, MetaEffectPriv::finished_data, and MetaEffect::priv.
Referenced by run_handler().
| static gboolean effects_draw_box_animation_timeout | ( | BoxAnimationContext * | context | ) | [static] |
Definition at line 335 of file effects.c.
References _MetaScreen::display, BoxAnimationContext::end_rect, FALSE, graphics_sync(), _MetaRectangle::height, meta_display_ungrab(), meta_ui_pop_delay_exposes(), meta_warning(), BoxAnimationContext::millisecs_duration, BoxAnimationContext::screen, BoxAnimationContext::start_rect, BoxAnimationContext::start_time, TRUE, _MetaScreen::ui, update_wireframe_window(), _MetaRectangle::width, BoxAnimationContext::wireframe_xwindow, _MetaRectangle::x, _MetaDisplay::xdisplay, _MetaScreen::xroot, and _MetaRectangle::y.
Referenced by draw_box_animation().
| static void graphics_sync | ( | BoxAnimationContext * | context | ) | [static] |
A hack to force the X server to synchronize with the graphics hardware.
Definition at line 322 of file effects.c.
References _MetaScreen::display, BoxAnimationContext::screen, _MetaDisplay::xdisplay, and _MetaScreen::xroot.
Referenced by effects_draw_box_animation_timeout().
| void meta_effect_run_close | ( | MetaWindow * | window, | |
| MetaEffectFinished | finished, | |||
| gpointer | data | |||
| ) |
Performs the close effect.
There is no such effect. FIXME: delete this.
| window | The window we're moving | |
| finished | Callback for when it's finished | |
| data | Data for callback |
Definition at line 246 of file effects.c.
References create_effect(), META_EFFECT_CLOSE, NULL, and run_handler().
Referenced by event_callback().
| void meta_effect_run_focus | ( | MetaWindow * | window, | |
| MetaEffectFinished | finished, | |||
| gpointer | data | |||
| ) |
Performs the focus effect.
There is no such effect. FIXME: delete this.
| window | The window we're moving | |
| finished | Callback for when it's finished | |
| data | Data for callback |
Definition at line 192 of file effects.c.
References create_effect(), META_EFFECT_FOCUS, NULL, and run_handler().
Referenced by meta_window_focus().
| void meta_effect_run_minimize | ( | MetaWindow * | window, | |
| MetaRectangle * | window_rect, | |||
| MetaRectangle * | target, | |||
| MetaEffectFinished | finished, | |||
| gpointer | data | |||
| ) |
Performs the minimize effect.
| window | The window we're moving | |
| window_rect | Its current state | |
| target | Where it should end up | |
| finished | Callback for when it's finished | |
| data | Data for callback |
Definition at line 206 of file effects.c.
References create_effect(), MetaMinimizeEffect::icon_rect, META_EFFECT_MINIMIZE, MetaEffect::minimize, NULL, run_handler(), MetaEffect::u, and MetaMinimizeEffect::window_rect.
Referenced by implement_showing().
| void meta_effect_run_unminimize | ( | MetaWindow * | window, | |
| MetaRectangle * | window_rect, | |||
| MetaRectangle * | icon_rect, | |||
| MetaEffectFinished | finished, | |||
| gpointer | data | |||
| ) |
Performs the unminimize effect.
There is no such effect. FIXME: delete this.
| window | The window we're moving | |
| icon_rect | Its current state | |
| window_rect | Where it should end up | |
| finished | Callback for when it's finished | |
| data | Data for callback |
Definition at line 226 of file effects.c.
References create_effect(), MetaMinimizeEffect::icon_rect, META_EFFECT_UNMINIMIZE, MetaEffect::minimize, NULL, run_handler(), MetaEffect::u, and MetaMinimizeEffect::window_rect.
Referenced by meta_window_show().
| void meta_effects_begin_wireframe | ( | MetaScreen * | screen, | |
| const MetaRectangle * | rect, | |||
| int | width, | |||
| int | height | |||
| ) |
Grabs the server and paints a wireframe rectangle on the screen.
Since this involves starting a grab, please be considerate of other users and don't keep the grab for long. You may move the wireframe around using meta_effects_update_wireframe() and remove it, and undo the grab, using meta_effects_end_wireframe().
| screen | The screen to draw the rectangle on. | |
| rect | The size of the rectangle to draw. | |
| width | The width to display in the middle (or 0 not to) | |
| height | The width to display in the middle (or 0 not to) |
Definition at line 517 of file effects.c.
References _MetaScreen::display, meta_display_grab(), meta_effects_update_wireframe(), meta_ui_push_delay_exposes(), NULL, and _MetaScreen::ui.
Referenced by meta_window_begin_wireframe().
| void meta_effects_end_wireframe | ( | MetaScreen * | screen, | |
| const MetaRectangle * | old_rect, | |||
| int | width, | |||
| int | height | |||
| ) |
Removes a wireframe rectangle from the screen and ends the grab started by meta_effects_begin_wireframe().
| old_rect | Where the rectangle is now | |
| old_width | The width that was displayed on it (or 0 if there wasn't) | |
| old_height | The height that was displayed on it (or 0 if there wasn't) |
Definition at line 698 of file effects.c.
References _MetaScreen::display, meta_display_ungrab(), meta_effects_update_wireframe(), meta_ui_pop_delay_exposes(), NULL, and _MetaScreen::ui.
Referenced by meta_window_end_wireframe().
| void meta_effects_update_wireframe | ( | MetaScreen * | screen, | |
| const MetaRectangle * | old_rect, | |||
| int | old_width, | |||
| int | old_height, | |||
| const MetaRectangle * | new_rect, | |||
| int | new_width, | |||
| int | new_height | |||
| ) |
Moves a wireframe rectangle around after its creation by meta_effects_begin_wireframe().
(Perhaps we ought to remember the old positions and not require people to pass them in?)
| old_rect | Where the rectangle is now | |
| old_width | The width that was displayed on it (or 0 if there wasn't) | |
| old_height | The height that was displayed on it (or 0 if there wasn't) | |
| new_rect | Where the rectangle is going | |
| new_width | The width that will be displayed on it (or 0 not to) | |
| new_height | The height that will be displayed on it (or 0 not to) |
Definition at line 680 of file effects.c.
References _MetaScreen::display, draw_xor_rect(), and _MetaDisplay::xdisplay.
Referenced by meta_effects_begin_wireframe(), meta_effects_end_wireframe(), and meta_window_update_wireframe().
| static void run_default_effect_handler | ( | MetaEffect * | effect | ) | [static] |
Definition at line 712 of file effects.c.
References draw_box_animation(), MetaMinimizeEffect::icon_rect, META_EFFECT_MINIMIZE, META_MINIMIZE_ANIMATION_LENGTH, MetaEffect::minimize, _MetaWindow::screen, MetaEffect::type, MetaEffect::u, MetaEffect::window, and MetaMinimizeEffect::window_rect.
Referenced by run_handler().
| static void run_handler | ( | MetaEffect * | effect | ) | [static] |
Definition at line 729 of file effects.c.
References effect_free(), meta_prefs_get_gnome_animations(), and run_default_effect_handler().
Referenced by meta_effect_run_close(), meta_effect_run_focus(), meta_effect_run_minimize(), and meta_effect_run_unminimize().
| static void update_wireframe_window | ( | MetaDisplay * | display, | |
| Window | xwindow, | |||
| const MetaRectangle * | rect | |||
| ) | [static] |
Definition at line 265 of file effects.c.
References _MetaRectangle::height, OUTLINE_WIDTH, _MetaRectangle::width, _MetaRectangle::x, _MetaDisplay::xdisplay, and _MetaRectangle::y.
Referenced by draw_box_animation(), and effects_draw_box_animation_timeout().
1.5.5