libxputty 0.1
Loading...
Searching...
No Matches
xcolor.h
Go to the documentation of this file.
1/*
2 * 0BSD
3 *
4 * BSD Zero Clause License
5 *
6 * Copyright (c) 2019 Hermann Meyer
7 *
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted.
10
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 *
19 */
20
21#pragma once
22
23#ifndef XCOLOR_H_
24#define XCOLOR_H_
25
26#include "xputty.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32
50
72
85typedef struct {
86 double fg[4];
87 double bg[4];
88 double base[4];
89 double text[4];
90 double shadow[4];
91 double frame[4];
92 double light[4];
93} Colors;
94
112
123 double r;
124 double g;
125 double b;
126 double a;
127};
128
135void set_dark_theme(Xputty *main);
136
143void set_light_theme(Xputty *main);
144
152
153
166 double r, double g, double b, double a);
167
177void widget_set_color(double *c, double r, double g, double b, double a);
178
188
197
205
213
221
229
237
245
253
260
270void set_systray_color(Xputty *main, double r, double g, double b, double a);
271
280void set_pattern(Widget_t *w, Colors *from, Colors *to, Color_mod mod);
281
282#ifdef __cplusplus
283}
284#endif
285
286#endif //XCOLOR_H_
Color_t - struct used to set cairo color for Widget_t.
Definition xcolor.h:85
SystrayColor - the Systray Color struct SystrayColor could be used for the backgroung color of the Sy...
Definition xcolor.h:122
Widget_t - struct to hold the basic Widget_t info.
Definition xwidget.h:457
XColor_t - the Widget_t Color struct XColor_t could be used for theming you Widget_t set.
Definition xcolor.h:105
Colors normal
Definition xcolor.h:106
Colors insensitive
Definition xcolor.h:110
Colors selected
Definition xcolor.h:108
Colors active
Definition xcolor.h:109
Colors prelight
Definition xcolor.h:107
Xputty - the main struct. It should be declared before any other call to a Xputty function....
Definition xputty.h:228
void use_frame_color_scheme(Widget_t *w, Color_state st)
use_frame_color_scheme - use frame Colors to paint on Widget_t
Definition xcolor.c:280
Color_state get_color_state(Widget_t *wid)
get_color_state - get the Color_state to use in relation to the Widget_t state
Definition xcolor.c:222
void use_text_color_scheme(Widget_t *w, Color_state st)
use_text_color_scheme - use text Colors to paint on Widget_t
Definition xcolor.c:266
void use_systray_color(Widget_t *w)
use_systray_color - use systray Colors to paint on Widget_t
Definition xcolor.c:294
void color_scheme_to_childs(Widget_t *wid)
color_scheme_to_childs - copy a colorscheme to all childs light theme
Definition xcolor.c:130
Color_mod
Color_mod - select color mod to use on draw.
Definition xcolor.h:63
@ BASE_
Definition xcolor.h:66
@ SHADOW_
Definition xcolor.h:68
@ FRAME_
Definition xcolor.h:69
@ FORGROUND_
Definition xcolor.h:64
@ BACKGROUND_
Definition xcolor.h:65
@ TEXT_
Definition xcolor.h:67
@ LIGHT_
Definition xcolor.h:70
void use_bg_color_scheme(Widget_t *w, Color_state st)
use_bg_color_scheme - use background Colors to paint on Widget_t
Definition xcolor.c:252
void use_fg_color_scheme(Widget_t *w, Color_state st)
use_fg_color_scheme - use forground Colors to paint on Widget_t
Definition xcolor.c:245
void set_pattern(Widget_t *w, Colors *from, Colors *to, Color_mod mod)
set_pattern - set pattern for the selected Colors
Definition xcolor.c:308
void set_light_theme(Xputty *main)
set_light_theme - init the XColor_t struct to the default light theme
Definition xcolor.c:77
void use_light_color_scheme(Widget_t *w, Color_state st)
use_light_color_scheme - use light Colors to paint on Widget_t
Definition xcolor.c:287
void set_dark_theme(Xputty *main)
set_dark_theme - init the XColor_t struct to the default dark theme
Definition xcolor.c:24
Colors * get_color_scheme(Widget_t *wid, Color_state st)
get_color_scheme - get pointer to the Colors struct to use in relation to the Color_state
Definition xcolor.c:197
void set_widget_color(Widget_t *w, Color_state st, Color_mod mod, double r, double g, double b, double a)
set_widget_color - set a individual Widget_t color
Definition xcolor.c:146
void use_shadow_color_scheme(Widget_t *w, Color_state st)
use_shadow_color_scheme - use shadow Colors to paint on Widget_t
Definition xcolor.c:273
void set_systray_color(Xputty *main, double r, double g, double b, double a)
set_systray_color - set the systray background color
Definition xcolor.c:300
void use_base_color_scheme(Widget_t *w, Color_state st)
use_base_color_scheme - use base Colors to paint on Widget_t
Definition xcolor.c:259
void widget_set_color(double *c, double r, double g, double b, double a)
widget_set_color - set a individual Widget_t color
Definition xcolor.c:139
Color_state
Color_state - select color mode to use on Widget_t.
Definition xcolor.h:43
@ NORMAL_
Definition xcolor.h:44
@ INSENSITIVE_
Definition xcolor.h:48
@ SELECTED_
Definition xcolor.h:46
@ PRELIGHT_
Definition xcolor.h:45
@ ACTIVE_
Definition xcolor.h:47
This file contains definitions and structs used on all platforms. Platform specific definitions are l...