summaryrefslogtreecommitdiff
path: root/gtk/gtkctree.h
diff options
context:
space:
mode:
authorLars Hamann <lars@gtk.org>1998-07-31 20:48:06 +0000
committerLars Hamann <lars@src.gnome.org>1998-07-31 20:48:06 +0000
commit8ad52d10249a4ee97fb6b84a8c798f03fa45c7bd (patch)
tree6f1edea6def97d695832410cd5179cf947cebef8 /gtk/gtkctree.h
parentcf7b958af57a768e075bb3961771eb11248453d2 (diff)
downloadgtk+-8ad52d10249a4ee97fb6b84a8c798f03fa45c7bd.tar.gz
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org> * gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion) (gtk_clist_button_release) (new_column_width): Few fixes for column resize. Store resize column in clist->drag_pos. Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org> * gtk/gtkctree.h * gtk/gtkctree.c * gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node to GtkCTreeNode *node. * gtk/gtklist.h : added extended selection mode and auto scrolling. (struct _GtkList): removed unneeded variables timer, button, selection_start_pos, selection_end_pos, scroll_direction, have_grab. Added new variables undo_selection, undo_unselection, last_focus_child, undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state, drag_selection, add_mode. New functions : (gtk_list_extend_selection), (gtk_list_start_selection), (gtk_list_end_selection), (gtk_list_select_all), (gtk_list_unselect_all), (gtk_list_scroll_horizontal), (gtk_list_scroll_vertical), (gtk_list_toggle_add_mode), (gtk_list_toggle_focus_row), (gtk_list_toggle_row), (gtk_list_undo_selection), (gtk_list_end_drag_selection) * gtk/gtklist.c : (gtk_list_enter_notify): removed, because auto scrolling now works with gtk_list_motion_notify New functions, needed for auto scrolling : (gtk_list_motion_notify) (gtk_list_move_focus_child) New functions for extended selection support : (gtk_list_set_anchor), (gtk_list_fake_unselect_all), (gtk_list_fake_toggle_row), (gtk_list_update_extended_selection), (gtk_list_focus_lost) (gtk_list_set_focus_child): modified gtk_container_set_focus_child function to support auto scrolling, and avoid out-of-sync errors in case auf GTK_SELECTION_BROWSE (gtk_list_focus): modified gtk_container_focus function to avoid out off sync errors in case auf GTK_SELECTION_EXTENDED * gtk/gtklistitem.h * gtk/gtklistitem.c : New signal functions for key binding support : (toggle_focus_row), (select_all), (list_item), (unselect_all) (list_item), (undo_selection), (start_selection), (end_selection) (extend_selection), (scroll_horizontal), (scroll_vertical), (toggle_add_mode) (gtk_list_item_realize): added GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK (gtk_list_item_draw_focus): modify gc if parent has add_mode set. * gtk/gtkcombo.c : (gtk_combo_popup_button_press): grab pointer for combo->list (gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB (gtk_combo_list_key_press): take care of which child HAS_GRAB (gtk_comb_init): don't connect combo->button with button_release_event
Diffstat (limited to 'gtk/gtkctree.h')
-rw-r--r--gtk/gtkctree.h164
1 files changed, 86 insertions, 78 deletions
diff --git a/gtk/gtkctree.h b/gtk/gtkctree.h
index e430a19dd5..b48e2aad36 100644
--- a/gtk/gtkctree.h
+++ b/gtk/gtkctree.h
@@ -37,7 +37,10 @@ extern "C"
#define GTK_IS_CTREE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CTREE))
#define GTK_IS_CTREE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CTREE))
-#define GTK_CTREE_ROW(_glist_) ((GtkCTreeRow *)((_glist_)->data))
+#define GTK_CTREE_ROW(_node_) ((GtkCTreeRow *)(((GList *)(_node_))->data))
+#define GTK_CTREE_NODE(_node_) ((GtkCTreeNode *)((_node_)))
+#define GTK_CTREE_NODE_NEXT(_nnode_) ((GtkCTreeNode *)(((GList *)(_nnode_))->next))
+#define GTK_CTREE_NODE_PREV(_pnode_) ((GtkCTreeNode *)(((GList *)(_pnode_))->prev))
#define GTK_CTREE_TREE(_ctree_, _glist_) \
((GtkCellTree *) &(((GtkCTreeRow *)((_glist_)->data))->cell[(_ctree_)->tree_col]))
@@ -71,14 +74,15 @@ typedef enum
typedef struct _GtkCTree GtkCTree;
typedef struct _GtkCTreeClass GtkCTreeClass;
typedef struct _GtkCTreeRow GtkCTreeRow;
+typedef struct _GtkCTreeNode GtkCTreeNode;
-typedef void (*GtkCTreeFunc) (GtkCTree *ctree,
- GList *node,
- gpointer data);
+typedef void (*GtkCTreeFunc) (GtkCTree *ctree,
+ GtkCTreeNode *node,
+ gpointer data);
typedef gint (*GtkCTreeCompareFunc) (GtkCTree *ctree,
- const GList *node1,
- const GList *node2);
+ const GtkCTreeNode *node1,
+ const GtkCTreeNode *node2);
struct _GtkCTree
{
@@ -93,8 +97,8 @@ struct _GtkCTree
gint tree_indent;
gint tree_column;
gint drag_row;
- GList *drag_source;
- GList *drag_target;
+ GtkCTreeNode *drag_source;
+ GtkCTreeNode *drag_target;
gint insert_pos;
GtkCTreeCompareFunc node_compare;
@@ -110,20 +114,20 @@ struct _GtkCTreeClass
{
GtkCListClass parent_class;
- void (*tree_select_row) (GtkCTree *ctree,
- GList *row,
- gint column);
- void (*tree_unselect_row) (GtkCTree *ctree,
- GList *row,
- gint column);
- void (*tree_expand) (GtkCTree *ctree,
- GList *node);
- void (*tree_collapse) (GtkCTree *ctree,
- GList *node);
- void (*tree_move) (GtkCTree *ctree,
- GList *node,
- GList *new_parent,
- GList *new_sibling);
+ void (*tree_select_row) (GtkCTree *ctree,
+ GtkCTreeNode *row,
+ gint column);
+ void (*tree_unselect_row) (GtkCTree *ctree,
+ GtkCTreeNode *row,
+ gint column);
+ void (*tree_expand) (GtkCTree *ctree,
+ GtkCTreeNode *node);
+ void (*tree_collapse) (GtkCTree *ctree,
+ GtkCTreeNode *node);
+ void (*tree_move) (GtkCTree *ctree,
+ GtkCTreeNode *node,
+ GtkCTreeNode *new_parent,
+ GtkCTreeNode *new_sibling);
void (*change_focus_row_expansion) (GtkCTree *ctree,
GtkCTreeExpansionType action);
};
@@ -132,9 +136,9 @@ struct _GtkCTreeRow
{
GtkCListRow row;
- GList *parent;
- GList *sibling;
- GList *children;
+ GtkCTreeNode *parent;
+ GtkCTreeNode *sibling;
+ GtkCTreeNode *children;
GdkPixmap *pixmap_closed;
GdkBitmap *mask_closed;
@@ -147,6 +151,10 @@ struct _GtkCTreeRow
guint expanded : 1;
};
+struct _GtkCTreeNode {
+ GList list;
+};
+
/***********************************************************
* Creation, insertion, deletion *
@@ -162,9 +170,9 @@ GtkWidget * gtk_ctree_new_with_titles (gint columns,
gchar *titles[]);
GtkWidget * gtk_ctree_new (gint columns,
gint tree_column);
-GList * gtk_ctree_insert (GtkCTree *ctree,
- GList *parent,
- GList *sibling,
+GtkCTreeNode * gtk_ctree_insert (GtkCTree *ctree,
+ GtkCTreeNode *parent,
+ GtkCTreeNode *sibling,
gchar *text[],
guint8 spacing,
GdkPixmap *pixmap_closed,
@@ -174,7 +182,7 @@ GList * gtk_ctree_insert (GtkCTree *ctree,
gboolean is_leaf,
gboolean expanded);
void gtk_ctree_remove (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
/***********************************************************
* Generic recursive functions, querying / finding tree *
@@ -182,37 +190,37 @@ void gtk_ctree_remove (GtkCTree *ctree,
***********************************************************/
void gtk_ctree_post_recursive (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
GtkCTreeFunc func,
gpointer data);
void gtk_ctree_post_recursive_to_depth (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint depth,
GtkCTreeFunc func,
gpointer data);
void gtk_ctree_pre_recursive (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
GtkCTreeFunc func,
gpointer data);
void gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint depth,
GtkCTreeFunc func,
gpointer data);
gboolean gtk_ctree_is_visible (GtkCTree *ctree,
- GList *node);
-GList * gtk_ctree_last (GtkCTree *ctree,
- GList *node);
-GList * gtk_ctree_find_glist_ptr (GtkCTree *ctree,
+ GtkCTreeNode *node);
+GtkCTreeNode * gtk_ctree_last (GtkCTree *ctree,
+ GtkCTreeNode *node);
+GtkCTreeNode * gtk_ctree_find_glist_ptr (GtkCTree *ctree,
GtkCTreeRow *ctree_row);
gint gtk_ctree_find (GtkCTree *ctree,
- GList *node,
- GList *child);
+ GtkCTreeNode *node,
+ GtkCTreeNode *child);
gboolean gtk_ctree_is_ancestor (GtkCTree *ctree,
- GList *node,
- GList *child);
-GList * gtk_ctree_find_by_row_data (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
+ GtkCTreeNode *child);
+GtkCTreeNode * gtk_ctree_find_by_row_data (GtkCTree *ctree,
+ GtkCTreeNode *node,
gpointer data);
gboolean gtk_ctree_is_hot_spot (GtkCTree *ctree,
gint x,
@@ -223,37 +231,37 @@ gboolean gtk_ctree_is_hot_spot (GtkCTree *ctree,
***********************************************************/
void gtk_ctree_move (GtkCTree *ctree,
- GList *node,
- GList *new_parent,
- GList *new_sibling);
+ GtkCTreeNode *node,
+ GtkCTreeNode *new_parent,
+ GtkCTreeNode *new_sibling);
void gtk_ctree_expand (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_expand_recursive (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_expand_to_depth (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint depth);
void gtk_ctree_collapse (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_collapse_recursive (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_collapse_to_depth (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint depth);
void gtk_ctree_toggle_expansion (GtkCTree *ctree,
- GList *node);
-void gtk_ctree_toggle_expansion_recursive (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
+void gtk_ctree_toggle_expansion_recursive (GtkCTree *ctree,
+ GtkCTreeNode *node);
void gtk_ctree_select (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_select_recursive (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_unselect (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_unselect_recursive (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_real_select_recursive (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint state);
/***********************************************************
@@ -261,23 +269,23 @@ void gtk_ctree_real_select_recursive (GtkCTree *ctree,
***********************************************************/
void gtk_ctree_set_text (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint column,
gchar *text);
void gtk_ctree_set_pixmap (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint column,
GdkPixmap *pixmap,
GdkBitmap *mask);
void gtk_ctree_set_pixtext (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint column,
gchar *text,
guint8 spacing,
GdkPixmap *pixmap,
GdkBitmap *mask);
void gtk_ctree_set_node_info (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gchar *text,
guint8 spacing,
GdkPixmap *pixmap_closed,
@@ -287,31 +295,31 @@ void gtk_ctree_set_node_info (GtkCTree *ctree,
gboolean is_leaf,
gboolean expanded);
void gtk_ctree_set_shift (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint column,
gint vertical,
gint horizontal);
GtkCellType gtk_ctree_get_cell_type (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint column);
gint gtk_ctree_get_text (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint column,
gchar **text);
gint gtk_ctree_get_pixmap (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint column,
GdkPixmap **pixmap,
GdkBitmap **mask);
gint gtk_ctree_get_pixtext (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint column,
gchar **text,
guint8 *spacing,
GdkPixmap **pixmap,
GdkBitmap **mask);
gint gtk_ctree_get_node_info (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gchar **text,
guint8 *spacing,
GdkPixmap **pixmap_closed,
@@ -321,22 +329,22 @@ gint gtk_ctree_get_node_info (GtkCTree *ctree,
gboolean *is_leaf,
gboolean *expanded);
void gtk_ctree_set_foreground (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
GdkColor *color);
void gtk_ctree_set_background (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
GdkColor *color);
void gtk_ctree_set_row_data (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gpointer data);
void gtk_ctree_set_row_data_full (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gpointer data,
GtkDestroyNotify destroy);
gpointer gtk_ctree_get_row_data (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_moveto (GtkCTree *ctree,
- GList *node,
+ GtkCTreeNode *node,
gint column,
gfloat row_align,
gfloat col_align);
@@ -363,9 +371,9 @@ void gtk_ctree_set_auto_sort (GtkCTree *ctree,
void gtk_ctree_set_compare_func (GtkCTree *ctree,
GtkCTreeCompareFunc cmp_func);
void gtk_ctree_sort (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
void gtk_ctree_sort_recursive (GtkCTree *ctree,
- GList *node);
+ GtkCTreeNode *node);
#ifdef __cplusplus
}