aboutsummaryrefslogtreecommitdiff
path: root/src/config.h
blob: c24c9689205ada2deb7eac67b01bdaaf283dfbd7 (plain)
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
#ifndef COMET_CONFIG_H
#define COMET_CONFIG_H

#include <stdio.h>
#include <stdint.h>

#include "block.h"

//typedef struct {
//    char *label;
//    char *type;
//    int x_padding, y_padding;
//    color_t color;
//    char *text;
//    color_t text_color;
//    int line_width;
//    color_t line_color;
//    bool hidden;
//    double interval;
//    int min_width, max_width;
//} config_block_t;

typedef struct {
    char *label;
    size_t n_pairs;
    pair_t *pairs;
} config_section_t;

typedef struct {
    size_t n_blocks;
    config_section_t *blocks;
    size_t n_actions;
    config_section_t *actions;
    char *font;
    char *monitor;
    uint32_t height;
    uint32_t width;
    bool override_redirect;
    color_t background;
} config_t;

void config_init(config_t *config);

void config_read(config_t *config, FILE *file);

void config_resolve(config_t *config, block_t *block);

void config_free(config_t *config);

#endif