medit/moo/mooutils/mooutils-treeview.h

108 lines
4.8 KiB
C
Raw Normal View History

/*
* mooutils-treeview.h
*
2010-12-21 20:15:45 -08:00
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with medit. If not, see <http://www.gnu.org/licenses/>.
*/
2016-10-02 21:14:12 -07:00
#ifndef MOO_UTILS_TREE_VIEW_H
#define MOO_UTILS_TREE_VIEW_H
#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;
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;
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);
void _moo_tree_helper_update_model (MooTreeHelper *helper,
GtkTreeModel *model,
GtkTreePath *path);
void _moo_tree_helper_update_widgets (MooTreeHelper *helper);
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,
...);
void _moo_tree_view_select_first (GtkTreeView *tree_view);
void _moo_combo_box_select_first (GtkComboBox *combo);
void _moo_tree_view_setup_expander (GtkTreeView *tree_view,
GtkTreeViewColumn *column);
G_END_DECLS
2016-10-02 21:14:12 -07:00
#endif /* MOO_UTILS_TREE_VIEW_H */