gtk2/gtk/gtkcellview.c

1221 lines
40 KiB
C
Raw Normal View History

/* gtkellview.c
* Copyright (C) 2002, 2003 Kristian Rietveld <kris@gtk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
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>
#include "gtkcellview.h"
#include "gtkcelllayout.h"
#include "gtkcellareabox.h"
#include "gtkintl.h"
#include "gtkcellrenderertext.h"
#include "gtkcellrendererpixbuf.h"
#include "gtkprivate.h"
#include "gtksizerequest.h"
#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"
/**
* SECTION:gtkcellview
* @Short_description: A widget displaying a single row of a GtkTreeModel
* @Title: GtkCellView
*
* A #GtkCellView displays a single row of a #GtkTreeModel, using
* cell renderers just like #GtkTreeView. #GtkCellView doesn't support
* some of the more complex features of #GtkTreeView, like cell editing
* and drag and drop.
*/
struct _GtkCellViewPrivate
{
GtkTreeModel *model;
GtkTreeRowReference *displayed_row;
GtkCellArea *cell_area;
GtkCellAreaContext *cell_area_context;
GdkRGBA background;
gboolean background_set;
};
static void gtk_cell_view_cell_layout_init (GtkCellLayoutIface *iface);
static GObject *gtk_cell_view_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties);
static void gtk_cell_view_get_property (GObject *object,
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);
static void gtk_cell_view_dispose (GObject *object);
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);
static void gtk_cell_view_set_value (GtkCellView *cell_view,
GtkCellRenderer *renderer,
gchar *property,
GValue *value);
static void gtk_cell_view_set_cell_data (GtkCellView *cell_view);
static void gtk_cell_view_cell_layout_pack_start (GtkCellLayout *layout,
GtkCellRenderer *renderer,
gboolean expand);
static void gtk_cell_view_cell_layout_pack_end (GtkCellLayout *layout,
GtkCellRenderer *renderer,
gboolean expand);
static void gtk_cell_view_cell_layout_add_attribute (GtkCellLayout *layout,
GtkCellRenderer *renderer,
const gchar *attribute,
gint column);
static void gtk_cell_view_cell_layout_clear (GtkCellLayout *layout);
static void gtk_cell_view_cell_layout_clear_attributes (GtkCellLayout *layout,
GtkCellRenderer *renderer);
static void gtk_cell_view_cell_layout_set_cell_data_func (GtkCellLayout *layout,
GtkCellRenderer *cell,
GtkCellLayoutDataFunc func,
gpointer func_data,
GDestroyNotify destroy);
static void gtk_cell_view_cell_layout_reorder (GtkCellLayout *layout,
GtkCellRenderer *cell,
gint position);
static GList * gtk_cell_view_cell_layout_get_cells (GtkCellLayout *layout);
static GtkCellArea *gtk_cell_view_cell_layout_get_area (GtkCellLayout *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
/* 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);
static void gtk_cell_view_get_preferred_width (GtkWidget *widget,
gint *minimum_size,
gint *natural_size);
static void gtk_cell_view_get_preferred_height (GtkWidget *widget,
gint *minimum_size,
gint *natural_size);
static void gtk_cell_view_get_preferred_width_for_height (GtkWidget *widget,
gint avail_size,
gint *minimum_size,
gint *natural_size);
static void gtk_cell_view_get_preferred_height_for_width (GtkWidget *widget,
gint avail_size,
gint *minimum_size,
gint *natural_size);
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;
enum
{
PROP_0,
PROP_BACKGROUND,
PROP_BACKGROUND_GDK,
PROP_BACKGROUND_RGBA,
PROP_BACKGROUND_SET,
PROP_MODEL,
PROP_CELL_AREA,
PROP_CELL_AREA_CONTEXT
};
2006-05-02 23:56:43 +00:00
G_DEFINE_TYPE_WITH_CODE (GtkCellView, gtk_cell_view, GTK_TYPE_WIDGET,
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,
gtk_cell_view_buildable_init))
static void
gtk_cell_view_class_init (GtkCellViewClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->constructor = gtk_cell_view_constructor;
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;
gobject_class->dispose = gtk_cell_view_dispose;
widget_class->draw = gtk_cell_view_draw;
widget_class->size_allocate = gtk_cell_view_size_allocate;
widget_class->get_preferred_width = gtk_cell_view_get_preferred_width;
widget_class->get_preferred_height = gtk_cell_view_get_preferred_height;
widget_class->get_preferred_width_for_height = gtk_cell_view_get_preferred_width_for_height;
widget_class->get_preferred_height_for_width = gtk_cell_view_get_preferred_height_for_width;
/* properties */
g_object_class_install_property (gobject_class,
PROP_BACKGROUND,
g_param_spec_string ("background",
P_("Background color name"),
P_("Background color as a string"),
NULL,
GTK_PARAM_WRITABLE));
g_object_class_install_property (gobject_class,
PROP_BACKGROUND_GDK,
2005-03-09 06:15:13 +00:00
g_param_spec_boxed ("background-gdk",
P_("Background color"),
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
GTK_PARAM_READWRITE));
/**
* GtkCellView:background-rgba
*
* 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));
/**
* GtkCellView:model
*
* 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));
/**
* GtkCellView:cell-area
*
* The #GtkCellArea rendering cells
*
* 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));
/**
* GtkCellView:cell-area-context
*
* The #GtkCellAreaContext used to compute the geometry of the cell view.
*
* since 3.0
*/
g_object_class_install_property (gobject_class,
PROP_CELL_AREA,
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));
#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))
2005-03-09 06:15:13 +00:00
ADD_SET_PROP ("background-set", PROP_BACKGROUND_SET,
P_("Background set"),
P_("Whether this tag affects the background color"));
g_type_class_add_private (gobject_class, sizeof (GtkCellViewPrivate));
}
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);
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;
}
static void
gtk_cell_view_cell_layout_init (GtkCellLayoutIface *iface)
{
iface->pack_start = gtk_cell_view_cell_layout_pack_start;
iface->pack_end = gtk_cell_view_cell_layout_pack_end;
iface->clear = gtk_cell_view_cell_layout_clear;
iface->add_attribute = gtk_cell_view_cell_layout_add_attribute;
iface->set_cell_data_func = gtk_cell_view_cell_layout_set_cell_data_func;
iface->clear_attributes = gtk_cell_view_cell_layout_clear_attributes;
iface->reorder = gtk_cell_view_cell_layout_reorder;
iface->get_cells = gtk_cell_view_cell_layout_get_cells;
iface->get_area = gtk_cell_view_cell_layout_get_area;
}
static GObject *
gtk_cell_view_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
GObject *object;
GtkCellView *view;
GtkCellViewPrivate *priv;
object = G_OBJECT_CLASS (gtk_cell_view_parent_class)->constructor
(type, n_construct_properties, construct_properties);
view = GTK_CELL_VIEW (object);
priv = view->priv;
if (!priv->cell_area)
{
GtkCellArea *area = gtk_cell_area_box_new ();
priv->cell_area = g_object_ref_sink (area);
}
if (!priv->cell_area_context)
priv->cell_area_context = gtk_cell_area_create_context (priv->cell_area);
return object;
}
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)
{
case PROP_BACKGROUND_GDK:
{
GdkColor color;
color.red = (guint) (view->priv->background.red * 65535);
color.green = (guint) (view->priv->background.green * 65535);
color.blue = (guint) (view->priv->background.blue * 65535);
color.pixel = 0;
g_value_set_boxed (value, &color);
}
break;
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->cell_area);
break;
case PROP_CELL_AREA_CONTEXT:
g_value_set_object (value, view->priv->cell_area_context);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static void
gtk_cell_view_set_property (GObject *object,
guint param_id,
const GValue *value,
GParamSpec *pspec)
{
GtkCellView *view = GTK_CELL_VIEW (object);
GtkCellArea *area;
GtkCellAreaContext *context;
switch (param_id)
{
case PROP_BACKGROUND:
{
GdkColor color;
if (!g_value_get_string (value))
gtk_cell_view_set_background_color (view, NULL);
else if (gdk_color_parse (g_value_get_string (value), &color))
gtk_cell_view_set_background_color (view, &color);
else
g_warning ("Don't know color `%s'", g_value_get_string (value));
g_object_notify (object, "background-gdk");
}
break;
case PROP_BACKGROUND_GDK:
gtk_cell_view_set_background_color (view, g_value_get_boxed (value));
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;
case PROP_CELL_AREA:
/* Construct-only, can only be assigned once */
area = g_value_get_object (value);
if (area)
view->priv->cell_area = g_object_ref_sink (area);
break;
case PROP_CELL_AREA_CONTEXT:
/* Construct-only, can only be assigned once */
context = g_value_get_object (value);
if (context)
view->priv->cell_area_context = g_object_ref (context);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
}
}
static void
gtk_cell_view_init (GtkCellView *cellview)
{
2010-06-01 21:38:52 +00:00
GtkCellViewPrivate *priv;
cellview->priv = G_TYPE_INSTANCE_GET_PRIVATE (cellview,
GTK_TYPE_CELL_VIEW,
GtkCellViewPrivate);
priv = cellview->priv;
2010-06-01 21:38:52 +00:00
gtk_widget_set_has_window (GTK_WIDGET (cellview), FALSE);
}
static void
gtk_cell_view_finalize (GObject *object)
{
GtkCellView *cellview = GTK_CELL_VIEW (object);
if (cellview->priv->displayed_row)
gtk_tree_row_reference_free (cellview->priv->displayed_row);
G_OBJECT_CLASS (gtk_cell_view_parent_class)->finalize (object);
}
static void
gtk_cell_view_dispose (GObject *object)
{
GtkCellView *cellview = GTK_CELL_VIEW (object);
gtk_cell_view_cell_layout_clear (GTK_CELL_LAYOUT (cellview));
if (cellview->priv->model)
{
g_object_unref (cellview->priv->model);
cellview->priv->model = NULL;
}
if (cellview->priv->cell_area)
{
g_object_unref (cellview->priv->cell_area);
cellview->priv->cell_area = NULL;
}
if (cellview->priv->cell_area_context)
{
g_object_unref (cellview->priv->cell_area_context);
cellview->priv->cell_area_context = NULL;
}
G_OBJECT_CLASS (gtk_cell_view_parent_class)->dispose (object);
}
static void
gtk_cell_view_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkCellView *cellview = GTK_CELL_VIEW (widget);
GtkCellViewPrivate *priv = cellview->priv;
gint alloc_width, alloc_height;
gtk_widget_set_allocation (widget, allocation);
gtk_cell_area_context_get_allocation (priv->cell_area_context, &alloc_width, &alloc_height);
/* Only allocate the GtkCellAreaContext if it has not been done for us by
* another widget (i.e. GtkTreeMenu)... in this case we assume that
* we own our GtkCellArea and GtkCellAreaContext and they are not shared with
* other cell views. */
if (alloc_width <= 0 && alloc_height <= 0)
{
gtk_cell_area_context_allocate_width (priv->cell_area_context, allocation->width);
gtk_cell_area_context_allocate_height (priv->cell_area_context, allocation->height);
}
}
static gboolean
2010-09-03 16:41:52 +00:00
gtk_cell_view_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkCellView *cellview;
GdkRectangle area;
GtkCellRendererState state;
2010-08-22 02:32:39 +00:00
cellview = GTK_CELL_VIEW (widget);
2010-09-03 16:41:52 +00:00
/* render cells */
area.x = 0;
area.y = 0;
area.width = gtk_widget_get_allocated_width (widget);
2010-09-03 16:41:52 +00:00
area.height = gtk_widget_get_allocated_height (widget);
/* "blank" background */
if (cellview->priv->background_set)
{
2010-09-03 16:41:52 +00:00
gdk_cairo_rectangle (cr, &area);
gdk_cairo_set_source_rgba (cr, &cellview->priv->background);
Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to 2005-05-11 Owen Taylor <otaylor@redhat.com> * gtk/gtkcolorbutton.c: Use a GtkAlignment rather than a GtkDrawingArea to draw the swatch in to avoid having an extraneous window. * gtk/gtkcolorsel.c (color_sample_draw_sample): Actually se tthe color when !has_opacity. 2005-05-10 Owen Taylor <otaylor@redhat.com> * gdk/gdkcairo.[ch] gdk/gdkcolor.[ch] gdk/Makefile.am: Add source files for Cairo convenience functionality. * gdk/gdkcairo.h (gdk_cairo_rectangle, gdk_cairo_region): Add a convenience functions to add GdkRectangle, GdkRegion to a cairo path. * gdk/gdkwindow.c gdk/gdkgc.c gtk/gtkcolorsel.c gtk/gtkiconview.c gtk/gtkstyle.c: Use gdk_cairo_rectangle/region(). * gdk/gdkcairo.[ch] gdk/gdkdrawable.h gdk/gdkdraw.c: Rename gdk_drawable_create_cairo_context() to gdk_cairo_create(). * gdk/gdkcairo.c gdk/gdkpixbuf.h gdk/gdkpixbuf-render.c: Rename gdk_pixbuf_set_as_cairo_source() to gdk_cairo_set_source_pixbuf(). * gdk/gdkdraw.c gdk/gdkpango.c gtk/gtkcolorsel.c gtk/gtkhruler.c gtk/gtkhsv.c gtk/gtkiconview.c gtk/gtkstyle.c gtk/gtkvruler.c: Adjust for renames. * gdk/gdk.symbols: Update. * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): Fix coordinate system problem that was causing the wrong portions to be invalidated. * gtk/gtkcellrenderer.c (gtk_cell_renderer_render) gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render) gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_render) gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render) gtk/gtkcellview.c (gtk_cell_view_expose) gtk/gtkdnd.c (gtk_drag_highlight_expose) gtk/gtkentry.c (gtk_entry_draw_text) gtk/gtktextview.c (text_window_invalidate_rect): Some cairoization. * gtk/gtkcalendar.[ch]: Beat into something roughly resembling GTK+ style ... use instance-private data and standard names for private structure, etc. Move function docs inline. * gtk/gtkcalendar.[ch]: Switch to drawing everything in expose. Switch drawing to Cairo. * gtk/gtkcalendar.c (gtk_calendar_freeze): Deprecate gtk_calendar_freeze/thaw
2005-05-11 19:16:19 +00:00
cairo_fill (cr);
}
/* 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;
2011-01-04 01:19:29 +00:00
if (gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_PRELIGHT)
state = GTK_CELL_RENDERER_PRELIT;
2011-01-04 01:19:29 +00:00
else if (gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_INSENSITIVE)
state = GTK_CELL_RENDERER_INSENSITIVE;
else
state = 0;
2006-12-14 18:33:43 +00:00
/* Render the cells */
gtk_cell_area_render (cellview->priv->cell_area, cellview->priv->cell_area_context,
widget, cr, &area, &area, state, FALSE);
return FALSE;
}
static void
gtk_cell_view_set_cell_data (GtkCellView *cell_view)
{
GtkTreeIter iter;
GtkTreePath *path;
g_return_if_fail (cell_view->priv->displayed_row != NULL);
path = gtk_tree_row_reference_get_path (cell_view->priv->displayed_row);
if (!path)
return;
gtk_tree_model_get_iter (cell_view->priv->model, &iter, path);
gtk_tree_path_free (path);
gtk_cell_area_apply_attributes (cell_view->priv->cell_area,
cell_view->priv->model,
&iter, FALSE, FALSE);
}
/* GtkCellLayout implementation */
static void
gtk_cell_view_cell_layout_pack_start (GtkCellLayout *layout,
GtkCellRenderer *renderer,
gboolean expand)
{
GtkCellView *cellview = GTK_CELL_VIEW (layout);
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cellview->priv->cell_area), renderer, expand);
gtk_widget_queue_resize (GTK_WIDGET (cellview));
}
static void
gtk_cell_view_cell_layout_pack_end (GtkCellLayout *layout,
GtkCellRenderer *renderer,
gboolean expand)
{
GtkCellView *cellview = GTK_CELL_VIEW (layout);
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (cellview->priv->cell_area), renderer, expand);
gtk_widget_queue_resize (GTK_WIDGET (cellview));
}
static void
gtk_cell_view_cell_layout_add_attribute (GtkCellLayout *layout,
GtkCellRenderer *renderer,
const gchar *attribute,
gint column)
{
GtkCellView *cellview = GTK_CELL_VIEW (layout);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (cellview->priv->cell_area), renderer,
attribute, column);
}
static void
gtk_cell_view_cell_layout_clear (GtkCellLayout *layout)
{
GtkCellView *cellview = GTK_CELL_VIEW (layout);
if (cellview->priv->cell_area)
gtk_cell_layout_clear (GTK_CELL_LAYOUT (cellview->priv->cell_area));
}
static void
gtk_cell_view_cell_layout_set_cell_data_func (GtkCellLayout *layout,
GtkCellRenderer *cell,
GtkCellLayoutDataFunc func,
gpointer func_data,
GDestroyNotify destroy)
{
GtkCellView *cellview = GTK_CELL_VIEW (layout);
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (cellview->priv->cell_area),
cell, func, func_data, destroy);
}
static void
gtk_cell_view_cell_layout_clear_attributes (GtkCellLayout *layout,
GtkCellRenderer *renderer)
{
GtkCellView *cellview = GTK_CELL_VIEW (layout);
gtk_cell_layout_clear_attributes (GTK_CELL_LAYOUT (cellview->priv->cell_area), renderer);
}
static void
gtk_cell_view_cell_layout_reorder (GtkCellLayout *layout,
GtkCellRenderer *cell,
gint position)
{
GtkCellView *cellview = GTK_CELL_VIEW (layout);
gtk_cell_layout_reorder (GTK_CELL_LAYOUT (cellview->priv->cell_area), cell, position);
}
static GList *
gtk_cell_view_cell_layout_get_cells (GtkCellLayout *layout)
{
GtkCellView *cellview = GTK_CELL_VIEW (layout);
return gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cellview->priv->cell_area));
}
static GtkCellArea *
gtk_cell_view_cell_layout_get_area (GtkCellLayout *layout)
{
GtkCellView *cellview = GTK_CELL_VIEW (layout);
return cellview->priv->cell_area;
}
/**
* gtk_cell_view_new:
*
* Creates a new #GtkCellView widget.
*
* Return value: A newly created #GtkCellView widget.
*
* Since: 2.6
*/
GtkWidget *
gtk_cell_view_new (void)
{
GtkCellView *cellview;
cellview = g_object_new (gtk_cell_view_get_type (), NULL);
return GTK_WIDGET (cellview);
}
/**
* 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.
*
* Return value: A newly created #GtkCellView widget.
*
* Since: 2.6
*/
GtkWidget *
gtk_cell_view_new_with_context (GtkCellArea *area,
GtkCellAreaContext *context)
{
return (GtkWidget *)g_object_new (GTK_TYPE_CELL_VIEW,
"cell-area", area,
"cell-area-context", context,
NULL);
}
/**
* gtk_cell_view_new_with_text:
* @text: the text to display in the cell view
*
* Creates a new #GtkCellView widget, adds a #GtkCellRendererText
* to it, and makes its show @text.
*
* Return value: A newly created #GtkCellView widget.
*
* Since: 2.6
*/
GtkWidget *
gtk_cell_view_new_with_text (const gchar *text)
{
GtkCellView *cellview;
GtkCellRenderer *renderer;
GValue value = {0, };
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
renderer = gtk_cell_renderer_text_new ();
gtk_cell_view_cell_layout_pack_start (GTK_CELL_LAYOUT (cellview),
renderer, TRUE);
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, text);
gtk_cell_view_set_value (cellview, renderer, "text", &value);
g_value_unset (&value);
return GTK_WIDGET (cellview);
}
/**
* gtk_cell_view_new_with_markup:
* @markup: the text to display in the cell view
*
* Creates a new #GtkCellView widget, adds a #GtkCellRendererText
* to it, and makes it show @markup. The text can be
* marked up with the <link linkend="PangoMarkupFormat">Pango text
* markup language</link>.
*
* Return value: A newly created #GtkCellView widget.
*
* Since: 2.6
*/
GtkWidget *
gtk_cell_view_new_with_markup (const gchar *markup)
{
GtkCellView *cellview;
GtkCellRenderer *renderer;
GValue value = {0, };
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
renderer = gtk_cell_renderer_text_new ();
gtk_cell_view_cell_layout_pack_start (GTK_CELL_LAYOUT (cellview),
renderer, TRUE);
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, markup);
gtk_cell_view_set_value (cellview, renderer, "markup", &value);
g_value_unset (&value);
return GTK_WIDGET (cellview);
}
/**
* gtk_cell_view_new_with_pixbuf:
* @pixbuf: the image to display in the cell view
*
* Creates a new #GtkCellView widget, adds a #GtkCellRendererPixbuf
* to it, and makes its show @pixbuf.
*
* Return value: A newly created #GtkCellView widget.
*
* Since: 2.6
*/
GtkWidget *
gtk_cell_view_new_with_pixbuf (GdkPixbuf *pixbuf)
{
GtkCellView *cellview;
GtkCellRenderer *renderer;
GValue value = {0, };
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_cell_view_cell_layout_pack_start (GTK_CELL_LAYOUT (cellview),
renderer, TRUE);
g_value_init (&value, GDK_TYPE_PIXBUF);
g_value_set_object (&value, pixbuf);
gtk_cell_view_set_value (cellview, renderer, "pixbuf", &value);
g_value_unset (&value);
return GTK_WIDGET (cellview);
}
/**
* 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
*/
static void
gtk_cell_view_set_value (GtkCellView *cell_view,
GtkCellRenderer *renderer,
gchar *property,
GValue *value)
{
g_object_set_property (G_OBJECT (renderer), property, value);
/* force resize and redraw */
gtk_widget_queue_resize (GTK_WIDGET (cell_view));
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
}
/**
* gtk_cell_view_set_model:
* @cell_view: a #GtkCellView
* @model: (allow-none): a #GtkTreeModel
*
* Sets the model for @cell_view. If @cell_view already has a model
* set, it will remove it before setting the new model. If @model is
* %NULL, then it will unset the old model.
*
* Since: 2.6
*/
void
gtk_cell_view_set_model (GtkCellView *cell_view,
GtkTreeModel *model)
{
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
if (cell_view->priv->model)
{
if (cell_view->priv->displayed_row)
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
cell_view->priv->displayed_row = NULL;
g_object_unref (cell_view->priv->model);
cell_view->priv->model = NULL;
}
cell_view->priv->model = model;
if (cell_view->priv->model)
g_object_ref (cell_view->priv->model);
}
/**
* gtk_cell_view_get_model:
* @cell_view: a #GtkCellView
*
* Returns the model for @cell_view. If no model is used %NULL is
* returned.
*
2010-09-21 04:18:11 +00:00
* Returns: (transfer none): a #GtkTreeModel used or %NULL
*
* 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;
}
/**
* gtk_cell_view_set_displayed_row:
* @cell_view: a #GtkCellView
* @path: (allow-none): a #GtkTreePath or %NULL to unset.
*
* Sets the row of the model that is currently displayed
* by the #GtkCellView. If the path is unset, then the
* contents of the cellview "stick" at their last value;
* this is not normally a desired result, but may be
* a needed intermediate state if say, the model for
* the #GtkCellView becomes temporarily empty.
*
* Since: 2.6
**/
void
gtk_cell_view_set_displayed_row (GtkCellView *cell_view,
GtkTreePath *path)
{
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
g_return_if_fail (GTK_IS_TREE_MODEL (cell_view->priv->model));
if (cell_view->priv->displayed_row)
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
if (path)
{
cell_view->priv->displayed_row =
gtk_tree_row_reference_new (cell_view->priv->model, path);
}
else
cell_view->priv->displayed_row = NULL;
/* force resize and redraw */
gtk_widget_queue_resize (GTK_WIDGET (cell_view));
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
}
/**
* 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.
*
* Returns: the currently displayed row or %NULL
*
* Since: 2.6
*/
GtkTreePath *
gtk_cell_view_get_displayed_row (GtkCellView *cell_view)
{
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), NULL);
if (!cell_view->priv->displayed_row)
return NULL;
return gtk_tree_row_reference_get_path (cell_view->priv->displayed_row);
}
/**
* gtk_cell_view_get_size_of_row:
* @cell_view: a #GtkCellView
* @path: a #GtkTreePath
* @requisition: return location for the size
*
* Sets @requisition to the size needed by @cell_view to display
* the model row pointed to by @path.
*
* Return value: %TRUE
*
* Since: 2.6
*
* Deprecated: 3.0: Use gtk_cell_view_get_desired_width_of_row() and
* gtk_cell_view_get_desired_height_for_width_of_row() instead.
*/
gboolean
gtk_cell_view_get_size_of_row (GtkCellView *cell_view,
GtkTreePath *path,
GtkRequisition *requisition)
{
GtkRequisition req;
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), FALSE);
g_return_val_if_fail (path != NULL, FALSE);
/* Return the minimum height for the minimum width */
gtk_cell_view_get_desired_width_of_row (cell_view, path, &req.width, NULL);
gtk_cell_view_get_desired_height_for_width_of_row (cell_view, path, req.width, &req.height, NULL);
if (requisition)
*requisition = req;
return TRUE;
}
/**
* gtk_cell_view_get_desired_width_of_row:
* @cell_view: a #GtkCellView
* @path: a #GtkTreePath
* @minimum_size: location to store the minimum size
* @natural_size: location to store the natural size
*
* Sets @minimum_size and @natural_size to the width desired by @cell_view
* to display the model row pointed to by @path.
*
* Since: 3.0
*/
void
gtk_cell_view_get_desired_width_of_row (GtkCellView *cell_view,
GtkTreePath *path,
gint *minimum_size,
gint *natural_size)
{
GtkTreeRowReference *tmp;
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
g_return_if_fail (path != NULL);
g_return_if_fail (minimum_size != NULL || natural_size != NULL);
tmp = cell_view->priv->displayed_row;
cell_view->priv->displayed_row =
gtk_tree_row_reference_new (cell_view->priv->model, path);
gtk_cell_view_get_preferred_width (GTK_WIDGET (cell_view), minimum_size, natural_size);
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
cell_view->priv->displayed_row = tmp;
/* Restore active size (this will restore the cellrenderer info->width/requested_width's) */
gtk_cell_view_get_preferred_width (GTK_WIDGET (cell_view), NULL, NULL);
}
/**
* gtk_cell_view_get_desired_height_for_width_of_row:
* @cell_view: a #GtkCellView
* @path: a #GtkTreePath
* @avail_size: available width
* @minimum_size: location to store the minimum height
* @natural_size: location to store the natural height
*
* Sets @minimum_size and @natural_size to the height desired by @cell_view
* if it were allocated a width of @avail_size to display the model row
* pointed to by @path.
*
* Since: 3.0
*/
void
gtk_cell_view_get_desired_height_for_width_of_row (GtkCellView *cell_view,
GtkTreePath *path,
gint avail_size,
gint *minimum_size,
gint *natural_size)
{
GtkTreeRowReference *tmp;
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
g_return_if_fail (path != NULL);
g_return_if_fail (minimum_size != NULL || natural_size != NULL);
tmp = cell_view->priv->displayed_row;
cell_view->priv->displayed_row =
gtk_tree_row_reference_new (cell_view->priv->model, path);
/* Then get the collective height_for_width based on the cached values */
gtk_cell_view_get_preferred_height_for_width (GTK_WIDGET (cell_view), avail_size, minimum_size, natural_size);
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
cell_view->priv->displayed_row = tmp;
/* Restore active size (this will restore the cellrenderer info->width/requested_width's) */
gtk_cell_view_get_preferred_width (GTK_WIDGET (cell_view), NULL, NULL);
}
/**
* gtk_cell_view_set_background_color:
* @cell_view: a #GtkCellView
* @color: the new background color
*
* Sets the background color of @view.
*
* Since: 2.6
*/
void
gtk_cell_view_set_background_color (GtkCellView *cell_view,
Fix #105497; constify uses of GdkColor. 2004-01-26 Federico Mena Quintero <federico@ximian.com> Fix #105497; constify uses of GdkColor. * gdk/gdkgc.c (gdk_gc_set_rgb_fg_color): Constify. (gdk_gc_set_rgb_bg_color): Constify. (gdk_gc_set_foreground): Constify. * gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_pixmap): Constify. * gdk/win32/gdkcursor-win32.c (gdk_cursor_new_from_pixmap): Constify. * gdk/linux-fb/gdkcursor-fb.c (gdk_cursor_new_from_pixmap): Constify. * gdk/x11/gdkpixmap-x11.c (gdk_pixmap_create_from_data): Constify. * gdk/win32/gdkpixmap-win32.c (gdk_pixmap_create_from_data): Constify. * gdk/linux-fb/gdkpixmap-fb.c (gdk_pixmap_create_from_data): Constify. * gdk/x11/gdkwindow-x11.c (gdk_window_set_background): Constify. * gdk/win32/gdkwindow-win32.c (gdk_window_set_background): Constify. * gdk/linux-fb/gdkwindow-fb.c (gdk_window_set_background): Constify. * gdk/gdkpango.c (gdk_draw_layout_line_with_colors): Constify. (gdk_draw_layout_with_colors): Constify. * gdk/gdkpixmap.c (gdk_pixmap_colormap_new_from_pixbuf): Constify. (gdk_pixmap_colormap_create_from_xpm): Constify. (gdk_pixmap_create_from_xpm): Constify. (gdk_pixmap_colormap_create_from_xpm_d): Constify. (gdk_pixmap_create_from_xpm_d): Constify. * gtk/gtkcellview.c (gtk_cell_view_set_background_color): Constify. * gtk/gtkclist.c (gtk_clist_set_foreground): Constify. (gtk_clist_set_background): Constify. * gtk/gtkcolorbutton.c (gtk_color_button_new_with_color): Constify. (gtk_color_button_set_color): Constify. * gtk/gtkcolorsel.c (gtk_color_selection_set_current_color): Constify and add a check for color != NULL. (gtk_color_selection_get_current_color): Add a check for color != NULL. (gtk_color_selection_set_previous_color): Constify and add a check for color != NULL. (gtk_color_selection_get_previous_color): Add a check for color != NULL. * gtk/gtkctree.c (gtk_ctree_node_set_foreground): Constify. (gtk_ctree_node_set_background): Constify. * gtk/gtktext.c (gtk_text_insert): Constify. (insert_text_property): Constify. (text_properties_equal): Constify. (new_text_property): Constify. * gtk/gtkwidget.c (gtk_widget_modify_color_component): Constify. (gtk_widget_modify_fg): Constify. (gtk_widget_modify_bg): Constify. (gtk_widget_modify_text): Constify. (gtk_widget_modify_base): Constify.
2004-01-26 20:21:09 +00:00
const GdkColor *color)
{
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
if (color)
{
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.red = color->red / 65535.;
cell_view->priv->background.green = color->green / 65535.;
cell_view->priv->background.blue = color->blue / 65535.;
cell_view->priv->background.alpha = 1;
}
else
{
if (cell_view->priv->background_set)
{
cell_view->priv->background_set = FALSE;
g_object_notify (G_OBJECT (cell_view), "background-set");
}
}
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
}
/**
* 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;
}
else
{
if (cell_view->priv->background_set)
{
cell_view->priv->background_set = FALSE;
g_object_notify (G_OBJECT (cell_view), "background-set");
}
}
gtk_widget_queue_draw (GTK_WIDGET (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
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,
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
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)
{
if (strcmp (tagname, "attributes") == 0)
_gtk_cell_layout_buildable_custom_tag_end (buildable, builder, child, tagname,
data);
else if (parent_buildable_iface->custom_tag_end)
Add GtkBuilder, fixes #172535 2007-06-15 Johan Dahlin <jdahlin@async.com.br> * demos/gtk-demo/Makefile.am: * demos/gtk-demo/builder.c: (quit_activate), (about_activate), (do_builder): * demos/gtk-demo/demo.ui: * docs/reference/gtk/gtk-docs.sgml: * docs/reference/gtk/gtk-sections.txt: * docs/reference/gtk/gtk.types: * docs/reference/gtk/tmpl/gtkbuildable.sgml: * docs/reference/gtk/tmpl/gtkbuilder.sgml: * gtk/Makefile.am: * gtk/gtk.h: * gtk/gtk.symbols: * gtk/gtkaction.c: (gtk_action_buildable_init), (gtk_action_buildable_set_name), (gtk_action_buildable_get_name): * gtk/gtkactiongroup.c: (gtk_action_group_get_type), (gtk_action_group_buildable_init), (gtk_action_group_buildable_add), (gtk_action_group_buildable_set_name), (gtk_action_group_buildable_get_name): * gtk/gtkbuildable.c: (gtk_buildable_get_type), (gtk_buildable_set_name), (gtk_buildable_get_name), (gtk_buildable_add), (gtk_buildable_set_property), (gtk_buildable_parser_finished), (gtk_buildable_construct_child), (gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end), (gtk_buildable_custom_finished), (gtk_buildable_get_internal_child): * gtk/gtkbuildable.h: * gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init), (gtk_builder_finalize), (gtk_builder_set_property), (gtk_builder_get_property), (_gtk_builder_resolve_type_lazily), (gtk_builder_real_get_type_from_name), (gtk_builder_get_parameters), (gtk_builder_get_internal_child), (_gtk_builder_construct), (_gtk_builder_add), (apply_delayed_properties), (_gtk_builder_finish), (gtk_builder_new), (gtk_builder_add_from_file), (gtk_builder_add_from_string), (gtk_builder_get_object), (object_add_to_list), (gtk_builder_get_objects), (gtk_builder_set_translation_domain), (gtk_builder_get_translation_domain), (gtk_builder_connect_signals_default), (gtk_builder_connect_signals), (gtk_builder_connect_signals_full), (gtk_builder_value_from_string), (gtk_builder_value_from_string_type), (_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string), (gtk_builder_get_type_from_name), (gtk_builder_error_quark): * gtk/gtkbuilder.h: * gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop), (error_missing_attribute), (error_invalid_attribute), (error_invalid_tag), (builder_construct), (parse_object), (free_object_info), (_get_type_by_symbol), (parse_child), (free_child_info), (parse_property), (free_property_info), (parse_signal), (_free_signal_info), (parse_interface), (create_subparser), (free_subparser), (subparser_start), (subparser_end), (parse_custom), (start_element), (end_element), (text), (_gtk_builder_parser_parse_buffer): * gtk/gtkbuilderprivate.h: * gtk/gtkcelllayout.c: (attributes_start_element), (attributes_text_element), (_gtk_cell_layout_buildable_custom_tag_start), (_gtk_cell_layout_buildable_custom_tag_end), (_gtk_cell_layout_buildable_add): * gtk/gtkcelllayout.h: * gtk/gtkcellview.c: (gtk_cell_view_buildable_init), (gtk_cell_view_buildable_custom_tag_start), (gtk_cell_view_buildable_custom_tag_end): * gtk/gtkcolorseldialog.c: (gtk_color_selection_dialog_buildable_interface_init), (gtk_color_selection_dialog_buildable_get_internal_child): * gtk/gtkcombobox.c: (gtk_combo_box_buildable_init), (gtk_combo_box_buildable_custom_tag_start), (gtk_combo_box_buildable_custom_tag_end): * gtk/gtkcomboboxentry.c: (gtk_combo_box_entry_buildable_interface_init), (gtk_combo_box_entry_buildable_get_internal_child): * gtk/gtkcontainer.c: (gtk_container_get_type), (gtk_container_buildable_init), (gtk_container_buildable_add), (gtk_container_buildable_set_child_property), (attributes_start_element), (attributes_text_element), (gtk_container_buildable_custom_tag_start), (gtk_container_buildable_custom_tag_end): * gtk/gtkdebug.h: * gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init), (gtk_dialog_buildable_get_internal_child), (attributes_start_element), (attributes_text_element), (gtk_dialog_buildable_custom_tag_start), (gtk_dialog_buildable_custom_finished): * gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init): * gtk/gtkexpander.c: (gtk_expander_buildable_add), (gtk_expander_buildable_init): * gtk/gtkfontsel.c: (gtk_font_selection_dialog_buildable_interface_init), (gtk_font_selection_dialog_buildable_get_internal_child): * gtk/gtkframe.c: (gtk_frame_buildable_init), (gtk_frame_buildable_add): * gtk/gtkiconview.c: (gtk_icon_view_buildable_init), (gtk_icon_view_buildable_custom_tag_start), (gtk_icon_view_buildable_custom_tag_end): * gtk/gtkliststore.c: (gtk_list_store_buildable_init), (list_store_start_element), (list_store_end_element), (list_store_text), (gtk_list_store_buildable_custom_tag_start), (gtk_list_store_buildable_custom_tag_end): * gtk/gtkmain.c: * gtk/gtknotebook.c: (gtk_notebook_buildable_init), (gtk_notebook_buildable_add): * gtk/gtksizegroup.c: (gtk_size_group_buildable_init), (size_group_start_element), (gtk_size_group_buildable_custom_tag_start), (gtk_size_group_buildable_custom_finished): * gtk/gtktreestore.c: (gtk_tree_store_buildable_init), (tree_model_start_element), (gtk_tree_store_buildable_custom_tag_start), (gtk_tree_store_buildable_custom_finished): * gtk/gtktreeview.c: (gtk_tree_view_buildable_init), (gtk_tree_view_buildable_add): * gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init): * gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init), (gtk_ui_manager_buildable_add), (gtk_ui_manager_buildable_construct_child), (gtk_ui_manager_buildable_custom_tag_start), (gtk_ui_manager_buildable_custom_tag_end): * gtk/gtkwidget.c: (gtk_widget_get_type), (gtk_widget_buildable_interface_init), (gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name), (gtk_widget_buildable_set_property), (gtk_widget_buildable_parser_finshed), (accel_group_start_element), (gtk_widget_buildable_custom_tag_start), (gtk_widget_buildable_custom_finshed): * gtk/gtkwindow.c: (gtk_window_buildable_interface_init), (gtk_window_buildable_set_property), (gtk_window_buildable_parser_finished): * tests/Makefile.am: * tests/buildertest.c: (builder_new_from_string), (test_parser), (signal_normal), (signal_after), (signal_object), (signal_object_after), (signal_first), (signal_second), (signal_extra), (signal_extra2), (test_connect_signals), (test_uimanager_simple), (test_domain), (test_translation), (test_sizegroup), (test_list_store), (test_tree_store), (test_types), (test_spin_button), (test_notebook), (test_construct_only_property), (test_children), (test_child_properties), (test_treeview_column), (test_icon_view), (test_combo_box), (test_combo_box_entry), (test_cell_view), (test_dialog), (test_accelerators), (test_widget), (main): Add GtkBuilder, fixes #172535 svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
data);
}
static void
gtk_cell_view_get_preferred_width (GtkWidget *widget,
gint *minimum_size,
gint *natural_size)
{
GtkCellView *cellview = GTK_CELL_VIEW (widget);
GtkCellViewPrivate *priv = cellview->priv;
if (cellview->priv->displayed_row)
gtk_cell_view_set_cell_data (cellview);
gtk_cell_area_get_preferred_width (priv->cell_area, priv->cell_area_context, widget, NULL, NULL);
gtk_cell_area_context_sum_preferred_width (priv->cell_area_context);
gtk_cell_area_context_get_preferred_width (priv->cell_area_context, minimum_size, natural_size);
}
static void
gtk_cell_view_get_preferred_height (GtkWidget *widget,
gint *minimum_size,
gint *natural_size)
{
GtkCellView *cellview = GTK_CELL_VIEW (widget);
GtkCellViewPrivate *priv = cellview->priv;
if (cellview->priv->displayed_row)
gtk_cell_view_set_cell_data (cellview);
gtk_cell_area_get_preferred_height (priv->cell_area, priv->cell_area_context, widget, NULL, NULL);
gtk_cell_area_context_sum_preferred_height (priv->cell_area_context);
gtk_cell_area_context_get_preferred_height (priv->cell_area_context, minimum_size, natural_size);
}
static void
gtk_cell_view_get_preferred_width_for_height (GtkWidget *widget,
gint for_size,
gint *minimum_size,
gint *natural_size)
{
GtkCellView *cellview = GTK_CELL_VIEW (widget);
GtkCellViewPrivate *priv = cellview->priv;
if (cellview->priv->displayed_row)
gtk_cell_view_set_cell_data (cellview);
gtk_cell_area_get_preferred_width_for_height (priv->cell_area, priv->cell_area_context, widget,
for_size, minimum_size, natural_size);
}
static void
gtk_cell_view_get_preferred_height_for_width (GtkWidget *widget,
gint for_size,
gint *minimum_size,
gint *natural_size)
{
GtkCellView *cellview = GTK_CELL_VIEW (widget);
GtkCellViewPrivate *priv = cellview->priv;
if (cellview->priv->displayed_row)
gtk_cell_view_set_cell_data (cellview);
gtk_cell_area_get_preferred_height_for_width (priv->cell_area, priv->cell_area_context, widget,
for_size, minimum_size, natural_size);
}