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
|
|
|
*
|
2010-01-01 22:55:18 +00:00
|
|
|
* Copyright 2008-2010 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
|
|
|
* Copyright 2008-2010 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
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GEANY_STASH_H
|
|
|
|
#define GEANY_STASH_H
|
|
|
|
|
2008-12-09 13:16:52 +00:00
|
|
|
typedef struct GeanyPrefEntry GeanyPrefEntry;
|
|
|
|
|
|
|
|
typedef struct GeanyPrefGroup GeanyPrefGroup;
|
|
|
|
|
2009-10-30 14:09:46 +00:00
|
|
|
/* Can be (GtkWidget*) or (gchar*) depending on whether owner argument is used for
|
|
|
|
* stash_group_display/stash_group_update. */
|
|
|
|
typedef gpointer GeanyWidgetID;
|
|
|
|
|
2008-12-09 13:16:52 +00:00
|
|
|
|
|
|
|
GeanyPrefGroup *stash_group_new(const gchar *name);
|
|
|
|
|
|
|
|
void stash_group_set_write_once(GeanyPrefGroup *group, gboolean write_once);
|
|
|
|
|
2008-12-27 12:55:04 +00:00
|
|
|
void stash_group_set_use_defaults(GeanyPrefGroup *group, gboolean use_defaults);
|
|
|
|
|
2008-12-09 13:16:52 +00:00
|
|
|
void stash_group_add_boolean(GeanyPrefGroup *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
|
|
|
|
|
|
|
void stash_group_add_integer(GeanyPrefGroup *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
|
|
|
|
|
|
|
void stash_group_add_string(GeanyPrefGroup *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
|
|
|
|
2008-12-28 13:21:35 +00:00
|
|
|
void stash_group_add_string_vector(GeanyPrefGroup *group, gchar ***setting,
|
|
|
|
const gchar *key_name, const gchar **default_value);
|
|
|
|
|
2008-12-22 12:50:19 +00:00
|
|
|
void stash_group_load_from_key_file(GeanyPrefGroup *group, GKeyFile *keyfile);
|
2008-12-09 13:16:52 +00:00
|
|
|
|
2008-12-22 12:50:19 +00:00
|
|
|
void stash_group_save_to_key_file(GeanyPrefGroup *group, GKeyFile *keyfile);
|
2008-12-09 13:16:52 +00:00
|
|
|
|
|
|
|
void stash_group_free(GeanyPrefGroup *group);
|
2008-11-28 12:52:19 +00:00
|
|
|
|
2008-12-22 16:03:16 +00:00
|
|
|
|
|
|
|
/* *** GTK-related functions *** */
|
|
|
|
|
|
|
|
void stash_group_add_toggle_button(GeanyPrefGroup *group, gboolean *setting,
|
2009-10-30 14:09:46 +00:00
|
|
|
const gchar *key_name, gboolean default_value, GeanyWidgetID widget_id);
|
2008-12-22 16:03:16 +00:00
|
|
|
|
|
|
|
void stash_group_add_radio_buttons(GeanyPrefGroup *group, gint *setting,
|
|
|
|
const gchar *key_name, gint default_value,
|
2009-10-30 14:09:46 +00:00
|
|
|
GeanyWidgetID widget_id, gint enum_id, ...) G_GNUC_NULL_TERMINATED;
|
2008-12-22 16:03:16 +00:00
|
|
|
|
|
|
|
void stash_group_add_spin_button_integer(GeanyPrefGroup *group, gint *setting,
|
2009-10-30 14:09:46 +00:00
|
|
|
const gchar *key_name, gint default_value, GeanyWidgetID widget_id);
|
2008-12-22 16:03:16 +00:00
|
|
|
|
|
|
|
void stash_group_add_combo_box(GeanyPrefGroup *group, gint *setting,
|
2009-10-30 14:09:46 +00:00
|
|
|
const gchar *key_name, gint default_value, GeanyWidgetID widget_id);
|
2008-12-22 16:03:16 +00:00
|
|
|
|
2008-12-22 17:13:37 +00:00
|
|
|
void stash_group_add_combo_box_entry(GeanyPrefGroup *group, gchar **setting,
|
2009-10-30 14:09:46 +00:00
|
|
|
const gchar *key_name, const gchar *default_value, GeanyWidgetID widget_id);
|
2008-12-22 17:13:37 +00:00
|
|
|
|
|
|
|
void stash_group_add_entry(GeanyPrefGroup *group, gchar **setting,
|
2009-10-30 14:09:46 +00:00
|
|
|
const gchar *key_name, const gchar *default_value, GeanyWidgetID widget_id);
|
2008-12-22 17:13:37 +00:00
|
|
|
|
2009-07-20 12:00:06 +00:00
|
|
|
void stash_group_add_widget_property(GeanyPrefGroup *group, gpointer setting,
|
2009-10-30 14:09:46 +00:00
|
|
|
const gchar *key_name, gpointer default_value, GeanyWidgetID widget_id,
|
2009-07-20 12:00:06 +00:00
|
|
|
const gchar *property_name, GType type);
|
|
|
|
|
2008-12-28 13:21:35 +00:00
|
|
|
void stash_group_display(GeanyPrefGroup *group, GtkWidget *owner);
|
|
|
|
|
|
|
|
void stash_group_update(GeanyPrefGroup *group, GtkWidget *owner);
|
|
|
|
|
2008-11-28 12:52:19 +00:00
|
|
|
#endif
|