diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-02-22 02:26:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-22 02:26:19 -0500 |
commit | 7f58ea5ec23ffded76a147a243aede34405e417b (patch) | |
tree | 5b8222416cf425c2c2dee123a13dd774fd2a368c /include/swaylock/swaylock.h | |
parent | Merge pull request #1080 from SirCmpwn/ipc-security (diff) | |
parent | Merge branch 'master' into swaylock_colors (diff) | |
download | sway-7f58ea5ec23ffded76a147a243aede34405e417b.tar.gz sway-7f58ea5ec23ffded76a147a243aede34405e417b.tar.zst sway-7f58ea5ec23ffded76a147a243aede34405e417b.zip |
Feature for #1078: Configurable swaylock colors
Diffstat (limited to 'include/swaylock/swaylock.h')
-rw-r--r-- | include/swaylock/swaylock.h | 68 |
1 files changed, 47 insertions, 21 deletions
diff --git a/include/swaylock/swaylock.h b/include/swaylock/swaylock.h index 1cf66e89..06533108 100644 --- a/include/swaylock/swaylock.h +++ b/include/swaylock/swaylock.h | |||
@@ -4,34 +4,60 @@ | |||
4 | #include "client/cairo.h" | 4 | #include "client/cairo.h" |
5 | 5 | ||
6 | enum scaling_mode { | 6 | enum scaling_mode { |
7 | SCALING_MODE_STRETCH, | 7 | SCALING_MODE_STRETCH, |
8 | SCALING_MODE_FILL, | 8 | SCALING_MODE_FILL, |
9 | SCALING_MODE_FIT, | 9 | SCALING_MODE_FIT, |
10 | SCALING_MODE_CENTER, | 10 | SCALING_MODE_CENTER, |
11 | SCALING_MODE_TILE, | 11 | SCALING_MODE_TILE, |
12 | }; | 12 | }; |
13 | 13 | ||
14 | enum auth_state { | 14 | enum auth_state { |
15 | AUTH_STATE_IDLE, | 15 | AUTH_STATE_IDLE, |
16 | AUTH_STATE_INPUT, | 16 | AUTH_STATE_INPUT, |
17 | AUTH_STATE_BACKSPACE, | 17 | AUTH_STATE_BACKSPACE, |
18 | AUTH_STATE_VALIDATING, | 18 | AUTH_STATE_VALIDATING, |
19 | AUTH_STATE_INVALID, | 19 | AUTH_STATE_INVALID, |
20 | }; | ||
21 | |||
22 | enum line_source { | ||
23 | LINE_SOURCE_DEFAULT, | ||
24 | LINE_SOURCE_RING, | ||
25 | LINE_SOURCE_INSIDE, | ||
20 | }; | 26 | }; |
21 | 27 | ||
22 | struct render_data { | 28 | struct render_data { |
23 | list_t *surfaces; | 29 | list_t *surfaces; |
24 | // Output specific images | 30 | // Output specific images |
25 | cairo_surface_t **images; | 31 | cairo_surface_t **images; |
26 | // OR one image for all outputs: | 32 | // OR one image for all outputs: |
27 | cairo_surface_t *image; | 33 | cairo_surface_t *image; |
28 | int num_images; | 34 | int num_images; |
29 | int color_set; | 35 | int color_set; |
30 | uint32_t color; | 36 | uint32_t color; |
31 | enum scaling_mode scaling_mode; | 37 | enum scaling_mode scaling_mode; |
32 | enum auth_state auth_state; | 38 | enum auth_state auth_state; |
39 | }; | ||
40 | |||
41 | struct lock_colors { | ||
42 | uint32_t inner_ring; | ||
43 | uint32_t outer_ring; | ||
44 | }; | ||
45 | |||
46 | struct lock_config { | ||
47 | char *font; | ||
48 | |||
49 | struct { | ||
50 | uint32_t text; | ||
51 | uint32_t line; | ||
52 | uint32_t separator; | ||
53 | uint32_t input_cursor; | ||
54 | uint32_t backspace_cursor; | ||
55 | struct lock_colors normal; | ||
56 | struct lock_colors validating; | ||
57 | struct lock_colors invalid; | ||
58 | } colors; | ||
33 | }; | 59 | }; |
34 | 60 | ||
35 | void render(struct render_data* render_data); | 61 | void render(struct render_data* render_data, struct lock_config *config); |
36 | 62 | ||
37 | #endif | 63 | #endif |