diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-02 23:14:37 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-04-04 18:47:48 -0400 |
commit | 1008d4cc9105e18074f8152ec5d6679aef8ebc5f (patch) | |
tree | 7ea62bc43f58f50477f0ee3edb44076944f19d02 /include/swaylock/swaylock.h | |
parent | Set up an XKB context for the keyboard (diff) | |
download | sway-1008d4cc9105e18074f8152ec5d6679aef8ebc5f.tar.gz sway-1008d4cc9105e18074f8152ec5d6679aef8ebc5f.tar.zst sway-1008d4cc9105e18074f8152ec5d6679aef8ebc5f.zip |
Split seat code into its own file
Diffstat (limited to 'include/swaylock/swaylock.h')
-rw-r--r-- | include/swaylock/swaylock.h | 87 |
1 files changed, 31 insertions, 56 deletions
diff --git a/include/swaylock/swaylock.h b/include/swaylock/swaylock.h index eeed094e..e2673aae 100644 --- a/include/swaylock/swaylock.h +++ b/include/swaylock/swaylock.h | |||
@@ -1,66 +1,41 @@ | |||
1 | #ifndef _SWAYLOCK_H | 1 | #ifndef _SWAYLOCK_H |
2 | #define _SWAYLOCK_H | 2 | #define _SWAYLOCK_H |
3 | 3 | #include <stdbool.h> | |
4 | #include "client/cairo.h" | 4 | #include <stdint.h> |
5 | 5 | #include <wayland-client.h> | |
6 | enum scaling_mode { | 6 | #include "background-image.h" |
7 | SCALING_MODE_STRETCH, | 7 | #include "cairo.h" |
8 | SCALING_MODE_FILL, | 8 | #include "pool-buffer.h" |
9 | SCALING_MODE_FIT, | 9 | #include "swaylock/seat.h" |
10 | SCALING_MODE_CENTER, | 10 | #include "wlr-layer-shell-unstable-v1-client-protocol.h" |
11 | SCALING_MODE_TILE, | 11 | |
12 | }; | 12 | struct swaylock_args { |
13 | |||
14 | enum auth_state { | ||
15 | AUTH_STATE_IDLE, | ||
16 | AUTH_STATE_INPUT, | ||
17 | AUTH_STATE_BACKSPACE, | ||
18 | AUTH_STATE_VALIDATING, | ||
19 | AUTH_STATE_INVALID, | ||
20 | }; | ||
21 | |||
22 | enum line_source { | ||
23 | LINE_SOURCE_DEFAULT, | ||
24 | LINE_SOURCE_RING, | ||
25 | LINE_SOURCE_INSIDE, | ||
26 | }; | ||
27 | |||
28 | struct render_data { | ||
29 | list_t *surfaces; | ||
30 | // Output specific images | ||
31 | cairo_surface_t **images; | ||
32 | // OR one image for all outputs: | ||
33 | cairo_surface_t *image; | ||
34 | int num_images; | ||
35 | int color_set; | ||
36 | uint32_t color; | 13 | uint32_t color; |
37 | enum scaling_mode scaling_mode; | 14 | enum background_mode mode; |
38 | enum auth_state auth_state; | 15 | bool show_indicator; |
39 | }; | 16 | }; |
40 | 17 | ||
41 | struct lock_colors { | 18 | struct swaylock_state { |
42 | uint32_t inner_ring; | 19 | struct wl_display *display; |
43 | uint32_t outer_ring; | 20 | struct wl_compositor *compositor; |
21 | struct zwlr_layer_shell_v1 *layer_shell; | ||
22 | struct wl_shm *shm; | ||
23 | struct wl_list contexts; | ||
24 | struct swaylock_args args; | ||
25 | struct swaylock_xkb xkb; | ||
26 | bool run_display; | ||
44 | }; | 27 | }; |
45 | 28 | ||
46 | struct lock_config { | 29 | struct swaylock_context { |
47 | char *font; | 30 | cairo_surface_t *image; |
48 | 31 | struct swaylock_state *state; | |
49 | struct { | 32 | struct wl_output *output; |
50 | uint32_t text; | 33 | struct wl_surface *surface; |
51 | uint32_t line; | 34 | struct zwlr_layer_surface_v1 *layer_surface; |
52 | uint32_t separator; | 35 | struct pool_buffer buffers[2]; |
53 | uint32_t input_cursor; | 36 | struct pool_buffer *current_buffer; |
54 | uint32_t backspace_cursor; | 37 | uint32_t width, height; |
55 | struct lock_colors normal; | 38 | struct wl_list link; |
56 | struct lock_colors validating; | ||
57 | struct lock_colors invalid; | ||
58 | } colors; | ||
59 | |||
60 | int radius; | ||
61 | int thickness; | ||
62 | }; | 39 | }; |
63 | 40 | ||
64 | void render(struct render_data* render_data, struct lock_config *config); | ||
65 | |||
66 | #endif | 41 | #endif |