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); |
Kristian Høgsberg | 1c56218 | 2011-05-02 22:09:20 -0400 | [diff] [blame^] | 132 | void (*set_selection_focus)(struct wlsc_shell *shell, |
| 133 | struct wl_selection *selection, |
| 134 | struct wl_surface *surface, uint32_t time); |
Kristian Høgsberg | 02ec0a5 | 2011-04-23 13:04:11 -0400 | [diff] [blame] | 135 | }; |
| 136 | |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 137 | enum { |
| 138 | WLSC_COMPOSITOR_ACTIVE, |
| 139 | WLSC_COMPOSITOR_SLEEPING |
| 140 | }; |
| 141 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 142 | struct wlsc_compositor { |
Kristian Høgsberg | b313b02 | 2010-12-01 17:07:41 -0500 | [diff] [blame] | 143 | struct wl_compositor compositor; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 144 | |
Benjamin Franzke | 315b3dc | 2011-03-08 11:32:57 +0100 | [diff] [blame] | 145 | struct wl_shm *shm; |
| 146 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 147 | EGLDisplay display; |
| 148 | EGLContext context; |
Benjamin Franzke | be01456 | 2011-02-18 17:04:24 +0100 | [diff] [blame] | 149 | EGLConfig config; |
Kristian Høgsberg | fa4e2a7 | 2011-02-13 13:44:55 -0500 | [diff] [blame] | 150 | GLuint fbo; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 151 | GLuint proj_uniform, tex_uniform; |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 152 | struct wlsc_sprite **pointer_sprites; |
Kristian Høgsberg | 7ffc448 | 2011-04-22 14:23:51 -0400 | [diff] [blame] | 153 | struct wlsc_shader texture_shader; |
| 154 | struct wlsc_shader solid_shader; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 155 | struct wl_display *wl_display; |
| 156 | |
Kristian Høgsberg | 02ec0a5 | 2011-04-23 13:04:11 -0400 | [diff] [blame] | 157 | struct wlsc_shell *shell; |
Kristian Høgsberg | 83fc061 | 2010-08-04 22:44:55 -0400 | [diff] [blame] | 158 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 159 | /* There can be more than one, but not right now... */ |
Kristian Høgsberg | 9c3e8d7 | 2010-12-08 09:48:52 -0500 | [diff] [blame] | 160 | struct wl_input_device *input_device; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 161 | |
| 162 | struct wl_list output_list; |
| 163 | struct wl_list input_device_list; |
| 164 | struct wl_list surface_list; |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 165 | struct wl_list binding_list; |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 166 | struct wl_list animation_list; |
| 167 | struct { |
Kristian Høgsberg | 269c782 | 2011-05-02 14:38:18 -0400 | [diff] [blame] | 168 | struct wlsc_spring spring; |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 169 | struct wlsc_animation animation; |
| 170 | } fade; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 171 | |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 172 | uint32_t state; |
| 173 | struct wl_event_source *idle_source; |
| 174 | uint32_t idle_inhibit; |
| 175 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 176 | /* Repaint state. */ |
| 177 | struct wl_event_source *timer_source; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 178 | int repaint_on_timeout; |
| 179 | struct timespec previous_swap; |
Kristian Høgsberg | 31bd6c7 | 2011-02-13 13:00:51 -0500 | [diff] [blame] | 180 | pixman_region32_t damage_region; |
Kristian Høgsberg | 525e4c0 | 2011-02-14 10:39:54 -0500 | [diff] [blame] | 181 | struct wl_array vertices, indices; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 182 | |
Kristian Høgsberg | 547cadf | 2011-04-12 22:23:30 -0400 | [diff] [blame] | 183 | struct wlsc_surface *overlay; |
Kristian Høgsberg | c9824dd | 2011-02-06 16:54:59 -0500 | [diff] [blame] | 184 | struct wlsc_switcher *switcher; |
Kristian Høgsberg | 86e0989 | 2010-07-07 09:51:11 -0400 | [diff] [blame] | 185 | uint32_t focus; |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 186 | |
Kristian Høgsberg | b5819dc | 2011-04-25 15:08:20 -0400 | [diff] [blame] | 187 | PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC |
| 188 | image_target_renderbuffer_storage; |
| 189 | PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d; |
| 190 | PFNEGLCREATEIMAGEKHRPROC create_image; |
| 191 | PFNEGLDESTROYIMAGEKHRPROC destroy_image; |
| 192 | PFNEGLBINDWAYLANDDISPLAYWL bind_display; |
| 193 | PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display; |
| 194 | int has_bind_display; |
| 195 | |
Kristian Høgsberg | caa6442 | 2010-12-01 16:52:15 -0500 | [diff] [blame] | 196 | void (*destroy)(struct wlsc_compositor *ec); |
Kristian Høgsberg | 640609a | 2010-08-09 22:11:47 -0400 | [diff] [blame] | 197 | int (*authenticate)(struct wlsc_compositor *c, uint32_t id); |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 198 | EGLImageKHR (*create_cursor_image)(struct wlsc_compositor *c, |
| 199 | int32_t width, int32_t height); |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 200 | }; |
| 201 | |
| 202 | #define MODIFIER_CTRL (1 << 8) |
| 203 | #define MODIFIER_ALT (1 << 9) |
Kristian Høgsberg | 5b75f1b | 2010-08-04 23:21:41 -0400 | [diff] [blame] | 204 | #define MODIFIER_SUPER (1 << 10) |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 205 | |
Benjamin Franzke | 1b765ff | 2011-02-18 16:51:37 +0100 | [diff] [blame] | 206 | enum wlsc_output_flags { |
| 207 | WL_OUTPUT_FLIPPED = 0x01 |
| 208 | }; |
| 209 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 210 | struct wlsc_vector { |
| 211 | GLfloat f[4]; |
| 212 | }; |
| 213 | |
Kristian Høgsberg | 0ce2457 | 2011-01-28 15:18:33 -0500 | [diff] [blame] | 214 | enum wlsc_surface_map_type { |
| 215 | WLSC_SURFACE_MAP_UNMAPPED, |
| 216 | WLSC_SURFACE_MAP_TOPLEVEL, |
| 217 | WLSC_SURFACE_MAP_TRANSIENT, |
| 218 | WLSC_SURFACE_MAP_FULLSCREEN |
| 219 | }; |
| 220 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 221 | struct wlsc_surface { |
Kristian Høgsberg | b313b02 | 2010-12-01 17:07:41 -0500 | [diff] [blame] | 222 | struct wl_surface surface; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 223 | struct wlsc_compositor *compositor; |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 224 | GLuint texture, saved_texture; |
Kristian Høgsberg | 83fc061 | 2010-08-04 22:44:55 -0400 | [diff] [blame] | 225 | int32_t x, y, width, height; |
Benjamin Franzke | fab5ec1 | 2011-04-25 19:44:47 +0200 | [diff] [blame] | 226 | int32_t pitch; |
Kristian Høgsberg | 0ce2457 | 2011-01-28 15:18:33 -0500 | [diff] [blame] | 227 | int32_t saved_x, saved_y; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 228 | struct wl_list link; |
Benjamin Franzke | bab41fb | 2011-03-07 18:04:59 +0100 | [diff] [blame] | 229 | struct wl_list buffer_link; |
Kristian Høgsberg | 0bc0e24 | 2011-05-02 14:35:40 -0400 | [diff] [blame] | 230 | struct wlsc_transform *transform; |
Kristian Høgsberg | 5fcd0aa | 2010-08-09 14:43:33 -0400 | [diff] [blame] | 231 | struct wl_visual *visual; |
Benjamin Franzke | ec4d342 | 2011-03-14 12:07:26 +0100 | [diff] [blame] | 232 | struct wlsc_output *output; |
Kristian Høgsberg | 0ce2457 | 2011-01-28 15:18:33 -0500 | [diff] [blame] | 233 | enum wlsc_surface_map_type map_type; |
| 234 | struct wlsc_output *fullscreen_output; |
Benjamin Franzke | 1178a3c | 2011-04-10 16:49:52 +0200 | [diff] [blame] | 235 | |
| 236 | EGLImageKHR image; |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 237 | }; |
| 238 | |
Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 239 | void |
Kristian Høgsberg | 269c782 | 2011-05-02 14:38:18 -0400 | [diff] [blame] | 240 | wlsc_spring_init(struct wlsc_spring *spring, |
| 241 | double k, double current, double target); |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 242 | void |
Kristian Høgsberg | 269c782 | 2011-05-02 14:38:18 -0400 | [diff] [blame] | 243 | wlsc_spring_update(struct wlsc_spring *spring, uint32_t msec); |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 244 | int |
Kristian Høgsberg | 269c782 | 2011-05-02 14:38:18 -0400 | [diff] [blame] | 245 | wlsc_spring_done(struct wlsc_spring *spring); |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 246 | |
| 247 | void |
Kristian Høgsberg | 30021d7 | 2011-04-12 17:42:30 -0400 | [diff] [blame] | 248 | wlsc_surface_activate(struct wlsc_surface *surface, |
| 249 | struct wlsc_input_device *device, uint32_t time); |
| 250 | |
| 251 | void |
Kristian Høgsberg | 9c3e8d7 | 2010-12-08 09:48:52 -0500 | [diff] [blame] | 252 | notify_motion(struct wl_input_device *device, |
Kristian Høgsberg | 808fd41 | 2010-07-20 17:06:19 -0400 | [diff] [blame] | 253 | uint32_t time, int x, int y); |
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_button(struct wl_input_device *device, |
Kristian Høgsberg | 808fd41 | 2010-07-20 17:06:19 -0400 | [diff] [blame] | 256 | uint32_t time, int32_t button, int32_t state); |
Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 257 | void |
Kristian Høgsberg | 9c3e8d7 | 2010-12-08 09:48:52 -0500 | [diff] [blame] | 258 | notify_key(struct wl_input_device *device, |
Kristian Høgsberg | 808fd41 | 2010-07-20 17:06:19 -0400 | [diff] [blame] | 259 | uint32_t time, uint32_t key, uint32_t state); |
Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 260 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 261 | void |
Kristian Høgsberg | 93331ff | 2011-01-26 20:35:07 -0500 | [diff] [blame] | 262 | notify_pointer_focus(struct wl_input_device *device, |
| 263 | uint32_t time, |
| 264 | struct wlsc_output *output, |
| 265 | int32_t x, int32_t y); |
| 266 | |
| 267 | void |
Kristian Høgsberg | 3ba4858 | 2011-01-27 11:57:19 -0500 | [diff] [blame] | 268 | notify_keyboard_focus(struct wl_input_device *device, |
| 269 | uint32_t time, struct wlsc_output *output, |
| 270 | struct wl_array *keys); |
| 271 | |
| 272 | void |
Benjamin Franzke | ec4d342 | 2011-03-14 12:07:26 +0100 | [diff] [blame] | 273 | wlsc_output_finish_frame(struct wlsc_output *output, int msecs); |
Kristian Høgsberg | 86e0989 | 2010-07-07 09:51:11 -0400 | [diff] [blame] | 274 | void |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 275 | wlsc_output_damage(struct wlsc_output *output); |
| 276 | void |
Kristian Høgsberg | 86e0989 | 2010-07-07 09:51:11 -0400 | [diff] [blame] | 277 | wlsc_compositor_schedule_repaint(struct wlsc_compositor *compositor); |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 278 | void |
Kristian Høgsberg | cce1aec | 2011-04-22 15:38:14 -0400 | [diff] [blame] | 279 | wlsc_compositor_fade(struct wlsc_compositor *compositor, float tint); |
| 280 | void |
Kristian Høgsberg | e10a5d9 | 2011-04-22 14:01:18 -0400 | [diff] [blame] | 281 | wlsc_compositor_damage_all(struct wlsc_compositor *compositor); |
| 282 | void |
| 283 | wlsc_compositor_unlock(struct wlsc_compositor *compositor); |
| 284 | void |
| 285 | wlsc_compositor_wake(struct wlsc_compositor *compositor); |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 286 | |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 287 | struct wlsc_binding; |
Kristian Høgsberg | a8ec863 | 2011-04-12 17:22:49 -0400 | [diff] [blame] | 288 | typedef void (*wlsc_binding_handler_t)(struct wl_input_device *device, |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 289 | uint32_t time, uint32_t key, |
Kristian Høgsberg | a8ec863 | 2011-04-12 17:22:49 -0400 | [diff] [blame] | 290 | uint32_t button, |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 291 | uint32_t state, void *data); |
| 292 | struct wlsc_binding * |
| 293 | wlsc_compositor_add_binding(struct wlsc_compositor *compositor, |
Kristian Høgsberg | a8ec863 | 2011-04-12 17:22:49 -0400 | [diff] [blame] | 294 | uint32_t key, uint32_t button, uint32_t modifier, |
Kristian Høgsberg | 3555d09 | 2011-04-11 13:58:13 -0400 | [diff] [blame] | 295 | wlsc_binding_handler_t binding, void *data); |
| 296 | void |
| 297 | wlsc_binding_destroy(struct wlsc_binding *binding); |
| 298 | |
Benjamin Franzke | 431da9a | 2011-04-20 11:02:58 +0200 | [diff] [blame] | 299 | struct wlsc_surface * |
| 300 | wlsc_surface_create(struct wlsc_compositor *compositor, |
| 301 | 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] | 302 | |
Kristian Høgsberg | 4cca349 | 2011-01-18 07:53:49 -0500 | [diff] [blame] | 303 | void |
Benjamin Franzke | ec4d342 | 2011-03-14 12:07:26 +0100 | [diff] [blame] | 304 | wlsc_surface_assign_output(struct wlsc_surface *surface); |
| 305 | |
| 306 | void |
Kristian Høgsberg | 31bd6c7 | 2011-02-13 13:00:51 -0500 | [diff] [blame] | 307 | wlsc_surface_damage(struct wlsc_surface *surface); |
| 308 | |
| 309 | void |
| 310 | wlsc_surface_damage_rectangle(struct wlsc_surface *surface, |
| 311 | int32_t x, int32_t y, |
| 312 | int32_t width, int32_t height); |
| 313 | |
| 314 | void |
Kristian Høgsberg | 4cca349 | 2011-01-18 07:53:49 -0500 | [diff] [blame] | 315 | wlsc_input_device_set_pointer_image(struct wlsc_input_device *device, |
| 316 | enum wlsc_pointer_type type); |
| 317 | struct wlsc_surface * |
| 318 | pick_surface(struct wl_input_device *device, int32_t *sx, int32_t *sy); |
| 319 | |
| 320 | uint32_t |
Kristian Høgsberg | 02ec0a5 | 2011-04-23 13:04:11 -0400 | [diff] [blame] | 321 | wlsc_compositor_get_time(void); |
Kristian Høgsberg | 4cca349 | 2011-01-18 07:53:49 -0500 | [diff] [blame] | 322 | |
Benjamin Franzke | 0c347f0 | 2011-03-07 15:17:56 +0100 | [diff] [blame] | 323 | int |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 324 | wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display); |
| 325 | void |
Benjamin Franzke | 9c26ff3 | 2011-03-15 15:08:41 +0100 | [diff] [blame] | 326 | wlsc_output_move(struct wlsc_output *output, int x, int y); |
| 327 | void |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 328 | wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c, |
Benjamin Franzke | 1b765ff | 2011-02-18 16:51:37 +0100 | [diff] [blame] | 329 | int x, int y, int width, int height, uint32_t flags); |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 330 | void |
Benjamin Franzke | 9c26ff3 | 2011-03-15 15:08:41 +0100 | [diff] [blame] | 331 | wlsc_output_destroy(struct wlsc_output *output); |
| 332 | |
| 333 | void |
Kristian Høgsberg | ce5325d | 2010-06-14 11:54:00 -0400 | [diff] [blame] | 334 | wlsc_input_device_init(struct wlsc_input_device *device, |
| 335 | struct wlsc_compositor *ec); |
| 336 | |
Kristian Høgsberg | 30021d7 | 2011-04-12 17:42:30 -0400 | [diff] [blame] | 337 | void |
| 338 | wlsc_switcher_init(struct wlsc_compositor *compositor); |
| 339 | |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 340 | void |
Kristian Høgsberg | 43db401 | 2011-01-14 14:45:42 -0500 | [diff] [blame] | 341 | evdev_input_add_devices(struct wlsc_compositor *c, struct udev *udev); |
| 342 | |
Kristian Høgsberg | e4762a6 | 2011-01-14 14:59:13 -0500 | [diff] [blame] | 343 | struct tty * |
| 344 | tty_create(struct wlsc_compositor *compositor); |
| 345 | |
| 346 | void |
| 347 | tty_destroy(struct tty *tty); |
| 348 | |
Kristian Høgsberg | 43db401 | 2011-01-14 14:45:42 -0500 | [diff] [blame] | 349 | void |
Kristian Høgsberg | fc783d4 | 2010-06-11 12:56:24 -0400 | [diff] [blame] | 350 | screenshooter_create(struct wlsc_compositor *ec); |
| 351 | |
Kristian Høgsberg | f58d8ca | 2011-01-26 14:37:07 -0500 | [diff] [blame] | 352 | uint32_t * |
Kristian Høgsberg | b41d76c | 2011-04-23 15:03:15 -0400 | [diff] [blame] | 353 | wlsc_load_image(const char *filename, |
| 354 | 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] | 355 | |
Kristian Høgsberg | 82f6e8a | 2008-12-19 13:47:53 -0500 | [diff] [blame] | 356 | #endif |