2006-04-22 19:13:35 -05:00
|
|
|
/*
|
|
|
|
* mooutils-treeview.h
|
|
|
|
*
|
2010-12-21 20:15:45 -08:00
|
|
|
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
|
2006-04-22 19:13:35 -05: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.
|
2006-04-22 19:13:35 -05: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/>.
|
2006-04-22 19:13:35 -05:00
|
|
|
*/
|
|
|
|
|
2007-04-12 10:31:28 -05:00
|
|
|
#ifndef MOO_UTILS_TREE_VIEW_H
|
|
|
|
#define MOO_UTILS_TREE_VIEW_H
|
2006-04-22 19:13:35 -05:00
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
2006-08-17 00:08:49 -05:00
|
|
|
#define MOO_TYPE_TREE_HELPER (_moo_tree_helper_get_type ())
|
|
|
|
#define MOO_TREE_HELPER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_TREE_HELPER, MooTreeHelper))
|
|
|
|
#define MOO_TREE_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_TREE_HELPER, MooTreeHelperClass))
|
|
|
|
#define MOO_IS_TREE_HELPER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_TREE_HELPER))
|
|
|
|
#define MOO_IS_TREE_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_TREE_HELPER))
|
|
|
|
#define MOO_TREE_HELPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_TREE_HELPER, MooTreeHelperClass))
|
|
|
|
|
2006-04-23 02:09:14 -05:00
|
|
|
typedef struct _MooTreeHelper MooTreeHelper;
|
|
|
|
typedef struct _MooTreeHelperClass MooTreeHelperClass;
|
|
|
|
|
2006-08-17 00:08:49 -05:00
|
|
|
struct _MooTreeHelper {
|
|
|
|
GtkObject parent;
|
|
|
|
|
2006-11-15 01:29:32 -06:00
|
|
|
gboolean modified;
|
2006-08-17 00:08:49 -05:00
|
|
|
int type;
|
|
|
|
gpointer widget;
|
|
|
|
|
|
|
|
GtkWidget *new_btn;
|
|
|
|
GtkWidget *delete_btn;
|
|
|
|
GtkWidget *up_btn;
|
|
|
|
GtkWidget *down_btn;
|
|
|
|
};
|
|
|
|
|
2006-04-23 02:09:14 -05:00
|
|
|
struct _MooTreeHelperClass {
|
|
|
|
GtkObjectClass parent_class;
|
|
|
|
|
|
|
|
gboolean (*new_row) (MooTreeHelper *helper,
|
|
|
|
GtkTreeModel *model,
|
|
|
|
GtkTreePath *path);
|
|
|
|
gboolean (*delete_row) (MooTreeHelper *helper,
|
|
|
|
GtkTreeModel *model,
|
|
|
|
GtkTreePath *path);
|
|
|
|
gboolean (*move_row) (MooTreeHelper *helper,
|
|
|
|
GtkTreeModel *model,
|
|
|
|
GtkTreePath *old_path,
|
|
|
|
GtkTreePath *new_path);
|
|
|
|
|
|
|
|
void (*update_widgets) (MooTreeHelper *helper,
|
|
|
|
GtkTreeModel *model,
|
|
|
|
GtkTreePath *path,
|
|
|
|
GtkTreeIter *iter);
|
|
|
|
void (*update_model) (MooTreeHelper *helper,
|
|
|
|
GtkTreeModel *model,
|
|
|
|
GtkTreePath *path,
|
|
|
|
GtkTreeIter *iter);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-08-17 00:08:49 -05:00
|
|
|
GType _moo_tree_helper_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2006-08-15 02:32:44 -05:00
|
|
|
MooTreeHelper *_moo_tree_helper_new (GtkWidget *treeview_or_combo,
|
2006-05-22 02:26:16 -05:00
|
|
|
GtkWidget *new_btn,
|
|
|
|
GtkWidget *delete_btn,
|
|
|
|
GtkWidget *up_btn,
|
|
|
|
GtkWidget *down_btn);
|
2006-08-17 00:08:49 -05:00
|
|
|
void _moo_tree_helper_connect (MooTreeHelper *helper,
|
|
|
|
GtkWidget *treeview_or_combo,
|
|
|
|
GtkWidget *new_btn,
|
|
|
|
GtkWidget *delete_btn,
|
|
|
|
GtkWidget *up_btn,
|
|
|
|
GtkWidget *down_btn);
|
2006-08-15 02:32:44 -05:00
|
|
|
void _moo_tree_helper_update_model (MooTreeHelper *helper,
|
2006-05-04 01:40:54 -05:00
|
|
|
GtkTreeModel *model,
|
|
|
|
GtkTreePath *path);
|
2006-08-15 02:32:44 -05:00
|
|
|
void _moo_tree_helper_update_widgets (MooTreeHelper *helper);
|
2006-05-04 01:40:54 -05:00
|
|
|
|
2006-11-15 01:29:32 -06:00
|
|
|
void _moo_tree_helper_set_modified (MooTreeHelper *helper,
|
|
|
|
gboolean modified);
|
|
|
|
gboolean _moo_tree_helper_get_modified (MooTreeHelper *helper);
|
|
|
|
|
|
|
|
gboolean _moo_tree_helper_set (MooTreeHelper *helper,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
...);
|
|
|
|
|
2006-08-15 02:32:44 -05:00
|
|
|
void _moo_tree_view_select_first (GtkTreeView *tree_view);
|
|
|
|
void _moo_combo_box_select_first (GtkComboBox *combo);
|
2006-04-22 19:13:35 -05:00
|
|
|
|
2008-01-03 13:33:12 -06:00
|
|
|
void _moo_tree_view_setup_expander (GtkTreeView *tree_view,
|
|
|
|
GtkTreeViewColumn *column);
|
|
|
|
|
2006-04-22 19:13:35 -05:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2007-04-12 10:31:28 -05:00
|
|
|
#endif /* MOO_UTILS_TREE_VIEW_H */
|