summaryrefslogtreecommitdiff
path: root/gtk/gtktreeview.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-05-05 07:27:04 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-05-11 20:33:23 -0400
commit3697c57e561660075256b0790e710f5d8f4a386d (patch)
tree0b7afe4730d6ffb5cbed0c7e71ade3703c2ba90e /gtk/gtktreeview.c
parent52b1a347d8f86551669946244a3521caff332eb3 (diff)
downloadgtk+-3697c57e561660075256b0790e710f5d8f4a386d.tar.gz
treeview: Derive from GtkWidget
Drop the GtkContainer vfuncs.
Diffstat (limited to 'gtk/gtktreeview.c')
-rw-r--r--gtk/gtktreeview.c55
1 files changed, 10 insertions, 45 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index a0049976ce..370acc9aea 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -26,7 +26,6 @@
#include "gtkbutton.h"
#include "gtkcelllayout.h"
#include "gtkcellrenderer.h"
-#include "gtkcontainer.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcsscolorvalueprivate.h"
#include "gtkcssstylepropertyprivate.h"
@@ -322,7 +321,7 @@ typedef struct _GtkTreeViewClass GtkTreeViewClass;
struct _GtkTreeViewClass
{
- GtkContainerClass parent_class;
+ GtkWidgetClass parent_class;
void (* row_activated) (GtkTreeView *tree_view,
GtkTreePath *path,
@@ -364,7 +363,7 @@ struct _GtkTreeViewClass
struct _GtkTreeView
{
- GtkContainer parent;
+ GtkWidget parent;
GtkTreeModel *model;
@@ -684,12 +683,8 @@ static gboolean gtk_tree_view_grab_focus (GtkWidget *widget);
static void gtk_tree_view_css_changed (GtkWidget *widget,
GtkCssStyleChange *change);
-/* container signals */
-static void gtk_tree_view_remove (GtkContainer *container,
- GtkWidget *widget);
-static void gtk_tree_view_forall (GtkContainer *container,
- GtkCallback callback,
- gpointer callback_data);
+static void gtk_tree_view_remove (GtkTreeView *tree_view,
+ GtkWidget *widget);
/* Source side drag signals */
static void gtk_tree_view_dnd_finished_cb (GdkDrag *drag,
@@ -999,10 +994,10 @@ static GParamSpec *tree_view_props [LAST_PROP] = { NULL };
/* GType Methods
*/
-G_DEFINE_TYPE_WITH_CODE (GtkTreeView, gtk_tree_view, GTK_TYPE_CONTAINER,
- G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
- gtk_tree_view_buildable_init)
- G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE,
+G_DEFINE_TYPE_WITH_CODE (GtkTreeView, gtk_tree_view, GTK_TYPE_WIDGET,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+ gtk_tree_view_buildable_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE,
gtk_tree_view_scrollable_init))
static void
@@ -1010,7 +1005,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
{
GObjectClass *o_class = G_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
/* GObject signals */
o_class->set_property = gtk_tree_view_set_property;
@@ -1030,10 +1024,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
widget_class->grab_focus = gtk_tree_view_grab_focus;
widget_class->css_changed = gtk_tree_view_css_changed;
- /* GtkContainer signals */
- container_class->remove = gtk_tree_view_remove;
- container_class->forall = gtk_tree_view_forall;
-
class->move_cursor = gtk_tree_view_real_move_cursor;
class->select_all = gtk_tree_view_real_select_all;
class->unselect_all = gtk_tree_view_real_unselect_all;
@@ -7452,16 +7442,10 @@ gtk_tree_view_drag_data_received (GObject *source,
set_dest_row (drop, NULL, NULL, FALSE, FALSE, FALSE);
}
-
-/* GtkContainer Methods
- */
-
-
static void
-gtk_tree_view_remove (GtkContainer *container,
- GtkWidget *widget)
+gtk_tree_view_remove (GtkTreeView *tree_view,
+ GtkWidget *widget)
{
- GtkTreeView *tree_view = GTK_TREE_VIEW (container);
GtkTreeViewChild *child = NULL;
GList *tmp_list;
@@ -7501,25 +7485,6 @@ gtk_tree_view_remove (GtkContainer *container,
}
}
-static void
-gtk_tree_view_forall (GtkContainer *container,
- GtkCallback callback,
- gpointer callback_data)
-{
- GtkTreeView *tree_view = GTK_TREE_VIEW (container);
- GtkTreeViewChild *child = NULL;
- GList *tmp_list;
-
- tmp_list = tree_view->children;
- while (tmp_list)
- {
- child = tmp_list->data;
- tmp_list = tmp_list->next;
-
- (* callback) (child->widget, callback_data);
- }
-}
-
/* Returns TRUE is any of the columns contains a cell that can-focus.
* If this is not the case, a column-spanning focus rectangle will be
* drawn.