blob: 865b01c4775db65d8eb2a74177333735d0d02af1 [file] [log] [blame]
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001/*
2 * Copyright © 2008-2011 Kristian Høgsberg
Pekka Paalanend581a8f2012-01-27 16:25:16 +02003 * Copyright © 2012 Collabora, Ltd.
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05004 *
5 * Permission to use, copy, modify, distribute, and sell this software and
6 * its documentation for any purpose is hereby granted without fee, provided
7 * that the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of the copyright holders not be used in
10 * advertising or publicity pertaining to distribution of the software
11 * without specific, written prior permission. The copyright holders make
12 * no representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied warranty.
14 *
15 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
16 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
19 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
20 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 */
23
24#ifndef _WAYLAND_SYSTEM_COMPOSITOR_H_
25#define _WAYLAND_SYSTEM_COMPOSITOR_H_
26
Giulio Camuffo7fe01b12013-03-28 18:02:42 +010027#ifdef __cplusplus
28extern "C" {
29#endif
30
Kristian Høgsberg8334bc12012-01-03 10:29:47 -050031#include <pixman.h>
Daniel Stone855028f2012-05-01 20:37:10 +010032#include <xkbcommon/xkbcommon.h>
Kristian Høgsberg8334bc12012-01-03 10:29:47 -050033#include <wayland-server.h>
34
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -050035#include "version.h"
36#include "matrix.h"
37#include "config-parser.h"
Pekka Paalanen2eaa11e2012-03-30 15:45:40 +030038
Kristian Høgsberg5717b6d2012-10-19 17:12:38 -040039#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
Kristian Høgsberg8334bc12012-01-03 10:29:47 -050040
Kristian Høgsberg8c31a4c2012-10-19 23:05:37 -040041#define container_of(ptr, type, member) ({ \
42 const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
43 (type *)( (char *)__mptr - offsetof(type,member) );})
44
Kristian Høgsberg8334bc12012-01-03 10:29:47 -050045struct weston_transform {
46 struct weston_matrix matrix;
Pekka Paalanenc61eca62012-01-06 14:10:06 +020047 struct wl_list link;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -050048};
49
50struct weston_surface;
Tiago Vignattibc052c92012-04-19 16:18:18 +030051struct shell_surface;
Daniel Stone37816df2012-05-16 18:45:18 +010052struct weston_seat;
Scott Moreau062be7e2012-04-20 13:37:33 -060053struct weston_output;
Jan Arne Petersene829adc2012-08-10 16:47:22 +020054struct input_method;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -050055
Daniel Stone496ca172012-05-30 16:31:42 +010056enum weston_keyboard_modifier {
57 MODIFIER_CTRL = (1 << 0),
58 MODIFIER_ALT = (1 << 1),
59 MODIFIER_SUPER = (1 << 2),
Kristian Høgsberg73694c82012-06-28 14:13:10 -040060 MODIFIER_SHIFT = (1 << 3),
Daniel Stone496ca172012-05-30 16:31:42 +010061};
62
Daniel Stone8c8164f2012-05-30 16:31:45 +010063enum weston_led {
64 LED_NUM_LOCK = (1 << 0),
65 LED_CAPS_LOCK = (1 << 1),
66 LED_SCROLL_LOCK = (1 << 2),
67};
68
Kristian Høgsberg8334bc12012-01-03 10:29:47 -050069struct weston_mode {
70 uint32_t flags;
71 int32_t width, height;
72 uint32_t refresh;
73 struct wl_list link;
74};
75
Kristian Høgsberga61ca062012-05-22 16:05:52 -040076struct weston_shell_client {
77 void (*send_configure)(struct weston_surface *surface,
78 uint32_t edges, int32_t width, int32_t height);
79};
80
Tiago Vignattibc052c92012-04-19 16:18:18 +030081struct weston_shell_interface {
82 void *shell; /* either desktop or tablet */
83
Kristian Høgsberg45ba8692012-05-21 14:27:33 -040084 struct shell_surface *(*create_shell_surface)(void *shell,
Kristian Høgsberga61ca062012-05-22 16:05:52 -040085 struct weston_surface *surface,
86 const struct weston_shell_client *client);
Kristian Høgsberg45ba8692012-05-21 14:27:33 -040087
Tiago Vignattibc052c92012-04-19 16:18:18 +030088 void (*set_toplevel)(struct shell_surface *shsurf);
Kristian Høgsberg938b8fa2012-05-18 13:46:27 -040089
Tiago Vignatti491bac12012-05-18 16:37:43 -040090 void (*set_transient)(struct shell_surface *shsurf,
Kristian Høgsberg8150b192012-06-27 10:22:58 -040091 struct weston_surface *parent,
Tiago Vignatti491bac12012-05-18 16:37:43 -040092 int x, int y, uint32_t flags);
Kristian Høgsbergb810eb52013-02-12 20:07:05 -050093 void (*set_fullscreen)(struct shell_surface *shsurf,
94 uint32_t method,
95 uint32_t framerate,
96 struct weston_output *output);
Tiago Vignattifb2adba2013-06-12 15:43:21 -030097 void (*set_xwayland)(struct shell_surface *shsurf,
98 int x, int y, uint32_t flags);
Kristian Høgsberg938b8fa2012-05-18 13:46:27 -040099 int (*move)(struct shell_surface *shsurf, struct weston_seat *ws);
Kristian Høgsbergc1693f22012-05-22 16:56:23 -0400100 int (*resize)(struct shell_surface *shsurf,
101 struct weston_seat *ws, uint32_t edges);
102
Tiago Vignattibc052c92012-04-19 16:18:18 +0300103};
104
Kristian Høgsberg546a8122012-02-01 07:45:51 -0500105struct weston_border {
106 int32_t left, right, top, bottom;
107};
108
Scott Moreaue6603982012-06-11 13:07:51 -0600109struct weston_animation {
110 void (*frame)(struct weston_animation *animation,
111 struct weston_output *output, uint32_t msecs);
112 int frame_counter;
113 struct wl_list link;
114};
115
116struct weston_spring {
117 double k;
118 double friction;
119 double current;
120 double target;
121 double previous;
122 uint32_t timestamp;
123};
124
Scott Moreau7a1b32a2012-05-27 14:25:02 -0600125enum {
Scott Moreaue6603982012-06-11 13:07:51 -0600126 ZOOM_FOCUS_POINTER,
127 ZOOM_FOCUS_TEXT
Scott Moreau7a1b32a2012-05-27 14:25:02 -0600128};
129
Scott Moreau8dacaab2012-06-17 18:10:58 -0600130struct weston_fixed_point {
131 wl_fixed_t x, y;
132};
133
Scott Moreauccbf29d2012-02-22 14:21:41 -0700134struct weston_output_zoom {
135 int active;
Scott Moreaue6603982012-06-11 13:07:51 -0600136 uint32_t type;
Scott Moreauccbf29d2012-02-22 14:21:41 -0700137 float increment;
138 float level;
Scott Moreaue6603982012-06-11 13:07:51 -0600139 float max_level;
Scott Moreauccbf29d2012-02-22 14:21:41 -0700140 float trans_x, trans_y;
Scott Moreaue6603982012-06-11 13:07:51 -0600141 struct weston_animation animation_z;
142 struct weston_spring spring_z;
Scott Moreau8dacaab2012-06-17 18:10:58 -0600143 struct weston_animation animation_xy;
144 struct weston_spring spring_xy;
145 struct weston_fixed_point from;
146 struct weston_fixed_point to;
147 struct weston_fixed_point current;
148 struct weston_fixed_point text_cursor;
Scott Moreauccbf29d2012-02-22 14:21:41 -0700149};
150
Tiago Vignatti8e53c7f2012-02-29 19:53:50 +0200151/* bit compatible with drm definitions. */
152enum dpms_enum {
153 WESTON_DPMS_ON,
154 WESTON_DPMS_STANDBY,
155 WESTON_DPMS_SUSPEND,
156 WESTON_DPMS_OFF
157};
158
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500159struct weston_output {
Casey Dahlin58ba1372012-04-19 22:50:08 -0400160 uint32_t id;
Richard Hughesafe690c2013-05-02 10:10:04 +0100161 char *name;
Casey Dahlin58ba1372012-04-19 22:50:08 -0400162
John Kåre Alsaker94659272012-11-13 19:10:18 +0100163 void *renderer_state;
164
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500165 struct wl_list link;
Casey Dahlin9074db52012-04-19 22:50:09 -0400166 struct wl_list resource_list;
Benjamin Franzkeb6879402012-04-10 18:28:54 +0200167 struct wl_global *global;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500168 struct weston_compositor *compositor;
169 struct weston_matrix matrix;
Scott Moreau9d1b1122012-06-08 19:40:53 -0600170 struct wl_list animation_list;
Scott Moreau1bad5db2012-08-18 01:04:05 -0600171 int32_t x, y, width, height;
172 int32_t mm_width, mm_height;
Kristian Høgsberg546a8122012-02-01 07:45:51 -0500173 struct weston_border border;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500174 pixman_region32_t region;
Ander Conselvan de Oliveirab8fcca92012-11-16 17:23:52 +0200175 pixman_region32_t previous_damage;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500176 int repaint_needed;
177 int repaint_scheduled;
Scott Moreauccbf29d2012-02-22 14:21:41 -0700178 struct weston_output_zoom zoom;
179 int dirty;
Kristian Høgsberg5fb70bf2012-05-24 12:29:46 -0400180 struct wl_signal frame_signal;
Richard Hughes64ddde12013-05-01 21:52:10 +0100181 struct wl_signal destroy_signal;
Kristian Høgsberge9d04922012-06-19 23:54:26 -0400182 uint32_t frame_time;
Kristian Høgsberg79af73e2012-08-03 15:45:23 -0400183 int disable_planes;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500184
Richard Hughes2b2092a2013-04-24 14:58:02 +0100185 char *make, *model, *serial_number;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500186 uint32_t subpixel;
Kristian Høgsberg05890dc2012-08-10 10:09:20 -0400187 uint32_t transform;
Alexander Larssonedddbd12013-05-24 13:09:43 +0200188 int32_t scale;
Alexander Larsson4ea95522013-05-22 14:41:37 +0200189
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500190 struct weston_mode *current;
Alex Wubd3354b2012-04-17 17:20:49 +0800191 struct weston_mode *origin;
Alexander Larssone32c3762013-05-28 16:23:37 +0200192 int32_t origin_scale;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500193 struct wl_list mode_list;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500194
Jonas Ådahle5a12252013-04-05 23:07:11 +0200195 void (*start_repaint_loop)(struct weston_output *output);
Kristian Høgsberg6ddcdae2012-02-28 22:31:58 -0500196 void (*repaint)(struct weston_output *output,
Kristian Høgsbergd7c17262012-09-05 21:54:15 -0400197 pixman_region32_t *damage);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500198 void (*destroy)(struct weston_output *output);
Jesse Barnes5308a5e2012-02-09 13:12:57 -0800199 void (*assign_planes)(struct weston_output *output);
Alex Wu2dda6042012-04-17 17:20:47 +0800200 int (*switch_mode)(struct weston_output *output, struct weston_mode *mode);
Tiago Vignatti8e53c7f2012-02-29 19:53:50 +0200201
Tiago Vignatti5ab91ad2012-03-12 19:40:09 -0300202 /* backlight values are on 0-255 range, where higher is brighter */
Kristian Høgsberg7c609122013-05-23 20:30:26 -0400203 int32_t backlight_current;
Tiago Vignatti8e53c7f2012-02-29 19:53:50 +0200204 void (*set_backlight)(struct weston_output *output, uint32_t value);
205 void (*set_dpms)(struct weston_output *output, enum dpms_enum level);
Richard Hughese7299962013-05-01 21:52:12 +0100206
Richard Hughesb24e48e2013-05-09 20:31:09 +0100207 int connection_internal;
Richard Hughese7299962013-05-01 21:52:12 +0100208 uint16_t gamma_size;
209 void (*set_gamma)(struct weston_output *output,
210 uint16_t size,
211 uint16_t *r,
212 uint16_t *g,
213 uint16_t *b);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500214};
215
Kristian Høgsberg02bbabb2013-05-06 22:15:05 -0400216struct weston_pointer_grab;
217struct weston_pointer_grab_interface {
Kristian Høgsberg6848c252013-05-08 22:02:59 -0400218 void (*focus)(struct weston_pointer_grab *grab);
Kristian Høgsbergbe6403e2013-05-08 21:03:21 -0400219 void (*motion)(struct weston_pointer_grab *grab, uint32_t time);
Kristian Høgsberg02bbabb2013-05-06 22:15:05 -0400220 void (*button)(struct weston_pointer_grab *grab,
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400221 uint32_t time, uint32_t button, uint32_t state);
222};
223
Kristian Høgsberg02bbabb2013-05-06 22:15:05 -0400224struct weston_pointer_grab {
225 const struct weston_pointer_grab_interface *interface;
226 struct weston_pointer *pointer;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400227};
228
Kristian Høgsberg29139d42013-04-18 15:25:39 -0400229struct weston_keyboard_grab;
230struct weston_keyboard_grab_interface {
231 void (*key)(struct weston_keyboard_grab *grab, uint32_t time,
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400232 uint32_t key, uint32_t state);
Kristian Høgsberg29139d42013-04-18 15:25:39 -0400233 void (*modifiers)(struct weston_keyboard_grab *grab, uint32_t serial,
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400234 uint32_t mods_depressed, uint32_t mods_latched,
235 uint32_t mods_locked, uint32_t group);
236};
237
Kristian Høgsberg29139d42013-04-18 15:25:39 -0400238struct weston_keyboard_grab {
239 const struct weston_keyboard_grab_interface *interface;
240 struct weston_keyboard *keyboard;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400241};
242
Kristian Høgsberge329f362013-05-06 22:19:57 -0400243struct weston_touch_grab;
244struct weston_touch_grab_interface {
245 void (*down)(struct weston_touch_grab *grab,
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400246 uint32_t time,
247 int touch_id,
248 wl_fixed_t sx,
249 wl_fixed_t sy);
Kristian Høgsberge329f362013-05-06 22:19:57 -0400250 void (*up)(struct weston_touch_grab *grab,
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400251 uint32_t time,
252 int touch_id);
Kristian Høgsberge329f362013-05-06 22:19:57 -0400253 void (*motion)(struct weston_touch_grab *grab,
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400254 uint32_t time,
255 int touch_id,
256 wl_fixed_t sx,
257 wl_fixed_t sy);
258};
259
Kristian Høgsberge329f362013-05-06 22:19:57 -0400260struct weston_touch_grab {
261 const struct weston_touch_grab_interface *interface;
262 struct weston_touch *touch;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400263};
264
265struct wl_data_offer {
266 struct wl_resource resource;
267 struct wl_data_source *source;
268 struct wl_listener source_destroy_listener;
269};
270
271struct wl_data_source {
272 struct wl_resource resource;
273 struct wl_array mime_types;
274
275 void (*accept)(struct wl_data_source *source,
276 uint32_t serial, const char *mime_type);
277 void (*send)(struct wl_data_source *source,
278 const char *mime_type, int32_t fd);
279 void (*cancel)(struct wl_data_source *source);
280};
281
Kristian Høgsberg02bbabb2013-05-06 22:15:05 -0400282struct weston_pointer {
Kristian Høgsberge3148752013-05-06 23:19:49 -0400283 struct weston_seat *seat;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400284
285 struct wl_list resource_list;
Kristian Høgsbergfe7aa902013-05-08 09:54:37 -0400286 struct weston_surface *focus;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400287 struct wl_resource *focus_resource;
288 struct wl_listener focus_listener;
289 uint32_t focus_serial;
290 struct wl_signal focus_signal;
291
Kristian Høgsberg195b8692013-05-08 15:02:05 -0400292 struct weston_surface *sprite;
293 struct wl_listener sprite_destroy_listener;
294 int32_t hotspot_x, hotspot_y;
295
Kristian Høgsberg02bbabb2013-05-06 22:15:05 -0400296 struct weston_pointer_grab *grab;
297 struct weston_pointer_grab default_grab;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400298 wl_fixed_t grab_x, grab_y;
299 uint32_t grab_button;
300 uint32_t grab_serial;
301 uint32_t grab_time;
302
303 wl_fixed_t x, y;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400304 uint32_t button_count;
305};
306
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400307
Kristian Høgsberge329f362013-05-06 22:19:57 -0400308struct weston_touch {
Kristian Høgsberge3148752013-05-06 23:19:49 -0400309 struct weston_seat *seat;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400310
311 struct wl_list resource_list;
Kristian Høgsbergfe7aa902013-05-08 09:54:37 -0400312 struct weston_surface *focus;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400313 struct wl_resource *focus_resource;
314 struct wl_listener focus_listener;
315 uint32_t focus_serial;
316 struct wl_signal focus_signal;
317
Kristian Høgsberge329f362013-05-06 22:19:57 -0400318 struct weston_touch_grab *grab;
319 struct weston_touch_grab default_grab;
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400320 wl_fixed_t grab_x, grab_y;
321 uint32_t grab_serial;
322 uint32_t grab_time;
323};
324
Kristian Høgsberga4036bb2013-05-07 23:52:07 -0400325struct weston_pointer *
326weston_pointer_create(void);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400327void
Kristian Høgsberga4036bb2013-05-07 23:52:07 -0400328weston_pointer_destroy(struct weston_pointer *pointer);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400329void
Kristian Høgsberg02bbabb2013-05-06 22:15:05 -0400330weston_pointer_set_focus(struct weston_pointer *pointer,
Kristian Høgsbergfe7aa902013-05-08 09:54:37 -0400331 struct weston_surface *surface,
Kristian Høgsberg02bbabb2013-05-06 22:15:05 -0400332 wl_fixed_t sx, wl_fixed_t sy);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400333void
Kristian Høgsberg02bbabb2013-05-06 22:15:05 -0400334weston_pointer_start_grab(struct weston_pointer *pointer,
335 struct weston_pointer_grab *grab);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400336void
Kristian Høgsberg02bbabb2013-05-06 22:15:05 -0400337weston_pointer_end_grab(struct weston_pointer *pointer);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400338
Kristian Høgsberga4036bb2013-05-07 23:52:07 -0400339struct weston_keyboard *
340weston_keyboard_create(void);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400341void
Kristian Høgsberga4036bb2013-05-07 23:52:07 -0400342weston_keyboard_destroy(struct weston_keyboard *keyboard);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400343void
Kristian Høgsberg29139d42013-04-18 15:25:39 -0400344weston_keyboard_set_focus(struct weston_keyboard *keyboard,
Kristian Høgsbergfe7aa902013-05-08 09:54:37 -0400345 struct weston_surface *surface);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400346void
Kristian Høgsberg29139d42013-04-18 15:25:39 -0400347weston_keyboard_start_grab(struct weston_keyboard *device,
348 struct weston_keyboard_grab *grab);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400349void
Kristian Høgsberg29139d42013-04-18 15:25:39 -0400350weston_keyboard_end_grab(struct weston_keyboard *keyboard);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400351
Kristian Høgsberga4036bb2013-05-07 23:52:07 -0400352struct weston_touch *
353weston_touch_create(void);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400354void
Kristian Høgsberga4036bb2013-05-07 23:52:07 -0400355weston_touch_destroy(struct weston_touch *touch);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400356void
Kristian Høgsberge329f362013-05-06 22:19:57 -0400357weston_touch_start_grab(struct weston_touch *device,
358 struct weston_touch_grab *grab);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400359void
Kristian Høgsberge329f362013-05-06 22:19:57 -0400360weston_touch_end_grab(struct weston_touch *touch);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400361
362void
Kristian Høgsberge3148752013-05-06 23:19:49 -0400363wl_data_device_set_keyboard_focus(struct weston_seat *seat);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400364
365int
366wl_data_device_manager_init(struct wl_display *display);
367
368
369void
Kristian Høgsberge3148752013-05-06 23:19:49 -0400370weston_seat_set_selection(struct weston_seat *seat,
371 struct wl_data_source *source, uint32_t serial);
Kristian Høgsberg2158a882013-04-18 15:07:39 -0400372
Daniel Stoned65b9092012-05-30 16:32:05 +0100373struct weston_xkb_info {
374 struct xkb_keymap *keymap;
Daniel Stoneb7452fe2012-06-01 12:14:06 +0100375 int keymap_fd;
376 size_t keymap_size;
377 char *keymap_area;
Daniel Stoneabb9dcd2012-06-22 13:21:33 +0100378 xkb_mod_index_t shift_mod;
379 xkb_mod_index_t caps_mod;
Daniel Stoned65b9092012-05-30 16:32:05 +0100380 xkb_mod_index_t ctrl_mod;
381 xkb_mod_index_t alt_mod;
Daniel Stoneabb9dcd2012-06-22 13:21:33 +0100382 xkb_mod_index_t mod2_mod;
383 xkb_mod_index_t mod3_mod;
Daniel Stoned65b9092012-05-30 16:32:05 +0100384 xkb_mod_index_t super_mod;
Daniel Stoneabb9dcd2012-06-22 13:21:33 +0100385 xkb_mod_index_t mod5_mod;
Daniel Stoned65b9092012-05-30 16:32:05 +0100386 xkb_led_index_t num_led;
387 xkb_led_index_t caps_led;
388 xkb_led_index_t scroll_led;
389};
390
Jan Arne Petersena75a7892013-01-16 21:26:50 +0100391struct weston_keyboard {
Kristian Høgsberge3148752013-05-06 23:19:49 -0400392 struct weston_seat *seat;
Jan Arne Petersena75a7892013-01-16 21:26:50 +0100393
Kristian Høgsberg29139d42013-04-18 15:25:39 -0400394 struct wl_list resource_list;
Kristian Høgsbergfe7aa902013-05-08 09:54:37 -0400395 struct weston_surface *focus;
Kristian Høgsberg29139d42013-04-18 15:25:39 -0400396 struct wl_resource *focus_resource;
397 struct wl_listener focus_listener;
398 uint32_t focus_serial;
399 struct wl_signal focus_signal;
400
401 struct weston_keyboard_grab *grab;
402 struct weston_keyboard_grab default_grab;
403 uint32_t grab_key;
404 uint32_t grab_serial;
405 uint32_t grab_time;
406
407 struct wl_array keys;
408
409 struct {
410 uint32_t mods_depressed;
411 uint32_t mods_latched;
412 uint32_t mods_locked;
413 uint32_t group;
414 } modifiers;
415
416 struct weston_keyboard_grab input_method_grab;
Jan Arne Petersena75a7892013-01-16 21:26:50 +0100417 struct wl_resource *input_method_resource;
418};
419
Daniel Stone37816df2012-05-16 18:45:18 +0100420struct weston_seat {
Kristian Høgsberge3148752013-05-06 23:19:49 -0400421 struct wl_list base_resource_list;
422
423 struct weston_pointer *pointer;
424 struct weston_keyboard *keyboard;
425 struct weston_touch *touch;
426
Giulio Camuffo5085a752013-03-25 21:42:45 +0100427 struct wl_signal destroy_signal;
Daniel Stone74419a22012-05-30 16:32:02 +0100428
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500429 struct weston_compositor *compositor;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500430 struct wl_list link;
Daniel Stone496ca172012-05-30 16:31:42 +0100431 enum weston_keyboard_modifier modifier_state;
Kristian Høgsbergfe7aa902013-05-08 09:54:37 -0400432 struct weston_surface *saved_kbd_focus;
Ander Conselvan de Oliveira71b1d0c2012-03-16 17:25:11 +0200433 struct wl_listener saved_kbd_focus_listener;
Kristian Høgsberg054c50a2013-05-08 15:27:47 -0400434 struct wl_list drag_resource_list;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500435
Kristian Høgsberge3148752013-05-06 23:19:49 -0400436 uint32_t selection_serial;
437 struct wl_data_source *selection_data_source;
438 struct wl_listener selection_data_source_listener;
439 struct wl_signal selection_signal;
440
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500441 uint32_t num_tp;
Ander Conselvan de Oliveirad6ea33d2012-03-27 17:36:39 +0300442
Daniel Stone8c8164f2012-05-30 16:31:45 +0100443 void (*led_update)(struct weston_seat *ws, enum weston_led leds);
444
Daniel Stoned65b9092012-05-30 16:32:05 +0100445 struct weston_xkb_info xkb_info;
Daniel Stone994679a2012-05-30 16:31:43 +0100446 struct {
447 struct xkb_state *state;
Daniel Stone8c8164f2012-05-30 16:31:45 +0100448 enum weston_led leds;
Daniel Stone994679a2012-05-30 16:31:43 +0100449 } xkb_state;
Jan Arne Petersene829adc2012-08-10 16:47:22 +0200450
451 struct input_method *input_method;
Rob Bradford9af5f9e2013-05-31 18:09:50 +0100452 char *seat_name;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500453};
454
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500455enum {
456 WESTON_COMPOSITOR_ACTIVE,
457 WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */
Philipp Brüschweiler57edf7f2013-03-29 13:01:56 +0100458 WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */
459 WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dmps
460 * to off */
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500461};
462
Kristian Høgsberg3be2ce92012-02-29 12:42:35 -0500463struct weston_layer {
464 struct wl_list surface_list;
465 struct wl_list link;
466};
467
Kristian Høgsberg65a11e12012-08-03 11:30:18 -0400468struct weston_plane {
469 pixman_region32_t damage;
Ander Conselvan de Oliveirae1bd5a02013-03-05 17:30:29 +0200470 pixman_region32_t clip;
Kristian Høgsberg65a11e12012-08-03 11:30:18 -0400471 int32_t x, y;
Ander Conselvan de Oliveira8ad19822013-03-05 17:30:27 +0200472 struct wl_list link;
Kristian Høgsberg65a11e12012-08-03 11:30:18 -0400473};
474
Kristian Høgsbergfa1be022012-09-05 22:49:55 -0400475struct weston_renderer {
John Kåre Alsakera95b2d62012-11-13 19:10:21 +0100476 int (*read_pixels)(struct weston_output *output,
477 pixman_format_code_t format, void *pixels,
478 uint32_t x, uint32_t y,
479 uint32_t width, uint32_t height);
Kristian Høgsbergfa1be022012-09-05 22:49:55 -0400480 void (*repaint_output)(struct weston_output *output,
481 pixman_region32_t *output_damage);
482 void (*flush_damage)(struct weston_surface *surface);
483 void (*attach)(struct weston_surface *es, struct wl_buffer *buffer);
John Kåre Alsaker878f4492012-11-13 19:10:23 +0100484 int (*create_surface)(struct weston_surface *surface);
485 void (*surface_set_color)(struct weston_surface *surface,
486 float red, float green,
487 float blue, float alpha);
Kristian Høgsberg42263852012-09-06 21:59:29 -0400488 void (*destroy_surface)(struct weston_surface *surface);
Vasily Khoruzhick52cfd612013-01-08 19:09:01 +0300489 void (*destroy)(struct weston_compositor *ec);
Kristian Høgsbergfa1be022012-09-05 22:49:55 -0400490};
491
Pekka Paalanen7bb65102013-05-22 18:03:04 +0300492enum weston_capability {
493 /* backend/renderer supports arbitrary rotation */
494 WESTON_CAP_ROTATION_ANY = 0x0001,
Pekka Paalanen4fc5dd02013-05-22 18:03:05 +0300495
496 /* screencaptures need to be y-flipped */
497 WESTON_CAP_CAPTURE_YFLIP = 0x0002,
Pekka Paalanen7bb65102013-05-22 18:03:04 +0300498};
499
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500500struct weston_compositor {
Kristian Høgsberg02e79dc2012-04-12 09:55:26 -0400501 struct wl_signal destroy_signal;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500502
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500503 struct wl_display *wl_display;
Tiago Vignattibc052c92012-04-19 16:18:18 +0300504 struct weston_shell_interface shell_interface;
Kristian Høgsberg73274712013-04-01 12:41:23 -0400505 struct weston_config *config;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500506
Tiago Vignattifb2adba2013-06-12 15:43:21 -0300507 /* surface signals */
Kristian Høgsberg02e79dc2012-04-12 09:55:26 -0400508 struct wl_signal activate_signal;
Tiago Vignattifb2adba2013-06-12 15:43:21 -0300509 struct wl_signal transform_signal;
510
Tiago Vignatti1d01b012012-09-27 17:48:36 +0300511 struct wl_signal kill_signal;
Ander Conselvan de Oliveiraa4575632013-02-21 18:35:23 +0200512 struct wl_signal idle_signal;
513 struct wl_signal wake_signal;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500514
Jan Arne Petersen42feced2012-06-21 21:52:17 +0200515 struct wl_signal show_input_panel_signal;
516 struct wl_signal hide_input_panel_signal;
Jan Arne Petersen14da96b2013-04-18 16:47:28 +0200517 struct wl_signal update_input_panel_signal;
Jan Arne Petersen42feced2012-06-21 21:52:17 +0200518
Jan Arne Petersen674fd1d2012-11-18 19:06:42 +0100519 struct wl_signal seat_created_signal;
Richard Hughes59d5da72013-05-01 21:52:11 +0100520 struct wl_signal output_created_signal;
Jan Arne Petersen674fd1d2012-11-18 19:06:42 +0100521
Kristian Høgsberg7ea10862012-03-05 17:49:30 -0500522 struct wl_event_loop *input_loop;
523 struct wl_event_source *input_loop_source;
524
Kristian Høgsberg3be2ce92012-02-29 12:42:35 -0500525 struct weston_layer fade_layer;
526 struct weston_layer cursor_layer;
527
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500528 struct wl_list output_list;
Daniel Stone37816df2012-05-16 18:45:18 +0100529 struct wl_list seat_list;
Kristian Høgsberg3be2ce92012-02-29 12:42:35 -0500530 struct wl_list layer_list;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500531 struct wl_list surface_list;
Ander Conselvan de Oliveira8ad19822013-03-05 17:30:27 +0200532 struct wl_list plane_list;
Daniel Stone325fc2d2012-05-30 16:31:58 +0100533 struct wl_list key_binding_list;
534 struct wl_list button_binding_list;
535 struct wl_list axis_binding_list;
Ander Conselvan de Oliveirac509d2b2012-11-08 17:20:45 +0200536 struct wl_list debug_binding_list;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500537
538 uint32_t state;
539 struct wl_event_source *idle_source;
540 uint32_t idle_inhibit;
Philipp Brüschweiler4b409c32013-03-10 14:37:04 +0100541 int idle_time; /* timeout, s */
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500542
543 /* Repaint state. */
Kristian Høgsberg65a11e12012-08-03 11:30:18 -0400544 struct weston_plane primary_plane;
Pekka Paalanen7bb65102013-05-22 18:03:04 +0300545 uint32_t capabilities; /* combination of enum weston_capability */
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500546
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500547 uint32_t focus;
548
Kristian Høgsbergfa1be022012-09-05 22:49:55 -0400549 struct weston_renderer *renderer;
550
John Kåre Alsakerf9e710b2012-11-13 19:10:22 +0100551 pixman_format_code_t read_format;
Pekka Paalanen52bfbaa2012-04-11 16:19:37 +0300552
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500553 void (*destroy)(struct weston_compositor *ec);
Kristian Høgsberg7b884bc2012-07-31 14:32:01 -0400554 void (*restore)(struct weston_compositor *ec);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500555 int (*authenticate)(struct weston_compositor *c, uint32_t id);
Kristian Høgsberg3466bc82012-01-03 11:29:15 -0500556
Scott Moreauff1db4a2012-04-17 19:06:18 -0600557 void (*ping_handler)(struct weston_surface *surface, uint32_t serial);
558
Benjamin Franzkebfeda132012-01-30 14:04:04 +0100559 int launcher_sock;
Casey Dahlin58ba1372012-04-19 22:50:08 -0400560
561 uint32_t output_id_pool;
Daniel Stone855028f2012-05-01 20:37:10 +0100562
Daniel Stonee379da92012-05-30 16:32:04 +0100563 struct xkb_rule_names xkb_names;
564 struct xkb_context *xkb_context;
565 struct weston_xkb_info xkb_info;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500566};
567
Pekka Paalanende685b82012-12-04 15:58:12 +0200568struct weston_buffer_reference {
569 struct wl_buffer *buffer;
570 struct wl_listener destroy_listener;
571};
572
Kristian Høgsberg5e7e6f22012-02-23 16:11:59 -0500573struct weston_region {
574 struct wl_resource resource;
575 pixman_region32_t region;
576};
577
Pekka Paalanene67858b2013-04-25 13:57:42 +0300578struct weston_subsurface {
579 struct wl_resource *resource;
580
581 /* guaranteed to be valid and non-NULL */
582 struct weston_surface *surface;
583 struct wl_listener surface_destroy_listener;
584
585 /* can be NULL */
586 struct weston_surface *parent;
587 struct wl_listener parent_destroy_listener;
588 struct wl_list parent_link;
589 struct wl_list parent_link_pending;
590
591 struct {
592 int32_t x;
593 int32_t y;
594 int set;
595 } position;
596
597 struct {
598 int has_data;
599
600 /* wl_surface.attach */
601 int newly_attached;
602 struct weston_buffer_reference buffer_ref;
603 int32_t sx;
604 int32_t sy;
605
606 /* wl_surface.damage */
607 pixman_region32_t damage;
608
609 /* wl_surface.set_opaque_region */
610 pixman_region32_t opaque;
611
612 /* wl_surface.set_input_region */
613 pixman_region32_t input;
614
615 /* wl_surface.frame */
616 struct wl_list frame_callback_list;
617
618 /* wl_surface.set_buffer_transform */
619 uint32_t buffer_transform;
Alexander Larsson4ea95522013-05-22 14:41:37 +0200620
621 /* wl_surface.set_buffer_scale */
Alexander Larssonedddbd12013-05-24 13:09:43 +0200622 int32_t buffer_scale;
Pekka Paalanene67858b2013-04-25 13:57:42 +0300623 } cached;
624
625 int synchronized;
626};
627
Pekka Paalanen44ab69c2012-02-07 13:18:00 +0200628/* Using weston_surface transformations
629 *
630 * To add a transformation to a surface, create a struct weston_transform, and
631 * add it to the list surface->geometry.transformation_list. Whenever you
632 * change the list, anything under surface->geometry, or anything in the
Pekka Paalanenc3ce7382013-03-08 14:56:49 +0200633 * weston_transforms linked into the list, you must call
634 * weston_surface_geometry_dirty().
Pekka Paalanen44ab69c2012-02-07 13:18:00 +0200635 *
636 * The order in the list defines the order of transformations. Let the list
637 * contain the transformation matrices M1, ..., Mn as head to tail. The
638 * transformation is applied to surface-local coordinate vector p as
639 * P = Mn * ... * M2 * M1 * p
640 * to produce the global coordinate vector P. The total transform
641 * Mn * ... * M2 * M1
642 * is cached in surface->transform.matrix, and the inverse of it in
643 * surface->transform.inverse.
644 *
645 * The list always contains surface->transform.position transformation, which
646 * is the translation by surface->geometry.x and y.
647 *
648 * If you want to apply a transformation in local coordinates, add your
649 * weston_transform to the head of the list. If you want to apply a
650 * transformation in global coordinates, add it to the tail of the list.
Pekka Paalanen483243f2013-03-08 14:56:50 +0200651 *
652 * If surface->geometry.parent is set, the total transformation of this
653 * surface will be the parent's total transformation and this transformation
654 * combined:
655 * Mparent * Mn * ... * M2 * M1
Pekka Paalanen44ab69c2012-02-07 13:18:00 +0200656 */
657
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500658struct weston_surface {
Jason Ekstrand26ed73c2013-06-06 22:34:41 -0500659 struct wl_resource *resource;
660 struct wl_signal destroy_signal;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500661 struct weston_compositor *compositor;
Kristian Høgsberg6ddcdae2012-02-28 22:31:58 -0500662 pixman_region32_t clip;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500663 pixman_region32_t damage;
Pekka Paalanenc3ce7382013-03-08 14:56:49 +0200664 pixman_region32_t opaque; /* part of geometry, see below */
Kristian Høgsberg5e7e6f22012-02-23 16:11:59 -0500665 pixman_region32_t input;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500666 struct wl_list link;
Kristian Høgsberg3be2ce92012-02-29 12:42:35 -0500667 struct wl_list layer_link;
Pekka Paalanenc3ce7382013-03-08 14:56:49 +0200668 float alpha; /* part of geometry, see below */
Kristian Høgsberg65a11e12012-08-03 11:30:18 -0400669 struct weston_plane *plane;
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500670
John Kåre Alsaker878f4492012-11-13 19:10:23 +0100671 void *renderer_state;
672
Pekka Paalanenbc0b7e72012-01-24 09:53:37 +0200673 /* Surface geometry state, mutable.
Pekka Paalanenc3ce7382013-03-08 14:56:49 +0200674 * If you change anything, call weston_surface_geometry_dirty().
Pekka Paalanenbc0b7e72012-01-24 09:53:37 +0200675 * That includes the transformations referenced from the list.
676 */
Pekka Paalanenc61eca62012-01-06 14:10:06 +0200677 struct {
John Kåre Alsaker490d02a2012-09-30 02:57:21 +0200678 float x, y; /* surface translation on display */
Pekka Paalanen60921e52012-01-25 15:55:43 +0200679 int32_t width, height;
Pekka Paalanenba3cf952012-01-25 16:22:05 +0200680
Pekka Paalanenbc0b7e72012-01-24 09:53:37 +0200681 /* struct weston_transform */
682 struct wl_list transformation_list;
Pekka Paalanen483243f2013-03-08 14:56:50 +0200683
684 /* managed by weston_surface_set_transform_parent() */
685 struct weston_surface *parent;
686 struct wl_listener parent_destroy_listener;
687 struct wl_list child_list; /* geometry.parent_link */
688 struct wl_list parent_link;
Pekka Paalanenbc0b7e72012-01-24 09:53:37 +0200689 } geometry;
690
691 /* State derived from geometry state, read-only.
692 * This is updated by weston_surface_update_transform().
693 */
694 struct {
Pekka Paalanenc3ce7382013-03-08 14:56:49 +0200695 int dirty;
696
Pekka Paalanen6720d8f2012-01-25 15:17:40 +0200697 pixman_region32_t boundingbox;
Pekka Paalanen730d87e2012-02-09 16:39:38 +0200698 pixman_region32_t opaque;
Pekka Paalanen6720d8f2012-01-25 15:17:40 +0200699
Pekka Paalanenbc0b7e72012-01-24 09:53:37 +0200700 /* matrix and inverse are used only if enabled = 1.
701 * If enabled = 0, use x, y, width, height directly.
702 */
703 int enabled;
Pekka Paalanen061b7472012-01-12 15:00:57 +0200704 struct weston_matrix matrix;
Pekka Paalanend1f0ab62012-01-20 10:47:57 +0200705 struct weston_matrix inverse;
Pekka Paalanencd403622012-01-25 13:37:39 +0200706
707 struct weston_transform position; /* matrix from x, y */
Pekka Paalanenc61eca62012-01-06 14:10:06 +0200708 } transform;
709
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500710 /*
711 * Which output to vsync this surface to.
712 * Used to determine, whether to send or queue frame events.
713 * Must be NULL, if 'link' is not in weston_compositor::surface_list.
714 */
715 struct weston_output *output;
716
Casey Dahlin9074db52012-04-19 22:50:09 -0400717 /*
718 * A more complete representation of all outputs this surface is
719 * displayed on.
720 */
721 uint32_t output_mask;
722
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500723 struct wl_list frame_callback_list;
724
Pekka Paalanende685b82012-12-04 15:58:12 +0200725 struct weston_buffer_reference buffer_ref;
Ander Conselvan de Oliveira012b4c72012-11-27 17:03:42 +0200726 uint32_t buffer_transform;
Alexander Larssonedddbd12013-05-24 13:09:43 +0200727 int32_t buffer_scale;
Pekka Paalanenccfeae22012-12-04 15:58:14 +0200728 int keep_buffer; /* bool for backends to prevent early release */
Alex Wu8811bf92012-02-28 18:07:54 +0800729
Pekka Paalanen5df44de2012-10-10 12:49:23 +0300730 /* All the pending state, that wl_surface.commit will apply. */
731 struct {
732 /* wl_surface.attach */
Giulio Camuffo184df502013-02-21 11:29:21 +0100733 int newly_attached;
Pekka Paalanen5df44de2012-10-10 12:49:23 +0300734 struct wl_buffer *buffer;
735 struct wl_listener buffer_destroy_listener;
736 int32_t sx;
737 int32_t sy;
Pekka Paalanen8e159182012-10-10 12:49:25 +0300738
739 /* wl_surface.damage */
740 pixman_region32_t damage;
Pekka Paalanen512dde82012-10-10 12:49:27 +0300741
742 /* wl_surface.set_opaque_region */
743 pixman_region32_t opaque;
Pekka Paalanen0cbd3b52012-10-10 12:49:28 +0300744
745 /* wl_surface.set_input_region */
746 pixman_region32_t input;
Pekka Paalanenbc106382012-10-10 12:49:31 +0300747
748 /* wl_surface.frame */
749 struct wl_list frame_callback_list;
Ander Conselvan de Oliveira012b4c72012-11-27 17:03:42 +0200750
751 /* wl_surface.set_buffer_transform */
752 uint32_t buffer_transform;
Alexander Larsson4ea95522013-05-22 14:41:37 +0200753
754 /* wl_surface.set_scaling_factor */
Alexander Larssonedddbd12013-05-24 13:09:43 +0200755 int32_t buffer_scale;
Pekka Paalanen5df44de2012-10-10 12:49:23 +0300756 } pending;
757
Ander Conselvan de Oliveira093bfa32012-03-27 17:36:41 +0300758 /*
759 * If non-NULL, this function will be called on surface::attach after
760 * a new buffer has been set up for this surface. The integer params
761 * are the sx and sy paramerters supplied to surface::attach .
762 */
Giulio Camuffo184df502013-02-21 11:29:21 +0100763 void (*configure)(struct weston_surface *es, int32_t sx, int32_t sy, int32_t width, int32_t height);
Giulio Camuffo7fe01b12013-03-28 18:02:42 +0100764 void *configure_private;
Pekka Paalanene67858b2013-04-25 13:57:42 +0300765
766 /* Parent's list of its sub-surfaces, weston_subsurface:parent_link.
767 * Contains also the parent itself as a dummy weston_subsurface,
768 * if the list is not empty.
769 */
770 struct wl_list subsurface_list; /* weston_subsurface::parent_link */
771 struct wl_list subsurface_list_pending; /* ...::parent_link_pending */
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500772};
773
Daniel Stoned6da09e2012-06-22 13:21:29 +0100774enum weston_key_state_update {
775 STATE_UPDATE_AUTOMATIC,
776 STATE_UPDATE_NONE,
777};
778
Kristian Høgsberg9ddb8262012-01-04 21:30:29 -0500779void
Kristian Høgsbergaf4f2aa2013-02-15 20:53:20 -0500780weston_version(int *major, int *minor, int *micro);
781
782void
Pekka Paalanen460099f2012-01-20 16:48:25 +0200783weston_surface_update_transform(struct weston_surface *surface);
784
785void
Pekka Paalanenc3ce7382013-03-08 14:56:49 +0200786weston_surface_geometry_dirty(struct weston_surface *surface);
787
788void
Daniel Stonebd3489b2012-05-08 17:17:53 +0100789weston_surface_to_global_fixed(struct weston_surface *surface,
790 wl_fixed_t sx, wl_fixed_t sy,
791 wl_fixed_t *x, wl_fixed_t *y);
792void
Ander Conselvan de Oliveirafbf28942012-03-27 17:36:37 +0300793weston_surface_to_global_float(struct weston_surface *surface,
John Kåre Alsaker490d02a2012-09-30 02:57:21 +0200794 float sx, float sy, float *x, float *y);
Pekka Paalanene0f3cb22012-01-24 09:59:29 +0200795
796void
Kristian Høgsbergecf6ede2012-09-05 21:59:35 -0400797weston_surface_from_global_float(struct weston_surface *surface,
John Kåre Alsaker490d02a2012-09-30 02:57:21 +0200798 float x, float y, float *sx, float *sy);
Kristian Høgsbergecf6ede2012-09-05 21:59:35 -0400799void
Pekka Paalanene0f3cb22012-01-24 09:59:29 +0200800weston_surface_from_global(struct weston_surface *surface,
801 int32_t x, int32_t y, int32_t *sx, int32_t *sy);
Daniel Stonebd3489b2012-05-08 17:17:53 +0100802void
803weston_surface_from_global_fixed(struct weston_surface *surface,
804 wl_fixed_t x, wl_fixed_t y,
805 wl_fixed_t *sx, wl_fixed_t *sy);
Ander Conselvan de Oliveira012b4c72012-11-27 17:03:42 +0200806int32_t
807weston_surface_buffer_width(struct weston_surface *surface);
808int32_t
809weston_surface_buffer_height(struct weston_surface *surface);
Pekka Paalanene0f3cb22012-01-24 09:59:29 +0200810
Ander Conselvan de Oliveira0396ba22012-11-28 17:10:26 +0200811WL_EXPORT void
812weston_surface_to_buffer_float(struct weston_surface *surface,
813 float x, float y, float *bx, float *by);
Alexander Larsson4ea95522013-05-22 14:41:37 +0200814WL_EXPORT void
815weston_surface_to_buffer(struct weston_surface *surface,
816 int sx, int sy, int *bx, int *by);
817
Ander Conselvan de Oliveira0396ba22012-11-28 17:10:26 +0200818pixman_box32_t
819weston_surface_to_buffer_rect(struct weston_surface *surface,
820 pixman_box32_t rect);
821
Pekka Paalanene0f3cb22012-01-24 09:59:29 +0200822void
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500823weston_spring_init(struct weston_spring *spring,
824 double k, double current, double target);
825void
826weston_spring_update(struct weston_spring *spring, uint32_t msec);
827int
828weston_spring_done(struct weston_spring *spring);
829
830void
831weston_surface_activate(struct weston_surface *surface,
Daniel Stone37816df2012-05-16 18:45:18 +0100832 struct weston_seat *seat);
Kristian Høgsberg68c479a2012-01-25 23:32:28 -0500833void
Kristian Høgsbergcb3eaae2012-08-10 09:50:11 -0400834notify_motion(struct weston_seat *seat, uint32_t time,
Rob Bradfordc088e2c2013-03-27 15:59:43 +0000835 wl_fixed_t dx, wl_fixed_t dy);
836void
837notify_motion_absolute(struct weston_seat *seat, uint32_t time,
838 wl_fixed_t x, wl_fixed_t y);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500839void
Kristian Høgsbergcb3eaae2012-08-10 09:50:11 -0400840notify_button(struct weston_seat *seat, uint32_t time, int32_t button,
Daniel Stone4dbadb12012-05-30 16:31:51 +0100841 enum wl_pointer_button_state state);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500842void
Kristian Høgsbergcb3eaae2012-08-10 09:50:11 -0400843notify_axis(struct weston_seat *seat, uint32_t time, uint32_t axis,
Daniel Stone878f0b72012-05-30 16:31:57 +0100844 wl_fixed_t value);
Scott Moreau210d0792012-03-22 10:47:01 -0600845void
Kristian Høgsbergcb3eaae2012-08-10 09:50:11 -0400846notify_key(struct weston_seat *seat, uint32_t time, uint32_t key,
Daniel Stone1b4e11f2012-06-22 13:21:37 +0100847 enum wl_keyboard_key_state state,
848 enum weston_key_state_update update_state);
Daniel Stone05d58682012-06-22 13:21:38 +0100849void
Kristian Høgsbergcb3eaae2012-08-10 09:50:11 -0400850notify_modifiers(struct weston_seat *seat, uint32_t serial);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500851
852void
Kristian Høgsbergcb3eaae2012-08-10 09:50:11 -0400853notify_pointer_focus(struct weston_seat *seat, struct weston_output *output,
Kristian Høgsberge11bbe42012-05-09 12:19:04 -0400854 wl_fixed_t x, wl_fixed_t y);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500855
856void
Kristian Høgsbergcb3eaae2012-08-10 09:50:11 -0400857notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys,
Daniel Stoned6da09e2012-06-22 13:21:29 +0100858 enum weston_key_state_update update_state);
859void
Kristian Høgsbergcb3eaae2012-08-10 09:50:11 -0400860notify_keyboard_focus_out(struct weston_seat *seat);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500861
862void
Kristian Høgsbergcb3eaae2012-08-10 09:50:11 -0400863notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
Kristian Høgsberge11bbe42012-05-09 12:19:04 -0400864 wl_fixed_t x, wl_fixed_t y, int touch_type);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500865
866void
Kristian Høgsberg3be2ce92012-02-29 12:42:35 -0500867weston_layer_init(struct weston_layer *layer, struct wl_list *below);
868
869void
Kristian Høgsberg65a11e12012-08-03 11:30:18 -0400870weston_plane_init(struct weston_plane *plane, int32_t x, int32_t y);
871void
872weston_plane_release(struct weston_plane *plane);
873
874void
Ander Conselvan de Oliveira8ad19822013-03-05 17:30:27 +0200875weston_compositor_stack_plane(struct weston_compositor *ec,
876 struct weston_plane *plane,
877 struct weston_plane *above);
878
879void
Rob Bradford0fb79752012-08-02 15:36:57 +0100880weston_output_finish_frame(struct weston_output *output, uint32_t msecs);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500881void
Kristian Høgsberg49952d12012-06-20 00:35:59 -0400882weston_output_schedule_repaint(struct weston_output *output);
883void
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500884weston_output_damage(struct weston_output *output);
885void
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500886weston_compositor_schedule_repaint(struct weston_compositor *compositor);
887void
888weston_compositor_fade(struct weston_compositor *compositor, float tint);
889void
890weston_compositor_damage_all(struct weston_compositor *compositor);
891void
892weston_compositor_unlock(struct weston_compositor *compositor);
893void
894weston_compositor_wake(struct weston_compositor *compositor);
895void
Philipp Brüschweiler57edf7f2013-03-29 13:01:56 +0100896weston_compositor_offscreen(struct weston_compositor *compositor);
897void
Ander Conselvan de Oliveira87524b62013-02-21 18:35:22 +0200898weston_compositor_sleep(struct weston_compositor *compositor);
Kristian Høgsbergb5e26102013-04-18 15:40:10 -0400899struct weston_surface *
900weston_compositor_pick_surface(struct weston_compositor *compositor,
901 wl_fixed_t x, wl_fixed_t y,
902 wl_fixed_t *sx, wl_fixed_t *sy);
Ander Conselvan de Oliveira30eebc72012-02-15 17:02:57 +0200903
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500904
905struct weston_binding;
Kristian Høgsberge3148752013-05-06 23:19:49 -0400906typedef void (*weston_key_binding_handler_t)(struct weston_seat *seat,
Daniel Stone325fc2d2012-05-30 16:31:58 +0100907 uint32_t time, uint32_t key,
908 void *data);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500909struct weston_binding *
Daniel Stone325fc2d2012-05-30 16:31:58 +0100910weston_compositor_add_key_binding(struct weston_compositor *compositor,
911 uint32_t key,
912 enum weston_keyboard_modifier modifier,
913 weston_key_binding_handler_t binding,
914 void *data);
915
Kristian Høgsberge3148752013-05-06 23:19:49 -0400916typedef void (*weston_button_binding_handler_t)(struct weston_seat *seat,
Daniel Stone325fc2d2012-05-30 16:31:58 +0100917 uint32_t time, uint32_t button,
918 void *data);
919struct weston_binding *
920weston_compositor_add_button_binding(struct weston_compositor *compositor,
921 uint32_t button,
922 enum weston_keyboard_modifier modifier,
923 weston_button_binding_handler_t binding,
924 void *data);
925
Kristian Høgsberge3148752013-05-06 23:19:49 -0400926typedef void (*weston_axis_binding_handler_t)(struct weston_seat *seat,
Daniel Stone325fc2d2012-05-30 16:31:58 +0100927 uint32_t time, uint32_t axis,
Daniel Stone0c1e46e2012-05-30 16:31:59 +0100928 wl_fixed_t value, void *data);
Daniel Stone325fc2d2012-05-30 16:31:58 +0100929struct weston_binding *
930weston_compositor_add_axis_binding(struct weston_compositor *compositor,
931 uint32_t axis,
932 enum weston_keyboard_modifier modifier,
933 weston_axis_binding_handler_t binding,
934 void *data);
Ander Conselvan de Oliveirac509d2b2012-11-08 17:20:45 +0200935struct weston_binding *
936weston_compositor_add_debug_binding(struct weston_compositor *compositor,
937 uint32_t key,
938 weston_key_binding_handler_t binding,
939 void *data);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500940void
941weston_binding_destroy(struct weston_binding *binding);
942
943void
Kristian Høgsberg3466bc82012-01-03 11:29:15 -0500944weston_binding_list_destroy_all(struct wl_list *list);
945
946void
Daniel Stone325fc2d2012-05-30 16:31:58 +0100947weston_compositor_run_key_binding(struct weston_compositor *compositor,
948 struct weston_seat *seat, uint32_t time,
949 uint32_t key,
950 enum wl_keyboard_key_state state);
951void
952weston_compositor_run_button_binding(struct weston_compositor *compositor,
953 struct weston_seat *seat, uint32_t time,
954 uint32_t button,
955 enum wl_pointer_button_state value);
Rune K. Svendsen14b2fe72013-03-07 21:50:00 +0100956int
Daniel Stone325fc2d2012-05-30 16:31:58 +0100957weston_compositor_run_axis_binding(struct weston_compositor *compositor,
958 struct weston_seat *seat, uint32_t time,
959 uint32_t axis, int32_t value);
Ander Conselvan de Oliveirac509d2b2012-11-08 17:20:45 +0200960int
961weston_compositor_run_debug_binding(struct weston_compositor *compositor,
962 struct weston_seat *seat, uint32_t time,
963 uint32_t key,
964 enum wl_keyboard_key_state state);
Daniel Stone325fc2d2012-05-30 16:31:58 +0100965
Benjamin Franzkebfeda132012-01-30 14:04:04 +0100966int
967weston_environment_get_fd(const char *env);
968
Kristian Høgsberga82c4862012-01-26 01:03:58 -0500969struct wl_list *
970weston_compositor_top(struct weston_compositor *compositor);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500971
972struct weston_surface *
Kristian Høgsberg18c93002012-01-27 11:58:31 -0500973weston_surface_create(struct weston_compositor *compositor);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500974
975void
976weston_surface_configure(struct weston_surface *surface,
John Kåre Alsaker490d02a2012-09-30 02:57:21 +0200977 float x, float y, int width, int height);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500978
979void
Kristian Høgsberg3be2ce92012-02-29 12:42:35 -0500980weston_surface_restack(struct weston_surface *surface, struct wl_list *below);
981
982void
Pekka Paalanen8fb8d3b2012-02-13 13:03:59 +0200983weston_surface_set_position(struct weston_surface *surface,
John Kåre Alsaker490d02a2012-09-30 02:57:21 +0200984 float x, float y);
Pekka Paalanen8fb8d3b2012-02-13 13:03:59 +0200985
Pekka Paalanen483243f2013-03-08 14:56:50 +0200986void
987weston_surface_set_transform_parent(struct weston_surface *surface,
988 struct weston_surface *parent);
989
Ander Conselvan de Oliveirab8ab14f2012-03-27 17:36:36 +0300990int
991weston_surface_is_mapped(struct weston_surface *surface);
992
Pekka Paalanen8fb8d3b2012-02-13 13:03:59 +0200993void
Kristian Høgsberg98238702012-08-03 16:29:12 -0400994weston_surface_schedule_repaint(struct weston_surface *surface);
995
996void
Kristian Høgsberg8334bc12012-01-03 10:29:47 -0500997weston_surface_damage(struct weston_surface *surface);
998
999void
Kristian Høgsbergd8bf90c2012-02-23 23:03:14 -05001000weston_surface_damage_below(struct weston_surface *surface);
1001
1002void
Kristian Høgsberg65a11e12012-08-03 11:30:18 -04001003weston_surface_move_to_plane(struct weston_surface *surface,
1004 struct weston_plane *plane);
1005void
Kristian Høgsbergaf7b1ff2012-06-26 21:19:23 -04001006weston_surface_unmap(struct weston_surface *surface);
1007
Pekka Paalanen01388e22013-04-25 13:57:44 +03001008struct weston_surface *
1009weston_surface_get_main_surface(struct weston_surface *surface);
1010
Kristian Høgsbergaf7b1ff2012-06-26 21:19:23 -04001011void
Pekka Paalanende685b82012-12-04 15:58:12 +02001012weston_buffer_reference(struct weston_buffer_reference *ref,
1013 struct wl_buffer *buffer);
1014
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001015uint32_t
1016weston_compositor_get_time(void);
1017
1018int
Daniel Stonebaf43592012-06-01 11:11:10 -04001019weston_compositor_init(struct weston_compositor *ec, struct wl_display *display,
Kristian Høgsberg14e438c2013-05-26 21:48:14 -04001020 int *argc, char *argv[], struct weston_config *config);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001021void
1022weston_compositor_shutdown(struct weston_compositor *ec);
1023void
Scott Moreauae712202012-06-01 12:46:09 -06001024weston_text_cursor_position_notify(struct weston_surface *surface,
1025 wl_fixed_t x, wl_fixed_t y);
Scott Moreau7a1b32a2012-05-27 14:25:02 -06001026void
Scott Moreau429490d2012-06-17 18:10:59 -06001027weston_output_init_zoom(struct weston_output *output);
1028void
Scott Moreau8dacaab2012-06-17 18:10:58 -06001029weston_output_update_zoom(struct weston_output *output, uint32_t type);
Scott Moreauccbf29d2012-02-22 14:21:41 -07001030void
1031weston_output_update_matrix(struct weston_output *output);
1032void
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001033weston_output_move(struct weston_output *output, int x, int y);
1034void
1035weston_output_init(struct weston_output *output, struct weston_compositor *c,
Alexander Larssonedddbd12013-05-24 13:09:43 +02001036 int x, int y, int width, int height, uint32_t transform, int32_t scale);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001037void
1038weston_output_destroy(struct weston_output *output);
1039
1040void
Rob Bradford9af5f9e2013-05-31 18:09:50 +01001041weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
1042 const char *seat_name);
Daniel Stone74419a22012-05-30 16:32:02 +01001043void
1044weston_seat_init_pointer(struct weston_seat *seat);
Kristian Høgsberg2f07ef62013-02-16 14:29:24 -05001045int
Daniel Stonebb1df6a2012-05-30 16:32:06 +01001046weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
Daniel Stone74419a22012-05-30 16:32:02 +01001047void
1048weston_seat_init_touch(struct weston_seat *seat);
Kristian Høgsbergb5e26102013-04-18 15:40:10 -04001049void
Kristian Høgsberga71e8b22013-05-06 21:51:21 -04001050weston_seat_repick(struct weston_seat *seat);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001051
1052void
Daniel Stone37816df2012-05-16 18:45:18 +01001053weston_seat_release(struct weston_seat *seat);
Kristian Høgsbergb5e26102013-04-18 15:40:10 -04001054int
1055weston_compositor_xkb_init(struct weston_compositor *ec,
1056 struct xkb_rule_names *names);
1057void
1058weston_compositor_xkb_destroy(struct weston_compositor *ec);
Kristian Høgsberg3466bc82012-01-03 11:29:15 -05001059
Kristian Høgsberg64eca892012-08-01 00:00:57 -04001060/* String literal of spaces, the same width as the timestamp. */
1061#define STAMP_SPACE " "
1062
1063void
1064weston_log_file_open(const char *filename);
1065void
1066weston_log_file_close(void);
1067int
Pekka Paalanend525b562012-08-06 14:57:04 +03001068weston_log(const char *fmt, ...)
1069 __attribute__ ((format (printf, 1, 2)));
Kristian Høgsberg64eca892012-08-01 00:00:57 -04001070int
Pekka Paalanend525b562012-08-06 14:57:04 +03001071weston_log_continue(const char *fmt, ...)
1072 __attribute__ ((format (printf, 1, 2)));
Kristian Høgsberg64eca892012-08-01 00:00:57 -04001073
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001074enum {
1075 TTY_ENTER_VT,
1076 TTY_LEAVE_VT
1077};
1078
1079typedef void (*tty_vt_func_t)(struct weston_compositor *compositor, int event);
1080
1081struct tty *
1082tty_create(struct weston_compositor *compositor,
1083 tty_vt_func_t vt_func, int tty_nr);
1084
1085void
1086tty_destroy(struct tty *tty);
1087
Kristian Høgsberg7b884bc2012-07-31 14:32:01 -04001088void
1089tty_reset(struct tty *tty);
1090
Kristian Høgsberg5d1c0c52012-04-10 00:11:50 -04001091int
1092tty_activate_vt(struct tty *tty, int vt);
1093
Kristian Høgsberg3466bc82012-01-03 11:29:15 -05001094void
Kristian Høgsberg02e79dc2012-04-12 09:55:26 -04001095screenshooter_create(struct weston_compositor *ec);
Kristian Høgsberg3466bc82012-01-03 11:29:15 -05001096
Kristian Høgsberga7ceaff2012-06-03 10:20:13 -04001097struct clipboard *
1098clipboard_create(struct weston_seat *seat);
1099
Scott Moreau7a1b32a2012-05-27 14:25:02 -06001100void
1101text_cursor_position_notifier_create(struct weston_compositor *ec);
1102
Jan Arne Petersen674fd1d2012-11-18 19:06:42 +01001103int
1104text_backend_init(struct weston_compositor *ec);
Jan Arne Petersen1f17be42012-06-21 21:52:18 +02001105
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001106struct weston_process;
1107typedef void (*weston_process_cleanup_func_t)(struct weston_process *process,
1108 int status);
1109
1110struct weston_process {
1111 pid_t pid;
1112 weston_process_cleanup_func_t cleanup;
1113 struct wl_list link;
1114};
1115
1116struct wl_client *
1117weston_client_launch(struct weston_compositor *compositor,
1118 struct weston_process *proc,
1119 const char *path,
1120 weston_process_cleanup_func_t cleanup);
1121
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001122void
1123weston_watch_process(struct weston_process *process);
1124
Kristian Høgsberg414bd422012-06-21 22:07:30 -04001125struct weston_surface_animation;
1126typedef void (*weston_surface_animation_done_func_t)(struct weston_surface_animation *animation, void *data);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001127
Kristian Høgsberg414bd422012-06-21 22:07:30 -04001128struct weston_surface_animation *
John Kåre Alsaker490d02a2012-09-30 02:57:21 +02001129weston_zoom_run(struct weston_surface *surface, float start, float stop,
Kristian Høgsberg414bd422012-06-21 22:07:30 -04001130 weston_surface_animation_done_func_t done, void *data);
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001131
Kristian Høgsberg414bd422012-06-21 22:07:30 -04001132struct weston_surface_animation *
Juan Zhaoe10d2792012-04-25 19:09:52 +08001133weston_fade_run(struct weston_surface *surface,
Ander Conselvan de Oliveiraee416052013-02-21 18:35:17 +02001134 float start, float end, float k,
Kristian Høgsberg414bd422012-06-21 22:07:30 -04001135 weston_surface_animation_done_func_t done, void *data);
Ander Conselvan de Oliveiraee416052013-02-21 18:35:17 +02001136void
1137weston_fade_update(struct weston_surface_animation *fade,
1138 float start, float end, float k);
1139
Kristian Høgsberg1ce6a2a2012-06-21 22:34:39 -04001140struct weston_surface_animation *
John Kåre Alsaker490d02a2012-09-30 02:57:21 +02001141weston_slide_run(struct weston_surface *surface, float start, float stop,
Kristian Høgsberg1ce6a2a2012-06-21 22:34:39 -04001142 weston_surface_animation_done_func_t done, void *data);
Juan Zhaoe10d2792012-04-25 19:09:52 +08001143
Alex Wu8811bf92012-02-28 18:07:54 +08001144void
1145weston_surface_set_color(struct weston_surface *surface,
John Kåre Alsaker490d02a2012-09-30 02:57:21 +02001146 float red, float green, float blue, float alpha);
Alex Wu8811bf92012-02-28 18:07:54 +08001147
1148void
1149weston_surface_destroy(struct weston_surface *surface);
1150
Alex Wu2dda6042012-04-17 17:20:47 +08001151int
Alexander Larsson355748e2013-05-28 16:23:38 +02001152weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode, int32_t scale);
Alex Wu2dda6042012-04-17 17:20:47 +08001153
Ander Conselvan de Oliveira11f8d402012-10-29 18:19:24 +02001154int
1155noop_renderer_init(struct weston_compositor *ec);
Ander Conselvan de Oliveira11f8d402012-10-29 18:19:24 +02001156
Kristian Høgsbergb00a9d32012-09-11 14:06:27 -04001157struct weston_compositor *
Kristian Høgsberg4172f662013-02-20 15:27:49 -05001158backend_init(struct wl_display *display, int *argc, char *argv[],
Kristian Høgsberg14e438c2013-05-26 21:48:14 -04001159 struct weston_config *config);
Kristian Høgsbergb00a9d32012-09-11 14:06:27 -04001160
1161int
Kristian Høgsbergcb4685b2013-02-20 15:37:49 -05001162module_init(struct weston_compositor *compositor,
Ossama Othmana50e6e42013-05-14 09:48:26 -07001163 int *argc, char *argv[]);
Kristian Høgsbergb00a9d32012-09-11 14:06:27 -04001164
Ander Conselvan de Oliveira409eebf2012-12-05 15:14:04 +02001165void
1166weston_transformed_coord(int width, int height,
1167 enum wl_output_transform transform,
Alexander Larssonedddbd12013-05-24 13:09:43 +02001168 int32_t scale,
Ander Conselvan de Oliveira409eebf2012-12-05 15:14:04 +02001169 float sx, float sy, float *bx, float *by);
1170pixman_box32_t
1171weston_transformed_rect(int width, int height,
1172 enum wl_output_transform transform,
Alexander Larssonedddbd12013-05-24 13:09:43 +02001173 int32_t scale,
Ander Conselvan de Oliveira409eebf2012-12-05 15:14:04 +02001174 pixman_box32_t rect);
1175
Giulio Camuffo7fe01b12013-03-28 18:02:42 +01001176#ifdef __cplusplus
1177}
1178#endif
1179
Kristian Høgsberg8334bc12012-01-03 10:29:47 -05001180#endif