* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
* elements on a #cairo_t. Typically, one cell renderer is used to
* draw many cells on the screen. To this extent, it isn't expected that a
* CellRenderer keep any permanent state around. Instead, any state is set
- * just prior to use using #GObject<!-- -->s property system. Then, the
+ * just prior to use using #GObjects property system. Then, the
* cell is measured using gtk_cell_renderer_get_size(). Finally, the cell
* is rendered in the correct location using gtk_cell_renderer_render().
*
* There are a number of rules that must be followed when writing a new
- * #GtkCellRenderer. First and formost, its important that a certain set
+ * #GtkCellRenderer. First and foremost, it's important that a certain set
* of properties will always yield a cell renderer of the same size,
* barring a #GtkStyle change. The #GtkCellRenderer also has a number of
* generic properties that are expected to be honored by all children.
* To make a cell renderer activatable or editable, you have to
* implement the #GtkCellRendererClass.activate or
* #GtkCellRendererClass.start_editing virtual functions, respectively.
+ *
+ * Many properties of #GtkCellRenderer and its subclasses have a
+ * corresponding "set" property, e.g. "cell-background-set" corresponds
+ * to "cell-background". These "set" properties reflect whether a property
+ * has been set or not. You should not set them independently.
*/
NULL,
GTK_PARAM_WRITABLE));
+ /**
+ * GtkCellRenderer:cell-background-gdk:
+ *
+ * Cell background as a #GdkColor
+ *
+ * Deprecated: 3.4: Use #GtkCellRenderer:cell-background-rgba instead.
+ */
g_object_class_install_property (object_class,
PROP_CELL_BACKGROUND_GDK,
g_param_spec_boxed ("cell-background-gdk",
P_("Cell background color"),
P_("Cell background color as a GdkColor"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkCellRenderer:cell-background-rgba:
*
ADD_SET_PROP ("cell-background-set", PROP_CELL_BACKGROUND_SET,
P_("Cell background set"),
- P_("Whether this tag affects the cell background color"));
+ P_("Whether the cell background color is set"));
g_type_class_add_private (class, sizeof (GtkCellRendererPrivate));
- _gtk_cell_renderer_class_set_accessible_type (class, GTK_TYPE_RENDERER_CELL_ACCESSIBLE);
+ gtk_cell_renderer_class_set_accessible_type (class, GTK_TYPE_RENDERER_CELL_ACCESSIBLE);
}
static void
(GdkRectangle *) background_area,
(GdkRectangle *) cell_area,
flags);
+ gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (editable)),
+ GTK_STYLE_CLASS_CELL);
g_signal_emit (cell,
cell_renderer_signals[EDITING_STARTED], 0,
g_return_val_if_fail (!cell || GTK_IS_CELL_RENDERER (cell), 0);
g_return_val_if_fail (!widget || GTK_IS_WIDGET (widget), 0);
- if ((widget && !gtk_widget_is_sensitive (widget)) ||
+ if (widget)
+ state |= gtk_widget_get_state_flags (widget);
+
+ state &= ~(GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED);
+
+ if ((state & GTK_STATE_FLAG_INSENSITIVE) != 0 ||
(cell && !gtk_cell_renderer_get_sensitive (cell)) ||
(cell_state & GTK_CELL_RENDERER_INSENSITIVE) != 0)
{
return state;
}
-/*
- * _gtk_cell_renderer_class_set_accessible_type:
+/**
+ * gtk_cell_renderer_class_set_accessible_type:
* @renderer_class: class to set the accessible type for
* @type: The object type that implements the accessible for @widget_class.
* The type must be a subtype of #GtkRendererCellAccessible
* renderers.
**/
void
-_gtk_cell_renderer_class_set_accessible_type (GtkCellRendererClass *renderer_class,
- GType type)
+gtk_cell_renderer_class_set_accessible_type (GtkCellRendererClass *renderer_class,
+ GType type)
{
GtkCellRendererClassPrivate *priv;