gtkcellarea.h 34 KB
Newer Older
1
/* gtkcellarea.h
2 3 4 5 6
 *
 * Copyright (C) 2010 Openismus GmbH
 *
 * Authors:
 *      Tristan Van Berkom <tristanvb@openismus.com>
7 8 9 10 11 12 13 14 15 16 17 18
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
Javier Jardón's avatar
Javier Jardón committed
19
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 21
 */

22 23 24
#ifndef __GTK_CELL_AREA_H__
#define __GTK_CELL_AREA_H__

25 26 27 28 29 30
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

#include <gtk/gtkcellrenderer.h>
#include <gtk/gtkwidget.h>
31
#include <gtk/gtktreemodel.h>
32 33 34

G_BEGIN_DECLS

Matthias Clasen's avatar
Matthias Clasen committed
35 36 37 38
#define GTK_TYPE_CELL_AREA                (gtk_cell_area_get_type ())
#define GTK_CELL_AREA(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA, GtkCellArea))
#define GTK_CELL_AREA_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA, GtkCellAreaClass))
#define GTK_IS_CELL_AREA(obj)     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA))
39 40 41 42 43
#define GTK_IS_CELL_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA))
#define GTK_CELL_AREA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA, GtkCellAreaClass))

typedef struct _GtkCellArea              GtkCellArea;
typedef struct _GtkCellAreaClass         GtkCellAreaClass;
44
typedef struct _GtkCellAreaPrivate       GtkCellAreaPrivate;
45
typedef struct _GtkCellAreaContext       GtkCellAreaContext;
46

47 48
/**
 * GTK_CELL_AREA_WARN_INVALID_CELL_PROPERTY_ID:
49
 * @object: the #GObject on which set_cell_property() or get_cell_property()
Matthias Clasen's avatar
Matthias Clasen committed
50
 *     was called
51 52 53 54
 * @property_id: the numeric id of the property
 * @pspec: the #GParamSpec of the property
 *
 * This macro should be used to emit a standard warning about unexpected
55
 * properties in set_cell_property() and get_cell_property() implementations.
56 57 58 59
 */
#define GTK_CELL_AREA_WARN_INVALID_CELL_PROPERTY_ID(object, property_id, pspec) \
  G_OBJECT_WARN_INVALID_PSPEC ((object), "cell property id", (property_id), (pspec))

60 61
/**
 * GtkCellCallback:
62
 * @renderer: the cell renderer to operate on
63
 * @data: (closure): user-supplied data
64 65
 *
 * The type of the callback functions used for iterating over
66 67
 * the cell renderers of a #GtkCellArea, see gtk_cell_area_foreach().
 *
68
 * Returns: %TRUE to stop iterating over cells.
69
 */
70
typedef gboolean    (*GtkCellCallback) (GtkCellRenderer  *renderer,
Matthias Clasen's avatar
Matthias Clasen committed
71
                                        gpointer          data);
72

73 74 75
/**
 * GtkCellAllocCallback:
 * @renderer: the cell renderer to operate on
Matthias Clasen's avatar
Matthias Clasen committed
76 77 78 79
 * @cell_area: the area allocated to @renderer inside the rectangle
 *     provided to gtk_cell_area_foreach_alloc().
 * @cell_background: the background area for @renderer inside the
 *     background area provided to gtk_cell_area_foreach_alloc().
80
 * @data: (closure): user-supplied data
81
 *
Matthias Clasen's avatar
Matthias Clasen committed
82 83
 * The type of the callback functions used for iterating over the
 * cell renderers and their allocated areas inside a #GtkCellArea,
84 85
 * see gtk_cell_area_foreach_alloc().
 *
86
 * Returns: %TRUE to stop iterating over cells.
87 88
 */
typedef gboolean    (*GtkCellAllocCallback) (GtkCellRenderer    *renderer,
Matthias Clasen's avatar
Matthias Clasen committed
89 90 91
                                             const GdkRectangle *cell_area,
                                             const GdkRectangle *cell_background,
                                             gpointer            data);
92

93 94 95

struct _GtkCellArea
{
96
  /*< private >*/
97 98
  GInitiallyUnowned parent_instance;

99
  GtkCellAreaPrivate *priv;
100 101
};

102 103 104 105 106

/**
 * GtkCellAreaClass:
 * @add: adds a #GtkCellRenderer to the area.
 * @remove: removes a #GtkCellRenderer from the area.
Matthias Clasen's avatar
Matthias Clasen committed
107 108 109 110 111 112 113 114
 * @foreach: calls the #GtkCellCallback function on every #GtkCellRenderer in
 *     the area with the provided user data until the callback returns %TRUE.
 * @foreach_alloc: Calls the #GtkCellAllocCallback function on every
 *     #GtkCellRenderer in the area with the allocated area for the cell
 *     and the provided user data until the callback returns %TRUE.
 * @event: Handle an event in the area, this is generally used to activate
 *     a cell at the event location for button events but can also be used
 *     to generically pass events to #GtkWidgets drawn onto the area.
115
 * @render: Actually render the area’s cells to the specified rectangle,
Matthias Clasen's avatar
Matthias Clasen committed
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
 *     @background_area should be correctly distributed to the cells
 *     corresponding background areas.
 * @apply_attributes: Apply the cell attributes to the cells. This is
 *     implemented as a signal and generally #GtkCellArea subclasses don't
 *     need to implement it since it is handled by the base class.
 * @create_context: Creates and returns a class specific #GtkCellAreaContext
 *     to store cell alignment and allocation details for a said #GtkCellArea
 *     class.
 * @copy_context: Creates a new #GtkCellAreaContext in the same state as
 *     the passed @context with any cell alignment data and allocations intact.
 * @get_request_mode: This allows an area to tell its layouting widget whether
 *     it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
 *     %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
 * @get_preferred_width: Calculates the minimum and natural width of the
 *     areas cells with the current attributes applied while considering
 *     the particular layouting details of the said #GtkCellArea. While
 *     requests are performed over a series of rows, alignments and overall
 *     minimum and natural sizes should be stored in the corresponding
 *     #GtkCellAreaContext.
 * @get_preferred_height_for_width: Calculates the minimum and natural height
 *     for the area if the passed @context would be allocated the given width.
 *     When implementing this virtual method it is safe to assume that @context
 *     has already stored the aligned cell widths for every #GtkTreeModel row
 *     that @context will be allocated for since this information was stored
 *     at #GtkCellAreaClass.get_preferred_width() time. This virtual method
 *     should also store any necessary alignments of cell heights for the
 *     case that the context is allocated a height.
 * @get_preferred_height: Calculates the minimum and natural height of the
 *     areas cells with the current attributes applied. Essentially this is
 *     the same as #GtkCellAreaClass.get_preferred_width() only for areas
 *     that are being requested as %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT.
 * @get_preferred_width_for_height: Calculates the minimum and natural width
 *     for the area if the passed @context would be allocated the given
 *     height. The same as #GtkCellAreaClass.get_preferred_height_for_width()
 *     only for handling requests in the %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT
 *     mode.
 * @set_cell_property: This should be implemented to handle changes in child
 *     cell properties for a given #GtkCellRenderer that were previously
 *     installed on the #GtkCellAreaClass with gtk_cell_area_class_install_cell_property().
 * @get_cell_property: This should be implemented to report the values of
 *     child cell properties for a given child #GtkCellRenderer.
 * @focus: This virtual method should be implemented to navigate focus from
 *     cell to cell inside the #GtkCellArea. The #GtkCellArea should move
 *     focus from cell to cell inside the area and return %FALSE if focus
 *     logically leaves the area with the following exceptions: When the
 *     area contains no activatable cells, the entire area recieves focus.
162
 *     Focus should not be given to cells that are actually “focus siblings”
Matthias Clasen's avatar
Matthias Clasen committed
163 164 165 166 167 168 169 170 171
 *     of other sibling cells (see gtk_cell_area_get_focus_from_sibling()).
 *     Focus is set by calling gtk_cell_area_set_focus_cell().
 * @is_activatable: Returns whether the #GtkCellArea can respond to
 *     #GtkCellAreaClass.activate(), usually this does not need to be
 *     implemented since the base class takes care of this however it can
 *     be enhanced if the #GtkCellArea subclass can handle activation in
 *     other ways than activating its #GtkCellRenderers.
 * @activate: This is called when the layouting widget rendering the
 *     #GtkCellArea activates the focus cell (see gtk_cell_area_get_focus_cell()).
172
 */
173 174
struct _GtkCellAreaClass
{
175
  /*< private >*/
176 177
  GInitiallyUnownedClass parent_class;

178
  /*< public >*/
179 180

  /* Basic methods */
181
  void               (* add)                             (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
182
                                                          GtkCellRenderer         *renderer);
183
  void               (* remove)                          (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
184
                                                          GtkCellRenderer         *renderer);
185
  void               (* foreach)                         (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
186 187
                                                          GtkCellCallback          callback,
                                                          gpointer                 callback_data);
188
  void               (* foreach_alloc)                   (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
189 190 191 192 193 194
                                                          GtkCellAreaContext      *context,
                                                          GtkWidget               *widget,
                                                          const GdkRectangle      *cell_area,
                                                          const GdkRectangle      *background_area,
                                                          GtkCellAllocCallback     callback,
                                                          gpointer                 callback_data);
195
  gint               (* event)                           (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
196 197 198 199 200
                                                          GtkCellAreaContext      *context,
                                                          GtkWidget               *widget,
                                                          GdkEvent                *event,
                                                          const GdkRectangle      *cell_area,
                                                          GtkCellRendererState     flags);
201
  void               (* render)                          (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
202 203 204 205 206 207 208
                                                          GtkCellAreaContext      *context,
                                                          GtkWidget               *widget,
                                                          cairo_t                 *cr,
                                                          const GdkRectangle      *background_area,
                                                          const GdkRectangle      *cell_area,
                                                          GtkCellRendererState     flags,
                                                          gboolean                 paint_focus);
209
  void               (* apply_attributes)                (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
210 211 212 213
                                                          GtkTreeModel            *tree_model,
                                                          GtkTreeIter             *iter,
                                                          gboolean                 is_expander,
                                                          gboolean                 is_expanded);
214

215
  /* Geometry */
216
  GtkCellAreaContext *(* create_context)                 (GtkCellArea             *area);
217
  GtkCellAreaContext *(* copy_context)                   (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
218
                                                          GtkCellAreaContext      *context);
219 220
  GtkSizeRequestMode (* get_request_mode)                (GtkCellArea             *area);
  void               (* get_preferred_width)             (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
221
                                                          GtkCellAreaContext      *context,
222
                                                          GtkWidget               *widget,
223 224
                                                          gint                    *minimum_width,
                                                          gint                    *natural_width);
225
  void               (* get_preferred_height_for_width)  (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
226
                                                          GtkCellAreaContext      *context,
227 228 229 230 231
                                                          GtkWidget               *widget,
                                                          gint                     width,
                                                          gint                    *minimum_height,
                                                          gint                    *natural_height);
  void               (* get_preferred_height)            (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
232
                                                          GtkCellAreaContext      *context,
233
                                                          GtkWidget               *widget,
234 235
                                                          gint                    *minimum_height,
                                                          gint                    *natural_height);
236
  void               (* get_preferred_width_for_height)  (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
237
                                                          GtkCellAreaContext      *context,
238 239 240 241
                                                          GtkWidget               *widget,
                                                          gint                     height,
                                                          gint                    *minimum_width,
                                                          gint                    *natural_width);
242

243 244
  /* Cell Properties */
  void               (* set_cell_property)               (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
245 246 247 248
                                                          GtkCellRenderer         *renderer,
                                                          guint                    property_id,
                                                          const GValue            *value,
                                                          GParamSpec              *pspec);
249
  void               (* get_cell_property)               (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
250 251 252 253
                                                          GtkCellRenderer         *renderer,
                                                          guint                    property_id,
                                                          GValue                  *value,
                                                          GParamSpec              *pspec);
254

255
  /* Focus */
256
  gboolean           (* focus)                           (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
257
                                                          GtkDirectionType         direction);
258
  gboolean           (* is_activatable)                  (GtkCellArea             *area);
259
  gboolean           (* activate)                        (GtkCellArea             *area,
Matthias Clasen's avatar
Matthias Clasen committed
260 261 262 263 264
                                                          GtkCellAreaContext      *context,
                                                          GtkWidget               *widget,
                                                          const GdkRectangle      *cell_area,
                                                          GtkCellRendererState     flags,
                                                          gboolean                 edit_only);
265

266
  /*< private >*/
267

268 269 270 271 272 273 274 275 276 277 278
  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
  void (*_gtk_reserved5) (void);
  void (*_gtk_reserved6) (void);
  void (*_gtk_reserved7) (void);
  void (*_gtk_reserved8) (void);
};

279
GDK_AVAILABLE_IN_ALL
280
GType                 gtk_cell_area_get_type                       (void) G_GNUC_CONST;
281 282

/* Basic methods */
283
GDK_AVAILABLE_IN_ALL
284
void                  gtk_cell_area_add                            (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
285
                                                                    GtkCellRenderer      *renderer);
286
GDK_AVAILABLE_IN_ALL
287
void                  gtk_cell_area_remove                         (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
288
                                                                    GtkCellRenderer      *renderer);
289
GDK_AVAILABLE_IN_ALL
290
gboolean              gtk_cell_area_has_renderer                   (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
291
                                                                    GtkCellRenderer      *renderer);
292
GDK_AVAILABLE_IN_ALL
293
void                  gtk_cell_area_foreach                        (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
294 295
                                                                    GtkCellCallback       callback,
                                                                    gpointer              callback_data);
296
GDK_AVAILABLE_IN_ALL
297
void                  gtk_cell_area_foreach_alloc                  (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
298 299 300 301 302 303
                                                                    GtkCellAreaContext   *context,
                                                                    GtkWidget            *widget,
                                                                    const GdkRectangle   *cell_area,
                                                                    const GdkRectangle   *background_area,
                                                                    GtkCellAllocCallback  callback,
                                                                    gpointer              callback_data);
304
GDK_AVAILABLE_IN_ALL
305
gint                  gtk_cell_area_event                          (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
306 307 308 309 310
                                                                    GtkCellAreaContext   *context,
                                                                    GtkWidget            *widget,
                                                                    GdkEvent             *event,
                                                                    const GdkRectangle   *cell_area,
                                                                    GtkCellRendererState  flags);
311
GDK_AVAILABLE_IN_ALL
312
void                  gtk_cell_area_render                         (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
313 314 315 316 317 318 319
                                                                    GtkCellAreaContext   *context,
                                                                    GtkWidget            *widget,
                                                                    cairo_t              *cr,
                                                                    const GdkRectangle   *background_area,
                                                                    const GdkRectangle   *cell_area,
                                                                    GtkCellRendererState  flags,
                                                                    gboolean              paint_focus);
320

321
GDK_AVAILABLE_IN_ALL
322
void                  gtk_cell_area_get_cell_allocation            (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
323 324 325 326 327
                                                                    GtkCellAreaContext   *context,
                                                                    GtkWidget            *widget,
                                                                    GtkCellRenderer      *renderer,
                                                                    const GdkRectangle   *cell_area,
                                                                    GdkRectangle         *allocation);
328
GDK_AVAILABLE_IN_ALL
329
GtkCellRenderer      *gtk_cell_area_get_cell_at_position           (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
330 331 332 333 334 335
                                                                    GtkCellAreaContext   *context,
                                                                    GtkWidget            *widget,
                                                                    const GdkRectangle   *cell_area,
                                                                    gint                  x,
                                                                    gint                  y,
                                                                    GdkRectangle         *alloc_area);
336

337
/* Geometry */
338
GDK_AVAILABLE_IN_ALL
339
GtkCellAreaContext   *gtk_cell_area_create_context                 (GtkCellArea        *area);
340
GDK_AVAILABLE_IN_ALL
341
GtkCellAreaContext   *gtk_cell_area_copy_context                   (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
342
                                                                    GtkCellAreaContext *context);
343
GDK_AVAILABLE_IN_ALL
344
GtkSizeRequestMode    gtk_cell_area_get_request_mode               (GtkCellArea        *area);
345
GDK_AVAILABLE_IN_ALL
346
void                  gtk_cell_area_get_preferred_width            (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
347 348 349 350
                                                                    GtkCellAreaContext *context,
                                                                    GtkWidget          *widget,
                                                                    gint               *minimum_width,
                                                                    gint               *natural_width);
351
GDK_AVAILABLE_IN_ALL
352
void                  gtk_cell_area_get_preferred_height_for_width (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
353 354 355 356 357
                                                                    GtkCellAreaContext *context,
                                                                    GtkWidget          *widget,
                                                                    gint                width,
                                                                    gint               *minimum_height,
                                                                    gint               *natural_height);
358
GDK_AVAILABLE_IN_ALL
359
void                  gtk_cell_area_get_preferred_height           (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
360 361 362 363
                                                                    GtkCellAreaContext *context,
                                                                    GtkWidget          *widget,
                                                                    gint               *minimum_height,
                                                                    gint               *natural_height);
364
GDK_AVAILABLE_IN_ALL
365
void                  gtk_cell_area_get_preferred_width_for_height (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
366 367 368 369 370
                                                                    GtkCellAreaContext *context,
                                                                    GtkWidget          *widget,
                                                                    gint                height,
                                                                    gint               *minimum_width,
                                                                    gint               *natural_width);
371
GDK_AVAILABLE_IN_ALL
372
const gchar *         gtk_cell_area_get_current_path_string        (GtkCellArea        *area);
373

374

375
/* Attributes */
376
GDK_AVAILABLE_IN_ALL
377
void                  gtk_cell_area_apply_attributes               (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
378 379 380 381
                                                                    GtkTreeModel       *tree_model,
                                                                    GtkTreeIter        *iter,
                                                                    gboolean            is_expander,
                                                                    gboolean            is_expanded);
382
GDK_AVAILABLE_IN_ALL
383
void                  gtk_cell_area_attribute_connect              (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
384 385 386
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar        *attribute,
                                                                    gint                column);
387
GDK_AVAILABLE_IN_ALL
388
void                  gtk_cell_area_attribute_disconnect           (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
389 390
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar        *attribute);
391 392 393 394 395
GDK_AVAILABLE_IN_3_14
gint                  gtk_cell_area_attribute_get_column           (GtkCellArea        *area,
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar        *attribute);

396

397
/* Cell Properties */
398
GDK_AVAILABLE_IN_ALL
399
void                  gtk_cell_area_class_install_cell_property    (GtkCellAreaClass   *aclass,
Matthias Clasen's avatar
Matthias Clasen committed
400 401
                                                                    guint               property_id,
                                                                    GParamSpec         *pspec);
402
GDK_AVAILABLE_IN_ALL
403
GParamSpec*           gtk_cell_area_class_find_cell_property       (GtkCellAreaClass   *aclass,
Matthias Clasen's avatar
Matthias Clasen committed
404
                                                                    const gchar        *property_name);
405
GDK_AVAILABLE_IN_ALL
406
GParamSpec**          gtk_cell_area_class_list_cell_properties     (GtkCellAreaClass   *aclass,
Matthias Clasen's avatar
Matthias Clasen committed
407
                                                                    guint                   *n_properties);
408
GDK_AVAILABLE_IN_ALL
409
void                  gtk_cell_area_add_with_properties            (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
410 411 412
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar     *first_prop_name,
                                                                    ...) G_GNUC_NULL_TERMINATED;
413
GDK_AVAILABLE_IN_ALL
414
void                  gtk_cell_area_cell_set                       (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
415 416 417
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar        *first_prop_name,
                                                                    ...) G_GNUC_NULL_TERMINATED;
418
GDK_AVAILABLE_IN_ALL
419
void                  gtk_cell_area_cell_get                       (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
420 421 422
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar        *first_prop_name,
                                                                    ...) G_GNUC_NULL_TERMINATED;
423
GDK_AVAILABLE_IN_ALL
424
void                  gtk_cell_area_cell_set_valist                (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
425 426 427
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar        *first_property_name,
                                                                    va_list             var_args);
428
GDK_AVAILABLE_IN_ALL
429
void                  gtk_cell_area_cell_get_valist                (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
430 431 432
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar        *first_property_name,
                                                                    va_list             var_args);
433
GDK_AVAILABLE_IN_ALL
434
void                  gtk_cell_area_cell_set_property              (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
435 436 437
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar        *property_name,
                                                                    const GValue       *value);
438
GDK_AVAILABLE_IN_ALL
439
void                  gtk_cell_area_cell_get_property              (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
440 441 442
                                                                    GtkCellRenderer    *renderer,
                                                                    const gchar        *property_name,
                                                                    GValue             *value);
443

444
/* Focus */
445
GDK_AVAILABLE_IN_ALL
446
gboolean              gtk_cell_area_is_activatable                 (GtkCellArea         *area);
447
GDK_AVAILABLE_IN_ALL
448
gboolean              gtk_cell_area_activate                       (GtkCellArea         *area,
Matthias Clasen's avatar
Matthias Clasen committed
449 450 451 452 453
                                                                    GtkCellAreaContext  *context,
                                                                    GtkWidget           *widget,
                                                                    const GdkRectangle  *cell_area,
                                                                    GtkCellRendererState flags,
                                                                    gboolean             edit_only);
454
GDK_AVAILABLE_IN_ALL
455
gboolean              gtk_cell_area_focus                          (GtkCellArea         *area,
Matthias Clasen's avatar
Matthias Clasen committed
456
                                                                    GtkDirectionType     direction);
457
GDK_AVAILABLE_IN_ALL
458
void                  gtk_cell_area_set_focus_cell                 (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
459
                                                                    GtkCellRenderer      *renderer);
460
GDK_AVAILABLE_IN_ALL
461
GtkCellRenderer      *gtk_cell_area_get_focus_cell                 (GtkCellArea          *area);
462

463 464

/* Focus siblings */
465
GDK_AVAILABLE_IN_ALL
466
void                  gtk_cell_area_add_focus_sibling              (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
467 468
                                                                    GtkCellRenderer      *renderer,
                                                                    GtkCellRenderer      *sibling);
469
GDK_AVAILABLE_IN_ALL
470
void                  gtk_cell_area_remove_focus_sibling           (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
471 472
                                                                    GtkCellRenderer      *renderer,
                                                                    GtkCellRenderer      *sibling);
473
GDK_AVAILABLE_IN_ALL
474
gboolean              gtk_cell_area_is_focus_sibling               (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
475 476
                                                                    GtkCellRenderer      *renderer,
                                                                    GtkCellRenderer      *sibling);
477
GDK_AVAILABLE_IN_ALL
478
const GList *         gtk_cell_area_get_focus_siblings             (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
479
                                                                    GtkCellRenderer      *renderer);
480
GDK_AVAILABLE_IN_ALL
481
GtkCellRenderer      *gtk_cell_area_get_focus_from_sibling         (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
482
                                                                    GtkCellRenderer      *renderer);
483

484
/* Cell Activation/Editing */
485
GDK_AVAILABLE_IN_ALL
486
GtkCellRenderer      *gtk_cell_area_get_edited_cell                (GtkCellArea          *area);
487
GDK_AVAILABLE_IN_ALL
488
GtkCellEditable      *gtk_cell_area_get_edit_widget                (GtkCellArea          *area);
489
GDK_AVAILABLE_IN_ALL
490
gboolean              gtk_cell_area_activate_cell                  (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
491 492 493 494 495
                                                                    GtkWidget            *widget,
                                                                    GtkCellRenderer      *renderer,
                                                                    GdkEvent             *event,
                                                                    const GdkRectangle   *cell_area,
                                                                    GtkCellRendererState  flags);
496
GDK_AVAILABLE_IN_ALL
497
void                  gtk_cell_area_stop_editing                   (GtkCellArea          *area,
Matthias Clasen's avatar
Matthias Clasen committed
498
                                                                    gboolean              canceled);
499

500 501 502
/* Functions for area implementations */

/* Distinguish the inner cell area from the whole requested area including margins */
503
GDK_AVAILABLE_IN_ALL
504
void                  gtk_cell_area_inner_cell_area                (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
505 506 507
                                                                    GtkWidget          *widget,
                                                                    const GdkRectangle *cell_area,
                                                                    GdkRectangle       *inner_area);
508

509
/* Request the size of a cell while respecting the cell margins (requests are margin inclusive) */
510
GDK_AVAILABLE_IN_ALL
511
void                  gtk_cell_area_request_renderer               (GtkCellArea        *area,
Matthias Clasen's avatar
Matthias Clasen committed
512 513 514 515 516 517
                                                                    GtkCellRenderer    *renderer,
                                                                    GtkOrientation      orientation,
                                                                    GtkWidget          *widget,
                                                                    gint                for_size,
                                                                    gint               *minimum_size,
                                                                    gint               *natural_size);
518

519 520 521 522 523 524 525 526 527 528 529 530 531
/* For api stability, this is called from gtkcelllayout.c in order to ensure the correct
 * object is passed to the user function in gtk_cell_layout_set_cell_data_func.
 *
 * This private api takes gpointer & GFunc arguments to circumvent circular header file
 * dependancies.
 */
void                 _gtk_cell_area_set_cell_data_func_with_proxy  (GtkCellArea           *area,
								    GtkCellRenderer       *cell,
								    GFunc                  func,
								    gpointer               func_data,
								    GDestroyNotify         destroy,
								    gpointer               proxy);

532 533 534
G_END_DECLS

#endif /* __GTK_CELL_AREA_H__ */