69 lines
2 KiB
C
69 lines
2 KiB
C
#ifndef __GM_OPTIONS_H__
|
|
#define __GM_OPTIONS_H__
|
|
|
|
#include <glib.h>
|
|
#include <gtk/gtk.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
/*
|
|
* Type checking and casting macros
|
|
*/
|
|
#define GM_TYPE_OPTIONS (gm_options_get_type())
|
|
#define GM_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
|
|
GM_TYPE_OPTIONS, GmOptions))
|
|
#define GM_OPTIONS_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
|
|
GM_TYPE_OPTIONS, GmOptions const))
|
|
#define GM_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
|
|
GM_TYPE_OPTIONS, GmOptionsClass))
|
|
#define GM_IS_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
|
|
GM_TYPE_OPTIONS))
|
|
#define GM_IS_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
|
GM_TYPE_OPTIONS))
|
|
#define GM_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \
|
|
GM_TYPE_OPTIONS, GmOptionsClass))
|
|
|
|
/* Private structure type */
|
|
typedef struct _GmOptionsPrivate GmOptionsPrivate;
|
|
|
|
/*
|
|
* Main object structure
|
|
*/
|
|
typedef struct _GmOptions GmOptions;
|
|
|
|
struct _GmOptions {
|
|
GObject object;
|
|
|
|
/*< private > */
|
|
GmOptionsPrivate *priv;
|
|
};
|
|
|
|
/*
|
|
* Class definition
|
|
*/
|
|
typedef struct _GmOptionsClass GmOptionsClass;
|
|
|
|
struct _GmOptionsClass {
|
|
GObjectClass parent_class;
|
|
|
|
/* Signals */
|
|
void (* option_changed) (GmOptions *options, const gchar *key);
|
|
};
|
|
|
|
GType gm_options_get_type(void) G_GNUC_CONST;
|
|
GmOptions *gm_options_new(void);
|
|
|
|
GmOptions *gm_options_dup(GmOptions *source);
|
|
void gm_options_add(GmOptions *options, const gchar *key, const gchar *value);
|
|
void gm_options_set(GmOptions *options, const gchar *key, const gchar *value);
|
|
const gchar *gm_options_get(GmOptions *options, const gchar *key);
|
|
void gm_options_set_int(GmOptions *options, const gchar *key, int value);
|
|
int gm_options_get_int(GmOptions *options, const gchar *key);
|
|
|
|
void gm_options_save(GmOptions *options);
|
|
void gm_options_save_as(GmOptions *options, const gchar *filename);
|
|
void gm_options_load(GmOptions *options, const gchar *filename);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GM_OPTIONS_H__ */
|