2003-09-26 21:57:06 +00:00
|
|
|
|
/* gtkellview.c
|
|
|
|
|
* Copyright (C) 2002, 2003 Kristian Rietveld <kris@gtk.org>
|
|
|
|
|
*
|
2003-10-24 18:36:55 +00:00
|
|
|
|
* 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.
|
2003-09-26 21:57:06 +00:00
|
|
|
|
*
|
2003-10-24 18:36:55 +00:00
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
2003-09-26 21:57:06 +00:00
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2003-10-24 18:36:55 +00:00
|
|
|
|
* Library General Public License for more details.
|
2003-09-26 21:57:06 +00:00
|
|
|
|
*
|
2003-10-24 18:36:55 +00:00
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2003-09-26 21:57:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
|
#include "config.h"
|
2020-04-23 16:48:29 +00:00
|
|
|
|
|
2003-10-23 18:25:53 +00:00
|
|
|
|
#include "gtkcellview.h"
|
2020-04-23 16:48:29 +00:00
|
|
|
|
|
|
|
|
|
#include "gtkbuildable.h"
|
2003-10-23 18:25:53 +00:00
|
|
|
|
#include "gtkcelllayout.h"
|
2010-11-18 04:53:55 +00:00
|
|
|
|
#include "gtkcellareabox.h"
|
2003-10-23 18:25:53 +00:00
|
|
|
|
#include "gtkcellrendererpixbuf.h"
|
2020-04-23 16:48:29 +00:00
|
|
|
|
#include "gtkcellrenderertext.h"
|
|
|
|
|
#include "gtkintl.h"
|
|
|
|
|
#include "gtkorientable.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
2015-12-17 00:07:26 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
2020-04-23 16:48:29 +00:00
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
|
#include <gobject/gmarshal.h>
|
2010-07-09 17:22:23 +00:00
|
|
|
|
|
2020-04-23 16:48:29 +00:00
|
|
|
|
#include <string.h>
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2010-11-06 17:04:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* SECTION:gtkcellview
|
|
|
|
|
* @Short_description: A widget displaying a single row of a GtkTreeModel
|
|
|
|
|
* @Title: GtkCellView
|
|
|
|
|
*
|
2010-11-26 04:18:08 +00:00
|
|
|
|
* A #GtkCellView displays a single row of a #GtkTreeModel using a #GtkCellArea
|
|
|
|
|
* and #GtkCellAreaContext. A #GtkCellAreaContext can be provided to the
|
|
|
|
|
* #GtkCellView at construction time in order to keep the cellview in context
|
|
|
|
|
* of a group of cell views, this ensures that the renderers displayed will
|
2020-08-21 12:41:13 +00:00
|
|
|
|
* be properly aligned with each other (like the aligned cells in the menus
|
2010-12-15 08:17:45 +00:00
|
|
|
|
* of #GtkComboBox).
|
2010-11-26 04:18:08 +00:00
|
|
|
|
*
|
|
|
|
|
* #GtkCellView is #GtkOrientable in order to decide in which orientation
|
2010-12-15 08:17:45 +00:00
|
|
|
|
* the underlying #GtkCellAreaContext should be allocated. Taking the #GtkComboBox
|
|
|
|
|
* menu as an example, cellviews should be oriented horizontally if the menus are
|
2010-11-26 04:18:08 +00:00
|
|
|
|
* listed top-to-bottom and thus all share the same width but may have separate
|
|
|
|
|
* individual heights (left-to-right menus should be allocated vertically since
|
|
|
|
|
* they all share the same height but may have variable widths).
|
2015-11-11 01:45:42 +00:00
|
|
|
|
*
|
|
|
|
|
* # CSS nodes
|
|
|
|
|
*
|
|
|
|
|
* GtkCellView has a single CSS node with name cellview.
|
2010-11-06 17:04:50 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
static void gtk_cell_view_constructed (GObject *object);
|
|
|
|
|
static void gtk_cell_view_get_property (GObject *object,
|
2003-09-26 21:57:06 +00:00
|
|
|
|
guint param_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_cell_view_set_property (GObject *object,
|
|
|
|
|
guint param_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_cell_view_finalize (GObject *object);
|
2010-11-18 04:53:55 +00:00
|
|
|
|
static void gtk_cell_view_dispose (GObject *object);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
static void gtk_cell_view_size_allocate (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline);
|
2016-12-19 15:34:25 +00:00
|
|
|
|
static void gtk_cell_view_snapshot (GtkWidget *widget,
|
|
|
|
|
GtkSnapshot *snapshot);
|
2004-12-15 16:27:30 +00:00
|
|
|
|
static void gtk_cell_view_set_value (GtkCellView *cell_view,
|
|
|
|
|
GtkCellRenderer *renderer,
|
2016-10-15 20:27:23 +00:00
|
|
|
|
const char *property,
|
2004-12-15 16:27:30 +00:00
|
|
|
|
GValue *value);
|
2004-11-29 18:43:41 +00:00
|
|
|
|
static void gtk_cell_view_set_cell_data (GtkCellView *cell_view);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2010-11-22 07:29:26 +00:00
|
|
|
|
/* celllayout */
|
|
|
|
|
static void gtk_cell_view_cell_layout_init (GtkCellLayoutIface *iface);
|
2010-11-18 04:53:55 +00:00
|
|
|
|
static GtkCellArea *gtk_cell_view_cell_layout_get_area (GtkCellLayout *layout);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
2010-11-22 07:29:26 +00:00
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
/* buildable */
|
2019-08-29 13:21:20 +00:00
|
|
|
|
static void gtk_cell_view_buildable_init (GtkBuildableIface *iface);
|
|
|
|
|
static gboolean gtk_cell_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *tagname,
|
2019-08-29 13:21:20 +00:00
|
|
|
|
GtkBuildableParser *parser,
|
|
|
|
|
gpointer *data);
|
|
|
|
|
static void gtk_cell_view_buildable_custom_tag_end (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *tagname,
|
2019-08-29 13:21:20 +00:00
|
|
|
|
gpointer 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
|
|
|
|
|
2011-03-05 08:49:49 +00:00
|
|
|
|
static GtkSizeRequestMode gtk_cell_view_get_request_mode (GtkWidget *widget);
|
2017-05-05 16:24:20 +00:00
|
|
|
|
static void gtk_cell_view_measure (GtkWidget *widget,
|
2016-10-22 14:06:14 +00:00
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline);
|
2010-11-20 07:30:51 +00:00
|
|
|
|
static void context_size_changed_cb (GtkCellAreaContext *context,
|
|
|
|
|
GParamSpec *pspec,
|
|
|
|
|
GtkWidget *view);
|
2010-11-22 06:51:51 +00:00
|
|
|
|
static void row_changed_cb (GtkTreeModel *model,
|
|
|
|
|
GtkTreePath *path,
|
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
|
GtkCellView *view);
|
2010-11-20 07:30:51 +00:00
|
|
|
|
|
2019-05-27 01:59:49 +00:00
|
|
|
|
typedef struct _GtkCellViewClass GtkCellViewClass;
|
|
|
|
|
typedef struct _GtkCellViewPrivate GtkCellViewPrivate;
|
|
|
|
|
|
|
|
|
|
struct _GtkCellView
|
|
|
|
|
{
|
|
|
|
|
GtkWidget parent_instance;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct _GtkCellViewClass
|
|
|
|
|
{
|
|
|
|
|
GtkWidgetClass parent_class;
|
|
|
|
|
};
|
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
struct _GtkCellViewPrivate
|
|
|
|
|
{
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
GtkTreeRowReference *displayed_row;
|
|
|
|
|
|
|
|
|
|
GtkCellArea *area;
|
|
|
|
|
GtkCellAreaContext *context;
|
|
|
|
|
|
|
|
|
|
gulong size_changed_id;
|
|
|
|
|
gulong row_changed_id;
|
|
|
|
|
|
2011-04-12 16:32:04 +00:00
|
|
|
|
GtkOrientation orientation;
|
|
|
|
|
|
|
|
|
|
guint draw_sensitive : 1;
|
|
|
|
|
guint fit_model : 1;
|
2010-11-24 05:59:55 +00:00
|
|
|
|
};
|
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
static GtkBuildableIface *parent_buildable_iface;
|
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
|
enum
|
|
|
|
|
{
|
|
|
|
|
PROP_0,
|
2010-11-26 04:18:08 +00:00
|
|
|
|
PROP_ORIENTATION,
|
2010-11-18 04:53:55 +00:00
|
|
|
|
PROP_MODEL,
|
|
|
|
|
PROP_CELL_AREA,
|
2010-11-24 05:59:55 +00:00
|
|
|
|
PROP_CELL_AREA_CONTEXT,
|
|
|
|
|
PROP_DRAW_SENSITIVE,
|
|
|
|
|
PROP_FIT_MODEL
|
2003-09-26 21:57:06 +00:00
|
|
|
|
};
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkCellView, gtk_cell_view, GTK_TYPE_WIDGET,
|
|
|
|
|
G_ADD_PRIVATE (GtkCellView)
|
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_cell_view_cell_layout_init)
|
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
2010-11-26 04:18:08 +00:00
|
|
|
|
gtk_cell_view_buildable_init)
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL))
|
2010-08-18 23:39:59 +00:00
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_class_init (GtkCellViewClass *klass)
|
|
|
|
|
{
|
2010-11-18 08:30:33 +00:00
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
gobject_class->constructed = gtk_cell_view_constructed;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
gobject_class->get_property = gtk_cell_view_get_property;
|
|
|
|
|
gobject_class->set_property = gtk_cell_view_set_property;
|
|
|
|
|
gobject_class->finalize = gtk_cell_view_finalize;
|
2010-11-18 04:53:55 +00:00
|
|
|
|
gobject_class->dispose = gtk_cell_view_dispose;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2016-12-19 15:34:25 +00:00
|
|
|
|
widget_class->snapshot = gtk_cell_view_snapshot;
|
2010-09-21 14:35:17 +00:00
|
|
|
|
widget_class->size_allocate = gtk_cell_view_size_allocate;
|
2011-03-05 08:49:49 +00:00
|
|
|
|
widget_class->get_request_mode = gtk_cell_view_get_request_mode;
|
2017-05-05 16:24:20 +00:00
|
|
|
|
widget_class->measure = gtk_cell_view_measure;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
|
|
/* properties */
|
2010-11-26 04:18:08 +00:00
|
|
|
|
g_object_class_override_property (gobject_class, PROP_ORIENTATION, "orientation");
|
|
|
|
|
|
2006-05-24 17:01:28 +00:00
|
|
|
|
/**
|
2012-04-13 00:07:28 +00:00
|
|
|
|
* GtkCellView:model:
|
2006-05-24 17:01:28 +00:00
|
|
|
|
*
|
|
|
|
|
* The model for cell view
|
|
|
|
|
*
|
|
|
|
|
* since 2.10
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_MODEL,
|
|
|
|
|
g_param_spec_object ("model",
|
|
|
|
|
P_("CellView model"),
|
|
|
|
|
P_("The model for cell view"),
|
|
|
|
|
GTK_TYPE_TREE_MODEL,
|
|
|
|
|
GTK_PARAM_READWRITE));
|
2010-11-18 04:53:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2012-04-13 00:07:28 +00:00
|
|
|
|
* GtkCellView:cell-area:
|
2010-11-18 04:53:55 +00:00
|
|
|
|
*
|
|
|
|
|
* The #GtkCellArea rendering cells
|
|
|
|
|
*
|
2011-02-24 07:05:41 +00:00
|
|
|
|
* If no area is specified when creating the cell view with gtk_cell_view_new_with_context()
|
|
|
|
|
* a horizontally oriented #GtkCellAreaBox will be used.
|
|
|
|
|
*
|
2010-11-18 04:53:55 +00:00
|
|
|
|
* since 3.0
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_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));
|
|
|
|
|
|
|
|
|
|
/**
|
2012-04-13 00:07:28 +00:00
|
|
|
|
* GtkCellView:cell-area-context:
|
2010-11-18 04:53:55 +00:00
|
|
|
|
*
|
|
|
|
|
* The #GtkCellAreaContext used to compute the geometry of the cell view.
|
|
|
|
|
*
|
2010-12-03 09:55:24 +00:00
|
|
|
|
* A group of cell views can be assigned the same context in order to
|
|
|
|
|
* ensure the sizes and cell alignments match across all the views with
|
|
|
|
|
* the same context.
|
|
|
|
|
*
|
2010-12-15 08:17:45 +00:00
|
|
|
|
* #GtkComboBox menus uses this to assign the same context to all cell views
|
2011-02-23 09:26:21 +00:00
|
|
|
|
* in the menu items for a single menu (each submenu creates its own
|
2010-12-03 09:55:24 +00:00
|
|
|
|
* context since the size of each submenu does not depend on parent
|
|
|
|
|
* or sibling menus).
|
|
|
|
|
*
|
2010-11-18 04:53:55 +00:00
|
|
|
|
* since 3.0
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
2010-11-18 08:30:33 +00:00
|
|
|
|
PROP_CELL_AREA_CONTEXT,
|
2010-11-18 04:53:55 +00:00
|
|
|
|
g_param_spec_object ("cell-area-context",
|
|
|
|
|
P_("Cell Area Context"),
|
|
|
|
|
P_("The GtkCellAreaContext used to "
|
|
|
|
|
"compute the geometry of the cell view"),
|
|
|
|
|
GTK_TYPE_CELL_AREA_CONTEXT,
|
|
|
|
|
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
/**
|
2012-04-13 00:07:28 +00:00
|
|
|
|
* GtkCellView:draw-sensitive:
|
2010-11-24 05:59:55 +00:00
|
|
|
|
*
|
|
|
|
|
* Whether all cells should be draw as sensitive for this view regardless
|
|
|
|
|
* of the actual cell properties (used to make menus with submenus appear
|
|
|
|
|
* sensitive when the items in submenus might be insensitive).
|
|
|
|
|
*
|
|
|
|
|
* since 3.0
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_DRAW_SENSITIVE,
|
|
|
|
|
g_param_spec_boolean ("draw-sensitive",
|
|
|
|
|
P_("Draw Sensitive"),
|
|
|
|
|
P_("Whether to force cells to be drawn in a "
|
|
|
|
|
"sensitive state"),
|
|
|
|
|
FALSE,
|
2014-06-08 15:29:58 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2012-04-13 00:07:28 +00:00
|
|
|
|
* GtkCellView:fit-model:
|
2010-11-24 05:59:55 +00:00
|
|
|
|
*
|
|
|
|
|
* Whether the view should request enough space to always fit
|
|
|
|
|
* the size of every row in the model (used by the combo box to
|
2020-08-21 12:41:13 +00:00
|
|
|
|
* ensure the combo box size doesn't change when different items
|
2010-11-24 05:59:55 +00:00
|
|
|
|
* are selected).
|
|
|
|
|
*
|
|
|
|
|
* since 3.0
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_FIT_MODEL,
|
|
|
|
|
g_param_spec_boolean ("fit-model",
|
|
|
|
|
P_("Fit Model"),
|
|
|
|
|
P_("Whether to request enough space for "
|
|
|
|
|
"every row in the model"),
|
|
|
|
|
FALSE,
|
2014-06-08 15:29:58 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
2017-11-18 03:49:57 +00:00
|
|
|
|
gtk_widget_class_set_css_name (widget_class, I_("cellview"));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-08 02:13:57 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_buildable_add_child (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *type)
|
2018-03-08 02:13:57 +00:00
|
|
|
|
{
|
|
|
|
|
if (GTK_IS_CELL_RENDERER (child))
|
|
|
|
|
_gtk_cell_layout_buildable_add_child (buildable, builder, child, type);
|
|
|
|
|
else
|
|
|
|
|
parent_buildable_iface->add_child (buildable, builder, child, type);
|
|
|
|
|
}
|
|
|
|
|
|
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_cell_view_buildable_init (GtkBuildableIface *iface)
|
|
|
|
|
{
|
|
|
|
|
parent_buildable_iface = g_type_interface_peek_parent (iface);
|
2018-03-08 02:13:57 +00:00
|
|
|
|
iface->add_child = gtk_cell_view_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_view_buildable_custom_tag_start;
|
|
|
|
|
iface->custom_tag_end = gtk_cell_view_buildable_custom_tag_end;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_cell_layout_init (GtkCellLayoutIface *iface)
|
|
|
|
|
{
|
2010-11-18 04:53:55 +00:00
|
|
|
|
iface->get_area = gtk_cell_view_cell_layout_get_area;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_constructed (GObject *object)
|
2010-11-18 04:53:55 +00:00
|
|
|
|
{
|
2014-06-26 22:22:42 +00:00
|
|
|
|
GtkCellView *view = GTK_CELL_VIEW (object);
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (view);
|
2010-11-18 04:53:55 +00:00
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_cell_view_parent_class)->constructed (object);
|
2010-11-18 04:53:55 +00:00
|
|
|
|
|
2010-11-18 08:30:33 +00:00
|
|
|
|
if (!priv->area)
|
2010-11-18 04:53:55 +00:00
|
|
|
|
{
|
2011-01-31 22:34:37 +00:00
|
|
|
|
priv->area = gtk_cell_area_box_new ();
|
|
|
|
|
g_object_ref_sink (priv->area);
|
2010-11-18 04:53:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-18 08:30:33 +00:00
|
|
|
|
if (!priv->context)
|
|
|
|
|
priv->context = gtk_cell_area_create_context (priv->area);
|
2010-11-18 04:53:55 +00:00
|
|
|
|
|
2011-01-31 22:34:37 +00:00
|
|
|
|
priv->size_changed_id =
|
2010-11-20 07:30:51 +00:00
|
|
|
|
g_signal_connect (priv->context, "notify",
|
|
|
|
|
G_CALLBACK (context_size_changed_cb), view);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_get_property (GObject *object,
|
|
|
|
|
guint param_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
|
|
|
|
{
|
|
|
|
|
GtkCellView *view = GTK_CELL_VIEW (object);
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (view);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
|
|
switch (param_id)
|
|
|
|
|
{
|
2010-11-26 04:18:08 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_value_set_enum (value, priv->orientation);
|
2010-11-26 04:18:08 +00:00
|
|
|
|
break;
|
2010-11-24 05:59:55 +00:00
|
|
|
|
case PROP_MODEL:
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_value_set_object (value, priv->model);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_CELL_AREA:
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_value_set_object (value, priv->area);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_CELL_AREA_CONTEXT:
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_value_set_object (value, priv->context);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_DRAW_SENSITIVE:
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_value_set_boolean (value, priv->draw_sensitive);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_FIT_MODEL:
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_value_set_boolean (value, priv->fit_model);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
|
|
|
|
break;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_set_property (GObject *object,
|
|
|
|
|
guint param_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
|
|
|
|
{
|
|
|
|
|
GtkCellView *view = GTK_CELL_VIEW (object);
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (view);
|
2010-11-18 04:53:55 +00:00
|
|
|
|
GtkCellArea *area;
|
|
|
|
|
GtkCellAreaContext *context;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
|
|
switch (param_id)
|
|
|
|
|
{
|
2010-11-26 04:18:08 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
2014-06-08 15:29:32 +00:00
|
|
|
|
if (priv->orientation != g_value_get_enum (value))
|
|
|
|
|
{
|
|
|
|
|
priv->orientation = g_value_get_enum (value);
|
|
|
|
|
if (priv->context)
|
|
|
|
|
gtk_cell_area_context_reset (priv->context);
|
2020-04-23 16:48:29 +00:00
|
|
|
|
gtk_widget_update_orientation (GTK_WIDGET (object), priv->orientation);
|
2014-06-08 15:29:32 +00:00
|
|
|
|
g_object_notify_by_pspec (object, pspec);
|
|
|
|
|
}
|
2010-11-26 04:18:08 +00:00
|
|
|
|
break;
|
2010-11-24 05:59:55 +00:00
|
|
|
|
case PROP_MODEL:
|
|
|
|
|
gtk_cell_view_set_model (view, g_value_get_object (value));
|
|
|
|
|
break;
|
2010-11-18 04:53:55 +00:00
|
|
|
|
case PROP_CELL_AREA:
|
|
|
|
|
/* Construct-only, can only be assigned once */
|
|
|
|
|
area = g_value_get_object (value);
|
2011-01-31 22:34:37 +00:00
|
|
|
|
|
2010-11-18 04:53:55 +00:00
|
|
|
|
if (area)
|
2011-01-31 22:34:37 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->area != NULL)
|
|
|
|
|
{
|
|
|
|
|
g_warning ("cell-area has already been set, ignoring construct property");
|
|
|
|
|
g_object_ref_sink (area);
|
|
|
|
|
g_object_unref (area);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
priv->area = g_object_ref_sink (area);
|
|
|
|
|
}
|
2010-11-18 04:53:55 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_CELL_AREA_CONTEXT:
|
|
|
|
|
/* Construct-only, can only be assigned once */
|
|
|
|
|
context = g_value_get_object (value);
|
2011-01-31 22:34:37 +00:00
|
|
|
|
|
2010-11-18 04:53:55 +00:00
|
|
|
|
if (context)
|
2011-01-31 22:34:37 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->context != NULL)
|
|
|
|
|
{
|
|
|
|
|
g_warning ("cell-area-context has already been set, ignoring construct property");
|
|
|
|
|
g_object_ref_sink (context);
|
|
|
|
|
g_object_unref (context);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
priv->context = g_object_ref (context);
|
|
|
|
|
}
|
2010-11-18 04:53:55 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
case PROP_DRAW_SENSITIVE:
|
|
|
|
|
gtk_cell_view_set_draw_sensitive (view, g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PROP_FIT_MODEL:
|
|
|
|
|
gtk_cell_view_set_fit_model (view, g_value_get_boolean (value));
|
|
|
|
|
break;
|
|
|
|
|
|
2006-05-24 17:01:28 +00:00
|
|
|
|
default:
|
2003-09-26 21:57:06 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_init (GtkCellView *cellview)
|
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cellview);
|
|
|
|
|
|
|
|
|
|
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_finalize (GObject *object)
|
|
|
|
|
{
|
2004-07-22 02:26:07 +00:00
|
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (object);
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cellview);
|
2004-07-22 02:26:07 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->displayed_row)
|
|
|
|
|
gtk_tree_row_reference_free (priv->displayed_row);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2008-08-12 09:51:16 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_cell_view_parent_class)->finalize (object);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2010-11-18 04:53:55 +00:00
|
|
|
|
gtk_cell_view_dispose (GObject *object)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2010-11-18 04:53:55 +00:00
|
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (object);
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cellview);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2010-11-23 03:39:00 +00:00
|
|
|
|
gtk_cell_view_set_model (cellview, NULL);
|
2010-08-18 23:39:59 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_clear_object (&priv->area);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->context)
|
2010-08-18 23:39:59 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_signal_handler_disconnect (priv->context, priv->size_changed_id);
|
2010-11-20 07:30:51 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_object_unref (priv->context);
|
|
|
|
|
priv->context = NULL;
|
|
|
|
|
priv->size_changed_id = 0;
|
2010-08-18 23:39:59 +00:00
|
|
|
|
}
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2010-11-18 04:53:55 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_cell_view_parent_class)->dispose (object);
|
|
|
|
|
}
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2015-07-19 03:23:11 +00:00
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_cell_view_size_allocate (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline)
|
2015-07-19 03:23:11 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (widget);
|
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cellview);
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int alloc_width, alloc_height;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2010-11-18 08:30:33 +00:00
|
|
|
|
gtk_cell_area_context_get_allocation (priv->context, &alloc_width, &alloc_height);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
/* The first cell view in context is responsible for allocating the context at
|
|
|
|
|
* allocate time (or the cellview has its own context and is not grouped with
|
|
|
|
|
* any other cell views)
|
2010-11-24 09:27:51 +00:00
|
|
|
|
*
|
2015-12-17 00:07:26 +00:00
|
|
|
|
* If the cellview is in "fit model" mode, we assume it's not in context and
|
|
|
|
|
* needs to allocate every time.
|
2010-11-24 09:27:51 +00:00
|
|
|
|
*/
|
2010-11-26 04:18:08 +00:00
|
|
|
|
if (priv->fit_model)
|
2015-07-19 03:23:11 +00:00
|
|
|
|
gtk_cell_area_context_allocate (priv->context, width, height);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
else if (alloc_width != width && priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2015-07-19 03:23:11 +00:00
|
|
|
|
gtk_cell_area_context_allocate (priv->context, width, -1);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
else if (alloc_height != height && priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2015-07-19 03:23:11 +00:00
|
|
|
|
gtk_cell_area_context_allocate (priv->context, -1, height);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_request_model (GtkCellView *cellview,
|
|
|
|
|
GtkTreeIter *parent,
|
|
|
|
|
GtkOrientation orientation,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum_size,
|
|
|
|
|
int *natural_size)
|
2010-11-24 05:59:55 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cellview);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
gboolean valid;
|
|
|
|
|
|
2011-01-21 03:35:09 +00:00
|
|
|
|
if (!priv->model)
|
|
|
|
|
return;
|
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
valid = gtk_tree_model_iter_children (priv->model, &iter, parent);
|
|
|
|
|
while (valid)
|
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int min, nat;
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
|
|
|
|
gtk_cell_area_apply_attributes (priv->area, priv->model, &iter, FALSE, FALSE);
|
|
|
|
|
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
if (for_size < 0)
|
|
|
|
|
gtk_cell_area_get_preferred_width (priv->area, priv->context,
|
|
|
|
|
GTK_WIDGET (cellview), &min, &nat);
|
|
|
|
|
else
|
|
|
|
|
gtk_cell_area_get_preferred_width_for_height (priv->area, priv->context,
|
|
|
|
|
GTK_WIDGET (cellview), for_size, &min, &nat);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (for_size < 0)
|
|
|
|
|
gtk_cell_area_get_preferred_height (priv->area, priv->context,
|
|
|
|
|
GTK_WIDGET (cellview), &min, &nat);
|
|
|
|
|
else
|
|
|
|
|
gtk_cell_area_get_preferred_height_for_width (priv->area, priv->context,
|
|
|
|
|
GTK_WIDGET (cellview), for_size, &min, &nat);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*minimum_size = MAX (min, *minimum_size);
|
|
|
|
|
*natural_size = MAX (nat, *natural_size);
|
|
|
|
|
|
|
|
|
|
/* Recurse into children when they exist */
|
|
|
|
|
gtk_cell_view_request_model (cellview, &iter, orientation, for_size, minimum_size, natural_size);
|
|
|
|
|
|
|
|
|
|
valid = gtk_tree_model_iter_next (priv->model, &iter);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-05 08:49:49 +00:00
|
|
|
|
static GtkSizeRequestMode
|
|
|
|
|
gtk_cell_view_get_request_mode (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (widget);
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cellview);
|
2011-03-05 08:49:49 +00:00
|
|
|
|
|
|
|
|
|
return gtk_cell_area_get_request_mode (priv->area);
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
static void
|
2017-05-05 16:24:20 +00:00
|
|
|
|
gtk_cell_view_measure (GtkWidget *widget,
|
2016-10-22 14:06:14 +00:00
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline)
|
2015-12-17 00:07:26 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (widget);
|
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cellview);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
g_signal_handler_block (priv->context, priv->size_changed_id);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL && for_size == -1)
|
2010-11-24 05:59:55 +00:00
|
|
|
|
{
|
2015-12-17 00:07:26 +00:00
|
|
|
|
if (priv->fit_model)
|
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int min = 0, nat = 0;
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_request_model (cellview, NULL, GTK_ORIENTATION_HORIZONTAL, -1, &min, &nat);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->displayed_row)
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_set_cell_data (cellview);
|
2015-07-19 03:23:11 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_area_get_preferred_width (priv->area, priv->context, widget, NULL, NULL);
|
|
|
|
|
}
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_area_context_get_preferred_width (priv->context, minimum, natural);
|
|
|
|
|
}
|
|
|
|
|
else if (orientation == GTK_ORIENTATION_VERTICAL && for_size == -1)
|
|
|
|
|
{
|
|
|
|
|
if (priv->fit_model)
|
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int min = 0, nat = 0;
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_request_model (cellview, NULL, GTK_ORIENTATION_VERTICAL, -1, &min, &nat);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->displayed_row)
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_set_cell_data (cellview);
|
2015-07-19 03:23:11 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_area_get_preferred_height (priv->area, priv->context, widget, NULL, NULL);
|
|
|
|
|
}
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_area_context_get_preferred_height (priv->context, minimum, natural);
|
|
|
|
|
}
|
|
|
|
|
else if (orientation == GTK_ORIENTATION_HORIZONTAL && for_size >= 0)
|
2010-11-24 05:59:55 +00:00
|
|
|
|
{
|
2015-12-17 00:07:26 +00:00
|
|
|
|
if (priv->fit_model)
|
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int min = 0, nat = 0;
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_request_model (cellview, NULL, GTK_ORIENTATION_HORIZONTAL, for_size, &min, &nat);
|
|
|
|
|
|
|
|
|
|
*minimum = min;
|
|
|
|
|
*natural = nat;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->displayed_row)
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_set_cell_data (cellview);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_area_get_preferred_width_for_height (priv->area, priv->context, widget,
|
|
|
|
|
for_size, minimum, natural);
|
|
|
|
|
}
|
2010-11-24 05:59:55 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2015-12-17 00:07:26 +00:00
|
|
|
|
{
|
|
|
|
|
if (priv->fit_model)
|
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int min = 0, nat = 0;
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_request_model (cellview, NULL, GTK_ORIENTATION_VERTICAL, for_size, &min, &nat);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
*minimum = min;
|
|
|
|
|
*natural = nat;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->displayed_row)
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_set_cell_data (cellview);
|
|
|
|
|
|
|
|
|
|
gtk_cell_area_get_preferred_height_for_width (priv->area, priv->context, widget,
|
|
|
|
|
for_size, minimum, natural);
|
|
|
|
|
}
|
2010-11-24 05:59:55 +00:00
|
|
|
|
}
|
2015-07-19 03:23:11 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
g_signal_handler_unblock (priv->context, priv->size_changed_id);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-19 15:34:25 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_snapshot (GtkWidget *widget,
|
|
|
|
|
GtkSnapshot *snapshot)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (widget);
|
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cellview);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
GdkRectangle area;
|
2004-04-14 20:26:26 +00:00
|
|
|
|
GtkCellRendererState state;
|
2010-08-22 02:32:39 +00:00
|
|
|
|
|
2010-09-03 16:41:52 +00:00
|
|
|
|
/* render cells */
|
2017-06-18 13:45:42 +00:00
|
|
|
|
area.x = 0;
|
|
|
|
|
area.y = 0;
|
2017-12-06 06:56:12 +00:00
|
|
|
|
area.width = gtk_widget_get_width (widget);
|
|
|
|
|
area.height = gtk_widget_get_height (widget);
|
2010-08-11 21:15:42 +00:00
|
|
|
|
|
2004-03-14 00:01:23 +00:00
|
|
|
|
/* set cell data (if available) */
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->displayed_row)
|
2004-03-14 00:01:23 +00:00
|
|
|
|
gtk_cell_view_set_cell_data (cellview);
|
2019-05-27 02:14:03 +00:00
|
|
|
|
else if (priv->model)
|
2017-05-05 16:24:20 +00:00
|
|
|
|
return;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2011-01-04 01:19:29 +00:00
|
|
|
|
if (gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_PRELIGHT)
|
2004-04-14 20:26:26 +00:00
|
|
|
|
state = GTK_CELL_RENDERER_PRELIT;
|
|
|
|
|
else
|
|
|
|
|
state = 0;
|
2015-12-17 00:07:26 +00:00
|
|
|
|
|
2010-11-18 04:53:55 +00:00
|
|
|
|
/* Render the cells */
|
2019-05-27 02:14:03 +00:00
|
|
|
|
gtk_cell_area_snapshot (priv->area, priv->context,
|
2016-12-19 15:34:25 +00:00
|
|
|
|
widget, snapshot, &area, &area, state, FALSE);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2017-05-05 16:24:20 +00:00
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-11-29 18:43:41 +00:00
|
|
|
|
static void
|
2004-10-25 15:53:46 +00:00
|
|
|
|
gtk_cell_view_set_cell_data (GtkCellView *cell_view)
|
2003-10-01 20:51:54 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cell_view);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_return_if_fail (priv->displayed_row != NULL);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
path = gtk_tree_row_reference_get_path (priv->displayed_row);
|
2004-08-02 19:08:13 +00:00
|
|
|
|
if (!path)
|
|
|
|
|
return;
|
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
gtk_tree_model_get_iter (priv->model, &iter, path);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
gtk_cell_area_apply_attributes (priv->area,
|
|
|
|
|
priv->model,
|
2010-11-18 04:53:55 +00:00
|
|
|
|
&iter, FALSE, FALSE);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->draw_sensitive)
|
2010-11-24 05:59:55 +00:00
|
|
|
|
{
|
|
|
|
|
GList *l, *cells =
|
2019-05-27 02:14:03 +00:00
|
|
|
|
gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->area));
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
|
|
|
|
for (l = cells; l; l = l->next)
|
|
|
|
|
{
|
|
|
|
|
GObject *renderer = l->data;
|
|
|
|
|
|
|
|
|
|
g_object_set (renderer, "sensitive", TRUE, NULL);
|
|
|
|
|
}
|
|
|
|
|
g_list_free (cells);
|
|
|
|
|
}
|
2003-10-01 20:51:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* GtkCellLayout implementation */
|
2010-11-18 04:53:55 +00:00
|
|
|
|
static GtkCellArea *
|
|
|
|
|
gtk_cell_view_cell_layout_get_area (GtkCellLayout *layout)
|
|
|
|
|
{
|
|
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (layout);
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cellview);
|
2011-01-31 22:34:37 +00:00
|
|
|
|
|
|
|
|
|
if (G_UNLIKELY (!priv->area))
|
|
|
|
|
{
|
|
|
|
|
priv->area = gtk_cell_area_box_new ();
|
|
|
|
|
g_object_ref_sink (priv->area);
|
|
|
|
|
}
|
2003-12-19 22:47:20 +00:00
|
|
|
|
|
2011-01-31 22:34:37 +00:00
|
|
|
|
return priv->area;
|
2003-12-19 22:47:20 +00:00
|
|
|
|
}
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
/* GtkBuildable implementation */
|
|
|
|
|
static gboolean
|
2019-08-29 13:21:20 +00:00
|
|
|
|
gtk_cell_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *tagname,
|
2019-08-29 13:21:20 +00:00
|
|
|
|
GtkBuildableParser *parser,
|
|
|
|
|
gpointer *data)
|
2010-11-24 05:59:55 +00:00
|
|
|
|
{
|
|
|
|
|
if (parent_buildable_iface->custom_tag_start &&
|
|
|
|
|
parent_buildable_iface->custom_tag_start (buildable, builder, child,
|
|
|
|
|
tagname, parser, data))
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
|
|
return _gtk_cell_layout_buildable_custom_tag_start (buildable, builder, child,
|
|
|
|
|
tagname, parser, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_buildable_custom_tag_end (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *tagname,
|
2018-10-07 22:34:43 +00:00
|
|
|
|
gpointer data)
|
2010-11-24 05:59:55 +00:00
|
|
|
|
{
|
2010-12-04 08:14:32 +00:00
|
|
|
|
if (_gtk_cell_layout_buildable_custom_tag_end (buildable, builder, child, tagname,
|
|
|
|
|
data))
|
|
|
|
|
return;
|
2010-11-24 05:59:55 +00:00
|
|
|
|
else if (parent_buildable_iface->custom_tag_end)
|
|
|
|
|
parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
|
|
|
|
|
data);
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-20 07:30:51 +00:00
|
|
|
|
static void
|
|
|
|
|
context_size_changed_cb (GtkCellAreaContext *context,
|
|
|
|
|
GParamSpec *pspec,
|
|
|
|
|
GtkWidget *view)
|
|
|
|
|
{
|
|
|
|
|
if (!strcmp (pspec->name, "minimum-width") ||
|
|
|
|
|
!strcmp (pspec->name, "natural-width") ||
|
|
|
|
|
!strcmp (pspec->name, "minimum-height") ||
|
|
|
|
|
!strcmp (pspec->name, "natural-height"))
|
|
|
|
|
gtk_widget_queue_resize (view);
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-22 06:51:51 +00:00
|
|
|
|
static void
|
|
|
|
|
row_changed_cb (GtkTreeModel *model,
|
|
|
|
|
GtkTreePath *path,
|
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
|
GtkCellView *view)
|
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (view);
|
2010-11-22 06:51:51 +00:00
|
|
|
|
GtkTreePath *row_path;
|
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->displayed_row)
|
2010-11-22 06:51:51 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
row_path = gtk_tree_row_reference_get_path (priv->displayed_row);
|
2010-11-22 06:51:51 +00:00
|
|
|
|
|
2010-11-24 09:14:36 +00:00
|
|
|
|
if (row_path)
|
|
|
|
|
{
|
|
|
|
|
/* Resize everything in our context if our row changed */
|
|
|
|
|
if (gtk_tree_path_compare (row_path, path) == 0)
|
2019-05-27 02:14:03 +00:00
|
|
|
|
gtk_cell_area_context_reset (priv->context);
|
2010-11-24 09:14:36 +00:00
|
|
|
|
|
|
|
|
|
gtk_tree_path_free (row_path);
|
|
|
|
|
}
|
2010-11-22 06:51:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2010-11-20 07:30:51 +00:00
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_new:
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GtkCellView widget.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A newly created #GtkCellView widget.
|
2004-10-09 05:39:22 +00:00
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_cell_view_new (void)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2003-10-01 20:51:54 +00:00
|
|
|
|
GtkCellView *cellview;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
cellview = g_object_new (GTK_TYPE_CELL_VIEW, NULL);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
|
return GTK_WIDGET (cellview);
|
|
|
|
|
}
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2010-11-18 06:21:41 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_new_with_context:
|
|
|
|
|
* @area: the #GtkCellArea to layout cells
|
|
|
|
|
* @context: the #GtkCellAreaContext in which to calculate cell geometry
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GtkCellView widget with a specific #GtkCellArea
|
|
|
|
|
* to layout cells and a specific #GtkCellAreaContext.
|
|
|
|
|
*
|
2020-08-21 12:41:13 +00:00
|
|
|
|
* Specifying the same context for a handful of cells lets
|
2010-11-18 06:21:41 +00:00
|
|
|
|
* the underlying area synchronize the geometry for those cells,
|
|
|
|
|
* in this way alignments with cellviews for other rows are
|
|
|
|
|
* possible.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A newly created #GtkCellView widget.
|
2010-11-18 06:21:41 +00:00
|
|
|
|
*/
|
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_cell_view_new_with_context (GtkCellArea *area,
|
|
|
|
|
GtkCellAreaContext *context)
|
|
|
|
|
{
|
2010-11-18 08:30:33 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_AREA (area), NULL);
|
|
|
|
|
g_return_val_if_fail (context == NULL || GTK_IS_CELL_AREA_CONTEXT (context), NULL);
|
|
|
|
|
|
2010-11-18 06:21:41 +00:00
|
|
|
|
return (GtkWidget *)g_object_new (GTK_TYPE_CELL_VIEW,
|
|
|
|
|
"cell-area", area,
|
|
|
|
|
"cell-area-context", context,
|
|
|
|
|
NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_new_with_text:
|
|
|
|
|
* @text: the text to display in the cell view
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GtkCellView widget, adds a #GtkCellRendererText
|
2012-02-29 17:19:55 +00:00
|
|
|
|
* to it, and makes it show @text.
|
2004-10-09 05:39:22 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A newly created #GtkCellView widget.
|
2004-10-09 05:39:22 +00:00
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
|
GtkWidget *
|
2020-07-24 18:40:36 +00:00
|
|
|
|
gtk_cell_view_new_with_text (const char *text)
|
2003-10-01 20:51:54 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCellView *cellview;
|
|
|
|
|
GtkCellRenderer *renderer;
|
2011-09-30 15:31:04 +00:00
|
|
|
|
GValue value = G_VALUE_INIT;
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
|
|
|
|
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
|
|
|
|
|
|
|
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2010-11-22 07:29:26 +00:00
|
|
|
|
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cellview),
|
|
|
|
|
renderer, TRUE);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
|
|
|
|
g_value_init (&value, G_TYPE_STRING);
|
|
|
|
|
g_value_set_string (&value, text);
|
2004-12-15 16:27:30 +00:00
|
|
|
|
gtk_cell_view_set_value (cellview, renderer, "text", &value);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
|
|
return GTK_WIDGET (cellview);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_new_with_markup:
|
|
|
|
|
* @markup: the text to display in the cell view
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GtkCellView widget, adds a #GtkCellRendererText
|
2010-03-28 02:21:47 +00:00
|
|
|
|
* to it, and makes it show @markup. The text can be
|
2014-02-07 02:07:03 +00:00
|
|
|
|
* marked up with the [Pango text markup language][PangoMarkupFormat].
|
2004-10-09 05:39:22 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A newly created #GtkCellView widget.
|
2004-10-09 05:39:22 +00:00
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
|
GtkWidget *
|
2020-07-24 18:40:36 +00:00
|
|
|
|
gtk_cell_view_new_with_markup (const char *markup)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2003-10-01 20:51:54 +00:00
|
|
|
|
GtkCellView *cellview;
|
|
|
|
|
GtkCellRenderer *renderer;
|
2011-09-30 15:31:04 +00:00
|
|
|
|
GValue value = G_VALUE_INIT;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
|
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2010-11-22 07:29:26 +00:00
|
|
|
|
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cellview),
|
|
|
|
|
renderer, TRUE);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
|
|
|
|
g_value_init (&value, G_TYPE_STRING);
|
|
|
|
|
g_value_set_string (&value, markup);
|
2004-12-15 16:27:30 +00:00
|
|
|
|
gtk_cell_view_set_value (cellview, renderer, "markup", &value);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
|
|
return GTK_WIDGET (cellview);
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-30 00:28:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_new_with_texture:
|
|
|
|
|
* @texture: the image to display in the cell view
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #GtkCellView widget, adds a #GtkCellRendererPixbuf
|
|
|
|
|
* to it, and makes it show @texture.
|
|
|
|
|
*
|
|
|
|
|
* Returns: A newly created #GtkCellView widget.
|
|
|
|
|
*/
|
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_cell_view_new_with_texture (GdkTexture *texture)
|
|
|
|
|
{
|
|
|
|
|
GtkCellView *cellview;
|
|
|
|
|
GtkCellRenderer *renderer;
|
|
|
|
|
GValue value = G_VALUE_INIT;
|
|
|
|
|
|
|
|
|
|
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
|
|
|
|
|
|
|
|
|
|
renderer = gtk_cell_renderer_pixbuf_new ();
|
|
|
|
|
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cellview),
|
|
|
|
|
renderer, TRUE);
|
|
|
|
|
|
|
|
|
|
g_value_init (&value, GDK_TYPE_TEXTURE);
|
|
|
|
|
g_value_set_object (&value, texture);
|
|
|
|
|
gtk_cell_view_set_value (cellview, renderer, "texture", &value);
|
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
|
|
return GTK_WIDGET (cellview);
|
|
|
|
|
}
|
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_set_value:
|
|
|
|
|
* @cell_view: a #GtkCellView widget
|
|
|
|
|
* @renderer: one of the renderers of @cell_view
|
|
|
|
|
* @property: the name of the property of @renderer to set
|
|
|
|
|
* @value: the new value to set the property to
|
|
|
|
|
*
|
|
|
|
|
* Sets a property of a cell renderer of @cell_view, and
|
|
|
|
|
* makes sure the display of @cell_view is updated.
|
|
|
|
|
*/
|
2004-12-15 16:27:30 +00:00
|
|
|
|
static void
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
gtk_cell_view_set_value (GtkCellView *cell_view,
|
2003-09-26 21:57:06 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2016-10-15 20:27:23 +00:00
|
|
|
|
const char *property,
|
2003-09-26 21:57:06 +00:00
|
|
|
|
GValue *value)
|
|
|
|
|
{
|
|
|
|
|
g_object_set_property (G_OBJECT (renderer), property, value);
|
|
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
/* force resize and redraw */
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (cell_view));
|
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_set_model:
|
|
|
|
|
* @cell_view: a #GtkCellView
|
2009-12-10 10:23:40 +00:00
|
|
|
|
* @model: (allow-none): a #GtkTreeModel
|
2004-10-09 05:39:22 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets the model for @cell_view. If @cell_view already has a model
|
2009-12-10 10:23:40 +00:00
|
|
|
|
* set, it will remove it before setting the new model. If @model is
|
2004-10-09 05:39:22 +00:00
|
|
|
|
* %NULL, then it will unset the old model.
|
|
|
|
|
*/
|
2003-09-26 21:57:06 +00:00
|
|
|
|
void
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
gtk_cell_view_set_model (GtkCellView *cell_view,
|
2003-09-26 21:57:06 +00:00
|
|
|
|
GtkTreeModel *model)
|
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cell_view);
|
|
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
|
2006-12-27 07:17:53 +00:00
|
|
|
|
g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->model)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_signal_handler_disconnect (priv->model, priv->row_changed_id);
|
|
|
|
|
priv->row_changed_id = 0;
|
2010-11-22 06:51:51 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->displayed_row)
|
|
|
|
|
gtk_tree_row_reference_free (priv->displayed_row);
|
|
|
|
|
priv->displayed_row = NULL;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_object_unref (priv->model);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
priv->model = model;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->model)
|
2010-11-22 06:51:51 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_object_ref (priv->model);
|
2010-11-22 06:51:51 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
priv->row_changed_id =
|
|
|
|
|
g_signal_connect (priv->model, "row-changed",
|
2010-11-22 06:51:51 +00:00
|
|
|
|
G_CALLBACK (row_changed_cb), cell_view);
|
|
|
|
|
}
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-10-06 21:15:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_get_model:
|
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
|
*
|
|
|
|
|
* Returns the model for @cell_view. If no model is used %NULL is
|
|
|
|
|
* returned.
|
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): a #GtkTreeModel used or %NULL
|
2008-10-06 21:15:45 +00:00
|
|
|
|
**/
|
|
|
|
|
GtkTreeModel *
|
|
|
|
|
gtk_cell_view_get_model (GtkCellView *cell_view)
|
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cell_view);
|
|
|
|
|
|
2008-10-06 21:15:45 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), NULL);
|
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
return priv->model;
|
2008-10-06 21:15:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-03-02 18:56:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_set_displayed_row:
|
|
|
|
|
* @cell_view: a #GtkCellView
|
2009-12-10 10:23:40 +00:00
|
|
|
|
* @path: (allow-none): a #GtkTreePath or %NULL to unset.
|
|
|
|
|
*
|
2004-03-02 18:56:10 +00:00
|
|
|
|
* Sets the row of the model that is currently displayed
|
|
|
|
|
* by the #GtkCellView. If the path is unset, then the
|
2014-02-05 18:07:34 +00:00
|
|
|
|
* contents of the cellview “stick” at their last value;
|
2004-03-02 18:56:10 +00:00
|
|
|
|
* this is not normally a desired result, but may be
|
|
|
|
|
* a needed intermediate state if say, the model for
|
|
|
|
|
* the #GtkCellView becomes temporarily empty.
|
|
|
|
|
**/
|
2003-09-26 21:57:06 +00:00
|
|
|
|
void
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
gtk_cell_view_set_displayed_row (GtkCellView *cell_view,
|
2003-09-26 21:57:06 +00:00
|
|
|
|
GtkTreePath *path)
|
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cell_view);
|
|
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
|
2019-05-27 02:14:03 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_TREE_MODEL (priv->model));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (priv->displayed_row)
|
|
|
|
|
gtk_tree_row_reference_free (priv->displayed_row);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2004-03-02 18:56:10 +00:00
|
|
|
|
if (path)
|
2019-05-27 02:14:03 +00:00
|
|
|
|
priv->displayed_row = gtk_tree_row_reference_new (priv->model, path);
|
2004-03-02 18:56:10 +00:00
|
|
|
|
else
|
2019-05-27 02:14:03 +00:00
|
|
|
|
priv->displayed_row = NULL;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
/* force resize and redraw */
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (cell_view));
|
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-03-20 07:01:23 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_get_displayed_row:
|
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
|
*
|
|
|
|
|
* Returns a #GtkTreePath referring to the currently
|
|
|
|
|
* displayed row. If no row is currently displayed,
|
|
|
|
|
* %NULL is returned.
|
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer full): the currently displayed row or %NULL
|
2005-03-20 07:01:23 +00:00
|
|
|
|
*/
|
2003-09-26 21:57:06 +00:00
|
|
|
|
GtkTreePath *
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
gtk_cell_view_get_displayed_row (GtkCellView *cell_view)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cell_view);
|
|
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), NULL);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
if (!priv->displayed_row)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
return gtk_tree_row_reference_get_path (priv->displayed_row);
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-03 09:43:37 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_get_draw_sensitive:
|
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
|
*
|
2011-02-23 09:26:21 +00:00
|
|
|
|
* Gets whether @cell_view is configured to draw all of its
|
2010-12-03 09:43:37 +00:00
|
|
|
|
* cells in a sensitive state.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: whether @cell_view draws all of its
|
2010-12-03 09:43:37 +00:00
|
|
|
|
* cells in a sensitive state
|
|
|
|
|
*/
|
2010-11-24 05:59:55 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_cell_view_get_draw_sensitive (GtkCellView *cell_view)
|
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
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cell_view);
|
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
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), FALSE);
|
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
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
return priv->draw_sensitive;
|
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
|
|
|
|
}
|
2010-08-18 23:39:59 +00:00
|
|
|
|
|
2010-12-03 09:43:37 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_set_draw_sensitive:
|
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
|
* @draw_sensitive: whether to draw all cells in a sensitive state.
|
|
|
|
|
*
|
2011-02-23 09:26:21 +00:00
|
|
|
|
* Sets whether @cell_view should draw all of its
|
2010-12-15 08:17:45 +00:00
|
|
|
|
* cells in a sensitive state, this is used by #GtkComboBox menus
|
2010-12-03 09:43:37 +00:00
|
|
|
|
* to ensure that rows with insensitive cells that contain
|
|
|
|
|
* children appear sensitive in the parent menu item.
|
|
|
|
|
*/
|
2010-11-24 05:59:55 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_cell_view_set_draw_sensitive (GtkCellView *cell_view,
|
|
|
|
|
gboolean draw_sensitive)
|
2010-08-18 23:39:59 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cell_view);
|
2010-08-18 23:39:59 +00:00
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
|
2010-11-20 07:30:51 +00:00
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
if (priv->draw_sensitive != draw_sensitive)
|
|
|
|
|
{
|
|
|
|
|
priv->draw_sensitive = draw_sensitive;
|
2010-11-20 07:30:51 +00:00
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
g_object_notify (G_OBJECT (cell_view), "draw-sensitive");
|
|
|
|
|
}
|
2010-08-18 23:39:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-03 09:43:37 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_get_fit_model:
|
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
|
*
|
|
|
|
|
* Gets whether @cell_view is configured to request space
|
|
|
|
|
* to fit the entire #GtkTreeModel.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: whether @cell_view requests space to fit
|
2010-12-03 09:43:37 +00:00
|
|
|
|
* the entire #GtkTreeModel.
|
|
|
|
|
*/
|
2010-11-24 05:59:55 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_cell_view_get_fit_model (GtkCellView *cell_view)
|
2010-08-18 23:39:59 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cell_view);
|
2010-11-18 04:53:55 +00:00
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), FALSE);
|
2010-11-20 07:30:51 +00:00
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
return priv->fit_model;
|
2010-08-18 23:39:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-03 09:43:37 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_set_fit_model:
|
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
|
* @fit_model: whether @cell_view should request space for the whole model.
|
|
|
|
|
*
|
|
|
|
|
* Sets whether @cell_view should request space to fit the entire #GtkTreeModel.
|
|
|
|
|
*
|
|
|
|
|
* This is used by #GtkComboBox to ensure that the cell view displayed on
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* the combo box’s button always gets enough space and does not resize
|
2010-12-03 09:43:37 +00:00
|
|
|
|
* when selection changes.
|
|
|
|
|
*/
|
2010-11-24 05:59:55 +00:00
|
|
|
|
void
|
2011-01-31 22:34:37 +00:00
|
|
|
|
gtk_cell_view_set_fit_model (GtkCellView *cell_view,
|
|
|
|
|
gboolean fit_model)
|
2010-08-18 23:39:59 +00:00
|
|
|
|
{
|
2019-05-27 02:14:03 +00:00
|
|
|
|
GtkCellViewPrivate *priv = gtk_cell_view_get_instance_private (cell_view);
|
2010-11-18 04:53:55 +00:00
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
|
2010-11-18 04:53:55 +00:00
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
if (priv->fit_model != fit_model)
|
|
|
|
|
{
|
|
|
|
|
priv->fit_model = fit_model;
|
2010-08-18 23:39:59 +00:00
|
|
|
|
|
2019-05-27 02:14:03 +00:00
|
|
|
|
gtk_cell_area_context_reset (priv->context);
|
2010-08-18 23:39:59 +00:00
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
g_object_notify (G_OBJECT (cell_view), "fit-model");
|
|
|
|
|
}
|
2010-08-18 23:39:59 +00:00
|
|
|
|
}
|