2 * Copyright © 2008-2011 Kristian Høgsberg
3 * Copyright © 2012 Collabora, Ltd.
5 * Permission to use, copy, modify, distribute, and sell this software and
6 * its documentation for any purpose is hereby granted without fee, provided
7 * that the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of the copyright holders not be used in
10 * advertising or publicity pertaining to distribution of the software
11 * without specific, written prior permission. The copyright holders make
12 * no representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied warranty.
15 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
16 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
19 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
20 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 #ifndef _WAYLAND_SYSTEM_COMPOSITOR_H_
25 #define _WAYLAND_SYSTEM_COMPOSITOR_H_
32 #include <xkbcommon/xkbcommon.h>
33 #include <wayland-server.h>
37 #include "config-parser.h"
39 #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
41 #define container_of(ptr, type, member) ({ \
42 const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
43 (type *)( (char *)__mptr - offsetof(type,member) );})
45 struct weston_transform {
46 struct weston_matrix matrix;
50 struct weston_surface;
56 enum weston_keyboard_modifier {
57 MODIFIER_CTRL = (1 << 0),
58 MODIFIER_ALT = (1 << 1),
59 MODIFIER_SUPER = (1 << 2),
60 MODIFIER_SHIFT = (1 << 3),
64 LED_NUM_LOCK = (1 << 0),
65 LED_CAPS_LOCK = (1 << 1),
66 LED_SCROLL_LOCK = (1 << 2),
71 int32_t width, height;
76 struct weston_shell_client {
77 void (*send_configure)(struct weston_surface *surface,
78 uint32_t edges, int32_t width, int32_t height);
81 struct weston_shell_interface {
82 void *shell; /* either desktop or tablet */
84 struct shell_surface *(*create_shell_surface)(void *shell,
85 struct weston_surface *surface,
86 const struct weston_shell_client *client);
88 void (*set_toplevel)(struct shell_surface *shsurf);
90 void (*set_transient)(struct shell_surface *shsurf,
91 struct weston_surface *parent,
92 int x, int y, uint32_t flags);
93 void (*set_fullscreen)(struct shell_surface *shsurf,
96 struct weston_output *output);
97 int (*move)(struct shell_surface *shsurf, struct weston_seat *ws);
98 int (*resize)(struct shell_surface *shsurf,
99 struct weston_seat *ws, uint32_t edges);
103 struct weston_border {
104 int32_t left, right, top, bottom;
107 struct weston_animation {
108 void (*frame)(struct weston_animation *animation,
109 struct weston_output *output, uint32_t msecs);
114 struct weston_spring {
128 struct weston_fixed_point {
132 struct weston_output_zoom {
138 float trans_x, trans_y;
139 struct weston_animation animation_z;
140 struct weston_spring spring_z;
141 struct weston_animation animation_xy;
142 struct weston_spring spring_xy;
143 struct weston_fixed_point from;
144 struct weston_fixed_point to;
145 struct weston_fixed_point current;
146 struct weston_fixed_point text_cursor;
149 /* bit compatible with drm definitions. */
157 struct weston_output {
161 void *renderer_state;
164 struct wl_list resource_list;
165 struct wl_global *global;
166 struct weston_compositor *compositor;
167 struct weston_matrix matrix;
168 struct wl_list animation_list;
169 int32_t x, y, width, height;
170 int32_t mm_width, mm_height;
171 struct weston_border border;
172 pixman_region32_t region;
173 pixman_region32_t previous_damage;
175 int repaint_scheduled;
176 struct weston_output_zoom zoom;
178 struct wl_signal frame_signal;
179 struct wl_signal destroy_signal;
183 char *make, *model, *serial_number;
187 struct weston_mode *current;
188 struct weston_mode *origin;
189 struct wl_list mode_list;
191 void (*start_repaint_loop)(struct weston_output *output);
192 void (*repaint)(struct weston_output *output,
193 pixman_region32_t *damage);
194 void (*destroy)(struct weston_output *output);
195 void (*assign_planes)(struct weston_output *output);
196 int (*switch_mode)(struct weston_output *output, struct weston_mode *mode);
198 /* backlight values are on 0-255 range, where higher is brighter */
199 uint32_t backlight_current;
200 void (*set_backlight)(struct weston_output *output, uint32_t value);
201 void (*set_dpms)(struct weston_output *output, enum dpms_enum level);
204 void (*set_gamma)(struct weston_output *output,
211 struct weston_pointer_grab;
212 struct weston_pointer_grab_interface {
213 void (*focus)(struct weston_pointer_grab *grab,
214 struct weston_surface *surface,
217 void (*motion)(struct weston_pointer_grab *grab,
221 void (*button)(struct weston_pointer_grab *grab,
222 uint32_t time, uint32_t button, uint32_t state);
225 struct weston_pointer_grab {
226 const struct weston_pointer_grab_interface *interface;
227 struct weston_pointer *pointer;
228 struct weston_surface *focus;
232 struct weston_keyboard_grab;
233 struct weston_keyboard_grab_interface {
234 void (*key)(struct weston_keyboard_grab *grab, uint32_t time,
235 uint32_t key, uint32_t state);
236 void (*modifiers)(struct weston_keyboard_grab *grab, uint32_t serial,
237 uint32_t mods_depressed, uint32_t mods_latched,
238 uint32_t mods_locked, uint32_t group);
241 struct weston_keyboard_grab {
242 const struct weston_keyboard_grab_interface *interface;
243 struct weston_keyboard *keyboard;
244 struct weston_surface *focus;
248 struct weston_touch_grab;
249 struct weston_touch_grab_interface {
250 void (*down)(struct weston_touch_grab *grab,
255 void (*up)(struct weston_touch_grab *grab,
258 void (*motion)(struct weston_touch_grab *grab,
265 struct weston_touch_grab {
266 const struct weston_touch_grab_interface *interface;
267 struct weston_touch *touch;
268 struct weston_surface *focus;
271 struct wl_data_offer {
272 struct wl_resource resource;
273 struct wl_data_source *source;
274 struct wl_listener source_destroy_listener;
277 struct wl_data_source {
278 struct wl_resource resource;
279 struct wl_array mime_types;
281 void (*accept)(struct wl_data_source *source,
282 uint32_t serial, const char *mime_type);
283 void (*send)(struct wl_data_source *source,
284 const char *mime_type, int32_t fd);
285 void (*cancel)(struct wl_data_source *source);
288 struct weston_pointer {
289 struct weston_seat *seat;
291 struct wl_list resource_list;
292 struct weston_surface *focus;
293 struct wl_resource *focus_resource;
294 struct wl_listener focus_listener;
295 uint32_t focus_serial;
296 struct wl_signal focus_signal;
298 struct weston_pointer_grab *grab;
299 struct weston_pointer_grab default_grab;
300 wl_fixed_t grab_x, grab_y;
301 uint32_t grab_button;
302 uint32_t grab_serial;
306 struct weston_surface *current;
307 struct wl_listener current_listener;
308 wl_fixed_t current_x, current_y;
310 uint32_t button_count;
314 struct weston_touch {
315 struct weston_seat *seat;
317 struct wl_list resource_list;
318 struct weston_surface *focus;
319 struct wl_resource *focus_resource;
320 struct wl_listener focus_listener;
321 uint32_t focus_serial;
322 struct wl_signal focus_signal;
324 struct weston_touch_grab *grab;
325 struct weston_touch_grab default_grab;
326 wl_fixed_t grab_x, grab_y;
327 uint32_t grab_serial;
331 struct weston_pointer *
332 weston_pointer_create(void);
334 weston_pointer_destroy(struct weston_pointer *pointer);
336 weston_pointer_set_focus(struct weston_pointer *pointer,
337 struct weston_surface *surface,
338 wl_fixed_t sx, wl_fixed_t sy);
340 weston_pointer_start_grab(struct weston_pointer *pointer,
341 struct weston_pointer_grab *grab);
343 weston_pointer_end_grab(struct weston_pointer *pointer);
345 weston_pointer_set_current(struct weston_pointer *pointer,
346 struct weston_surface *surface);
348 struct weston_keyboard *
349 weston_keyboard_create(void);
351 weston_keyboard_destroy(struct weston_keyboard *keyboard);
353 weston_keyboard_set_focus(struct weston_keyboard *keyboard,
354 struct weston_surface *surface);
356 weston_keyboard_start_grab(struct weston_keyboard *device,
357 struct weston_keyboard_grab *grab);
359 weston_keyboard_end_grab(struct weston_keyboard *keyboard);
361 struct weston_touch *
362 weston_touch_create(void);
364 weston_touch_destroy(struct weston_touch *touch);
366 weston_touch_start_grab(struct weston_touch *device,
367 struct weston_touch_grab *grab);
369 weston_touch_end_grab(struct weston_touch *touch);
372 wl_data_device_set_keyboard_focus(struct weston_seat *seat);
375 wl_data_device_manager_init(struct wl_display *display);
379 weston_seat_set_selection(struct weston_seat *seat,
380 struct wl_data_source *source, uint32_t serial);
382 struct weston_xkb_info {
383 struct xkb_keymap *keymap;
387 xkb_mod_index_t shift_mod;
388 xkb_mod_index_t caps_mod;
389 xkb_mod_index_t ctrl_mod;
390 xkb_mod_index_t alt_mod;
391 xkb_mod_index_t mod2_mod;
392 xkb_mod_index_t mod3_mod;
393 xkb_mod_index_t super_mod;
394 xkb_mod_index_t mod5_mod;
395 xkb_led_index_t num_led;
396 xkb_led_index_t caps_led;
397 xkb_led_index_t scroll_led;
400 struct weston_keyboard {
401 struct weston_seat *seat;
403 struct wl_list resource_list;
404 struct weston_surface *focus;
405 struct wl_resource *focus_resource;
406 struct wl_listener focus_listener;
407 uint32_t focus_serial;
408 struct wl_signal focus_signal;
410 struct weston_keyboard_grab *grab;
411 struct weston_keyboard_grab default_grab;
413 uint32_t grab_serial;
416 struct wl_array keys;
419 uint32_t mods_depressed;
420 uint32_t mods_latched;
421 uint32_t mods_locked;
425 struct weston_keyboard_grab input_method_grab;
426 struct wl_resource *input_method_resource;
430 struct wl_list base_resource_list;
432 struct weston_pointer *pointer;
433 struct weston_keyboard *keyboard;
434 struct weston_touch *touch;
436 struct wl_signal destroy_signal;
438 struct weston_compositor *compositor;
439 struct weston_surface *sprite;
440 struct wl_listener sprite_destroy_listener;
441 int32_t hotspot_x, hotspot_y;
443 enum weston_keyboard_modifier modifier_state;
444 struct weston_surface *saved_kbd_focus;
445 struct wl_listener saved_kbd_focus_listener;
447 uint32_t selection_serial;
448 struct wl_data_source *selection_data_source;
449 struct wl_listener selection_data_source_listener;
450 struct wl_signal selection_signal;
452 struct wl_list drag_resource_list;
453 struct wl_client *drag_client;
454 struct wl_data_source *drag_data_source;
455 struct wl_listener drag_data_source_listener;
456 struct weston_surface *drag_focus;
457 struct wl_resource *drag_focus_resource;
458 struct wl_listener drag_focus_listener;
459 struct weston_pointer_grab drag_grab;
460 struct weston_surface *drag_surface;
461 struct wl_listener drag_surface_destroy_listener;
462 int32_t drag_dx, drag_dy;
466 void (*led_update)(struct weston_seat *ws, enum weston_led leds);
468 struct weston_xkb_info xkb_info;
470 struct xkb_state *state;
471 enum weston_led leds;
474 struct input_method *input_method;
478 WESTON_COMPOSITOR_ACTIVE,
479 WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */
480 WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */
481 WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dmps
485 struct weston_layer {
486 struct wl_list surface_list;
490 struct weston_plane {
491 pixman_region32_t damage;
492 pixman_region32_t clip;
497 struct weston_renderer {
498 int (*read_pixels)(struct weston_output *output,
499 pixman_format_code_t format, void *pixels,
500 uint32_t x, uint32_t y,
501 uint32_t width, uint32_t height);
502 void (*repaint_output)(struct weston_output *output,
503 pixman_region32_t *output_damage);
504 void (*flush_damage)(struct weston_surface *surface);
505 void (*attach)(struct weston_surface *es, struct wl_buffer *buffer);
506 int (*create_surface)(struct weston_surface *surface);
507 void (*surface_set_color)(struct weston_surface *surface,
508 float red, float green,
509 float blue, float alpha);
510 void (*destroy_surface)(struct weston_surface *surface);
511 void (*destroy)(struct weston_compositor *ec);
514 struct weston_compositor {
515 struct wl_signal destroy_signal;
517 struct wl_display *wl_display;
518 struct weston_shell_interface shell_interface;
520 struct wl_signal activate_signal;
521 struct wl_signal kill_signal;
522 struct wl_signal idle_signal;
523 struct wl_signal wake_signal;
525 struct wl_signal show_input_panel_signal;
526 struct wl_signal hide_input_panel_signal;
527 struct wl_signal update_input_panel_signal;
529 struct wl_signal seat_created_signal;
530 struct wl_signal output_created_signal;
532 struct wl_event_loop *input_loop;
533 struct wl_event_source *input_loop_source;
535 struct weston_layer fade_layer;
536 struct weston_layer cursor_layer;
538 struct wl_list output_list;
539 struct wl_list seat_list;
540 struct wl_list layer_list;
541 struct wl_list surface_list;
542 struct wl_list plane_list;
543 struct wl_list key_binding_list;
544 struct wl_list button_binding_list;
545 struct wl_list axis_binding_list;
546 struct wl_list debug_binding_list;
549 struct wl_event_source *idle_source;
550 uint32_t idle_inhibit;
551 int idle_time; /* timeout, s */
554 struct wl_array vertices;
555 struct wl_array indices; /* only used in compositor-wayland */
556 struct wl_array vtxcnt;
557 struct weston_plane primary_plane;
561 struct weston_renderer *renderer;
563 pixman_format_code_t read_format;
565 void (*destroy)(struct weston_compositor *ec);
566 void (*restore)(struct weston_compositor *ec);
567 int (*authenticate)(struct weston_compositor *c, uint32_t id);
569 void (*ping_handler)(struct weston_surface *surface, uint32_t serial);
573 uint32_t output_id_pool;
575 struct xkb_rule_names xkb_names;
576 struct xkb_context *xkb_context;
577 struct weston_xkb_info xkb_info;
580 struct weston_buffer_reference {
581 struct wl_buffer *buffer;
582 struct wl_listener destroy_listener;
585 struct weston_region {
586 struct wl_resource resource;
587 pixman_region32_t region;
590 /* Using weston_surface transformations
592 * To add a transformation to a surface, create a struct weston_transform, and
593 * add it to the list surface->geometry.transformation_list. Whenever you
594 * change the list, anything under surface->geometry, or anything in the
595 * weston_transforms linked into the list, you must call
596 * weston_surface_geometry_dirty().
598 * The order in the list defines the order of transformations. Let the list
599 * contain the transformation matrices M1, ..., Mn as head to tail. The
600 * transformation is applied to surface-local coordinate vector p as
601 * P = Mn * ... * M2 * M1 * p
602 * to produce the global coordinate vector P. The total transform
604 * is cached in surface->transform.matrix, and the inverse of it in
605 * surface->transform.inverse.
607 * The list always contains surface->transform.position transformation, which
608 * is the translation by surface->geometry.x and y.
610 * If you want to apply a transformation in local coordinates, add your
611 * weston_transform to the head of the list. If you want to apply a
612 * transformation in global coordinates, add it to the tail of the list.
614 * If surface->geometry.parent is set, the total transformation of this
615 * surface will be the parent's total transformation and this transformation
617 * Mparent * Mn * ... * M2 * M1
620 struct weston_surface {
621 struct wl_resource resource;
622 struct weston_compositor *compositor;
623 pixman_region32_t clip;
624 pixman_region32_t damage;
625 pixman_region32_t opaque; /* part of geometry, see below */
626 pixman_region32_t input;
628 struct wl_list layer_link;
629 float alpha; /* part of geometry, see below */
630 struct weston_plane *plane;
632 void *renderer_state;
634 /* Surface geometry state, mutable.
635 * If you change anything, call weston_surface_geometry_dirty().
636 * That includes the transformations referenced from the list.
639 float x, y; /* surface translation on display */
640 int32_t width, height;
642 /* struct weston_transform */
643 struct wl_list transformation_list;
645 /* managed by weston_surface_set_transform_parent() */
646 struct weston_surface *parent;
647 struct wl_listener parent_destroy_listener;
648 struct wl_list child_list; /* geometry.parent_link */
649 struct wl_list parent_link;
652 /* State derived from geometry state, read-only.
653 * This is updated by weston_surface_update_transform().
658 pixman_region32_t boundingbox;
659 pixman_region32_t opaque;
661 /* matrix and inverse are used only if enabled = 1.
662 * If enabled = 0, use x, y, width, height directly.
665 struct weston_matrix matrix;
666 struct weston_matrix inverse;
668 struct weston_transform position; /* matrix from x, y */
672 * Which output to vsync this surface to.
673 * Used to determine, whether to send or queue frame events.
674 * Must be NULL, if 'link' is not in weston_compositor::surface_list.
676 struct weston_output *output;
679 * A more complete representation of all outputs this surface is
682 uint32_t output_mask;
684 struct wl_list frame_callback_list;
686 struct weston_buffer_reference buffer_ref;
687 uint32_t buffer_transform;
688 int keep_buffer; /* bool for backends to prevent early release */
690 /* All the pending state, that wl_surface.commit will apply. */
692 /* wl_surface.attach */
694 struct wl_buffer *buffer;
695 struct wl_listener buffer_destroy_listener;
699 /* wl_surface.damage */
700 pixman_region32_t damage;
702 /* wl_surface.set_opaque_region */
703 pixman_region32_t opaque;
705 /* wl_surface.set_input_region */
706 pixman_region32_t input;
708 /* wl_surface.frame */
709 struct wl_list frame_callback_list;
711 /* wl_surface.set_buffer_transform */
712 uint32_t buffer_transform;
716 * If non-NULL, this function will be called on surface::attach after
717 * a new buffer has been set up for this surface. The integer params
718 * are the sx and sy paramerters supplied to surface::attach .
720 void (*configure)(struct weston_surface *es, int32_t sx, int32_t sy, int32_t width, int32_t height);
721 void *configure_private;
724 enum weston_key_state_update {
725 STATE_UPDATE_AUTOMATIC,
730 weston_version(int *major, int *minor, int *micro);
733 weston_surface_update_transform(struct weston_surface *surface);
736 weston_surface_geometry_dirty(struct weston_surface *surface);
739 weston_surface_to_global_fixed(struct weston_surface *surface,
740 wl_fixed_t sx, wl_fixed_t sy,
741 wl_fixed_t *x, wl_fixed_t *y);
743 weston_surface_to_global_float(struct weston_surface *surface,
744 float sx, float sy, float *x, float *y);
747 weston_surface_from_global_float(struct weston_surface *surface,
748 float x, float y, float *sx, float *sy);
750 weston_surface_from_global(struct weston_surface *surface,
751 int32_t x, int32_t y, int32_t *sx, int32_t *sy);
753 weston_surface_from_global_fixed(struct weston_surface *surface,
754 wl_fixed_t x, wl_fixed_t y,
755 wl_fixed_t *sx, wl_fixed_t *sy);
757 weston_surface_buffer_width(struct weston_surface *surface);
759 weston_surface_buffer_height(struct weston_surface *surface);
762 weston_surface_to_buffer_float(struct weston_surface *surface,
763 float x, float y, float *bx, float *by);
765 weston_surface_to_buffer_rect(struct weston_surface *surface,
766 pixman_box32_t rect);
769 weston_spring_init(struct weston_spring *spring,
770 double k, double current, double target);
772 weston_spring_update(struct weston_spring *spring, uint32_t msec);
774 weston_spring_done(struct weston_spring *spring);
777 weston_surface_activate(struct weston_surface *surface,
778 struct weston_seat *seat);
780 notify_motion(struct weston_seat *seat, uint32_t time,
781 wl_fixed_t dx, wl_fixed_t dy);
783 notify_motion_absolute(struct weston_seat *seat, uint32_t time,
784 wl_fixed_t x, wl_fixed_t y);
786 notify_button(struct weston_seat *seat, uint32_t time, int32_t button,
787 enum wl_pointer_button_state state);
789 notify_axis(struct weston_seat *seat, uint32_t time, uint32_t axis,
792 notify_key(struct weston_seat *seat, uint32_t time, uint32_t key,
793 enum wl_keyboard_key_state state,
794 enum weston_key_state_update update_state);
796 notify_modifiers(struct weston_seat *seat, uint32_t serial);
799 notify_pointer_focus(struct weston_seat *seat, struct weston_output *output,
800 wl_fixed_t x, wl_fixed_t y);
803 notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys,
804 enum weston_key_state_update update_state);
806 notify_keyboard_focus_out(struct weston_seat *seat);
809 notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
810 wl_fixed_t x, wl_fixed_t y, int touch_type);
813 weston_layer_init(struct weston_layer *layer, struct wl_list *below);
816 weston_plane_init(struct weston_plane *plane, int32_t x, int32_t y);
818 weston_plane_release(struct weston_plane *plane);
821 weston_compositor_stack_plane(struct weston_compositor *ec,
822 struct weston_plane *plane,
823 struct weston_plane *above);
826 weston_output_finish_frame(struct weston_output *output, uint32_t msecs);
828 weston_output_schedule_repaint(struct weston_output *output);
830 weston_output_damage(struct weston_output *output);
832 weston_compositor_schedule_repaint(struct weston_compositor *compositor);
834 weston_compositor_fade(struct weston_compositor *compositor, float tint);
836 weston_compositor_damage_all(struct weston_compositor *compositor);
838 weston_compositor_unlock(struct weston_compositor *compositor);
840 weston_compositor_wake(struct weston_compositor *compositor);
842 weston_compositor_offscreen(struct weston_compositor *compositor);
844 weston_compositor_sleep(struct weston_compositor *compositor);
845 struct weston_surface *
846 weston_compositor_pick_surface(struct weston_compositor *compositor,
847 wl_fixed_t x, wl_fixed_t y,
848 wl_fixed_t *sx, wl_fixed_t *sy);
851 struct weston_binding;
852 typedef void (*weston_key_binding_handler_t)(struct weston_seat *seat,
853 uint32_t time, uint32_t key,
855 struct weston_binding *
856 weston_compositor_add_key_binding(struct weston_compositor *compositor,
858 enum weston_keyboard_modifier modifier,
859 weston_key_binding_handler_t binding,
862 typedef void (*weston_button_binding_handler_t)(struct weston_seat *seat,
863 uint32_t time, uint32_t button,
865 struct weston_binding *
866 weston_compositor_add_button_binding(struct weston_compositor *compositor,
868 enum weston_keyboard_modifier modifier,
869 weston_button_binding_handler_t binding,
872 typedef void (*weston_axis_binding_handler_t)(struct weston_seat *seat,
873 uint32_t time, uint32_t axis,
874 wl_fixed_t value, void *data);
875 struct weston_binding *
876 weston_compositor_add_axis_binding(struct weston_compositor *compositor,
878 enum weston_keyboard_modifier modifier,
879 weston_axis_binding_handler_t binding,
881 struct weston_binding *
882 weston_compositor_add_debug_binding(struct weston_compositor *compositor,
884 weston_key_binding_handler_t binding,
887 weston_binding_destroy(struct weston_binding *binding);
890 weston_binding_list_destroy_all(struct wl_list *list);
893 weston_compositor_run_key_binding(struct weston_compositor *compositor,
894 struct weston_seat *seat, uint32_t time,
896 enum wl_keyboard_key_state state);
898 weston_compositor_run_button_binding(struct weston_compositor *compositor,
899 struct weston_seat *seat, uint32_t time,
901 enum wl_pointer_button_state value);
903 weston_compositor_run_axis_binding(struct weston_compositor *compositor,
904 struct weston_seat *seat, uint32_t time,
905 uint32_t axis, int32_t value);
907 weston_compositor_run_debug_binding(struct weston_compositor *compositor,
908 struct weston_seat *seat, uint32_t time,
910 enum wl_keyboard_key_state state);
913 weston_environment_get_fd(const char *env);
916 weston_compositor_top(struct weston_compositor *compositor);
918 struct weston_surface *
919 weston_surface_create(struct weston_compositor *compositor);
922 weston_surface_configure(struct weston_surface *surface,
923 float x, float y, int width, int height);
926 weston_surface_restack(struct weston_surface *surface, struct wl_list *below);
929 weston_surface_set_position(struct weston_surface *surface,
933 weston_surface_set_transform_parent(struct weston_surface *surface,
934 struct weston_surface *parent);
937 weston_surface_is_mapped(struct weston_surface *surface);
940 weston_surface_schedule_repaint(struct weston_surface *surface);
943 weston_surface_damage(struct weston_surface *surface);
946 weston_surface_damage_below(struct weston_surface *surface);
949 weston_surface_move_to_plane(struct weston_surface *surface,
950 struct weston_plane *plane);
952 weston_surface_unmap(struct weston_surface *surface);
955 weston_buffer_reference(struct weston_buffer_reference *ref,
956 struct wl_buffer *buffer);
959 weston_compositor_get_time(void);
962 weston_compositor_init(struct weston_compositor *ec, struct wl_display *display,
963 int *argc, char *argv[], const char *config_file);
965 weston_compositor_shutdown(struct weston_compositor *ec);
967 weston_text_cursor_position_notify(struct weston_surface *surface,
968 wl_fixed_t x, wl_fixed_t y);
970 weston_output_init_zoom(struct weston_output *output);
972 weston_output_update_zoom(struct weston_output *output, uint32_t type);
974 weston_output_update_matrix(struct weston_output *output);
976 weston_output_move(struct weston_output *output, int x, int y);
978 weston_output_init(struct weston_output *output, struct weston_compositor *c,
979 int x, int y, int width, int height, uint32_t transform);
981 weston_output_destroy(struct weston_output *output);
984 weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec);
986 weston_seat_init_pointer(struct weston_seat *seat);
988 weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
990 weston_seat_init_touch(struct weston_seat *seat);
992 weston_seat_repick(struct weston_seat *seat);
995 weston_seat_release(struct weston_seat *seat);
997 weston_compositor_xkb_init(struct weston_compositor *ec,
998 struct xkb_rule_names *names);
1000 weston_compositor_xkb_destroy(struct weston_compositor *ec);
1002 /* String literal of spaces, the same width as the timestamp. */
1003 #define STAMP_SPACE " "
1006 weston_log_file_open(const char *filename);
1008 weston_log_file_close(void);
1010 weston_log(const char *fmt, ...)
1011 __attribute__ ((format (printf, 1, 2)));
1013 weston_log_continue(const char *fmt, ...)
1014 __attribute__ ((format (printf, 1, 2)));
1021 typedef void (*tty_vt_func_t)(struct weston_compositor *compositor, int event);
1024 tty_create(struct weston_compositor *compositor,
1025 tty_vt_func_t vt_func, int tty_nr);
1028 tty_destroy(struct tty *tty);
1031 tty_reset(struct tty *tty);
1034 tty_activate_vt(struct tty *tty, int vt);
1037 screenshooter_create(struct weston_compositor *ec);
1040 clipboard_create(struct weston_seat *seat);
1043 text_cursor_position_notifier_create(struct weston_compositor *ec);
1046 text_backend_init(struct weston_compositor *ec);
1048 struct weston_process;
1049 typedef void (*weston_process_cleanup_func_t)(struct weston_process *process,
1052 struct weston_process {
1054 weston_process_cleanup_func_t cleanup;
1055 struct wl_list link;
1059 weston_client_launch(struct weston_compositor *compositor,
1060 struct weston_process *proc,
1062 weston_process_cleanup_func_t cleanup);
1065 weston_watch_process(struct weston_process *process);
1067 struct weston_surface_animation;
1068 typedef void (*weston_surface_animation_done_func_t)(struct weston_surface_animation *animation, void *data);
1070 struct weston_surface_animation *
1071 weston_zoom_run(struct weston_surface *surface, float start, float stop,
1072 weston_surface_animation_done_func_t done, void *data);
1074 struct weston_surface_animation *
1075 weston_fade_run(struct weston_surface *surface,
1076 float start, float end, float k,
1077 weston_surface_animation_done_func_t done, void *data);
1079 weston_fade_update(struct weston_surface_animation *fade,
1080 float start, float end, float k);
1082 struct weston_surface_animation *
1083 weston_slide_run(struct weston_surface *surface, float start, float stop,
1084 weston_surface_animation_done_func_t done, void *data);
1087 weston_surface_set_color(struct weston_surface *surface,
1088 float red, float green, float blue, float alpha);
1091 weston_surface_destroy(struct weston_surface *surface);
1094 weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode);
1097 noop_renderer_init(struct weston_compositor *ec);
1099 struct weston_compositor *
1100 backend_init(struct wl_display *display, int *argc, char *argv[],
1101 const char *config_file);
1104 module_init(struct weston_compositor *compositor,
1105 int *argc, char *argv[], const char *config_file);
1108 weston_transformed_coord(int width, int height,
1109 enum wl_output_transform transform,
1110 float sx, float sy, float *bx, float *by);
1112 weston_transformed_rect(int width, int height,
1113 enum wl_output_transform transform,
1114 pixman_box32_t rect);