1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
3 * Copyright (C) 2006 Armin Burgmeier
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __CLASSGEN_ELEMENT_EDITOR_H__
21 #define __CLASSGEN_ELEMENT_EDITOR_H__
25 #include <glib-object.h>
29 #define CG_TYPE_ELEMENT_EDITOR (cg_element_editor_get_type ())
30 #define CG_ELEMENT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CG_TYPE_ELEMENT_EDITOR, CgElementEditor))
31 #define CG_ELEMENT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CG_TYPE_ELEMENT_EDITOR, CgElementEditorClass))
32 #define CG_IS_ELEMENT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CG_TYPE_ELEMENT_EDITOR))
33 #define CG_IS_ELEMENT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CG_TYPE_ELEMENT_EDITOR))
34 #define CG_ELEMENT_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CG_TYPE_ELEMENT_EDITOR, CgElementEditorClass))
36 typedef struct _CgElementEditorClass CgElementEditorClass
;
37 typedef struct _CgElementEditor CgElementEditor
;
41 CG_ELEMENT_EDITOR_COLUMN_LIST
,
42 CG_ELEMENT_EDITOR_COLUMN_FLAGS
,
43 CG_ELEMENT_EDITOR_COLUMN_STRING
,
44 CG_ELEMENT_EDITOR_COLUMN_ARGUMENTS
45 } CgElementEditorColumnType
;
47 typedef struct CgElementEditorFlags_
50 const gchar
*abbrevation
;
51 } CgElementEditorFlags
;
53 struct _CgElementEditorClass
55 GObjectClass parent_class
;
58 struct _CgElementEditor
60 GObject parent_instance
;
63 GType
cg_element_editor_get_type (void) G_GNUC_CONST
;
65 CgElementEditor
*cg_element_editor_new (GtkTreeView
*view
,
66 GtkButton
*add_button
,
67 GtkButton
*remove_button
,
71 typedef void(*CgElementEditorTransformFunc
) (GHashTable
*, gpointer
);
73 /* The CgElementEditorTransformFunc may be used to modify the values
74 * before they are stored in the value heap. It is also possible to
75 * remove some or to create new ones. You should keep the key string
76 * static because it is not freed when the hash table is destroyed, but
77 * the data string may be dynamically allocated, it will be freed
79 void cg_element_editor_set_values (CgElementEditor
*editor
,
82 CgElementEditorTransformFunc func
,
86 typedef gboolean(*CgElementEditorConditionFunc
) (const gchar
**, gpointer
);
88 void cg_element_editor_set_value_count (CgElementEditor
*editor
,
91 CgElementEditorConditionFunc func
,
96 #endif /* __CLASSGEN_ELEMENT_EDITOR_H__ */