Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2008 Kristian Høgsberg |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software Foundation, |
| 16 | * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | |
| 19 | #ifndef _WAYLAND_SYSTEM_COMPOSITOR_H_ |
| 20 | #define _WAYLAND_SYSTEM_COMPOSITOR_H_ |
| 21 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 22 | #include <libudev.h> |
Kristian Høgsberg | 31bd6c7 | 2011-02-13 13:00:51 -0500 | [diff] [blame] | 23 | #include <pixman.h> |
Kristian Høgsberg | a661f26 | 2010-08-10 14:12:05 -0400 | [diff] [blame] | 24 | #include "wayland-server.h" |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 25 | #include "wayland-util.h" |
| 26 | |
Kristian Høgsberg | 5fcd0aa | 2010-08-09 14:43:33 -0400 | [diff] [blame] | 27 | #include <GLES2/gl2.h> |
| 28 | #include <GLES2/gl2ext.h> |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 29 | #include <EGL/egl.h> |
| 30 | #include <EGL/eglext.h> |
| 31 | |
| 32 | #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) |
| 33 | |
Benjamin Franzke | e5b3b26 | 2011-04-26 09:21:13 +0200 | [diff] [blame] | 34 | #define FD_TO_EGL_NATIVE_DPY(fd) ((EGLNativeDisplayType)(intptr_t)(fd)) |
| 35 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 36 | struct wlsc_matrix { |
| 37 | GLfloat d[16]; |
| 38 | }; |
| 39 | |
Kristian Høgsberg | d880e14 | 2011-05-02 13:53:45 -0400 | [diff] [blame] | 40 | void |
| 41 | wlsc_matrix_init(struct wlsc_matrix *matrix); |
| 42 | void |
| 43 | wlsc_matrix_scale(struct wlsc_matrix *matrix, GLfloat x, GLfloat y, GLfloat z); |
| 44 | void |
| 45 | wlsc_matrix_translate(struct wlsc_matrix *matrix, |
| 46 | GLfloat x, GLfloat y, GLfloat z); |
| 47 | |
Kristian Høgsberg | 0bc0e24 | 2011-05-02 14:35:40 -0400 | [diff] [blame] | 48 | struct wlsc_transform { |
| 49 | struct wlsc_matrix matrix; |
| 50 | struct wlsc_matrix inverse; |
| 51 | }; |
| 52 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 53 | struct wlsc_surface; |
| 54 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 55 | struct wlsc_output { |
Kristian Høgsberg | b313b02 | 2010-12-01 17:07:41 -0500 | [diff] [blame] | 56 | struct wl_object object; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 57 | struct wl_list link; |
| 58 | struct wlsc_compositor *compositor; |
| 59 | struct wlsc_surface *background; |
| 60 | struct wlsc_matrix matrix; |
| 61 | int32_t x, y, width, height; |
Kristian Høgsberg | 31bd6c7 | 2011-02-13 13:00:51 -0500 | [diff] [blame] | 62 | pixman_region32_t previous_damage_region; |
Benjamin Franzke | 9c26ff3 | 2011-03-15 15:08:41 +0100 | [diff] [blame] | 63 | uint32_t flags; |
Benjamin Franzke | ec4d342 | 2011-03-14 12:07:26 +0100 | [diff] [blame] | 64 | int repaint_needed; |
| 65 | int finished; |
Benjamin Franzke | eefc36c | 2011-03-11 16:39:20 +0100 | [diff] [blame] | 66 | |
| 67 | int (*prepare_render)(struct wlsc_output *output); |
Benjamin Franzke | ec4d342 | 2011-03-14 12:07:26 +0100 | [diff] [blame] | 68 | int (*present)(struct wlsc_output *output); |
Benjamin Franzke | 66aa235 | 2011-04-20 17:06:13 +0200 | [diff] [blame] | 69 | int (*prepare_scanout_surface)(struct wlsc_output *output, |
| 70 | struct wlsc_surface *es); |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 71 | int (*set_hardware_cursor)(struct wlsc_output *output, |
| 72 | struct wl_input_device *input); |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 73 | }; |
| 74 | |
Kristian Høgsberg | 1db21f1 | 2010-08-16 16:08:12 -0400 | [diff] [blame] | 75 | enum wlsc_pointer_type { |
| 76 | WLSC_POINTER_BOTTOM_LEFT, |
| 77 | WLSC_POINTER_BOTTOM_RIGHT, |
| 78 | WLSC_POINTER_BOTTOM, |
| 79 | WLSC_POINTER_DRAGGING, |
| 80 | WLSC_POINTER_LEFT_PTR, |
| 81 | WLSC_POINTER_LEFT, |
| 82 | WLSC_POINTER_RIGHT, |
| 83 | WLSC_POINTER_TOP_LEFT, |
| 84 | WLSC_POINTER_TOP_RIGHT, |
| 85 | WLSC_POINTER_TOP, |
| 86 | WLSC_POINTER_IBEAM, |
| 87 | }; |
| 88 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 89 | struct wlsc_input_device { |
Kristian Høgsberg | b313b02 | 2010-12-01 17:07:41 -0500 | [diff] [blame] | 90 | struct wl_input_device input_device; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 91 | struct wlsc_surface *sprite; |
Kristian Høgsberg | 77fb167 | 2010-08-16 10:38:29 -0400 | [diff] [blame] | 92 | int32_t hotspot_x, hotspot_y; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 93 | struct wl_list link; |
Kristian Høgsberg | 5b75f1b | 2010-08-04 23:21:41 -0400 | [diff] [blame] | 94 | uint32_t modifier_state; |
Kristian Høgsberg | ae6c8a6 | 2011-01-18 09:08:53 -0500 | [diff] [blame] | 95 | struct wl_selection *selection; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 96 | }; |
| 97 | |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 98 | struct wlsc_sprite { |
| 99 | GLuint texture; |
| 100 | EGLImageKHR image; |
| 101 | struct wl_visual *visual; |
| 102 | int width; |
| 103 | int height; |
| 104 | }; |
| 105 | |
Kristian Høgsberg | 7ffc448 | 2011-04-22 14:23:51 -0400 | [diff] [blame] | 106 | struct wlsc_shader { |
| 107 | GLuint program; |
| 108 | GLuint vertex_shader, fragment_shader; |
| 109 | GLuint proj_uniform; |
| 110 | GLuint tex_uniform; |
| 111 | GLuint color_uniform; |
| 112 | }; |
| 113 | |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 114 | struct wlsc_animation { |
| 115 | void (*frame)(struct wlsc_animation *animation, |
| 116 | struct wlsc_output *output, uint32_t msecs); |
| 117 | struct wl_list link; |
| 118 | }; |
| 119 | |
Kristian Høgsberg | 269c782 | 2011-05-02 14:38:18 -0400 | [diff] [blame^] | 120 | struct wlsc_spring { |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 121 | double k; |
Kristian Høgsberg | 4a9be13 | 2011-05-02 13:38:03 -0400 | [diff] [blame] | 122 | double friction; |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 123 | double current; |
| 124 | double target; |
| 125 | double previous; |
| 126 | uint32_t timestamp; |
| 127 | }; |
| 128 | |
Kristian Høgsberg | 02ec0a5 | 2011-04-23 13:04:11 -0400 | [diff] [blame] | 129 | struct wlsc_shell { |
| 130 | void (*lock)(struct wlsc_shell *shell); |
| 131 | void (*attach)(struct wlsc_shell *shell, struct wlsc_surface *surface); |
| 132 | }; |
| 133 | |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 134 | enum { |
| 135 | WLSC_COMPOSITOR_ACTIVE, |
| 136 | WLSC_COMPOSITOR_SLEEPING |
| 137 | }; |
| 138 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 139 | struct wlsc_compositor { |
Kristian Høgsberg | b313b02 | 2010-12-01 17:07:41 -0500 | [diff] [blame] | 140 | struct wl_compositor compositor; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 141 | |
Benjamin Franzke | 315b3dc | 2011-03-08 11:32:57 +0100 | [diff] [blame] | 142 | struct wl_shm *shm; |
| 143 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 144 | EGLDisplay display; |
| 145 | EGLContext context; |
Benjamin Franzke | be01456 | 2011-02-18 17:04:24 +0100 | [diff] [blame] | 146 | EGLConfig config; |
Kristian Høgsberg | fa4e2a7 | 2011-02-13 13:44:55 -0500 | [diff] [blame] | 147 | GLuint fbo; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 148 | GLuint proj_uniform, tex_uniform; |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 149 | struct wlsc_sprite **pointer_sprites; |
Kristian Høgsberg | 7ffc448 | 2011-04-22 14:23:51 -0400 | [diff] [blame] | 150 | struct wlsc_shader texture_shader; |
| 151 | struct wlsc_shader solid_shader; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 152 | struct wl_display *wl_display; |
| 153 | |
Kristian Høgsberg | 02ec0a5 | 2011-04-23 13:04:11 -0400 | [diff] [blame] | 154 | struct wlsc_shell *shell; |
Kristian Høgsberg | 83fc061 | 2010-08-04 22:44:55 -0400 | [diff] [blame] | 155 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 156 | /* There can be more than one, but not right now... */ |
Kristian Høgsberg | 9c3e8d7 | 2010-12-08 09:48:52 -0500 | [diff] [blame] | 157 | struct wl_input_device *input_device; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 158 | |
| 159 | struct wl_list output_list; |
| 160 | struct wl_list input_device_list; |
| 161 | struct wl_list surface_list; |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 162 | struct wl_list binding_list; |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 163 | struct wl_list animation_list; |
| 164 | struct { |
Kristian Høgsberg | 269c782 | 2011-05-02 14:38:18 -0400 | [diff] [blame^] | 165 | struct wlsc_spring spring; |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 166 | struct wlsc_animation animation; |
| 167 | } fade; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 168 | |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 169 | uint32_t state; |
| 170 | struct wl_event_source *idle_source; |
| 171 | uint32_t idle_inhibit; |
| 172 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 173 | /* Repaint state. */ |
| 174 | struct wl_event_source *timer_source; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 175 | int repaint_on_timeout; |
| 176 | struct timespec previous_swap; |
Kristian Høgsberg | 31bd6c7 | 2011-02-13 13:00:51 -0500 | [diff] [blame] | 177 | pixman_region32_t damage_region; |
Kristian Høgsberg | 525e4c0 | 2011-02-14 10:39:54 -0500 | [diff] [blame] | 178 | struct wl_array vertices, indices; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 179 | |
Kristian Høgsberg | 547cadf | 2011-04-12 22:23:30 -0400 | [diff] [blame] | 180 | struct wlsc_surface *overlay; |
Kristian Høgsberg | c9824dd | 2011-02-06 16:54:59 -0500 | [diff] [blame] | 181 | struct wlsc_switcher *switcher; |
Kristian Høgsberg | 86e0989 | 2010-07-07 09:51:11 -0400 | [diff] [blame] | 182 | uint32_t focus; |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 183 | |
Kristian Høgsberg | b5819dc | 2011-04-25 15:08:20 -0400 | [diff] [blame] | 184 | PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC |
| 185 | image_target_renderbuffer_storage; |
| 186 | PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d; |
| 187 | PFNEGLCREATEIMAGEKHRPROC create_image; |
| 188 | PFNEGLDESTROYIMAGEKHRPROC destroy_image; |
| 189 | PFNEGLBINDWAYLANDDISPLAYWL bind_display; |
| 190 | PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display; |
| 191 | int has_bind_display; |
| 192 | |
Kristian Høgsberg | caa6442 | 2010-12-01 16:52:15 -0500 | [diff] [blame] | 193 | void (*destroy)(struct wlsc_compositor *ec); |
Kristian Høgsberg | 640609a | 2010-08-09 22:11:47 -0400 | [diff] [blame] | 194 | int (*authenticate)(struct wlsc_compositor *c, uint32_t id); |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 195 | EGLImageKHR (*create_cursor_image)(struct wlsc_compositor *c, |
| 196 | int32_t width, int32_t height); |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 197 | }; |
| 198 | |
| 199 | #define MODIFIER_CTRL (1 << 8) |
| 200 | #define MODIFIER_ALT (1 << 9) |
Kristian Høgsberg | 5b75f1b | 2010-08-04 23:21:41 -0400 | [diff] [blame] | 201 | #define MODIFIER_SUPER (1 << 10) |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 202 | |
Benjamin Franzke | 1b765ff | 2011-02-18 16:51:37 +0100 | [diff] [blame] | 203 | enum wlsc_output_flags { |
| 204 | WL_OUTPUT_FLIPPED = 0x01 |
| 205 | }; |
| 206 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 207 | struct wlsc_vector { |
| 208 | GLfloat f[4]; |
| 209 | }; |
| 210 | |
Kristian Høgsberg | 0ce2457 | 2011-01-28 15:18:33 -0500 | [diff] [blame] | 211 | enum wlsc_surface_map_type { |
| 212 | WLSC_SURFACE_MAP_UNMAPPED, |
| 213 | WLSC_SURFACE_MAP_TOPLEVEL, |
| 214 | WLSC_SURFACE_MAP_TRANSIENT, |
| 215 | WLSC_SURFACE_MAP_FULLSCREEN |
| 216 | }; |
| 217 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 218 | struct wlsc_surface { |
Kristian Høgsberg | b313b02 | 2010-12-01 17:07:41 -0500 | [diff] [blame] | 219 | struct wl_surface surface; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 220 | struct wlsc_compositor *compositor; |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 221 | GLuint texture, saved_texture; |
Kristian Høgsberg | 83fc061 | 2010-08-04 22:44:55 -0400 | [diff] [blame] | 222 | int32_t x, y, width, height; |
Benjamin Franzke | fab5ec1 | 2011-04-25 19:44:47 +0200 | [diff] [blame] | 223 | int32_t pitch; |
Kristian Høgsberg | 0ce2457 | 2011-01-28 15:18:33 -0500 | [diff] [blame] | 224 | int32_t saved_x, saved_y; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 225 | struct wl_list link; |
Benjamin Franzke | bab41fb | 2011-03-07 18:04:59 +0100 | [diff] [blame] | 226 | struct wl_list buffer_link; |
Kristian Høgsberg | 0bc0e24 | 2011-05-02 14:35:40 -0400 | [diff] [blame] | 227 | struct wlsc_transform *transform; |
Kristian Høgsberg | 5fcd0aa | 2010-08-09 14:43:33 -0400 | [diff] [blame] | 228 | struct wl_visual *visual; |
Benjamin Franzke | ec4d342 | 2011-03-14 12:07:26 +0100 | [diff] [blame] | 229 | struct wlsc_output *output; |
Kristian Høgsberg | 0ce2457 | 2011-01-28 15:18:33 -0500 | [diff] [blame] | 230 | enum wlsc_surface_map_type map_type; |
| 231 | struct wlsc_output *fullscreen_output; |
Benjamin Franzke | 1178a3c | 2011-04-10 16:49:52 +0200 | [diff] [blame] | 232 | |
| 233 | EGLImageKHR image; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 234 | }; |
| 235 | |
Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 236 | void |
Kristian Høgsberg | 269c782 | 2011-05-02 14:38:18 -0400 | [diff] [blame^] | 237 | wlsc_spring_init(struct wlsc_spring *spring, |
| 238 | double k, double current, double target); |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 239 | void |
Kristian Høgsberg | 269c782 | 2011-05-02 14:38:18 -0400 | [diff] [blame^] | 240 | wlsc_spring_update(struct wlsc_spring *spring, uint32_t msec); |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 241 | int |
Kristian Høgsberg | 269c782 | 2011-05-02 14:38:18 -0400 | [diff] [blame^] | 242 | wlsc_spring_done(struct wlsc_spring *spring); |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 243 | |
| 244 | void |
Kristian Høgsberg | 30021d7 | 2011-04-12 17:42:30 -0400 | [diff] [blame] | 245 | wlsc_surface_activate(struct wlsc_surface *surface, |
| 246 | struct wlsc_input_device *device, uint32_t time); |
| 247 | |
| 248 | void |
Kristian Høgsberg | 9c3e8d7 | 2010-12-08 09:48:52 -0500 | [diff] [blame] | 249 | notify_motion(struct wl_input_device *device, |
Kristian Høgsberg | 808fd41 | 2010-07-20 17:06:19 -0400 | [diff] [blame] | 250 | uint32_t time, int x, int y); |
Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 251 | void |
Kristian Høgsberg | 9c3e8d7 | 2010-12-08 09:48:52 -0500 | [diff] [blame] | 252 | notify_button(struct wl_input_device *device, |
Kristian Høgsberg | 808fd41 | 2010-07-20 17:06:19 -0400 | [diff] [blame] | 253 | uint32_t time, int32_t button, int32_t state); |
Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 254 | void |
Kristian Høgsberg | 9c3e8d7 | 2010-12-08 09:48:52 -0500 | [diff] [blame] | 255 | notify_key(struct wl_input_device *device, |
Kristian Høgsberg | 808fd41 | 2010-07-20 17:06:19 -0400 | [diff] [blame] | 256 | uint32_t time, uint32_t key, uint32_t state); |
Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 257 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 258 | void |
Kristian Høgsberg | 93331ff | 2011-01-26 20:35:07 -0500 | [diff] [blame] | 259 | notify_pointer_focus(struct wl_input_device *device, |
| 260 | uint32_t time, |
| 261 | struct wlsc_output *output, |
| 262 | int32_t x, int32_t y); |
| 263 | |
| 264 | void |
Kristian Høgsberg | 3ba4858 | 2011-01-27 11:57:19 -0500 | [diff] [blame] | 265 | notify_keyboard_focus(struct wl_input_device *device, |
| 266 | uint32_t time, struct wlsc_output *output, |
| 267 | struct wl_array *keys); |
| 268 | |
| 269 | void |
Benjamin Franzke | ec4d342 | 2011-03-14 12:07:26 +0100 | [diff] [blame] | 270 | wlsc_output_finish_frame(struct wlsc_output *output, int msecs); |
Kristian Høgsberg | 86e0989 | 2010-07-07 09:51:11 -0400 | [diff] [blame] | 271 | void |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 272 | wlsc_output_damage(struct wlsc_output *output); |
| 273 | void |
Kristian Høgsberg | 86e0989 | 2010-07-07 09:51:11 -0400 | [diff] [blame] | 274 | wlsc_compositor_schedule_repaint(struct wlsc_compositor *compositor); |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 275 | void |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 276 | wlsc_compositor_fade(struct wlsc_compositor *compositor, float tint); |
| 277 | void |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 278 | wlsc_compositor_damage_all(struct wlsc_compositor *compositor); |
| 279 | void |
| 280 | wlsc_compositor_unlock(struct wlsc_compositor *compositor); |
| 281 | void |
| 282 | wlsc_compositor_wake(struct wlsc_compositor *compositor); |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 283 | |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 284 | struct wlsc_binding; |
Kristian Høgsberg | a8ec863 | 2011-04-12 17:22:49 -0400 | [diff] [blame] | 285 | typedef void (*wlsc_binding_handler_t)(struct wl_input_device *device, |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 286 | uint32_t time, uint32_t key, |
Kristian Høgsberg | a8ec863 | 2011-04-12 17:22:49 -0400 | [diff] [blame] | 287 | uint32_t button, |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 288 | uint32_t state, void *data); |
| 289 | struct wlsc_binding * |
| 290 | wlsc_compositor_add_binding(struct wlsc_compositor *compositor, |
Kristian Høgsberg | a8ec863 | 2011-04-12 17:22:49 -0400 | [diff] [blame] | 291 | uint32_t key, uint32_t button, uint32_t modifier, |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 292 | wlsc_binding_handler_t binding, void *data); |
| 293 | void |
| 294 | wlsc_binding_destroy(struct wlsc_binding *binding); |
| 295 | |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 296 | struct wlsc_surface * |
| 297 | wlsc_surface_create(struct wlsc_compositor *compositor, |
| 298 | int32_t x, int32_t y, int32_t width, int32_t height); |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 299 | |
Kristian Høgsberg | 4cca349 | 2011-01-18 07:53:49 -0500 | [diff] [blame] | 300 | void |
Benjamin Franzke | ec4d342 | 2011-03-14 12:07:26 +0100 | [diff] [blame] | 301 | wlsc_surface_assign_output(struct wlsc_surface *surface); |
| 302 | |
| 303 | void |
Kristian Høgsberg | 31bd6c7 | 2011-02-13 13:00:51 -0500 | [diff] [blame] | 304 | wlsc_surface_damage(struct wlsc_surface *surface); |
| 305 | |
| 306 | void |
| 307 | wlsc_surface_damage_rectangle(struct wlsc_surface *surface, |
| 308 | int32_t x, int32_t y, |
| 309 | int32_t width, int32_t height); |
| 310 | |
| 311 | void |
Kristian Høgsberg | 4cca349 | 2011-01-18 07:53:49 -0500 | [diff] [blame] | 312 | wlsc_input_device_set_pointer_image(struct wlsc_input_device *device, |
| 313 | enum wlsc_pointer_type type); |
| 314 | struct wlsc_surface * |
| 315 | pick_surface(struct wl_input_device *device, int32_t *sx, int32_t *sy); |
| 316 | |
Kristian Høgsberg | ae6c8a6 | 2011-01-18 09:08:53 -0500 | [diff] [blame] | 317 | void |
| 318 | wlsc_selection_set_focus(struct wl_selection *selection, |
| 319 | struct wl_surface *surface, uint32_t time); |
| 320 | |
Kristian Høgsberg | 4cca349 | 2011-01-18 07:53:49 -0500 | [diff] [blame] | 321 | uint32_t |
Kristian Høgsberg | 02ec0a5 | 2011-04-23 13:04:11 -0400 | [diff] [blame] | 322 | wlsc_compositor_get_time(void); |
Kristian Høgsberg | 4cca349 | 2011-01-18 07:53:49 -0500 | [diff] [blame] | 323 | |
Benjamin Franzke | 0c347f0 | 2011-03-07 15:17:56 +0100 | [diff] [blame] | 324 | int |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 325 | wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display); |
| 326 | void |
Benjamin Franzke | 9c26ff3 | 2011-03-15 15:08:41 +0100 | [diff] [blame] | 327 | wlsc_output_move(struct wlsc_output *output, int x, int y); |
| 328 | void |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 329 | wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c, |
Benjamin Franzke | 1b765ff | 2011-02-18 16:51:37 +0100 | [diff] [blame] | 330 | int x, int y, int width, int height, uint32_t flags); |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 331 | void |
Benjamin Franzke | 9c26ff3 | 2011-03-15 15:08:41 +0100 | [diff] [blame] | 332 | wlsc_output_destroy(struct wlsc_output *output); |
| 333 | |
| 334 | void |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 335 | wlsc_input_device_init(struct wlsc_input_device *device, |
| 336 | struct wlsc_compositor *ec); |
| 337 | |
Kristian Høgsberg | 3d5bae0 | 2010-10-06 21:17:40 -0400 | [diff] [blame] | 338 | int |
Kristian Høgsberg | 02ec0a5 | 2011-04-23 13:04:11 -0400 | [diff] [blame] | 339 | desktop_shell_init(struct wlsc_compositor *ec); |
Kristian Høgsberg | 4cca349 | 2011-01-18 07:53:49 -0500 | [diff] [blame] | 340 | |
Kristian Høgsberg | 30021d7 | 2011-04-12 17:42:30 -0400 | [diff] [blame] | 341 | void |
| 342 | wlsc_switcher_init(struct wlsc_compositor *compositor); |
| 343 | |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 344 | struct wlsc_compositor * |
Kristian Høgsberg | 61a8251 | 2010-10-26 11:26:44 -0400 | [diff] [blame] | 345 | x11_compositor_create(struct wl_display *display, int width, int height); |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 346 | |
| 347 | struct wlsc_compositor * |
Kristian Høgsberg | 61a8251 | 2010-10-26 11:26:44 -0400 | [diff] [blame] | 348 | drm_compositor_create(struct wl_display *display, int connector); |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 349 | |
Benjamin Franzke | ec2e642 | 2010-11-27 19:04:12 +0100 | [diff] [blame] | 350 | struct wlsc_compositor * |
Benjamin Franzke | 5d00709 | 2011-04-04 00:30:25 +0200 | [diff] [blame] | 351 | wfd_compositor_create(struct wl_display *display, int connector); |
| 352 | |
| 353 | struct wlsc_compositor * |
Benjamin Franzke | ec2e642 | 2010-11-27 19:04:12 +0100 | [diff] [blame] | 354 | wayland_compositor_create(struct wl_display *display, int width, int height); |
| 355 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 356 | void |
Kristian Høgsberg | 43db401 | 2011-01-14 14:45:42 -0500 | [diff] [blame] | 357 | evdev_input_add_devices(struct wlsc_compositor *c, struct udev *udev); |
| 358 | |
Kristian Høgsberg | e4762a6 | 2011-01-14 14:59:13 -0500 | [diff] [blame] | 359 | struct tty * |
| 360 | tty_create(struct wlsc_compositor *compositor); |
| 361 | |
| 362 | void |
| 363 | tty_destroy(struct tty *tty); |
| 364 | |
Kristian Høgsberg | 43db401 | 2011-01-14 14:45:42 -0500 | [diff] [blame] | 365 | void |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 366 | screenshooter_create(struct wlsc_compositor *ec); |
| 367 | |
Kristian Høgsberg | f58d8ca | 2011-01-26 14:37:07 -0500 | [diff] [blame] | 368 | uint32_t * |
Kristian Høgsberg | b41d76c | 2011-04-23 15:03:15 -0400 | [diff] [blame] | 369 | wlsc_load_image(const char *filename, |
| 370 | int32_t *width_arg, int32_t *height_arg, uint32_t *stride_arg); |
Kristian Høgsberg | f58d8ca | 2011-01-26 14:37:07 -0500 | [diff] [blame] | 371 | |
Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 372 | #endif |