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"
|
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
|
|
|
|
#include <string.h>
|
2003-10-23 18:25:53 +00:00
|
|
|
|
#include "gtkcellview.h"
|
|
|
|
|
#include "gtkcelllayout.h"
|
2010-11-18 04:53:55 +00:00
|
|
|
|
#include "gtkcellareabox.h"
|
2003-10-23 18:25:53 +00:00
|
|
|
|
#include "gtkintl.h"
|
|
|
|
|
#include "gtkcellrenderertext.h"
|
|
|
|
|
#include "gtkcellrendererpixbuf.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
|
#include "gtkprivate.h"
|
2011-01-30 08:12:49 +00:00
|
|
|
|
#include "gtkorientableprivate.h"
|
2015-07-19 03:23:11 +00:00
|
|
|
|
#include "gtkrender.h"
|
2015-12-17 00:07:26 +00:00
|
|
|
|
#include "gtkcsscustomgadgetprivate.h"
|
|
|
|
|
#include "gtkwidgetprivate.h"
|
2003-09-26 21:57:06 +00:00
|
|
|
|
#include <gobject/gmarshal.h>
|
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
|
|
|
|
#include "gtkbuildable.h"
|
2010-07-09 17:22:23 +00:00
|
|
|
|
|
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
|
2010-12-15 08:17:45 +00:00
|
|
|
|
* be properly aligned with eachother (like the aligned cells in the menus
|
|
|
|
|
* 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);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
static void gtk_cell_view_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation);
|
2010-09-03 16:41:52 +00:00
|
|
|
|
static gboolean gtk_cell_view_draw (GtkWidget *widget,
|
|
|
|
|
cairo_t *cr);
|
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 */
|
|
|
|
|
static void gtk_cell_view_buildable_init (GtkBuildableIface *iface);
|
|
|
|
|
static gboolean gtk_cell_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
|
|
|
|
const gchar *tagname,
|
|
|
|
|
GMarkupParser *parser,
|
|
|
|
|
gpointer *data);
|
|
|
|
|
static void gtk_cell_view_buildable_custom_tag_end (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
|
|
|
|
const gchar *tagname,
|
|
|
|
|
gpointer *data);
|
|
|
|
|
|
2011-03-05 08:49:49 +00:00
|
|
|
|
static GtkSizeRequestMode gtk_cell_view_get_request_mode (GtkWidget *widget);
|
2016-10-22 14:06:14 +00:00
|
|
|
|
static void gtk_cell_view_measure_ (GtkWidget *widget,
|
|
|
|
|
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
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
static void gtk_cell_view_measure (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static void gtk_cell_view_allocate (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static gboolean gtk_cell_view_render (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer data);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
|
|
|
|
struct _GtkCellViewPrivate
|
|
|
|
|
{
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
GtkTreeRowReference *displayed_row;
|
|
|
|
|
|
|
|
|
|
GtkCellArea *area;
|
|
|
|
|
GtkCellAreaContext *context;
|
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
GtkCssGadget *gadget;
|
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
GdkRGBA background;
|
|
|
|
|
|
|
|
|
|
gulong size_changed_id;
|
|
|
|
|
gulong row_changed_id;
|
|
|
|
|
|
2011-04-12 16:32:04 +00:00
|
|
|
|
GtkOrientation orientation;
|
|
|
|
|
|
|
|
|
|
guint background_set : 1;
|
|
|
|
|
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,
|
2003-09-26 21:57:06 +00:00
|
|
|
|
PROP_BACKGROUND,
|
2010-10-22 11:01:54 +00:00
|
|
|
|
PROP_BACKGROUND_RGBA,
|
2006-05-24 17:01:28 +00:00
|
|
|
|
PROP_BACKGROUND_SET,
|
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
|
|
|
|
|
2010-09-21 14:35:17 +00:00
|
|
|
|
widget_class->draw = gtk_cell_view_draw;
|
|
|
|
|
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;
|
2016-10-22 14:06:14 +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");
|
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_BACKGROUND,
|
|
|
|
|
g_param_spec_string ("background",
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Background color name"),
|
|
|
|
|
P_("Background color as a string"),
|
2003-09-26 21:57:06 +00:00
|
|
|
|
NULL,
|
2005-03-22 02:14:55 +00:00
|
|
|
|
GTK_PARAM_WRITABLE));
|
2011-12-13 11:02:13 +00:00
|
|
|
|
|
2010-10-22 11:01:54 +00:00
|
|
|
|
/**
|
2012-04-13 00:07:28 +00:00
|
|
|
|
* GtkCellView:background-rgba:
|
2010-10-22 11:01:54 +00:00
|
|
|
|
*
|
|
|
|
|
* The background color as a #GdkRGBA
|
|
|
|
|
*
|
|
|
|
|
* Since: 3.0
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_BACKGROUND_RGBA,
|
|
|
|
|
g_param_spec_boxed ("background-rgba",
|
|
|
|
|
P_("Background RGBA color"),
|
|
|
|
|
P_("Background color as a GdkRGBA"),
|
|
|
|
|
GDK_TYPE_RGBA,
|
|
|
|
|
GTK_PARAM_READWRITE));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
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
|
|
|
|
|
* ensure the combo box size doesnt change when different items
|
|
|
|
|
* 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
|
|
|
|
|
2006-05-24 17:01:28 +00:00
|
|
|
|
|
2005-03-22 02:14:55 +00:00
|
|
|
|
#define ADD_SET_PROP(propname, propval, nick, blurb) g_object_class_install_property (gobject_class, propval, g_param_spec_boolean (propname, nick, blurb, FALSE, GTK_PARAM_READWRITE))
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2005-03-09 06:15:13 +00:00
|
|
|
|
ADD_SET_PROP ("background-set", PROP_BACKGROUND_SET,
|
2004-01-16 23:10:05 +00:00
|
|
|
|
P_("Background set"),
|
|
|
|
|
P_("Whether this tag affects the background color"));
|
2015-11-11 01:45:42 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_class_set_css_name (widget_class, "cellview");
|
2003-09-26 21:57:06 +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 void
|
|
|
|
|
gtk_cell_view_buildable_init (GtkBuildableIface *iface)
|
|
|
|
|
{
|
|
|
|
|
parent_buildable_iface = g_type_interface_peek_parent (iface);
|
2007-06-19 12:23:36 +00:00
|
|
|
|
iface->add_child = _gtk_cell_layout_buildable_add_child;
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
iface->custom_tag_start = gtk_cell_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);
|
|
|
|
|
GtkCellViewPrivate *priv = view->priv;
|
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);
|
|
|
|
|
|
|
|
|
|
switch (param_id)
|
|
|
|
|
{
|
2010-11-26 04:18:08 +00:00
|
|
|
|
case PROP_ORIENTATION:
|
|
|
|
|
g_value_set_enum (value, view->priv->orientation);
|
|
|
|
|
break;
|
2010-11-24 05:59:55 +00:00
|
|
|
|
case PROP_BACKGROUND_RGBA:
|
|
|
|
|
g_value_set_boxed (value, &view->priv->background);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_BACKGROUND_SET:
|
|
|
|
|
g_value_set_boolean (value, view->priv->background_set);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_MODEL:
|
|
|
|
|
g_value_set_object (value, view->priv->model);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_CELL_AREA:
|
|
|
|
|
g_value_set_object (value, view->priv->area);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_CELL_AREA_CONTEXT:
|
|
|
|
|
g_value_set_object (value, view->priv->context);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DRAW_SENSITIVE:
|
|
|
|
|
g_value_set_boolean (value, view->priv->draw_sensitive);
|
|
|
|
|
break;
|
|
|
|
|
case PROP_FIT_MODEL:
|
|
|
|
|
g_value_set_boolean (value, view->priv->fit_model);
|
|
|
|
|
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);
|
2011-01-31 22:34:37 +00:00
|
|
|
|
GtkCellViewPrivate *priv = view->priv;
|
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);
|
|
|
|
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (object));
|
|
|
|
|
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_BACKGROUND:
|
|
|
|
|
{
|
2011-12-19 13:48:16 +00:00
|
|
|
|
GdkRGBA color;
|
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
if (!g_value_get_string (value))
|
2011-12-19 13:48:16 +00:00
|
|
|
|
gtk_cell_view_set_background_rgba (view, NULL);
|
|
|
|
|
else if (gdk_rgba_parse (&color, g_value_get_string (value)))
|
|
|
|
|
gtk_cell_view_set_background_rgba (view, &color);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
else
|
2015-09-20 06:32:48 +00:00
|
|
|
|
g_warning ("Don't know color '%s'", g_value_get_string (value));
|
2011-12-19 13:48:16 +00:00
|
|
|
|
|
|
|
|
|
g_object_notify (object, "background-rgba");
|
2012-01-03 16:23:38 +00:00
|
|
|
|
}
|
2010-11-24 05:59:55 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_BACKGROUND_RGBA:
|
|
|
|
|
gtk_cell_view_set_background_rgba (view, g_value_get_boxed (value));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_BACKGROUND_SET:
|
|
|
|
|
view->priv->background_set = g_value_get_boolean (value);
|
|
|
|
|
break;
|
|
|
|
|
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)
|
|
|
|
|
{
|
2015-12-17 00:07:26 +00:00
|
|
|
|
GtkCssNode *widget_node;
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
cellview->priv = gtk_cell_view_get_instance_private (cellview);
|
|
|
|
|
cellview->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2010-06-01 21:38:52 +00:00
|
|
|
|
gtk_widget_set_has_window (GTK_WIDGET (cellview), FALSE);
|
2015-12-17 00:07:26 +00:00
|
|
|
|
|
|
|
|
|
widget_node = gtk_widget_get_css_node (GTK_WIDGET (cellview));
|
|
|
|
|
cellview->priv->gadget = gtk_css_custom_gadget_new_for_node (widget_node,
|
|
|
|
|
GTK_WIDGET (cellview),
|
|
|
|
|
gtk_cell_view_measure,
|
|
|
|
|
gtk_cell_view_allocate,
|
|
|
|
|
gtk_cell_view_render,
|
|
|
|
|
NULL,
|
2016-11-13 20:08:34 +00:00
|
|
|
|
NULL,
|
2015-12-17 00:07:26 +00:00
|
|
|
|
NULL);
|
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);
|
|
|
|
|
|
|
|
|
|
if (cellview->priv->displayed_row)
|
|
|
|
|
gtk_tree_row_reference_free (cellview->priv->displayed_row);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
g_clear_object (&cellview->priv->gadget);
|
|
|
|
|
|
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);
|
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
|
|
|
|
|
2010-11-18 08:30:33 +00:00
|
|
|
|
if (cellview->priv->area)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2010-11-18 08:30:33 +00:00
|
|
|
|
g_object_unref (cellview->priv->area);
|
|
|
|
|
cellview->priv->area = NULL;
|
2010-08-18 23:39:59 +00:00
|
|
|
|
}
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2010-11-18 08:30:33 +00:00
|
|
|
|
if (cellview->priv->context)
|
2010-08-18 23:39:59 +00:00
|
|
|
|
{
|
2010-11-20 07:30:51 +00:00
|
|
|
|
g_signal_handler_disconnect (cellview->priv->context, cellview->priv->size_changed_id);
|
|
|
|
|
|
2010-11-18 08:30:33 +00:00
|
|
|
|
g_object_unref (cellview->priv->context);
|
|
|
|
|
cellview->priv->context = NULL;
|
2010-11-20 07:30:51 +00:00
|
|
|
|
cellview->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
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_size_allocate (GtkWidget *widget,
|
|
|
|
|
GtkAllocation *allocation)
|
2015-07-19 03:23:11 +00:00
|
|
|
|
{
|
2015-12-17 00:07:26 +00:00
|
|
|
|
GtkAllocation clip;
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_allocation (widget, allocation);
|
|
|
|
|
|
|
|
|
|
gtk_css_gadget_allocate (GTK_CELL_VIEW (widget)->priv->gadget,
|
|
|
|
|
allocation,
|
|
|
|
|
gtk_widget_get_allocated_baseline (widget),
|
|
|
|
|
&clip);
|
|
|
|
|
|
|
|
|
|
gtk_widget_set_clip (widget, &clip);
|
2015-07-19 03:23:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-18 04:53:55 +00:00
|
|
|
|
static void
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_view_allocate (GtkCssGadget *gadget,
|
|
|
|
|
const GtkAllocation *allocation,
|
|
|
|
|
int baseline,
|
|
|
|
|
GtkAllocation *out_clip,
|
|
|
|
|
gpointer data)
|
2010-11-18 04:53:55 +00:00
|
|
|
|
{
|
2015-12-17 00:07:26 +00:00
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkCellView *cellview;
|
|
|
|
|
GtkCellViewPrivate *priv;
|
|
|
|
|
gint alloc_width, alloc_height, width, height;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
cellview = GTK_CELL_VIEW (widget);
|
|
|
|
|
priv = cellview->priv;
|
2010-08-18 23:39:59 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
width = allocation->width;
|
|
|
|
|
height = allocation->height;
|
2015-07-19 03:23:11 +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);
|
2010-11-27 07:32:36 +00:00
|
|
|
|
else if (alloc_width != allocation->width && priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
2015-07-19 03:23:11 +00:00
|
|
|
|
gtk_cell_area_context_allocate (priv->context, width, -1);
|
2010-11-27 07:32:36 +00:00
|
|
|
|
else if (alloc_height != allocation->height && priv->orientation == GTK_ORIENTATION_VERTICAL)
|
2015-07-19 03:23:11 +00:00
|
|
|
|
gtk_cell_area_context_allocate (priv->context, -1, height);
|
2015-12-17 00:07:26 +00:00
|
|
|
|
|
|
|
|
|
*out_clip = *allocation;
|
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,
|
|
|
|
|
gint for_size,
|
|
|
|
|
gint *minimum_size,
|
|
|
|
|
gint *natural_size)
|
|
|
|
|
{
|
|
|
|
|
GtkCellViewPrivate *priv = cellview->priv;
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
gint min, nat;
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
GtkCellViewPrivate *priv = cellview->priv;
|
|
|
|
|
|
|
|
|
|
return gtk_cell_area_get_request_mode (priv->area);
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
static void
|
2016-10-22 14:06:14 +00:00
|
|
|
|
gtk_cell_view_measure_ (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline)
|
2015-12-17 00:07:26 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_css_gadget_get_preferred_size (GTK_CELL_VIEW (widget)->priv->gadget,
|
2016-10-22 14:06:14 +00:00
|
|
|
|
orientation,
|
|
|
|
|
for_size,
|
2015-12-17 00:07:26 +00:00
|
|
|
|
minimum, natural,
|
2016-10-22 14:06:14 +00:00
|
|
|
|
minimum_baseline, natural_baseline);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_cell_view_measure (GtkCssGadget *gadget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline,
|
|
|
|
|
gpointer data)
|
2010-11-24 05:59:55 +00:00
|
|
|
|
{
|
2015-12-17 00:07:26 +00:00
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkCellView *cellview;
|
|
|
|
|
GtkCellViewPrivate *priv;
|
2015-07-19 03:23:11 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
|
|
|
|
cellview = GTK_CELL_VIEW (widget);
|
|
|
|
|
priv = cellview->priv;
|
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)
|
|
|
|
|
{
|
|
|
|
|
gint min = 0, nat = 0;
|
|
|
|
|
gtk_cell_view_request_model (cellview, NULL, GTK_ORIENTATION_HORIZONTAL, -1, &min, &nat);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (cellview->priv->displayed_row)
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
gint min = 0, nat = 0;
|
|
|
|
|
gtk_cell_view_request_model (cellview, NULL, GTK_ORIENTATION_VERTICAL, -1, &min, &nat);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (cellview->priv->displayed_row)
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
gint min = 0, nat = 0;
|
|
|
|
|
gtk_cell_view_request_model (cellview, NULL, GTK_ORIENTATION_HORIZONTAL, for_size, &min, &nat);
|
|
|
|
|
|
|
|
|
|
*minimum = min;
|
|
|
|
|
*natural = nat;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (cellview->priv->displayed_row)
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
gint min = 0, nat = 0;
|
|
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
if (cellview->priv->displayed_row)
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
|
static gboolean
|
2010-09-03 16:41:52 +00:00
|
|
|
|
gtk_cell_view_draw (GtkWidget *widget,
|
|
|
|
|
cairo_t *cr)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_css_gadget_draw (GTK_CELL_VIEW (widget)->priv->gadget, cr);
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
gtk_cell_view_render (GtkCssGadget *gadget,
|
|
|
|
|
cairo_t *cr,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
GtkCellView *cellview;
|
|
|
|
|
GdkRectangle area;
|
2004-04-14 20:26:26 +00:00
|
|
|
|
GtkCellRendererState state;
|
2010-08-22 02:32:39 +00:00
|
|
|
|
|
2015-12-17 00:07:26 +00:00
|
|
|
|
widget = gtk_css_gadget_get_owner (gadget);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
cellview = GTK_CELL_VIEW (widget);
|
|
|
|
|
|
2010-09-03 16:41:52 +00:00
|
|
|
|
/* render cells */
|
2015-12-17 00:07:26 +00:00
|
|
|
|
area.x = x;
|
|
|
|
|
area.y = y;
|
|
|
|
|
area.width = width;
|
|
|
|
|
area.height = height;
|
2010-08-11 21:15:42 +00:00
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
|
/* "blank" background */
|
|
|
|
|
if (cellview->priv->background_set)
|
|
|
|
|
{
|
2010-09-03 16:41:52 +00:00
|
|
|
|
gdk_cairo_rectangle (cr, &area);
|
2010-10-22 11:01:54 +00:00
|
|
|
|
gdk_cairo_set_source_rgba (cr, &cellview->priv->background);
|
2005-05-11 19:16:19 +00:00
|
|
|
|
cairo_fill (cr);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-03-14 00:01:23 +00:00
|
|
|
|
/* set cell data (if available) */
|
|
|
|
|
if (cellview->priv->displayed_row)
|
|
|
|
|
gtk_cell_view_set_cell_data (cellview);
|
|
|
|
|
else if (cellview->priv->model)
|
2010-09-03 16:41:52 +00:00
|
|
|
|
return FALSE;
|
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 */
|
2015-12-17 00:07:26 +00:00
|
|
|
|
gtk_cell_area_render (cellview->priv->area, cellview->priv->context,
|
2010-11-18 04:53:55 +00:00
|
|
|
|
widget, cr, &area, &area, state, FALSE);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
{
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
|
2004-10-25 15:53:46 +00:00
|
|
|
|
g_return_if_fail (cell_view->priv->displayed_row != NULL);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
2004-10-25 15:53:46 +00:00
|
|
|
|
path = gtk_tree_row_reference_get_path (cell_view->priv->displayed_row);
|
2004-08-02 19:08:13 +00:00
|
|
|
|
if (!path)
|
|
|
|
|
return;
|
|
|
|
|
|
2004-10-25 15:53:46 +00:00
|
|
|
|
gtk_tree_model_get_iter (cell_view->priv->model, &iter, path);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
2010-11-18 08:30:33 +00:00
|
|
|
|
gtk_cell_area_apply_attributes (cell_view->priv->area,
|
2010-11-18 04:53:55 +00:00
|
|
|
|
cell_view->priv->model,
|
|
|
|
|
&iter, FALSE, FALSE);
|
2010-11-24 05:59:55 +00:00
|
|
|
|
|
|
|
|
|
if (cell_view->priv->draw_sensitive)
|
|
|
|
|
{
|
|
|
|
|
GList *l, *cells =
|
|
|
|
|
gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_view->priv->area));
|
|
|
|
|
|
|
|
|
|
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);
|
2011-01-31 22:34:37 +00:00
|
|
|
|
GtkCellViewPrivate *priv = cellview->priv;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
gtk_cell_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
|
|
|
|
const gchar *tagname,
|
|
|
|
|
GMarkupParser *parser,
|
|
|
|
|
gpointer *data)
|
|
|
|
|
{
|
|
|
|
|
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,
|
|
|
|
|
const gchar *tagname,
|
|
|
|
|
gpointer *data)
|
|
|
|
|
{
|
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)
|
|
|
|
|
{
|
|
|
|
|
GtkTreePath *row_path;
|
|
|
|
|
|
|
|
|
|
if (view->priv->displayed_row)
|
|
|
|
|
{
|
|
|
|
|
row_path =
|
|
|
|
|
gtk_tree_row_reference_get_path (view->priv->displayed_row);
|
|
|
|
|
|
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)
|
2010-11-27 07:32:36 +00:00
|
|
|
|
gtk_cell_area_context_reset (view->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
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
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
|
|
|
|
|
2004-11-19 23:18:38 +00:00
|
|
|
|
cellview = g_object_new (gtk_cell_view_get_type (), 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.
|
|
|
|
|
*
|
|
|
|
|
* Specifying the same context for a handfull of cells lets
|
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_cell_view_new_with_text (const gchar *text)
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_cell_view_new_with_markup (const gchar *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);
|
|
|
|
|
}
|
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_new_with_pixbuf:
|
|
|
|
|
* @pixbuf: the image to display in the cell view
|
|
|
|
|
*
|
2012-02-29 17:19:55 +00:00
|
|
|
|
* Creates a new #GtkCellView widget, adds a #GtkCellRendererPixbuf
|
|
|
|
|
* to it, and makes it show @pixbuf.
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_cell_view_new_with_pixbuf (GdkPixbuf *pixbuf)
|
|
|
|
|
{
|
|
|
|
|
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_pixbuf_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, GDK_TYPE_PIXBUF);
|
|
|
|
|
g_value_set_object (&value, pixbuf);
|
2004-12-15 16:27:30 +00:00
|
|
|
|
gtk_cell_view_set_value (cellview, renderer, "pixbuf", &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_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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
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)
|
|
|
|
|
{
|
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
|
|
|
|
|
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
|
|
|
|
if (cell_view->priv->model)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2010-11-22 06:51:51 +00:00
|
|
|
|
g_signal_handler_disconnect (cell_view->priv->model,
|
|
|
|
|
cell_view->priv->row_changed_id);
|
|
|
|
|
cell_view->priv->row_changed_id = 0;
|
|
|
|
|
|
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
|
|
|
|
if (cell_view->priv->displayed_row)
|
|
|
|
|
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
|
|
|
|
|
cell_view->priv->displayed_row = NULL;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2004-11-19 23:18:38 +00:00
|
|
|
|
g_object_unref (cell_view->priv->model);
|
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
|
|
|
|
cell_view->priv->model = model;
|
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
|
|
|
|
if (cell_view->priv->model)
|
2010-11-22 06:51:51 +00:00
|
|
|
|
{
|
|
|
|
|
g_object_ref (cell_view->priv->model);
|
|
|
|
|
|
|
|
|
|
cell_view->priv->row_changed_id =
|
|
|
|
|
g_signal_connect (cell_view->priv->model, "row-changed",
|
|
|
|
|
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
|
|
|
|
*
|
|
|
|
|
* Since: 2.16
|
|
|
|
|
**/
|
|
|
|
|
GtkTreeModel *
|
|
|
|
|
gtk_cell_view_get_model (GtkCellView *cell_view)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), NULL);
|
|
|
|
|
|
|
|
|
|
return cell_view->priv->model;
|
|
|
|
|
}
|
|
|
|
|
|
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.
|
2004-10-09 05:39:22 +00:00
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
2004-03-02 18:56:10 +00:00
|
|
|
|
**/
|
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)
|
|
|
|
|
{
|
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));
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_MODEL (cell_view->priv->model));
|
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
|
|
|
|
if (cell_view->priv->displayed_row)
|
|
|
|
|
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
2004-03-02 18:56:10 +00:00
|
|
|
|
if (path)
|
|
|
|
|
{
|
|
|
|
|
cell_view->priv->displayed_row =
|
|
|
|
|
gtk_tree_row_reference_new (cell_view->priv->model, path);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
cell_view->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
|
|
|
|
*
|
|
|
|
|
* Since: 2.6
|
|
|
|
|
*/
|
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
|
|
|
|
{
|
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
|
|
|
|
|
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
|
|
|
|
if (!cell_view->priv->displayed_row)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
|
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
|
|
|
|
return gtk_tree_row_reference_get_path (cell_view->priv->displayed_row);
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-22 11:01:54 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_cell_view_set_background_rgba:
|
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
|
* @rgba: the new background color
|
|
|
|
|
*
|
|
|
|
|
* Sets the background color of @cell_view.
|
|
|
|
|
*
|
|
|
|
|
* Since: 3.0
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_cell_view_set_background_rgba (GtkCellView *cell_view,
|
|
|
|
|
const GdkRGBA *rgba)
|
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
|
|
|
|
|
|
|
|
|
|
if (rgba)
|
|
|
|
|
{
|
|
|
|
|
if (!cell_view->priv->background_set)
|
|
|
|
|
{
|
|
|
|
|
cell_view->priv->background_set = TRUE;
|
|
|
|
|
g_object_notify (G_OBJECT (cell_view), "background-set");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cell_view->priv->background = *rgba;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-10-25 15:53:46 +00:00
|
|
|
|
if (cell_view->priv->background_set)
|
2003-09-26 21:57:06 +00:00
|
|
|
|
{
|
2004-10-25 15:53:46 +00:00
|
|
|
|
cell_view->priv->background_set = FALSE;
|
2005-03-26 05:49:15 +00:00
|
|
|
|
g_object_notify (G_OBJECT (cell_view), "background-set");
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2004-12-07 14:12:51 +00:00
|
|
|
|
|
2004-12-07 15:32:08 +00:00
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
}
|
2004-05-27 03:31:17 +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
|
|
|
|
|
*
|
|
|
|
|
* Since: 3.0
|
|
|
|
|
*/
|
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
|
|
|
|
{
|
2010-11-24 05:59:55 +00:00
|
|
|
|
GtkCellViewPrivate *priv;
|
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
|
|
|
|
priv = cell_view->priv;
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 3.0
|
|
|
|
|
*/
|
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
|
|
|
|
{
|
2010-11-24 05:59:55 +00:00
|
|
|
|
GtkCellViewPrivate *priv;
|
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
|
|
|
|
priv = cell_view->priv;
|
2010-08-18 23:39:59 +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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 3.0
|
|
|
|
|
*/
|
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
|
|
|
|
{
|
2010-11-24 05:59:55 +00:00
|
|
|
|
GtkCellViewPrivate *priv;
|
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
|
|
|
|
priv = cell_view->priv;
|
2010-08-18 23:39:59 +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.
|
|
|
|
|
*
|
|
|
|
|
* Since: 3.0
|
|
|
|
|
*/
|
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
|
|
|
|
{
|
2010-11-24 05:59:55 +00:00
|
|
|
|
GtkCellViewPrivate *priv;
|
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
|
|
|
|
priv = cell_view->priv;
|
2010-08-18 23:39:59 +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
|
|
|
|
|
2010-11-27 07:32:36 +00:00
|
|
|
|
gtk_cell_area_context_reset (cell_view->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
|
|
|
|
}
|