2 * Copyright © 2008-2011 Kristian Høgsberg
3 * Copyright © 2012 Collabora, Ltd.
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial
15 * portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 #ifndef _WAYLAND_SYSTEM_COMPOSITOR_H_
28 #define _WAYLAND_SYSTEM_COMPOSITOR_H_
38 #include <xkbcommon/xkbcommon.h>
40 #define WL_HIDE_DEPRECATED
41 #include <wayland-server.h>
45 #include "config-parser.h"
47 #include "timeline-object.h"
49 struct weston_transform {
50 struct weston_matrix matrix;
54 struct weston_surface;
60 struct weston_pointer;
61 struct linux_dmabuf_buffer;
62 struct weston_recorder;
63 struct weston_pointer_constraint;
65 enum weston_keyboard_modifier {
66 MODIFIER_CTRL = (1 << 0),
67 MODIFIER_ALT = (1 << 1),
68 MODIFIER_SUPER = (1 << 2),
69 MODIFIER_SHIFT = (1 << 3),
72 enum weston_keyboard_locks {
73 WESTON_NUM_LOCK = (1 << 0),
74 WESTON_CAPS_LOCK = (1 << 1),
78 LED_NUM_LOCK = (1 << 0),
79 LED_CAPS_LOCK = (1 << 1),
80 LED_SCROLL_LOCK = (1 << 2),
85 int32_t width, height;
90 struct weston_shell_client {
91 void (*send_configure)(struct weston_surface *surface, int32_t width, int32_t height);
92 void (*send_position)(struct weston_surface *surface, int32_t x, int32_t y);
95 struct weston_shell_interface {
96 void *shell; /* either desktop or tablet */
98 struct shell_surface *(*create_shell_surface)(void *shell,
99 struct weston_surface *surface,
100 const struct weston_shell_client *client);
101 void (*set_toplevel)(struct shell_surface *shsurf);
103 void (*set_transient)(struct shell_surface *shsurf,
104 struct weston_surface *parent,
105 int x, int y, uint32_t flags);
106 void (*set_fullscreen)(struct shell_surface *shsurf,
109 struct weston_output *output);
110 void (*set_xwayland)(struct shell_surface *shsurf,
111 int x, int y, uint32_t flags);
112 int (*move)(struct shell_surface *shsurf, struct weston_pointer *pointer);
113 int (*resize)(struct shell_surface *shsurf,
114 struct weston_pointer *pointer, uint32_t edges);
115 void (*set_title)(struct shell_surface *shsurf,
117 void (*set_window_geometry)(struct shell_surface *shsurf,
118 int32_t x, int32_t y,
119 int32_t width, int32_t height);
120 void (*set_maximized)(struct shell_surface *shsurf);
121 void (*set_pid)(struct shell_surface *shsurf, pid_t pid);
122 void (*get_output_work_area)(void *shell, struct weston_output *output, pixman_rectangle32_t *area);
125 struct weston_animation {
126 void (*frame)(struct weston_animation *animation,
127 struct weston_output *output, uint32_t msecs);
133 WESTON_SPRING_OVERSHOOT,
138 struct weston_spring {
149 struct weston_output_zoom {
154 float trans_x, trans_y;
158 struct weston_seat *seat;
159 struct weston_animation animation_z;
160 struct weston_spring spring_z;
161 struct wl_listener motion_listener;
164 /* bit compatible with drm definitions. */
172 struct weston_output {
176 void *renderer_state;
179 struct wl_list resource_list;
180 struct wl_global *global;
181 struct weston_compositor *compositor;
183 /** From global to output buffer coordinates. */
184 struct weston_matrix matrix;
185 /** From output buffer to global coordinates. */
186 struct weston_matrix inverse_matrix;
188 struct wl_list animation_list;
189 int32_t x, y, width, height;
190 int32_t mm_width, mm_height;
192 /** Output area in global coordinates, simple rect */
193 pixman_region32_t region;
195 pixman_region32_t previous_damage;
197 int repaint_scheduled;
198 struct wl_event_source *repaint_timer;
199 struct weston_output_zoom zoom;
201 struct wl_signal frame_signal;
202 struct wl_signal destroy_signal;
204 uint32_t frame_time; /* presentation timestamp in milliseconds */
205 uint64_t msc; /* media stream counter */
208 struct wl_list feedback_list;
210 char *make, *model, *serial_number;
213 int32_t native_scale;
214 int32_t current_scale;
215 int32_t original_scale;
217 struct weston_mode *native_mode;
218 struct weston_mode *current_mode;
219 struct weston_mode *original_mode;
220 struct wl_list mode_list;
222 void (*start_repaint_loop)(struct weston_output *output);
223 int (*repaint)(struct weston_output *output,
224 pixman_region32_t *damage);
225 void (*destroy)(struct weston_output *output);
226 void (*assign_planes)(struct weston_output *output);
227 int (*switch_mode)(struct weston_output *output, struct weston_mode *mode);
229 /* backlight values are on 0-255 range, where higher is brighter */
230 int32_t backlight_current;
231 void (*set_backlight)(struct weston_output *output, uint32_t value);
232 void (*set_dpms)(struct weston_output *output, enum dpms_enum level);
234 int connection_internal;
236 void (*set_gamma)(struct weston_output *output,
242 struct weston_timeline_object timeline;
245 enum weston_pointer_motion_mask {
246 WESTON_POINTER_MOTION_ABS = 1 << 0,
247 WESTON_POINTER_MOTION_REL = 1 << 1,
248 WESTON_POINTER_MOTION_REL_UNACCEL = 1 << 2,
251 struct weston_pointer_motion_event {
262 struct weston_pointer_axis_event {
269 struct weston_pointer_grab;
270 struct weston_pointer_grab_interface {
271 void (*focus)(struct weston_pointer_grab *grab);
272 void (*motion)(struct weston_pointer_grab *grab, uint32_t time,
273 struct weston_pointer_motion_event *event);
274 void (*button)(struct weston_pointer_grab *grab,
275 uint32_t time, uint32_t button, uint32_t state);
276 void (*axis)(struct weston_pointer_grab *grab,
278 struct weston_pointer_axis_event *event);
279 void (*axis_source)(struct weston_pointer_grab *grab, uint32_t source);
280 void (*frame)(struct weston_pointer_grab *grab);
281 void (*cancel)(struct weston_pointer_grab *grab);
284 struct weston_pointer_grab {
285 const struct weston_pointer_grab_interface *interface;
286 struct weston_pointer *pointer;
289 struct weston_keyboard_grab;
290 struct weston_keyboard_grab_interface {
291 void (*key)(struct weston_keyboard_grab *grab, uint32_t time,
292 uint32_t key, uint32_t state);
293 void (*modifiers)(struct weston_keyboard_grab *grab, uint32_t serial,
294 uint32_t mods_depressed, uint32_t mods_latched,
295 uint32_t mods_locked, uint32_t group);
296 void (*cancel)(struct weston_keyboard_grab *grab);
299 struct weston_keyboard_grab {
300 const struct weston_keyboard_grab_interface *interface;
301 struct weston_keyboard *keyboard;
304 struct weston_touch_grab;
305 struct weston_touch_grab_interface {
306 void (*down)(struct weston_touch_grab *grab,
311 void (*up)(struct weston_touch_grab *grab,
314 void (*motion)(struct weston_touch_grab *grab,
319 void (*frame)(struct weston_touch_grab *grab);
320 void (*cancel)(struct weston_touch_grab *grab);
323 struct weston_touch_grab {
324 const struct weston_touch_grab_interface *interface;
325 struct weston_touch *touch;
328 struct weston_data_offer {
329 struct wl_resource *resource;
330 struct weston_data_source *source;
331 struct wl_listener source_destroy_listener;
332 uint32_t dnd_actions;
333 enum wl_data_device_manager_dnd_action preferred_dnd_action;
337 struct weston_data_source {
338 struct wl_resource *resource;
339 struct wl_signal destroy_signal;
340 struct wl_array mime_types;
341 struct weston_data_offer *offer;
342 struct weston_seat *seat;
345 uint32_t dnd_actions;
346 enum wl_data_device_manager_dnd_action current_dnd_action;
347 enum wl_data_device_manager_dnd_action compositor_action;
349 void (*accept)(struct weston_data_source *source,
350 uint32_t serial, const char *mime_type);
351 void (*send)(struct weston_data_source *source,
352 const char *mime_type, int32_t fd);
353 void (*cancel)(struct weston_data_source *source);
356 struct weston_pointer_client {
358 struct wl_client *client;
359 struct wl_list pointer_resources;
360 struct wl_list relative_pointer_resources;
363 struct weston_pointer {
364 struct weston_seat *seat;
366 struct wl_list pointer_clients;
368 struct weston_view *focus;
369 struct weston_pointer_client *focus_client;
370 uint32_t focus_serial;
371 struct wl_listener focus_view_listener;
372 struct wl_listener focus_resource_listener;
373 struct wl_signal focus_signal;
374 struct wl_signal motion_signal;
375 struct wl_signal destroy_signal;
377 struct weston_view *sprite;
378 struct wl_listener sprite_destroy_listener;
379 int32_t hotspot_x, hotspot_y;
381 struct weston_pointer_grab *grab;
382 struct weston_pointer_grab default_grab;
383 wl_fixed_t grab_x, grab_y;
384 uint32_t grab_button;
385 uint32_t grab_serial;
390 uint32_t button_count;
392 struct wl_listener output_destroy_listener;
396 struct weston_touch {
397 struct weston_seat *seat;
399 struct wl_list resource_list;
400 struct wl_list focus_resource_list;
401 struct weston_view *focus;
402 struct wl_listener focus_view_listener;
403 struct wl_listener focus_resource_listener;
404 uint32_t focus_serial;
405 struct wl_signal focus_signal;
409 struct weston_touch_grab *grab;
410 struct weston_touch_grab default_grab;
412 wl_fixed_t grab_x, grab_y;
413 uint32_t grab_serial;
418 weston_pointer_motion_to_abs(struct weston_pointer *pointer,
419 struct weston_pointer_motion_event *event,
420 wl_fixed_t *x, wl_fixed_t *y);
422 struct weston_pointer *
423 weston_pointer_create(struct weston_seat *seat);
425 weston_pointer_destroy(struct weston_pointer *pointer);
427 weston_pointer_send_motion(struct weston_pointer *pointer, uint32_t time,
428 struct weston_pointer_motion_event *event);
430 weston_pointer_has_focus_resource(struct weston_pointer *pointer);
432 weston_pointer_send_button(struct weston_pointer *pointer,
433 uint32_t time, uint32_t button, uint32_t state_w);
435 weston_pointer_send_axis(struct weston_pointer *pointer,
437 struct weston_pointer_axis_event *event);
439 weston_pointer_send_axis_source(struct weston_pointer *pointer,
442 weston_pointer_send_frame(struct weston_pointer *pointer);
445 weston_pointer_set_focus(struct weston_pointer *pointer,
446 struct weston_view *view,
447 wl_fixed_t sx, wl_fixed_t sy);
449 weston_pointer_clear_focus(struct weston_pointer *pointer);
451 weston_pointer_start_grab(struct weston_pointer *pointer,
452 struct weston_pointer_grab *grab);
454 weston_pointer_end_grab(struct weston_pointer *pointer);
456 weston_pointer_clamp(struct weston_pointer *pointer,
457 wl_fixed_t *fx, wl_fixed_t *fy);
459 weston_pointer_move(struct weston_pointer *pointer,
460 struct weston_pointer_motion_event *event);
462 weston_pointer_set_default_grab(struct weston_pointer *pointer,
463 const struct weston_pointer_grab_interface *interface);
466 weston_pointer_constraint_destroy(struct weston_pointer_constraint *constraint);
468 struct weston_keyboard *
469 weston_keyboard_create(void);
471 weston_keyboard_destroy(struct weston_keyboard *keyboard);
473 weston_keyboard_set_focus(struct weston_keyboard *keyboard,
474 struct weston_surface *surface);
476 weston_keyboard_start_grab(struct weston_keyboard *device,
477 struct weston_keyboard_grab *grab);
479 weston_keyboard_end_grab(struct weston_keyboard *keyboard);
482 * 'mask' and 'value' should be a bitwise mask of one or more
483 * valued of the weston_keyboard_locks enum.
485 weston_keyboard_set_locks(struct weston_keyboard *keyboard,
486 uint32_t mask, uint32_t value);
489 weston_keyboard_has_focus_resource(struct weston_keyboard *keyboard);
491 weston_keyboard_send_key(struct weston_keyboard *keyboard,
492 uint32_t time, uint32_t key,
493 enum wl_keyboard_key_state state);
495 weston_keyboard_send_modifiers(struct weston_keyboard *keyboard,
496 uint32_t serial, uint32_t mods_depressed,
497 uint32_t mods_latched,
498 uint32_t mods_locked, uint32_t group);
500 struct weston_touch *
501 weston_touch_create(void);
503 weston_touch_destroy(struct weston_touch *touch);
505 weston_touch_set_focus(struct weston_touch *touch,
506 struct weston_view *view);
508 weston_touch_start_grab(struct weston_touch *device,
509 struct weston_touch_grab *grab);
511 weston_touch_end_grab(struct weston_touch *touch);
514 weston_touch_has_focus_resource(struct weston_touch *touch);
516 weston_touch_send_down(struct weston_touch *touch, uint32_t time,
517 int touch_id, wl_fixed_t x, wl_fixed_t y);
519 weston_touch_send_up(struct weston_touch *touch, uint32_t time, int touch_id);
521 weston_touch_send_motion(struct weston_touch *touch, uint32_t time,
522 int touch_id, wl_fixed_t x, wl_fixed_t y);
524 weston_touch_send_frame(struct weston_touch *touch);
527 wl_data_device_set_keyboard_focus(struct weston_seat *seat);
530 wl_data_device_manager_init(struct wl_display *display);
534 weston_seat_set_selection(struct weston_seat *seat,
535 struct weston_data_source *source, uint32_t serial);
537 weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client);
540 weston_pointer_start_drag(struct weston_pointer *pointer,
541 struct weston_data_source *source,
542 struct weston_surface *icon,
543 struct wl_client *client);
545 weston_touch_start_drag(struct weston_touch *touch,
546 struct weston_data_source *source,
547 struct weston_surface *icon,
548 struct wl_client *client);
550 struct weston_xkb_info {
551 struct xkb_keymap *keymap;
556 xkb_mod_index_t shift_mod;
557 xkb_mod_index_t caps_mod;
558 xkb_mod_index_t ctrl_mod;
559 xkb_mod_index_t alt_mod;
560 xkb_mod_index_t mod2_mod;
561 xkb_mod_index_t mod3_mod;
562 xkb_mod_index_t super_mod;
563 xkb_mod_index_t mod5_mod;
564 xkb_led_index_t num_led;
565 xkb_led_index_t caps_led;
566 xkb_led_index_t scroll_led;
569 struct weston_keyboard {
570 struct weston_seat *seat;
572 struct wl_list resource_list;
573 struct wl_list focus_resource_list;
574 struct weston_surface *focus;
575 struct wl_listener focus_resource_listener;
576 uint32_t focus_serial;
577 struct wl_signal focus_signal;
579 struct weston_keyboard_grab *grab;
580 struct weston_keyboard_grab default_grab;
582 uint32_t grab_serial;
585 struct wl_array keys;
588 uint32_t mods_depressed;
589 uint32_t mods_latched;
590 uint32_t mods_locked;
594 struct weston_keyboard_grab input_method_grab;
595 struct wl_resource *input_method_resource;
597 struct weston_xkb_info *xkb_info;
599 struct xkb_state *state;
600 enum weston_led leds;
602 struct xkb_keymap *pending_keymap;
606 struct wl_list base_resource_list;
608 struct wl_global *global;
609 struct weston_pointer *pointer_state;
610 struct weston_keyboard *keyboard_state;
611 struct weston_touch *touch_state;
612 int pointer_device_count;
613 int keyboard_device_count;
614 int touch_device_count;
616 struct weston_output *output; /* constraint */
618 struct wl_signal destroy_signal;
619 struct wl_signal updated_caps_signal;
621 struct weston_compositor *compositor;
623 enum weston_keyboard_modifier modifier_state;
624 struct weston_surface *saved_kbd_focus;
625 struct wl_listener saved_kbd_focus_listener;
626 struct wl_list drag_resource_list;
628 uint32_t selection_serial;
629 struct weston_data_source *selection_data_source;
630 struct wl_listener selection_data_source_listener;
631 struct wl_signal selection_signal;
633 void (*led_update)(struct weston_seat *ws, enum weston_led leds);
635 struct input_method *input_method;
640 WESTON_COMPOSITOR_ACTIVE, /* normal rendering and events */
641 WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */
642 WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */
643 WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dpms
647 struct weston_layer_entry {
649 struct weston_layer *layer;
652 struct weston_layer {
653 struct weston_layer_entry view_list;
658 struct weston_plane {
659 struct weston_compositor *compositor;
660 pixman_region32_t damage; /**< in global coords */
661 pixman_region32_t clip;
666 struct weston_renderer {
667 int (*read_pixels)(struct weston_output *output,
668 pixman_format_code_t format, void *pixels,
669 uint32_t x, uint32_t y,
670 uint32_t width, uint32_t height);
671 void (*repaint_output)(struct weston_output *output,
672 pixman_region32_t *output_damage);
673 void (*flush_damage)(struct weston_surface *surface);
674 void (*attach)(struct weston_surface *es, struct weston_buffer *buffer);
675 void (*surface_set_color)(struct weston_surface *surface,
676 float red, float green,
677 float blue, float alpha);
678 void (*destroy)(struct weston_compositor *ec);
681 /** See weston_surface_get_content_size() */
682 void (*surface_get_content_size)(struct weston_surface *surface,
683 int *width, int *height);
685 /** See weston_surface_copy_content() */
686 int (*surface_copy_content)(struct weston_surface *surface,
687 void *target, size_t size,
688 int src_x, int src_y,
689 int width, int height);
691 /** See weston_compositor_import_dmabuf() */
692 bool (*import_dmabuf)(struct weston_compositor *ec,
693 struct linux_dmabuf_buffer *buffer);
696 enum weston_capability {
697 /* backend/renderer supports arbitrary rotation */
698 WESTON_CAP_ROTATION_ANY = 0x0001,
700 /* screencaptures need to be y-flipped */
701 WESTON_CAP_CAPTURE_YFLIP = 0x0002,
703 /* backend/renderer has a separate cursor plane */
704 WESTON_CAP_CURSOR_PLANE = 0x0004,
706 /* backend supports setting arbitrary resolutions */
707 WESTON_CAP_ARBITRARY_MODES = 0x0008,
709 /* renderer supports weston_view_set_mask() clipping */
710 WESTON_CAP_VIEW_CLIP_MASK = 0x0010,
713 /* Configuration struct for an output.
715 * This struct is used to pass the configuration for an output
716 * to the compositor backend when creating a new output.
717 * The backend can subclass this struct to handle backend
720 struct weston_backend_output_config {
727 /* Configuration struct for a backend.
729 * This struct carries the configuration for a backend, and it's
730 * passed to the backend's init entry point. The backend will
731 * likely want to subclass this in order to handle backend specific
734 * NOTE: Alternate designs were proposed (Feb 2016) for using opaque
735 * structures[1] and for section+key/value getter/setters[2]. The rationale
736 * for selecting the transparent structure design is based on several
737 * assumptions[3] which may require re-evaluating the design choice if they
740 * 1: https://lists.freedesktop.org/archives/wayland-devel/2016-February/026989.html
741 * 2: https://lists.freedesktop.org/archives/wayland-devel/2016-February/026929.html
742 * 3: https://lists.freedesktop.org/archives/wayland-devel/2016-February/027228.html
744 struct weston_backend_config {
745 /** Major version for the backend-specific config struct
747 * This version must match exactly what the backend expects, otherwise
748 * the struct is incompatible.
750 uint32_t struct_version;
752 /** Minor version of the backend-specific config struct
754 * This must be set to sizeof(struct backend-specific config).
755 * If the value here is smaller than what the backend expects, the
756 * extra config members will assume their default values.
758 * A value greater than what the backend expects is incompatible.
763 struct weston_backend {
764 void (*destroy)(struct weston_compositor *compositor);
765 void (*restore)(struct weston_compositor *compositor);
768 struct weston_compositor {
769 struct wl_signal destroy_signal;
771 struct wl_display *wl_display;
772 struct weston_shell_interface shell_interface;
774 /* surface signals */
775 struct wl_signal create_surface_signal;
776 struct wl_signal activate_signal;
777 struct wl_signal transform_signal;
779 struct wl_signal kill_signal;
780 struct wl_signal idle_signal;
781 struct wl_signal wake_signal;
783 struct wl_signal show_input_panel_signal;
784 struct wl_signal hide_input_panel_signal;
785 struct wl_signal update_input_panel_signal;
787 struct wl_signal seat_created_signal;
788 struct wl_signal output_created_signal;
789 struct wl_signal output_destroyed_signal;
790 struct wl_signal output_moved_signal;
791 struct wl_signal output_resized_signal; /* callback argument: resized output */
793 struct wl_signal session_signal;
796 struct weston_layer fade_layer;
797 struct weston_layer cursor_layer;
799 struct wl_list output_list;
800 struct wl_list seat_list;
801 struct wl_list layer_list;
802 struct wl_list view_list; /* struct weston_view::link */
803 struct wl_list plane_list;
804 struct wl_list key_binding_list;
805 struct wl_list modifier_binding_list;
806 struct wl_list button_binding_list;
807 struct wl_list touch_binding_list;
808 struct wl_list axis_binding_list;
809 struct wl_list debug_binding_list;
812 struct wl_event_source *idle_source;
813 uint32_t idle_inhibit;
814 int idle_time; /* timeout, s */
816 const struct weston_pointer_grab_interface *default_pointer_grab;
819 struct weston_plane primary_plane;
820 uint32_t capabilities; /* combination of enum weston_capability */
822 struct weston_renderer *renderer;
824 pixman_format_code_t read_format;
826 struct weston_backend *backend;
828 struct weston_launcher *launcher;
830 struct wl_list plugin_api_list; /* struct weston_plugin_api::link */
832 uint32_t output_id_pool;
834 struct xkb_rule_names xkb_names;
835 struct xkb_context *xkb_context;
836 struct weston_xkb_info *xkb_info;
838 /* Raw keyboard processing (no libxkbcommon initialization or handling) */
841 int32_t kb_repeat_rate;
842 int32_t kb_repeat_delay;
846 clockid_t presentation_clock;
847 int32_t repaint_msec;
849 unsigned int activate_serial;
851 struct wl_global *pointer_constraints;
856 void (*exit)(struct weston_compositor *c);
859 struct weston_buffer {
860 struct wl_resource *resource;
861 struct wl_signal destroy_signal;
862 struct wl_listener destroy_listener;
865 struct wl_shm_buffer *shm_buffer;
868 int32_t width, height;
873 struct weston_buffer_reference {
874 struct weston_buffer *buffer;
875 struct wl_listener destroy_listener;
878 struct weston_buffer_viewport {
880 /* wl_surface.set_buffer_transform */
883 /* wl_surface.set_scaling_factor */
887 * If src_width != wl_fixed_from_int(-1),
888 * then and only then src_* are used.
890 wl_fixed_t src_x, src_y;
891 wl_fixed_t src_width, src_height;
896 * If width == -1, the size is inferred from the buffer.
898 int32_t width, height;
904 struct weston_region {
905 struct wl_resource *resource;
906 pixman_region32_t region;
909 /* Using weston_view transformations
911 * To add a transformation to a view, create a struct weston_transform, and
912 * add it to the list view->geometry.transformation_list. Whenever you
913 * change the list, anything under view->geometry, or anything in the
914 * weston_transforms linked into the list, you must call
915 * weston_view_geometry_dirty().
917 * The order in the list defines the order of transformations. Let the list
918 * contain the transformation matrices M1, ..., Mn as head to tail. The
919 * transformation is applied to view-local coordinate vector p as
920 * P = Mn * ... * M2 * M1 * p
921 * to produce the global coordinate vector P. The total transform
923 * is cached in view->transform.matrix, and the inverse of it in
924 * view->transform.inverse.
926 * The list always contains view->transform.position transformation, which
927 * is the translation by view->geometry.x and y.
929 * If you want to apply a transformation in local coordinates, add your
930 * weston_transform to the head of the list. If you want to apply a
931 * transformation in global coordinates, add it to the tail of the list.
933 * If view->geometry.parent is set, the total transformation of this
934 * view will be the parent's total transformation and this transformation
936 * Mparent * Mn * ... * M2 * M1
940 struct weston_surface *surface;
941 struct wl_list surface_link;
942 struct wl_signal destroy_signal;
944 struct wl_list link; /* weston_compositor::view_list */
945 struct weston_layer_entry layer_link; /* part of geometry */
946 struct weston_plane *plane;
948 /* For weston_layer inheritance from another view */
949 struct weston_view *parent_view;
951 unsigned int click_to_activate_serial;
953 pixman_region32_t clip; /* See weston_view_damage_below() */
954 float alpha; /* part of geometry, see below */
956 void *renderer_state;
958 /* Surface geometry state, mutable.
959 * If you change anything, call weston_surface_geometry_dirty().
960 * That includes the transformations referenced from the list.
963 float x, y; /* surface translation on display */
965 /* struct weston_transform */
966 struct wl_list transformation_list;
968 /* managed by weston_surface_set_transform_parent() */
969 struct weston_view *parent;
970 struct wl_listener parent_destroy_listener;
971 struct wl_list child_list; /* geometry.parent_link */
972 struct wl_list parent_link;
974 /* managed by weston_view_set_mask() */
975 bool scissor_enabled;
976 pixman_region32_t scissor; /* always a simple rect */
979 /* State derived from geometry state, read-only.
980 * This is updated by weston_view_update_transform().
985 /* Approximations in global coordinates:
986 * - boundingbox is guaranteed to include the whole view in
987 * the smallest possible single rectangle.
988 * - opaque is guaranteed to be fully opaque, though not
989 * necessarily include all opaque areas.
991 pixman_region32_t boundingbox;
992 pixman_region32_t opaque;
994 /* matrix and inverse are used only if enabled = 1.
995 * If enabled = 0, use x, y, width, height directly.
998 struct weston_matrix matrix;
999 struct weston_matrix inverse;
1001 struct weston_transform position; /* matrix from x, y */
1005 * The primary output for this view.
1006 * Used for picking the output for driving internal animations on the
1007 * view, inheriting the primary output for related views in shells, etc.
1009 struct weston_output *output;
1012 * A more complete representation of all outputs this surface is
1015 uint32_t output_mask;
1017 /* Per-surface Presentation feedback flags, controlled by backend. */
1023 struct weston_surface_state {
1024 /* wl_surface.attach */
1026 struct weston_buffer *buffer;
1027 struct wl_listener buffer_destroy_listener;
1031 /* wl_surface.damage */
1032 pixman_region32_t damage_surface;
1033 /* wl_surface.damage_buffer */
1034 pixman_region32_t damage_buffer;
1036 /* wl_surface.set_opaque_region */
1037 pixman_region32_t opaque;
1039 /* wl_surface.set_input_region */
1040 pixman_region32_t input;
1042 /* wl_surface.frame */
1043 struct wl_list frame_callback_list;
1045 /* presentation.feedback */
1046 struct wl_list feedback_list;
1048 /* wl_surface.set_buffer_transform */
1049 /* wl_surface.set_scaling_factor */
1050 /* wp_viewport.set_source */
1051 /* wp_viewport.set_destination */
1052 struct weston_buffer_viewport buffer_viewport;
1055 struct weston_surface_activation_data {
1056 struct weston_surface *surface;
1057 struct weston_seat *seat;
1060 struct weston_pointer_constraint {
1061 struct wl_list link;
1063 struct weston_surface *surface;
1064 struct weston_view *view;
1065 struct wl_resource *resource;
1066 struct weston_pointer_grab grab;
1067 struct weston_pointer *pointer;
1070 pixman_region32_t region;
1071 pixman_region32_t region_pending;
1072 bool region_is_pending;
1076 wl_fixed_t hint_x_pending;
1077 wl_fixed_t hint_y_pending;
1078 bool hint_is_pending;
1080 struct wl_listener pointer_destroy_listener;
1081 struct wl_listener surface_destroy_listener;
1082 struct wl_listener surface_commit_listener;
1083 struct wl_listener surface_activate_listener;
1086 struct weston_surface {
1087 struct wl_resource *resource;
1088 struct wl_signal destroy_signal; /* callback argument: this surface */
1089 struct weston_compositor *compositor;
1090 struct wl_signal commit_signal;
1092 /** Damage in local coordinates from the client, for tex upload. */
1093 pixman_region32_t damage;
1095 pixman_region32_t opaque; /* part of geometry, see below */
1096 pixman_region32_t input;
1097 int32_t width, height;
1100 /* Not for long-term storage. This exists for book-keeping while
1101 * iterating over surfaces and views
1105 void *renderer_state;
1107 struct wl_list views;
1110 * Which output to vsync this surface to.
1111 * Used to determine whether to send or queue frame events, and for
1112 * other client-visible syncing/throttling tied to the output
1115 struct weston_output *output;
1118 * A more complete representation of all outputs this surface is
1121 uint32_t output_mask;
1123 struct wl_list frame_callback_list;
1124 struct wl_list feedback_list;
1126 struct weston_buffer_reference buffer_ref;
1127 struct weston_buffer_viewport buffer_viewport;
1128 int32_t width_from_buffer; /* before applying viewport */
1129 int32_t height_from_buffer;
1130 bool keep_buffer; /* for backends to prevent early release */
1132 /* wp_viewport resource for this surface */
1133 struct wl_resource *viewport_resource;
1135 /* All the pending state, that wl_surface.commit will apply. */
1136 struct weston_surface_state pending;
1138 /* Matrices representating of the full transformation between
1139 * buffer and surface coordinates. These matrices are updated
1140 * using the weston_surface_build_buffer_matrix function. */
1141 struct weston_matrix buffer_to_surface_matrix;
1142 struct weston_matrix surface_to_buffer_matrix;
1145 * If non-NULL, this function will be called on
1146 * wl_surface::commit after a new buffer has been set up for
1147 * this surface. The integer params are the sx and sy
1148 * parameters supplied to wl_surface::attach.
1150 void (*committed)(struct weston_surface *es, int32_t sx, int32_t sy);
1151 void *committed_private;
1152 int (*get_label)(struct weston_surface *surface, char *buf, size_t len);
1154 /* Parent's list of its sub-surfaces, weston_subsurface:parent_link.
1155 * Contains also the parent itself as a dummy weston_subsurface,
1156 * if the list is not empty.
1158 struct wl_list subsurface_list; /* weston_subsurface::parent_link */
1159 struct wl_list subsurface_list_pending; /* ...::parent_link_pending */
1162 * For tracking protocol role assignments. Different roles may
1163 * have the same configure hook, e.g. in shell.c. Configure hook
1164 * may get reset, this will not.
1165 * XXX: map configure functions 1:1 to roles, and never reset it,
1166 * and replace role_name with configure.
1168 const char *role_name;
1170 struct weston_timeline_object timeline;
1174 /* An list of per seat pointer constraints. */
1175 struct wl_list pointer_constraints;
1178 struct weston_subsurface {
1179 struct wl_resource *resource;
1181 /* guaranteed to be valid and non-NULL */
1182 struct weston_surface *surface;
1183 struct wl_listener surface_destroy_listener;
1186 struct weston_surface *parent;
1187 struct wl_listener parent_destroy_listener;
1188 struct wl_list parent_link;
1189 struct wl_list parent_link_pending;
1197 int has_cached_data;
1198 struct weston_surface_state cached;
1199 struct weston_buffer_reference cached_buffer_ref;
1203 /* Used for constructing the view tree */
1204 struct wl_list unused_views;
1207 enum weston_key_state_update {
1208 STATE_UPDATE_AUTOMATIC,
1212 enum weston_activate_flag {
1213 WESTON_ACTIVATE_FLAG_NONE = 0,
1214 WESTON_ACTIVATE_FLAG_CONFIGURE = 1 << 0,
1215 WESTON_ACTIVATE_FLAG_CLICKED = 1 << 1,
1219 weston_version(int *major, int *minor, int *micro);
1222 weston_view_update_transform(struct weston_view *view);
1225 weston_view_geometry_dirty(struct weston_view *view);
1228 weston_view_to_global_fixed(struct weston_view *view,
1229 wl_fixed_t sx, wl_fixed_t sy,
1230 wl_fixed_t *x, wl_fixed_t *y);
1232 weston_view_to_global_float(struct weston_view *view,
1233 float sx, float sy, float *x, float *y);
1236 weston_view_from_global_float(struct weston_view *view,
1237 float x, float y, float *vx, float *vy);
1239 weston_view_from_global(struct weston_view *view,
1240 int32_t x, int32_t y, int32_t *vx, int32_t *vy);
1242 weston_view_from_global_fixed(struct weston_view *view,
1243 wl_fixed_t x, wl_fixed_t y,
1244 wl_fixed_t *vx, wl_fixed_t *vy);
1247 weston_surface_to_buffer_float(struct weston_surface *surface,
1248 float x, float y, float *bx, float *by);
1250 weston_surface_to_buffer_rect(struct weston_surface *surface,
1251 pixman_box32_t rect);
1254 weston_surface_to_buffer_region(struct weston_surface *surface,
1255 pixman_region32_t *surface_region,
1256 pixman_region32_t *buffer_region);
1259 weston_spring_init(struct weston_spring *spring,
1260 double k, double current, double target);
1262 weston_spring_update(struct weston_spring *spring, uint32_t msec);
1264 weston_spring_done(struct weston_spring *spring);
1267 weston_view_activate(struct weston_view *view,
1268 struct weston_seat *seat,
1272 notify_motion(struct weston_seat *seat, uint32_t time,
1273 struct weston_pointer_motion_event *event);
1275 notify_motion_absolute(struct weston_seat *seat, uint32_t time,
1276 double x, double y);
1278 notify_button(struct weston_seat *seat, uint32_t time, int32_t button,
1279 enum wl_pointer_button_state state);
1281 notify_axis(struct weston_seat *seat, uint32_t time,
1282 struct weston_pointer_axis_event *event);
1284 notify_axis_source(struct weston_seat *seat, uint32_t source);
1287 notify_pointer_frame(struct weston_seat *seat);
1290 notify_key(struct weston_seat *seat, uint32_t time, uint32_t key,
1291 enum wl_keyboard_key_state state,
1292 enum weston_key_state_update update_state);
1294 notify_modifiers(struct weston_seat *seat, uint32_t serial);
1297 notify_pointer_focus(struct weston_seat *seat, struct weston_output *output,
1298 double x, double y);
1301 notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys,
1302 enum weston_key_state_update update_state);
1304 notify_keyboard_focus_out(struct weston_seat *seat);
1307 notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
1308 double x, double y, int touch_type);
1310 notify_touch_frame(struct weston_seat *seat);
1313 notify_touch_cancel(struct weston_seat *seat);
1316 weston_layer_entry_insert(struct weston_layer_entry *list,
1317 struct weston_layer_entry *entry);
1319 weston_layer_entry_remove(struct weston_layer_entry *entry);
1321 weston_layer_init(struct weston_layer *layer, struct wl_list *below);
1324 weston_layer_set_mask(struct weston_layer *layer, int x, int y, int width, int height);
1327 weston_layer_set_mask_infinite(struct weston_layer *layer);
1330 weston_plane_init(struct weston_plane *plane,
1331 struct weston_compositor *ec,
1332 int32_t x, int32_t y);
1334 weston_plane_release(struct weston_plane *plane);
1337 weston_compositor_stack_plane(struct weston_compositor *ec,
1338 struct weston_plane *plane,
1339 struct weston_plane *above);
1341 /* An invalid flag in presented_flags to catch logic errors. */
1342 #define WP_PRESENTATION_FEEDBACK_INVALID (1U << 31)
1345 weston_output_finish_frame(struct weston_output *output,
1346 const struct timespec *stamp,
1347 uint32_t presented_flags);
1349 weston_output_schedule_repaint(struct weston_output *output);
1351 weston_output_damage(struct weston_output *output);
1353 weston_compositor_schedule_repaint(struct weston_compositor *compositor);
1355 weston_compositor_fade(struct weston_compositor *compositor, float tint);
1357 weston_compositor_damage_all(struct weston_compositor *compositor);
1359 weston_compositor_unlock(struct weston_compositor *compositor);
1361 weston_compositor_wake(struct weston_compositor *compositor);
1363 weston_compositor_offscreen(struct weston_compositor *compositor);
1365 weston_compositor_sleep(struct weston_compositor *compositor);
1366 struct weston_view *
1367 weston_compositor_pick_view(struct weston_compositor *compositor,
1368 wl_fixed_t x, wl_fixed_t y,
1369 wl_fixed_t *sx, wl_fixed_t *sy);
1372 struct weston_binding;
1373 typedef void (*weston_key_binding_handler_t)(struct weston_keyboard *keyboard,
1374 uint32_t time, uint32_t key,
1376 struct weston_binding *
1377 weston_compositor_add_key_binding(struct weston_compositor *compositor,
1379 enum weston_keyboard_modifier modifier,
1380 weston_key_binding_handler_t binding,
1383 typedef void (*weston_modifier_binding_handler_t)(struct weston_keyboard *keyboard,
1384 enum weston_keyboard_modifier modifier,
1386 struct weston_binding *
1387 weston_compositor_add_modifier_binding(struct weston_compositor *compositor,
1388 enum weston_keyboard_modifier modifier,
1389 weston_modifier_binding_handler_t binding,
1392 typedef void (*weston_button_binding_handler_t)(struct weston_pointer *pointer,
1393 uint32_t time, uint32_t button,
1395 struct weston_binding *
1396 weston_compositor_add_button_binding(struct weston_compositor *compositor,
1398 enum weston_keyboard_modifier modifier,
1399 weston_button_binding_handler_t binding,
1402 typedef void (*weston_touch_binding_handler_t)(struct weston_touch *touch,
1405 struct weston_binding *
1406 weston_compositor_add_touch_binding(struct weston_compositor *compositor,
1407 enum weston_keyboard_modifier modifier,
1408 weston_touch_binding_handler_t binding,
1411 typedef void (*weston_axis_binding_handler_t)(struct weston_pointer *pointer,
1413 struct weston_pointer_axis_event *event,
1415 struct weston_binding *
1416 weston_compositor_add_axis_binding(struct weston_compositor *compositor,
1418 enum weston_keyboard_modifier modifier,
1419 weston_axis_binding_handler_t binding,
1421 struct weston_binding *
1422 weston_compositor_add_debug_binding(struct weston_compositor *compositor,
1424 weston_key_binding_handler_t binding,
1427 weston_binding_destroy(struct weston_binding *binding);
1430 weston_install_debug_key_binding(struct weston_compositor *compositor,
1434 weston_binding_list_destroy_all(struct wl_list *list);
1437 weston_compositor_run_key_binding(struct weston_compositor *compositor,
1438 struct weston_keyboard *keyboard,
1441 enum wl_keyboard_key_state state);
1444 weston_compositor_run_modifier_binding(struct weston_compositor *compositor,
1445 struct weston_keyboard *keyboard,
1446 enum weston_keyboard_modifier modifier,
1447 enum wl_keyboard_key_state state);
1449 weston_compositor_run_button_binding(struct weston_compositor *compositor,
1450 struct weston_pointer *pointer, uint32_t time,
1452 enum wl_pointer_button_state value);
1454 weston_compositor_run_touch_binding(struct weston_compositor *compositor,
1455 struct weston_touch *touch, uint32_t time,
1458 weston_compositor_run_axis_binding(struct weston_compositor *compositor,
1459 struct weston_pointer *pointer, uint32_t time,
1460 struct weston_pointer_axis_event *event);
1462 weston_compositor_run_debug_binding(struct weston_compositor *compositor,
1463 struct weston_keyboard *keyboard, uint32_t time,
1465 enum wl_keyboard_key_state state);
1468 weston_compositor_set_default_pointer_grab(struct weston_compositor *compositor,
1469 const struct weston_pointer_grab_interface *interface);
1472 weston_environment_get_fd(const char *env);
1475 weston_compositor_top(struct weston_compositor *compositor);
1477 struct weston_surface *
1478 weston_surface_create(struct weston_compositor *compositor);
1480 struct weston_view *
1481 weston_view_create(struct weston_surface *surface);
1484 weston_view_destroy(struct weston_view *view);
1487 weston_view_set_position(struct weston_view *view,
1491 weston_view_set_transform_parent(struct weston_view *view,
1492 struct weston_view *parent);
1495 weston_view_set_mask(struct weston_view *view,
1496 int x, int y, int width, int height);
1499 weston_view_set_mask_infinite(struct weston_view *view);
1502 weston_view_is_mapped(struct weston_view *view);
1505 weston_view_schedule_repaint(struct weston_view *view);
1508 weston_surface_is_mapped(struct weston_surface *surface);
1511 weston_surface_set_size(struct weston_surface *surface,
1512 int32_t width, int32_t height);
1515 weston_surface_schedule_repaint(struct weston_surface *surface);
1518 weston_surface_damage(struct weston_surface *surface);
1521 weston_view_damage_below(struct weston_view *view);
1524 weston_view_move_to_plane(struct weston_view *view,
1525 struct weston_plane *plane);
1527 weston_view_unmap(struct weston_view *view);
1530 weston_surface_unmap(struct weston_surface *surface);
1532 struct weston_surface *
1533 weston_surface_get_main_surface(struct weston_surface *surface);
1536 weston_surface_set_role(struct weston_surface *surface,
1537 const char *role_name,
1538 struct wl_resource *error_resource,
1539 uint32_t error_code);
1542 weston_surface_set_label_func(struct weston_surface *surface,
1543 int (*desc)(struct weston_surface *,
1547 weston_surface_get_content_size(struct weston_surface *surface,
1548 int *width, int *height);
1551 weston_surface_copy_content(struct weston_surface *surface,
1552 void *target, size_t size,
1553 int src_x, int src_y,
1554 int width, int height);
1556 struct weston_buffer *
1557 weston_buffer_from_resource(struct wl_resource *resource);
1560 weston_buffer_reference(struct weston_buffer_reference *ref,
1561 struct weston_buffer *buffer);
1564 weston_compositor_get_time(void);
1567 weston_compositor_destroy(struct weston_compositor *ec);
1568 struct weston_compositor *
1569 weston_compositor_create(struct wl_display *display, void *user_data);
1571 enum weston_compositor_backend {
1573 WESTON_BACKEND_FBDEV,
1574 WESTON_BACKEND_HEADLESS,
1576 WESTON_BACKEND_WAYLAND,
1581 weston_compositor_load_backend(struct weston_compositor *compositor,
1582 enum weston_compositor_backend backend,
1583 struct weston_backend_config *config_base);
1585 weston_compositor_exit(struct weston_compositor *ec);
1587 weston_compositor_get_user_data(struct weston_compositor *compositor);
1589 weston_compositor_set_presentation_clock(struct weston_compositor *compositor,
1592 weston_compositor_set_presentation_clock_software(
1593 struct weston_compositor *compositor);
1595 weston_compositor_read_presentation_clock(
1596 const struct weston_compositor *compositor,
1597 struct timespec *ts);
1600 weston_compositor_import_dmabuf(struct weston_compositor *compositor,
1601 struct linux_dmabuf_buffer *buffer);
1604 weston_compositor_shutdown(struct weston_compositor *ec);
1606 weston_compositor_exit_with_code(struct weston_compositor *compositor,
1609 weston_output_init_zoom(struct weston_output *output);
1611 weston_output_update_zoom(struct weston_output *output);
1613 weston_output_activate_zoom(struct weston_output *output,
1614 struct weston_seat *seat);
1616 weston_output_update_matrix(struct weston_output *output);
1618 weston_output_move(struct weston_output *output, int x, int y);
1620 weston_output_init(struct weston_output *output, struct weston_compositor *c,
1621 int x, int y, int width, int height, uint32_t transform, int32_t scale);
1623 weston_compositor_add_output(struct weston_compositor *compositor,
1624 struct weston_output *output);
1626 weston_output_destroy(struct weston_output *output);
1628 weston_output_transform_coordinate(struct weston_output *output,
1629 double device_x, double device_y,
1630 double *x, double *y);
1633 weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
1634 const char *seat_name);
1636 weston_seat_init_pointer(struct weston_seat *seat);
1638 weston_seat_release_pointer(struct weston_seat *seat);
1640 weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
1642 weston_seat_release_keyboard(struct weston_seat *seat);
1644 weston_seat_init_touch(struct weston_seat *seat);
1646 weston_seat_release_touch(struct weston_seat *seat);
1648 weston_seat_repick(struct weston_seat *seat);
1650 weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap);
1653 weston_seat_release(struct weston_seat *seat);
1655 weston_compositor_set_xkb_rule_names(struct weston_compositor *ec,
1656 struct xkb_rule_names *names);
1658 weston_compositor_xkb_destroy(struct weston_compositor *ec);
1660 /* String literal of spaces, the same width as the timestamp. */
1661 #define STAMP_SPACE " "
1663 typedef int (*log_func_t)(const char *fmt, va_list ap);
1665 weston_log_set_handler(log_func_t log, log_func_t cont);
1667 weston_vlog(const char *fmt, va_list ap);
1669 weston_vlog_continue(const char *fmt, va_list ap);
1671 weston_log(const char *fmt, ...)
1672 __attribute__ ((format (printf, 1, 2)));
1674 weston_log_continue(const char *fmt, ...)
1675 __attribute__ ((format (printf, 1, 2)));
1683 tty_create(struct weston_compositor *compositor, int tty_nr);
1686 tty_destroy(struct tty *tty);
1689 tty_reset(struct tty *tty);
1692 tty_activate_vt(struct tty *tty, int vt);
1694 enum weston_screenshooter_outcome {
1695 WESTON_SCREENSHOOTER_SUCCESS,
1696 WESTON_SCREENSHOOTER_NO_MEMORY,
1697 WESTON_SCREENSHOOTER_BAD_BUFFER
1700 typedef void (*weston_screenshooter_done_func_t)(void *data,
1701 enum weston_screenshooter_outcome outcome);
1703 weston_screenshooter_shoot(struct weston_output *output, struct weston_buffer *buffer,
1704 weston_screenshooter_done_func_t done, void *data);
1705 struct weston_recorder *
1706 weston_recorder_start(struct weston_output *output, const char *filename);
1708 weston_recorder_stop(struct weston_recorder *recorder);
1711 clipboard_create(struct weston_seat *seat);
1713 struct text_backend;
1715 struct text_backend *
1716 text_backend_init(struct weston_compositor *ec);
1719 text_backend_destroy(struct text_backend *text_backend);
1721 struct weston_view_animation;
1722 typedef void (*weston_view_animation_done_func_t)(struct weston_view_animation *animation, void *data);
1725 weston_view_animation_destroy(struct weston_view_animation *animation);
1727 struct weston_view_animation *
1728 weston_zoom_run(struct weston_view *view, float start, float stop,
1729 weston_view_animation_done_func_t done, void *data);
1731 struct weston_view_animation *
1732 weston_fade_run(struct weston_view *view,
1733 float start, float end, float k,
1734 weston_view_animation_done_func_t done, void *data);
1736 struct weston_view_animation *
1737 weston_move_scale_run(struct weston_view *view, int dx, int dy,
1738 float start, float end, int reverse,
1739 weston_view_animation_done_func_t done, void *data);
1742 weston_fade_update(struct weston_view_animation *fade, float target);
1744 struct weston_view_animation *
1745 weston_stable_fade_run(struct weston_view *front_view, float start,
1746 struct weston_view *back_view, float end,
1747 weston_view_animation_done_func_t done, void *data);
1749 struct weston_view_animation *
1750 weston_slide_run(struct weston_view *view, float start, float stop,
1751 weston_view_animation_done_func_t done, void *data);
1754 weston_surface_set_color(struct weston_surface *surface,
1755 float red, float green, float blue, float alpha);
1758 weston_surface_destroy(struct weston_surface *surface);
1761 weston_output_mode_set_native(struct weston_output *output,
1762 struct weston_mode *mode,
1765 weston_output_mode_switch_to_temporary(struct weston_output *output,
1766 struct weston_mode *mode,
1769 weston_output_mode_switch_to_native(struct weston_output *output);
1772 noop_renderer_init(struct weston_compositor *ec);
1775 weston_input_init(struct weston_compositor *compositor);
1778 backend_init(struct weston_compositor *c,
1779 struct weston_backend_config *config_base);
1781 module_init(struct weston_compositor *compositor,
1782 int *argc, char *argv[]);
1785 weston_transformed_coord(int width, int height,
1786 enum wl_output_transform transform,
1788 float sx, float sy, float *bx, float *by);
1790 weston_transformed_rect(int width, int height,
1791 enum wl_output_transform transform,
1793 pixman_box32_t rect);
1795 weston_matrix_transform_region(pixman_region32_t *dest,
1796 struct weston_matrix *matrix,
1797 pixman_region32_t *src);
1799 weston_transformed_region(int width, int height,
1800 enum wl_output_transform transform,
1802 pixman_region32_t *src, pixman_region32_t *dest);
1805 weston_load_module(const char *name, const char *entrypoint);
1808 weston_parse_transform(const char *transform, uint32_t *out);
1811 weston_transform_to_string(uint32_t output_transform);
1813 struct weston_keyboard *
1814 weston_seat_get_keyboard(struct weston_seat *seat);
1816 struct weston_pointer *
1817 weston_seat_get_pointer(struct weston_seat *seat);
1819 struct weston_touch *
1820 weston_seat_get_touch(struct weston_seat *seat);
1823 weston_seat_set_keyboard_focus(struct weston_seat *seat,
1824 struct weston_surface *surface);
1827 weston_compositor_load_xwayland(struct weston_compositor *compositor);