diff options
Diffstat (limited to 'extras.h')
| -rw-r--r-- | extras.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/extras.h b/extras.h new file mode 100644 index 0000000..d4a353e --- /dev/null +++ b/extras.h | |||
| @@ -0,0 +1,102 @@ | |||
| 1 | /* | ||
| 2 | * This file is part of i3lock-extended | ||
| 3 | * Copyright (C) 2020 Simeon Simeonov | ||
| 4 | |||
| 5 | * i3lock-extended is free software: you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation, either version 3 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | |||
| 10 | * i3lock-extended is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | |||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef EXTRAS_H | ||
| 20 | #define EXTRAS_H | ||
| 21 | |||
| 22 | #include <time.h> | ||
| 23 | |||
| 24 | |||
| 25 | #define I3LOCK_SCALE_LED_LENGTH 60 | ||
| 26 | #define I3LOCK_SCALE_LED_SPACING 30 | ||
| 27 | |||
| 28 | |||
| 29 | typedef enum { | ||
| 30 | |||
| 31 | I3LOCK_ALIGN_LEFT = 0, | ||
| 32 | I3LOCK_ALIGN_CENTER, | ||
| 33 | I3LOCK_ALIGN_RIGHT | ||
| 34 | |||
| 35 | } i3lock_horizontal_alignment; | ||
| 36 | |||
| 37 | |||
| 38 | typedef enum { | ||
| 39 | |||
| 40 | I3LOCK_ALIGN_TOP = 0, | ||
| 41 | I3LOCK_ALIGN_MIDDLE, | ||
| 42 | I3LOCK_ALIGN_BOTTOM | ||
| 43 | |||
| 44 | } i3lock_vertical_alignment; | ||
| 45 | |||
| 46 | |||
| 47 | typedef struct i3lock_digital_clock_t_ { | ||
| 48 | |||
| 49 | int text_size; | ||
| 50 | char color[7]; | ||
| 51 | char *template; | ||
| 52 | i3lock_horizontal_alignment horizontal_alignment; | ||
| 53 | i3lock_vertical_alignment vertical_alignment; | ||
| 54 | |||
| 55 | } i3lock_digital_clock_t; | ||
| 56 | |||
| 57 | |||
| 58 | typedef struct i3lock_elapsed_time_t_ { | ||
| 59 | |||
| 60 | int text_size; | ||
| 61 | char color[7]; | ||
| 62 | time_t start_time; | ||
| 63 | i3lock_horizontal_alignment horizontal_alignment; | ||
| 64 | i3lock_vertical_alignment vertical_alignment; | ||
| 65 | |||
| 66 | } i3lock_elapsed_time_t; | ||
| 67 | |||
| 68 | |||
| 69 | typedef struct i3lock_led_clock_t_ { | ||
| 70 | |||
| 71 | char led_on_color[7]; | ||
| 72 | char led_off_color[7]; | ||
| 73 | char led_border_color[7]; | ||
| 74 | i3lock_horizontal_alignment horizontal_alignment; | ||
| 75 | i3lock_vertical_alignment vertical_alignment; | ||
| 76 | |||
| 77 | } i3lock_led_clock_t; | ||
| 78 | |||
| 79 | |||
| 80 | void i3lock_draw_digital_clock(cairo_t *cr, | ||
| 81 | const i3lock_digital_clock_t *dc, | ||
| 82 | const uint32_t *resolution, | ||
| 83 | const struct tm *brokentime); | ||
| 84 | |||
| 85 | |||
| 86 | void i3lock_draw_elapsed_time(cairo_t *cr, | ||
| 87 | const i3lock_elapsed_time_t *et, | ||
| 88 | const uint32_t *resolution, | ||
| 89 | const time_t *now); | ||
| 90 | |||
| 91 | |||
| 92 | void i3lock_draw_led_clock(cairo_t *cr, | ||
| 93 | const i3lock_led_clock_t *lc, | ||
| 94 | const uint32_t *resolution, | ||
| 95 | const struct tm *brokentime); | ||
| 96 | |||
| 97 | |||
| 98 | void i3lock_draw_string(cairo_t *cr, | ||
| 99 | const char *formatted_string, | ||
| 100 | const i3lock_elapsed_time_t *et, | ||
| 101 | const uint32_t *resolution); | ||
| 102 | #endif | ||
