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>
44 #include "config-parser.h"
46 #include "timeline-object.h"
48 struct weston_geometry {
50 int32_t width, height;
53 struct weston_position {
58 int32_t width, height;
61 struct weston_transform {
62 struct weston_matrix matrix;
66 struct weston_surface;
72 struct weston_pointer;
73 struct linux_dmabuf_buffer;
74 struct weston_recorder;
75 struct weston_pointer_constraint;
77 enum weston_keyboard_modifier {
78 MODIFIER_CTRL = (1 << 0),
79 MODIFIER_ALT = (1 << 1),
80 MODIFIER_SUPER = (1 << 2),
81 MODIFIER_SHIFT = (1 << 3),
84 enum weston_keyboard_locks {
85 WESTON_NUM_LOCK = (1 << 0),
86 WESTON_CAPS_LOCK = (1 << 1),
90 LED_NUM_LOCK = (1 << 0),
91 LED_CAPS_LOCK = (1 << 1),
92 LED_SCROLL_LOCK = (1 << 2),
97 int32_t width, height;
102 struct weston_animation {
103 void (*frame)(struct weston_animation *animation,
104 struct weston_output *output, uint32_t msecs);
110 WESTON_SPRING_OVERSHOOT,
115 struct weston_spring {
126 struct weston_output_zoom {
131 float trans_x, trans_y;
135 struct weston_seat *seat;
136 struct weston_animation animation_z;
137 struct weston_spring spring_z;
138 struct wl_listener motion_listener;
141 /* bit compatible with drm definitions. */
149 struct weston_output {
153 void *renderer_state;
156 struct wl_list resource_list;
157 struct wl_global *global;
158 struct weston_compositor *compositor;
160 /** From global to output buffer coordinates. */
161 struct weston_matrix matrix;
162 /** From output buffer to global coordinates. */
163 struct weston_matrix inverse_matrix;
165 struct wl_list animation_list;
166 int32_t x, y, width, height;
167 int32_t mm_width, mm_height;
169 /** Output area in global coordinates, simple rect */
170 pixman_region32_t region;
172 pixman_region32_t previous_damage;
174 /** True if damage has occurred since the last repaint for this output;
175 * if set, a repaint will eventually occur. */
178 /** State of the repaint loop */
180 REPAINT_NOT_SCHEDULED = 0, /**< idle; no repaint will occur */
181 REPAINT_BEGIN_FROM_IDLE, /**< start_repaint_loop scheduled */
182 REPAINT_SCHEDULED, /**< repaint is scheduled to occur */
183 REPAINT_AWAITING_COMPLETION, /**< last repaint not yet finished */
186 /** If repaint_status is REPAINT_SCHEDULED, contains the time the
187 * next repaint should be run */
188 struct timespec next_repaint;
190 struct weston_output_zoom zoom;
192 struct wl_signal frame_signal;
193 struct wl_signal destroy_signal;
195 uint32_t frame_time; /* presentation timestamp in milliseconds */
196 uint64_t msc; /* media stream counter */
199 struct wl_list feedback_list;
201 char *make, *model, *serial_number;
204 int32_t native_scale;
205 int32_t current_scale;
206 int32_t original_scale;
208 struct weston_mode *native_mode;
209 struct weston_mode *current_mode;
210 struct weston_mode *original_mode;
211 struct wl_list mode_list;
213 void (*start_repaint_loop)(struct weston_output *output);
214 int (*repaint)(struct weston_output *output,
215 pixman_region32_t *damage);
216 void (*destroy)(struct weston_output *output);
217 void (*assign_planes)(struct weston_output *output);
218 int (*switch_mode)(struct weston_output *output, struct weston_mode *mode);
220 /* backlight values are on 0-255 range, where higher is brighter */
221 int32_t backlight_current;
222 void (*set_backlight)(struct weston_output *output, uint32_t value);
223 void (*set_dpms)(struct weston_output *output, enum dpms_enum level);
225 int connection_internal;
227 void (*set_gamma)(struct weston_output *output,
233 struct weston_timeline_object timeline;
238 int (*enable)(struct weston_output *output);
239 int (*disable)(struct weston_output *output);
242 enum weston_pointer_motion_mask {
243 WESTON_POINTER_MOTION_ABS = 1 << 0,
244 WESTON_POINTER_MOTION_REL = 1 << 1,
245 WESTON_POINTER_MOTION_REL_UNACCEL = 1 << 2,
248 struct weston_pointer_motion_event {
259 struct weston_pointer_axis_event {
266 struct weston_pointer_grab;
267 struct weston_pointer_grab_interface {
268 void (*focus)(struct weston_pointer_grab *grab);
269 void (*motion)(struct weston_pointer_grab *grab, uint32_t time,
270 struct weston_pointer_motion_event *event);
271 void (*button)(struct weston_pointer_grab *grab,
272 uint32_t time, uint32_t button, uint32_t state);
273 void (*axis)(struct weston_pointer_grab *grab,
275 struct weston_pointer_axis_event *event);
276 void (*axis_source)(struct weston_pointer_grab *grab, uint32_t source);
277 void (*frame)(struct weston_pointer_grab *grab);
278 void (*cancel)(struct weston_pointer_grab *grab);
281 struct weston_pointer_grab {
282 const struct weston_pointer_grab_interface *interface;
283 struct weston_pointer *pointer;
286 struct weston_keyboard_grab;
287 struct weston_keyboard_grab_interface {
288 void (*key)(struct weston_keyboard_grab *grab, uint32_t time,
289 uint32_t key, uint32_t state);
290 void (*modifiers)(struct weston_keyboard_grab *grab, uint32_t serial,
291 uint32_t mods_depressed, uint32_t mods_latched,
292 uint32_t mods_locked, uint32_t group);
293 void (*cancel)(struct weston_keyboard_grab *grab);
296 struct weston_keyboard_grab {
297 const struct weston_keyboard_grab_interface *interface;
298 struct weston_keyboard *keyboard;
301 struct weston_touch_grab;
302 struct weston_touch_grab_interface {
303 void (*down)(struct weston_touch_grab *grab,
308 void (*up)(struct weston_touch_grab *grab,
311 void (*motion)(struct weston_touch_grab *grab,
316 void (*frame)(struct weston_touch_grab *grab);
317 void (*cancel)(struct weston_touch_grab *grab);
320 struct weston_touch_grab {
321 const struct weston_touch_grab_interface *interface;
322 struct weston_touch *touch;
325 struct weston_data_offer {
326 struct wl_resource *resource;
327 struct weston_data_source *source;
328 struct wl_listener source_destroy_listener;
329 uint32_t dnd_actions;
330 enum wl_data_device_manager_dnd_action preferred_dnd_action;
334 struct weston_data_source {
335 struct wl_resource *resource;
336 struct wl_signal destroy_signal;
337 struct wl_array mime_types;
338 struct weston_data_offer *offer;
339 struct weston_seat *seat;
342 uint32_t dnd_actions;
343 enum wl_data_device_manager_dnd_action current_dnd_action;
344 enum wl_data_device_manager_dnd_action compositor_action;
346 void (*accept)(struct weston_data_source *source,
347 uint32_t serial, const char *mime_type);
348 void (*send)(struct weston_data_source *source,
349 const char *mime_type, int32_t fd);
350 void (*cancel)(struct weston_data_source *source);
353 struct weston_pointer_client {
355 struct wl_client *client;
356 struct wl_list pointer_resources;
357 struct wl_list relative_pointer_resources;
360 struct weston_pointer {
361 struct weston_seat *seat;
363 struct wl_list pointer_clients;
365 struct weston_view *focus;
366 struct weston_pointer_client *focus_client;
367 uint32_t focus_serial;
368 struct wl_listener focus_view_listener;
369 struct wl_listener focus_resource_listener;
370 struct wl_signal focus_signal;
371 struct wl_signal motion_signal;
372 struct wl_signal destroy_signal;
374 struct weston_view *sprite;
375 struct wl_listener sprite_destroy_listener;
376 int32_t hotspot_x, hotspot_y;
378 struct weston_pointer_grab *grab;
379 struct weston_pointer_grab default_grab;
380 wl_fixed_t grab_x, grab_y;
381 uint32_t grab_button;
382 uint32_t grab_serial;
387 uint32_t button_count;
389 struct wl_listener output_destroy_listener;
393 struct weston_touch {
394 struct weston_seat *seat;
396 struct wl_list resource_list;
397 struct wl_list focus_resource_list;
398 struct weston_view *focus;
399 struct wl_listener focus_view_listener;
400 struct wl_listener focus_resource_listener;
401 uint32_t focus_serial;
402 struct wl_signal focus_signal;
406 struct weston_touch_grab *grab;
407 struct weston_touch_grab default_grab;
409 wl_fixed_t grab_x, grab_y;
410 uint32_t grab_serial;
415 weston_pointer_motion_to_abs(struct weston_pointer *pointer,
416 struct weston_pointer_motion_event *event,
417 wl_fixed_t *x, wl_fixed_t *y);
419 struct weston_pointer *
420 weston_pointer_create(struct weston_seat *seat);
422 weston_pointer_destroy(struct weston_pointer *pointer);
424 weston_pointer_send_motion(struct weston_pointer *pointer, uint32_t time,
425 struct weston_pointer_motion_event *event);
427 weston_pointer_has_focus_resource(struct weston_pointer *pointer);
429 weston_pointer_send_button(struct weston_pointer *pointer,
430 uint32_t time, uint32_t button, uint32_t state_w);
432 weston_pointer_send_axis(struct weston_pointer *pointer,
434 struct weston_pointer_axis_event *event);
436 weston_pointer_send_axis_source(struct weston_pointer *pointer,
439 weston_pointer_send_frame(struct weston_pointer *pointer);
442 weston_pointer_set_focus(struct weston_pointer *pointer,
443 struct weston_view *view,
444 wl_fixed_t sx, wl_fixed_t sy);
446 weston_pointer_clear_focus(struct weston_pointer *pointer);
448 weston_pointer_start_grab(struct weston_pointer *pointer,
449 struct weston_pointer_grab *grab);
451 weston_pointer_end_grab(struct weston_pointer *pointer);
453 weston_pointer_clamp(struct weston_pointer *pointer,
454 wl_fixed_t *fx, wl_fixed_t *fy);
456 weston_pointer_move(struct weston_pointer *pointer,
457 struct weston_pointer_motion_event *event);
459 weston_pointer_set_default_grab(struct weston_pointer *pointer,
460 const struct weston_pointer_grab_interface *interface);
463 weston_pointer_constraint_destroy(struct weston_pointer_constraint *constraint);
465 struct weston_keyboard *
466 weston_keyboard_create(void);
468 weston_keyboard_destroy(struct weston_keyboard *keyboard);
470 weston_keyboard_set_focus(struct weston_keyboard *keyboard,
471 struct weston_surface *surface);
473 weston_keyboard_start_grab(struct weston_keyboard *device,
474 struct weston_keyboard_grab *grab);
476 weston_keyboard_end_grab(struct weston_keyboard *keyboard);
479 * 'mask' and 'value' should be a bitwise mask of one or more
480 * valued of the weston_keyboard_locks enum.
482 weston_keyboard_set_locks(struct weston_keyboard *keyboard,
483 uint32_t mask, uint32_t value);
486 weston_keyboard_has_focus_resource(struct weston_keyboard *keyboard);
488 weston_keyboard_send_key(struct weston_keyboard *keyboard,
489 uint32_t time, uint32_t key,
490 enum wl_keyboard_key_state state);
492 weston_keyboard_send_modifiers(struct weston_keyboard *keyboard,
493 uint32_t serial, uint32_t mods_depressed,
494 uint32_t mods_latched,
495 uint32_t mods_locked, uint32_t group);
497 struct weston_touch *
498 weston_touch_create(void);
500 weston_touch_destroy(struct weston_touch *touch);
502 weston_touch_set_focus(struct weston_touch *touch,
503 struct weston_view *view);
505 weston_touch_start_grab(struct weston_touch *device,
506 struct weston_touch_grab *grab);
508 weston_touch_end_grab(struct weston_touch *touch);
511 weston_touch_has_focus_resource(struct weston_touch *touch);
513 weston_touch_send_down(struct weston_touch *touch, uint32_t time,
514 int touch_id, wl_fixed_t x, wl_fixed_t y);
516 weston_touch_send_up(struct weston_touch *touch, uint32_t time, int touch_id);
518 weston_touch_send_motion(struct weston_touch *touch, uint32_t time,
519 int touch_id, wl_fixed_t x, wl_fixed_t y);
521 weston_touch_send_frame(struct weston_touch *touch);
524 wl_data_device_set_keyboard_focus(struct weston_seat *seat);
527 wl_data_device_manager_init(struct wl_display *display);
531 weston_seat_set_selection(struct weston_seat *seat,
532 struct weston_data_source *source, uint32_t serial);
534 weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client);
537 weston_pointer_start_drag(struct weston_pointer *pointer,
538 struct weston_data_source *source,
539 struct weston_surface *icon,
540 struct wl_client *client);
542 weston_touch_start_drag(struct weston_touch *touch,
543 struct weston_data_source *source,
544 struct weston_surface *icon,
545 struct wl_client *client);
547 struct weston_xkb_info {
548 struct xkb_keymap *keymap;
553 xkb_mod_index_t shift_mod;
554 xkb_mod_index_t caps_mod;
555 xkb_mod_index_t ctrl_mod;
556 xkb_mod_index_t alt_mod;
557 xkb_mod_index_t mod2_mod;
558 xkb_mod_index_t mod3_mod;
559 xkb_mod_index_t super_mod;
560 xkb_mod_index_t mod5_mod;
561 xkb_led_index_t num_led;
562 xkb_led_index_t caps_led;
563 xkb_led_index_t scroll_led;
566 struct weston_keyboard {
567 struct weston_seat *seat;
569 struct wl_list resource_list;
570 struct wl_list focus_resource_list;
571 struct weston_surface *focus;
572 struct wl_listener focus_resource_listener;
573 uint32_t focus_serial;
574 struct wl_signal focus_signal;
576 struct weston_keyboard_grab *grab;
577 struct weston_keyboard_grab default_grab;
579 uint32_t grab_serial;
582 struct wl_array keys;
585 uint32_t mods_depressed;
586 uint32_t mods_latched;
587 uint32_t mods_locked;
591 struct weston_keyboard_grab input_method_grab;
592 struct wl_resource *input_method_resource;
594 struct weston_xkb_info *xkb_info;
596 struct xkb_state *state;
597 enum weston_led leds;
599 struct xkb_keymap *pending_keymap;
603 struct wl_list base_resource_list;
605 struct wl_global *global;
606 struct weston_pointer *pointer_state;
607 struct weston_keyboard *keyboard_state;
608 struct weston_touch *touch_state;
609 int pointer_device_count;
610 int keyboard_device_count;
611 int touch_device_count;
613 struct weston_output *output; /* constraint */
615 struct wl_signal destroy_signal;
616 struct wl_signal updated_caps_signal;
618 struct weston_compositor *compositor;
620 enum weston_keyboard_modifier modifier_state;
621 struct weston_surface *saved_kbd_focus;
622 struct wl_listener saved_kbd_focus_listener;
623 struct wl_list drag_resource_list;
625 uint32_t selection_serial;
626 struct weston_data_source *selection_data_source;
627 struct wl_listener selection_data_source_listener;
628 struct wl_signal selection_signal;
630 void (*led_update)(struct weston_seat *ws, enum weston_led leds);
632 struct input_method *input_method;
637 WESTON_COMPOSITOR_ACTIVE, /* normal rendering and events */
638 WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */
639 WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */
640 WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dpms
644 struct weston_layer_entry {
646 struct weston_layer *layer;
650 * Higher value means higher in the stack.
652 * These values are based on well-known concepts in a classic desktop
653 * environment. Third-party modules based on libweston are encouraged to use
654 * them to integrate better with other projects.
656 * A fully integrated environment can use any value, based on these or not,
657 * at their discretion.
659 enum weston_layer_position {
661 * Special value to make the layer invisible and still rendered.
662 * This is used by compositors wanting e.g. minimized surfaces to still
663 * receive frame callbacks.
665 WESTON_LAYER_POSITION_HIDDEN = 0x00000000,
668 * There should always be a background layer with a surface covering
671 * If the compositor handles the background itself, it should use
674 * If the compositor supports runtime-loadable modules to set the
675 * background, it should put a solid color surface at (BACKGROUND - 1)
676 * and modules must use BACKGROUND.
678 WESTON_LAYER_POSITION_BACKGROUND = 0x00000002,
680 /* For "desktop widgets" and applications like conky. */
681 WESTON_LAYER_POSITION_BOTTOM_UI = 0x30000000,
683 /* For regular applications, only one layer should have this value
684 * to ensure proper stacking control. */
685 WESTON_LAYER_POSITION_NORMAL = 0x50000000,
687 /* For desktop UI, like panels. */
688 WESTON_LAYER_POSITION_UI = 0x80000000,
690 /* For fullscreen applications that should cover UI. */
691 WESTON_LAYER_POSITION_FULLSCREEN = 0xb0000000,
693 /* For special UI like on-screen keyboard that fullscreen applications
695 WESTON_LAYER_POSITION_TOP_UI = 0xe0000000,
697 /* For the lock surface. */
698 WESTON_LAYER_POSITION_LOCK = 0xffff0000,
700 /* Values reserved for libweston internal usage */
701 WESTON_LAYER_POSITION_CURSOR = 0xfffffffe,
702 WESTON_LAYER_POSITION_FADE = 0xffffffff,
705 struct weston_layer {
706 struct weston_compositor *compositor;
707 struct wl_list link; /* weston_compositor::layer_list */
708 enum weston_layer_position position;
710 struct weston_layer_entry view_list;
713 struct weston_plane {
714 struct weston_compositor *compositor;
715 pixman_region32_t damage; /**< in global coords */
716 pixman_region32_t clip;
721 struct weston_renderer {
722 int (*read_pixels)(struct weston_output *output,
723 pixman_format_code_t format, void *pixels,
724 uint32_t x, uint32_t y,
725 uint32_t width, uint32_t height);
726 void (*repaint_output)(struct weston_output *output,
727 pixman_region32_t *output_damage);
728 void (*flush_damage)(struct weston_surface *surface);
729 void (*attach)(struct weston_surface *es, struct weston_buffer *buffer);
730 void (*surface_set_color)(struct weston_surface *surface,
731 float red, float green,
732 float blue, float alpha);
733 void (*destroy)(struct weston_compositor *ec);
736 /** See weston_surface_get_content_size() */
737 void (*surface_get_content_size)(struct weston_surface *surface,
738 int *width, int *height);
740 /** See weston_surface_copy_content() */
741 int (*surface_copy_content)(struct weston_surface *surface,
742 void *target, size_t size,
743 int src_x, int src_y,
744 int width, int height);
746 /** See weston_compositor_import_dmabuf() */
747 bool (*import_dmabuf)(struct weston_compositor *ec,
748 struct linux_dmabuf_buffer *buffer);
751 enum weston_capability {
752 /* backend/renderer supports arbitrary rotation */
753 WESTON_CAP_ROTATION_ANY = 0x0001,
755 /* screencaptures need to be y-flipped */
756 WESTON_CAP_CAPTURE_YFLIP = 0x0002,
758 /* backend/renderer has a separate cursor plane */
759 WESTON_CAP_CURSOR_PLANE = 0x0004,
761 /* backend supports setting arbitrary resolutions */
762 WESTON_CAP_ARBITRARY_MODES = 0x0008,
764 /* renderer supports weston_view_set_mask() clipping */
765 WESTON_CAP_VIEW_CLIP_MASK = 0x0010,
768 /* Configuration struct for a backend.
770 * This struct carries the configuration for a backend, and it's
771 * passed to the backend's init entry point. The backend will
772 * likely want to subclass this in order to handle backend specific
775 * NOTE: Alternate designs were proposed (Feb 2016) for using opaque
776 * structures[1] and for section+key/value getter/setters[2]. The rationale
777 * for selecting the transparent structure design is based on several
778 * assumptions[3] which may require re-evaluating the design choice if they
781 * 1: https://lists.freedesktop.org/archives/wayland-devel/2016-February/026989.html
782 * 2: https://lists.freedesktop.org/archives/wayland-devel/2016-February/026929.html
783 * 3: https://lists.freedesktop.org/archives/wayland-devel/2016-February/027228.html
785 struct weston_backend_config {
786 /** Major version for the backend-specific config struct
788 * This version must match exactly what the backend expects, otherwise
789 * the struct is incompatible.
791 uint32_t struct_version;
793 /** Minor version of the backend-specific config struct
795 * This must be set to sizeof(struct backend-specific config).
796 * If the value here is smaller than what the backend expects, the
797 * extra config members will assume their default values.
799 * A value greater than what the backend expects is incompatible.
804 struct weston_backend {
805 void (*destroy)(struct weston_compositor *compositor);
806 void (*restore)(struct weston_compositor *compositor);
809 struct weston_desktop_xwayland;
810 struct weston_desktop_xwayland_interface;
812 struct weston_compositor {
813 struct wl_signal destroy_signal;
815 struct wl_display *wl_display;
816 struct weston_desktop_xwayland *xwayland;
817 const struct weston_desktop_xwayland_interface *xwayland_interface;
819 /* surface signals */
820 struct wl_signal create_surface_signal;
821 struct wl_signal activate_signal;
822 struct wl_signal transform_signal;
824 struct wl_signal kill_signal;
825 struct wl_signal idle_signal;
826 struct wl_signal wake_signal;
828 struct wl_signal show_input_panel_signal;
829 struct wl_signal hide_input_panel_signal;
830 struct wl_signal update_input_panel_signal;
832 struct wl_signal seat_created_signal;
833 struct wl_signal output_pending_signal;
834 struct wl_signal output_created_signal;
835 struct wl_signal output_destroyed_signal;
836 struct wl_signal output_moved_signal;
837 struct wl_signal output_resized_signal; /* callback argument: resized output */
839 struct wl_signal session_signal;
842 struct weston_layer fade_layer;
843 struct weston_layer cursor_layer;
845 struct wl_list pending_output_list;
846 struct wl_list output_list;
847 struct wl_list seat_list;
848 struct wl_list layer_list; /* struct weston_layer::link */
849 struct wl_list view_list; /* struct weston_view::link */
850 struct wl_list plane_list;
851 struct wl_list key_binding_list;
852 struct wl_list modifier_binding_list;
853 struct wl_list button_binding_list;
854 struct wl_list touch_binding_list;
855 struct wl_list axis_binding_list;
856 struct wl_list debug_binding_list;
859 struct wl_event_source *idle_source;
860 uint32_t idle_inhibit;
861 int idle_time; /* timeout, s */
862 struct wl_event_source *repaint_timer;
864 const struct weston_pointer_grab_interface *default_pointer_grab;
867 struct weston_plane primary_plane;
868 uint32_t capabilities; /* combination of enum weston_capability */
870 struct weston_renderer *renderer;
872 pixman_format_code_t read_format;
874 struct weston_backend *backend;
876 struct weston_launcher *launcher;
878 struct wl_list plugin_api_list; /* struct weston_plugin_api::link */
880 uint32_t output_id_pool;
882 struct xkb_rule_names xkb_names;
883 struct xkb_context *xkb_context;
884 struct weston_xkb_info *xkb_info;
886 /* Raw keyboard processing (no libxkbcommon initialization or handling) */
889 int32_t kb_repeat_rate;
890 int32_t kb_repeat_delay;
894 clockid_t presentation_clock;
895 int32_t repaint_msec;
897 unsigned int activate_serial;
899 struct wl_global *pointer_constraints;
904 void (*exit)(struct weston_compositor *c);
906 /* Whether to let the compositor run without any input device. */
911 struct weston_buffer {
912 struct wl_resource *resource;
913 struct wl_signal destroy_signal;
914 struct wl_listener destroy_listener;
917 struct wl_shm_buffer *shm_buffer;
920 int32_t width, height;
925 struct weston_buffer_reference {
926 struct weston_buffer *buffer;
927 struct wl_listener destroy_listener;
930 struct weston_buffer_viewport {
932 /* wl_surface.set_buffer_transform */
935 /* wl_surface.set_scaling_factor */
939 * If src_width != wl_fixed_from_int(-1),
940 * then and only then src_* are used.
942 wl_fixed_t src_x, src_y;
943 wl_fixed_t src_width, src_height;
948 * If width == -1, the size is inferred from the buffer.
950 int32_t width, height;
956 struct weston_region {
957 struct wl_resource *resource;
958 pixman_region32_t region;
961 /* Using weston_view transformations
963 * To add a transformation to a view, create a struct weston_transform, and
964 * add it to the list view->geometry.transformation_list. Whenever you
965 * change the list, anything under view->geometry, or anything in the
966 * weston_transforms linked into the list, you must call
967 * weston_view_geometry_dirty().
969 * The order in the list defines the order of transformations. Let the list
970 * contain the transformation matrices M1, ..., Mn as head to tail. The
971 * transformation is applied to view-local coordinate vector p as
972 * P = Mn * ... * M2 * M1 * p
973 * to produce the global coordinate vector P. The total transform
975 * is cached in view->transform.matrix, and the inverse of it in
976 * view->transform.inverse.
978 * The list always contains view->transform.position transformation, which
979 * is the translation by view->geometry.x and y.
981 * If you want to apply a transformation in local coordinates, add your
982 * weston_transform to the head of the list. If you want to apply a
983 * transformation in global coordinates, add it to the tail of the list.
985 * If view->geometry.parent is set, the total transformation of this
986 * view will be the parent's total transformation and this transformation
988 * Mparent * Mn * ... * M2 * M1
992 struct weston_surface *surface;
993 struct wl_list surface_link;
994 struct wl_signal destroy_signal;
996 struct wl_list link; /* weston_compositor::view_list */
997 struct weston_layer_entry layer_link; /* part of geometry */
998 struct weston_plane *plane;
1000 /* For weston_layer inheritance from another view */
1001 struct weston_view *parent_view;
1003 unsigned int click_to_activate_serial;
1005 pixman_region32_t clip; /* See weston_view_damage_below() */
1006 float alpha; /* part of geometry, see below */
1008 void *renderer_state;
1010 /* Surface geometry state, mutable.
1011 * If you change anything, call weston_surface_geometry_dirty().
1012 * That includes the transformations referenced from the list.
1015 float x, y; /* surface translation on display */
1017 /* struct weston_transform */
1018 struct wl_list transformation_list;
1020 /* managed by weston_surface_set_transform_parent() */
1021 struct weston_view *parent;
1022 struct wl_listener parent_destroy_listener;
1023 struct wl_list child_list; /* geometry.parent_link */
1024 struct wl_list parent_link;
1026 /* managed by weston_view_set_mask() */
1027 bool scissor_enabled;
1028 pixman_region32_t scissor; /* always a simple rect */
1031 /* State derived from geometry state, read-only.
1032 * This is updated by weston_view_update_transform().
1037 /* Approximations in global coordinates:
1038 * - boundingbox is guaranteed to include the whole view in
1039 * the smallest possible single rectangle.
1040 * - opaque is guaranteed to be fully opaque, though not
1041 * necessarily include all opaque areas.
1043 pixman_region32_t boundingbox;
1044 pixman_region32_t opaque;
1046 /* matrix and inverse are used only if enabled = 1.
1047 * If enabled = 0, use x, y, width, height directly.
1050 struct weston_matrix matrix;
1051 struct weston_matrix inverse;
1053 struct weston_transform position; /* matrix from x, y */
1057 * The primary output for this view.
1058 * Used for picking the output for driving internal animations on the
1059 * view, inheriting the primary output for related views in shells, etc.
1061 struct weston_output *output;
1064 * A more complete representation of all outputs this surface is
1067 uint32_t output_mask;
1069 /* Per-surface Presentation feedback flags, controlled by backend. */
1075 struct weston_surface_state {
1076 /* wl_surface.attach */
1078 struct weston_buffer *buffer;
1079 struct wl_listener buffer_destroy_listener;
1083 /* wl_surface.damage */
1084 pixman_region32_t damage_surface;
1085 /* wl_surface.damage_buffer */
1086 pixman_region32_t damage_buffer;
1088 /* wl_surface.set_opaque_region */
1089 pixman_region32_t opaque;
1091 /* wl_surface.set_input_region */
1092 pixman_region32_t input;
1094 /* wl_surface.frame */
1095 struct wl_list frame_callback_list;
1097 /* presentation.feedback */
1098 struct wl_list feedback_list;
1100 /* wl_surface.set_buffer_transform */
1101 /* wl_surface.set_scaling_factor */
1102 /* wp_viewport.set_source */
1103 /* wp_viewport.set_destination */
1104 struct weston_buffer_viewport buffer_viewport;
1107 struct weston_surface_activation_data {
1108 struct weston_surface *surface;
1109 struct weston_seat *seat;
1112 struct weston_pointer_constraint {
1113 struct wl_list link;
1115 struct weston_surface *surface;
1116 struct weston_view *view;
1117 struct wl_resource *resource;
1118 struct weston_pointer_grab grab;
1119 struct weston_pointer *pointer;
1122 pixman_region32_t region;
1123 pixman_region32_t region_pending;
1124 bool region_is_pending;
1128 wl_fixed_t hint_x_pending;
1129 wl_fixed_t hint_y_pending;
1130 bool hint_is_pending;
1132 struct wl_listener pointer_destroy_listener;
1133 struct wl_listener surface_destroy_listener;
1134 struct wl_listener surface_commit_listener;
1135 struct wl_listener surface_activate_listener;
1138 struct weston_surface {
1139 struct wl_resource *resource;
1140 struct wl_signal destroy_signal; /* callback argument: this surface */
1141 struct weston_compositor *compositor;
1142 struct wl_signal commit_signal;
1144 /** Damage in local coordinates from the client, for tex upload. */
1145 pixman_region32_t damage;
1147 pixman_region32_t opaque; /* part of geometry, see below */
1148 pixman_region32_t input;
1149 int32_t width, height;
1152 /* Not for long-term storage. This exists for book-keeping while
1153 * iterating over surfaces and views
1157 void *renderer_state;
1159 struct wl_list views;
1162 * Which output to vsync this surface to.
1163 * Used to determine whether to send or queue frame events, and for
1164 * other client-visible syncing/throttling tied to the output
1167 struct weston_output *output;
1170 * A more complete representation of all outputs this surface is
1173 uint32_t output_mask;
1175 struct wl_list frame_callback_list;
1176 struct wl_list feedback_list;
1178 struct weston_buffer_reference buffer_ref;
1179 struct weston_buffer_viewport buffer_viewport;
1180 int32_t width_from_buffer; /* before applying viewport */
1181 int32_t height_from_buffer;
1182 bool keep_buffer; /* for backends to prevent early release */
1184 /* wp_viewport resource for this surface */
1185 struct wl_resource *viewport_resource;
1187 /* All the pending state, that wl_surface.commit will apply. */
1188 struct weston_surface_state pending;
1190 /* Matrices representating of the full transformation between
1191 * buffer and surface coordinates. These matrices are updated
1192 * using the weston_surface_build_buffer_matrix function. */
1193 struct weston_matrix buffer_to_surface_matrix;
1194 struct weston_matrix surface_to_buffer_matrix;
1197 * If non-NULL, this function will be called on
1198 * wl_surface::commit after a new buffer has been set up for
1199 * this surface. The integer params are the sx and sy
1200 * parameters supplied to wl_surface::attach.
1202 void (*committed)(struct weston_surface *es, int32_t sx, int32_t sy);
1203 void *committed_private;
1204 int (*get_label)(struct weston_surface *surface, char *buf, size_t len);
1206 /* Parent's list of its sub-surfaces, weston_subsurface:parent_link.
1207 * Contains also the parent itself as a dummy weston_subsurface,
1208 * if the list is not empty.
1210 struct wl_list subsurface_list; /* weston_subsurface::parent_link */
1211 struct wl_list subsurface_list_pending; /* ...::parent_link_pending */
1214 * For tracking protocol role assignments. Different roles may
1215 * have the same configure hook, e.g. in shell.c. Configure hook
1216 * may get reset, this will not.
1217 * XXX: map configure functions 1:1 to roles, and never reset it,
1218 * and replace role_name with configure.
1220 const char *role_name;
1222 struct weston_timeline_object timeline;
1226 /* An list of per seat pointer constraints. */
1227 struct wl_list pointer_constraints;
1230 struct weston_subsurface {
1231 struct wl_resource *resource;
1233 /* guaranteed to be valid and non-NULL */
1234 struct weston_surface *surface;
1235 struct wl_listener surface_destroy_listener;
1238 struct weston_surface *parent;
1239 struct wl_listener parent_destroy_listener;
1240 struct wl_list parent_link;
1241 struct wl_list parent_link_pending;
1249 int has_cached_data;
1250 struct weston_surface_state cached;
1251 struct weston_buffer_reference cached_buffer_ref;
1253 /* Sub-surface has been reordered; need to apply damage. */
1258 /* Used for constructing the view tree */
1259 struct wl_list unused_views;
1262 enum weston_key_state_update {
1263 STATE_UPDATE_AUTOMATIC,
1267 enum weston_activate_flag {
1268 WESTON_ACTIVATE_FLAG_NONE = 0,
1269 WESTON_ACTIVATE_FLAG_CONFIGURE = 1 << 0,
1270 WESTON_ACTIVATE_FLAG_CLICKED = 1 << 1,
1274 weston_version(int *major, int *minor, int *micro);
1277 weston_view_update_transform(struct weston_view *view);
1280 weston_view_geometry_dirty(struct weston_view *view);
1283 weston_view_to_global_fixed(struct weston_view *view,
1284 wl_fixed_t sx, wl_fixed_t sy,
1285 wl_fixed_t *x, wl_fixed_t *y);
1287 weston_view_to_global_float(struct weston_view *view,
1288 float sx, float sy, float *x, float *y);
1291 weston_view_from_global_float(struct weston_view *view,
1292 float x, float y, float *vx, float *vy);
1294 weston_view_from_global(struct weston_view *view,
1295 int32_t x, int32_t y, int32_t *vx, int32_t *vy);
1297 weston_view_from_global_fixed(struct weston_view *view,
1298 wl_fixed_t x, wl_fixed_t y,
1299 wl_fixed_t *vx, wl_fixed_t *vy);
1302 weston_surface_to_buffer_float(struct weston_surface *surface,
1303 float x, float y, float *bx, float *by);
1305 weston_surface_to_buffer_rect(struct weston_surface *surface,
1306 pixman_box32_t rect);
1309 weston_surface_to_buffer_region(struct weston_surface *surface,
1310 pixman_region32_t *surface_region,
1311 pixman_region32_t *buffer_region);
1314 weston_spring_init(struct weston_spring *spring,
1315 double k, double current, double target);
1317 weston_spring_update(struct weston_spring *spring, uint32_t msec);
1319 weston_spring_done(struct weston_spring *spring);
1322 weston_view_activate(struct weston_view *view,
1323 struct weston_seat *seat,
1327 notify_motion(struct weston_seat *seat, uint32_t time,
1328 struct weston_pointer_motion_event *event);
1330 notify_motion_absolute(struct weston_seat *seat, uint32_t time,
1331 double x, double y);
1333 notify_button(struct weston_seat *seat, uint32_t time, int32_t button,
1334 enum wl_pointer_button_state state);
1336 notify_axis(struct weston_seat *seat, uint32_t time,
1337 struct weston_pointer_axis_event *event);
1339 notify_axis_source(struct weston_seat *seat, uint32_t source);
1342 notify_pointer_frame(struct weston_seat *seat);
1345 notify_key(struct weston_seat *seat, uint32_t time, uint32_t key,
1346 enum wl_keyboard_key_state state,
1347 enum weston_key_state_update update_state);
1349 notify_modifiers(struct weston_seat *seat, uint32_t serial);
1352 notify_pointer_focus(struct weston_seat *seat, struct weston_output *output,
1353 double x, double y);
1356 notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys,
1357 enum weston_key_state_update update_state);
1359 notify_keyboard_focus_out(struct weston_seat *seat);
1362 notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
1363 double x, double y, int touch_type);
1365 notify_touch_frame(struct weston_seat *seat);
1368 notify_touch_cancel(struct weston_seat *seat);
1371 weston_layer_entry_insert(struct weston_layer_entry *list,
1372 struct weston_layer_entry *entry);
1374 weston_layer_entry_remove(struct weston_layer_entry *entry);
1376 weston_layer_init(struct weston_layer *layer,
1377 struct weston_compositor *compositor);
1379 weston_layer_set_position(struct weston_layer *layer,
1380 enum weston_layer_position position);
1382 weston_layer_unset_position(struct weston_layer *layer);
1385 weston_layer_set_mask(struct weston_layer *layer, int x, int y, int width, int height);
1388 weston_layer_set_mask_infinite(struct weston_layer *layer);
1391 weston_plane_init(struct weston_plane *plane,
1392 struct weston_compositor *ec,
1393 int32_t x, int32_t y);
1395 weston_plane_release(struct weston_plane *plane);
1398 weston_compositor_stack_plane(struct weston_compositor *ec,
1399 struct weston_plane *plane,
1400 struct weston_plane *above);
1402 /* An invalid flag in presented_flags to catch logic errors. */
1403 #define WP_PRESENTATION_FEEDBACK_INVALID (1U << 31)
1406 weston_output_finish_frame(struct weston_output *output,
1407 const struct timespec *stamp,
1408 uint32_t presented_flags);
1410 weston_output_schedule_repaint(struct weston_output *output);
1412 weston_output_damage(struct weston_output *output);
1414 weston_compositor_schedule_repaint(struct weston_compositor *compositor);
1416 weston_compositor_fade(struct weston_compositor *compositor, float tint);
1418 weston_compositor_damage_all(struct weston_compositor *compositor);
1420 weston_compositor_unlock(struct weston_compositor *compositor);
1422 weston_compositor_wake(struct weston_compositor *compositor);
1424 weston_compositor_offscreen(struct weston_compositor *compositor);
1426 weston_compositor_sleep(struct weston_compositor *compositor);
1427 struct weston_view *
1428 weston_compositor_pick_view(struct weston_compositor *compositor,
1429 wl_fixed_t x, wl_fixed_t y,
1430 wl_fixed_t *sx, wl_fixed_t *sy);
1433 struct weston_binding;
1434 typedef void (*weston_key_binding_handler_t)(struct weston_keyboard *keyboard,
1435 uint32_t time, uint32_t key,
1437 struct weston_binding *
1438 weston_compositor_add_key_binding(struct weston_compositor *compositor,
1440 enum weston_keyboard_modifier modifier,
1441 weston_key_binding_handler_t binding,
1444 typedef void (*weston_modifier_binding_handler_t)(struct weston_keyboard *keyboard,
1445 enum weston_keyboard_modifier modifier,
1447 struct weston_binding *
1448 weston_compositor_add_modifier_binding(struct weston_compositor *compositor,
1449 enum weston_keyboard_modifier modifier,
1450 weston_modifier_binding_handler_t binding,
1453 typedef void (*weston_button_binding_handler_t)(struct weston_pointer *pointer,
1454 uint32_t time, uint32_t button,
1456 struct weston_binding *
1457 weston_compositor_add_button_binding(struct weston_compositor *compositor,
1459 enum weston_keyboard_modifier modifier,
1460 weston_button_binding_handler_t binding,
1463 typedef void (*weston_touch_binding_handler_t)(struct weston_touch *touch,
1466 struct weston_binding *
1467 weston_compositor_add_touch_binding(struct weston_compositor *compositor,
1468 enum weston_keyboard_modifier modifier,
1469 weston_touch_binding_handler_t binding,
1472 typedef void (*weston_axis_binding_handler_t)(struct weston_pointer *pointer,
1474 struct weston_pointer_axis_event *event,
1476 struct weston_binding *
1477 weston_compositor_add_axis_binding(struct weston_compositor *compositor,
1479 enum weston_keyboard_modifier modifier,
1480 weston_axis_binding_handler_t binding,
1482 struct weston_binding *
1483 weston_compositor_add_debug_binding(struct weston_compositor *compositor,
1485 weston_key_binding_handler_t binding,
1488 weston_binding_destroy(struct weston_binding *binding);
1491 weston_install_debug_key_binding(struct weston_compositor *compositor,
1495 weston_binding_list_destroy_all(struct wl_list *list);
1498 weston_compositor_run_key_binding(struct weston_compositor *compositor,
1499 struct weston_keyboard *keyboard,
1502 enum wl_keyboard_key_state state);
1505 weston_compositor_run_modifier_binding(struct weston_compositor *compositor,
1506 struct weston_keyboard *keyboard,
1507 enum weston_keyboard_modifier modifier,
1508 enum wl_keyboard_key_state state);
1510 weston_compositor_run_button_binding(struct weston_compositor *compositor,
1511 struct weston_pointer *pointer, uint32_t time,
1513 enum wl_pointer_button_state value);
1515 weston_compositor_run_touch_binding(struct weston_compositor *compositor,
1516 struct weston_touch *touch, uint32_t time,
1519 weston_compositor_run_axis_binding(struct weston_compositor *compositor,
1520 struct weston_pointer *pointer, uint32_t time,
1521 struct weston_pointer_axis_event *event);
1523 weston_compositor_run_debug_binding(struct weston_compositor *compositor,
1524 struct weston_keyboard *keyboard, uint32_t time,
1526 enum wl_keyboard_key_state state);
1529 weston_compositor_set_default_pointer_grab(struct weston_compositor *compositor,
1530 const struct weston_pointer_grab_interface *interface);
1533 weston_environment_get_fd(const char *env);
1535 struct weston_surface *
1536 weston_surface_create(struct weston_compositor *compositor);
1538 struct weston_view *
1539 weston_view_create(struct weston_surface *surface);
1542 weston_view_destroy(struct weston_view *view);
1545 weston_view_set_position(struct weston_view *view,
1549 weston_view_set_transform_parent(struct weston_view *view,
1550 struct weston_view *parent);
1553 weston_view_set_mask(struct weston_view *view,
1554 int x, int y, int width, int height);
1557 weston_view_set_mask_infinite(struct weston_view *view);
1560 weston_view_is_mapped(struct weston_view *view);
1563 weston_view_schedule_repaint(struct weston_view *view);
1566 weston_surface_is_mapped(struct weston_surface *surface);
1569 weston_surface_set_size(struct weston_surface *surface,
1570 int32_t width, int32_t height);
1573 weston_surface_schedule_repaint(struct weston_surface *surface);
1576 weston_surface_damage(struct weston_surface *surface);
1579 weston_view_damage_below(struct weston_view *view);
1582 weston_view_move_to_plane(struct weston_view *view,
1583 struct weston_plane *plane);
1585 weston_view_unmap(struct weston_view *view);
1588 weston_surface_unmap(struct weston_surface *surface);
1590 struct weston_surface *
1591 weston_surface_get_main_surface(struct weston_surface *surface);
1594 weston_surface_set_role(struct weston_surface *surface,
1595 const char *role_name,
1596 struct wl_resource *error_resource,
1597 uint32_t error_code);
1599 weston_surface_get_role(struct weston_surface *surface);
1602 weston_surface_set_label_func(struct weston_surface *surface,
1603 int (*desc)(struct weston_surface *,
1607 weston_surface_get_content_size(struct weston_surface *surface,
1608 int *width, int *height);
1610 struct weston_geometry
1611 weston_surface_get_bounding_box(struct weston_surface *surface);
1614 weston_surface_copy_content(struct weston_surface *surface,
1615 void *target, size_t size,
1616 int src_x, int src_y,
1617 int width, int height);
1619 struct weston_buffer *
1620 weston_buffer_from_resource(struct wl_resource *resource);
1623 weston_buffer_reference(struct weston_buffer_reference *ref,
1624 struct weston_buffer *buffer);
1627 weston_compositor_get_time(void);
1630 weston_compositor_destroy(struct weston_compositor *ec);
1631 struct weston_compositor *
1632 weston_compositor_create(struct wl_display *display, void *user_data);
1634 enum weston_compositor_backend {
1636 WESTON_BACKEND_FBDEV,
1637 WESTON_BACKEND_HEADLESS,
1639 WESTON_BACKEND_WAYLAND,
1644 weston_compositor_load_backend(struct weston_compositor *compositor,
1645 enum weston_compositor_backend backend,
1646 struct weston_backend_config *config_base);
1648 weston_compositor_exit(struct weston_compositor *ec);
1650 weston_compositor_get_user_data(struct weston_compositor *compositor);
1652 weston_compositor_set_presentation_clock(struct weston_compositor *compositor,
1655 weston_compositor_set_presentation_clock_software(
1656 struct weston_compositor *compositor);
1658 weston_compositor_read_presentation_clock(
1659 const struct weston_compositor *compositor,
1660 struct timespec *ts);
1663 weston_compositor_import_dmabuf(struct weston_compositor *compositor,
1664 struct linux_dmabuf_buffer *buffer);
1667 weston_compositor_shutdown(struct weston_compositor *ec);
1669 weston_compositor_exit_with_code(struct weston_compositor *compositor,
1672 weston_output_init_zoom(struct weston_output *output);
1674 weston_output_update_zoom(struct weston_output *output);
1676 weston_output_activate_zoom(struct weston_output *output,
1677 struct weston_seat *seat);
1679 weston_output_update_matrix(struct weston_output *output);
1681 weston_output_move(struct weston_output *output, int x, int y);
1684 weston_compositor_add_output(struct weston_compositor *compositor,
1685 struct weston_output *output);
1687 weston_output_destroy(struct weston_output *output);
1689 weston_output_transform_coordinate(struct weston_output *output,
1690 double device_x, double device_y,
1691 double *x, double *y);
1694 weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
1695 const char *seat_name);
1697 weston_seat_init_pointer(struct weston_seat *seat);
1699 weston_seat_release_pointer(struct weston_seat *seat);
1701 weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
1703 weston_seat_release_keyboard(struct weston_seat *seat);
1705 weston_seat_init_touch(struct weston_seat *seat);
1707 weston_seat_release_touch(struct weston_seat *seat);
1709 weston_seat_repick(struct weston_seat *seat);
1711 weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap);
1714 weston_seat_release(struct weston_seat *seat);
1716 weston_compositor_set_xkb_rule_names(struct weston_compositor *ec,
1717 struct xkb_rule_names *names);
1719 weston_compositor_xkb_destroy(struct weston_compositor *ec);
1721 /* String literal of spaces, the same width as the timestamp. */
1722 #define STAMP_SPACE " "
1724 typedef int (*log_func_t)(const char *fmt, va_list ap);
1726 weston_log_set_handler(log_func_t log, log_func_t cont);
1728 weston_vlog(const char *fmt, va_list ap);
1730 weston_vlog_continue(const char *fmt, va_list ap);
1732 weston_log(const char *fmt, ...)
1733 __attribute__ ((format (printf, 1, 2)));
1735 weston_log_continue(const char *fmt, ...)
1736 __attribute__ ((format (printf, 1, 2)));
1744 tty_create(struct weston_compositor *compositor, int tty_nr);
1747 tty_destroy(struct tty *tty);
1750 tty_reset(struct tty *tty);
1753 tty_activate_vt(struct tty *tty, int vt);
1755 enum weston_screenshooter_outcome {
1756 WESTON_SCREENSHOOTER_SUCCESS,
1757 WESTON_SCREENSHOOTER_NO_MEMORY,
1758 WESTON_SCREENSHOOTER_BAD_BUFFER
1761 typedef void (*weston_screenshooter_done_func_t)(void *data,
1762 enum weston_screenshooter_outcome outcome);
1764 weston_screenshooter_shoot(struct weston_output *output, struct weston_buffer *buffer,
1765 weston_screenshooter_done_func_t done, void *data);
1766 struct weston_recorder *
1767 weston_recorder_start(struct weston_output *output, const char *filename);
1769 weston_recorder_stop(struct weston_recorder *recorder);
1772 clipboard_create(struct weston_seat *seat);
1774 struct weston_view_animation;
1775 typedef void (*weston_view_animation_done_func_t)(struct weston_view_animation *animation, void *data);
1778 weston_view_animation_destroy(struct weston_view_animation *animation);
1780 struct weston_view_animation *
1781 weston_zoom_run(struct weston_view *view, float start, float stop,
1782 weston_view_animation_done_func_t done, void *data);
1784 struct weston_view_animation *
1785 weston_fade_run(struct weston_view *view,
1786 float start, float end, float k,
1787 weston_view_animation_done_func_t done, void *data);
1789 struct weston_view_animation *
1790 weston_move_scale_run(struct weston_view *view, int dx, int dy,
1791 float start, float end, bool reverse,
1792 weston_view_animation_done_func_t done, void *data);
1794 struct weston_view_animation *
1795 weston_move_run(struct weston_view *view, int dx, int dy,
1796 float start, float end, bool reverse,
1797 weston_view_animation_done_func_t done, void *data);
1800 weston_fade_update(struct weston_view_animation *fade, float target);
1802 struct weston_view_animation *
1803 weston_stable_fade_run(struct weston_view *front_view, float start,
1804 struct weston_view *back_view, float end,
1805 weston_view_animation_done_func_t done, void *data);
1807 struct weston_view_animation *
1808 weston_slide_run(struct weston_view *view, float start, float stop,
1809 weston_view_animation_done_func_t done, void *data);
1812 weston_surface_set_color(struct weston_surface *surface,
1813 float red, float green, float blue, float alpha);
1816 weston_surface_destroy(struct weston_surface *surface);
1819 weston_output_mode_set_native(struct weston_output *output,
1820 struct weston_mode *mode,
1823 weston_output_mode_switch_to_temporary(struct weston_output *output,
1824 struct weston_mode *mode,
1827 weston_output_mode_switch_to_native(struct weston_output *output);
1830 noop_renderer_init(struct weston_compositor *ec);
1833 weston_input_init(struct weston_compositor *compositor);
1836 weston_backend_init(struct weston_compositor *c,
1837 struct weston_backend_config *config_base);
1839 weston_module_init(struct weston_compositor *compositor);
1842 weston_transformed_coord(int width, int height,
1843 enum wl_output_transform transform,
1845 float sx, float sy, float *bx, float *by);
1847 weston_transformed_rect(int width, int height,
1848 enum wl_output_transform transform,
1850 pixman_box32_t rect);
1852 weston_matrix_transform_region(pixman_region32_t *dest,
1853 struct weston_matrix *matrix,
1854 pixman_region32_t *src);
1856 weston_transformed_region(int width, int height,
1857 enum wl_output_transform transform,
1859 pixman_region32_t *src, pixman_region32_t *dest);
1862 weston_load_module(const char *name, const char *entrypoint);
1865 weston_parse_transform(const char *transform, uint32_t *out);
1868 weston_transform_to_string(uint32_t output_transform);
1870 struct weston_keyboard *
1871 weston_seat_get_keyboard(struct weston_seat *seat);
1873 struct weston_pointer *
1874 weston_seat_get_pointer(struct weston_seat *seat);
1876 struct weston_touch *
1877 weston_seat_get_touch(struct weston_seat *seat);
1880 weston_seat_set_keyboard_focus(struct weston_seat *seat,
1881 struct weston_surface *surface);
1884 weston_compositor_load_xwayland(struct weston_compositor *compositor);
1887 weston_output_set_scale(struct weston_output *output,
1891 weston_output_set_transform(struct weston_output *output,
1892 uint32_t transform);
1895 weston_output_init(struct weston_output *output,
1896 struct weston_compositor *compositor);
1899 weston_compositor_add_pending_output(struct weston_output *output,
1900 struct weston_compositor *compositor);
1903 weston_output_enable(struct weston_output *output);
1906 weston_output_disable(struct weston_output *output);
1909 weston_pending_output_coldplug(struct weston_compositor *compositor);