Replaced with GTK_TREE_SELECTION_OLD to prevent conflict with
2000-10-05 Jonathan Blandford <jrb@redhat.com> * gtk/gtktree.h (GTK_TREE_SELECTION): Replaced with GTK_TREE_SELECTION_OLD to prevent conflict with gtktreeselection.c * gtk/testgtk.c: s/GTK_TREE_SELECTION/GTK_TREE_SELECTION_OLD/ * gtk/gtktreeselection.[ch]: Replaced "node_selected"/"node_unselected" signal with "selection_changed" signal.
This commit is contained in:
parent
98c0e90970
commit
6b6e6763b7
11
ChangeLog
11
ChangeLog
@ -1,4 +1,13 @@
|
|||||||
2000-10-04 <jrb@redhat.com>
|
2000-10-05 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtktree.h (GTK_TREE_SELECTION): Replaced with
|
||||||
|
GTK_TREE_SELECTION_OLD to prevent conflict with gtktreeselection.c
|
||||||
|
* gtk/testgtk.c: s/GTK_TREE_SELECTION/GTK_TREE_SELECTION_OLD/
|
||||||
|
* gtk/gtktreeselection.[ch]: Replaced
|
||||||
|
"node_selected"/"node_unselected" signal with "selection_changed"
|
||||||
|
signal.
|
||||||
|
|
||||||
|
2000-10-04 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
||||||
tree widget.
|
tree widget.
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
2000-10-04 <jrb@redhat.com>
|
2000-10-05 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtktree.h (GTK_TREE_SELECTION): Replaced with
|
||||||
|
GTK_TREE_SELECTION_OLD to prevent conflict with gtktreeselection.c
|
||||||
|
* gtk/testgtk.c: s/GTK_TREE_SELECTION/GTK_TREE_SELECTION_OLD/
|
||||||
|
* gtk/gtktreeselection.[ch]: Replaced
|
||||||
|
"node_selected"/"node_unselected" signal with "selection_changed"
|
||||||
|
signal.
|
||||||
|
|
||||||
|
2000-10-04 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
||||||
tree widget.
|
tree widget.
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
2000-10-04 <jrb@redhat.com>
|
2000-10-05 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtktree.h (GTK_TREE_SELECTION): Replaced with
|
||||||
|
GTK_TREE_SELECTION_OLD to prevent conflict with gtktreeselection.c
|
||||||
|
* gtk/testgtk.c: s/GTK_TREE_SELECTION/GTK_TREE_SELECTION_OLD/
|
||||||
|
* gtk/gtktreeselection.[ch]: Replaced
|
||||||
|
"node_selected"/"node_unselected" signal with "selection_changed"
|
||||||
|
signal.
|
||||||
|
|
||||||
|
2000-10-04 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
||||||
tree widget.
|
tree widget.
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
2000-10-04 <jrb@redhat.com>
|
2000-10-05 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtktree.h (GTK_TREE_SELECTION): Replaced with
|
||||||
|
GTK_TREE_SELECTION_OLD to prevent conflict with gtktreeselection.c
|
||||||
|
* gtk/testgtk.c: s/GTK_TREE_SELECTION/GTK_TREE_SELECTION_OLD/
|
||||||
|
* gtk/gtktreeselection.[ch]: Replaced
|
||||||
|
"node_selected"/"node_unselected" signal with "selection_changed"
|
||||||
|
signal.
|
||||||
|
|
||||||
|
2000-10-04 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
||||||
tree widget.
|
tree widget.
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
2000-10-04 <jrb@redhat.com>
|
2000-10-05 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtktree.h (GTK_TREE_SELECTION): Replaced with
|
||||||
|
GTK_TREE_SELECTION_OLD to prevent conflict with gtktreeselection.c
|
||||||
|
* gtk/testgtk.c: s/GTK_TREE_SELECTION/GTK_TREE_SELECTION_OLD/
|
||||||
|
* gtk/gtktreeselection.[ch]: Replaced
|
||||||
|
"node_selected"/"node_unselected" signal with "selection_changed"
|
||||||
|
signal.
|
||||||
|
|
||||||
|
2000-10-04 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
||||||
tree widget.
|
tree widget.
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
2000-10-04 <jrb@redhat.com>
|
2000-10-05 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtktree.h (GTK_TREE_SELECTION): Replaced with
|
||||||
|
GTK_TREE_SELECTION_OLD to prevent conflict with gtktreeselection.c
|
||||||
|
* gtk/testgtk.c: s/GTK_TREE_SELECTION/GTK_TREE_SELECTION_OLD/
|
||||||
|
* gtk/gtktreeselection.[ch]: Replaced
|
||||||
|
"node_selected"/"node_unselected" signal with "selection_changed"
|
||||||
|
signal.
|
||||||
|
|
||||||
|
2000-10-04 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
||||||
tree widget.
|
tree widget.
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
2000-10-04 <jrb@redhat.com>
|
2000-10-05 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtktree.h (GTK_TREE_SELECTION): Replaced with
|
||||||
|
GTK_TREE_SELECTION_OLD to prevent conflict with gtktreeselection.c
|
||||||
|
* gtk/testgtk.c: s/GTK_TREE_SELECTION/GTK_TREE_SELECTION_OLD/
|
||||||
|
* gtk/gtktreeselection.[ch]: Replaced
|
||||||
|
"node_selected"/"node_unselected" signal with "selection_changed"
|
||||||
|
signal.
|
||||||
|
|
||||||
|
2000-10-04 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
* gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new
|
||||||
tree widget.
|
tree widget.
|
||||||
|
@ -74,6 +74,11 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
|
|||||||
gtkcontainer.h \
|
gtkcontainer.h \
|
||||||
gtkctree.h \
|
gtkctree.h \
|
||||||
gtkcurve.h \
|
gtkcurve.h \
|
||||||
|
gtkcellrenderer.h \
|
||||||
|
gtkcellrenderertext.h \
|
||||||
|
gtkcellrenderertextpixbuf.h \
|
||||||
|
gtkcellrenderertoggle.h \
|
||||||
|
gtkcellrendererpixbuf.h \
|
||||||
gtkdata.h \
|
gtkdata.h \
|
||||||
gtkdebug.h \
|
gtkdebug.h \
|
||||||
gtkdialog.h \
|
gtkdialog.h \
|
||||||
@ -110,6 +115,7 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
|
|||||||
gtklayout.h \
|
gtklayout.h \
|
||||||
gtklist.h \
|
gtklist.h \
|
||||||
gtklistitem.h \
|
gtklistitem.h \
|
||||||
|
gtkliststore.h \
|
||||||
gtkmain.h \
|
gtkmain.h \
|
||||||
gtkmenu.h \
|
gtkmenu.h \
|
||||||
gtkmenubar.h \
|
gtkmenubar.h \
|
||||||
@ -117,6 +123,7 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
|
|||||||
gtkmenuitem.h \
|
gtkmenuitem.h \
|
||||||
gtkmenushell.h \
|
gtkmenushell.h \
|
||||||
gtkmisc.h \
|
gtkmisc.h \
|
||||||
|
gtkmodelsimple.h \
|
||||||
gtknotebook.h \
|
gtknotebook.h \
|
||||||
gtkobject.h \
|
gtkobject.h \
|
||||||
gtkoptionmenu.h \
|
gtkoptionmenu.h \
|
||||||
@ -162,6 +169,11 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
|
|||||||
gtktooltips.h \
|
gtktooltips.h \
|
||||||
gtktree.h \
|
gtktree.h \
|
||||||
gtktreeitem.h \
|
gtktreeitem.h \
|
||||||
|
gtktreemodel.h \
|
||||||
|
gtktreeselection.h \
|
||||||
|
gtktreestore.h \
|
||||||
|
gtktreeview.h \
|
||||||
|
gtktreeviewcolumn.h \
|
||||||
gtktypeutils.h \
|
gtktypeutils.h \
|
||||||
gtkvbbox.h \
|
gtkvbbox.h \
|
||||||
gtkvbox.h \
|
gtkvbox.h \
|
||||||
@ -189,6 +201,7 @@ gtk_semipublic_h_sources = @STRIP_BEGIN@ \
|
|||||||
|
|
||||||
# GTK+ header files that don't get installed
|
# GTK+ header files that don't get installed
|
||||||
gtk_private_h_sources = @STRIP_BEGIN@ \
|
gtk_private_h_sources = @STRIP_BEGIN@ \
|
||||||
|
gtkrbtree.h \
|
||||||
gtktextbtree.h \
|
gtktextbtree.h \
|
||||||
gtktextchildprivate.h \
|
gtktextchildprivate.h \
|
||||||
gtktextsegment.h \
|
gtktextsegment.h \
|
||||||
@ -196,8 +209,12 @@ gtk_private_h_sources = @STRIP_BEGIN@ \
|
|||||||
gtktextiterprivate.h \
|
gtktextiterprivate.h \
|
||||||
gtktextmarkprivate.h \
|
gtktextmarkprivate.h \
|
||||||
gtktexttagprivate.h \
|
gtktexttagprivate.h \
|
||||||
|
gtktreeprivate.h \
|
||||||
@STRIP_END@
|
@STRIP_END@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# GTK+ C sources to build the library from
|
# GTK+ C sources to build the library from
|
||||||
gtk_c_sources = @STRIP_BEGIN@ \
|
gtk_c_sources = @STRIP_BEGIN@ \
|
||||||
gtkaccelgroup.c \
|
gtkaccelgroup.c \
|
||||||
@ -213,6 +230,11 @@ gtk_c_sources = @STRIP_BEGIN@ \
|
|||||||
gtkbox.c \
|
gtkbox.c \
|
||||||
gtkbutton.c \
|
gtkbutton.c \
|
||||||
gtkcalendar.c \
|
gtkcalendar.c \
|
||||||
|
gtkcellrenderer.c \
|
||||||
|
gtkcellrenderertext.c \
|
||||||
|
gtkcellrenderertextpixbuf.c \
|
||||||
|
gtkcellrenderertoggle.c \
|
||||||
|
gtkcellrendererpixbuf.c \
|
||||||
gtkcheckbutton.c \
|
gtkcheckbutton.c \
|
||||||
gtkcheckmenuitem.c \
|
gtkcheckmenuitem.c \
|
||||||
gtkclipboard.c \
|
gtkclipboard.c \
|
||||||
@ -260,6 +282,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
|
|||||||
gtklayout.c \
|
gtklayout.c \
|
||||||
gtklist.c \
|
gtklist.c \
|
||||||
gtklistitem.c \
|
gtklistitem.c \
|
||||||
|
gtkliststore.c \
|
||||||
gtkmain.c \
|
gtkmain.c \
|
||||||
gtkmarshal.c \
|
gtkmarshal.c \
|
||||||
gtkmenu.c \
|
gtkmenu.c \
|
||||||
@ -268,6 +291,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
|
|||||||
gtkmenuitem.c \
|
gtkmenuitem.c \
|
||||||
gtkmenushell.c \
|
gtkmenushell.c \
|
||||||
gtkmisc.c \
|
gtkmisc.c \
|
||||||
|
gtkmodelsimple.c \
|
||||||
gtknotebook.c \
|
gtknotebook.c \
|
||||||
gtkobject.c \
|
gtkobject.c \
|
||||||
gtkoptionmenu.c \
|
gtkoptionmenu.c \
|
||||||
@ -281,6 +305,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
|
|||||||
gtkradiobutton.c \
|
gtkradiobutton.c \
|
||||||
gtkradiomenuitem.c \
|
gtkradiomenuitem.c \
|
||||||
gtkrange.c \
|
gtkrange.c \
|
||||||
|
gtkrbtree.c \
|
||||||
gtkrc.c \
|
gtkrc.c \
|
||||||
gtkruler.c \
|
gtkruler.c \
|
||||||
gtkscale.c \
|
gtkscale.c \
|
||||||
@ -318,6 +343,12 @@ gtk_c_sources = @STRIP_BEGIN@ \
|
|||||||
gtktooltips.c \
|
gtktooltips.c \
|
||||||
gtktree.c \
|
gtktree.c \
|
||||||
gtktreeitem.c \
|
gtktreeitem.c \
|
||||||
|
gtktreedatalist.c \
|
||||||
|
gtktreemodel.c \
|
||||||
|
gtktreeselection.c \
|
||||||
|
gtktreestore.c \
|
||||||
|
gtktreeview.c \
|
||||||
|
gtktreeviewcolumn.c \
|
||||||
gtktypeutils.c \
|
gtktypeutils.c \
|
||||||
gtkvbbox.c \
|
gtkvbbox.c \
|
||||||
gtkvbox.c \
|
gtkvbox.c \
|
||||||
@ -530,7 +561,7 @@ uninstall-local:
|
|||||||
#
|
#
|
||||||
# test programs, not to be installed
|
# test programs, not to be installed
|
||||||
#
|
#
|
||||||
noinst_PROGRAMS = testgtk testcalendar testinput testselection testrgb testdnd testtext simple testtextbuffer # testthreads
|
noinst_PROGRAMS = testgtk testcalendar testinput testselection testrgb testdnd testtext simple treestoretest testtextbuffer # testthreads
|
||||||
DEPS = @gtktargetlib@ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-1.3.la $(top_builddir)/gdk/@gdktargetlib@
|
DEPS = @gtktargetlib@ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-1.3.la $(top_builddir)/gdk/@gdktargetlib@
|
||||||
LDADDS = @STRIP_BEGIN@ \
|
LDADDS = @STRIP_BEGIN@ \
|
||||||
@gtktargetlib@ \
|
@gtktargetlib@ \
|
||||||
@ -550,6 +581,7 @@ testinput_DEPENDENCIES = $(DEPS)
|
|||||||
testselection_DEPENDENCIES = $(DEPS)
|
testselection_DEPENDENCIES = $(DEPS)
|
||||||
testrgb_DEPENDENCIES = $(DEPS)
|
testrgb_DEPENDENCIES = $(DEPS)
|
||||||
testtext_DEPENDENCIES = $(DEPS)
|
testtext_DEPENDENCIES = $(DEPS)
|
||||||
|
treestoretest_DEPENDENCIES = $(DEPS)
|
||||||
testdnd_DEPENDENCIES = $(DEPS)
|
testdnd_DEPENDENCIES = $(DEPS)
|
||||||
simple_DEPENDENCIES = $(DEPS)
|
simple_DEPENDENCIES = $(DEPS)
|
||||||
#testthreads_DEPENDENCIES = $(DEPS)
|
#testthreads_DEPENDENCIES = $(DEPS)
|
||||||
@ -558,6 +590,7 @@ testgtk_LDADD = $(LDADDS)
|
|||||||
testinput_LDADD = $(LDADDS)
|
testinput_LDADD = $(LDADDS)
|
||||||
testselection_LDADD = $(LDADDS)
|
testselection_LDADD = $(LDADDS)
|
||||||
testtext_LDADD = $(LDADDS)
|
testtext_LDADD = $(LDADDS)
|
||||||
|
treestoretest_LDADD = $(LDADDS)
|
||||||
testtextbuffer_LDADD = $(LDADDS)
|
testtextbuffer_LDADD = $(LDADDS)
|
||||||
testrgb_LDADD = $(LDADDS)
|
testrgb_LDADD = $(LDADDS)
|
||||||
testdnd_LDADD = $(LDADDS)
|
testdnd_LDADD = $(LDADDS)
|
||||||
|
13
gtk/gtk.h
13
gtk/gtk.h
@ -42,6 +42,11 @@
|
|||||||
#include <gtk/gtkbbox.h>
|
#include <gtk/gtkbbox.h>
|
||||||
#include <gtk/gtkbutton.h>
|
#include <gtk/gtkbutton.h>
|
||||||
#include <gtk/gtkcalendar.h>
|
#include <gtk/gtkcalendar.h>
|
||||||
|
#include <gtk/gtkcellrenderer.h>
|
||||||
|
#include <gtk/gtkcellrenderertext.h>
|
||||||
|
#include <gtk/gtkcellrenderertextpixbuf.h>
|
||||||
|
#include <gtk/gtkcellrenderertoggle.h>
|
||||||
|
#include <gtk/gtkcellrendererpixbuf.h>
|
||||||
#include <gtk/gtkcheckbutton.h>
|
#include <gtk/gtkcheckbutton.h>
|
||||||
#include <gtk/gtkcheckmenuitem.h>
|
#include <gtk/gtkcheckmenuitem.h>
|
||||||
#include <gtk/gtkclipboard.h>
|
#include <gtk/gtkclipboard.h>
|
||||||
@ -87,6 +92,7 @@
|
|||||||
#include <gtk/gtklayout.h>
|
#include <gtk/gtklayout.h>
|
||||||
#include <gtk/gtklist.h>
|
#include <gtk/gtklist.h>
|
||||||
#include <gtk/gtklistitem.h>
|
#include <gtk/gtklistitem.h>
|
||||||
|
#include <gtk/gtkliststore.h>
|
||||||
#include <gtk/gtkmain.h>
|
#include <gtk/gtkmain.h>
|
||||||
#include <gtk/gtkmenu.h>
|
#include <gtk/gtkmenu.h>
|
||||||
#include <gtk/gtkmenubar.h>
|
#include <gtk/gtkmenubar.h>
|
||||||
@ -94,6 +100,7 @@
|
|||||||
#include <gtk/gtkmenuitem.h>
|
#include <gtk/gtkmenuitem.h>
|
||||||
#include <gtk/gtkmenushell.h>
|
#include <gtk/gtkmenushell.h>
|
||||||
#include <gtk/gtkmisc.h>
|
#include <gtk/gtkmisc.h>
|
||||||
|
#include <gtk/gtkmodelsimple.h>
|
||||||
#include <gtk/gtknotebook.h>
|
#include <gtk/gtknotebook.h>
|
||||||
#include <gtk/gtkobject.h>
|
#include <gtk/gtkobject.h>
|
||||||
#include <gtk/gtkoptionmenu.h>
|
#include <gtk/gtkoptionmenu.h>
|
||||||
@ -132,6 +139,12 @@
|
|||||||
#include <gtk/gtktooltips.h>
|
#include <gtk/gtktooltips.h>
|
||||||
#include <gtk/gtktree.h>
|
#include <gtk/gtktree.h>
|
||||||
#include <gtk/gtktreeitem.h>
|
#include <gtk/gtktreeitem.h>
|
||||||
|
#include <gtk/gtktreedatalist.h>
|
||||||
|
#include <gtk/gtktreemodel.h>
|
||||||
|
#include <gtk/gtktreeselection.h>
|
||||||
|
#include <gtk/gtktreestore.h>
|
||||||
|
#include <gtk/gtktreeview.h>
|
||||||
|
#include <gtk/gtktreeviewcolumn.h>
|
||||||
#include <gtk/gtktypeutils.h>
|
#include <gtk/gtktypeutils.h>
|
||||||
#include <gtk/gtkvbox.h>
|
#include <gtk/gtkvbox.h>
|
||||||
#include <gtk/gtkvbbox.h>
|
#include <gtk/gtkvbbox.h>
|
||||||
|
@ -49,7 +49,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define GTK_IS_ROOT_TREE(obj) ((GtkObject*) GTK_TREE(obj)->root_tree == (GtkObject*)obj)
|
#define GTK_IS_ROOT_TREE(obj) ((GtkObject*) GTK_TREE(obj)->root_tree == (GtkObject*)obj)
|
||||||
#define GTK_TREE_ROOT_TREE(obj) (GTK_TREE(obj)->root_tree ? GTK_TREE(obj)->root_tree : GTK_TREE(obj))
|
#define GTK_TREE_ROOT_TREE(obj) (GTK_TREE(obj)->root_tree ? GTK_TREE(obj)->root_tree : GTK_TREE(obj))
|
||||||
#define GTK_TREE_SELECTION(obj) (GTK_TREE_ROOT_TREE(obj)->selection)
|
#define GTK_TREE_SELECTION_OLD(obj) (GTK_TREE_ROOT_TREE(obj)->selection)
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -24,47 +24,21 @@
|
|||||||
|
|
||||||
static void gtk_tree_selection_init (GtkTreeSelection *selection);
|
static void gtk_tree_selection_init (GtkTreeSelection *selection);
|
||||||
static void gtk_tree_selection_class_init (GtkTreeSelectionClass *class);
|
static void gtk_tree_selection_class_init (GtkTreeSelectionClass *class);
|
||||||
|
static gint gtk_tree_selection_real_select_all (GtkTreeSelection *selection);
|
||||||
|
static gint gtk_tree_selection_real_unselect_all (GtkTreeSelection *selection);
|
||||||
|
static gint gtk_tree_selection_real_select_node (GtkTreeSelection *selection,
|
||||||
|
GtkRBTree *tree,
|
||||||
|
GtkRBNode *node,
|
||||||
|
gboolean select);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ROW_SELECTED,
|
SELECTION_CHANGED,
|
||||||
ROW_UNSELECTED,
|
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
};
|
};
|
||||||
|
|
||||||
static GtkObjectClass *parent_class = NULL;
|
static GtkObjectClass *parent_class = NULL;
|
||||||
static guint tree_selection_signals[LAST_SIGNAL] = { 0 };
|
static guint tree_selection_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_tree_selection_real_select_node (GtkTreeSelection *selection, GtkRBTree *tree, GtkRBNode *node, gboolean select)
|
|
||||||
{
|
|
||||||
gboolean selected = FALSE;
|
|
||||||
GtkTreePath *path = NULL;
|
|
||||||
|
|
||||||
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) != select)
|
|
||||||
{
|
|
||||||
path = _gtk_tree_view_find_path (selection->tree_view, tree, node);
|
|
||||||
if (selection->user_func)
|
|
||||||
{
|
|
||||||
if ((*selection->user_func) (selection, selection->tree_view->priv->model, path, selection->user_data))
|
|
||||||
selected = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
selected = TRUE;
|
|
||||||
}
|
|
||||||
if (selected == TRUE)
|
|
||||||
{
|
|
||||||
GtkTreeNode tree_node;
|
|
||||||
tree_node = gtk_tree_model_get_node (selection->tree_view->priv->model, path);
|
|
||||||
|
|
||||||
node->flags ^= GTK_RBNODE_IS_SELECTED;
|
|
||||||
if (select)
|
|
||||||
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[ROW_SELECTED], selection->tree_view->priv->model, tree_node);
|
|
||||||
else
|
|
||||||
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[ROW_UNSELECTED], selection->tree_view->priv->model, tree_node);
|
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (selection->tree_view));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GtkType
|
GtkType
|
||||||
gtk_tree_selection_get_type (void)
|
gtk_tree_selection_get_type (void)
|
||||||
{
|
{
|
||||||
@ -99,40 +73,23 @@ gtk_tree_selection_class_init (GtkTreeSelectionClass *class)
|
|||||||
object_class = (GtkObjectClass*) class;
|
object_class = (GtkObjectClass*) class;
|
||||||
parent_class = g_type_class_peek_parent (class);
|
parent_class = g_type_class_peek_parent (class);
|
||||||
|
|
||||||
tree_selection_signals[ROW_SELECTED] =
|
tree_selection_signals[SELECTION_CHANGED] =
|
||||||
gtk_signal_new ("row_selected",
|
gtk_signal_new ("selection_changed",
|
||||||
GTK_RUN_FIRST,
|
GTK_RUN_FIRST,
|
||||||
GTK_CLASS_TYPE (object_class),
|
GTK_CLASS_TYPE (object_class),
|
||||||
GTK_SIGNAL_OFFSET (GtkTreeSelectionClass, row_selected),
|
GTK_SIGNAL_OFFSET (GtkTreeSelectionClass, selection_changed),
|
||||||
gtk_marshal_NONE__POINTER_POINTER,
|
gtk_marshal_NONE__NONE,
|
||||||
GTK_TYPE_NONE, 2,
|
GTK_TYPE_NONE, 0);
|
||||||
GTK_TYPE_POINTER,
|
|
||||||
GTK_TYPE_POINTER);
|
|
||||||
|
|
||||||
tree_selection_signals[ROW_UNSELECTED] =
|
|
||||||
gtk_signal_new ("row_unselected",
|
|
||||||
GTK_RUN_FIRST,
|
|
||||||
GTK_CLASS_TYPE (object_class),
|
|
||||||
GTK_SIGNAL_OFFSET (GtkTreeSelectionClass, row_unselected),
|
|
||||||
gtk_marshal_NONE__POINTER_POINTER,
|
|
||||||
GTK_TYPE_NONE, 2,
|
|
||||||
GTK_TYPE_POINTER,
|
|
||||||
GTK_TYPE_POINTER);
|
|
||||||
|
|
||||||
gtk_object_class_add_signals (object_class, tree_selection_signals, LAST_SIGNAL);
|
gtk_object_class_add_signals (object_class, tree_selection_signals, LAST_SIGNAL);
|
||||||
|
|
||||||
class->row_selected = NULL;
|
class->selection_changed = NULL;
|
||||||
class->row_unselected = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_tree_selection_init (GtkTreeSelection *selection)
|
gtk_tree_selection_init (GtkTreeSelection *selection)
|
||||||
{
|
{
|
||||||
selection->type = GTK_TREE_SELECTION_MULTI;
|
selection->type = GTK_TREE_SELECTION_SINGLE;
|
||||||
selection->user_func = NULL;
|
|
||||||
selection->user_data = NULL;
|
|
||||||
selection->user_func = NULL;
|
|
||||||
selection->tree_view = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkObject *
|
GtkObject *
|
||||||
@ -459,29 +416,48 @@ select_all_helper (GtkRBTree *tree,
|
|||||||
data);
|
data);
|
||||||
if (!GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
|
if (!GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
|
||||||
{
|
{
|
||||||
gtk_tree_selection_real_select_node (tuple->selection, tree, node, TRUE);
|
tuple->dirty = gtk_tree_selection_real_select_node (tuple->selection, tree, node, TRUE) || tuple->dirty;
|
||||||
tuple->dirty = TRUE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
gtk_tree_selection_select_all (GtkTreeSelection *selection)
|
/* We have a real_{un,}select_all function that doesn't emit the signal, so we
|
||||||
|
* can use it in other places without fear of the signal being emitted.
|
||||||
|
*/
|
||||||
|
static gint
|
||||||
|
gtk_tree_selection_real_select_all (GtkTreeSelection *selection)
|
||||||
{
|
{
|
||||||
struct _TempTuple *tuple;
|
struct _TempTuple *tuple;
|
||||||
|
if (selection->tree_view->priv->tree == NULL)
|
||||||
g_return_if_fail (selection != NULL);
|
return FALSE;
|
||||||
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
|
|
||||||
g_return_if_fail (selection->tree_view != NULL);
|
|
||||||
g_return_if_fail (selection->tree_view->priv->tree != NULL);
|
|
||||||
|
|
||||||
if (selection->type == GTK_TREE_SELECTION_SINGLE)
|
if (selection->type == GTK_TREE_SELECTION_SINGLE)
|
||||||
{
|
{
|
||||||
|
GtkRBTree *tree;
|
||||||
GtkRBNode *node;
|
GtkRBNode *node;
|
||||||
node = selection->tree_view->priv->tree->root;
|
gint dirty;
|
||||||
|
|
||||||
|
dirty = gtk_tree_selection_real_unselect_all (selection);
|
||||||
|
|
||||||
|
tree = selection->tree_view->priv->tree;
|
||||||
|
node = tree->root;
|
||||||
|
do
|
||||||
|
{
|
||||||
while (node->right != selection->tree_view->priv->tree->nil)
|
while (node->right != selection->tree_view->priv->tree->nil)
|
||||||
node = node->right;
|
node = node->right;
|
||||||
return;
|
|
||||||
|
if (node->children)
|
||||||
|
{
|
||||||
|
tree = node->children;
|
||||||
|
node = tree->root;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
} while (TRUE);
|
||||||
|
|
||||||
|
dirty |= gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
|
||||||
|
|
||||||
|
return dirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
tuple = g_new (struct _TempTuple, 1);
|
tuple = g_new (struct _TempTuple, 1);
|
||||||
@ -494,8 +470,24 @@ gtk_tree_selection_select_all (GtkTreeSelection *selection)
|
|||||||
select_all_helper,
|
select_all_helper,
|
||||||
tuple);
|
tuple);
|
||||||
if (tuple->dirty)
|
if (tuple->dirty)
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (selection->tree_view));
|
{
|
||||||
g_free (tuple);
|
g_free (tuple);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
g_free (tuple);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_tree_selection_select_all (GtkTreeSelection *selection)
|
||||||
|
{
|
||||||
|
g_return_if_fail (selection != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
|
||||||
|
g_return_if_fail (selection->tree_view != NULL);
|
||||||
|
g_return_if_fail (selection->tree_view->priv->tree != NULL);
|
||||||
|
|
||||||
|
if (gtk_tree_selection_real_select_all (selection))
|
||||||
|
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -513,36 +505,32 @@ unselect_all_helper (GtkRBTree *tree,
|
|||||||
data);
|
data);
|
||||||
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
|
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
|
||||||
{
|
{
|
||||||
gtk_tree_selection_real_select_node (tuple->selection, tree, node, FALSE);
|
tuple->dirty = gtk_tree_selection_real_select_node (tuple->selection, tree, node, FALSE) || tuple->dirty;
|
||||||
tuple->dirty = TRUE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static gint
|
||||||
gtk_tree_selection_unselect_all (GtkTreeSelection *selection)
|
gtk_tree_selection_real_unselect_all (GtkTreeSelection *selection)
|
||||||
{
|
{
|
||||||
struct _TempTuple *tuple;
|
struct _TempTuple *tuple;
|
||||||
|
|
||||||
g_return_if_fail (selection != NULL);
|
|
||||||
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
|
|
||||||
g_return_if_fail (selection->tree_view != NULL);
|
|
||||||
if (selection->tree_view->priv->tree == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (selection->type == GTK_TREE_SELECTION_SINGLE)
|
if (selection->type == GTK_TREE_SELECTION_SINGLE)
|
||||||
{
|
{
|
||||||
GtkRBTree *tree = NULL;
|
GtkRBTree *tree = NULL;
|
||||||
GtkRBNode *node = NULL;
|
GtkRBNode *node = NULL;
|
||||||
if (selection->tree_view->priv->anchor == NULL)
|
if (selection->tree_view->priv->anchor == NULL)
|
||||||
return;
|
return FALSE;
|
||||||
|
|
||||||
_gtk_tree_view_find_node (selection->tree_view,
|
_gtk_tree_view_find_node (selection->tree_view,
|
||||||
selection->tree_view->priv->anchor,
|
selection->tree_view->priv->anchor,
|
||||||
&tree,
|
&tree,
|
||||||
&node);
|
&node);
|
||||||
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
|
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
|
||||||
|
{
|
||||||
gtk_tree_selection_real_select_node (selection, tree, node, FALSE);
|
gtk_tree_selection_real_select_node (selection, tree, node, FALSE);
|
||||||
return;
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
tuple = g_new (struct _TempTuple, 1);
|
tuple = g_new (struct _TempTuple, 1);
|
||||||
@ -554,22 +542,38 @@ gtk_tree_selection_unselect_all (GtkTreeSelection *selection)
|
|||||||
G_PRE_ORDER,
|
G_PRE_ORDER,
|
||||||
unselect_all_helper,
|
unselect_all_helper,
|
||||||
tuple);
|
tuple);
|
||||||
|
|
||||||
if (tuple->dirty)
|
if (tuple->dirty)
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (selection->tree_view));
|
{
|
||||||
g_free (tuple);
|
g_free (tuple);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
g_free (tuple);
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gtk_tree_selection_select_range (GtkTreeSelection *selection,
|
gtk_tree_selection_unselect_all (GtkTreeSelection *selection)
|
||||||
|
{
|
||||||
|
g_return_if_fail (selection != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
|
||||||
|
g_return_if_fail (selection->tree_view != NULL);
|
||||||
|
g_return_if_fail (selection->tree_view->priv->tree != NULL);
|
||||||
|
if (selection->tree_view->priv->tree == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (gtk_tree_selection_real_unselect_all (selection))
|
||||||
|
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gint
|
||||||
|
gtk_tree_selection_real_select_range (GtkTreeSelection *selection,
|
||||||
GtkTreePath *start_path,
|
GtkTreePath *start_path,
|
||||||
GtkTreePath *end_path)
|
GtkTreePath *end_path)
|
||||||
{
|
{
|
||||||
GtkRBNode *start_node, *end_node;
|
GtkRBNode *start_node, *end_node;
|
||||||
GtkRBTree *start_tree, *end_tree;
|
GtkRBTree *start_tree, *end_tree;
|
||||||
|
gboolean dirty = FALSE;
|
||||||
g_return_if_fail (selection != NULL);
|
|
||||||
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
|
|
||||||
g_return_if_fail (selection->tree_view != NULL);
|
|
||||||
|
|
||||||
switch (gtk_tree_path_compare (start_path, end_path))
|
switch (gtk_tree_path_compare (start_path, end_path))
|
||||||
{
|
{
|
||||||
@ -603,15 +607,18 @@ gtk_tree_selection_select_range (GtkTreeSelection *selection,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_return_if_fail (start_node != NULL);
|
g_return_val_if_fail (start_node != NULL, FALSE);
|
||||||
g_return_if_fail (end_node != NULL);
|
g_return_val_if_fail (end_node != NULL, FALSE);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
gtk_tree_selection_real_select_node (selection, start_tree, start_node, TRUE);
|
if (GTK_RBNODE_FLAG_SET (start_node, GTK_RBNODE_IS_SELECTED))
|
||||||
|
{
|
||||||
|
dirty = gtk_tree_selection_real_select_node (selection, start_tree, start_node, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
if (start_node == end_node)
|
if (start_node == end_node)
|
||||||
return;
|
break;
|
||||||
|
|
||||||
if (start_node->children)
|
if (start_node->children)
|
||||||
{
|
{
|
||||||
@ -637,19 +644,32 @@ gtk_tree_selection_select_range (GtkTreeSelection *selection,
|
|||||||
if (start_tree == NULL)
|
if (start_tree == NULL)
|
||||||
/* we've run out of tree */
|
/* we've run out of tree */
|
||||||
/* This means we never found end node!! */
|
/* This means we never found end node!! */
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (!done);
|
while (!done);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (TRUE);
|
while (TRUE);
|
||||||
|
|
||||||
|
return dirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_tree_selection_select_range (GtkTreeSelection *selection,
|
||||||
|
GtkTreePath *start_path,
|
||||||
|
GtkTreePath *end_path)
|
||||||
|
{
|
||||||
|
g_return_if_fail (selection != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
|
||||||
|
g_return_if_fail (selection->tree_view != NULL);
|
||||||
|
|
||||||
/* Called internally by gtktree_view. It handles actually selecting
|
if (gtk_tree_selection_real_select_range (selection, start_path, end_path))
|
||||||
* the tree. This should almost certainly ever be called by
|
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
|
||||||
* anywhere else */
|
}
|
||||||
|
/* Called internally by gtktreeview.c It handles actually selecting the tree.
|
||||||
|
* This should almost certainly ever be called by anywhere else.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
_gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
|
_gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
|
||||||
GtkRBNode *node,
|
GtkRBNode *node,
|
||||||
@ -658,11 +678,12 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
|
|||||||
GdkModifierType state)
|
GdkModifierType state)
|
||||||
{
|
{
|
||||||
gint flags;
|
gint flags;
|
||||||
|
gint dirty = FALSE;
|
||||||
|
|
||||||
if (((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) && (selection->tree_view->priv->anchor == NULL))
|
if (((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) && (selection->tree_view->priv->anchor == NULL))
|
||||||
{
|
{
|
||||||
selection->tree_view->priv->anchor = gtk_tree_path_copy (path);
|
selection->tree_view->priv->anchor = gtk_tree_path_copy (path);
|
||||||
gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
|
dirty = gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
|
||||||
}
|
}
|
||||||
else if ((state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) == (GDK_SHIFT_MASK|GDK_CONTROL_MASK))
|
else if ((state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) == (GDK_SHIFT_MASK|GDK_CONTROL_MASK))
|
||||||
{
|
{
|
||||||
@ -674,29 +695,69 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
|
|||||||
{
|
{
|
||||||
flags = node->flags;
|
flags = node->flags;
|
||||||
if (selection->type == GTK_TREE_SELECTION_SINGLE)
|
if (selection->type == GTK_TREE_SELECTION_SINGLE)
|
||||||
gtk_tree_selection_unselect_all (selection);
|
dirty = gtk_tree_selection_real_unselect_all (selection);
|
||||||
|
|
||||||
if (selection->tree_view->priv->anchor)
|
if (selection->tree_view->priv->anchor)
|
||||||
gtk_tree_path_free (selection->tree_view->priv->anchor);
|
gtk_tree_path_free (selection->tree_view->priv->anchor);
|
||||||
selection->tree_view->priv->anchor = gtk_tree_path_copy (path);
|
selection->tree_view->priv->anchor = gtk_tree_path_copy (path);
|
||||||
|
|
||||||
if ((flags & GTK_RBNODE_IS_SELECTED) == GTK_RBNODE_IS_SELECTED)
|
if ((flags & GTK_RBNODE_IS_SELECTED) == GTK_RBNODE_IS_SELECTED)
|
||||||
gtk_tree_selection_real_select_node (selection, tree, node, FALSE);
|
dirty |= gtk_tree_selection_real_select_node (selection, tree, node, FALSE);
|
||||||
else
|
else
|
||||||
gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
|
dirty |= gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
|
||||||
}
|
}
|
||||||
else if ((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
|
else if ((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
|
||||||
{
|
{
|
||||||
gtk_tree_selection_unselect_all (selection);
|
dirty = gtk_tree_selection_real_unselect_all (selection);
|
||||||
gtk_tree_selection_select_range (selection,
|
dirty |= gtk_tree_selection_real_select_range (selection,
|
||||||
selection->tree_view->priv->anchor,
|
selection->tree_view->priv->anchor,
|
||||||
path);
|
path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gtk_tree_selection_unselect_all (selection);
|
dirty = gtk_tree_selection_real_unselect_all (selection);
|
||||||
if (selection->tree_view->priv->anchor)
|
if (selection->tree_view->priv->anchor)
|
||||||
gtk_tree_path_free (selection->tree_view->priv->anchor);
|
gtk_tree_path_free (selection->tree_view->priv->anchor);
|
||||||
selection->tree_view->priv->anchor = gtk_tree_path_copy (path);
|
selection->tree_view->priv->anchor = gtk_tree_path_copy (path);
|
||||||
gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
|
dirty |= gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dirty)
|
||||||
|
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gint
|
||||||
|
gtk_tree_selection_real_select_node (GtkTreeSelection *selection,
|
||||||
|
GtkRBTree *tree,
|
||||||
|
GtkRBNode *node,
|
||||||
|
gboolean select)
|
||||||
|
{
|
||||||
|
gboolean selected = FALSE;
|
||||||
|
GtkTreePath *path = NULL;
|
||||||
|
|
||||||
|
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) != select)
|
||||||
|
{
|
||||||
|
path = _gtk_tree_view_find_path (selection->tree_view, tree, node);
|
||||||
|
if (selection->user_func)
|
||||||
|
{
|
||||||
|
if ((*selection->user_func) (selection, selection->tree_view->priv->model, path, selection->user_data))
|
||||||
|
selected = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
selected = TRUE;
|
||||||
|
}
|
||||||
|
if (selected == TRUE)
|
||||||
|
{
|
||||||
|
GtkTreeNode tree_node;
|
||||||
|
tree_node = gtk_tree_model_get_node (selection->tree_view->priv->model, path);
|
||||||
|
|
||||||
|
node->flags ^= GTK_RBNODE_IS_SELECTED;
|
||||||
|
|
||||||
|
/* FIXME: just draw the one node*/
|
||||||
|
gtk_widget_queue_draw (GTK_WIDGET (selection->tree_view));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,9 +28,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#warning "Die GTK_TREE_SELECTION, DIE"
|
|
||||||
#undef GTK_TREE_SELECTION
|
|
||||||
|
|
||||||
#define GTK_TYPE_TREE_SELECTION (gtk_tree_selection_get_type ())
|
#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(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_TREE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_SELECTION, GtkTreeSelectionClass))
|
||||||
@ -65,12 +62,7 @@ struct _GtkTreeSelectionClass
|
|||||||
{
|
{
|
||||||
GtkObjectClass parent_class;
|
GtkObjectClass parent_class;
|
||||||
|
|
||||||
void (* row_selected) (GtkTreeView *tree_view,
|
void (* selection_changed) (GtkTreeView *tree_view);
|
||||||
GtkTreeModel *tree_model,
|
|
||||||
GtkTreeNode *node);
|
|
||||||
void (* row_unselected) (GtkTreeView *tree_view,
|
|
||||||
GtkTreeModel *tree_model,
|
|
||||||
GtkTreeNode *node);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -2114,16 +2114,20 @@ gtk_tree_view_node_deleted (GtkTreeModel *model,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* next, update the selection */
|
/* next, update the selection */
|
||||||
#if 0
|
|
||||||
if (tree_view->priv->anchor)
|
if (tree_view->priv->anchor)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
gint *select_indices = gtk_tree_path_get_indices (tree_view->priv->anchor);
|
gint depth = gtk_tree_path_get_indices (path);
|
||||||
|
gint *indices = gtk_tree_path_get_depth (path);
|
||||||
gint select_depth = gtk_tree_path_get_depth (tree_view->priv->anchor);
|
gint select_depth = gtk_tree_path_get_depth (tree_view->priv->anchor);
|
||||||
|
gint *select_indices = gtk_tree_path_get_indices (tree_view->priv->anchor);
|
||||||
|
|
||||||
if (gtk_tree_path_compare (path, tree_view->priv->anchor) == 0)
|
if (gtk_tree_path_compare (path, tree_view->priv->anchor) == 0)
|
||||||
{
|
{
|
||||||
|
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) &&
|
||||||
|
tree_view->priv->selection)
|
||||||
|
gtk_signal_emit_by_name (GTK_OBJECT (tree_view->priv->selection),
|
||||||
|
"selection_changed");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2144,7 +2148,6 @@ gtk_tree_view_node_deleted (GtkTreeModel *model,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for (list = tree_view->priv->column; list; list = list->next)
|
for (list = tree_view->priv->column; list; list = list->next)
|
||||||
if (((GtkTreeViewColumn *)list->data)->visible &&
|
if (((GtkTreeViewColumn *)list->data)->visible &&
|
||||||
|
@ -1094,7 +1094,7 @@ cb_add_new_item(GtkWidget* w, GtkTree* tree)
|
|||||||
|
|
||||||
tree_buttons = gtk_object_get_user_data(GTK_OBJECT(tree));
|
tree_buttons = gtk_object_get_user_data(GTK_OBJECT(tree));
|
||||||
|
|
||||||
selected_list = GTK_TREE_SELECTION(tree);
|
selected_list = GTK_TREE_SELECTION_OLD(tree);
|
||||||
|
|
||||||
if(selected_list == NULL)
|
if(selected_list == NULL)
|
||||||
{
|
{
|
||||||
@ -1133,7 +1133,7 @@ cb_remove_item(GtkWidget*w, GtkTree* tree)
|
|||||||
GList* selected_list;
|
GList* selected_list;
|
||||||
GList* clear_list;
|
GList* clear_list;
|
||||||
|
|
||||||
selected_list = GTK_TREE_SELECTION(tree);
|
selected_list = GTK_TREE_SELECTION_OLD(tree);
|
||||||
|
|
||||||
clear_list = NULL;
|
clear_list = NULL;
|
||||||
|
|
||||||
@ -1155,7 +1155,7 @@ cb_remove_subtree(GtkWidget*w, GtkTree* tree)
|
|||||||
GList* selected_list;
|
GList* selected_list;
|
||||||
GtkTreeItem *item;
|
GtkTreeItem *item;
|
||||||
|
|
||||||
selected_list = GTK_TREE_SELECTION(tree);
|
selected_list = GTK_TREE_SELECTION_OLD(tree);
|
||||||
|
|
||||||
if (selected_list)
|
if (selected_list)
|
||||||
{
|
{
|
||||||
@ -1174,7 +1174,7 @@ cb_tree_changed(GtkTree* tree)
|
|||||||
|
|
||||||
tree_buttons = gtk_object_get_user_data(GTK_OBJECT(tree));
|
tree_buttons = gtk_object_get_user_data(GTK_OBJECT(tree));
|
||||||
|
|
||||||
selected_list = GTK_TREE_SELECTION(tree);
|
selected_list = GTK_TREE_SELECTION_OLD(tree);
|
||||||
nb_selected = g_list_length(selected_list);
|
nb_selected = g_list_length(selected_list);
|
||||||
|
|
||||||
if(nb_selected == 0)
|
if(nb_selected == 0)
|
||||||
|
@ -1094,7 +1094,7 @@ cb_add_new_item(GtkWidget* w, GtkTree* tree)
|
|||||||
|
|
||||||
tree_buttons = gtk_object_get_user_data(GTK_OBJECT(tree));
|
tree_buttons = gtk_object_get_user_data(GTK_OBJECT(tree));
|
||||||
|
|
||||||
selected_list = GTK_TREE_SELECTION(tree);
|
selected_list = GTK_TREE_SELECTION_OLD(tree);
|
||||||
|
|
||||||
if(selected_list == NULL)
|
if(selected_list == NULL)
|
||||||
{
|
{
|
||||||
@ -1133,7 +1133,7 @@ cb_remove_item(GtkWidget*w, GtkTree* tree)
|
|||||||
GList* selected_list;
|
GList* selected_list;
|
||||||
GList* clear_list;
|
GList* clear_list;
|
||||||
|
|
||||||
selected_list = GTK_TREE_SELECTION(tree);
|
selected_list = GTK_TREE_SELECTION_OLD(tree);
|
||||||
|
|
||||||
clear_list = NULL;
|
clear_list = NULL;
|
||||||
|
|
||||||
@ -1155,7 +1155,7 @@ cb_remove_subtree(GtkWidget*w, GtkTree* tree)
|
|||||||
GList* selected_list;
|
GList* selected_list;
|
||||||
GtkTreeItem *item;
|
GtkTreeItem *item;
|
||||||
|
|
||||||
selected_list = GTK_TREE_SELECTION(tree);
|
selected_list = GTK_TREE_SELECTION_OLD(tree);
|
||||||
|
|
||||||
if (selected_list)
|
if (selected_list)
|
||||||
{
|
{
|
||||||
@ -1174,7 +1174,7 @@ cb_tree_changed(GtkTree* tree)
|
|||||||
|
|
||||||
tree_buttons = gtk_object_get_user_data(GTK_OBJECT(tree));
|
tree_buttons = gtk_object_get_user_data(GTK_OBJECT(tree));
|
||||||
|
|
||||||
selected_list = GTK_TREE_SELECTION(tree);
|
selected_list = GTK_TREE_SELECTION_OLD(tree);
|
||||||
nb_selected = g_list_length(selected_list);
|
nb_selected = g_list_length(selected_list);
|
||||||
|
|
||||||
if(nb_selected == 0)
|
if(nb_selected == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user