diff options
author | Matthias Clasen <mclasen@redhat.com> | 2006-12-29 07:53:01 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-12-29 07:53:01 +0000 |
commit | 6fa25d074e3bc5b06c7346a97bd06da74064a63a (patch) | |
tree | 13a1cf5d0fc4804efbc3f96c8fbc014d684b8a1d | |
parent | b3ef93d8ee2139996d1a43b498a6314d5a2b2370 (diff) | |
download | gtk+-6fa25d074e3bc5b06c7346a97bd06da74064a63a.tar.gz |
New function to get the cell renderers of a cell layout.
2006-12-29 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk.symbols:
* gtk/gtkcelllayout.[hc] (gtk_cell_layout_get_cells):
New function to get the cell renderers of a cell layout.
* gtk/gtktreeviewcolumn.c:
* gtk/gtkcellview.c:
* gtk/gtkiconview.c: Implement get_cells.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | docs/reference/ChangeLog | 6 | ||||
-rw-r--r-- | docs/reference/gtk/gtk-docs.sgml | 3 | ||||
-rw-r--r-- | docs/reference/gtk/gtk-sections.txt | 1 | ||||
-rw-r--r-- | gtk/gtk.symbols | 1 | ||||
-rw-r--r-- | gtk/gtkcelllayout.c | 26 | ||||
-rw-r--r-- | gtk/gtkcelllayout.h | 2 | ||||
-rw-r--r-- | gtk/gtkcellview.c | 10 | ||||
-rw-r--r-- | gtk/gtkiconview.c | 19 | ||||
-rw-r--r-- | gtk/gtktreeviewcolumn.c | 8 |
10 files changed, 85 insertions, 1 deletions
@@ -1,3 +1,13 @@ +2006-12-29 Matthias Clasen <mclasen@redhat.com> + + * gtk/gtk.symbols: + * gtk/gtkcelllayout.[hc] (gtk_cell_layout_get_cells): + New function to get the cell renderers of a cell layout. + + * gtk/gtktreeviewcolumn.c: + * gtk/gtkcellview.c: + * gtk/gtkiconview.c: Implement get_cells. + 2006-12-28 Matthias Clasen <mclasen@redhat.com> * gtk/gtkiconview.c: Use word wrapping by default, and diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 9b4e8b732c..93be8c442e 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,9 @@ +2006-12-29 Matthias Clasen <mclasen@redhat.com> + + * gtk/gtk-sections.txt: Add gtk_cell_layout_get_cells. + + * gtk/gtk-docs.sgml: Add a "Since 2.12" index. + 2006-12-22 Matthias Clasen <mclasen@redhat.com> * gdk/gdk-sections.txt: Add new functions. diff --git a/docs/reference/gtk/gtk-docs.sgml b/docs/reference/gtk/gtk-docs.sgml index 7d65699825..87c9f2bd58 100644 --- a/docs/reference/gtk/gtk-docs.sgml +++ b/docs/reference/gtk/gtk-docs.sgml @@ -671,5 +671,8 @@ that is, GUI components such as <link linkend="GtkButton">GtkButton</link> or <index role="2.10"> <title>Index of new symbols in 2.10</title> </index> + <index role="2.12"> + <title>Index of new symbols in 2.12</title> + </index> </book> diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk-sections.txt index 8b58ed4a42..258df39efc 100644 --- a/docs/reference/gtk/gtk-sections.txt +++ b/docs/reference/gtk/gtk-sections.txt @@ -4574,6 +4574,7 @@ GtkCellLayoutIface GtkCellLayoutDataFunc gtk_cell_layout_pack_start gtk_cell_layout_pack_end +gtk_cell_layout_get_cells gtk_cell_layout_reorder gtk_cell_layout_clear gtk_cell_layout_set_attributes diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 573137fd9f..e4b382f1c1 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -498,6 +498,7 @@ gtk_cell_layout_clear_attributes gtk_cell_layout_get_type G_GNUC_CONST gtk_cell_layout_pack_end gtk_cell_layout_pack_start +gtk_cell_layout_get_cells gtk_cell_layout_reorder gtk_cell_layout_set_attributes G_GNUC_NULL_TERMINATED gtk_cell_layout_set_cell_data_func diff --git a/gtk/gtkcelllayout.c b/gtk/gtkcelllayout.c index e866271a44..10cf3c4267 100644 --- a/gtk/gtkcelllayout.c +++ b/gtk/gtkcelllayout.c @@ -283,5 +283,31 @@ gtk_cell_layout_reorder (GtkCellLayout *cell_layout, position); } +/** + * gtk_cell_layout_get_cells: + * @cell_layout: a #GtkCellLayout + * + * Returns the cell renderers which have been added to @cell_layout. + * + * 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.12 + */ +GList * +gtk_cell_layout_get_cells (GtkCellLayout *cell_layout) +{ + GtkCellLayoutIface *iface; + + g_return_val_if_fail (GTK_IS_CELL_LAYOUT (cell_layout), NULL); + + iface = GTK_CELL_LAYOUT_GET_IFACE (cell_layout); + if (iface->get_cells) + return iface->get_cells (cell_layout); + + return NULL; +} + #define __GTK_CELL_LAYOUT_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkcelllayout.h b/gtk/gtkcelllayout.h index 3b4d375a59..520f35dbc1 100644 --- a/gtk/gtkcelllayout.h +++ b/gtk/gtkcelllayout.h @@ -68,6 +68,7 @@ struct _GtkCellLayoutIface void (* reorder) (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gint position); + GList* (* get_cells) (GtkCellLayout *cell_layout); }; GType gtk_cell_layout_get_type (void) G_GNUC_CONST; @@ -77,6 +78,7 @@ void gtk_cell_layout_pack_start (GtkCellLayout *cell_layout, void gtk_cell_layout_pack_end (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand); +GList *gtk_cell_layout_get_cells (GtkCellLayout *cell_layout); void gtk_cell_layout_clear (GtkCellLayout *cell_layout); void gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell, diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c index 405a8ba0ad..1cd3fc7065 100644 --- a/gtk/gtkcellview.c +++ b/gtk/gtkcellview.c @@ -103,7 +103,7 @@ static void gtk_cell_view_cell_layout_set_cell_data_func (GtkCellLayout static void gtk_cell_view_cell_layout_reorder (GtkCellLayout *layout, GtkCellRenderer *cell, gint position); - +static GList * gtk_cell_view_cell_layout_get_cells (GtkCellLayout *layout); #define GTK_CELL_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_VIEW, GtkCellViewPrivate)) @@ -184,6 +184,7 @@ gtk_cell_view_cell_layout_init (GtkCellLayoutIface *iface) iface->set_cell_data_func = gtk_cell_view_cell_layout_set_cell_data_func; iface->clear_attributes = gtk_cell_view_cell_layout_clear_attributes; iface->reorder = gtk_cell_view_cell_layout_reorder; + iface->get_cells = gtk_cell_view_cell_layout_get_cells; } static void @@ -1060,5 +1061,12 @@ gtk_cell_view_get_cell_renderers (GtkCellView *cell_view) return g_list_reverse (retval); } +static GList * +gtk_cell_view_cell_layout_get_cells (GtkCellLayout *layout) +{ + return gtk_cell_view_get_cell_renderers (GTK_CELL_VIEW (layout)); +} + + #define __GTK_CELL_VIEW_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 218e653f93..f7ecd435f8 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -383,6 +383,8 @@ static void gtk_icon_view_cell_layout_set_cell_data_func (GtkCel static void gtk_icon_view_cell_layout_reorder (GtkCellLayout *layout, GtkCellRenderer *cell, gint position); +static GList * gtk_icon_view_cell_layout_get_cells (GtkCellLayout *layout); + static void gtk_icon_view_item_activate_cell (GtkIconView *icon_view, GtkIconViewItem *item, GtkIconViewCellInfo *cell_info, @@ -893,6 +895,7 @@ gtk_icon_view_cell_layout_init (GtkCellLayoutIface *iface) iface->set_cell_data_func = gtk_icon_view_cell_layout_set_cell_data_func; iface->clear_attributes = gtk_icon_view_cell_layout_clear_attributes; iface->reorder = gtk_icon_view_cell_layout_reorder; + iface->get_cells = gtk_icon_view_cell_layout_get_cells; } static void @@ -4375,6 +4378,22 @@ gtk_icon_view_cell_layout_reorder (GtkCellLayout *layout, gtk_widget_queue_draw (GTK_WIDGET (icon_view)); } +static GList * +gtk_icon_view_cell_layout_get_cells (GtkCellLayout *layout) +{ + GtkIconView *icon_view = (GtkIconView *)layout; + GList *retval = NULL, *l; + + for (l = icon_view->priv->cell_list; l; l = l->next) + { + GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data; + + retval = g_list_prepend (retval, info->cell); + } + + return g_list_reverse (retval); +} + /* Public API */ diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 69cd5f7fb5..6904c6f38a 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -112,6 +112,7 @@ static void gtk_tree_view_column_cell_layout_clear_attributes (GtkCellLayout static void gtk_tree_view_column_cell_layout_reorder (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gint position); +static GList *gtk_tree_view_column_cell_layout_get_cells (GtkCellLayout *cell_layout); /* Button handling code */ static void gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column); @@ -332,6 +333,7 @@ gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface) iface->set_cell_data_func = gtk_tree_view_column_cell_layout_set_cell_data_func; iface->clear_attributes = gtk_tree_view_column_cell_layout_clear_attributes; iface->reorder = gtk_tree_view_column_cell_layout_reorder; + iface->get_cells = gtk_tree_view_column_cell_layout_get_cells; } static void @@ -1552,6 +1554,12 @@ gtk_tree_view_column_get_cell_renderers (GtkTreeViewColumn *tree_column) return retval; } +static GList * +gtk_tree_view_column_cell_layout_get_cells (GtkCellLayout *layout) +{ + return gtk_tree_view_column_get_cell_renderers (GTK_TREE_VIEW_COLUMN (layout)); +} + /** * gtk_tree_view_column_add_attribute: * @tree_column: A #GtkTreeViewColumn. |