~ubuntu-branches/ubuntu/maverick/gnome-terminal/maverick-proposed

« back to all changes in this revision

Viewing changes to src/terminal-profile.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-06-18 10:33:45 UTC
  • mfrom: (1.3.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20080618103345-ife89bdnaa2ttfyk
Tags: 2.23.4.2-0ubuntu1
* new upstream version
* changed debian/patches/01_lpi.patch to work with GtkUIManager
* dropped debian/patches/03_ubuntu_lpi_fix_crash.diff because the
  UIManager makes it obsolete
* updated and renamed debian/patches/02_autoconf.patch to
  debian/patches/99_autoreconf.patch
* debian/control.in:
  - add Vcs-Bzr header
* debian/watch:
  - look for uneven version numbers too to make bzr-buildpackage
    auto download the right tarball
* debian/gnome-terminal-data.install:
  - drop /usr/share/pixmaps, its no longer used

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* object representing a profile */
2
 
 
3
1
/*
4
 
 * Copyright (C) 2001 Havoc Pennington
5
 
 * Copyright (C) 2002 Mathias Hasselmann
 
2
 * Copyright © 2001 Havoc Pennington
 
3
 * Copyright © 2002 Mathias Hasselmann
 
4
 * Copyright © 2008 Christian Persch
6
5
 *
7
6
 * This library is free software; you can redistribute it and/or
8
7
 * modify it under the terms of the GNU Library General Public
24
23
#define TERMINAL_PROFILE_H
25
24
 
26
25
#include <gtk/gtk.h>
27
 
#include <gconf/gconf-client.h>
28
 
 
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"
34
 
 
35
 
typedef struct
36
 
{
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;
 
26
 
 
27
G_BEGIN_DECLS
69
28
 
70
29
typedef enum
71
30
{
72
 
  /* this has to be kept in sync with the option menu in the
73
 
   * glade file
74
 
   */
 
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,
80
37
 
81
38
typedef enum
82
39
{
83
 
  TERMINAL_ERASE_ASCII_DEL,
84
 
  TERMINAL_ERASE_ESCAPE_SEQUENCE,
85
 
  TERMINAL_ERASE_CONTROL_H
86
 
} TerminalEraseBinding;
87
 
 
88
 
#define TERMINAL_PALETTE_SIZE 16
89
 
 
90
 
typedef enum
91
 
{
92
40
  TERMINAL_SCROLLBAR_LEFT,
93
41
  TERMINAL_SCROLLBAR_RIGHT,
94
42
  TERMINAL_SCROLLBAR_HIDDEN
108
56
  TERMINAL_BACKGROUND_TRANSPARENT
109
57
} TerminalBackgroundType;
110
58
 
111
 
G_BEGIN_DECLS
 
59
typedef enum
 
60
{
 
61
  TERMINAL_CURSOR_BLINK_SYSTEM,
 
62
  TERMINAL_CURSOR_BLINK_ON,
 
63
  TERMINAL_CURSOR_BLINK_OFF
 
64
} TerminalCursorBlinkMode;
 
65
 
 
66
#define TERMINAL_PALETTE_SIZE 16
 
67
 
 
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
 
73
 
 
74
/* Property names */
 
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"
 
108
 
 
109
/* TerminalProfile object */
112
110
 
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))
132
130
{
133
131
  GObjectClass parent_class;
134
132
 
135
 
  void (* changed)   (TerminalProfile           *profile,
136
 
                      const TerminalSettingMask *mask);
137
133
  void (* forgotten) (TerminalProfile           *profile);
 
134
 
 
135
  GHashTable *gconf_keys;
138
136
};
139
137
 
140
 
GType terminal_profile_get_type (void) G_GNUC_CONST;
141
 
 
142
 
TerminalProfile* terminal_profile_new (const char  *name,
143
 
                                       GConfClient *conf);
144
 
 
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);
161
 
 
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);
167
 
 
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,
172
 
                                                                     GdkColor        *colors);
173
 
 
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);
181
 
 
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);
187
 
 
188
 
void terminal_profile_set_visible_name         (TerminalProfile           *profile,
189
 
                                                const char                *name);
190
 
void terminal_profile_set_allow_bold           (TerminalProfile           *profile,
191
 
                                                gboolean                   setting);
192
 
void terminal_profile_set_silent_bell          (TerminalProfile           *profile,
193
 
                                                gboolean                   setting);
194
 
void terminal_profile_set_scrollbar_position   (TerminalProfile           *profile,
195
 
                                                TerminalScrollbarPosition  pos);
196
 
void terminal_profile_set_scrollback_lines     (TerminalProfile           *profile,
197
 
                                                int                        lines);
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,
202
 
                                                const char                *title);
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,
208
 
                                                gboolean                   setting);
209
 
void terminal_profile_set_scroll_on_keystroke  (TerminalProfile           *profile,
210
 
                                                gboolean                   setting);
211
 
void terminal_profile_set_scroll_on_output     (TerminalProfile           *profile,
212
 
                                                gboolean                   setting);
213
 
 
214
 
void terminal_profile_set_exit_action          (TerminalProfile           *profile,
215
 
                                                TerminalExitAction         action);
216
 
void terminal_profile_set_login_shell          (TerminalProfile           *profile,
217
 
                                                gboolean                   setting);
218
 
void terminal_profile_set_update_records       (TerminalProfile           *profile,
219
 
                                                gboolean                   setting);
220
 
void terminal_profile_set_use_custom_command   (TerminalProfile           *profile,
221
 
                                                gboolean                   setting);
222
 
void terminal_profile_set_custom_command       (TerminalProfile          *profile,
223
 
                                                const char               *command);
224
 
 
225
 
void terminal_profile_set_icon_file            (TerminalProfile          *profile,
226
 
                                                const char               *filename);
227
 
void terminal_profile_set_is_default           (TerminalProfile          *profile,
228
 
                                                gboolean                  setting);
229
 
void terminal_profile_set_palette              (TerminalProfile *profile,
230
 
                                                const GdkColor  *colors);
231
 
void terminal_profile_set_palette_entry        (TerminalProfile *profile,
232
 
                                                int              i,
233
 
                                                const GdkColor  *color);
234
 
 
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,
240
 
                                                 gboolean                setting);
241
 
void terminal_profile_set_background_darkness   (TerminalProfile        *profile,
242
 
                                                 double                  setting);
243
 
void terminal_profile_set_backspace_binding     (TerminalProfile        *profile,
244
 
                                                 TerminalEraseBinding    binding);
245
 
void terminal_profile_set_delete_binding        (TerminalProfile        *profile,
246
 
                                                 TerminalEraseBinding    binding);
247
 
 
248
 
void terminal_profile_set_use_theme_colors      (TerminalProfile        *profile,
249
 
                                                 gboolean                setting);
250
 
 
251
 
void terminal_profile_set_use_system_font       (TerminalProfile        *profile,
252
 
                                                 gboolean                setting);
253
 
 
254
 
void terminal_profile_set_use_skey              (TerminalProfile        *profile,
255
 
                                                 gboolean                setting);
256
 
void terminal_profile_set_font                   (TerminalProfile            *profile,
257
 
                                                  const PangoFontDescription *font_desc);
258
 
 
259
 
void terminal_profile_reset_compat_defaults     (TerminalProfile        *profile);
260
 
 
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);
272
 
 
273
 
const TerminalSettingMask* terminal_profile_get_locked_settings (TerminalProfile *profile);
274
 
 
275
 
void terminal_profile_update (TerminalProfile *profile);
276
 
 
277
 
char* terminal_profile_create (TerminalProfile *base_profile,
278
 
                               const char      *visible_name,
279
 
                               GtkWindow       *transient_parent);
280
 
 
281
 
void terminal_profile_delete_list (GConfClient *conf,
282
 
                                   GList      *list,
283
 
                                   GtkWindow  *transient_parent);
284
 
 
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);
289
 
 
290
 
 
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];
295
 
 
296
 
char*    terminal_palette_to_string   (const GdkColor *palette);
297
 
gboolean terminal_palette_from_string (const char     *str,
298
 
                                       GdkColor       *palette,
299
 
                                       gboolean        warn);
300
 
 
301
 
 
302
 
void profile_name_entry_notify (TerminalProfile *profile);
 
138
GType             terminal_profile_get_type               (void);
 
139
 
 
140
TerminalProfile* _terminal_profile_new                    (const char *name);
 
141
 
 
142
void             _terminal_profile_forget                 (TerminalProfile *profile);
 
143
 
 
144
gboolean         _terminal_profile_get_forgotten          (TerminalProfile *profile);
 
145
 
 
146
TerminalProfile* _terminal_profile_clone                  (TerminalProfile *base_profile,
 
147
                                                           const char *visible_name);
 
148
 
 
149
gboolean          terminal_profile_property_locked        (TerminalProfile *profile,
 
150
                                                           const char *prop_name);
 
151
 
 
152
void              terminal_profile_reset_property         (TerminalProfile *profile,
 
153
                                                           const char *prop_name);
 
154
 
 
155
gboolean          terminal_profile_get_property_boolean   (TerminalProfile *profile,
 
156
                                                           const char *prop_name);
 
157
 
 
158
gconstpointer     terminal_profile_get_property_boxed     (TerminalProfile *profile,
 
159
                                                           const char *prop_name);
 
160
 
 
161
double            terminal_profile_get_property_double    (TerminalProfile *profile,
 
162
                                                           const char *prop_name);
 
163
 
 
164
glong             terminal_profile_get_property_enum      (TerminalProfile *profile,
 
165
                                                           const char *prop_name);
 
166
 
 
167
int               terminal_profile_get_property_int       (TerminalProfile *profile,
 
168
                                                           const char *prop_name);
 
169
 
 
170
gpointer          terminal_profile_get_property_object    (TerminalProfile *profile,
 
171
                                                           const char *prop_name);
 
172
 
 
173
const char*       terminal_profile_get_property_string    (TerminalProfile *profile,
 
174
                                                           const char *prop_name);
 
175
 
 
176
gboolean          terminal_profile_get_palette            (TerminalProfile *profile,
 
177
                                                           GdkColor *colors,
 
178
                                                           guint *n_colors);
 
179
 
 
180
gboolean          terminal_profile_get_palette_is_builtin (TerminalProfile *profile,
 
181
                                                           guint *n);
 
182
 
 
183
void              terminal_profile_set_palette_builtin    (TerminalProfile *profile,
 
184
                                                           guint n);
 
185
 
 
186
gboolean          terminal_profile_modify_palette_entry   (TerminalProfile *profile,
 
187
                                                           int              i,
 
188
                                                           const GdkColor  *color);
303
189
 
304
190
G_END_DECLS
305
191