2003-09-26 21:57:06 +00:00
|
|
|
/* gtkellview.c
|
|
|
|
* Copyright (C) 2002, 2003 Kristian Rietveld <kris@gtk.org>
|
|
|
|
*
|
2003-10-24 18:36:55 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
2003-09-26 21:57:06 +00:00
|
|
|
*
|
2003-10-24 18:36:55 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2003-09-26 21:57:06 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2003-10-24 18:36:55 +00:00
|
|
|
* Library General Public License for more details.
|
2003-09-26 21:57:06 +00:00
|
|
|
*
|
2003-10-24 18:36:55 +00:00
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2003-09-26 21:57:06 +00:00
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
#include <string.h>
|
2003-10-23 18:25:53 +00:00
|
|
|
#include "gtkcellview.h"
|
|
|
|
#include "gtkcelllayout.h"
|
|
|
|
#include "gtkintl.h"
|
|
|
|
#include "gtkcellrenderertext.h"
|
|
|
|
#include "gtkcellrendererpixbuf.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
#include "gtkprivate.h"
|
2003-09-26 21:57:06 +00:00
|
|
|
#include <gobject/gmarshal.h>
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
#include "gtkbuildable.h"
|
2005-03-20 07:01:23 +00:00
|
|
|
#include "gtkalias.h"
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
typedef struct _GtkCellViewCellInfo GtkCellViewCellInfo;
|
|
|
|
struct _GtkCellViewCellInfo
|
|
|
|
{
|
|
|
|
GtkCellRenderer *cell;
|
|
|
|
|
|
|
|
gint requested_width;
|
|
|
|
gint real_width;
|
|
|
|
guint expand : 1;
|
|
|
|
guint pack : 1;
|
|
|
|
|
|
|
|
GSList *attributes;
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
|
|
GtkCellLayoutDataFunc func;
|
|
|
|
gpointer func_data;
|
|
|
|
GDestroyNotify destroy;
|
2003-09-26 21:57:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkCellViewPrivate
|
|
|
|
{
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeRowReference *displayed_row;
|
|
|
|
GList *cell_list;
|
|
|
|
gint spacing;
|
|
|
|
|
|
|
|
GdkColor background;
|
|
|
|
gboolean background_set;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
static void gtk_cell_view_cell_layout_init (GtkCellLayoutIface *iface);
|
2003-09-26 21:57:06 +00:00
|
|
|
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_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
static void gtk_cell_view_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
static gboolean gtk_cell_view_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event);
|
2004-12-15 16:27:30 +00:00
|
|
|
static void gtk_cell_view_set_value (GtkCellView *cell_view,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
gchar *property,
|
|
|
|
GValue *value);
|
2003-10-01 20:51:54 +00:00
|
|
|
static GtkCellViewCellInfo *gtk_cell_view_get_cell_info (GtkCellView *cellview,
|
|
|
|
GtkCellRenderer *renderer);
|
2004-11-29 18:43:41 +00:00
|
|
|
static void gtk_cell_view_set_cell_data (GtkCellView *cell_view);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
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);
|
2003-12-19 22:47:20 +00:00
|
|
|
static void gtk_cell_view_cell_layout_reorder (GtkCellLayout *layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gint position);
|
2006-12-29 07:53:01 +00:00
|
|
|
static GList * gtk_cell_view_cell_layout_get_cells (GtkCellLayout *layout);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
/* buildable */
|
|
|
|
static void gtk_cell_view_buildable_init (GtkBuildableIface *iface);
|
|
|
|
static gboolean gtk_cell_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
GtkBuilder *builder,
|
|
|
|
GObject *child,
|
|
|
|
const gchar *tagname,
|
|
|
|
GMarkupParser *parser,
|
|
|
|
gpointer *data);
|
|
|
|
static void gtk_cell_view_buildable_custom_tag_end (GtkBuildable *buildable,
|
|
|
|
GtkBuilder *builder,
|
|
|
|
GObject *child,
|
|
|
|
const gchar *tagname,
|
|
|
|
gpointer *data);
|
|
|
|
|
|
|
|
static GtkBuildableIface *parent_buildable_iface;
|
|
|
|
|
2003-12-08 22:55:03 +00:00
|
|
|
#define GTK_CELL_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_VIEW, GtkCellViewPrivate))
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_BACKGROUND,
|
|
|
|
PROP_BACKGROUND_GDK,
|
2006-05-24 17:01:28 +00:00
|
|
|
PROP_BACKGROUND_SET,
|
2006-12-14 18:33:43 +00:00
|
|
|
PROP_MODEL
|
2003-09-26 21:57:06 +00:00
|
|
|
};
|
|
|
|
|
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))
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
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->get_property = gtk_cell_view_get_property;
|
|
|
|
gobject_class->set_property = gtk_cell_view_set_property;
|
|
|
|
gobject_class->finalize = gtk_cell_view_finalize;
|
|
|
|
|
|
|
|
widget_class->expose_event = gtk_cell_view_expose;
|
|
|
|
widget_class->size_allocate = gtk_cell_view_size_allocate;
|
|
|
|
widget_class->size_request = gtk_cell_view_size_request;
|
|
|
|
|
|
|
|
/* properties */
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_BACKGROUND,
|
|
|
|
g_param_spec_string ("background",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Background color name"),
|
|
|
|
P_("Background color as a string"),
|
2003-09-26 21:57:06 +00:00
|
|
|
NULL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_WRITABLE));
|
2003-09-26 21:57:06 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_BACKGROUND_GDK,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_boxed ("background-gdk",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Background color"),
|
|
|
|
P_("Background color as a GdkColor"),
|
2003-09-26 21:57:06 +00:00
|
|
|
GDK_TYPE_COLOR,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2006-05-24 17:01:28 +00:00
|
|
|
/**
|
|
|
|
* 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));
|
|
|
|
|
2005-03-22 02:14:55 +00:00
|
|
|
#define ADD_SET_PROP(propname, propval, nick, blurb) g_object_class_install_property (gobject_class, propval, g_param_spec_boolean (propname, nick, blurb, FALSE, GTK_PARAM_READWRITE))
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2005-03-09 06:15:13 +00:00
|
|
|
ADD_SET_PROP ("background-set", PROP_BACKGROUND_SET,
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Background set"),
|
|
|
|
P_("Whether this tag affects the background color"));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
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);
|
2007-06-19 12:23:36 +00:00
|
|
|
iface->add_child = _gtk_cell_layout_buildable_add_child;
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
iface->custom_tag_start = gtk_cell_view_buildable_custom_tag_start;
|
|
|
|
iface->custom_tag_end = gtk_cell_view_buildable_custom_tag_end;
|
|
|
|
}
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
static void
|
|
|
|
gtk_cell_view_cell_layout_init (GtkCellLayoutIface *iface)
|
|
|
|
{
|
|
|
|
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;
|
2003-12-19 22:47:20 +00:00
|
|
|
iface->reorder = gtk_cell_view_cell_layout_reorder;
|
2006-12-29 07:53:01 +00:00
|
|
|
iface->get_cells = gtk_cell_view_cell_layout_get_cells;
|
2003-10-01 20:51:54 +00:00
|
|
|
}
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
static void
|
|
|
|
gtk_cell_view_get_property (GObject *object,
|
|
|
|
guint param_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkCellView *view = GTK_CELL_VIEW (object);
|
|
|
|
|
|
|
|
switch (param_id)
|
|
|
|
{
|
|
|
|
case PROP_BACKGROUND_GDK:
|
|
|
|
{
|
|
|
|
GdkColor color;
|
|
|
|
|
|
|
|
color = view->priv->background;
|
|
|
|
|
|
|
|
g_value_set_boxed (value, &color);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case PROP_BACKGROUND_SET:
|
|
|
|
g_value_set_boolean (value, view->priv->background_set);
|
|
|
|
break;
|
2006-05-24 17:01:28 +00:00
|
|
|
case PROP_MODEL:
|
|
|
|
g_value_set_object (value, view->priv->model);
|
|
|
|
break;
|
2003-09-26 21:57:06 +00:00
|
|
|
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);
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (object, "background-gdk");
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case PROP_BACKGROUND_GDK:
|
|
|
|
gtk_cell_view_set_background_color (view, g_value_get_boxed (value));
|
|
|
|
break;
|
|
|
|
case PROP_BACKGROUND_SET:
|
|
|
|
view->priv->background_set = g_value_get_boolean (value);
|
|
|
|
break;
|
2006-05-24 17:01:28 +00:00
|
|
|
case PROP_MODEL:
|
|
|
|
gtk_cell_view_set_model (view, g_value_get_object (value));
|
|
|
|
break;
|
|
|
|
default:
|
2003-09-26 21:57:06 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_cell_view_init (GtkCellView *cellview)
|
|
|
|
{
|
2010-03-06 10:29:31 +00:00
|
|
|
gtk_widget_set_has_window (GTK_WIDGET (cellview), FALSE);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
cellview->priv = GTK_CELL_VIEW_GET_PRIVATE (cellview);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_cell_view_finalize (GObject *object)
|
|
|
|
{
|
2004-07-22 02:26:07 +00:00
|
|
|
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);
|
|
|
|
|
|
|
|
if (cellview->priv->displayed_row)
|
|
|
|
gtk_tree_row_reference_free (cellview->priv->displayed_row);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2008-08-12 09:51:16 +00:00
|
|
|
G_OBJECT_CLASS (gtk_cell_view_parent_class)->finalize (object);
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_cell_view_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
|
|
|
GList *i;
|
|
|
|
gboolean first_cell = TRUE;
|
|
|
|
GtkCellView *cellview;
|
|
|
|
|
|
|
|
cellview = GTK_CELL_VIEW (widget);
|
|
|
|
|
|
|
|
requisition->width = 0;
|
|
|
|
requisition->height = 0;
|
|
|
|
|
|
|
|
if (cellview->priv->displayed_row)
|
|
|
|
gtk_cell_view_set_cell_data (cellview);
|
|
|
|
|
|
|
|
for (i = cellview->priv->cell_list; i; i = i->next)
|
|
|
|
{
|
|
|
|
gint width, height;
|
|
|
|
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
|
|
|
|
|
|
|
|
if (!info->cell->visible)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!first_cell)
|
|
|
|
requisition->width += cellview->priv->spacing;
|
|
|
|
|
|
|
|
gtk_cell_renderer_get_size (info->cell, widget, NULL, NULL, NULL,
|
|
|
|
&width, &height);
|
|
|
|
|
|
|
|
info->requested_width = width;
|
|
|
|
requisition->width += width;
|
|
|
|
requisition->height = MAX (requisition->height, height);
|
|
|
|
|
|
|
|
first_cell = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_cell_view_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation)
|
|
|
|
{
|
|
|
|
GList *i;
|
|
|
|
gint expand_cell_count = 0;
|
|
|
|
gint full_requested_width = 0;
|
|
|
|
gint extra_space;
|
|
|
|
GtkCellView *cellview;
|
|
|
|
|
|
|
|
widget->allocation = *allocation;
|
|
|
|
|
|
|
|
cellview = GTK_CELL_VIEW (widget);
|
|
|
|
|
|
|
|
/* checking how much extra space we have */
|
|
|
|
for (i = cellview->priv->cell_list; i; i = i->next)
|
|
|
|
{
|
|
|
|
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
|
|
|
|
|
|
|
|
if (!info->cell->visible)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (info->expand)
|
|
|
|
expand_cell_count++;
|
|
|
|
|
|
|
|
full_requested_width += info->requested_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
extra_space = widget->allocation.width - full_requested_width;
|
|
|
|
if (extra_space < 0)
|
|
|
|
extra_space = 0;
|
|
|
|
else if (extra_space > 0 && expand_cell_count > 0)
|
|
|
|
extra_space /= expand_cell_count;
|
|
|
|
|
|
|
|
for (i = cellview->priv->cell_list; i; i = i->next)
|
|
|
|
{
|
|
|
|
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
|
|
|
|
|
|
|
|
if (!info->cell->visible)
|
|
|
|
continue;
|
|
|
|
|
2008-08-19 19:16:38 +00:00
|
|
|
info->real_width = info->requested_width +
|
|
|
|
(info->expand ? extra_space : 0);
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_cell_view_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event)
|
|
|
|
{
|
|
|
|
GList *i;
|
|
|
|
GtkCellView *cellview;
|
|
|
|
GdkRectangle area;
|
2004-04-14 20:26:26 +00:00
|
|
|
GtkCellRendererState state;
|
2003-12-12 20:08:58 +00:00
|
|
|
gboolean rtl = (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
cellview = GTK_CELL_VIEW (widget);
|
|
|
|
|
2010-01-07 15:47:35 +00:00
|
|
|
if (!gtk_widget_is_drawable (widget))
|
2003-09-26 21:57:06 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* "blank" background */
|
|
|
|
if (cellview->priv->background_set)
|
|
|
|
{
|
2005-05-11 19:16:19 +00:00
|
|
|
cairo_t *cr = gdk_cairo_create (GTK_WIDGET (cellview)->window);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
gdk_cairo_rectangle (cr, &widget->allocation);
|
|
|
|
cairo_set_source_rgb (cr,
|
|
|
|
cellview->priv->background.red / 65535.,
|
|
|
|
cellview->priv->background.green / 65535.,
|
|
|
|
cellview->priv->background.blue / 65535.);
|
|
|
|
cairo_fill (cr);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
cairo_destroy (cr);
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 00:01:23 +00:00
|
|
|
/* set cell data (if available) */
|
|
|
|
if (cellview->priv->displayed_row)
|
|
|
|
gtk_cell_view_set_cell_data (cellview);
|
|
|
|
else if (cellview->priv->model)
|
2004-03-13 20:44:14 +00:00
|
|
|
return FALSE;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
/* render cells */
|
|
|
|
area = widget->allocation;
|
|
|
|
|
|
|
|
/* we draw on our very own window, initialize x and y to zero */
|
2003-12-12 20:08:58 +00:00
|
|
|
area.x = widget->allocation.x + (rtl ? widget->allocation.width : 0);
|
2003-09-26 21:57:06 +00:00
|
|
|
area.y = widget->allocation.y;
|
|
|
|
|
2010-03-03 20:49:33 +00:00
|
|
|
if (gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
|
2004-04-14 20:26:26 +00:00
|
|
|
state = GTK_CELL_RENDERER_PRELIT;
|
2010-03-03 20:49:33 +00:00
|
|
|
else if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
|
2009-09-04 11:11:19 +00:00
|
|
|
state = GTK_CELL_RENDERER_INSENSITIVE;
|
2004-04-14 20:26:26 +00:00
|
|
|
else
|
|
|
|
state = 0;
|
2006-12-14 18:33:43 +00:00
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
/* PACK_START */
|
|
|
|
for (i = cellview->priv->cell_list; i; i = i->next)
|
|
|
|
{
|
|
|
|
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
|
|
|
|
|
|
|
|
if (info->pack == GTK_PACK_END)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!info->cell->visible)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
area.width = info->real_width;
|
2003-12-12 20:08:58 +00:00
|
|
|
if (rtl)
|
|
|
|
area.x -= area.width;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
gtk_cell_renderer_render (info->cell,
|
|
|
|
event->window,
|
|
|
|
widget,
|
|
|
|
/* FIXME! */
|
2004-04-14 20:26:26 +00:00
|
|
|
&area, &area, &event->area, state);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2003-12-12 20:08:58 +00:00
|
|
|
if (!rtl)
|
|
|
|
area.x += info->real_width;
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2003-12-12 20:08:58 +00:00
|
|
|
area.x = rtl ? widget->allocation.x : (widget->allocation.x + widget->allocation.width);
|
|
|
|
|
2003-09-26 21:57:06 +00:00
|
|
|
/* PACK_END */
|
|
|
|
for (i = cellview->priv->cell_list; i; i = i->next)
|
|
|
|
{
|
|
|
|
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
|
|
|
|
|
|
|
|
if (info->pack == GTK_PACK_START)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!info->cell->visible)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
area.width = info->real_width;
|
2003-12-12 20:08:58 +00:00
|
|
|
if (!rtl)
|
|
|
|
area.x -= area.width;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
gtk_cell_renderer_render (info->cell,
|
|
|
|
widget->window,
|
|
|
|
widget,
|
|
|
|
/* FIXME ! */
|
2004-04-14 20:26:26 +00:00
|
|
|
&area, &area, &event->area, state);
|
2003-12-12 20:08:58 +00:00
|
|
|
if (rtl)
|
|
|
|
area.x += info->real_width;
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkCellViewCellInfo *
|
|
|
|
gtk_cell_view_get_cell_info (GtkCellView *cellview,
|
|
|
|
GtkCellRenderer *renderer)
|
|
|
|
{
|
|
|
|
GList *i;
|
|
|
|
|
|
|
|
for (i = cellview->priv->cell_list; i; i = i->next)
|
|
|
|
{
|
|
|
|
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)i->data;
|
|
|
|
|
|
|
|
if (info->cell == renderer)
|
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-11-29 18:43:41 +00:00
|
|
|
static void
|
2004-10-25 15:53:46 +00:00
|
|
|
gtk_cell_view_set_cell_data (GtkCellView *cell_view)
|
2003-10-01 20:51:54 +00:00
|
|
|
{
|
|
|
|
GList *i;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
2004-10-25 15:53:46 +00:00
|
|
|
g_return_if_fail (cell_view->priv->displayed_row != NULL);
|
2003-10-01 20:51:54 +00:00
|
|
|
|
2004-10-25 15:53:46 +00:00
|
|
|
path = gtk_tree_row_reference_get_path (cell_view->priv->displayed_row);
|
2004-08-02 19:08:13 +00:00
|
|
|
if (!path)
|
|
|
|
return;
|
|
|
|
|
2004-10-25 15:53:46 +00:00
|
|
|
gtk_tree_model_get_iter (cell_view->priv->model, &iter, path);
|
2003-10-01 20:51:54 +00:00
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
2004-10-25 15:53:46 +00:00
|
|
|
for (i = cell_view->priv->cell_list; i; i = i->next)
|
2003-10-01 20:51:54 +00:00
|
|
|
{
|
|
|
|
GSList *j;
|
|
|
|
GtkCellViewCellInfo *info = i->data;
|
|
|
|
|
2004-03-14 00:01:23 +00:00
|
|
|
g_object_freeze_notify (G_OBJECT (info->cell));
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
|
|
for (j = info->attributes; j && j->next; j = j->next->next)
|
|
|
|
{
|
|
|
|
gchar *property = j->data;
|
|
|
|
gint column = GPOINTER_TO_INT (j->next->data);
|
|
|
|
GValue value = {0, };
|
|
|
|
|
2004-10-25 15:53:46 +00:00
|
|
|
gtk_tree_model_get_value (cell_view->priv->model, &iter,
|
2003-10-01 20:51:54 +00:00
|
|
|
column, &value);
|
|
|
|
g_object_set_property (G_OBJECT (info->cell),
|
|
|
|
property, &value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
2004-03-14 00:01:23 +00:00
|
|
|
|
|
|
|
if (info->func)
|
2004-10-25 15:53:46 +00:00
|
|
|
(* info->func) (GTK_CELL_LAYOUT (cell_view),
|
2004-03-14 00:01:23 +00:00
|
|
|
info->cell,
|
2004-10-25 15:53:46 +00:00
|
|
|
cell_view->priv->model,
|
2004-03-14 00:01:23 +00:00
|
|
|
&iter,
|
|
|
|
info->func_data);
|
|
|
|
|
|
|
|
g_object_thaw_notify (G_OBJECT (info->cell));
|
2003-10-01 20:51:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* GtkCellLayout implementation */
|
|
|
|
static void
|
|
|
|
gtk_cell_view_cell_layout_pack_start (GtkCellLayout *layout,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
gboolean expand)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
|
|
|
GtkCellViewCellInfo *info;
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (layout);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
g_return_if_fail (!gtk_cell_view_get_cell_info (cellview, renderer));
|
|
|
|
|
2005-11-23 18:06:58 +00:00
|
|
|
g_object_ref_sink (renderer);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2008-07-04 14:27:40 +00:00
|
|
|
info = g_slice_new0 (GtkCellViewCellInfo);
|
2003-09-26 21:57:06 +00:00
|
|
|
info->cell = renderer;
|
|
|
|
info->expand = expand ? TRUE : FALSE;
|
|
|
|
info->pack = GTK_PACK_START;
|
|
|
|
|
|
|
|
cellview->priv->cell_list = g_list_append (cellview->priv->cell_list, info);
|
|
|
|
}
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
static void
|
|
|
|
gtk_cell_view_cell_layout_pack_end (GtkCellLayout *layout,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
gboolean expand)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
|
|
|
GtkCellViewCellInfo *info;
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (layout);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
g_return_if_fail (!gtk_cell_view_get_cell_info (cellview, renderer));
|
|
|
|
|
2005-11-23 18:06:58 +00:00
|
|
|
g_object_ref_sink (renderer);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2008-07-04 14:27:40 +00:00
|
|
|
info = g_slice_new0 (GtkCellViewCellInfo);
|
2003-09-26 21:57:06 +00:00
|
|
|
info->cell = renderer;
|
|
|
|
info->expand = expand ? TRUE : FALSE;
|
|
|
|
info->pack = GTK_PACK_END;
|
|
|
|
|
|
|
|
cellview->priv->cell_list = g_list_append (cellview->priv->cell_list, info);
|
|
|
|
}
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
static void
|
|
|
|
gtk_cell_view_cell_layout_add_attribute (GtkCellLayout *layout,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
const gchar *attribute,
|
|
|
|
gint column)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
|
|
|
GtkCellViewCellInfo *info;
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (layout);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
info = gtk_cell_view_get_cell_info (cellview, renderer);
|
|
|
|
g_return_if_fail (info != NULL);
|
|
|
|
|
|
|
|
info->attributes = g_slist_prepend (info->attributes,
|
|
|
|
GINT_TO_POINTER (column));
|
|
|
|
info->attributes = g_slist_prepend (info->attributes,
|
|
|
|
g_strdup (attribute));
|
|
|
|
}
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
static void
|
|
|
|
gtk_cell_view_cell_layout_clear (GtkCellLayout *layout)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (layout);
|
|
|
|
|
2004-03-10 21:28:10 +00:00
|
|
|
while (cellview->priv->cell_list)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
2004-03-10 21:28:10 +00:00
|
|
|
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)cellview->priv->cell_list->data;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
gtk_cell_view_cell_layout_clear_attributes (layout, info->cell);
|
2004-11-19 23:18:38 +00:00
|
|
|
g_object_unref (info->cell);
|
2008-07-04 14:27:40 +00:00
|
|
|
g_slice_free (GtkCellViewCellInfo, info);
|
2004-03-10 21:28:10 +00:00
|
|
|
cellview->priv->cell_list = g_list_delete_link (cellview->priv->cell_list,
|
|
|
|
cellview->priv->cell_list);
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
static void
|
|
|
|
gtk_cell_view_cell_layout_set_cell_data_func (GtkCellLayout *layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
GtkCellLayoutDataFunc func,
|
|
|
|
gpointer func_data,
|
|
|
|
GDestroyNotify destroy)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (layout);
|
2003-09-26 21:57:06 +00:00
|
|
|
GtkCellViewCellInfo *info;
|
2003-10-01 20:51:54 +00:00
|
|
|
|
|
|
|
info = gtk_cell_view_get_cell_info (cellview, cell);
|
|
|
|
g_return_if_fail (info != NULL);
|
|
|
|
|
|
|
|
if (info->destroy)
|
|
|
|
{
|
|
|
|
GDestroyNotify d = info->destroy;
|
|
|
|
|
|
|
|
info->destroy = NULL;
|
|
|
|
d (info->func_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
info->func = func;
|
|
|
|
info->func_data = func_data;
|
|
|
|
info->destroy = destroy;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_cell_view_cell_layout_clear_attributes (GtkCellLayout *layout,
|
|
|
|
GtkCellRenderer *renderer)
|
|
|
|
{
|
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (layout);
|
2008-02-07 16:59:42 +00:00
|
|
|
GtkCellViewCellInfo *info;
|
2004-02-09 21:19:35 +00:00
|
|
|
GSList *list;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
info = gtk_cell_view_get_cell_info (cellview, renderer);
|
2004-10-01 18:56:14 +00:00
|
|
|
if (info != NULL)
|
2004-02-09 21:19:35 +00:00
|
|
|
{
|
2004-10-01 18:56:14 +00:00
|
|
|
list = info->attributes;
|
|
|
|
while (list && list->next)
|
|
|
|
{
|
|
|
|
g_free (list->data);
|
|
|
|
list = list->next->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_slist_free (info->attributes);
|
|
|
|
info->attributes = NULL;
|
2004-02-09 21:19:35 +00:00
|
|
|
}
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2003-12-19 22:47:20 +00:00
|
|
|
static void
|
|
|
|
gtk_cell_view_cell_layout_reorder (GtkCellLayout *layout,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gint position)
|
|
|
|
{
|
|
|
|
GtkCellView *cellview = GTK_CELL_VIEW (layout);
|
2008-02-07 16:59:42 +00:00
|
|
|
GtkCellViewCellInfo *info;
|
|
|
|
GList *link;
|
2003-12-19 22:47:20 +00:00
|
|
|
|
|
|
|
info = gtk_cell_view_get_cell_info (cellview, cell);
|
|
|
|
|
|
|
|
g_return_if_fail (info != NULL);
|
|
|
|
g_return_if_fail (position >= 0);
|
|
|
|
|
|
|
|
link = g_list_find (cellview->priv->cell_list, info);
|
|
|
|
|
|
|
|
g_return_if_fail (link != NULL);
|
|
|
|
|
2008-02-11 15:06:57 +00:00
|
|
|
cellview->priv->cell_list = g_list_delete_link (cellview->priv->cell_list,
|
2003-12-19 22:47:20 +00:00
|
|
|
link);
|
|
|
|
cellview->priv->cell_list = g_list_insert (cellview->priv->cell_list,
|
|
|
|
info, position);
|
|
|
|
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (cellview));
|
|
|
|
}
|
2003-10-01 20:51:54 +00:00
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_new:
|
|
|
|
*
|
|
|
|
* Creates a new #GtkCellView widget.
|
|
|
|
*
|
|
|
|
* Return value: A newly created #GtkCellView widget.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkWidget *
|
|
|
|
gtk_cell_view_new (void)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkCellView *cellview;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2004-11-19 23:18:38 +00:00
|
|
|
cellview = g_object_new (gtk_cell_view_get_type (), NULL);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
return GTK_WIDGET (cellview);
|
|
|
|
}
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_new_with_text:
|
|
|
|
* @text: the text to display in the cell view
|
|
|
|
*
|
|
|
|
* Creates a new #GtkCellView widget, adds a #GtkCellRendererText
|
|
|
|
* to it, and makes its show @text.
|
|
|
|
*
|
|
|
|
* Return value: A newly created #GtkCellView widget.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkWidget *
|
|
|
|
gtk_cell_view_new_with_text (const gchar *text)
|
|
|
|
{
|
|
|
|
GtkCellView *cellview;
|
|
|
|
GtkCellRenderer *renderer;
|
|
|
|
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);
|
2004-12-15 16:27:30 +00:00
|
|
|
gtk_cell_view_set_value (cellview, renderer, "text", &value);
|
2003-10-01 20:51:54 +00:00
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
return GTK_WIDGET (cellview);
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_new_with_markup:
|
|
|
|
* @markup: the text to display in the cell view
|
|
|
|
*
|
|
|
|
* Creates a new #GtkCellView widget, adds a #GtkCellRendererText
|
2010-03-28 02:21:47 +00:00
|
|
|
* to it, and makes it show @markup. The text can be
|
2004-10-09 05:39:22 +00:00
|
|
|
* marked up with the <link linkend="PangoMarkupFormat">Pango text
|
|
|
|
* markup language</link>.
|
|
|
|
*
|
|
|
|
* Return value: A newly created #GtkCellView widget.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkWidget *
|
|
|
|
gtk_cell_view_new_with_markup (const gchar *markup)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
2003-10-01 20:51:54 +00:00
|
|
|
GtkCellView *cellview;
|
|
|
|
GtkCellRenderer *renderer;
|
|
|
|
GValue value = {0, };
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
cellview = GTK_CELL_VIEW (gtk_cell_view_new ());
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2003-10-01 20:51:54 +00:00
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
|
|
|
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);
|
2004-12-15 16:27:30 +00:00
|
|
|
gtk_cell_view_set_value (cellview, renderer, "markup", &value);
|
2003-10-01 20:51:54 +00:00
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
return GTK_WIDGET (cellview);
|
|
|
|
}
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_new_with_pixbuf:
|
|
|
|
* @pixbuf: the image to display in the cell view
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
2003-10-01 20:51:54 +00:00
|
|
|
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);
|
2004-12-15 16:27:30 +00:00
|
|
|
gtk_cell_view_set_value (cellview, renderer, "pixbuf", &value);
|
2003-10-01 20:51:54 +00:00
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
return GTK_WIDGET (cellview);
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_set_value:
|
|
|
|
* @cell_view: a #GtkCellView widget
|
|
|
|
* @renderer: one of the renderers of @cell_view
|
|
|
|
* @property: the name of the property of @renderer to set
|
|
|
|
* @value: the new value to set the property to
|
|
|
|
*
|
|
|
|
* Sets a property of a cell renderer of @cell_view, and
|
|
|
|
* makes sure the display of @cell_view is updated.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2004-12-15 16:27:30 +00:00
|
|
|
static void
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
gtk_cell_view_set_value (GtkCellView *cell_view,
|
2003-09-26 21:57:06 +00:00
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
gchar *property,
|
|
|
|
GValue *value)
|
|
|
|
{
|
|
|
|
g_object_set_property (G_OBJECT (renderer), property, value);
|
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
/* force resize and redraw */
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (cell_view));
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_set_model:
|
|
|
|
* @cell_view: a #GtkCellView
|
2009-12-10 10:23:40 +00:00
|
|
|
* @model: (allow-none): a #GtkTreeModel
|
2004-10-09 05:39:22 +00:00
|
|
|
*
|
|
|
|
* Sets the model for @cell_view. If @cell_view already has a model
|
2009-12-10 10:23:40 +00:00
|
|
|
* set, it will remove it before setting the new model. If @model is
|
2004-10-09 05:39:22 +00:00
|
|
|
* %NULL, then it will unset the old model.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2003-09-26 21:57:06 +00:00
|
|
|
void
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
gtk_cell_view_set_model (GtkCellView *cell_view,
|
2003-09-26 21:57:06 +00:00
|
|
|
GtkTreeModel *model)
|
|
|
|
{
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
|
2006-12-27 07:17:53 +00:00
|
|
|
g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
if (cell_view->priv->model)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
if (cell_view->priv->displayed_row)
|
|
|
|
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
|
|
|
|
cell_view->priv->displayed_row = NULL;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2004-11-19 23:18:38 +00:00
|
|
|
g_object_unref (cell_view->priv->model);
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
cell_view->priv->model = NULL;
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
cell_view->priv->model = model;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
if (cell_view->priv->model)
|
2004-11-19 23:18:38 +00:00
|
|
|
g_object_ref (cell_view->priv->model);
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2008-10-06 21:15:45 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_get_model:
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
*
|
|
|
|
* Returns the model for @cell_view. If no model is used %NULL is
|
|
|
|
* returned.
|
|
|
|
*
|
|
|
|
* Returns: 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;
|
|
|
|
}
|
|
|
|
|
2004-03-02 18:56:10 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_set_displayed_row:
|
|
|
|
* @cell_view: a #GtkCellView
|
2009-12-10 10:23:40 +00:00
|
|
|
* @path: (allow-none): a #GtkTreePath or %NULL to unset.
|
|
|
|
*
|
2004-03-02 18:56:10 +00:00
|
|
|
* Sets the row of the model that is currently displayed
|
|
|
|
* by the #GtkCellView. If the path is unset, then the
|
|
|
|
* 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.
|
2004-10-09 05:39:22 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
2004-03-02 18:56:10 +00:00
|
|
|
**/
|
2003-09-26 21:57:06 +00:00
|
|
|
void
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
gtk_cell_view_set_displayed_row (GtkCellView *cell_view,
|
2003-09-26 21:57:06 +00:00
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
|
|
|
|
g_return_if_fail (GTK_IS_TREE_MODEL (cell_view->priv->model));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
if (cell_view->priv->displayed_row)
|
|
|
|
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
2004-03-02 18:56:10 +00:00
|
|
|
if (path)
|
|
|
|
{
|
|
|
|
cell_view->priv->displayed_row =
|
|
|
|
gtk_tree_row_reference_new (cell_view->priv->model, path);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
cell_view->priv->displayed_row = NULL;
|
2003-09-26 21:57:06 +00:00
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
/* force resize and redraw */
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (cell_view));
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2005-03-20 07:01:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_get_displayed_row:
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
*
|
|
|
|
* Returns a #GtkTreePath referring to the currently
|
|
|
|
* displayed row. If no row is currently displayed,
|
|
|
|
* %NULL is returned.
|
|
|
|
*
|
|
|
|
* Returns: the currently displayed row or %NULL
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2003-09-26 21:57:06 +00:00
|
|
|
GtkTreePath *
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
gtk_cell_view_get_displayed_row (GtkCellView *cell_view)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), NULL);
|
2003-09-26 21:57:06 +00:00
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
if (!cell_view->priv->displayed_row)
|
2003-09-26 21:57:06 +00:00
|
|
|
return NULL;
|
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
return gtk_tree_row_reference_get_path (cell_view->priv->displayed_row);
|
|
|
|
}
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
gboolean
|
|
|
|
gtk_cell_view_get_size_of_row (GtkCellView *cell_view,
|
|
|
|
GtkTreePath *path,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
|
|
|
GtkTreeRowReference *tmp;
|
2004-10-15 05:25:56 +00:00
|
|
|
GtkRequisition req;
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), FALSE);
|
|
|
|
g_return_val_if_fail (path != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (requisition != NULL, FALSE);
|
|
|
|
|
|
|
|
tmp = cell_view->priv->displayed_row;
|
|
|
|
cell_view->priv->displayed_row =
|
|
|
|
gtk_tree_row_reference_new (cell_view->priv->model, path);
|
|
|
|
|
|
|
|
gtk_cell_view_size_request (GTK_WIDGET (cell_view), requisition);
|
|
|
|
|
|
|
|
gtk_tree_row_reference_free (cell_view->priv->displayed_row);
|
|
|
|
cell_view->priv->displayed_row = tmp;
|
|
|
|
|
2004-10-15 04:59:03 +00:00
|
|
|
/* restore actual size info */
|
|
|
|
gtk_cell_view_size_request (GTK_WIDGET (cell_view), &req);
|
|
|
|
|
Fixes based on comments from Owen Taylor, #125264.
Tue Nov 18 19:47:59 2003 Kristian Rietveld <kris@gtk.org>
Fixes based on comments from Owen Taylor, #125264.
* gtk/gtkcellview.[ch] (gtk_cell_view_finalize): remove unused
variable,
(gtk_cell_view_set_value), (gtk_cell_view_set_displayed_model): queue
a resize,
(gtk_cell_view_get_size_of_row): new function,
(gtk_cell_view_set_value), (gtk_cell_view_set_valuesv),
(gtk_cell_view_set_values), (gtk_cell_view_set_model),
(gtk_cell_view_set_displayed_row), (gtk_cell_view_get_displayed_row):
s/cellview/cell_view/ in the function definitions, so they match
with the header file.
* gtk/gtkcombobox.c (gtk_combo_box_remeasure): remove the resize
flag again (:, and use gtk_cell_view_get_size_of_row instead of
the measurer, remove _set_size_request call,
(gtk_combo_box_calc_requested_width): use gtk_cell_view_get_size_of_row
instead of the measurer,
(gtk_combo_box_style_set): queue a resize,
(gtk_combo_box_size_request): update of _remeasure call,
(gtk_combo_box_init), (gtk_combo_box_cell_layout_pack_start),
(gtk_combo_box_cell_layout_pack_end),
(gtk_combo_box_cell_layout_clear),
(gtk_combo_box_set_model): get rid of the measurer,
(gtk_combo_box_cell_layout_add_attribute),
(gtk_combo_box_cell_layout_set_cell_data_func),
(gtk_combo_box_cell_layout_clear_attributes): ditto and queue a
resize instead of calling _remeasure.
2003-11-18 19:02:30 +00:00
|
|
|
return TRUE;
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2004-10-09 05:39:22 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_set_background_color:
|
2004-10-25 15:53:46 +00:00
|
|
|
* @cell_view: a #GtkCellView
|
2004-10-09 05:39:22 +00:00
|
|
|
* @color: the new background color
|
|
|
|
*
|
|
|
|
* Sets the background color of @view.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2003-09-26 21:57:06 +00:00
|
|
|
void
|
2004-10-25 15:53:46 +00:00
|
|
|
gtk_cell_view_set_background_color (GtkCellView *cell_view,
|
2004-01-26 20:21:09 +00:00
|
|
|
const GdkColor *color)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
2004-10-25 15:53:46 +00:00
|
|
|
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
|
2003-09-26 21:57:06 +00:00
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
2004-10-25 15:53:46 +00:00
|
|
|
if (!cell_view->priv->background_set)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
2004-10-25 15:53:46 +00:00
|
|
|
cell_view->priv->background_set = TRUE;
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (cell_view), "background-set");
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
|
2004-10-25 15:53:46 +00:00
|
|
|
cell_view->priv->background = *color;
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-10-25 15:53:46 +00:00
|
|
|
if (cell_view->priv->background_set)
|
2003-09-26 21:57:06 +00:00
|
|
|
{
|
2004-10-25 15:53:46 +00:00
|
|
|
cell_view->priv->background_set = FALSE;
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (cell_view), "background-set");
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
|
|
|
}
|
2004-12-07 14:12:51 +00:00
|
|
|
|
2004-12-07 15:32:08 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
|
2003-09-26 21:57:06 +00:00
|
|
|
}
|
2004-05-27 03:31:17 +00:00
|
|
|
|
2009-07-08 14:38:40 +00:00
|
|
|
static GList *
|
|
|
|
gtk_cell_view_cell_layout_get_cells (GtkCellLayout *layout)
|
2004-05-27 03:31:17 +00:00
|
|
|
{
|
2009-07-08 14:38:40 +00:00
|
|
|
GtkCellView *cell_view = GTK_CELL_VIEW (layout);
|
2004-05-27 03:31:17 +00:00
|
|
|
GList *retval = NULL, *list;
|
|
|
|
|
|
|
|
g_return_val_if_fail (cell_view != NULL, NULL);
|
|
|
|
|
2004-11-29 18:43:41 +00:00
|
|
|
gtk_cell_view_set_cell_data (cell_view);
|
|
|
|
|
2004-05-27 03:31:17 +00:00
|
|
|
for (list = cell_view->priv->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkCellViewCellInfo *info = (GtkCellViewCellInfo *)list->data;
|
|
|
|
|
|
|
|
retval = g_list_prepend (retval, info->cell);
|
|
|
|
}
|
|
|
|
|
|
|
|
return g_list_reverse (retval);
|
|
|
|
}
|
2005-03-20 07:01:23 +00:00
|
|
|
|
2009-07-08 14:38:40 +00:00
|
|
|
/**
|
|
|
|
* gtk_cell_view_get_cell_renderers:
|
|
|
|
* @cell_view: a #GtkCellView
|
|
|
|
*
|
|
|
|
* Returns the cell renderers which have been added to @cell_view.
|
|
|
|
*
|
|
|
|
* Return value: a list of cell renderers. The list, but not the
|
|
|
|
* renderers has been newly allocated and should be freed with
|
|
|
|
* g_list_free() when no longer needed.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*
|
|
|
|
* Deprecated: 2.18: use gtk_cell_layout_get_cells() instead.
|
|
|
|
**/
|
|
|
|
GList *
|
|
|
|
gtk_cell_view_get_cell_renderers (GtkCellView *cell_view)
|
2006-12-29 07:53:01 +00:00
|
|
|
{
|
2009-07-08 14:38:40 +00:00
|
|
|
return gtk_cell_view_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_view));
|
2006-12-29 07:53:01 +00:00
|
|
|
}
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
static gboolean
|
|
|
|
gtk_cell_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
GtkBuilder *builder,
|
|
|
|
GObject *child,
|
|
|
|
const gchar *tagname,
|
|
|
|
GMarkupParser *parser,
|
|
|
|
gpointer *data)
|
|
|
|
{
|
2008-07-07 02:45:51 +00:00
|
|
|
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);
|
2008-07-07 02:45:51 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-20 07:01:23 +00:00
|
|
|
#define __GTK_CELL_VIEW_C__
|
|
|
|
#include "gtkaliasdef.c"
|