GList *current);
static void gtk_tree_view_column_clear_attributes_by_info (GtkTreeViewColumn *tree_column,
GtkTreeViewColumnCellInfo *info);
+/* GtkBuildable implementation */
+static void gtk_tree_view_column_buildable_init (GtkBuildableIface *iface);
static guint tree_column_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_CODE (GtkTreeViewColumn, gtk_tree_view_column, GTK_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
- gtk_tree_view_column_cell_layout_init))
+ gtk_tree_view_column_cell_layout_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+ gtk_tree_view_column_buildable_init))
+
static void
gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
}
+static void
+gtk_tree_view_column_buildable_init (GtkBuildableIface *iface)
+{
+ iface->add_child = _gtk_cell_layout_buildable_add_child;
+ iface->custom_tag_start = _gtk_cell_layout_buildable_custom_tag_start;
+ iface->custom_tag_end = _gtk_cell_layout_buildable_custom_tag_end;
+}
+
static void
gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface)
{
g_return_if_fail (link != NULL);
- column->cell_list = g_list_remove_link (column->cell_list, link);
+ column->cell_list = g_list_delete_link (column->cell_list, link);
column->cell_list = g_list_insert (column->cell_list, info, position);
if (column->tree_view)
&sort_column_id,
NULL);
- if (tree_column->show_sort_indicator
- || (sort_column_id >= 0 && sort_column_id == tree_column->sort_column_id))
+ if (tree_column->show_sort_indicator)
{
gboolean alternative;
* gtk_tree_view_column_set_attributes() on the newly created #GtkTreeViewColumn.
*
* Here's a simple example:
- * <informalexample><programlisting>
+ * |[
* enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS };
* ...
* {
* GtkTreeViewColumn *column;
- * GtkCellRenderer *renderer = gtk_cell_renderer_text_new (<!-- -->);
+ * GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
*
* column = gtk_tree_view_column_new_with_attributes ("Title",
* renderer,
* "foreground", COLOR_COLUMN,
* NULL);
* }
- * </programlisting></informalexample>
+ * ]|
*
* Return value: A newly created #GtkTreeViewColumn.
**/
real_background_area = *background_area;
- if (rtl)
- depth = real_background_area.width - real_cell_area.width - horizontal_separator/2;
- else
- depth = real_cell_area.x - real_background_area.x - horizontal_separator/2;
-
real_cell_area.x += focus_line_width;
real_cell_area.y += focus_line_width;
real_cell_area.height -= 2 * focus_line_width;
+ if (rtl)
+ depth = real_background_area.width - real_cell_area.width;
+ else
+ depth = real_cell_area.x - real_background_area.x;
+
/* Find out how much extra space we have to allocate */
for (list = tree_column->cell_list; list; list = list->next)
{
path_string);
}
+void
+_gtk_tree_view_column_get_focus_area (GtkTreeViewColumn *tree_column,
+ GdkRectangle *background_area,
+ GdkRectangle *cell_area,
+ GdkRectangle *focus_area)
+{
+ gtk_tree_view_column_cell_process_action (tree_column,
+ NULL,
+ background_area,
+ cell_area,
+ 0,
+ CELL_ACTION_FOCUS,
+ NULL,
+ focus_area,
+ NULL, NULL, NULL);
+}
+
+
/* cell list manipulation */
static GList *
gtk_tree_view_column_cell_first (GtkTreeViewColumn *tree_column)
void
gtk_tree_view_column_queue_resize (GtkTreeViewColumn *tree_column)
{
- g_return_if_fail (tree_column != NULL);
+ g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
if (tree_column->tree_view)
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
}
+/**
+ * gtk_tree_view_column_get_tree_view:
+ * @tree_column: A #GtkTreeViewColumn
+ *
+ * Returns the #GtkTreeView wherein @tree_column has been inserted. If
+ * @column is currently not inserted in any tree view, %NULL is
+ * returned.
+ *
+ * Return value: The tree view wherein @column has been inserted if any,
+ * %NULL otherwise.
+ *
+ * Since: 2.12
+ */
+GtkWidget *
+gtk_tree_view_column_get_tree_view (GtkTreeViewColumn *tree_column)
+{
+ g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
+
+ return tree_column->tree_view;
+}
+
#define __GTK_TREE_VIEW_COLUMN_C__
#include "gtkaliasdef.c"