From e37b58efec96ce102e8c354a979a2b37d28249c7 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 24 Apr 2001 02:23:47 +0000 Subject: Documented this function properly. 2001-04-23 Christopher James Lahey * e-table.c (e_table_get_cell_geometry): Documented this function properly. * e-tree.c, e-tree.h (e_tree_get_cell_geometry): Added this function. svn path=/trunk/; revision=9533 --- widgets/table/e-tree.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'widgets/table/e-tree.c') diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index dc76561848..cd6e90e4f6 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1781,6 +1781,38 @@ e_tree_get_cell_at (ETree *tree, e_table_item_compute_location(E_TABLE_ITEM(tree->priv->item), &x, &y, row_return, col_return); } +/** + * e_tree_get_cell_geometry: + * @tree: The tree. + * @row: The row to get the geometry of. + * @col: The col to get the geometry of. + * @x_return: Returns the x coordinate of the upper right hand corner of the cell with respect to the widget. + * @y_return: Returns the y coordinate of the upper right hand corner of the cell with respect to the widget. + * @width_return: Returns the width of the cell. + * @height_return: Returns the height of the cell. + * + * Computes the data about this cell. + **/ +void +e_tree_get_cell_geometry (ETree *tree, + int row, int col, + int *x_return, int *y_return, + int *width_return, int *height_return) +{ + g_return_if_fail (tree != NULL); + g_return_if_fail (E_IS_TREE (tree)); + + /* FIXME it would be nice if it could handle a NULL row_return or + * col_return gracefully. */ + + e_table_item_get_cell_geometry(E_TABLE_ITEM(tree->priv->item), &row, &col, x_return, y_return, width_return, height_return); + + if (x_return) + (*x_return) -= GTK_LAYOUT(tree->priv->table_canvas)->hadjustment->value; + if (y_return) + (*y_return) -= GTK_LAYOUT(tree->priv->table_canvas)->vadjustment->value; +} + static void et_drag_begin (GtkWidget *widget, GdkDragContext *context, -- cgit