|
| 1 | +/* |
| 2 | + * This an unstable interface of wlroots. No guarantees are made regarding the |
| 3 | + * future consistency of this API. |
| 4 | + */ |
| 5 | +#ifndef WLR_USE_UNSTABLE |
| 6 | +#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" |
| 7 | +#endif |
| 8 | + |
| 9 | +#ifndef WLR_TYPES_WLR_XDG_ACTIVATION_V1 |
| 10 | +#define WLR_TYPES_WLR_XDG_ACTIVATION_V1 |
| 11 | + |
| 12 | +#include <wayland-server-core.h> |
| 13 | + |
| 14 | +struct wlr_xdg_activation_token_v1 { |
| 15 | + struct wlr_xdg_activation_v1 *activation; |
| 16 | + // The source surface that created the token. |
| 17 | + struct wlr_surface *surface; // can be NULL |
| 18 | + struct wlr_seat *seat; // can be NULL |
| 19 | + // The serial for the input event that created the token. |
| 20 | + uint32_t serial; // invalid if seat is NULL |
| 21 | + // The application ID to be activated. This is just a hint. |
| 22 | + char *app_id; // can be NULL |
| 23 | + struct wl_list link; // wlr_xdg_activation_v1.tokens |
| 24 | + |
| 25 | + // private state |
| 26 | + |
| 27 | + char *token; |
| 28 | + struct wl_resource *resource; // can be NULL |
| 29 | + |
| 30 | + struct wl_listener seat_destroy; |
| 31 | + struct wl_listener surface_destroy; |
| 32 | +}; |
| 33 | + |
| 34 | +struct wlr_xdg_activation_v1 { |
| 35 | + |
| 36 | + struct wl_list tokens; // wlr_xdg_activation_token_v1.link |
| 37 | + |
| 38 | + struct { |
| 39 | + struct wl_signal destroy; |
| 40 | + struct wl_signal request_activate; // wlr_xdg_activation_v1_request_activate_event |
| 41 | + } events; |
| 42 | + |
| 43 | + // private state |
| 44 | + |
| 45 | + struct wl_global *global; |
| 46 | + |
| 47 | + struct wl_listener display_destroy; |
| 48 | +}; |
| 49 | + |
| 50 | +struct wlr_xdg_activation_v1_request_activate_event { |
| 51 | + struct wlr_xdg_activation_v1 *activation; |
| 52 | + // The token used to request activation. |
| 53 | + struct wlr_xdg_activation_token_v1 *token; |
| 54 | + // The surface requesting for activation. |
| 55 | + struct wlr_surface *surface; |
| 56 | +}; |
| 57 | + |
| 58 | +struct wlr_xdg_activation_v1 *wlr_xdg_activation_v1_create( |
| 59 | + struct wl_display *display); |
| 60 | + |
| 61 | +#endif |
0 commit comments