2000-10-05 01:04:57 +00:00
|
|
|
|
/* gtktreeviewcolumn.c
|
|
|
|
|
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Library General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2000-10-05 01:04:57 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
|
#include "config.h"
|
2010-09-13 00:50:04 +00:00
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
#include "gtktreeviewcolumn.h"
|
2010-09-13 00:50:04 +00:00
|
|
|
|
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkbox.h"
|
2000-10-05 01:04:57 +00:00
|
|
|
|
#include "gtkbutton.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkcellareabox.h"
|
|
|
|
|
#include "gtkcellareacontext.h"
|
|
|
|
|
#include "gtkcelllayout.h"
|
|
|
|
|
#include "gtkframe.h"
|
|
|
|
|
#include "gtkimage.h"
|
|
|
|
|
#include "gtkintl.h"
|
2000-10-16 17:50:15 +00:00
|
|
|
|
#include "gtklabel.h"
|
2001-11-17 23:28:51 +00:00
|
|
|
|
#include "gtkmarshalers.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtktreeprivate.h"
|
|
|
|
|
#include "gtktreeview.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
|
#include "gtktypebuiltins.h"
|
2017-07-15 18:43:52 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
2018-06-12 11:56:28 +00:00
|
|
|
|
#include "gtkgesturedrag.h"
|
2019-02-28 03:42:27 +00:00
|
|
|
|
#include "gtkeventcontrollerkey.h"
|
2010-07-09 17:22:23 +00:00
|
|
|
|
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "a11y/gtktreeviewaccessibleprivate.h"
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2001-04-12 16:11:54 +00:00
|
|
|
|
|
2010-10-22 19:59:08 +00:00
|
|
|
|
/**
|
|
|
|
|
* SECTION:gtktreeviewcolumn
|
|
|
|
|
* @Short_description: A visible column in a GtkTreeView widget
|
|
|
|
|
* @Title: GtkTreeViewColumn
|
2014-01-22 02:10:55 +00:00
|
|
|
|
* @See_also: #GtkTreeView, #GtkTreeSelection, #GtkTreeModel, #GtkTreeSortable,
|
2010-10-22 19:59:08 +00:00
|
|
|
|
* #GtkTreeModelSort, #GtkListStore, #GtkTreeStore, #GtkCellRenderer, #GtkCellEditable,
|
2014-01-22 02:10:55 +00:00
|
|
|
|
* #GtkCellRendererPixbuf, #GtkCellRendererText, #GtkCellRendererToggle,
|
2014-02-07 02:07:03 +00:00
|
|
|
|
* [GtkTreeView drag-and-drop][gtk3-GtkTreeView-drag-and-drop]
|
2010-10-22 19:59:08 +00:00
|
|
|
|
*
|
|
|
|
|
* The GtkTreeViewColumn object represents a visible column in a #GtkTreeView widget.
|
|
|
|
|
* It allows to set properties of the column header, and functions as a holding pen for
|
|
|
|
|
* the cell renderers which determine how the data in the column is displayed.
|
|
|
|
|
*
|
2014-02-07 02:07:03 +00:00
|
|
|
|
* Please refer to the [tree widget conceptual overview][TreeWidget]
|
2010-10-22 19:59:08 +00:00
|
|
|
|
* for an overview of all the objects and data types related to the tree widget and how
|
|
|
|
|
* they work together.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
/* Type methods */
|
2003-07-11 12:51:24 +00:00
|
|
|
|
static void gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
|
|
/* GObject methods */
|
|
|
|
|
static void gtk_tree_view_column_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_tree_view_column_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_tree_view_column_finalize (GObject *object);
|
2010-11-29 04:01:49 +00:00
|
|
|
|
static void gtk_tree_view_column_dispose (GObject *object);
|
2014-06-26 22:22:42 +00:00
|
|
|
|
static void gtk_tree_view_column_constructed (GObject *object);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
|
/* GtkCellLayout implementation */
|
2011-01-31 22:34:37 +00:00
|
|
|
|
static void gtk_tree_view_column_ensure_cell_area (GtkTreeViewColumn *column,
|
|
|
|
|
GtkCellArea *cell_area);
|
|
|
|
|
|
2010-11-29 04:01:49 +00:00
|
|
|
|
static GtkCellArea *gtk_tree_view_column_cell_layout_get_area (GtkCellLayout *cell_layout);
|
2003-07-11 12:51:24 +00:00
|
|
|
|
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
|
/* Button handling code */
|
2001-05-16 00:23:30 +00:00
|
|
|
|
static void gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column);
|
|
|
|
|
static void gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column);
|
|
|
|
|
|
|
|
|
|
/* Button signal handlers */
|
2018-06-12 11:56:28 +00:00
|
|
|
|
static void column_button_drag_begin (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkTreeViewColumn *column);
|
|
|
|
|
static void column_button_drag_update (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkTreeViewColumn *column);
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
static void gtk_tree_view_column_button_clicked (GtkWidget *widget,
|
|
|
|
|
gpointer data);
|
2002-02-19 21:16:49 +00:00
|
|
|
|
static gboolean gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
|
|
|
|
|
gboolean group_cycling,
|
|
|
|
|
gpointer data);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
|
|
/* Property handlers */
|
|
|
|
|
static void gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
|
|
|
|
|
GtkTreeViewColumn *tree_column);
|
|
|
|
|
|
2010-11-29 04:01:49 +00:00
|
|
|
|
/* GtkCellArea/GtkCellAreaContext callbacks */
|
|
|
|
|
static void gtk_tree_view_column_context_changed (GtkCellAreaContext *context,
|
|
|
|
|
GParamSpec *pspec,
|
|
|
|
|
GtkTreeViewColumn *tree_column);
|
|
|
|
|
static void gtk_tree_view_column_add_editable_callback (GtkCellArea *area,
|
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellEditable *edit_widget,
|
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
|
const gchar *path_string,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
static void gtk_tree_view_column_remove_editable_callback (GtkCellArea *area,
|
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellEditable *edit_widget,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
/* Internal functions */
|
|
|
|
|
static void gtk_tree_view_column_sort (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_tree_view_column_setup_sort_column_id_callback (GtkTreeViewColumn *tree_column);
|
|
|
|
|
static void gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
|
GtkCellRenderer *cell_renderer,
|
2001-05-16 00:23:30 +00:00
|
|
|
|
va_list args);
|
2010-11-28 18:01:49 +00:00
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
/* GtkBuildable implementation */
|
|
|
|
|
static void gtk_tree_view_column_buildable_init (GtkBuildableIface *iface);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2019-05-29 01:42:38 +00:00
|
|
|
|
typedef struct _GtkTreeViewColumnClass GtkTreeViewColumnClass;
|
|
|
|
|
typedef struct _GtkTreeViewColumnPrivate GtkTreeViewColumnPrivate;
|
|
|
|
|
|
|
|
|
|
struct _GtkTreeViewColumn
|
|
|
|
|
{
|
|
|
|
|
GInitiallyUnowned parent_instance;
|
|
|
|
|
|
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct _GtkTreeViewColumnClass
|
|
|
|
|
{
|
|
|
|
|
GInitiallyUnownedClass parent_class;
|
|
|
|
|
|
|
|
|
|
void (*clicked) (GtkTreeViewColumn *tree_column);
|
|
|
|
|
};
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
|
|
|
|
|
struct _GtkTreeViewColumnPrivate
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *tree_view;
|
|
|
|
|
GtkWidget *button;
|
|
|
|
|
GtkWidget *child;
|
|
|
|
|
GtkWidget *arrow;
|
2016-10-15 15:43:56 +00:00
|
|
|
|
GtkWidget *frame;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gulong property_changed_signal;
|
2013-09-22 03:37:48 +00:00
|
|
|
|
gfloat xalign;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
|
|
|
|
|
/* Sizing fields */
|
|
|
|
|
/* see gtk+/doc/tree-column-sizing.txt for more information on them */
|
|
|
|
|
GtkTreeViewColumnSizing column_type;
|
2010-12-06 07:31:07 +00:00
|
|
|
|
gint padding;
|
2011-06-10 04:09:25 +00:00
|
|
|
|
gint x_offset;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gint width;
|
|
|
|
|
gint fixed_width;
|
|
|
|
|
gint min_width;
|
|
|
|
|
gint max_width;
|
|
|
|
|
|
|
|
|
|
/* dragging columns */
|
|
|
|
|
gint drag_x;
|
|
|
|
|
gint drag_y;
|
|
|
|
|
|
|
|
|
|
gchar *title;
|
|
|
|
|
|
|
|
|
|
/* Sorting */
|
|
|
|
|
gulong sort_clicked_signal;
|
|
|
|
|
gulong sort_column_changed_signal;
|
|
|
|
|
gint sort_column_id;
|
|
|
|
|
GtkSortType sort_order;
|
|
|
|
|
|
|
|
|
|
/* Cell area */
|
|
|
|
|
GtkCellArea *cell_area;
|
|
|
|
|
GtkCellAreaContext *cell_area_context;
|
|
|
|
|
gulong add_editable_signal;
|
|
|
|
|
gulong remove_editable_signal;
|
|
|
|
|
gulong context_changed_signal;
|
|
|
|
|
|
|
|
|
|
/* Flags */
|
|
|
|
|
guint visible : 1;
|
|
|
|
|
guint resizable : 1;
|
|
|
|
|
guint clickable : 1;
|
|
|
|
|
guint dirty : 1;
|
|
|
|
|
guint show_sort_indicator : 1;
|
|
|
|
|
guint maybe_reordered : 1;
|
|
|
|
|
guint reorderable : 1;
|
|
|
|
|
guint expand : 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_VISIBLE,
|
|
|
|
|
PROP_RESIZABLE,
|
2011-06-10 04:09:25 +00:00
|
|
|
|
PROP_X_OFFSET,
|
2010-11-30 05:29:45 +00:00
|
|
|
|
PROP_WIDTH,
|
|
|
|
|
PROP_SPACING,
|
|
|
|
|
PROP_SIZING,
|
|
|
|
|
PROP_FIXED_WIDTH,
|
|
|
|
|
PROP_MIN_WIDTH,
|
|
|
|
|
PROP_MAX_WIDTH,
|
|
|
|
|
PROP_TITLE,
|
|
|
|
|
PROP_EXPAND,
|
|
|
|
|
PROP_CLICKABLE,
|
|
|
|
|
PROP_WIDGET,
|
|
|
|
|
PROP_ALIGNMENT,
|
|
|
|
|
PROP_REORDERABLE,
|
|
|
|
|
PROP_SORT_INDICATOR,
|
|
|
|
|
PROP_SORT_ORDER,
|
2010-12-01 14:26:25 +00:00
|
|
|
|
PROP_SORT_COLUMN_ID,
|
2015-09-06 16:35:12 +00:00
|
|
|
|
PROP_CELL_AREA,
|
|
|
|
|
LAST_PROP
|
2010-11-30 05:29:45 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
CLICKED,
|
|
|
|
|
LAST_SIGNAL
|
|
|
|
|
};
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
static guint tree_column_signals[LAST_SIGNAL] = { 0 };
|
2015-09-06 16:35:12 +00:00
|
|
|
|
static GParamSpec *tree_column_props[LAST_PROP] = { NULL, };
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2010-09-18 23:57:32 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkTreeViewColumn, gtk_tree_view_column, G_TYPE_INITIALLY_UNOWNED,
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_ADD_PRIVATE (GtkTreeViewColumn)
|
2006-05-02 23:56:43 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
gtk_tree_view_column_cell_layout_init)
|
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
|
|
|
|
gtk_tree_view_column_buildable_init))
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
|
|
|
|
|
{
|
2001-01-09 23:24:20 +00:00
|
|
|
|
GObjectClass *object_class;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
|
object_class = (GObjectClass*) class;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
class->clicked = NULL;
|
doh, this was broken beyond believe.
Tue Dec 12 23:46:44 2000 Tim Janik <timj@gtk.org>
* gtk/stock-icons/Makefile.am: doh, this was broken beyond believe.
* gtk/gtkbox.c: change property types from (u)long to (u)int for
::position and ::padding.
* gtk/gtkcontainer.c: make ::border_width an INT property.
* gtk/gtkpacker.c: make ::position an INT property.
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_adjustment_changed):
guard against NULL h/v scrollbars, since this is used at construction
time.
* gtk/gtkclist.[hc]: nuked gtk_clist_construct(), implemented
internal gtk_clist_constructor().
* gtk/gtkctree.[hc]: nuked gtk_ctree_construct(), implemented
gtk_ctree_constructor().
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): property
::pulse_step should use ARG_PULSE_STEP, not ARG_FRACTION.
* docs/reference/Makefile.am: fun stuff, disabled docs generation
again, gtk-scan.c needs to introspec paramspecs, not GtkAgs.
* gtk/gtkwidget.[hc]:
removed gtk_widget_setv(), gtk_widget_getv(), gtk_widget_newv()
and gtk_widget_get().
(gtk_widget_new): use g_object_new_valist().
(gtk_widget_set): use g_object_set_valist().
* gtk/gtkobject.[hc]:
removed gtk_object_arg_get_info(), gtk_object_getv(),
gtk_object_query_args(), gtk_object_newv(),
gtk_object_class_add_signals(),
gtk_object_class_user_signal_new(),
gtk_object_class_user_signal_newv(),
gtk_object_arg_set(), gtk_object_arg_get(),
gtk_object_args_collect(),
gtk_object_default_construct(),
gtk_object_constructed(),
GTK_CONSTRUCTED and GTK_OBJECT_CONSTRUCTED().
removed nsignals, signals and n_args members from GtkObjectClass.
(gtk_object_new): use g_object_new_valist().
(gtk_object_set): use g_object_set_valist().
(gtk_object_get): use g_object_get_valist().
* gtk/gtkcompat.h: define gtk_object_default_construct().
* gtk/gtktypeutils.c (gtk_type_new): create constructed objects via
g_object_new().
* gtk/*.c: removed gtk_object_class_add_signals() from class_init()
fucntions, cleaned up method assignments (make sure your structures
are setup properly before calling out). removed all GTK_CONSTRUCTED
hacks ;)
2000-12-13 01:34:41 +00:00
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
object_class->constructed = gtk_tree_view_column_constructed;
|
2001-02-17 00:16:08 +00:00
|
|
|
|
object_class->finalize = gtk_tree_view_column_finalize;
|
2010-11-29 04:01:49 +00:00
|
|
|
|
object_class->dispose = gtk_tree_view_column_dispose;
|
2001-01-09 23:24:20 +00:00
|
|
|
|
object_class->set_property = gtk_tree_view_column_set_property;
|
|
|
|
|
object_class->get_property = gtk_tree_view_column_get_property;
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
tree_column_signals[CLICKED] =
|
2005-09-01 05:11:46 +00:00
|
|
|
|
g_signal_new (I_("clicked"),
|
2002-10-13 19:34:42 +00:00
|
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkTreeViewColumnClass, clicked),
|
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2002-10-13 19:34:42 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
2015-09-06 16:35:12 +00:00
|
|
|
|
tree_column_props[PROP_VISIBLE] =
|
|
|
|
|
g_param_spec_boolean ("visible",
|
|
|
|
|
P_("Visible"),
|
|
|
|
|
P_("Whether to display the column"),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_RESIZABLE] =
|
|
|
|
|
g_param_spec_boolean ("resizable",
|
|
|
|
|
P_("Resizable"),
|
|
|
|
|
P_("Column is user-resizable"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_X_OFFSET] =
|
|
|
|
|
g_param_spec_int ("x-offset",
|
|
|
|
|
P_("X position"),
|
|
|
|
|
P_("Current X position of the column"),
|
|
|
|
|
-G_MAXINT, G_MAXINT,
|
|
|
|
|
0,
|
|
|
|
|
GTK_PARAM_READABLE);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_WIDTH] =
|
|
|
|
|
g_param_spec_int ("width",
|
|
|
|
|
P_("Width"),
|
|
|
|
|
P_("Current width of the column"),
|
|
|
|
|
0, G_MAXINT,
|
|
|
|
|
0,
|
|
|
|
|
GTK_PARAM_READABLE);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_SPACING] =
|
|
|
|
|
g_param_spec_int ("spacing",
|
|
|
|
|
P_("Spacing"),
|
|
|
|
|
P_("Space which is inserted between cells"),
|
|
|
|
|
0, G_MAXINT,
|
|
|
|
|
0,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_SIZING] =
|
|
|
|
|
g_param_spec_enum ("sizing",
|
|
|
|
|
P_("Sizing"),
|
|
|
|
|
P_("Resize mode of the column"),
|
|
|
|
|
GTK_TYPE_TREE_VIEW_COLUMN_SIZING,
|
|
|
|
|
GTK_TREE_VIEW_COLUMN_GROW_ONLY,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_FIXED_WIDTH] =
|
|
|
|
|
g_param_spec_int ("fixed-width",
|
|
|
|
|
P_("Fixed Width"),
|
|
|
|
|
P_("Current fixed width of the column"),
|
|
|
|
|
-1, G_MAXINT,
|
|
|
|
|
-1,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_MIN_WIDTH] =
|
|
|
|
|
g_param_spec_int ("min-width",
|
|
|
|
|
P_("Minimum Width"),
|
|
|
|
|
P_("Minimum allowed width of the column"),
|
|
|
|
|
-1, G_MAXINT,
|
|
|
|
|
-1,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_MAX_WIDTH] =
|
|
|
|
|
g_param_spec_int ("max-width",
|
|
|
|
|
P_("Maximum Width"),
|
|
|
|
|
P_("Maximum allowed width of the column"),
|
|
|
|
|
-1, G_MAXINT,
|
|
|
|
|
-1,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_TITLE] =
|
|
|
|
|
g_param_spec_string ("title",
|
|
|
|
|
P_("Title"),
|
|
|
|
|
P_("Title to appear in column header"),
|
|
|
|
|
"",
|
|
|
|
|
GTK_PARAM_READWRITE);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_EXPAND] =
|
|
|
|
|
g_param_spec_boolean ("expand",
|
|
|
|
|
P_("Expand"),
|
|
|
|
|
P_("Column gets share of extra width allocated to the widget"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_CLICKABLE] =
|
|
|
|
|
g_param_spec_boolean ("clickable",
|
|
|
|
|
P_("Clickable"),
|
|
|
|
|
P_("Whether the header can be clicked"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_WIDGET] =
|
|
|
|
|
g_param_spec_object ("widget",
|
|
|
|
|
P_("Widget"),
|
|
|
|
|
P_("Widget to put in column header button instead of column title"),
|
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_ALIGNMENT] =
|
|
|
|
|
g_param_spec_float ("alignment",
|
|
|
|
|
P_("Alignment"),
|
|
|
|
|
P_("X Alignment of the column header text or widget"),
|
|
|
|
|
0.0, 1.0, 0.0,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_REORDERABLE] =
|
|
|
|
|
g_param_spec_boolean ("reorderable",
|
|
|
|
|
P_("Reorderable"),
|
|
|
|
|
P_("Whether the column can be reordered around the headers"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_SORT_INDICATOR] =
|
|
|
|
|
g_param_spec_boolean ("sort-indicator",
|
|
|
|
|
P_("Sort indicator"),
|
|
|
|
|
P_("Whether to show a sort indicator"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
|
|
|
|
tree_column_props[PROP_SORT_ORDER] =
|
|
|
|
|
g_param_spec_enum ("sort-order",
|
|
|
|
|
P_("Sort order"),
|
|
|
|
|
P_("Sort direction the sort indicator should indicate"),
|
|
|
|
|
GTK_TYPE_SORT_TYPE,
|
|
|
|
|
GTK_SORT_ASCENDING,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2009-07-25 16:46:09 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkTreeViewColumn:sort-column-id:
|
|
|
|
|
*
|
|
|
|
|
* Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
|
2013-01-17 01:12:44 +00:00
|
|
|
|
* clickable. Set to -1 to make the column unsortable.
|
2009-07-25 16:46:09 +00:00
|
|
|
|
**/
|
2015-09-06 16:35:12 +00:00
|
|
|
|
tree_column_props[PROP_SORT_COLUMN_ID] =
|
|
|
|
|
g_param_spec_int ("sort-column-id",
|
|
|
|
|
P_("Sort column ID"),
|
|
|
|
|
P_("Logical sort column ID this column sorts on when selected for sorting"),
|
|
|
|
|
-1, G_MAXINT,
|
|
|
|
|
-1,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2010-12-01 14:26:25 +00:00
|
|
|
|
|
2010-12-01 14:26:25 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkTreeViewColumn:cell-area:
|
|
|
|
|
*
|
|
|
|
|
* The #GtkCellArea used to layout cell renderers for this column.
|
|
|
|
|
*
|
2011-02-24 07:05:41 +00:00
|
|
|
|
* If no area is specified when creating the tree view column with gtk_tree_view_column_new_with_area()
|
|
|
|
|
* a horizontally oriented #GtkCellAreaBox will be used.
|
2010-12-01 14:26:25 +00:00
|
|
|
|
*/
|
2015-09-06 16:35:12 +00:00
|
|
|
|
tree_column_props[PROP_CELL_AREA] =
|
|
|
|
|
g_param_spec_object ("cell-area",
|
|
|
|
|
P_("Cell Area"),
|
|
|
|
|
P_("The GtkCellArea used to layout cells"),
|
|
|
|
|
GTK_TYPE_CELL_AREA,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY);
|
|
|
|
|
|
|
|
|
|
g_object_class_install_properties (object_class, LAST_PROP, tree_column_props);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-04 08:10:31 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_custom_tag_end (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
|
|
|
|
const gchar *tagname,
|
2018-10-07 22:34:43 +00:00
|
|
|
|
gpointer data)
|
2010-12-04 08:10:31 +00:00
|
|
|
|
{
|
|
|
|
|
/* Just ignore the boolean return from here */
|
|
|
|
|
_gtk_cell_layout_buildable_custom_tag_end (buildable, builder, child, tagname, data);
|
|
|
|
|
}
|
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_buildable_init (GtkBuildableIface *iface)
|
|
|
|
|
{
|
2007-06-19 12:23:36 +00:00
|
|
|
|
iface->add_child = _gtk_cell_layout_buildable_add_child;
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
iface->custom_tag_start = _gtk_cell_layout_buildable_custom_tag_start;
|
2010-12-04 08:10:31 +00:00
|
|
|
|
iface->custom_tag_end = gtk_tree_view_column_custom_tag_end;
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface)
|
|
|
|
|
{
|
2010-11-29 04:01:49 +00:00
|
|
|
|
iface->get_area = gtk_tree_view_column_cell_layout_get_area;
|
2003-07-11 12:51:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_init (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
tree_column->priv = gtk_tree_view_column_get_instance_private (tree_column);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
|
|
priv->button = NULL;
|
|
|
|
|
priv->xalign = 0.0;
|
|
|
|
|
priv->width = 0;
|
2013-09-26 17:37:46 +00:00
|
|
|
|
priv->padding = 0;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->min_width = -1;
|
|
|
|
|
priv->max_width = -1;
|
|
|
|
|
priv->column_type = GTK_TREE_VIEW_COLUMN_GROW_ONLY;
|
|
|
|
|
priv->visible = TRUE;
|
|
|
|
|
priv->resizable = FALSE;
|
|
|
|
|
priv->expand = FALSE;
|
|
|
|
|
priv->clickable = FALSE;
|
|
|
|
|
priv->dirty = TRUE;
|
|
|
|
|
priv->sort_order = GTK_SORT_ASCENDING;
|
|
|
|
|
priv->show_sort_indicator = FALSE;
|
|
|
|
|
priv->property_changed_signal = 0;
|
|
|
|
|
priv->sort_clicked_signal = 0;
|
|
|
|
|
priv->sort_column_changed_signal = 0;
|
|
|
|
|
priv->sort_column_id = -1;
|
|
|
|
|
priv->reorderable = FALSE;
|
|
|
|
|
priv->maybe_reordered = FALSE;
|
2012-12-18 06:26:37 +00:00
|
|
|
|
priv->fixed_width = -1;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->title = g_strdup ("");
|
2015-09-05 23:46:24 +00:00
|
|
|
|
|
|
|
|
|
gtk_tree_view_column_create_button (tree_column);
|
2010-12-01 14:26:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_constructed (GObject *object)
|
2010-12-01 14:26:25 +00:00
|
|
|
|
{
|
2014-06-26 22:22:42 +00:00
|
|
|
|
GtkTreeViewColumn *tree_column = GTK_TREE_VIEW_COLUMN (object);
|
2010-12-01 14:26:25 +00:00
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->constructed (object);
|
2010-12-01 14:26:25 +00:00
|
|
|
|
|
2011-01-31 22:34:37 +00:00
|
|
|
|
gtk_tree_view_column_ensure_cell_area (tree_column, NULL);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2010-11-29 04:01:49 +00:00
|
|
|
|
gtk_tree_view_column_dispose (GObject *object)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumn *tree_column = (GtkTreeViewColumn *) object;
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2002-03-03 05:41:28 +00:00
|
|
|
|
|
2011-09-28 11:02:20 +00:00
|
|
|
|
/* Remove this column from its treeview,
|
|
|
|
|
* in case this column is destroyed before its treeview.
|
|
|
|
|
*/
|
|
|
|
|
if (priv->tree_view)
|
|
|
|
|
gtk_tree_view_remove_column (GTK_TREE_VIEW (priv->tree_view), tree_column);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->cell_area_context)
|
2010-12-02 08:42:46 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_signal_handler_disconnect (priv->cell_area_context,
|
|
|
|
|
priv->context_changed_signal);
|
2010-12-02 08:42:46 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_object_unref (priv->cell_area_context);
|
2010-12-02 08:42:46 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->cell_area_context = NULL;
|
|
|
|
|
priv->context_changed_signal = 0;
|
2010-11-29 04:01:49 +00:00
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->cell_area)
|
2010-11-29 04:01:49 +00:00
|
|
|
|
{
|
2010-12-01 14:26:25 +00:00
|
|
|
|
g_signal_handler_disconnect (priv->cell_area,
|
|
|
|
|
priv->add_editable_signal);
|
|
|
|
|
g_signal_handler_disconnect (priv->cell_area,
|
|
|
|
|
priv->remove_editable_signal);
|
2011-01-31 22:34:37 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_object_unref (priv->cell_area);
|
|
|
|
|
priv->cell_area = NULL;
|
2010-12-01 14:26:25 +00:00
|
|
|
|
priv->add_editable_signal = 0;
|
|
|
|
|
priv->remove_editable_signal = 0;
|
2010-11-29 04:01:49 +00:00
|
|
|
|
}
|
Behaviour change, apply changes if the entry of the editable gets a focus
Tue Oct 15 00:53:14 2002 Kristian Rietveld <kris@gtk.org>
Behaviour change, apply changes if the entry of the editable gets
a focus out event (#82405).
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_focus_out_event):
new function,
(gtk_cell_renderer_text_start_editing): stop editing and apply
changes on focus-out.
Tue Oct 15 00:47:35 2002 Kristian Rietveld <kris@gtk.org>
Fixes an *evil* GtkTreeModelSort bug, #93629.
* gtk/gtktreemodel.c (release_row_references): return if the
refs->list is NULL.
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_changed): if we
are swapping two rows (re-insertion on row_changed), also *emit*
a rows_reordered signal. oops.
Tue Oct 15 00:45:03 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_remove_silently): free
the actual link after the node has been removed (#92014).
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_column_finalize):
free the cell_list and the child if the exists (#92014).
Tue Oct 15 00:40:25 2002 Kristian Rietveld <kris@gtk.org>
Don't accept drops if the model has been sorted, #93758)
* gtk/gtkliststore.c (gtk_list_store_row_drop_possible): return
FALSE if the list has been sorted.
* gtk/gtktreestore.c (gtk_tree_store_row_drop_possible): check
if drag_dest is a TreeStore, return FALSE if the tree has been
sorted.
Tue Oct 15 00:33:59 2002 Kristian Rietveld <kris@gtk.org>
Compiler warning fixage, (#85858, #85859, #85860, #85872)
* gtk/gtkcellrendererpixbuf (gtk_cell_renderer_pixbuf_render):
s/guint/GtkCellRendererState/.
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render):
ditto.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render),
(gtk_cell_renderer_toggle_activate): ditto.
* gtk/gtkliststore.c (gtk_list_store_get_flags): a
s/guint/GtkTreeModelFlags/ on the return type.
2002-10-14 22:50:18 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->child)
|
2010-11-29 04:01:49 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_object_unref (priv->child);
|
|
|
|
|
priv->child = NULL;
|
2010-11-29 04:01:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-09-05 23:46:24 +00:00
|
|
|
|
g_clear_object (&priv->button);
|
|
|
|
|
|
2010-11-29 04:01:49 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->dispose (object);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_finalize (GObject *object)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumn *tree_column = (GtkTreeViewColumn *) object;
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2010-11-29 04:01:49 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_free (priv->title);
|
2001-08-23 16:54:49 +00:00
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->finalize (object);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
2001-03-07 14:49:21 +00:00
|
|
|
|
GParamSpec *pspec)
|
2001-01-09 23:24:20 +00:00
|
|
|
|
{
|
|
|
|
|
GtkTreeViewColumn *tree_column;
|
2010-12-01 14:26:25 +00:00
|
|
|
|
GtkCellArea *area;
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
|
|
tree_column = GTK_TREE_VIEW_COLUMN (object);
|
|
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_VISIBLE:
|
|
|
|
|
gtk_tree_view_column_set_visible (tree_column,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
|
case PROP_RESIZABLE:
|
|
|
|
|
gtk_tree_view_column_set_resizable (tree_column,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
|
case PROP_SIZING:
|
|
|
|
|
gtk_tree_view_column_set_sizing (tree_column,
|
|
|
|
|
g_value_get_enum (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
|
case PROP_FIXED_WIDTH:
|
|
|
|
|
gtk_tree_view_column_set_fixed_width (tree_column,
|
|
|
|
|
g_value_get_int (value));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_MIN_WIDTH:
|
|
|
|
|
gtk_tree_view_column_set_min_width (tree_column,
|
|
|
|
|
g_value_get_int (value));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_MAX_WIDTH:
|
|
|
|
|
gtk_tree_view_column_set_max_width (tree_column,
|
|
|
|
|
g_value_get_int (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2004-07-15 17:37:06 +00:00
|
|
|
|
case PROP_SPACING:
|
|
|
|
|
gtk_tree_view_column_set_spacing (tree_column,
|
|
|
|
|
g_value_get_int (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
|
case PROP_TITLE:
|
|
|
|
|
gtk_tree_view_column_set_title (tree_column,
|
|
|
|
|
g_value_get_string (value));
|
|
|
|
|
break;
|
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
case PROP_EXPAND:
|
|
|
|
|
gtk_tree_view_column_set_expand (tree_column,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
|
case PROP_CLICKABLE:
|
|
|
|
|
gtk_tree_view_column_set_clickable (tree_column,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_WIDGET:
|
|
|
|
|
gtk_tree_view_column_set_widget (tree_column,
|
|
|
|
|
(GtkWidget*) g_value_get_object (value));
|
|
|
|
|
break;
|
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
case PROP_ALIGNMENT:
|
|
|
|
|
gtk_tree_view_column_set_alignment (tree_column,
|
|
|
|
|
g_value_get_float (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
|
case PROP_REORDERABLE:
|
|
|
|
|
gtk_tree_view_column_set_reorderable (tree_column,
|
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
case PROP_SORT_INDICATOR:
|
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column,
|
|
|
|
|
g_value_get_boolean (value));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
case PROP_SORT_ORDER:
|
|
|
|
|
gtk_tree_view_column_set_sort_order (tree_column,
|
|
|
|
|
g_value_get_enum (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2009-07-25 16:46:09 +00:00
|
|
|
|
case PROP_SORT_COLUMN_ID:
|
|
|
|
|
gtk_tree_view_column_set_sort_column_id (tree_column,
|
|
|
|
|
g_value_get_int (value));
|
|
|
|
|
break;
|
2010-12-01 14:26:25 +00:00
|
|
|
|
|
|
|
|
|
case PROP_CELL_AREA:
|
|
|
|
|
/* Construct-only, can only be assigned once */
|
|
|
|
|
area = g_value_get_object (value);
|
|
|
|
|
|
|
|
|
|
if (area)
|
2011-01-31 22:34:37 +00:00
|
|
|
|
{
|
|
|
|
|
if (tree_column->priv->cell_area != NULL)
|
|
|
|
|
{
|
|
|
|
|
g_warning ("cell-area has already been set, ignoring construct property");
|
|
|
|
|
g_object_ref_sink (area);
|
|
|
|
|
g_object_unref (area);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
gtk_tree_view_column_ensure_cell_area (tree_column, area);
|
|
|
|
|
}
|
2010-12-01 14:26:25 +00:00
|
|
|
|
break;
|
2011-01-31 22:34:37 +00:00
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
2001-03-07 14:49:21 +00:00
|
|
|
|
GParamSpec *pspec)
|
2001-01-09 23:24:20 +00:00
|
|
|
|
{
|
|
|
|
|
GtkTreeViewColumn *tree_column;
|
|
|
|
|
|
|
|
|
|
tree_column = GTK_TREE_VIEW_COLUMN (object);
|
|
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
|
{
|
|
|
|
|
case PROP_VISIBLE:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
|
gtk_tree_view_column_get_visible (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
|
case PROP_RESIZABLE:
|
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
|
gtk_tree_view_column_get_resizable (tree_column));
|
|
|
|
|
break;
|
|
|
|
|
|
2011-06-10 04:09:25 +00:00
|
|
|
|
case PROP_X_OFFSET:
|
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
gtk_tree_view_column_get_x_offset (tree_column));
|
|
|
|
|
break;
|
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
|
case PROP_WIDTH:
|
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
gtk_tree_view_column_get_width (tree_column));
|
|
|
|
|
break;
|
|
|
|
|
|
2004-07-15 17:37:06 +00:00
|
|
|
|
case PROP_SPACING:
|
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
gtk_tree_view_column_get_spacing (tree_column));
|
|
|
|
|
break;
|
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
|
case PROP_SIZING:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
g_value_set_enum (value,
|
|
|
|
|
gtk_tree_view_column_get_sizing (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
|
case PROP_FIXED_WIDTH:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
g_value_set_int (value,
|
2001-09-08 00:56:30 +00:00
|
|
|
|
gtk_tree_view_column_get_fixed_width (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_MIN_WIDTH:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
gtk_tree_view_column_get_min_width (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_MAX_WIDTH:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
gtk_tree_view_column_get_max_width (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_TITLE:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
g_value_set_string (value,
|
|
|
|
|
gtk_tree_view_column_get_title (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
case PROP_EXPAND:
|
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
|
gtk_tree_view_column_get_expand (tree_column));
|
|
|
|
|
break;
|
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
|
case PROP_CLICKABLE:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
|
gtk_tree_view_column_get_clickable (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_WIDGET:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
g_value_set_object (value,
|
|
|
|
|
(GObject*) gtk_tree_view_column_get_widget (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
case PROP_ALIGNMENT:
|
|
|
|
|
g_value_set_float (value,
|
|
|
|
|
gtk_tree_view_column_get_alignment (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
|
case PROP_REORDERABLE:
|
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
|
gtk_tree_view_column_get_reorderable (tree_column));
|
|
|
|
|
break;
|
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
case PROP_SORT_INDICATOR:
|
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
|
gtk_tree_view_column_get_sort_indicator (tree_column));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_SORT_ORDER:
|
|
|
|
|
g_value_set_enum (value,
|
|
|
|
|
gtk_tree_view_column_get_sort_order (tree_column));
|
|
|
|
|
break;
|
|
|
|
|
|
2009-07-25 16:46:09 +00:00
|
|
|
|
case PROP_SORT_COLUMN_ID:
|
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
gtk_tree_view_column_get_sort_column_id (tree_column));
|
|
|
|
|
break;
|
2010-12-01 14:26:25 +00:00
|
|
|
|
|
|
|
|
|
case PROP_CELL_AREA:
|
2010-12-01 14:26:25 +00:00
|
|
|
|
g_value_set_object (value, tree_column->priv->cell_area);
|
2010-12-01 14:26:25 +00:00
|
|
|
|
break;
|
2009-07-25 16:46:09 +00:00
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
|
/* Implementation of GtkCellLayout interface
|
|
|
|
|
*/
|
2011-01-31 22:34:37 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_ensure_cell_area (GtkTreeViewColumn *column,
|
|
|
|
|
GtkCellArea *cell_area)
|
|
|
|
|
{
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->cell_area)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (cell_area)
|
|
|
|
|
priv->cell_area = cell_area;
|
|
|
|
|
else
|
|
|
|
|
priv->cell_area = gtk_cell_area_box_new ();
|
|
|
|
|
|
|
|
|
|
g_object_ref_sink (priv->cell_area);
|
|
|
|
|
|
|
|
|
|
priv->add_editable_signal =
|
|
|
|
|
g_signal_connect (priv->cell_area, "add-editable",
|
|
|
|
|
G_CALLBACK (gtk_tree_view_column_add_editable_callback),
|
|
|
|
|
column);
|
|
|
|
|
priv->remove_editable_signal =
|
|
|
|
|
g_signal_connect (priv->cell_area, "remove-editable",
|
|
|
|
|
G_CALLBACK (gtk_tree_view_column_remove_editable_callback),
|
|
|
|
|
column);
|
|
|
|
|
|
|
|
|
|
priv->cell_area_context = gtk_cell_area_create_context (priv->cell_area);
|
|
|
|
|
|
|
|
|
|
priv->context_changed_signal =
|
|
|
|
|
g_signal_connect (priv->cell_area_context, "notify",
|
|
|
|
|
G_CALLBACK (gtk_tree_view_column_context_changed),
|
|
|
|
|
column);
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-29 04:01:49 +00:00
|
|
|
|
static GtkCellArea *
|
|
|
|
|
gtk_tree_view_column_cell_layout_get_area (GtkCellLayout *cell_layout)
|
2003-07-11 12:51:24 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN (cell_layout);
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2003-07-11 12:51:24 +00:00
|
|
|
|
|
2011-01-31 22:34:37 +00:00
|
|
|
|
if (G_UNLIKELY (!priv->cell_area))
|
|
|
|
|
gtk_tree_view_column_ensure_cell_area (column, NULL);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return priv->cell_area;
|
2003-12-19 22:47:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-28 03:42:27 +00:00
|
|
|
|
static void
|
|
|
|
|
focus_in (GtkEventControllerKey *controller,
|
2019-03-07 05:14:26 +00:00
|
|
|
|
GdkCrossingMode mode,
|
|
|
|
|
GdkNotifyType detail,
|
2019-02-28 03:42:27 +00:00
|
|
|
|
GtkTreeViewColumn *column)
|
|
|
|
|
{
|
|
|
|
|
_gtk_tree_view_set_focus_column (GTK_TREE_VIEW (column->priv->tree_view), column);
|
|
|
|
|
}
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
/* Button handling code
|
|
|
|
|
*/
|
2001-02-17 00:16:08 +00:00
|
|
|
|
static void
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
|
2001-02-17 00:16:08 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2018-06-12 11:56:28 +00:00
|
|
|
|
GtkEventController *controller;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
GtkWidget *child;
|
|
|
|
|
GtkWidget *hbox;
|
2001-02-17 00:16:08 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_return_if_fail (priv->button == NULL);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->button = gtk_button_new ();
|
2015-09-05 23:46:24 +00:00
|
|
|
|
g_object_ref_sink (priv->button);
|
2010-11-30 07:36:07 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_signal_connect (priv->button, "clicked",
|
2002-10-13 19:34:42 +00:00
|
|
|
|
G_CALLBACK (gtk_tree_view_column_button_clicked),
|
|
|
|
|
tree_column);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2018-06-12 11:56:28 +00:00
|
|
|
|
controller = GTK_EVENT_CONTROLLER (gtk_gesture_drag_new ());
|
|
|
|
|
g_signal_connect (controller, "drag-begin",
|
|
|
|
|
G_CALLBACK (column_button_drag_begin), tree_column);
|
|
|
|
|
g_signal_connect (controller, "drag-update",
|
|
|
|
|
G_CALLBACK (column_button_drag_update), tree_column);
|
|
|
|
|
gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
|
|
|
|
|
gtk_widget_add_controller (priv->button, controller);
|
|
|
|
|
|
2019-02-28 03:42:27 +00:00
|
|
|
|
controller = gtk_event_controller_key_new ();
|
|
|
|
|
g_signal_connect (controller, "focus-in", G_CALLBACK (focus_in), tree_column);
|
|
|
|
|
gtk_widget_add_controller (priv->button, controller);
|
|
|
|
|
|
2016-10-15 15:43:56 +00:00
|
|
|
|
priv->frame = gtk_frame_new (NULL);
|
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (priv->frame), GTK_SHADOW_NONE);
|
2017-07-15 18:43:52 +00:00
|
|
|
|
gtk_widget_set_hexpand (priv->frame, TRUE);
|
2016-10-15 15:43:56 +00:00
|
|
|
|
gtk_widget_set_halign (priv->frame, GTK_ALIGN_START);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2010-10-31 17:07:20 +00:00
|
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
|
2017-11-15 00:43:13 +00:00
|
|
|
|
priv->arrow = gtk_image_new_from_icon_name ("pan-down-symbolic");
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->child)
|
|
|
|
|
child = priv->child;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
child = gtk_label_new (priv->title);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-08-08 14:23:32 +00:00
|
|
|
|
g_signal_connect (child, "mnemonic-activate",
|
2002-02-19 21:16:49 +00:00
|
|
|
|
G_CALLBACK (gtk_tree_view_column_mnemonic_activate),
|
2002-10-13 19:34:42 +00:00
|
|
|
|
tree_column);
|
2002-02-19 21:16:49 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->xalign <= 0.5)
|
2014-07-10 19:20:01 +00:00
|
|
|
|
{
|
2018-12-26 07:20:34 +00:00
|
|
|
|
gtk_container_add (GTK_CONTAINER (hbox), priv->frame);
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (hbox), priv->arrow);
|
2014-07-10 19:20:01 +00:00
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
else
|
2014-07-10 19:20:01 +00:00
|
|
|
|
{
|
2018-12-26 07:20:34 +00:00
|
|
|
|
gtk_container_add (GTK_CONTAINER (hbox), priv->arrow);
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (hbox), priv->frame);
|
2014-07-10 19:20:01 +00:00
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2016-10-15 15:43:56 +00:00
|
|
|
|
gtk_container_add (GTK_CONTAINER (priv->frame), child);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_container_add (GTK_CONTAINER (priv->button), hbox);
|
2001-02-17 00:16:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2006-09-24 17:03:45 +00:00
|
|
|
|
gint sort_column_id = -1;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
GtkWidget *hbox;
|
2016-10-15 15:43:56 +00:00
|
|
|
|
GtkWidget *frame;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
GtkWidget *arrow;
|
|
|
|
|
GtkWidget *current_child;
|
2014-05-13 03:56:37 +00:00
|
|
|
|
const gchar *icon_name = "missing-image";
|
2006-05-30 09:29:49 +00:00
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->tree_view)
|
|
|
|
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
|
2006-05-30 09:29:49 +00:00
|
|
|
|
else
|
|
|
|
|
model = NULL;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
hbox = gtk_bin_get_child (GTK_BIN (priv->button));
|
2016-10-15 15:43:56 +00:00
|
|
|
|
frame = priv->frame;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
arrow = priv->arrow;
|
2016-10-15 15:43:56 +00:00
|
|
|
|
current_child = gtk_bin_get_child (GTK_BIN (frame));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
|
|
/* Set up the actual button */
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->child)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (current_child != priv->child)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2016-10-15 15:43:56 +00:00
|
|
|
|
gtk_container_remove (GTK_CONTAINER (frame),
|
2001-05-16 00:23:30 +00:00
|
|
|
|
current_child);
|
2016-10-15 15:43:56 +00:00
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame),
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->child);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (current_child == NULL)
|
|
|
|
|
{
|
|
|
|
|
current_child = gtk_label_new (NULL);
|
|
|
|
|
gtk_widget_show (current_child);
|
2016-10-15 15:43:56 +00:00
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame),
|
2001-05-16 00:23:30 +00:00
|
|
|
|
current_child);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_LABEL (current_child));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->title)
|
2002-02-19 21:16:49 +00:00
|
|
|
|
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->title);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
else
|
2002-02-19 21:16:49 +00:00
|
|
|
|
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
|
|
|
|
|
"");
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-09-24 17:03:45 +00:00
|
|
|
|
if (GTK_IS_TREE_SORTABLE (model))
|
|
|
|
|
gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
|
|
|
|
|
&sort_column_id,
|
|
|
|
|
NULL);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->show_sort_indicator)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2006-12-27 19:52:25 +00:00
|
|
|
|
gboolean alternative;
|
|
|
|
|
|
2015-09-05 23:46:24 +00:00
|
|
|
|
if (priv->tree_view)
|
|
|
|
|
g_object_get (gtk_widget_get_settings (priv->tree_view),
|
|
|
|
|
"gtk-alternative-sort-arrows", &alternative,
|
|
|
|
|
NULL);
|
|
|
|
|
else
|
|
|
|
|
alternative = FALSE;
|
2006-12-27 19:52:25 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
switch (priv->sort_order)
|
2006-09-24 17:03:45 +00:00
|
|
|
|
{
|
|
|
|
|
case GTK_SORT_ASCENDING:
|
2014-05-13 03:56:37 +00:00
|
|
|
|
icon_name = alternative ? "pan-up-symbolic" : "pan-down-symbolic";
|
2006-09-24 17:03:45 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTK_SORT_DESCENDING:
|
2014-05-13 03:56:37 +00:00
|
|
|
|
icon_name = alternative ? "pan-down-symbolic" : "pan-up-symbolic";
|
2006-09-24 17:03:45 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
g_warning (G_STRLOC": bad sort order");
|
|
|
|
|
break;
|
2006-05-28 12:37:21 +00:00
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-15 00:43:13 +00:00
|
|
|
|
gtk_image_set_from_icon_name (GTK_IMAGE (arrow), icon_name);
|
2006-05-28 12:37:21 +00:00
|
|
|
|
|
2002-04-05 16:11:32 +00:00
|
|
|
|
/* Put arrow on the right if the text is left-or-center justified, and on the
|
|
|
|
|
* left otherwise; do this by packing boxes, so flipping text direction will
|
|
|
|
|
* reverse things
|
|
|
|
|
*/
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->xalign <= 0.5)
|
2019-01-22 23:44:34 +00:00
|
|
|
|
gtk_box_reorder_child_after (GTK_BOX (hbox), arrow, gtk_widget_get_last_child (hbox));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
else
|
2019-01-22 23:44:34 +00:00
|
|
|
|
gtk_box_reorder_child_after (GTK_BOX (hbox), arrow, NULL);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->show_sort_indicator
|
|
|
|
|
|| (GTK_IS_TREE_SORTABLE (model) && priv->sort_column_id >= 0))
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_widget_show (arrow);
|
|
|
|
|
else
|
|
|
|
|
gtk_widget_hide (arrow);
|
|
|
|
|
|
2014-05-17 19:32:54 +00:00
|
|
|
|
if (priv->show_sort_indicator)
|
|
|
|
|
gtk_widget_set_opacity (arrow, 1.0);
|
|
|
|
|
else
|
|
|
|
|
gtk_widget_set_opacity (arrow, 0.0);
|
|
|
|
|
|
2002-04-05 16:11:32 +00:00
|
|
|
|
/* It's always safe to hide the button. It isn't always safe to show it, as
|
|
|
|
|
* if you show it before it's realized, it'll get the wrong window. */
|
2015-09-05 23:46:24 +00:00
|
|
|
|
if (priv->tree_view != NULL &&
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2013-01-16 23:36:04 +00:00
|
|
|
|
if (priv->visible &&
|
2017-04-06 10:53:22 +00:00
|
|
|
|
gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view)))
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2013-01-16 23:36:04 +00:00
|
|
|
|
gtk_widget_show (priv->button);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_widget_hide (priv->button);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2001-05-22 19:18:47 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->reorderable || priv->clickable)
|
2001-05-25 23:10:49 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_widget_set_can_focus (priv->button, TRUE);
|
2001-05-25 23:10:49 +00:00
|
|
|
|
}
|
2001-05-22 19:18:47 +00:00
|
|
|
|
else
|
2001-05-25 23:10:49 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_widget_set_can_focus (priv->button, FALSE);
|
|
|
|
|
if (gtk_widget_has_focus (priv->button))
|
2001-07-05 02:58:34 +00:00
|
|
|
|
{
|
2019-03-02 13:49:00 +00:00
|
|
|
|
GtkRoot *root = gtk_widget_get_root (priv->tree_view);
|
|
|
|
|
gtk_root_set_focus (root, NULL);
|
2001-07-05 02:58:34 +00:00
|
|
|
|
}
|
2001-05-25 23:10:49 +00:00
|
|
|
|
}
|
2002-01-18 00:23:26 +00:00
|
|
|
|
/* Queue a resize on the assumption that we always want to catch all changes
|
|
|
|
|
* and columns don't change all that often.
|
|
|
|
|
*/
|
2015-09-05 23:46:24 +00:00
|
|
|
|
if (priv->tree_view && gtk_widget_get_realized (priv->tree_view))
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Button signal handlers
|
|
|
|
|
*/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2018-06-12 11:56:28 +00:00
|
|
|
|
static void
|
|
|
|
|
column_button_drag_begin (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble x,
|
|
|
|
|
gdouble y,
|
|
|
|
|
GtkTreeViewColumn *column)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
{
|
2018-06-12 11:56:28 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2017-08-25 14:56:15 +00:00
|
|
|
|
|
2018-06-12 11:56:28 +00:00
|
|
|
|
if (!priv->reorderable)
|
2001-05-22 19:18:47 +00:00
|
|
|
|
{
|
2018-06-12 11:56:28 +00:00
|
|
|
|
gtk_gesture_set_state (GTK_GESTURE (gesture),
|
|
|
|
|
GTK_EVENT_SEQUENCE_DENIED);
|
|
|
|
|
return;
|
2001-05-22 19:18:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-12 11:56:28 +00:00
|
|
|
|
priv->drag_x = x;
|
|
|
|
|
priv->drag_y = y;
|
|
|
|
|
gtk_widget_grab_focus (priv->button);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
column_button_drag_update (GtkGestureDrag *gesture,
|
|
|
|
|
gdouble offset_x,
|
|
|
|
|
gdouble offset_y,
|
|
|
|
|
GtkTreeViewColumn *column)
|
|
|
|
|
{
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
|
2018-06-12 11:56:28 +00:00
|
|
|
|
if (gtk_drag_check_threshold (priv->button, 0, 0, offset_x, offset_y))
|
2001-05-22 19:18:47 +00:00
|
|
|
|
{
|
2018-06-12 11:56:28 +00:00
|
|
|
|
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
|
|
|
|
_gtk_tree_view_column_start_drag (GTK_TREE_VIEW (priv->tree_view), column,
|
|
|
|
|
gtk_gesture_get_device (GTK_GESTURE (gesture)));
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_button_clicked (GtkWidget *widget, gpointer data)
|
|
|
|
|
{
|
2002-10-13 19:34:42 +00:00
|
|
|
|
g_signal_emit_by_name (data, "clicked");
|
2001-04-12 16:11:54 +00:00
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2002-02-19 21:16:49 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
|
|
|
|
|
gboolean group_cycling,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumn *column = (GtkTreeViewColumn *)data;
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2002-02-19 21:16:49 +00:00
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), FALSE);
|
|
|
|
|
|
2010-11-30 07:36:07 +00:00
|
|
|
|
_gtk_tree_view_set_focus_column (GTK_TREE_VIEW (priv->tree_view), column);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
|
|
|
|
|
if (priv->clickable)
|
2019-05-18 18:15:54 +00:00
|
|
|
|
g_signal_emit_by_name (priv->button, "clicked");
|
2010-11-30 05:29:45 +00:00
|
|
|
|
else if (gtk_widget_get_can_focus (priv->button))
|
|
|
|
|
gtk_widget_grab_focus (priv->button);
|
2002-02-19 21:16:49 +00:00
|
|
|
|
else
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_widget_grab_focus (priv->tree_view);
|
2002-02-19 21:16:49 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2001-04-12 16:11:54 +00:00
|
|
|
|
static void
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
|
2001-12-04 23:49:57 +00:00
|
|
|
|
GtkTreeViewColumn *column)
|
2001-04-12 16:11:54 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gint sort_column_id;
|
2001-08-23 18:33:37 +00:00
|
|
|
|
GtkSortType order;
|
2001-04-12 16:11:54 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
if (gtk_tree_sortable_get_sort_column_id (sortable,
|
|
|
|
|
&sort_column_id,
|
|
|
|
|
&order))
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (sort_column_id == priv->sort_column_id)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, TRUE);
|
|
|
|
|
gtk_tree_view_column_set_sort_order (column, order);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, FALSE);
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-10-09 18:51:43 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, FALSE);
|
|
|
|
|
}
|
2001-04-12 16:11:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_sort (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gpointer data)
|
2001-03-02 00:49:32 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
GtkTreeSortable *sortable;
|
2001-10-06 00:50:36 +00:00
|
|
|
|
gint sort_column_id;
|
|
|
|
|
GtkSortType order;
|
|
|
|
|
gboolean has_sort_column;
|
|
|
|
|
gboolean has_default_sort_func;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_return_if_fail (priv->tree_view != NULL);
|
|
|
|
|
|
|
|
|
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
|
|
|
|
|
sortable = GTK_TREE_SORTABLE (model);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
2001-10-06 00:50:36 +00:00
|
|
|
|
has_sort_column =
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_tree_sortable_get_sort_column_id (sortable,
|
2001-10-06 00:50:36 +00:00
|
|
|
|
&sort_column_id,
|
|
|
|
|
&order);
|
|
|
|
|
has_default_sort_func =
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_tree_sortable_has_default_sort_func (sortable);
|
2001-10-06 00:50:36 +00:00
|
|
|
|
|
|
|
|
|
if (has_sort_column &&
|
2010-11-30 05:29:45 +00:00
|
|
|
|
sort_column_id == priv->sort_column_id)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2001-10-06 00:50:36 +00:00
|
|
|
|
if (order == GTK_SORT_ASCENDING)
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_tree_sortable_set_sort_column_id (sortable,
|
|
|
|
|
priv->sort_column_id,
|
2001-10-06 00:50:36 +00:00
|
|
|
|
GTK_SORT_DESCENDING);
|
|
|
|
|
else if (order == GTK_SORT_DESCENDING && has_default_sort_func)
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_tree_sortable_set_sort_column_id (sortable,
|
2001-10-06 00:50:36 +00:00
|
|
|
|
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
|
|
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
else
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_tree_sortable_set_sort_column_id (sortable,
|
|
|
|
|
priv->sort_column_id,
|
2001-10-06 00:50:36 +00:00
|
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_tree_sortable_set_sort_column_id (sortable,
|
|
|
|
|
priv->sort_column_id,
|
2001-10-06 00:50:36 +00:00
|
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_setup_sort_column_id_callback (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->tree_view == NULL)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
|
|
if (model == NULL)
|
2001-08-21 04:49:15 +00:00
|
|
|
|
return;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
if (GTK_IS_TREE_SORTABLE (model) &&
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->sort_column_id != -1)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
|
|
|
|
gint real_sort_column_id;
|
2001-08-23 18:33:37 +00:00
|
|
|
|
GtkSortType real_order;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->sort_column_changed_signal == 0)
|
|
|
|
|
priv->sort_column_changed_signal =
|
2008-08-08 14:23:32 +00:00
|
|
|
|
g_signal_connect (model, "sort-column-changed",
|
2002-10-13 19:34:42 +00:00
|
|
|
|
G_CALLBACK (gtk_tree_view_model_sort_column_changed),
|
|
|
|
|
tree_column);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
if (gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
|
|
|
|
|
&real_sort_column_id,
|
|
|
|
|
&real_order) &&
|
2010-11-30 05:29:45 +00:00
|
|
|
|
(real_sort_column_id == priv->sort_column_id))
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, TRUE);
|
|
|
|
|
gtk_tree_view_column_set_sort_order (tree_column, real_order);
|
2004-10-03 06:12:09 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, FALSE);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
2004-10-03 06:12:09 +00:00
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
2010-11-29 04:01:49 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_context_changed (GtkCellAreaContext *context,
|
|
|
|
|
GParamSpec *pspec,
|
|
|
|
|
GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
2010-12-06 08:03:53 +00:00
|
|
|
|
/* Here we want the column re-requested if the underlying context was
|
|
|
|
|
* actually reset for any reason, this can happen if the underlying
|
|
|
|
|
* area/cell configuration changes (i.e. cell packing properties
|
|
|
|
|
* or cell spacing and the like)
|
|
|
|
|
*
|
|
|
|
|
* Note that we block this handler while requesting for sizes
|
|
|
|
|
* so there is no need to check for the new context size being -1,
|
|
|
|
|
* we also block the handler when explicitly resetting the context
|
|
|
|
|
* so as to avoid some infinite stack recursion.
|
|
|
|
|
*/
|
2010-11-29 04:01:49 +00:00
|
|
|
|
if (!strcmp (pspec->name, "minimum-width") ||
|
|
|
|
|
!strcmp (pspec->name, "natural-width") ||
|
|
|
|
|
!strcmp (pspec->name, "minimum-height") ||
|
|
|
|
|
!strcmp (pspec->name, "natural-height"))
|
2010-12-12 07:43:07 +00:00
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
2010-11-29 04:01:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_add_editable_callback (GtkCellArea *area,
|
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellEditable *edit_widget,
|
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
|
const gchar *path_string,
|
|
|
|
|
gpointer user_data)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumn *column = user_data;
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
GtkTreePath *path;
|
2010-11-28 18:01:49 +00:00
|
|
|
|
|
2010-12-01 14:26:25 +00:00
|
|
|
|
if (priv->tree_view)
|
|
|
|
|
{
|
|
|
|
|
path = gtk_tree_path_new_from_string (path_string);
|
|
|
|
|
|
|
|
|
|
_gtk_tree_view_add_editable (GTK_TREE_VIEW (priv->tree_view),
|
|
|
|
|
column,
|
|
|
|
|
path,
|
|
|
|
|
edit_widget,
|
|
|
|
|
cell_area);
|
|
|
|
|
|
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
}
|
2010-11-28 18:01:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_remove_editable_callback (GtkCellArea *area,
|
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellEditable *edit_widget,
|
|
|
|
|
gpointer user_data)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumn *column = user_data;
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2010-11-28 18:01:49 +00:00
|
|
|
|
|
2010-12-01 14:26:25 +00:00
|
|
|
|
if (priv->tree_view)
|
|
|
|
|
_gtk_tree_view_remove_editable (GTK_TREE_VIEW (priv->tree_view),
|
|
|
|
|
column,
|
|
|
|
|
edit_widget);
|
2010-11-28 18:01:49 +00:00
|
|
|
|
}
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
/* Exported Private Functions.
|
|
|
|
|
* These should only be called by gtktreeview.c or gtktreeviewcolumn.c
|
|
|
|
|
*/
|
2001-03-02 00:49:32 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
2017-07-15 18:43:52 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW (priv->tree_view));
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_return_if_fail (gtk_widget_get_realized (priv->tree_view));
|
|
|
|
|
g_return_if_fail (priv->button != NULL);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_update_button (column);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_tree_view_column_unset_model (GtkTreeViewColumn *column,
|
|
|
|
|
GtkTreeModel *old_model)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->sort_column_changed_signal)
|
2002-10-13 19:34:42 +00:00
|
|
|
|
{
|
|
|
|
|
g_signal_handler_disconnect (old_model,
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->sort_column_changed_signal);
|
|
|
|
|
priv->sort_column_changed_signal = 0;
|
2002-10-13 19:34:42 +00:00
|
|
|
|
}
|
2004-10-03 06:12:09 +00:00
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, FALSE);
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column,
|
|
|
|
|
GtkTreeView *tree_view)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
|
|
g_assert (priv->tree_view == NULL);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->tree_view = GTK_WIDGET (tree_view);
|
2015-09-05 23:46:24 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_set_parent (priv->button, GTK_WIDGET (tree_view));
|
2001-03-29 21:30:05 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->property_changed_signal =
|
2010-12-01 14:26:25 +00:00
|
|
|
|
g_signal_connect_swapped (tree_view,
|
|
|
|
|
"notify::model",
|
|
|
|
|
G_CALLBACK (gtk_tree_view_column_setup_sort_column_id_callback),
|
|
|
|
|
column);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_setup_sort_column_id_callback (column);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
_gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
2017-10-06 19:24:01 +00:00
|
|
|
|
if (priv->tree_view == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (priv->tree_view), priv->button);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->property_changed_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_signal_handler_disconnect (priv->tree_view, priv->property_changed_signal);
|
|
|
|
|
priv->property_changed_signal = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->sort_column_changed_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_signal_handler_disconnect (gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view)),
|
2017-10-06 19:24:01 +00:00
|
|
|
|
priv->sort_column_changed_signal);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->sort_column_changed_signal = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->tree_view = NULL;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-04-09 19:48:32 +00:00
|
|
|
|
gboolean
|
|
|
|
|
_gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2010-11-28 18:01:49 +00:00
|
|
|
|
gboolean ret = FALSE;
|
|
|
|
|
GList *list, *cells;
|
2002-04-09 19:48:32 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->cell_area));
|
2010-11-28 18:01:49 +00:00
|
|
|
|
|
|
|
|
|
for (list = cells; list; list = list->next)
|
2010-05-30 20:38:33 +00:00
|
|
|
|
{
|
2010-11-28 18:01:49 +00:00
|
|
|
|
GtkCellRenderer *cell = list->data;
|
|
|
|
|
GtkCellRendererMode mode;
|
|
|
|
|
|
2010-05-30 20:38:33 +00:00
|
|
|
|
g_object_get (cell, "mode", &mode, NULL);
|
2010-11-28 18:01:49 +00:00
|
|
|
|
|
2010-05-30 20:38:33 +00:00
|
|
|
|
if (mode == GTK_CELL_RENDERER_MODE_EDITABLE)
|
2010-11-28 18:01:49 +00:00
|
|
|
|
{
|
|
|
|
|
ret = TRUE;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2010-05-30 20:38:33 +00:00
|
|
|
|
}
|
2002-04-09 19:48:32 +00:00
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
|
g_list_free (cells);
|
|
|
|
|
|
|
|
|
|
return ret;
|
2002-04-09 19:48:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
/* gets cell being edited */
|
2002-04-14 15:05:04 +00:00
|
|
|
|
GtkCellRenderer *
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
_gtk_tree_view_column_get_edited_cell (GtkTreeViewColumn *column)
|
2002-04-14 15:05:04 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
|
|
return gtk_cell_area_get_edited_cell (priv->cell_area);
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-05 17:18:36 +00:00
|
|
|
|
GtkCellRenderer *
|
|
|
|
|
_gtk_tree_view_column_get_cell_at_pos (GtkTreeViewColumn *column,
|
2010-12-12 14:22:49 +00:00
|
|
|
|
GdkRectangle *cell_area,
|
2010-12-15 22:45:04 +00:00
|
|
|
|
GdkRectangle *background_area,
|
2010-12-12 14:22:49 +00:00
|
|
|
|
gint x,
|
|
|
|
|
gint y)
|
2010-12-05 17:18:36 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCellRenderer *match = NULL;
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
2010-12-15 22:45:04 +00:00
|
|
|
|
/* If (x, y) is outside of the background area, immediately return */
|
|
|
|
|
if (x < background_area->x ||
|
|
|
|
|
x > background_area->x + background_area->width ||
|
|
|
|
|
y < background_area->y ||
|
|
|
|
|
y > background_area->y + background_area->height)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
/* If (x, y) is inside the background area, clamp it to the cell_area
|
|
|
|
|
* so that a cell is still returned. The main reason for doing this
|
|
|
|
|
* (on the x axis) is for handling clicks in the indentation area
|
|
|
|
|
* (either at the left or right depending on RTL setting). Another
|
|
|
|
|
* reason is for handling clicks on the area where the focus rectangle
|
|
|
|
|
* is drawn (this is outside of cell area), this manifests itself
|
|
|
|
|
* mainly when a large setting is used for focus-line-width.
|
|
|
|
|
*/
|
2010-12-12 16:32:59 +00:00
|
|
|
|
if (x < cell_area->x)
|
2010-12-15 22:45:04 +00:00
|
|
|
|
x = cell_area->x;
|
|
|
|
|
else if (x > cell_area->x + cell_area->width)
|
|
|
|
|
x = cell_area->x + cell_area->width;
|
|
|
|
|
|
|
|
|
|
if (y < cell_area->y)
|
|
|
|
|
y = cell_area->y;
|
|
|
|
|
else if (y > cell_area->y + cell_area->height)
|
|
|
|
|
y = cell_area->y + cell_area->height;
|
2010-12-12 16:32:59 +00:00
|
|
|
|
|
2010-12-12 14:22:49 +00:00
|
|
|
|
match = gtk_cell_area_get_cell_at_position (priv->cell_area,
|
|
|
|
|
priv->cell_area_context,
|
|
|
|
|
priv->tree_view,
|
|
|
|
|
cell_area,
|
|
|
|
|
x, y,
|
|
|
|
|
NULL);
|
2010-12-05 17:18:36 +00:00
|
|
|
|
|
|
|
|
|
return match;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-07 14:35:35 +00:00
|
|
|
|
gboolean
|
|
|
|
|
_gtk_tree_view_column_is_blank_at_pos (GtkTreeViewColumn *column,
|
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
|
GdkRectangle *background_area,
|
|
|
|
|
gint x,
|
|
|
|
|
gint y)
|
|
|
|
|
{
|
|
|
|
|
GtkCellRenderer *match;
|
|
|
|
|
GdkRectangle cell_alloc, aligned_area, inner_area;
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
|
|
match = _gtk_tree_view_column_get_cell_at_pos (column,
|
|
|
|
|
cell_area,
|
|
|
|
|
background_area,
|
|
|
|
|
x, y);
|
|
|
|
|
if (!match)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
gtk_cell_area_get_cell_allocation (priv->cell_area,
|
|
|
|
|
priv->cell_area_context,
|
|
|
|
|
priv->tree_view,
|
|
|
|
|
match,
|
|
|
|
|
cell_area,
|
|
|
|
|
&cell_alloc);
|
|
|
|
|
|
|
|
|
|
gtk_cell_area_inner_cell_area (priv->cell_area, priv->tree_view,
|
|
|
|
|
&cell_alloc, &inner_area);
|
|
|
|
|
gtk_cell_renderer_get_aligned_area (match, priv->tree_view, 0,
|
|
|
|
|
&inner_area, &aligned_area);
|
|
|
|
|
|
|
|
|
|
if (x < aligned_area.x ||
|
|
|
|
|
x > aligned_area.x + aligned_area.width ||
|
|
|
|
|
y < aligned_area.y ||
|
|
|
|
|
y > aligned_area.y + aligned_area.height)
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
|
/* Public Functions */
|
|
|
|
|
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_new:
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GtkTreeViewColumn.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A newly created #GtkTreeViewColumn.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-11-09 16:52:17 +00:00
|
|
|
|
GtkTreeViewColumn *
|
2000-10-05 01:04:57 +00:00
|
|
|
|
gtk_tree_view_column_new (void)
|
|
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
|
GtkTreeViewColumn *tree_column;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2002-10-13 19:34:42 +00:00
|
|
|
|
tree_column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, NULL);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
return tree_column;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-06 10:04:51 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_new_with_area:
|
|
|
|
|
* @area: the #GtkCellArea that the newly created column should use to layout cells.
|
|
|
|
|
*
|
2011-02-23 09:26:21 +00:00
|
|
|
|
* Creates a new #GtkTreeViewColumn using @area to render its cells.
|
2010-12-06 10:04:51 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A newly created #GtkTreeViewColumn.
|
2010-12-06 10:04:51 +00:00
|
|
|
|
*/
|
|
|
|
|
GtkTreeViewColumn *
|
|
|
|
|
gtk_tree_view_column_new_with_area (GtkCellArea *area)
|
|
|
|
|
{
|
|
|
|
|
GtkTreeViewColumn *tree_column;
|
|
|
|
|
|
|
|
|
|
tree_column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, "cell-area", area, NULL);
|
|
|
|
|
|
|
|
|
|
return tree_column;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_new_with_attributes:
|
2011-09-26 00:58:59 +00:00
|
|
|
|
* @title: The title to set the header to
|
|
|
|
|
* @cell: The #GtkCellRenderer
|
|
|
|
|
* @...: A %NULL-terminated list of attributes
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GtkTreeViewColumn with a number of default values.
|
|
|
|
|
* This is equivalent to calling gtk_tree_view_column_set_title(),
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* gtk_tree_view_column_pack_start(), and
|
|
|
|
|
* gtk_tree_view_column_set_attributes() on the newly created #GtkTreeViewColumn.
|
2002-03-15 21:47:52 +00:00
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Here’s a simple example:
|
2014-01-27 19:55:18 +00:00
|
|
|
|
* |[<!-- language="C" -->
|
2002-04-18 22:04:46 +00:00
|
|
|
|
* enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS };
|
2018-01-03 13:10:22 +00:00
|
|
|
|
* // ...
|
2002-04-18 22:04:46 +00:00
|
|
|
|
* {
|
|
|
|
|
* GtkTreeViewColumn *column;
|
2007-11-25 06:51:19 +00:00
|
|
|
|
* GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
|
2002-04-18 22:04:46 +00:00
|
|
|
|
*
|
|
|
|
|
* column = gtk_tree_view_column_new_with_attributes ("Title",
|
|
|
|
|
* renderer,
|
|
|
|
|
* "text", TEXT_COLUMN,
|
|
|
|
|
* "foreground", COLOR_COLUMN,
|
|
|
|
|
* NULL);
|
|
|
|
|
* }
|
2007-11-25 06:51:19 +00:00
|
|
|
|
* ]|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A newly created #GtkTreeViewColumn.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-11-09 16:52:17 +00:00
|
|
|
|
GtkTreeViewColumn *
|
2001-02-17 00:16:08 +00:00
|
|
|
|
gtk_tree_view_column_new_with_attributes (const gchar *title,
|
2000-10-05 01:04:57 +00:00
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
|
...)
|
|
|
|
|
{
|
2000-11-09 16:52:17 +00:00
|
|
|
|
GtkTreeViewColumn *retval;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
|
|
retval = gtk_tree_view_column_new ();
|
|
|
|
|
|
2000-11-09 16:52:17 +00:00
|
|
|
|
gtk_tree_view_column_set_title (retval, title);
|
2001-09-25 19:38:18 +00:00
|
|
|
|
gtk_tree_view_column_pack_start (retval, cell, TRUE);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
|
|
va_start (args, cell);
|
2001-06-27 23:44:53 +00:00
|
|
|
|
gtk_tree_view_column_set_attributesv (retval, cell, args);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
va_end (args);
|
|
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
|
/**
|
2001-08-24 20:09:26 +00:00
|
|
|
|
* gtk_tree_view_column_pack_start:
|
2001-06-27 23:44:53 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* @cell: The #GtkCellRenderer.
|
2003-09-30 21:02:05 +00:00
|
|
|
|
* @expand: %TRUE if @cell is to be given extra space allocated to @tree_column.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
*
|
2003-09-30 21:02:05 +00:00
|
|
|
|
* Packs the @cell into the beginning of the column. If @expand is %FALSE, then
|
2002-09-28 20:03:56 +00:00
|
|
|
|
* the @cell is allocated no more space than it needs. Any unused space is divided
|
2003-09-30 21:02:05 +00:00
|
|
|
|
* evenly between cells for which @expand is %TRUE.
|
2001-06-27 23:44:53 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2001-08-24 20:09:26 +00:00
|
|
|
|
gtk_tree_view_column_pack_start (GtkTreeViewColumn *tree_column,
|
|
|
|
|
GtkCellRenderer *cell,
|
2001-09-08 00:56:30 +00:00
|
|
|
|
gboolean expand)
|
2001-06-27 23:44:53 +00:00
|
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
|
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (tree_column), cell, expand);
|
2001-06-27 23:44:53 +00:00
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_pack_end:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
* @cell: The #GtkCellRenderer.
|
2003-09-30 21:02:05 +00:00
|
|
|
|
* @expand: %TRUE if @cell is to be given extra space allocated to @tree_column.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
*
|
2003-09-30 21:02:05 +00:00
|
|
|
|
* Adds the @cell to end of the column. If @expand is %FALSE, then the @cell
|
2002-09-28 20:03:56 +00:00
|
|
|
|
* is allocated no more space than it needs. Any unused space is divided
|
2003-09-30 21:02:05 +00:00
|
|
|
|
* evenly between cells for which @expand is %TRUE.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
**/
|
2001-06-27 23:44:53 +00:00
|
|
|
|
void
|
2001-08-24 20:09:26 +00:00
|
|
|
|
gtk_tree_view_column_pack_end (GtkTreeViewColumn *tree_column,
|
|
|
|
|
GtkCellRenderer *cell,
|
2001-09-08 00:56:30 +00:00
|
|
|
|
gboolean expand)
|
2001-06-27 23:44:53 +00:00
|
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
|
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (tree_column), cell, expand);
|
2001-06-27 23:44:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_clear:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
|
*
|
|
|
|
|
* Unsets all the mappings on all renderers on the @tree_column.
|
|
|
|
|
**/
|
2001-06-27 23:44:53 +00:00
|
|
|
|
void
|
2001-08-24 20:09:26 +00:00
|
|
|
|
gtk_tree_view_column_clear (GtkTreeViewColumn *tree_column)
|
2001-06-27 23:44:53 +00:00
|
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
|
gtk_cell_layout_clear (GTK_CELL_LAYOUT (tree_column));
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_add_attribute:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-09-08 06:24:46 +00:00
|
|
|
|
* @cell_renderer: the #GtkCellRenderer to set attributes on
|
|
|
|
|
* @attribute: An attribute on the renderer
|
2000-10-16 06:14:53 +00:00
|
|
|
|
* @column: The column position on the model to get the attribute from.
|
|
|
|
|
*
|
|
|
|
|
* Adds an attribute mapping to the list in @tree_column. The @column is the
|
2001-09-08 06:24:46 +00:00
|
|
|
|
* column of the model to get a value from, and the @attribute is the
|
|
|
|
|
* parameter on @cell_renderer to be set from the value. So for example
|
|
|
|
|
* if column 2 of the model contains strings, you could have the
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* “text” attribute of a #GtkCellRendererText get its values from
|
2001-09-08 06:24:46 +00:00
|
|
|
|
* column 2.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_add_attribute (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
|
GtkCellRenderer *cell_renderer,
|
2001-02-17 00:16:08 +00:00
|
|
|
|
const gchar *attribute,
|
2000-10-05 01:04:57 +00:00
|
|
|
|
gint column)
|
|
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
|
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (tree_column),
|
|
|
|
|
cell_renderer, attribute, column);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
|
GtkCellRenderer *cell_renderer,
|
2000-10-05 01:04:57 +00:00
|
|
|
|
va_list args)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
gchar *attribute;
|
|
|
|
|
gint column;
|
|
|
|
|
|
|
|
|
|
attribute = va_arg (args, gchar *);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_cell_layout_clear_attributes (GTK_CELL_LAYOUT (priv->cell_area),
|
2010-11-28 18:01:49 +00:00
|
|
|
|
cell_renderer);
|
2001-01-11 17:59:40 +00:00
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
while (attribute != NULL)
|
|
|
|
|
{
|
|
|
|
|
column = va_arg (args, gint);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (priv->cell_area),
|
2010-11-28 18:01:49 +00:00
|
|
|
|
cell_renderer, attribute, column);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
attribute = va_arg (args, gchar *);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_attributes:
|
2011-09-26 00:58:59 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2014-02-07 18:37:09 +00:00
|
|
|
|
* @cell_renderer: the #GtkCellRenderer we’re setting the attributes of
|
2011-09-26 00:58:59 +00:00
|
|
|
|
* @...: A %NULL-terminated list of attributes
|
|
|
|
|
*
|
Adapt to GtkTreeSelection changes
2001-01-01 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c: Adapt to GtkTreeSelection changes
* gtk/gtktreeselection.c (_gtk_tree_selection_set_tree_view):
don't fill in tree_view->priv->selection, kind of an unexpected
side effect
* gtk/gtkcellrenderertext.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderer.c: Remove definition of _ and include
gtkintl.h
(gtk_cell_renderer_get_property): remove calls to g_value_init
* gtk/gtkcellrendererpixbuf.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderertextpixbuf.c: Remove definition of _ macro
and include gtkintl.h
(gtk_cell_renderer_text_pixbuf_class_init): remove spaces from
property names
* gtk/gtktreeselection.c (_gtk_tree_selection_new): rename, return
GtkTreeSelection
(_gtk_tree_selection_new_from_with_view): rename, return
GtkTreeSelection
(_gtk_tree_selection_set_tree_view): rename with uscore
(gtk_tree_selection_get_selected): fill in the "model" out param
first, so it gets filled in even if we return at the top of the
function
(gtk_tree_selection_real_select_all): add a comment and an else{}
to clarify this a bit
(gtk_tree_selection_real_unselect_all): add the same else{}
* gtk/gtktreeselection.h: Rename new, new_with_tree_view, and
set_tree_view to have underscore prefixes, move them to the
private header, fix return type of new_with_tree_view
(struct _GtkTreeSelection): mark struct
fields private
* gtk/gtktreemodel.c (gtk_tree_model_get_flags): return
GtkTreeModelFlags, not a guint
(gtk_tree_path_prev): return gboolean not gint
(gtk_tree_path_up): return gboolean not gint
* gtk/gtktreemodel.h (struct _GtkTreeModelIface): make get_flags
return GtkTreeModelFlags, not a guint
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_finalize): check
that child model is non-null before unrefing it
(g_value_int_compare_func): make this a qsort compare func, not
a boolean predicate
* gtk/gtktreemodelsort.h: rename gtk_tree_model_set_sort_column,
(add -umn to the end), and mark it unimplemented
(gtk_tree_model_sort_resort): remove, this wasn't implemented, and
I don't see what it's for - doesn't the model always sort itself?
(gtk_tree_model_sort_set_compare): this had the wrong signature
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_attributes):
Fix the docs to say that it destructively replaces existing
attributes (previously said that it added attributes).
(gtk_tree_view_column_set_visible): canonicalize bool before
equality testing. Also, check for realization before
hiding/showing the tree_column->window; if this window could exist
before realization, then it's busted and needs fixing, we can't
create GDK resources pre-realization. Also, remove
superfluous queue_resize(), since set_size() does that for us.
(gtk_tree_view_column_set_col_type): check realization before
using tree_column->window
* gtk/gtktreedatalist.c: fix filename in copyright notice
2001-01-01 19:01:54 +00:00
|
|
|
|
* Sets the attributes in the list as the attributes of @tree_column.
|
|
|
|
|
* The attributes should be in attribute/column order, as in
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* gtk_tree_view_column_add_attribute(). All existing attributes
|
Adapt to GtkTreeSelection changes
2001-01-01 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c: Adapt to GtkTreeSelection changes
* gtk/gtktreeselection.c (_gtk_tree_selection_set_tree_view):
don't fill in tree_view->priv->selection, kind of an unexpected
side effect
* gtk/gtkcellrenderertext.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderer.c: Remove definition of _ and include
gtkintl.h
(gtk_cell_renderer_get_property): remove calls to g_value_init
* gtk/gtkcellrendererpixbuf.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderertextpixbuf.c: Remove definition of _ macro
and include gtkintl.h
(gtk_cell_renderer_text_pixbuf_class_init): remove spaces from
property names
* gtk/gtktreeselection.c (_gtk_tree_selection_new): rename, return
GtkTreeSelection
(_gtk_tree_selection_new_from_with_view): rename, return
GtkTreeSelection
(_gtk_tree_selection_set_tree_view): rename with uscore
(gtk_tree_selection_get_selected): fill in the "model" out param
first, so it gets filled in even if we return at the top of the
function
(gtk_tree_selection_real_select_all): add a comment and an else{}
to clarify this a bit
(gtk_tree_selection_real_unselect_all): add the same else{}
* gtk/gtktreeselection.h: Rename new, new_with_tree_view, and
set_tree_view to have underscore prefixes, move them to the
private header, fix return type of new_with_tree_view
(struct _GtkTreeSelection): mark struct
fields private
* gtk/gtktreemodel.c (gtk_tree_model_get_flags): return
GtkTreeModelFlags, not a guint
(gtk_tree_path_prev): return gboolean not gint
(gtk_tree_path_up): return gboolean not gint
* gtk/gtktreemodel.h (struct _GtkTreeModelIface): make get_flags
return GtkTreeModelFlags, not a guint
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_finalize): check
that child model is non-null before unrefing it
(g_value_int_compare_func): make this a qsort compare func, not
a boolean predicate
* gtk/gtktreemodelsort.h: rename gtk_tree_model_set_sort_column,
(add -umn to the end), and mark it unimplemented
(gtk_tree_model_sort_resort): remove, this wasn't implemented, and
I don't see what it's for - doesn't the model always sort itself?
(gtk_tree_model_sort_set_compare): this had the wrong signature
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_attributes):
Fix the docs to say that it destructively replaces existing
attributes (previously said that it added attributes).
(gtk_tree_view_column_set_visible): canonicalize bool before
equality testing. Also, check for realization before
hiding/showing the tree_column->window; if this window could exist
before realization, then it's busted and needs fixing, we can't
create GDK resources pre-realization. Also, remove
superfluous queue_resize(), since set_size() does that for us.
(gtk_tree_view_column_set_col_type): check realization before
using tree_column->window
* gtk/gtktreedatalist.c: fix filename in copyright notice
2001-01-01 19:01:54 +00:00
|
|
|
|
* are removed, and replaced with the new attributes.
|
2011-09-26 00:58:59 +00:00
|
|
|
|
*/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
|
GtkCellRenderer *cell_renderer,
|
2000-10-05 01:04:57 +00:00
|
|
|
|
...)
|
|
|
|
|
{
|
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-06-27 23:44:53 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CELL_RENDERER (cell_renderer));
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
|
va_start (args, cell_renderer);
|
|
|
|
|
gtk_tree_view_column_set_attributesv (tree_column, cell_renderer, args);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
va_end (args);
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-17 00:16:08 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2001-02-21 19:59:23 +00:00
|
|
|
|
* gtk_tree_view_column_set_cell_data_func:
|
2001-02-17 00:16:08 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2001-10-03 04:44:13 +00:00
|
|
|
|
* @cell_renderer: A #GtkCellRenderer
|
2012-07-02 06:19:06 +00:00
|
|
|
|
* @func: (allow-none): The #GtkTreeCellDataFunc to use.
|
2014-05-26 16:24:00 +00:00
|
|
|
|
* @func_data: (closure): The user data for @func.
|
2001-02-17 00:16:08 +00:00
|
|
|
|
* @destroy: The destroy notification for @func_data
|
|
|
|
|
*
|
2012-07-02 06:19:06 +00:00
|
|
|
|
* Sets the #GtkTreeCellDataFunc to use for the column. This
|
2001-09-08 06:24:46 +00:00
|
|
|
|
* function is used instead of the standard attributes mapping for
|
|
|
|
|
* setting the column value, and should set the value of @tree_column's
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* cell renderer as appropriate. @func may be %NULL to remove an
|
2001-09-08 06:24:46 +00:00
|
|
|
|
* older one.
|
2001-02-17 00:16:08 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2001-06-01 22:57:30 +00:00
|
|
|
|
gtk_tree_view_column_set_cell_data_func (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
|
GtkCellRenderer *cell_renderer,
|
2001-06-01 22:57:30 +00:00
|
|
|
|
GtkTreeCellDataFunc func,
|
|
|
|
|
gpointer func_data,
|
2008-06-18 09:12:32 +00:00
|
|
|
|
GDestroyNotify destroy)
|
2001-02-17 00:16:08 +00:00
|
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
|
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (tree_column),
|
|
|
|
|
cell_renderer,
|
|
|
|
|
(GtkCellLayoutDataFunc)func,
|
|
|
|
|
func_data, destroy);
|
2001-02-17 00:16:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-01-11 17:59:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_clear_attributes:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* @cell_renderer: a #GtkCellRenderer to clear the attribute mapping on.
|
2001-01-11 17:59:40 +00:00
|
|
|
|
*
|
|
|
|
|
* Clears all existing attributes previously set with
|
|
|
|
|
* gtk_tree_view_column_set_attributes().
|
|
|
|
|
**/
|
|
|
|
|
void
|
2001-06-27 23:44:53 +00:00
|
|
|
|
gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column,
|
|
|
|
|
GtkCellRenderer *cell_renderer)
|
2001-01-11 17:59:40 +00:00
|
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
|
gtk_cell_layout_clear_attributes (GTK_CELL_LAYOUT (tree_column),
|
|
|
|
|
cell_renderer);
|
2002-06-07 22:02:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-30 02:38:17 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_spacing:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
* @spacing: distance between cell renderers in pixels.
|
|
|
|
|
*
|
|
|
|
|
* Sets the spacing field of @tree_column, which is the number of pixels to
|
|
|
|
|
* place between cell renderers packed into it.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_spacing (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gint spacing)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2001-06-30 02:38:17 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
g_return_if_fail (spacing >= 0);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2014-06-09 15:50:22 +00:00
|
|
|
|
if (gtk_cell_area_box_get_spacing (GTK_CELL_AREA_BOX (priv->cell_area)) != spacing)
|
|
|
|
|
{
|
|
|
|
|
gtk_cell_area_box_set_spacing (GTK_CELL_AREA_BOX (priv->cell_area), spacing);
|
|
|
|
|
if (priv->tree_view)
|
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_SPACING]);
|
2014-06-09 15:50:22 +00:00
|
|
|
|
}
|
2001-06-30 02:38:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_spacing:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
|
|
|
|
* Returns the spacing of @tree_column.
|
2001-12-08 21:39:34 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the spacing of @tree_column.
|
2001-06-30 02:38:17 +00:00
|
|
|
|
**/
|
|
|
|
|
gint
|
|
|
|
|
gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2001-06-30 02:38:17 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
|
|
return gtk_cell_area_box_get_spacing (GTK_CELL_AREA_BOX (priv->cell_area));
|
2001-06-30 02:38:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
/* Options for manipulating the columns */
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_visible:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* @visible: %TRUE if the @tree_column is visible.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets the visibility of @tree_column.
|
2011-02-03 04:54:38 +00:00
|
|
|
|
*/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
|
2011-02-03 04:54:38 +00:00
|
|
|
|
gboolean visible)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
Adapt to GtkTreeSelection changes
2001-01-01 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c: Adapt to GtkTreeSelection changes
* gtk/gtktreeselection.c (_gtk_tree_selection_set_tree_view):
don't fill in tree_view->priv->selection, kind of an unexpected
side effect
* gtk/gtkcellrenderertext.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderer.c: Remove definition of _ and include
gtkintl.h
(gtk_cell_renderer_get_property): remove calls to g_value_init
* gtk/gtkcellrendererpixbuf.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderertextpixbuf.c: Remove definition of _ macro
and include gtkintl.h
(gtk_cell_renderer_text_pixbuf_class_init): remove spaces from
property names
* gtk/gtktreeselection.c (_gtk_tree_selection_new): rename, return
GtkTreeSelection
(_gtk_tree_selection_new_from_with_view): rename, return
GtkTreeSelection
(_gtk_tree_selection_set_tree_view): rename with uscore
(gtk_tree_selection_get_selected): fill in the "model" out param
first, so it gets filled in even if we return at the top of the
function
(gtk_tree_selection_real_select_all): add a comment and an else{}
to clarify this a bit
(gtk_tree_selection_real_unselect_all): add the same else{}
* gtk/gtktreeselection.h: Rename new, new_with_tree_view, and
set_tree_view to have underscore prefixes, move them to the
private header, fix return type of new_with_tree_view
(struct _GtkTreeSelection): mark struct
fields private
* gtk/gtktreemodel.c (gtk_tree_model_get_flags): return
GtkTreeModelFlags, not a guint
(gtk_tree_path_prev): return gboolean not gint
(gtk_tree_path_up): return gboolean not gint
* gtk/gtktreemodel.h (struct _GtkTreeModelIface): make get_flags
return GtkTreeModelFlags, not a guint
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_finalize): check
that child model is non-null before unrefing it
(g_value_int_compare_func): make this a qsort compare func, not
a boolean predicate
* gtk/gtktreemodelsort.h: rename gtk_tree_model_set_sort_column,
(add -umn to the end), and mark it unimplemented
(gtk_tree_model_sort_resort): remove, this wasn't implemented, and
I don't see what it's for - doesn't the model always sort itself?
(gtk_tree_model_sort_set_compare): this had the wrong signature
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_attributes):
Fix the docs to say that it destructively replaces existing
attributes (previously said that it added attributes).
(gtk_tree_view_column_set_visible): canonicalize bool before
equality testing. Also, check for realization before
hiding/showing the tree_column->window; if this window could exist
before realization, then it's busted and needs fixing, we can't
create GDK resources pre-realization. Also, remove
superfluous queue_resize(), since set_size() does that for us.
(gtk_tree_view_column_set_col_type): check realization before
using tree_column->window
* gtk/gtktreedatalist.c: fix filename in copyright notice
2001-01-01 19:01:54 +00:00
|
|
|
|
visible = !! visible;
|
2011-02-03 04:54:38 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->visible == visible)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
return;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->visible = visible;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2015-09-05 23:46:24 +00:00
|
|
|
|
gtk_widget_set_visible (priv->button, visible);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->visible)
|
2002-02-25 21:20:25 +00:00
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
|
|
|
|
|
2011-02-03 04:54:38 +00:00
|
|
|
|
if (priv->tree_view)
|
2011-11-16 02:47:33 +00:00
|
|
|
|
{
|
|
|
|
|
_gtk_tree_view_accessible_toggle_visibility (GTK_TREE_VIEW (priv->tree_view),
|
|
|
|
|
tree_column);
|
|
|
|
|
}
|
2011-01-12 20:18:07 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_VISIBLE]);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_visible:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* Returns %TRUE if @tree_column is visible.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: whether the column is visible or not. If it is visible, then
|
2000-10-16 06:14:53 +00:00
|
|
|
|
* the tree will show the column.
|
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->visible;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_resizable:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
|
* @resizable: %TRUE, if the column can be resized
|
|
|
|
|
*
|
|
|
|
|
* If @resizable is %TRUE, then the user can explicitly resize the column by
|
2004-01-31 21:42:28 +00:00
|
|
|
|
* grabbing the outer edge of the column button. If resizable is %TRUE and
|
2002-03-05 23:08:56 +00:00
|
|
|
|
* sizing mode of the column is #GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing
|
|
|
|
|
* mode is changed to #GTK_TREE_VIEW_COLUMN_GROW_ONLY.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
**/
|
2001-11-19 21:18:22 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_resizable (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gboolean resizable)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
2001-11-19 21:18:22 +00:00
|
|
|
|
resizable = !! resizable;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->resizable == resizable)
|
2001-11-19 21:18:22 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->resizable = resizable;
|
2001-12-04 23:49:57 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (resizable && priv->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
2001-11-19 21:18:22 +00:00
|
|
|
|
gtk_tree_view_column_set_sizing (tree_column, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
|
|
|
|
|
|
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
|
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_RESIZABLE]);
|
2001-11-19 21:18:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_resizable:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
|
* Returns %TRUE if the @tree_column can be resized by the end user.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE, if the @tree_column can be resized.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
**/
|
2001-11-19 21:18:22 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->resizable;
|
2001-11-19 21:18:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
2001-01-04 21:33:24 +00:00
|
|
|
|
* gtk_tree_view_column_set_sizing:
|
2000-10-16 06:14:53 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-01-04 21:33:24 +00:00
|
|
|
|
* @type: The #GtkTreeViewColumnSizing.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets the growth behavior of @tree_column to @type.
|
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column,
|
2001-01-09 23:24:20 +00:00
|
|
|
|
GtkTreeViewColumnSizing type)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
|
|
if (type == priv->column_type)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
|
if (type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
|
|
|
|
gtk_tree_view_column_set_resizable (tree_column, FALSE);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->column_type = type;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
|
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_SIZING]);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
2001-01-09 23:24:20 +00:00
|
|
|
|
* gtk_tree_view_column_get_sizing:
|
2000-10-16 06:14:53 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
|
|
|
|
* Returns the current type of @tree_column.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The type of @tree_column.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2001-06-05 19:01:30 +00:00
|
|
|
|
GtkTreeViewColumnSizing
|
2001-01-09 23:24:20 +00:00
|
|
|
|
gtk_tree_view_column_get_sizing (GtkTreeViewColumn *tree_column)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->column_type;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
2001-09-08 00:56:30 +00:00
|
|
|
|
* gtk_tree_view_column_get_width:
|
2000-10-16 06:14:53 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* Returns the current size of @tree_column in pixels.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The current width of @tree_column.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
gint
|
2001-09-08 00:56:30 +00:00
|
|
|
|
gtk_tree_view_column_get_width (GtkTreeViewColumn *tree_column)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->width;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-06-10 04:09:25 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_x_offset:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
|
|
|
|
* Returns the current X offset of @tree_column in pixels.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The current X offset of @tree_column.
|
2011-06-10 04:09:25 +00:00
|
|
|
|
*/
|
|
|
|
|
gint
|
|
|
|
|
gtk_tree_view_column_get_x_offset (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
|
|
|
|
return tree_column->priv->x_offset;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-01 14:16:01 +00:00
|
|
|
|
gint
|
|
|
|
|
_gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column)
|
2010-12-01 03:41:42 +00:00
|
|
|
|
{
|
2014-06-01 14:16:01 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
gint real_requested_width;
|
2010-12-01 03:41:42 +00:00
|
|
|
|
|
2014-06-01 14:16:01 +00:00
|
|
|
|
priv = tree_column->priv;
|
2010-12-06 07:31:07 +00:00
|
|
|
|
|
2014-06-01 14:16:01 +00:00
|
|
|
|
if (priv->fixed_width != -1)
|
|
|
|
|
{
|
|
|
|
|
real_requested_width = priv->fixed_width;
|
2010-12-01 03:41:42 +00:00
|
|
|
|
}
|
2014-06-01 14:16:01 +00:00
|
|
|
|
else if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view)))
|
|
|
|
|
{
|
|
|
|
|
gint button_request;
|
|
|
|
|
gint requested_width;
|
2010-12-06 07:31:07 +00:00
|
|
|
|
|
2014-06-01 14:16:01 +00:00
|
|
|
|
gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &requested_width, NULL);
|
|
|
|
|
requested_width += priv->padding;
|
2010-12-01 03:41:42 +00:00
|
|
|
|
|
2017-03-05 07:50:52 +00:00
|
|
|
|
gtk_widget_measure (priv->button, GTK_ORIENTATION_HORIZONTAL, -1,
|
|
|
|
|
&button_request, NULL, NULL, NULL);
|
2014-06-01 14:16:01 +00:00
|
|
|
|
real_requested_width = MAX (requested_width, button_request);
|
|
|
|
|
}
|
|
|
|
|
else
|
2012-12-18 07:06:12 +00:00
|
|
|
|
{
|
2014-06-01 14:16:01 +00:00
|
|
|
|
gint requested_width;
|
|
|
|
|
|
|
|
|
|
gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &requested_width, NULL);
|
|
|
|
|
requested_width += priv->padding;
|
|
|
|
|
|
|
|
|
|
real_requested_width = requested_width;
|
|
|
|
|
if (real_requested_width < 0)
|
|
|
|
|
real_requested_width = 0;
|
2012-12-18 07:06:12 +00:00
|
|
|
|
}
|
2010-12-01 03:41:42 +00:00
|
|
|
|
|
2014-06-01 14:16:01 +00:00
|
|
|
|
if (priv->min_width != -1)
|
|
|
|
|
real_requested_width = MAX (real_requested_width, priv->min_width);
|
|
|
|
|
|
2010-12-01 03:41:42 +00:00
|
|
|
|
if (priv->max_width != -1)
|
2014-06-01 14:16:01 +00:00
|
|
|
|
real_requested_width = MIN (real_requested_width, priv->max_width);
|
2010-12-01 03:41:42 +00:00
|
|
|
|
|
2014-06-01 14:16:01 +00:00
|
|
|
|
return real_requested_width;
|
2010-12-01 03:41:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
|
void
|
2010-12-01 03:23:02 +00:00
|
|
|
|
_gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column,
|
|
|
|
|
int x_offset,
|
2017-11-13 00:23:16 +00:00
|
|
|
|
int width,
|
|
|
|
|
int height)
|
2010-11-28 18:01:49 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
2011-09-28 22:27:35 +00:00
|
|
|
|
GtkAllocation allocation = { 0, 0, 0, 0 };
|
2010-11-30 05:29:45 +00:00
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2011-04-05 19:13:43 +00:00
|
|
|
|
if (priv->width != width)
|
|
|
|
|
gtk_widget_queue_draw (priv->tree_view);
|
|
|
|
|
|
2011-06-10 04:09:25 +00:00
|
|
|
|
priv->x_offset = x_offset;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->width = width;
|
2010-11-29 09:04:47 +00:00
|
|
|
|
|
2010-12-06 07:31:07 +00:00
|
|
|
|
gtk_cell_area_context_allocate (priv->cell_area_context, priv->width - priv->padding, -1);
|
2010-12-01 03:23:02 +00:00
|
|
|
|
|
2011-06-09 22:55:19 +00:00
|
|
|
|
if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view)))
|
|
|
|
|
{
|
2017-07-15 18:43:52 +00:00
|
|
|
|
/* TODO: Underallocates the button horizontally, but
|
|
|
|
|
* https://bugzilla.gnome.org/show_bug.cgi?id=770388
|
|
|
|
|
*/
|
|
|
|
|
allocation.x = x_offset;
|
|
|
|
|
allocation.y = 0;
|
2011-06-09 22:55:19 +00:00
|
|
|
|
allocation.width = width;
|
2017-11-13 00:23:16 +00:00
|
|
|
|
allocation.height = height;
|
2010-12-01 03:23:02 +00:00
|
|
|
|
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->button, &allocation, -1);
|
2011-06-09 22:55:19 +00:00
|
|
|
|
}
|
2010-12-01 03:23:02 +00:00
|
|
|
|
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_X_OFFSET]);
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_WIDTH]);
|
2010-11-28 18:01:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
2001-09-08 00:56:30 +00:00
|
|
|
|
* gtk_tree_view_column_set_fixed_width:
|
2000-10-16 06:14:53 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2013-01-17 01:23:37 +00:00
|
|
|
|
* @fixed_width: The new fixed width, in pixels, or -1.
|
|
|
|
|
*
|
|
|
|
|
* If @fixed_width is not -1, sets the fixed width of @tree_column; otherwise
|
|
|
|
|
* unsets it. The effective value of @fixed_width is clamped between the
|
2015-07-03 16:24:23 +00:00
|
|
|
|
* minimum and maximum width of the column; however, the value stored in the
|
|
|
|
|
* “fixed-width” property is not clamped. If the column sizing is
|
|
|
|
|
* #GTK_TREE_VIEW_COLUMN_GROW_ONLY or #GTK_TREE_VIEW_COLUMN_AUTOSIZE, setting
|
|
|
|
|
* a fixed width overrides the automatically calculated width. Note that
|
2013-01-17 01:23:37 +00:00
|
|
|
|
* @fixed_width is only a hint to GTK+; the width actually allocated to the
|
|
|
|
|
* column may be greater or less than requested.
|
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Along with “expand”, the “fixed-width” property changes when the column is
|
2013-01-17 01:23:37 +00:00
|
|
|
|
* resized by the user.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
2001-09-08 00:56:30 +00:00
|
|
|
|
gtk_tree_view_column_set_fixed_width (GtkTreeViewColumn *tree_column,
|
2001-10-03 04:44:13 +00:00
|
|
|
|
gint fixed_width)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2012-12-18 06:26:37 +00:00
|
|
|
|
g_return_if_fail (fixed_width >= -1);
|
2001-03-05 19:43:24 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2014-06-09 15:50:22 +00:00
|
|
|
|
if (priv->fixed_width != fixed_width)
|
2001-12-04 23:49:57 +00:00
|
|
|
|
{
|
2014-06-09 15:50:22 +00:00
|
|
|
|
priv->fixed_width = fixed_width;
|
|
|
|
|
if (priv->visible &&
|
|
|
|
|
priv->tree_view != NULL &&
|
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
|
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2002-01-28 18:52:49 +00:00
|
|
|
|
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_FIXED_WIDTH]);
|
2014-06-09 15:50:22 +00:00
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
/**
|
2001-09-08 00:56:30 +00:00
|
|
|
|
* gtk_tree_view_column_get_fixed_width:
|
2013-01-17 01:23:37 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
|
|
|
|
* Gets the fixed width of the column. This may not be the actual displayed
|
|
|
|
|
* width of the column; for that, use gtk_tree_view_column_get_width().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The fixed width of the column.
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
**/
|
|
|
|
|
gint
|
2001-09-08 00:56:30 +00:00
|
|
|
|
gtk_tree_view_column_get_fixed_width (GtkTreeViewColumn *tree_column)
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->fixed_width;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_min_width:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
* @min_width: The minimum width of the column in pixels, or -1.
|
|
|
|
|
*
|
|
|
|
|
* Sets the minimum width of the @tree_column. If @min_width is -1, then the
|
|
|
|
|
* minimum width is unset.
|
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_min_width (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gint min_width)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
g_return_if_fail (min_width >= -1);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
|
|
if (min_width == priv->min_width)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->visible &&
|
|
|
|
|
priv->tree_view != NULL &&
|
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (min_width > priv->width)
|
|
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->min_width = min_width;
|
2002-01-28 18:52:49 +00:00
|
|
|
|
g_object_freeze_notify (G_OBJECT (tree_column));
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->max_width != -1 && priv->max_width < min_width)
|
2001-12-04 23:49:57 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->max_width = min_width;
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_MAX_WIDTH]);
|
2001-12-04 23:49:57 +00:00
|
|
|
|
}
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_MIN_WIDTH]);
|
2002-01-28 18:52:49 +00:00
|
|
|
|
g_object_thaw_notify (G_OBJECT (tree_column));
|
2002-04-19 23:41:37 +00:00
|
|
|
|
|
2014-02-04 20:32:02 +00:00
|
|
|
|
if (priv->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE && priv->tree_view)
|
2010-11-30 05:29:45 +00:00
|
|
|
|
_gtk_tree_view_column_autosize (GTK_TREE_VIEW (priv->tree_view),
|
2002-04-19 23:41:37 +00:00
|
|
|
|
tree_column);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_min_width:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
|
|
|
|
* Returns the minimum width in pixels of the @tree_column, or -1 if no minimum
|
|
|
|
|
* width is set.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The minimum width of the @tree_column.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
gint
|
|
|
|
|
gtk_tree_view_column_get_min_width (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), -1);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->min_width;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_max_width:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
* @max_width: The maximum width of the column in pixels, or -1.
|
|
|
|
|
*
|
|
|
|
|
* Sets the maximum width of the @tree_column. If @max_width is -1, then the
|
2001-08-24 20:09:26 +00:00
|
|
|
|
* maximum width is unset. Note, the column can actually be wider than max
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* width if it’s the last column in a view. In this case, the column expands to
|
2001-12-04 23:49:57 +00:00
|
|
|
|
* fill any extra space.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_max_width (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gint max_width)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
g_return_if_fail (max_width >= -1);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
|
|
if (max_width == priv->max_width)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->visible &&
|
|
|
|
|
priv->tree_view != NULL &&
|
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
2001-06-05 15:30:53 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (max_width != -1 && max_width < priv->width)
|
|
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2001-06-05 15:30:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->max_width = max_width;
|
2002-01-28 18:52:49 +00:00
|
|
|
|
g_object_freeze_notify (G_OBJECT (tree_column));
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (max_width != -1 && max_width < priv->min_width)
|
2001-12-04 23:49:57 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->min_width = max_width;
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_MIN_WIDTH]);
|
2001-12-04 23:49:57 +00:00
|
|
|
|
}
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_MAX_WIDTH]);
|
2002-01-28 18:52:49 +00:00
|
|
|
|
g_object_thaw_notify (G_OBJECT (tree_column));
|
2002-04-19 23:41:37 +00:00
|
|
|
|
|
2014-02-04 20:32:02 +00:00
|
|
|
|
if (priv->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE && priv->tree_view)
|
2010-11-30 05:29:45 +00:00
|
|
|
|
_gtk_tree_view_column_autosize (GTK_TREE_VIEW (priv->tree_view),
|
2002-04-19 23:41:37 +00:00
|
|
|
|
tree_column);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_max_width:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
|
|
|
|
* Returns the maximum width in pixels of the @tree_column, or -1 if no maximum
|
|
|
|
|
* width is set.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The maximum width of the @tree_column.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
gint
|
|
|
|
|
gtk_tree_view_column_get_max_width (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), -1);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->max_width;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
Port to GObject, can go back in gdk-pixbuf after setting up a
2000-12-16 Havoc Pennington <hp@pobox.com>
* gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c:
Port to GObject, can go back in gdk-pixbuf after setting up
a gdk-pixbuf-marshal.h header over there.
* gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g;
(gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal
args
(gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be
set
(gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons
here, do it when we create the buttons later
(gtk_tree_view_realize_buttons): add some g_return_if_fail
(gtk_tree_view_map): paranoia checks that column->button is shown
and unmapped
(gtk_tree_view_size_request): only request visible children.
Move header size calculation in here, for cleanliness, and
to maintain invariants for child widgets if we eventually
let users set different children inside the buttons
(gtk_tree_view_map_buttons): factor out code to map buttons,
since it was being called several times
(gtk_tree_view_size_allocate_buttons): move_resize the drag
windows instead of just moving them; their height may change
if we allow random widgets in there, or the theme changes.
(gtk_tree_view_size_allocate): move button size allocation
above emitting the scroll signals, to ensure a sane state when we
hit user code
(gtk_tree_view_button_release): remove queue_resize after
tree_view_set_size(), set_size() will handle any resize queuing
that's needed
(gtk_tree_view_focus_in): just queue a draw, don't fool with
draw_focus goo
(gtk_tree_view_focus): use gtk_get_current_event() and
gdk_event_get_state()
(gtk_tree_view_deleted): don't queue_resize() after calling set_size()
(gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove
semicolon
(gtk_tree_view_create_button): show the button here
(gtk_tree_view_button_clicked): actually emit the clicked signal
on the column
(_gtk_tree_view_set_size): return right away if the size is
unchanged, as a cheesy optimization
(gtk_tree_view_setup_model): rename set_model_realized to
setup_model to match the flag that indicates whether we've
called it
(gtk_tree_view_get_hadjustment): create adjustment if it doesn't
exist, because set_scroll_adjustment does that and it shouldn't
matter what order you call these in
(gtk_tree_view_get_vadjustment): ditto
(gtk_tree_view_set_headers_visible): canonicalize the bool,
for paranoia
(gtk_tree_view_set_headers_visible): call
gtk_tree_view_map_buttons() instead of using cut-and-paste code
(gtk_tree_view_append_column): clarify whether the return value
is the count of columns before or after, and do the increment
separately from the return statement so you can tell from the code.
(gtk_tree_view_remove_column): ditto
(gtk_tree_view_insert_column): ditto
(gtk_tree_view_get_column): remove g_return_if_fail for columns
outside the existing range, the docs say that outside-range
columns are allowed, so we handle them as documented. (Presumably
this allows a nice loop with column != NULL as test.)
(gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments
mean (left/right/center etc.).
(gtk_tree_view_collapse_all): only queue a draw if we're mapped
(gtk_tree_view_expand_row): add docs
(gtk_tree_view_collapse_row): add docs
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new
function to emit the clicked signal on a column
* gdk/gdkevents.c (gdk_event_get_state): new function, to get the
state of an event
(gdk_event_get_time): don't treat GDK_SCROLL
as a button event, remove default case from switch so gcc
will whine if we don't explicitly handle all event types
* gtk/gtktreeselection.h: added some FIXME
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename
"columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_clicked:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Emits the “clicked” signal on the column. This function will only work if
|
2001-12-04 23:49:57 +00:00
|
|
|
|
* @tree_column is clickable.
|
Port to GObject, can go back in gdk-pixbuf after setting up a
2000-12-16 Havoc Pennington <hp@pobox.com>
* gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c:
Port to GObject, can go back in gdk-pixbuf after setting up
a gdk-pixbuf-marshal.h header over there.
* gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g;
(gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal
args
(gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be
set
(gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons
here, do it when we create the buttons later
(gtk_tree_view_realize_buttons): add some g_return_if_fail
(gtk_tree_view_map): paranoia checks that column->button is shown
and unmapped
(gtk_tree_view_size_request): only request visible children.
Move header size calculation in here, for cleanliness, and
to maintain invariants for child widgets if we eventually
let users set different children inside the buttons
(gtk_tree_view_map_buttons): factor out code to map buttons,
since it was being called several times
(gtk_tree_view_size_allocate_buttons): move_resize the drag
windows instead of just moving them; their height may change
if we allow random widgets in there, or the theme changes.
(gtk_tree_view_size_allocate): move button size allocation
above emitting the scroll signals, to ensure a sane state when we
hit user code
(gtk_tree_view_button_release): remove queue_resize after
tree_view_set_size(), set_size() will handle any resize queuing
that's needed
(gtk_tree_view_focus_in): just queue a draw, don't fool with
draw_focus goo
(gtk_tree_view_focus): use gtk_get_current_event() and
gdk_event_get_state()
(gtk_tree_view_deleted): don't queue_resize() after calling set_size()
(gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove
semicolon
(gtk_tree_view_create_button): show the button here
(gtk_tree_view_button_clicked): actually emit the clicked signal
on the column
(_gtk_tree_view_set_size): return right away if the size is
unchanged, as a cheesy optimization
(gtk_tree_view_setup_model): rename set_model_realized to
setup_model to match the flag that indicates whether we've
called it
(gtk_tree_view_get_hadjustment): create adjustment if it doesn't
exist, because set_scroll_adjustment does that and it shouldn't
matter what order you call these in
(gtk_tree_view_get_vadjustment): ditto
(gtk_tree_view_set_headers_visible): canonicalize the bool,
for paranoia
(gtk_tree_view_set_headers_visible): call
gtk_tree_view_map_buttons() instead of using cut-and-paste code
(gtk_tree_view_append_column): clarify whether the return value
is the count of columns before or after, and do the increment
separately from the return statement so you can tell from the code.
(gtk_tree_view_remove_column): ditto
(gtk_tree_view_insert_column): ditto
(gtk_tree_view_get_column): remove g_return_if_fail for columns
outside the existing range, the docs say that outside-range
columns are allowed, so we handle them as documented. (Presumably
this allows a nice loop with column != NULL as test.)
(gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments
mean (left/right/center etc.).
(gtk_tree_view_collapse_all): only queue a draw if we're mapped
(gtk_tree_view_expand_row): add docs
(gtk_tree_view_collapse_row): add docs
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new
function to emit the clicked signal on a column
* gdk/gdkevents.c (gdk_event_get_state): new function, to get the
state of an event
(gdk_event_get_time): don't treat GDK_SCROLL
as a button event, remove default case from switch so gcc
will whine if we don't explicitly handle all event types
* gtk/gtktreeselection.h: added some FIXME
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename
"columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_clicked (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
Port to GObject, can go back in gdk-pixbuf after setting up a
2000-12-16 Havoc Pennington <hp@pobox.com>
* gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c:
Port to GObject, can go back in gdk-pixbuf after setting up
a gdk-pixbuf-marshal.h header over there.
* gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g;
(gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal
args
(gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be
set
(gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons
here, do it when we create the buttons later
(gtk_tree_view_realize_buttons): add some g_return_if_fail
(gtk_tree_view_map): paranoia checks that column->button is shown
and unmapped
(gtk_tree_view_size_request): only request visible children.
Move header size calculation in here, for cleanliness, and
to maintain invariants for child widgets if we eventually
let users set different children inside the buttons
(gtk_tree_view_map_buttons): factor out code to map buttons,
since it was being called several times
(gtk_tree_view_size_allocate_buttons): move_resize the drag
windows instead of just moving them; their height may change
if we allow random widgets in there, or the theme changes.
(gtk_tree_view_size_allocate): move button size allocation
above emitting the scroll signals, to ensure a sane state when we
hit user code
(gtk_tree_view_button_release): remove queue_resize after
tree_view_set_size(), set_size() will handle any resize queuing
that's needed
(gtk_tree_view_focus_in): just queue a draw, don't fool with
draw_focus goo
(gtk_tree_view_focus): use gtk_get_current_event() and
gdk_event_get_state()
(gtk_tree_view_deleted): don't queue_resize() after calling set_size()
(gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove
semicolon
(gtk_tree_view_create_button): show the button here
(gtk_tree_view_button_clicked): actually emit the clicked signal
on the column
(_gtk_tree_view_set_size): return right away if the size is
unchanged, as a cheesy optimization
(gtk_tree_view_setup_model): rename set_model_realized to
setup_model to match the flag that indicates whether we've
called it
(gtk_tree_view_get_hadjustment): create adjustment if it doesn't
exist, because set_scroll_adjustment does that and it shouldn't
matter what order you call these in
(gtk_tree_view_get_vadjustment): ditto
(gtk_tree_view_set_headers_visible): canonicalize the bool,
for paranoia
(gtk_tree_view_set_headers_visible): call
gtk_tree_view_map_buttons() instead of using cut-and-paste code
(gtk_tree_view_append_column): clarify whether the return value
is the count of columns before or after, and do the increment
separately from the return statement so you can tell from the code.
(gtk_tree_view_remove_column): ditto
(gtk_tree_view_insert_column): ditto
(gtk_tree_view_get_column): remove g_return_if_fail for columns
outside the existing range, the docs say that outside-range
columns are allowed, so we handle them as documented. (Presumably
this allows a nice loop with column != NULL as test.)
(gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments
mean (left/right/center etc.).
(gtk_tree_view_collapse_all): only queue a draw if we're mapped
(gtk_tree_view_expand_row): add docs
(gtk_tree_view_collapse_row): add docs
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new
function to emit the clicked signal on a column
* gdk/gdkevents.c (gdk_event_get_state): new function, to get the
state of an event
(gdk_event_get_time): don't treat GDK_SCROLL
as a button event, remove default case from switch so gcc
will whine if we don't explicitly handle all event types
* gtk/gtktreeselection.h: added some FIXME
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename
"columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2019-05-18 18:15:54 +00:00
|
|
|
|
if (priv->visible && priv->clickable)
|
|
|
|
|
g_signal_emit_by_name (priv->button, "clicked");
|
2001-01-19 22:39:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_title:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
* @title: The title of the @tree_column.
|
|
|
|
|
*
|
|
|
|
|
* Sets the title of the @tree_column. If a custom widget has been set, then
|
|
|
|
|
* this value is ignored.
|
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column,
|
2001-02-21 19:59:23 +00:00
|
|
|
|
const gchar *title)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
gchar *new_title;
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2003-11-07 21:57:20 +00:00
|
|
|
|
new_title = g_strdup (title);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_free (priv->title);
|
|
|
|
|
priv->title = new_title;
|
2000-10-16 06:14:53 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_TITLE]);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_title:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
|
* Returns the title of the widget.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the title of the column. This string should not be
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
|
* modified or freed.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2011-06-06 18:13:44 +00:00
|
|
|
|
const gchar *
|
2000-10-05 01:04:57 +00:00
|
|
|
|
gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->title;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_expand:
|
2013-01-17 01:23:37 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
* @expand: %TRUE if the column should expand to fill available space.
|
|
|
|
|
*
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
* Sets the column to take available extra space. This space is shared equally
|
|
|
|
|
* amongst all columns that have the expand set to %TRUE. If no column has this
|
|
|
|
|
* option set, then the last column gets all extra space. By default, every
|
|
|
|
|
* column is created with this %FALSE.
|
2003-04-12 22:25:21 +00:00
|
|
|
|
*
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* Along with “fixed-width”, the “expand” property changes when the column is
|
2013-01-17 01:23:37 +00:00
|
|
|
|
* resized by the user.
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_expand (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gboolean expand)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
expand = expand?TRUE:FALSE;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->expand == expand)
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
return;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->expand = expand;
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->visible &&
|
|
|
|
|
priv->tree_view != NULL &&
|
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_EXPAND]);
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_expand:
|
2013-01-17 01:23:37 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
|
|
|
|
* Returns %TRUE if the column expands to fill available space.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the column expands to fill available space.
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_tree_view_column_get_expand (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->expand;
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_clickable:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* @clickable: %TRUE if the header is active.
|
2001-05-16 00:23:30 +00:00
|
|
|
|
*
|
2012-02-10 13:58:59 +00:00
|
|
|
|
* Sets the header to be active if @clickable is %TRUE. When the header is
|
|
|
|
|
* active, then it can take keyboard focus, and can be clicked.
|
2001-05-16 00:23:30 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_clickable (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gboolean clickable)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
|
clickable = !! clickable;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->clickable == clickable)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->clickable = clickable;
|
2001-05-22 19:18:47 +00:00
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_CLICKABLE]);
|
2001-01-09 23:24:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_clickable:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
|
*
|
|
|
|
|
* Returns %TRUE if the user can click on the header for the column.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if user can click the column header.
|
2001-01-09 23:24:20 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_tree_view_column_get_clickable (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->clickable;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_widget:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2009-12-10 10:23:40 +00:00
|
|
|
|
* @widget: (allow-none): A child #GtkWidget, or %NULL.
|
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* Sets the widget in the header to be @widget. If widget is %NULL, then the
|
2000-10-16 06:14:53 +00:00
|
|
|
|
* header button is set with a #GtkLabel set to the title of @tree_column.
|
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column,
|
|
|
|
|
GtkWidget *widget)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2001-01-19 22:39:19 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
if (widget)
|
2005-11-23 18:06:58 +00:00
|
|
|
|
g_object_ref_sink (widget);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2015-09-06 16:35:12 +00:00
|
|
|
|
if (priv->child)
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_object_unref (priv->child);
|
2001-01-19 22:39:19 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->child = widget;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_WIDGET]);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_widget:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2010-09-21 04:18:11 +00:00
|
|
|
|
*
|
|
|
|
|
* Returns the #GtkWidget in the button on the column header.
|
|
|
|
|
* If a custom widget has not been set then %NULL is returned.
|
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): The #GtkWidget in the column
|
2010-09-21 04:18:11 +00:00
|
|
|
|
* header, or %NULL
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->child;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
|
/**
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
* gtk_tree_view_column_set_alignment:
|
2000-10-16 06:14:53 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-10-06 00:50:36 +00:00
|
|
|
|
* @xalign: The alignment, which is between [0.0 and 1.0] inclusive.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
*
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
* Sets the alignment of the title or custom widget inside the column header.
|
2001-10-06 00:50:36 +00:00
|
|
|
|
* The alignment determines its location inside the button -- 0.0 for left, 0.5
|
|
|
|
|
* for center, 1.0 for right.
|
2000-10-16 06:14:53 +00:00
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
void
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
gtk_tree_view_column_set_alignment (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gfloat xalign)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2001-09-25 19:38:18 +00:00
|
|
|
|
xalign = CLAMP (xalign, 0.0, 1.0);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->xalign == xalign)
|
2000-10-05 01:04:57 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->xalign = xalign;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_ALIGNMENT]);
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2001-06-05 15:30:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_alignment:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
*
|
|
|
|
|
* Returns the current x alignment of @tree_column. This value can range
|
|
|
|
|
* between 0.0 and 1.0.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: The current alignent of @tree_column.
|
2001-06-05 15:30:53 +00:00
|
|
|
|
**/
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
gfloat
|
|
|
|
|
gtk_tree_view_column_get_alignment (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0.5);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->xalign;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_reorderable:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2003-04-12 22:25:21 +00:00
|
|
|
|
* @reorderable: %TRUE, if the column can be reordered.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
|
* If @reorderable is %TRUE, then the column can be reordered by the end user
|
2002-02-23 07:05:55 +00:00
|
|
|
|
* dragging the header.
|
|
|
|
|
**/
|
2001-05-16 00:23:30 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_reorderable (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gboolean reorderable)
|
2001-03-29 21:30:05 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-03-29 21:30:05 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2001-05-22 19:18:47 +00:00
|
|
|
|
/* if (reorderable)
|
|
|
|
|
gtk_tree_view_column_set_clickable (tree_column, TRUE);*/
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->reorderable == (reorderable?TRUE:FALSE))
|
2001-05-16 00:23:30 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->reorderable = (reorderable?TRUE:FALSE);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_REORDERABLE]);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
}
|
2001-03-28 01:54:14 +00:00
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_reorderable:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
|
* Returns %TRUE if the @tree_column can be reordered by the user.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the @tree_column can be reordered by the user.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
**/
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_tree_view_column_get_reorderable (GtkTreeViewColumn *tree_column)
|
2001-03-28 01:54:14 +00:00
|
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
2001-04-12 16:11:54 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->reorderable;
|
2001-03-28 01:54:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
2001-03-28 01:54:14 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_sort_column_id:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* @sort_column_id: The @sort_column_id of the model to sort on.
|
docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
Sat Oct 5 16:47:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
gdk/x11/gdkwindow-x11.c, gtk/gtkfontsel.h, gtk/gtkimcontext.c,
gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c
Documentation fixes:
#75170, Dan Winship;
#73220, Havoc Pennington;
#70742, Boris Shingarov;
#72007, Alexey A. Malyshev
2002-10-05 15:09:29 +00:00
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* Sets the logical @sort_column_id that this column sorts on when this column
|
|
|
|
|
* is selected for sorting. Doing so makes the column header clickable.
|
2001-03-28 01:54:14 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gint sort_column_id)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2001-03-28 01:54:14 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2003-01-27 21:41:06 +00:00
|
|
|
|
g_return_if_fail (sort_column_id >= -1);
|
2001-03-28 01:54:14 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->sort_column_id == sort_column_id)
|
2001-03-28 01:54:14 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->sort_column_id = sort_column_id;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
|
|
/* Handle unsetting the id */
|
2001-03-28 01:54:14 +00:00
|
|
|
|
if (sort_column_id == -1)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
|
2003-01-27 21:41:06 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->sort_clicked_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_signal_handler_disconnect (tree_column, priv->sort_clicked_signal);
|
|
|
|
|
priv->sort_clicked_signal = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->sort_column_changed_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_signal_handler_disconnect (model, priv->sort_column_changed_signal);
|
|
|
|
|
priv->sort_column_changed_signal = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-08-23 18:33:37 +00:00
|
|
|
|
gtk_tree_view_column_set_sort_order (tree_column, GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, FALSE);
|
2003-01-27 21:41:06 +00:00
|
|
|
|
gtk_tree_view_column_set_clickable (tree_column, FALSE);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_SORT_COLUMN_ID]);
|
2001-03-28 01:54:14 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_set_clickable (tree_column, TRUE);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (! priv->sort_clicked_signal)
|
|
|
|
|
priv->sort_clicked_signal = g_signal_connect (tree_column,
|
|
|
|
|
"clicked",
|
|
|
|
|
G_CALLBACK (gtk_tree_view_column_sort),
|
|
|
|
|
NULL);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_setup_sort_column_id_callback (tree_column);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_SORT_COLUMN_ID]);
|
2001-03-28 01:54:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_sort_column_id:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* Gets the logical @sort_column_id that the model sorts on when this
|
docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
Sat Oct 5 16:47:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
gdk/x11/gdkwindow-x11.c, gtk/gtkfontsel.h, gtk/gtkimcontext.c,
gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c
Documentation fixes:
#75170, Dan Winship;
#73220, Havoc Pennington;
#70742, Boris Shingarov;
#72007, Alexey A. Malyshev
2002-10-05 15:09:29 +00:00
|
|
|
|
* column is selected for sorting.
|
|
|
|
|
* See gtk_tree_view_column_set_sort_column_id().
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the current @sort_column_id for this column, or -1 if
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* this column can’t be used for sorting.
|
2001-06-24 15:34:48 +00:00
|
|
|
|
**/
|
|
|
|
|
gint
|
|
|
|
|
gtk_tree_view_column_get_sort_column_id (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->sort_column_id;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_sort_indicator:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
|
* @setting: %TRUE to display an indicator that the column is sorted
|
|
|
|
|
*
|
|
|
|
|
* Call this function with a @setting of %TRUE to display an arrow in
|
|
|
|
|
* the header button indicating the column is sorted. Call
|
|
|
|
|
* gtk_tree_view_column_set_sort_order() to change the direction of
|
|
|
|
|
* the arrow.
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_sort_indicator (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gboolean setting)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
|
|
setting = setting != FALSE;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (setting == tree_column->priv->show_sort_indicator)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
return;
|
2001-03-29 21:30:05 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
tree_column->priv->show_sort_indicator = setting;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_SORT_INDICATOR]);
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_sort_indicator:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
|
*
|
|
|
|
|
* Gets the value set by gtk_tree_view_column_set_sort_indicator().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: whether the sort indicator arrow is displayed
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_tree_view_column_get_sort_indicator (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->show_sort_indicator;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_set_sort_order:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
|
* @order: sort order that the sort indicator should indicate
|
|
|
|
|
*
|
2001-11-10 01:30:31 +00:00
|
|
|
|
* Changes the appearance of the sort indicator.
|
|
|
|
|
*
|
2014-01-28 06:54:48 +00:00
|
|
|
|
* This does not actually sort the model. Use
|
2001-03-28 01:54:14 +00:00
|
|
|
|
* gtk_tree_view_column_set_sort_column_id() if you want automatic sorting
|
|
|
|
|
* support. This function is primarily for custom sorting behavior, and should
|
2012-07-02 06:19:06 +00:00
|
|
|
|
* be used in conjunction with gtk_tree_sortable_set_sort_column_id() to do
|
2001-11-10 01:30:31 +00:00
|
|
|
|
* that. For custom models, the mechanism will vary.
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
*
|
2001-11-10 01:30:31 +00:00
|
|
|
|
* The sort indicator changes direction to indicate normal sort or reverse sort.
|
|
|
|
|
* Note that you must have the sort indicator enabled to see anything when
|
|
|
|
|
* calling this function; see gtk_tree_view_column_set_sort_indicator().
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_set_sort_order (GtkTreeViewColumn *tree_column,
|
2001-08-23 18:33:37 +00:00
|
|
|
|
GtkSortType order)
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (order == tree_column->priv->sort_order)
|
2001-05-16 00:23:30 +00:00
|
|
|
|
return;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
tree_column->priv->sort_order = order;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2015-09-06 16:35:12 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (tree_column), tree_column_props[PROP_SORT_ORDER]);
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_sort_order:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
|
*
|
|
|
|
|
* Gets the value set by gtk_tree_view_column_set_sort_order().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the sort order the sort indicator is indicating
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
**/
|
2001-08-23 18:33:37 +00:00
|
|
|
|
GtkSortType
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
gtk_tree_view_column_get_sort_order (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->sort_order;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
}
|
2001-01-19 22:39:19 +00:00
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_cell_set_cell_data:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
|
* @tree_model: The #GtkTreeModel to to get the cell renderers attributes from.
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @iter: The #GtkTreeIter to to get the cell renderer’s attributes from.
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* @is_expander: %TRUE, if the row has children
|
|
|
|
|
* @is_expanded: %TRUE, if the row has visible children
|
2001-05-25 23:10:49 +00:00
|
|
|
|
*
|
2002-09-28 20:03:56 +00:00
|
|
|
|
* Sets the cell renderer based on the @tree_model and @iter. That is, for
|
2001-05-25 23:10:49 +00:00
|
|
|
|
* every attribute mapping in @tree_column, it will get a value from the set
|
2002-09-28 20:03:56 +00:00
|
|
|
|
* column on the @iter, and use that value to set the attribute on the cell
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* renderer. This is used primarily by the #GtkTreeView.
|
2001-05-25 23:10:49 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_cell_set_cell_data (GtkTreeViewColumn *tree_column,
|
|
|
|
|
GtkTreeModel *tree_model,
|
2001-08-19 04:19:56 +00:00
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
|
gboolean is_expander,
|
|
|
|
|
gboolean is_expanded)
|
2001-05-25 23:10:49 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
|
|
if (tree_model == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_cell_area_apply_attributes (tree_column->priv->cell_area, tree_model, iter,
|
2010-11-28 18:01:49 +00:00
|
|
|
|
is_expander, is_expanded);
|
2001-05-25 23:10:49 +00:00
|
|
|
|
}
|
2001-09-17 21:44:20 +00:00
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_cell_get_size:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2010-02-19 16:53:17 +00:00
|
|
|
|
* @cell_area: (allow-none): The area a cell in the column will be allocated, or %NULL
|
2014-05-26 16:37:13 +00:00
|
|
|
|
* @x_offset: (out) (optional): location to return x offset of a cell relative to @cell_area, or %NULL
|
|
|
|
|
* @y_offset: (out) (optional): location to return y offset of a cell relative to @cell_area, or %NULL
|
|
|
|
|
* @width: (out) (optional): location to return width needed to render a cell, or %NULL
|
|
|
|
|
* @height: (out) (optional): location to return height needed to render a cell, or %NULL
|
2001-05-25 23:10:49 +00:00
|
|
|
|
*
|
|
|
|
|
* Obtains the width and height needed to render the column. This is used
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* primarily by the #GtkTreeView.
|
2001-05-25 23:10:49 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2008-01-25 09:30:40 +00:00
|
|
|
|
gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column,
|
2019-08-09 15:04:58 +00:00
|
|
|
|
int *x_offset,
|
|
|
|
|
int *y_offset,
|
|
|
|
|
int *width,
|
|
|
|
|
int *height)
|
2001-09-08 00:56:30 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
2010-12-04 07:24:31 +00:00
|
|
|
|
gint min_width = 0, min_height = 0;
|
2010-11-28 20:02:36 +00:00
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
2010-12-04 05:05:15 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_signal_handler_block (priv->cell_area_context,
|
|
|
|
|
priv->context_changed_signal);
|
|
|
|
|
|
|
|
|
|
gtk_cell_area_get_preferred_width (priv->cell_area,
|
|
|
|
|
priv->cell_area_context,
|
|
|
|
|
priv->tree_view,
|
2010-12-04 05:05:15 +00:00
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
2010-12-04 07:24:31 +00:00
|
|
|
|
gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &min_width, NULL);
|
2010-12-04 05:05:15 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_cell_area_get_preferred_height_for_width (priv->cell_area,
|
|
|
|
|
priv->cell_area_context,
|
|
|
|
|
priv->tree_view,
|
2010-12-04 07:24:31 +00:00
|
|
|
|
min_width,
|
|
|
|
|
&min_height,
|
2010-11-28 18:01:49 +00:00
|
|
|
|
NULL);
|
2002-03-06 05:27:29 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_signal_handler_unblock (priv->cell_area_context,
|
|
|
|
|
priv->context_changed_signal);
|
2010-11-29 04:01:49 +00:00
|
|
|
|
|
2010-12-04 05:05:15 +00:00
|
|
|
|
|
|
|
|
|
if (height)
|
|
|
|
|
* height = min_height;
|
|
|
|
|
if (width)
|
|
|
|
|
* width = min_width;
|
|
|
|
|
|
2001-09-25 16:44:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2016-12-22 02:35:24 +00:00
|
|
|
|
* gtk_tree_view_column_cell_snapshot:
|
2001-09-25 16:44:39 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2016-12-22 02:35:24 +00:00
|
|
|
|
* @snapshot: #GtkSnapshot to draw to
|
2001-09-25 16:44:39 +00:00
|
|
|
|
* @background_area: entire cell area (including tree expanders and maybe padding on the sides)
|
|
|
|
|
* @cell_area: area normally rendered by a cell renderer
|
|
|
|
|
* @flags: flags that affect rendering
|
|
|
|
|
*
|
|
|
|
|
* Renders the cell contained by #tree_column. This is used primarily by the
|
2001-12-08 21:39:34 +00:00
|
|
|
|
* #GtkTreeView.
|
2001-09-25 16:44:39 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2016-12-22 02:35:24 +00:00
|
|
|
|
gtk_tree_view_column_cell_snapshot (GtkTreeViewColumn *tree_column,
|
|
|
|
|
GtkSnapshot *snapshot,
|
|
|
|
|
const GdkRectangle *background_area,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
guint flags,
|
|
|
|
|
gboolean draw_focus)
|
2001-09-25 16:44:39 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2001-09-25 16:44:39 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2016-12-22 02:35:24 +00:00
|
|
|
|
g_return_if_fail (snapshot != NULL);
|
2001-09-25 16:44:39 +00:00
|
|
|
|
g_return_if_fail (background_area != NULL);
|
|
|
|
|
g_return_if_fail (cell_area != NULL);
|
2010-08-24 13:45:41 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2016-12-22 02:35:24 +00:00
|
|
|
|
gtk_cell_area_snapshot (priv->cell_area, priv->cell_area_context,
|
|
|
|
|
priv->tree_view, snapshot,
|
|
|
|
|
background_area, cell_area, flags,
|
|
|
|
|
draw_focus);
|
2001-05-25 23:10:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean
|
2001-09-18 16:15:10 +00:00
|
|
|
|
_gtk_tree_view_column_cell_event (GtkTreeViewColumn *tree_column,
|
|
|
|
|
GdkEvent *event,
|
2008-01-25 09:30:40 +00:00
|
|
|
|
const GdkRectangle *cell_area,
|
2001-09-18 16:15:10 +00:00
|
|
|
|
guint flags)
|
2001-05-25 23:10:49 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
|
|
return gtk_cell_area_event (priv->cell_area,
|
|
|
|
|
priv->cell_area_context,
|
|
|
|
|
priv->tree_view,
|
2010-11-28 18:01:49 +00:00
|
|
|
|
event,
|
|
|
|
|
cell_area,
|
|
|
|
|
flags);
|
2001-05-25 23:10:49 +00:00
|
|
|
|
}
|
2001-06-27 23:44:53 +00:00
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_cell_is_visible:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
|
* Returns %TRUE if any of the cells packed into the @tree_column are visible.
|
2002-02-23 07:05:55 +00:00
|
|
|
|
* For this to be meaningful, you must first initialize the cells with
|
|
|
|
|
* gtk_tree_view_column_cell_set_cell_data()
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE, if any of the cells packed into the @tree_column are currently visible
|
2002-02-23 07:05:55 +00:00
|
|
|
|
**/
|
2001-06-27 23:44:53 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_tree_view_column_cell_is_visible (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
GList *list;
|
2010-11-28 18:01:49 +00:00
|
|
|
|
GList *cells;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
2001-06-27 23:44:53 +00:00
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
|
|
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->cell_area));
|
2010-11-28 18:01:49 +00:00
|
|
|
|
for (list = cells; list; list = list->next)
|
2001-06-27 23:44:53 +00:00
|
|
|
|
{
|
2010-11-28 18:01:49 +00:00
|
|
|
|
if (gtk_cell_renderer_get_visible (list->data))
|
|
|
|
|
{
|
|
|
|
|
g_list_free (cells);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
2001-06-27 23:44:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
|
g_list_free (cells);
|
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_focus_cell:
|
2002-10-10 23:42:57 +00:00
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
* @cell: A #GtkCellRenderer
|
|
|
|
|
*
|
|
|
|
|
* Sets the current keyboard focus to be at @cell, if the column contains
|
|
|
|
|
* 2 or more editable and activatable cells.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_focus_cell (GtkTreeViewColumn *tree_column,
|
|
|
|
|
GtkCellRenderer *cell)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_cell_area_set_focus_cell (tree_column->priv->cell_area, cell);
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
|
void
|
2002-02-19 18:21:50 +00:00
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (GtkTreeViewColumn *tree_column,
|
|
|
|
|
gboolean install_handler)
|
2001-09-08 00:56:30 +00:00
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
|
|
|
|
|
|
|
|
|
priv->dirty = TRUE;
|
2010-12-06 07:31:07 +00:00
|
|
|
|
priv->padding = 0;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
priv->width = 0;
|
2001-09-08 00:56:30 +00:00
|
|
|
|
|
2010-12-06 08:03:53 +00:00
|
|
|
|
/* Issue a manual reset on the context to have all
|
|
|
|
|
* sizes re-requested for the context.
|
|
|
|
|
*/
|
2010-12-12 07:43:07 +00:00
|
|
|
|
g_signal_handler_block (priv->cell_area_context,
|
|
|
|
|
priv->context_changed_signal);
|
|
|
|
|
gtk_cell_area_context_reset (priv->cell_area_context);
|
|
|
|
|
g_signal_handler_unblock (priv->cell_area_context,
|
|
|
|
|
priv->context_changed_signal);
|
2010-12-06 08:03:53 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (priv->tree_view &&
|
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
2001-12-04 23:49:57 +00:00
|
|
|
|
{
|
2010-11-30 07:36:07 +00:00
|
|
|
|
_gtk_tree_view_install_mark_rows_col_dirty (GTK_TREE_VIEW (priv->tree_view), install_handler);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2001-12-04 23:49:57 +00:00
|
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gboolean
|
|
|
|
|
_gtk_tree_view_column_cell_get_dirty (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
return tree_column->priv->dirty;
|
|
|
|
|
}
|
|
|
|
|
|
2003-04-12 22:25:21 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_cell_get_position:
|
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
2003-04-15 22:51:04 +00:00
|
|
|
|
* @cell_renderer: a #GtkCellRenderer
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* @x_offset: (out) (allow-none): return location for the horizontal
|
|
|
|
|
* position of @cell within @tree_column, may be %NULL
|
|
|
|
|
* @width: (out) (allow-none): return location for the width of @cell,
|
|
|
|
|
* may be %NULL
|
2003-04-12 22:25:21 +00:00
|
|
|
|
*
|
|
|
|
|
* Obtains the horizontal position and size of a cell in a column. If the
|
|
|
|
|
* cell is not found in the column, @start_pos and @width are not changed and
|
|
|
|
|
* %FALSE is returned.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if @cell belongs to @tree_column.
|
2003-04-12 22:25:21 +00:00
|
|
|
|
*/
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_tree_view_column_cell_get_position (GtkTreeViewColumn *tree_column,
|
|
|
|
|
GtkCellRenderer *cell_renderer,
|
2010-12-05 16:04:52 +00:00
|
|
|
|
gint *x_offset,
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
|
gint *width)
|
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
2011-01-07 14:10:06 +00:00
|
|
|
|
GdkRectangle cell_area;
|
2010-11-28 18:01:49 +00:00
|
|
|
|
GdkRectangle allocation;
|
2003-01-30 22:42:21 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell_renderer), FALSE);
|
|
|
|
|
|
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
2011-09-25 12:50:31 +00:00
|
|
|
|
if (! gtk_cell_area_has_renderer (priv->cell_area, cell_renderer))
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
2011-01-07 14:10:06 +00:00
|
|
|
|
gtk_tree_view_get_background_area (GTK_TREE_VIEW (priv->tree_view),
|
|
|
|
|
NULL, tree_column, &cell_area);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
gtk_cell_area_get_cell_allocation (priv->cell_area,
|
|
|
|
|
priv->cell_area_context,
|
|
|
|
|
priv->tree_view,
|
2010-11-28 18:01:49 +00:00
|
|
|
|
cell_renderer,
|
2011-01-07 14:10:06 +00:00
|
|
|
|
&cell_area,
|
2010-11-28 18:01:49 +00:00
|
|
|
|
&allocation);
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
|
|
2010-12-05 16:04:52 +00:00
|
|
|
|
if (x_offset)
|
2011-09-25 15:43:45 +00:00
|
|
|
|
*x_offset = allocation.x - cell_area.x;
|
2011-01-07 14:10:06 +00:00
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
|
if (width)
|
|
|
|
|
*width = allocation.width;
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
|
return TRUE;
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
|
}
|
2003-04-12 22:25:21 +00:00
|
|
|
|
|
2005-07-14 00:05:49 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_queue_resize:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
|
*
|
|
|
|
|
* Flags the column, and the cell renderers added to this column, to have
|
|
|
|
|
* their sizes renegotiated.
|
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_tree_view_column_queue_resize (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
2007-06-06 12:56:13 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2005-07-14 00:05:49 +00:00
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
if (tree_column->priv->tree_view)
|
2005-07-14 00:05:49 +00:00
|
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-06 12:54:35 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_tree_view:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
|
*
|
2010-09-21 04:18:11 +00:00
|
|
|
|
* Returns the #GtkTreeView wherein @tree_column has been inserted.
|
|
|
|
|
* If @column is currently not inserted in any tree view, %NULL is
|
2007-06-06 12:54:35 +00:00
|
|
|
|
* returned.
|
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): The tree view wherein @column has
|
2010-09-21 04:18:11 +00:00
|
|
|
|
* been inserted if any, %NULL otherwise.
|
2007-06-06 12:54:35 +00:00
|
|
|
|
*/
|
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_tree_view_column_get_tree_view (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
return tree_column->priv->tree_view;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_tree_view_column_get_button:
|
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
|
*
|
|
|
|
|
* Returns the button used in the treeview column header
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: (transfer none): The button for the column header.
|
2010-11-30 05:29:45 +00:00
|
|
|
|
*/
|
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_tree_view_column_get_button (GtkTreeViewColumn *tree_column)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
|
|
|
|
|
return tree_column->priv->button;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2010-12-06 07:31:07 +00:00
|
|
|
|
_gtk_tree_view_column_push_padding (GtkTreeViewColumn *column,
|
|
|
|
|
gint padding)
|
2010-11-30 05:29:45 +00:00
|
|
|
|
{
|
2010-12-06 07:31:07 +00:00
|
|
|
|
column->priv->padding = MAX (column->priv->padding, padding);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gint
|
|
|
|
|
_gtk_tree_view_column_get_requested_width (GtkTreeViewColumn *column)
|
|
|
|
|
{
|
2010-12-06 07:31:07 +00:00
|
|
|
|
gint requested_width;
|
|
|
|
|
|
|
|
|
|
gtk_cell_area_context_get_preferred_width (column->priv->cell_area_context, &requested_width, NULL);
|
|
|
|
|
|
|
|
|
|
return requested_width + column->priv->padding;
|
2010-11-30 05:29:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gint
|
|
|
|
|
_gtk_tree_view_column_get_drag_x (GtkTreeViewColumn *column)
|
|
|
|
|
{
|
|
|
|
|
return column->priv->drag_x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkCellAreaContext *
|
|
|
|
|
_gtk_tree_view_column_get_context (GtkTreeViewColumn *column)
|
|
|
|
|
{
|
|
|
|
|
return column->priv->cell_area_context;
|
2007-06-06 12:54:35 +00:00
|
|
|
|
}
|
2017-07-15 18:43:52 +00:00
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
_gtk_tree_view_column_coords_in_resize_rect (GtkTreeViewColumn *column,
|
|
|
|
|
double x,
|
|
|
|
|
double y)
|
|
|
|
|
{
|
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2018-04-07 11:37:24 +00:00
|
|
|
|
graphene_rect_t button_bounds;
|
2017-07-15 18:43:52 +00:00
|
|
|
|
|
|
|
|
|
/* x and y are in treeview coordinates. */
|
|
|
|
|
|
|
|
|
|
if (!gtk_widget_get_realized (priv->button) ||
|
|
|
|
|
!priv->resizable ||
|
|
|
|
|
!priv->visible)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
2019-02-20 03:53:47 +00:00
|
|
|
|
if (!gtk_widget_compute_bounds (priv->button, priv->tree_view, &button_bounds))
|
|
|
|
|
return FALSE;
|
2017-07-15 18:43:52 +00:00
|
|
|
|
|
|
|
|
|
if (gtk_widget_get_direction (priv->tree_view) == GTK_TEXT_DIR_LTR)
|
2018-04-07 11:37:24 +00:00
|
|
|
|
button_bounds.origin.x += button_bounds.size.width - TREE_VIEW_DRAG_WIDTH;
|
|
|
|
|
|
|
|
|
|
button_bounds.size.width = TREE_VIEW_DRAG_WIDTH;
|
2017-07-15 18:43:52 +00:00
|
|
|
|
|
2018-04-07 11:37:24 +00:00
|
|
|
|
return graphene_rect_contains_point (&button_bounds,
|
|
|
|
|
&(graphene_point_t){x, y});
|
2017-07-15 18:43:52 +00:00
|
|
|
|
}
|