2010-10-21 13:46:10 +00:00
|
|
|
|
/* gtkcellarea.h
|
2010-10-22 07:41:52 +00:00
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2010 Openismus GmbH
|
|
|
|
|
*
|
|
|
|
|
* Authors:
|
|
|
|
|
* Tristan Van Berkom <tristanvb@openismus.com>
|
2010-10-21 13:46:10 +00:00
|
|
|
|
*
|
|
|
|
|
* 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
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2010-10-21 13:46:10 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2012-12-28 14:57:34 +00:00
|
|
|
|
#ifndef __GTK_CELL_AREA_H__
|
|
|
|
|
#define __GTK_CELL_AREA_H__
|
|
|
|
|
|
2010-10-21 13:46:10 +00:00
|
|
|
|
#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>
|
2010-10-24 06:44:48 +00:00
|
|
|
|
#include <gtk/gtktreemodel.h>
|
2010-10-21 13:46:10 +00:00
|
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
2010-12-18 00:14:35 +00:00
|
|
|
|
#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))
|
2010-10-21 13:46:10 +00:00
|
|
|
|
#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;
|
2010-11-13 07:23:01 +00:00
|
|
|
|
typedef struct _GtkCellAreaContext GtkCellAreaContext;
|
2010-10-21 13:46:10 +00:00
|
|
|
|
|
2010-12-04 11:52:03 +00:00
|
|
|
|
/**
|
|
|
|
|
* GTK_CELL_AREA_WARN_INVALID_CELL_PROPERTY_ID:
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* @object: the `GObject` on which set_cell_property() or get_cell_property()
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* was called
|
2010-12-04 11:52:03 +00:00
|
|
|
|
* @property_id: the numeric id of the property
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* @pspec: the `GParamSpec` of the property
|
2010-12-04 11:52:03 +00:00
|
|
|
|
*
|
|
|
|
|
* This macro should be used to emit a standard warning about unexpected
|
2014-03-29 04:24:15 +00:00
|
|
|
|
* properties in set_cell_property() and get_cell_property() implementations.
|
2010-12-04 11:52:03 +00:00
|
|
|
|
*/
|
|
|
|
|
#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))
|
|
|
|
|
|
2010-10-21 13:46:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkCellCallback:
|
2010-10-22 07:41:52 +00:00
|
|
|
|
* @renderer: the cell renderer to operate on
|
2011-01-18 05:28:24 +00:00
|
|
|
|
* @data: (closure): user-supplied data
|
2010-10-21 13:46:10 +00:00
|
|
|
|
*
|
|
|
|
|
* The type of the callback functions used for iterating over
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* the cell renderers of a `GtkCellArea`, see gtk_cell_area_foreach().
|
2010-12-06 03:41:38 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE to stop iterating over cells.
|
2010-10-21 13:46:10 +00:00
|
|
|
|
*/
|
2010-12-06 03:41:38 +00:00
|
|
|
|
typedef gboolean (*GtkCellCallback) (GtkCellRenderer *renderer,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
gpointer data);
|
2010-10-21 13:46:10 +00:00
|
|
|
|
|
2010-12-06 05:11:28 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkCellAllocCallback:
|
|
|
|
|
* @renderer: the cell renderer to operate on
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @cell_area: the area allocated to @renderer inside the rectangle
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* provided to gtk_cell_area_foreach_alloc().
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @cell_background: the background area for @renderer inside the
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* background area provided to gtk_cell_area_foreach_alloc().
|
2011-01-18 05:28:24 +00:00
|
|
|
|
* @data: (closure): user-supplied data
|
2010-12-06 05:11:28 +00:00
|
|
|
|
*
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* The type of the callback functions used for iterating over the
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* cell renderers and their allocated areas inside a `GtkCellArea`,
|
2010-12-06 05:11:28 +00:00
|
|
|
|
* see gtk_cell_area_foreach_alloc().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE to stop iterating over cells.
|
2010-12-06 05:11:28 +00:00
|
|
|
|
*/
|
|
|
|
|
typedef gboolean (*GtkCellAllocCallback) (GtkCellRenderer *renderer,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
const GdkRectangle *cell_background,
|
|
|
|
|
gpointer data);
|
2010-12-06 05:11:28 +00:00
|
|
|
|
|
2010-10-21 13:46:10 +00:00
|
|
|
|
|
|
|
|
|
struct _GtkCellArea
|
|
|
|
|
{
|
2010-12-03 08:12:59 +00:00
|
|
|
|
/*< private >*/
|
2010-10-21 13:46:10 +00:00
|
|
|
|
GInitiallyUnowned parent_instance;
|
|
|
|
|
};
|
|
|
|
|
|
2010-12-02 15:29:22 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkCellAreaClass:
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* @add: adds a `GtkCellRenderer` to the area.
|
|
|
|
|
* @remove: removes a `GtkCellRenderer` from the area.
|
|
|
|
|
* @foreach: calls the `GtkCellCallback` function on every `GtkCellRenderer` in
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* the area with the provided user data until the callback returns %TRUE.
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* @foreach_alloc: Calls the `GtkCellAllocCallback` function on every
|
|
|
|
|
* `GtkCellRenderer` in the area with the allocated area for the cell
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* and the provided user data until the callback returns %TRUE.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @event: Handle an event in the area, this is generally used to activate
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* a cell at the event location for button events but can also be used
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* to generically pass events to `GtkWidget`s drawn onto the area.
|
2016-12-23 08:09:42 +00:00
|
|
|
|
* @snapshot: Actually snapshot the area’s cells to the specified rectangle,
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* @background_area should be correctly distributed to the cells
|
|
|
|
|
* corresponding background areas.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @apply_attributes: Apply the cell attributes to the cells. This is
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* implemented as a signal and generally `GtkCellArea` subclasses don't
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* need to implement it since it is handled by the base class.
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* @create_context: Creates and returns a class specific `GtkCellAreaContext`
|
|
|
|
|
* to store cell alignment and allocation details for a said `GtkCellArea`
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* class.
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* @copy_context: Creates a new `GtkCellAreaContext` in the same state as
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* the passed @context with any cell alignment data and allocations intact.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @get_request_mode: This allows an area to tell its layouting widget whether
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
|
|
|
|
|
* %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @get_preferred_width: Calculates the minimum and natural width of the
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* areas cells with the current attributes applied while considering
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* the particular layouting details of the said `GtkCellArea`. While
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* requests are performed over a series of rows, alignments and overall
|
|
|
|
|
* minimum and natural sizes should be stored in the corresponding
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* `GtkCellAreaContext`.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @get_preferred_height_for_width: Calculates the minimum and natural height
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* 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
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* has already stored the aligned cell widths for every `GtkTreeModel` row
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* that @context will be allocated for since this information was stored
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* at `GtkCellAreaClass.get_preferred_width()` time. This virtual method
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* should also store any necessary alignments of cell heights for the
|
|
|
|
|
* case that the context is allocated a height.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @get_preferred_height: Calculates the minimum and natural height of the
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* areas cells with the current attributes applied. Essentially this is
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* the same as `GtkCellAreaClass.get_preferred_width()` only for areas
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* that are being requested as %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @get_preferred_width_for_height: Calculates the minimum and natural width
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* for the area if the passed @context would be allocated the given
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* height. The same as `GtkCellAreaClass.get_preferred_height_for_width()`
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* only for handling requests in the %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT
|
|
|
|
|
* mode.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @set_cell_property: This should be implemented to handle changes in child
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* cell properties for a given `GtkCellRenderer` that were previously
|
|
|
|
|
* installed on the `GtkCellAreaClass` with gtk_cell_area_class_install_cell_property().
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @get_cell_property: This should be implemented to report the values of
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* child cell properties for a given child `GtkCellRenderer`.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @focus: This virtual method should be implemented to navigate focus from
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* cell to cell inside the `GtkCellArea`. The `GtkCellArea` should move
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* 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 receives focus.
|
|
|
|
|
* Focus should not be given to cells that are actually “focus siblings”
|
|
|
|
|
* of other sibling cells (see gtk_cell_area_get_focus_from_sibling()).
|
|
|
|
|
* Focus is set by calling gtk_cell_area_set_focus_cell().
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* @is_activatable: Returns whether the `GtkCellArea` can respond to
|
|
|
|
|
* `GtkCellAreaClass.activate()`, usually this does not need to be
|
2021-05-18 21:05:26 +00:00
|
|
|
|
* implemented since the base class takes care of this however it can
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* be enhanced if the `GtkCellArea` subclass can handle activation in
|
|
|
|
|
* other ways than activating its `GtkCellRenderers`.
|
2010-12-18 00:14:35 +00:00
|
|
|
|
* @activate: This is called when the layouting widget rendering the
|
2021-05-20 13:17:04 +00:00
|
|
|
|
* `GtkCellArea` activates the focus cell (see gtk_cell_area_get_focus_cell()).
|
2010-12-02 15:29:22 +00:00
|
|
|
|
*/
|
2010-10-21 13:46:10 +00:00
|
|
|
|
struct _GtkCellAreaClass
|
|
|
|
|
{
|
2010-12-02 15:29:22 +00:00
|
|
|
|
/*< private >*/
|
2010-10-21 13:46:10 +00:00
|
|
|
|
GInitiallyUnownedClass parent_class;
|
|
|
|
|
|
2010-12-02 15:29:22 +00:00
|
|
|
|
/*< public >*/
|
2010-10-22 07:41:52 +00:00
|
|
|
|
|
|
|
|
|
/* Basic methods */
|
2010-10-23 08:01:58 +00:00
|
|
|
|
void (* add) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer);
|
2010-10-23 08:01:58 +00:00
|
|
|
|
void (* remove) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer);
|
2010-12-06 03:41:38 +00:00
|
|
|
|
void (* foreach) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellCallback callback,
|
|
|
|
|
gpointer callback_data);
|
2010-12-06 05:11:28 +00:00
|
|
|
|
void (* foreach_alloc) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
const GdkRectangle *background_area,
|
|
|
|
|
GtkCellAllocCallback callback,
|
|
|
|
|
gpointer callback_data);
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int (* event) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
GdkEvent *event,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
GtkCellRendererState flags);
|
2016-12-23 08:09:42 +00:00
|
|
|
|
void (* snapshot) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
2016-12-23 08:09:42 +00:00
|
|
|
|
GtkSnapshot *snapshot,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
const GdkRectangle *background_area,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
GtkCellRendererState flags,
|
|
|
|
|
gboolean paint_focus);
|
2010-11-23 14:37:58 +00:00
|
|
|
|
void (* apply_attributes) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkTreeModel *tree_model,
|
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
|
gboolean is_expander,
|
|
|
|
|
gboolean is_expanded);
|
2010-10-21 13:46:10 +00:00
|
|
|
|
|
2010-10-22 07:41:52 +00:00
|
|
|
|
/* Geometry */
|
2010-11-13 07:23:01 +00:00
|
|
|
|
GtkCellAreaContext *(* create_context) (GtkCellArea *area);
|
2010-12-12 15:18:00 +00:00
|
|
|
|
GtkCellAreaContext *(* copy_context) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context);
|
2010-10-23 08:01:58 +00:00
|
|
|
|
GtkSizeRequestMode (* get_request_mode) (GtkCellArea *area);
|
|
|
|
|
void (* get_preferred_width) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
2010-10-23 08:01:58 +00:00
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *minimum_width,
|
|
|
|
|
int *natural_width);
|
2010-10-23 08:01:58 +00:00
|
|
|
|
void (* get_preferred_height_for_width) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
2010-10-23 08:01:58 +00:00
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int width,
|
|
|
|
|
int *minimum_height,
|
|
|
|
|
int *natural_height);
|
2010-10-23 08:01:58 +00:00
|
|
|
|
void (* get_preferred_height) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
2010-10-23 08:01:58 +00:00
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *minimum_height,
|
|
|
|
|
int *natural_height);
|
2010-10-23 08:01:58 +00:00
|
|
|
|
void (* get_preferred_width_for_height) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
2010-10-23 08:01:58 +00:00
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int height,
|
|
|
|
|
int *minimum_width,
|
|
|
|
|
int *natural_width);
|
2010-10-21 13:46:10 +00:00
|
|
|
|
|
2010-10-31 08:13:15 +00:00
|
|
|
|
/* Cell Properties */
|
|
|
|
|
void (* set_cell_property) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
guint property_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
2010-10-31 08:13:15 +00:00
|
|
|
|
void (* get_cell_property) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
guint property_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
2010-10-21 13:46:10 +00:00
|
|
|
|
|
2010-11-01 07:01:25 +00:00
|
|
|
|
/* Focus */
|
2010-11-10 10:17:06 +00:00
|
|
|
|
gboolean (* focus) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkDirectionType direction);
|
2010-12-02 15:29:22 +00:00
|
|
|
|
gboolean (* is_activatable) (GtkCellArea *area);
|
2010-11-10 10:17:06 +00:00
|
|
|
|
gboolean (* activate) (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
GtkCellRendererState flags,
|
|
|
|
|
gboolean edit_only);
|
2010-11-10 10:17:06 +00:00
|
|
|
|
|
2010-12-02 15:29:22 +00:00
|
|
|
|
/*< private >*/
|
2010-11-01 07:01:25 +00:00
|
|
|
|
|
2019-05-27 01:34:06 +00:00
|
|
|
|
gpointer padding[8];
|
2010-10-21 13:46:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
GType gtk_cell_area_get_type (void) G_GNUC_CONST;
|
2010-10-21 13:46:10 +00:00
|
|
|
|
|
|
|
|
|
/* Basic methods */
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_add (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_remove (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
gboolean gtk_cell_area_has_renderer (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-06 03:41:38 +00:00
|
|
|
|
void gtk_cell_area_foreach (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellCallback callback,
|
|
|
|
|
gpointer callback_data);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-06 05:11:28 +00:00
|
|
|
|
void gtk_cell_area_foreach_alloc (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
const GdkRectangle *background_area,
|
|
|
|
|
GtkCellAllocCallback callback,
|
|
|
|
|
gpointer callback_data);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int gtk_cell_area_event (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
GdkEvent *event,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
GtkCellRendererState flags);
|
2018-02-05 19:13:20 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2016-12-19 15:34:25 +00:00
|
|
|
|
void gtk_cell_area_snapshot (GtkCellArea *area,
|
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
GtkSnapshot *snapshot,
|
|
|
|
|
const GdkRectangle *background_area,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
GtkCellRendererState flags,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
gboolean paint_focus);
|
2010-12-06 05:11:28 +00:00
|
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-06 05:11:28 +00:00
|
|
|
|
void gtk_cell_area_get_cell_allocation (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
GdkRectangle *allocation);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-06 05:11:28 +00:00
|
|
|
|
GtkCellRenderer *gtk_cell_area_get_cell_at_position (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
const GdkRectangle *cell_area,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GdkRectangle *alloc_area);
|
2010-12-06 05:11:28 +00:00
|
|
|
|
|
2010-10-21 13:46:10 +00:00
|
|
|
|
/* Geometry */
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-13 07:23:01 +00:00
|
|
|
|
GtkCellAreaContext *gtk_cell_area_create_context (GtkCellArea *area);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-12 15:18:00 +00:00
|
|
|
|
GtkCellAreaContext *gtk_cell_area_copy_context (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
GtkSizeRequestMode gtk_cell_area_get_request_mode (GtkCellArea *area);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_get_preferred_width (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *minimum_width,
|
|
|
|
|
int *natural_width);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_get_preferred_height_for_width (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int width,
|
|
|
|
|
int *minimum_height,
|
|
|
|
|
int *natural_height);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_get_preferred_height (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *minimum_height,
|
|
|
|
|
int *natural_height);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_get_preferred_width_for_height (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int height,
|
|
|
|
|
int *minimum_width,
|
|
|
|
|
int *natural_width);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char * gtk_cell_area_get_current_path_string (GtkCellArea *area);
|
2010-11-05 13:16:32 +00:00
|
|
|
|
|
2010-10-21 13:46:10 +00:00
|
|
|
|
|
2010-10-31 08:13:15 +00:00
|
|
|
|
/* Attributes */
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_apply_attributes (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkTreeModel *tree_model,
|
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
|
gboolean is_expander,
|
|
|
|
|
gboolean is_expanded);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_attribute_connect (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *attribute,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int column);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_attribute_disconnect (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *attribute);
|
2018-02-05 19:13:20 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int gtk_cell_area_attribute_get_column (GtkCellArea *area,
|
2014-05-08 18:06:03 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *attribute);
|
2014-05-08 18:06:03 +00:00
|
|
|
|
|
2010-10-24 06:44:48 +00:00
|
|
|
|
|
2010-10-31 08:13:15 +00:00
|
|
|
|
/* Cell Properties */
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_class_install_cell_property (GtkCellAreaClass *aclass,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
guint property_id,
|
|
|
|
|
GParamSpec *pspec);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
GParamSpec* gtk_cell_area_class_find_cell_property (GtkCellAreaClass *aclass,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *property_name);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
GParamSpec** gtk_cell_area_class_list_cell_properties (GtkCellAreaClass *aclass,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
guint *n_properties);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_add_with_properties (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *first_prop_name,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_cell_set (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *first_prop_name,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_cell_get (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *first_prop_name,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_cell_set_valist (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *first_property_name,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
va_list var_args);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_cell_get_valist (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *first_property_name,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
va_list var_args);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_cell_set_property (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *property_name,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
const GValue *value);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_cell_get_property (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *property_name,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GValue *value);
|
2010-10-31 08:13:15 +00:00
|
|
|
|
|
2010-11-01 07:01:25 +00:00
|
|
|
|
/* Focus */
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-29 07:29:09 +00:00
|
|
|
|
gboolean gtk_cell_area_is_activatable (GtkCellArea *area);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
gboolean gtk_cell_area_activate (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
GtkCellRendererState flags,
|
|
|
|
|
gboolean edit_only);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-29 07:29:09 +00:00
|
|
|
|
gboolean gtk_cell_area_focus (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkDirectionType direction);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_set_focus_cell (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
GtkCellRenderer *gtk_cell_area_get_focus_cell (GtkCellArea *area);
|
2010-11-05 04:05:20 +00:00
|
|
|
|
|
2010-11-11 07:13:06 +00:00
|
|
|
|
|
|
|
|
|
/* Focus siblings */
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_add_focus_sibling (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellRenderer *sibling);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_remove_focus_sibling (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellRenderer *sibling);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
gboolean gtk_cell_area_is_focus_sibling (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellRenderer *sibling);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2011-06-06 18:13:44 +00:00
|
|
|
|
const GList * gtk_cell_area_get_focus_siblings (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
GtkCellRenderer *gtk_cell_area_get_focus_from_sibling (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer);
|
2010-11-11 07:13:06 +00:00
|
|
|
|
|
2010-11-06 06:29:27 +00:00
|
|
|
|
/* Cell Activation/Editing */
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
GtkCellRenderer *gtk_cell_area_get_edited_cell (GtkCellArea *area);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
GtkCellEditable *gtk_cell_area_get_edit_widget (GtkCellArea *area);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
gboolean gtk_cell_area_activate_cell (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GdkEvent *event,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
GtkCellRendererState flags);
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_stop_editing (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
gboolean canceled);
|
2010-11-05 04:05:20 +00:00
|
|
|
|
|
2010-10-31 13:50:53 +00:00
|
|
|
|
/* Functions for area implementations */
|
|
|
|
|
|
|
|
|
|
/* Distinguish the inner cell area from the whole requested area including margins */
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_inner_cell_area (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
|
GdkRectangle *inner_area);
|
2010-11-12 10:25:07 +00:00
|
|
|
|
|
2010-10-31 13:50:53 +00:00
|
|
|
|
/* Request the size of a cell while respecting the cell margins (requests are margin inclusive) */
|
2013-03-20 22:17:32 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-11-12 05:06:00 +00:00
|
|
|
|
void gtk_cell_area_request_renderer (GtkCellArea *area,
|
2010-12-18 00:14:35 +00:00
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
GtkWidget *widget,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum_size,
|
|
|
|
|
int *natural_size);
|
2010-10-24 06:44:48 +00:00
|
|
|
|
|
2010-12-20 10:37:30 +00:00
|
|
|
|
/* 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
|
2020-05-28 08:00:03 +00:00
|
|
|
|
* dependencies.
|
2010-12-20 10:37:30 +00:00
|
|
|
|
*/
|
|
|
|
|
void _gtk_cell_area_set_cell_data_func_with_proxy (GtkCellArea *area,
|
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
|
GFunc func,
|
|
|
|
|
gpointer func_data,
|
|
|
|
|
GDestroyNotify destroy,
|
|
|
|
|
gpointer proxy);
|
|
|
|
|
|
2010-10-21 13:46:10 +00:00
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif /* __GTK_CELL_AREA_H__ */
|