marco 1.29.1
Window manager
Loading...
Searching...
No Matches
effects.h File Reference
View source

"Special effects" other than compositor effects. More...

#include "util.h"
#include "screen-private.h"
Include dependency graph for effects.h:
This graph shows which files directly or indirectly include this file:

Typedefs

typedef void(* MetaEffectFinished) (gpointer data)
 A callback which will be called when the effect has finished.
 

Enumerations

enum  MetaEffectType {
  META_EFFECT_MINIMIZE , META_EFFECT_UNMINIMIZE , META_EFFECT_FOCUS , META_EFFECT_CLOSE ,
  META_NUM_EFFECTS
}
 

Functions

void meta_effect_run_minimize (MetaWindow *window, MetaRectangle *window_rect, MetaRectangle *target, 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.
 
void meta_effect_run_focus (MetaWindow *window, MetaEffectFinished finished, gpointer data)
 Performs the focus effect.
 
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.
 
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 width, int height)
 Removes a wireframe rectangle from the screen and ends the grab started by meta_effects_begin_wireframe().
 

Detailed Description

"Special effects" other than compositor effects.

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.

Typedef Documentation

◆ MetaEffectFinished

typedef void(* MetaEffectFinished) (gpointer data)

A callback which will be called when the effect has finished.

Enumeration Type Documentation

◆ MetaEffectType

Enumerator
META_EFFECT_MINIMIZE 
META_EFFECT_UNMINIMIZE 
META_EFFECT_FOCUS 
META_EFFECT_CLOSE 
META_NUM_EFFECTS 

Function Documentation

◆ meta_effect_run_close()

void meta_effect_run_close ( MetaWindow *  window,
MetaEffectFinished  finished,
gpointer  data 
)

Performs the close effect.

There is no such effect. FIXME: delete this.

Parameters
windowThe window we're moving
finishedCallback for when it's finished
dataData for callback

References create_effect(), META_EFFECT_CLOSE, NULL, and run_handler().

Referenced by event_callback().

Here is the call graph for this function:

◆ meta_effect_run_focus()

void meta_effect_run_focus ( MetaWindow *  window,
MetaEffectFinished  finished,
gpointer  data 
)

Performs the focus effect.

There is no such effect. FIXME: delete this.

Parameters
windowThe window we're moving
finishedCallback for when it's finished
dataData for callback

References create_effect(), META_EFFECT_FOCUS, NULL, and run_handler().

Referenced by meta_window_focus().

Here is the call graph for this function:

◆ meta_effect_run_minimize()

void meta_effect_run_minimize ( MetaWindow *  window,
MetaRectangle *  window_rect,
MetaRectangle *  target,
MetaEffectFinished  finished,
gpointer  data 
)

Performs the minimize effect.

Parameters
windowThe window we're moving
window_rectIts current state
targetWhere it should end up
finishedCallback for when it's finished
dataData for callback

References create_effect(), MetaMinimizeEffect::icon_rect, META_EFFECT_MINIMIZE, MetaEffect::minimize, NULL, run_handler(), MetaEffect::u, and MetaMinimizeEffect::window_rect.

Referenced by implement_showing().

Here is the call graph for this function:

◆ meta_effect_run_unminimize()

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.

Parameters
windowThe window we're moving
icon_rectIts current state
window_rectWhere it should end up
finishedCallback for when it's finished
dataData for callback

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().

Here is the call graph for this function:

◆ meta_effects_begin_wireframe()

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().

Parameters
screenThe screen to draw the rectangle on.
rectThe size of the rectangle to draw.
widthThe width to display in the middle (or 0 not to)
heightThe width to display in the middle (or 0 not to)

References meta_display_grab(), meta_effects_update_wireframe(), meta_ui_push_delay_exposes(), NULL, and screen.

Referenced by meta_window_begin_wireframe().

Here is the call graph for this function:

◆ meta_effects_end_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().

Parameters
old_rectWhere the rectangle is now
old_widthThe width that was displayed on it (or 0 if there wasn't)
old_heightThe height that was displayed on it (or 0 if there wasn't)

References meta_display_ungrab(), meta_effects_update_wireframe(), meta_ui_pop_delay_exposes(), NULL, and screen.

Referenced by meta_window_end_wireframe().

Here is the call graph for this function:

◆ meta_effects_update_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?)

Parameters
old_rectWhere the rectangle is now
old_widthThe width that was displayed on it (or 0 if there wasn't)
old_heightThe height that was displayed on it (or 0 if there wasn't)
new_rectWhere the rectangle is going
new_widthThe width that will be displayed on it (or 0 not to)
new_heightThe height that will be displayed on it (or 0 not to)

References draw_xor_rect(), and screen.

Referenced by meta_effects_begin_wireframe(), meta_effects_end_wireframe(), and meta_window_update_wireframe().

Here is the call graph for this function: