2006-05-04 22:41:23 -05:00
|
|
|
/*
|
2007-04-07 03:21:52 -05:00
|
|
|
* mooeditprefs.c
|
|
|
|
*
|
2010-11-07 01:20:45 -08:00
|
|
|
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@sourceforge.net>
|
2005-06-22 18:20:32 +00:00
|
|
|
*
|
2008-09-05 17:20:50 -05:00
|
|
|
* This file is part of medit. medit is free software; you can
|
|
|
|
* redistribute it and/or modify it under the terms of the
|
|
|
|
* GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2.1 of the License,
|
|
|
|
* or (at your option) any later version.
|
2005-06-22 18:20:32 +00:00
|
|
|
*
|
2008-09-05 17:20:50 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with medit. If not, see <http://www.gnu.org/licenses/>.
|
2005-06-22 18:20:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define MOOEDIT_COMPILATION
|
|
|
|
#include "mooedit/mooeditprefs.h"
|
2010-02-01 22:44:03 -08:00
|
|
|
#include "mooedit/mooedit-impl.h"
|
2008-09-07 00:15:07 -05:00
|
|
|
#include "mooedit/mooedit-fileops.h"
|
2006-11-14 00:58:23 -06:00
|
|
|
#include "mooedit/mootextview-private.h"
|
2006-08-19 02:50:56 -05:00
|
|
|
#include "mooedit/mooedit-enums.h"
|
2005-09-09 09:40:10 +00:00
|
|
|
#include "mooedit/mootextbuffer.h"
|
2008-08-26 13:51:05 -05:00
|
|
|
#include "mooedit/moolangmgr.h"
|
2007-05-02 00:37:36 -05:00
|
|
|
#include "mooutils/mooencodings.h"
|
2010-11-23 21:54:39 -08:00
|
|
|
#include "mooutils/mooi18n.h"
|
2005-06-22 18:20:32 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2010-07-10 23:52:04 -07:00
|
|
|
#ifdef __WIN32__
|
|
|
|
#define DEFAULT_FONT "Monospace 10"
|
|
|
|
#else
|
|
|
|
#define DEFAULT_FONT "Monospace"
|
|
|
|
#endif
|
2005-06-22 18:20:32 +00:00
|
|
|
|
2006-07-27 14:39:53 -05:00
|
|
|
static void _moo_edit_init_prefs (void);
|
2005-07-29 11:51:36 +00:00
|
|
|
|
|
|
|
|
2006-07-27 14:39:53 -05:00
|
|
|
static guint settings[MOO_EDIT_LAST_SETTING];
|
|
|
|
guint *_moo_edit_settings = settings;
|
2005-07-29 11:51:36 +00:00
|
|
|
|
|
|
|
|
2010-11-23 21:54:39 -08:00
|
|
|
const char *
|
|
|
|
_moo_get_default_encodings (void)
|
|
|
|
{
|
|
|
|
/* Translators: if translated, it should be a comma-separated list
|
|
|
|
of encodings to try when opening files. Encodings names should be
|
|
|
|
those understood by iconv, or "LOCALE" which means user's locale
|
|
|
|
charset. For instance, the default value is "UTF-8,LOCALE,ISO_8859-15,ISO_8859-1".
|
|
|
|
You want to add common preferred non-UTF8 encodings used in your locale.
|
|
|
|
Do not remove ISO_8859-15 and ISO_8859-1, instead leave them at the end,
|
|
|
|
these are common source files encodings. */
|
|
|
|
const char *to_translate = N_("encodings_list");
|
|
|
|
const char *encodings;
|
|
|
|
|
|
|
|
encodings = _(to_translate);
|
|
|
|
|
|
|
|
if (!strcmp (encodings, to_translate))
|
|
|
|
encodings = "UTF-8," MOO_EDIT_ENCODING_LOCALE ",ISO_8859-1,ISO_8859-15";
|
|
|
|
|
|
|
|
return encodings;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
_moo_edit_get_default_encoding (void)
|
|
|
|
{
|
|
|
|
return moo_prefs_get_string (moo_edit_setting (MOO_EDIT_PREFS_ENCODING_SAVE));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-07-27 14:39:53 -05:00
|
|
|
void
|
|
|
|
_moo_edit_init_config (void)
|
|
|
|
{
|
|
|
|
static gboolean done = FALSE;
|
2005-07-29 11:51:36 +00:00
|
|
|
|
2006-07-27 14:39:53 -05:00
|
|
|
if (done)
|
|
|
|
return;
|
|
|
|
done = TRUE;
|
|
|
|
|
|
|
|
_moo_edit_init_prefs ();
|
|
|
|
|
|
|
|
_moo_edit_settings[MOO_EDIT_SETTING_LANG] =
|
|
|
|
moo_edit_config_install_setting (g_param_spec_string ("lang", "lang", "lang",
|
|
|
|
NULL,
|
2010-08-12 18:17:00 -07:00
|
|
|
(GParamFlags) G_PARAM_READWRITE));
|
2006-07-27 14:39:53 -05:00
|
|
|
_moo_edit_settings[MOO_EDIT_SETTING_INDENT] =
|
|
|
|
moo_edit_config_install_setting (g_param_spec_string ("indent", "indent", "indent",
|
|
|
|
NULL,
|
2010-08-12 18:17:00 -07:00
|
|
|
(GParamFlags) G_PARAM_READWRITE));
|
2006-07-27 14:39:53 -05:00
|
|
|
_moo_edit_settings[MOO_EDIT_SETTING_STRIP] =
|
|
|
|
moo_edit_config_install_setting (g_param_spec_boolean ("strip", "strip", "strip",
|
|
|
|
FALSE,
|
2010-08-12 18:17:00 -07:00
|
|
|
(GParamFlags) G_PARAM_READWRITE));
|
2007-12-24 10:24:33 -06:00
|
|
|
_moo_edit_settings[MOO_EDIT_SETTING_ADD_NEWLINE] =
|
|
|
|
moo_edit_config_install_setting (g_param_spec_boolean ("add-newline", "add-newline", "add-newline",
|
|
|
|
FALSE,
|
2010-08-12 18:17:00 -07:00
|
|
|
(GParamFlags) G_PARAM_READWRITE));
|
2006-07-27 14:39:53 -05:00
|
|
|
_moo_edit_settings[MOO_EDIT_SETTING_WRAP_MODE] =
|
|
|
|
moo_edit_config_install_setting (g_param_spec_enum ("wrap-mode", "wrap-mode", "wrap-mode",
|
|
|
|
GTK_TYPE_WRAP_MODE, GTK_WRAP_NONE,
|
2010-08-12 18:17:00 -07:00
|
|
|
(GParamFlags) G_PARAM_READWRITE));
|
2006-07-27 14:39:53 -05:00
|
|
|
_moo_edit_settings[MOO_EDIT_SETTING_SHOW_LINE_NUMBERS] =
|
|
|
|
moo_edit_config_install_setting (g_param_spec_boolean ("show-line-numbers", "show-line-numbers", "show-line-numbers",
|
|
|
|
FALSE,
|
2010-08-12 18:17:00 -07:00
|
|
|
(GParamFlags) G_PARAM_READWRITE));
|
2006-07-27 14:39:53 -05:00
|
|
|
_moo_edit_settings[MOO_EDIT_SETTING_TAB_WIDTH] =
|
|
|
|
moo_edit_config_install_setting (g_param_spec_uint ("tab-width", "tab-width", "tab-width",
|
|
|
|
1, G_MAXUINT, 8,
|
2010-08-12 18:17:00 -07:00
|
|
|
(GParamFlags) G_PARAM_READWRITE));
|
2008-01-06 12:50:09 -06:00
|
|
|
_moo_edit_settings[MOO_EDIT_SETTING_WORD_CHARS] =
|
|
|
|
moo_edit_config_install_setting (g_param_spec_string ("word-chars", "word-chars", "word-chars",
|
2010-08-12 18:17:00 -07:00
|
|
|
NULL, (GParamFlags) G_PARAM_READWRITE));
|
2005-06-22 18:20:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-04-05 01:22:26 -05:00
|
|
|
#define NEW_KEY_BOOL(s,v) moo_prefs_new_key_bool (MOO_EDIT_PREFS_PREFIX "/" s, v)
|
|
|
|
#define NEW_KEY_INT(s,v) moo_prefs_new_key_int (MOO_EDIT_PREFS_PREFIX "/" s, v)
|
|
|
|
#define NEW_KEY_STRING(s,v) moo_prefs_new_key_string (MOO_EDIT_PREFS_PREFIX "/" s, v)
|
2005-06-22 18:20:32 +00:00
|
|
|
|
2006-07-27 14:39:53 -05:00
|
|
|
static void
|
|
|
|
_moo_edit_init_prefs (void)
|
2005-06-22 18:20:32 +00:00
|
|
|
{
|
2005-12-08 22:46:03 +00:00
|
|
|
static gboolean done = FALSE;
|
|
|
|
|
|
|
|
if (done)
|
|
|
|
return;
|
|
|
|
else
|
|
|
|
done = TRUE;
|
|
|
|
|
2005-07-28 19:25:10 +00:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_SPACES_NO_TABS, FALSE);
|
2005-12-08 22:46:03 +00:00
|
|
|
NEW_KEY_INT (MOO_EDIT_PREFS_INDENT_WIDTH, 8);
|
2007-07-10 11:57:07 -05:00
|
|
|
NEW_KEY_INT (MOO_EDIT_PREFS_TAB_WIDTH, 8);
|
2006-04-25 00:10:36 -05:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_AUTO_INDENT, TRUE);
|
2007-12-02 12:19:02 -06:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_TAB_INDENTS, TRUE);
|
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_BACKSPACE_INDENTS, TRUE);
|
2005-12-08 22:46:03 +00:00
|
|
|
|
2007-07-20 13:19:23 -05:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_SAVE_SESSION, TRUE);
|
2005-09-14 07:06:17 +00:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_AUTO_SAVE, FALSE);
|
|
|
|
NEW_KEY_INT (MOO_EDIT_PREFS_AUTO_SAVE_INTERVAL, 5);
|
2005-12-08 22:46:03 +00:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_MAKE_BACKUPS, FALSE);
|
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_STRIP, FALSE);
|
2007-12-24 10:24:33 -06:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_ADD_NEWLINE, FALSE);
|
2005-12-08 22:46:03 +00:00
|
|
|
|
2007-11-22 16:10:07 -06:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_USE_TABS, TRUE);
|
2007-11-22 21:42:49 -06:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_OPEN_NEW_WINDOW, FALSE);
|
2007-11-22 16:10:07 -06:00
|
|
|
|
2007-09-05 18:20:01 -05:00
|
|
|
NEW_KEY_STRING (MOO_EDIT_PREFS_TITLE_FORMAT, "%a - %f%s");
|
|
|
|
NEW_KEY_STRING (MOO_EDIT_PREFS_TITLE_FORMAT_NO_DOC, "%a");
|
|
|
|
|
2007-08-07 00:19:47 -05:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_DIALOGS_OPEN_FOLLOWS_DOC, FALSE);
|
|
|
|
|
2006-11-12 21:20:30 -06:00
|
|
|
NEW_KEY_STRING (MOO_EDIT_PREFS_COLOR_SCHEME, "kate");
|
2005-12-08 22:46:03 +00:00
|
|
|
|
2007-06-20 23:37:08 -05:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_SMART_HOME_END, TRUE);
|
2005-12-08 22:46:03 +00:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_WRAP_ENABLE, FALSE);
|
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_WRAP_WORDS, TRUE);
|
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_ENABLE_HIGHLIGHTING, TRUE);
|
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_HIGHLIGHT_MATCHING, TRUE);
|
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_HIGHLIGHT_MISMATCHING, FALSE);
|
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_HIGHLIGHT_CURRENT_LINE, TRUE);
|
2007-07-15 04:51:58 -05:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_DRAW_RIGHT_MARGIN, FALSE);
|
|
|
|
NEW_KEY_INT (MOO_EDIT_PREFS_RIGHT_MARGIN_OFFSET, 80);
|
2007-06-20 23:37:08 -05:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_SHOW_LINE_NUMBERS, FALSE);
|
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_SHOW_TABS, FALSE);
|
2010-07-10 23:52:04 -07:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_SHOW_SPACES, FALSE);
|
2007-06-20 23:37:08 -05:00
|
|
|
NEW_KEY_BOOL (MOO_EDIT_PREFS_SHOW_TRAILING_SPACES, FALSE);
|
2010-07-10 23:52:04 -07:00
|
|
|
NEW_KEY_STRING (MOO_EDIT_PREFS_FONT, DEFAULT_FONT);
|
2010-11-07 01:07:42 -08:00
|
|
|
NEW_KEY_INT (MOO_EDIT_PREFS_QUICK_SEARCH_FLAGS, MOO_TEXT_SEARCH_CASELESS);
|
2006-11-14 00:58:23 -06:00
|
|
|
NEW_KEY_STRING (MOO_EDIT_PREFS_LINE_NUMBERS_FONT, NULL);
|
2007-02-27 22:55:05 -06:00
|
|
|
|
2007-04-10 02:20:06 -05:00
|
|
|
NEW_KEY_STRING (MOO_EDIT_PREFS_ENCODINGS, _moo_get_default_encodings ());
|
2007-05-02 00:37:36 -05:00
|
|
|
NEW_KEY_STRING (MOO_EDIT_PREFS_ENCODING_SAVE, MOO_ENCODING_UTF8);
|
2005-06-22 18:20:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-28 19:25:10 +00:00
|
|
|
#define get_string(key) moo_prefs_get_string (MOO_EDIT_PREFS_PREFIX "/" key)
|
|
|
|
#define get_bool(key) moo_prefs_get_bool (MOO_EDIT_PREFS_PREFIX "/" key)
|
|
|
|
#define get_int(key) moo_prefs_get_int (MOO_EDIT_PREFS_PREFIX "/" key)
|
2005-06-22 18:20:32 +00:00
|
|
|
|
2005-12-08 23:26:08 +00:00
|
|
|
void
|
2006-07-27 14:39:53 -05:00
|
|
|
_moo_edit_update_global_config (void)
|
|
|
|
{
|
2007-12-24 10:24:33 -06:00
|
|
|
gboolean use_tabs, strip, show_line_numbers, add_newline;
|
2007-07-10 11:57:07 -05:00
|
|
|
int indent_width, tab_width;
|
2006-07-27 14:39:53 -05:00
|
|
|
GtkWrapMode wrap_mode;
|
|
|
|
|
|
|
|
use_tabs = !get_bool (MOO_EDIT_PREFS_SPACES_NO_TABS);
|
|
|
|
indent_width = get_int (MOO_EDIT_PREFS_INDENT_WIDTH);
|
2007-07-10 11:57:07 -05:00
|
|
|
tab_width = get_int (MOO_EDIT_PREFS_TAB_WIDTH);
|
2006-07-27 14:39:53 -05:00
|
|
|
strip = get_bool (MOO_EDIT_PREFS_STRIP);
|
2007-12-24 10:24:33 -06:00
|
|
|
add_newline = get_bool (MOO_EDIT_PREFS_ADD_NEWLINE);
|
2006-07-27 14:39:53 -05:00
|
|
|
show_line_numbers = get_bool (MOO_EDIT_PREFS_SHOW_LINE_NUMBERS);
|
|
|
|
|
|
|
|
if (get_bool (MOO_EDIT_PREFS_WRAP_ENABLE))
|
|
|
|
{
|
|
|
|
if (get_bool (MOO_EDIT_PREFS_WRAP_WORDS))
|
|
|
|
wrap_mode = GTK_WRAP_WORD;
|
|
|
|
else
|
|
|
|
wrap_mode = GTK_WRAP_CHAR;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wrap_mode = GTK_WRAP_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
moo_edit_config_set_global (MOO_EDIT_CONFIG_SOURCE_AUTO,
|
|
|
|
"indent-use-tabs", use_tabs,
|
|
|
|
"indent-width", indent_width,
|
2007-07-10 11:57:07 -05:00
|
|
|
"tab-width", tab_width,
|
2006-07-27 14:39:53 -05:00
|
|
|
"strip", strip,
|
2007-12-24 10:24:33 -06:00
|
|
|
"add-newline", add_newline,
|
2006-07-27 14:39:53 -05:00
|
|
|
"show-line-numbers", show_line_numbers,
|
|
|
|
"wrap-mode", wrap_mode,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
_moo_edit_apply_prefs (MooEdit *edit)
|
2005-06-22 18:20:32 +00:00
|
|
|
{
|
2006-04-26 14:08:39 -05:00
|
|
|
MooLangMgr *mgr;
|
2006-08-26 04:46:29 -05:00
|
|
|
MooTextStyleScheme *scheme;
|
2010-07-10 23:52:04 -07:00
|
|
|
MooDrawWhitespaceFlags ws_flags = 0;
|
2010-12-18 23:58:18 -08:00
|
|
|
MooEditView *view;
|
2005-12-08 22:46:03 +00:00
|
|
|
|
|
|
|
g_return_if_fail (MOO_IS_EDIT (edit));
|
|
|
|
|
2010-12-18 23:58:18 -08:00
|
|
|
view = moo_edit_get_view (edit);
|
|
|
|
|
2010-12-08 01:11:51 -08:00
|
|
|
g_object_freeze_notify (G_OBJECT (edit));
|
2010-12-18 23:58:18 -08:00
|
|
|
g_object_freeze_notify (G_OBJECT (view));
|
2006-04-26 14:08:39 -05:00
|
|
|
|
2010-12-18 23:58:18 -08:00
|
|
|
g_object_set (view,
|
2005-12-08 22:46:03 +00:00
|
|
|
"smart-home-end", get_bool (MOO_EDIT_PREFS_SMART_HOME_END),
|
|
|
|
"enable-highlight", get_bool (MOO_EDIT_PREFS_ENABLE_HIGHLIGHTING),
|
|
|
|
"highlight-matching-brackets", get_bool (MOO_EDIT_PREFS_HIGHLIGHT_MATCHING),
|
|
|
|
"highlight-mismatching-brackets", get_bool (MOO_EDIT_PREFS_HIGHLIGHT_MISMATCHING),
|
|
|
|
"highlight-current-line", get_bool (MOO_EDIT_PREFS_HIGHLIGHT_CURRENT_LINE),
|
2007-07-15 04:51:58 -05:00
|
|
|
"draw-right-margin", get_bool (MOO_EDIT_PREFS_DRAW_RIGHT_MARGIN),
|
|
|
|
"right-margin-offset", get_int (MOO_EDIT_PREFS_RIGHT_MARGIN_OFFSET),
|
2010-11-07 01:07:42 -08:00
|
|
|
"quick-search-flags", get_int (MOO_EDIT_PREFS_QUICK_SEARCH_FLAGS),
|
2006-04-25 00:10:36 -05:00
|
|
|
"auto-indent", get_bool (MOO_EDIT_PREFS_AUTO_INDENT),
|
2007-12-02 12:19:02 -06:00
|
|
|
"tab-indents", get_bool (MOO_EDIT_PREFS_TAB_INDENTS),
|
2006-04-25 00:10:36 -05:00
|
|
|
"backspace-indents", get_bool (MOO_EDIT_PREFS_BACKSPACE_INDENTS),
|
2005-12-08 22:46:03 +00:00
|
|
|
NULL);
|
2005-06-22 18:20:32 +00:00
|
|
|
|
2010-07-10 23:52:04 -07:00
|
|
|
if (get_bool (MOO_EDIT_PREFS_SHOW_TABS))
|
|
|
|
ws_flags |= MOO_DRAW_TABS;
|
|
|
|
if (get_bool (MOO_EDIT_PREFS_SHOW_SPACES))
|
|
|
|
ws_flags |= MOO_DRAW_SPACES;
|
|
|
|
if (get_bool (MOO_EDIT_PREFS_SHOW_TRAILING_SPACES))
|
|
|
|
ws_flags |= MOO_DRAW_TRAILING_SPACES;
|
2010-12-18 23:58:18 -08:00
|
|
|
g_object_set (view, "draw-whitespace", ws_flags, NULL);
|
2010-07-10 23:52:04 -07:00
|
|
|
|
2010-12-18 23:58:18 -08:00
|
|
|
moo_text_view_set_font_from_string (MOO_TEXT_VIEW (view),
|
2008-08-30 01:14:18 -05:00
|
|
|
get_string (MOO_EDIT_PREFS_FONT));
|
2010-12-18 23:58:18 -08:00
|
|
|
_moo_text_view_set_line_numbers_font (MOO_TEXT_VIEW (view),
|
2006-11-14 00:58:23 -06:00
|
|
|
get_string (MOO_EDIT_PREFS_LINE_NUMBERS_FONT));
|
|
|
|
|
2008-08-26 13:51:05 -05:00
|
|
|
mgr = moo_lang_mgr_default ();
|
2007-06-18 00:17:05 -05:00
|
|
|
scheme = moo_lang_mgr_get_active_scheme (mgr);
|
2006-08-26 04:46:29 -05:00
|
|
|
|
|
|
|
if (scheme)
|
2010-12-18 23:58:18 -08:00
|
|
|
moo_text_view_set_style_scheme (MOO_TEXT_VIEW (view), scheme);
|
2006-04-26 14:08:39 -05:00
|
|
|
|
2010-12-18 23:58:18 -08:00
|
|
|
g_object_thaw_notify (G_OBJECT (view));
|
2010-12-08 01:11:51 -08:00
|
|
|
g_object_thaw_notify (G_OBJECT (edit));
|
2005-12-08 22:46:03 +00:00
|
|
|
}
|
2006-07-27 14:39:53 -05:00
|
|
|
|
|
|
|
|
|
|
|
const char *
|
|
|
|
moo_edit_setting (const char *setting_name)
|
|
|
|
{
|
|
|
|
#define STR_STACK_SIZE 4
|
|
|
|
static GString *stack[STR_STACK_SIZE];
|
|
|
|
static guint p;
|
|
|
|
|
|
|
|
g_return_val_if_fail (setting_name != NULL, NULL);
|
|
|
|
|
|
|
|
if (!stack[0])
|
|
|
|
{
|
|
|
|
for (p = 0; p < STR_STACK_SIZE; ++p)
|
|
|
|
stack[p] = g_string_new ("");
|
|
|
|
p = STR_STACK_SIZE - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p == STR_STACK_SIZE - 1)
|
|
|
|
p = 0;
|
|
|
|
else
|
|
|
|
p++;
|
|
|
|
|
|
|
|
g_string_printf (stack[p], MOO_EDIT_PREFS_PREFIX "/%s", setting_name);
|
|
|
|
return stack[p]->str;
|
|
|
|
#undef STR_STACK_SIZE
|
|
|
|
}
|