]> Pileus Git - ~andy/gtk/blob - gtk/gtkcellrenderer.c
Make sure to include <config.h> (#137001)
[~andy/gtk] / gtk / gtkcellrenderer.c
1 /* gtkcellrenderer.c
2  * Copyright (C) 2000  Red Hat, Inc. Jonathan Blandford
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include <config.h>
21 #include "gtkcellrenderer.h"
22 #include "gtkintl.h"
23 #include "gtkmarshalers.h"
24 #include "gtktreeprivate.h"
25
26 static void gtk_cell_renderer_init       (GtkCellRenderer      *cell);
27 static void gtk_cell_renderer_class_init (GtkCellRendererClass *class);
28 static void gtk_cell_renderer_get_property  (GObject              *object,
29                                              guint                 param_id,
30                                              GValue               *value,
31                                              GParamSpec           *pspec);
32 static void gtk_cell_renderer_set_property  (GObject              *object,
33                                              guint                 param_id,
34                                              const GValue         *value,
35                                              GParamSpec           *pspec);
36 static void set_cell_bg_color               (GtkCellRenderer      *cell,
37                                              GdkColor             *color);
38
39
40 #define GTK_CELL_RENDERER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_RENDERER, GtkCellRendererPrivate))
41
42 typedef struct _GtkCellRendererPrivate GtkCellRendererPrivate;
43 struct _GtkCellRendererPrivate
44 {
45   GdkColor cell_background;
46 };
47
48
49 enum {
50   PROP_ZERO,
51   PROP_MODE,
52   PROP_VISIBLE,
53   PROP_XALIGN,
54   PROP_YALIGN,
55   PROP_XPAD,
56   PROP_YPAD,
57   PROP_WIDTH,
58   PROP_HEIGHT,
59   PROP_IS_EXPANDER,
60   PROP_IS_EXPANDED,
61   PROP_CELL_BACKGROUND,
62   PROP_CELL_BACKGROUND_GDK,
63   PROP_CELL_BACKGROUND_SET
64 };
65
66 /* Signal IDs */
67 enum {
68   EDITING_CANCELED,
69   LAST_SIGNAL
70 };
71
72 static guint cell_renderer_signals[LAST_SIGNAL] = { 0 };
73
74
75 GType
76 gtk_cell_renderer_get_type (void)
77 {
78   static GType cell_type = 0;
79
80   if (!cell_type)
81     {
82       static const GTypeInfo cell_info =
83       {
84         sizeof (GtkCellRendererClass),
85         NULL,           /* base_init */
86         NULL,           /* base_finalize */
87         (GClassInitFunc) gtk_cell_renderer_class_init,
88         NULL,           /* class_finalize */
89         NULL,           /* class_data */
90         sizeof (GtkCellRenderer),
91         0,              /* n_preallocs */
92         (GInstanceInitFunc) gtk_cell_renderer_init,
93         NULL,           /* value_table */
94       };
95
96       cell_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkCellRenderer", 
97                                           &cell_info, G_TYPE_FLAG_ABSTRACT);
98     }
99
100   return cell_type;
101 }
102
103 static void
104 gtk_cell_renderer_init (GtkCellRenderer *cell)
105 {
106   cell->mode = GTK_CELL_RENDERER_MODE_INERT;
107   cell->visible = TRUE;
108   cell->width = -1;
109   cell->height = -1;
110   cell->xalign = 0.5;
111   cell->yalign = 0.5;
112   cell->xpad = 0;
113   cell->ypad = 0;
114 }
115
116 static void
117 gtk_cell_renderer_class_init (GtkCellRendererClass *class)
118 {
119   GObjectClass *object_class = G_OBJECT_CLASS (class);
120
121   object_class->get_property = gtk_cell_renderer_get_property;
122   object_class->set_property = gtk_cell_renderer_set_property;
123
124   class->render = NULL;
125   class->get_size = NULL;
126
127   /**
128    * GtkCellRenderer::editing-canceled:
129    *
130    * This signal gets emitted when the user cancels the process of editing a
131    * cell.  For example, an editable cell renderer could be written to cancel
132    * editing when the user presses Escape.
133    *
134    * See also: gtk_cell_renderer_editing_canceled()
135    *
136    * Since: 2.4
137    */
138
139   cell_renderer_signals[EDITING_CANCELED] =
140     g_signal_new ("editing-canceled",
141                   G_OBJECT_CLASS_TYPE (object_class),
142                   G_SIGNAL_RUN_FIRST,
143                   G_STRUCT_OFFSET (GtkCellRendererClass, editing_canceled),
144                   NULL, NULL,
145                   _gtk_marshal_VOID__VOID,
146                   G_TYPE_NONE, 0);
147
148   g_object_class_install_property (object_class,
149                                    PROP_MODE,
150                                    g_param_spec_enum ("mode",
151                                                       P_("mode"),
152                                                       P_("Editable mode of the CellRenderer"),
153                                                       GTK_TYPE_CELL_RENDERER_MODE,
154                                                       GTK_CELL_RENDERER_MODE_INERT,
155                                                       G_PARAM_READABLE |
156                                                       G_PARAM_WRITABLE));
157
158   g_object_class_install_property (object_class,
159                                    PROP_VISIBLE,
160                                    g_param_spec_boolean ("visible",
161                                                          P_("visible"),
162                                                          P_("Display the cell"),
163                                                          TRUE,
164                                                          G_PARAM_READABLE |
165                                                          G_PARAM_WRITABLE));
166
167   g_object_class_install_property (object_class,
168                                    PROP_XALIGN,
169                                    g_param_spec_float ("xalign",
170                                                        P_("xalign"),
171                                                        P_("The x-align"),
172                                                        0.0,
173                                                        1.0,
174                                                        0.0,
175                                                        G_PARAM_READABLE |
176                                                        G_PARAM_WRITABLE));
177
178   g_object_class_install_property (object_class,
179                                    PROP_YALIGN,
180                                    g_param_spec_float ("yalign",
181                                                        P_("yalign"),
182                                                        P_("The y-align"),
183                                                        0.0,
184                                                        1.0,
185                                                        0.5,
186                                                        G_PARAM_READABLE |
187                                                        G_PARAM_WRITABLE));
188
189   g_object_class_install_property (object_class,
190                                    PROP_XPAD,
191                                    g_param_spec_uint ("xpad",
192                                                       P_("xpad"),
193                                                       P_("The xpad"),
194                                                       0,
195                                                       G_MAXUINT,
196                                                       2,
197                                                       G_PARAM_READABLE |
198                                                       G_PARAM_WRITABLE));
199
200   g_object_class_install_property (object_class,
201                                    PROP_YPAD,
202                                    g_param_spec_uint ("ypad",
203                                                       P_("ypad"),
204                                                       P_("The ypad"),
205                                                       0,
206                                                       G_MAXUINT,
207                                                       2,
208                                                       G_PARAM_READABLE |
209                                                       G_PARAM_WRITABLE));
210
211   g_object_class_install_property (object_class,
212                                    PROP_WIDTH,
213                                    g_param_spec_int ("width",
214                                                      P_("width"),
215                                                      P_("The fixed width"),
216                                                      -1,
217                                                      G_MAXINT,
218                                                      -1,
219                                                      G_PARAM_READABLE |
220                                                      G_PARAM_WRITABLE));
221
222   g_object_class_install_property (object_class,
223                                    PROP_HEIGHT,
224                                    g_param_spec_int ("height",
225                                                      P_("height"),
226                                                      P_("The fixed height"),
227                                                      -1,
228                                                      G_MAXINT,
229                                                      -1,
230                                                      G_PARAM_READABLE |
231                                                      G_PARAM_WRITABLE));
232
233   g_object_class_install_property (object_class,
234                                    PROP_IS_EXPANDER,
235                                    g_param_spec_boolean ("is_expander",
236                                                          P_("Is Expander"),
237                                                          P_("Row has children"),
238                                                          FALSE,
239                                                          G_PARAM_READABLE |
240                                                          G_PARAM_WRITABLE));
241
242
243   g_object_class_install_property (object_class,
244                                    PROP_IS_EXPANDED,
245                                    g_param_spec_boolean ("is_expanded",
246                                                          P_("Is Expanded"),
247                                                          P_("Row is an expander row, and is expanded"),
248                                                          FALSE,
249                                                          G_PARAM_READABLE |
250                                                          G_PARAM_WRITABLE));
251
252   g_object_class_install_property (object_class,
253                                    PROP_CELL_BACKGROUND,
254                                    g_param_spec_string ("cell_background",
255                                                         P_("Cell background color name"),
256                                                         P_("Cell background color as a string"),
257                                                         NULL,
258                                                         G_PARAM_WRITABLE));
259
260   g_object_class_install_property (object_class,
261                                    PROP_CELL_BACKGROUND_GDK,
262                                    g_param_spec_boxed ("cell_background_gdk",
263                                                        P_("Cell background color"),
264                                                        P_("Cell background color as a GdkColor"),
265                                                        GDK_TYPE_COLOR,
266                                                        G_PARAM_READABLE | G_PARAM_WRITABLE));
267
268
269 #define ADD_SET_PROP(propname, propval, nick, blurb) g_object_class_install_property (object_class, propval, g_param_spec_boolean (propname, nick, blurb, FALSE, G_PARAM_READABLE | G_PARAM_WRITABLE))
270
271   ADD_SET_PROP ("cell_background_set", PROP_CELL_BACKGROUND_SET,
272                 P_("Cell background set"),
273                 P_("Whether this tag affects the cell background color"));
274
275   g_type_class_add_private (object_class, sizeof (GtkCellRendererPrivate));
276 }
277
278 static void
279 gtk_cell_renderer_get_property (GObject     *object,
280                                 guint        param_id,
281                                 GValue      *value,
282                                 GParamSpec  *pspec)
283 {
284   GtkCellRenderer *cell = GTK_CELL_RENDERER (object);
285   GtkCellRendererPrivate *priv = GTK_CELL_RENDERER_GET_PRIVATE (object);
286
287   switch (param_id)
288     {
289     case PROP_MODE:
290       g_value_set_enum (value, cell->mode);
291       break;
292     case PROP_VISIBLE:
293       g_value_set_boolean (value, cell->visible);
294       break;
295     case PROP_XALIGN:
296       g_value_set_float (value, cell->xalign);
297       break;
298     case PROP_YALIGN:
299       g_value_set_float (value, cell->yalign);
300       break;
301     case PROP_XPAD:
302       g_value_set_uint (value, cell->xpad);
303       break;
304     case PROP_YPAD:
305       g_value_set_uint (value, cell->ypad);
306       break;
307     case PROP_WIDTH:
308       g_value_set_int (value, cell->width);
309       break;
310     case PROP_HEIGHT:
311       g_value_set_int (value, cell->height);
312       break;
313     case PROP_IS_EXPANDER:
314       g_value_set_boolean (value, cell->is_expander);
315       break;
316     case PROP_IS_EXPANDED:
317       g_value_set_boolean (value, cell->is_expanded);
318       break;
319     case PROP_CELL_BACKGROUND_GDK:
320       {
321         GdkColor color;
322
323         color.red = priv->cell_background.red;
324         color.green = priv->cell_background.green;
325         color.blue = priv->cell_background.blue;
326
327         g_value_set_boxed (value, &color);
328       }
329       break;
330     case PROP_CELL_BACKGROUND_SET:
331       g_value_set_boolean (value, cell->cell_background_set);
332       break;
333     case PROP_CELL_BACKGROUND:
334     default:
335       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
336       break;
337     }
338
339 }
340
341 static void
342 gtk_cell_renderer_set_property (GObject      *object,
343                                 guint         param_id,
344                                 const GValue *value,
345                                 GParamSpec   *pspec)
346 {
347   GtkCellRenderer *cell = GTK_CELL_RENDERER (object);
348
349   switch (param_id)
350     {
351     case PROP_MODE:
352       cell->mode = g_value_get_enum (value);
353       break;
354     case PROP_VISIBLE:
355       cell->visible = g_value_get_boolean (value);
356       break;
357     case PROP_XALIGN:
358       cell->xalign = g_value_get_float (value);
359       break;
360     case PROP_YALIGN:
361       cell->yalign = g_value_get_float (value);
362       break;
363     case PROP_XPAD:
364       cell->xpad = g_value_get_uint (value);
365       break;
366     case PROP_YPAD:
367       cell->ypad = g_value_get_uint (value);
368       break;
369     case PROP_WIDTH:
370       cell->width = g_value_get_int (value);
371       break;
372     case PROP_HEIGHT:
373       cell->height = g_value_get_int (value);
374       break;
375     case PROP_IS_EXPANDER:
376       cell->is_expander = g_value_get_boolean (value);
377       break;
378     case PROP_IS_EXPANDED:
379       cell->is_expanded = g_value_get_boolean (value);
380       break;
381     case PROP_CELL_BACKGROUND:
382       {
383         GdkColor color;
384
385         if (!g_value_get_string (value))
386           set_cell_bg_color (cell, NULL);
387         else if (gdk_color_parse (g_value_get_string (value), &color))
388           set_cell_bg_color (cell, &color);
389         else
390           g_warning ("Don't know color `%s'", g_value_get_string (value));
391
392         g_object_notify (object, "cell_background_gdk");
393       }
394       break;
395     case PROP_CELL_BACKGROUND_GDK:
396       set_cell_bg_color (cell, g_value_get_boxed (value));
397       break;
398     case PROP_CELL_BACKGROUND_SET:
399       cell->cell_background_set = g_value_get_boolean (value);
400       break;
401     default:
402       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
403       break;
404     }
405 }
406
407 static void
408 set_cell_bg_color (GtkCellRenderer *cell,
409                    GdkColor        *color)
410 {
411   GtkCellRendererPrivate *priv = GTK_CELL_RENDERER_GET_PRIVATE (cell);
412
413   if (color)
414     {
415       if (!cell->cell_background_set)
416         {
417           cell->cell_background_set = TRUE;
418           g_object_notify (G_OBJECT (cell), "cell_background_set");
419         }
420
421       priv->cell_background.red = color->red;
422       priv->cell_background.green = color->green;
423       priv->cell_background.blue = color->blue;
424     }
425   else
426     {
427       if (cell->cell_background_set)
428         {
429           cell->cell_background_set = FALSE;
430           g_object_notify (G_OBJECT (cell), "cell_background_set");
431         }
432     }
433 }
434
435 /**
436  * gtk_cell_renderer_get_size:
437  * @cell: a #GtkCellRenderer
438  * @widget: the widget the renderer is rendering to
439  * @cell_area: The area a cell will be allocated, or %NULL
440  * @x_offset: location to return x offset of cell relative to @cell_area, or %NULL
441  * @y_offset: location to return y offset of cell relative to @cell_area, or %NULL
442  * @width: location to return width needed to render a cell, or %NULL
443  * @height: location to return height needed to render a cell, or %NULL
444  *
445  * Obtains the width and height needed to render the cell. Used by view widgets
446  * to determine the appropriate size for the cell_area passed to
447  * gtk_cell_renderer_render().  If @cell_area is not %NULL, fills in the x and y
448  * offsets (if set) of the cell relative to this location.  Please note that the
449  * values set in @width and @height, as well as those in @x_offset and @y_offset
450  * are inclusive of the xpad and ypad properties.
451  **/
452 void
453 gtk_cell_renderer_get_size (GtkCellRenderer *cell,
454                             GtkWidget       *widget,
455                             GdkRectangle    *cell_area,
456                             gint            *x_offset,
457                             gint            *y_offset,
458                             gint            *width,
459                             gint            *height)
460 {
461   gint *real_width = width;
462   gint *real_height = height;
463
464   g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
465   g_return_if_fail (GTK_CELL_RENDERER_GET_CLASS (cell)->get_size != NULL);
466
467   if (width && cell->width != -1)
468     {
469       real_width = NULL;
470       *width = cell->width;
471     }
472   if (height && cell->height != -1)
473     {
474       real_height = NULL;
475       *height = cell->height;
476     }
477
478   GTK_CELL_RENDERER_GET_CLASS (cell)->get_size (cell,
479                                                 widget,
480                                                 cell_area,
481                                                 x_offset,
482                                                 y_offset,
483                                                 real_width,
484                                                 real_height);
485 }
486
487 /**
488  * gtk_cell_renderer_render:
489  * @cell: a #GtkCellRenderer
490  * @window: a #GdkDrawable to draw to
491  * @widget: the widget owning @window
492  * @background_area: entire cell area (including tree expanders and maybe padding on the sides)
493  * @cell_area: area normally rendered by a cell renderer
494  * @expose_area: area that actually needs updating
495  * @flags: flags that affect rendering
496  *
497  * Invokes the virtual render function of the #GtkCellRenderer. The three
498  * passed-in rectangles are areas of @window. Most renderers will draw within
499  * @cell_area; the xalign, yalign, xpad, and ypad fields of the #GtkCellRenderer
500  * should be honored with respect to @cell_area. @background_area includes the
501  * blank space around the cell, and also the area containing the tree expander;
502  * so the @background_area rectangles for all cells tile to cover the entire
503  * @window.  @expose_area is a clip rectangle.
504  *
505  **/
506 void
507 gtk_cell_renderer_render (GtkCellRenderer     *cell,
508                           GdkWindow           *window,
509                           GtkWidget           *widget,
510                           GdkRectangle        *background_area,
511                           GdkRectangle        *cell_area,
512                           GdkRectangle        *expose_area,
513                           GtkCellRendererState flags)
514 {
515   gboolean selected = FALSE;
516   GtkCellRendererPrivate *priv = GTK_CELL_RENDERER_GET_PRIVATE (cell);
517
518   g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
519   g_return_if_fail (GTK_CELL_RENDERER_GET_CLASS (cell)->render != NULL);
520
521   selected = (flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED;
522
523   if (cell->cell_background_set && !selected)
524     {
525       GdkColor color;
526       GdkGC *gc;
527
528       color.red = priv->cell_background.red;
529       color.green = priv->cell_background.green;
530       color.blue = priv->cell_background.blue;
531
532       gc = gdk_gc_new (window);
533       gdk_gc_set_rgb_fg_color (gc, &color);
534       gdk_draw_rectangle (window, gc, TRUE,
535                           background_area->x, background_area->y,
536                           background_area->width, background_area->height);
537       g_object_unref (gc);
538     }
539
540   GTK_CELL_RENDERER_GET_CLASS (cell)->render (cell,
541                                               window,
542                                               widget,
543                                               background_area,
544                                               cell_area,
545                                               expose_area,
546                                               flags);
547 }
548
549 /**
550  * gtk_cell_renderer_activate:
551  * @cell: a #GtkCellRenderer
552  * @event: a #GdkEvent
553  * @widget: widget that received the event
554  * @path: widget-dependent string representation of the event location; e.g. for #GtkTreeView, a string representation of #GtkTreePath
555  * @background_area: background area as passed to @gtk_cell_renderer_render
556  * @cell_area: cell area as passed to @gtk_cell_renderer_render
557  * @flags: render flags
558  *
559  * Passes an activate event to the cell renderer for possible processing.  Some
560  * cell renderers may use events; for example, #GtkCellRendererToggle toggles
561  * when it gets a mouse click.
562  *
563  * Return value: %TRUE if the event was consumed/handled
564  **/
565 gboolean
566 gtk_cell_renderer_activate (GtkCellRenderer      *cell,
567                             GdkEvent             *event,
568                             GtkWidget            *widget,
569                             const gchar          *path,
570                             GdkRectangle         *background_area,
571                             GdkRectangle         *cell_area,
572                             GtkCellRendererState  flags)
573 {
574   g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), FALSE);
575
576   if (cell->mode != GTK_CELL_RENDERER_MODE_ACTIVATABLE)
577     return FALSE;
578
579   if (GTK_CELL_RENDERER_GET_CLASS (cell)->activate == NULL)
580     return FALSE;
581
582   return GTK_CELL_RENDERER_GET_CLASS (cell)->activate (cell,
583                                                        event,
584                                                        widget,
585                                                        path,
586                                                        background_area,
587                                                        cell_area,
588                                                        flags);
589 }
590
591 /**
592  * gtk_cell_renderer_start_editing:
593  * @cell: a #GtkCellRenderer
594  * @event: a #GdkEvent
595  * @widget: widget that received the event
596  * @path: widget-dependent string representation of the event location; e.g. for #GtkTreeView, a string representation of #GtkTreePath
597  * @background_area: background area as passed to @gtk_cell_renderer_render
598  * @cell_area: cell area as passed to @gtk_cell_renderer_render
599  * @flags: render flags
600  * 
601  * Passes an activate event to the cell renderer for possible processing.
602  * 
603  * Return value: A new #GtkCellEditable, or %NULL
604  **/
605 GtkCellEditable *
606 gtk_cell_renderer_start_editing (GtkCellRenderer      *cell,
607                                  GdkEvent             *event,
608                                  GtkWidget            *widget,
609                                  const gchar          *path,
610                                  GdkRectangle         *background_area,
611                                  GdkRectangle         *cell_area,
612                                  GtkCellRendererState  flags)
613
614 {
615   g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), NULL);
616
617   if (cell->mode != GTK_CELL_RENDERER_MODE_EDITABLE)
618     return NULL;
619
620   if (GTK_CELL_RENDERER_GET_CLASS (cell)->start_editing == NULL)
621     return NULL;
622
623   
624   return GTK_CELL_RENDERER_GET_CLASS (cell)->start_editing (cell,
625                                                             event,
626                                                             widget,
627                                                             path,
628                                                             background_area,
629                                                             cell_area,
630                                                             flags);
631 }
632
633 /**
634  * gtk_cell_renderer_set_fixed_size:
635  * @cell: A #GtkCellRenderer
636  * @width: the width of the cell renderer, or -1
637  * @height: the height of the cell renderer, or -1
638  * 
639  * Sets the renderer size to be explicit, independent of the properties set.
640  **/
641 void
642 gtk_cell_renderer_set_fixed_size (GtkCellRenderer *cell,
643                                   gint             width,
644                                   gint             height)
645 {
646   g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
647   g_return_if_fail (width >= -1 && height >= -1);
648
649   if ((width != cell->width) || (height != cell->height))
650     {
651       g_object_freeze_notify (G_OBJECT (cell));
652
653       if (width != cell->width)
654         {
655           cell->width = width;
656           g_object_notify (G_OBJECT (cell), "width");
657         }
658
659       if (height != cell->height)
660         {
661           cell->height = height;
662           g_object_notify (G_OBJECT (cell), "height");
663         }
664
665       g_object_thaw_notify (G_OBJECT (cell));
666     }
667 }
668
669 /**
670  * gtk_cell_renderer_get_fixed_size:
671  * @cell: A #GtkCellRenderer
672  * @width: location to fill in with the fixed width of the widget, or %NULL
673  * @height: location to fill in with the fixed height of the widget, or %NULL
674  * 
675  * Fills in @width and @height with the appropriate size of @cell.
676  **/
677 void
678 gtk_cell_renderer_get_fixed_size (GtkCellRenderer *cell,
679                                   gint            *width,
680                                   gint            *height)
681 {
682   g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
683
684   if (width)
685     (* width) = cell->width;
686   if (height)
687     (* height) = cell->height;
688 }
689
690 /**
691  * gtk_cell_renderer_editing_canceled:
692  * @cell: A #GtkCellRenderer
693  * 
694  * Causes the cell renderer to emit the "editing-canceled" signal.  This
695  * function is for use only by implementations of cell renderers that need to
696  * notify the client program that an editing process was canceled and the
697  * changes were not committed.
698  *
699  * Since: 2.4
700  **/
701 void
702 gtk_cell_renderer_editing_canceled (GtkCellRenderer *cell)
703 {
704   g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
705
706   g_signal_emit (cell, cell_renderer_signals[EDITING_CANCELED], 0);
707 }