-
Notifications
You must be signed in to change notification settings - Fork 21
/
config.h
117 lines (103 loc) · 3.41 KB
/
config.h
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* config.h
*
* Copyright (C) 2013-2016 Bartek Fabiszewski (www.fabiszewski.net)
*
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU Library General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef config_h
#define config_h
#include <gtk/gtk.h>
/** Kterm version */
#ifndef VERSION
# define VERSION "2.0"
#endif
#ifdef KINDLE
/** Kindle title scheme */
# define TITLE "L:A_N:application_ID:net.fabiszewski.kterm_PC:N_O:URL"
# define TITLE_DIALOG "L:D_N:application_ID:net.fabiszewski.kterm_O:URL"
/** Mouse button to open popup menu */
// middle button on kindle
# define BUTTON_MENU 2
/** Terminfo path */
# define TERMINFO_PATH SYSCONFDIR "/vte/terminfo"
#else
/** Window title */
# define TITLE "kterm " VERSION
/** Mouse button to open popup menu */
# define BUTTON_MENU 3
#endif
/** Sysconf path */
#ifndef SYSCONFDIR
# define SYSCONFDIR "/etc/local"
#endif
/** Default keyboard config path */
#define KB_FULL_PATH SYSCONFDIR "/layouts/keyboard.xml"
/** Keyboard max factor. Keyboard takes at most 1/3 of the screen height */
#define KB_HEIGHTMAX_FACTOR 3
/** mm to inch conversion multiplier */
#define MM_TO_IN 0.0393701
/** Preferred key button height in inches */
#define KB_KEYHEIGHT_PREF (double) (8 * MM_TO_IN)
/** Config file name */
#define CONFIG_FILE "kterm.conf"
/** Default config file path */
#define CONFIG_FULL_PATH SYSCONFDIR "/kterm/" CONFIG_FILE
/** Resize font up */
#define FONT_UP 0
/** Resize font down */
#define FONT_DOWN 1
#ifndef MAX
/** MAX macro */
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef PATH_MAX
/** Path max */
# define PATH_MAX 4096
#endif
/** Max count of arguments passed to terminal */
#define TERM_ARGS_MAX 50
/** Delay for key release event */
#define KB_RELEASE_DELAY_MS 100
/** Terminal scrollback size */
#define VTE_SCROLLBACK_LINES 200
/** Default terminal font family */
#define VTE_FONT_FAMILY "monospace"
/** Default terminal font size */
#define VTE_FONT_SIZE 8
/** Default terminal encoding */
#define VTE_ENCODING "UTF-8"
/** Terminal color scheme normal */
#define VTE_SCHEME_LIGHT FALSE
/** Terminal color scheme reversed */
#define VTE_SCHEME_DARK TRUE
/** Debug */
extern gboolean debug;
#define D if G_UNLIKELY(debug)
/** Unused variable */
#define UNUSED(x) (void)(x)
/** Kterm config */
typedef struct {
gboolean kb_on; /** Keyboard visibility */
gboolean color_reversed; /** Color scheme, is reversed */
gchar font_family[50]; /** Terminal font family */
guint font_size; /** Terminal font size */
gchar cursor_shape; /** Terminal cursor shape: 'B', 'I' or 'U' */
gchar encoding[50]; /** Terminal encoding */
gchar kb_conf_path[PATH_MAX]; /** Keyboard config path */
gchar orientation; /** Screen orientation: 'U', 'R' or 'L' */
gchar orientation_saved; /** Initial screen orientation: 'U', 'R' or 'L' */
} KTconf;
KTconf * parse_config(void);
#endif