2008-11-28 12:52:19 +00:00
|
|
|
/*
|
2008-12-11 12:49:26 +00:00
|
|
|
* stash.h - this file is part of Geany, a fast and lightweight IDE
|
2008-11-28 12:52:19 +00:00
|
|
|
*
|
2011-01-19 19:39:09 +00:00
|
|
|
* Copyright 2008-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
|
|
|
* Copyright 2008-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
2008-11-28 12:52:19 +00:00
|
|
|
*
|
2008-12-11 12:49:26 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2008-11-28 12:52:19 +00:00
|
|
|
*
|
2008-12-11 12:49:26 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2008-11-28 12:52:19 +00:00
|
|
|
*
|
2008-12-11 12:49:26 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
* MA 02110-1301, USA.
|
2008-11-28 12:52:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GEANY_STASH_H
|
|
|
|
#define GEANY_STASH_H
|
|
|
|
|
2010-03-17 17:15:47 +00:00
|
|
|
/** Opaque type for a group of settings. */
|
2010-03-18 17:04:17 +00:00
|
|
|
typedef struct StashGroup StashGroup;
|
2008-12-09 13:16:52 +00:00
|
|
|
|
2010-03-31 16:21:28 +00:00
|
|
|
/** Can be @c GtkWidget* or @c gchar* depending on whether the @a owner argument is used for
|
2010-03-17 17:15:47 +00:00
|
|
|
* stash_group_display() and stash_group_update(). */
|
2011-06-17 22:53:01 +00:00
|
|
|
typedef gconstpointer StashWidgetID;
|
2009-10-30 14:09:46 +00:00
|
|
|
|
2008-12-09 13:16:52 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
StashGroup *stash_group_new(const gchar *name);
|
2008-12-09 13:16:52 +00:00
|
|
|
|
2011-07-28 17:59:22 +00:00
|
|
|
void stash_group_set_various(StashGroup *group, gboolean write_once);
|
2008-12-09 13:16:52 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_set_use_defaults(StashGroup *group, gboolean use_defaults);
|
2008-12-27 12:55:04 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_boolean(StashGroup *group, gboolean *setting,
|
2008-12-11 16:49:59 +00:00
|
|
|
const gchar *key_name, gboolean default_value);
|
2008-12-09 13:16:52 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_integer(StashGroup *group, gint *setting,
|
2008-12-11 16:49:59 +00:00
|
|
|
const gchar *key_name, gint default_value);
|
2008-12-09 13:16:52 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_string(StashGroup *group, gchar **setting,
|
2008-12-11 16:49:59 +00:00
|
|
|
const gchar *key_name, const gchar *default_value);
|
2008-12-11 12:49:26 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_string_vector(StashGroup *group, gchar ***setting,
|
2008-12-28 13:21:35 +00:00
|
|
|
const gchar *key_name, const gchar **default_value);
|
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_load_from_key_file(StashGroup *group, GKeyFile *keyfile);
|
2008-12-09 13:16:52 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_save_to_key_file(StashGroup *group, GKeyFile *keyfile);
|
2008-12-09 13:16:52 +00:00
|
|
|
|
2010-03-30 16:29:38 +00:00
|
|
|
gboolean stash_group_load_from_file(StashGroup *group, const gchar *filename);
|
2010-03-19 17:38:27 +00:00
|
|
|
|
|
|
|
gint stash_group_save_to_file(StashGroup *group, const gchar *filename,
|
|
|
|
GKeyFileFlags flags);
|
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_free(StashGroup *group);
|
2008-11-28 12:52:19 +00:00
|
|
|
|
2008-12-22 16:03:16 +00:00
|
|
|
|
|
|
|
/* *** GTK-related functions *** */
|
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_toggle_button(StashGroup *group, gboolean *setting,
|
|
|
|
const gchar *key_name, gboolean default_value, StashWidgetID widget_id);
|
2008-12-22 16:03:16 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_radio_buttons(StashGroup *group, gint *setting,
|
2008-12-22 16:03:16 +00:00
|
|
|
const gchar *key_name, gint default_value,
|
2010-03-18 17:04:17 +00:00
|
|
|
StashWidgetID widget_id, gint enum_id, ...) G_GNUC_NULL_TERMINATED;
|
2008-12-22 16:03:16 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_spin_button_integer(StashGroup *group, gint *setting,
|
|
|
|
const gchar *key_name, gint default_value, StashWidgetID widget_id);
|
2008-12-22 16:03:16 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_combo_box(StashGroup *group, gint *setting,
|
|
|
|
const gchar *key_name, gint default_value, StashWidgetID widget_id);
|
2008-12-22 16:03:16 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_combo_box_entry(StashGroup *group, gchar **setting,
|
|
|
|
const gchar *key_name, const gchar *default_value, StashWidgetID widget_id);
|
2008-12-22 17:13:37 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_entry(StashGroup *group, gchar **setting,
|
|
|
|
const gchar *key_name, const gchar *default_value, StashWidgetID widget_id);
|
2008-12-22 17:13:37 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_add_widget_property(StashGroup *group, gpointer setting,
|
|
|
|
const gchar *key_name, gpointer default_value, StashWidgetID widget_id,
|
2009-07-20 12:00:06 +00:00
|
|
|
const gchar *property_name, GType type);
|
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_display(StashGroup *group, GtkWidget *owner);
|
2008-12-28 13:21:35 +00:00
|
|
|
|
2010-03-18 17:04:17 +00:00
|
|
|
void stash_group_update(StashGroup *group, GtkWidget *owner);
|
2008-12-28 13:21:35 +00:00
|
|
|
|
2011-07-28 17:59:22 +00:00
|
|
|
void stash_tree_setup(GPtrArray *group_array, GtkTreeView *tree);
|
|
|
|
|
2011-09-21 15:50:36 +00:00
|
|
|
void stash_tree_display(GPtrArray *group_array, GtkTreeView *tree);
|
|
|
|
|
2011-07-28 17:59:22 +00:00
|
|
|
void stash_tree_update(GPtrArray *group_array, GtkTreeView *tree);
|
|
|
|
|
2008-11-28 12:52:19 +00:00
|
|
|
#endif
|