1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
4
* Copyright (C) 2008 Iain Holmes
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation; either version 2 of the
9
* License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22
#ifndef META_COMPOSITOR_H
23
#define META_COMPOSITOR_H
28
#include <meta/types.h>
29
#include <meta/boxes.h>
30
#include <meta/window.h>
31
#include <meta/workspace.h>
35
* @META_COMP_EFFECT_CREATE: The window is newly created
36
* (also used for a window that was previously on a different
37
* workspace and is changed to become visible on the active
39
* @META_COMP_EFFECT_UNMINIMIZE: The window should be shown
40
* as unminimizing from its icon geometry.
41
* @META_COMP_EFFECT_DESTROY: The window is being destroyed
42
* @META_COMP_EFFECT_MINIMIZE: The window should be shown
43
* as minimizing to its icon geometry.
44
* @META_COMP_EFFECT_NONE: No effect, the window should be
45
* shown or hidden immediately.
47
* Indicates the appropriate effect to show the user for
48
* meta_compositor_show_window() and meta_compositor_hide_window()
52
META_COMP_EFFECT_CREATE,
53
META_COMP_EFFECT_UNMINIMIZE,
54
META_COMP_EFFECT_DESTROY,
55
META_COMP_EFFECT_MINIMIZE,
59
MetaCompositor *meta_compositor_new (MetaDisplay *display);
60
void meta_compositor_destroy (MetaCompositor *compositor);
62
void meta_compositor_manage_screen (MetaCompositor *compositor,
64
void meta_compositor_unmanage_screen (MetaCompositor *compositor,
67
gboolean meta_compositor_process_event (MetaCompositor *compositor,
71
/* At a high-level, a window is not-visible or visible. When a
72
* window is added (with add_window()) it is not visible.
73
* show_window() indicates a transition from not-visible to
74
* visible. Some of the reasons for this:
76
* - Window newly created
77
* - Window is unminimized
78
* - Window is moved to the current desktop
79
* - Window was made sticky
81
* hide_window() indicates that the window has transitioned from
82
* visible to not-visible. Some reasons include:
84
* - Window was destroyed
85
* - Window is minimized
86
* - Window is moved to a different desktop
87
* - Window no longer sticky.
89
* Note that combinations are possible - a window might have first
90
* been minimized and then moved to a different desktop. The
91
* 'effect' parameter to show_window() and hide_window() is a hint
92
* as to the appropriate effect to show the user and should not
93
* be considered to be indicative of a state change.
95
* When the active workspace is changed, switch_workspace() is called
96
* first, then show_window() and hide_window() are called individually
97
* for each window affected, with an effect of META_COMP_EFFECT_NONE.
98
* If hiding windows will affect the switch workspace animation, the
99
* compositor needs to delay hiding the windows until the switch
100
* workspace animation completes.
102
* maximize_window() and unmaximize_window() are transitions within
103
* the visible state. The window is resized *before* the call, so
104
* it may be necessary to readjust the display based on the old_rect
105
* to start the animation.
107
* window_mapped() and window_unmapped() are notifications when the
108
* toplevel window (frame or client window) is mapped or unmapped.
109
* That is, when the result of meta_window_toplevel_is_mapped()
110
* changes. The main use of this is to drop resources when a window
111
* is unmapped. A window will always be mapped before show_window()
112
* is called and will not be unmapped until after hide_window() is
113
* called. If the live_hidden_windows preference is set, windows will
117
void meta_compositor_add_window (MetaCompositor *compositor,
119
void meta_compositor_remove_window (MetaCompositor *compositor,
122
void meta_compositor_show_window (MetaCompositor *compositor,
124
MetaCompEffect effect);
125
void meta_compositor_hide_window (MetaCompositor *compositor,
127
MetaCompEffect effect);
128
void meta_compositor_switch_workspace (MetaCompositor *compositor,
132
MetaMotionDirection direction);
134
void meta_compositor_maximize_window (MetaCompositor *compositor,
136
MetaRectangle *old_rect,
137
MetaRectangle *new_rect);
138
void meta_compositor_unmaximize_window (MetaCompositor *compositor,
140
MetaRectangle *old_rect,
141
MetaRectangle *new_rect);
143
void meta_compositor_window_mapped (MetaCompositor *compositor,
145
void meta_compositor_window_unmapped (MetaCompositor *compositor,
147
void meta_compositor_sync_window_geometry (MetaCompositor *compositor,
149
void meta_compositor_set_updates (MetaCompositor *compositor,
153
void meta_compositor_update_workspace_geometry (MetaCompositor *compositor,
154
MetaWorkspace *workspace);
155
void meta_compositor_sync_stack (MetaCompositor *compositor,
158
void meta_compositor_sync_screen_size (MetaCompositor *compositor,
163
void meta_compositor_flash_screen (MetaCompositor *compositor,
166
#endif /* META_COMPOSITOR_H */