24
23
#define TERMINAL_PROFILE_H
26
25
#include <gtk/gtk.h>
27
#include <gconf/gconf-client.h>
29
#define CONF_PREFIX "/apps/gnome-terminal"
30
#define CONF_GLOBAL_PREFIX CONF_PREFIX"/global"
31
#define CONF_PROFILES_PREFIX CONF_PREFIX"/profiles"
32
#define CONF_KEYS_PREFIX CONF_PREFIX"/keybindings"
33
#define FALLBACK_PROFILE_ID "Default"
37
unsigned int visible_name : 1;
38
unsigned int default_show_menubar : 1;
39
unsigned int foreground_color : 1;
40
unsigned int background_color : 1;
41
unsigned int title : 1;
42
unsigned int title_mode : 1;
43
unsigned int allow_bold : 1;
44
unsigned int silent_bell : 1;
45
unsigned int word_chars : 1;
46
unsigned int scrollbar_position : 1;
47
unsigned int scrollback_lines : 1;
48
unsigned int scroll_on_keystroke : 1;
49
unsigned int scroll_on_output : 1;
50
unsigned int exit_action : 1;
51
unsigned int login_shell : 1;
52
unsigned int update_records : 1;
53
unsigned int use_custom_command : 1;
54
unsigned int custom_command : 1;
55
unsigned int icon_file : 1;
56
unsigned int is_default : 1;
57
unsigned int palette : 1;
58
unsigned int background_type : 1;
59
unsigned int background_image_file : 1;
60
unsigned int scroll_background : 1;
61
unsigned int background_darkness : 1;
62
unsigned int backspace_binding : 1;
63
unsigned int delete_binding : 1;
64
unsigned int use_theme_colors : 1;
65
unsigned int use_system_font : 1;
66
unsigned int no_aa_without_render : 1;
67
unsigned int font : 1;
68
} TerminalSettingMask;
72
/* this has to be kept in sync with the option menu in the
31
/* this has to be kept in sync with the option menu in the profile editor UI file */
75
32
TERMINAL_TITLE_REPLACE,
76
33
TERMINAL_TITLE_BEFORE,
77
34
TERMINAL_TITLE_AFTER,
108
56
TERMINAL_BACKGROUND_TRANSPARENT
109
57
} TerminalBackgroundType;
61
TERMINAL_CURSOR_BLINK_SYSTEM,
62
TERMINAL_CURSOR_BLINK_ON,
63
TERMINAL_CURSOR_BLINK_OFF
64
} TerminalCursorBlinkMode;
66
#define TERMINAL_PALETTE_SIZE 16
68
#define TERMINAL_PALETTE_TANGO 0
69
#define TERMINAL_PALETTE_LINUX 1
70
#define TERMINAL_PALETTE_XTERM 2
71
#define TERMINAL_PALETTE_RXVT 3
72
#define TERMINAL_PALETTE_N_BUILTINS 4
75
#define TERMINAL_PROFILE_ALLOW_BOLD "allow-bold"
76
#define TERMINAL_PROFILE_BACKGROUND_COLOR "background-color"
77
#define TERMINAL_PROFILE_BACKGROUND_DARKNESS "background-darkness"
78
#define TERMINAL_PROFILE_BACKGROUND_IMAGE "background-image"
79
#define TERMINAL_PROFILE_BACKGROUND_IMAGE_FILE "background-image-file"
80
#define TERMINAL_PROFILE_BACKGROUND_TYPE "background-type"
81
#define TERMINAL_PROFILE_BACKSPACE_BINDING "backspace-binding"
82
#define TERMINAL_PROFILE_CURSOR_BLINK_MODE "cursor-blink-mode"
83
#define TERMINAL_PROFILE_CUSTOM_COMMAND "custom-command"
84
#define TERMINAL_PROFILE_DEFAULT_SHOW_MENUBAR "default-show-menubar"
85
#define TERMINAL_PROFILE_DELETE_BINDING "delete-binding"
86
#define TERMINAL_PROFILE_EXIT_ACTION "exit-action"
87
#define TERMINAL_PROFILE_FONT "font"
88
#define TERMINAL_PROFILE_FOREGROUND_COLOR "foreground-color"
89
#define TERMINAL_PROFILE_LOGIN_SHELL "login-shell"
90
#define TERMINAL_PROFILE_NAME "name"
91
#define TERMINAL_PROFILE_NO_AA_WITHOUT_RENDER "no-aa-without-render"
92
#define TERMINAL_PROFILE_PALETTE "palette"
93
#define TERMINAL_PROFILE_SCROLL_BACKGROUND "scroll-background"
94
#define TERMINAL_PROFILE_SCROLLBACK_LINES "scrollback-lines"
95
#define TERMINAL_PROFILE_SCROLLBAR_POSITION "scrollbar-position"
96
#define TERMINAL_PROFILE_SCROLL_ON_KEYSTROKE "scroll-on-keystroke"
97
#define TERMINAL_PROFILE_SCROLL_ON_OUTPUT "scroll-on-output"
98
#define TERMINAL_PROFILE_SILENT_BELL "silent-bell"
99
#define TERMINAL_PROFILE_TITLE_MODE "title-mode"
100
#define TERMINAL_PROFILE_TITLE "title"
101
#define TERMINAL_PROFILE_UPDATE_RECORDS "update-records"
102
#define TERMINAL_PROFILE_USE_CUSTOM_COMMAND "use-custom-command"
103
#define TERMINAL_PROFILE_USE_SKEY "use-skey"
104
#define TERMINAL_PROFILE_USE_SYSTEM_FONT "use-system-font"
105
#define TERMINAL_PROFILE_USE_THEME_COLORS "use-theme-colors"
106
#define TERMINAL_PROFILE_VISIBLE_NAME "visible-name"
107
#define TERMINAL_PROFILE_WORD_CHARS "word-chards"
109
/* TerminalProfile object */
113
111
#define TERMINAL_TYPE_PROFILE (terminal_profile_get_type ())
114
112
#define TERMINAL_PROFILE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TERMINAL_TYPE_PROFILE, TerminalProfile))
133
131
GObjectClass parent_class;
135
void (* changed) (TerminalProfile *profile,
136
const TerminalSettingMask *mask);
137
133
void (* forgotten) (TerminalProfile *profile);
135
GHashTable *gconf_keys;
140
GType terminal_profile_get_type (void) G_GNUC_CONST;
142
TerminalProfile* terminal_profile_new (const char *name,
145
const char* terminal_profile_get_name (TerminalProfile *profile);
146
const char* terminal_profile_get_visible_name (TerminalProfile *profile);
147
gboolean terminal_profile_get_allow_bold (TerminalProfile *profile);
148
gboolean terminal_profile_get_silent_bell (TerminalProfile *profile);
149
TerminalScrollbarPosition terminal_profile_get_scrollbar_position (TerminalProfile *profile);
150
int terminal_profile_get_scrollback_lines (TerminalProfile *profile);
151
void terminal_profile_get_color_scheme (TerminalProfile *profile,
152
GdkColor *foreground,
153
GdkColor *background);
154
const char* terminal_profile_get_word_chars (TerminalProfile *profile);
155
const char* terminal_profile_get_title (TerminalProfile *profile);
156
TerminalTitleMode terminal_profile_get_title_mode (TerminalProfile *profile);
157
gboolean terminal_profile_get_forgotten (TerminalProfile *profile);
158
gboolean terminal_profile_get_default_show_menubar (TerminalProfile *profile);
159
gboolean terminal_profile_get_scroll_on_keystroke (TerminalProfile *profile);
160
gboolean terminal_profile_get_scroll_on_output (TerminalProfile *profile);
162
TerminalExitAction terminal_profile_get_exit_action (TerminalProfile *profile);
163
gboolean terminal_profile_get_login_shell (TerminalProfile *profile);
164
gboolean terminal_profile_get_update_records (TerminalProfile *profile);
165
gboolean terminal_profile_get_use_custom_command (TerminalProfile *profile);
166
const char* terminal_profile_get_custom_command (TerminalProfile *profile);
168
const char* terminal_profile_get_icon_file (TerminalProfile *profile);
169
GdkPixbuf* terminal_profile_get_icon (TerminalProfile *profile);
170
gboolean terminal_profile_get_is_default (TerminalProfile *profile);
171
void terminal_profile_get_palette (TerminalProfile *profile,
174
TerminalBackgroundType terminal_profile_get_background_type (TerminalProfile *profile);
175
GdkPixbuf* terminal_profile_get_background_image (TerminalProfile *profile);
176
const char* terminal_profile_get_background_image_file (TerminalProfile *profile);
177
gboolean terminal_profile_get_scroll_background (TerminalProfile *profile);
178
double terminal_profile_get_background_darkness (TerminalProfile *profile);
179
TerminalEraseBinding terminal_profile_get_backspace_binding (TerminalProfile *profile);
180
TerminalEraseBinding terminal_profile_get_delete_binding (TerminalProfile *profile);
182
gboolean terminal_profile_get_use_theme_colors (TerminalProfile *profile);
183
gboolean terminal_profile_get_use_system_font (TerminalProfile *profile);
184
gboolean terminal_profile_get_no_aa_without_render (TerminalProfile *profile);
185
gboolean terminal_profile_get_use_skey (TerminalProfile *profile);
186
const PangoFontDescription* terminal_profile_get_font (TerminalProfile *profile);
188
void terminal_profile_set_visible_name (TerminalProfile *profile,
190
void terminal_profile_set_allow_bold (TerminalProfile *profile,
192
void terminal_profile_set_silent_bell (TerminalProfile *profile,
194
void terminal_profile_set_scrollbar_position (TerminalProfile *profile,
195
TerminalScrollbarPosition pos);
196
void terminal_profile_set_scrollback_lines (TerminalProfile *profile,
198
void terminal_profile_set_color_scheme (TerminalProfile *profile,
199
const GdkColor *foreground,
200
const GdkColor *background);
201
void terminal_profile_set_title (TerminalProfile *profile,
203
void terminal_profile_set_title_mode (TerminalProfile *profile,
204
TerminalTitleMode mode);
205
void terminal_profile_set_word_chars (TerminalProfile *profile,
206
const char *word_class);
207
void terminal_profile_set_default_show_menubar (TerminalProfile *profile,
209
void terminal_profile_set_scroll_on_keystroke (TerminalProfile *profile,
211
void terminal_profile_set_scroll_on_output (TerminalProfile *profile,
214
void terminal_profile_set_exit_action (TerminalProfile *profile,
215
TerminalExitAction action);
216
void terminal_profile_set_login_shell (TerminalProfile *profile,
218
void terminal_profile_set_update_records (TerminalProfile *profile,
220
void terminal_profile_set_use_custom_command (TerminalProfile *profile,
222
void terminal_profile_set_custom_command (TerminalProfile *profile,
223
const char *command);
225
void terminal_profile_set_icon_file (TerminalProfile *profile,
226
const char *filename);
227
void terminal_profile_set_is_default (TerminalProfile *profile,
229
void terminal_profile_set_palette (TerminalProfile *profile,
230
const GdkColor *colors);
231
void terminal_profile_set_palette_entry (TerminalProfile *profile,
233
const GdkColor *color);
235
void terminal_profile_set_background_type (TerminalProfile *profile,
236
TerminalBackgroundType type);
237
void terminal_profile_set_background_image_file (TerminalProfile *profile,
238
const char *filename);
239
void terminal_profile_set_scroll_background (TerminalProfile *profile,
241
void terminal_profile_set_background_darkness (TerminalProfile *profile,
243
void terminal_profile_set_backspace_binding (TerminalProfile *profile,
244
TerminalEraseBinding binding);
245
void terminal_profile_set_delete_binding (TerminalProfile *profile,
246
TerminalEraseBinding binding);
248
void terminal_profile_set_use_theme_colors (TerminalProfile *profile,
251
void terminal_profile_set_use_system_font (TerminalProfile *profile,
254
void terminal_profile_set_use_skey (TerminalProfile *profile,
256
void terminal_profile_set_font (TerminalProfile *profile,
257
const PangoFontDescription *font_desc);
259
void terminal_profile_reset_compat_defaults (TerminalProfile *profile);
261
TerminalProfile* terminal_profile_ensure_fallback (GConfClient *conf);
262
void terminal_profile_initialize (GConfClient *conf);
263
GList* terminal_profile_get_list (void);
264
int terminal_profile_get_count (void);
265
/* may return NULL */
266
TerminalProfile* terminal_profile_get_default (void);
267
/* never returns NULL if any profiles exist, one is always supposed to */
268
TerminalProfile* terminal_profile_get_for_new_term (TerminalProfile *current);
269
TerminalProfile* terminal_profile_lookup (const char *name);
270
TerminalProfile* terminal_profile_lookup_by_visible_name (const char *name);
271
void terminal_profile_forget (TerminalProfile *profile);
273
const TerminalSettingMask* terminal_profile_get_locked_settings (TerminalProfile *profile);
275
void terminal_profile_update (TerminalProfile *profile);
277
char* terminal_profile_create (TerminalProfile *base_profile,
278
const char *visible_name,
279
GtkWindow *transient_parent);
281
void terminal_profile_delete_list (GConfClient *conf,
283
GtkWindow *transient_parent);
285
gboolean terminal_setting_mask_is_empty (const TerminalSettingMask *mask);
286
void terminal_setting_mask_clear (TerminalSettingMask *mask);
287
gboolean terminal_setting_mask_equal (const TerminalSettingMask *a,
288
const TerminalSettingMask *b);
291
extern const GdkColor terminal_palette_linux[TERMINAL_PALETTE_SIZE];
292
extern const GdkColor terminal_palette_xterm[TERMINAL_PALETTE_SIZE];
293
extern const GdkColor terminal_palette_rxvt[TERMINAL_PALETTE_SIZE];
294
extern const GdkColor terminal_palette_tango[TERMINAL_PALETTE_SIZE];
296
char* terminal_palette_to_string (const GdkColor *palette);
297
gboolean terminal_palette_from_string (const char *str,
302
void profile_name_entry_notify (TerminalProfile *profile);
138
GType terminal_profile_get_type (void);
140
TerminalProfile* _terminal_profile_new (const char *name);
142
void _terminal_profile_forget (TerminalProfile *profile);
144
gboolean _terminal_profile_get_forgotten (TerminalProfile *profile);
146
TerminalProfile* _terminal_profile_clone (TerminalProfile *base_profile,
147
const char *visible_name);
149
gboolean terminal_profile_property_locked (TerminalProfile *profile,
150
const char *prop_name);
152
void terminal_profile_reset_property (TerminalProfile *profile,
153
const char *prop_name);
155
gboolean terminal_profile_get_property_boolean (TerminalProfile *profile,
156
const char *prop_name);
158
gconstpointer terminal_profile_get_property_boxed (TerminalProfile *profile,
159
const char *prop_name);
161
double terminal_profile_get_property_double (TerminalProfile *profile,
162
const char *prop_name);
164
glong terminal_profile_get_property_enum (TerminalProfile *profile,
165
const char *prop_name);
167
int terminal_profile_get_property_int (TerminalProfile *profile,
168
const char *prop_name);
170
gpointer terminal_profile_get_property_object (TerminalProfile *profile,
171
const char *prop_name);
173
const char* terminal_profile_get_property_string (TerminalProfile *profile,
174
const char *prop_name);
176
gboolean terminal_profile_get_palette (TerminalProfile *profile,
180
gboolean terminal_profile_get_palette_is_builtin (TerminalProfile *profile,
183
void terminal_profile_set_palette_builtin (TerminalProfile *profile,
186
gboolean terminal_profile_modify_palette_entry (TerminalProfile *profile,
188
const GdkColor *color);