1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 
3 /*
4  * Copyright (C) 2008 Iain Holmes
5  *
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.
10  *
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.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef META_COMPOSITOR_H
21 #define META_COMPOSITOR_H
22 
23 #include <glib.h>
24 
25 #include <meta/types.h>
26 #include <meta/boxes.h>
27 #include <meta/window.h>
28 #include <meta/workspace.h>
29 
30 #define META_TYPE_COMPOSITOR (meta_compositor_get_type ())
31 META_EXPORT
32 G_DECLARE_DERIVABLE_TYPE (MetaCompositor, meta_compositor,
33                           META, COMPOSITOR, GObject)
34 
35 /**
36  * MetaCompEffect:
37  * @META_COMP_EFFECT_CREATE: The window is newly created
38  *   (also used for a window that was previously on a different
39  *   workspace and is changed to become visible on the active
40  *   workspace.)
41  * @META_COMP_EFFECT_UNMINIMIZE: The window should be shown
42  *   as unminimizing from its icon geometry.
43  * @META_COMP_EFFECT_DESTROY: The window is being destroyed
44  * @META_COMP_EFFECT_MINIMIZE: The window should be shown
45  *   as minimizing to its icon geometry.
46  * @META_COMP_EFFECT_NONE: No effect, the window should be
47  *   shown or hidden immediately.
48  *
49  * Indicates the appropriate effect to show the user for
50  * meta_compositor_show_window() and meta_compositor_hide_window()
51  */
52 typedef enum
53 {
54   META_COMP_EFFECT_CREATE,
55   META_COMP_EFFECT_UNMINIMIZE,
56   META_COMP_EFFECT_DESTROY,
57   META_COMP_EFFECT_MINIMIZE,
58   META_COMP_EFFECT_NONE
59 } MetaCompEffect;
60 
61 typedef enum
62 {
63   META_SIZE_CHANGE_MAXIMIZE,
64   META_SIZE_CHANGE_UNMAXIMIZE,
65   META_SIZE_CHANGE_FULLSCREEN,
66   META_SIZE_CHANGE_UNFULLSCREEN,
67 } MetaSizeChange;
68 
69 META_EXPORT
70 void            meta_compositor_destroy (MetaCompositor *compositor);
71 
72 META_EXPORT
73 void meta_compositor_manage   (MetaCompositor *compositor);
74 
75 META_EXPORT
76 void meta_compositor_unmanage (MetaCompositor *compositor);
77 
78 META_EXPORT
79 void meta_compositor_window_shape_changed (MetaCompositor *compositor,
80                                            MetaWindow     *window);
81 
82 META_EXPORT
83 void meta_compositor_window_opacity_changed (MetaCompositor *compositor,
84                                              MetaWindow     *window);
85 
86 META_EXPORT
87 gboolean meta_compositor_filter_keybinding (MetaCompositor *compositor,
88                                             MetaKeyBinding *binding);
89 
90 META_EXPORT
91 void meta_compositor_add_window        (MetaCompositor      *compositor,
92                                         MetaWindow          *window);
93 
94 META_EXPORT
95 void meta_compositor_remove_window     (MetaCompositor      *compositor,
96                                         MetaWindow          *window);
97 
98 META_EXPORT
99 void meta_compositor_show_window       (MetaCompositor      *compositor,
100                                         MetaWindow          *window,
101                                         MetaCompEffect       effect);
102 
103 META_EXPORT
104 void meta_compositor_hide_window       (MetaCompositor      *compositor,
105                                         MetaWindow          *window,
106                                         MetaCompEffect       effect);
107 
108 META_EXPORT
109 void meta_compositor_switch_workspace  (MetaCompositor      *compositor,
110                                         MetaWorkspace       *from,
111                                         MetaWorkspace       *to,
112                                         MetaMotionDirection  direction);
113 
114 META_EXPORT
115 void meta_compositor_size_change_window (MetaCompositor      *compositor,
116                                          MetaWindow          *window,
117                                          MetaSizeChange       which_change,
118                                          MetaRectangle       *old_frame_rect,
119                                          MetaRectangle       *old_buffer_rect);
120 
121 META_EXPORT
122 void meta_compositor_sync_window_geometry (MetaCompositor *compositor,
123                                            MetaWindow     *window,
124                                            gboolean        did_placement);
125 
126 META_EXPORT
127 void meta_compositor_sync_updates_frozen  (MetaCompositor *compositor,
128                                            MetaWindow     *window);
129 
130 META_EXPORT
131 void meta_compositor_queue_frame_drawn    (MetaCompositor *compositor,
132                                            MetaWindow     *window,
133                                            gboolean        no_delay_frame);
134 
135 META_EXPORT
136 void meta_compositor_sync_stack                (MetaCompositor *compositor,
137                                                 GList          *stack);
138 
139 META_EXPORT
140 void meta_compositor_flash_display             (MetaCompositor *compositor,
141                                                 MetaDisplay    *display);
142 
143 META_EXPORT
144 void meta_compositor_show_tile_preview (MetaCompositor *compositor,
145                                         MetaWindow     *window,
146                                         MetaRectangle  *tile_rect,
147                                         int             tile_monitor_number);
148 
149 META_EXPORT
150 void meta_compositor_hide_tile_preview (MetaCompositor *compositor);
151 
152 META_EXPORT
153 void meta_compositor_show_window_menu (MetaCompositor     *compositor,
154                                        MetaWindow         *window,
155 				       MetaWindowMenuType  menu,
156                                        int                 x,
157                                        int                 y);
158 
159 META_EXPORT
160 void meta_compositor_show_window_menu_for_rect (MetaCompositor     *compositor,
161                                                 MetaWindow         *window,
162 				                MetaWindowMenuType  menu,
163                                                 MetaRectangle      *rect);
164 
165 #endif /* META_COMPOSITOR_H */
166