]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktreeviewcolumn.c
Make GtkCellArea use GtkStyleContext
[~andy/gtk] / gtk / gtktreeviewcolumn.c
index 612732f5499f73b9f1e2c5a29d976ebfd301a568..809eec145a1ab832f5d67acde9fa7f8a6bc0283c 100644 (file)
@@ -496,8 +496,6 @@ gtk_tree_view_column_constructor (GType                    type,
       g_object_ref_sink (priv->cell_area);
     }
 
-  gtk_cell_area_set_style_detail (priv->cell_area, "treeview");
-
   priv->add_editable_signal =
     g_signal_connect (priv->cell_area, "add-editable",
                      G_CALLBACK (gtk_tree_view_column_add_editable_callback),
@@ -1515,6 +1513,45 @@ _gtk_tree_view_column_get_cell_at_pos (GtkTreeViewColumn *column,
   return match;
 }
 
+gboolean
+_gtk_tree_view_column_is_blank_at_pos (GtkTreeViewColumn *column,
+                                       GdkRectangle      *cell_area,
+                                       GdkRectangle      *background_area,
+                                       gint               x,
+                                       gint               y)
+{
+  GtkCellRenderer *match;
+  GdkRectangle cell_alloc, aligned_area, inner_area;
+  GtkTreeViewColumnPrivate *priv = column->priv;
+
+  match = _gtk_tree_view_column_get_cell_at_pos (column,
+                                                 cell_area,
+                                                 background_area,
+                                                 x, y);
+  if (!match)
+    return FALSE;
+
+  gtk_cell_area_get_cell_allocation (priv->cell_area,
+                                     priv->cell_area_context,
+                                     priv->tree_view,
+                                     match,
+                                     cell_area,
+                                     &cell_alloc);
+
+  gtk_cell_area_inner_cell_area (priv->cell_area, priv->tree_view,
+                                 &cell_alloc, &inner_area);
+  gtk_cell_renderer_get_aligned_area (match, priv->tree_view, 0,
+                                      &inner_area, &aligned_area);
+
+  if (x < aligned_area.x ||
+      x > aligned_area.x + aligned_area.width ||
+      y < aligned_area.y ||
+      y > aligned_area.y + aligned_area.height)
+    return TRUE;
+
+  return FALSE;
+}
+
 /* Public Functions */
 
 
@@ -1731,7 +1768,7 @@ gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
  * gtk_tree_view_column_set_cell_data_func:
  * @tree_column: A #GtkTreeViewColumn
  * @cell_renderer: A #GtkCellRenderer
- * @func: The #GtkTreeViewColumnFunc to use. 
+ * @func: (allow-none): The #GtkTreeViewColumnFunc to use. 
  * @func_data: The user data for @func.
  * @destroy: The destroy notification for @func_data
  * 
@@ -2753,10 +2790,10 @@ gtk_tree_view_column_cell_set_cell_data (GtkTreeViewColumn *tree_column,
  * gtk_tree_view_column_cell_get_size:
  * @tree_column: A #GtkTreeViewColumn.
  * @cell_area: (allow-none): The area a cell in the column will be allocated, or %NULL
- * @x_offset: (allow-none): location to return x offset of a cell relative to @cell_area, or %NULL
- * @y_offset: (allow-none): location to return y offset of a cell relative to @cell_area, or %NULL
- * @width: (allow-none): location to return width needed to render a cell, or %NULL
- * @height: (allow-none): location to return height needed to render a cell, or %NULL
+ * @x_offset: (out) (allow-none): location to return x offset of a cell relative to @cell_area, or %NULL
+ * @y_offset: (out) (allow-none): location to return y offset of a cell relative to @cell_area, or %NULL
+ * @width: (out) (allow-none): location to return width needed to render a cell, or %NULL
+ * @height: (out) (allow-none): location to return height needed to render a cell, or %NULL
  * 
  * Obtains the width and height needed to render the column.  This is used
  * primarily by the #GtkTreeView.
@@ -2955,9 +2992,10 @@ _gtk_tree_view_column_cell_get_dirty (GtkTreeViewColumn  *tree_column)
  * gtk_tree_view_column_cell_get_position:
  * @tree_column: a #GtkTreeViewColumn
  * @cell_renderer: a #GtkCellRenderer
- * @x_offset: return location for the horizontal position of @cell within
- *            @tree_column, may be %NULL
- * @width: return location for the width of @cell, may be %NULL
+ * @x_offset: (out) (allow-none): return location for the horizontal
+ *            position of @cell within @tree_column, may be %NULL
+ * @width: (out) (allow-none): return location for the width of @cell,
+ *         may be %NULL
  *
  * Obtains the horizontal position and size of a cell in a column. If the
  * cell is not found in the column, @start_pos and @width are not changed and