downstream: terminal: destroy display at the end.
[profile/ivi/weston-ivi-shell.git] / src / compositor.h
1 /*
2  * Copyright © 2008-2011 Kristian Høgsberg
3  * Copyright © 2012 Collabora, Ltd.
4  *
5  * Permission to use, copy, modify, distribute, and sell this software and
6  * its documentation for any purpose is hereby granted without fee, provided
7  * that the above copyright notice appear in all copies and that both that
8  * copyright notice and this permission notice appear in supporting
9  * documentation, and that the name of the copyright holders not be used in
10  * advertising or publicity pertaining to distribution of the software
11  * without specific, written prior permission.  The copyright holders make
12  * no representations about the suitability of this software for any
13  * purpose.  It is provided "as is" without express or implied warranty.
14  *
15  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
16  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
19  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
20  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22  */
23
24 #ifndef _WAYLAND_SYSTEM_COMPOSITOR_H_
25 #define _WAYLAND_SYSTEM_COMPOSITOR_H_
26
27 #ifdef  __cplusplus
28 extern "C" {
29 #endif
30
31 #include <pixman.h>
32 #include <xkbcommon/xkbcommon.h>
33
34 #define WL_HIDE_DEPRECATED
35 #include <wayland-server.h>
36
37 #include "version.h"
38 #include "matrix.h"
39 #include "config-parser.h"
40 #include "zalloc.h"
41
42 #ifndef MIN
43 #define MIN(x,y) (((x) < (y)) ? (x) : (y))
44 #endif
45
46 #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
47
48 #define container_of(ptr, type, member) ({                              \
49         const __typeof__( ((type *)0)->member ) *__mptr = (ptr);        \
50         (type *)( (char *)__mptr - offsetof(type,member) );})
51
52 struct weston_transform {
53         struct weston_matrix matrix;
54         struct wl_list link;
55 };
56
57 struct weston_surface;
58 struct weston_buffer;
59 struct shell_surface;
60 struct weston_seat;
61 struct weston_output;
62 struct input_method;
63
64 enum weston_keyboard_modifier {
65         MODIFIER_CTRL = (1 << 0),
66         MODIFIER_ALT = (1 << 1),
67         MODIFIER_SUPER = (1 << 2),
68         MODIFIER_SHIFT = (1 << 3),
69 };
70
71 enum weston_keyboard_locks {
72         WESTON_NUM_LOCK = (1 << 0),
73         WESTON_CAPS_LOCK = (1 << 1),
74 };
75
76 enum weston_led {
77         LED_NUM_LOCK = (1 << 0),
78         LED_CAPS_LOCK = (1 << 1),
79         LED_SCROLL_LOCK = (1 << 2),
80 };
81
82 struct weston_mode {
83         uint32_t flags;
84         int32_t width, height;
85         uint32_t refresh;
86         struct wl_list link;
87 };
88
89 struct weston_shell_client {
90         void (*send_configure)(struct weston_surface *surface, int32_t width, int32_t height);
91 };
92
93 struct weston_shell_interface {
94         void *shell;                    /* either desktop or tablet */
95
96         struct shell_surface *(*create_shell_surface)(void *shell,
97                                                       struct weston_surface *surface,
98                                                       const struct weston_shell_client *client);
99         struct weston_view *(*get_primary_view)(void *shell,
100                                                 struct shell_surface *shsurf);
101
102         void (*set_toplevel)(struct shell_surface *shsurf);
103
104         void (*set_transient)(struct shell_surface *shsurf,
105                               struct weston_surface *parent,
106                               int x, int y, uint32_t flags);
107         void (*set_fullscreen)(struct shell_surface *shsurf,
108                                uint32_t method,
109                                uint32_t framerate,
110                                struct weston_output *output);
111         void (*set_xwayland)(struct shell_surface *shsurf,
112                                int x, int y, uint32_t flags);
113         int (*move)(struct shell_surface *shsurf, struct weston_seat *ws);
114         int (*resize)(struct shell_surface *shsurf,
115                       struct weston_seat *ws, uint32_t edges);
116         void (*set_title)(struct shell_surface *shsurf,
117                           const char *title);
118         void (*set_window_geometry)(struct shell_surface *shsurf,
119                                     int32_t x, int32_t y,
120                                     int32_t width, int32_t height);
121 };
122
123 struct weston_animation {
124         void (*frame)(struct weston_animation *animation,
125                       struct weston_output *output, uint32_t msecs);
126         int frame_counter;
127         struct wl_list link;
128 };
129
130 enum {
131         WESTON_SPRING_OVERSHOOT,
132         WESTON_SPRING_CLAMP,
133         WESTON_SPRING_BOUNCE
134 };
135
136 struct weston_spring {
137         double k;
138         double friction;
139         double current;
140         double target;
141         double previous;
142         double min, max;
143         uint32_t timestamp;
144         uint32_t clip;
145 };
146
147 struct weston_fixed_point {
148         wl_fixed_t x, y;
149 };
150
151 struct weston_output_zoom {
152         int active;
153         float increment;
154         float level;
155         float max_level;
156         float trans_x, trans_y;
157         struct weston_animation animation_z;
158         struct weston_spring spring_z;
159         struct weston_animation animation_xy;
160         struct weston_spring spring_xy;
161         struct weston_fixed_point from;
162         struct weston_fixed_point to;
163         struct weston_fixed_point current;
164         struct wl_listener motion_listener;
165 };
166
167 /* bit compatible with drm definitions. */
168 enum dpms_enum {
169         WESTON_DPMS_ON,
170         WESTON_DPMS_STANDBY,
171         WESTON_DPMS_SUSPEND,
172         WESTON_DPMS_OFF
173 };
174
175 enum weston_mode_switch_op {
176         WESTON_MODE_SWITCH_SET_NATIVE,
177         WESTON_MODE_SWITCH_SET_TEMPORARY,
178         WESTON_MODE_SWITCH_RESTORE_NATIVE
179 };
180
181 struct weston_output {
182         uint32_t id;
183         char *name;
184
185         struct {
186                 char *seatname;
187                 struct weston_seat *seat;
188         } seat_data;
189
190         void *renderer_state;
191
192         struct wl_list link;
193         struct wl_list resource_list;
194         struct wl_global *global;
195         struct weston_compositor *compositor;
196         struct weston_matrix matrix;
197         struct wl_list animation_list;
198         int32_t x, y, width, height;
199         int32_t mm_width, mm_height;
200         pixman_region32_t region;
201         pixman_region32_t previous_damage;
202         int repaint_needed;
203         int repaint_scheduled;
204         struct weston_output_zoom zoom;
205         int dirty;
206         struct wl_signal frame_signal;
207         struct wl_signal destroy_signal;
208         int move_x, move_y;
209         uint32_t frame_time;
210         int disable_planes;
211         uint32_t default_output;
212         int destroying;
213
214         char *make, *model, *serial_number;
215         uint32_t subpixel;
216         uint32_t transform;
217         int32_t native_scale;
218         int32_t current_scale;
219         int32_t original_scale;
220
221         struct weston_mode *native_mode;
222         struct weston_mode *current_mode;
223         struct weston_mode *original_mode;
224         struct wl_list mode_list;
225
226         void (*start_repaint_loop)(struct weston_output *output);
227         int (*repaint)(struct weston_output *output,
228                         pixman_region32_t *damage);
229         void (*destroy)(struct weston_output *output);
230         void (*assign_planes)(struct weston_output *output);
231         int (*switch_mode)(struct weston_output *output, struct weston_mode *mode);
232
233         /* backlight values are on 0-255 range, where higher is brighter */
234         int32_t backlight_current;
235         void (*set_backlight)(struct weston_output *output, uint32_t value);
236         void (*set_dpms)(struct weston_output *output, enum dpms_enum level);
237
238         int connection_internal;
239         uint16_t gamma_size;
240         void (*set_gamma)(struct weston_output *output,
241                           uint16_t size,
242                           uint16_t *r,
243                           uint16_t *g,
244                           uint16_t *b);
245 };
246
247 struct weston_pointer_grab;
248 struct weston_pointer_grab_interface {
249         void (*focus)(struct weston_pointer_grab *grab);
250         void (*motion)(struct weston_pointer_grab *grab, uint32_t time,
251                        wl_fixed_t x, wl_fixed_t y);
252         void (*button)(struct weston_pointer_grab *grab,
253                        uint32_t time, uint32_t button, uint32_t state);
254         void (*cancel)(struct weston_pointer_grab *grab);
255 };
256
257 struct weston_pointer_grab {
258         const struct weston_pointer_grab_interface *interface;
259         struct weston_pointer *pointer;
260 };
261
262 struct weston_keyboard_grab;
263 struct weston_keyboard_grab_interface {
264         void (*key)(struct weston_keyboard_grab *grab, uint32_t time,
265                     uint32_t key, uint32_t state);
266         void (*modifiers)(struct weston_keyboard_grab *grab, uint32_t serial,
267                           uint32_t mods_depressed, uint32_t mods_latched,
268                           uint32_t mods_locked, uint32_t group);
269         void (*cancel)(struct weston_keyboard_grab *grab);
270 };
271
272 struct weston_keyboard_grab {
273         const struct weston_keyboard_grab_interface *interface;
274         struct weston_keyboard *keyboard;
275 };
276
277 struct weston_touch_grab;
278 struct weston_touch_grab_interface {
279         void (*down)(struct weston_touch_grab *grab,
280                         uint32_t time,
281                         int touch_id,
282                         wl_fixed_t sx,
283                         wl_fixed_t sy);
284         void (*up)(struct weston_touch_grab *grab,
285                         uint32_t time,
286                         int touch_id);
287         void (*motion)(struct weston_touch_grab *grab,
288                         uint32_t time,
289                         int touch_id,
290                         wl_fixed_t sx,
291                         wl_fixed_t sy);
292         void (*frame)(struct weston_touch_grab *grab);
293         void (*cancel)(struct weston_touch_grab *grab);
294 };
295
296 struct weston_touch_grab {
297         const struct weston_touch_grab_interface *interface;
298         struct weston_touch *touch;
299 };
300
301 struct weston_data_offer {
302         struct wl_resource *resource;
303         struct weston_data_source *source;
304         struct wl_listener source_destroy_listener;
305 };
306
307 struct weston_data_source {
308         struct wl_resource *resource;
309         struct wl_signal destroy_signal;
310         struct wl_array mime_types;
311
312         void (*accept)(struct weston_data_source *source,
313                        uint32_t serial, const char *mime_type);
314         void (*send)(struct weston_data_source *source,
315                      const char *mime_type, int32_t fd);
316         void (*cancel)(struct weston_data_source *source);
317 };
318
319 struct weston_pointer {
320         struct weston_seat *seat;
321
322         struct wl_list resource_list;
323         struct wl_list focus_resource_list;
324         struct weston_view *focus;
325         uint32_t focus_serial;
326         struct wl_listener focus_view_listener;
327         struct wl_listener focus_resource_listener;
328         struct wl_signal focus_signal;
329         struct wl_signal motion_signal;
330
331         struct weston_view *sprite;
332         struct wl_listener sprite_destroy_listener;
333         int32_t hotspot_x, hotspot_y;
334
335         struct weston_pointer_grab *grab;
336         struct weston_pointer_grab default_grab;
337         wl_fixed_t grab_x, grab_y;
338         uint32_t grab_button;
339         uint32_t grab_serial;
340         uint32_t grab_time;
341
342         wl_fixed_t x, y;
343         wl_fixed_t sx, sy;
344         uint32_t button_count;
345
346         struct wl_listener output_destroy_listener;
347 };
348
349
350 struct weston_touch {
351         struct weston_seat *seat;
352
353         struct wl_list resource_list;
354         struct wl_list focus_resource_list;
355         struct weston_view *focus;
356         struct wl_listener focus_view_listener;
357         struct wl_listener focus_resource_listener;
358         uint32_t focus_serial;
359         struct wl_signal focus_signal;
360
361         uint32_t num_tp;
362
363         struct weston_touch_grab *grab;
364         struct weston_touch_grab default_grab;
365         int grab_touch_id;
366         wl_fixed_t grab_x, grab_y;
367         uint32_t grab_serial;
368         uint32_t grab_time;
369 };
370
371 struct weston_pointer *
372 weston_pointer_create(struct weston_seat *seat);
373 void
374 weston_pointer_destroy(struct weston_pointer *pointer);
375 void
376 weston_pointer_set_focus(struct weston_pointer *pointer,
377                          struct weston_view *view,
378                          wl_fixed_t sx, wl_fixed_t sy);
379 void
380 weston_pointer_start_grab(struct weston_pointer *pointer,
381                           struct weston_pointer_grab *grab);
382 void
383 weston_pointer_end_grab(struct weston_pointer *pointer);
384 void
385 weston_pointer_clamp(struct weston_pointer *pointer,
386                             wl_fixed_t *fx, wl_fixed_t *fy);
387 void
388 weston_pointer_move(struct weston_pointer *pointer,
389                     wl_fixed_t x, wl_fixed_t y);
390 void
391 weston_pointer_set_default_grab(struct weston_pointer *pointer,
392                 const struct weston_pointer_grab_interface *interface);
393
394 struct weston_keyboard *
395 weston_keyboard_create(void);
396 void
397 weston_keyboard_destroy(struct weston_keyboard *keyboard);
398 void
399 weston_keyboard_set_focus(struct weston_keyboard *keyboard,
400                           struct weston_surface *surface);
401 void
402 weston_keyboard_start_grab(struct weston_keyboard *device,
403                            struct weston_keyboard_grab *grab);
404 void
405 weston_keyboard_end_grab(struct weston_keyboard *keyboard);
406 int
407 /*
408  * 'mask' and 'value' should be a bitwise mask of one or more
409  * valued of the weston_keyboard_locks enum.
410  */
411 weston_keyboard_set_locks(struct weston_keyboard *keyboard,
412                           uint32_t mask, uint32_t value);
413
414 struct weston_touch *
415 weston_touch_create(void);
416 void
417 weston_touch_destroy(struct weston_touch *touch);
418 void
419 weston_touch_set_focus(struct weston_seat *seat,
420                        struct weston_view *view);
421 void
422 weston_touch_start_grab(struct weston_touch *device,
423                         struct weston_touch_grab *grab);
424 void
425 weston_touch_end_grab(struct weston_touch *touch);
426
427 void
428 wl_data_device_set_keyboard_focus(struct weston_seat *seat);
429
430 int
431 wl_data_device_manager_init(struct wl_display *display);
432
433
434 void
435 weston_seat_set_selection(struct weston_seat *seat,
436                           struct weston_data_source *source, uint32_t serial);
437 int
438 weston_pointer_start_drag(struct weston_pointer *pointer,
439                        struct weston_data_source *source,
440                        struct weston_surface *icon,
441                        struct wl_client *client);
442 int
443 weston_touch_start_drag(struct weston_touch *touch,
444                         struct weston_data_source *source,
445                         struct weston_surface *icon,
446                         struct wl_client *client);
447
448 struct weston_xkb_info {
449         struct xkb_keymap *keymap;
450         int keymap_fd;
451         size_t keymap_size;
452         char *keymap_area;
453         int32_t ref_count;
454         xkb_mod_index_t shift_mod;
455         xkb_mod_index_t caps_mod;
456         xkb_mod_index_t ctrl_mod;
457         xkb_mod_index_t alt_mod;
458         xkb_mod_index_t mod2_mod;
459         xkb_mod_index_t mod3_mod;
460         xkb_mod_index_t super_mod;
461         xkb_mod_index_t mod5_mod;
462         xkb_led_index_t num_led;
463         xkb_led_index_t caps_led;
464         xkb_led_index_t scroll_led;
465 };
466
467 struct weston_keyboard {
468         struct weston_seat *seat;
469
470         struct wl_list resource_list;
471         struct wl_list focus_resource_list;
472         struct weston_surface *focus;
473         struct wl_listener focus_resource_listener;
474         uint32_t focus_serial;
475         struct wl_signal focus_signal;
476
477         struct weston_keyboard_grab *grab;
478         struct weston_keyboard_grab default_grab;
479         uint32_t grab_key;
480         uint32_t grab_serial;
481         uint32_t grab_time;
482
483         struct wl_array keys;
484
485         struct {
486                 uint32_t mods_depressed;
487                 uint32_t mods_latched;
488                 uint32_t mods_locked;
489                 uint32_t group;
490         } modifiers;
491
492         struct weston_keyboard_grab input_method_grab;
493         struct wl_resource *input_method_resource;
494
495         struct weston_xkb_info *xkb_info;
496         struct {
497                 struct xkb_state *state;
498                 enum weston_led leds;
499         } xkb_state;
500         struct xkb_keymap *pending_keymap;
501 };
502
503 struct weston_seat {
504         struct wl_list base_resource_list;
505
506         struct wl_global *global;
507         struct weston_pointer *pointer;
508         struct weston_keyboard *keyboard;
509         struct weston_touch *touch;
510         int pointer_device_count;
511         int keyboard_device_count;
512         int touch_device_count;
513
514         struct wl_signal destroy_signal;
515         struct wl_signal updated_caps_signal;
516
517         struct weston_compositor *compositor;
518         struct wl_list link;
519         enum weston_keyboard_modifier modifier_state;
520         struct weston_surface *saved_kbd_focus;
521         struct wl_listener saved_kbd_focus_listener;
522         struct wl_list drag_resource_list;
523
524         uint32_t selection_serial;
525         struct weston_data_source *selection_data_source;
526         struct wl_listener selection_data_source_listener;
527         struct wl_signal selection_signal;
528
529         void (*led_update)(struct weston_seat *ws, enum weston_led leds);
530
531         uint32_t slot_map;
532         struct input_method *input_method;
533         char *seat_name;
534 };
535
536 enum {
537         WESTON_COMPOSITOR_ACTIVE,
538         WESTON_COMPOSITOR_IDLE,         /* shell->unlock called on activity */
539         WESTON_COMPOSITOR_OFFSCREEN,    /* no rendering, no frame events */
540         WESTON_COMPOSITOR_SLEEPING      /* same as offscreen, but also set dmps
541                                          * to off */
542 };
543
544 struct weston_layer_entry {
545         struct wl_list link;
546         struct weston_layer *layer;
547 };
548
549 struct weston_layer {
550         struct weston_layer_entry view_list;
551         struct wl_list link;
552         pixman_box32_t mask;
553 };
554
555 struct weston_plane {
556         struct weston_compositor *compositor;
557         pixman_region32_t damage;
558         pixman_region32_t clip;
559         int32_t x, y;
560         struct wl_list link;
561 };
562
563 struct weston_renderer {
564         int (*read_pixels)(struct weston_output *output,
565                                pixman_format_code_t format, void *pixels,
566                                uint32_t x, uint32_t y,
567                                uint32_t width, uint32_t height);
568         int (*read_surface_pixels)(struct weston_surface *es,
569                                    pixman_format_code_t format, void *pixels,
570                                    int x, int y, int width, int height);
571         void (*repaint_output)(struct weston_output *output,
572                                pixman_region32_t *output_damage);
573         void (*flush_damage)(struct weston_surface *surface);
574         void (*attach)(struct weston_surface *es, struct weston_buffer *buffer);
575         void (*surface_set_color)(struct weston_surface *surface,
576                                float red, float green,
577                                float blue, float alpha);
578         void (*destroy)(struct weston_compositor *ec);
579 };
580
581 enum weston_capability {
582         /* backend/renderer supports arbitrary rotation */
583         WESTON_CAP_ROTATION_ANY                 = 0x0001,
584
585         /* screencaptures need to be y-flipped */
586         WESTON_CAP_CAPTURE_YFLIP                = 0x0002,
587
588         /* backend/renderer has a seperate cursor plane */
589         WESTON_CAP_CURSOR_PLANE                 = 0x0004,
590
591         /* backend supports setting arbitrary resolutions */
592         WESTON_CAP_ARBITRARY_MODES              = 0x0008,
593 };
594
595 struct weston_compositor {
596         struct wl_signal destroy_signal;
597
598         struct wl_display *wl_display;
599         struct weston_shell_interface shell_interface;
600         struct weston_config *config;
601
602         /* surface signals */
603         struct wl_signal create_surface_signal;
604         struct wl_signal activate_signal;
605         struct wl_signal transform_signal;
606
607         struct wl_signal kill_signal;
608         struct wl_signal idle_signal;
609         struct wl_signal wake_signal;
610
611         struct wl_signal show_input_panel_signal;
612         struct wl_signal hide_input_panel_signal;
613         struct wl_signal update_input_panel_signal;
614
615         struct wl_signal seat_created_signal;
616         struct wl_signal output_created_signal;
617         struct wl_signal output_destroyed_signal;
618         struct wl_signal output_moved_signal;
619
620         struct wl_event_loop *input_loop;
621         struct wl_event_source *input_loop_source;
622
623         struct wl_signal session_signal;
624         int session_active;
625
626         struct weston_layer fade_layer;
627         struct weston_layer cursor_layer;
628
629         struct wl_list output_list;
630         struct wl_list seat_list;
631         struct wl_list layer_list;
632         struct wl_list view_list;
633         struct wl_list plane_list;
634         struct wl_list key_binding_list;
635         struct wl_list modifier_binding_list;
636         struct wl_list button_binding_list;
637         struct wl_list touch_binding_list;
638         struct wl_list axis_binding_list;
639         struct wl_list debug_binding_list;
640
641         struct weston_output *default_output;
642
643         uint32_t state;
644         struct wl_event_source *idle_source;
645         uint32_t idle_inhibit;
646         int idle_time;                  /* timeout, s */
647
648         const struct weston_pointer_grab_interface *default_pointer_grab;
649
650         /* Repaint state. */
651         struct weston_plane primary_plane;
652         uint32_t capabilities; /* combination of enum weston_capability */
653
654         struct weston_renderer *renderer;
655
656         pixman_format_code_t read_format;
657
658         void (*destroy)(struct weston_compositor *ec);
659         void (*restore)(struct weston_compositor *ec);
660         int (*authenticate)(struct weston_compositor *c, uint32_t id);
661
662         struct weston_launcher *launcher;
663
664         uint32_t output_id_pool;
665
666         struct xkb_rule_names xkb_names;
667         struct xkb_context *xkb_context;
668         struct weston_xkb_info *xkb_info;
669
670         /* Raw keyboard processing (no libxkbcommon initialization or handling) */
671         int use_xkbcommon;
672
673         int32_t kb_repeat_rate;
674         int32_t kb_repeat_delay;
675 };
676
677 struct weston_buffer {
678         struct wl_resource *resource;
679         struct wl_signal destroy_signal;
680         struct wl_listener destroy_listener;
681
682         union {
683                 struct wl_shm_buffer *shm_buffer;
684                 void *legacy_buffer;
685         };
686         int32_t width, height;
687         uint32_t busy_count;
688         int y_inverted;
689 };
690
691 struct weston_buffer_reference {
692         struct weston_buffer *buffer;
693         struct wl_listener destroy_listener;
694 };
695
696 struct weston_buffer_viewport {
697         struct {
698                 /* wl_surface.set_buffer_transform */
699                 uint32_t transform;
700
701                 /* wl_surface.set_scaling_factor */
702                 int32_t scale;
703
704                 /*
705                  * If src_width != wl_fixed_from_int(-1),
706                  * then and only then src_* are used.
707                  */
708                 wl_fixed_t src_x, src_y;
709                 wl_fixed_t src_width, src_height;
710         } buffer;
711
712         struct {
713                 /*
714                  * If width == -1, the size is inferred from the buffer.
715                  */
716                 int32_t width, height;
717         } surface;
718
719         int changed;
720 };
721
722 struct weston_region {
723         struct wl_resource *resource;
724         pixman_region32_t region;
725 };
726
727 /* Using weston_view transformations
728  *
729  * To add a transformation to a view, create a struct weston_transform, and
730  * add it to the list view->geometry.transformation_list. Whenever you
731  * change the list, anything under view->geometry, or anything in the
732  * weston_transforms linked into the list, you must call
733  * weston_view_geometry_dirty().
734  *
735  * The order in the list defines the order of transformations. Let the list
736  * contain the transformation matrices M1, ..., Mn as head to tail. The
737  * transformation is applied to view-local coordinate vector p as
738  *    P = Mn * ... * M2 * M1 * p
739  * to produce the global coordinate vector P. The total transform
740  *    Mn * ... * M2 * M1
741  * is cached in view->transform.matrix, and the inverse of it in
742  * view->transform.inverse.
743  *
744  * The list always contains view->transform.position transformation, which
745  * is the translation by view->geometry.x and y.
746  *
747  * If you want to apply a transformation in local coordinates, add your
748  * weston_transform to the head of the list. If you want to apply a
749  * transformation in global coordinates, add it to the tail of the list.
750  *
751  * If view->geometry.parent is set, the total transformation of this
752  * view will be the parent's total transformation and this transformation
753  * combined:
754  *    Mparent * Mn * ... * M2 * M1
755  */
756
757 struct weston_view {
758         struct weston_surface *surface;
759         struct wl_list surface_link;
760         struct wl_signal destroy_signal;
761
762         struct wl_list link;
763         struct weston_layer_entry layer_link;
764         struct weston_plane *plane;
765         struct weston_view *parent_view;
766
767         pixman_region32_t clip;
768         float alpha;                     /* part of geometry, see below */
769
770         void *renderer_state;
771
772         /* Surface geometry state, mutable.
773          * If you change anything, call weston_surface_geometry_dirty().
774          * That includes the transformations referenced from the list.
775          */
776         struct {
777                 float x, y; /* surface translation on display */
778
779                 /* struct weston_transform */
780                 struct wl_list transformation_list;
781
782                 /* managed by weston_surface_set_transform_parent() */
783                 struct weston_view *parent;
784                 struct wl_listener parent_destroy_listener;
785                 struct wl_list child_list; /* geometry.parent_link */
786                 struct wl_list parent_link;
787         } geometry;
788
789         /* State derived from geometry state, read-only.
790          * This is updated by weston_view_update_transform().
791          */
792         struct {
793                 int dirty;
794
795                 pixman_region32_t boundingbox;
796                 pixman_region32_t opaque;
797                 pixman_region32_t masked_boundingbox;
798                 pixman_region32_t masked_opaque;
799
800                 /* matrix and inverse are used only if enabled = 1.
801                  * If enabled = 0, use x, y, width, height directly.
802                  */
803                 int enabled;
804                 struct weston_matrix matrix;
805                 struct weston_matrix inverse;
806
807                 struct weston_transform position; /* matrix from x, y */
808         } transform;
809
810         /*
811          * Which output to vsync this surface to.
812          * Used to determine, whether to send or queue frame events.
813          * Must be NULL, if 'link' is not in weston_compositor::surface_list.
814          */
815         struct weston_output *output;
816
817         /*
818          * A more complete representation of all outputs this surface is
819          * displayed on.
820          */
821         uint32_t output_mask;
822 };
823
824 struct weston_surface_state {
825         /* wl_surface.attach */
826         int newly_attached;
827         struct weston_buffer *buffer;
828         struct wl_listener buffer_destroy_listener;
829         int32_t sx;
830         int32_t sy;
831
832         /* wl_surface.damage */
833         pixman_region32_t damage;
834
835         /* wl_surface.set_opaque_region */
836         pixman_region32_t opaque;
837
838         /* wl_surface.set_input_region */
839         pixman_region32_t input;
840
841         /* wl_surface.frame */
842         struct wl_list frame_callback_list;
843
844         /* wl_surface.set_buffer_transform */
845         /* wl_surface.set_scaling_factor */
846         /* wl_viewport.set */
847         struct weston_buffer_viewport buffer_viewport;
848 };
849
850 struct weston_surface {
851         struct wl_resource *resource;
852         struct wl_signal destroy_signal;
853         struct weston_compositor *compositor;
854         pixman_region32_t damage;
855         pixman_region32_t opaque;        /* part of geometry, see below */
856         pixman_region32_t input;
857         int32_t width, height;
858         int32_t ref_count;
859
860         /* Not for long-term storage.  This exists for book-keeping while
861          * iterating over surfaces and views
862          */
863         int32_t touched;
864
865         void *renderer_state;
866
867         struct wl_list views;
868
869         /*
870          * Which output to vsync this surface to.
871          * Used to determine, whether to send or queue frame events.
872          * Must be NULL, if 'link' is not in weston_compositor::surface_list.
873          */
874         struct weston_output *output;
875
876         /*
877          * A more complete representation of all outputs this surface is
878          * displayed on.
879          */
880         uint32_t output_mask;
881
882         struct wl_list frame_callback_list;
883
884         struct weston_buffer_reference buffer_ref;
885         struct weston_buffer_viewport buffer_viewport;
886         int32_t width_from_buffer; /* before applying viewport */
887         int32_t height_from_buffer;
888         int keep_buffer; /* bool for backends to prevent early release */
889
890         /* wl_viewport resource for this surface */
891         struct wl_resource *viewport_resource;
892
893         /* All the pending state, that wl_surface.commit will apply. */
894         struct weston_surface_state pending;
895
896         /*
897          * If non-NULL, this function will be called on
898          * wl_surface::commit after a new buffer has been set up for
899          * this surface. The integer params are the sx and sy
900          * parameters supplied to wl_surface::attach.
901          */
902         void (*configure)(struct weston_surface *es, int32_t sx, int32_t sy);
903         void *configure_private;
904
905         /* Parent's list of its sub-surfaces, weston_subsurface:parent_link.
906          * Contains also the parent itself as a dummy weston_subsurface,
907          * if the list is not empty.
908          */
909         struct wl_list subsurface_list; /* weston_subsurface::parent_link */
910         struct wl_list subsurface_list_pending; /* ...::parent_link_pending */
911 };
912
913 struct weston_subsurface {
914         struct wl_resource *resource;
915
916         /* guaranteed to be valid and non-NULL */
917         struct weston_surface *surface;
918         struct wl_listener surface_destroy_listener;
919
920         /* can be NULL */
921         struct weston_surface *parent;
922         struct wl_listener parent_destroy_listener;
923         struct wl_list parent_link;
924         struct wl_list parent_link_pending;
925
926         struct {
927                 int32_t x;
928                 int32_t y;
929                 int set;
930         } position;
931
932         int has_cached_data;
933         struct weston_surface_state cached;
934         struct weston_buffer_reference cached_buffer_ref;
935
936         int synchronized;
937
938         /* Used for constructing the view tree */
939         struct wl_list unused_views;
940 };
941
942 enum weston_key_state_update {
943         STATE_UPDATE_AUTOMATIC,
944         STATE_UPDATE_NONE,
945 };
946
947 void
948 weston_version(int *major, int *minor, int *micro);
949
950 void
951 weston_view_update_transform(struct weston_view *view);
952
953 void
954 weston_view_geometry_dirty(struct weston_view *view);
955
956 void
957 weston_view_to_global_fixed(struct weston_view *view,
958                             wl_fixed_t sx, wl_fixed_t sy,
959                             wl_fixed_t *x, wl_fixed_t *y);
960 void
961 weston_view_to_global_float(struct weston_view *view,
962                             float sx, float sy, float *x, float *y);
963
964 void
965 weston_view_from_global_float(struct weston_view *view,
966                               float x, float y, float *vx, float *vy);
967 void
968 weston_view_from_global(struct weston_view *view,
969                         int32_t x, int32_t y, int32_t *vx, int32_t *vy);
970 void
971 weston_view_from_global_fixed(struct weston_view *view,
972                               wl_fixed_t x, wl_fixed_t y,
973                               wl_fixed_t *vx, wl_fixed_t *vy);
974
975 WL_EXPORT void
976 weston_surface_to_buffer_float(struct weston_surface *surface,
977                                float x, float y, float *bx, float *by);
978 WL_EXPORT void
979 weston_surface_to_buffer(struct weston_surface *surface,
980                          int sx, int sy, int *bx, int *by);
981 pixman_box32_t
982 weston_surface_to_buffer_rect(struct weston_surface *surface,
983                               pixman_box32_t rect);
984
985 void
986 weston_spring_init(struct weston_spring *spring,
987                    double k, double current, double target);
988 void
989 weston_spring_update(struct weston_spring *spring, uint32_t msec);
990 int
991 weston_spring_done(struct weston_spring *spring);
992
993 void
994 weston_surface_activate(struct weston_surface *surface,
995                         struct weston_seat *seat);
996 void
997 notify_motion(struct weston_seat *seat, uint32_t time,
998               wl_fixed_t dx, wl_fixed_t dy);
999 void
1000 notify_motion_absolute(struct weston_seat *seat, uint32_t time,
1001                        wl_fixed_t x, wl_fixed_t y);
1002 void
1003 notify_button(struct weston_seat *seat, uint32_t time, int32_t button,
1004               enum wl_pointer_button_state state);
1005 void
1006 notify_axis(struct weston_seat *seat, uint32_t time, uint32_t axis,
1007             wl_fixed_t value);
1008 void
1009 notify_key(struct weston_seat *seat, uint32_t time, uint32_t key,
1010            enum wl_keyboard_key_state state,
1011            enum weston_key_state_update update_state);
1012 void
1013 notify_modifiers(struct weston_seat *seat, uint32_t serial);
1014
1015 void
1016 notify_pointer_focus(struct weston_seat *seat, struct weston_output *output,
1017                      wl_fixed_t x, wl_fixed_t y);
1018
1019 void
1020 notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys,
1021                          enum weston_key_state_update update_state);
1022 void
1023 notify_keyboard_focus_out(struct weston_seat *seat);
1024
1025 void
1026 notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
1027              wl_fixed_t x, wl_fixed_t y, int touch_type);
1028 void
1029 notify_touch_frame(struct weston_seat *seat);
1030
1031 void
1032 weston_layer_entry_insert(struct weston_layer_entry *list,
1033                           struct weston_layer_entry *entry);
1034 void
1035 weston_layer_entry_remove(struct weston_layer_entry *entry);
1036 void
1037 weston_layer_init(struct weston_layer *layer, struct wl_list *below);
1038
1039 void
1040 weston_layer_set_mask(struct weston_layer *layer, int x, int y, int width, int height);
1041
1042 void
1043 weston_layer_set_mask_infinite(struct weston_layer *layer);
1044
1045 void
1046 weston_plane_init(struct weston_plane *plane,
1047                         struct weston_compositor *ec,
1048                         int32_t x, int32_t y);
1049 void
1050 weston_plane_release(struct weston_plane *plane);
1051
1052 void
1053 weston_compositor_stack_plane(struct weston_compositor *ec,
1054                               struct weston_plane *plane,
1055                               struct weston_plane *above);
1056
1057 void
1058 weston_output_finish_frame(struct weston_output *output, uint32_t msecs);
1059 void
1060 weston_output_schedule_repaint(struct weston_output *output);
1061 void
1062 weston_output_damage(struct weston_output *output);
1063 void
1064 weston_compositor_schedule_repaint(struct weston_compositor *compositor);
1065 void
1066 weston_compositor_fade(struct weston_compositor *compositor, float tint);
1067 void
1068 weston_compositor_damage_all(struct weston_compositor *compositor);
1069 void
1070 weston_compositor_unlock(struct weston_compositor *compositor);
1071 void
1072 weston_compositor_wake(struct weston_compositor *compositor);
1073 void
1074 weston_compositor_offscreen(struct weston_compositor *compositor);
1075 void
1076 weston_compositor_sleep(struct weston_compositor *compositor);
1077 struct weston_view *
1078 weston_compositor_pick_view(struct weston_compositor *compositor,
1079                             wl_fixed_t x, wl_fixed_t y,
1080                             wl_fixed_t *sx, wl_fixed_t *sy);
1081
1082
1083 struct weston_binding;
1084 typedef void (*weston_key_binding_handler_t)(struct weston_seat *seat,
1085                                              uint32_t time, uint32_t key,
1086                                              void *data);
1087 struct weston_binding *
1088 weston_compositor_add_key_binding(struct weston_compositor *compositor,
1089                                   uint32_t key,
1090                                   enum weston_keyboard_modifier modifier,
1091                                   weston_key_binding_handler_t binding,
1092                                   void *data);
1093
1094 typedef void (*weston_modifier_binding_handler_t)(struct weston_seat *seat,
1095                                                   enum weston_keyboard_modifier modifier,
1096                                                   void *data);
1097 struct weston_binding *
1098 weston_compositor_add_modifier_binding(struct weston_compositor *compositor,
1099                                        enum weston_keyboard_modifier modifier,
1100                                        weston_modifier_binding_handler_t binding,
1101                                        void *data);
1102
1103 typedef void (*weston_button_binding_handler_t)(struct weston_seat *seat,
1104                                                 uint32_t time, uint32_t button,
1105                                                 void *data);
1106 struct weston_binding *
1107 weston_compositor_add_button_binding(struct weston_compositor *compositor,
1108                                      uint32_t button,
1109                                      enum weston_keyboard_modifier modifier,
1110                                      weston_button_binding_handler_t binding,
1111                                      void *data);
1112
1113 typedef void (*weston_touch_binding_handler_t)(struct weston_seat *seat,
1114                                                uint32_t time,
1115                                                void *data);
1116 struct weston_binding *
1117 weston_compositor_add_touch_binding(struct weston_compositor *compositor,
1118                                     enum weston_keyboard_modifier modifier,
1119                                     weston_touch_binding_handler_t binding,
1120                                     void *data);
1121
1122 typedef void (*weston_axis_binding_handler_t)(struct weston_seat *seat,
1123                                               uint32_t time, uint32_t axis,
1124                                               wl_fixed_t value, void *data);
1125 struct weston_binding *
1126 weston_compositor_add_axis_binding(struct weston_compositor *compositor,
1127                                    uint32_t axis,
1128                                    enum weston_keyboard_modifier modifier,
1129                                    weston_axis_binding_handler_t binding,
1130                                    void *data);
1131 struct weston_binding *
1132 weston_compositor_add_debug_binding(struct weston_compositor *compositor,
1133                                     uint32_t key,
1134                                     weston_key_binding_handler_t binding,
1135                                     void *data);
1136 void
1137 weston_binding_destroy(struct weston_binding *binding);
1138
1139 void
1140 weston_binding_list_destroy_all(struct wl_list *list);
1141
1142 void
1143 weston_compositor_run_key_binding(struct weston_compositor *compositor,
1144                                   struct weston_seat *seat, uint32_t time,
1145                                   uint32_t key,
1146                                   enum wl_keyboard_key_state state);
1147
1148 void
1149 weston_compositor_run_modifier_binding(struct weston_compositor *compositor,
1150                                        struct weston_seat *seat,
1151                                        enum weston_keyboard_modifier modifier,
1152                                        enum wl_keyboard_key_state state);
1153 void
1154 weston_compositor_run_button_binding(struct weston_compositor *compositor,
1155                                      struct weston_seat *seat, uint32_t time,
1156                                      uint32_t button,
1157                                      enum wl_pointer_button_state value);
1158 void
1159 weston_compositor_run_touch_binding(struct weston_compositor *compositor,
1160                                     struct weston_seat *seat, uint32_t time,
1161                                     int touch_type);
1162 int
1163 weston_compositor_run_axis_binding(struct weston_compositor *compositor,
1164                                    struct weston_seat *seat, uint32_t time,
1165                                    uint32_t axis, int32_t value);
1166 int
1167 weston_compositor_run_debug_binding(struct weston_compositor *compositor,
1168                                     struct weston_seat *seat, uint32_t time,
1169                                     uint32_t key,
1170                                     enum wl_keyboard_key_state state);
1171
1172 void
1173 weston_compositor_set_default_pointer_grab(struct weston_compositor *compositor,
1174                         const struct weston_pointer_grab_interface *interface);
1175
1176 int
1177 weston_environment_get_fd(const char *env);
1178
1179 struct wl_list *
1180 weston_compositor_top(struct weston_compositor *compositor);
1181
1182 struct weston_surface *
1183 weston_surface_create(struct weston_compositor *compositor);
1184
1185 struct weston_view *
1186 weston_view_create(struct weston_surface *surface);
1187
1188 void
1189 weston_view_destroy(struct weston_view *view);
1190
1191 void
1192 weston_view_set_position(struct weston_view *view,
1193                          float x, float y);
1194
1195 void
1196 weston_view_set_transform_parent(struct weston_view *view,
1197                                  struct weston_view *parent);
1198
1199 int
1200 weston_view_is_mapped(struct weston_view *view);
1201
1202 void
1203 weston_view_schedule_repaint(struct weston_view *view);
1204
1205 int
1206 weston_surface_is_mapped(struct weston_surface *surface);
1207
1208 WL_EXPORT void
1209 weston_surface_set_size(struct weston_surface *surface,
1210                         int32_t width, int32_t height);
1211
1212 void
1213 weston_surface_schedule_repaint(struct weston_surface *surface);
1214
1215 void
1216 weston_surface_damage(struct weston_surface *surface);
1217
1218 void
1219 weston_view_damage_below(struct weston_view *view);
1220
1221 void
1222 weston_view_move_to_plane(struct weston_view *view,
1223                           struct weston_plane *plane);
1224 void
1225 weston_view_unmap(struct weston_view *view);
1226
1227 void
1228 weston_surface_unmap(struct weston_surface *surface);
1229
1230 struct weston_surface *
1231 weston_surface_get_main_surface(struct weston_surface *surface);
1232
1233 struct weston_buffer *
1234 weston_buffer_from_resource(struct wl_resource *resource);
1235
1236 void
1237 weston_buffer_reference(struct weston_buffer_reference *ref,
1238                         struct weston_buffer *buffer);
1239
1240 uint32_t
1241 weston_compositor_get_time(void);
1242
1243 int
1244 weston_compositor_init(struct weston_compositor *ec, struct wl_display *display,
1245                        int *argc, char *argv[], struct weston_config *config);
1246 void
1247 weston_compositor_shutdown(struct weston_compositor *ec);
1248 void
1249 weston_output_init_zoom(struct weston_output *output);
1250 void
1251 weston_output_update_zoom(struct weston_output *output);
1252 void
1253 weston_output_activate_zoom(struct weston_output *output);
1254 void
1255 weston_output_update_matrix(struct weston_output *output);
1256 void
1257 weston_output_move(struct weston_output *output, int x, int y);
1258 void
1259 weston_output_init(struct weston_output *output, struct weston_compositor *c,
1260                    int x, int y, int width, int height, uint32_t transform, int32_t scale);
1261 void
1262 weston_output_destroy(struct weston_output *output);
1263 void
1264 weston_output_transform_coordinate(struct weston_output *output,
1265                                    wl_fixed_t device_x, wl_fixed_t device_y,
1266                                    wl_fixed_t *x, wl_fixed_t *y);
1267
1268 void
1269 weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
1270                  const char *seat_name);
1271 void
1272 weston_seat_init_pointer(struct weston_seat *seat);
1273 void
1274 weston_seat_release_pointer(struct weston_seat *seat);
1275 int
1276 weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
1277 void
1278 weston_seat_release_keyboard(struct weston_seat *seat);
1279 void
1280 weston_seat_init_touch(struct weston_seat *seat);
1281 void
1282 weston_seat_release_touch(struct weston_seat *seat);
1283 void
1284 weston_seat_repick(struct weston_seat *seat);
1285 void
1286 weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap);
1287
1288 void
1289 weston_seat_release(struct weston_seat *seat);
1290 int
1291 weston_compositor_xkb_init(struct weston_compositor *ec,
1292                            struct xkb_rule_names *names);
1293 void
1294 weston_compositor_xkb_destroy(struct weston_compositor *ec);
1295
1296 /* String literal of spaces, the same width as the timestamp. */
1297 #define STAMP_SPACE "               "
1298
1299 void
1300 weston_log_file_open(const char *filename);
1301 void
1302 weston_log_file_close(void);
1303 int
1304 weston_vlog(const char *fmt, va_list ap);
1305 int
1306 weston_vlog_continue(const char *fmt, va_list ap);
1307 int
1308 weston_log(const char *fmt, ...)
1309         __attribute__ ((format (printf, 1, 2)));
1310 int
1311 weston_log_continue(const char *fmt, ...)
1312         __attribute__ ((format (printf, 1, 2)));
1313
1314 enum {
1315         TTY_ENTER_VT,
1316         TTY_LEAVE_VT
1317 };
1318
1319 struct tty *
1320 tty_create(struct weston_compositor *compositor, int tty_nr);
1321
1322 void
1323 tty_destroy(struct tty *tty);
1324
1325 void
1326 tty_reset(struct tty *tty);
1327
1328 int
1329 tty_activate_vt(struct tty *tty, int vt);
1330
1331 void
1332 screenshooter_create(struct weston_compositor *ec);
1333
1334 enum weston_screenshooter_outcome {
1335         WESTON_SCREENSHOOTER_SUCCESS,
1336         WESTON_SCREENSHOOTER_NO_MEMORY,
1337         WESTON_SCREENSHOOTER_BAD_BUFFER
1338 };
1339
1340 typedef void (*weston_screenshooter_done_func_t)(void *data,
1341                                 enum weston_screenshooter_outcome outcome);
1342 int
1343 weston_screenshooter_shoot(struct weston_output *output, struct weston_buffer *buffer,
1344                            weston_screenshooter_done_func_t done, void *data);
1345
1346 struct clipboard *
1347 clipboard_create(struct weston_seat *seat);
1348
1349 int
1350 text_backend_init(struct weston_compositor *ec);
1351
1352 struct weston_process;
1353 typedef void (*weston_process_cleanup_func_t)(struct weston_process *process,
1354                                             int status);
1355
1356 struct weston_process {
1357         pid_t pid;
1358         weston_process_cleanup_func_t cleanup;
1359         struct wl_list link;
1360 };
1361
1362 struct wl_client *
1363 weston_client_launch(struct weston_compositor *compositor,
1364                      struct weston_process *proc,
1365                      const char *path,
1366                      weston_process_cleanup_func_t cleanup);
1367
1368 struct wl_client *
1369 weston_client_start(struct weston_compositor *compositor, const char *path);
1370
1371 void
1372 weston_watch_process(struct weston_process *process);
1373
1374 struct weston_view_animation;
1375 typedef void (*weston_view_animation_done_func_t)(struct weston_view_animation *animation, void *data);
1376
1377 void
1378 weston_view_animation_destroy(struct weston_view_animation *animation);
1379
1380 struct weston_view_animation *
1381 weston_zoom_run(struct weston_view *view, float start, float stop,
1382                 weston_view_animation_done_func_t done, void *data);
1383
1384 struct weston_view_animation *
1385 weston_fade_run(struct weston_view *view,
1386                 float start, float end, float k,
1387                 weston_view_animation_done_func_t done, void *data);
1388
1389 struct weston_view_animation *
1390 weston_move_scale_run(struct weston_view *view, int dx, int dy,
1391                       float start, float end, int reverse,
1392                       weston_view_animation_done_func_t done, void *data);
1393
1394 void
1395 weston_fade_update(struct weston_view_animation *fade, float target);
1396
1397 struct weston_view_animation *
1398 weston_stable_fade_run(struct weston_view *front_view, float start,
1399                        struct weston_view *back_view, float end,
1400                        weston_view_animation_done_func_t done, void *data);
1401
1402 struct weston_view_animation *
1403 weston_slide_run(struct weston_view *view, float start, float stop,
1404                  weston_view_animation_done_func_t done, void *data);
1405
1406 void
1407 weston_surface_set_color(struct weston_surface *surface,
1408                          float red, float green, float blue, float alpha);
1409
1410 void
1411 weston_surface_destroy(struct weston_surface *surface);
1412
1413 int
1414 weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode,
1415                         int32_t scale, enum weston_mode_switch_op op);
1416
1417 int
1418 noop_renderer_init(struct weston_compositor *ec);
1419
1420 struct weston_compositor *
1421 backend_init(struct wl_display *display, int *argc, char *argv[],
1422              struct weston_config *config);
1423
1424 int
1425 module_init(struct weston_compositor *compositor,
1426             int *argc, char *argv[]);
1427
1428 void
1429 weston_transformed_coord(int width, int height,
1430                          enum wl_output_transform transform,
1431                          int32_t scale,
1432                          float sx, float sy, float *bx, float *by);
1433 pixman_box32_t
1434 weston_transformed_rect(int width, int height,
1435                         enum wl_output_transform transform,
1436                         int32_t scale,
1437                         pixman_box32_t rect);
1438 void
1439 weston_transformed_region(int width, int height,
1440                           enum wl_output_transform transform,
1441                           int32_t scale,
1442                           pixman_region32_t *src, pixman_region32_t *dest);
1443
1444 void *
1445 weston_load_module(const char *name, const char *entrypoint);
1446
1447 #ifdef  __cplusplus
1448 }
1449 #endif
1450
1451 #endif