Followup: GtkTree update
- From: <jrb redhat com>
- To: gtk-devel-list gnome org
- Subject: Followup: GtkTree update
- Date: Mon, 2 Oct 2000 20:27:48 -0400
Havoc just yelled at me for not Posting headers. Here they are for your
commenting pleasure.
--
/* gtkcellrenderer.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_CELL_RENDERER_H__
#define __GTK_CELL_RENDERER_H__
#include "gtk/gtk.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
typedef enum
{
GTK_CELL_RENDERER_SELECTED = 1 << 0,
GTK_CELL_RENDERER_PRELIT = 1 << 1,
GTK_CELL_RENDERER_INSENSITIVE = 1 << 2
} GtkCellRendererType;
#define GTK_TYPE_CELL_RENDERER (gtk_cell_renderer_get_type ())
#define GTK_CELL_RENDERER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CELL_RENDERER, GtkCellRenderer))
#define GTK_CELL_RENDERER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER, GtkCellRendererClass))
#define GTK_IS_CELL_RENDERER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CELL_RENDERER))
#define GTK_IS_CELL_RENDERER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_CELL_RENDERER))
#define GTK_CELL_RENDERER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_CELL_RENDERER, GtkCellRendererClass))
typedef struct _GtkCellRenderer GtkCellRenderer;
typedef struct _GtkCellRendererClass GtkCellRendererClass;
struct _GtkCellRenderer
{
GtkObject parent;
gfloat xalign;
gfloat yalign;
guint16 xpad;
guint16 ypad;
};
struct _GtkCellRendererClass
{
GtkObjectClass parent_class;
/* vtable - not signals */
void (* get_size) (GtkCellRenderer *cell,
GtkWidget *widget,
gint *width,
gint *height);
void (* render) (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
guint flags);
gint (* event) (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
guint flags);
};
GtkType gtk_cell_renderer_get_type (void);
void gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
gint *width,
gint *height);
void gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
guint flags);
gint gtk_cell_renderer_event (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
guint flags);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_CELL_RENDERER_H__ */
--
/* gtkcellrendererpixbuf.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_CELL_RENDERER_PIXBUF_H__
#define __GTK_CELL_RENDERER_PIXBUF_H__
#include <gtk/gtk.h>
#include "gtkcellrenderer.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_CELL_RENDERER_PIXBUF (gtk_cell_renderer_pixbuf_get_type ())
#define GTK_CELL_RENDERER_PIXBUF(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CELL_RENDERER_PIXBUF, GtkCellRendererPixbuf))
#define GTK_CELL_RENDERER_PIXBUF_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER_PIXBUF, GtkCellRendererPixbufClass))
#define GTK_IS_CELL_RENDERER_PIXBUF(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CELL_RENDERER_PIXBUF))
#define GTK_IS_CELL_RENDERER_PIXBUF_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_CELL_RENDERER_PIXBUF))
typedef struct _GtkCellRendererPixbuf GtkCellRendererPixbuf;
typedef struct _GtkCellRendererPixbufClass GtkCellRendererPixbufClass;
struct _GtkCellRendererPixbuf
{
GtkCellRenderer parent;
GdkPixbuf *pixbuf;
};
struct _GtkCellRendererPixbufClass
{
GtkCellRendererClass parent_class;
};
GtkType gtk_cell_renderer_pixbuf_get_type (void);
GtkCellRenderer *gtk_cell_renderer_pixbuf_new (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_CELL_RENDERER_PIXBUF_H__ */
--
/* gtkcellrenderertext.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_CELL_RENDERER_TEXT_H__
#define __GTK_CELL_RENDERER_TEXT_H__
#include <gtk/gtk.h>
#include "gtkcellrenderer.h"
#include <pango/pango.h>
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_CELL_RENDERER_TEXT (gtk_cell_renderer_text_get_type ())
#define GTK_CELL_RENDERER_TEXT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CELL_RENDERER_TEXT, GtkCellRendererText))
#define GTK_CELL_RENDERER_TEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER_TEXT, GtkCellRendererTextClass))
#define GTK_IS_CELL_RENDERER_TEXT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CELL_RENDERER_TEXT))
#define GTK_IS_CELL_RENDERER_TEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_CELL_RENDERER_TEXT))
typedef struct _GtkCellRendererText GtkCellRendererText;
typedef struct _GtkCellRendererTextClass GtkCellRendererTextClass;
struct _GtkCellRendererText
{
GtkCellRenderer parent;
/*< private >*/
gchar *text;
PangoAttrList *attr_list;
guint editable : 1;
guint underline : 1;
};
struct _GtkCellRendererTextClass
{
GtkCellRendererClass parent_class;
};
GtkType gtk_cell_renderer_text_get_type (void);
GtkCellRenderer *gtk_cell_renderer_text_new (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_CELL_RENDERER_TEXT_H__ */
--
/* gtkcellpixbuftext.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_CELL_RENDERER_TEXT_PIXBUF_H__
#define __GTK_CELL_RENDERER_TEXT_PIXBUF_H__
#include <gtk/gtk.h>
#include "gtkcellrenderertext.h"
#include "gtkcellrendererpixbuf.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_CELL_RENDERER_TEXT_PIXBUF (gtk_cell_renderer_text_pixbuf_get_type ())
#define GTK_CELL_RENDERER_TEXT_PIXBUF(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CELL_RENDERER_TEXT_PIXBUF, GtkCellRendererTextPixbuf))
#define GTK_CELL_RENDERER_TEXT_PIXBUF_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER_TEXT_PIXBUF, GtkCellRendererTextPixbufClass))
#define GTK_IS_CELL_RENDERER_TEXT_PIXBUF(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CELL_RENDERER_TEXT_PIXBUF))
#define GTK_IS_CELL_RENDERER_TEXT_PIXBUF_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_CELL_RENDERER_TEXT_PIXBUF))
typedef struct _GtkCellRendererTextPixbuf GtkCellRendererTextPixbuf;
typedef struct _GtkCellRendererTextPixbufClass GtkCellRendererTextPixbufClass;
struct _GtkCellRendererTextPixbuf
{
GtkCellRendererText parent;
/*< private >*/
GtkCellRendererPixbuf *pixbuf;
GtkPositionType pixbuf_pos;
};
struct _GtkCellRendererTextPixbufClass
{
GtkCellRendererTextClass parent_class;
};
GtkType gtk_cell_renderer_text_pixbuf_get_type (void);
GtkCellRenderer *gtk_cell_renderer_text_pixbuf_new (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_CELL_RENDERER_TEXT_PIXBUF_H__ */
--
/* gtkcelltoggle.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_CELL_RENDERER_TOGGLE_H__
#define __GTK_CELL_RENDERER_TOGGLE_H__
#include <gtk/gtk.h>
#include "gtkcellrenderer.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_CELL_RENDERER_TOGGLE (gtk_cell_renderer_toggle_get_type ())
#define GTK_CELL_RENDERER_TOGGLE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CELL_RENDERER_TOGGLE, GtkCellRendererToggle))
#define GTK_CELL_RENDERER_TOGGLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER_TOGGLE, GtkCellRendererToggleClass))
#define GTK_IS_CELL_RENDERER_TOGGLE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CELL_RENDERER_TOGGLE))
#define GTK_IS_CELL_RENDERER_TOGGLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_CELL_RENDERER_TOGGLE))
typedef struct _GtkCellRendererToggle GtkCellRendererToggle;
typedef struct _GtkCellRendererToggleClass GtkCellRendererToggleClass;
struct _GtkCellRendererToggle
{
GtkCellRenderer parent;
/*< private >*/
guint state : 1;
guint radio : 1;
};
struct _GtkCellRendererToggleClass
{
GtkCellRendererClass parent_class;
void (* toggled) (GtkCellRendererToggle *celltoggle,
gchar *path);
};
GtkType gtk_cell_renderer_toggle_get_type (void);
GtkCellRenderer *gtk_cell_renderer_toggle_new (void);
void gtk_cell_renderer_toggle_set_radio (GtkCellRendererToggle *toggle,
gboolean radio);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_CELL_RENDERER_TOGGLE_H__ */
--
/* gtkliststore.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_LIST_STORE_H__
#define __GTK_LIST_STORE_H__
#include <gtk/gtk.h>
#include "gtkliststore.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_LIST_STORE (gtk_list_store_get_type ())
#define GTK_LIST_STORE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST_STORE, GtkListStore))
#define GTK_LIST_STORE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LISTSTORE, GtkListStoreClass))
#define GTK_IS_LIST_STORE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST_STORE))
#define GTK_IS_LIST_STORE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_LIST_STORE))
typedef struct _GtkListStore GtkListStore;
typedef struct _GtkListStoreClass GtkListStoreClass;
struct _GtkListStore
{
GtkTreeModel parent;
/*< private >*/
GtkTreeNode *root;
gint n_columns;
GType *column_headers;
};
struct _GtkListStoreClass
{
GtkTreeModelClass parent_class;
};
GtkType gtk_list_store_get_type (void);
GtkObject *gtk_list_store_new (void);
GtkObject *gtk_list_store_new_with_types (gint n_columns,
...);
void gtk_list_store_set_n_columns (GtkListStore *store,
gint n_columns);
void gtk_list_store_set_column_type (GtkListStore *store,
gint column,
GType type);
GtkTreeNode *gtk_list_store_node_new (void);
void gtk_list_store_node_set_cell (GtkListStore *store,
GtkTreeNode *node,
gint column,
GValue *value);
void gtk_list_store_node_remove (GtkListStore *store,
GtkTreeNode *node);
GtkTreeNode *gtk_list_store_node_insert (GtkListStore *store,
gint position,
GtkTreeNode *node);
GtkTreeNode *gtk_list_store_node_insert_before (GtkListStore *store,
GtkTreeNode *sibling,
GtkTreeNode *node);
GtkTreeNode *gtk_list_store_node_prepend (GtkListStore *store,
GtkTreeNode *node);
GtkTreeNode *gtk_list_store_node_append (GtkListStore *store,
GtkTreeNode *node);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_LIST_STORE_H__ */
--
/* gtkmodelsimple.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_MODEL_SIMPLE_H__
#define __GTK_MODEL_SIMPLE_H__
#include "gtktreemodel.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_MODEL_SIMPLE (gtk_model_simple_get_type ())
#define GTK_MODEL_SIMPLE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MODEL_SIMPLE, GtkModelSimple))
#define GTK_MODEL_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MODEL_SIMPLE, GtkModelSimpleClass))
#define GTK_IS_MODEL_SIMPLE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_MODEL_SIMPLE))
#define GTK_IS_MODEL_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_MODEL_SIMPLE))
typedef struct _GtkModelSimple GtkModelSimple;
typedef struct _GtkModelSimpleClass GtkModelSimpleClass;
struct _GtkModelSimple
{
GtkTreeModel parent;
};
struct _GtkModelSimpleClass
{
GtkTreeModelClass parent_class;
};
GtkType gtk_model_simple_get_type (void);
GtkObject *gtk_model_simple_new (void);
void gtk_model_simple_node_changed (GtkModelSimple *simple,
GtkTreePath *path,
GtkTreeNode *tree_node);
void gtk_model_simple_node_inserted (GtkModelSimple *simple,
GtkTreePath *path,
GtkTreeNode *tree_node);
void gtk_model_simple_node_child_toggled (GtkModelSimple *simple,
GtkTreePath *path,
GtkTreeNode *tree_node,
gboolean has_child);
void gtk_model_simple_node_deleted (GtkModelSimple *simple,
GtkTreePath *path,
GtkTreeNode *tree_node);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_MODEL_SIMPLE_H__ */
--
/* gtkrbtree.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_RBTREE_H__
#define __GTK_RBTREE_H__
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#include <glib.h>
typedef enum
{
GTK_RBNODE_BLACK = 1 << 0,
GTK_RBNODE_RED = 1 << 1,
GTK_RBNODE_IS_PARENT = 1 << 2,
GTK_RBNODE_IS_SELECTED = 1 << 3,
GTK_RBNODE_IS_PRELIT = 1 << 4,
GTK_RBNODE_IS_VIEW = 1 << 5
} GtkRBNodeColor;
typedef struct _GtkRBTree GtkRBTree;
typedef struct _GtkRBNode GtkRBNode;
typedef struct _GtkRBTreeView GtkRBTreeView;
typedef void (*GtkRBTreeTraverseFunc) (GtkRBTree *tree,
GtkRBNode *node,
gpointer data);
struct _GtkRBTree
{
GtkRBNode *root;
GtkRBNode *nil;
GtkRBTree *parent_tree;
GtkRBNode *parent_node;
};
struct _GtkRBNode
{
guint flags;
GtkRBNode *left;
GtkRBNode *right;
GtkRBNode *parent;
gint count; /* aggregate number of children we have */
gint offset; /* aggregate of the heights of all our children */
GtkRBTree *children;
};
struct _GtkRBNodeView
{
GtkRBNode parent;
gint offset;
GtkRBTree *children;
};
#define GTK_RBNODE_GET_COLOR(node) (node?(((node->flags>K_RBNODE_RED)==GTK_RBNODE_RED)?GTK_RBNODE_RED:GTK_RBNODE_BLACK):GTK_RBNODE_BLACK)
#define GTK_RBNODE_SET_COLOR(node,color) if((node->flags&color)!=color)node->flags=node->flags^(GTK_RBNODE_RED|GTK_RBNODE_BLACK)
#define GTK_RBNODE_GET_HEIGHT(node) (node->offset-(node->left->offset+node->right->offset+(node->children?node->children->root->offset:0)))
#define GTK_RBNODE_SET_FLAG(node, flag) G_STMT_START{ (node->flags|=flag); }G_STMT_END
#define GTK_RBNODE_UNSET_FLAG(node, flag) G_STMT_START{ (node->flags&=~(flag)); }G_STMT_END
#define GTK_RBNODE_FLAG_SET(node, flag) (node?(((node->flags&flag)==flag)?TRUE:FALSE):FALSE)
void _gtk_rbtree_push_allocator (GAllocator *allocator);
void _gtk_rbtree_pop_allocator (void);
GtkRBTree *_gtk_rbtree_new (void);
void _gtk_rbtree_free (GtkRBTree *tree);
void _gtk_rbtree_remove (GtkRBTree *tree);
void _gtk_rbtree_destroy (GtkRBTree *tree);
GtkRBNode *_gtk_rbtree_insert_after (GtkRBTree *tree,
GtkRBNode *node,
gint height);
void _gtk_rbtree_remove_node (GtkRBTree *tree,
GtkRBNode *node);
GtkRBNode *_gtk_rbtree_find_count (GtkRBTree *tree,
gint count);
void _gtk_rbtree_node_set_height (GtkRBTree *tree,
GtkRBNode *node,
gint height);
gint _gtk_rbtree_node_find_offset (GtkRBTree *tree,
GtkRBNode *node);
gint _gtk_rbtree_find_offset (GtkRBTree *tree,
gint offset,
GtkRBTree **new_tree,
GtkRBNode **new_node);
void _gtk_rbtree_traverse (GtkRBTree *tree,
GtkRBNode *node,
GTraverseType order,
GtkRBTreeTraverseFunc func,
gpointer data);
GtkRBNode *_gtk_rbtree_next (GtkRBTree *tree,
GtkRBNode *node);
GtkRBNode *_gtk_rbtree_prev (GtkRBTree *tree,
GtkRBNode *node);
void _gtk_rbtree_next_full (GtkRBTree *tree,
GtkRBNode *node,
GtkRBTree **new_tree,
GtkRBNode **new_node);
void _gtk_rbtree_prev_full (GtkRBTree *tree,
GtkRBNode *node,
GtkRBTree **new_tree,
GtkRBNode **new_node);
/* This func just checks the integrity of the tree */
/* It will go away later. */
void _gtk_rbtree_test (GtkRBTree *tree);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_RBTREE_H__ */
--
/* gtktreedatalist.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_TREE_DATA_LIST_H__
#define __GTK_TREE_DATA_LIST_H__
#include <gtk/gtk.h>
typedef struct _GtkTreeDataList GtkTreeDataList;
struct _GtkTreeDataList
{
GtkTreeDataList *next;
union {
gint v_int;
guint v_uint;
gfloat v_float;
gpointer v_pointer;
} data;
};
/* FIXME: s/gtk/_gtk/g to make internal */
void gtk_tree_data_list_push_allocator (GAllocator *allocator);
void gtk_tree_data_list_pop_allocator (void);
GtkTreeDataList *gtk_tree_data_list_alloc (void);
void gtk_tree_data_list_free (GtkTreeDataList *list);
void gtk_tree_data_list_node_to_value (GtkTreeDataList *list,
GType type,
GValue *value);
void gtk_tree_data_list_value_to_node (GtkTreeDataList *list,
GValue *value);
#endif /* __GTK_TREE_DATA_LIST_H__ */
--
/* gtktreemodel.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_TREE_MODEL_H__
#define __GTK_TREE_MODEL_H__
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_TREE_MODEL (gtk_tree_model_get_type ())
#define GTK_TREE_MODEL(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_MODEL, GtkTreeModel))
#define GTK_TREE_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_MODEL, GtkTreeModelClass))
#define GTK_IS_TREE_MODEL(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_MODEL))
#define GTK_IS_TREE_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_TREE_MODEL))
#define GTK_TREE_MODEL_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TREE_MODEL, GtkTreeModelClass))
typedef gpointer GtkTreeNode;
typedef struct _GtkTreePath GtkTreePath;
typedef struct _GtkTreeModel GtkTreeModel;
typedef struct _GtkTreeModelClass GtkTreeModelClass;
struct _GtkTreeModel
{
GtkObject parent;
};
struct _GtkTreeModelClass
{
GtkObjectClass parent_class;
/* signals */
void (* node_changed) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeNode *node);
void (* node_inserted) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeNode *node);
void (* node_child_toggled) (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeNode *node,
gboolean has_child);
void (* node_deleted) (GtkTreeModel *tree_model,
GtkTreePath *path);
/* VTable - not signals */
gint (* get_n_columns) (GtkTreeModel *tree_model);
GtkTreeNode (* get_node) (GtkTreeModel *tree_model,
GtkTreePath *path);
GtkTreePath *(* get_path) (GtkTreeModel *tree_model,
GtkTreeNode node);
void (* node_get_value) (GtkTreeModel *tree_model,
GtkTreeNode node,
gint column,
GValue *value);
gboolean (* node_next) (GtkTreeModel *tree_model,
GtkTreeNode *node);
GtkTreeNode (* node_children) (GtkTreeModel *tree_model,
GtkTreeNode node);
gboolean (* node_has_child) (GtkTreeModel *tree_model,
GtkTreeNode node);
gint (* node_n_children) (GtkTreeModel *tree_model,
GtkTreeNode node);
GtkTreeNode (* node_nth_child) (GtkTreeModel *tree_model,
GtkTreeNode node,
gint n);
GtkTreeNode (* node_parent) (GtkTreeModel *tree_model,
GtkTreeNode node);
};
/* Basic tree_model operations */
GtkType gtk_tree_model_get_type (void);
/* GtkTreePath Operations */
GtkTreePath *gtk_tree_path_new (void);
GtkTreePath *gtk_tree_path_new_from_string (gchar *path);
gchar *gtk_tree_path_to_string (GtkTreePath *path);
GtkTreePath *gtk_tree_path_new_root (void);
void gtk_tree_path_append_index (GtkTreePath *path,
gint index);
void gtk_tree_path_prepend_index (GtkTreePath *path,
gint index);
gint gtk_tree_path_get_depth (GtkTreePath *path);
const gint * gtk_tree_path_get_indices (GtkTreePath *path);
void gtk_tree_path_free (GtkTreePath *path);
GtkTreePath *gtk_tree_path_copy (GtkTreePath *path);
gint gtk_tree_path_compare (GtkTreePath *a,
GtkTreePath *b);
void gtk_tree_path_next (GtkTreePath *path);
gint gtk_tree_path_prev (GtkTreePath *path);
gint gtk_tree_path_up (GtkTreePath *path);
void gtk_tree_path_down (GtkTreePath *path);
/* Header operations */
gint gtk_tree_model_get_n_columns (GtkTreeModel *tree_model);
/* Node operations */
GtkTreeNode gtk_tree_model_get_node (GtkTreeModel *tree_model,
GtkTreePath *path);
GtkTreePath *gtk_tree_model_get_path (GtkTreeModel *tree_model,
GtkTreeNode node);
void gtk_tree_model_node_get_value (GtkTreeModel *tree_model,
GtkTreeNode node,
gint column,
GValue *value);
gboolean gtk_tree_model_node_next (GtkTreeModel *tree_model,
GtkTreeNode *node);
GtkTreeNode gtk_tree_model_node_children (GtkTreeModel *tree_model,
GtkTreeNode node);
gboolean gtk_tree_model_node_has_child (GtkTreeModel *tree_model,
GtkTreeNode node);
gint gtk_tree_model_node_n_children (GtkTreeModel *tree_model,
GtkTreeNode node);
GtkTreeNode gtk_tree_model_node_nth_child (GtkTreeModel *tree_model,
GtkTreeNode node,
gint n);
GtkTreeNode gtk_tree_model_node_parent (GtkTreeModel *tree_model,
GtkTreeNode node);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_TREE_MODEL_H__ */
--
/* gtktreeprivate.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_TREE_PRIVATE_H__
#define __GTK_TREE_PRIVATE_H__
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#include <gtk/gtk.h>
#include "gtktreeview.h"
#include "gtktreeselection.h"
#include "gtkrbtree.h"
typedef enum {
GTK_TREE_VIEW_IS_LIST = 1 << 0,
GTK_TREE_VIEW_SHOW_EXPANDERS = 1 << 1,
GTK_TREE_VIEW_IN_COLUMN_RESIZE = 1 << 2,
GTK_TREE_VIEW_ARROW_PRELIT = 1 << 3,
GTK_TREE_VIEW_HEADERS_VISIBLE = 1 << 4,
GTK_TREE_VIEW_DRAW_KEYFOCUS = 1 << 5,
GTK_TREE_VIEW_MODEL_SETUP = 1 << 6
} GtkTreeViewFlags;
#define GTK_TREE_VIEW_SET_FLAG(tree_view, flag) G_STMT_START{ (tree_view->priv->flags|=flag); }G_STMT_END
#define GTK_TREE_VIEW_UNSET_FLAG(tree_view, flag) G_STMT_START{ (tree_view->priv->flags&=~(flag)); }G_STMT_END
#define GTK_TREE_VIEW_FLAG_SET(tree_view, flag) ((tree_view->priv->flags&flag)==flag)
#define TREE_VIEW_HEADER_HEIGHT(tree_view) (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_HEADERS_VISIBLE)?tree_view->priv->header_height:0)
#define TREE_VIEW_COLUMN_SIZE(column) (CLAMP (column->size, (column->min_width!=-1)?column->min_width:column->size, (column->max_width!=-1)?column->max_width:column->size))
#define TREE_VIEW_DRAW_EXPANDERS(tree_view) (!GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IS_LIST)&>K_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_SHOW_EXPANDERS))
struct _GtkTreeViewPrivate
{
GtkTreeModel *model;
guint flags;
/* tree information */
GtkRBTree *tree;
gint tab_offset;
GtkRBNode *button_pressed_node;
GtkRBTree *button_pressed_tree;
GList *children;
gint width;
gint height;
GtkAdjustment *hadjustment;
GtkAdjustment *vadjustment;
GdkWindow *bin_window;
GdkWindow *header_window;
/* Selection stuff */
GtkTreePath *anchor;
GtkTreePath *cursor;
/* Column Resizing */
GdkCursor *cursor_drag;
GdkGC *xor_gc;
gint drag_pos;
gint x_drag;
/* Prelight information */
GtkRBNode *prelight_node;
GtkRBTree *prelight_tree;
gint prelight_offset;
/* Selection information */
GtkTreeSelection *selection;
/* Header information */
gint columns;
GList *column;
gint header_height;
};
#ifdef __GNUC__
#define TREE_VIEW_INTERNAL_ASSERT(expr, ret) G_STMT_START{ \
if (!(expr)) \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed.\n" \
"There is a disparity between the internal view of the GtkTreeView,\n" \
"and the GtkTreeModel. This generally means that the model has changed\n"\
"without letting the view know. Any display from now on is likely to\n" \
"be incorrect.\n", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return ret; \
}; }G_STMT_END
#define TREE_VIEW_INTERNAL_ASSERT_VOID(expr) G_STMT_START{ \
if (!(expr)) \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d (%s): assertion `%s' failed.\n" \
"There is a disparity between the internal view of the GtkTreeView,\n" \
"and the GtkTreeModel. This generally means that the model has changed\n"\
"without letting the view know. Any display from now on is likely to\n" \
"be incorrect.\n", \
__FILE__, \
__LINE__, \
__PRETTY_FUNCTION__, \
#expr); \
return; \
}; }G_STMT_END
#else
#define TREE_VIEW_INTERNAL_ASSERT(expr, ret) G_STMT_START{ \
if (!(expr)) \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion `%s' failed.\n" \
"There is a disparity between the internal view of the GtkTreeView,\n" \
"and the GtkTreeModel. This generally means that the model has changed\n"\
"without letting the view know. Any display from now on is likely to\n" \
"be incorrect.\n", \
__FILE__, \
__LINE__, \
#expr); \
return ret; \
}; }G_STMT_END
#define TREE_VIEW_INTERNAL_ASSERT_VOID(expr) G_STMT_START{ \
if (!(expr)) \
{ \
g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_CRITICAL, \
"file %s: line %d: assertion '%s' failed.\n" \
"There is a disparity between the internal view of the GtkTreeView,\n" \
"and the GtkTreeModel. This generally means that the model has changed\n"\
"without letting the view know. Any display from now on is likely to\n" \
"be incorrect.\n", \
__FILE__, \
__LINE__, \
#expr); \
return; \
}; }G_STMT_END
#endif
/* functions that shouldn't be exported */
void _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
GtkRBNode *node,
GtkRBTree *tree,
GtkTreePath *path,
GdkModifierType state);
gboolean _gtk_tree_view_find_node (GtkTreeView *tree_view,
GtkTreePath *path,
GtkRBTree **tree,
GtkRBNode **node);
GtkTreePath *_gtk_tree_view_find_path (GtkTreeView *tree_view,
GtkRBTree *tree,
GtkRBNode *node);
void _gtk_tree_view_set_size (GtkTreeView *tree_view,
gint width,
gint height);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_TREE_PRIVATE_H__ */
--
/* gtktreeselection.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_TREE_SELECTION_H__
#define __GTK_TREE_SELECTION_H__
#include <gobject/gobject.h>
#include <gtk/gtk.h>
#include "gtktreeview.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#warning "Die GTK_TREE_SELECTION, DIE"
#undef GTK_TREE_SELECTION
#define GTK_TYPE_TREE_SELECTION (gtk_tree_selection_get_type ())
#define GTK_TREE_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_SELECTION, GtkTreeSelection))
#define GTK_TREE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_SELECTION, GtkTreeSelectionClass))
#define GTK_IS_TREE_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_SELECTION))
#define GTK_IS_TREE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_TREE_SELECTION))
typedef enum
{
GTK_TREE_SELECTION_SINGLE,
GTK_TREE_SELECTION_MULTI
} GtkTreeSelectionType;
typedef gboolean (* GtkTreeSelectionFunc) (GtkTreeSelection *selection,
GtkTreeModel *model,
GtkTreePath *path,
gpointer data);
typedef void (* GtkTreeSelectionForeachFunc) (GtkTreeModel *model,
GtkTreeNode *node,
gpointer data);
struct _GtkTreeSelection
{
GtkObject parent;
GtkTreeView *tree_view;
GtkTreeSelectionType type;
GtkTreeSelectionFunc user_func;
gpointer user_data;
};
struct _GtkTreeSelectionClass
{
GtkObjectClass parent_class;
void (* row_selected) (GtkTreeView *tree_view,
GtkTreeModel *tree_model,
GtkTreeNode *node);
void (* row_unselected) (GtkTreeView *tree_view,
GtkTreeModel *tree_model,
GtkTreeNode *node);
};
GtkType gtk_tree_selection_get_type (void);
GtkObject *gtk_tree_selection_new (void);
void gtk_tree_selection_set_type (GtkTreeSelection *selection,
GtkTreeSelectionType type);
void gtk_tree_selection_set_select_function (GtkTreeSelection *selection,
GtkTreeSelectionFunc func,
gpointer data);
gpointer gtk_tree_selection_get_user_data (GtkTreeSelection *selection);
/* Only meaningful if GTK_TREE_SELECTION_SINGLE is set */
/* User selected_foreach for GTK_TREE_SELECTION_MULTI */
GtkTreeNode *gtk_tree_selection_get_selected (GtkTreeSelection *selection);
/* FIXME: Get a more convenient get_selection function???? one returning GSList?? */
void gtk_tree_selection_selected_foreach (GtkTreeSelection *selection,
GtkTreeSelectionForeachFunc func,
gpointer data);
void gtk_tree_selection_select_path (GtkTreeSelection *selection,
GtkTreePath *path);
void gtk_tree_selection_unselect_path (GtkTreeSelection *selection,
GtkTreePath *path);
void gtk_tree_selection_select_node (GtkTreeSelection *selection,
GtkTreeNode *tree_node);
void gtk_tree_selection_unselect_node (GtkTreeSelection *selection,
GtkTreeNode *tree_node);
void gtk_tree_selection_select_all (GtkTreeSelection *selection);
void gtk_tree_selection_unselect_all (GtkTreeSelection *selection);
void gtk_tree_selection_select_range (GtkTreeSelection *selection,
GtkTreePath *start_path,
GtkTreePath *end_path);
/*< private >*/
GtkObject *gtk_tree_selection_new_with_tree_view (GtkTreeView *tree_view);
void gtk_tree_selection_set_tree_view (GtkTreeSelection *selection,
GtkTreeView *tree_view);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_TREE_SELECTION_H__ */
--
/* gtktreestore.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_TREE_STORE_H__
#define __GTK_TREE_STORE_H__
#include <gtk/gtk.h>
#include "gtktreemodel.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_TREE_STORE (gtk_tree_store_get_type ())
#define GTK_TREE_STORE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_STORE, GtkTreeStore))
#define GTK_TREE_STORE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_STORE, GtkTreeStoreClass))
#define GTK_IS_TREE_STORE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_STORE))
#define GTK_IS_TREE_STORE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_TREE_STORE))
typedef struct _GtkTreeStore GtkTreeStore;
typedef struct _GtkTreeStoreClass GtkTreeStoreClass;
struct _GtkTreeStore
{
GtkTreeModel parent;
GtkTreeNode *root;
gint n_columns;
GType *column_headers;
};
struct _GtkTreeStoreClass
{
GtkTreeModelClass parent_class;
};
GtkType gtk_tree_store_get_type (void);
GtkObject *gtk_tree_store_new (void);
GtkObject *gtk_tree_store_new_with_values (gint n_columns,
...);
void gtk_tree_store_set_n_columns (GtkTreeStore *tree_store,
gint n_columns);
void gtk_tree_store_set_column_type (GtkTreeStore *store,
gint column,
GType type);
GtkTreeNode *gtk_tree_store_node_new (void);
void gtk_tree_store_node_set_cell (GtkTreeStore *tree_store,
GtkTreeNode *node,
gint column,
GValue *value);
void gtk_tree_store_node_remove (GtkTreeStore *tree_store,
GtkTreeNode *node);
GtkTreeNode *gtk_tree_store_node_insert (GtkTreeStore *tree_store,
GtkTreeNode *parent,
gint position,
GtkTreeNode *node);
GtkTreeNode *gtk_tree_store_node_insert_before (GtkTreeStore *tree_store,
GtkTreeNode *parent,
GtkTreeNode *sibling,
GtkTreeNode *node);
GtkTreeNode *gtk_tree_store_node_insert_after (GtkTreeStore *tree_store,
GtkTreeNode *parent,
GtkTreeNode *sibling,
GtkTreeNode *node);
GtkTreeNode *gtk_tree_store_node_prepend (GtkTreeStore *tree_store,
GtkTreeNode *parent,
GtkTreeNode *node);
GtkTreeNode *gtk_tree_store_node_append (GtkTreeStore *tree_store,
GtkTreeNode *parent,
GtkTreeNode *node);
GtkTreeNode *gtk_tree_store_node_get_root (GtkTreeStore *tree_store);
gboolean gtk_tree_store_node_is_ancestor (GtkTreeStore *tree_store,
GtkTreeNode *node,
GtkTreeNode *descendant);
gint gtk_tree_store_node_depth (GtkTreeStore *tree_store,
GtkTreeNode *node);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_TREE_STORE_H__ */
--
/* gtktree_view.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_TREE_VIEW_H__
#define __GTK_TREE_VIEW_H__
#include <gtk/gtk.h>
#include "gtktreemodel.h"
#include "gtktreeviewcolumn.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_TREE_VIEW (gtk_tree_view_get_type ())
#define GTK_TREE_VIEW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_VIEW, GtkTreeView))
#define GTK_TREE_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_VIEW, GtkTreeViewClass))
#define GTK_IS_TREE_VIEW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_VIEW))
#define GTK_IS_TREE_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_TREE_VIEW))
typedef struct _GtkTreeView GtkTreeView;
typedef struct _GtkTreeViewClass GtkTreeViewClass;
typedef struct _GtkTreeViewPrivate GtkTreeViewPrivate;
typedef struct _GtkTreeSelection GtkTreeSelection;
typedef struct _GtkTreeSelectionClass GtkTreeSelectionClass;
struct _GtkTreeView
{
GtkContainer parent;
GtkTreeViewPrivate *priv;
};
struct _GtkTreeViewClass
{
GtkContainerClass parent_class;
void (*set_scroll_adjustments) (GtkTreeView *tree_view,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
gint (*expand_row) (GtkTreeView *tree_view,
GtkTreeNode *node);
};
/* Creators */
GtkType gtk_tree_view_get_type (void);
GtkWidget *gtk_tree_view_new (void);
GtkWidget *gtk_tree_view_new_with_model (GtkTreeModel *model);
GtkTreeModel *gtk_tree_view_get_model (GtkTreeView *tree_view);
void gtk_tree_view_set_model (GtkTreeView *tree_view,
GtkTreeModel *tree_model);
GtkTreeSelection *gtk_tree_view_get_selection (GtkTreeView *tree_view);
void gtk_tree_view_set_selection (GtkTreeView *tree_view,
GtkTreeSelection *selection);
GtkAdjustment *gtk_tree_view_get_hadjustment (GtkTreeView *layout);
void gtk_tree_view_set_hadjustment (GtkTreeView *layout,
GtkAdjustment *adjustment);
GtkAdjustment *gtk_tree_view_get_vadjustment (GtkTreeView *layout);
void gtk_tree_view_set_vadjustment (GtkTreeView *layout,
GtkAdjustment *adjustment);
gboolean gtk_tree_view_get_headers_visible (GtkTreeView *tree_view);
void gtk_tree_view_set_headers_visible (GtkTreeView *tree_view,
gboolean headers_visible);
void gtk_tree_view_columns_autosize (GtkTreeView *tree_view);
void gtk_tree_view_set_headers_active (GtkTreeView *tree_view,
gboolean active);
gint gtk_tree_view_add_column (GtkTreeView *tree_view,
GtkTreeViewColumn *column);
GtkTreeViewColumn *gtk_tree_view_get_column (GtkTreeView *tree_view,
gint n);
/* Actions */
void gtk_tree_view_move_to (GtkTreeView *tree_view,
GtkTreePath *path,
gint column,
gfloat row_align,
gfloat col_align);
void gtk_tree_view_expand_all (GtkTreeView *tree_view);
void gtk_tree_view_collapse_all (GtkTreeView *tree_view);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_TREE_VIEW_H__ */
--
/* gtktreeviewcolumn.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb redhat com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_TREE_VIEW_COLUMN_H__
#define __GTK_TREE_VIEW_COLUMN_H__
#include <gtk/gtk.h>
#include "gtkcellrenderer.h"
#include "gtktreemodel.h"
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define GTK_TYPE_TREE_COLUMN (gtk_tree_view_column_get_type ())
#define GTK_TREE_VIEW_COLUMN(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE_COLUMN, GtkTreeViewColumn))
#define GTK_TREE_VIEW_COLUMN_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_COLUMN, GtkTreeViewColumnClass))
#define GTK_IS_TREE_VIEW_COLUMN(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE_COLUMN))
#define GTK_IS_TREE_VIEW_COLUMN_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_TREE_COLUMN))
typedef enum
{
GTK_TREE_VIEW_COLUMN_RESIZEABLE,
GTK_TREE_VIEW_COLUMN_AUTOSIZE,
GTK_TREE_VIEW_COLUMN_FIXED
} GtkTreeViewColumnType;
typedef struct _GtkTreeViewColumn GtkTreeViewColumn;
typedef struct _GtkTreeViewColumnClass GtkTreeViewColumnClass;
typedef gboolean (* GtkTreeViewColumnFunc) (GtkTreeViewColumn *tree_column,
GtkTreeModel *tree_model,
GtkTreeNode tree_node,
gpointer data);
struct _GtkTreeViewColumn
{
GtkObject parent;
GtkWidget *tree_view;
GtkWidget *button;
GdkWindow *window;
GtkJustification justification;
gint id;
gint size;
gint min_width;
gint max_width;
GtkTreeViewColumnFunc *func;
gpointer func_data;
gchar *title;
GtkCellRenderer *cell;
GSList *attributes;
GtkTreeViewColumnType column_type;
guint visible : 1;
guint button_active : 1;
guint dirty : 1;
};
struct _GtkTreeViewColumnClass
{
GtkObjectClass parent_class;
void (*clicked) (GtkTreeViewColumn *tree_column);
};
GtkType gtk_tree_view_column_get_type (void);
GtkObject *gtk_tree_view_column_new (void);
GtkObject *gtk_tree_view_column_new_with_attributes (gchar *title,
GtkCellRenderer *cell,
...);
void gtk_tree_view_column_set_cell_renderer (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell);
void gtk_tree_view_column_add_attribute (GtkTreeViewColumn *tree_column,
gchar *attribute,
gint column);
void gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
...);
void gtk_tree_view_column_set_cell_data (GtkTreeViewColumn *tree_column,
GtkTreeModel *tree_model,
GtkTreeNode tree_node);
void gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
gboolean visible);
gboolean gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column);
void gtk_tree_view_column_set_col_type (GtkTreeViewColumn *tree_column,
GtkTreeViewColumnType type);
gint gtk_tree_view_column_get_col_type (GtkTreeViewColumn *tree_column);
gint gtk_tree_view_column_get_preferred_size (GtkTreeViewColumn *tree_column);
gint gtk_tree_view_column_get_size (GtkTreeViewColumn *tree_column);
void gtk_tree_view_column_set_size (GtkTreeViewColumn *tree_column,
gint width);
void gtk_tree_view_column_set_min_width (GtkTreeViewColumn *tree_column,
gint min_width);
gint gtk_tree_view_column_get_min_width (GtkTreeViewColumn *tree_column);
void gtk_tree_view_column_set_max_width (GtkTreeViewColumn *tree_column,
gint max_width);
gint gtk_tree_view_column_get_max_width (GtkTreeViewColumn *tree_column);
/* Options for manipulating the column headers
*/
void gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column,
gchar *title);
gchar *gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column);
void gtk_tree_view_column_set_header_active (GtkTreeViewColumn *tree_column,
gboolean active);
void gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column,
GtkWidget *widget);
GtkWidget *gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column);
void gtk_tree_view_column_set_justification (GtkTreeViewColumn *tree_column,
GtkJustification justification);
GtkJustification gtk_tree_view_column_get_justification (GtkTreeViewColumn *tree_column);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_TREE_VIEW_COLUMN_H__ */
--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]