gtk2/gtk/gtktreeviewcolumn.c

3200 lines
96 KiB
C
Raw Normal View History

/* 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
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "gtktreeviewcolumn.h"
#include <string.h>
#include "gtktreeview.h"
#include "gtktreeprivate.h"
#include "gtkcelllayout.h"
#include "gtkbutton.h"
#include "gtkalignment.h"
#include "gtklabel.h"
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
#include "gtkhbox.h"
#include "gtkmarshalers.h"
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
#include "gtkarrow.h"
#include "gtkcellareacontext.h"
#include "gtkcellareabox.h"
#include "gtkprivate.h"
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
#include "gtkintl.h"
#include "gtktypebuiltins.h"
/**
* SECTION:gtktreeviewcolumn
* @Short_description: A visible column in a GtkTreeView widget
* @Title: GtkTreeViewColumn
* @See_also: #GtkTreeView, #GtkTreeSelection, #GtkTreeDnd, #GtkTreeMode, #GtkTreeSortable,
* #GtkTreeModelSort, #GtkListStore, #GtkTreeStore, #GtkCellRenderer, #GtkCellEditable,
* #GtkCellRendererPixbuf, #GtkCellRendererText, #GtkCellRendererToggle
*
* 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.
*
* Please refer to the <link linkend="TreeWidget">tree widget conceptual overview</link>
* for an overview of all the objects and data types related to the tree widget and how
* they work together.
*/
/* Type methods */
static void gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface);
/* 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);
static void gtk_tree_view_column_dispose (GObject *object);
static GObject *gtk_tree_view_column_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties);
/* GtkCellLayout implementation */
static void gtk_tree_view_column_ensure_cell_area (GtkTreeViewColumn *column,
GtkCellArea *cell_area);
static GtkCellArea *gtk_tree_view_column_cell_layout_get_area (GtkCellLayout *cell_layout);
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 */
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 */
static gint gtk_tree_view_column_button_event (GtkWidget *widget,
GdkEvent *event,
gpointer data);
static void gtk_tree_view_column_button_clicked (GtkWidget *widget,
gpointer data);
static gboolean gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling,
gpointer data);
/* Property handlers */
static void gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
GtkTreeViewColumn *tree_column);
/* 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);
/* 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,
GtkCellRenderer *cell_renderer,
va_list args);
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);
struct _GtkTreeViewColumnPrivate
{
GtkWidget *tree_view;
GtkWidget *button;
GtkWidget *child;
GtkWidget *arrow;
GtkWidget *alignment;
GdkWindow *window;
gfloat xalign;
gulong property_changed_signal;
/* Sizing fields */
/* see gtk+/doc/tree-column-sizing.txt for more information on them */
GtkTreeViewColumnSizing column_type;
gint padding;
gint resized_width;
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 use_resized_width : 1;
guint expand : 1;
};
enum
{
PROP_0,
PROP_VISIBLE,
PROP_RESIZABLE,
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,
PROP_SORT_COLUMN_ID,
PROP_CELL_AREA
};
enum
{
CLICKED,
LAST_SIGNAL
};
static guint tree_column_signals[LAST_SIGNAL] = { 0 };
2010-09-18 23:57:32 +00:00
G_DEFINE_TYPE_WITH_CODE (GtkTreeViewColumn, gtk_tree_view_column, G_TYPE_INITIALLY_UNOWNED,
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))
static void
gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
{
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
GObjectClass *object_class;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
object_class = (GObjectClass*) class;
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
object_class->constructor = gtk_tree_view_column_constructor;
object_class->finalize = gtk_tree_view_column_finalize;
object_class->dispose = gtk_tree_view_column_dispose;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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;
tree_column_signals[CLICKED] =
g_signal_new (I_("clicked"),
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkTreeViewColumnClass, clicked),
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_VISIBLE,
g_param_spec_boolean ("visible",
P_("Visible"),
P_("Whether to display the column"),
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
TRUE,
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_RESIZABLE,
g_param_spec_boolean ("resizable",
P_("Resizable"),
P_("Column is user-resizable"),
FALSE,
GTK_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_WIDTH,
g_param_spec_int ("width",
P_("Width"),
P_("Current width of the column"),
0,
G_MAXINT,
0,
GTK_PARAM_READABLE));
g_object_class_install_property (object_class,
PROP_SPACING,
g_param_spec_int ("spacing",
P_("Spacing"),
P_("Space which is inserted between cells"),
0,
G_MAXINT,
0,
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_SIZING,
g_param_spec_enum ("sizing",
P_("Sizing"),
P_("Resize mode of the column"),
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
GTK_TYPE_TREE_VIEW_COLUMN_SIZING,
GTK_TREE_VIEW_COLUMN_GROW_ONLY,
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_FIXED_WIDTH,
g_param_spec_int ("fixed-width",
P_("Fixed Width"),
P_("Current fixed width of the column"),
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
1,
G_MAXINT,
1, /* not useful */
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_MIN_WIDTH,
g_param_spec_int ("min-width",
P_("Minimum Width"),
P_("Minimum allowed width of the column"),
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
-1,
G_MAXINT,
-1,
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_MAX_WIDTH,
g_param_spec_int ("max-width",
P_("Maximum Width"),
P_("Maximum allowed width of the column"),
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
-1,
G_MAXINT,
-1,
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_TITLE,
g_param_spec_string ("title",
P_("Title"),
P_("Title to appear in column header"),
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
"",
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_EXPAND,
g_param_spec_boolean ("expand",
P_("Expand"),
P_("Column gets share of extra width allocated to the widget"),
FALSE,
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_CLICKABLE,
g_param_spec_boolean ("clickable",
P_("Clickable"),
P_("Whether the header can be clicked"),
FALSE,
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
PROP_WIDGET,
g_param_spec_object ("widget",
P_("Widget"),
P_("Widget to put in column header button instead of column title"),
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
GTK_TYPE_WIDGET,
GTK_PARAM_READWRITE));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_class_install_property (object_class,
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
PROP_ALIGNMENT,
g_param_spec_float ("alignment",
P_("Alignment"),
P_("X Alignment of the column header text or 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
0.0,
1.0,
0.0,
GTK_PARAM_READWRITE));
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_object_class_install_property (object_class,
PROP_REORDERABLE,
g_param_spec_boolean ("reorderable",
P_("Reorderable"),
P_("Whether the column can be reordered around the headers"),
FALSE,
GTK_PARAM_READWRITE));
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_object_class_install_property (object_class,
PROP_SORT_INDICATOR,
g_param_spec_boolean ("sort-indicator",
P_("Sort indicator"),
P_("Whether to show a 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
FALSE,
GTK_PARAM_READWRITE));
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_object_class_install_property (object_class,
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));
/**
* 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
* clickable. Set to %-1 to make the column unsortable.
*
* Since: 2.18
**/
g_object_class_install_property (object_class,
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));
/**
* GtkTreeViewColumn:cell-area:
*
* The #GtkCellArea used to layout cell renderers for this column.
*
* 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.
*
* Since: 3.0
*/
g_object_class_install_property (object_class,
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_type_class_add_private (class, sizeof (GtkTreeViewColumnPrivate));
}
static void
gtk_tree_view_column_custom_tag_end (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
const gchar *tagname,
gpointer *data)
{
/* 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)
{
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;
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
}
static void
gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface)
{
iface->get_area = gtk_tree_view_column_cell_layout_get_area;
}
static void
gtk_tree_view_column_init (GtkTreeViewColumn *tree_column)
{
GtkTreeViewColumnPrivate *priv;
tree_column->priv = G_TYPE_INSTANCE_GET_PRIVATE (tree_column,
GTK_TYPE_TREE_VIEW_COLUMN,
GtkTreeViewColumnPrivate);
priv = tree_column->priv;
priv->button = NULL;
priv->xalign = 0.0;
priv->width = 0;
priv->padding = -1;
priv->min_width = -1;
priv->max_width = -1;
priv->resized_width = 0;
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;
priv->fixed_width = 1;
priv->use_resized_width = FALSE;
priv->title = g_strdup ("");
}
static GObject *
gtk_tree_view_column_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GtkTreeViewColumn *tree_column;
GObject *object;
object = G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->constructor
(type, n_construct_properties, construct_properties);
tree_column = (GtkTreeViewColumn *) object;
gtk_tree_view_column_ensure_cell_area (tree_column, NULL);
return object;
}
static void
gtk_tree_view_column_dispose (GObject *object)
{
GtkTreeViewColumn *tree_column = (GtkTreeViewColumn *) object;
GtkTreeViewColumnPrivate *priv = tree_column->priv;
if (priv->cell_area_context)
{
g_signal_handler_disconnect (priv->cell_area_context,
priv->context_changed_signal);
g_object_unref (priv->cell_area_context);
priv->cell_area_context = NULL;
priv->context_changed_signal = 0;
}
if (priv->cell_area)
{
g_signal_handler_disconnect (priv->cell_area,
priv->add_editable_signal);
g_signal_handler_disconnect (priv->cell_area,
priv->remove_editable_signal);
g_object_unref (priv->cell_area);
priv->cell_area = NULL;
priv->add_editable_signal = 0;
priv->remove_editable_signal = 0;
}
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
if (priv->child)
{
g_object_unref (priv->child);
priv->child = NULL;
}
G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->dispose (object);
}
static void
gtk_tree_view_column_finalize (GObject *object)
{
GtkTreeViewColumn *tree_column = (GtkTreeViewColumn *) object;
GtkTreeViewColumnPrivate *priv = tree_column->priv;
g_free (priv->title);
2006-05-02 23:56:43 +00:00
G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->finalize (object);
}
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
static void
gtk_tree_view_column_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
{
GtkTreeViewColumn *tree_column;
GtkCellArea *area;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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;
case PROP_RESIZABLE:
gtk_tree_view_column_set_resizable (tree_column,
g_value_get_boolean (value));
break;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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;
case PROP_FIXED_WIDTH:
gtk_tree_view_column_set_fixed_width (tree_column,
g_value_get_int (value));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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;
case PROP_SPACING:
gtk_tree_view_column_set_spacing (tree_column,
g_value_get_int (value));
break;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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;
case PROP_EXPAND:
gtk_tree_view_column_set_expand (tree_column,
g_value_get_boolean (value));
break;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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;
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));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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;
case PROP_SORT_COLUMN_ID:
gtk_tree_view_column_set_sort_column_id (tree_column,
g_value_get_int (value));
break;
case PROP_CELL_AREA:
/* Construct-only, can only be assigned once */
area = g_value_get_object (value);
if (area)
{
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);
}
break;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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,
GParamSpec *pspec)
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
break;
case PROP_RESIZABLE:
g_value_set_boolean (value,
gtk_tree_view_column_get_resizable (tree_column));
break;
case PROP_WIDTH:
g_value_set_int (value,
gtk_tree_view_column_get_width (tree_column));
break;
case PROP_SPACING:
g_value_set_int (value,
gtk_tree_view_column_get_spacing (tree_column));
break;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
break;
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,
gtk_tree_view_column_get_fixed_width (tree_column));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
break;
case PROP_EXPAND:
g_value_set_boolean (value,
gtk_tree_view_column_get_expand (tree_column));
break;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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));
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
break;
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;
case PROP_SORT_COLUMN_ID:
g_value_set_int (value,
gtk_tree_view_column_get_sort_column_id (tree_column));
break;
case PROP_CELL_AREA:
g_value_set_object (value, tree_column->priv->cell_area);
break;
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
/* Implementation of GtkCellLayout interface
*/
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);
}
static GtkCellArea *
gtk_tree_view_column_cell_layout_get_area (GtkCellLayout *cell_layout)
{
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN (cell_layout);
GtkTreeViewColumnPrivate *priv = column->priv;
if (G_UNLIKELY (!priv->cell_area))
gtk_tree_view_column_ensure_cell_area (column, NULL);
return priv->cell_area;
}
/* Button handling code
*/
static void
gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
{
GtkTreeViewColumnPrivate *priv = tree_column->priv;
GtkTreeView *tree_view;
GtkWidget *child;
GtkWidget *hbox;
tree_view = (GtkTreeView *) priv->tree_view;
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
g_return_if_fail (priv->button == NULL);
gtk_widget_push_composite_child ();
priv->button = gtk_button_new ();
gtk_widget_add_events (priv->button, GDK_POINTER_MOTION_MASK);
gtk_widget_pop_composite_child ();
/* make sure we own a reference to it as well. */
if (_gtk_tree_view_get_header_window (tree_view))
gtk_widget_set_parent_window (priv->button, _gtk_tree_view_get_header_window (tree_view));
gtk_widget_set_parent (priv->button, GTK_WIDGET (tree_view));
g_signal_connect (priv->button, "event",
G_CALLBACK (gtk_tree_view_column_button_event),
tree_column);
g_signal_connect (priv->button, "clicked",
G_CALLBACK (gtk_tree_view_column_button_clicked),
tree_column);
priv->alignment = gtk_alignment_new (priv->xalign, 0.5, 0.0, 0.0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
priv->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
if (priv->child)
child = priv->child;
else
{
child = gtk_label_new (priv->title);
gtk_widget_show (child);
}
g_signal_connect (child, "mnemonic-activate",
G_CALLBACK (gtk_tree_view_column_mnemonic_activate),
tree_column);
if (priv->xalign <= 0.5)
gtk_box_pack_end (GTK_BOX (hbox), priv->arrow, FALSE, FALSE, 0);
else
gtk_box_pack_start (GTK_BOX (hbox), priv->arrow, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), priv->alignment, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (priv->alignment), child);
gtk_container_add (GTK_CONTAINER (priv->button), hbox);
gtk_widget_show (hbox);
gtk_widget_show (priv->alignment);
gtk_tree_view_column_update_button (tree_column);
}
static void
gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
{
GtkTreeViewColumnPrivate *priv = tree_column->priv;
gint sort_column_id = -1;
GtkWidget *hbox;
GtkWidget *alignment;
GtkWidget *arrow;
GtkWidget *current_child;
GtkArrowType arrow_type = GTK_ARROW_NONE;
GtkTreeModel *model;
if (priv->tree_view)
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
else
model = NULL;
/* Create a button if necessary */
if (priv->visible &&
priv->button == NULL &&
priv->tree_view &&
gtk_widget_get_realized (priv->tree_view))
gtk_tree_view_column_create_button (tree_column);
if (! priv->button)
return;
hbox = gtk_bin_get_child (GTK_BIN (priv->button));
alignment = priv->alignment;
arrow = priv->arrow;
2010-05-24 20:31:36 +00:00
current_child = gtk_bin_get_child (GTK_BIN (alignment));
/* Set up the actual button */
gtk_alignment_set (GTK_ALIGNMENT (alignment), priv->xalign,
0.5, 0.0, 0.0);
if (priv->child)
{
if (current_child != priv->child)
{
gtk_container_remove (GTK_CONTAINER (alignment),
current_child);
gtk_container_add (GTK_CONTAINER (alignment),
priv->child);
}
}
else
{
if (current_child == NULL)
{
current_child = gtk_label_new (NULL);
gtk_widget_show (current_child);
gtk_container_add (GTK_CONTAINER (alignment),
current_child);
}
g_return_if_fail (GTK_IS_LABEL (current_child));
if (priv->title)
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
priv->title);
else
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
"");
}
if (GTK_IS_TREE_SORTABLE (model))
gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
&sort_column_id,
NULL);
if (priv->show_sort_indicator)
{
gboolean alternative;
g_object_get (gtk_widget_get_settings (priv->tree_view),
"gtk-alternative-sort-arrows", &alternative,
NULL);
switch (priv->sort_order)
{
case GTK_SORT_ASCENDING:
arrow_type = alternative ? GTK_ARROW_UP : GTK_ARROW_DOWN;
break;
case GTK_SORT_DESCENDING:
arrow_type = alternative ? GTK_ARROW_DOWN : GTK_ARROW_UP;
break;
default:
g_warning (G_STRLOC": bad sort order");
break;
}
}
gtk_arrow_set (GTK_ARROW (arrow),
arrow_type,
GTK_SHADOW_IN);
/* 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
*/
g_object_ref (arrow);
gtk_container_remove (GTK_CONTAINER (hbox), arrow);
if (priv->xalign <= 0.5)
{
gtk_box_pack_end (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
}
else
{
gtk_box_pack_start (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
/* move it to the front */
gtk_box_reorder_child (GTK_BOX (hbox), arrow, 0);
}
g_object_unref (arrow);
if (priv->show_sort_indicator
|| (GTK_IS_TREE_SORTABLE (model) && priv->sort_column_id >= 0))
gtk_widget_show (arrow);
else
gtk_widget_hide (arrow);
/* 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. */
if (priv->button &&
priv->tree_view != NULL &&
gtk_widget_get_realized (priv->tree_view))
{
if (priv->visible)
{
if (gdk_window_is_visible (_gtk_tree_view_get_header_window (GTK_TREE_VIEW (priv->tree_view))))
gtk_widget_show_now (priv->button);
if (priv->window)
{
if (priv->resizable)
{
gdk_window_show (priv->window);
gdk_window_raise (priv->window);
}
else
{
gdk_window_hide (priv->window);
}
}
}
else
{
gtk_widget_hide (priv->button);
if (priv->window)
gdk_window_hide (priv->window);
}
}
if (priv->reorderable || priv->clickable)
{
gtk_widget_set_can_focus (priv->button, TRUE);
}
else
{
gtk_widget_set_can_focus (priv->button, FALSE);
if (gtk_widget_has_focus (priv->button))
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
{
GtkWidget *toplevel = gtk_widget_get_toplevel (priv->tree_view);
if (gtk_widget_is_toplevel (toplevel))
2001-10-31 22:57:51 +00:00
{
gtk_window_set_focus (GTK_WINDOW (toplevel), NULL);
}
Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not Wed Jul 4 22:35:40 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklabel.c gtk/gtkmenubar.c gtk/gtktreeviewcolumn.c gtk/gtkwidget.c: Check GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel (widget)), not GTK_WIDGET_GET_ANCESTOR ... see http://mail.gnome.org/archives/gtk-devel-list/2001-July/msg00072.html. Indicate the best practice in the docs for gtk_widget_get_toplevel(). * gtk/gtkwidget.[ch]: Expose a private _gtk_widget_hierarchy_changed(), so GtkPlug can give the correct signals when transforming from a child to a toplevel. * gtk/gtkdnd.c (gtk_drag_dest_hierarchy_changed): Handle reparentation correctly. * gtk/gtkwidget.c (gtk_widget_propagate_hierarchy_changed): Propagate the previous_toplevel argument down properly. * gtk/gtklabel.c (gtk_label_finalize): Fix unrefing of wrong atr list. * gtk/gtkplug.[ch]: Add an "embedded" signal. * gtk/gtksocket.[ch]: Add "child_added", "child_removed" signals. * gtk/gtkplug.[ch] gtk/gtksocket.[ch]: Add functions gtk_plug_get_id(), gtk_socket_get_id(), to avoid the user having to worry about realization, and gdkx.h. * tests/testsocket.c: Extend to try out the new signals and gtk_plug/socket_get_id(). * gtk/gtklabel.c (gtk_label_set_pattern_internal): Fix setting of underline attributes. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Ignore DestroyNotify events from SubstructureNotifyMask * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Switch GDK_WINDOW_TYPE (window) as needed. * gdk/x11/gdkwindow-x11.c (gdk_window_new): Clean up, allow creation of toplevel windows as children of foreign windows. * gtk/gtkplug.c: Remove hacks involving changing private fields of GdkWindow. * gtk/gtkplug.[ch] gtk/gtksocket.c: Work to make exactly the same signals and notification be emitted for local embedding as for inter-process embedding.
2001-07-05 02:58:34 +00:00
}
}
/* Queue a resize on the assumption that we always want to catch all changes
* and columns don't change all that often.
*/
if (gtk_widget_get_realized (priv->tree_view))
gtk_widget_queue_resize (priv->tree_view);
}
/* Button signal handlers
*/
static gint
gtk_tree_view_column_button_event (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
GtkTreeViewColumn *column = (GtkTreeViewColumn *) data;
GtkTreeViewColumnPrivate *priv = column->priv;
g_return_val_if_fail (event != NULL, FALSE);
if (event->type == GDK_BUTTON_PRESS &&
priv->reorderable &&
((GdkEventButton *)event)->button == 1)
{
priv->maybe_reordered = TRUE;
gdk_window_get_pointer (gtk_button_get_event_window (GTK_BUTTON (widget)),
&priv->drag_x,
&priv->drag_y,
NULL);
gtk_widget_grab_focus (widget);
}
if (event->type == GDK_BUTTON_RELEASE ||
event->type == GDK_LEAVE_NOTIFY)
priv->maybe_reordered = FALSE;
if (event->type == GDK_MOTION_NOTIFY &&
priv->maybe_reordered &&
(gtk_drag_check_threshold (widget,
priv->drag_x,
priv->drag_y,
(gint) ((GdkEventMotion *)event)->x,
(gint) ((GdkEventMotion *)event)->y)))
{
priv->maybe_reordered = FALSE;
_gtk_tree_view_column_start_drag (GTK_TREE_VIEW (priv->tree_view), column,
2010-05-25 22:38:44 +00:00
event->motion.device);
return TRUE;
}
if (priv->clickable == FALSE)
{
switch (event->type)
{
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_MOTION_NOTIFY:
case GDK_BUTTON_RELEASE:
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
return TRUE;
default:
return FALSE;
}
}
return FALSE;
}
static void
gtk_tree_view_column_button_clicked (GtkWidget *widget, gpointer data)
{
g_signal_emit_by_name (data, "clicked");
}
static gboolean
gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling,
gpointer data)
{
GtkTreeViewColumn *column = (GtkTreeViewColumn *)data;
GtkTreeViewColumnPrivate *priv = column->priv;
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), FALSE);
_gtk_tree_view_set_focus_column (GTK_TREE_VIEW (priv->tree_view), column);
if (priv->clickable)
gtk_button_clicked (GTK_BUTTON (priv->button));
else if (gtk_widget_get_can_focus (priv->button))
gtk_widget_grab_focus (priv->button);
else
gtk_widget_grab_focus (priv->tree_view);
return TRUE;
}
static void
gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
GtkTreeViewColumn *column)
{
GtkTreeViewColumnPrivate *priv = column->priv;
gint sort_column_id;
GtkSortType order;
if (gtk_tree_sortable_get_sort_column_id (sortable,
&sort_column_id,
&order))
{
if (sort_column_id == priv->sort_column_id)
{
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);
}
}
else
{
gtk_tree_view_column_set_sort_indicator (column, FALSE);
}
}
static void
gtk_tree_view_column_sort (GtkTreeViewColumn *tree_column,
gpointer data)
{
GtkTreeViewColumnPrivate *priv = tree_column->priv;
GtkTreeModel *model;
GtkTreeSortable *sortable;
gint sort_column_id;
GtkSortType order;
gboolean has_sort_column;
gboolean has_default_sort_func;
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);
has_sort_column =
gtk_tree_sortable_get_sort_column_id (sortable,
&sort_column_id,
&order);
has_default_sort_func =
gtk_tree_sortable_has_default_sort_func (sortable);
if (has_sort_column &&
sort_column_id == priv->sort_column_id)
{
if (order == GTK_SORT_ASCENDING)
gtk_tree_sortable_set_sort_column_id (sortable,
priv->sort_column_id,
GTK_SORT_DESCENDING);
else if (order == GTK_SORT_DESCENDING && has_default_sort_func)
gtk_tree_sortable_set_sort_column_id (sortable,
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
GTK_SORT_ASCENDING);
else
gtk_tree_sortable_set_sort_column_id (sortable,
priv->sort_column_id,
GTK_SORT_ASCENDING);
}
else
{
gtk_tree_sortable_set_sort_column_id (sortable,
priv->sort_column_id,
GTK_SORT_ASCENDING);
}
}
static void
gtk_tree_view_column_setup_sort_column_id_callback (GtkTreeViewColumn *tree_column)
{
GtkTreeViewColumnPrivate *priv = tree_column->priv;
GtkTreeModel *model;
if (priv->tree_view == NULL)
return;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
if (model == NULL)
return;
if (GTK_IS_TREE_SORTABLE (model) &&
priv->sort_column_id != -1)
{
gint real_sort_column_id;
GtkSortType real_order;
if (priv->sort_column_changed_signal == 0)
priv->sort_column_changed_signal =
g_signal_connect (model, "sort-column-changed",
G_CALLBACK (gtk_tree_view_model_sort_column_changed),
tree_column);
if (gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
&real_sort_column_id,
&real_order) &&
(real_sort_column_id == priv->sort_column_id))
{
gtk_tree_view_column_set_sort_indicator (tree_column, TRUE);
gtk_tree_view_column_set_sort_order (tree_column, real_order);
}
else
{
gtk_tree_view_column_set_sort_indicator (tree_column, FALSE);
}
}
}
static void
gtk_tree_view_column_context_changed (GtkCellAreaContext *context,
GParamSpec *pspec,
GtkTreeViewColumn *tree_column)
{
/* 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.
*/
if (!strcmp (pspec->name, "minimum-width") ||
!strcmp (pspec->name, "natural-width") ||
!strcmp (pspec->name, "minimum-height") ||
!strcmp (pspec->name, "natural-height"))
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
}
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)
{
GtkTreeViewColumn *column = user_data;
GtkTreeViewColumnPrivate *priv = column->priv;
GtkTreePath *path;
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);
}
}
static void
gtk_tree_view_column_remove_editable_callback (GtkCellArea *area,
GtkCellRenderer *renderer,
GtkCellEditable *edit_widget,
gpointer user_data)
{
GtkTreeViewColumn *column = user_data;
GtkTreeViewColumnPrivate *priv = column->priv;
if (priv->tree_view)
_gtk_tree_view_remove_editable (GTK_TREE_VIEW (priv->tree_view),
column,
edit_widget);
}
/* Exported Private Functions.
* These should only be called by gtktreeview.c or gtktreeviewcolumn.c
*/
void
_gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
{
GtkTreeViewColumnPrivate *priv = column->priv;
GtkAllocation allocation;
GtkTreeView *tree_view;
GdkWindowAttr attr;
guint attributes_mask;
gboolean rtl;
tree_view = (GtkTreeView *)priv->tree_view;
rtl = (gtk_widget_get_direction (priv->tree_view) == GTK_TEXT_DIR_RTL);
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
g_return_if_fail (gtk_widget_get_realized (priv->tree_view));
g_return_if_fail (priv->button != NULL);
g_return_if_fail (_gtk_tree_view_get_header_window (tree_view) != NULL);
gtk_widget_set_parent_window (priv->button, _gtk_tree_view_get_header_window (tree_view));
attr.window_type = GDK_WINDOW_CHILD;
attr.wclass = GDK_INPUT_ONLY;
attr.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
attr.event_mask = gtk_widget_get_events (GTK_WIDGET (tree_view)) |
(GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_KEY_PRESS_MASK);
attributes_mask = GDK_WA_CURSOR | GDK_WA_X | GDK_WA_Y;
attr.cursor = gdk_cursor_new_for_display
(gdk_window_get_display (_gtk_tree_view_get_header_window (tree_view)), GDK_SB_H_DOUBLE_ARROW);
attr.y = 0;
attr.width = TREE_VIEW_DRAG_WIDTH;
attr.height = _gtk_tree_view_get_header_height (tree_view);
gtk_widget_get_allocation (priv->button, &allocation);
attr.x = (allocation.x + (rtl ? 0 : allocation.width)) - TREE_VIEW_DRAG_WIDTH / 2;
priv->window = gdk_window_new (_gtk_tree_view_get_header_window (tree_view),
&attr, attributes_mask);
gdk_window_set_user_data (priv->window, tree_view);
gtk_tree_view_column_update_button (column);
g_object_unref (attr.cursor);
}
void
_gtk_tree_view_column_unrealize_button (GtkTreeViewColumn *column)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (column != NULL);
priv = column->priv;
g_return_if_fail (priv->window != NULL);
gdk_window_set_user_data (priv->window, NULL);
gdk_window_destroy (priv->window);
priv->window = NULL;
}
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)
{
GtkTreeViewColumnPrivate *priv = column->priv;
if (priv->sort_column_changed_signal)
{
g_signal_handler_disconnect (old_model,
priv->sort_column_changed_signal);
priv->sort_column_changed_signal = 0;
}
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
}
void
_gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column,
GtkTreeView *tree_view)
{
GtkTreeViewColumnPrivate *priv = column->priv;
g_assert (priv->tree_view == NULL);
priv->tree_view = GTK_WIDGET (tree_view);
gtk_tree_view_column_create_button (column);
priv->property_changed_signal =
g_signal_connect_swapped (tree_view,
"notify::model",
G_CALLBACK (gtk_tree_view_column_setup_sort_column_id_callback),
column);
gtk_tree_view_column_setup_sort_column_id_callback (column);
}
void
_gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column)
{
GtkTreeViewColumnPrivate *priv = column->priv;
if (priv->tree_view && priv->button)
{
gtk_container_remove (GTK_CONTAINER (priv->tree_view), priv->button);
}
if (priv->property_changed_signal)
{
g_signal_handler_disconnect (priv->tree_view, priv->property_changed_signal);
priv->property_changed_signal = 0;
}
if (priv->sort_column_changed_signal)
{
g_signal_handler_disconnect (gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view)),
priv->sort_column_changed_signal);
priv->sort_column_changed_signal = 0;
}
priv->tree_view = NULL;
priv->button = NULL;
}
gboolean
_gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column)
{
GtkTreeViewColumnPrivate *priv = column->priv;
gboolean ret = FALSE;
GList *list, *cells;
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->cell_area));
for (list = cells; list; list = list->next)
{
GtkCellRenderer *cell = list->data;
GtkCellRendererMode mode;
g_object_get (cell, "mode", &mode, NULL);
if (mode == GTK_CELL_RENDERER_MODE_EDITABLE)
{
ret = TRUE;
break;
}
}
g_list_free (cells);
return ret;
}
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 */
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)
{
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
}
GtkCellRenderer *
_gtk_tree_view_column_get_cell_at_pos (GtkTreeViewColumn *column,
GdkRectangle *cell_area,
GdkRectangle *background_area,
gint x,
gint y)
{
GtkCellRenderer *match = NULL;
GtkTreeViewColumnPrivate *priv = column->priv;
/* 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.
*/
if (x < cell_area->x)
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;
match = gtk_cell_area_get_cell_at_position (priv->cell_area,
priv->cell_area_context,
priv->tree_view,
cell_area,
x, y,
NULL);
return match;
}
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;
}
/* Public Functions */
/**
* gtk_tree_view_column_new:
*
* Creates a new #GtkTreeViewColumn.
*
* Return value: A newly created #GtkTreeViewColumn.
**/
GtkTreeViewColumn *
gtk_tree_view_column_new (void)
{
GtkTreeViewColumn *tree_column;
tree_column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, NULL);
return tree_column;
}
/**
* gtk_tree_view_column_new_with_area:
* @area: the #GtkCellArea that the newly created column should use to layout cells.
*
* Creates a new #GtkTreeViewColumn using @area to render its cells.
*
* Return value: A newly created #GtkTreeViewColumn.
*
* Since: 3.0
*/
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;
}
/**
* gtk_tree_view_column_new_with_attributes:
* @title: The title to set the header to.
* @cell: The #GtkCellRenderer.
* @Varargs: 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(),
* gtk_tree_view_column_pack_start(), and
* gtk_tree_view_column_set_attributes() on the newly created #GtkTreeViewColumn.
*
* Here's a simple example:
* |[
* enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS };
* ...
* {
* GtkTreeViewColumn *column;
* GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
*
* column = gtk_tree_view_column_new_with_attributes ("Title",
* renderer,
* "text", TEXT_COLUMN,
* "foreground", COLOR_COLUMN,
* NULL);
* }
* ]|
*
* Return value: A newly created #GtkTreeViewColumn.
**/
GtkTreeViewColumn *
gtk_tree_view_column_new_with_attributes (const gchar *title,
GtkCellRenderer *cell,
...)
{
GtkTreeViewColumn *retval;
va_list args;
retval = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (retval, title);
gtk_tree_view_column_pack_start (retval, cell, TRUE);
va_start (args, cell);
gtk_tree_view_column_set_attributesv (retval, cell, args);
va_end (args);
return retval;
}
/**
* gtk_tree_view_column_pack_start:
* @tree_column: A #GtkTreeViewColumn.
* @cell: The #GtkCellRenderer.
* @expand: %TRUE if @cell is to be given extra space allocated to @tree_column.
*
* Packs the @cell into the beginning of the column. If @expand is %FALSE, then
* the @cell is allocated no more space than it needs. Any unused space is divided
* evenly between cells for which @expand is %TRUE.
**/
void
gtk_tree_view_column_pack_start (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
gboolean expand)
{
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (tree_column), cell, expand);
}
/**
* gtk_tree_view_column_pack_end:
* @tree_column: A #GtkTreeViewColumn.
* @cell: The #GtkCellRenderer.
* @expand: %TRUE if @cell is to be given extra space allocated to @tree_column.
*
* Adds the @cell to end of the column. If @expand is %FALSE, then the @cell
* is allocated no more space than it needs. Any unused space is divided
* evenly between cells for which @expand is %TRUE.
**/
void
gtk_tree_view_column_pack_end (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
gboolean expand)
{
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (tree_column), cell, expand);
}
/**
* gtk_tree_view_column_clear:
* @tree_column: A #GtkTreeViewColumn
*
* Unsets all the mappings on all renderers on the @tree_column.
**/
void
gtk_tree_view_column_clear (GtkTreeViewColumn *tree_column)
{
gtk_cell_layout_clear (GTK_CELL_LAYOUT (tree_column));
}
/**
* gtk_tree_view_column_add_attribute:
* @tree_column: A #GtkTreeViewColumn.
* @cell_renderer: the #GtkCellRenderer to set attributes on
* @attribute: An attribute on the renderer
* @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
* 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
* "text" attribute of a #GtkCellRendererText get its values from
* column 2.
**/
void
gtk_tree_view_column_add_attribute (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell_renderer,
const gchar *attribute,
gint column)
{
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (tree_column),
cell_renderer, attribute, column);
}
static void
gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell_renderer,
va_list args)
{
GtkTreeViewColumnPrivate *priv = tree_column->priv;
gchar *attribute;
gint column;
attribute = va_arg (args, gchar *);
gtk_cell_layout_clear_attributes (GTK_CELL_LAYOUT (priv->cell_area),
cell_renderer);
while (attribute != NULL)
{
column = va_arg (args, gint);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (priv->cell_area),
cell_renderer, attribute, column);
attribute = va_arg (args, gchar *);
}
}
/**
* gtk_tree_view_column_set_attributes:
* @tree_column: A #GtkTreeViewColumn.
* @cell_renderer: the #GtkCellRenderer we're setting the attributes of
* @Varargs: 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
* 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.
**/
void
gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell_renderer,
...)
{
va_list args;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
g_return_if_fail (GTK_IS_CELL_RENDERER (cell_renderer));
va_start (args, cell_renderer);
gtk_tree_view_column_set_attributesv (tree_column, cell_renderer, args);
va_end (args);
}
/**
* gtk_tree_view_column_set_cell_data_func:
* @tree_column: A #GtkTreeViewColumn
* @cell_renderer: A #GtkCellRenderer
* @func: (allow-none): The #GtkTreeViewColumnFunc to use.
* @func_data: The user data for @func.
* @destroy: The destroy notification for @func_data
*
* Sets the #GtkTreeViewColumnFunc to use for the column. This
* function is used instead of the standard attributes mapping for
* setting the column value, and should set the value of @tree_column's
* cell renderer as appropriate. @func may be %NULL to remove an
* older one.
**/
void
gtk_tree_view_column_set_cell_data_func (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell_renderer,
GtkTreeCellDataFunc func,
gpointer func_data,
GDestroyNotify destroy)
{
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (tree_column),
cell_renderer,
(GtkCellLayoutDataFunc)func,
func_data, destroy);
}
/**
* gtk_tree_view_column_clear_attributes:
* @tree_column: a #GtkTreeViewColumn
* @cell_renderer: a #GtkCellRenderer to clear the attribute mapping on.
*
* Clears all existing attributes previously set with
* gtk_tree_view_column_set_attributes().
**/
void
gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell_renderer)
{
gtk_cell_layout_clear_attributes (GTK_CELL_LAYOUT (tree_column),
cell_renderer);
}
/**
* 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)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
g_return_if_fail (spacing >= 0);
priv = tree_column->priv;
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);
}
/**
* gtk_tree_view_column_get_spacing:
* @tree_column: A #GtkTreeViewColumn.
*
* Returns the spacing of @tree_column.
*
* Return value: the spacing of @tree_column.
**/
gint
gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column)
{
GtkTreeViewColumnPrivate *priv;
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
priv = tree_column->priv;
return gtk_cell_area_box_get_spacing (GTK_CELL_AREA_BOX (priv->cell_area));
}
/* Options for manipulating the columns */
/**
* gtk_tree_view_column_set_visible:
* @tree_column: A #GtkTreeViewColumn.
* @visible: %TRUE if the @tree_column is visible.
*
* Sets the visibility of @tree_column.
*/
void
gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
gboolean visible)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
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;
if (priv->visible == visible)
return;
priv->visible = visible;
if (priv->visible)
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
if (priv->tree_view)
_gtk_tree_view_reset_header_styles (GTK_TREE_VIEW (priv->tree_view));
gtk_tree_view_column_update_button (tree_column);
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_notify (G_OBJECT (tree_column), "visible");
}
/**
* gtk_tree_view_column_get_visible:
* @tree_column: A #GtkTreeViewColumn.
*
* Returns %TRUE if @tree_column is visible.
*
* Return value: whether the column is visible or not. If it is visible, then
* the tree will show the column.
**/
gboolean
gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
return tree_column->priv->visible;
}
/**
* 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
* grabbing the outer edge of the column button. If resizable is %TRUE and
* sizing mode of the column is #GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing
* mode is changed to #GTK_TREE_VIEW_COLUMN_GROW_ONLY.
**/
void
gtk_tree_view_column_set_resizable (GtkTreeViewColumn *tree_column,
gboolean resizable)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
priv = tree_column->priv;
resizable = !! resizable;
if (priv->resizable == resizable)
return;
priv->resizable = resizable;
if (resizable && priv->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
gtk_tree_view_column_set_sizing (tree_column, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
gtk_tree_view_column_update_button (tree_column);
g_object_notify (G_OBJECT (tree_column), "resizable");
}
/**
* gtk_tree_view_column_get_resizable:
* @tree_column: A #GtkTreeViewColumn
*
* Returns %TRUE if the @tree_column can be resized by the end user.
*
* Return value: %TRUE, if the @tree_column can be resized.
**/
gboolean
gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
return tree_column->priv->resizable;
}
/**
* gtk_tree_view_column_set_sizing:
* @tree_column: A #GtkTreeViewColumn.
* @type: The #GtkTreeViewColumnSizing.
*
* Sets the growth behavior of @tree_column to @type.
**/
void
gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column,
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
GtkTreeViewColumnSizing type)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
priv = tree_column->priv;
if (type == priv->column_type)
return;
if (type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
gtk_tree_view_column_set_resizable (tree_column, FALSE);
priv->column_type = type;
gtk_tree_view_column_update_button (tree_column);
g_object_notify (G_OBJECT (tree_column), "sizing");
}
/**
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
* gtk_tree_view_column_get_sizing:
* @tree_column: A #GtkTreeViewColumn.
*
* Returns the current type of @tree_column.
*
* Return value: The type of @tree_column.
**/
GtkTreeViewColumnSizing
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
gtk_tree_view_column_get_sizing (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
return tree_column->priv->column_type;
}
/**
* gtk_tree_view_column_get_width:
* @tree_column: A #GtkTreeViewColumn.
*
* Returns the current size of @tree_column in pixels.
*
* Return value: The current width of @tree_column.
**/
gint
gtk_tree_view_column_get_width (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
return tree_column->priv->width;
}
gint
_gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column)
{
GtkTreeViewColumnPrivate *priv;
gint real_requested_width;
priv = tree_column->priv;
if (priv->use_resized_width)
{
real_requested_width = priv->resized_width;
}
else if (priv->column_type == GTK_TREE_VIEW_COLUMN_FIXED)
{
real_requested_width = priv->fixed_width;
}
else if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view)))
{
gint button_request;
gint requested_width;
gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &requested_width, NULL);
requested_width += priv->padding;
gtk_widget_get_preferred_width (priv->button, &button_request, NULL);
real_requested_width = MAX (requested_width, button_request);
}
else
{
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;
}
if (priv->min_width != -1)
real_requested_width = MAX (real_requested_width, priv->min_width);
if (priv->max_width != -1)
real_requested_width = MIN (real_requested_width, priv->max_width);
return real_requested_width;
}
void
_gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column,
int x_offset,
int width)
{
GtkTreeViewColumnPrivate *priv;
GtkAllocation allocation;
gboolean rtl;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
priv = tree_column->priv;
if (priv->width != width)
gtk_widget_queue_draw (priv->tree_view);
priv->width = width;
gtk_cell_area_context_allocate (priv->cell_area_context, priv->width - priv->padding, -1);
allocation.x = x_offset;
allocation.y = 0;
allocation.width = width;
allocation.height = _gtk_tree_view_get_header_height (GTK_TREE_VIEW (priv->tree_view));
gtk_widget_size_allocate (priv->button, &allocation);
if (priv->window)
{
rtl = (gtk_widget_get_direction (priv->tree_view) == GTK_TEXT_DIR_RTL);
gdk_window_move_resize (priv->window,
allocation.x + (rtl ? 0 : allocation.width) - TREE_VIEW_DRAG_WIDTH/2,
allocation.y,
TREE_VIEW_DRAG_WIDTH, allocation.height);
}
g_object_notify (G_OBJECT (tree_column), "width");
}
/**
* gtk_tree_view_column_set_fixed_width:
* @tree_column: A #GtkTreeViewColumn.
* @fixed_width: The size to set @tree_column to. Must be greater than 0.
*
* Sets the size of the column in pixels. This is meaningful only if the sizing
* type is #GTK_TREE_VIEW_COLUMN_FIXED. The size of the column is clamped to
* the min/max width for the column. Please note that the min/max width of the
* column doesn't actually affect the "fixed_width" property of the widget, just
* the actual size when displayed.
**/
void
gtk_tree_view_column_set_fixed_width (GtkTreeViewColumn *tree_column,
gint fixed_width)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
g_return_if_fail (fixed_width > 0);
priv = tree_column->priv;
priv->fixed_width = fixed_width;
priv->use_resized_width = FALSE;
if (priv->tree_view &&
gtk_widget_get_realized (priv->tree_view) &&
priv->column_type == GTK_TREE_VIEW_COLUMN_FIXED)
{
gtk_widget_queue_resize (priv->tree_view);
}
2002-01-28 18:52:49 +00:00
g_object_notify (G_OBJECT (tree_column), "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
/**
* gtk_tree_view_column_get_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
* @tree_column: a #GtkTreeViewColumn
*
* Gets the fixed width of the column. This value is only meaning may not be
* the actual width of the column on the screen, just what is requested.
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
*
* Return value: 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
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);
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
}
/**
* 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.
**/
void
gtk_tree_view_column_set_min_width (GtkTreeViewColumn *tree_column,
gint min_width)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
g_return_if_fail (min_width >= -1);
priv = tree_column->priv;
if (min_width == priv->min_width)
return;
if (priv->visible &&
priv->tree_view != NULL &&
gtk_widget_get_realized (priv->tree_view))
{
if (min_width > priv->width)
gtk_widget_queue_resize (priv->tree_view);
}
priv->min_width = min_width;
2002-01-28 18:52:49 +00:00
g_object_freeze_notify (G_OBJECT (tree_column));
if (priv->max_width != -1 && priv->max_width < min_width)
{
priv->max_width = min_width;
g_object_notify (G_OBJECT (tree_column), "max-width");
}
g_object_notify (G_OBJECT (tree_column), "min-width");
2002-01-28 18:52:49 +00:00
g_object_thaw_notify (G_OBJECT (tree_column));
if (priv->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
_gtk_tree_view_column_autosize (GTK_TREE_VIEW (priv->tree_view),
tree_column);
}
/**
* 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.
*
* Return value: The minimum width of the @tree_column.
**/
gint
gtk_tree_view_column_get_min_width (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), -1);
return tree_column->priv->min_width;
}
/**
* 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
* maximum width is unset. Note, the column can actually be wider than max
* width if it's the last column in a view. In this case, the column expands to
* fill any extra space.
**/
void
gtk_tree_view_column_set_max_width (GtkTreeViewColumn *tree_column,
gint max_width)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
g_return_if_fail (max_width >= -1);
priv = tree_column->priv;
if (max_width == priv->max_width)
return;
if (priv->visible &&
priv->tree_view != NULL &&
gtk_widget_get_realized (priv->tree_view))
{
if (max_width != -1 && max_width < priv->width)
gtk_widget_queue_resize (priv->tree_view);
}
priv->max_width = max_width;
2002-01-28 18:52:49 +00:00
g_object_freeze_notify (G_OBJECT (tree_column));
if (max_width != -1 && max_width < priv->min_width)
{
priv->min_width = max_width;
g_object_notify (G_OBJECT (tree_column), "min-width");
}
g_object_notify (G_OBJECT (tree_column), "max-width");
2002-01-28 18:52:49 +00:00
g_object_thaw_notify (G_OBJECT (tree_column));
if (priv->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
_gtk_tree_view_column_autosize (GTK_TREE_VIEW (priv->tree_view),
tree_column);
}
/**
* 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.
*
* Return value: The maximum width of the @tree_column.
**/
gint
gtk_tree_view_column_get_max_width (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), -1);
return tree_column->priv->max_width;
}
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
*
* Emits the "clicked" signal on the column. This function will only work if
* @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)
{
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));
priv = tree_column->priv;
if (priv->visible &&
priv->button &&
priv->clickable)
gtk_button_clicked (GTK_BUTTON (priv->button));
sync to tree changes 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
2001-01-19 22:39:19 +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.
**/
void
gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column,
const gchar *title)
{
GtkTreeViewColumnPrivate *priv;
gchar *new_title;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
priv = tree_column->priv;
new_title = g_strdup (title);
g_free (priv->title);
priv->title = new_title;
gtk_tree_view_column_update_button (tree_column);
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_notify (G_OBJECT (tree_column), "title");
}
/**
* 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.
*
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
* Return value: the title of the column. This string should not be
* modified or freed.
**/
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_CONST_RETURN gchar *
gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
return tree_column->priv->title;
}
/**
* gtk_tree_view_column_set_expand:
* @tree_column: A #GtkTreeViewColumn
* @expand: %TRUE if the column should take available extra space, %FALSE if not
*
* 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.
*
* Since: 2.4
**/
void
gtk_tree_view_column_set_expand (GtkTreeViewColumn *tree_column,
gboolean expand)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
priv = tree_column->priv;
expand = expand?TRUE:FALSE;
if (priv->expand == expand)
return;
priv->expand = expand;
if (priv->visible &&
priv->tree_view != NULL &&
gtk_widget_get_realized (priv->tree_view))
{
/* We want to continue using the original width of the
* column that includes additional space added by the user
* resizing the columns and possibly extra (expanded) space, which
* are not included in the resized width.
*/
priv->use_resized_width = FALSE;
gtk_widget_queue_resize (priv->tree_view);
}
g_object_notify (G_OBJECT (tree_column), "expand");
}
/**
* gtk_tree_view_column_get_expand:
* @tree_column: a #GtkTreeViewColumn
*
* Return %TRUE if the column expands to take any available space.
*
* Return value: %TRUE, if the column expands
*
* Since: 2.4
**/
gboolean
gtk_tree_view_column_get_expand (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
return tree_column->priv->expand;
}
/**
* gtk_tree_view_column_set_clickable:
* @tree_column: A #GtkTreeViewColumn.
* @clickable: %TRUE if the header is active.
*
* Sets the header to be active if @active is %TRUE. When the header is active,
* then it can take keyboard focus, and can be clicked.
**/
void
gtk_tree_view_column_set_clickable (GtkTreeViewColumn *tree_column,
gboolean clickable)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
priv = tree_column->priv;
clickable = !! clickable;
if (priv->clickable == clickable)
return;
priv->clickable = clickable;
gtk_tree_view_column_update_button (tree_column);
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_notify (G_OBJECT (tree_column), "clickable");
}
/**
* gtk_tree_view_column_get_clickable:
* @tree_column: a #GtkTreeViewColumn
*
* Returns %TRUE if the user can click on the header for the column.
*
* Return value: %TRUE if user can click the column header.
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
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);
return tree_column->priv->clickable;
}
/**
* gtk_tree_view_column_set_widget:
* @tree_column: A #GtkTreeViewColumn.
* @widget: (allow-none): A child #GtkWidget, or %NULL.
*
* Sets the widget in the header to be @widget. If widget is %NULL, then the
* header button is set with a #GtkLabel set to the title of @tree_column.
**/
void
gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column,
GtkWidget *widget)
{
GtkTreeViewColumnPrivate *priv;
sync to tree changes 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
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));
priv = tree_column->priv;
if (widget)
g_object_ref_sink (widget);
if (priv->child)
g_object_unref (priv->child);
sync to tree changes 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
2001-01-19 22:39:19 +00:00
priv->child = widget;
gtk_tree_view_column_update_button (tree_column);
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
g_object_notify (G_OBJECT (tree_column), "widget");
}
/**
* 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.
*
* Return value: (transfer none): The #GtkWidget in the column
* header, or %NULL
**/
GtkWidget *
gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
return tree_column->priv->child;
}
/**
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:
* @tree_column: A #GtkTreeViewColumn.
* @xalign: The alignment, which is between [0.0 and 1.0] inclusive.
*
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.
* The alignment determines its location inside the button -- 0.0 for left, 0.5
* for center, 1.0 for right.
**/
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)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
priv = tree_column->priv;
xalign = CLAMP (xalign, 0.0, 1.0);
if (priv->xalign == xalign)
return;
priv->xalign = xalign;
gtk_tree_view_column_update_button (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_object_notify (G_OBJECT (tree_column), "alignment");
}
/**
* 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.
*
* Return value: The current alignent of @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
gfloat
gtk_tree_view_column_get_alignment (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0.5);
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
}
/**
* gtk_tree_view_column_set_reorderable:
* @tree_column: A #GtkTreeViewColumn
* @reorderable: %TRUE, if the column can be reordered.
*
* If @reorderable is %TRUE, then the column can be reordered by the end user
* dragging the header.
**/
void
gtk_tree_view_column_set_reorderable (GtkTreeViewColumn *tree_column,
gboolean reorderable)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
priv = tree_column->priv;
/* if (reorderable)
gtk_tree_view_column_set_clickable (tree_column, TRUE);*/
if (priv->reorderable == (reorderable?TRUE:FALSE))
return;
priv->reorderable = (reorderable?TRUE:FALSE);
gtk_tree_view_column_update_button (tree_column);
g_object_notify (G_OBJECT (tree_column), "reorderable");
}
/**
* gtk_tree_view_column_get_reorderable:
* @tree_column: A #GtkTreeViewColumn
*
* Returns %TRUE if the @tree_column can be reordered by the user.
*
* Return value: %TRUE if the @tree_column can be reordered by the user.
**/
gboolean
gtk_tree_view_column_get_reorderable (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
return tree_column->priv->reorderable;
}
/**
* gtk_tree_view_column_set_sort_column_id:
* @tree_column: a #GtkTreeViewColumn
* @sort_column_id: The @sort_column_id of the model to sort on.
*
* 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.
**/
void
gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column,
gint sort_column_id)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
g_return_if_fail (sort_column_id >= -1);
priv = tree_column->priv;
if (priv->sort_column_id == sort_column_id)
return;
priv->sort_column_id = sort_column_id;
/* Handle unsetting the id */
if (sort_column_id == -1)
{
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
if (priv->sort_clicked_signal)
{
g_signal_handler_disconnect (tree_column, priv->sort_clicked_signal);
priv->sort_clicked_signal = 0;
}
if (priv->sort_column_changed_signal)
{
g_signal_handler_disconnect (model, priv->sort_column_changed_signal);
priv->sort_column_changed_signal = 0;
}
gtk_tree_view_column_set_sort_order (tree_column, GTK_SORT_ASCENDING);
gtk_tree_view_column_set_sort_indicator (tree_column, FALSE);
gtk_tree_view_column_set_clickable (tree_column, FALSE);
g_object_notify (G_OBJECT (tree_column), "sort-column-id");
return;
}
gtk_tree_view_column_set_clickable (tree_column, TRUE);
if (! priv->sort_clicked_signal)
priv->sort_clicked_signal = g_signal_connect (tree_column,
"clicked",
G_CALLBACK (gtk_tree_view_column_sort),
NULL);
gtk_tree_view_column_setup_sort_column_id_callback (tree_column);
g_object_notify (G_OBJECT (tree_column), "sort-column-id");
}
/**
* gtk_tree_view_column_get_sort_column_id:
* @tree_column: a #GtkTreeViewColumn
*
* Gets the logical @sort_column_id that the model sorts on when this
* column is selected for sorting.
* See gtk_tree_view_column_set_sort_column_id().
*
* Return value: the current @sort_column_id for this column, or -1 if
* this column can't be used for sorting.
**/
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);
return tree_column->priv->sort_column_id;
}
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;
if (setting == tree_column->priv->show_sort_indicator)
return;
tree_column->priv->show_sort_indicator = setting;
gtk_tree_view_column_update_button (tree_column);
g_object_notify (G_OBJECT (tree_column), "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().
*
* Return value: whether the sort indicator arrow is displayed
**/
gboolean
gtk_tree_view_column_get_sort_indicator (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
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
*
* Changes the appearance of the sort indicator.
*
* This <emphasis>does not</emphasis> actually sort the model. Use
* gtk_tree_view_column_set_sort_column_id() if you want automatic sorting
* support. This function is primarily for custom sorting behavior, and should
* be used in conjunction with gtk_tree_sortable_set_sort_column() to do
* 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
*
* 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,
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));
if (order == tree_column->priv->sort_order)
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
tree_column->priv->sort_order = order;
gtk_tree_view_column_update_button (tree_column);
g_object_notify (G_OBJECT (tree_column), "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().
*
* Return value: the sort order the sort indicator is indicating
**/
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);
don't draw if label->layout is NULL due to a pending resize 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout is NULL due to a pending resize * gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the column width to values less than 1 * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp width to be between min/max width, and still set the width even if autosize is turned on, so the tree view can use this function in order to autosize. (gtk_tree_view_column_init): set initial width to 1 not 0 * gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use setter function to modify column width, so we get notification (gtk_tree_view_insert_iter_height): ditto (gtk_tree_view_calc_size): ditto (gtk_tree_view_check_dirty): ditto * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add properties to change all the interesting attributes of the tree view column. (gtk_tree_view_column_set_header_clickable): rename set_clickable (gtk_tree_view_column_get_clickable): add (gtk_tree_view_column_set_cell_renderer): don't unset the current attributes; assume a cell renderer with equivalent object properties has been swapped in. Do g_object_notify(). (gtk_tree_view_column_set_visible): g_object_notify (gtk_tree_view_column_get_sizing): rename from get_col_type (gtk_tree_view_column_set_sizing): g_object_notify (gtk_tree_view_column_set_width): add g_object_notify (gtk_tree_view_column_set_min_width): ditto (gtk_tree_view_column_set_max_width): ditto (gtk_tree_view_column_set_title): ditto (gtk_tree_view_column_set_clickable): ditto (gtk_tree_view_column_set_widget): ditto (gtk_tree_view_column_set_justification): ditto
2001-01-09 23:24:20 +00:00
return tree_column->priv->sort_order;
}
sync to tree changes 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
2001-01-19 22:39:19 +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.
* @iter: The #GtkTreeIter to to get the cell renderer's attributes from.
* @is_expander: %TRUE, if the row has children
* @is_expanded: %TRUE, if the row has visible children
*
* Sets the cell renderer based on the @tree_model and @iter. That is, for
* every attribute mapping in @tree_column, it will get a value from the set
* column on the @iter, and use that value to set the attribute on the cell
* renderer. This is used primarily by the #GtkTreeView.
**/
void
gtk_tree_view_column_cell_set_cell_data (GtkTreeViewColumn *tree_column,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
gboolean is_expander,
gboolean is_expanded)
{
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
if (tree_model == NULL)
return;
gtk_cell_area_apply_attributes (tree_column->priv->cell_area, tree_model, iter,
is_expander, is_expanded);
}
/**
* gtk_tree_view_column_cell_get_size:
* @tree_column: A #GtkTreeViewColumn.
* @cell_area: (allow-none): The area a cell in the column will be allocated, or %NULL
* @x_offset: (out) (allow-none): location to return x offset of a cell relative to @cell_area, or %NULL
* @y_offset: (out) (allow-none): location to return y offset of a cell relative to @cell_area, or %NULL
* @width: (out) (allow-none): location to return width needed to render a cell, or %NULL
* @height: (out) (allow-none): location to return height needed to render a cell, or %NULL
*
* Obtains the width and height needed to render the column. This is used
* primarily by the #GtkTreeView.
**/
void
gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column,
const GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height)
{
GtkTreeViewColumnPrivate *priv;
gint min_width = 0, min_height = 0;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
priv = tree_column->priv;
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,
NULL, NULL);
gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &min_width, NULL);
gtk_cell_area_get_preferred_height_for_width (priv->cell_area,
priv->cell_area_context,
priv->tree_view,
min_width,
&min_height,
NULL);
g_signal_handler_unblock (priv->cell_area_context,
priv->context_changed_signal);
if (height)
* height = min_height;
if (width)
* width = min_width;
}
/**
* gtk_tree_view_column_cell_render:
* @tree_column: A #GtkTreeViewColumn.
* @cr: cairo context to draw to
* @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
* #GtkTreeView.
**/
void
_gtk_tree_view_column_cell_render (GtkTreeViewColumn *tree_column,
cairo_t *cr,
const GdkRectangle *background_area,
const GdkRectangle *cell_area,
guint flags,
gboolean draw_focus)
{
GtkTreeViewColumnPrivate *priv;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
g_return_if_fail (cr != NULL);
g_return_if_fail (background_area != NULL);
g_return_if_fail (cell_area != NULL);
priv = tree_column->priv;
cairo_save (cr);
gtk_cell_area_render (priv->cell_area, priv->cell_area_context,
priv->tree_view, cr,
background_area, cell_area, flags,
draw_focus);
cairo_restore (cr);
}
gboolean
_gtk_tree_view_column_cell_event (GtkTreeViewColumn *tree_column,
GdkEvent *event,
const GdkRectangle *cell_area,
guint flags)
{
GtkTreeViewColumnPrivate *priv;
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
priv = tree_column->priv;
return gtk_cell_area_event (priv->cell_area,
priv->cell_area_context,
priv->tree_view,
event,
cell_area,
flags);
}
/**
* gtk_tree_view_column_cell_is_visible:
* @tree_column: A #GtkTreeViewColumn
*
* Returns %TRUE if any of the cells packed into the @tree_column are visible.
* For this to be meaningful, you must first initialize the cells with
* gtk_tree_view_column_cell_set_cell_data()
*
* Return value: %TRUE, if any of the cells packed into the @tree_column are currently visible
**/
gboolean
gtk_tree_view_column_cell_is_visible (GtkTreeViewColumn *tree_column)
{
GList *list;
GList *cells;
GtkTreeViewColumnPrivate *priv;
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);
priv = tree_column->priv;
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->cell_area));
for (list = cells; list; list = list->next)
{
if (gtk_cell_renderer_get_visible (list->data))
{
g_list_free (cells);
return TRUE;
}
}
g_list_free (cells);
return FALSE;
}
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.
2002-11-28 00:33:17 +00:00
*
* Since: 2.2
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
**/
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));
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
}
void
_gtk_tree_view_column_cell_set_dirty (GtkTreeViewColumn *tree_column,
gboolean install_handler)
{
GtkTreeViewColumnPrivate *priv = tree_column->priv;
priv->dirty = TRUE;
priv->padding = 0;
priv->width = 0;
/* Issue a manual reset on the context to have all
* sizes re-requested for the context.
*/
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);
if (priv->tree_view &&
gtk_widget_get_realized (priv->tree_view))
{
_gtk_tree_view_install_mark_rows_col_dirty (GTK_TREE_VIEW (priv->tree_view), install_handler);
gtk_widget_queue_resize (priv->tree_view);
}
}
gboolean
_gtk_tree_view_column_cell_get_dirty (GtkTreeViewColumn *tree_column)
{
return tree_column->priv->dirty;
}
/**
* gtk_tree_view_column_cell_get_position:
* @tree_column: a #GtkTreeViewColumn
2003-04-15 22:51:04 +00:00
* @cell_renderer: a #GtkCellRenderer
* @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
*
* 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.
*
* Return value: %TRUE if @cell belongs to @tree_column.
*/
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,
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)
{
GtkTreeViewColumnPrivate *priv;
GdkRectangle cell_area;
GdkRectangle allocation;
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;
gtk_tree_view_get_background_area (GTK_TREE_VIEW (priv->tree_view),
NULL, tree_column, &cell_area);
gtk_cell_area_get_cell_allocation (priv->cell_area,
priv->cell_area_context,
priv->tree_view,
cell_renderer,
&cell_area,
&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
if (x_offset)
{
GdkRectangle button_allocation;
/* Retrieve column offset */
gtk_widget_get_allocation (priv->button, &button_allocation);
*x_offset = allocation.x - button_allocation.x;
}
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
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
}
/**
* 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.
*
* Since: 2.8
**/
void
gtk_tree_view_column_queue_resize (GtkTreeViewColumn *tree_column)
{
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
if (tree_column->priv->tree_view)
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
}
/**
* 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
* returned.
*
2010-09-21 04:18:11 +00:00
* Return value: (transfer none): The tree view wherein @column has
* been inserted if any, %NULL otherwise.
*
* Since: 2.12
*/
GtkWidget *
gtk_tree_view_column_get_tree_view (GtkTreeViewColumn *tree_column)
{
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
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
*
* Return value: (transfer none): The button for the column header.
*
* Since: 3.0
*/
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;
}
GdkWindow *
_gtk_tree_view_column_get_window (GtkTreeViewColumn *column)
{
return column->priv->window;
}
void
_gtk_tree_view_column_push_padding (GtkTreeViewColumn *column,
gint padding)
{
column->priv->padding = MAX (column->priv->padding, padding);
}
gint
_gtk_tree_view_column_get_requested_width (GtkTreeViewColumn *column)
{
gint requested_width;
gtk_cell_area_context_get_preferred_width (column->priv->cell_area_context, &requested_width, NULL);
return requested_width + column->priv->padding;
}
void
_gtk_tree_view_column_set_resized_width (GtkTreeViewColumn *column,
gint width)
{
column->priv->resized_width = width;
}
gint
_gtk_tree_view_column_get_resized_width (GtkTreeViewColumn *column)
{
return column->priv->resized_width;
}
void
_gtk_tree_view_column_set_use_resized_width (GtkTreeViewColumn *column,
gboolean use_resized_width)
{
column->priv->use_resized_width = use_resized_width;
}
gboolean
_gtk_tree_view_column_get_use_resized_width (GtkTreeViewColumn *column)
{
return column->priv->use_resized_width;
}
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;
}