mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-06 00:30:08 +00:00
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.
This commit is contained in:
parent
b3ef93d8ee
commit
6fa25d074e
10
ChangeLog
10
ChangeLog
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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,
|
||||
|
@ -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"
|
||||
|
@ -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 */
|
||||
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user