1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/* colitur-x / colitur-mu -- compile-time configuration, suckless style.
* Edit, `make`, `make install`. There is no runtime config file: colitur
* itself owns the CALENDAR's configuration (language, sigla, overlays);
* this file owns only how it is painted.
*/
/* ------------------------------------------------------------------ fonts */
/* Any fontconfig name. Terminus is a bitmap font, so it exists only at
fixed pixelsizes (12 14 16 18 20 22 24 28 32) and wants antialias=false;
asking for a size it does not have silently gets you a substitute. */
static const char *font = "Terminus:pixelsize=20:antialias=false";
static const char *font_big = "Terminus:pixelsize=20:style=Bold:antialias=false";
/* ---------------------------------------------------------------- colours */
/* Liturgical colours, keyed by the name colitur emits in the `colour`
column. bg is the cell, fg is its text; every other marker is derived
from these two so it cannot become invisible against an odd combination. */
static const struct { const char *name, *bg, *fg; } palette[] = {
{ "white", "#f7f5ef", "#1a1a1a" },
{ "red", "#b03030", "#ffffff" },
{ "violet", "#5a3a78", "#ffffff" },
{ "green", "#2f6b3a", "#ffffff" },
{ "black", "#202020", "#e0e0e0" },
{ "rose", "#d9a0b0", "#1a1a1a" },
};
static const char *col_unknown_bg = "#808080"; /* a colour not listed above */
static const char *col_unknown_fg = "#ffffff";
static const char *col_bg = "#141414"; /* window background */
static const char *col_grid = "#3a3a3a"; /* rule above the detail pane */
static const char *col_head = "#8a8a8a"; /* title and weekday row */
static const char *col_detail = "#e8e8e8"; /* detail pane text */
/* The selected day is ringed TWICE, dark outside and bright inside, so it
survives on a white cell and on a red one alike. A single bright ring
vanishes against white; a single dark one vanishes against black. */
static const char *col_sel_dark = "#1a1a1a";
static const char *col_sel_light = "#ffd24a";
enum { SEL_RING = 3 }; /* px per ring */
/* --------------------------------------------------------------- geometry */
/* The grid FILLS the window: cell size is computed from whatever space the
window manager gives us, divided seven across and six down. Under a
tiling WM that means the calendar uses its whole tile instead of sitting
in a corner of it, and resizing reflows rather than clipping.
These are therefore MINIMUMS, not sizes. If the window is too small to
honour them the grid stops shrinking and simply overflows -- better than
cells too small to read. How many lines a name gets is likewise derived
from the cell height at runtime; NAME_LINES_MAX only caps it. */
enum {
CELL_W_MIN = 96,
CELL_H_MIN = 52,
PAD = 10, /* margin around the grid */
HEAD_H = 62, /* title + weekday headings */
DETAIL_H = 116, /* the pane under the grid */
NAME_LINES_MAX = 5,
/* Preferred size when the window manager lets us choose. A tiling WM
will not, and that is fine: the grid reflows to whatever it gets. */
WIN_W = 1200,
WIN_H = 820,
};
/* ------------------------------------------------------------------ labels */
/* Weekday headings, Sunday first. These are the VIEWER's own text, not
colitur's: the day names inside each cell come from the CSV and follow
whatever --lang produced it. Set these to match. */
static const char *dow_headings[7] = {
"Dom", "Fer II", "Fer III", "Fer IV", "Fer V", "Fer VI", "Sab"
};
static const char *label_epistle = "Epistola";
static const char *label_gospel = "Evangelium";
static const char *window_title = "colitur";
/* Which rank gets a badge, and what the badge says. The value is compared
against colitur's own `rank` column (class-1 | class-2 | class-3 |
class-4), so "class-2" here would mark second-class feasts instead. */
static const char *badge_rank = "class-1";
static const char *badge_glyph = "I";
|