diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 76b24c08b4..e395d51da8 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -264,8 +264,8 @@ typedef enum { /* Translate from bin_window coordinates to rbtree (tree coordinates) and * vice versa. */ -#define TREE_WINDOW_Y_TO_RBTREE_Y(tree_view,y) ((y) + tree_view->priv->dy) -#define RBTREE_Y_TO_TREE_WINDOW_Y(tree_view,y) ((y) - tree_view->priv->dy) +#define TREE_WINDOW_Y_TO_RBTREE_Y(tree_view,y) ((y) + tree_view->dy) +#define RBTREE_Y_TO_TREE_WINDOW_Y(tree_view,y) ((y) - tree_view->dy) /* Vertical separator width. Must be an even number. */ #define _TREE_VIEW_VERTICAL_SEPARATOR 2 @@ -307,14 +307,6 @@ struct _TreeViewDragInfo }; typedef struct _GtkTreeViewClass GtkTreeViewClass; -typedef struct _GtkTreeViewPrivate GtkTreeViewPrivate; - -struct _GtkTreeView -{ - GtkContainer parent; - - GtkTreeViewPrivate *priv; -}; struct _GtkTreeViewClass { @@ -356,8 +348,10 @@ struct _GtkTreeViewClass }; -struct _GtkTreeViewPrivate +struct _GtkTreeView { + GtkContainer parent; + GtkTreeModel *model; /* tree information */ @@ -993,7 +987,6 @@ static GParamSpec *tree_view_props [LAST_PROP] = { NULL }; */ G_DEFINE_TYPE_WITH_CODE (GtkTreeView, gtk_tree_view, GTK_TYPE_CONTAINER, - G_ADD_PRIVATE (GtkTreeView) G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_tree_view_buildable_init) G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, @@ -1733,61 +1726,58 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) static void gtk_tree_view_init (GtkTreeView *tree_view) { - GtkTreeViewPrivate *priv; GtkCssNode *widget_node; GtkGesture *gesture; GtkEventController *controller; - priv = tree_view->priv = gtk_tree_view_get_instance_private (tree_view); - gtk_widget_set_can_focus (GTK_WIDGET (tree_view), TRUE); gtk_widget_set_overflow (GTK_WIDGET (tree_view), GTK_OVERFLOW_HIDDEN); - priv->show_expanders = TRUE; - priv->draw_keyfocus = TRUE; - priv->headers_visible = TRUE; - priv->activate_on_single_click = FALSE; + tree_view->show_expanders = TRUE; + tree_view->draw_keyfocus = TRUE; + tree_view->headers_visible = TRUE; + tree_view->activate_on_single_click = FALSE; /* We need some padding */ - priv->dy = 0; - priv->cursor_offset = 0; - priv->n_columns = 0; - priv->header_height = 1; - priv->x_drag = 0; - priv->drag_pos = -1; - priv->header_has_focus = FALSE; - priv->press_start_x = -1; - priv->press_start_y = -1; - priv->reorderable = FALSE; - priv->presize_handler_tick_cb = 0; - priv->scroll_sync_timer = 0; - priv->fixed_height = -1; - priv->fixed_height_mode = FALSE; - priv->fixed_height_check = 0; - priv->selection = _gtk_tree_selection_new_with_tree_view (tree_view); - priv->enable_search = TRUE; - priv->search_column = -1; - priv->search_position_func = gtk_tree_view_search_position_func; - priv->search_equal_func = gtk_tree_view_search_equal_func; - priv->search_custom_entry_set = FALSE; - priv->typeselect_flush_timeout = 0; - priv->width = 0; - priv->expander_size = -1; + tree_view->dy = 0; + tree_view->cursor_offset = 0; + tree_view->n_columns = 0; + tree_view->header_height = 1; + tree_view->x_drag = 0; + tree_view->drag_pos = -1; + tree_view->header_has_focus = FALSE; + tree_view->press_start_x = -1; + tree_view->press_start_y = -1; + tree_view->reorderable = FALSE; + tree_view->presize_handler_tick_cb = 0; + tree_view->scroll_sync_timer = 0; + tree_view->fixed_height = -1; + tree_view->fixed_height_mode = FALSE; + tree_view->fixed_height_check = 0; + tree_view->selection = _gtk_tree_selection_new_with_tree_view (tree_view); + tree_view->enable_search = TRUE; + tree_view->search_column = -1; + tree_view->search_position_func = gtk_tree_view_search_position_func; + tree_view->search_equal_func = gtk_tree_view_search_equal_func; + tree_view->search_custom_entry_set = FALSE; + tree_view->typeselect_flush_timeout = 0; + tree_view->width = 0; + tree_view->expander_size = -1; - priv->hover_selection = FALSE; - priv->hover_expand = FALSE; + tree_view->hover_selection = FALSE; + tree_view->hover_expand = FALSE; - priv->level_indentation = 0; + tree_view->level_indentation = 0; - priv->rubber_banding_enable = FALSE; + tree_view->rubber_banding_enable = FALSE; - priv->grid_lines = GTK_TREE_VIEW_GRID_LINES_NONE; - priv->tree_lines_enabled = FALSE; + tree_view->grid_lines = GTK_TREE_VIEW_GRID_LINES_NONE; + tree_view->tree_lines_enabled = FALSE; - priv->tooltip_column = -1; + tree_view->tooltip_column = -1; - priv->event_last_x = -10000; - priv->event_last_y = -10000; + tree_view->event_last_x = -10000; + tree_view->event_last_y = -10000; gtk_tree_view_do_set_vadjustment (tree_view, NULL); gtk_tree_view_do_set_hadjustment (tree_view, NULL); @@ -1796,19 +1786,19 @@ gtk_tree_view_init (GtkTreeView *tree_view) GTK_STYLE_CLASS_VIEW); widget_node = gtk_widget_get_css_node (GTK_WIDGET (tree_view)); - priv->header_node = gtk_css_node_new (); - gtk_css_node_set_name (priv->header_node, I_("header")); - gtk_css_node_set_parent (priv->header_node, widget_node); - gtk_css_node_set_state (priv->header_node, gtk_css_node_get_state (widget_node)); - g_object_unref (priv->header_node); + tree_view->header_node = gtk_css_node_new (); + gtk_css_node_set_name (tree_view->header_node, I_("header")); + gtk_css_node_set_parent (tree_view->header_node, widget_node); + gtk_css_node_set_state (tree_view->header_node, gtk_css_node_get_state (widget_node)); + g_object_unref (tree_view->header_node); - priv->click_gesture = gtk_gesture_click_new (); - gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->click_gesture), 0); - g_signal_connect (priv->click_gesture, "pressed", + tree_view->click_gesture = gtk_gesture_click_new (); + gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (tree_view->click_gesture), 0); + g_signal_connect (tree_view->click_gesture, "pressed", G_CALLBACK (gtk_tree_view_click_gesture_pressed), tree_view); - g_signal_connect (priv->click_gesture, "released", + g_signal_connect (tree_view->click_gesture, "released", G_CALLBACK (gtk_tree_view_click_gesture_released), tree_view); - gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (priv->click_gesture)); + gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (tree_view->click_gesture)); gesture = gtk_gesture_click_new (); g_signal_connect (gesture, "pressed", @@ -1817,25 +1807,25 @@ gtk_tree_view_init (GtkTreeView *tree_view) GTK_PHASE_CAPTURE); gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (gesture)); - priv->drag_gesture = gtk_gesture_drag_new (); - g_signal_connect (priv->drag_gesture, "drag-begin", + tree_view->drag_gesture = gtk_gesture_drag_new (); + g_signal_connect (tree_view->drag_gesture, "drag-begin", G_CALLBACK (gtk_tree_view_drag_gesture_begin), tree_view); - g_signal_connect (priv->drag_gesture, "drag-update", + g_signal_connect (tree_view->drag_gesture, "drag-update", G_CALLBACK (gtk_tree_view_drag_gesture_update), tree_view); - g_signal_connect (priv->drag_gesture, "drag-end", + g_signal_connect (tree_view->drag_gesture, "drag-end", G_CALLBACK (gtk_tree_view_drag_gesture_end), tree_view); - gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (priv->drag_gesture)); + gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (tree_view->drag_gesture)); - priv->column_drag_gesture = gtk_gesture_drag_new (); - g_signal_connect (priv->column_drag_gesture, "drag-begin", + tree_view->column_drag_gesture = gtk_gesture_drag_new (); + g_signal_connect (tree_view->column_drag_gesture, "drag-begin", G_CALLBACK (gtk_tree_view_column_drag_gesture_begin), tree_view); - g_signal_connect (priv->column_drag_gesture, "drag-update", + g_signal_connect (tree_view->column_drag_gesture, "drag-update", G_CALLBACK (gtk_tree_view_column_drag_gesture_update), tree_view); - g_signal_connect (priv->column_drag_gesture, "drag-end", + g_signal_connect (tree_view->column_drag_gesture, "drag-end", G_CALLBACK (gtk_tree_view_column_drag_gesture_end), tree_view); - gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->column_drag_gesture), + gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (tree_view->column_drag_gesture), GTK_PHASE_CAPTURE); - gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (priv->column_drag_gesture)); + gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (tree_view->column_drag_gesture)); controller = gtk_event_controller_motion_new (); g_signal_connect (controller, "enter", @@ -1883,17 +1873,17 @@ gtk_tree_view_set_property (GObject *object, gtk_tree_view_do_set_vadjustment (tree_view, g_value_get_object (value)); break; case PROP_HSCROLL_POLICY: - if (tree_view->priv->hscroll_policy != g_value_get_enum (value)) + if (tree_view->hscroll_policy != g_value_get_enum (value)) { - tree_view->priv->hscroll_policy = g_value_get_enum (value); + tree_view->hscroll_policy = g_value_get_enum (value); gtk_widget_queue_resize (GTK_WIDGET (tree_view)); g_object_notify_by_pspec (object, pspec); } break; case PROP_VSCROLL_POLICY: - if (tree_view->priv->vscroll_policy != g_value_get_enum (value)) + if (tree_view->vscroll_policy != g_value_get_enum (value)) { - tree_view->priv->vscroll_policy = g_value_get_enum (value); + tree_view->vscroll_policy = g_value_get_enum (value); gtk_widget_queue_resize (GTK_WIDGET (tree_view)); g_object_notify_by_pspec (object, pspec); } @@ -1920,16 +1910,16 @@ gtk_tree_view_set_property (GObject *object, gtk_tree_view_set_fixed_height_mode (tree_view, g_value_get_boolean (value)); break; case PROP_HOVER_SELECTION: - if (tree_view->priv->hover_selection != g_value_get_boolean (value)) + if (tree_view->hover_selection != g_value_get_boolean (value)) { - tree_view->priv->hover_selection = g_value_get_boolean (value); + tree_view->hover_selection = g_value_get_boolean (value); g_object_notify_by_pspec (object, pspec); } break; case PROP_HOVER_EXPAND: - if (tree_view->priv->hover_expand != g_value_get_boolean (value)) + if (tree_view->hover_expand != g_value_get_boolean (value)) { - tree_view->priv->hover_expand = g_value_get_boolean (value); + tree_view->hover_expand = g_value_get_boolean (value); g_object_notify_by_pspec (object, pspec); } break; @@ -1937,16 +1927,16 @@ gtk_tree_view_set_property (GObject *object, gtk_tree_view_set_show_expanders (tree_view, g_value_get_boolean (value)); break; case PROP_LEVEL_INDENTATION: - if (tree_view->priv->level_indentation != g_value_get_int (value)) + if (tree_view->level_indentation != g_value_get_int (value)) { - tree_view->priv->level_indentation = g_value_get_int (value); + tree_view->level_indentation = g_value_get_int (value); g_object_notify_by_pspec (object, pspec); } break; case PROP_RUBBER_BANDING: - if (tree_view->priv->rubber_banding_enable != g_value_get_boolean (value)) + if (tree_view->rubber_banding_enable != g_value_get_boolean (value)) { - tree_view->priv->rubber_banding_enable = g_value_get_boolean (value); + tree_view->rubber_banding_enable = g_value_get_boolean (value); g_object_notify_by_pspec (object, pspec); } break; @@ -1981,19 +1971,19 @@ gtk_tree_view_get_property (GObject *object, switch (prop_id) { case PROP_MODEL: - g_value_set_object (value, tree_view->priv->model); + g_value_set_object (value, tree_view->model); break; case PROP_HADJUSTMENT: - g_value_set_object (value, tree_view->priv->hadjustment); + g_value_set_object (value, tree_view->hadjustment); break; case PROP_VADJUSTMENT: - g_value_set_object (value, tree_view->priv->vadjustment); + g_value_set_object (value, tree_view->vadjustment); break; case PROP_HSCROLL_POLICY: - g_value_set_enum (value, tree_view->priv->hscroll_policy); + g_value_set_enum (value, tree_view->hscroll_policy); break; case PROP_VSCROLL_POLICY: - g_value_set_enum (value, tree_view->priv->vscroll_policy); + g_value_set_enum (value, tree_view->vscroll_policy); break; case PROP_HEADERS_VISIBLE: g_value_set_boolean (value, gtk_tree_view_get_headers_visible (tree_view)); @@ -2002,46 +1992,46 @@ gtk_tree_view_get_property (GObject *object, g_value_set_boolean (value, gtk_tree_view_get_headers_clickable (tree_view)); break; case PROP_EXPANDER_COLUMN: - g_value_set_object (value, tree_view->priv->expander_column); + g_value_set_object (value, tree_view->expander_column); break; case PROP_REORDERABLE: - g_value_set_boolean (value, tree_view->priv->reorderable); + g_value_set_boolean (value, tree_view->reorderable); break; case PROP_ENABLE_SEARCH: - g_value_set_boolean (value, tree_view->priv->enable_search); + g_value_set_boolean (value, tree_view->enable_search); break; case PROP_SEARCH_COLUMN: - g_value_set_int (value, tree_view->priv->search_column); + g_value_set_int (value, tree_view->search_column); break; case PROP_FIXED_HEIGHT_MODE: - g_value_set_boolean (value, tree_view->priv->fixed_height_mode); + g_value_set_boolean (value, tree_view->fixed_height_mode); break; case PROP_HOVER_SELECTION: - g_value_set_boolean (value, tree_view->priv->hover_selection); + g_value_set_boolean (value, tree_view->hover_selection); break; case PROP_HOVER_EXPAND: - g_value_set_boolean (value, tree_view->priv->hover_expand); + g_value_set_boolean (value, tree_view->hover_expand); break; case PROP_SHOW_EXPANDERS: - g_value_set_boolean (value, tree_view->priv->show_expanders); + g_value_set_boolean (value, tree_view->show_expanders); break; case PROP_LEVEL_INDENTATION: - g_value_set_int (value, tree_view->priv->level_indentation); + g_value_set_int (value, tree_view->level_indentation); break; case PROP_RUBBER_BANDING: - g_value_set_boolean (value, tree_view->priv->rubber_banding_enable); + g_value_set_boolean (value, tree_view->rubber_banding_enable); break; case PROP_ENABLE_GRID_LINES: - g_value_set_enum (value, tree_view->priv->grid_lines); + g_value_set_enum (value, tree_view->grid_lines); break; case PROP_ENABLE_TREE_LINES: - g_value_set_boolean (value, tree_view->priv->tree_lines_enabled); + g_value_set_boolean (value, tree_view->tree_lines_enabled); break; case PROP_TOOLTIP_COLUMN: - g_value_set_int (value, tree_view->priv->tooltip_column); + g_value_set_int (value, tree_view->tooltip_column); break; case PROP_ACTIVATE_ON_SINGLE_CLICK: - g_value_set_boolean (value, tree_view->priv->activate_on_single_click); + g_value_set_boolean (value, tree_view->activate_on_single_click); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -2084,7 +2074,7 @@ gtk_tree_view_buildable_get_internal_child (GtkBuildable *buildable, const gchar *childname) { if (strcmp (childname, "selection") == 0) - return G_OBJECT (GTK_TREE_VIEW (buildable)->priv->selection); + return G_OBJECT (GTK_TREE_VIEW (buildable)->selection); return parent_buildable_iface->get_internal_child (buildable, builder, @@ -2097,38 +2087,37 @@ gtk_tree_view_buildable_get_internal_child (GtkBuildable *buildable, static void gtk_tree_view_free_rbtree (GtkTreeView *tree_view) { - gtk_tree_rbtree_free (tree_view->priv->tree); + gtk_tree_rbtree_free (tree_view->tree); - tree_view->priv->tree = NULL; - tree_view->priv->button_pressed_node = NULL; - tree_view->priv->button_pressed_tree = NULL; - tree_view->priv->prelight_tree = NULL; - tree_view->priv->prelight_node = NULL; + tree_view->tree = NULL; + tree_view->button_pressed_node = NULL; + tree_view->button_pressed_tree = NULL; + tree_view->prelight_tree = NULL; + tree_view->prelight_node = NULL; } static void gtk_tree_view_destroy_search_window (GtkTreeView *tree_view) { - gtk_widget_destroy (tree_view->priv->search_window); + gtk_widget_destroy (tree_view->search_window); - tree_view->priv->search_window = NULL; - tree_view->priv->search_entry = NULL; - tree_view->priv->search_entry_changed_id = 0; + tree_view->search_window = NULL; + tree_view->search_entry = NULL; + tree_view->search_entry_changed_id = 0; } static void gtk_tree_view_destroy (GtkWidget *widget) { GtkTreeView *tree_view = GTK_TREE_VIEW (widget); - GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); GList *list; gtk_tree_view_stop_editing (tree_view, TRUE); gtk_tree_view_stop_rubber_band (tree_view); - if (tree_view->priv->columns != NULL) + if (tree_view->columns != NULL) { - list = tree_view->priv->columns; + list = tree_view->columns; while (list) { GtkTreeViewColumn *column; @@ -2136,96 +2125,96 @@ gtk_tree_view_destroy (GtkWidget *widget) list = list->next; gtk_tree_view_remove_column (tree_view, column); } - tree_view->priv->columns = NULL; + tree_view->columns = NULL; } - if (tree_view->priv->tree != NULL) + if (tree_view->tree != NULL) { - gtk_tree_view_unref_and_check_selection_tree (tree_view, tree_view->priv->tree); + gtk_tree_view_unref_and_check_selection_tree (tree_view, tree_view->tree); gtk_tree_view_free_rbtree (tree_view); } - if (tree_view->priv->selection != NULL) + if (tree_view->selection != NULL) { - _gtk_tree_selection_set_tree_view (tree_view->priv->selection, NULL); - g_object_unref (tree_view->priv->selection); - tree_view->priv->selection = NULL; + _gtk_tree_selection_set_tree_view (tree_view->selection, NULL); + g_object_unref (tree_view->selection); + tree_view->selection = NULL; } - g_clear_pointer (&priv->scroll_to_path, gtk_tree_row_reference_free); - g_clear_pointer (&priv->drag_dest_row, gtk_tree_row_reference_free); - g_clear_pointer (&priv->top_row, gtk_tree_row_reference_free); + g_clear_pointer (&tree_view->scroll_to_path, gtk_tree_row_reference_free); + g_clear_pointer (&tree_view->drag_dest_row, gtk_tree_row_reference_free); + g_clear_pointer (&tree_view->top_row, gtk_tree_row_reference_free); - if (tree_view->priv->column_drop_func_data && - tree_view->priv->column_drop_func_data_destroy) + if (tree_view->column_drop_func_data && + tree_view->column_drop_func_data_destroy) { - tree_view->priv->column_drop_func_data_destroy (tree_view->priv->column_drop_func_data); - tree_view->priv->column_drop_func_data = NULL; + tree_view->column_drop_func_data_destroy (tree_view->column_drop_func_data); + tree_view->column_drop_func_data = NULL; } - gtk_tree_row_reference_free (tree_view->priv->anchor); - tree_view->priv->anchor = NULL; + gtk_tree_row_reference_free (tree_view->anchor); + tree_view->anchor = NULL; /* destroy interactive search dialog */ - if (tree_view->priv->search_window) + if (tree_view->search_window) { gtk_tree_view_destroy_search_window (tree_view); - if (tree_view->priv->typeselect_flush_timeout) + if (tree_view->typeselect_flush_timeout) { - g_source_remove (tree_view->priv->typeselect_flush_timeout); - tree_view->priv->typeselect_flush_timeout = 0; + g_source_remove (tree_view->typeselect_flush_timeout); + tree_view->typeselect_flush_timeout = 0; } } - if (tree_view->priv->search_custom_entry_set) + if (tree_view->search_custom_entry_set) { GtkEventController *controller; - g_signal_handlers_disconnect_by_func (tree_view->priv->search_entry, + g_signal_handlers_disconnect_by_func (tree_view->search_entry, G_CALLBACK (gtk_tree_view_search_init), tree_view); - if (GTK_IS_ENTRY (tree_view->priv->search_entry)) - controller = gtk_entry_get_key_controller (GTK_ENTRY (tree_view->priv->search_entry)); + if (GTK_IS_ENTRY (tree_view->search_entry)) + controller = gtk_entry_get_key_controller (GTK_ENTRY (tree_view->search_entry)); else - controller = gtk_search_entry_get_key_controller (GTK_SEARCH_ENTRY (tree_view->priv->search_entry)); + controller = gtk_search_entry_get_key_controller (GTK_SEARCH_ENTRY (tree_view->search_entry)); g_signal_handlers_disconnect_by_func (controller, G_CALLBACK (gtk_tree_view_search_key_pressed), tree_view); - g_object_unref (tree_view->priv->search_entry); + g_object_unref (tree_view->search_entry); - tree_view->priv->search_entry = NULL; - tree_view->priv->search_custom_entry_set = FALSE; + tree_view->search_entry = NULL; + tree_view->search_custom_entry_set = FALSE; } - if (tree_view->priv->search_destroy && tree_view->priv->search_user_data) + if (tree_view->search_destroy && tree_view->search_user_data) { - tree_view->priv->search_destroy (tree_view->priv->search_user_data); - tree_view->priv->search_user_data = NULL; + tree_view->search_destroy (tree_view->search_user_data); + tree_view->search_user_data = NULL; } - if (tree_view->priv->search_position_destroy && tree_view->priv->search_position_user_data) + if (tree_view->search_position_destroy && tree_view->search_position_user_data) { - tree_view->priv->search_position_destroy (tree_view->priv->search_position_user_data); - tree_view->priv->search_position_user_data = NULL; + tree_view->search_position_destroy (tree_view->search_position_user_data); + tree_view->search_position_user_data = NULL; } - if (tree_view->priv->row_separator_destroy && tree_view->priv->row_separator_data) + if (tree_view->row_separator_destroy && tree_view->row_separator_data) { - tree_view->priv->row_separator_destroy (tree_view->priv->row_separator_data); - tree_view->priv->row_separator_data = NULL; + tree_view->row_separator_destroy (tree_view->row_separator_data); + tree_view->row_separator_data = NULL; } gtk_tree_view_set_model (tree_view, NULL); - g_clear_object (&priv->hadjustment); - g_clear_object (&priv->vadjustment); - g_clear_object (&priv->horizontal_grid_line_texture); - g_clear_object (&priv->vertical_grid_line_texture); - g_clear_object (&priv->horizontal_tree_line_texture); - g_clear_object (&priv->vertical_tree_line_texture); + g_clear_object (&tree_view->hadjustment); + g_clear_object (&tree_view->vadjustment); + g_clear_object (&tree_view->horizontal_grid_line_texture); + g_clear_object (&tree_view->vertical_grid_line_texture); + g_clear_object (&tree_view->horizontal_tree_line_texture); + g_clear_object (&tree_view->vertical_tree_line_texture); GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->destroy (widget); } @@ -2238,12 +2227,12 @@ gtk_tree_view_map_buttons (GtkTreeView *tree_view) g_return_if_fail (gtk_widget_get_mapped (GTK_WIDGET (tree_view))); - if (tree_view->priv->headers_visible) + if (tree_view->headers_visible) { GtkTreeViewColumn *column; GtkWidget *button; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { column = list->data; button = gtk_tree_view_column_get_button (column); @@ -2266,7 +2255,7 @@ gtk_tree_view_map (GtkWidget *widget) GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->map (widget); - tmp_list = tree_view->priv->children; + tmp_list = tree_view->children; while (tmp_list) { GtkTreeViewChild *child = tmp_list->data; @@ -2290,12 +2279,12 @@ gtk_tree_view_realize (GtkWidget *widget) GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->realize (widget); - for (tmp_list = tree_view->priv->columns; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = tree_view->columns; tmp_list; tmp_list = tmp_list->next) _gtk_tree_view_column_realize_button (GTK_TREE_VIEW_COLUMN (tmp_list->data)); /* Need to call those here, since they create GCs */ - gtk_tree_view_set_grid_lines (tree_view, tree_view->priv->grid_lines); - gtk_tree_view_set_enable_tree_lines (tree_view, tree_view->priv->tree_lines_enabled); + gtk_tree_view_set_grid_lines (tree_view, tree_view->grid_lines); + gtk_tree_view_set_enable_tree_lines (tree_view, tree_view->tree_lines_enabled); install_presize_handler (tree_view); } @@ -2304,48 +2293,47 @@ static void gtk_tree_view_unrealize (GtkWidget *widget) { GtkTreeView *tree_view = GTK_TREE_VIEW (widget); - GtkTreeViewPrivate *priv = tree_view->priv; - if (priv->scroll_timeout != 0) + if (tree_view->scroll_timeout != 0) { - g_source_remove (priv->scroll_timeout); - priv->scroll_timeout = 0; + g_source_remove (tree_view->scroll_timeout); + tree_view->scroll_timeout = 0; } - if (priv->auto_expand_timeout != 0) + if (tree_view->auto_expand_timeout != 0) { - g_source_remove (priv->auto_expand_timeout); - priv->auto_expand_timeout = 0; + g_source_remove (tree_view->auto_expand_timeout); + tree_view->auto_expand_timeout = 0; } - if (priv->open_dest_timeout != 0) + if (tree_view->open_dest_timeout != 0) { - g_source_remove (priv->open_dest_timeout); - priv->open_dest_timeout = 0; + g_source_remove (tree_view->open_dest_timeout); + tree_view->open_dest_timeout = 0; } - if (priv->presize_handler_tick_cb != 0) + if (tree_view->presize_handler_tick_cb != 0) { - gtk_widget_remove_tick_callback (widget, priv->presize_handler_tick_cb); - priv->presize_handler_tick_cb = 0; + gtk_widget_remove_tick_callback (widget, tree_view->presize_handler_tick_cb); + tree_view->presize_handler_tick_cb = 0; } - if (priv->validate_rows_timer != 0) + if (tree_view->validate_rows_timer != 0) { - g_source_remove (priv->validate_rows_timer); - priv->validate_rows_timer = 0; + g_source_remove (tree_view->validate_rows_timer); + tree_view->validate_rows_timer = 0; } - if (priv->scroll_sync_timer != 0) + if (tree_view->scroll_sync_timer != 0) { - g_source_remove (priv->scroll_sync_timer); - priv->scroll_sync_timer = 0; + g_source_remove (tree_view->scroll_sync_timer); + tree_view->scroll_sync_timer = 0; } - if (priv->typeselect_flush_timeout) + if (tree_view->typeselect_flush_timeout) { - g_source_remove (priv->typeselect_flush_timeout); - priv->typeselect_flush_timeout = 0; + g_source_remove (tree_view->typeselect_flush_timeout); + tree_view->typeselect_flush_timeout = 0; } GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->unrealize (widget); @@ -2357,9 +2345,9 @@ gtk_tree_view_update_height (GtkTreeView *tree_view) { GList *list; - tree_view->priv->header_height = 0; + tree_view->header_height = 0; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { GtkRequisition requisition; GtkTreeViewColumn *column = list->data; @@ -2369,17 +2357,17 @@ gtk_tree_view_update_height (GtkTreeView *tree_view) continue; gtk_widget_get_preferred_size (button, &requisition, NULL); - tree_view->priv->header_height = MAX (tree_view->priv->header_height, requisition.height); + tree_view->header_height = MAX (tree_view->header_height, requisition.height); } } static gint gtk_tree_view_get_height (GtkTreeView *tree_view) { - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return 0; else - return tree_view->priv->tree->root->offset; + return tree_view->tree->root->offset; } static void @@ -2405,10 +2393,10 @@ gtk_tree_view_measure (GtkWidget *widget, do_validate_rows (tree_view, FALSE); /* keep this in sync with size_allocate below */ - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { column = list->data; - if (!gtk_tree_view_column_get_visible (column) || column == tree_view->priv->drag_column) + if (!gtk_tree_view_column_get_visible (column) || column == tree_view->drag_column) continue; width += _gtk_tree_view_column_request_width (column); @@ -2435,8 +2423,8 @@ gtk_tree_view_calculate_width_before_expander (GtkTreeView *tree_view) gboolean rtl; rtl = (_gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL); - for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns)); - list->data != tree_view->priv->expander_column; + for (list = (rtl ? g_list_last (tree_view->columns) : g_list_first (tree_view->columns)); + list->data != tree_view->expander_column; list = (rtl ? list->prev : list->next)) { GtkTreeViewColumn *column = list->data; @@ -2452,8 +2440,7 @@ static void gtk_tree_view_size_allocate_columns (GtkWidget *widget) { GtkTreeView *tree_view = GTK_TREE_VIEW (widget); - GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); - const int x_offset = - gtk_adjustment_get_value (priv->hadjustment); + const int x_offset = - gtk_adjustment_get_value (tree_view->hadjustment); GList *list, *first_column, *last_column; GtkTreeViewColumn *column; gint widget_width, width = 0; @@ -2462,7 +2449,7 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget) gint number_of_expand_columns = 0; gboolean rtl; - for (last_column = g_list_last (tree_view->priv->columns); + for (last_column = g_list_last (tree_view->columns); last_column && !(gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (last_column->data))); last_column = last_column->prev) @@ -2470,7 +2457,7 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget) if (last_column == NULL) return; - for (first_column = g_list_first (tree_view->priv->columns); + for (first_column = g_list_first (tree_view->columns); first_column && !(gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (first_column->data))); first_column = first_column->next) @@ -2482,11 +2469,11 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget) rtl = (_gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL); /* find out how many extra space and expandable columns we have */ - for (list = tree_view->priv->columns; list != last_column->next; list = list->next) + for (list = tree_view->columns; list != last_column->next; list = list->next) { column = (GtkTreeViewColumn *)list->data; - if (!gtk_tree_view_column_get_visible (column) || column == tree_view->priv->drag_column) + if (!gtk_tree_view_column_get_visible (column) || column == tree_view->drag_column) continue; full_requested_width += _gtk_tree_view_column_request_width (column); @@ -2515,7 +2502,7 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget) if (!gtk_tree_view_column_get_visible (column)) continue; - if (column == tree_view->priv->drag_column) + if (column == tree_view->drag_column) goto next; if (gtk_tree_view_column_get_expand (column)) @@ -2541,10 +2528,10 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget) if (rtl) _gtk_tree_view_column_allocate (column, widget_width - width - column_width + x_offset, - column_width, tree_view->priv->header_height); + column_width, tree_view->header_height); else _gtk_tree_view_column_allocate (column, width + x_offset, - column_width, tree_view->priv->header_height); + column_width, tree_view->header_height); next: width += column_width; } @@ -2553,7 +2540,7 @@ gtk_tree_view_size_allocate_columns (GtkWidget *widget) * which changes the total width of the tree view. This is of * importance for getting the horizontal scroll bar right. */ - tree_view->priv->width = width; + tree_view->width = width; } /* GtkWidget::size_allocate helper */ @@ -2565,13 +2552,13 @@ gtk_tree_view_size_allocate_drag_column (GtkWidget *widget) int baseline; GtkWidget *button; - if (tree_view->priv->drag_column == NULL) + if (tree_view->drag_column == NULL) return; - button = gtk_tree_view_column_get_button (tree_view->priv->drag_column); + button = gtk_tree_view_column_get_button (tree_view->drag_column); - allocation.x = tree_view->priv->drag_column_x; - allocation.y = tree_view->priv->drag_column_y; + allocation.x = tree_view->drag_column_x; + allocation.y = tree_view->drag_column_y; allocation.width = gtk_widget_get_allocated_width (button); allocation.height = gtk_widget_get_allocated_height (button); baseline = gtk_widget_get_allocated_baseline (button); @@ -2595,19 +2582,19 @@ gtk_tree_view_size_allocate (GtkWidget *widget, gtk_tree_view_size_allocate_columns (widget); gtk_tree_view_size_allocate_drag_column (widget); - page_size = gtk_adjustment_get_page_size (tree_view->priv->vadjustment); - gtk_adjustment_configure (tree_view->priv->hadjustment, - gtk_adjustment_get_value (tree_view->priv->hadjustment) + + page_size = gtk_adjustment_get_page_size (tree_view->vadjustment); + gtk_adjustment_configure (tree_view->hadjustment, + gtk_adjustment_get_value (tree_view->hadjustment) + (_gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL ? width - page_size : 0), 0, - MAX (width, tree_view->priv->width), + MAX (width, tree_view->width), width * 0.1, width * 0.9, width); page_size = height - gtk_tree_view_get_effective_header_height (tree_view); - gtk_adjustment_configure (tree_view->priv->vadjustment, - gtk_adjustment_get_value (tree_view->priv->vadjustment), + gtk_adjustment_configure (tree_view->vadjustment, + gtk_adjustment_get_value (tree_view->vadjustment), 0, MAX (page_size, gtk_tree_view_get_height (tree_view)), page_size * 0.1, @@ -2615,17 +2602,17 @@ gtk_tree_view_size_allocate (GtkWidget *widget, page_size); /* now the adjustments and window sizes are in sync, we can sync toprow/dy again */ - if (gtk_tree_row_reference_valid (tree_view->priv->top_row)) + if (gtk_tree_row_reference_valid (tree_view->top_row)) gtk_tree_view_top_row_to_dy (tree_view); else gtk_tree_view_dy_to_top_row (tree_view); if (gtk_widget_get_realized (widget)) { - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) invalidate_empty_focus (tree_view); - if (tree_view->priv->expander_column) + if (tree_view->expander_column) { /* Might seem awkward, but is the best heuristic I could come up * with. Only if the width of the columns before the expander @@ -2637,17 +2624,17 @@ gtk_tree_view_size_allocate (GtkWidget *widget, width_before_expander = gtk_tree_view_calculate_width_before_expander (tree_view); - if (tree_view->priv->prev_width_before_expander + if (tree_view->prev_width_before_expander != width_before_expander) update_prelight (tree_view, - tree_view->priv->event_last_x, - tree_view->priv->event_last_y); + tree_view->event_last_x, + tree_view->event_last_y); - tree_view->priv->prev_width_before_expander = width_before_expander; + tree_view->prev_width_before_expander = width_before_expander; } } - for (tmp_list = tree_view->priv->children; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = tree_view->children; tmp_list; tmp_list = tmp_list->next) { GtkTreeViewChild *child = tmp_list->data; GtkTreePath *path; @@ -2694,7 +2681,7 @@ gtk_tree_view_size_allocate (GtkWidget *widget, * preferring the top left corner (for RTL) * or top right corner (for LTR) */ - min_x = gtk_adjustment_get_value (tree_view->priv->hadjustment); + min_x = gtk_adjustment_get_value (tree_view->hadjustment); max_x = min_x + width - child_rect.width; min_y = 0; max_y = min_y + height - gtk_tree_view_get_effective_header_height (tree_view) - child_rect.height; @@ -2732,7 +2719,7 @@ grab_focus_and_unset_draw_keyfocus (GtkTreeView *tree_view) !_gtk_widget_get_shadowed (widget)) gtk_widget_grab_focus (widget); - tree_view->priv->draw_keyfocus = 0; + tree_view->draw_keyfocus = 0; } static inline gboolean @@ -2742,7 +2729,7 @@ row_is_separator (GtkTreeView *tree_view, { gboolean is_separator = FALSE; - if (tree_view->priv->row_separator_func) + if (tree_view->row_separator_func) { GtkTreeIter tmpiter; @@ -2750,13 +2737,13 @@ row_is_separator (GtkTreeView *tree_view, tmpiter = *iter; else { - if (!gtk_tree_model_get_iter (tree_view->priv->model, &tmpiter, path)) + if (!gtk_tree_model_get_iter (tree_view->model, &tmpiter, path)) return FALSE; } - is_separator = tree_view->priv->row_separator_func (tree_view->priv->model, + is_separator = tree_view->row_separator_func (tree_view->model, &tmpiter, - tree_view->priv->row_separator_data); + tree_view->row_separator_data); } return is_separator; @@ -2765,15 +2752,14 @@ row_is_separator (GtkTreeView *tree_view, static int gtk_tree_view_get_expander_size (GtkTreeView *tree_view) { - GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); GtkStyleContext *context; GtkCssStyle *style; int min_width; int min_height; int expander_size; - if (priv->expander_size != -1) - return priv->expander_size; + if (tree_view->expander_size != -1) + return tree_view->expander_size; context = gtk_widget_get_style_context (GTK_WIDGET (tree_view)); gtk_style_context_save (context); @@ -2789,9 +2775,9 @@ gtk_tree_view_get_expander_size (GtkTreeView *tree_view) expander_size = MAX (min_width, min_height); - priv->expander_size = expander_size + (_TREE_VIEW_HORIZONTAL_SEPARATOR / 2); + tree_view->expander_size = expander_size + (_TREE_VIEW_HORIZONTAL_SEPARATOR / 2); - return priv->expander_size; + return tree_view->expander_size; } static void @@ -2857,25 +2843,25 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); if (n_press > 1) - gtk_gesture_set_state (tree_view->priv->drag_gesture, + gtk_gesture_set_state (tree_view->drag_gesture, GTK_EVENT_SEQUENCE_DENIED); /* Empty tree? */ - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) { grab_focus_and_unset_draw_keyfocus (tree_view); return; } /* are we in an arrow? */ - if (tree_view->priv->prelight_node && - tree_view->priv->arrow_prelit && + if (tree_view->prelight_node && + tree_view->arrow_prelit && gtk_tree_view_draw_expanders (tree_view)) { if (button == GDK_BUTTON_PRIMARY) { - tree_view->priv->button_pressed_node = tree_view->priv->prelight_node; - tree_view->priv->button_pressed_tree = tree_view->priv->prelight_tree; + tree_view->button_pressed_node = tree_view->prelight_node; + tree_view->button_pressed_tree = tree_view->prelight_tree; gtk_widget_queue_draw (widget); } @@ -2887,7 +2873,7 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, new_y = TREE_WINDOW_Y_TO_RBTREE_Y(tree_view, bin_y); if (new_y < 0) new_y = 0; - y_offset = -gtk_tree_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node); + y_offset = -gtk_tree_rbtree_find_offset (tree_view->tree, new_y, &tree, &node); if (node == NULL) { @@ -2919,7 +2905,7 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, /* Let the column have a chance at selecting it. */ rtl = (_gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL); - for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns)); + for (list = (rtl ? g_list_last (tree_view->columns) : g_list_first (tree_view->columns)); list; list = (rtl ? list->prev : list->next)) { GtkTreeViewColumn *candidate = list->data; @@ -2943,8 +2929,8 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, if (gtk_tree_view_is_expander_column (tree_view, column)) { if (!rtl) - cell_area.x += (depth - 1) * tree_view->priv->level_indentation; - cell_area.width -= (depth - 1) * tree_view->priv->level_indentation; + cell_area.x += (depth - 1) * tree_view->level_indentation; + cell_area.width -= (depth - 1) * tree_view->level_indentation; if (gtk_tree_view_draw_expanders (tree_view)) { @@ -2978,15 +2964,15 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, GtkTreePath *anchor; GtkTreeIter iter; - gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); + gtk_tree_model_get_iter (tree_view->model, &iter, path); gtk_tree_view_column_cell_set_cell_data (column, - tree_view->priv->model, + tree_view->model, &iter, GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_PARENT), node->children?TRUE:FALSE); - if (tree_view->priv->anchor) - anchor = gtk_tree_row_reference_get_path (tree_view->priv->anchor); + if (tree_view->anchor) + anchor = gtk_tree_row_reference_get_path (tree_view->anchor); else anchor = NULL; @@ -3025,8 +3011,8 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, gboolean modify, extend; get_current_selection_modifiers (widget, &modify, &extend); - tree_view->priv->modify_selection_pressed = modify; - tree_view->priv->extend_selection_pressed = extend; + tree_view->modify_selection_pressed = modify; + tree_view->extend_selection_pressed = extend; /* We update the focus cell here, this is also needed if the * column does not contain an editable cell. In this case, @@ -3056,8 +3042,8 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, gtk_tree_view_real_set_cursor (tree_view, path, CLEAR_AND_SELECT | CLAMP_NODE); } - tree_view->priv->modify_selection_pressed = FALSE; - tree_view->priv->extend_selection_pressed = FALSE; + tree_view->modify_selection_pressed = FALSE; + tree_view->extend_selection_pressed = FALSE; } if (button == GDK_BUTTON_PRIMARY && n_press == 2) @@ -3066,8 +3052,8 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, { if (n_press == 1) { - tree_view->priv->button_pressed_node = tree_view->priv->prelight_node; - tree_view->priv->button_pressed_tree = tree_view->priv->prelight_tree; + tree_view->button_pressed_node = tree_view->prelight_node; + tree_view->button_pressed_tree = tree_view->prelight_tree; } grab_focus_and_unset_draw_keyfocus (tree_view); @@ -3089,7 +3075,7 @@ gtk_tree_view_drag_gesture_begin (GtkGestureDrag *gesture, GtkTreeRBTree *tree; GtkTreeRBNode *node; - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) { gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED); return; @@ -3097,24 +3083,24 @@ gtk_tree_view_drag_gesture_begin (GtkGestureDrag *gesture, gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, &bin_x, &bin_y); - tree_view->priv->press_start_x = tree_view->priv->rubber_band_x = bin_x; - tree_view->priv->press_start_y = tree_view->priv->rubber_band_y = bin_y; - gtk_tree_rbtree_find_offset (tree_view->priv->tree, bin_y + tree_view->priv->dy, + tree_view->press_start_x = tree_view->rubber_band_x = bin_x; + tree_view->press_start_y = tree_view->rubber_band_y = bin_y; + gtk_tree_rbtree_find_offset (tree_view->tree, bin_y + tree_view->dy, &tree, &node); - if (tree_view->priv->rubber_banding_enable + if (tree_view->rubber_banding_enable && !GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_SELECTED) - && gtk_tree_selection_get_mode (tree_view->priv->selection) == GTK_SELECTION_MULTIPLE) + && gtk_tree_selection_get_mode (tree_view->selection) == GTK_SELECTION_MULTIPLE) { gboolean modify, extend; - tree_view->priv->press_start_y += tree_view->priv->dy; - tree_view->priv->rubber_band_y += tree_view->priv->dy; - tree_view->priv->rubber_band_status = RUBBER_BAND_MAYBE_START; + tree_view->press_start_y += tree_view->dy; + tree_view->rubber_band_y += tree_view->dy; + tree_view->rubber_band_status = RUBBER_BAND_MAYBE_START; get_current_selection_modifiers (GTK_WIDGET (tree_view), &modify, &extend); - tree_view->priv->rubber_band_modify = modify; - tree_view->priv->rubber_band_extend = extend; + tree_view->rubber_band_modify = modify; + tree_view->rubber_band_extend = extend; } } @@ -3131,7 +3117,7 @@ gtk_tree_view_column_click_gesture_pressed (GtkGestureClick *gesture, if (n_press != 2) return; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { column = list->data; @@ -3164,7 +3150,7 @@ gtk_tree_view_column_drag_gesture_begin (GtkGestureDrag *gesture, rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL); - for (i = 0, list = tree_view->priv->columns; list; list = list->next, i++) + for (i = 0, list = tree_view->columns; list; list = list->next, i++) { gpointer drag_data; gint column_width; @@ -3177,7 +3163,7 @@ gtk_tree_view_column_drag_gesture_begin (GtkGestureDrag *gesture, if (!gtk_tree_view_column_get_resizable (column)) break; - tree_view->priv->in_column_resize = TRUE; + tree_view->in_column_resize = TRUE; /* block attached dnd signal handler */ drag_data = g_object_get_data (G_OBJECT (tree_view), "gtk-site-data"); @@ -3191,8 +3177,8 @@ gtk_tree_view_column_drag_gesture_begin (GtkGestureDrag *gesture, gtk_tree_view_column_set_fixed_width (column, column_width); gtk_tree_view_column_set_expand (column, FALSE); - tree_view->priv->drag_pos = i; - tree_view->priv->x_drag = start_x + (rtl ? column_width : -column_width); + tree_view->drag_pos = i; + tree_view->x_drag = start_x + (rtl ? column_width : -column_width); if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) gtk_widget_grab_focus (GTK_WIDGET (tree_view)); @@ -3206,13 +3192,12 @@ static void gtk_tree_view_update_button_position (GtkTreeView *tree_view, GtkTreeViewColumn *column) { - GtkTreeViewPrivate *priv = tree_view->priv; GList *column_el; - column_el = g_list_find (priv->columns, column); + column_el = g_list_find (tree_view->columns, column); g_return_if_fail (column_el != NULL); - gtk_css_node_insert_after (priv->header_node, + gtk_css_node_insert_after (tree_view->header_node, gtk_widget_get_css_node (gtk_tree_view_column_get_button (column)), column_el->prev ? gtk_widget_get_css_node ( gtk_tree_view_column_get_button (column_el->prev->data)) : NULL); @@ -3230,41 +3215,41 @@ gtk_tree_view_button_release_drag_column (GtkTreeView *tree_view) rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL); /* Move the button back */ - button = gtk_tree_view_column_get_button (tree_view->priv->drag_column); + button = gtk_tree_view_column_get_button (tree_view->drag_column); context = gtk_widget_get_style_context (button); gtk_style_context_remove_class (context, GTK_STYLE_CLASS_DND); - gtk_tree_view_update_button_position (tree_view, tree_view->priv->drag_column); + gtk_tree_view_update_button_position (tree_view, tree_view->drag_column); gtk_widget_queue_allocate (widget); gtk_widget_grab_focus (button); if (rtl) { - if (tree_view->priv->cur_reorder && - tree_view->priv->cur_reorder->right_column != tree_view->priv->drag_column) - gtk_tree_view_move_column_after (tree_view, tree_view->priv->drag_column, - tree_view->priv->cur_reorder->right_column); + if (tree_view->cur_reorder && + tree_view->cur_reorder->right_column != tree_view->drag_column) + gtk_tree_view_move_column_after (tree_view, tree_view->drag_column, + tree_view->cur_reorder->right_column); } else { - if (tree_view->priv->cur_reorder && - tree_view->priv->cur_reorder->left_column != tree_view->priv->drag_column) - gtk_tree_view_move_column_after (tree_view, tree_view->priv->drag_column, - tree_view->priv->cur_reorder->left_column); + if (tree_view->cur_reorder && + tree_view->cur_reorder->left_column != tree_view->drag_column) + gtk_tree_view_move_column_after (tree_view, tree_view->drag_column, + tree_view->cur_reorder->left_column); } - tree_view->priv->drag_column = NULL; + tree_view->drag_column = NULL; - for (l = tree_view->priv->column_drag_info; l != NULL; l = l->next) + for (l = tree_view->column_drag_info; l != NULL; l = l->next) g_slice_free (GtkTreeViewColumnReorder, l->data); - g_list_free (tree_view->priv->column_drag_info); - tree_view->priv->column_drag_info = NULL; - tree_view->priv->cur_reorder = NULL; + g_list_free (tree_view->column_drag_info); + tree_view->column_drag_info = NULL; + tree_view->cur_reorder = NULL; /* Reset our flags */ - tree_view->priv->drag_column_surface_state = DRAG_COLUMN_WINDOW_STATE_UNSET; - tree_view->priv->in_column_drag = FALSE; + tree_view->drag_column_surface_state = DRAG_COLUMN_WINDOW_STATE_UNSET; + tree_view->in_column_drag = FALSE; return TRUE; } @@ -3275,7 +3260,7 @@ gtk_tree_view_button_release_column_resize (GtkTreeView *tree_view) { gpointer drag_data; - tree_view->priv->drag_pos = -1; + tree_view->drag_pos = -1; /* unblock attached dnd signal handler */ drag_data = g_object_get_data (G_OBJECT (tree_view), "gtk-site-data"); @@ -3285,7 +3270,7 @@ gtk_tree_view_button_release_column_resize (GtkTreeView *tree_view) 0, 0, NULL, NULL, drag_data); - tree_view->priv->in_column_resize = FALSE; + tree_view->in_column_resize = FALSE; return TRUE; } @@ -3301,11 +3286,11 @@ gtk_tree_view_column_drag_gesture_end (GtkGestureDrag *gesture, /* Cancel reorder if the drag got cancelled */ if (!gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence)) - tree_view->priv->cur_reorder = NULL; + tree_view->cur_reorder = NULL; - if (tree_view->priv->in_column_drag) + if (tree_view->in_column_drag) gtk_tree_view_button_release_drag_column (tree_view); - else if (tree_view->priv->in_column_resize) + else if (tree_view->in_column_resize) gtk_tree_view_button_release_column_resize (tree_view); } @@ -3331,42 +3316,42 @@ gtk_tree_view_click_gesture_released (GtkGestureClick *gesture, button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)); if (button != GDK_BUTTON_PRIMARY || - tree_view->priv->button_pressed_node == NULL || - tree_view->priv->button_pressed_node != tree_view->priv->prelight_node) + tree_view->button_pressed_node == NULL || + tree_view->button_pressed_node != tree_view->prelight_node) return; get_current_selection_modifiers (GTK_WIDGET (tree_view), &modify, &extend); - if (tree_view->priv->arrow_prelit) + if (tree_view->arrow_prelit) { GtkTreePath *path = NULL; - path = _gtk_tree_path_new_from_rbtree (tree_view->priv->button_pressed_tree, - tree_view->priv->button_pressed_node); + path = _gtk_tree_path_new_from_rbtree (tree_view->button_pressed_tree, + tree_view->button_pressed_node); /* Actually activate the node */ - if (tree_view->priv->button_pressed_node->children == NULL) + if (tree_view->button_pressed_node->children == NULL) gtk_tree_view_real_expand_row (tree_view, path, - tree_view->priv->button_pressed_tree, - tree_view->priv->button_pressed_node, + tree_view->button_pressed_tree, + tree_view->button_pressed_node, FALSE, TRUE); else gtk_tree_view_real_collapse_row (tree_view, path, - tree_view->priv->button_pressed_tree, - tree_view->priv->button_pressed_node, TRUE); + tree_view->button_pressed_tree, + tree_view->button_pressed_node, TRUE); gtk_tree_path_free (path); } - else if (tree_view->priv->activate_on_single_click && !modify && !extend) + else if (tree_view->activate_on_single_click && !modify && !extend) { GtkTreePath *path = NULL; - path = _gtk_tree_path_new_from_rbtree (tree_view->priv->button_pressed_tree, - tree_view->priv->button_pressed_node); - gtk_tree_view_row_activated (tree_view, path, tree_view->priv->focus_column); + path = _gtk_tree_path_new_from_rbtree (tree_view->button_pressed_tree, + tree_view->button_pressed_node); + gtk_tree_view_row_activated (tree_view, path, tree_view->focus_column); gtk_tree_path_free (path); } - tree_view->priv->button_pressed_tree = NULL; - tree_view->priv->button_pressed_node = NULL; + tree_view->button_pressed_tree = NULL; + tree_view->button_pressed_node = NULL; } /* GtkWidget::motion_event function set. @@ -3408,12 +3393,12 @@ auto_expand_timeout (gpointer data) GtkTreeView *tree_view = GTK_TREE_VIEW (data); GtkTreePath *path; - if (tree_view->priv->prelight_node) + if (tree_view->prelight_node) { - path = _gtk_tree_path_new_from_rbtree (tree_view->priv->prelight_tree, - tree_view->priv->prelight_node); + path = _gtk_tree_path_new_from_rbtree (tree_view->prelight_tree, + tree_view->prelight_node); - if (tree_view->priv->prelight_node->children) + if (tree_view->prelight_node->children) gtk_tree_view_collapse_row (tree_view, path); else gtk_tree_view_expand_row (tree_view, path, FALSE); @@ -3421,7 +3406,7 @@ auto_expand_timeout (gpointer data) gtk_tree_path_free (path); } - tree_view->priv->auto_expand_timeout = 0; + tree_view->auto_expand_timeout = 0; return FALSE; } @@ -3429,10 +3414,10 @@ auto_expand_timeout (gpointer data) static void remove_auto_expand_timeout (GtkTreeView *tree_view) { - if (tree_view->priv->auto_expand_timeout != 0) + if (tree_view->auto_expand_timeout != 0) { - g_source_remove (tree_view->priv->auto_expand_timeout); - tree_view->priv->auto_expand_timeout = 0; + g_source_remove (tree_view->auto_expand_timeout); + tree_view->auto_expand_timeout = 0; } } @@ -3444,8 +3429,8 @@ do_prelight (GtkTreeView *tree_view, gint x, gint y) { - if (tree_view->priv->prelight_tree == tree && - tree_view->priv->prelight_node == node) + if (tree_view->prelight_tree == tree && + tree_view->prelight_node == node) { /* We are still on the same node, but we might need to take care of the arrow */ @@ -3456,12 +3441,12 @@ do_prelight (GtkTreeView *tree_view, over_arrow = coords_are_over_arrow (tree_view, tree, node, x, y); - if (over_arrow != tree_view->priv->arrow_prelit) + if (over_arrow != tree_view->arrow_prelit) { if (over_arrow) - tree_view->priv->arrow_prelit = TRUE; + tree_view->arrow_prelit = TRUE; else - tree_view->priv->arrow_prelit = FALSE; + tree_view->arrow_prelit = FALSE; gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } @@ -3470,17 +3455,17 @@ do_prelight (GtkTreeView *tree_view, return; } - if (tree_view->priv->prelight_tree && tree_view->priv->prelight_node) + if (tree_view->prelight_tree && tree_view->prelight_node) { /* Unprelight the old node and arrow */ - GTK_TREE_RBNODE_UNSET_FLAG (tree_view->priv->prelight_node, + GTK_TREE_RBNODE_UNSET_FLAG (tree_view->prelight_node, GTK_TREE_RBNODE_IS_PRELIT); - if (tree_view->priv->arrow_prelit + if (tree_view->arrow_prelit && gtk_tree_view_draw_expanders (tree_view)) { - tree_view->priv->arrow_prelit = FALSE; + tree_view->arrow_prelit = FALSE; gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } @@ -3489,12 +3474,12 @@ do_prelight (GtkTreeView *tree_view, } - if (tree_view->priv->hover_expand) + if (tree_view->hover_expand) remove_auto_expand_timeout (tree_view); /* Set the new prelight values */ - tree_view->priv->prelight_node = node; - tree_view->priv->prelight_tree = tree; + tree_view->prelight_node = node; + tree_view->prelight_tree = tree; if (!node || !tree) return; @@ -3504,7 +3489,7 @@ do_prelight (GtkTreeView *tree_view, if (gtk_tree_view_draw_expanders (tree_view) && coords_are_over_arrow (tree_view, tree, node, x, y)) { - tree_view->priv->arrow_prelit = TRUE; + tree_view->arrow_prelit = TRUE; gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } @@ -3513,11 +3498,11 @@ do_prelight (GtkTreeView *tree_view, gtk_widget_queue_draw (GTK_WIDGET (tree_view)); - if (tree_view->priv->hover_expand) + if (tree_view->hover_expand) { - tree_view->priv->auto_expand_timeout = + tree_view->auto_expand_timeout = g_timeout_add (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view); - g_source_set_name_by_id (tree_view->priv->auto_expand_timeout, "[gtk] auto_expand_timeout"); + g_source_set_name_by_id (tree_view->auto_expand_timeout, "[gtk] auto_expand_timeout"); } } @@ -3529,13 +3514,13 @@ prelight_or_select (GtkTreeView *tree_view, gint x, gint y) { - GtkSelectionMode mode = gtk_tree_selection_get_mode (tree_view->priv->selection); + GtkSelectionMode mode = gtk_tree_selection_get_mode (tree_view->selection); - if (tree_view->priv->hover_selection && + if (tree_view->hover_selection && (mode == GTK_SELECTION_SINGLE || mode == GTK_SELECTION_BROWSE) && - !(tree_view->priv->edited_column && + !(tree_view->edited_column && gtk_cell_area_get_edit_widget - (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->priv->edited_column))))) + (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->edited_column))))) { if (node) { @@ -3544,10 +3529,10 @@ prelight_or_select (GtkTreeView *tree_view, GtkTreePath *path; path = _gtk_tree_path_new_from_rbtree (tree, node); - gtk_tree_selection_select_path (tree_view->priv->selection, path); + gtk_tree_selection_select_path (tree_view->selection, path); if (GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_SELECTED)) { - tree_view->priv->draw_keyfocus = FALSE; + tree_view->draw_keyfocus = FALSE; gtk_tree_view_real_set_cursor (tree_view, path, 0); } gtk_tree_path_free (path); @@ -3555,7 +3540,7 @@ prelight_or_select (GtkTreeView *tree_view, } else if (mode == GTK_SELECTION_SINGLE) - gtk_tree_selection_unselect_all (tree_view->priv->selection); + gtk_tree_selection_unselect_all (tree_view->selection); } do_prelight (tree_view, tree, node, x, y); @@ -3568,7 +3553,7 @@ ensure_unprelighted (GtkTreeView *tree_view) NULL, NULL, -1000, -1000); /* coords not possibly over an arrow */ - g_assert (tree_view->priv->prelight_node == NULL); + g_assert (tree_view->prelight_node == NULL); } static void @@ -3580,7 +3565,7 @@ update_prelight (GtkTreeView *tree_view, GtkTreeRBTree *tree; GtkTreeRBNode *node; - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return; if (x == -10000) @@ -3593,7 +3578,7 @@ update_prelight (GtkTreeView *tree_view, if (new_y < 0) new_y = 0; - gtk_tree_rbtree_find_offset (tree_view->priv->tree, + gtk_tree_rbtree_find_offset (tree_view->tree, new_y, &tree, &node); if (node) @@ -3608,12 +3593,12 @@ gtk_tree_view_motion_resize_column (GtkTreeView *tree_view, gint new_width; GtkTreeViewColumn *column; - column = gtk_tree_view_get_column (tree_view, tree_view->priv->drag_pos); + column = gtk_tree_view_get_column (tree_view, tree_view->drag_pos); if (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL) - new_width = MAX (tree_view->priv->x_drag - x, 0); + new_width = MAX (tree_view->x_drag - x, 0); else - new_width = MAX (x - tree_view->priv->x_drag, 0); + new_width = MAX (x - tree_view->x_drag, 0); if (new_width != gtk_tree_view_column_get_fixed_width (column)) gtk_tree_view_column_set_fixed_width (column, new_width); @@ -3630,12 +3615,12 @@ gtk_tree_view_update_current_reorder (GtkTreeView *tree_view) gdouble x; sequence = gtk_gesture_single_get_current_sequence - (GTK_GESTURE_SINGLE (tree_view->priv->column_drag_gesture)); - gtk_gesture_get_point (tree_view->priv->column_drag_gesture, + (GTK_GESTURE_SINGLE (tree_view->column_drag_gesture)); + gtk_gesture_get_point (tree_view->column_drag_gesture, sequence, &x, NULL); - x += gtk_adjustment_get_value (tree_view->priv->hadjustment); + x += gtk_adjustment_get_value (tree_view->hadjustment); - for (list = tree_view->priv->column_drag_info; list; list = list->next) + for (list = tree_view->column_drag_info; list; list = list->next) { reorder = (GtkTreeViewColumnReorder *) list->data; if (x >= reorder->left_align && x < reorder->right_align) @@ -3643,7 +3628,7 @@ gtk_tree_view_update_current_reorder (GtkTreeView *tree_view) reorder = NULL; } - tree_view->priv->cur_reorder = reorder; + tree_view->cur_reorder = reorder; } static void @@ -3653,23 +3638,23 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) gint y; gint offset; - if (gtk_gesture_is_recognized (tree_view->priv->drag_gesture)) + if (gtk_gesture_is_recognized (tree_view->drag_gesture)) { GdkEventSequence *sequence; gdouble py; - sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (tree_view->priv->drag_gesture)); - gtk_gesture_get_point (tree_view->priv->drag_gesture, sequence, NULL, &py); + sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (tree_view->drag_gesture)); + gtk_gesture_get_point (tree_view->drag_gesture, sequence, NULL, &py); gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, py, NULL, &y); } else { - y = tree_view->priv->event_last_y; + y = tree_view->event_last_y; gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, y, NULL, &y); } - y += tree_view->priv->dy; + y += tree_view->dy; gtk_tree_view_get_visible_rect (tree_view, &visible_rect); /* see if we are near the edge. */ @@ -3681,8 +3666,8 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) return; } - gtk_adjustment_set_value (tree_view->priv->vadjustment, - MAX (gtk_adjustment_get_value (tree_view->priv->vadjustment) + offset, 0.0)); + gtk_adjustment_set_value (tree_view->vadjustment, + MAX (gtk_adjustment_get_value (tree_view->vadjustment) + offset, 0.0)); } static void @@ -3694,12 +3679,12 @@ gtk_tree_view_horizontal_autoscroll (GtkTreeView *tree_view) gint offset; sequence = gtk_gesture_single_get_current_sequence - (GTK_GESTURE_SINGLE (tree_view->priv->column_drag_gesture)); - gtk_gesture_get_point (tree_view->priv->column_drag_gesture, + (GTK_GESTURE_SINGLE (tree_view->column_drag_gesture)); + gtk_gesture_get_point (tree_view->column_drag_gesture, sequence, &x, NULL); gtk_tree_view_get_visible_rect (tree_view, &visible_rect); - x += gtk_adjustment_get_value (tree_view->priv->hadjustment); + x += gtk_adjustment_get_value (tree_view->hadjustment); /* See if we are near the edge. */ offset = x - (visible_rect.x + SCROLL_EDGE_SIZE); @@ -3711,8 +3696,8 @@ gtk_tree_view_horizontal_autoscroll (GtkTreeView *tree_view) } offset = offset/3; - gtk_adjustment_set_value (tree_view->priv->hadjustment, - MAX (gtk_adjustment_get_value (tree_view->priv->hadjustment) + offset, 0.0)); + gtk_adjustment_set_value (tree_view->hadjustment, + MAX (gtk_adjustment_get_value (tree_view->hadjustment) + offset, 0.0)); } static void @@ -3720,18 +3705,18 @@ gtk_tree_view_motion_drag_column (GtkTreeView *tree_view, gdouble x, gdouble y) { - GtkTreeViewColumn *column = tree_view->priv->drag_column; + GtkTreeViewColumn *column = tree_view->drag_column; GtkWidget *button; gint width, button_width; button = gtk_tree_view_column_get_button (column); - x += gtk_adjustment_get_value (tree_view->priv->hadjustment); + x += gtk_adjustment_get_value (tree_view->hadjustment); /* Handle moving the header */ width = gtk_widget_get_allocated_width (GTK_WIDGET (tree_view)); button_width = gtk_widget_get_allocated_width (button); - tree_view->priv->drag_column_x = CLAMP (x - _gtk_tree_view_column_get_drag_x (column), 0, - MAX (tree_view->priv->width, width) - button_width); + tree_view->drag_column_x = CLAMP (x - _gtk_tree_view_column_get_drag_x (column), 0, + MAX (tree_view->width, width) - button_width); /* autoscroll, if needed */ gtk_tree_view_horizontal_autoscroll (tree_view); @@ -3745,51 +3730,51 @@ gtk_tree_view_stop_rubber_band (GtkTreeView *tree_view) { remove_scroll_timeout (tree_view); - if (tree_view->priv->rubber_band_status == RUBBER_BAND_ACTIVE) + if (tree_view->rubber_band_status == RUBBER_BAND_ACTIVE) { GtkTreePath *tmp_path; gtk_widget_queue_draw (GTK_WIDGET (tree_view)); /* The anchor path should be set to the start path */ - if (tree_view->priv->rubber_band_start_node) + if (tree_view->rubber_band_start_node) { - tmp_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->rubber_band_start_tree, - tree_view->priv->rubber_band_start_node); + tmp_path = _gtk_tree_path_new_from_rbtree (tree_view->rubber_band_start_tree, + tree_view->rubber_band_start_node); - if (tree_view->priv->anchor) - gtk_tree_row_reference_free (tree_view->priv->anchor); + if (tree_view->anchor) + gtk_tree_row_reference_free (tree_view->anchor); - tree_view->priv->anchor = gtk_tree_row_reference_new (tree_view->priv->model, + tree_view->anchor = gtk_tree_row_reference_new (tree_view->model, tmp_path); gtk_tree_path_free (tmp_path); } /* ... and the cursor to the end path */ - if (tree_view->priv->rubber_band_end_node) + if (tree_view->rubber_band_end_node) { - tmp_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->rubber_band_end_tree, - tree_view->priv->rubber_band_end_node); + tmp_path = _gtk_tree_path_new_from_rbtree (tree_view->rubber_band_end_tree, + tree_view->rubber_band_end_node); gtk_tree_view_real_set_cursor (GTK_TREE_VIEW (tree_view), tmp_path, 0); gtk_tree_path_free (tmp_path); } - _gtk_tree_selection_emit_changed (tree_view->priv->selection); + _gtk_tree_selection_emit_changed (tree_view->selection); - gtk_css_node_set_parent (tree_view->priv->rubber_band_cssnode, NULL); - tree_view->priv->rubber_band_cssnode = NULL; + gtk_css_node_set_parent (tree_view->rubber_band_cssnode, NULL); + tree_view->rubber_band_cssnode = NULL; } /* Clear status variables */ - tree_view->priv->rubber_band_status = RUBBER_BAND_OFF; - tree_view->priv->rubber_band_extend = FALSE; - tree_view->priv->rubber_band_modify = FALSE; + tree_view->rubber_band_status = RUBBER_BAND_OFF; + tree_view->rubber_band_extend = FALSE; + tree_view->rubber_band_modify = FALSE; - tree_view->priv->rubber_band_start_node = NULL; - tree_view->priv->rubber_band_start_tree = NULL; - tree_view->priv->rubber_band_end_node = NULL; - tree_view->priv->rubber_band_end_tree = NULL; + tree_view->rubber_band_start_node = NULL; + tree_view->rubber_band_start_tree = NULL; + tree_view->rubber_band_end_node = NULL; + tree_view->rubber_band_end_tree = NULL; } static void @@ -3820,7 +3805,7 @@ gtk_tree_view_update_rubber_band_selection_range (GtkTreeView *tree_view, gboolean selectable; path = _gtk_tree_path_new_from_rbtree (start_tree, start_node); - selectable = _gtk_tree_selection_row_is_selectable (tree_view->priv->selection, start_node, path); + selectable = _gtk_tree_selection_row_is_selectable (tree_view->selection, start_node, path); gtk_tree_path_free (path); if (!selectable) @@ -3829,9 +3814,9 @@ gtk_tree_view_update_rubber_band_selection_range (GtkTreeView *tree_view, if (select) { - if (tree_view->priv->rubber_band_extend) + if (tree_view->rubber_band_extend) GTK_TREE_RBNODE_SET_FLAG (start_node, GTK_TREE_RBNODE_IS_SELECTED); - else if (tree_view->priv->rubber_band_modify) + else if (tree_view->rubber_band_modify) { /* Toggle the selection state */ if (GTK_TREE_RBNODE_FLAG_SET (start_node, GTK_TREE_RBNODE_IS_SELECTED)) @@ -3845,9 +3830,9 @@ gtk_tree_view_update_rubber_band_selection_range (GtkTreeView *tree_view, else { /* Mirror the above */ - if (tree_view->priv->rubber_band_extend) + if (tree_view->rubber_band_extend) GTK_TREE_RBNODE_UNSET_FLAG (start_node, GTK_TREE_RBNODE_IS_SELECTED); - else if (tree_view->priv->rubber_band_modify) + else if (tree_view->rubber_band_modify) { /* Toggle the selection state */ if (GTK_TREE_RBNODE_FLAG_SET (start_node, GTK_TREE_RBNODE_IS_SELECTED)) @@ -3895,28 +3880,28 @@ gtk_tree_view_update_rubber_band_selection (GtkTreeView *tree_view) gdouble start_y, offset_y; gint bin_y; - if (!gtk_gesture_is_active (tree_view->priv->drag_gesture)) + if (!gtk_gesture_is_active (tree_view->drag_gesture)) return; - gtk_gesture_drag_get_offset (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), + gtk_gesture_drag_get_offset (GTK_GESTURE_DRAG (tree_view->drag_gesture), NULL, &offset_y); - gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), + gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->drag_gesture), NULL, &start_y); gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, 0, start_y, NULL, &bin_y); - bin_y = MAX (0, bin_y + offset_y + tree_view->priv->dy); + bin_y = MAX (0, bin_y + offset_y + tree_view->dy); - gtk_tree_rbtree_find_offset (tree_view->priv->tree, MIN (tree_view->priv->press_start_y, bin_y), &start_tree, &start_node); - gtk_tree_rbtree_find_offset (tree_view->priv->tree, MAX (tree_view->priv->press_start_y, bin_y), &end_tree, &end_node); + gtk_tree_rbtree_find_offset (tree_view->tree, MIN (tree_view->press_start_y, bin_y), &start_tree, &start_node); + gtk_tree_rbtree_find_offset (tree_view->tree, MAX (tree_view->press_start_y, bin_y), &end_tree, &end_node); /* Handle the start area first */ if (!start_node && !end_node) { - if (tree_view->priv->rubber_band_start_node) + if (tree_view->rubber_band_start_node) { - GtkTreeRBNode *node = tree_view->priv->rubber_band_start_node; + GtkTreeRBNode *node = tree_view->rubber_band_start_node; - if (tree_view->priv->rubber_band_modify) + if (tree_view->rubber_band_modify) { /* Toggle the selection state */ if (GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_SELECTED)) @@ -3930,7 +3915,7 @@ gtk_tree_view_update_rubber_band_selection (GtkTreeView *tree_view) gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } } - if (!tree_view->priv->rubber_band_start_node || !start_node) + if (!tree_view->rubber_band_start_node || !start_node) { gtk_tree_view_update_rubber_band_selection_range (tree_view, start_tree, @@ -3942,25 +3927,25 @@ gtk_tree_view_update_rubber_band_selection (GtkTreeView *tree_view) FALSE); } else if (gtk_tree_rbtree_node_find_offset (start_tree, start_node) < - gtk_tree_rbtree_node_find_offset (tree_view->priv->rubber_band_start_tree, tree_view->priv->rubber_band_start_node)) + gtk_tree_rbtree_node_find_offset (tree_view->rubber_band_start_tree, tree_view->rubber_band_start_node)) { /* New node is above the old one; selection became bigger */ gtk_tree_view_update_rubber_band_selection_range (tree_view, start_tree, start_node, - tree_view->priv->rubber_band_start_tree, - tree_view->priv->rubber_band_start_node, + tree_view->rubber_band_start_tree, + tree_view->rubber_band_start_node, TRUE, FALSE, TRUE); } else if (gtk_tree_rbtree_node_find_offset (start_tree, start_node) > - gtk_tree_rbtree_node_find_offset (tree_view->priv->rubber_band_start_tree, tree_view->priv->rubber_band_start_node)) + gtk_tree_rbtree_node_find_offset (tree_view->rubber_band_start_tree, tree_view->rubber_band_start_node)) { /* New node is below the old one; selection became smaller */ gtk_tree_view_update_rubber_band_selection_range (tree_view, - tree_view->priv->rubber_band_start_tree, - tree_view->priv->rubber_band_start_node, + tree_view->rubber_band_start_tree, + tree_view->rubber_band_start_node, start_tree, start_node, FALSE, @@ -3968,11 +3953,11 @@ gtk_tree_view_update_rubber_band_selection (GtkTreeView *tree_view) TRUE); } - tree_view->priv->rubber_band_start_tree = start_tree; - tree_view->priv->rubber_band_start_node = start_node; + tree_view->rubber_band_start_tree = start_tree; + tree_view->rubber_band_start_node = start_node; /* Next, handle the end area */ - if (!tree_view->priv->rubber_band_end_node) + if (!tree_view->rubber_band_end_node) { /* In the event this happens, start_node was also NULL; this case is * handled above. @@ -3981,13 +3966,13 @@ gtk_tree_view_update_rubber_band_selection (GtkTreeView *tree_view) else if (!end_node) { /* Find the last node in the tree */ - gtk_tree_rbtree_find_offset (tree_view->priv->tree, gtk_tree_view_get_height (tree_view) - 1, + gtk_tree_rbtree_find_offset (tree_view->tree, gtk_tree_view_get_height (tree_view) - 1, &end_tree, &end_node); /* Selection reached end of the tree */ gtk_tree_view_update_rubber_band_selection_range (tree_view, - tree_view->priv->rubber_band_end_tree, - tree_view->priv->rubber_band_end_node, + tree_view->rubber_band_end_tree, + tree_view->rubber_band_end_node, end_tree, end_node, TRUE, @@ -3995,12 +3980,12 @@ gtk_tree_view_update_rubber_band_selection (GtkTreeView *tree_view) FALSE); } else if (gtk_tree_rbtree_node_find_offset (end_tree, end_node) > - gtk_tree_rbtree_node_find_offset (tree_view->priv->rubber_band_end_tree, tree_view->priv->rubber_band_end_node)) + gtk_tree_rbtree_node_find_offset (tree_view->rubber_band_end_tree, tree_view->rubber_band_end_node)) { /* New node is below the old one; selection became bigger */ gtk_tree_view_update_rubber_band_selection_range (tree_view, - tree_view->priv->rubber_band_end_tree, - tree_view->priv->rubber_band_end_node, + tree_view->rubber_band_end_tree, + tree_view->rubber_band_end_node, end_tree, end_node, TRUE, @@ -4008,21 +3993,21 @@ gtk_tree_view_update_rubber_band_selection (GtkTreeView *tree_view) FALSE); } else if (gtk_tree_rbtree_node_find_offset (end_tree, end_node) < - gtk_tree_rbtree_node_find_offset (tree_view->priv->rubber_band_end_tree, tree_view->priv->rubber_band_end_node)) + gtk_tree_rbtree_node_find_offset (tree_view->rubber_band_end_tree, tree_view->rubber_band_end_node)) { /* New node is above the old one; selection became smaller */ gtk_tree_view_update_rubber_band_selection_range (tree_view, end_tree, end_node, - tree_view->priv->rubber_band_end_tree, - tree_view->priv->rubber_band_end_node, + tree_view->rubber_band_end_tree, + tree_view->rubber_band_end_node, FALSE, TRUE, FALSE); } - tree_view->priv->rubber_band_end_tree = end_tree; - tree_view->priv->rubber_band_end_node = end_node; + tree_view->rubber_band_end_tree = end_tree; + tree_view->rubber_band_end_node = end_node; } static void @@ -4031,24 +4016,24 @@ gtk_tree_view_update_rubber_band (GtkTreeView *tree_view) gdouble start_x, start_y, offset_x, offset_y, x, y; gint bin_x, bin_y; - if (!gtk_gesture_is_recognized (tree_view->priv->drag_gesture)) + if (!gtk_gesture_is_recognized (tree_view->drag_gesture)) return; - gtk_gesture_drag_get_offset (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), + gtk_gesture_drag_get_offset (GTK_GESTURE_DRAG (tree_view->drag_gesture), &offset_x, &offset_y); - gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), + gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->drag_gesture), &start_x, &start_y); gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, &bin_x, &bin_y); - bin_y += tree_view->priv->dy; + bin_y += tree_view->dy; x = MAX (bin_x + offset_x, 0); y = MAX (bin_y + offset_y, 0); gtk_widget_queue_draw (GTK_WIDGET (tree_view)); - tree_view->priv->rubber_band_x = x; - tree_view->priv->rubber_band_y = y; + tree_view->rubber_band_x = x; + tree_view->rubber_band_y = y; gtk_tree_view_update_rubber_band_selection (tree_view); } @@ -4062,26 +4047,26 @@ gtk_tree_view_snapshot_rubber_band (GtkTreeView *tree_view, GtkStyleContext *context; gint bin_x, bin_y; - if (!gtk_gesture_is_recognized (tree_view->priv->drag_gesture)) + if (!gtk_gesture_is_recognized (tree_view->drag_gesture)) return; - gtk_gesture_drag_get_offset (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), + gtk_gesture_drag_get_offset (GTK_GESTURE_DRAG (tree_view->drag_gesture), &offset_x, &offset_y); - gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), + gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->drag_gesture), &start_x, &start_y); gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, &bin_x, &bin_y); bin_x = MAX (0, bin_x + offset_x); - bin_y = MAX (0, bin_y + offset_y + tree_view->priv->dy); + bin_y = MAX (0, bin_y + offset_y + tree_view->dy); context = gtk_widget_get_style_context (GTK_WIDGET (tree_view)); - gtk_style_context_save_to_node (context, tree_view->priv->rubber_band_cssnode); + gtk_style_context_save_to_node (context, tree_view->rubber_band_cssnode); - rect.x = MIN (tree_view->priv->press_start_x, bin_x); - rect.y = MIN (tree_view->priv->press_start_y, bin_y) - tree_view->priv->dy; - rect.width = ABS (tree_view->priv->press_start_x - bin_x) + 1; - rect.height = ABS (tree_view->priv->press_start_y - bin_y) + 1; + rect.x = MIN (tree_view->press_start_x, bin_x); + rect.y = MIN (tree_view->press_start_y, bin_y) - tree_view->dy; + rect.width = ABS (tree_view->press_start_x - bin_x) + 1; + rect.height = ABS (tree_view->press_start_y - bin_y) + 1; gtk_snapshot_render_background (snapshot, context, rect.x, rect.y, @@ -4111,9 +4096,9 @@ gtk_tree_view_column_drag_gesture_update (GtkGestureDrag *gesture, x = start_x + offset_x; y = start_y + offset_y; - if (tree_view->priv->in_column_resize) + if (tree_view->in_column_resize) gtk_tree_view_motion_resize_column (tree_view, x, y); - else if (tree_view->priv->in_column_drag) + else if (tree_view->in_column_drag) gtk_tree_view_motion_drag_column (tree_view, x, y); } @@ -4123,35 +4108,35 @@ gtk_tree_view_drag_gesture_update (GtkGestureDrag *gesture, gdouble offset_y, GtkTreeView *tree_view) { - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) { gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED); return; } - if (tree_view->priv->rubber_band_status == RUBBER_BAND_MAYBE_START) + if (tree_view->rubber_band_status == RUBBER_BAND_MAYBE_START) { GtkCssNode *widget_node; widget_node = gtk_widget_get_css_node (GTK_WIDGET (tree_view)); - tree_view->priv->rubber_band_cssnode = gtk_css_node_new (); - gtk_css_node_set_name (tree_view->priv->rubber_band_cssnode, I_("rubberband")); - gtk_css_node_set_parent (tree_view->priv->rubber_band_cssnode, widget_node); - gtk_css_node_set_state (tree_view->priv->rubber_band_cssnode, gtk_css_node_get_state (widget_node)); - g_object_unref (tree_view->priv->rubber_band_cssnode); + tree_view->rubber_band_cssnode = gtk_css_node_new (); + gtk_css_node_set_name (tree_view->rubber_band_cssnode, I_("rubberband")); + gtk_css_node_set_parent (tree_view->rubber_band_cssnode, widget_node); + gtk_css_node_set_state (tree_view->rubber_band_cssnode, gtk_css_node_get_state (widget_node)); + g_object_unref (tree_view->rubber_band_cssnode); gtk_tree_view_update_rubber_band (tree_view); - tree_view->priv->rubber_band_status = RUBBER_BAND_ACTIVE; + tree_view->rubber_band_status = RUBBER_BAND_ACTIVE; gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); } - else if (tree_view->priv->rubber_band_status == RUBBER_BAND_ACTIVE) + else if (tree_view->rubber_band_status == RUBBER_BAND_ACTIVE) { gtk_tree_view_update_rubber_band (tree_view); add_scroll_timeout (tree_view); } - else if (!tree_view->priv->rubber_band_status) + else if (!tree_view->rubber_band_status) { if (gtk_tree_view_maybe_begin_dragging_row (tree_view)) gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED); @@ -4170,27 +4155,27 @@ gtk_tree_view_motion_controller_motion (GtkEventControllerMotion *controller, GList *list; gboolean cursor_set = FALSE; - if (tree_view->priv->tree) + if (tree_view->tree) { gint bin_x, bin_y; /* If we are currently pressing down a button, we don't want to prelight anything else. */ - if (gtk_gesture_is_active (tree_view->priv->drag_gesture) || - gtk_gesture_is_active (tree_view->priv->click_gesture)) + if (gtk_gesture_is_active (tree_view->drag_gesture) || + gtk_gesture_is_active (tree_view->click_gesture)) node = NULL; gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, &bin_x, &bin_y); new_y = MAX (0, TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, bin_y)); - gtk_tree_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node); + gtk_tree_rbtree_find_offset (tree_view->tree, new_y, &tree, &node); - tree_view->priv->event_last_x = bin_x; - tree_view->priv->event_last_y = bin_y; + tree_view->event_last_x = bin_x; + tree_view->event_last_y = bin_y; prelight_or_select (tree_view, tree, node, bin_x, bin_y); } - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { GtkTreeViewColumn *column = list->data; @@ -4225,7 +4210,6 @@ gtk_tree_view_snapshot_grid_line (GtkTreeView *tree_view, const graphene_point_t *start, float size) { - GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); GtkStyleContext *context; const GdkRGBA *grid_line_color; @@ -4233,16 +4217,16 @@ gtk_tree_view_snapshot_grid_line (GtkTreeView *tree_view, grid_line_color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_COLOR)); - if (!gdk_rgba_equal (grid_line_color, &priv->grid_line_color) || - (orientation == GTK_ORIENTATION_HORIZONTAL && !priv->horizontal_grid_line_texture) || - (orientation == GTK_ORIENTATION_VERTICAL && !priv->vertical_grid_line_texture)) + if (!gdk_rgba_equal (grid_line_color, &tree_view->grid_line_color) || + (orientation == GTK_ORIENTATION_HORIZONTAL && !tree_view->horizontal_grid_line_texture) || + (orientation == GTK_ORIENTATION_VERTICAL && !tree_view->vertical_grid_line_texture)) { cairo_surface_t *surface; unsigned char *data; - g_clear_object (&priv->horizontal_grid_line_texture); - g_clear_object (&priv->vertical_grid_line_texture); - priv->grid_line_color = *grid_line_color; + g_clear_object (&tree_view->horizontal_grid_line_texture); + g_clear_object (&tree_view->vertical_grid_line_texture); + tree_view->grid_line_color = *grid_line_color; surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 2, 1); data = cairo_image_surface_get_data (surface); @@ -4252,7 +4236,7 @@ gtk_tree_view_snapshot_grid_line (GtkTreeView *tree_view, data[2] = round (grid_line_color->red * 255); data[3] = round (grid_line_color->alpha * 255); - priv->horizontal_grid_line_texture = gdk_texture_new_for_surface (surface); + tree_view->horizontal_grid_line_texture = gdk_texture_new_for_surface (surface); cairo_surface_destroy (surface); surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 2); @@ -4262,12 +4246,12 @@ gtk_tree_view_snapshot_grid_line (GtkTreeView *tree_view, data[2] = round (grid_line_color->red * 255); data[3] = round (grid_line_color->alpha * 255); - priv->vertical_grid_line_texture = gdk_texture_new_for_surface (surface); + tree_view->vertical_grid_line_texture = gdk_texture_new_for_surface (surface); cairo_surface_destroy (surface); } - g_assert (priv->horizontal_grid_line_texture); - g_assert (priv->vertical_grid_line_texture); + g_assert (tree_view->horizontal_grid_line_texture); + g_assert (tree_view->vertical_grid_line_texture); if (orientation == GTK_ORIENTATION_HORIZONTAL) { @@ -4276,7 +4260,7 @@ gtk_tree_view_snapshot_grid_line (GtkTreeView *tree_view, start->x, start->y, size, 1), NULL); - gtk_snapshot_append_texture (snapshot, priv->horizontal_grid_line_texture, + gtk_snapshot_append_texture (snapshot, tree_view->horizontal_grid_line_texture, &GRAPHENE_RECT_INIT (0, 0, 2, 1)); gtk_snapshot_pop (snapshot); } @@ -4287,7 +4271,7 @@ gtk_tree_view_snapshot_grid_line (GtkTreeView *tree_view, start->x, start->y, 1, size), NULL); - gtk_snapshot_append_texture (snapshot, priv->vertical_grid_line_texture, + gtk_snapshot_append_texture (snapshot, tree_view->vertical_grid_line_texture, &GRAPHENE_RECT_INIT (0, 0, 1, 2)); gtk_snapshot_pop (snapshot); } @@ -4300,7 +4284,6 @@ gtk_tree_view_snapshot_tree_line (GtkTreeView *tree_view, const graphene_point_t *start, float size) { - GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); GtkStyleContext *context; const GdkRGBA *tree_line_color; @@ -4308,16 +4291,16 @@ gtk_tree_view_snapshot_tree_line (GtkTreeView *tree_view, tree_line_color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR)); - if (!gdk_rgba_equal (tree_line_color, &priv->tree_line_color) || - (orientation == GTK_ORIENTATION_HORIZONTAL && !priv->horizontal_tree_line_texture) || - (orientation == GTK_ORIENTATION_VERTICAL && !priv->vertical_tree_line_texture)) + if (!gdk_rgba_equal (tree_line_color, &tree_view->tree_line_color) || + (orientation == GTK_ORIENTATION_HORIZONTAL && !tree_view->horizontal_tree_line_texture) || + (orientation == GTK_ORIENTATION_VERTICAL && !tree_view->vertical_tree_line_texture)) { cairo_surface_t *surface; unsigned char *data; - g_clear_object (&priv->horizontal_tree_line_texture); - g_clear_object (&priv->vertical_tree_line_texture); - priv->tree_line_color = *tree_line_color; + g_clear_object (&tree_view->horizontal_tree_line_texture); + g_clear_object (&tree_view->vertical_tree_line_texture); + tree_view->tree_line_color = *tree_line_color; surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 2, 1); data = cairo_image_surface_get_data (surface); @@ -4327,7 +4310,7 @@ gtk_tree_view_snapshot_tree_line (GtkTreeView *tree_view, data[2] = round (tree_line_color->red * 255); data[3] = round (tree_line_color->alpha * 255); - priv->horizontal_tree_line_texture = gdk_texture_new_for_surface (surface); + tree_view->horizontal_tree_line_texture = gdk_texture_new_for_surface (surface); cairo_surface_destroy (surface); surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 2); @@ -4337,12 +4320,12 @@ gtk_tree_view_snapshot_tree_line (GtkTreeView *tree_view, data[2] = round (tree_line_color->red * 255); data[3] = round (tree_line_color->alpha * 255); - priv->vertical_tree_line_texture = gdk_texture_new_for_surface (surface); + tree_view->vertical_tree_line_texture = gdk_texture_new_for_surface (surface); cairo_surface_destroy (surface); } - g_assert (priv->horizontal_tree_line_texture); - g_assert (priv->vertical_tree_line_texture); + g_assert (tree_view->horizontal_tree_line_texture); + g_assert (tree_view->vertical_tree_line_texture); if (orientation == GTK_ORIENTATION_HORIZONTAL) { @@ -4351,7 +4334,7 @@ gtk_tree_view_snapshot_tree_line (GtkTreeView *tree_view, start->x, start->y, size, 1), NULL); - gtk_snapshot_append_texture (snapshot, priv->horizontal_tree_line_texture, + gtk_snapshot_append_texture (snapshot, tree_view->horizontal_tree_line_texture, &GRAPHENE_RECT_INIT (0, 0, 2, 1)); gtk_snapshot_pop (snapshot); } @@ -4362,7 +4345,7 @@ gtk_tree_view_snapshot_tree_line (GtkTreeView *tree_view, start->x, start->y, 1, size), NULL); - gtk_snapshot_append_texture (snapshot, priv->vertical_tree_line_texture, + gtk_snapshot_append_texture (snapshot, tree_view->vertical_tree_line_texture, &GRAPHENE_RECT_INIT (0, 0, 1, 2)); gtk_snapshot_pop (snapshot); } @@ -4372,20 +4355,19 @@ static void gtk_tree_view_snapshot_grid_lines (GtkTreeView *tree_view, GtkSnapshot *snapshot) { - GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); GList *list, *first, *last; gboolean rtl; int current_x = 0; int tree_view_height; - if (priv->grid_lines != GTK_TREE_VIEW_GRID_LINES_VERTICAL && - priv->grid_lines != GTK_TREE_VIEW_GRID_LINES_BOTH) + if (tree_view->grid_lines != GTK_TREE_VIEW_GRID_LINES_VERTICAL && + tree_view->grid_lines != GTK_TREE_VIEW_GRID_LINES_BOTH) return; rtl = (_gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL); - first = g_list_first (priv->columns); - last = g_list_last (priv->columns); + first = g_list_first (tree_view->columns); + last = g_list_last (tree_view->columns); tree_view_height = gtk_tree_view_get_height (tree_view); for (list = (rtl ? last : first); @@ -4422,8 +4404,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, GtkSnapshot *snapshot) { GtkTreeView *tree_view = GTK_TREE_VIEW (widget); - GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); - const int x_scroll_offset = - gtk_adjustment_get_value (priv->hadjustment); + const int x_scroll_offset = - gtk_adjustment_get_value (tree_view->hadjustment); GtkTreePath *path; GtkTreeRBTree *tree; GList *list; @@ -4454,7 +4435,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, rtl = (_gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL); context = gtk_widget_get_style_context (widget); - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return; bin_window_width = gtk_widget_get_width (GTK_WIDGET (tree_view)); @@ -4462,7 +4443,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, clip = (GdkRectangle) { 0, 0, bin_window_width, bin_window_height }; new_y = TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, clip.y); - y_offset = -gtk_tree_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node); + y_offset = -gtk_tree_rbtree_find_offset (tree_view->tree, new_y, &tree, &node); if (gtk_tree_view_get_height (tree_view) < bin_window_height) { @@ -4482,7 +4463,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, /* find the path for the node */ path = _gtk_tree_path_new_from_rbtree (tree, node); - gtk_tree_model_get_iter (tree_view->priv->model, + gtk_tree_model_get_iter (tree_view->model, &iter, path); depth = gtk_tree_path_get_depth (path); @@ -4490,23 +4471,23 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, drag_dest_path = NULL; - if (tree_view->priv->drag_dest_row) - drag_dest_path = gtk_tree_row_reference_get_path (tree_view->priv->drag_dest_row); + if (tree_view->drag_dest_row) + drag_dest_path = gtk_tree_row_reference_get_path (tree_view->drag_dest_row); if (drag_dest_path) _gtk_tree_view_find_node (tree_view, drag_dest_path, &drag_highlight_tree, &drag_highlight); draw_vgrid_lines = - tree_view->priv->grid_lines == GTK_TREE_VIEW_GRID_LINES_VERTICAL - || tree_view->priv->grid_lines == GTK_TREE_VIEW_GRID_LINES_BOTH; + tree_view->grid_lines == GTK_TREE_VIEW_GRID_LINES_VERTICAL + || tree_view->grid_lines == GTK_TREE_VIEW_GRID_LINES_BOTH; draw_hgrid_lines = - tree_view->priv->grid_lines == GTK_TREE_VIEW_GRID_LINES_HORIZONTAL - || tree_view->priv->grid_lines == GTK_TREE_VIEW_GRID_LINES_BOTH; + tree_view->grid_lines == GTK_TREE_VIEW_GRID_LINES_HORIZONTAL + || tree_view->grid_lines == GTK_TREE_VIEW_GRID_LINES_BOTH; expander_size = gtk_tree_view_get_expander_size (tree_view); n_visible_columns = 0; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { if (!gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (list->data))) continue; @@ -4514,14 +4495,14 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, } /* Find the last column */ - for (last_column = g_list_last (tree_view->priv->columns); + for (last_column = g_list_last (tree_view->columns); last_column && !(gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (last_column->data))); last_column = last_column->prev) ; /* and the first */ - for (first_column = g_list_first (tree_view->priv->columns); + for (first_column = g_list_first (tree_view->columns); first_column && !(gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (first_column->data))); first_column = first_column->next) @@ -4561,13 +4542,13 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, * to _has_can_focus_cell, else _has_can_focus_cell() does not * return a correct value. */ - for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns)); + for (list = (rtl ? g_list_last (tree_view->columns) : g_list_first (tree_view->columns)); list; list = (rtl ? list->prev : list->next)) { GtkTreeViewColumn *column = list->data; gtk_tree_view_column_cell_set_cell_data (column, - tree_view->priv->model, + tree_view->model, &iter, GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_PARENT), node->children?TRUE:FALSE); @@ -4575,7 +4556,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, has_can_focus_cell = gtk_tree_view_has_can_focus_cell (tree_view); - for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns)); + for (list = (rtl ? g_list_last (tree_view->columns) : g_list_first (tree_view->columns)); list; list = (rtl ? list->prev : list->next)) { @@ -4602,7 +4583,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, else flags &= ~GTK_CELL_RENDERER_SORTED; - if (tree_view->priv->cursor_node == node) + if (tree_view->cursor_node == node) flags |= GTK_CELL_RENDERER_FOCUSED; else flags &= ~GTK_CELL_RENDERER_FOCUSED; @@ -4658,7 +4639,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, cell_area.x -= x_scroll_offset; gtk_tree_view_column_cell_set_cell_data (column, - tree_view->priv->model, + tree_view->model, &iter, GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_PARENT), node->children?TRUE:FALSE); @@ -4670,11 +4651,11 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, gtk_style_context_add_class (context, GTK_STYLE_CLASS_CELL); - if (node == tree_view->priv->cursor_node && has_can_focus_cell - && ((column == tree_view->priv->focus_column - && tree_view->priv->draw_keyfocus && + if (node == tree_view->cursor_node && has_can_focus_cell + && ((column == tree_view->focus_column + && tree_view->draw_keyfocus && gtk_widget_has_visible_focus (widget)) - || (column == tree_view->priv->edited_column))) + || (column == tree_view->edited_column))) draw_focus = TRUE; else draw_focus = FALSE; @@ -4696,8 +4677,8 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, if (gtk_tree_view_is_expander_column (tree_view, column)) { if (!rtl) - cell_area.x += (depth - 1) * tree_view->priv->level_indentation; - cell_area.width -= (depth - 1) * tree_view->priv->level_indentation; + cell_area.x += (depth - 1) * tree_view->level_indentation; + cell_area.width -= (depth - 1) * tree_view->level_indentation; if (gtk_tree_view_draw_expanders (tree_view)) { @@ -4796,7 +4777,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, } if (gtk_tree_view_is_expander_column (tree_view, column) && - tree_view->priv->tree_lines_enabled) + tree_view->tree_lines_enabled) { gint x = background_area.x; gint mult = rtl ? -1 : 1; @@ -4891,7 +4872,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, gtk_style_context_save (context); gtk_style_context_set_state (context, gtk_style_context_get_state (context) | GTK_STATE_FLAG_DROP_ACTIVE); - switch (tree_view->priv->drag_dest_pos) + switch (tree_view->drag_dest_pos) { case GTK_TREE_VIEW_DROP_BEFORE: gtk_style_context_add_class (context, "before"); @@ -4921,8 +4902,8 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, } /* draw the big row-spanning focus rectangle, if needed */ - if (!has_can_focus_cell && node == tree_view->priv->cursor_node && - tree_view->priv->draw_keyfocus && + if (!has_can_focus_cell && node == tree_view->cursor_node && + tree_view->draw_keyfocus && gtk_widget_has_visible_focus (widget)) { gint tmp_y, tmp_height; @@ -4961,7 +4942,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, tree = node->children; node = gtk_tree_rbtree_first (tree); - has_child = gtk_tree_model_iter_children (tree_view->priv->model, + has_child = gtk_tree_model_iter_children (tree_view->model, &iter, &parent); depth++; @@ -4978,7 +4959,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, node = gtk_tree_rbtree_next (tree, node); if (node != NULL) { - gboolean has_next = gtk_tree_model_iter_next (tree_view->priv->model, &iter); + gboolean has_next = gtk_tree_model_iter_next (tree_view->model, &iter); done = TRUE; /* Sanity Check! */ @@ -4994,7 +4975,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, if (tree == NULL) /* we should go to done to free some memory */ goto done; - has_parent = gtk_tree_model_iter_parent (tree_view->priv->model, + has_parent = gtk_tree_model_iter_parent (tree_view->model, &iter, &parent_iter); depth--; @@ -5011,7 +4992,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget, done: gtk_tree_view_snapshot_grid_lines (tree_view, snapshot); - if (tree_view->priv->rubber_band_status == RUBBER_BAND_ACTIVE) + if (tree_view->rubber_band_status == RUBBER_BAND_ACTIVE) gtk_tree_view_snapshot_rubber_band (tree_view, snapshot); if (drag_dest_path) @@ -5041,7 +5022,7 @@ gtk_tree_view_snapshot (GtkWidget *widget, gtk_snapshot_save (snapshot); gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT ( - - (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment), + - (gint) gtk_adjustment_get_value (tree_view->hadjustment), gtk_tree_view_get_effective_header_height (tree_view))); gtk_tree_view_bin_snapshot (widget, snapshot); gtk_snapshot_restore (snapshot); @@ -5050,7 +5031,7 @@ gtk_tree_view_snapshot (GtkWidget *widget, * event to the headers, so we handle propagating it to our children * (eg. widgets being edited) ourselves. */ - for (list = tree_view->priv->children; list; list = list->next) + for (list = tree_view->children; list; list = list->next) { GtkTreeViewChild *child = list->data; @@ -5069,11 +5050,11 @@ gtk_tree_view_snapshot (GtkWidget *widget, gtk_style_context_save (context); gtk_style_context_remove_class (context, GTK_STYLE_CLASS_VIEW); - for (list = tree_view->priv->columns; list != NULL; list = list->next) + for (list = tree_view->columns; list != NULL; list = list->next) { GtkTreeViewColumn *column = list->data; - if (column == tree_view->priv->drag_column) + if (column == tree_view->drag_column) continue; if (gtk_tree_view_column_get_visible (column)) @@ -5083,9 +5064,9 @@ gtk_tree_view_snapshot (GtkWidget *widget, } } - if (tree_view->priv->drag_column) + if (tree_view->drag_column) { - button = gtk_tree_view_column_get_button (tree_view->priv->drag_column); + button = gtk_tree_view_column_get_button (tree_view->drag_column); gtk_widget_snapshot_child (widget, button, snapshot); } @@ -5119,7 +5100,7 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, { case DROP_HOME: /* find first column where we can drop */ - tmp_list = tree_view->priv->columns; + tmp_list = tree_view->columns; if (column == GTK_TREE_VIEW_COLUMN (tmp_list->data)) return (GtkTreeViewColumn *)0x1; @@ -5134,10 +5115,10 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, gtk_tree_view_column_get_visible (left_column) == FALSE) continue; - if (!tree_view->priv->column_drop_func) + if (!tree_view->column_drop_func) return left_column; - if (!tree_view->priv->column_drop_func (tree_view, column, left_column, cur_column, tree_view->priv->column_drop_func_data)) + if (!tree_view->column_drop_func (tree_view, column, left_column, cur_column, tree_view->column_drop_func_data)) { left_column = cur_column; continue; @@ -5146,10 +5127,10 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, return left_column; } - if (!tree_view->priv->column_drop_func) + if (!tree_view->column_drop_func) return left_column; - if (tree_view->priv->column_drop_func (tree_view, column, left_column, NULL, tree_view->priv->column_drop_func_data)) + if (tree_view->column_drop_func (tree_view, column, left_column, NULL, tree_view->column_drop_func_data)) return left_column; else return (GtkTreeViewColumn *)0x1; @@ -5157,7 +5138,7 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, case DROP_RIGHT: /* find first column after column where we can drop */ - tmp_list = tree_view->priv->columns; + tmp_list = tree_view->columns; for (; tmp_list; tmp_list = tmp_list->next) if (GTK_TREE_VIEW_COLUMN (tmp_list->data) == column) @@ -5186,10 +5167,10 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, continue; } - if (!tree_view->priv->column_drop_func) + if (!tree_view->column_drop_func) return left_column; - if (!tree_view->priv->column_drop_func (tree_view, column, left_column, cur_column, tree_view->priv->column_drop_func_data)) + if (!tree_view->column_drop_func (tree_view, column, left_column, cur_column, tree_view->column_drop_func_data)) { left_column = cur_column; continue; @@ -5198,10 +5179,10 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, return left_column; } - if (!tree_view->priv->column_drop_func) + if (!tree_view->column_drop_func) return left_column; - if (tree_view->priv->column_drop_func (tree_view, column, left_column, NULL, tree_view->priv->column_drop_func_data)) + if (tree_view->column_drop_func (tree_view, column, left_column, NULL, tree_view->column_drop_func_data)) return left_column; else return (GtkTreeViewColumn *)0x1; @@ -5209,7 +5190,7 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, case DROP_LEFT: /* find first column before column where we can drop */ - tmp_list = tree_view->priv->columns; + tmp_list = tree_view->columns; for (; tmp_list; tmp_list = tmp_list->next) if (GTK_TREE_VIEW_COLUMN (tmp_list->data) == column) @@ -5245,20 +5226,20 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, continue; } - if (!tree_view->priv->column_drop_func) + if (!tree_view->column_drop_func) return left_column; - if (tree_view->priv->column_drop_func (tree_view, column, left_column, cur_column, tree_view->priv->column_drop_func_data)) + if (tree_view->column_drop_func (tree_view, column, left_column, cur_column, tree_view->column_drop_func_data)) return left_column; cur_column = left_column; tmp_list = tmp_list->prev; } - if (!tree_view->priv->column_drop_func) + if (!tree_view->column_drop_func) return NULL; - if (tree_view->priv->column_drop_func (tree_view, column, NULL, cur_column, tree_view->priv->column_drop_func_data)) + if (tree_view->column_drop_func (tree_view, column, NULL, cur_column, tree_view->column_drop_func_data)) return NULL; else return (GtkTreeViewColumn *)0x1; @@ -5266,7 +5247,7 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, case DROP_END: /* same as DROP_HOME case, but doing it backwards */ - tmp_list = g_list_last (tree_view->priv->columns); + tmp_list = g_list_last (tree_view->columns); cur_column = NULL; if (column == GTK_TREE_VIEW_COLUMN (tmp_list->data)) @@ -5285,20 +5266,20 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view, tmp_list = tmp_list->prev; } - if (!tree_view->priv->column_drop_func) + if (!tree_view->column_drop_func) return left_column; - if (tree_view->priv->column_drop_func (tree_view, column, left_column, cur_column, tree_view->priv->column_drop_func_data)) + if (tree_view->column_drop_func (tree_view, column, left_column, cur_column, tree_view->column_drop_func_data)) return left_column; cur_column = left_column; tmp_list = tmp_list->prev; } - if (!tree_view->priv->column_drop_func) + if (!tree_view->column_drop_func) return NULL; - if (tree_view->priv->column_drop_func (tree_view, column, NULL, cur_column, tree_view->priv->column_drop_func_data)) + if (tree_view->column_drop_func (tree_view, column, NULL, cur_column, tree_view->column_drop_func_data)) return NULL; else return (GtkTreeViewColumn *)0x1; @@ -5336,7 +5317,7 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key, GtkWidget *button; GdkEvent *event; - if (tree_view->priv->rubber_band_status) + if (tree_view->rubber_band_status) { if (keyval == GDK_KEY_Escape) gtk_tree_view_stop_rubber_band (tree_view); @@ -5344,22 +5325,22 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key, return TRUE; } - if (tree_view->priv->in_column_drag) + if (tree_view->in_column_drag) { if (keyval == GDK_KEY_Escape) - gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->column_drag_gesture), + gtk_gesture_set_state (GTK_GESTURE (tree_view->column_drag_gesture), GTK_EVENT_SEQUENCE_DENIED); return TRUE; } - if (tree_view->priv->headers_visible) + if (tree_view->headers_visible) { GList *focus_column; gboolean rtl; rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL); - for (focus_column = tree_view->priv->columns; + for (focus_column = tree_view->columns; focus_column; focus_column = focus_column->next) { @@ -5464,9 +5445,9 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key, g_object_unref (event); - if (tree_view->priv->search_entry_avoid_unhandled_binding) + if (tree_view->search_entry_avoid_unhandled_binding) { - tree_view->priv->search_entry_avoid_unhandled_binding = FALSE; + tree_view->search_entry_avoid_unhandled_binding = FALSE; return FALSE; } @@ -5477,21 +5458,21 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key, * keeping the focus on the tree view. */ if (gtk_widget_has_focus (GTK_WIDGET (tree_view)) - && tree_view->priv->enable_search - && !tree_view->priv->search_custom_entry_set + && tree_view->enable_search + && !tree_view->search_custom_entry_set && !gtk_tree_view_search_key_cancels_search (keyval)) { GtkWidget *search_window; gtk_tree_view_ensure_interactive_directory (tree_view); - search_window = tree_view->priv->search_window; + search_window = tree_view->search_window; if (!gtk_widget_is_visible (search_window)) { - tree_view->priv->imcontext_changed = FALSE; - gtk_event_controller_key_forward (key, tree_view->priv->search_entry); + tree_view->imcontext_changed = FALSE; + gtk_event_controller_key_forward (key, tree_view->search_entry); - if (tree_view->priv->imcontext_changed) + if (tree_view->imcontext_changed) { GdkDevice *device; @@ -5505,7 +5486,7 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key, } else { - gtk_editable_set_text (GTK_EDITABLE (tree_view->priv->search_entry), ""); + gtk_editable_set_text (GTK_EDITABLE (tree_view->search_entry), ""); return FALSE; } } @@ -5514,7 +5495,7 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key, { gulong popup_menu_id; - popup_menu_id = g_signal_connect (tree_view->priv->search_entry, + popup_menu_id = g_signal_connect (tree_view->search_entry, "popup-menu", G_CALLBACK (no_popup), NULL); @@ -5522,7 +5503,7 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key, * key events to the entry, when it is visible. */ gtk_event_controller_key_forward (key, search_window); - g_signal_handler_disconnect (tree_view->priv->search_entry, + g_signal_handler_disconnect (tree_view->search_entry, popup_menu_id); } } @@ -5539,7 +5520,7 @@ gtk_tree_view_key_controller_key_released (GtkEventControllerKey *key, { GdkEvent *event; - if (tree_view->priv->rubber_band_status) + if (tree_view->rubber_band_status) return; /* Handle the keybindings. */ @@ -5560,20 +5541,20 @@ gtk_tree_view_motion_controller_enter (GtkEventControllerMotion *controller, GtkTreeRBNode *node; gint new_y; - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return; /* find the node internally */ new_y = TREE_WINDOW_Y_TO_RBTREE_Y(tree_view, y); if (new_y < 0) new_y = 0; - gtk_tree_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node); + gtk_tree_rbtree_find_offset (tree_view->tree, new_y, &tree, &node); - tree_view->priv->event_last_x = x; - tree_view->priv->event_last_y = y; + tree_view->event_last_x = x; + tree_view->event_last_y = y; - if ((tree_view->priv->button_pressed_node == NULL) || - (tree_view->priv->button_pressed_node == node)) + if ((tree_view->button_pressed_node == NULL) || + (tree_view->button_pressed_node == node)) prelight_or_select (tree_view, tree, node, x, y); } @@ -5583,11 +5564,11 @@ gtk_tree_view_motion_controller_leave (GtkEventControllerMotion *controller, GdkNotifyType detail, GtkTreeView *tree_view) { - if (tree_view->priv->prelight_node) + if (tree_view->prelight_node) gtk_widget_queue_draw (GTK_WIDGET (tree_view)); - tree_view->priv->event_last_x = -10000; - tree_view->priv->event_last_y = -10000; + tree_view->event_last_x = -10000; + tree_view->event_last_y = -10000; if (!gtk_event_controller_motion_contains_pointer (GTK_EVENT_CONTROLLER_MOTION (controller))) prelight_or_select (tree_view, NULL, NULL, -1000, -1000); /* not possibly over an arrow */ @@ -5609,9 +5590,9 @@ gtk_tree_view_key_controller_focus_out (GtkEventControllerKey *key, NULL); /* destroy interactive search dialog */ - if (tree_view->priv->search_window && + if (tree_view->search_window && !gtk_event_controller_key_contains_focus (key)) - gtk_tree_view_search_window_hide (tree_view->priv->search_window, tree_view, + gtk_tree_view_search_window_hide (tree_view->search_window, tree_view, gtk_get_current_event_device ()); } @@ -5629,9 +5610,9 @@ node_is_visible (GtkTreeView *tree_view, y = gtk_tree_rbtree_node_find_offset (tree, node); height = gtk_tree_view_get_row_height (tree_view, node); - if (y >= gtk_adjustment_get_value (tree_view->priv->vadjustment) && - y + height <= (gtk_adjustment_get_value (tree_view->priv->vadjustment) - + gtk_adjustment_get_page_size (tree_view->priv->vadjustment))) + if (y >= gtk_adjustment_get_value (tree_view->vadjustment) && + y + height <= (gtk_adjustment_get_value (tree_view->vadjustment) + + gtk_adjustment_get_page_size (tree_view->vadjustment))) return TRUE; return FALSE; @@ -5691,20 +5672,20 @@ validate_row (GtkTreeView *tree_view, is_separator = row_is_separator (tree_view, iter, NULL); draw_vgrid_lines = - tree_view->priv->grid_lines == GTK_TREE_VIEW_GRID_LINES_VERTICAL - || tree_view->priv->grid_lines == GTK_TREE_VIEW_GRID_LINES_BOTH; + tree_view->grid_lines == GTK_TREE_VIEW_GRID_LINES_VERTICAL + || tree_view->grid_lines == GTK_TREE_VIEW_GRID_LINES_BOTH; draw_hgrid_lines = - tree_view->priv->grid_lines == GTK_TREE_VIEW_GRID_LINES_HORIZONTAL - || tree_view->priv->grid_lines == GTK_TREE_VIEW_GRID_LINES_BOTH; + tree_view->grid_lines == GTK_TREE_VIEW_GRID_LINES_HORIZONTAL + || tree_view->grid_lines == GTK_TREE_VIEW_GRID_LINES_BOTH; expander_size = gtk_tree_view_get_expander_size (tree_view); - for (last_column = g_list_last (tree_view->priv->columns); + for (last_column = g_list_last (tree_view->columns); last_column && !(gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (last_column->data))); last_column = last_column->prev) ; - for (first_column = g_list_first (tree_view->priv->columns); + for (first_column = g_list_first (tree_view->columns); first_column && !(gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (first_column->data))); first_column = first_column->next) @@ -5716,7 +5697,7 @@ validate_row (GtkTreeView *tree_view, gtk_style_context_save (context); gtk_style_context_add_class (context, GTK_STYLE_CLASS_CELL); - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { gint padding = 0; gint original_width; @@ -5734,7 +5715,7 @@ validate_row (GtkTreeView *tree_view, original_width = _gtk_tree_view_column_get_requested_width (column); - gtk_tree_view_column_cell_set_cell_data (column, tree_view->priv->model, iter, + gtk_tree_view_column_cell_set_cell_data (column, tree_view->model, iter, GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_PARENT), node->children?TRUE:FALSE); gtk_tree_view_column_cell_get_size (column, @@ -5755,7 +5736,7 @@ validate_row (GtkTreeView *tree_view, if (gtk_tree_view_is_expander_column (tree_view, column)) { - padding += _TREE_VIEW_HORIZONTAL_SEPARATOR + (depth - 1) * tree_view->priv->level_indentation; + padding += _TREE_VIEW_HORIZONTAL_SEPARATOR + (depth - 1) * tree_view->level_indentation; if (gtk_tree_view_draw_expanders (tree_view)) padding += depth * expander_size; @@ -5809,11 +5790,11 @@ validate_visible_area (GtkTreeView *tree_view) gint area_above = 0; gint area_below = 0; - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return; - if (! GTK_TREE_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_TREE_RBNODE_DESCENDANTS_INVALID) && - tree_view->priv->scroll_to_path == NULL) + if (! GTK_TREE_RBNODE_FLAG_SET (tree_view->tree->root, GTK_TREE_RBNODE_DESCENDANTS_INVALID) && + tree_view->scroll_to_path == NULL) return; total_height = gtk_widget_get_height (GTK_WIDGET (tree_view)) @@ -5824,13 +5805,13 @@ validate_visible_area (GtkTreeView *tree_view) /* First, we check to see if we need to scroll anywhere */ - if (tree_view->priv->scroll_to_path) + if (tree_view->scroll_to_path) { - path = gtk_tree_row_reference_get_path (tree_view->priv->scroll_to_path); + path = gtk_tree_row_reference_get_path (tree_view->scroll_to_path); if (path && !_gtk_tree_view_find_node (tree_view, path, &tree, &node)) { /* we are going to scroll, and will update dy */ - gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); + gtk_tree_model_get_iter (tree_view->model, &iter, path); if (GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_INVALID) || GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_COLUMN_INVALID)) { @@ -5839,11 +5820,11 @@ validate_visible_area (GtkTreeView *tree_view) size_changed = TRUE; } - if (tree_view->priv->scroll_to_use_align) + if (tree_view->scroll_to_use_align) { gint height = gtk_tree_view_get_row_height (tree_view, node); area_above = (total_height - height) * - tree_view->priv->scroll_to_row_align; + tree_view->scroll_to_row_align; area_below = total_height - area_above - height; area_above = MAX (area_above, 0); area_below = MAX (area_below, 0); @@ -5859,39 +5840,39 @@ validate_visible_area (GtkTreeView *tree_view) dy = gtk_tree_rbtree_node_find_offset (tree, node); - if (dy >= gtk_adjustment_get_value (tree_view->priv->vadjustment) && - dy + height <= (gtk_adjustment_get_value (tree_view->priv->vadjustment) - + gtk_adjustment_get_page_size (tree_view->priv->vadjustment))) + if (dy >= gtk_adjustment_get_value (tree_view->vadjustment) && + dy + height <= (gtk_adjustment_get_value (tree_view->vadjustment) + + gtk_adjustment_get_page_size (tree_view->vadjustment))) { /* row visible: keep the row at the same position */ - area_above = dy - gtk_adjustment_get_value (tree_view->priv->vadjustment); - area_below = (gtk_adjustment_get_value (tree_view->priv->vadjustment) + - gtk_adjustment_get_page_size (tree_view->priv->vadjustment)) + area_above = dy - gtk_adjustment_get_value (tree_view->vadjustment); + area_below = (gtk_adjustment_get_value (tree_view->vadjustment) + + gtk_adjustment_get_page_size (tree_view->vadjustment)) - dy - height; } else { /* row not visible */ if (dy >= 0 - && dy + height <= gtk_adjustment_get_page_size (tree_view->priv->vadjustment)) + && dy + height <= gtk_adjustment_get_page_size (tree_view->vadjustment)) { /* row at the beginning -- fixed */ area_above = dy; - area_below = gtk_adjustment_get_page_size (tree_view->priv->vadjustment) + area_below = gtk_adjustment_get_page_size (tree_view->vadjustment) - area_above - height; } - else if (dy >= (gtk_adjustment_get_upper (tree_view->priv->vadjustment) - - gtk_adjustment_get_page_size (tree_view->priv->vadjustment))) + else if (dy >= (gtk_adjustment_get_upper (tree_view->vadjustment) - + gtk_adjustment_get_page_size (tree_view->vadjustment))) { /* row at the end -- fixed */ - area_above = dy - (gtk_adjustment_get_upper (tree_view->priv->vadjustment) - - gtk_adjustment_get_page_size (tree_view->priv->vadjustment)); - area_below = gtk_adjustment_get_page_size (tree_view->priv->vadjustment) - + area_above = dy - (gtk_adjustment_get_upper (tree_view->vadjustment) - + gtk_adjustment_get_page_size (tree_view->vadjustment)); + area_below = gtk_adjustment_get_page_size (tree_view->vadjustment) - area_above - height; if (area_below < 0) { - area_above = gtk_adjustment_get_page_size (tree_view->priv->vadjustment) - height; + area_above = gtk_adjustment_get_page_size (tree_view->vadjustment) - height; area_below = 0; } } @@ -5910,10 +5891,10 @@ validate_visible_area (GtkTreeView *tree_view) /* the scroll to isn't valid; ignore it. */ { - if (tree_view->priv->scroll_to_path && !path) + if (tree_view->scroll_to_path && !path) { - gtk_tree_row_reference_free (tree_view->priv->scroll_to_path); - tree_view->priv->scroll_to_path = NULL; + gtk_tree_row_reference_free (tree_view->scroll_to_path); + tree_view->scroll_to_path = NULL; } if (path) gtk_tree_path_free (path); @@ -5927,7 +5908,7 @@ validate_visible_area (GtkTreeView *tree_view) { gint offset; - offset = gtk_tree_rbtree_find_offset (tree_view->priv->tree, + offset = gtk_tree_rbtree_find_offset (tree_view->tree, TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, 0), &tree, &node); if (node == NULL) @@ -5942,7 +5923,7 @@ validate_visible_area (GtkTreeView *tree_view) total_height += offset; } - gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); + gtk_tree_model_get_iter (tree_view->model, &iter, path); if (GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_INVALID) || GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_COLUMN_INVALID)) @@ -5977,7 +5958,7 @@ validate_visible_area (GtkTreeView *tree_view) GtkTreeIter tmpiter; tmppath = _gtk_tree_path_new_from_rbtree (tmptree, tmpnode); - gtk_tree_model_get_iter (tree_view->priv->model, &tmpiter, tmppath); + gtk_tree_model_get_iter (tree_view->model, &tmpiter, tmppath); if (GTK_TREE_RBNODE_FLAG_SET (tmpnode, GTK_TREE_RBNODE_INVALID) || GTK_TREE_RBNODE_FLAG_SET (tmpnode, GTK_TREE_RBNODE_COLUMN_INVALID)) @@ -6006,7 +5987,7 @@ validate_visible_area (GtkTreeView *tree_view) tree = node->children; node = gtk_tree_rbtree_first (tree); - has_child = gtk_tree_model_iter_children (tree_view->priv->model, + has_child = gtk_tree_model_iter_children (tree_view->model, &iter, &parent); TREE_VIEW_INTERNAL_ASSERT_VOID (has_child); @@ -6020,7 +6001,7 @@ validate_visible_area (GtkTreeView *tree_view) node = gtk_tree_rbtree_next (tree, node); if (node != NULL) { - gboolean has_next = gtk_tree_model_iter_next (tree_view->priv->model, &iter); + gboolean has_next = gtk_tree_model_iter_next (tree_view->model, &iter); done = TRUE; gtk_tree_path_next (path); @@ -6036,7 +6017,7 @@ validate_visible_area (GtkTreeView *tree_view) tree = tree->parent_tree; if (tree == NULL) break; - has_parent = gtk_tree_model_iter_parent (tree_view->priv->model, + has_parent = gtk_tree_model_iter_parent (tree_view->model, &iter, &parent_iter); gtk_tree_path_up (path); @@ -6090,7 +6071,7 @@ validate_visible_area (GtkTreeView *tree_view) gtk_tree_path_free (above_path); above_path = _gtk_tree_path_new_from_rbtree (tree, node); - gtk_tree_model_get_iter (tree_view->priv->model, &iter, above_path); + gtk_tree_model_get_iter (tree_view->model, &iter, above_path); if (GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_INVALID) || GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_COLUMN_INVALID)) @@ -6105,24 +6086,24 @@ validate_visible_area (GtkTreeView *tree_view) /* if we scrolled to a path, we need to set the dy here, * and sync the top row accordingly */ - if (tree_view->priv->scroll_to_path) + if (tree_view->scroll_to_path) { gtk_tree_view_set_top_row (tree_view, above_path, -area_above); gtk_tree_view_top_row_to_dy (tree_view); need_redraw = TRUE; } - else if (gtk_tree_view_get_height (tree_view) <= gtk_adjustment_get_page_size (tree_view->priv->vadjustment)) + else if (gtk_tree_view_get_height (tree_view) <= gtk_adjustment_get_page_size (tree_view->vadjustment)) { /* when we are not scrolling, we should never set dy to something * else than zero. we update top_row to be in sync with dy = 0. */ - gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), 0); + gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->vadjustment), 0); gtk_tree_view_dy_to_top_row (tree_view); } - else if (gtk_adjustment_get_value (tree_view->priv->vadjustment) + gtk_adjustment_get_page_size (tree_view->priv->vadjustment) > gtk_tree_view_get_height (tree_view)) + else if (gtk_adjustment_get_value (tree_view->vadjustment) + gtk_adjustment_get_page_size (tree_view->vadjustment) > gtk_tree_view_get_height (tree_view)) { - gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), gtk_tree_view_get_height (tree_view) - gtk_adjustment_get_page_size (tree_view->priv->vadjustment)); + gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->vadjustment), gtk_tree_view_get_height (tree_view) - gtk_adjustment_get_page_size (tree_view->vadjustment)); gtk_tree_view_dy_to_top_row (tree_view); } else @@ -6139,25 +6120,25 @@ validate_visible_area (GtkTreeView *tree_view) gtk_widget_get_preferred_size (GTK_WIDGET (tree_view), &requisition, NULL); - gtk_adjustment_set_upper (tree_view->priv->hadjustment, - MAX (gtk_adjustment_get_upper (tree_view->priv->hadjustment), requisition.width)); - gtk_adjustment_set_upper (tree_view->priv->vadjustment, - MAX (gtk_adjustment_get_upper (tree_view->priv->vadjustment), requisition.height)); + gtk_adjustment_set_upper (tree_view->hadjustment, + MAX (gtk_adjustment_get_upper (tree_view->hadjustment), requisition.width)); + gtk_adjustment_set_upper (tree_view->vadjustment, + MAX (gtk_adjustment_get_upper (tree_view->vadjustment), requisition.height)); gtk_widget_queue_resize (GTK_WIDGET (tree_view)); } - if (tree_view->priv->scroll_to_path) + if (tree_view->scroll_to_path) { - gtk_tree_row_reference_free (tree_view->priv->scroll_to_path); - tree_view->priv->scroll_to_path = NULL; + gtk_tree_row_reference_free (tree_view->scroll_to_path); + tree_view->scroll_to_path = NULL; } if (above_path) gtk_tree_path_free (above_path); - if (tree_view->priv->scroll_to_column) + if (tree_view->scroll_to_column) { - tree_view->priv->scroll_to_column = NULL; + tree_view->scroll_to_column = NULL; } if (need_redraw) gtk_widget_queue_draw (GTK_WIDGET (tree_view)); @@ -6166,10 +6147,10 @@ validate_visible_area (GtkTreeView *tree_view) static void initialize_fixed_height_mode (GtkTreeView *tree_view) { - if (!tree_view->priv->tree) + if (!tree_view->tree) return; - if (tree_view->priv->fixed_height < 0) + if (tree_view->fixed_height < 0) { GtkTreeIter iter; GtkTreePath *path; @@ -6177,21 +6158,21 @@ initialize_fixed_height_mode (GtkTreeView *tree_view) GtkTreeRBTree *tree = NULL; GtkTreeRBNode *node = NULL; - tree = tree_view->priv->tree; + tree = tree_view->tree; node = tree->root; path = _gtk_tree_path_new_from_rbtree (tree, node); - gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); + gtk_tree_model_get_iter (tree_view->model, &iter, path); validate_row (tree_view, tree, node, &iter, path); gtk_tree_path_free (path); - tree_view->priv->fixed_height = gtk_tree_view_get_row_height (tree_view, node); + tree_view->fixed_height = gtk_tree_view_get_row_height (tree_view, node); } - gtk_tree_rbtree_set_fixed_height (tree_view->priv->tree, - tree_view->priv->fixed_height, TRUE); + gtk_tree_rbtree_set_fixed_height (tree_view->tree, + tree_view->fixed_height, TRUE); } /* Our strategy for finding nodes to validate is a little convoluted. We find @@ -6224,12 +6205,12 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) if (prevent_recursion_hack) return FALSE; - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return FALSE; - if (tree_view->priv->fixed_height_mode) + if (tree_view->fixed_height_mode) { - if (tree_view->priv->fixed_height < 0) + if (tree_view->fixed_height < 0) initialize_fixed_height_mode (tree_view); return FALSE; @@ -6242,7 +6223,7 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) { gboolean changed = FALSE; - if (! GTK_TREE_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_TREE_RBNODE_DESCENDANTS_INVALID)) + if (! GTK_TREE_RBNODE_FLAG_SET (tree_view->tree->root, GTK_TREE_RBNODE_DESCENDANTS_INVALID)) { retval = FALSE; goto done; @@ -6253,7 +6234,7 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) node = gtk_tree_rbtree_next (tree, node); if (node != NULL) { - TREE_VIEW_INTERNAL_ASSERT (gtk_tree_model_iter_next (tree_view->priv->model, &iter), FALSE); + TREE_VIEW_INTERNAL_ASSERT (gtk_tree_model_iter_next (tree_view->model, &iter), FALSE); gtk_tree_path_next (path); } else @@ -6265,8 +6246,8 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) if (path == NULL) { - tree = tree_view->priv->tree; - node = tree_view->priv->tree->root; + tree = tree_view->tree; + node = tree_view->tree->root; g_assert (GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_DESCENDANTS_INVALID)); @@ -6298,7 +6279,7 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) } while (TRUE); path = _gtk_tree_path_new_from_rbtree (tree, node); - gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); + gtk_tree_model_get_iter (tree_view->model, &iter, path); } changed = validate_row (tree_view, tree, node, &iter, path); @@ -6312,7 +6293,7 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) y = offset; } - if (!tree_view->priv->fixed_height_check) + if (!tree_view->fixed_height_check) { gint height; @@ -6327,12 +6308,12 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) } while (g_timer_elapsed (timer, NULL) < GTK_TREE_VIEW_TIME_MS_PER_IDLE / 1000.); - if (!tree_view->priv->fixed_height_check) + if (!tree_view->fixed_height_check) { if (fixed_height) - gtk_tree_rbtree_set_fixed_height (tree_view->priv->tree, prev_height, FALSE); + gtk_tree_rbtree_set_fixed_height (tree_view->tree, prev_height, FALSE); - tree_view->priv->fixed_height_check = 1; + tree_view->fixed_height_check = 1; } done: @@ -6371,13 +6352,13 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) /* If rows above the current position have changed height, this has * affected the current view and thus needs a redraw. */ - if (y != -1 && y < gtk_adjustment_get_value (tree_view->priv->vadjustment)) + if (y != -1 && y < gtk_adjustment_get_value (tree_view->vadjustment)) gtk_widget_queue_draw (GTK_WIDGET (tree_view)); - gtk_adjustment_set_upper (tree_view->priv->hadjustment, - MAX (gtk_adjustment_get_upper (tree_view->priv->hadjustment), requisition.width)); - gtk_adjustment_set_upper (tree_view->priv->vadjustment, - MAX (gtk_adjustment_get_upper (tree_view->priv->vadjustment), requisition.height)); + gtk_adjustment_set_upper (tree_view->hadjustment, + MAX (gtk_adjustment_get_upper (tree_view->hadjustment), requisition.width)); + gtk_adjustment_set_upper (tree_view->vadjustment, + MAX (gtk_adjustment_get_upper (tree_view->vadjustment), requisition.height)); if (queue_resize) gtk_widget_queue_resize (GTK_WIDGET (tree_view)); @@ -6388,8 +6369,8 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) if (!retval && gtk_widget_get_mapped (GTK_WIDGET (tree_view))) update_prelight (tree_view, - tree_view->priv->event_last_x, - tree_view->priv->event_last_y); + tree_view->event_last_x, + tree_view->event_last_y); return retval; } @@ -6397,50 +6378,50 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize) static void disable_adjustment_animation (GtkTreeView *tree_view) { - gtk_adjustment_enable_animation (tree_view->priv->vadjustment, + gtk_adjustment_enable_animation (tree_view->vadjustment, NULL, - gtk_adjustment_get_animation_duration (tree_view->priv->vadjustment)); + gtk_adjustment_get_animation_duration (tree_view->vadjustment)); } static void maybe_reenable_adjustment_animation (GtkTreeView *tree_view) { - if (tree_view->priv->presize_handler_tick_cb != 0 || - tree_view->priv->validate_rows_timer != 0) + if (tree_view->presize_handler_tick_cb != 0 || + tree_view->validate_rows_timer != 0) return; - gtk_adjustment_enable_animation (tree_view->priv->vadjustment, + gtk_adjustment_enable_animation (tree_view->vadjustment, gtk_widget_get_frame_clock (GTK_WIDGET (tree_view)), - gtk_adjustment_get_animation_duration (tree_view->priv->vadjustment)); + gtk_adjustment_get_animation_duration (tree_view->vadjustment)); } static gboolean do_presize_handler (GtkTreeView *tree_view) { - if (tree_view->priv->mark_rows_col_dirty) + if (tree_view->mark_rows_col_dirty) { - if (tree_view->priv->tree) - gtk_tree_rbtree_column_invalid (tree_view->priv->tree); - tree_view->priv->mark_rows_col_dirty = FALSE; + if (tree_view->tree) + gtk_tree_rbtree_column_invalid (tree_view->tree); + tree_view->mark_rows_col_dirty = FALSE; } validate_visible_area (tree_view); - if (tree_view->priv->presize_handler_tick_cb != 0) + if (tree_view->presize_handler_tick_cb != 0) { - gtk_widget_remove_tick_callback (GTK_WIDGET (tree_view), tree_view->priv->presize_handler_tick_cb); - tree_view->priv->presize_handler_tick_cb = 0; + gtk_widget_remove_tick_callback (GTK_WIDGET (tree_view), tree_view->presize_handler_tick_cb); + tree_view->presize_handler_tick_cb = 0; } - if (tree_view->priv->fixed_height_mode) + if (tree_view->fixed_height_mode) { GtkRequisition requisition; gtk_widget_get_preferred_size (GTK_WIDGET (tree_view), &requisition, NULL); - gtk_adjustment_set_upper (tree_view->priv->hadjustment, - MAX (gtk_adjustment_get_upper (tree_view->priv->hadjustment), requisition.width)); - gtk_adjustment_set_upper (tree_view->priv->vadjustment, - MAX (gtk_adjustment_get_upper (tree_view->priv->vadjustment), requisition.height)); + gtk_adjustment_set_upper (tree_view->hadjustment, + MAX (gtk_adjustment_get_upper (tree_view->hadjustment), requisition.width)); + gtk_adjustment_set_upper (tree_view->vadjustment, + MAX (gtk_adjustment_get_upper (tree_view->vadjustment), requisition.height)); gtk_widget_queue_resize (GTK_WIDGET (tree_view)); } @@ -6464,7 +6445,7 @@ validate_rows (GtkTreeView *tree_view) { gboolean retval; - if (tree_view->priv->presize_handler_tick_cb) + if (tree_view->presize_handler_tick_cb) { do_presize_handler (tree_view); return G_SOURCE_CONTINUE; @@ -6472,10 +6453,10 @@ validate_rows (GtkTreeView *tree_view) retval = do_validate_rows (tree_view, TRUE); - if (! retval && tree_view->priv->validate_rows_timer) + if (! retval && tree_view->validate_rows_timer) { - g_source_remove (tree_view->priv->validate_rows_timer); - tree_view->priv->validate_rows_timer = 0; + g_source_remove (tree_view->validate_rows_timer); + tree_view->validate_rows_timer = 0; maybe_reenable_adjustment_animation (tree_view); } @@ -6490,30 +6471,30 @@ install_presize_handler (GtkTreeView *tree_view) disable_adjustment_animation (tree_view); - if (! tree_view->priv->presize_handler_tick_cb) + if (! tree_view->presize_handler_tick_cb) { - tree_view->priv->presize_handler_tick_cb = + tree_view->presize_handler_tick_cb = gtk_widget_add_tick_callback (GTK_WIDGET (tree_view), presize_handler_callback, NULL, NULL); } - if (! tree_view->priv->validate_rows_timer) + if (! tree_view->validate_rows_timer) { - tree_view->priv->validate_rows_timer = + tree_view->validate_rows_timer = g_idle_add_full (GTK_TREE_VIEW_PRIORITY_VALIDATE, (GSourceFunc) validate_rows, tree_view, NULL); - g_source_set_name_by_id (tree_view->priv->validate_rows_timer, "[gtk] validate_rows"); + g_source_set_name_by_id (tree_view->validate_rows_timer, "[gtk] validate_rows"); } } static gboolean scroll_sync_handler (GtkTreeView *tree_view) { - if (gtk_tree_view_get_height (tree_view) <= gtk_adjustment_get_page_size (tree_view->priv->vadjustment)) - gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), 0); - else if (gtk_tree_row_reference_valid (tree_view->priv->top_row)) + if (gtk_tree_view_get_height (tree_view) <= gtk_adjustment_get_page_size (tree_view->vadjustment)) + gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->vadjustment), 0); + else if (gtk_tree_row_reference_valid (tree_view->top_row)) gtk_tree_view_top_row_to_dy (tree_view); else gtk_tree_view_dy_to_top_row (tree_view); - tree_view->priv->scroll_sync_timer = 0; + tree_view->scroll_sync_timer = 0; return FALSE; } @@ -6524,11 +6505,11 @@ install_scroll_sync_handler (GtkTreeView *tree_view) if (!gtk_widget_get_realized (GTK_WIDGET (tree_view))) return; - if (!tree_view->priv->scroll_sync_timer) + if (!tree_view->scroll_sync_timer) { - tree_view->priv->scroll_sync_timer = + tree_view->scroll_sync_timer = g_idle_add_full (GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC, (GSourceFunc) scroll_sync_handler, tree_view, NULL); - g_source_set_name_by_id (tree_view->priv->scroll_sync_timer, "[gtk] scroll_sync_handler"); + g_source_set_name_by_id (tree_view->scroll_sync_timer, "[gtk] scroll_sync_handler"); } } @@ -6537,17 +6518,17 @@ gtk_tree_view_set_top_row (GtkTreeView *tree_view, GtkTreePath *path, gint offset) { - gtk_tree_row_reference_free (tree_view->priv->top_row); + gtk_tree_row_reference_free (tree_view->top_row); if (!path) { - tree_view->priv->top_row = NULL; - tree_view->priv->top_row_dy = 0; + tree_view->top_row = NULL; + tree_view->top_row_dy = 0; } else { - tree_view->priv->top_row = gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), tree_view->priv->model, path); - tree_view->priv->top_row_dy = offset; + tree_view->top_row = gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), tree_view->model, path); + tree_view->top_row_dy = offset; } } @@ -6562,14 +6543,14 @@ gtk_tree_view_dy_to_top_row (GtkTreeView *tree_view) GtkTreeRBTree *tree; GtkTreeRBNode *node; - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) { gtk_tree_view_set_top_row (tree_view, NULL, 0); } else { - offset = gtk_tree_rbtree_find_offset (tree_view->priv->tree, - tree_view->priv->dy, + offset = gtk_tree_rbtree_find_offset (tree_view->tree, + tree_view->dy, &tree, &node); if (tree == NULL) @@ -6594,11 +6575,11 @@ gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view) int new_dy; /* Avoid recursive calls */ - if (tree_view->priv->in_top_row_to_dy) + if (tree_view->in_top_row_to_dy) return; - if (tree_view->priv->top_row) - path = gtk_tree_row_reference_get_path (tree_view->priv->top_row); + if (tree_view->top_row) + path = gtk_tree_row_reference_get_path (tree_view->top_row); else path = NULL; @@ -6613,16 +6594,16 @@ gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view) if (tree == NULL) { /* keep dy and set new toprow */ - gtk_tree_row_reference_free (tree_view->priv->top_row); - tree_view->priv->top_row = NULL; - tree_view->priv->top_row_dy = 0; + gtk_tree_row_reference_free (tree_view->top_row); + tree_view->top_row = NULL; + tree_view->top_row_dy = 0; /* DO NOT install the idle handler */ gtk_tree_view_dy_to_top_row (tree_view); return; } if (gtk_tree_view_get_row_height (tree_view, node) - < tree_view->priv->top_row_dy) + < tree_view->top_row_dy) { /* new top row -- do NOT install the idle handler */ gtk_tree_view_dy_to_top_row (tree_view); @@ -6630,16 +6611,16 @@ gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view) } new_dy = gtk_tree_rbtree_node_find_offset (tree, node); - new_dy += tree_view->priv->top_row_dy; + new_dy += tree_view->top_row_dy; - if (new_dy + gtk_adjustment_get_page_size (tree_view->priv->vadjustment) > gtk_tree_view_get_height (tree_view)) - new_dy = gtk_tree_view_get_height (tree_view) - gtk_adjustment_get_page_size (tree_view->priv->vadjustment); + if (new_dy + gtk_adjustment_get_page_size (tree_view->vadjustment) > gtk_tree_view_get_height (tree_view)) + new_dy = gtk_tree_view_get_height (tree_view) - gtk_adjustment_get_page_size (tree_view->vadjustment); new_dy = MAX (0, new_dy); - tree_view->priv->in_top_row_to_dy = TRUE; - gtk_adjustment_set_value (tree_view->priv->vadjustment, (gdouble)new_dy); - tree_view->priv->in_top_row_to_dy = FALSE; + tree_view->in_top_row_to_dy = TRUE; + gtk_adjustment_set_value (tree_view->vadjustment, (gdouble)new_dy); + tree_view->in_top_row_to_dy = FALSE; } @@ -6647,7 +6628,7 @@ void _gtk_tree_view_install_mark_rows_col_dirty (GtkTreeView *tree_view, gboolean install_handler) { - tree_view->priv->mark_rows_col_dirty = TRUE; + tree_view->mark_rows_col_dirty = TRUE; if (install_handler) install_presize_handler (tree_view); @@ -6837,20 +6818,20 @@ remove_info (GtkTreeView *tree_view) static void add_scroll_timeout (GtkTreeView *tree_view) { - if (tree_view->priv->scroll_timeout == 0) + if (tree_view->scroll_timeout == 0) { - tree_view->priv->scroll_timeout = g_timeout_add (150, scroll_row_timeout, tree_view); - g_source_set_name_by_id (tree_view->priv->scroll_timeout, "[gtk] scroll_row_timeout"); + tree_view->scroll_timeout = g_timeout_add (150, scroll_row_timeout, tree_view); + g_source_set_name_by_id (tree_view->scroll_timeout, "[gtk] scroll_row_timeout"); } } static void remove_scroll_timeout (GtkTreeView *tree_view) { - if (tree_view->priv->scroll_timeout != 0) + if (tree_view->scroll_timeout != 0) { - g_source_remove (tree_view->priv->scroll_timeout); - tree_view->priv->scroll_timeout = 0; + g_source_remove (tree_view->scroll_timeout); + tree_view->scroll_timeout = 0; } } @@ -6881,10 +6862,10 @@ check_model_dnd (GtkTreeModel *model, static void remove_open_timeout (GtkTreeView *tree_view) { - if (tree_view->priv->open_dest_timeout != 0) + if (tree_view->open_dest_timeout != 0) { - g_source_remove (tree_view->priv->open_dest_timeout); - tree_view->priv->open_dest_timeout = 0; + g_source_remove (tree_view->open_dest_timeout); + tree_view->open_dest_timeout = 0; } } @@ -6906,7 +6887,7 @@ open_row_timeout (gpointer data) pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)) { gtk_tree_view_expand_row (tree_view, dest_path, FALSE); - tree_view->priv->open_dest_timeout = 0; + tree_view->open_dest_timeout = 0; gtk_tree_path_free (dest_path); } @@ -6928,7 +6909,7 @@ scroll_row_timeout (gpointer data) gtk_tree_view_vertical_autoscroll (tree_view); - if (tree_view->priv->rubber_band_status == RUBBER_BAND_ACTIVE) + if (tree_view->rubber_band_status == RUBBER_BAND_ACTIVE) gtk_tree_view_update_rubber_band (tree_view); return TRUE; @@ -7127,12 +7108,12 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view) if (di == NULL || !di->source_set) goto out; - if (!gtk_gesture_is_recognized (tree_view->priv->drag_gesture)) + if (!gtk_gesture_is_recognized (tree_view->drag_gesture)) goto out; - gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), + gtk_gesture_drag_get_start_point (GTK_GESTURE_DRAG (tree_view->drag_gesture), &start_x, &start_y); - gtk_gesture_drag_get_offset (GTK_GESTURE_DRAG (tree_view->priv->drag_gesture), + gtk_gesture_drag_get_offset (GTK_GESTURE_DRAG (tree_view->drag_gesture), &offset_x, &offset_y); if (!gtk_drag_check_threshold (widget, 0, 0, offset_x, offset_y)) @@ -7143,10 +7124,10 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view) if (model == NULL) goto out; - button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (tree_view->priv->drag_gesture)); + button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (tree_view->drag_gesture)); /* Deny the click gesture */ - gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->click_gesture), + gtk_gesture_set_state (GTK_GESTURE (tree_view->click_gesture), GTK_EVENT_SEQUENCE_DENIED); gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, @@ -7168,11 +7149,11 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view) retval = TRUE; /* Now we can begin the drag */ - gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->drag_gesture), + gtk_gesture_set_state (GTK_GESTURE (tree_view->drag_gesture), GTK_EVENT_SEQUENCE_CLAIMED); drag = gtk_drag_begin (widget, - gtk_gesture_get_device (GTK_GESTURE (tree_view->priv->drag_gesture)), + gtk_gesture_get_device (GTK_GESTURE (tree_view->drag_gesture)), gtk_drag_source_get_target_list (widget), di->source_actions, start_x, start_y); @@ -7206,8 +7187,8 @@ gtk_tree_view_drag_begin (GtkWidget *widget, return; gtk_tree_view_get_path_at_pos (tree_view, - tree_view->priv->press_start_x, - tree_view->priv->press_start_y, + tree_view->press_start_x, + tree_view->press_start_y, &path, NULL, &cell_x, @@ -7224,7 +7205,7 @@ gtk_tree_view_drag_begin (GtkWidget *widget, row_pix = gtk_tree_view_create_row_drag_icon (tree_view, path); - gtk_drag_set_icon_paintable (drag, row_pix, tree_view->priv->press_start_x + 1, 1); + gtk_drag_set_icon_paintable (drag, row_pix, tree_view->press_start_x + 1, 1); g_object_unref (row_pix); gtk_tree_path_free (path); @@ -7236,8 +7217,8 @@ gtk_tree_view_drag_end (GtkWidget *widget, { GtkTreeView *tree_view = GTK_TREE_VIEW (widget); - tree_view->priv->event_last_x = -10000; - tree_view->priv->event_last_y = -10000; + tree_view->event_last_x = -10000; + tree_view->event_last_y = -10000; } /* Default signal implementations for the drag signals */ @@ -7338,8 +7319,8 @@ gtk_tree_view_drag_leave (GtkWidget *widget, remove_scroll_timeout (GTK_TREE_VIEW (widget)); remove_open_timeout (GTK_TREE_VIEW (widget)); - tree_view->priv->event_last_x = -10000; - tree_view->priv->event_last_y = -10000; + tree_view->event_last_x = -10000; + tree_view->event_last_y = -10000; } @@ -7361,13 +7342,13 @@ gtk_tree_view_drag_motion (GtkWidget *widget, if (!set_destination_row (tree_view, drop, x, y, &suggested_action, &target)) return FALSE; - tree_view->priv->event_last_x = x; - tree_view->priv->event_last_y = y; + tree_view->event_last_x = x; + tree_view->event_last_y = y; gtk_tree_view_get_drag_dest_row (tree_view, &path, &pos); /* we only know this *after* set_desination_row */ - empty = tree_view->priv->empty_view_drop; + empty = tree_view->empty_view_drop; if (path == NULL && !empty) { @@ -7376,13 +7357,13 @@ gtk_tree_view_drag_motion (GtkWidget *widget, } else { - if (tree_view->priv->open_dest_timeout == 0 && + if (tree_view->open_dest_timeout == 0 && (pos == GTK_TREE_VIEW_DROP_INTO_OR_AFTER || pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)) { - tree_view->priv->open_dest_timeout = + tree_view->open_dest_timeout = g_timeout_add (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view); - g_source_set_name_by_id (tree_view->priv->open_dest_timeout, "[gtk] open_row_timeout"); + g_source_set_name_by_id (tree_view->open_dest_timeout, "[gtk] open_row_timeout"); } else { @@ -7453,7 +7434,7 @@ gtk_tree_view_drag_drop (GtkWidget *widget, */ set_status_pending (drop, 0); set_dest_row (drop, model, path, - path_down_mode, tree_view->priv->empty_view_drop, + path_down_mode, tree_view->empty_view_drop, drop_append_mode); } @@ -7606,10 +7587,10 @@ gtk_tree_view_drag_data_received (GtkWidget *widget, if (gtk_tree_path_get_depth (dest_row) == 1 && gtk_tree_path_get_indices (dest_row)[0] == 0 && - gtk_tree_model_iter_n_children (tree_view->priv->model, NULL) != 0) + gtk_tree_model_iter_n_children (tree_view->model, NULL) != 0) { /* special special case drag to "0", scroll to first item */ - if (!tree_view->priv->scroll_to_path) + if (!tree_view->scroll_to_path) gtk_tree_view_scroll_to_cell (tree_view, dest_row, NULL, FALSE, 0.0, 0.0); } @@ -7632,7 +7613,7 @@ gtk_tree_view_remove (GtkContainer *container, GtkTreeViewChild *child = NULL; GList *tmp_list; - tmp_list = tree_view->priv->children; + tmp_list = tree_view->children; while (tmp_list) { child = tmp_list->data; @@ -7640,7 +7621,7 @@ gtk_tree_view_remove (GtkContainer *container, { gtk_widget_unparent (widget); - tree_view->priv->children = g_list_remove_link (tree_view->priv->children, tmp_list); + tree_view->children = g_list_remove_link (tree_view->children, tmp_list); g_list_free_1 (tmp_list); g_slice_free (GtkTreeViewChild, child); return; @@ -7649,7 +7630,7 @@ gtk_tree_view_remove (GtkContainer *container, tmp_list = tmp_list->next; } - tmp_list = tree_view->priv->columns; + tmp_list = tree_view->columns; while (tmp_list) { @@ -7677,7 +7658,7 @@ gtk_tree_view_forall (GtkContainer *container, GtkTreeViewChild *child = NULL; GList *tmp_list; - tmp_list = tree_view->priv->children; + tmp_list = tree_view->children; while (tmp_list) { child = tmp_list->data; @@ -7696,7 +7677,7 @@ gtk_tree_view_has_can_focus_cell (GtkTreeView *tree_view) { GList *list; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { GtkTreeViewColumn *column = list->data; @@ -7740,18 +7721,18 @@ gtk_tree_view_set_fixed_height_mode (GtkTreeView *tree_view, enable = enable != FALSE; - if (enable == tree_view->priv->fixed_height_mode) + if (enable == tree_view->fixed_height_mode) return; if (!enable) { - tree_view->priv->fixed_height_mode = 0; - tree_view->priv->fixed_height = -1; + tree_view->fixed_height_mode = 0; + tree_view->fixed_height = -1; } else { /* make sure all columns are of type FIXED */ - for (l = tree_view->priv->columns; l; l = l->next) + for (l = tree_view->columns; l; l = l->next) { GtkTreeViewColumn *c = l->data; @@ -7759,12 +7740,12 @@ gtk_tree_view_set_fixed_height_mode (GtkTreeView *tree_view, } /* yes, we really have to do this is in a separate loop */ - for (l = tree_view->priv->columns; l; l = l->next) + for (l = tree_view->columns; l; l = l->next) g_signal_connect (l->data, "notify::sizing", G_CALLBACK (column_sizing_notify), tree_view); - tree_view->priv->fixed_height_mode = 1; - tree_view->priv->fixed_height = -1; + tree_view->fixed_height_mode = 1; + tree_view->fixed_height = -1; } /* force a revalidation */ @@ -7784,7 +7765,7 @@ gtk_tree_view_set_fixed_height_mode (GtkTreeView *tree_view, gboolean gtk_tree_view_get_fixed_height_mode (GtkTreeView *tree_view) { - return tree_view->priv->fixed_height_mode; + return tree_view->fixed_height_mode; } /* Returns TRUE if the focus is within the headers, after the focus operation is @@ -7802,12 +7783,12 @@ gtk_tree_view_header_focus (GtkTreeView *tree_view, GList *tmp_list; gboolean rtl; - if (! tree_view->priv->headers_visible) + if (! tree_view->headers_visible) return FALSE; focus_child = gtk_widget_get_focus_child (GTK_WIDGET (tree_view)); - first_column = tree_view->priv->columns; + first_column = tree_view->columns; while (first_column) { column = GTK_TREE_VIEW_COLUMN (first_column->data); @@ -7826,7 +7807,7 @@ gtk_tree_view_header_focus (GtkTreeView *tree_view, if (first_column == NULL) return FALSE; - last_column = g_list_last (tree_view->priv->columns); + last_column = g_list_last (tree_view->columns); while (last_column) { column = GTK_TREE_VIEW_COLUMN (last_column->data); @@ -7851,8 +7832,8 @@ gtk_tree_view_header_focus (GtkTreeView *tree_view, case GTK_DIR_DOWN: if (focus_child == NULL) { - if (tree_view->priv->focus_column != NULL) - button = gtk_tree_view_column_get_button (tree_view->priv->focus_column); + if (tree_view->focus_column != NULL) + button = gtk_tree_view_column_get_button (tree_view->focus_column); else button = NULL; @@ -7870,8 +7851,8 @@ gtk_tree_view_header_focus (GtkTreeView *tree_view, case GTK_DIR_RIGHT: if (focus_child == NULL) { - if (tree_view->priv->focus_column != NULL) - focus_child = gtk_tree_view_column_get_button (tree_view->priv->focus_column); + if (tree_view->focus_column != NULL) + focus_child = gtk_tree_view_column_get_button (tree_view->focus_column); else if (dir == GTK_DIR_LEFT) focus_child = gtk_tree_view_column_get_button (GTK_TREE_VIEW_COLUMN (last_column->data)); else @@ -7889,7 +7870,7 @@ gtk_tree_view_header_focus (GtkTreeView *tree_view, } /* We need to move the focus among the row of buttons. */ - for (tmp_list = tree_view->priv->columns; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = tree_view->columns; tmp_list; tmp_list = tmp_list->next) if (gtk_tree_view_column_get_button (GTK_TREE_VIEW_COLUMN (tmp_list->data)) == focus_child) break; @@ -7933,7 +7914,7 @@ gtk_tree_view_header_focus (GtkTreeView *tree_view, */ if (focus_child) { - for (tmp_list = tree_view->priv->columns; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = tree_view->columns; tmp_list; tmp_list = tmp_list->next) if (gtk_tree_view_column_get_button (GTK_TREE_VIEW_COLUMN (tmp_list->data)) == focus_child) { _gtk_tree_view_set_focus_column (tree_view, GTK_TREE_VIEW_COLUMN (tmp_list->data)); @@ -7943,7 +7924,7 @@ gtk_tree_view_header_focus (GtkTreeView *tree_view, if (clamp_column_visible) { gtk_tree_view_clamp_column_visible (tree_view, - tree_view->priv->focus_column, + tree_view->focus_column, FALSE); } } @@ -8061,7 +8042,6 @@ static void gtk_tree_view_style_updated (GtkWidget *widget) { GtkTreeView *tree_view = GTK_TREE_VIEW (widget); - GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view); GList *list; GtkTreeViewColumn *column; GtkStyleContext *style_context; @@ -8071,8 +8051,8 @@ gtk_tree_view_style_updated (GtkWidget *widget) if (gtk_widget_get_realized (widget)) { - gtk_tree_view_set_grid_lines (tree_view, priv->grid_lines); - gtk_tree_view_set_enable_tree_lines (tree_view, priv->tree_lines_enabled); + gtk_tree_view_set_grid_lines (tree_view, tree_view->grid_lines); + gtk_tree_view_set_enable_tree_lines (tree_view, tree_view->tree_lines_enabled); } style_context = gtk_widget_get_style_context (widget); @@ -8080,18 +8060,18 @@ gtk_tree_view_style_updated (GtkWidget *widget) if (change == NULL || gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_SIZE)) { - for (list = priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { column = list->data; _gtk_tree_view_column_cell_set_dirty (column, TRUE); } - priv->fixed_height = -1; - gtk_tree_rbtree_mark_invalid (priv->tree); + tree_view->fixed_height = -1; + gtk_tree_rbtree_mark_invalid (tree_view->tree); } /* Invalidate expander size */ - priv->expander_size = -1; + tree_view->expander_size = -1; } static gboolean @@ -8108,13 +8088,13 @@ gtk_tree_view_real_move_cursor (GtkTreeView *tree_view, step == GTK_MOVEMENT_PAGES || step == GTK_MOVEMENT_BUFFER_ENDS, FALSE); - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return FALSE; if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return FALSE; gtk_tree_view_stop_editing (tree_view, FALSE); - tree_view->priv->draw_keyfocus = TRUE; + tree_view->draw_keyfocus = TRUE; gtk_widget_grab_focus (GTK_WIDGET (tree_view)); if (gtk_get_current_event_state (&state)) @@ -8131,9 +8111,9 @@ gtk_tree_view_real_move_cursor (GtkTreeView *tree_view, GDK_MODIFIER_INTENT_MODIFY_SELECTION); if ((state & modify_mod_mask) == modify_mod_mask) - tree_view->priv->modify_selection_pressed = TRUE; + tree_view->modify_selection_pressed = TRUE; if ((state & extend_mod_mask) == extend_mod_mask) - tree_view->priv->extend_selection_pressed = TRUE; + tree_view->extend_selection_pressed = TRUE; } /* else we assume not pressed */ @@ -8162,8 +8142,8 @@ gtk_tree_view_real_move_cursor (GtkTreeView *tree_view, g_assert_not_reached (); } - tree_view->priv->modify_selection_pressed = FALSE; - tree_view->priv->extend_selection_pressed = FALSE; + tree_view->modify_selection_pressed = FALSE; + tree_view->extend_selection_pressed = FALSE; return TRUE; } @@ -8193,7 +8173,7 @@ gtk_tree_view_put (GtkTreeView *tree_view, child->column = column; child->border = *border; - tree_view->priv->children = g_list_append (tree_view->priv->children, child); + tree_view->children = g_list_append (tree_view->children, child); gtk_widget_set_parent (child_widget, GTK_WIDGET (tree_view)); } @@ -8216,13 +8196,13 @@ gtk_tree_view_row_changed (GtkTreeModel *model, g_return_if_fail (path != NULL || iter != NULL); - if (tree_view->priv->cursor_node != NULL) - cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + if (tree_view->cursor_node != NULL) + cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); else cursor_path = NULL; - if (tree_view->priv->edited_column && + if (tree_view->edited_column && (cursor_path == NULL || gtk_tree_path_compare (cursor_path, path) == 0)) gtk_tree_view_stop_editing (tree_view, TRUE); @@ -8249,16 +8229,16 @@ gtk_tree_view_row_changed (GtkTreeModel *model, _gtk_tree_view_accessible_changed (tree_view, tree, node); - if (tree_view->priv->fixed_height_mode - && tree_view->priv->fixed_height >= 0) + if (tree_view->fixed_height_mode + && tree_view->fixed_height >= 0) { - gtk_tree_rbtree_node_set_height (tree, node, tree_view->priv->fixed_height); + gtk_tree_rbtree_node_set_height (tree, node, tree_view->fixed_height); gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } else { gtk_tree_rbtree_node_mark_invalid (tree, node); - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { GtkTreeViewColumn *column; @@ -8274,7 +8254,7 @@ gtk_tree_view_row_changed (GtkTreeModel *model, } done: - if (!tree_view->priv->fixed_height_mode && + if (!tree_view->fixed_height_mode && gtk_widget_get_realized (GTK_WIDGET (tree_view))) install_presize_handler (tree_view); if (free_path) @@ -8299,9 +8279,9 @@ gtk_tree_view_row_inserted (GtkTreeModel *model, g_return_if_fail (path != NULL || iter != NULL); - if (tree_view->priv->fixed_height_mode - && tree_view->priv->fixed_height >= 0) - height = tree_view->priv->fixed_height; + if (tree_view->fixed_height_mode + && tree_view->fixed_height >= 0) + height = tree_view->fixed_height; else height = 0; @@ -8313,10 +8293,10 @@ gtk_tree_view_row_inserted (GtkTreeModel *model, else if (iter == NULL) gtk_tree_model_get_iter (model, iter, path); - if (tree_view->priv->tree == NULL) - tree_view->priv->tree = gtk_tree_rbtree_new (); + if (tree_view->tree == NULL) + tree_view->tree = gtk_tree_rbtree_new (); - tree = tree_view->priv->tree; + tree = tree_view->tree; /* Update all row-references */ gtk_tree_row_reference_inserted (G_OBJECT (data), path); @@ -8364,7 +8344,7 @@ gtk_tree_view_row_inserted (GtkTreeModel *model, } /* ref the node */ - gtk_tree_model_ref_node (tree_view->priv->model, iter); + gtk_tree_model_ref_node (tree_view->model, iter); if (indices[depth - 1] == 0) { tmpnode = gtk_tree_rbtree_find_count (tree, 1); @@ -8448,14 +8428,14 @@ gtk_tree_view_row_has_child_toggled (GtkTreeModel *model, _gtk_tree_view_accessible_remove_state (tree_view, tree, node, GTK_CELL_RENDERER_EXPANDABLE); } - if (has_child && tree_view->priv->is_list) + if (has_child && tree_view->is_list) { - tree_view->priv->is_list = FALSE; - if (tree_view->priv->show_expanders) + tree_view->is_list = FALSE; + if (tree_view->show_expanders) { GList *list; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) if (gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (list->data))) { _gtk_tree_view_column_cell_set_dirty (GTK_TREE_VIEW_COLUMN (list->data), TRUE); @@ -8514,7 +8494,7 @@ gtk_tree_view_row_deleted (GtkTreeModel *model, gtk_tree_rbtree_traverse (tree, node, G_POST_ORDER, check_selection_helper, &selection_changed); - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) if (gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (list->data)) && gtk_tree_view_column_get_sizing (GTK_TREE_VIEW_COLUMN (list->data)) == GTK_TREE_VIEW_COLUMN_AUTOSIZE) _gtk_tree_view_column_cell_set_dirty ((GtkTreeViewColumn *)list->data, TRUE); @@ -8526,10 +8506,10 @@ gtk_tree_view_row_deleted (GtkTreeModel *model, gtk_tree_view_stop_editing (tree_view, TRUE); /* If the cursor row got deleted, move the cursor to the next row */ - if (tree_view->priv->cursor_node && - (tree_view->priv->cursor_node == node || - (node->children && (tree_view->priv->cursor_tree == node->children || - gtk_tree_rbtree_contains (node->children, tree_view->priv->cursor_tree))))) + if (tree_view->cursor_node && + (tree_view->cursor_node == node || + (node->children && (tree_view->cursor_tree == node->children || + gtk_tree_rbtree_contains (node->children, tree_view->cursor_tree))))) { GtkTreePath *cursor_path; @@ -8574,8 +8554,8 @@ gtk_tree_view_row_deleted (GtkTreeModel *model, if (tree->root->count == 1) { - if (tree_view->priv->tree == tree) - tree_view->priv->tree = NULL; + if (tree_view->tree == tree) + tree_view->tree = NULL; _gtk_tree_view_accessible_remove_state (tree_view, tree->parent_tree, tree->parent_node, @@ -8589,10 +8569,10 @@ gtk_tree_view_row_deleted (GtkTreeModel *model, gtk_tree_rbtree_remove_node (tree, node); } - if (! gtk_tree_row_reference_valid (tree_view->priv->top_row)) + if (! gtk_tree_row_reference_valid (tree_view->top_row)) { - gtk_tree_row_reference_free (tree_view->priv->top_row); - tree_view->priv->top_row = NULL; + gtk_tree_row_reference_free (tree_view->top_row); + tree_view->top_row = NULL; } install_scroll_sync_handler (tree_view); @@ -8611,7 +8591,7 @@ gtk_tree_view_row_deleted (GtkTreeModel *model, gtk_tree_view_real_set_cursor (tree_view, NULL, CLEAR_AND_SELECT | CURSOR_INVALID); } if (selection_changed) - g_signal_emit_by_name (tree_view->priv->selection, "changed"); + g_signal_emit_by_name (tree_view->selection, "changed"); } static void @@ -8644,14 +8624,14 @@ gtk_tree_view_rows_reordered (GtkTreeModel *model, /* We need to special case the parent path */ if (tree == NULL) - tree = tree_view->priv->tree; + tree = tree_view->tree; else tree = node->children; if (tree == NULL) return; - if (tree_view->priv->edited_column) + if (tree_view->edited_column) gtk_tree_view_stop_editing (tree_view, TRUE); /* we need to be unprelighted */ @@ -8692,7 +8672,7 @@ gtk_tree_view_get_background_xrange (GtkTreeView *tree_view, rtl = (_gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL); total_width = 0; - for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns)); + for (list = (rtl ? g_list_last (tree_view->columns) : g_list_first (tree_view->columns)); list; list = (rtl ? list->prev : list->next)) { @@ -8741,7 +8721,7 @@ gtk_tree_view_get_arrow_xrange (GtkTreeView *tree_view, expander_render_size = expander_size - (_TREE_VIEW_HORIZONTAL_SEPARATOR / 2); total_width = 0; - for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns)); + for (list = (rtl ? g_list_last (tree_view->columns) : g_list_first (tree_view->columns)); list; list = (rtl ? list->prev : list->next)) { @@ -8789,19 +8769,19 @@ gtk_tree_view_build_tree (GtkTreeView *tree_view, do { - gtk_tree_model_ref_node (tree_view->priv->model, iter); + gtk_tree_model_ref_node (tree_view->model, iter); temp = gtk_tree_rbtree_insert_after (tree, temp, 0, FALSE); - if (tree_view->priv->fixed_height > 0) + if (tree_view->fixed_height > 0) { if (GTK_TREE_RBNODE_FLAG_SET (temp, GTK_TREE_RBNODE_INVALID)) { - gtk_tree_rbtree_node_set_height (tree, temp, tree_view->priv->fixed_height); + gtk_tree_rbtree_node_set_height (tree, temp, tree_view->fixed_height); gtk_tree_rbtree_node_mark_valid (tree, temp); } } - if (tree_view->priv->is_list) + if (tree_view->is_list) continue; if (recurse) @@ -8809,17 +8789,17 @@ gtk_tree_view_build_tree (GtkTreeView *tree_view, GtkTreeIter child; if (!path) - path = gtk_tree_model_get_path (tree_view->priv->model, iter); + path = gtk_tree_model_get_path (tree_view->model, iter); else gtk_tree_path_next (path); - if (gtk_tree_model_iter_children (tree_view->priv->model, &child, iter)) + if (gtk_tree_model_iter_children (tree_view->model, &child, iter)) { gboolean expand; g_signal_emit (tree_view, tree_view_signals[TEST_EXPAND_ROW], 0, iter, path, &expand); - if (gtk_tree_model_iter_has_child (tree_view->priv->model, iter) + if (gtk_tree_model_iter_has_child (tree_view->model, iter) && !expand) { temp->children = gtk_tree_rbtree_new (); @@ -8830,13 +8810,13 @@ gtk_tree_view_build_tree (GtkTreeView *tree_view, } } - if (gtk_tree_model_iter_has_child (tree_view->priv->model, iter)) + if (gtk_tree_model_iter_has_child (tree_view->model, iter)) { if ((temp->flags>K_TREE_RBNODE_IS_PARENT) != GTK_TREE_RBNODE_IS_PARENT) temp->flags ^= GTK_TREE_RBNODE_IS_PARENT; } } - while (gtk_tree_model_iter_next (tree_view->priv->model, iter)); + while (gtk_tree_model_iter_next (tree_view->model, iter)); if (path) gtk_tree_path_free (path); @@ -8858,9 +8838,9 @@ gtk_tree_view_clamp_node_visible (GtkTreeView *tree_view, node_dy = gtk_tree_rbtree_node_find_offset (tree, node); height = gtk_tree_view_get_row_height (tree_view, node); if (! GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_INVALID) - && node_dy >= gtk_adjustment_get_value (tree_view->priv->vadjustment) - && node_dy + height <= (gtk_adjustment_get_value (tree_view->priv->vadjustment) - + gtk_adjustment_get_page_size (tree_view->priv->vadjustment))) + && node_dy >= gtk_adjustment_get_value (tree_view->vadjustment) + && node_dy + height <= (gtk_adjustment_get_value (tree_view->vadjustment) + + gtk_adjustment_get_page_size (tree_view->vadjustment))) return; path = _gtk_tree_path_new_from_rbtree (tree, node); @@ -8886,7 +8866,7 @@ gtk_tree_view_clamp_column_visible (GtkTreeView *tree_view, x = allocation.x; width = allocation.width; - if (width > gtk_adjustment_get_page_size (tree_view->priv->hadjustment)) + if (width > gtk_adjustment_get_page_size (tree_view->hadjustment)) { /* The column is larger than the horizontal page size. If the * column has cells which can be focused individually, then we make @@ -8909,26 +8889,26 @@ gtk_tree_view_clamp_column_visible (GtkTreeView *tree_view, if (gtk_tree_view_column_cell_get_position (column, focus_cell, &x, &width)) { - if (width < gtk_adjustment_get_page_size (tree_view->priv->hadjustment)) + if (width < gtk_adjustment_get_page_size (tree_view->hadjustment)) { - if (gtk_adjustment_get_value (tree_view->priv->hadjustment) + gtk_adjustment_get_page_size (tree_view->priv->hadjustment) < x + width) - gtk_adjustment_set_value (tree_view->priv->hadjustment, - x + width - gtk_adjustment_get_page_size (tree_view->priv->hadjustment)); - else if (gtk_adjustment_get_value (tree_view->priv->hadjustment) > x) - gtk_adjustment_set_value (tree_view->priv->hadjustment, x); + if (gtk_adjustment_get_value (tree_view->hadjustment) + gtk_adjustment_get_page_size (tree_view->hadjustment) < x + width) + gtk_adjustment_set_value (tree_view->hadjustment, + x + width - gtk_adjustment_get_page_size (tree_view->hadjustment)); + else if (gtk_adjustment_get_value (tree_view->hadjustment) > x) + gtk_adjustment_set_value (tree_view->hadjustment, x); } } } - gtk_adjustment_set_value (tree_view->priv->hadjustment, x); + gtk_adjustment_set_value (tree_view->hadjustment, x); } else { - if ((gtk_adjustment_get_value (tree_view->priv->hadjustment) + gtk_adjustment_get_page_size (tree_view->priv->hadjustment)) < (x + width)) - gtk_adjustment_set_value (tree_view->priv->hadjustment, - x + width - gtk_adjustment_get_page_size (tree_view->priv->hadjustment)); - else if (gtk_adjustment_get_value (tree_view->priv->hadjustment) > x) - gtk_adjustment_set_value (tree_view->priv->hadjustment, x); + if ((gtk_adjustment_get_value (tree_view->hadjustment) + gtk_adjustment_get_page_size (tree_view->hadjustment)) < (x + width)) + gtk_adjustment_set_value (tree_view->hadjustment, + x + width - gtk_adjustment_get_page_size (tree_view->hadjustment)); + else if (gtk_adjustment_get_value (tree_view->hadjustment) > x) + gtk_adjustment_set_value (tree_view->hadjustment, x); } } @@ -8984,7 +8964,7 @@ _gtk_tree_view_find_node (GtkTreeView *tree_view, GtkTreeRBNode **node) { GtkTreeRBNode *tmpnode = NULL; - GtkTreeRBTree *tmptree = tree_view->priv->tree; + GtkTreeRBTree *tmptree = tree_view->tree; gint *indices = gtk_tree_path_get_indices (path); gint depth = gtk_tree_path_get_depth (path); gint i = 0; @@ -9025,18 +9005,18 @@ gtk_tree_view_is_expander_column (GtkTreeView *tree_view, { GList *list; - if (tree_view->priv->is_list) + if (tree_view->is_list) return FALSE; - if (tree_view->priv->expander_column != NULL) + if (tree_view->expander_column != NULL) { - if (tree_view->priv->expander_column == column) + if (tree_view->expander_column == column) return TRUE; return FALSE; } else { - for (list = tree_view->priv->columns; + for (list = tree_view->columns; list; list = list->next) if (gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (list->data))) @@ -9050,7 +9030,7 @@ gtk_tree_view_is_expander_column (GtkTreeView *tree_view, static inline gboolean gtk_tree_view_draw_expanders (GtkTreeView *tree_view) { - if (!tree_view->priv->is_list && tree_view->priv->show_expanders) + if (!tree_view->is_list && tree_view->show_expanders) return TRUE; /* else */ return FALSE; @@ -9142,9 +9122,9 @@ gtk_tree_view_unref_and_check_selection_tree (GtkTreeView *tree_view, g_return_val_if_fail (node != NULL, FALSE); path = _gtk_tree_path_new_from_rbtree (tree, node); - gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_view->priv->model), + gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_view->model), &iter, path); - retval = gtk_tree_view_unref_tree_helper (GTK_TREE_MODEL (tree_view->priv->model), &iter, tree, node); + retval = gtk_tree_view_unref_tree_helper (GTK_TREE_MODEL (tree_view->model), &iter, tree, node); gtk_tree_path_free (path); return retval; @@ -9169,9 +9149,9 @@ gtk_tree_view_set_column_drag_info (GtkTreeView *tree_view, /* First, identify all possible drop spots */ if (rtl) - tmp_list = g_list_last (tree_view->priv->columns); + tmp_list = g_list_last (tree_view->columns); else - tmp_list = g_list_first (tree_view->priv->columns); + tmp_list = g_list_first (tree_view->columns); while (tmp_list) { @@ -9183,8 +9163,8 @@ gtk_tree_view_set_column_drag_info (GtkTreeView *tree_view, /* If it's not the column moving and func tells us to skip over the column, we continue. */ if (left_column != column && cur_column != column && - tree_view->priv->column_drop_func && - ! tree_view->priv->column_drop_func (tree_view, column, left_column, cur_column, tree_view->priv->column_drop_func_data)) + tree_view->column_drop_func && + ! tree_view->column_drop_func (tree_view, column, left_column, cur_column, tree_view->column_drop_func_data)) { left_column = cur_column; continue; @@ -9193,43 +9173,43 @@ gtk_tree_view_set_column_drag_info (GtkTreeView *tree_view, reorder->left_column = left_column; left_column = reorder->right_column = cur_column; - tree_view->priv->column_drag_info = g_list_append (tree_view->priv->column_drag_info, reorder); + tree_view->column_drag_info = g_list_append (tree_view->column_drag_info, reorder); } /* Add the last one */ - if (tree_view->priv->column_drop_func == NULL || + if (tree_view->column_drop_func == NULL || ((left_column != column) && - tree_view->priv->column_drop_func (tree_view, column, left_column, NULL, tree_view->priv->column_drop_func_data))) + tree_view->column_drop_func (tree_view, column, left_column, NULL, tree_view->column_drop_func_data))) { reorder = g_slice_new0 (GtkTreeViewColumnReorder); reorder->left_column = left_column; reorder->right_column = NULL; - tree_view->priv->column_drag_info = g_list_append (tree_view->priv->column_drag_info, reorder); + tree_view->column_drag_info = g_list_append (tree_view->column_drag_info, reorder); } /* We quickly check to see if it even makes sense to reorder columns. */ /* If there is nothing that can be moved, then we return */ - if (tree_view->priv->column_drag_info == NULL) + if (tree_view->column_drag_info == NULL) return; /* We know there are always 2 slots possbile, as you can always return column. */ /* If that's all there is, return */ - if (tree_view->priv->column_drag_info->next == NULL || - (tree_view->priv->column_drag_info->next->next == NULL && - ((GtkTreeViewColumnReorder *)tree_view->priv->column_drag_info->data)->right_column == column && - ((GtkTreeViewColumnReorder *)tree_view->priv->column_drag_info->next->data)->left_column == column)) + if (tree_view->column_drag_info->next == NULL || + (tree_view->column_drag_info->next->next == NULL && + ((GtkTreeViewColumnReorder *)tree_view->column_drag_info->data)->right_column == column && + ((GtkTreeViewColumnReorder *)tree_view->column_drag_info->next->data)->left_column == column)) { - for (tmp_list = tree_view->priv->column_drag_info; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = tree_view->column_drag_info; tmp_list; tmp_list = tmp_list->next) g_slice_free (GtkTreeViewColumnReorder, tmp_list->data); - g_list_free (tree_view->priv->column_drag_info); - tree_view->priv->column_drag_info = NULL; + g_list_free (tree_view->column_drag_info); + tree_view->column_drag_info = NULL; return; } /* We fill in the ranges for the columns, now that we've isolated them */ left = - TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER (tree_view); - for (tmp_list = tree_view->priv->column_drag_info; tmp_list; tmp_list = tmp_list->next) + for (tmp_list = tree_view->column_drag_info; tmp_list; tmp_list = tmp_list->next) { reorder = (GtkTreeViewColumnReorder *) tmp_list->data; @@ -9266,12 +9246,12 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, GtkWidget *button; GtkStyleContext *context; - g_return_if_fail (tree_view->priv->column_drag_info == NULL); - g_return_if_fail (tree_view->priv->cur_reorder == NULL); + g_return_if_fail (tree_view->column_drag_info == NULL); + g_return_if_fail (tree_view->cur_reorder == NULL); gtk_tree_view_set_column_drag_info (tree_view, column); - if (tree_view->priv->column_drag_info == NULL) + if (tree_view->column_drag_info == NULL) return; button = gtk_tree_view_column_get_button (column); @@ -9280,24 +9260,24 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, gtk_style_context_add_class (context, GTK_STYLE_CLASS_DND); gtk_widget_get_allocation (button, &button_allocation); - tree_view->priv->drag_column_x = button_allocation.x; - tree_view->priv->drag_column_y = button_allocation.y; + tree_view->drag_column_x = button_allocation.x; + tree_view->drag_column_y = button_allocation.y; - tree_view->priv->drag_column = column; + tree_view->drag_column = column; gtk_widget_grab_focus (GTK_WIDGET (tree_view)); - tree_view->priv->in_column_drag = TRUE; + tree_view->in_column_drag = TRUE; - gtk_gesture_set_state (tree_view->priv->column_drag_gesture, + gtk_gesture_set_state (tree_view->column_drag_gesture, GTK_EVENT_SEQUENCE_CLAIMED); } static inline gint gtk_tree_view_get_effective_header_height (GtkTreeView *tree_view) { - if (tree_view->priv->headers_visible) - return tree_view->priv->header_height; + if (tree_view->headers_visible) + return tree_view->header_height; else return 0; } @@ -9307,15 +9287,15 @@ _gtk_tree_view_get_row_separator_func (GtkTreeView *tree_view, GtkTreeViewRowSeparatorFunc *func, gpointer *data) { - *func = tree_view->priv->row_separator_func; - *data = tree_view->priv->row_separator_data; + *func = tree_view->row_separator_func; + *data = tree_view->row_separator_data; } GtkTreePath * _gtk_tree_view_get_anchor_path (GtkTreeView *tree_view) { - if (tree_view->priv->anchor) - return gtk_tree_row_reference_get_path (tree_view->priv->anchor); + if (tree_view->anchor) + return gtk_tree_row_reference_get_path (tree_view->anchor); return NULL; } @@ -9324,21 +9304,21 @@ void _gtk_tree_view_set_anchor_path (GtkTreeView *tree_view, GtkTreePath *anchor_path) { - if (tree_view->priv->anchor) + if (tree_view->anchor) { - gtk_tree_row_reference_free (tree_view->priv->anchor); - tree_view->priv->anchor = NULL; + gtk_tree_row_reference_free (tree_view->anchor); + tree_view->anchor = NULL; } - if (anchor_path && tree_view->priv->model) - tree_view->priv->anchor = - gtk_tree_row_reference_new (tree_view->priv->model, anchor_path); + if (anchor_path && tree_view->model) + tree_view->anchor = + gtk_tree_row_reference_new (tree_view->model, anchor_path); } GtkTreeRBTree * _gtk_tree_view_get_rbtree (GtkTreeView *tree_view) { - return tree_view->priv->tree; + return tree_view->tree; } gboolean @@ -9346,15 +9326,11 @@ _gtk_tree_view_get_cursor_node (GtkTreeView *tree_view, GtkTreeRBTree **tree, GtkTreeRBNode **node) { - GtkTreeViewPrivate *priv; - - priv = tree_view->priv; - - if (priv->cursor_node == NULL) + if (tree_view->cursor_node == NULL) return FALSE; - *tree = priv->cursor_tree; - *node = priv->cursor_node; + *tree = tree_view->cursor_tree; + *node = tree_view->cursor_node; return TRUE; } @@ -9362,19 +9338,19 @@ _gtk_tree_view_get_cursor_node (GtkTreeView *tree_view, GtkTreeViewColumn * _gtk_tree_view_get_focus_column (GtkTreeView *tree_view) { - return tree_view->priv->focus_column; + return tree_view->focus_column; } void _gtk_tree_view_set_focus_column (GtkTreeView *tree_view, GtkTreeViewColumn *column) { - GtkTreeViewColumn *old_column = tree_view->priv->focus_column; + GtkTreeViewColumn *old_column = tree_view->focus_column; if (old_column == column) return; - tree_view->priv->focus_column = column; + tree_view->focus_column = column; _gtk_tree_view_accessible_update_focus_column (tree_view, old_column, @@ -9416,8 +9392,8 @@ gtk_tree_view_snapshot_arrow (GtkTreeView *tree_view, if (GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_SELECTED)) flags |= GTK_CELL_RENDERER_SELECTED; - if (node == tree_view->priv->prelight_node && - tree_view->priv->arrow_prelit) + if (node == tree_view->prelight_node && + tree_view->arrow_prelit) flags |= GTK_CELL_RENDERER_PRELIT; state = gtk_cell_renderer_get_state (NULL, widget, flags); @@ -9455,14 +9431,14 @@ gtk_tree_view_focus_to_cursor (GtkTreeView *tree_view) { GtkTreePath *cursor_path; - if ((tree_view->priv->tree == NULL) || + if ((tree_view->tree == NULL) || (! gtk_widget_get_realized (GTK_WIDGET (tree_view)))) return; cursor_path = NULL; - if (tree_view->priv->cursor_node) - cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + if (tree_view->cursor_node) + cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); if (cursor_path == NULL) { @@ -9490,7 +9466,7 @@ gtk_tree_view_focus_to_cursor (GtkTreeView *tree_view) if (cursor_path) { - if (gtk_tree_selection_get_mode (tree_view->priv->selection) == GTK_SELECTION_MULTIPLE) + if (gtk_tree_selection_get_mode (tree_view->selection) == GTK_SELECTION_MULTIPLE) gtk_tree_view_real_set_cursor (tree_view, cursor_path, 0); else gtk_tree_view_real_set_cursor (tree_view, cursor_path, CLEAR_AND_SELECT); @@ -9499,15 +9475,15 @@ gtk_tree_view_focus_to_cursor (GtkTreeView *tree_view) if (cursor_path) { - tree_view->priv->draw_keyfocus = TRUE; + tree_view->draw_keyfocus = TRUE; gtk_widget_queue_draw (GTK_WIDGET (tree_view)); gtk_tree_path_free (cursor_path); - if (tree_view->priv->focus_column == NULL) + if (tree_view->focus_column == NULL) { GList *list; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { if (gtk_tree_view_column_get_visible (GTK_TREE_VIEW_COLUMN (list->data))) { @@ -9517,7 +9493,7 @@ gtk_tree_view_focus_to_cursor (GtkTreeView *tree_view) /* This happens when the treeview initially grabs focus and there * is no column in focus, here we explicitly focus into the first cell */ - cell_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->priv->focus_column)); + cell_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->focus_column)); if (!gtk_cell_area_get_focus_cell (cell_area)) { gboolean rtl; @@ -9548,26 +9524,26 @@ gtk_tree_view_move_cursor_up_down (GtkTreeView *tree_view, GtkCellRenderer *last_focus_cell = NULL; GtkTreeIter iter; - if (tree_view->priv->cursor_node == NULL) + if (tree_view->cursor_node == NULL) return; - cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); direction = count < 0 ? GTK_DIR_UP : GTK_DIR_DOWN; - if (tree_view->priv->focus_column) - cell_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->priv->focus_column)); + if (tree_view->focus_column) + cell_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->focus_column)); /* If focus stays in the area for this row, then just return for this round */ if (cell_area && (count == -1 || count == 1) && - gtk_tree_model_get_iter (tree_view->priv->model, &iter, cursor_path)) + gtk_tree_model_get_iter (tree_view->model, &iter, cursor_path)) { - gtk_tree_view_column_cell_set_cell_data (tree_view->priv->focus_column, - tree_view->priv->model, + gtk_tree_view_column_cell_set_cell_data (tree_view->focus_column, + tree_view->model, &iter, - GTK_TREE_RBNODE_FLAG_SET (tree_view->priv->cursor_node, GTK_TREE_RBNODE_IS_PARENT), - tree_view->priv->cursor_node->children ? TRUE : FALSE); + GTK_TREE_RBNODE_FLAG_SET (tree_view->cursor_node, GTK_TREE_RBNODE_IS_PARENT), + tree_view->cursor_node->children ? TRUE : FALSE); /* Save the last cell that had focus, if we hit the end of the view we'll give * focus back to it. */ @@ -9578,27 +9554,27 @@ gtk_tree_view_move_cursor_up_down (GtkTreeView *tree_view, return; } - selection_count = gtk_tree_selection_count_selected_rows (tree_view->priv->selection); - selectable = _gtk_tree_selection_row_is_selectable (tree_view->priv->selection, - tree_view->priv->cursor_node, + selection_count = gtk_tree_selection_count_selected_rows (tree_view->selection); + selectable = _gtk_tree_selection_row_is_selectable (tree_view->selection, + tree_view->cursor_node, cursor_path); if (selection_count == 0 - && gtk_tree_selection_get_mode (tree_view->priv->selection) != GTK_SELECTION_NONE - && !tree_view->priv->modify_selection_pressed + && gtk_tree_selection_get_mode (tree_view->selection) != GTK_SELECTION_NONE + && !tree_view->modify_selection_pressed && selectable) { /* Don't move the cursor, but just select the current node */ - new_cursor_tree = tree_view->priv->cursor_tree; - new_cursor_node = tree_view->priv->cursor_node; + new_cursor_tree = tree_view->cursor_tree; + new_cursor_node = tree_view->cursor_node; } else { if (count == -1) - gtk_tree_rbtree_prev_full (tree_view->priv->cursor_tree, tree_view->priv->cursor_node, + gtk_tree_rbtree_prev_full (tree_view->cursor_tree, tree_view->cursor_node, &new_cursor_tree, &new_cursor_node); else - gtk_tree_rbtree_next_full (tree_view->priv->cursor_tree, tree_view->priv->cursor_node, + gtk_tree_rbtree_next_full (tree_view->cursor_tree, tree_view->cursor_node, &new_cursor_tree, &new_cursor_node); } @@ -9621,21 +9597,21 @@ gtk_tree_view_move_cursor_up_down (GtkTreeView *tree_view, * If the list has only one item and multi-selection is set then select * the row (if not yet selected). */ - if (gtk_tree_selection_get_mode (tree_view->priv->selection) == GTK_SELECTION_MULTIPLE && + if (gtk_tree_selection_get_mode (tree_view->selection) == GTK_SELECTION_MULTIPLE && new_cursor_node == NULL) { if (count == -1) - gtk_tree_rbtree_next_full (tree_view->priv->cursor_tree, tree_view->priv->cursor_node, + gtk_tree_rbtree_next_full (tree_view->cursor_tree, tree_view->cursor_node, &new_cursor_tree, &new_cursor_node); else - gtk_tree_rbtree_prev_full (tree_view->priv->cursor_tree, tree_view->priv->cursor_node, + gtk_tree_rbtree_prev_full (tree_view->cursor_tree, tree_view->cursor_node, &new_cursor_tree, &new_cursor_node); if (new_cursor_node == NULL - && !GTK_TREE_RBNODE_FLAG_SET (tree_view->priv->cursor_node, GTK_TREE_RBNODE_IS_SELECTED)) + && !GTK_TREE_RBNODE_FLAG_SET (tree_view->cursor_node, GTK_TREE_RBNODE_IS_SELECTED)) { - new_cursor_node = tree_view->priv->cursor_node; - new_cursor_tree = tree_view->priv->cursor_tree; + new_cursor_node = tree_view->cursor_node; + new_cursor_tree = tree_view->cursor_tree; } else { @@ -9657,10 +9633,10 @@ gtk_tree_view_move_cursor_up_down (GtkTreeView *tree_view, else { gtk_tree_view_clamp_node_visible (tree_view, - tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + tree_view->cursor_tree, + tree_view->cursor_node); - if (!tree_view->priv->extend_selection_pressed) + if (!tree_view->extend_selection_pressed) { if (! gtk_widget_keynav_failed (GTK_WIDGET (tree_view), count < 0 ? @@ -9701,23 +9677,23 @@ gtk_tree_view_move_cursor_page_up_down (GtkTreeView *tree_view, if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return; - if (tree_view->priv->cursor_node == NULL) + if (tree_view->cursor_node == NULL) return; - old_cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + old_cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); - y = gtk_tree_rbtree_node_find_offset (tree_view->priv->cursor_tree, tree_view->priv->cursor_node); + y = gtk_tree_rbtree_node_find_offset (tree_view->cursor_tree, tree_view->cursor_node); window_y = RBTREE_Y_TO_TREE_WINDOW_Y (tree_view, y); - y += tree_view->priv->cursor_offset; - y += count * (int)gtk_adjustment_get_page_increment (tree_view->priv->vadjustment); - y = CLAMP (y, (gint)gtk_adjustment_get_lower (tree_view->priv->vadjustment), (gint)gtk_adjustment_get_upper (tree_view->priv->vadjustment)); + y += tree_view->cursor_offset; + y += count * (int)gtk_adjustment_get_page_increment (tree_view->vadjustment); + y = CLAMP (y, (gint)gtk_adjustment_get_lower (tree_view->vadjustment), (gint)gtk_adjustment_get_upper (tree_view->vadjustment)); if (y >= gtk_tree_view_get_height (tree_view)) y = gtk_tree_view_get_height (tree_view) - 1; - tree_view->priv->cursor_offset = - gtk_tree_rbtree_find_offset (tree_view->priv->tree, y, + tree_view->cursor_offset = + gtk_tree_rbtree_find_offset (tree_view->tree, y, &cursor_tree, &cursor_node); if (cursor_tree == NULL) @@ -9727,15 +9703,15 @@ gtk_tree_view_move_cursor_page_up_down (GtkTreeView *tree_view, return; } - if (tree_view->priv->cursor_offset + if (tree_view->cursor_offset > gtk_tree_view_get_row_height (tree_view, cursor_node)) { gtk_tree_rbtree_next_full (cursor_tree, cursor_node, &cursor_tree, &cursor_node); - tree_view->priv->cursor_offset -= gtk_tree_view_get_row_height (tree_view, cursor_node); + tree_view->cursor_offset -= gtk_tree_view_get_row_height (tree_view, cursor_node); } - y -= tree_view->priv->cursor_offset; + y -= tree_view->cursor_offset; cursor_path = _gtk_tree_path_new_from_rbtree (cursor_tree, cursor_node); start_cursor_tree = cursor_tree; @@ -9801,30 +9777,30 @@ gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view, if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return; - if (tree_view->priv->cursor_node == NULL) + if (tree_view->cursor_node == NULL) return; - cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); - if (gtk_tree_model_get_iter (tree_view->priv->model, &iter, cursor_path) == FALSE) + if (gtk_tree_model_get_iter (tree_view->model, &iter, cursor_path) == FALSE) { gtk_tree_path_free (cursor_path); return; } gtk_tree_path_free (cursor_path); - list = rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns); - if (tree_view->priv->focus_column) + list = rtl ? g_list_last (tree_view->columns) : g_list_first (tree_view->columns); + if (tree_view->focus_column) { /* Save the cell/area we are moving focus from, if moving the cursor * by one step hits the end we'll set focus back here */ - last_focus_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->priv->focus_column)); + last_focus_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->focus_column)); last_focus_cell = gtk_cell_area_get_focus_cell (last_focus_area); for (; list; list = (rtl ? list->prev : list->next)) { - if (list->data == tree_view->priv->focus_column) + if (list->data == tree_view->focus_column) break; } } @@ -9838,10 +9814,10 @@ gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view, goto loop_end; gtk_tree_view_column_cell_set_cell_data (column, - tree_view->priv->model, + tree_view->model, &iter, - GTK_TREE_RBNODE_FLAG_SET (tree_view->priv->cursor_node, GTK_TREE_RBNODE_IS_PARENT), - tree_view->priv->cursor_node->children ? TRUE : FALSE); + GTK_TREE_RBNODE_FLAG_SET (tree_view->cursor_node, GTK_TREE_RBNODE_IS_PARENT), + tree_view->cursor_node->children ? TRUE : FALSE); cell_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (column)); if (gtk_cell_area_focus (cell_area, direction)) @@ -9874,7 +9850,7 @@ gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view, } gtk_tree_view_clamp_column_visible (tree_view, - tree_view->priv->focus_column, TRUE); + tree_view->focus_column, TRUE); } static void @@ -9889,11 +9865,11 @@ gtk_tree_view_move_cursor_start_end (GtkTreeView *tree_view, if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return; - g_return_if_fail (tree_view->priv->tree != NULL); + g_return_if_fail (tree_view->tree != NULL); gtk_tree_view_get_cursor (tree_view, &old_path, NULL); - cursor_tree = tree_view->priv->tree; + cursor_tree = tree_view->tree; if (count == -1) { @@ -9950,10 +9926,10 @@ gtk_tree_view_real_select_all (GtkTreeView *tree_view) if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return FALSE; - if (gtk_tree_selection_get_mode (tree_view->priv->selection) != GTK_SELECTION_MULTIPLE) + if (gtk_tree_selection_get_mode (tree_view->selection) != GTK_SELECTION_MULTIPLE) return FALSE; - gtk_tree_selection_select_all (tree_view->priv->selection); + gtk_tree_selection_select_all (tree_view->selection); return TRUE; } @@ -9964,10 +9940,10 @@ gtk_tree_view_real_unselect_all (GtkTreeView *tree_view) if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return FALSE; - if (gtk_tree_selection_get_mode (tree_view->priv->selection) != GTK_SELECTION_MULTIPLE) + if (gtk_tree_selection_get_mode (tree_view->selection) != GTK_SELECTION_MULTIPLE) return FALSE; - gtk_tree_selection_unselect_all (tree_view->priv->selection); + gtk_tree_selection_unselect_all (tree_view->selection); return TRUE; } @@ -9986,11 +9962,11 @@ gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view, if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return FALSE; - if (tree_view->priv->cursor_node == NULL) + if (tree_view->cursor_node == NULL) return FALSE; - cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); _gtk_tree_view_find_node (tree_view, cursor_path, &cursor_tree, &cursor_node); @@ -10001,8 +9977,8 @@ gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view, return FALSE; } - if (!tree_view->priv->extend_selection_pressed && start_editing && - tree_view->priv->focus_column) + if (!tree_view->extend_selection_pressed && start_editing && + tree_view->focus_column) { if (gtk_tree_view_start_editing (tree_view, cursor_path, FALSE)) { @@ -10011,12 +9987,12 @@ gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view, } } - if (tree_view->priv->modify_selection_pressed) + if (tree_view->modify_selection_pressed) mode |= GTK_TREE_SELECT_MODE_TOGGLE; - if (tree_view->priv->extend_selection_pressed) + if (tree_view->extend_selection_pressed) mode |= GTK_TREE_SELECT_MODE_EXTEND; - _gtk_tree_selection_internal_select_node (tree_view->priv->selection, + _gtk_tree_selection_internal_select_node (tree_view->selection, cursor_node, cursor_tree, cursor_path, @@ -10037,9 +10013,9 @@ gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view, gtk_widget_grab_focus (GTK_WIDGET (tree_view)); gtk_widget_queue_draw (GTK_WIDGET (tree_view)); - if (!tree_view->priv->extend_selection_pressed) + if (!tree_view->extend_selection_pressed) gtk_tree_view_row_activated (tree_view, cursor_path, - tree_view->priv->focus_column); + tree_view->focus_column); gtk_tree_path_free (cursor_path); @@ -10056,15 +10032,15 @@ gtk_tree_view_real_toggle_cursor_row (GtkTreeView *tree_view) if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return FALSE; - if (tree_view->priv->cursor_node == NULL) + if (tree_view->cursor_node == NULL) return FALSE; - cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); - _gtk_tree_selection_internal_select_node (tree_view->priv->selection, - tree_view->priv->cursor_node, - tree_view->priv->cursor_tree, + _gtk_tree_selection_internal_select_node (tree_view->selection, + tree_view->cursor_node, + tree_view->cursor_tree, cursor_path, GTK_TREE_SELECT_MODE_TOGGLE, FALSE); @@ -10075,12 +10051,12 @@ gtk_tree_view_real_toggle_cursor_row (GtkTreeView *tree_view) */ _gtk_tree_view_find_node (tree_view, cursor_path, &new_tree, &new_node); - if (tree_view->priv->cursor_node != new_node) + if (tree_view->cursor_node != new_node) return FALSE; gtk_tree_view_clamp_node_visible (tree_view, - tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + tree_view->cursor_tree, + tree_view->cursor_node); gtk_widget_grab_focus (GTK_WIDGET (tree_view)); gtk_widget_queue_draw (GTK_WIDGET (tree_view)); @@ -10100,14 +10076,14 @@ gtk_tree_view_real_expand_collapse_cursor_row (GtkTreeView *tree_view, if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return FALSE; - if (tree_view->priv->cursor_node == NULL) + if (tree_view->cursor_node == NULL) return FALSE; - cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); /* Don't handle the event if we aren't an expander */ - if (!GTK_TREE_RBNODE_FLAG_SET (tree_view->priv->cursor_node, GTK_TREE_RBNODE_IS_PARENT)) + if (!GTK_TREE_RBNODE_FLAG_SET (tree_view->cursor_node, GTK_TREE_RBNODE_IS_PARENT)) return FALSE; if (!logical @@ -10117,15 +10093,15 @@ gtk_tree_view_real_expand_collapse_cursor_row (GtkTreeView *tree_view, if (expand) gtk_tree_view_real_expand_row (tree_view, cursor_path, - tree_view->priv->cursor_tree, - tree_view->priv->cursor_node, + tree_view->cursor_tree, + tree_view->cursor_node, open_all, TRUE); else gtk_tree_view_real_collapse_row (tree_view, cursor_path, - tree_view->priv->cursor_tree, - tree_view->priv->cursor_node, + tree_view->cursor_tree, + tree_view->cursor_node, TRUE); gtk_tree_path_free (cursor_path); @@ -10142,13 +10118,13 @@ gtk_tree_view_real_select_cursor_parent (GtkTreeView *tree_view) if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) goto out; - if (tree_view->priv->cursor_node == NULL) + if (tree_view->cursor_node == NULL) goto out; - cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + cursor_path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); - if (tree_view->priv->cursor_tree->parent_node) + if (tree_view->cursor_tree->parent_node) { gtk_widget_queue_draw (GTK_WIDGET (tree_view)); @@ -10163,7 +10139,7 @@ gtk_tree_view_real_select_cursor_parent (GtkTreeView *tree_view) GDK_MODIFIER_INTENT_MODIFY_SELECTION); if ((state & modify_mod_mask) == modify_mod_mask) - tree_view->priv->modify_selection_pressed = TRUE; + tree_view->modify_selection_pressed = TRUE; } gtk_tree_view_real_set_cursor (tree_view, cursor_path, CLEAR_AND_SELECT | CLAMP_NODE); @@ -10171,22 +10147,22 @@ gtk_tree_view_real_select_cursor_parent (GtkTreeView *tree_view) gtk_widget_grab_focus (GTK_WIDGET (tree_view)); - tree_view->priv->modify_selection_pressed = FALSE; + tree_view->modify_selection_pressed = FALSE; return TRUE; } out: - tree_view->priv->search_entry_avoid_unhandled_binding = TRUE; + tree_view->search_entry_avoid_unhandled_binding = TRUE; return FALSE; } static gboolean gtk_tree_view_search_entry_flush_timeout (GtkTreeView *tree_view) { - gtk_tree_view_search_window_hide (tree_view->priv->search_window, tree_view, NULL); - tree_view->priv->typeselect_flush_timeout = 0; + gtk_tree_view_search_window_hide (tree_view->search_window, tree_view, NULL); + tree_view->typeselect_flush_timeout = 0; return FALSE; } @@ -10235,78 +10211,78 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view) GtkEventController *controller; GtkGesture *gesture; - if (tree_view->priv->search_custom_entry_set) + if (tree_view->search_custom_entry_set) return; toplevel = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (tree_view))); display = gtk_widget_get_display (GTK_WIDGET (tree_view)); - if (tree_view->priv->search_window != NULL) + if (tree_view->search_window != NULL) { if (gtk_window_has_group (GTK_WINDOW (toplevel))) gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (toplevel)), - GTK_WINDOW (tree_view->priv->search_window)); - else if (gtk_window_has_group (GTK_WINDOW (tree_view->priv->search_window))) - gtk_window_group_remove_window (gtk_window_get_group (GTK_WINDOW (tree_view->priv->search_window)), - GTK_WINDOW (tree_view->priv->search_window)); + GTK_WINDOW (tree_view->search_window)); + else if (gtk_window_has_group (GTK_WINDOW (tree_view->search_window))) + gtk_window_group_remove_window (gtk_window_get_group (GTK_WINDOW (tree_view->search_window)), + GTK_WINDOW (tree_view->search_window)); - gtk_window_set_display (GTK_WINDOW (tree_view->priv->search_window), display); + gtk_window_set_display (GTK_WINDOW (tree_view->search_window), display); return; } - tree_view->priv->search_window = gtk_window_new (GTK_WINDOW_POPUP); - gtk_window_set_display (GTK_WINDOW (tree_view->priv->search_window), display); + tree_view->search_window = gtk_window_new (GTK_WINDOW_POPUP); + gtk_window_set_display (GTK_WINDOW (tree_view->search_window), display); if (gtk_window_has_group (GTK_WINDOW (toplevel))) gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (toplevel)), - GTK_WINDOW (tree_view->priv->search_window)); + GTK_WINDOW (tree_view->search_window)); - gtk_window_set_type_hint (GTK_WINDOW (tree_view->priv->search_window), + gtk_window_set_type_hint (GTK_WINDOW (tree_view->search_window), GDK_SURFACE_TYPE_HINT_UTILITY); - gtk_window_set_modal (GTK_WINDOW (tree_view->priv->search_window), TRUE); - gtk_window_set_transient_for (GTK_WINDOW (tree_view->priv->search_window), + gtk_window_set_modal (GTK_WINDOW (tree_view->search_window), TRUE); + gtk_window_set_transient_for (GTK_WINDOW (tree_view->search_window), GTK_WINDOW (toplevel)); controller = gtk_event_controller_key_new (); g_signal_connect (controller, "key-pressed", G_CALLBACK (gtk_tree_view_search_key_pressed), tree_view); - gtk_widget_add_controller (tree_view->priv->search_window, controller); + gtk_widget_add_controller (tree_view->search_window, controller); gesture = gtk_gesture_click_new (); g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_tree_view_search_pressed_cb), tree_view); - gtk_widget_add_controller (tree_view->priv->search_window, GTK_EVENT_CONTROLLER (gesture)); + gtk_widget_add_controller (tree_view->search_window, GTK_EVENT_CONTROLLER (gesture)); controller = gtk_event_controller_scroll_new (GTK_EVENT_CONTROLLER_SCROLL_VERTICAL); g_signal_connect (controller, "scroll", G_CALLBACK (gtk_tree_view_search_scroll_event), tree_view); - gtk_widget_add_controller (tree_view->priv->search_window, controller); + gtk_widget_add_controller (tree_view->search_window, controller); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_widget_show (frame); - gtk_container_add (GTK_CONTAINER (tree_view->priv->search_window), frame); + gtk_container_add (GTK_CONTAINER (tree_view->search_window), frame); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (frame), vbox); /* add entry */ - tree_view->priv->search_entry = gtk_text_new (); - g_signal_connect (tree_view->priv->search_entry, "activate", + tree_view->search_entry = gtk_text_new (); + g_signal_connect (tree_view->search_entry, "activate", G_CALLBACK (gtk_tree_view_search_activate), tree_view); - g_signal_connect (tree_view->priv->search_entry, "preedit-changed", + g_signal_connect (tree_view->search_entry, "preedit-changed", G_CALLBACK (gtk_tree_view_search_preedit_changed), tree_view); - g_signal_connect (tree_view->priv->search_entry, "changed", + g_signal_connect (tree_view->search_entry, "changed", G_CALLBACK (gtk_tree_view_search_changed), tree_view); gtk_container_add (GTK_CONTAINER (vbox), - tree_view->priv->search_entry); + tree_view->search_entry); - gtk_widget_realize (tree_view->priv->search_entry); + gtk_widget_realize (tree_view->search_entry); } /* Pops up the interactive search entry. If keybinding is TRUE then the user @@ -10324,17 +10300,17 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view, GList *list; gboolean found_focus = FALSE; - if (!tree_view->priv->enable_search && !keybinding) + if (!tree_view->enable_search && !keybinding) return FALSE; - if (tree_view->priv->search_custom_entry_set) + if (tree_view->search_custom_entry_set) return FALSE; - if (tree_view->priv->search_window != NULL && - gtk_widget_get_visible (tree_view->priv->search_window)) + if (tree_view->search_window != NULL && + gtk_widget_get_visible (tree_view->search_window)) return TRUE; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { GtkTreeViewColumn *column; GtkWidget *button; @@ -10357,43 +10333,43 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view, if (!found_focus) return FALSE; - if (tree_view->priv->search_column < 0) + if (tree_view->search_column < 0) return FALSE; gtk_tree_view_ensure_interactive_directory (tree_view); if (keybinding) - gtk_editable_set_text (GTK_EDITABLE (tree_view->priv->search_entry), ""); + gtk_editable_set_text (GTK_EDITABLE (tree_view->search_entry), ""); /* done, show it */ - tree_view->priv->search_position_func (tree_view, tree_view->priv->search_window, tree_view->priv->search_position_user_data); + tree_view->search_position_func (tree_view, tree_view->search_window, tree_view->search_position_user_data); /* Grab focus without selecting all the text. */ - if (GTK_IS_ENTRY (tree_view->priv->search_entry)) - gtk_entry_grab_focus_without_selecting (GTK_ENTRY (tree_view->priv->search_entry)); + if (GTK_IS_ENTRY (tree_view->search_entry)) + gtk_entry_grab_focus_without_selecting (GTK_ENTRY (tree_view->search_entry)); else - gtk_widget_grab_focus (tree_view->priv->search_entry); + gtk_widget_grab_focus (tree_view->search_entry); - gtk_widget_show (tree_view->priv->search_window); - if (tree_view->priv->search_entry_changed_id == 0) + gtk_widget_show (tree_view->search_window); + if (tree_view->search_entry_changed_id == 0) { - tree_view->priv->search_entry_changed_id = - g_signal_connect (tree_view->priv->search_entry, "changed", + tree_view->search_entry_changed_id = + g_signal_connect (tree_view->search_entry, "changed", G_CALLBACK (gtk_tree_view_search_init), tree_view); } - tree_view->priv->typeselect_flush_timeout = + tree_view->typeselect_flush_timeout = g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT, (GSourceFunc) gtk_tree_view_search_entry_flush_timeout, tree_view); - g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); + g_source_set_name_by_id (tree_view->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); /* send focus-in event */ - send_focus_change (tree_view->priv->search_entry, device, TRUE); + send_focus_change (tree_view->search_entry, device, TRUE); /* search first matching iter */ - gtk_tree_view_search_init (tree_view->priv->search_entry, tree_view); + gtk_tree_view_search_init (tree_view->search_entry, tree_view); return TRUE; } @@ -10417,18 +10393,18 @@ gtk_tree_view_adjustment_changed (GtkAdjustment *adjustment, gint dy; gtk_widget_get_allocation (GTK_WIDGET (tree_view), &allocation); - dy = tree_view->priv->dy - (int) gtk_adjustment_get_value (tree_view->priv->vadjustment); + dy = tree_view->dy - (int) gtk_adjustment_get_value (tree_view->vadjustment); if (dy != 0) { /* update our dy and top_row */ - tree_view->priv->dy = (int) gtk_adjustment_get_value (tree_view->priv->vadjustment); + tree_view->dy = (int) gtk_adjustment_get_value (tree_view->vadjustment); update_prelight (tree_view, - tree_view->priv->event_last_x, - tree_view->priv->event_last_y); + tree_view->event_last_x, + tree_view->event_last_y); - if (!tree_view->priv->in_top_row_to_dy) + if (!tree_view->in_top_row_to_dy) gtk_tree_view_dy_to_top_row (tree_view); } @@ -10487,7 +10463,7 @@ gtk_tree_view_get_model (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL); - return tree_view->priv->model; + return tree_view->model; } /** @@ -10506,77 +10482,77 @@ gtk_tree_view_set_model (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model)); - if (model == tree_view->priv->model) + if (model == tree_view->model) return; - if (tree_view->priv->scroll_to_path) + if (tree_view->scroll_to_path) { - gtk_tree_row_reference_free (tree_view->priv->scroll_to_path); - tree_view->priv->scroll_to_path = NULL; + gtk_tree_row_reference_free (tree_view->scroll_to_path); + tree_view->scroll_to_path = NULL; } - if (tree_view->priv->rubber_band_status) + if (tree_view->rubber_band_status) gtk_tree_view_stop_rubber_band (tree_view); - if (tree_view->priv->model) + if (tree_view->model) { - GList *tmplist = tree_view->priv->columns; + GList *tmplist = tree_view->columns; - gtk_tree_view_unref_and_check_selection_tree (tree_view, tree_view->priv->tree); + gtk_tree_view_unref_and_check_selection_tree (tree_view, tree_view->tree); gtk_tree_view_stop_editing (tree_view, TRUE); - g_signal_handlers_disconnect_by_func (tree_view->priv->model, + g_signal_handlers_disconnect_by_func (tree_view->model, gtk_tree_view_row_changed, tree_view); - g_signal_handlers_disconnect_by_func (tree_view->priv->model, + g_signal_handlers_disconnect_by_func (tree_view->model, gtk_tree_view_row_inserted, tree_view); - g_signal_handlers_disconnect_by_func (tree_view->priv->model, + g_signal_handlers_disconnect_by_func (tree_view->model, gtk_tree_view_row_has_child_toggled, tree_view); - g_signal_handlers_disconnect_by_func (tree_view->priv->model, + g_signal_handlers_disconnect_by_func (tree_view->model, gtk_tree_view_row_deleted, tree_view); - g_signal_handlers_disconnect_by_func (tree_view->priv->model, + g_signal_handlers_disconnect_by_func (tree_view->model, gtk_tree_view_rows_reordered, tree_view); for (; tmplist; tmplist = tmplist->next) _gtk_tree_view_column_unset_model (tmplist->data, - tree_view->priv->model); + tree_view->model); - if (tree_view->priv->tree) + if (tree_view->tree) gtk_tree_view_free_rbtree (tree_view); - gtk_tree_row_reference_free (tree_view->priv->drag_dest_row); - tree_view->priv->drag_dest_row = NULL; - gtk_tree_row_reference_free (tree_view->priv->anchor); - tree_view->priv->anchor = NULL; - gtk_tree_row_reference_free (tree_view->priv->top_row); - tree_view->priv->top_row = NULL; - gtk_tree_row_reference_free (tree_view->priv->scroll_to_path); - tree_view->priv->scroll_to_path = NULL; + gtk_tree_row_reference_free (tree_view->drag_dest_row); + tree_view->drag_dest_row = NULL; + gtk_tree_row_reference_free (tree_view->anchor); + tree_view->anchor = NULL; + gtk_tree_row_reference_free (tree_view->top_row); + tree_view->top_row = NULL; + gtk_tree_row_reference_free (tree_view->scroll_to_path); + tree_view->scroll_to_path = NULL; - tree_view->priv->scroll_to_column = NULL; + tree_view->scroll_to_column = NULL; - g_object_unref (tree_view->priv->model); + g_object_unref (tree_view->model); - tree_view->priv->search_column = -1; - tree_view->priv->fixed_height_check = 0; - tree_view->priv->fixed_height = -1; - tree_view->priv->dy = tree_view->priv->top_row_dy = 0; + tree_view->search_column = -1; + tree_view->fixed_height_check = 0; + tree_view->fixed_height = -1; + tree_view->dy = tree_view->top_row_dy = 0; } - tree_view->priv->model = model; + tree_view->model = model; - if (tree_view->priv->model) + if (tree_view->model) { gint i; GtkTreePath *path; GtkTreeIter iter; GtkTreeModelFlags flags; - if (tree_view->priv->search_column == -1) + if (tree_view->search_column == -1) { for (i = 0; i < gtk_tree_model_get_n_columns (model); i++) { @@ -10584,46 +10560,46 @@ gtk_tree_view_set_model (GtkTreeView *tree_view, if (g_value_type_transformable (type, G_TYPE_STRING)) { - tree_view->priv->search_column = i; + tree_view->search_column = i; break; } } } - g_object_ref (tree_view->priv->model); - g_signal_connect (tree_view->priv->model, + g_object_ref (tree_view->model); + g_signal_connect (tree_view->model, "row-changed", G_CALLBACK (gtk_tree_view_row_changed), tree_view); - g_signal_connect (tree_view->priv->model, + g_signal_connect (tree_view->model, "row-inserted", G_CALLBACK (gtk_tree_view_row_inserted), tree_view); - g_signal_connect (tree_view->priv->model, + g_signal_connect (tree_view->model, "row-has-child-toggled", G_CALLBACK (gtk_tree_view_row_has_child_toggled), tree_view); - g_signal_connect (tree_view->priv->model, + g_signal_connect (tree_view->model, "row-deleted", G_CALLBACK (gtk_tree_view_row_deleted), tree_view); - g_signal_connect (tree_view->priv->model, + g_signal_connect (tree_view->model, "rows-reordered", G_CALLBACK (gtk_tree_view_rows_reordered), tree_view); - flags = gtk_tree_model_get_flags (tree_view->priv->model); + flags = gtk_tree_model_get_flags (tree_view->model); if ((flags & GTK_TREE_MODEL_LIST_ONLY) == GTK_TREE_MODEL_LIST_ONLY) - tree_view->priv->is_list = TRUE; + tree_view->is_list = TRUE; else - tree_view->priv->is_list = FALSE; + tree_view->is_list = FALSE; path = gtk_tree_path_new_first (); - if (gtk_tree_model_get_iter (tree_view->priv->model, &iter, path)) + if (gtk_tree_model_get_iter (tree_view->model, &iter, path)) { - tree_view->priv->tree = gtk_tree_rbtree_new (); - gtk_tree_view_build_tree (tree_view, tree_view->priv->tree, &iter, 1, FALSE); - _gtk_tree_view_accessible_add (tree_view, tree_view->priv->tree, NULL); + tree_view->tree = gtk_tree_rbtree_new (); + gtk_tree_view_build_tree (tree_view, tree_view->tree, &iter, 1, FALSE); + _gtk_tree_view_accessible_add (tree_view, tree_view->tree, NULL); } gtk_tree_path_free (path); @@ -10635,8 +10611,8 @@ gtk_tree_view_set_model (GtkTreeView *tree_view, g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_MODEL]); - if (tree_view->priv->selection) - _gtk_tree_selection_emit_changed (tree_view->priv->selection); + if (tree_view->selection) + _gtk_tree_selection_emit_changed (tree_view->selection); if (gtk_widget_get_realized (GTK_WIDGET (tree_view))) gtk_widget_queue_resize (GTK_WIDGET (tree_view)); @@ -10655,24 +10631,23 @@ gtk_tree_view_get_selection (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL); - return tree_view->priv->selection; + return tree_view->selection; } static void gtk_tree_view_do_set_hadjustment (GtkTreeView *tree_view, GtkAdjustment *adjustment) { - GtkTreeViewPrivate *priv = tree_view->priv; - if (adjustment && priv->hadjustment == adjustment) + if (adjustment && tree_view->hadjustment == adjustment) return; - if (priv->hadjustment != NULL) + if (tree_view->hadjustment != NULL) { - g_signal_handlers_disconnect_by_func (priv->hadjustment, + g_signal_handlers_disconnect_by_func (tree_view->hadjustment, gtk_tree_view_adjustment_changed, tree_view); - g_object_unref (priv->hadjustment); + g_object_unref (tree_view->hadjustment); } if (adjustment == NULL) @@ -10681,7 +10656,7 @@ gtk_tree_view_do_set_hadjustment (GtkTreeView *tree_view, g_signal_connect (adjustment, "value-changed", G_CALLBACK (gtk_tree_view_adjustment_changed), tree_view); - priv->hadjustment = g_object_ref_sink (adjustment); + tree_view->hadjustment = g_object_ref_sink (adjustment); /* FIXME: Adjustment should probably be populated here with fresh values, but * internal details are too complicated for me to decipher right now. */ @@ -10694,17 +10669,16 @@ static void gtk_tree_view_do_set_vadjustment (GtkTreeView *tree_view, GtkAdjustment *adjustment) { - GtkTreeViewPrivate *priv = tree_view->priv; - if (adjustment && priv->vadjustment == adjustment) + if (adjustment && tree_view->vadjustment == adjustment) return; - if (priv->vadjustment != NULL) + if (tree_view->vadjustment != NULL) { - g_signal_handlers_disconnect_by_func (priv->vadjustment, + g_signal_handlers_disconnect_by_func (tree_view->vadjustment, gtk_tree_view_adjustment_changed, tree_view); - g_object_unref (priv->vadjustment); + g_object_unref (tree_view->vadjustment); } if (adjustment == NULL) @@ -10713,7 +10687,7 @@ gtk_tree_view_do_set_vadjustment (GtkTreeView *tree_view, g_signal_connect (adjustment, "value-changed", G_CALLBACK (gtk_tree_view_adjustment_changed), tree_view); - priv->vadjustment = g_object_ref_sink (adjustment); + tree_view->vadjustment = g_object_ref_sink (adjustment); /* FIXME: Adjustment should probably be populated here with fresh values, but * internal details are too complicated for me to decipher right now. */ @@ -10736,7 +10710,7 @@ gtk_tree_view_get_headers_visible (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - return tree_view->priv->headers_visible; + return tree_view->headers_visible; } /** @@ -10758,10 +10732,10 @@ gtk_tree_view_set_headers_visible (GtkTreeView *tree_view, headers_visible = !! headers_visible; - if (tree_view->priv->headers_visible == headers_visible) + if (tree_view->headers_visible == headers_visible) return; - tree_view->priv->headers_visible = headers_visible == TRUE; + tree_view->headers_visible = headers_visible == TRUE; if (gtk_widget_get_realized (GTK_WIDGET (tree_view))) { @@ -10773,7 +10747,7 @@ gtk_tree_view_set_headers_visible (GtkTreeView *tree_view, else { - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { column = list->data; button = gtk_tree_view_column_get_button (column); @@ -10805,7 +10779,7 @@ gtk_tree_view_columns_autosize (GtkTreeView *tree_view) g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { column = list->data; if (gtk_tree_view_column_get_sizing (column) == GTK_TREE_VIEW_COLUMN_AUTOSIZE) @@ -10834,7 +10808,7 @@ gtk_tree_view_set_headers_clickable (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { if (gtk_tree_view_column_get_clickable (GTK_TREE_VIEW_COLUMN (list->data)) != setting) { @@ -10863,7 +10837,7 @@ gtk_tree_view_get_headers_clickable (GtkTreeView *tree_view) g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) if (!gtk_tree_view_column_get_clickable (GTK_TREE_VIEW_COLUMN (list->data))) return FALSE; @@ -10886,10 +10860,10 @@ gtk_tree_view_set_activate_on_single_click (GtkTreeView *tree_view, single = single != FALSE; - if (tree_view->priv->activate_on_single_click == single) + if (tree_view->activate_on_single_click == single) return; - tree_view->priv->activate_on_single_click = single; + tree_view->activate_on_single_click = single; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_ACTIVATE_ON_SINGLE_CLICK]); } @@ -10906,7 +10880,7 @@ gtk_tree_view_get_activate_on_single_click (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - return tree_view->priv->activate_on_single_click; + return tree_view->activate_on_single_click; } /* Public Column functions @@ -10953,36 +10927,36 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view, g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), -1); g_return_val_if_fail (gtk_tree_view_column_get_tree_view (column) == GTK_WIDGET (tree_view), -1); - if (tree_view->priv->focus_column == column) + if (tree_view->focus_column == column) _gtk_tree_view_set_focus_column (tree_view, NULL); - if (tree_view->priv->edited_column == column) + if (tree_view->edited_column == column) { gtk_tree_view_stop_editing (tree_view, TRUE); /* no need to, but just to be sure ... */ - tree_view->priv->edited_column = NULL; + tree_view->edited_column = NULL; } - if (tree_view->priv->expander_column == column) - tree_view->priv->expander_column = NULL; + if (tree_view->expander_column == column) + tree_view->expander_column = NULL; g_signal_handlers_disconnect_by_func (column, G_CALLBACK (column_sizing_notify), tree_view); - position = g_list_index (tree_view->priv->columns, column); + position = g_list_index (tree_view->columns, column); _gtk_tree_view_column_unset_tree_view (column); - tree_view->priv->columns = g_list_remove (tree_view->priv->columns, column); - tree_view->priv->n_columns--; + tree_view->columns = g_list_remove (tree_view->columns, column); + tree_view->n_columns--; if (gtk_widget_get_realized (GTK_WIDGET (tree_view))) { GList *list; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { GtkTreeViewColumn *tmp_column; @@ -10999,7 +10973,7 @@ gtk_tree_view_remove_column (GtkTreeView *tree_view, g_object_unref (column); g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); - return tree_view->priv->n_columns; + return tree_view->n_columns; } /** @@ -11024,21 +10998,21 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view, g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), -1); g_return_val_if_fail (gtk_tree_view_column_get_tree_view (column) == NULL, -1); - if (tree_view->priv->fixed_height_mode) + if (tree_view->fixed_height_mode) g_return_val_if_fail (gtk_tree_view_column_get_sizing (column) == GTK_TREE_VIEW_COLUMN_FIXED, -1); - if (position < 0 || position > tree_view->priv->n_columns) - position = tree_view->priv->n_columns; + if (position < 0 || position > tree_view->n_columns) + position = tree_view->n_columns; g_object_ref_sink (column); g_signal_connect (column, "notify::sizing", G_CALLBACK (column_sizing_notify), tree_view); - tree_view->priv->columns = g_list_insert (tree_view->priv->columns, + tree_view->columns = g_list_insert (tree_view->columns, column, position); - tree_view->priv->n_columns++; + tree_view->n_columns++; gtk_tree_view_update_button_position (tree_view, column); @@ -11050,7 +11024,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view, _gtk_tree_view_column_realize_button (column); - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { column = GTK_TREE_VIEW_COLUMN (list->data); if (gtk_tree_view_column_get_visible (column)) @@ -11063,7 +11037,7 @@ gtk_tree_view_insert_column (GtkTreeView *tree_view, g_signal_emit (tree_view, tree_view_signals[COLUMNS_CHANGED], 0); - return tree_view->priv->n_columns; + return tree_view->n_columns; } /** @@ -11097,7 +11071,7 @@ gtk_tree_view_insert_column_with_attributes (GtkTreeView *tree_view, g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), -1); column = gtk_tree_view_column_new (); - if (tree_view->priv->fixed_height_mode) + if (tree_view->fixed_height_mode) gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_title (column, title); @@ -11152,7 +11126,7 @@ gtk_tree_view_insert_column_with_data_func (GtkTreeView *tree_vie g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), -1); column = gtk_tree_view_column_new (); - if (tree_view->priv->fixed_height_mode) + if (tree_view->fixed_height_mode) gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_title (column, title); @@ -11175,7 +11149,7 @@ gtk_tree_view_get_n_columns (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), 0); - return tree_view->priv->n_columns; + return tree_view->n_columns; } /** @@ -11194,13 +11168,13 @@ gtk_tree_view_get_column (GtkTreeView *tree_view, { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL); - if (n < 0 || n >= tree_view->priv->n_columns) + if (n < 0 || n >= tree_view->n_columns) return NULL; - if (tree_view->priv->columns == NULL) + if (tree_view->columns == NULL) return NULL; - return GTK_TREE_VIEW_COLUMN (g_list_nth (tree_view->priv->columns, n)->data); + return GTK_TREE_VIEW_COLUMN (g_list_nth (tree_view->columns, n)->data); } /** @@ -11217,7 +11191,7 @@ gtk_tree_view_get_columns (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL); - return g_list_copy (tree_view->priv->columns); + return g_list_copy (tree_view->columns); } /** @@ -11238,26 +11212,26 @@ gtk_tree_view_move_column_after (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - column_list_el = g_list_find (tree_view->priv->columns, column); + column_list_el = g_list_find (tree_view->columns, column); g_return_if_fail (column_list_el != NULL); if (base_column) { - base_el = g_list_find (tree_view->priv->columns, base_column); + base_el = g_list_find (tree_view->columns, base_column); g_return_if_fail (base_el != NULL); } if (column_list_el->prev == base_el) return; - tree_view->priv->columns = g_list_remove_link (tree_view->priv->columns, column_list_el); + tree_view->columns = g_list_remove_link (tree_view->columns, column_list_el); if (base_el == NULL) { column_list_el->prev = NULL; - column_list_el->next = tree_view->priv->columns; + column_list_el->next = tree_view->columns; if (column_list_el->next) column_list_el->next->prev = column_list_el; - tree_view->priv->columns = column_list_el; + tree_view->columns = column_list_el; } else { @@ -11297,9 +11271,9 @@ gtk_tree_view_set_expander_column (GtkTreeView *tree_view, g_return_if_fail (column == NULL || GTK_IS_TREE_VIEW_COLUMN (column)); g_return_if_fail (column == NULL || gtk_tree_view_column_get_tree_view (column) == GTK_WIDGET (tree_view)); - if (tree_view->priv->expander_column != column) + if (tree_view->expander_column != column) { - tree_view->priv->expander_column = column; + tree_view->expander_column = column; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_EXPANDER_COLUMN]); } } @@ -11320,7 +11294,7 @@ gtk_tree_view_get_expander_column (GtkTreeView *tree_view) g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL); - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) if (gtk_tree_view_is_expander_column (tree_view, GTK_TREE_VIEW_COLUMN (list->data))) return (GtkTreeViewColumn *) list->data; return NULL; @@ -11352,12 +11326,12 @@ gtk_tree_view_set_column_drag_function (GtkTreeView *tree_view, { g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - if (tree_view->priv->column_drop_func_data_destroy) - tree_view->priv->column_drop_func_data_destroy (tree_view->priv->column_drop_func_data); + if (tree_view->column_drop_func_data_destroy) + tree_view->column_drop_func_data_destroy (tree_view->column_drop_func_data); - tree_view->priv->column_drop_func = func; - tree_view->priv->column_drop_func_data = user_data; - tree_view->priv->column_drop_func_data_destroy = destroy; + tree_view->column_drop_func = func; + tree_view->column_drop_func_data = user_data; + tree_view->column_drop_func_data_destroy = destroy; } /** @@ -11385,8 +11359,8 @@ gtk_tree_view_scroll_to_point (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (tree_view))); - hadj = tree_view->priv->hadjustment; - vadj = tree_view->priv->vadjustment; + hadj = tree_view->hadjustment; + vadj = tree_view->vadjustment; if (tree_x != -1) gtk_adjustment_animate_to_value (hadj, tree_x); @@ -11429,8 +11403,8 @@ gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view, gfloat col_align) { g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - g_return_if_fail (tree_view->priv->model != NULL); - g_return_if_fail (tree_view->priv->tree != NULL); + g_return_if_fail (tree_view->model != NULL); + g_return_if_fail (tree_view->tree != NULL); g_return_if_fail (row_align >= 0.0 && row_align <= 1.0); g_return_if_fail (col_align >= 0.0 && col_align <= 1.0); g_return_if_fail (path != NULL || column != NULL); @@ -11446,21 +11420,21 @@ gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view, if (!gtk_widget_get_visible (GTK_WIDGET (tree_view)) || !gtk_widget_get_realized (GTK_WIDGET (tree_view)) || _gtk_widget_get_alloc_needed (GTK_WIDGET (tree_view)) || - GTK_TREE_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_TREE_RBNODE_DESCENDANTS_INVALID)) + GTK_TREE_RBNODE_FLAG_SET (tree_view->tree->root, GTK_TREE_RBNODE_DESCENDANTS_INVALID)) { - if (tree_view->priv->scroll_to_path) - gtk_tree_row_reference_free (tree_view->priv->scroll_to_path); + if (tree_view->scroll_to_path) + gtk_tree_row_reference_free (tree_view->scroll_to_path); - tree_view->priv->scroll_to_path = NULL; - tree_view->priv->scroll_to_column = NULL; + tree_view->scroll_to_path = NULL; + tree_view->scroll_to_column = NULL; if (path) - tree_view->priv->scroll_to_path = gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), tree_view->priv->model, path); + tree_view->scroll_to_path = gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), tree_view->model, path); if (column) - tree_view->priv->scroll_to_column = column; - tree_view->priv->scroll_to_use_align = use_align; - tree_view->priv->scroll_to_row_align = row_align; - tree_view->priv->scroll_to_col_align = col_align; + tree_view->scroll_to_column = column; + tree_view->scroll_to_use_align = use_align; + tree_view->scroll_to_row_align = row_align; + tree_view->scroll_to_col_align = col_align; install_presize_handler (tree_view); } @@ -11546,7 +11520,7 @@ gtk_tree_view_expand_all_emission_helper (GtkTreeRBTree *tree, GtkTreeIter iter; path = _gtk_tree_path_new_from_rbtree (tree, node); - gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); + gtk_tree_model_get_iter (tree_view->model, &iter, path); g_signal_emit (tree_view, tree_view_signals[ROW_EXPANDED], 0, &iter, path); @@ -11576,7 +11550,7 @@ gtk_tree_view_expand_all (GtkTreeView *tree_view) g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return; path = gtk_tree_path_new_first (); @@ -11608,14 +11582,14 @@ gtk_tree_view_collapse_all (GtkTreeView *tree_view) g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return; path = gtk_tree_path_new (); gtk_tree_path_down (path); indices = gtk_tree_path_get_indices (path); - tree = tree_view->priv->tree; + tree = tree_view->tree; node = gtk_tree_rbtree_first (tree); while (node) @@ -11692,8 +11666,8 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view, if (! GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_PARENT)) return FALSE; - gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); - if (! gtk_tree_model_iter_has_child (tree_view->priv->model, &iter)) + gtk_tree_model_get_iter (tree_view->model, &iter, path); + if (! gtk_tree_model_iter_has_child (tree_view->model, &iter)) return FALSE; @@ -11726,7 +11700,7 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view, g_signal_emit (tree_view, tree_view_signals[TEST_EXPAND_ROW], 0, &iter, path, &expand); - if (!gtk_tree_model_iter_has_child (tree_view->priv->model, &iter)) + if (!gtk_tree_model_iter_has_child (tree_view->model, &iter)) return FALSE; if (expand) @@ -11736,7 +11710,7 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view, node->children->parent_tree = tree; node->children->parent_node = node; - gtk_tree_model_iter_children (tree_view->priv->model, &temp, &iter); + gtk_tree_model_iter_children (tree_view->model, &temp, &iter); gtk_tree_view_build_tree (tree_view, node->children, @@ -11783,7 +11757,7 @@ gtk_tree_view_expand_row (GtkTreeView *tree_view, GtkTreeRBNode *node; g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - g_return_val_if_fail (tree_view->priv->model != NULL, FALSE); + g_return_val_if_fail (tree_view->model != NULL, FALSE); g_return_val_if_fail (path != NULL, FALSE); if (_gtk_tree_view_find_node (tree_view, @@ -11818,7 +11792,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, if (node->children == NULL) return FALSE; - gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); + gtk_tree_model_get_iter (tree_view->model, &iter, path); g_signal_emit (tree_view, tree_view_signals[TEST_COLLAPSE_ROW], 0, &iter, path, &collapse); @@ -11828,13 +11802,13 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, /* if the prelighted node is a child of us, we want to unprelight it. We have * a chance to prelight the correct node below */ - if (tree_view->priv->prelight_tree) + if (tree_view->prelight_tree) { GtkTreeRBTree *parent_tree; GtkTreeRBNode *parent_node; - parent_tree = tree_view->priv->prelight_tree->parent_tree; - parent_node = tree_view->priv->prelight_tree->parent_node; + parent_tree = tree_view->prelight_tree->parent_tree; + parent_node = tree_view->prelight_tree->parent_node; while (parent_tree) { if (parent_tree == tree && parent_node == node) @@ -11847,9 +11821,9 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, } } - TREE_VIEW_INTERNAL_ASSERT (gtk_tree_model_iter_children (tree_view->priv->model, &children, &iter), FALSE); + TREE_VIEW_INTERNAL_ASSERT (gtk_tree_model_iter_children (tree_view->model, &children, &iter), FALSE); - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) { GtkTreeViewColumn *column = list->data; @@ -11859,21 +11833,21 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, _gtk_tree_view_column_cell_set_dirty (column, TRUE); } - if (tree_view->priv->cursor_node) + if (tree_view->cursor_node) { - cursor_changed = (node->children == tree_view->priv->cursor_tree) - || gtk_tree_rbtree_contains (node->children, tree_view->priv->cursor_tree); + cursor_changed = (node->children == tree_view->cursor_tree) + || gtk_tree_rbtree_contains (node->children, tree_view->cursor_tree); } else cursor_changed = FALSE; - if (gtk_tree_row_reference_valid (tree_view->priv->anchor)) + if (gtk_tree_row_reference_valid (tree_view->anchor)) { - GtkTreePath *anchor_path = gtk_tree_row_reference_get_path (tree_view->priv->anchor); + GtkTreePath *anchor_path = gtk_tree_row_reference_get_path (tree_view->anchor); if (gtk_tree_path_is_ancestor (path, anchor_path)) { - gtk_tree_row_reference_free (tree_view->priv->anchor); - tree_view->priv->anchor = NULL; + gtk_tree_row_reference_free (tree_view->anchor); + tree_view->anchor = NULL; } gtk_tree_path_free (anchor_path); } @@ -11881,7 +11855,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, selection_changed = gtk_tree_view_unref_and_check_selection_tree (tree_view, node->children); /* Stop a pending double click */ - gtk_event_controller_reset (GTK_EVENT_CONTROLLER (tree_view->priv->click_gesture)); + gtk_event_controller_reset (GTK_EVENT_CONTROLLER (tree_view->click_gesture)); _gtk_tree_view_accessible_remove (tree_view, node->children, NULL); _gtk_tree_view_accessible_remove_state (tree_view, @@ -11893,7 +11867,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, if (cursor_changed) gtk_tree_view_real_set_cursor (tree_view, path, CLEAR_AND_SELECT | CURSOR_INVALID); if (selection_changed) - g_signal_emit_by_name (tree_view->priv->selection, "changed"); + g_signal_emit_by_name (tree_view->selection, "changed"); if (gtk_widget_get_mapped (GTK_WIDGET (tree_view))) { @@ -11904,8 +11878,8 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, if (gtk_widget_get_mapped (GTK_WIDGET (tree_view))) update_prelight (tree_view, - tree_view->priv->event_last_x, - tree_view->priv->event_last_y); + tree_view->event_last_x, + tree_view->event_last_y); return TRUE; } @@ -11927,7 +11901,7 @@ gtk_tree_view_collapse_row (GtkTreeView *tree_view, GtkTreeRBNode *node; g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - g_return_val_if_fail (tree_view->priv->tree != NULL, FALSE); + g_return_val_if_fail (tree_view->tree != NULL, FALSE); g_return_val_if_fail (path != NULL, FALSE); if (_gtk_tree_view_find_node (tree_view, @@ -11991,7 +11965,7 @@ gtk_tree_view_map_expanded_rows (GtkTreeView *tree_view, path = gtk_tree_path_new_first (); gtk_tree_view_map_expanded_rows_helper (tree_view, - tree_view->priv->tree, + tree_view->tree, path, func, user_data); gtk_tree_path_free (path); @@ -12038,7 +12012,7 @@ gtk_tree_view_get_reorderable (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - return tree_view->priv->reorderable; + return tree_view->reorderable; } /** @@ -12069,7 +12043,7 @@ gtk_tree_view_set_reorderable (GtkTreeView *tree_view, reorderable = reorderable != FALSE; - if (tree_view->priv->reorderable == reorderable) + if (tree_view->reorderable == reorderable) return; if (reorderable) @@ -12096,7 +12070,7 @@ gtk_tree_view_set_reorderable (GtkTreeView *tree_view, gtk_tree_view_unset_rows_drag_dest (tree_view); } - tree_view->priv->reorderable = reorderable; + tree_view->reorderable = reorderable; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_REORDERABLE]); } @@ -12106,11 +12080,11 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view, GtkTreePath *path, SetCursorFlags flags) { - if (!(flags & CURSOR_INVALID) && tree_view->priv->cursor_node) + if (!(flags & CURSOR_INVALID) && tree_view->cursor_node) { _gtk_tree_view_accessible_remove_state (tree_view, - tree_view->priv->cursor_tree, - tree_view->priv->cursor_node, + tree_view->cursor_tree, + tree_view->cursor_node, GTK_CELL_RENDERER_FOCUSED); gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } @@ -12125,28 +12099,28 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view, row_is_separator (tree_view, NULL, path) || _gtk_tree_view_find_node (tree_view, path, - &tree_view->priv->cursor_tree, - &tree_view->priv->cursor_node)) + &tree_view->cursor_tree, + &tree_view->cursor_node)) { - tree_view->priv->cursor_tree = NULL; - tree_view->priv->cursor_node = NULL; + tree_view->cursor_tree = NULL; + tree_view->cursor_node = NULL; } - if (tree_view->priv->cursor_node != NULL) + if (tree_view->cursor_node != NULL) { GtkTreeRBTree *new_tree = NULL; GtkTreeRBNode *new_node = NULL; - if ((flags & CLEAR_AND_SELECT) && !tree_view->priv->modify_selection_pressed) + if ((flags & CLEAR_AND_SELECT) && !tree_view->modify_selection_pressed) { GtkTreeSelectMode mode = 0; - if (tree_view->priv->extend_selection_pressed) + if (tree_view->extend_selection_pressed) mode |= GTK_TREE_SELECT_MODE_EXTEND; - _gtk_tree_selection_internal_select_node (tree_view->priv->selection, - tree_view->priv->cursor_node, - tree_view->priv->cursor_tree, + _gtk_tree_selection_internal_select_node (tree_view->selection, + tree_view->cursor_node, + tree_view->cursor_tree, path, mode, FALSE); @@ -12158,21 +12132,21 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view, */ _gtk_tree_view_find_node (tree_view, path, &new_tree, &new_node); - if (tree_view->priv->cursor_node == NULL || - tree_view->priv->cursor_node != new_node) + if (tree_view->cursor_node == NULL || + tree_view->cursor_node != new_node) return; if (flags & CLAMP_NODE) { gtk_tree_view_clamp_node_visible (tree_view, - tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + tree_view->cursor_tree, + tree_view->cursor_node); gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } _gtk_tree_view_accessible_add_state (tree_view, - tree_view->priv->cursor_tree, - tree_view->priv->cursor_node, + tree_view->cursor_tree, + tree_view->cursor_node, GTK_CELL_RENDERER_FOCUSED); } @@ -12204,16 +12178,16 @@ gtk_tree_view_get_cursor (GtkTreeView *tree_view, if (path) { - if (tree_view->priv->cursor_node) - *path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + if (tree_view->cursor_node) + *path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); else *path = NULL; } if (focus_column) { - *focus_column = tree_view->priv->focus_column; + *focus_column = tree_view->focus_column; } } @@ -12280,7 +12254,7 @@ gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view, g_return_if_fail (path != NULL); g_return_if_fail (focus_column == NULL || GTK_IS_TREE_VIEW_COLUMN (focus_column)); - if (!tree_view->priv->model) + if (!tree_view->model) return; if (focus_cell) @@ -12290,9 +12264,9 @@ gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view, } /* cancel the current editing, if it exists */ - if (tree_view->priv->edited_column && + if (tree_view->edited_column && gtk_cell_area_get_edit_widget - (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->priv->edited_column)))) + (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_view->edited_column)))) gtk_tree_view_stop_editing (tree_view, TRUE); gtk_tree_view_real_set_cursor (tree_view, path, CLEAR_AND_SELECT | CLAMP_NODE); @@ -12303,7 +12277,7 @@ gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view, GList *list; gboolean column_in_tree = FALSE; - for (list = tree_view->priv->columns; list; list = list->next) + for (list = tree_view->columns; list; list = list->next) if (list->data == focus_column) { column_in_tree = TRUE; @@ -12371,10 +12345,10 @@ gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view, if (column) *column = NULL; - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return FALSE; - if (x > gtk_adjustment_get_upper (tree_view->priv->hadjustment)) + if (x > gtk_adjustment_get_upper (tree_view->hadjustment)) return FALSE; if (x < 0 || y < 0) @@ -12391,7 +12365,7 @@ gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view, gint width; rtl = (_gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL); - for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns)); + for (list = (rtl ? g_list_last (tree_view->columns) : g_list_first (tree_view->columns)); list; list = (rtl ? list->prev : list->next)) { @@ -12437,7 +12411,7 @@ gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view, } } - y_offset = gtk_tree_rbtree_find_offset (tree_view->priv->tree, + y_offset = gtk_tree_rbtree_find_offset (tree_view->tree, TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y), &tree, &node); @@ -12562,8 +12536,8 @@ gtk_tree_view_get_cell_area (GtkTreeView *tree_view, rtl = _gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL; if (!rtl) - rect->x += (depth - 1) * tree_view->priv->level_indentation; - rect->width -= (depth - 1) * tree_view->priv->level_indentation; + rect->x += (depth - 1) * tree_view->level_indentation; + rect->width -= (depth - 1) * tree_view->level_indentation; if (gtk_tree_view_draw_expanders (tree_view)) { @@ -12694,8 +12668,8 @@ gtk_tree_view_get_visible_rect (GtkTreeView *tree_view, if (visible_rect) { gtk_widget_get_allocation (widget, &allocation); - visible_rect->x = gtk_adjustment_get_value (tree_view->priv->hadjustment); - visible_rect->y = gtk_adjustment_get_value (tree_view->priv->vadjustment); + visible_rect->x = gtk_adjustment_get_value (tree_view->hadjustment); + visible_rect->y = gtk_adjustment_get_value (tree_view->vadjustment); visible_rect->width = allocation.width; visible_rect->height = allocation.height - gtk_tree_view_get_effective_header_height (tree_view); } @@ -12781,7 +12755,7 @@ gtk_tree_view_convert_widget_to_bin_window_coords (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); if (bx) - *bx = wx + gtk_adjustment_get_value (tree_view->priv->hadjustment); + *bx = wx + gtk_adjustment_get_value (tree_view->hadjustment); if (by) *by = wy - gtk_tree_view_get_effective_header_height (tree_view); } @@ -12806,7 +12780,7 @@ gtk_tree_view_convert_bin_window_to_widget_coords (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); if (wx) - *wx = bx - gtk_adjustment_get_value (tree_view->priv->hadjustment); + *wx = bx - gtk_adjustment_get_value (tree_view->hadjustment); if (wy) *wy = by + gtk_tree_view_get_effective_header_height (tree_view); } @@ -12834,7 +12808,7 @@ gtk_tree_view_convert_tree_to_bin_window_coords (GtkTreeView *tree_view, if (bx) *bx = tx; if (by) - *by = ty - tree_view->priv->dy; + *by = ty - tree_view->dy; } /** @@ -12860,7 +12834,7 @@ gtk_tree_view_convert_bin_window_to_tree_coords (GtkTreeView *tree_view, if (tx) *tx = bx; if (ty) - *ty = by + tree_view->priv->dy; + *ty = by + tree_view->dy; } @@ -12890,14 +12864,14 @@ gtk_tree_view_get_visible_range (GtkTreeView *tree_view, g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - if (!tree_view->priv->tree) + if (!tree_view->tree) return FALSE; retval = TRUE; if (start_path) { - gtk_tree_rbtree_find_offset (tree_view->priv->tree, + gtk_tree_rbtree_find_offset (tree_view->tree, TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, 0), &tree, &node); if (node) @@ -12910,12 +12884,12 @@ gtk_tree_view_get_visible_range (GtkTreeView *tree_view, { gint y; - if (gtk_tree_view_get_height (tree_view) < gtk_adjustment_get_page_size (tree_view->priv->vadjustment)) + if (gtk_tree_view_get_height (tree_view) < gtk_adjustment_get_page_size (tree_view->vadjustment)) y = gtk_tree_view_get_height (tree_view) - 1; else - y = TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, gtk_adjustment_get_page_size (tree_view->priv->vadjustment)) - 1; + y = TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, gtk_adjustment_get_page_size (tree_view->vadjustment)) - 1; - gtk_tree_rbtree_find_offset (tree_view->priv->tree, y, &tree, &node); + gtk_tree_rbtree_find_offset (tree_view->tree, y, &tree, &node); if (node) *end_path = _gtk_tree_path_new_from_rbtree (tree, node); else @@ -12990,11 +12964,11 @@ gtk_tree_view_is_blank_at_pos (GtkTreeView *tree_view, if (column) *column = real_column; - gtk_tree_model_get_iter (tree_view->priv->model, &iter, real_path); + gtk_tree_model_get_iter (tree_view->model, &iter, real_path); _gtk_tree_view_find_node (tree_view, real_path, &tree, &node); /* Check if there's an expander arrow at (x, y) */ - if (real_column == tree_view->priv->expander_column + if (real_column == tree_view->expander_column && gtk_tree_view_draw_expanders (tree_view)) { gboolean over_arrow; @@ -13011,7 +12985,7 @@ gtk_tree_view_is_blank_at_pos (GtkTreeView *tree_view, /* Otherwise, have the column see if there's a cell at (x, y) */ gtk_tree_view_column_cell_set_cell_data (real_column, - tree_view->priv->model, + tree_view->model, &iter, GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_PARENT), node->children ? TRUE : FALSE); @@ -13033,9 +13007,9 @@ gtk_tree_view_is_blank_at_pos (GtkTreeView *tree_view, static void unset_reorderable (GtkTreeView *tree_view) { - if (tree_view->priv->reorderable) + if (tree_view->reorderable) { - tree_view->priv->reorderable = FALSE; + tree_view->reorderable = FALSE; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_REORDERABLE]); } } @@ -13193,14 +13167,14 @@ gtk_tree_view_set_drag_dest_row (GtkTreeView *tree_view, current_dest = NULL; - if (tree_view->priv->drag_dest_row) + if (tree_view->drag_dest_row) { - current_dest = gtk_tree_row_reference_get_path (tree_view->priv->drag_dest_row); - gtk_tree_row_reference_free (tree_view->priv->drag_dest_row); + current_dest = gtk_tree_row_reference_get_path (tree_view->drag_dest_row); + gtk_tree_row_reference_free (tree_view->drag_dest_row); } /* special case a drop on an empty model */ - tree_view->priv->empty_view_drop = 0; + tree_view->empty_view_drop = 0; if (pos == GTK_TREE_VIEW_DROP_BEFORE && path && gtk_tree_path_get_depth (path) == 1 @@ -13208,23 +13182,23 @@ gtk_tree_view_set_drag_dest_row (GtkTreeView *tree_view, { gint n_children; - n_children = gtk_tree_model_iter_n_children (tree_view->priv->model, + n_children = gtk_tree_model_iter_n_children (tree_view->model, NULL); if (!n_children) - tree_view->priv->empty_view_drop = 1; + tree_view->empty_view_drop = 1; } - tree_view->priv->drag_dest_pos = pos; + tree_view->drag_dest_pos = pos; if (path) { - tree_view->priv->drag_dest_row = - gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), tree_view->priv->model, path); + tree_view->drag_dest_row = + gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), tree_view->model, path); gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } else - tree_view->priv->drag_dest_row = NULL; + tree_view->drag_dest_row = NULL; if (current_dest) { @@ -13251,11 +13225,11 @@ gtk_tree_view_get_drag_dest_row (GtkTreeView *tree_view, if (path) { - if (tree_view->priv->drag_dest_row) - *path = gtk_tree_row_reference_get_path (tree_view->priv->drag_dest_row); + if (tree_view->drag_dest_row) + *path = gtk_tree_row_reference_get_path (tree_view->drag_dest_row); else { - if (tree_view->priv->empty_view_drop) + if (tree_view->empty_view_drop) *path = gtk_tree_path_new_from_indices (0, -1); else *path = NULL; @@ -13263,7 +13237,7 @@ gtk_tree_view_get_drag_dest_row (GtkTreeView *tree_view, } if (pos) - *pos = tree_view->priv->drag_dest_pos; + *pos = tree_view->drag_dest_pos; } /** @@ -13310,7 +13284,7 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view, if (path) *path = NULL; - if (tree_view->priv->tree == NULL) + if (tree_view->tree == NULL) return FALSE; /* If in the top fourth of a row, we drop before that row; if @@ -13437,7 +13411,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, if (tree == NULL) return NULL; - if (!gtk_tree_model_get_iter (tree_view->priv->model, + if (!gtk_tree_model_get_iter (tree_view->model, &iter, path)) return NULL; @@ -13462,7 +13436,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, rtl = gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL; - for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns)); + for (list = (rtl ? g_list_last (tree_view->columns) : g_list_first (tree_view->columns)); list; list = (rtl ? list->prev : list->next)) { @@ -13472,7 +13446,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, if (!gtk_tree_view_column_get_visible (column)) continue; - gtk_tree_view_column_cell_set_cell_data (column, tree_view->priv->model, &iter, + gtk_tree_view_column_cell_set_cell_data (column, tree_view->model, &iter, GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_IS_PARENT), node->children?TRUE:FALSE); @@ -13484,8 +13458,8 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, if (gtk_tree_view_is_expander_column (tree_view, column)) { if (!rtl) - cell_area.x += (depth - 1) * tree_view->priv->level_indentation; - cell_area.width -= (depth - 1) * tree_view->priv->level_indentation; + cell_area.x += (depth - 1) * tree_view->level_indentation; + cell_area.width -= (depth - 1) * tree_view->level_indentation; if (gtk_tree_view_draw_expanders (tree_view)) { @@ -13561,9 +13535,9 @@ gtk_tree_view_set_enable_search (GtkTreeView *tree_view, enable_search = !!enable_search; - if (tree_view->priv->enable_search != enable_search) + if (tree_view->enable_search != enable_search) { - tree_view->priv->enable_search = enable_search; + tree_view->enable_search = enable_search; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_ENABLE_SEARCH]); } } @@ -13582,7 +13556,7 @@ gtk_tree_view_get_enable_search (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - return tree_view->priv->enable_search; + return tree_view->enable_search; } @@ -13599,7 +13573,7 @@ gtk_tree_view_get_search_column (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), -1); - return (tree_view->priv->search_column); + return (tree_view->search_column); } /** @@ -13624,10 +13598,10 @@ gtk_tree_view_set_search_column (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); g_return_if_fail (column >= -1); - if (tree_view->priv->search_column == column) + if (tree_view->search_column == column) return; - tree_view->priv->search_column = column; + tree_view->search_column = column; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_SEARCH_COLUMN]); } @@ -13645,7 +13619,7 @@ gtk_tree_view_get_search_equal_func (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL); - return tree_view->priv->search_equal_func; + return tree_view->search_equal_func; } /** @@ -13668,14 +13642,14 @@ gtk_tree_view_set_search_equal_func (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); g_return_if_fail (search_equal_func != NULL); - if (tree_view->priv->search_destroy) - tree_view->priv->search_destroy (tree_view->priv->search_user_data); + if (tree_view->search_destroy) + tree_view->search_destroy (tree_view->search_user_data); - tree_view->priv->search_equal_func = search_equal_func; - tree_view->priv->search_user_data = search_user_data; - tree_view->priv->search_destroy = search_destroy; - if (tree_view->priv->search_equal_func == NULL) - tree_view->priv->search_equal_func = gtk_tree_view_search_equal_func; + tree_view->search_equal_func = search_equal_func; + tree_view->search_user_data = search_user_data; + tree_view->search_destroy = search_destroy; + if (tree_view->search_equal_func == NULL) + tree_view->search_equal_func = gtk_tree_view_search_equal_func; } /** @@ -13693,8 +13667,8 @@ gtk_tree_view_get_search_entry (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL); - if (tree_view->priv->search_custom_entry_set) - return GTK_EDITABLE (tree_view->priv->search_entry); + if (tree_view->search_custom_entry_set) + return GTK_EDITABLE (tree_view->search_entry); return NULL; } @@ -13717,22 +13691,22 @@ gtk_tree_view_set_search_entry (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); g_return_if_fail (entry == NULL || GTK_IS_ENTRY (entry) || GTK_IS_SEARCH_ENTRY (entry)); - if (tree_view->priv->search_custom_entry_set) + if (tree_view->search_custom_entry_set) { - if (tree_view->priv->search_entry_changed_id) + if (tree_view->search_entry_changed_id) { - g_signal_handler_disconnect (tree_view->priv->search_entry, - tree_view->priv->search_entry_changed_id); - tree_view->priv->search_entry_changed_id = 0; + g_signal_handler_disconnect (tree_view->search_entry, + tree_view->search_entry_changed_id); + tree_view->search_entry_changed_id = 0; } - g_signal_handlers_disconnect_by_func (gtk_entry_get_key_controller (GTK_ENTRY (tree_view->priv->search_entry)), + g_signal_handlers_disconnect_by_func (gtk_entry_get_key_controller (GTK_ENTRY (tree_view->search_entry)), G_CALLBACK (gtk_tree_view_search_key_pressed), tree_view); - g_object_unref (tree_view->priv->search_entry); + g_object_unref (tree_view->search_entry); } - else if (tree_view->priv->search_window) + else if (tree_view->search_window) { gtk_tree_view_destroy_search_window (tree_view); } @@ -13741,13 +13715,13 @@ gtk_tree_view_set_search_entry (GtkTreeView *tree_view, { GtkEventController *controller; - tree_view->priv->search_entry = GTK_WIDGET (g_object_ref (entry)); - tree_view->priv->search_custom_entry_set = TRUE; + tree_view->search_entry = GTK_WIDGET (g_object_ref (entry)); + tree_view->search_custom_entry_set = TRUE; - if (tree_view->priv->search_entry_changed_id == 0) + if (tree_view->search_entry_changed_id == 0) { - tree_view->priv->search_entry_changed_id = - g_signal_connect (tree_view->priv->search_entry, "changed", + tree_view->search_entry_changed_id = + g_signal_connect (tree_view->search_entry, "changed", G_CALLBACK (gtk_tree_view_search_init), tree_view); } @@ -13759,12 +13733,12 @@ gtk_tree_view_set_search_entry (GtkTreeView *tree_view, g_signal_connect (controller, "key-pressed", G_CALLBACK (gtk_tree_view_search_key_pressed), tree_view); - gtk_tree_view_search_init (tree_view->priv->search_entry, tree_view); + gtk_tree_view_search_init (tree_view->search_entry, tree_view); } else { - tree_view->priv->search_entry = NULL; - tree_view->priv->search_custom_entry_set = FALSE; + tree_view->search_entry = NULL; + tree_view->search_custom_entry_set = FALSE; } } @@ -13786,14 +13760,14 @@ gtk_tree_view_set_search_position_func (GtkTreeView *tree_view { g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - if (tree_view->priv->search_position_destroy) - tree_view->priv->search_position_destroy (tree_view->priv->search_position_user_data); + if (tree_view->search_position_destroy) + tree_view->search_position_destroy (tree_view->search_position_user_data); - tree_view->priv->search_position_func = func; - tree_view->priv->search_position_user_data = user_data; - tree_view->priv->search_position_destroy = destroy; - if (tree_view->priv->search_position_func == NULL) - tree_view->priv->search_position_func = gtk_tree_view_search_position_func; + tree_view->search_position_func = func; + tree_view->search_position_user_data = user_data; + tree_view->search_position_destroy = destroy; + if (tree_view->search_position_func == NULL) + tree_view->search_position_func = gtk_tree_view_search_position_func; } /** @@ -13809,7 +13783,7 @@ gtk_tree_view_get_search_position_func (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL); - return tree_view->priv->search_position_func; + return tree_view->search_position_func; } @@ -13818,27 +13792,27 @@ gtk_tree_view_search_window_hide (GtkWidget *search_window, GtkTreeView *tree_view, GdkDevice *device) { - if (tree_view->priv->disable_popdown) + if (tree_view->disable_popdown) return; - if (tree_view->priv->search_entry_changed_id) + if (tree_view->search_entry_changed_id) { - g_signal_handler_disconnect (tree_view->priv->search_entry, - tree_view->priv->search_entry_changed_id); - tree_view->priv->search_entry_changed_id = 0; + g_signal_handler_disconnect (tree_view->search_entry, + tree_view->search_entry_changed_id); + tree_view->search_entry_changed_id = 0; } - if (tree_view->priv->typeselect_flush_timeout) + if (tree_view->typeselect_flush_timeout) { - g_source_remove (tree_view->priv->typeselect_flush_timeout); - tree_view->priv->typeselect_flush_timeout = 0; + g_source_remove (tree_view->typeselect_flush_timeout); + tree_view->typeselect_flush_timeout = 0; } if (gtk_widget_get_visible (search_window)) { /* send focus-in event */ - send_focus_change (GTK_WIDGET (tree_view->priv->search_entry), device, FALSE); + send_focus_change (GTK_WIDGET (tree_view->search_entry), device, FALSE); gtk_widget_hide (search_window); - gtk_editable_set_text (GTK_EDITABLE(tree_view->priv->search_entry), ""); + gtk_editable_set_text (GTK_EDITABLE(tree_view->search_entry), ""); send_focus_change (GTK_WIDGET (tree_view), device, TRUE); } } @@ -13858,15 +13832,15 @@ gtk_tree_view_search_preedit_changed (GtkText *text, const char *predit, GtkTreeView *tree_view) { - tree_view->priv->imcontext_changed = 1; - if (tree_view->priv->typeselect_flush_timeout) + tree_view->imcontext_changed = 1; + if (tree_view->typeselect_flush_timeout) { - g_source_remove (tree_view->priv->typeselect_flush_timeout); - tree_view->priv->typeselect_flush_timeout = + g_source_remove (tree_view->typeselect_flush_timeout); + tree_view->typeselect_flush_timeout = g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT, (GSourceFunc) gtk_tree_view_search_entry_flush_timeout, tree_view); - g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); + g_source_set_name_by_id (tree_view->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); } } @@ -13875,7 +13849,7 @@ static void gtk_tree_view_search_changed (GtkEditable *editable, GtkTreeView *tree_view) { - tree_view->priv->imcontext_changed = 1; + tree_view->imcontext_changed = 1; } static void @@ -13884,19 +13858,19 @@ gtk_tree_view_search_activate (GtkEntry *entry, { GtkTreePath *path; - gtk_tree_view_search_window_hide (tree_view->priv->search_window, + gtk_tree_view_search_window_hide (tree_view->search_window, tree_view, gtk_get_current_event_device ()); /* If we have a row selected and it's the cursor row, we activate * the row XXX */ - if (tree_view->priv->cursor_node && - GTK_TREE_RBNODE_FLAG_SET (tree_view->priv->cursor_node, GTK_TREE_RBNODE_IS_SELECTED)) + if (tree_view->cursor_node && + GTK_TREE_RBNODE_FLAG_SET (tree_view->cursor_node, GTK_TREE_RBNODE_IS_SELECTED)) { - path = _gtk_tree_path_new_from_rbtree (tree_view->priv->cursor_tree, - tree_view->priv->cursor_node); + path = _gtk_tree_path_new_from_rbtree (tree_view->cursor_tree, + tree_view->cursor_node); - gtk_tree_view_row_activated (tree_view, path, tree_view->priv->focus_column); + gtk_tree_view_row_activated (tree_view, path, tree_view->focus_column); gtk_tree_path_free (path); } @@ -13937,15 +13911,15 @@ gtk_tree_view_search_scroll_event (GtkWidget *widget, gtk_tree_view_search_move (widget, tree_view, FALSE); /* renew the flush timeout */ - if (tree_view->priv->typeselect_flush_timeout && - !tree_view->priv->search_custom_entry_set) + if (tree_view->typeselect_flush_timeout && + !tree_view->search_custom_entry_set) { - g_source_remove (tree_view->priv->typeselect_flush_timeout); - tree_view->priv->typeselect_flush_timeout = + g_source_remove (tree_view->typeselect_flush_timeout); + tree_view->typeselect_flush_timeout = g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT, (GSourceFunc) gtk_tree_view_search_entry_flush_timeout, tree_view); - g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); + g_source_set_name_by_id (tree_view->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); } return GDK_EVENT_STOP; @@ -13958,7 +13932,7 @@ gtk_tree_view_search_key_pressed (GtkEventControllerKey *key, GdkModifierType state, GtkTreeView *tree_view) { - GtkWidget *widget = tree_view->priv->search_entry; + GtkWidget *widget = tree_view->search_entry; GdkModifierType default_accel; gboolean retval = FALSE; @@ -13966,7 +13940,7 @@ gtk_tree_view_search_key_pressed (GtkEventControllerKey *key, g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); /* close window and cancel the search */ - if (!tree_view->priv->search_custom_entry_set + if (!tree_view->search_custom_entry_set && gtk_tree_view_search_key_cancels_search (keyval)) { gtk_tree_view_search_window_hide (widget, tree_view, @@ -14014,19 +13988,19 @@ gtk_tree_view_search_key_pressed (GtkEventControllerKey *key, } /* renew the flush timeout */ - if (retval && tree_view->priv->typeselect_flush_timeout - && !tree_view->priv->search_custom_entry_set) + if (retval && tree_view->typeselect_flush_timeout + && !tree_view->search_custom_entry_set) { - g_source_remove (tree_view->priv->typeselect_flush_timeout); - tree_view->priv->typeselect_flush_timeout = + g_source_remove (tree_view->typeselect_flush_timeout); + tree_view->typeselect_flush_timeout = g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT, (GSourceFunc) gtk_tree_view_search_entry_flush_timeout, tree_view); - g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); + g_source_set_name_by_id (tree_view->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); } if (!retval) - gtk_event_controller_key_forward (key, tree_view->priv->search_entry); + gtk_event_controller_key_forward (key, tree_view->search_entry); return retval; } @@ -14047,13 +14021,13 @@ gtk_tree_view_search_move (GtkWidget *window, GtkTreeModel *model; GtkTreeSelection *selection; - text = gtk_editable_get_text (GTK_EDITABLE (tree_view->priv->search_entry)); + text = gtk_editable_get_text (GTK_EDITABLE (tree_view->search_entry)); g_return_val_if_fail (text != NULL, FALSE); len = strlen (text); - if (up && tree_view->priv->selected_iter == 1) + if (up && tree_view->selected_iter == 1) return len < 1; if (len < 1) @@ -14068,12 +14042,12 @@ gtk_tree_view_search_move (GtkWidget *window, return TRUE; ret = gtk_tree_view_search_iter (model, selection, &iter, text, - &count, up?((tree_view->priv->selected_iter) - 1):((tree_view->priv->selected_iter + 1))); + &count, up?((tree_view->selected_iter) - 1):((tree_view->selected_iter + 1))); if (ret) { /* found */ - tree_view->priv->selected_iter += up?(-1):(1); + tree_view->selected_iter += up?(-1):(1); return TRUE; } else @@ -14083,7 +14057,7 @@ gtk_tree_view_search_move (GtkWidget *window, gtk_tree_model_get_iter_first (model, &iter); gtk_tree_view_search_iter (model, selection, &iter, text, - &count, tree_view->priv->selected_iter); + &count, tree_view->selected_iter); return FALSE; } } @@ -14163,7 +14137,7 @@ gtk_tree_view_search_iter (GtkTreeModel *model, do { - if (! tree_view->priv->search_equal_func (model, tree_view->priv->search_column, text, iter, tree_view->priv->search_user_data)) + if (! tree_view->search_equal_func (model, tree_view->search_column, text, iter, tree_view->search_user_data)) { (*count)++; if (*count == n) @@ -14269,15 +14243,15 @@ gtk_tree_view_search_init (GtkWidget *entry, /* search */ gtk_tree_selection_unselect_all (selection); - if (tree_view->priv->typeselect_flush_timeout - && !tree_view->priv->search_custom_entry_set) + if (tree_view->typeselect_flush_timeout + && !tree_view->search_custom_entry_set) { - g_source_remove (tree_view->priv->typeselect_flush_timeout); - tree_view->priv->typeselect_flush_timeout = + g_source_remove (tree_view->typeselect_flush_timeout); + tree_view->typeselect_flush_timeout = g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT, (GSourceFunc) gtk_tree_view_search_entry_flush_timeout, tree_view); - g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); + g_source_set_name_by_id (tree_view->typeselect_flush_timeout, "[gtk] gtk_tree_view_search_entry_flush_timeout"); } if (*text == '\0') @@ -14291,7 +14265,7 @@ gtk_tree_view_search_init (GtkWidget *entry, &count, 1); if (ret) - tree_view->priv->selected_iter = 1; + tree_view->selected_iter = 1; } void @@ -14299,12 +14273,12 @@ _gtk_tree_view_remove_editable (GtkTreeView *tree_view, GtkTreeViewColumn *column, GtkCellEditable *cell_editable) { - if (tree_view->priv->edited_column == NULL) + if (tree_view->edited_column == NULL) return; - g_return_if_fail (column == tree_view->priv->edited_column); + g_return_if_fail (column == tree_view->edited_column); - tree_view->priv->edited_column = NULL; + tree_view->edited_column = NULL; if (gtk_widget_has_focus (GTK_WIDGET (cell_editable))) gtk_widget_grab_focus (GTK_WIDGET (tree_view)); @@ -14329,8 +14303,8 @@ gtk_tree_view_start_editing (GtkTreeView *tree_view, GtkTreeRBTree *cursor_tree; GtkTreeRBNode *cursor_node; - g_assert (tree_view->priv->focus_column); - focus_column = tree_view->priv->focus_column; + g_assert (tree_view->focus_column); + focus_column = tree_view->focus_column; if (!gtk_widget_get_realized (GTK_WIDGET (tree_view))) return FALSE; @@ -14339,12 +14313,12 @@ gtk_tree_view_start_editing (GtkTreeView *tree_view, cursor_node == NULL) return FALSE; - gtk_tree_model_get_iter (tree_view->priv->model, &iter, cursor_path); + gtk_tree_model_get_iter (tree_view->model, &iter, cursor_path); validate_row (tree_view, cursor_tree, cursor_node, &iter, cursor_path); gtk_tree_view_column_cell_set_cell_data (focus_column, - tree_view->priv->model, + tree_view->model, &iter, GTK_TREE_RBNODE_FLAG_SET (cursor_node, GTK_TREE_RBNODE_IS_PARENT), cursor_node->children ? TRUE : FALSE); @@ -14373,11 +14347,11 @@ _gtk_tree_view_add_editable (GtkTreeView *tree_view, GdkRectangle full_area; GtkBorder border; - tree_view->priv->edited_column = column; + tree_view->edited_column = column; gtk_tree_view_real_set_cursor (tree_view, path, CLAMP_NODE); - tree_view->priv->draw_keyfocus = TRUE; + tree_view->draw_keyfocus = TRUE; gtk_tree_view_get_cell_area (tree_view, path, column, &full_area); border.left = cell_area->x - full_area.x; @@ -14398,22 +14372,22 @@ gtk_tree_view_stop_editing (GtkTreeView *tree_view, { GtkTreeViewColumn *column; - if (tree_view->priv->edited_column == NULL) + if (tree_view->edited_column == NULL) return; /* * This is very evil. We need to do this, because * gtk_cell_editable_editing_done may trigger gtk_tree_view_row_changed * later on. If gtk_tree_view_row_changed notices - * tree_view->priv->edited_column != NULL, it'll call + * tree_view->edited_column != NULL, it'll call * gtk_tree_view_stop_editing again. Bad things will happen then. * * Please read that again if you intend to modify anything here. */ - column = tree_view->priv->edited_column; + column = tree_view->edited_column; gtk_cell_area_stop_editing (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (column)), cancel_editing); - tree_view->priv->edited_column = NULL; + tree_view->edited_column = NULL; } @@ -14433,9 +14407,9 @@ gtk_tree_view_set_hover_selection (GtkTreeView *tree_view, { hover = hover != FALSE; - if (hover != tree_view->priv->hover_selection) + if (hover != tree_view->hover_selection) { - tree_view->priv->hover_selection = hover; + tree_view->hover_selection = hover; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_HOVER_SELECTION]); } @@ -14452,7 +14426,7 @@ gtk_tree_view_set_hover_selection (GtkTreeView *tree_view, gboolean gtk_tree_view_get_hover_selection (GtkTreeView *tree_view) { - return tree_view->priv->hover_selection; + return tree_view->hover_selection; } /** @@ -14470,9 +14444,9 @@ gtk_tree_view_set_hover_expand (GtkTreeView *tree_view, { expand = expand != FALSE; - if (expand != tree_view->priv->hover_expand) + if (expand != tree_view->hover_expand) { - tree_view->priv->hover_expand = expand; + tree_view->hover_expand = expand; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_HOVER_EXPAND]); } @@ -14489,7 +14463,7 @@ gtk_tree_view_set_hover_expand (GtkTreeView *tree_view, gboolean gtk_tree_view_get_hover_expand (GtkTreeView *tree_view) { - return tree_view->priv->hover_expand; + return tree_view->hover_expand; } /** @@ -14507,9 +14481,9 @@ gtk_tree_view_set_rubber_banding (GtkTreeView *tree_view, { enable = enable != FALSE; - if (enable != tree_view->priv->rubber_banding_enable) + if (enable != tree_view->rubber_banding_enable) { - tree_view->priv->rubber_banding_enable = enable; + tree_view->rubber_banding_enable = enable; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_RUBBER_BANDING]); } @@ -14528,7 +14502,7 @@ gtk_tree_view_set_rubber_banding (GtkTreeView *tree_view, gboolean gtk_tree_view_get_rubber_banding (GtkTreeView *tree_view) { - return tree_view->priv->rubber_banding_enable; + return tree_view->rubber_banding_enable; } /** @@ -14546,8 +14520,8 @@ gtk_tree_view_is_rubber_banding_active (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - if (tree_view->priv->rubber_banding_enable - && tree_view->priv->rubber_band_status == RUBBER_BAND_ACTIVE) + if (tree_view->rubber_banding_enable + && tree_view->rubber_band_status == RUBBER_BAND_ACTIVE) return TRUE; return FALSE; @@ -14566,7 +14540,7 @@ gtk_tree_view_get_row_separator_func (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL); - return tree_view->priv->row_separator_func; + return tree_view->row_separator_func; } /** @@ -14588,15 +14562,15 @@ gtk_tree_view_set_row_separator_func (GtkTreeView *tree_view, { g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - if (tree_view->priv->row_separator_destroy) - tree_view->priv->row_separator_destroy (tree_view->priv->row_separator_data); + if (tree_view->row_separator_destroy) + tree_view->row_separator_destroy (tree_view->row_separator_data); - tree_view->priv->row_separator_func = func; - tree_view->priv->row_separator_data = data; - tree_view->priv->row_separator_destroy = destroy; + tree_view->row_separator_func = func; + tree_view->row_separator_data = data; + tree_view->row_separator_destroy = destroy; /* Have the tree recalculate heights */ - gtk_tree_rbtree_mark_invalid (tree_view->priv->tree); + gtk_tree_rbtree_mark_invalid (tree_view->tree); gtk_widget_queue_resize (GTK_WIDGET (tree_view)); } @@ -14614,7 +14588,7 @@ gtk_tree_view_get_grid_lines (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), 0); - return tree_view->priv->grid_lines; + return tree_view->grid_lines; } /** @@ -14629,15 +14603,12 @@ void gtk_tree_view_set_grid_lines (GtkTreeView *tree_view, GtkTreeViewGridLines grid_lines) { - GtkTreeViewPrivate *priv; GtkTreeViewGridLines old_grid_lines; g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - priv = tree_view->priv; - - old_grid_lines = priv->grid_lines; - priv->grid_lines = grid_lines; + old_grid_lines = tree_view->grid_lines; + tree_view->grid_lines = grid_lines; if (old_grid_lines != grid_lines) { @@ -14661,7 +14632,7 @@ gtk_tree_view_get_enable_tree_lines (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - return tree_view->priv->tree_lines_enabled; + return tree_view->tree_lines_enabled; } /** @@ -14676,18 +14647,15 @@ void gtk_tree_view_set_enable_tree_lines (GtkTreeView *tree_view, gboolean enabled) { - GtkTreeViewPrivate *priv; gboolean was_enabled; g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); enabled = enabled != FALSE; - priv = tree_view->priv; + was_enabled = tree_view->tree_lines_enabled; - was_enabled = priv->tree_lines_enabled; - - priv->tree_lines_enabled = enabled; + tree_view->tree_lines_enabled = enabled; if (was_enabled != enabled) { @@ -14718,9 +14686,9 @@ gtk_tree_view_set_show_expanders (GtkTreeView *tree_view, g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); enabled = enabled != FALSE; - if (tree_view->priv->show_expanders != enabled) + if (tree_view->show_expanders != enabled) { - tree_view->priv->show_expanders = enabled; + tree_view->show_expanders = enabled; gtk_widget_queue_draw (GTK_WIDGET (tree_view)); g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_SHOW_EXPANDERS]); } @@ -14740,7 +14708,7 @@ gtk_tree_view_get_show_expanders (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - return tree_view->priv->show_expanders; + return tree_view->show_expanders; } /** @@ -14758,7 +14726,7 @@ void gtk_tree_view_set_level_indentation (GtkTreeView *tree_view, gint indentation) { - tree_view->priv->level_indentation = indentation; + tree_view->level_indentation = indentation; gtk_widget_queue_draw (GTK_WIDGET (tree_view)); } @@ -14778,7 +14746,7 @@ gtk_tree_view_get_level_indentation (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), 0); - return tree_view->priv->level_indentation; + return tree_view->level_indentation; } /** @@ -14887,7 +14855,7 @@ gtk_tree_view_set_tooltip_cell (GtkTreeView *tree_view, else { rect.y = 0; - rect.height = gtk_adjustment_get_page_size (tree_view->priv->vadjustment); + rect.height = gtk_adjustment_get_page_size (tree_view->vadjustment); } gtk_tooltip_set_tip_area (tooltip, &rect); @@ -14987,7 +14955,7 @@ gtk_tree_view_set_tooltip_query_cb (GtkWidget *widget, return FALSE; gtk_tree_model_get_value (model, &iter, - tree_view->priv->tooltip_column, &value); + tree_view->tooltip_column, &value); g_value_init (&transformed, G_TYPE_STRING); @@ -15040,7 +15008,7 @@ gtk_tree_view_set_tooltip_column (GtkTreeView *tree_view, { g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - if (column == tree_view->priv->tooltip_column) + if (column == tree_view->tooltip_column) return; if (column == -1) @@ -15052,7 +15020,7 @@ gtk_tree_view_set_tooltip_column (GtkTreeView *tree_view, } else { - if (tree_view->priv->tooltip_column == -1) + if (tree_view->tooltip_column == -1) { g_signal_connect (tree_view, "query-tooltip", G_CALLBACK (gtk_tree_view_set_tooltip_query_cb), NULL); @@ -15060,7 +15028,7 @@ gtk_tree_view_set_tooltip_column (GtkTreeView *tree_view, } } - tree_view->priv->tooltip_column = column; + tree_view->tooltip_column = column; g_object_notify_by_pspec (G_OBJECT (tree_view), tree_view_props[PROP_TOOLTIP_COLUMN]); } @@ -15079,7 +15047,7 @@ gtk_tree_view_get_tooltip_column (GtkTreeView *tree_view) { g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), 0); - return tree_view->priv->tooltip_column; + return tree_view->tooltip_column; } static gboolean