diff options
author | Calvin Lee <cyrus296@gmail.com> | 2017-02-21 12:49:22 -0700 |
---|---|---|
committer | Calvin Lee <cyrus296@gmail.com> | 2017-02-21 14:12:31 -0700 |
commit | 34e2c70abcbc9ba496ab32f1f742dd7bae0ce0fe (patch) | |
tree | 41068bbf6d412c8501a8040c577321798ff8991c /include/swaylock | |
parent | Merge pull request #1075 from zandrmartin/floating-positioning (diff) | |
download | sway-34e2c70abcbc9ba496ab32f1f742dd7bae0ce0fe.tar.gz sway-34e2c70abcbc9ba496ab32f1f742dd7bae0ce0fe.tar.zst sway-34e2c70abcbc9ba496ab32f1f742dd7bae0ce0fe.zip |
Feature for #1078: Configurable swaylock colors
Colors are configured through the command line so that swaylock conforms
to the i3lock fork 'github.com/chrjguill/i3lock-color'. Differences from
it are that one letter options '-r' and '-s' are not implimentend because
'-s' is already used by '--scaling' in swaylock.
This commit also fixed whitespace in 'include/swaylock/swaylock.h' and
changed `parse_color` in 'common/util.h' so that it can accept colors
that do not start with a hash. This was done to keep compatability with
the i3lock fork.
Diffstat (limited to 'include/swaylock')
-rw-r--r-- | include/swaylock/swaylock.h | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/include/swaylock/swaylock.h b/include/swaylock/swaylock.h index 1cf66e89..6e0ae288 100644 --- a/include/swaylock/swaylock.h +++ b/include/swaylock/swaylock.h | |||
@@ -4,34 +4,54 @@ | |||
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 | }; | 20 | }; |
21 | 21 | ||
22 | struct render_data { | 22 | struct render_data { |
23 | list_t *surfaces; | 23 | list_t *surfaces; |
24 | // Output specific images | 24 | // Output specific images |
25 | cairo_surface_t **images; | 25 | cairo_surface_t **images; |
26 | // OR one image for all outputs: | 26 | // OR one image for all outputs: |
27 | cairo_surface_t *image; | 27 | cairo_surface_t *image; |
28 | int num_images; | 28 | int num_images; |
29 | int color_set; | 29 | int color_set; |
30 | uint32_t color; | 30 | uint32_t color; |
31 | enum scaling_mode scaling_mode; | 31 | enum scaling_mode scaling_mode; |
32 | enum auth_state auth_state; | 32 | enum auth_state auth_state; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | void render(struct render_data* render_data); | 35 | struct lock_colors { |
36 | uint32_t inner_ring; | ||
37 | uint32_t outer_ring; | ||
38 | }; | ||
39 | |||
40 | struct lock_config { | ||
41 | char *font; | ||
42 | |||
43 | struct { | ||
44 | uint32_t text; | ||
45 | uint32_t line; | ||
46 | uint32_t separator; | ||
47 | uint32_t input_cursor; | ||
48 | uint32_t backspace_cursor; | ||
49 | struct lock_colors normal; | ||
50 | struct lock_colors validating; | ||
51 | struct lock_colors invalid; | ||
52 | } colors; | ||
53 | }; | ||
54 | |||
55 | void render(struct render_data* render_data, struct lock_config *config); | ||
36 | 56 | ||
37 | #endif | 57 | #endif |