From 1ad5fa3e7a8f41e95057bd8e9ff8c32a5c8b8459 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom <tristan.van.berkom@gmail.com> Date: Fri, 5 Nov 2010 13:05:20 +0900 Subject: Committing half-way done focus work. --- gtk/gtkcellrenderer.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gtk/gtkcellrenderer.c') diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c index 3656599483..da6c77ce92 100644 --- a/gtk/gtkcellrenderer.c +++ b/gtk/gtkcellrenderer.c @@ -1058,6 +1058,32 @@ gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell) return cell->priv->sensitive; } + +/** + * gtk_cell_renderer_can_focus: + * @cell: A #GtkCellRenderer + * + * Checks whether the cell renderer can receive focus. + * + * Returns: %TRUE if the cell renderer can do anything with keyboard focus + * + * Since: 3.0 + */ +gboolean +gtk_cell_renderer_can_focus (GtkCellRenderer *cell) +{ + GtkCellRendererPrivate *priv; + + g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), FALSE); + + priv = cell->priv; + + return (cell->priv->visible && + (cell->priv->mode == GTK_CELL_RENDERER_MODE_EDITABLE || + cell->priv->mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)); +} + + /** * gtk_cell_renderer_stop_editing: * @cell: A #GtkCellRenderer -- cgit v1.2.1