2019-07-16 11:52:22 +02:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
2019-07-21 11:06:28 +02:00
|
|
|
|
#include <stdint.h>
|
2019-07-17 10:12:14 +02:00
|
|
|
|
#include <stdbool.h>
|
fcft: adapt to API changes in fcft-3.x
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.
Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.
For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).
Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.
These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.
For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.
FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.
Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.
Other fcft API changes:
* fcft_glyph_rasterize() -> fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
2021-08-21 14:50:42 +02:00
|
|
|
|
#include <uchar.h>
|
2019-07-17 10:12:14 +02:00
|
|
|
|
|
2022-02-07 19:35:52 +01:00
|
|
|
|
#include <xkbcommon/xkbcommon.h>
|
2019-12-01 13:43:51 +01:00
|
|
|
|
#include <tllist.h>
|
2022-02-07 19:35:52 +01:00
|
|
|
|
#include <fcft/fcft.h>
|
2019-12-01 13:43:51 +01:00
|
|
|
|
|
2020-07-30 18:57:21 +02:00
|
|
|
|
#include "user-notification.h"
|
2019-07-22 20:15:14 +02:00
|
|
|
|
|
2021-06-17 18:15:29 +02:00
|
|
|
|
#define DEFINE_LIST(type) \
|
|
|
|
|
|
type##_list { \
|
|
|
|
|
|
size_t count; \
|
|
|
|
|
|
type *arr; \
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-02-07 19:35:52 +01:00
|
|
|
|
/* If px != 0 then px is valid, otherwise pt is valid */
|
|
|
|
|
|
struct pt_or_px {
|
|
|
|
|
|
int16_t px;
|
|
|
|
|
|
float pt;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum cursor_style { CURSOR_BLOCK, CURSOR_UNDERLINE, CURSOR_BEAM };
|
|
|
|
|
|
|
2020-09-08 19:17:29 +02:00
|
|
|
|
enum conf_size_type {CONF_SIZE_PX, CONF_SIZE_CELLS};
|
|
|
|
|
|
|
2020-07-07 10:44:55 +02:00
|
|
|
|
struct config_font {
|
|
|
|
|
|
char *pattern;
|
2021-11-06 12:01:57 +01:00
|
|
|
|
float pt_size;
|
2020-07-07 10:44:55 +02:00
|
|
|
|
int px_size;
|
|
|
|
|
|
};
|
2021-06-17 18:15:29 +02:00
|
|
|
|
DEFINE_LIST(struct config_font);
|
2020-07-07 10:44:55 +02:00
|
|
|
|
|
config: key/mouse bindings: refactor: less parsing in keyboard_enter()
This simplifies the handling of mouse and keyboard bindings.
Before, the bindings where parsed *both* when loading the
configuration, and then on every keyboard enter event. This was done
since keys require a keymap to be decoded. Something we don't have at
configuration time. The idea was that at config time, we used a
default keymap just to verify the key combo strings were valid.
The following has changed:
* The bindings in the config struct is now *one* key combo per
entry. Previously, it was one *action* per entry, and each entry
had one or more key combos.
Doing it this way makes it easier when converting the binding in the
keyboard enter event (which previously had to expand the combos
anyway).
* The bindings in the config struct no longer contains any unparsed
strings.
A key binding contains a decoded 'modifier' struct (which specifies
whether e.g. ctrl, or shift, or ctrl+shift must be pressed for the
binding to be used).
It also contains a decoded XKB keysym.
* A mouse binding in the config struct is similar to a key binding,
except it contains the button, and click count instead of the XKB
key sym.
* The modifiers in the user-specified key combo is decoded at config
time, by using the pre-defined XKB constants
XKB_MOD_NAME_<modifier>.
The result is stored in a 'modifiers' struct, which is just a
collection of booleans; one for each supported modifier.
The supported modifiers are: shift, ctrl, alt and meta/super.
* The key sym is decoded at config time using
xkb_keysym_from_name(). This call does *not* depend on a keymap.
* The mouse button is decoded at config time using a hardcoded mapping
table (just like before).
* The click count is currently hard-coded to 1.
* In the keyboard enter event, all we need to do is pre-compute the
xkb_mod_mask_t variable for each key/mouse binding, and find all the
*key codes* that map to the (already decoded) symbol.
For mouse bindings, the modifiers are the *only* reason we convert
the mouse bindings at all.
In fact, on button events, we check if the seat has a keyboard. If
not, we use the mouse bindings from the configuration directly, and
simply filter out those with a non-empty set of modifiers.
2020-08-10 19:00:03 +02:00
|
|
|
|
struct config_key_modifiers {
|
|
|
|
|
|
bool shift;
|
|
|
|
|
|
bool alt;
|
|
|
|
|
|
bool ctrl;
|
2021-12-05 16:30:01 +01:00
|
|
|
|
bool super;
|
config: key/mouse bindings: refactor: less parsing in keyboard_enter()
This simplifies the handling of mouse and keyboard bindings.
Before, the bindings where parsed *both* when loading the
configuration, and then on every keyboard enter event. This was done
since keys require a keymap to be decoded. Something we don't have at
configuration time. The idea was that at config time, we used a
default keymap just to verify the key combo strings were valid.
The following has changed:
* The bindings in the config struct is now *one* key combo per
entry. Previously, it was one *action* per entry, and each entry
had one or more key combos.
Doing it this way makes it easier when converting the binding in the
keyboard enter event (which previously had to expand the combos
anyway).
* The bindings in the config struct no longer contains any unparsed
strings.
A key binding contains a decoded 'modifier' struct (which specifies
whether e.g. ctrl, or shift, or ctrl+shift must be pressed for the
binding to be used).
It also contains a decoded XKB keysym.
* A mouse binding in the config struct is similar to a key binding,
except it contains the button, and click count instead of the XKB
key sym.
* The modifiers in the user-specified key combo is decoded at config
time, by using the pre-defined XKB constants
XKB_MOD_NAME_<modifier>.
The result is stored in a 'modifiers' struct, which is just a
collection of booleans; one for each supported modifier.
The supported modifiers are: shift, ctrl, alt and meta/super.
* The key sym is decoded at config time using
xkb_keysym_from_name(). This call does *not* depend on a keymap.
* The mouse button is decoded at config time using a hardcoded mapping
table (just like before).
* The click count is currently hard-coded to 1.
* In the keyboard enter event, all we need to do is pre-compute the
xkb_mod_mask_t variable for each key/mouse binding, and find all the
*key codes* that map to the (already decoded) symbol.
For mouse bindings, the modifiers are the *only* reason we convert
the mouse bindings at all.
In fact, on button events, we check if the seat has a keyboard. If
not, we use the mouse bindings from the configuration directly, and
simply filter out those with a non-empty set of modifiers.
2020-08-10 19:00:03 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
2021-06-18 16:18:41 +02:00
|
|
|
|
struct argv {
|
|
|
|
|
|
char **args;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2022-02-08 19:35:41 +01:00
|
|
|
|
enum binding_aux_type {
|
|
|
|
|
|
BINDING_AUX_NONE,
|
|
|
|
|
|
BINDING_AUX_PIPE,
|
2022-02-06 19:36:44 +01:00
|
|
|
|
BINDING_AUX_TEXT,
|
2022-02-08 19:35:41 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct binding_aux {
|
|
|
|
|
|
enum binding_aux_type type;
|
2021-02-07 14:46:29 +01:00
|
|
|
|
bool master_copy;
|
2022-02-08 19:35:41 +01:00
|
|
|
|
|
|
|
|
|
|
union {
|
|
|
|
|
|
struct argv pipe;
|
2022-02-06 19:36:44 +01:00
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
|
uint8_t *data;
|
|
|
|
|
|
size_t len;
|
|
|
|
|
|
} text;
|
2022-02-08 19:35:41 +01:00
|
|
|
|
};
|
config: key/mouse bindings: refactor: less parsing in keyboard_enter()
This simplifies the handling of mouse and keyboard bindings.
Before, the bindings where parsed *both* when loading the
configuration, and then on every keyboard enter event. This was done
since keys require a keymap to be decoded. Something we don't have at
configuration time. The idea was that at config time, we used a
default keymap just to verify the key combo strings were valid.
The following has changed:
* The bindings in the config struct is now *one* key combo per
entry. Previously, it was one *action* per entry, and each entry
had one or more key combos.
Doing it this way makes it easier when converting the binding in the
keyboard enter event (which previously had to expand the combos
anyway).
* The bindings in the config struct no longer contains any unparsed
strings.
A key binding contains a decoded 'modifier' struct (which specifies
whether e.g. ctrl, or shift, or ctrl+shift must be pressed for the
binding to be used).
It also contains a decoded XKB keysym.
* A mouse binding in the config struct is similar to a key binding,
except it contains the button, and click count instead of the XKB
key sym.
* The modifiers in the user-specified key combo is decoded at config
time, by using the pre-defined XKB constants
XKB_MOD_NAME_<modifier>.
The result is stored in a 'modifiers' struct, which is just a
collection of booleans; one for each supported modifier.
The supported modifiers are: shift, ctrl, alt and meta/super.
* The key sym is decoded at config time using
xkb_keysym_from_name(). This call does *not* depend on a keymap.
* The mouse button is decoded at config time using a hardcoded mapping
table (just like before).
* The click count is currently hard-coded to 1.
* In the keyboard enter event, all we need to do is pre-compute the
xkb_mod_mask_t variable for each key/mouse binding, and find all the
*key codes* that map to the (already decoded) symbol.
For mouse bindings, the modifiers are the *only* reason we convert
the mouse bindings at all.
In fact, on button events, we check if the seat has a keyboard. If
not, we use the mouse bindings from the configuration directly, and
simply filter out those with a non-empty set of modifiers.
2020-08-10 19:00:03 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
2022-02-08 19:02:28 +01:00
|
|
|
|
enum key_binding_type {
|
2021-12-06 21:04:38 +01:00
|
|
|
|
KEY_BINDING,
|
|
|
|
|
|
MOUSE_BINDING,
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2022-02-06 19:36:44 +01:00
|
|
|
|
struct config_key_binding_text {
|
|
|
|
|
|
char *text;
|
|
|
|
|
|
bool master_copy;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2021-02-07 14:46:29 +01:00
|
|
|
|
struct config_key_binding {
|
|
|
|
|
|
int action; /* One of the varios bind_action_* enums from wayland.h */
|
2021-01-30 12:43:59 +01:00
|
|
|
|
struct config_key_modifiers modifiers;
|
2021-12-06 21:04:38 +01:00
|
|
|
|
union {
|
|
|
|
|
|
/* Key bindings */
|
|
|
|
|
|
struct {
|
|
|
|
|
|
xkb_keysym_t sym;
|
|
|
|
|
|
} k;
|
|
|
|
|
|
|
|
|
|
|
|
/* Mouse bindings */
|
|
|
|
|
|
struct {
|
|
|
|
|
|
int button;
|
|
|
|
|
|
int count;
|
|
|
|
|
|
} m;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2022-02-08 19:35:41 +01:00
|
|
|
|
struct binding_aux aux;
|
2021-12-05 15:19:22 +01:00
|
|
|
|
|
|
|
|
|
|
/* For error messages in collision handling */
|
|
|
|
|
|
const char *path;
|
|
|
|
|
|
int lineno;
|
2021-01-30 12:43:59 +01:00
|
|
|
|
};
|
2021-06-17 18:15:29 +02:00
|
|
|
|
DEFINE_LIST(struct config_key_binding);
|
2021-01-30 12:43:59 +01:00
|
|
|
|
|
2021-06-11 04:40:08 -05:00
|
|
|
|
typedef tll(char *) config_override_t;
|
|
|
|
|
|
|
2021-01-31 14:27:13 +01:00
|
|
|
|
struct config_spawn_template {
|
2021-06-18 16:18:41 +02:00
|
|
|
|
struct argv argv;
|
2021-01-31 14:27:13 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
2019-07-16 11:52:22 +02:00
|
|
|
|
struct config {
|
2019-07-18 14:29:40 +02:00
|
|
|
|
char *term;
|
2019-07-17 09:29:56 +02:00
|
|
|
|
char *shell;
|
2020-04-01 19:59:47 +02:00
|
|
|
|
char *title;
|
2020-04-01 18:40:51 +02:00
|
|
|
|
char *app_id;
|
fcft: adapt to API changes in fcft-3.x
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.
Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.
For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).
Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.
These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.
For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.
FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.
Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.
Other fcft API changes:
* fcft_glyph_rasterize() -> fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
2021-08-21 14:50:42 +02:00
|
|
|
|
char32_t *word_delimiters;
|
2020-02-20 18:35:10 +01:00
|
|
|
|
bool login_shell;
|
2021-07-04 17:59:40 +02:00
|
|
|
|
bool locked_title;
|
2020-09-08 19:17:29 +02:00
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
|
enum conf_size_type type;
|
2021-11-06 12:32:20 +01:00
|
|
|
|
uint32_t width;
|
|
|
|
|
|
uint32_t height;
|
2020-09-08 19:17:29 +02:00
|
|
|
|
} size;
|
|
|
|
|
|
|
2020-02-15 19:00:56 +01:00
|
|
|
|
unsigned pad_x;
|
|
|
|
|
|
unsigned pad_y;
|
2021-01-06 11:17:29 +01:00
|
|
|
|
bool center;
|
2021-01-21 15:14:43 +01:00
|
|
|
|
uint16_t resize_delay_ms;
|
2020-09-08 19:17:29 +02:00
|
|
|
|
|
2021-04-17 21:57:08 +02:00
|
|
|
|
struct {
|
|
|
|
|
|
bool enabled;
|
|
|
|
|
|
bool palette_based;
|
|
|
|
|
|
} bold_in_bright;
|
|
|
|
|
|
|
2020-03-26 19:39:12 +01:00
|
|
|
|
enum { STARTUP_WINDOWED, STARTUP_MAXIMIZED, STARTUP_FULLSCREEN } startup_mode;
|
2019-08-23 17:26:41 +02:00
|
|
|
|
|
2020-12-17 12:05:22 +01:00
|
|
|
|
enum {DPI_AWARE_AUTO, DPI_AWARE_YES, DPI_AWARE_NO} dpi_aware;
|
2021-06-17 18:15:29 +02:00
|
|
|
|
struct config_font_list fonts[4];
|
2019-07-21 11:06:28 +02:00
|
|
|
|
|
2021-01-07 11:16:02 +01:00
|
|
|
|
/* Custom font metrics (-1 = use real font metrics) */
|
2021-01-11 19:37:05 +01:00
|
|
|
|
struct pt_or_px line_height;
|
|
|
|
|
|
struct pt_or_px letter_spacing;
|
2021-01-07 11:16:02 +01:00
|
|
|
|
|
|
|
|
|
|
/* Adjusted letter x/y offsets */
|
2021-01-11 19:37:05 +01:00
|
|
|
|
struct pt_or_px horizontal_letter_offset;
|
|
|
|
|
|
struct pt_or_px vertical_letter_offset;
|
2021-01-07 11:16:02 +01:00
|
|
|
|
|
2021-06-17 17:52:38 +02:00
|
|
|
|
bool use_custom_underline_offset;
|
|
|
|
|
|
struct pt_or_px underline_offset;
|
|
|
|
|
|
|
2021-04-09 23:19:20 +02:00
|
|
|
|
bool box_drawings_uses_font_glyphs;
|
2020-08-20 19:25:35 +02:00
|
|
|
|
bool can_shape_grapheme;
|
2021-04-09 23:19:20 +02:00
|
|
|
|
|
2021-04-29 04:12:55 -05:00
|
|
|
|
struct {
|
|
|
|
|
|
bool urgent;
|
|
|
|
|
|
bool notify;
|
|
|
|
|
|
struct config_spawn_template command;
|
|
|
|
|
|
bool command_focused;
|
|
|
|
|
|
} bell;
|
|
|
|
|
|
|
2020-07-25 14:31:45 +02:00
|
|
|
|
struct {
|
2021-11-06 12:01:57 +01:00
|
|
|
|
uint32_t lines;
|
2020-07-25 14:31:45 +02:00
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
|
enum {
|
2020-07-27 20:02:51 +02:00
|
|
|
|
SCROLLBACK_INDICATOR_POSITION_NONE,
|
|
|
|
|
|
SCROLLBACK_INDICATOR_POSITION_FIXED,
|
|
|
|
|
|
SCROLLBACK_INDICATOR_POSITION_RELATIVE
|
|
|
|
|
|
} position;
|
2020-07-25 14:31:45 +02:00
|
|
|
|
|
|
|
|
|
|
enum {
|
2020-07-26 11:39:02 +02:00
|
|
|
|
SCROLLBACK_INDICATOR_FORMAT_PERCENTAGE,
|
2020-07-28 19:56:53 +02:00
|
|
|
|
SCROLLBACK_INDICATOR_FORMAT_LINENO,
|
|
|
|
|
|
SCROLLBACK_INDICATOR_FORMAT_TEXT,
|
2020-07-25 14:31:45 +02:00
|
|
|
|
} format;
|
2020-07-28 19:56:53 +02:00
|
|
|
|
|
fcft: adapt to API changes in fcft-3.x
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.
Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.
For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).
Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.
These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.
For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.
FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.
Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.
Other fcft API changes:
* fcft_glyph_rasterize() -> fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
2021-08-21 14:50:42 +02:00
|
|
|
|
char32_t *text;
|
2020-07-25 14:31:45 +02:00
|
|
|
|
} indicator;
|
2021-11-06 12:01:57 +01:00
|
|
|
|
float multiplier;
|
2020-07-25 14:31:45 +02:00
|
|
|
|
} scrollback;
|
2019-08-01 19:28:14 +02:00
|
|
|
|
|
2021-05-20 17:56:56 +02:00
|
|
|
|
struct {
|
fcft: adapt to API changes in fcft-3.x
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.
Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.
For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).
Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.
These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.
For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.
FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.
Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.
Other fcft API changes:
* fcft_glyph_rasterize() -> fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
2021-08-21 14:50:42 +02:00
|
|
|
|
char32_t *label_letters;
|
2021-05-20 17:56:56 +02:00
|
|
|
|
struct config_spawn_template launch;
|
|
|
|
|
|
enum {
|
|
|
|
|
|
OSC8_UNDERLINE_URL_MODE,
|
|
|
|
|
|
OSC8_UNDERLINE_ALWAYS,
|
|
|
|
|
|
} osc8_underline;
|
|
|
|
|
|
|
fcft: adapt to API changes in fcft-3.x
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.
Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.
For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).
Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.
These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.
For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.
FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.
Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.
Other fcft API changes:
* fcft_glyph_rasterize() -> fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
2021-08-21 14:50:42 +02:00
|
|
|
|
char32_t **protocols;
|
|
|
|
|
|
char32_t *uri_characters;
|
2021-05-20 17:58:06 +02:00
|
|
|
|
size_t prot_count;
|
|
|
|
|
|
size_t max_prot_len;
|
2021-05-20 17:56:56 +02:00
|
|
|
|
} url;
|
|
|
|
|
|
|
2019-07-21 11:06:28 +02:00
|
|
|
|
struct {
|
|
|
|
|
|
uint32_t fg;
|
|
|
|
|
|
uint32_t bg;
|
2021-04-07 08:07:43 +02:00
|
|
|
|
uint32_t table[256];
|
2019-08-16 22:06:06 +02:00
|
|
|
|
uint16_t alpha;
|
2020-08-12 18:53:32 +02:00
|
|
|
|
uint32_t selection_fg;
|
|
|
|
|
|
uint32_t selection_bg;
|
2021-02-06 11:10:40 +01:00
|
|
|
|
uint32_t url;
|
|
|
|
|
|
|
2021-11-03 14:25:38 +01:00
|
|
|
|
uint32_t dim[8];
|
|
|
|
|
|
|
2021-02-06 11:10:40 +01:00
|
|
|
|
struct {
|
|
|
|
|
|
uint32_t fg;
|
|
|
|
|
|
uint32_t bg;
|
|
|
|
|
|
} jump_label;
|
2021-02-06 10:35:48 +01:00
|
|
|
|
|
2021-09-27 19:05:40 +00:00
|
|
|
|
struct {
|
|
|
|
|
|
uint32_t fg;
|
|
|
|
|
|
uint32_t bg;
|
|
|
|
|
|
} scrollback_indicator;
|
|
|
|
|
|
|
2021-02-06 10:35:48 +01:00
|
|
|
|
struct {
|
|
|
|
|
|
bool selection:1;
|
2021-02-06 11:10:40 +01:00
|
|
|
|
bool jump_label:1;
|
2021-09-27 19:05:40 +00:00
|
|
|
|
bool scrollback_indicator:1;
|
2021-02-06 11:10:40 +01:00
|
|
|
|
bool url:1;
|
2021-11-03 14:25:38 +01:00
|
|
|
|
uint8_t dim;
|
2021-02-06 10:35:48 +01:00
|
|
|
|
} use_custom;
|
2019-07-21 11:06:28 +02:00
|
|
|
|
} colors;
|
2019-07-22 20:15:14 +02:00
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
|
enum cursor_style style;
|
2020-06-30 17:45:34 +02:00
|
|
|
|
bool blink;
|
2019-07-23 18:54:58 +02:00
|
|
|
|
struct {
|
|
|
|
|
|
uint32_t text;
|
|
|
|
|
|
uint32_t cursor;
|
|
|
|
|
|
} color;
|
2021-04-30 20:31:47 +02:00
|
|
|
|
struct pt_or_px beam_thickness;
|
2021-05-18 18:52:10 +02:00
|
|
|
|
struct pt_or_px underline_thickness;
|
2019-07-22 20:15:14 +02:00
|
|
|
|
} cursor;
|
2019-07-29 20:13:26 +02:00
|
|
|
|
|
2020-08-04 07:33:15 +02:00
|
|
|
|
struct {
|
|
|
|
|
|
bool hide_when_typing;
|
2020-09-15 19:09:00 +02:00
|
|
|
|
bool alternate_scroll_mode;
|
2021-09-27 19:09:07 +00:00
|
|
|
|
struct config_key_modifiers selection_override_modifiers;
|
2020-08-04 07:33:15 +02:00
|
|
|
|
} mouse;
|
|
|
|
|
|
|
2020-03-08 12:08:46 +01:00
|
|
|
|
struct {
|
|
|
|
|
|
/* Bindings for "normal" mode */
|
2021-06-17 18:15:29 +02:00
|
|
|
|
struct config_key_binding_list key;
|
2021-12-06 21:04:38 +01:00
|
|
|
|
struct config_key_binding_list mouse;
|
2020-03-08 12:08:46 +01:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Special modes
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/* While searching (not - action to *start* a search is in the
|
|
|
|
|
|
* 'key' bindings above */
|
2021-06-17 18:15:29 +02:00
|
|
|
|
struct config_key_binding_list search;
|
2021-01-30 12:43:59 +01:00
|
|
|
|
|
|
|
|
|
|
/* While showing URL jump labels */
|
2021-06-17 18:15:29 +02:00
|
|
|
|
struct config_key_binding_list url;
|
2020-03-08 12:08:46 +01:00
|
|
|
|
} bindings;
|
|
|
|
|
|
|
2020-03-02 18:42:49 +01:00
|
|
|
|
struct {
|
2020-10-10 11:04:17 +02:00
|
|
|
|
enum { CONF_CSD_PREFER_NONE, CONF_CSD_PREFER_SERVER, CONF_CSD_PREFER_CLIENT } preferred;
|
2020-03-02 18:42:49 +01:00
|
|
|
|
|
2021-11-06 12:01:57 +01:00
|
|
|
|
uint16_t title_height;
|
|
|
|
|
|
uint16_t border_width;
|
|
|
|
|
|
uint16_t border_width_visible;
|
|
|
|
|
|
uint16_t button_width;
|
2020-03-02 18:42:49 +01:00
|
|
|
|
|
|
|
|
|
|
struct {
|
2021-02-06 11:12:22 +01:00
|
|
|
|
bool title_set:1;
|
2021-06-20 10:44:50 +02:00
|
|
|
|
bool buttons_set:1;
|
2021-02-06 11:12:22 +01:00
|
|
|
|
bool minimize_set:1;
|
|
|
|
|
|
bool maximize_set:1;
|
|
|
|
|
|
bool close_set:1;
|
2021-10-27 18:27:08 +02:00
|
|
|
|
bool border_set:1;
|
2020-03-02 18:42:49 +01:00
|
|
|
|
uint32_t title;
|
2021-06-20 10:44:50 +02:00
|
|
|
|
uint32_t buttons;
|
2020-03-02 20:29:28 +01:00
|
|
|
|
uint32_t minimize;
|
|
|
|
|
|
uint32_t maximize;
|
2022-02-08 20:12:05 +01:00
|
|
|
|
uint32_t quit; /* ‘close’ collides with #define in epoll-shim */
|
2021-10-27 18:27:08 +02:00
|
|
|
|
uint32_t border;
|
2020-03-02 18:42:49 +01:00
|
|
|
|
} color;
|
2021-07-22 23:21:31 +02:00
|
|
|
|
|
|
|
|
|
|
struct config_font_list font;
|
2020-03-02 18:42:49 +01:00
|
|
|
|
} csd;
|
|
|
|
|
|
|
2021-11-06 12:01:57 +01:00
|
|
|
|
uint16_t render_worker_count;
|
2019-12-14 12:59:06 +01:00
|
|
|
|
char *server_socket_path;
|
2019-12-31 15:39:40 +01:00
|
|
|
|
bool presentation_timings;
|
2020-02-03 19:58:32 +01:00
|
|
|
|
bool hold_at_exit;
|
2021-01-16 11:26:03 +01:00
|
|
|
|
enum {
|
2021-01-16 15:39:44 +01:00
|
|
|
|
SELECTION_TARGET_NONE,
|
2021-01-16 11:26:03 +01:00
|
|
|
|
SELECTION_TARGET_PRIMARY,
|
|
|
|
|
|
SELECTION_TARGET_CLIPBOARD,
|
|
|
|
|
|
SELECTION_TARGET_BOTH
|
|
|
|
|
|
} selection_target;
|
2020-03-17 16:46:54 +01:00
|
|
|
|
|
2021-01-31 14:27:13 +01:00
|
|
|
|
struct config_spawn_template notify;
|
2021-10-05 23:07:01 +02:00
|
|
|
|
bool notify_focus_inhibit;
|
2021-02-14 21:29:22 +01:00
|
|
|
|
|
2020-03-17 16:46:54 +01:00
|
|
|
|
struct {
|
2020-09-13 17:59:56 +02:00
|
|
|
|
enum fcft_scaling_filter fcft_filter;
|
2021-06-15 11:45:27 +02:00
|
|
|
|
bool overflowing_glyphs;
|
2020-08-20 19:25:35 +02:00
|
|
|
|
bool grapheme_shaping;
|
2021-11-22 23:02:25 +01:00
|
|
|
|
enum {
|
|
|
|
|
|
GRAPHEME_WIDTH_WCSWIDTH,
|
|
|
|
|
|
GRAPHEME_WIDTH_DOUBLE,
|
|
|
|
|
|
GRAPHEME_WIDTH_MAX,
|
|
|
|
|
|
} grapheme_width_method;
|
2022-01-13 12:08:20 +01:00
|
|
|
|
enum {
|
|
|
|
|
|
RENDER_TIMER_NONE,
|
|
|
|
|
|
RENDER_TIMER_OSD,
|
|
|
|
|
|
RENDER_TIMER_LOG,
|
|
|
|
|
|
RENDER_TIMER_BOTH
|
|
|
|
|
|
} render_timer;
|
2020-09-06 17:52:07 +02:00
|
|
|
|
bool damage_whole_window;
|
2021-11-06 12:01:57 +01:00
|
|
|
|
uint32_t delayed_render_lower_ns;
|
|
|
|
|
|
uint32_t delayed_render_upper_ns;
|
2020-03-25 20:48:02 +01:00
|
|
|
|
off_t max_shm_pool_size;
|
2021-01-08 10:27:35 +01:00
|
|
|
|
float box_drawing_base_thickness;
|
2021-05-05 22:24:25 +02:00
|
|
|
|
bool box_drawing_solid_shades;
|
2021-08-31 19:42:22 +02:00
|
|
|
|
bool font_monospace_warn;
|
2022-02-27 16:29:35 +01:00
|
|
|
|
bool sixel;
|
2020-03-17 16:46:54 +01:00
|
|
|
|
} tweak;
|
2020-07-29 19:42:12 +02:00
|
|
|
|
|
2020-07-30 18:57:21 +02:00
|
|
|
|
user_notifications_t notifications;
|
2019-07-16 11:52:22 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
2021-06-11 04:40:08 -05:00
|
|
|
|
bool config_override_apply(struct config *conf, config_override_t *overrides,
|
|
|
|
|
|
bool errors_are_fatal);
|
2020-09-08 19:17:29 +02:00
|
|
|
|
bool config_load(
|
|
|
|
|
|
struct config *conf, const char *path,
|
2021-06-11 04:40:08 -05:00
|
|
|
|
user_notifications_t *initial_user_notifications,
|
|
|
|
|
|
config_override_t *overrides, bool errors_are_fatal);
|
2022-04-12 13:01:56 +02:00
|
|
|
|
void config_free(struct config *conf);
|
2021-06-18 16:18:41 +02:00
|
|
|
|
struct config *config_clone(const struct config *old);
|
2020-07-07 10:44:55 +02:00
|
|
|
|
|
2020-12-15 18:55:27 +01:00
|
|
|
|
bool config_font_parse(const char *pattern, struct config_font *font);
|
2021-06-17 18:15:29 +02:00
|
|
|
|
void config_font_list_destroy(struct config_font_list *font_list);
|
2021-08-31 19:42:22 +02:00
|
|
|
|
|
|
|
|
|
|
bool check_if_font_is_monospaced(
|
|
|
|
|
|
const char *pattern, user_notifications_t *notifications);
|