gnome-terminal r2509 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r2509 - trunk/src
- Date: Thu, 20 Mar 2008 10:14:46 +0000 (GMT)
Author: chpe
Date: Thu Mar 20 10:14:46 2008
New Revision: 2509
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2509&view=rev
Log:
Replace profile->priv-> with priv-> access.
Modified:
trunk/src/terminal-profile.c
Modified: trunk/src/terminal-profile.c
==============================================================================
--- trunk/src/terminal-profile.c (original)
+++ trunk/src/terminal-profile.c Thu Mar 20 10:14:46 2008
@@ -257,43 +257,45 @@
static void
terminal_profile_init (TerminalProfile *profile)
{
+ TerminalProfilePrivate *priv;
+
g_return_if_fail (profiles != NULL);
- profile->priv = g_new0 (TerminalProfilePrivate, 1);
- terminal_setting_mask_clear (&profile->priv->locked);
- profile->priv->default_show_menubar = TRUE;
- profile->priv->visible_name = g_strdup ("<not named>");
- profile->priv->foreground.red = 0;
- profile->priv->foreground.green = 0;
- profile->priv->foreground.blue = 0;
- profile->priv->background.red = 0xFFFF;
- profile->priv->background.green = 0xFFFF;
- profile->priv->background.blue = 0xDDDD;
- profile->priv->in_notification_count = 0;
- profile->priv->title_mode = TERMINAL_TITLE_REPLACE;
- profile->priv->title = g_strdup (_("Terminal"));
- profile->priv->scrollbar_position = TERMINAL_SCROLLBAR_RIGHT;
- profile->priv->scrollback_lines = 1000;
- profile->priv->allow_bold = TRUE;
- profile->priv->word_chars = g_strdup ("");
- profile->priv->custom_command = g_strdup ("");
- profile->priv->icon_file = g_strdup ("gnome-terminal.png");
- memcpy (profile->priv->palette,
+ priv = profile->priv = g_new0 (TerminalProfilePrivate, 1);
+ terminal_setting_mask_clear (&priv->locked);
+ priv->default_show_menubar = TRUE;
+ priv->visible_name = g_strdup ("<not named>");
+ priv->foreground.red = 0;
+ priv->foreground.green = 0;
+ priv->foreground.blue = 0;
+ priv->background.red = 0xFFFF;
+ priv->background.green = 0xFFFF;
+ priv->background.blue = 0xDDDD;
+ priv->in_notification_count = 0;
+ priv->title_mode = TERMINAL_TITLE_REPLACE;
+ priv->title = g_strdup (_("Terminal"));
+ priv->scrollbar_position = TERMINAL_SCROLLBAR_RIGHT;
+ priv->scrollback_lines = 1000;
+ priv->allow_bold = TRUE;
+ priv->word_chars = g_strdup ("");
+ priv->custom_command = g_strdup ("");
+ priv->icon_file = g_strdup ("gnome-terminal.png");
+ memcpy (priv->palette,
terminal_palette_linux,
TERMINAL_PALETTE_SIZE * sizeof (GdkColor));
- profile->priv->background_type = TERMINAL_BACKGROUND_SOLID;
- profile->priv->background_image_file = g_strdup ("");
- profile->priv->background_darkness = 0.0;
- profile->priv->backspace_binding = TERMINAL_ERASE_ASCII_DEL;
- profile->priv->delete_binding = TERMINAL_ERASE_ESCAPE_SEQUENCE;
- profile->priv->use_theme_colors = TRUE;
- profile->priv->use_system_font = TRUE;
- profile->priv->no_aa_without_render = TRUE;
- profile->priv->use_skey = TRUE;
- profile->priv->font = pango_font_description_new ();
- pango_font_description_set_family (profile->priv->font,
+ priv->background_type = TERMINAL_BACKGROUND_SOLID;
+ priv->background_image_file = g_strdup ("");
+ priv->background_darkness = 0.0;
+ priv->backspace_binding = TERMINAL_ERASE_ASCII_DEL;
+ priv->delete_binding = TERMINAL_ERASE_ESCAPE_SEQUENCE;
+ priv->use_theme_colors = TRUE;
+ priv->use_system_font = TRUE;
+ priv->no_aa_without_render = TRUE;
+ priv->use_skey = TRUE;
+ priv->font = pango_font_description_new ();
+ pango_font_description_set_family (priv->font,
"monospace");
- pango_font_description_set_size (profile->priv->font,
+ pango_font_description_set_size (priv->font,
PANGO_SCALE * 12);
}
@@ -328,31 +330,29 @@
static void
terminal_profile_finalize (GObject *object)
{
- TerminalProfile *profile;
-
- profile = TERMINAL_PROFILE (object);
+ TerminalProfile *profile = TERMINAL_PROFILE (object);
+ TerminalProfilePrivate *priv = profile->priv;
terminal_profile_forget (profile);
- gconf_client_notify_remove (profile->priv->conf,
- profile->priv->notify_id);
- profile->priv->notify_id = 0;
-
- g_object_unref (G_OBJECT (profile->priv->conf));
-
- g_free (profile->priv->visible_name);
- g_free (profile->priv->name);
- g_free (profile->priv->title);
- g_free (profile->priv->profile_dir);
- g_free (profile->priv->icon_file);
- if (profile->priv->icon)
- g_object_unref (G_OBJECT (profile->priv->icon));
-
- g_free (profile->priv->background_image_file);
- if (profile->priv->background_image)
- g_object_unref (G_OBJECT (profile->priv->background_image));
+ gconf_client_notify_remove (priv->conf, priv->notify_id);
+ priv->notify_id = 0;
+
+ g_object_unref (G_OBJECT (priv->conf));
+
+ g_free (priv->visible_name);
+ g_free (priv->name);
+ g_free (priv->title);
+ g_free (priv->profile_dir);
+ g_free (priv->icon_file);
+ if (priv->icon)
+ g_object_unref (G_OBJECT (priv->icon));
+
+ g_free (priv->background_image_file);
+ if (priv->background_image)
+ g_object_unref (G_OBJECT (priv->background_image));
- pango_font_description_free (profile->priv->font);
+ pango_font_description_free (priv->font);
g_free (profile->priv);
@@ -364,6 +364,7 @@
GConfClient *conf)
{
TerminalProfile *profile;
+ TerminalProfilePrivate *priv;
GError *err;
g_return_val_if_fail (profiles != NULL, NULL);
@@ -371,30 +372,31 @@
NULL);
profile = g_object_new (TERMINAL_TYPE_PROFILE, NULL);
+ priv = profile->priv;
- profile->priv->conf = conf;
+ priv->conf = conf;
g_object_ref (G_OBJECT (conf));
- profile->priv->name = g_strdup (name);
+ priv->name = g_strdup (name);
- profile->priv->profile_dir = gconf_concat_dir_and_key (CONF_PROFILES_PREFIX,
- profile->priv->name);
+ priv->profile_dir = gconf_concat_dir_and_key (CONF_PROFILES_PREFIX,
+ priv->name);
err = NULL;
- gconf_client_add_dir (conf, profile->priv->profile_dir,
+ gconf_client_add_dir (conf, priv->profile_dir,
GCONF_CLIENT_PRELOAD_ONELEVEL,
&err);
if (err)
{
g_printerr (_("There was an error loading config from %s. (%s)\n"),
- profile->priv->profile_dir, err->message);
+ priv->profile_dir, err->message);
g_error_free (err);
}
err = NULL;
- profile->priv->notify_id =
+ priv->notify_id =
gconf_client_notify_add (conf,
- profile->priv->profile_dir,
+ priv->profile_dir,
profile_change_notify,
profile,
NULL, &err);
@@ -406,11 +408,11 @@
g_error_free (err);
}
- g_hash_table_insert (profiles, profile->priv->name, profile);
+ g_hash_table_insert (profiles, priv->name, profile);
if (default_profile == NULL &&
default_profile_id &&
- strcmp (default_profile_id, profile->priv->name) == 0)
+ strcmp (default_profile_id, priv->name) == 0)
{
/* We are the default profile */
default_profile = profile;
@@ -422,27 +424,33 @@
const char*
terminal_profile_get_name (TerminalProfile *profile)
{
- return profile->priv->name;
+ TerminalProfilePrivate *priv = profile->priv;
+
+ return priv->name;
}
const char*
terminal_profile_get_visible_name (TerminalProfile *profile)
{
- return profile->priv->visible_name;
+ TerminalProfilePrivate *priv = profile->priv;
+
+ return priv->visible_name;
}
void
terminal_profile_set_visible_name (TerminalProfile *profile,
const char *name)
{
+ TerminalProfilePrivate *priv = profile->priv;
+
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_VISIBLE_NAME);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
name,
NULL);
@@ -454,6 +462,7 @@
terminal_profile_get_forgotten (TerminalProfile *profile)
{
g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
+
return profile->priv->forgotten;
}
@@ -469,14 +478,15 @@
terminal_profile_set_silent_bell (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_SILENT_BELL);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -487,7 +497,7 @@
gboolean
terminal_profile_get_scroll_on_keystroke (TerminalProfile *profile)
{
- g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
+ g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
return profile->priv->scroll_on_keystroke;
}
@@ -497,14 +507,15 @@
terminal_profile_set_scroll_on_keystroke (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_SCROLL_ON_KEYSTROKE);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -515,7 +526,7 @@
gboolean
terminal_profile_get_scroll_on_output (TerminalProfile *profile)
{
- g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
+ g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
return profile->priv->scroll_on_output;
}
@@ -525,14 +536,15 @@
terminal_profile_set_scroll_on_output (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_SCROLL_ON_OUTPUT);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -552,17 +564,18 @@
terminal_profile_set_scrollbar_position (TerminalProfile *profile,
TerminalScrollbarPosition pos)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
const char *pos_string;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_SCROLLBAR_POSITION);
pos_string = gconf_enum_to_string (scrollbar_positions, pos);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
pos_string,
NULL);
@@ -582,14 +595,15 @@
terminal_profile_set_scrollback_lines (TerminalProfile *profile,
int lines)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_SCROLLBACK_LINES);
- gconf_client_set_int (profile->priv->conf,
+ gconf_client_set_int (priv->conf,
key,
lines,
NULL);
@@ -602,12 +616,15 @@
GdkColor *foreground,
GdkColor *background)
{
- g_return_if_fail (TERMINAL_IS_PROFILE (profile));
+ TerminalProfilePrivate *priv;
+ g_return_if_fail (TERMINAL_IS_PROFILE (profile));
+
+ priv = profile->priv;
if (foreground)
- *foreground = profile->priv->foreground;
+ *foreground = priv->foreground;
if (background)
- *background = profile->priv->background;
+ *background = priv->background;
}
static char*
@@ -633,28 +650,29 @@
const GdkColor *foreground,
const GdkColor *background)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *fg_key;
char *bg_key;
char *str;
RETURN_IF_NOTIFYING (profile);
- fg_key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ fg_key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_FOREGROUND_COLOR);
- bg_key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ bg_key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_BACKGROUND_COLOR);
str = color_to_string (foreground);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
fg_key, str, NULL);
g_free (str);
str = color_to_string (background);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
bg_key, str, NULL);
g_free (str);
@@ -675,14 +693,15 @@
terminal_profile_set_word_chars (TerminalProfile *profile,
const char *word_chars)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_WORD_CHARS);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
word_chars,
NULL);
@@ -702,14 +721,15 @@
terminal_profile_set_title (TerminalProfile *profile,
const char *title)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_TITLE);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
title,
NULL);
@@ -729,17 +749,18 @@
terminal_profile_set_title_mode (TerminalProfile *profile,
TerminalTitleMode mode)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
const char *mode_string;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_TITLE_MODE);
mode_string = gconf_enum_to_string (title_modes, mode);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
mode_string,
NULL);
@@ -751,7 +772,7 @@
gboolean
terminal_profile_get_allow_bold (TerminalProfile *profile)
{
- g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
+ g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
return profile->priv->allow_bold;
}
@@ -760,14 +781,15 @@
terminal_profile_set_allow_bold (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_ALLOW_BOLD);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -787,14 +809,15 @@
terminal_profile_set_default_show_menubar (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_DEFAULT_SHOW_MENUBAR);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -815,17 +838,18 @@
terminal_profile_set_exit_action (TerminalProfile *profile,
TerminalExitAction action)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
const char *action_string;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_EXIT_ACTION);
action_string = gconf_enum_to_string (exit_actions, action);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
action_string,
NULL);
@@ -845,14 +869,15 @@
terminal_profile_set_login_shell (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_LOGIN_SHELL);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -872,14 +897,15 @@
terminal_profile_set_update_records (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_UPDATE_RECORDS);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -899,14 +925,15 @@
terminal_profile_set_use_custom_command (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_USE_CUSTOM_COMMAND);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -926,14 +953,15 @@
terminal_profile_set_custom_command (TerminalProfile *profile,
const char *command)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_CUSTOM_COMMAND);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
command,
NULL);
@@ -952,10 +980,13 @@
GdkPixbuf*
terminal_profile_get_icon (TerminalProfile *profile)
{
- g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), NULL);
+ TerminalProfilePrivate *priv;
- if (profile->priv->icon == NULL &&
- !profile->priv->icon_load_failed)
+ g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), NULL);
+
+ priv = profile->priv;
+ if (priv->icon == NULL &&
+ !priv->icon_load_failed)
{
GdkPixbuf *pixbuf;
GError *err;
@@ -964,16 +995,16 @@
filename = gnome_program_locate_file (gnome_program_get (),
/* FIXME should I use APP_PIXMAP? */
GNOME_FILE_DOMAIN_PIXMAP,
- profile->priv->icon_file,
+ priv->icon_file,
TRUE, NULL);
if (filename == NULL)
{
g_printerr (_("Could not find an icon called \"%s\" for terminal profile \"%s\"\n"),
- profile->priv->icon_file,
+ priv->icon_file,
terminal_profile_get_visible_name (profile));
- profile->priv->icon_load_failed = TRUE;
+ priv->icon_load_failed = TRUE;
goto out;
}
@@ -991,41 +1022,42 @@
g_free (filename);
- profile->priv->icon_load_failed = TRUE;
+ priv->icon_load_failed = TRUE;
goto out;
}
- profile->priv->icon = pixbuf;
+ priv->icon = pixbuf;
g_free (filename);
}
out:
- return profile->priv->icon;
+ return priv->icon;
}
void
terminal_profile_set_icon_file (TerminalProfile *profile,
const char *filename)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_ICON);
if (filename)
{
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
filename,
NULL);
}
else
{
- gconf_client_unset (profile->priv->conf, key, NULL);
+ gconf_client_unset (priv->conf, key, NULL);
}
g_free (key);
@@ -1043,9 +1075,11 @@
terminal_profile_set_is_default (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
+
RETURN_IF_NOTIFYING (profile);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
CONF_GLOBAL_PREFIX"/default_profile",
terminal_profile_get_name (profile),
NULL);
@@ -1055,7 +1089,7 @@
* and update_default_profile must be called in sync with those changes.
*/
update_default_profile (terminal_profile_get_name (profile),
- !gconf_client_key_is_writable (profile->priv->conf,
+ !gconf_client_key_is_writable (priv->conf,
CONF_GLOBAL_PREFIX"/default_profile",
NULL));
}
@@ -1064,9 +1098,12 @@
terminal_profile_get_palette (TerminalProfile *profile,
GdkColor *colors)
{
+ TerminalProfilePrivate *priv;
+
g_return_if_fail (TERMINAL_IS_PROFILE (profile));
- memcpy (colors, profile->priv->palette,
+ priv = profile->priv;
+ memcpy (colors, priv->palette,
TERMINAL_PALETTE_SIZE * sizeof (GdkColor));
}
@@ -1074,17 +1111,18 @@
terminal_profile_set_palette (TerminalProfile *profile,
const GdkColor *colors)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
char *str;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_PALETTE);
str = terminal_palette_to_string (colors);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key, str,
NULL);
@@ -1104,17 +1142,18 @@
terminal_profile_set_background_type (TerminalProfile *profile,
TerminalBackgroundType type)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
const char *type_string;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_BACKGROUND_TYPE);
type_string = gconf_enum_to_string (background_types, type);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
type_string,
NULL);
@@ -1125,10 +1164,13 @@
GdkPixbuf*
terminal_profile_get_background_image (TerminalProfile *profile)
{
- g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), NULL);
+ TerminalProfilePrivate *priv;
- if (profile->priv->background_image == NULL &&
- !profile->priv->background_load_failed)
+ g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), NULL);
+
+ priv = profile->priv;
+ if (priv->background_image == NULL &&
+ !priv->background_load_failed)
{
GdkPixbuf *pixbuf;
GError *err;
@@ -1137,16 +1179,16 @@
filename = gnome_program_locate_file (gnome_program_get (),
/* FIXME should I use APP_PIXMAP? */
GNOME_FILE_DOMAIN_PIXMAP,
- profile->priv->background_image_file,
+ priv->background_image_file,
TRUE, NULL);
if (filename == NULL)
{
g_printerr (_("Could not find a background image called \"%s\" for terminal profile \"%s\"\n"),
- profile->priv->background_image_file,
+ priv->background_image_file,
terminal_profile_get_visible_name (profile));
- profile->priv->background_load_failed = TRUE;
+ priv->background_load_failed = TRUE;
goto out;
}
@@ -1164,16 +1206,16 @@
g_free (filename);
- profile->priv->background_load_failed = TRUE;
+ priv->background_load_failed = TRUE;
goto out;
}
- profile->priv->background_image = pixbuf;
+ priv->background_image = pixbuf;
}
out:
- return profile->priv->background_image;
+ return priv->background_image;
}
const char*
@@ -1184,19 +1226,19 @@
return profile->priv->background_image_file;
}
-
void
terminal_profile_set_background_image_file (TerminalProfile *profile,
const char *filename)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_BACKGROUND_IMAGE);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
filename,
NULL);
@@ -1216,14 +1258,15 @@
terminal_profile_set_scroll_background (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_SCROLL_BACKGROUND);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -1243,14 +1286,15 @@
terminal_profile_set_background_darkness (TerminalProfile *profile,
double setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_BACKGROUND_DARKNESS);
- gconf_client_set_float (profile->priv->conf,
+ gconf_client_set_float (priv->conf,
key,
setting,
NULL);
@@ -1270,17 +1314,18 @@
terminal_profile_set_backspace_binding (TerminalProfile *profile,
TerminalEraseBinding binding)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
const char *binding_string;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_BACKSPACE_BINDING);
binding_string = gconf_enum_to_string (erase_bindings, binding);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
binding_string,
NULL);
@@ -1300,17 +1345,18 @@
terminal_profile_set_delete_binding (TerminalProfile *profile,
TerminalEraseBinding binding)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
const char *binding_string;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_DELETE_BINDING);
binding_string = gconf_enum_to_string (erase_bindings, binding);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
binding_string,
NULL);
@@ -1323,13 +1369,15 @@
int i,
const GdkColor *color)
{
+ TerminalProfilePrivate *priv;
GdkColor colors[TERMINAL_PALETTE_SIZE];
g_return_if_fail (TERMINAL_IS_PROFILE (profile));
g_return_if_fail (i < TERMINAL_PALETTE_SIZE);
g_return_if_fail (color != NULL);
-
- memcpy (colors, profile->priv->palette,
+
+ priv = profile->priv;
+ memcpy (colors, priv->palette,
TERMINAL_PALETTE_SIZE * sizeof (GdkColor));
colors[i] = *color;
@@ -1349,14 +1397,15 @@
terminal_profile_set_use_theme_colors (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_USE_THEME_COLORS);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -1384,14 +1433,15 @@
terminal_profile_set_use_system_font (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_USE_SYSTEM_FONT);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -1411,14 +1461,15 @@
terminal_profile_set_use_skey (TerminalProfile *profile,
gboolean setting)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_USE_SKEY);
- gconf_client_set_bool (profile->priv->conf,
+ gconf_client_set_bool (priv->conf,
key,
setting,
NULL);
@@ -1439,6 +1490,7 @@
terminal_profile_set_font (TerminalProfile *profile,
const PangoFontDescription *font_desc)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
char *str;
@@ -1446,13 +1498,13 @@
RETURN_IF_NOTIFYING (profile);
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
KEY_FONT);
str = pango_font_description_to_string (font_desc);
g_return_if_fail (str);
- gconf_client_set_string (profile->priv->conf,
+ gconf_client_set_string (priv->conf,
key,
str,
NULL);
@@ -1465,14 +1517,15 @@
set_visible_name (TerminalProfile *profile,
const char *candidate_name)
{
+ TerminalProfilePrivate *priv = profile->priv;
if (candidate_name &&
- strcmp (profile->priv->visible_name, candidate_name) == 0)
+ strcmp (priv->visible_name, candidate_name) == 0)
return FALSE;
if (candidate_name != NULL)
{
- g_free (profile->priv->visible_name);
- profile->priv->visible_name = g_strdup (candidate_name);
+ g_free (priv->visible_name);
+ priv->visible_name = g_strdup (candidate_name);
return TRUE;
}
/* otherwise just leave the old name */
@@ -1484,12 +1537,13 @@
set_foreground_color (TerminalProfile *profile,
const char *str_val)
{
+ TerminalProfilePrivate *priv = profile->priv;
GdkColor color;
if (str_val && gdk_color_parse (str_val, &color) &&
- !gdk_color_equal (&color, &profile->priv->foreground))
+ !gdk_color_equal (&color, &priv->foreground))
{
- profile->priv->foreground = color;
+ priv->foreground = color;
return TRUE;
}
else
@@ -1502,12 +1556,13 @@
set_background_color (TerminalProfile *profile,
const char *str_val)
{
+ TerminalProfilePrivate *priv = profile->priv;
GdkColor color;
if (str_val && gdk_color_parse (str_val, &color) &&
- !gdk_color_equal (&color, &profile->priv->background))
+ !gdk_color_equal (&color, &priv->background))
{
- profile->priv->background = color;
+ priv->background = color;
return TRUE;
}
else
@@ -1520,14 +1575,16 @@
set_title (TerminalProfile *profile,
const char *candidate_name)
{
+ TerminalProfilePrivate *priv = profile->priv;
+
if (candidate_name &&
- strcmp (profile->priv->title, candidate_name) == 0)
+ strcmp (priv->title, candidate_name) == 0)
return FALSE;
if (candidate_name != NULL)
{
- g_free (profile->priv->title);
- profile->priv->title = g_strdup (candidate_name);
+ g_free (priv->title);
+ priv->title = g_strdup (candidate_name);
return TRUE;
}
/* otherwise just leave the old name */
@@ -1539,13 +1596,14 @@
set_title_mode (TerminalProfile *profile,
const char *str_val)
{
+ TerminalProfilePrivate *priv = profile->priv;
int mode; /* TerminalTitleMode */
if (str_val &&
gconf_string_to_enum (title_modes, str_val, &mode) &&
- mode != profile->priv->title_mode)
+ mode != priv->title_mode)
{
- profile->priv->title_mode = mode;
+ priv->title_mode = mode;
return TRUE;
}
else
@@ -1558,14 +1616,15 @@
set_word_chars (TerminalProfile *profile,
const char *candidate_chars)
{
+ TerminalProfilePrivate *priv = profile->priv;
if (candidate_chars &&
- strcmp (profile->priv->word_chars, candidate_chars) == 0)
+ strcmp (priv->word_chars, candidate_chars) == 0)
return FALSE;
if (candidate_chars != NULL)
{
- g_free (profile->priv->word_chars);
- profile->priv->word_chars = g_strdup (candidate_chars);
+ g_free (priv->word_chars);
+ priv->word_chars = g_strdup (candidate_chars);
return TRUE;
}
/* otherwise just leave the old chars */
@@ -1577,13 +1636,14 @@
set_scrollbar_position (TerminalProfile *profile,
const char *str_val)
{
+ TerminalProfilePrivate *priv = profile->priv;
int pos; /* TerminalScrollbarPosition */
if (str_val &&
gconf_string_to_enum (scrollbar_positions, str_val, &pos) &&
- pos != profile->priv->scrollbar_position)
+ pos != priv->scrollbar_position)
{
- profile->priv->scrollbar_position = pos;
+ priv->scrollbar_position = pos;
return TRUE;
}
else
@@ -1596,10 +1656,12 @@
set_scrollback_lines (TerminalProfile *profile,
int int_val)
{
+ TerminalProfilePrivate *priv = profile->priv;
+
if (int_val >= 1 &&
- int_val != profile->priv->scrollback_lines)
+ int_val != priv->scrollback_lines)
{
- profile->priv->scrollback_lines = int_val;
+ priv->scrollback_lines = int_val;
return TRUE;
}
else
@@ -1612,13 +1674,14 @@
set_exit_action (TerminalProfile *profile,
const char *str_val)
{
+ TerminalProfilePrivate *priv = profile->priv;
int action; /* TerminalExitAction */
if (str_val &&
gconf_string_to_enum (exit_actions, str_val, &action) &&
- action != profile->priv->exit_action)
+ action != priv->exit_action)
{
- profile->priv->exit_action = action;
+ priv->exit_action = action;
return TRUE;
}
else
@@ -1631,14 +1694,16 @@
set_custom_command (TerminalProfile *profile,
const char *candidate_command)
{
+ TerminalProfilePrivate *priv = profile->priv;
+
if (candidate_command &&
- strcmp (profile->priv->custom_command, candidate_command) == 0)
+ strcmp (priv->custom_command, candidate_command) == 0)
return FALSE;
if (candidate_command != NULL)
{
- g_free (profile->priv->custom_command);
- profile->priv->custom_command = g_strdup (candidate_command);
+ g_free (priv->custom_command);
+ priv->custom_command = g_strdup (candidate_command);
return TRUE;
}
/* otherwise just leave the old command */
@@ -1650,23 +1715,25 @@
set_icon_file (TerminalProfile *profile,
const char *candidate_file)
{
+ TerminalProfilePrivate *priv = profile->priv;
+
if (candidate_file &&
- strcmp (profile->priv->icon_file, candidate_file) == 0)
+ strcmp (priv->icon_file, candidate_file) == 0)
return FALSE;
if (candidate_file != NULL)
{
- g_free (profile->priv->icon_file);
- profile->priv->icon_file = g_strdup (candidate_file);
+ g_free (priv->icon_file);
+ priv->icon_file = g_strdup (candidate_file);
- if (profile->priv->icon != NULL)
+ if (priv->icon != NULL)
{
- g_object_unref (G_OBJECT (profile->priv->icon));
- profile->priv->icon = NULL;
+ g_object_unref (G_OBJECT (priv->icon));
+ priv->icon = NULL;
}
- profile->priv->icon_load_failed = FALSE; /* try again */
+ priv->icon_load_failed = FALSE; /* try again */
return TRUE;
}
@@ -1678,7 +1745,9 @@
static gboolean
set_palette (TerminalProfile *profile,
const char *candidate_str)
-{
+{
+ TerminalProfilePrivate *priv = profile->priv;
+
if (candidate_str != NULL)
{
int i;
@@ -1693,7 +1762,7 @@
for (i = 0; i < TERMINAL_PALETTE_SIZE; i++)
{
- if (!gdk_color_equal (&profile->priv->palette[i],
+ if (!gdk_color_equal (&priv->palette[i],
&new_palette[i]))
{
break;
@@ -1705,7 +1774,7 @@
return FALSE;
}
- memcpy (profile->priv->palette, new_palette,
+ memcpy (priv->palette, new_palette,
TERMINAL_PALETTE_SIZE * sizeof (GdkColor));
return TRUE;
@@ -1718,13 +1787,14 @@
set_background_type (TerminalProfile *profile,
const char *str_val)
{
+ TerminalProfilePrivate *priv = profile->priv;
int type; /* TerminalBackgroundType */
if (str_val &&
gconf_string_to_enum (background_types, str_val, &type) &&
- type != profile->priv->background_type)
+ type != priv->background_type)
{
- profile->priv->background_type = type;
+ priv->background_type = type;
return TRUE;
}
else
@@ -1737,22 +1807,24 @@
set_background_image_file (TerminalProfile *profile,
const char *candidate_file)
{
+ TerminalProfilePrivate *priv = profile->priv;
+
if (candidate_file &&
- strcmp (profile->priv->background_image_file, candidate_file) == 0)
+ strcmp (priv->background_image_file, candidate_file) == 0)
return FALSE;
if (candidate_file != NULL)
{
- g_free (profile->priv->background_image_file);
- profile->priv->background_image_file = g_strdup (candidate_file);
+ g_free (priv->background_image_file);
+ priv->background_image_file = g_strdup (candidate_file);
- if (profile->priv->background_image != NULL)
+ if (priv->background_image != NULL)
{
- g_object_unref (G_OBJECT (profile->priv->background_image));
- profile->priv->background_image = NULL;
+ g_object_unref (G_OBJECT (priv->background_image));
+ priv->background_image = NULL;
}
- profile->priv->background_load_failed = FALSE; /* try again */
+ priv->background_load_failed = FALSE; /* try again */
return TRUE;
}
@@ -1765,13 +1837,14 @@
set_backspace_binding (TerminalProfile *profile,
const char *str_val)
{
+ TerminalProfilePrivate *priv = profile->priv;
int binding; /* TerminalEraseBinding */
if (str_val &&
gconf_string_to_enum (erase_bindings, str_val, &binding) &&
- binding != profile->priv->backspace_binding)
+ binding != priv->backspace_binding)
{
- profile->priv->backspace_binding = binding;
+ priv->backspace_binding = binding;
return TRUE;
}
else
@@ -1784,13 +1857,14 @@
set_delete_binding (TerminalProfile *profile,
const char *str_val)
{
+ TerminalProfilePrivate *priv = profile->priv;
int binding; /* TerminalEraseBinding */
if (str_val &&
gconf_string_to_enum (erase_bindings, str_val, &binding) &&
- binding != profile->priv->delete_binding)
+ binding != priv->delete_binding)
{
- profile->priv->delete_binding = binding;
+ priv->delete_binding = binding;
return TRUE;
}
else
@@ -1803,6 +1877,7 @@
set_font (TerminalProfile *profile,
const char *candidate_font_name)
{
+ TerminalProfilePrivate *priv = profile->priv;
PangoFontDescription *desc;
PangoFontDescription *tmp;
@@ -1820,20 +1895,20 @@
/* Merge in case the new string isn't complete enough to
* load a font
*/
- tmp = pango_font_description_copy (profile->priv->font);
+ tmp = pango_font_description_copy (priv->font);
pango_font_description_merge (tmp, desc, TRUE);
pango_font_description_free (desc);
desc = tmp;
- if (pango_font_description_equal (profile->priv->font, desc))
+ if (pango_font_description_equal (priv->font, desc))
{
pango_font_description_free (desc);
return FALSE;
}
else
{
- pango_font_description_free (profile->priv->font);
- profile->priv->font = desc;
+ pango_font_description_free (priv->font);
+ priv->font = desc;
return TRUE;
}
}
@@ -1841,6 +1916,7 @@
void
terminal_profile_update (TerminalProfile *profile)
{
+ TerminalProfilePrivate *priv = profile->priv;
TerminalSettingMask locked;
TerminalSettingMask old_locked;
TerminalSettingMask mask;
@@ -1852,43 +1928,43 @@
#define UPDATE_BOOLEAN(KName, FName) \
{ \
- char *key = gconf_concat_dir_and_key (profile->priv->profile_dir, KName); \
- gboolean val = gconf_client_get_bool (profile->priv->conf, key, NULL); \
+ char *key = gconf_concat_dir_and_key (priv->profile_dir, KName); \
+ gboolean val = gconf_client_get_bool (priv->conf, key, NULL); \
\
- if (val != profile->priv->FName) \
+ if (val != priv->FName) \
{ \
mask.FName = TRUE; \
- profile->priv->FName = val; \
+ priv->FName = val; \
} \
\
locked.FName = \
- !gconf_client_key_is_writable (profile->priv->conf, key, NULL); \
+ !gconf_client_key_is_writable (priv->conf, key, NULL); \
\
g_free (key); \
}
#define UPDATE_INTEGER(KName, FName) \
{ \
- char *key = gconf_concat_dir_and_key (profile->priv->profile_dir, KName); \
- int val = gconf_client_get_int (profile->priv->conf, key, NULL); \
+ char *key = gconf_concat_dir_and_key (priv->profile_dir, KName); \
+ int val = gconf_client_get_int (priv->conf, key, NULL); \
\
mask.FName = set_##FName (profile, val); \
\
locked.FName = \
- !gconf_client_key_is_writable (profile->priv->conf, key, NULL); \
+ !gconf_client_key_is_writable (priv->conf, key, NULL); \
\
g_free (key); \
}
#define UPDATE_FLOAT(KName, FName) \
{ \
- char *key = gconf_concat_dir_and_key (profile->priv->profile_dir, KName); \
- double val = gconf_client_get_float (profile->priv->conf, key, NULL); \
+ char *key = gconf_concat_dir_and_key (priv->profile_dir, KName); \
+ double val = gconf_client_get_float (priv->conf, key, NULL); \
\
- if (val != profile->priv->FName) \
+ if (val != priv->FName) \
{ \
mask.FName = TRUE; \
- profile->priv->FName = val; \
+ priv->FName = val; \
} \
\
g_free (key); \
@@ -1896,13 +1972,13 @@
#define UPDATE_STRING(KName, FName) \
{ \
- char *key = gconf_concat_dir_and_key (profile->priv->profile_dir, KName); \
- char *val = gconf_client_get_string (profile->priv->conf, key, NULL); \
+ char *key = gconf_concat_dir_and_key (priv->profile_dir, KName); \
+ char *val = gconf_client_get_string (priv->conf, key, NULL); \
\
mask.FName = set_##FName (profile, val); \
\
locked.FName = \
- !gconf_client_key_is_writable (profile->priv->conf, key, NULL); \
+ !gconf_client_key_is_writable (priv->conf, key, NULL); \
\
g_free (val); \
g_free (key); \
@@ -1946,8 +2022,8 @@
/* Update state and emit signals */
- old_locked = profile->priv->locked;
- profile->priv->locked = locked;
+ old_locked = priv->locked;
+ priv->locked = locked;
if (!(terminal_setting_mask_is_empty (&mask) &&
terminal_setting_mask_equal (&locked, &old_locked)))
@@ -1973,16 +2049,15 @@
GConfEntry *entry,
gpointer user_data)
{
- TerminalProfile *profile;
+ TerminalProfile *profile = TERMINAL_PROFILE (user_data);
+ TerminalProfilePrivate *priv = profile->priv;
const char *key;
GConfValue *val;
TerminalSettingMask old_locked;
TerminalSettingMask mask;
- profile = TERMINAL_PROFILE (user_data);
-
terminal_setting_mask_clear (&mask);
- old_locked = profile->priv->locked;
+ old_locked = priv->locked;
val = gconf_entry_get_value (entry);
@@ -1997,13 +2072,13 @@
if (val && val->type == GCONF_VALUE_BOOL) \
setting = gconf_value_get_bool (val); \
\
- if (setting != profile->priv->FName) \
+ if (setting != priv->FName) \
{ \
mask.FName = TRUE; \
- profile->priv->FName = setting; \
+ priv->FName = setting; \
} \
\
- profile->priv->locked.FName = !gconf_entry_get_is_writable (entry);
+ priv->locked.FName = !gconf_entry_get_is_writable (entry);
#define UPDATE_INTEGER(KName, FName, Preset) \
} \
@@ -2016,7 +2091,7 @@
\
mask.FName = set_##FName (profile, setting); \
\
- profile->priv->locked.FName = !gconf_entry_get_is_writable (entry);
+ priv->locked.FName = !gconf_entry_get_is_writable (entry);
#define UPDATE_FLOAT(KName, FName, Preset) \
} \
@@ -2027,13 +2102,13 @@
if (val && val->type == GCONF_VALUE_FLOAT) \
setting = gconf_value_get_float (val); \
\
- if (setting != profile->priv->FName) \
+ if (setting != priv->FName) \
{ \
mask.FName = TRUE; \
- profile->priv->FName = setting; \
+ priv->FName = setting; \
} \
\
- profile->priv->locked.FName = !gconf_entry_get_is_writable (entry);
+ priv->locked.FName = !gconf_entry_get_is_writable (entry);
#define UPDATE_STRING(KName, FName, Preset) \
@@ -2047,7 +2122,7 @@
\
mask.FName = set_##FName (profile, setting); \
\
- profile->priv->locked.FName = !gconf_entry_get_is_writable (entry);
+ priv->locked.FName = !gconf_entry_get_is_writable (entry);
if (0)
@@ -2063,7 +2138,7 @@
UPDATE_BOOLEAN (KEY_SILENT_BELL, silent_bell, FALSE);
UPDATE_STRING (KEY_WORD_CHARS, word_chars, NULL);
UPDATE_STRING (KEY_SCROLLBAR_POSITION, scrollbar_position, NULL);
- UPDATE_INTEGER (KEY_SCROLLBACK_LINES, scrollback_lines, profile->priv->scrollback_lines);
+ UPDATE_INTEGER (KEY_SCROLLBACK_LINES, scrollback_lines, priv->scrollback_lines);
UPDATE_BOOLEAN (KEY_SCROLL_ON_KEYSTROKE, scroll_on_keystroke, FALSE);
UPDATE_BOOLEAN (KEY_SCROLL_ON_OUTPUT, scroll_on_output, FALSE);
UPDATE_STRING (KEY_EXIT_ACTION, exit_action, NULL);
@@ -2091,7 +2166,7 @@
#undef UPDATE_STRING
if (!(terminal_setting_mask_is_empty (&mask) &&
- terminal_setting_mask_equal (&old_locked, &profile->priv->locked)))
+ terminal_setting_mask_equal (&old_locked, &priv->locked)))
emit_changed (profile, &mask);
}
@@ -2099,6 +2174,7 @@
set_key_to_default (TerminalProfile *profile,
const char *relative_key)
{
+ TerminalProfilePrivate *priv = profile->priv;
char *key;
char *default_key;
GError *err;
@@ -2108,7 +2184,7 @@
relative_key);
err = NULL;
- val = gconf_client_get_default_from_schema (profile->priv->conf,
+ val = gconf_client_get_default_from_schema (priv->conf,
default_key,
&err);
if (err != NULL)
@@ -2126,11 +2202,11 @@
if (val)
{
- key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ key = gconf_concat_dir_and_key (priv->profile_dir,
relative_key);
err = NULL;
- gconf_client_set (profile->priv->conf,
+ gconf_client_set (priv->conf,
key, val, &err);
if (err != NULL)
{
@@ -2334,23 +2410,25 @@
void
terminal_profile_forget (TerminalProfile *profile)
{
- if (!profile->priv->forgotten)
+ TerminalProfilePrivate *priv = profile->priv;
+
+ if (!priv->forgotten)
{
GError *err;
err = NULL;
- gconf_client_remove_dir (profile->priv->conf,
- profile->priv->profile_dir,
+ gconf_client_remove_dir (priv->conf,
+ priv->profile_dir,
&err);
if (err)
{
g_printerr (_("There was an error while removing the configuration directory %s. (%s)\n"),
- profile->priv->profile_dir, err->message);
+ priv->profile_dir, err->message);
g_error_free (err);
}
- g_hash_table_remove (profiles, profile->priv->name);
- profile->priv->forgotten = TRUE;
+ g_hash_table_remove (profiles, priv->name);
+ priv->forgotten = TRUE;
if (profile == default_profile)
default_profile = NULL;
@@ -2362,7 +2440,8 @@
const TerminalSettingMask*
terminal_profile_get_locked_settings (TerminalProfile *profile)
{
- return &profile->priv->locked;
+ TerminalProfilePrivate *priv = profile->priv;
+ return &priv->locked;
}
TerminalProfile*
@@ -2423,9 +2502,11 @@
emit_changed (TerminalProfile *profile,
const TerminalSettingMask *mask)
{
- profile->priv->in_notification_count += 1;
+ TerminalProfilePrivate *priv = profile->priv;
+
+ priv->in_notification_count += 1;
g_signal_emit (G_OBJECT (profile), signals[CHANGED], 0, mask);
- profile->priv->in_notification_count -= 1;
+ priv->in_notification_count -= 1;
}
/* Function I'm cut-and-pasting everywhere, this is from msm */
@@ -2488,6 +2569,7 @@
const char *visible_name,
GtkWindow *transient_parent)
{
+ TerminalProfilePrivate *base_priv = base_profile->priv;
char *profile_name = NULL;
char *profile_dir = NULL;
int i;
@@ -2505,7 +2587,7 @@
#define BAIL_OUT_CHECK() do { \
if (!GTK_WIDGET_VISIBLE (transient_parent) || \
- base_profile->priv->forgotten || \
+ base_priv->forgotten || \
err != NULL) \
goto cleanup; \
} while (0)
@@ -2535,7 +2617,7 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_VISIBLE_NAME);
- gconf_client_set_string (base_profile->priv->conf,
+ gconf_client_set_string (base_priv->conf,
key,
visible_name,
&err);
@@ -2545,9 +2627,9 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_DEFAULT_SHOW_MENUBAR);
- gconf_client_set_bool (base_profile->priv->conf,
+ gconf_client_set_bool (base_priv->conf,
key,
- base_profile->priv->default_show_menubar,
+ base_priv->default_show_menubar,
&err);
BAIL_OUT_CHECK ();
@@ -2555,8 +2637,8 @@
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_FOREGROUND_COLOR);
- s = color_to_string (&base_profile->priv->foreground);
- gconf_client_set_string (base_profile->priv->conf,
+ s = color_to_string (&base_priv->foreground);
+ gconf_client_set_string (base_priv->conf,
key, s,
&err);
g_free (s);
@@ -2566,8 +2648,8 @@
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_BACKGROUND_COLOR);
- s = color_to_string (&base_profile->priv->background);
- gconf_client_set_string (base_profile->priv->conf,
+ s = color_to_string (&base_priv->background);
+ gconf_client_set_string (base_priv->conf,
key, s,
&err);
g_free (s);
@@ -2578,7 +2660,7 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_TITLE);
/* default title is profile name, not copied from base */
- gconf_client_set_string (base_profile->priv->conf,
+ gconf_client_set_string (base_priv->conf,
key, visible_name,
&err);
BAIL_OUT_CHECK ();
@@ -2586,8 +2668,8 @@
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_TITLE_MODE);
- cs = gconf_enum_to_string (title_modes, base_profile->priv->title_mode);
- gconf_client_set_string (base_profile->priv->conf,
+ cs = gconf_enum_to_string (title_modes, base_priv->title_mode);
+ gconf_client_set_string (base_priv->conf,
key, cs,
&err);
BAIL_OUT_CHECK ();
@@ -2596,9 +2678,9 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_ALLOW_BOLD);
- gconf_client_set_bool (base_profile->priv->conf,
+ gconf_client_set_bool (base_priv->conf,
key,
- base_profile->priv->allow_bold,
+ base_priv->allow_bold,
&err);
BAIL_OUT_CHECK ();
@@ -2607,9 +2689,9 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_SILENT_BELL);
- gconf_client_set_bool (base_profile->priv->conf,
+ gconf_client_set_bool (base_priv->conf,
key,
- base_profile->priv->silent_bell,
+ base_priv->silent_bell,
&err);
BAIL_OUT_CHECK ();
@@ -2618,8 +2700,8 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_WORD_CHARS);
/* default title is profile name, not copied from base */
- gconf_client_set_string (base_profile->priv->conf,
- key, base_profile->priv->word_chars,
+ gconf_client_set_string (base_priv->conf,
+ key, base_priv->word_chars,
&err);
BAIL_OUT_CHECK ();
@@ -2627,8 +2709,8 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_SCROLLBAR_POSITION);
cs = gconf_enum_to_string (scrollbar_positions,
- base_profile->priv->scrollbar_position);
- gconf_client_set_string (base_profile->priv->conf,
+ base_priv->scrollbar_position);
+ gconf_client_set_string (base_priv->conf,
key, cs,
&err);
BAIL_OUT_CHECK ();
@@ -2636,8 +2718,8 @@
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_SCROLLBACK_LINES);
- gconf_client_set_int (base_profile->priv->conf,
- key, base_profile->priv->scrollback_lines,
+ gconf_client_set_int (base_priv->conf,
+ key, base_priv->scrollback_lines,
&err);
BAIL_OUT_CHECK ();
@@ -2646,9 +2728,9 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_SCROLL_ON_KEYSTROKE);
- gconf_client_set_bool (base_profile->priv->conf,
+ gconf_client_set_bool (base_priv->conf,
key,
- base_profile->priv->scroll_on_keystroke,
+ base_priv->scroll_on_keystroke,
&err);
BAIL_OUT_CHECK ();
@@ -2657,9 +2739,9 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_SCROLL_ON_OUTPUT);
- gconf_client_set_bool (base_profile->priv->conf,
+ gconf_client_set_bool (base_priv->conf,
key,
- base_profile->priv->scroll_on_output,
+ base_priv->scroll_on_output,
&err);
BAIL_OUT_CHECK ();
@@ -2670,9 +2752,9 @@
KEY_EXIT_ACTION);
cs = gconf_enum_to_string (scrollbar_positions,
- base_profile->priv->exit_action);
+ base_priv->exit_action);
- gconf_client_set_string (base_profile->priv->conf,
+ gconf_client_set_string (base_priv->conf,
key, cs,
&err);
@@ -2682,9 +2764,9 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_LOGIN_SHELL);
- gconf_client_set_bool (base_profile->priv->conf,
+ gconf_client_set_bool (base_priv->conf,
key,
- base_profile->priv->login_shell,
+ base_priv->login_shell,
&err);
BAIL_OUT_CHECK ();
@@ -2693,9 +2775,9 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_UPDATE_RECORDS);
- gconf_client_set_bool (base_profile->priv->conf,
+ gconf_client_set_bool (base_priv->conf,
key,
- base_profile->priv->update_records,
+ base_priv->update_records,
&err);
BAIL_OUT_CHECK ();
@@ -2704,9 +2786,9 @@
key = gconf_concat_dir_and_key (profile_dir,
KEY_USE_CUSTOM_COMMAND);
- gconf_client_set_bool (base_profile->priv->conf,
+ gconf_client_set_bool (base_priv->conf,
key,
- base_profile->priv->use_custom_command,
+ base_priv->use_custom_command,
&err);
BAIL_OUT_CHECK ();
@@ -2715,24 +2797,24 @@
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_CUSTOM_COMMAND);
- gconf_client_set_string (base_profile->priv->conf,
- key, base_profile->priv->custom_command,
+ gconf_client_set_string (base_priv->conf,
+ key, base_priv->custom_command,
&err);
BAIL_OUT_CHECK ();
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_ICON);
- gconf_client_set_string (base_profile->priv->conf,
- key, base_profile->priv->icon_file,
+ gconf_client_set_string (base_priv->conf,
+ key, base_priv->icon_file,
&err);
BAIL_OUT_CHECK ();
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_PALETTE);
- s = terminal_palette_to_string (base_profile->priv->palette);
- gconf_client_set_string (base_profile->priv->conf,
+ s = terminal_palette_to_string (base_priv->palette);
+ gconf_client_set_string (base_priv->conf,
key, s,
&err);
g_free (s);
@@ -2741,8 +2823,8 @@
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_BACKGROUND_TYPE);
- cs = gconf_enum_to_string (background_types, base_profile->priv->background_type);
- gconf_client_set_string (base_profile->priv->conf,
+ cs = gconf_enum_to_string (background_types, base_priv->background_type);
+ gconf_client_set_string (base_priv->conf,
key, cs,
&err);
BAIL_OUT_CHECK ();
@@ -2750,32 +2832,32 @@
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_BACKGROUND_IMAGE);
- gconf_client_set_string (base_profile->priv->conf,
- key, base_profile->priv->background_image_file,
+ gconf_client_set_string (base_priv->conf,
+ key, base_priv->background_image_file,
&err);
BAIL_OUT_CHECK ();
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_SCROLL_BACKGROUND);
- gconf_client_set_bool (base_profile->priv->conf,
- key, base_profile->priv->scroll_background,
+ gconf_client_set_bool (base_priv->conf,
+ key, base_priv->scroll_background,
&err);
BAIL_OUT_CHECK ();
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_BACKGROUND_DARKNESS);
- gconf_client_set_float (base_profile->priv->conf,
- key, base_profile->priv->background_darkness,
+ gconf_client_set_float (base_priv->conf,
+ key, base_priv->background_darkness,
&err);
BAIL_OUT_CHECK ();
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_BACKSPACE_BINDING);
- cs = gconf_enum_to_string (erase_bindings, base_profile->priv->backspace_binding);
- gconf_client_set_string (base_profile->priv->conf,
+ cs = gconf_enum_to_string (erase_bindings, base_priv->backspace_binding);
+ gconf_client_set_string (base_priv->conf,
key, cs,
&err);
BAIL_OUT_CHECK ();
@@ -2783,8 +2865,8 @@
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_DELETE_BINDING);
- cs = gconf_enum_to_string (erase_bindings, base_profile->priv->delete_binding);
- gconf_client_set_string (base_profile->priv->conf,
+ cs = gconf_enum_to_string (erase_bindings, base_priv->delete_binding);
+ gconf_client_set_string (base_priv->conf,
key, cs,
&err);
BAIL_OUT_CHECK ();
@@ -2792,32 +2874,32 @@
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_USE_THEME_COLORS);
- gconf_client_set_bool (base_profile->priv->conf,
- key, base_profile->priv->use_theme_colors,
+ gconf_client_set_bool (base_priv->conf,
+ key, base_priv->use_theme_colors,
&err);
BAIL_OUT_CHECK ();
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_USE_SYSTEM_FONT);
- gconf_client_set_bool (base_profile->priv->conf,
- key, base_profile->priv->use_system_font,
+ gconf_client_set_bool (base_priv->conf,
+ key, base_priv->use_system_font,
&err);
BAIL_OUT_CHECK ();
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_NO_AA_WITHOUT_RENDER);
- gconf_client_set_bool (base_profile->priv->conf,
- key, base_profile->priv->no_aa_without_render,
+ gconf_client_set_bool (base_priv->conf,
+ key, base_priv->no_aa_without_render,
&err);
BAIL_OUT_CHECK ();
g_free (key);
key = gconf_concat_dir_and_key (profile_dir,
KEY_FONT);
- s = pango_font_description_to_string (base_profile->priv->font);
- gconf_client_set_string (base_profile->priv->conf,
+ s = pango_font_description_to_string (base_priv->font);
+ gconf_client_set_string (base_priv->conf,
key, s,
&err);
g_free (s);
@@ -2841,7 +2923,7 @@
name_list = g_slist_prepend (name_list, g_strdup (profile_name));
- gconf_client_set_list (base_profile->priv->conf,
+ gconf_client_set_list (base_priv->conf,
CONF_GLOBAL_PREFIX"/profile_list",
GCONF_VALUE_STRING,
name_list,
@@ -3219,6 +3301,8 @@
void
profile_name_entry_notify (TerminalProfile *profile)
{
- gconf_client_notify (profile->priv->conf,
+ TerminalProfilePrivate *priv = profile->priv;
+
+ gconf_client_notify (priv->conf,
CONF_GLOBAL_PREFIX"/profile_list");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]