1 /*
2  * Copyright (C) 2008 Iain Holmes
3  * Copyright (C) 2017 Alberts Muktupāvels
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef META_COMPOSITOR_H
20 #define META_COMPOSITOR_H
21 
22 #include <glib-object.h>
23 #include <X11/Xlib.h>
24 
25 #include "types.h"
26 #include "boxes.h"
27 
28 G_BEGIN_DECLS
29 
30 #define META_TYPE_COMPOSITOR meta_compositor_get_type ()
31 G_DECLARE_DERIVABLE_TYPE (MetaCompositor, meta_compositor,
32                           META, COMPOSITOR, GObject)
33 
34 typedef enum
35 {
36   META_COMPOSITOR_TYPE_NONE,
37   META_COMPOSITOR_TYPE_XRENDER,
38   META_COMPOSITOR_TYPE_XPRESENT,
39   META_COMPOSITOR_TYPE_EXTERNAL, /*< skip >*/
40   META_COMPOSITOR_TYPE_VULKAN /*< skip >*/
41 } MetaCompositorType;
42 
43 typedef enum /*< skip >*/
44 {
45   META_EFFECT_TYPE_NONE,
46   META_EFFECT_TYPE_CREATE,
47   META_EFFECT_TYPE_DESTROY,
48   META_EFFECT_TYPE_MINIMIZE,
49   META_EFFECT_TYPE_UNMINIMIZE,
50 } MetaEffectType;
51 
52 void             meta_compositor_add_window                   (MetaCompositor     *compositor,
53                                                                MetaWindow         *window);
54 
55 void             meta_compositor_remove_window                (MetaCompositor     *compositor,
56                                                                MetaWindow         *window);
57 
58 void             meta_compositor_show_window                  (MetaCompositor     *compositor,
59                                                                MetaWindow         *window,
60                                                                MetaEffectType      effect);
61 
62 void             meta_compositor_hide_window                  (MetaCompositor     *compositor,
63                                                                MetaWindow         *window,
64                                                                MetaEffectType      effect);
65 
66 void             meta_compositor_window_opacity_changed       (MetaCompositor     *compositor,
67                                                                MetaWindow         *window);
68 
69 void             meta_compositor_window_opaque_region_changed (MetaCompositor     *compositor,
70                                                                MetaWindow         *window);
71 
72 void             meta_compositor_window_shape_region_changed  (MetaCompositor     *compositor,
73                                                                MetaWindow         *window);
74 
75 void             meta_compositor_set_updates_frozen           (MetaCompositor     *compositor,
76                                                                MetaWindow         *window,
77                                                                gboolean            updates_frozen);
78 
79 void             meta_compositor_process_event                (MetaCompositor     *compositor,
80                                                                XEvent             *event,
81                                                                MetaWindow         *window);
82 
83 cairo_surface_t *meta_compositor_get_window_surface           (MetaCompositor     *compositor,
84                                                                MetaWindow         *window);
85 
86 void             meta_compositor_maximize_window              (MetaCompositor     *compositor,
87                                                                MetaWindow         *window);
88 
89 void             meta_compositor_unmaximize_window            (MetaCompositor     *compositor,
90                                                                MetaWindow         *window);
91 
92 void             meta_compositor_sync_screen_size             (MetaCompositor     *compositor);
93 
94 void             meta_compositor_sync_stack                   (MetaCompositor     *compositor,
95                                                                GList              *stack);
96 
97 void             meta_compositor_sync_window_geometry         (MetaCompositor     *compositor,
98                                                                MetaWindow         *window);
99 
100 gboolean         meta_compositor_is_our_xwindow               (MetaCompositor     *compositor,
101                                                                Window              xwindow);
102 
103 gboolean         meta_compositor_is_composited                (MetaCompositor     *compositor);
104 
105 G_END_DECLS
106 
107 #endif
108