mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
Trivial changes
Whitespace fixes, comment formatting, etc
This commit is contained in:
parent
453bf477ed
commit
a2dda0c2bb
1616
gtk/gtkcellarea.c
1616
gtk/gtkcellarea.c
File diff suppressed because it is too large
Load Diff
@ -34,10 +34,10 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#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))
|
||||
#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))
|
||||
#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))
|
||||
|
||||
@ -49,7 +49,7 @@ typedef struct _GtkCellAreaContext GtkCellAreaContext;
|
||||
/**
|
||||
* GTK_CELL_AREA_WARN_INVALID_CELL_PROPERTY_ID:
|
||||
* @object: the #GObject on which set_cell_property() or get_get_property()
|
||||
* was called
|
||||
* was called
|
||||
* @property_id: the numeric id of the property
|
||||
* @pspec: the #GParamSpec of the property
|
||||
*
|
||||
@ -70,26 +70,27 @@ typedef struct _GtkCellAreaContext GtkCellAreaContext;
|
||||
* Return value: %TRUE to stop iterating over cells.
|
||||
*/
|
||||
typedef gboolean (*GtkCellCallback) (GtkCellRenderer *renderer,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
|
||||
/**
|
||||
* GtkCellAllocCallback:
|
||||
* @renderer: the cell renderer to operate on
|
||||
* @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().
|
||||
* @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().
|
||||
* @data: user-supplied data
|
||||
*
|
||||
* The type of the callback functions used for iterating over
|
||||
* the cell renderers and their allocated areas inside a #GtkCellArea,
|
||||
* The type of the callback functions used for iterating over the
|
||||
* cell renderers and their allocated areas inside a #GtkCellArea,
|
||||
* see gtk_cell_area_foreach_alloc().
|
||||
*
|
||||
* Return value: %TRUE to stop iterating over cells.
|
||||
*/
|
||||
typedef gboolean (*GtkCellAllocCallback) (GtkCellRenderer *renderer,
|
||||
const GdkRectangle *cell_area,
|
||||
const GdkRectangle *cell_background,
|
||||
gpointer data);
|
||||
const GdkRectangle *cell_area,
|
||||
const GdkRectangle *cell_background,
|
||||
gpointer data);
|
||||
|
||||
|
||||
struct _GtkCellArea
|
||||
@ -105,60 +106,71 @@ struct _GtkCellArea
|
||||
* GtkCellAreaClass:
|
||||
* @add: adds a #GtkCellRenderer to the area.
|
||||
* @remove: removes a #GtkCellRenderer from the area.
|
||||
* @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.
|
||||
* @render: Actually render the area's cells to the specified rectangle, @background_area
|
||||
* should be correctly distributed to the cells coresponding background areas.
|
||||
* @apply_attributes: Apply the cell attributes to the cells. This is implemented as a signal and
|
||||
* generally #GtkCellArea subclasses dont need to implement this since it's handled by the base
|
||||
* class but can be overridden to apply some custom attributes.
|
||||
* @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 in tact.
|
||||
* @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 area's 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 area's 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. 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().
|
||||
* @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()).
|
||||
* @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.
|
||||
* @render: Actually render the area's cells to the specified rectangle,
|
||||
* @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.
|
||||
* 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().
|
||||
* @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()).
|
||||
*/
|
||||
struct _GtkCellAreaClass
|
||||
{
|
||||
@ -169,62 +181,62 @@ struct _GtkCellAreaClass
|
||||
|
||||
/* Basic methods */
|
||||
void (* add) (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *renderer);
|
||||
void (* remove) (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *renderer);
|
||||
void (* foreach) (GtkCellArea *area,
|
||||
GtkCellCallback callback,
|
||||
gpointer callback_data);
|
||||
GtkCellCallback callback,
|
||||
gpointer callback_data);
|
||||
void (* foreach_alloc) (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
const GdkRectangle *background_area,
|
||||
GtkCellAllocCallback callback,
|
||||
gpointer callback_data);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
const GdkRectangle *background_area,
|
||||
GtkCellAllocCallback callback,
|
||||
gpointer callback_data);
|
||||
gint (* event) (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
void (* render) (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const GdkRectangle *background_area,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags,
|
||||
gboolean paint_focus);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const GdkRectangle *background_area,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags,
|
||||
gboolean paint_focus);
|
||||
void (* apply_attributes) (GtkCellArea *area,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
gboolean is_expander,
|
||||
gboolean is_expanded);
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
gboolean is_expander,
|
||||
gboolean is_expanded);
|
||||
|
||||
/* Geometry */
|
||||
GtkCellAreaContext *(* create_context) (GtkCellArea *area);
|
||||
GtkCellAreaContext *(* copy_context) (GtkCellArea *area,
|
||||
GtkCellAreaContext *context);
|
||||
GtkCellAreaContext *context);
|
||||
GtkSizeRequestMode (* get_request_mode) (GtkCellArea *area);
|
||||
void (* get_preferred_width) (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
void (* get_preferred_height_for_width) (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
void (* get_preferred_height) (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
void (* get_preferred_width_for_height) (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
@ -232,26 +244,26 @@ struct _GtkCellAreaClass
|
||||
|
||||
/* Cell Properties */
|
||||
void (* set_cell_property) (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
GtkCellRenderer *renderer,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
void (* get_cell_property) (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
GtkCellRenderer *renderer,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
/* Focus */
|
||||
gboolean (* focus) (GtkCellArea *area,
|
||||
GtkDirectionType direction);
|
||||
GtkDirectionType direction);
|
||||
gboolean (* is_activatable) (GtkCellArea *area);
|
||||
gboolean (* activate) (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags,
|
||||
gboolean edit_only);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags,
|
||||
gboolean edit_only);
|
||||
|
||||
/*< private >*/
|
||||
|
||||
@ -270,193 +282,193 @@ GType gtk_cell_area_get_type (void) G_GNUC
|
||||
|
||||
/* Basic methods */
|
||||
void gtk_cell_area_add (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *renderer);
|
||||
void gtk_cell_area_remove (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *renderer);
|
||||
gboolean gtk_cell_area_has_renderer (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *renderer);
|
||||
void gtk_cell_area_foreach (GtkCellArea *area,
|
||||
GtkCellCallback callback,
|
||||
gpointer callback_data);
|
||||
GtkCellCallback callback,
|
||||
gpointer callback_data);
|
||||
void gtk_cell_area_foreach_alloc (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
const GdkRectangle *background_area,
|
||||
GtkCellAllocCallback callback,
|
||||
gpointer callback_data);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
const GdkRectangle *background_area,
|
||||
GtkCellAllocCallback callback,
|
||||
gpointer callback_data);
|
||||
gint gtk_cell_area_event (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
void gtk_cell_area_render (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const GdkRectangle *background_area,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags,
|
||||
gboolean paint_focus);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const GdkRectangle *background_area,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags,
|
||||
gboolean paint_focus);
|
||||
void gtk_cell_area_set_style_detail (GtkCellArea *area,
|
||||
const gchar *detail);
|
||||
const gchar *detail);
|
||||
G_CONST_RETURN gchar *gtk_cell_area_get_style_detail (GtkCellArea *area);
|
||||
|
||||
|
||||
void gtk_cell_area_get_cell_allocation (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
GtkCellRenderer *renderer,
|
||||
const GdkRectangle *cell_area,
|
||||
GdkRectangle *allocation);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
GtkCellRenderer *renderer,
|
||||
const GdkRectangle *cell_area,
|
||||
GdkRectangle *allocation);
|
||||
GtkCellRenderer *gtk_cell_area_get_cell_at_position (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
gint x,
|
||||
gint y,
|
||||
GdkRectangle *alloc_area);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
gint x,
|
||||
gint y,
|
||||
GdkRectangle *alloc_area);
|
||||
|
||||
/* Geometry */
|
||||
GtkCellAreaContext *gtk_cell_area_create_context (GtkCellArea *area);
|
||||
GtkCellAreaContext *gtk_cell_area_copy_context (GtkCellArea *area,
|
||||
GtkCellAreaContext *context);
|
||||
GtkCellAreaContext *context);
|
||||
GtkSizeRequestMode gtk_cell_area_get_request_mode (GtkCellArea *area);
|
||||
void gtk_cell_area_get_preferred_width (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
void gtk_cell_area_get_preferred_height_for_width (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
void gtk_cell_area_get_preferred_height (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
void gtk_cell_area_get_preferred_width_for_height (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
G_CONST_RETURN gchar *gtk_cell_area_get_current_path_string (GtkCellArea *area);
|
||||
|
||||
|
||||
/* Attributes */
|
||||
void gtk_cell_area_apply_attributes (GtkCellArea *area,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
gboolean is_expander,
|
||||
gboolean is_expanded);
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
gboolean is_expander,
|
||||
gboolean is_expanded);
|
||||
void gtk_cell_area_attribute_connect (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *attribute,
|
||||
gint column);
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *attribute,
|
||||
gint column);
|
||||
void gtk_cell_area_attribute_disconnect (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *attribute);
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *attribute);
|
||||
|
||||
/* Cell Properties */
|
||||
void gtk_cell_area_class_install_cell_property (GtkCellAreaClass *aclass,
|
||||
guint property_id,
|
||||
GParamSpec *pspec);
|
||||
guint property_id,
|
||||
GParamSpec *pspec);
|
||||
GParamSpec* gtk_cell_area_class_find_cell_property (GtkCellAreaClass *aclass,
|
||||
const gchar *property_name);
|
||||
const gchar *property_name);
|
||||
GParamSpec** gtk_cell_area_class_list_cell_properties (GtkCellAreaClass *aclass,
|
||||
guint *n_properties);
|
||||
guint *n_properties);
|
||||
void gtk_cell_area_add_with_properties (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_prop_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_prop_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
void gtk_cell_area_cell_set (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_prop_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_prop_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
void gtk_cell_area_cell_get (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_prop_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_prop_name,
|
||||
...) G_GNUC_NULL_TERMINATED;
|
||||
void gtk_cell_area_cell_set_valist (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_property_name,
|
||||
va_list var_args);
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_property_name,
|
||||
va_list var_args);
|
||||
void gtk_cell_area_cell_get_valist (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_property_name,
|
||||
va_list var_args);
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *first_property_name,
|
||||
va_list var_args);
|
||||
void gtk_cell_area_cell_set_property (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *property_name,
|
||||
const GValue *value);
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *property_name,
|
||||
const GValue *value);
|
||||
void gtk_cell_area_cell_get_property (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *property_name,
|
||||
GValue *value);
|
||||
GtkCellRenderer *renderer,
|
||||
const gchar *property_name,
|
||||
GValue *value);
|
||||
|
||||
/* Focus */
|
||||
gboolean gtk_cell_area_is_activatable (GtkCellArea *area);
|
||||
gboolean gtk_cell_area_activate (GtkCellArea *area,
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags,
|
||||
gboolean edit_only);
|
||||
GtkCellAreaContext *context,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags,
|
||||
gboolean edit_only);
|
||||
gboolean gtk_cell_area_focus (GtkCellArea *area,
|
||||
GtkDirectionType direction);
|
||||
GtkDirectionType direction);
|
||||
void gtk_cell_area_set_focus_cell (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *gtk_cell_area_get_focus_cell (GtkCellArea *area);
|
||||
|
||||
|
||||
/* Focus siblings */
|
||||
void gtk_cell_area_add_focus_sibling (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
GtkCellRenderer *sibling);
|
||||
GtkCellRenderer *renderer,
|
||||
GtkCellRenderer *sibling);
|
||||
void gtk_cell_area_remove_focus_sibling (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
GtkCellRenderer *sibling);
|
||||
GtkCellRenderer *renderer,
|
||||
GtkCellRenderer *sibling);
|
||||
gboolean gtk_cell_area_is_focus_sibling (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
GtkCellRenderer *sibling);
|
||||
GtkCellRenderer *renderer,
|
||||
GtkCellRenderer *sibling);
|
||||
G_CONST_RETURN GList *gtk_cell_area_get_focus_siblings (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *gtk_cell_area_get_focus_from_sibling (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer);
|
||||
GtkCellRenderer *renderer);
|
||||
|
||||
/* Cell Activation/Editing */
|
||||
GtkCellRenderer *gtk_cell_area_get_edited_cell (GtkCellArea *area);
|
||||
GtkCellEditable *gtk_cell_area_get_edit_widget (GtkCellArea *area);
|
||||
gboolean gtk_cell_area_activate_cell (GtkCellArea *area,
|
||||
GtkWidget *widget,
|
||||
GtkCellRenderer *renderer,
|
||||
GdkEvent *event,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
GtkWidget *widget,
|
||||
GtkCellRenderer *renderer,
|
||||
GdkEvent *event,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkCellRendererState flags);
|
||||
void gtk_cell_area_stop_editing (GtkCellArea *area,
|
||||
gboolean canceled);
|
||||
gboolean canceled);
|
||||
|
||||
/* Functions for area implementations */
|
||||
|
||||
/* Distinguish the inner cell area from the whole requested area including margins */
|
||||
void gtk_cell_area_inner_cell_area (GtkCellArea *area,
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
GdkRectangle *inner_area);
|
||||
GtkWidget *widget,
|
||||
const GdkRectangle *cell_area,
|
||||
GdkRectangle *inner_area);
|
||||
|
||||
/* Request the size of a cell while respecting the cell margins (requests are margin inclusive) */
|
||||
void gtk_cell_area_request_renderer (GtkCellArea *area,
|
||||
GtkCellRenderer *renderer,
|
||||
GtkOrientation orientation,
|
||||
GtkWidget *widget,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
GtkCellRenderer *renderer,
|
||||
GtkOrientation orientation,
|
||||
GtkWidget *widget,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
1266
gtk/gtkcellareabox.c
1266
gtk/gtkcellareabox.c
File diff suppressed because it is too large
Load Diff
@ -32,10 +32,10 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_CELL_AREA_BOX (gtk_cell_area_box_get_type ())
|
||||
#define GTK_CELL_AREA_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_BOX, GtkCellAreaBox))
|
||||
#define GTK_CELL_AREA_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_BOX, GtkCellAreaBoxClass))
|
||||
#define GTK_IS_CELL_AREA_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_BOX))
|
||||
#define GTK_TYPE_CELL_AREA_BOX (gtk_cell_area_box_get_type ())
|
||||
#define GTK_CELL_AREA_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_BOX, GtkCellAreaBox))
|
||||
#define GTK_CELL_AREA_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_BOX, GtkCellAreaBoxClass))
|
||||
#define GTK_IS_CELL_AREA_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_BOX))
|
||||
#define GTK_IS_CELL_AREA_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA_BOX))
|
||||
#define GTK_CELL_AREA_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA_BOX, GtkCellAreaBoxClass))
|
||||
|
||||
@ -63,20 +63,20 @@ struct _GtkCellAreaBoxClass
|
||||
void (*_gtk_reserved4) (void);
|
||||
};
|
||||
|
||||
GType gtk_cell_area_box_get_type (void) G_GNUC_CONST;
|
||||
GType gtk_cell_area_box_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkCellArea *gtk_cell_area_box_new (void);
|
||||
void gtk_cell_area_box_pack_start (GtkCellAreaBox *box,
|
||||
GtkCellRenderer *renderer,
|
||||
gboolean expand,
|
||||
gboolean align);
|
||||
void gtk_cell_area_box_pack_end (GtkCellAreaBox *box,
|
||||
GtkCellRenderer *renderer,
|
||||
gboolean expand,
|
||||
gboolean align);
|
||||
gint gtk_cell_area_box_get_spacing (GtkCellAreaBox *box);
|
||||
void gtk_cell_area_box_set_spacing (GtkCellAreaBox *box,
|
||||
gint spacing);
|
||||
GtkCellArea *gtk_cell_area_box_new (void);
|
||||
void gtk_cell_area_box_pack_start (GtkCellAreaBox *box,
|
||||
GtkCellRenderer *renderer,
|
||||
gboolean expand,
|
||||
gboolean align);
|
||||
void gtk_cell_area_box_pack_end (GtkCellAreaBox *box,
|
||||
GtkCellRenderer *renderer,
|
||||
gboolean expand,
|
||||
gboolean align);
|
||||
gint gtk_cell_area_box_get_spacing (GtkCellAreaBox *box);
|
||||
void gtk_cell_area_box_set_spacing (GtkCellAreaBox *box,
|
||||
gint spacing);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -33,32 +33,32 @@ static void gtk_cell_area_box_context_finalize (GObject
|
||||
/* GtkCellAreaContextClass */
|
||||
static void gtk_cell_area_box_context_reset (GtkCellAreaContext *context);
|
||||
static void gtk_cell_area_box_context_allocate (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint height);
|
||||
gint width,
|
||||
gint height);
|
||||
static void gtk_cell_area_box_context_get_preferred_height_for_width (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
static void gtk_cell_area_box_context_get_preferred_width_for_height (GtkCellAreaContext *context,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
|
||||
|
||||
|
||||
/* Internal functions */
|
||||
static void gtk_cell_area_box_context_sum (GtkCellAreaBoxContext *context,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void free_cache_array (GArray *array);
|
||||
static GArray *group_array_new (GtkCellAreaBoxContext *context);
|
||||
static GArray *get_array (GtkCellAreaBoxContext *context,
|
||||
GtkOrientation orientation,
|
||||
gint for_size);
|
||||
GtkOrientation orientation,
|
||||
gint for_size);
|
||||
static gboolean group_expands (GtkCellAreaBoxContext *context,
|
||||
gint group_idx);
|
||||
gint group_idx);
|
||||
static gint count_expand_groups (GtkCellAreaBoxContext *context);
|
||||
|
||||
|
||||
@ -110,8 +110,8 @@ group_array_new (GtkCellAreaBoxContext *context)
|
||||
|
||||
static GArray *
|
||||
get_array (GtkCellAreaBoxContext *context,
|
||||
GtkOrientation orientation,
|
||||
gint for_size)
|
||||
GtkOrientation orientation,
|
||||
gint for_size)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv = context->priv;
|
||||
GArray *array;
|
||||
@ -119,26 +119,26 @@ get_array (GtkCellAreaBoxContext *context,
|
||||
if (for_size < 0)
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
array = priv->base_widths;
|
||||
array = priv->base_widths;
|
||||
else
|
||||
array = priv->base_heights;
|
||||
array = priv->base_heights;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
array = g_hash_table_lookup (priv->widths, GINT_TO_POINTER (for_size));
|
||||
{
|
||||
array = g_hash_table_lookup (priv->widths, GINT_TO_POINTER (for_size));
|
||||
|
||||
if (!array)
|
||||
array = priv->base_widths;
|
||||
}
|
||||
if (!array)
|
||||
array = priv->base_widths;
|
||||
}
|
||||
else
|
||||
{
|
||||
array = g_hash_table_lookup (priv->heights, GINT_TO_POINTER (for_size));
|
||||
{
|
||||
array = g_hash_table_lookup (priv->heights, GINT_TO_POINTER (for_size));
|
||||
|
||||
if (!array)
|
||||
array = priv->base_heights;
|
||||
}
|
||||
if (!array)
|
||||
array = priv->base_heights;
|
||||
}
|
||||
}
|
||||
|
||||
return array;
|
||||
@ -146,7 +146,7 @@ get_array (GtkCellAreaBoxContext *context,
|
||||
|
||||
static gboolean
|
||||
group_expands (GtkCellAreaBoxContext *context,
|
||||
gint group_idx)
|
||||
gint group_idx)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv = context->priv;
|
||||
|
||||
@ -164,7 +164,7 @@ count_expand_groups (GtkCellAreaBoxContext *context)
|
||||
for (i = 0; i < priv->base_widths->len; i++)
|
||||
{
|
||||
if (priv->expand[i])
|
||||
expand++;
|
||||
expand++;
|
||||
}
|
||||
|
||||
return expand;
|
||||
@ -176,17 +176,17 @@ gtk_cell_area_box_context_init (GtkCellAreaBoxContext *box_context)
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
|
||||
box_context->priv = G_TYPE_INSTANCE_GET_PRIVATE (box_context,
|
||||
GTK_TYPE_CELL_AREA_BOX_CONTEXT,
|
||||
GtkCellAreaBoxContextPrivate);
|
||||
GTK_TYPE_CELL_AREA_BOX_CONTEXT,
|
||||
GtkCellAreaBoxContextPrivate);
|
||||
priv = box_context->priv;
|
||||
|
||||
priv->base_widths = g_array_new (FALSE, TRUE, sizeof (CachedSize));
|
||||
priv->base_heights = g_array_new (FALSE, TRUE, sizeof (CachedSize));
|
||||
|
||||
priv->widths = g_hash_table_new_full (g_direct_hash, g_direct_equal,
|
||||
NULL, (GDestroyNotify)free_cache_array);
|
||||
NULL, (GDestroyNotify)free_cache_array);
|
||||
priv->heights = g_hash_table_new_full (g_direct_hash, g_direct_equal,
|
||||
NULL, (GDestroyNotify)free_cache_array);
|
||||
NULL, (GDestroyNotify)free_cache_array);
|
||||
|
||||
priv->alloc_width = 0;
|
||||
priv->alloc_height = 0;
|
||||
@ -232,7 +232,7 @@ gtk_cell_area_box_context_finalize (GObject *object)
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* GtkCellAreaContextClass *
|
||||
* GtkCellAreaContextClass *
|
||||
*************************************************************/
|
||||
static void
|
||||
gtk_cell_area_box_context_reset (GtkCellAreaContext *context)
|
||||
@ -270,9 +270,9 @@ gtk_cell_area_box_context_reset (GtkCellAreaContext *context)
|
||||
|
||||
static GtkRequestedSize *
|
||||
gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *n_requests)
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *n_requests)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
GtkRequestedSize *requests;
|
||||
@ -291,7 +291,7 @@ gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
|
||||
size = &g_array_index (array, CachedSize, i);
|
||||
|
||||
if (size->nat_size > 0)
|
||||
visible_groups++;
|
||||
visible_groups++;
|
||||
}
|
||||
|
||||
requests = g_new (GtkRequestedSize, visible_groups);
|
||||
@ -301,12 +301,12 @@ gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
|
||||
size = &g_array_index (array, CachedSize, i);
|
||||
|
||||
if (size->nat_size > 0)
|
||||
{
|
||||
requests[j].data = GINT_TO_POINTER (i);
|
||||
requests[j].minimum_size = size->min_size;
|
||||
requests[j].natural_size = size->nat_size;
|
||||
j++;
|
||||
}
|
||||
{
|
||||
requests[j].data = GINT_TO_POINTER (i);
|
||||
requests[j].minimum_size = size->min_size;
|
||||
requests[j].natural_size = size->nat_size;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
if (n_requests)
|
||||
@ -317,11 +317,11 @@ gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
|
||||
|
||||
static GtkCellAreaBoxAllocation *
|
||||
allocate_for_orientation (GtkCellAreaBoxContext *context,
|
||||
GtkOrientation orientation,
|
||||
gint spacing,
|
||||
gint size,
|
||||
gint for_size,
|
||||
gint *n_allocs)
|
||||
GtkOrientation orientation,
|
||||
gint spacing,
|
||||
gint size,
|
||||
gint for_size,
|
||||
gint *n_allocs)
|
||||
{
|
||||
GtkCellAreaBoxAllocation *allocs;
|
||||
GtkRequestedSize *sizes;
|
||||
@ -363,14 +363,14 @@ allocate_for_orientation (GtkCellAreaBoxContext *context,
|
||||
allocs[i].size = sizes[i].minimum_size;
|
||||
|
||||
if (group_expands (context, allocs[i].group_idx))
|
||||
{
|
||||
allocs[i].size += extra_size;
|
||||
if (extra_extra)
|
||||
{
|
||||
allocs[i].size++;
|
||||
extra_extra--;
|
||||
}
|
||||
}
|
||||
{
|
||||
allocs[i].size += extra_size;
|
||||
if (extra_extra)
|
||||
{
|
||||
allocs[i].size++;
|
||||
extra_extra--;
|
||||
}
|
||||
}
|
||||
|
||||
position += allocs[i].size;
|
||||
position += spacing;
|
||||
@ -386,8 +386,8 @@ allocate_for_orientation (GtkCellAreaBoxContext *context,
|
||||
|
||||
static void
|
||||
gtk_cell_area_box_context_allocate (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint height)
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GtkCellAreaBoxContext *box_context = GTK_CELL_AREA_BOX_CONTEXT (context);
|
||||
GtkCellAreaBoxContextPrivate *priv = box_context->priv;
|
||||
@ -405,22 +405,22 @@ gtk_cell_area_box_context_allocate (GtkCellAreaContext *context,
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL && width > 0)
|
||||
priv->orientation_allocs = allocate_for_orientation (box_context, orientation,
|
||||
spacing, width, height,
|
||||
&priv->n_orientation_allocs);
|
||||
spacing, width, height,
|
||||
&priv->n_orientation_allocs);
|
||||
else if (orientation == GTK_ORIENTATION_VERTICAL && height > 0)
|
||||
priv->orientation_allocs = allocate_for_orientation (box_context, orientation,
|
||||
spacing, height, width,
|
||||
&priv->n_orientation_allocs);
|
||||
spacing, height, width,
|
||||
&priv->n_orientation_allocs);
|
||||
|
||||
GTK_CELL_AREA_CONTEXT_CLASS (gtk_cell_area_box_context_parent_class)->allocate (context, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_cell_area_box_context_sum (GtkCellAreaBoxContext *context,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
GtkCellArea *area;
|
||||
GtkOrientation box_orientation;
|
||||
@ -438,32 +438,32 @@ gtk_cell_area_box_context_sum (GtkCellAreaBoxContext *context,
|
||||
CachedSize *size = &g_array_index (array, CachedSize, i);
|
||||
|
||||
if (box_orientation == orientation)
|
||||
{
|
||||
/* Dont add spacing for 0 size groups, they can be 0 size because
|
||||
* they contain only invisible cells for this round of requests
|
||||
*/
|
||||
if (min_size > 0 && size->nat_size > 0)
|
||||
{
|
||||
min_size += spacing;
|
||||
nat_size += spacing;
|
||||
}
|
||||
|
||||
min_size += size->min_size;
|
||||
nat_size += size->nat_size;
|
||||
}
|
||||
{
|
||||
/* Dont add spacing for 0 size groups, they can be 0 size because
|
||||
* they contain only invisible cells for this round of requests
|
||||
*/
|
||||
if (min_size > 0 && size->nat_size > 0)
|
||||
{
|
||||
min_size += spacing;
|
||||
nat_size += spacing;
|
||||
}
|
||||
|
||||
min_size += size->min_size;
|
||||
nat_size += size->nat_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
min_size = MAX (min_size, size->min_size);
|
||||
nat_size = MAX (nat_size, size->nat_size);
|
||||
}
|
||||
{
|
||||
min_size = MAX (min_size, size->min_size);
|
||||
nat_size = MAX (nat_size, size->nat_size);
|
||||
}
|
||||
}
|
||||
|
||||
if (for_size < 0)
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_cell_area_context_push_preferred_width (GTK_CELL_AREA_CONTEXT (context), min_size, nat_size);
|
||||
gtk_cell_area_context_push_preferred_width (GTK_CELL_AREA_CONTEXT (context), min_size, nat_size);
|
||||
else
|
||||
gtk_cell_area_context_push_preferred_height (GTK_CELL_AREA_CONTEXT (context), min_size, nat_size);
|
||||
gtk_cell_area_context_push_preferred_height (GTK_CELL_AREA_CONTEXT (context), min_size, nat_size);
|
||||
}
|
||||
|
||||
if (minimum_size)
|
||||
@ -474,22 +474,22 @@ gtk_cell_area_box_context_sum (GtkCellAreaBoxContext *context,
|
||||
|
||||
static void
|
||||
gtk_cell_area_box_context_get_preferred_height_for_width (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_VERTICAL,
|
||||
width, minimum_height, natural_height);
|
||||
width, minimum_height, natural_height);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_cell_area_box_context_get_preferred_width_for_height (GtkCellAreaContext *context,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_HORIZONTAL,
|
||||
height, minimum_width, natural_width);
|
||||
height, minimum_width, natural_width);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
@ -497,7 +497,7 @@ gtk_cell_area_box_context_get_preferred_width_for_height (GtkCellAreaContext *co
|
||||
*************************************************************/
|
||||
static void
|
||||
copy_size_array (GArray *src_array,
|
||||
GArray *dest_array)
|
||||
GArray *dest_array)
|
||||
{
|
||||
gint i;
|
||||
|
||||
@ -512,8 +512,8 @@ copy_size_array (GArray *src_array,
|
||||
|
||||
static void
|
||||
for_size_copy (gpointer key,
|
||||
GArray *size_array,
|
||||
GHashTable *dest_hash)
|
||||
GArray *size_array,
|
||||
GHashTable *dest_hash)
|
||||
{
|
||||
GArray *new_array;
|
||||
|
||||
@ -527,52 +527,52 @@ for_size_copy (gpointer key,
|
||||
|
||||
GtkCellAreaBoxContext *
|
||||
gtk_cell_area_box_context_copy (GtkCellAreaBox *box,
|
||||
GtkCellAreaBoxContext *context)
|
||||
GtkCellAreaBoxContext *context)
|
||||
{
|
||||
GtkCellAreaBoxContext *copy;
|
||||
|
||||
copy = g_object_new (GTK_TYPE_CELL_AREA_BOX_CONTEXT,
|
||||
"area", box, NULL);
|
||||
copy = g_object_new (GTK_TYPE_CELL_AREA_BOX_CONTEXT,
|
||||
"area", box, NULL);
|
||||
|
||||
gtk_cell_area_box_init_groups (copy,
|
||||
context->priv->base_widths->len,
|
||||
context->priv->expand);
|
||||
gtk_cell_area_box_init_groups (copy,
|
||||
context->priv->base_widths->len,
|
||||
context->priv->expand);
|
||||
|
||||
/* Copy the base arrays */
|
||||
copy_size_array (context->priv->base_widths,
|
||||
copy->priv->base_widths);
|
||||
copy_size_array (context->priv->base_heights,
|
||||
copy->priv->base_heights);
|
||||
copy_size_array (context->priv->base_widths,
|
||||
copy->priv->base_widths);
|
||||
copy_size_array (context->priv->base_heights,
|
||||
copy->priv->base_heights);
|
||||
|
||||
/* Copy each for size */
|
||||
g_hash_table_foreach (context->priv->heights,
|
||||
(GHFunc)for_size_copy, copy->priv->heights);
|
||||
(GHFunc)for_size_copy, copy->priv->heights);
|
||||
g_hash_table_foreach (context->priv->widths,
|
||||
(GHFunc)for_size_copy, copy->priv->widths);
|
||||
(GHFunc)for_size_copy, copy->priv->widths);
|
||||
|
||||
/* Copy any active allocation */
|
||||
copy->priv->n_orientation_allocs =
|
||||
copy->priv->n_orientation_allocs =
|
||||
context->priv->n_orientation_allocs;
|
||||
|
||||
if (copy->priv->n_orientation_allocs)
|
||||
copy->priv->orientation_allocs =
|
||||
g_memdup (context->priv->orientation_allocs,
|
||||
copy->priv->n_orientation_allocs * sizeof (GtkCellAreaBoxAllocation));
|
||||
copy->priv->orientation_allocs =
|
||||
g_memdup (context->priv->orientation_allocs,
|
||||
copy->priv->n_orientation_allocs * sizeof (GtkCellAreaBoxAllocation));
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
|
||||
guint n_groups,
|
||||
gboolean *expand_groups)
|
||||
guint n_groups,
|
||||
gboolean *expand_groups)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
|
||||
g_return_if_fail (GTK_IS_CELL_AREA_BOX_CONTEXT (box_context));
|
||||
g_return_if_fail (n_groups == 0 || expand_groups != NULL);
|
||||
|
||||
/* When the group dimensions change, all info must be reset
|
||||
/* When the group dimensions change, all info must be reset
|
||||
* Note this already clears the min/nat values on the CachedSizes
|
||||
*/
|
||||
gtk_cell_area_context_reset (GTK_CELL_AREA_CONTEXT (box_context));
|
||||
@ -587,9 +587,9 @@ gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
|
||||
|
||||
void
|
||||
gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint minimum_width,
|
||||
gint natural_width)
|
||||
gint group_idx,
|
||||
gint minimum_width,
|
||||
gint natural_width)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
CachedSize *size;
|
||||
@ -618,10 +618,10 @@ gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxContext *box_context,
|
||||
|
||||
void
|
||||
gtk_cell_area_box_context_push_group_height_for_width (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint for_width,
|
||||
gint minimum_height,
|
||||
gint natural_height)
|
||||
gint group_idx,
|
||||
gint for_width,
|
||||
gint minimum_height,
|
||||
gint natural_height)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
GArray *group_array;
|
||||
@ -646,9 +646,9 @@ gtk_cell_area_box_context_push_group_height_for_width (GtkCellAreaBoxContext *b
|
||||
|
||||
void
|
||||
gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint minimum_height,
|
||||
gint natural_height)
|
||||
gint group_idx,
|
||||
gint minimum_height,
|
||||
gint natural_height)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
CachedSize *size;
|
||||
@ -677,10 +677,10 @@ gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context,
|
||||
|
||||
void
|
||||
gtk_cell_area_box_context_push_group_width_for_height (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint for_height,
|
||||
gint minimum_width,
|
||||
gint natural_width)
|
||||
gint group_idx,
|
||||
gint for_height,
|
||||
gint minimum_width,
|
||||
gint natural_width)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
GArray *group_array;
|
||||
@ -705,9 +705,9 @@ gtk_cell_area_box_context_push_group_width_for_height (GtkCellAreaBoxContext *bo
|
||||
|
||||
void
|
||||
gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
gint group_idx,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
CachedSize *size;
|
||||
@ -721,17 +721,17 @@ gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context,
|
||||
|
||||
if (minimum_width)
|
||||
*minimum_width = size->min_size;
|
||||
|
||||
|
||||
if (natural_width)
|
||||
*natural_width = size->nat_size;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_cell_area_box_context_get_group_height_for_width (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint for_width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
gint group_idx,
|
||||
gint for_width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
GArray *group_array;
|
||||
@ -748,26 +748,26 @@ gtk_cell_area_box_context_get_group_height_for_width (GtkCellAreaBoxContext *box
|
||||
CachedSize *size = &g_array_index (group_array, CachedSize, group_idx);
|
||||
|
||||
if (minimum_height)
|
||||
*minimum_height = size->min_size;
|
||||
*minimum_height = size->min_size;
|
||||
|
||||
if (natural_height)
|
||||
*natural_height = size->nat_size;
|
||||
*natural_height = size->nat_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minimum_height)
|
||||
*minimum_height = -1;
|
||||
*minimum_height = -1;
|
||||
|
||||
if (natural_height)
|
||||
*natural_height = -1;
|
||||
*natural_height = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
gint group_idx,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
CachedSize *size;
|
||||
@ -781,17 +781,17 @@ gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context,
|
||||
|
||||
if (minimum_height)
|
||||
*minimum_height = size->min_size;
|
||||
|
||||
|
||||
if (natural_height)
|
||||
*natural_height = size->nat_size;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_cell_area_box_context_get_group_width_for_height (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint for_height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
gint group_idx,
|
||||
gint for_height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
GArray *group_array;
|
||||
@ -808,43 +808,43 @@ gtk_cell_area_box_context_get_group_width_for_height (GtkCellAreaBoxContext *box
|
||||
CachedSize *size = &g_array_index (group_array, CachedSize, group_idx);
|
||||
|
||||
if (minimum_width)
|
||||
*minimum_width = size->min_size;
|
||||
*minimum_width = size->min_size;
|
||||
|
||||
if (natural_width)
|
||||
*natural_width = size->nat_size;
|
||||
*natural_width = size->nat_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minimum_width)
|
||||
*minimum_width = -1;
|
||||
*minimum_width = -1;
|
||||
|
||||
if (natural_width)
|
||||
*natural_width = -1;
|
||||
*natural_width = -1;
|
||||
}
|
||||
}
|
||||
|
||||
GtkRequestedSize *
|
||||
gtk_cell_area_box_context_get_widths (GtkCellAreaBoxContext *box_context,
|
||||
gint *n_widths)
|
||||
gint *n_widths)
|
||||
{
|
||||
return gtk_cell_area_box_context_get_requests (box_context, GTK_ORIENTATION_HORIZONTAL, -1, n_widths);
|
||||
}
|
||||
|
||||
GtkRequestedSize *
|
||||
gtk_cell_area_box_context_get_heights (GtkCellAreaBoxContext *box_context,
|
||||
gint *n_heights)
|
||||
gint *n_heights)
|
||||
{
|
||||
return gtk_cell_area_box_context_get_requests (box_context, GTK_ORIENTATION_VERTICAL, -1, n_heights);
|
||||
}
|
||||
|
||||
GtkCellAreaBoxAllocation *
|
||||
gtk_cell_area_box_context_get_orientation_allocs (GtkCellAreaBoxContext *context,
|
||||
gint *n_allocs)
|
||||
gint *n_allocs)
|
||||
{
|
||||
GtkCellAreaBoxContextPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_CELL_AREA_BOX_CONTEXT (context), NULL);
|
||||
|
||||
|
||||
priv = context->priv;
|
||||
|
||||
*n_allocs = priv->n_orientation_allocs;
|
||||
|
@ -35,10 +35,10 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_CELL_AREA_BOX_CONTEXT (gtk_cell_area_box_context_get_type ())
|
||||
#define GTK_CELL_AREA_BOX_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContext))
|
||||
#define GTK_CELL_AREA_BOX_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContextClass))
|
||||
#define GTK_IS_CELL_AREA_BOX_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT))
|
||||
#define GTK_TYPE_CELL_AREA_BOX_CONTEXT (gtk_cell_area_box_context_get_type ())
|
||||
#define GTK_CELL_AREA_BOX_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContext))
|
||||
#define GTK_CELL_AREA_BOX_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContextClass))
|
||||
#define GTK_IS_CELL_AREA_BOX_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT))
|
||||
#define GTK_IS_CELL_AREA_BOX_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA_BOX_CONTEXT))
|
||||
#define GTK_CELL_AREA_BOX_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContextClass))
|
||||
|
||||
@ -64,63 +64,63 @@ GType gtk_cell_area_box_context_get_type (void) G_GNUC_CON
|
||||
|
||||
/* Create a duplicate of the context */
|
||||
GtkCellAreaBoxContext *gtk_cell_area_box_context_copy (GtkCellAreaBox *box,
|
||||
GtkCellAreaBoxContext *box_context);
|
||||
GtkCellAreaBoxContext *box_context);
|
||||
|
||||
/* Initialize group array dimensions */
|
||||
void gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
|
||||
guint n_groups,
|
||||
gboolean *expand_groups);
|
||||
guint n_groups,
|
||||
gboolean *expand_groups);
|
||||
|
||||
/* Update cell-group sizes */
|
||||
void gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint minimum_width,
|
||||
gint natural_width);
|
||||
gint group_idx,
|
||||
gint minimum_width,
|
||||
gint natural_width);
|
||||
|
||||
void gtk_cell_area_box_context_push_group_height_for_width (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint for_width,
|
||||
gint minimum_height,
|
||||
gint natural_height);
|
||||
gint group_idx,
|
||||
gint for_width,
|
||||
gint minimum_height,
|
||||
gint natural_height);
|
||||
|
||||
void gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint minimum_height,
|
||||
gint natural_height);
|
||||
gint group_idx,
|
||||
gint minimum_height,
|
||||
gint natural_height);
|
||||
|
||||
void gtk_cell_area_box_context_push_group_width_for_height (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint for_height,
|
||||
gint minimum_width,
|
||||
gint natural_width);
|
||||
gint group_idx,
|
||||
gint for_height,
|
||||
gint minimum_width,
|
||||
gint natural_width);
|
||||
|
||||
/* Fetch cell-group sizes */
|
||||
void gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
gint group_idx,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
|
||||
void gtk_cell_area_box_context_get_group_height_for_width (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint for_width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
gint group_idx,
|
||||
gint for_width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
|
||||
void gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
gint group_idx,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
|
||||
void gtk_cell_area_box_context_get_group_width_for_height (GtkCellAreaBoxContext *box_context,
|
||||
gint group_idx,
|
||||
gint for_height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
gint group_idx,
|
||||
gint for_height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
|
||||
GtkRequestedSize *gtk_cell_area_box_context_get_widths (GtkCellAreaBoxContext *box_context,
|
||||
gint *n_widths);
|
||||
gint *n_widths);
|
||||
GtkRequestedSize *gtk_cell_area_box_context_get_heights (GtkCellAreaBoxContext *box_context,
|
||||
gint *n_heights);
|
||||
gint *n_heights);
|
||||
|
||||
/* Private context/area interaction */
|
||||
typedef struct {
|
||||
@ -131,7 +131,7 @@ typedef struct {
|
||||
|
||||
GtkCellAreaBoxAllocation *
|
||||
gtk_cell_area_box_context_get_orientation_allocs (GtkCellAreaBoxContext *context,
|
||||
gint *n_allocs);
|
||||
gint *n_allocs);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -23,18 +23,22 @@
|
||||
|
||||
/**
|
||||
* SECTION:gtkcellareacontext
|
||||
* @Short_Description: An object for a GtkCellArea to store geometrical information for a series of rows.
|
||||
* @Short_Description: An object for a GtkCellArea to store geometrical
|
||||
* information for a series of rows.
|
||||
* @Title: GtkCellAreaContext
|
||||
*
|
||||
* The #GtkCellAreaContext object is created by a given #GtkCellArea implementation via it's
|
||||
* #GtkCellAreaClass.create_context() virtual method and is used to store cell sizes and alignments
|
||||
* for a series of #GtkTreeModel rows that are requested and rendered in the same context.
|
||||
* The #GtkCellAreaContext object is created by a given #GtkCellArea
|
||||
* implementation via it's #GtkCellAreaClass.create_context() virtual
|
||||
* method and is used to store cell sizes and alignments for a series of
|
||||
* #GtkTreeModel rows that are requested and rendered in the same context.
|
||||
*
|
||||
* #GtkCellLayout widgets can create any number of contexts in which to request and render
|
||||
* groups of data rows. However its important that the same context which was used to
|
||||
* request sizes for a given #GtkTreeModel row also be used for the same row when calling
|
||||
* other #GtkCellArea apis such as gtk_cell_area_render() and gtk_cell_area_event().
|
||||
* #GtkCellLayout widgets can create any number of contexts in which to
|
||||
* request and render groups of data rows. However its important that the
|
||||
* same context which was used to request sizes for a given #GtkTreeModel
|
||||
* row also be used for the same row when calling other #GtkCellArea APIs
|
||||
* such as gtk_cell_area_render() and gtk_cell_area_event().
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkmarshalers.h"
|
||||
@ -42,21 +46,21 @@
|
||||
#include "gtkprivate.h"
|
||||
|
||||
/* GObjectClass */
|
||||
static void gtk_cell_area_context_dispose (GObject *object);
|
||||
static void gtk_cell_area_context_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gtk_cell_area_context_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gtk_cell_area_context_dispose (GObject *object);
|
||||
static void gtk_cell_area_context_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gtk_cell_area_context_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
/* GtkCellAreaContextClass */
|
||||
static void gtk_cell_area_context_real_reset (GtkCellAreaContext *context);
|
||||
static void gtk_cell_area_context_real_allocate (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint height);
|
||||
static void gtk_cell_area_context_real_reset (GtkCellAreaContext *context);
|
||||
static void gtk_cell_area_context_real_allocate (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint height);
|
||||
|
||||
struct _GtkCellAreaContextPrivate
|
||||
{
|
||||
@ -87,8 +91,8 @@ gtk_cell_area_context_init (GtkCellAreaContext *context)
|
||||
GtkCellAreaContextPrivate *priv;
|
||||
|
||||
context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context,
|
||||
GTK_TYPE_CELL_AREA_CONTEXT,
|
||||
GtkCellAreaContextPrivate);
|
||||
GTK_TYPE_CELL_AREA_CONTEXT,
|
||||
GtkCellAreaContextPrivate);
|
||||
priv = context->priv;
|
||||
|
||||
priv->min_width = -1;
|
||||
@ -97,7 +101,7 @@ gtk_cell_area_context_init (GtkCellAreaContext *context)
|
||||
priv->nat_height = -1;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_cell_area_context_class_init (GtkCellAreaContextClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
@ -121,10 +125,10 @@ gtk_cell_area_context_class_init (GtkCellAreaContextClass *class)
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_CELL_AREA,
|
||||
g_param_spec_object ("area",
|
||||
P_("Area"),
|
||||
P_("The Cell Area this context was created for"),
|
||||
GTK_TYPE_CELL_AREA,
|
||||
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||
P_("Area"),
|
||||
P_("The Cell Area this context was created for"),
|
||||
GTK_TYPE_CELL_AREA,
|
||||
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||
|
||||
/**
|
||||
* GtkCellAreaContext:minimum-width:
|
||||
@ -138,12 +142,12 @@ gtk_cell_area_context_class_init (GtkCellAreaContextClass *class)
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_MIN_WIDTH,
|
||||
g_param_spec_int ("minimum-width",
|
||||
P_("Minimum Width"),
|
||||
P_("Minimum cached width"),
|
||||
-1,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
G_PARAM_READABLE));
|
||||
P_("Minimum Width"),
|
||||
P_("Minimum cached width"),
|
||||
-1,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
/**
|
||||
* GtkCellAreaContext:natural-width:
|
||||
@ -157,12 +161,12 @@ gtk_cell_area_context_class_init (GtkCellAreaContextClass *class)
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_NAT_WIDTH,
|
||||
g_param_spec_int ("natural-width",
|
||||
P_("Minimum Width"),
|
||||
P_("Minimum cached width"),
|
||||
-1,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
G_PARAM_READABLE));
|
||||
P_("Minimum Width"),
|
||||
P_("Minimum cached width"),
|
||||
-1,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
/**
|
||||
* GtkCellAreaContext:minimum-height:
|
||||
@ -176,12 +180,12 @@ gtk_cell_area_context_class_init (GtkCellAreaContextClass *class)
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_MIN_HEIGHT,
|
||||
g_param_spec_int ("minimum-height",
|
||||
P_("Minimum Height"),
|
||||
P_("Minimum cached height"),
|
||||
-1,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
G_PARAM_READABLE));
|
||||
P_("Minimum Height"),
|
||||
P_("Minimum cached height"),
|
||||
-1,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
/**
|
||||
* GtkCellAreaContext:natural-height:
|
||||
@ -195,12 +199,12 @@ gtk_cell_area_context_class_init (GtkCellAreaContextClass *class)
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_NAT_HEIGHT,
|
||||
g_param_spec_int ("natural-height",
|
||||
P_("Minimum Height"),
|
||||
P_("Minimum cached height"),
|
||||
-1,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
G_PARAM_READABLE));
|
||||
P_("Minimum Height"),
|
||||
P_("Minimum cached height"),
|
||||
-1,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (GtkCellAreaContextPrivate));
|
||||
}
|
||||
@ -226,9 +230,9 @@ gtk_cell_area_context_dispose (GObject *object)
|
||||
|
||||
static void
|
||||
gtk_cell_area_context_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkCellAreaContext *context = GTK_CELL_AREA_CONTEXT (object);
|
||||
GtkCellAreaContextPrivate *priv = context->priv;
|
||||
@ -246,9 +250,9 @@ gtk_cell_area_context_set_property (GObject *object,
|
||||
|
||||
static void
|
||||
gtk_cell_area_context_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkCellAreaContext *context = GTK_CELL_AREA_CONTEXT (object);
|
||||
GtkCellAreaContextPrivate *priv = context->priv;
|
||||
@ -277,13 +281,13 @@ gtk_cell_area_context_get_property (GObject *object,
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* GtkCellAreaContextClass *
|
||||
* GtkCellAreaContextClass *
|
||||
*************************************************************/
|
||||
static void
|
||||
gtk_cell_area_context_real_reset (GtkCellAreaContext *context)
|
||||
{
|
||||
GtkCellAreaContextPrivate *priv = context->priv;
|
||||
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (context));
|
||||
|
||||
if (priv->min_width != -1)
|
||||
@ -318,8 +322,8 @@ gtk_cell_area_context_real_reset (GtkCellAreaContext *context)
|
||||
|
||||
static void
|
||||
gtk_cell_area_context_real_allocate (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint height)
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GtkCellAreaContextPrivate *priv = context->priv;
|
||||
|
||||
@ -336,13 +340,13 @@ gtk_cell_area_context_real_allocate (GtkCellAreaContext *context,
|
||||
*
|
||||
* Fetches the #GtkCellArea this @context was created by.
|
||||
*
|
||||
* This is generally unneeded by layouting widgets however
|
||||
* its important for the context implementation itself to
|
||||
* This is generally unneeded by layouting widgets; however
|
||||
* it is important for the context implementation itself to
|
||||
* fetch information about the area it is being used for.
|
||||
*
|
||||
* For instance at #GtkCellAreaContextClass.allocate() time
|
||||
* it's important to know details about any cell spacing
|
||||
* that the #GtkCellArea is configured with in order to
|
||||
* that the #GtkCellArea is configured with in order to
|
||||
* compute a proper allocation.
|
||||
*
|
||||
* Return value: the #GtkCellArea this context was created by.
|
||||
@ -366,15 +370,15 @@ gtk_cell_area_context_get_area (GtkCellAreaContext *context)
|
||||
* @context: a #GtkCellAreaContext
|
||||
*
|
||||
* Resets any previously cached request and allocation
|
||||
* data.
|
||||
* data.
|
||||
*
|
||||
* When underlying #GtkTreeModel data changes it's
|
||||
* When underlying #GtkTreeModel data changes it's
|
||||
* important to reset the context if the content
|
||||
* size is allowed to shrink. If the content size
|
||||
* is only allowed to grow (this is usually an option
|
||||
* for views rendering large data stores as a measure
|
||||
* of optimization), then only the row that changed
|
||||
* or was inserted needs to be (re)requested with
|
||||
* or was inserted needs to be (re)requested with
|
||||
* gtk_cell_area_get_preferred_width().
|
||||
*
|
||||
* When the new overall size of the context requires
|
||||
@ -401,24 +405,28 @@ gtk_cell_area_context_reset (GtkCellAreaContext *context)
|
||||
/**
|
||||
* gtk_cell_area_context_allocate:
|
||||
* @context: a #GtkCellAreaContext
|
||||
* @width: the allocated width for all #GtkTreeModel rows rendered with @context, or -1.
|
||||
* @height: the allocated height for all #GtkTreeModel rows rendered with @context, or -1.
|
||||
* @width: the allocated width for all #GtkTreeModel rows rendered
|
||||
* with @context, or -1.
|
||||
* @height: the allocated height for all #GtkTreeModel rows rendered
|
||||
* with @context, or -1.
|
||||
*
|
||||
* Allocates a width and/or a height for all rows which are to be rendered with @context.
|
||||
* Allocates a width and/or a height for all rows which are to be
|
||||
* rendered with @context.
|
||||
*
|
||||
* Usually allocation is performed only horizontally or sometimes vertically since
|
||||
* a group of rows are usually rendered side by side vertically or horizontally and
|
||||
* share either the same width or the same hieght. Sometimes they are allocated in
|
||||
* both horizontal and vertical orientations producing a homogenious effect of the
|
||||
* rows. This is generally the case for #GtkTreeView when #GtkTreeView:fixed-height-mode
|
||||
* is enabled.
|
||||
* Usually allocation is performed only horizontally or sometimes
|
||||
* vertically since a group of rows are usually rendered side by
|
||||
* side vertically or horizontally and share either the same width
|
||||
* or the same height. Sometimes they are allocated in both horizontal
|
||||
* and vertical orientations producing a homogeneous effect of the
|
||||
* rows. This is generally the case for #GtkTreeView when
|
||||
* #GtkTreeView:fixed-height-mode is enabled.
|
||||
*
|
||||
* Since 3.0
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_allocate (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint height)
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_CELL_AREA_CONTEXT (context));
|
||||
|
||||
@ -428,21 +436,23 @@ gtk_cell_area_context_allocate (GtkCellAreaContext *context,
|
||||
/**
|
||||
* gtk_cell_area_context_get_preferred_width:
|
||||
* @context: a #GtkCellAreaContext
|
||||
* @minimum_width: (out) (allow-none): location to store the minimum width, or %NULL
|
||||
* @natural_width: (out) (allow-none): location to store the natural width, or %NULL
|
||||
* @minimum_width: (out) (allow-none): location to store the minimum width,
|
||||
* or %NULL
|
||||
* @natural_width: (out) (allow-none): location to store the natural width,
|
||||
* or %NULL
|
||||
*
|
||||
* Gets the accumulative preferred width for all rows which have been requested
|
||||
* with this context.
|
||||
* Gets the accumulative preferred width for all rows which have been
|
||||
* requested with this context.
|
||||
*
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever requesting
|
||||
* the size of a #GtkCellArea, the returned values are -1.
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever
|
||||
* requesting the size of a #GtkCellArea, the returned values are -1.
|
||||
*
|
||||
* Since: 3.0
|
||||
* Since: 3.0
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_preferred_width (GtkCellAreaContext *context,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
GtkCellAreaContextPrivate *priv;
|
||||
|
||||
@ -460,21 +470,23 @@ gtk_cell_area_context_get_preferred_width (GtkCellAreaContext *context,
|
||||
/**
|
||||
* gtk_cell_area_context_get_preferred_height:
|
||||
* @context: a #GtkCellAreaContext
|
||||
* @minimum_height: (out) (allow-none): location to store the minimum height, or %NULL
|
||||
* @natural_height: (out) (allow-none): location to store the natural height, or %NULL
|
||||
* @minimum_height: (out) (allow-none): location to store the minimum height,
|
||||
* or %NULL
|
||||
* @natural_height: (out) (allow-none): location to store the natural height,
|
||||
* or %NULL
|
||||
*
|
||||
* Gets the accumulative preferred height for all rows which have been requested
|
||||
* with this context.
|
||||
* Gets the accumulative preferred height for all rows which have been
|
||||
* requested with this context.
|
||||
*
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever requesting
|
||||
* the size of a #GtkCellArea, the returned values are -1.
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever
|
||||
* requesting the size of a #GtkCellArea, the returned values are -1.
|
||||
*
|
||||
* Since: 3.0
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_preferred_height (GtkCellAreaContext *context,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
GtkCellAreaContextPrivate *priv;
|
||||
|
||||
@ -493,67 +505,71 @@ gtk_cell_area_context_get_preferred_height (GtkCellAreaContext *context,
|
||||
* gtk_cell_area_context_get_preferred_height_for_width:
|
||||
* @context: a #GtkCellAreaContext
|
||||
* @width: a proposed width for allocation
|
||||
* @minimum_height: (out) (allow-none): location to store the minimum height, or %NULL
|
||||
* @natural_height: (out) (allow-none): location to store the natural height, or %NULL
|
||||
* @minimum_height: (out) (allow-none): location to store the minimum height,
|
||||
* or %NULL
|
||||
* @natural_height: (out) (allow-none): location to store the natural height,
|
||||
* or %NULL
|
||||
*
|
||||
* Gets the accumulative preferred height for @width for all rows which have been
|
||||
* requested for the same said @width with this context.
|
||||
* Gets the accumulative preferred height for @width for all rows
|
||||
* which have been requested for the same said @width with this context.
|
||||
*
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever requesting
|
||||
* the size of a #GtkCellArea, the returned values are -1.
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever
|
||||
* requesting the size of a #GtkCellArea, the returned values are -1.
|
||||
*
|
||||
* Since: 3.0
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_preferred_height_for_width (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_CELL_AREA_CONTEXT (context));
|
||||
|
||||
if (GTK_CELL_AREA_CONTEXT_GET_CLASS (context)->get_preferred_height_for_width)
|
||||
GTK_CELL_AREA_CONTEXT_GET_CLASS (context)->get_preferred_height_for_width (context,
|
||||
width,
|
||||
minimum_height,
|
||||
natural_height);
|
||||
width,
|
||||
minimum_height,
|
||||
natural_height);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_cell_area_context_get_preferred_width_for_height:
|
||||
* @context: a #GtkCellAreaContext
|
||||
* @height: a proposed height for allocation
|
||||
* @minimum_width: (out) (allow-none): location to store the minimum width, or %NULL
|
||||
* @natural_width: (out) (allow-none): location to store the natural width, or %NULL
|
||||
* @minimum_width: (out) (allow-none): location to store the minimum width,
|
||||
* or %NULL
|
||||
* @natural_width: (out) (allow-none): location to store the natural width,
|
||||
* or %NULL
|
||||
*
|
||||
* Gets the accumulative preferred width for @height for all rows which have
|
||||
* been requested for the same said @height with this context.
|
||||
* Gets the accumulative preferred width for @height for all rows which
|
||||
* have been requested for the same said @height with this context.
|
||||
*
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever requesting
|
||||
* the size of a #GtkCellArea, the returned values are -1.
|
||||
* After gtk_cell_area_context_reset() is called and/or before ever
|
||||
* requesting the size of a #GtkCellArea, the returned values are -1.
|
||||
*
|
||||
* Since: 3.0
|
||||
* Since: 3.0
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_preferred_width_for_height (GtkCellAreaContext *context,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_CELL_AREA_CONTEXT (context));
|
||||
|
||||
if (GTK_CELL_AREA_CONTEXT_GET_CLASS (context)->get_preferred_width_for_height)
|
||||
GTK_CELL_AREA_CONTEXT_GET_CLASS (context)->get_preferred_width_for_height (context,
|
||||
height,
|
||||
minimum_width,
|
||||
natural_width);
|
||||
height,
|
||||
minimum_width,
|
||||
natural_width);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_cell_area_context_get_allocation:
|
||||
* @context: a #GtkCellAreaContext
|
||||
* @width: (out) (allow-none): location to store the allocated width, or %NULL.
|
||||
* @height: (out) (allow-none): location to store the allocated height, or %NULL.
|
||||
* @width: (out) (allow-none): location to store the allocated width, or %NULL
|
||||
* @height: (out) (allow-none): location to store the allocated height, or %NULL
|
||||
*
|
||||
* Fetches the current allocation size for @context.
|
||||
*
|
||||
@ -565,8 +581,8 @@ gtk_cell_area_context_get_preferred_width_for_height (GtkCellAreaContext *contex
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_get_allocation (GtkCellAreaContext *context,
|
||||
gint *width,
|
||||
gint *height)
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GtkCellAreaContextPrivate *priv;
|
||||
|
||||
@ -584,8 +600,8 @@ gtk_cell_area_context_get_allocation (GtkCellAreaContext *context,
|
||||
/**
|
||||
* gtk_cell_area_context_push_preferred_width:
|
||||
* @context: a #GtkCellAreaContext
|
||||
* @minimum_width: the proposed new minimum width for @context.
|
||||
* @natural_width: the proposed new natural width for @context.
|
||||
* @minimum_width: the proposed new minimum width for @context
|
||||
* @natural_width: the proposed new natural width for @context
|
||||
*
|
||||
* Causes the minimum and/or natural width to grow if the new
|
||||
* proposed sizes exceed the current minimum and natural width.
|
||||
@ -599,8 +615,8 @@ gtk_cell_area_context_get_allocation (GtkCellAreaContext *context,
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_push_preferred_width (GtkCellAreaContext *context,
|
||||
gint minimum_width,
|
||||
gint natural_width)
|
||||
gint minimum_width,
|
||||
gint natural_width)
|
||||
{
|
||||
GtkCellAreaContextPrivate *priv;
|
||||
|
||||
@ -630,8 +646,8 @@ gtk_cell_area_context_push_preferred_width (GtkCellAreaContext *context,
|
||||
/**
|
||||
* gtk_cell_area_context_push_preferred_height:
|
||||
* @context: a #GtkCellAreaContext
|
||||
* @minimum_height: the proposed new minimum height for @context.
|
||||
* @natural_height: the proposed new natural height for @context.
|
||||
* @minimum_height: the proposed new minimum height for @context
|
||||
* @natural_height: the proposed new natural height for @context
|
||||
*
|
||||
* Causes the minimum and/or natural height to grow if the new
|
||||
* proposed sizes exceed the current minimum and natural height.
|
||||
@ -645,11 +661,11 @@ gtk_cell_area_context_push_preferred_width (GtkCellAreaContext *context,
|
||||
*/
|
||||
void
|
||||
gtk_cell_area_context_push_preferred_height (GtkCellAreaContext *context,
|
||||
gint minimum_height,
|
||||
gint natural_height)
|
||||
gint minimum_height,
|
||||
gint natural_height)
|
||||
{
|
||||
GtkCellAreaContextPrivate *priv;
|
||||
|
||||
|
||||
g_return_if_fail (GTK_IS_CELL_AREA_CONTEXT (context));
|
||||
|
||||
priv = context->priv;
|
||||
|
@ -32,10 +32,10 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_CELL_AREA_CONTEXT (gtk_cell_area_context_get_type ())
|
||||
#define GTK_CELL_AREA_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_CONTEXT, GtkCellAreaContext))
|
||||
#define GTK_TYPE_CELL_AREA_CONTEXT (gtk_cell_area_context_get_type ())
|
||||
#define GTK_CELL_AREA_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_CONTEXT, GtkCellAreaContext))
|
||||
#define GTK_CELL_AREA_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_CONTEXT, GtkCellAreaContextClass))
|
||||
#define GTK_IS_CELL_AREA_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_CONTEXT))
|
||||
#define GTK_IS_CELL_AREA_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_CONTEXT))
|
||||
#define GTK_IS_CELL_AREA_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA_CONTEXT))
|
||||
#define GTK_CELL_AREA_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA_CONTEXT, GtkCellAreaContextClass))
|
||||
|
||||
@ -52,16 +52,16 @@ struct _GtkCellAreaContext
|
||||
|
||||
/**
|
||||
* GtkCellAreaContextClass:
|
||||
* @allocate: This tells the context that an allocation width or height (or both)
|
||||
* have been decided for a group of rows. The context should store any allocations
|
||||
* for internally aligned cells at this point so that they dont need to be
|
||||
* recalculated at gtk_cell_area_render() time.
|
||||
* @reset: Clear any previously stored information about requested and allocated
|
||||
* sizes for the context.
|
||||
* @get_preferred_height_for_width: Returns the aligned height for the given width
|
||||
* that context must store while collecting sizes for it's rows.
|
||||
* @get_preferred_width_for_height: Returns the aligned width for the given height
|
||||
* that context must store while collecting sizes for it's rows.
|
||||
* @allocate: This tells the context that an allocation width or height
|
||||
* (or both) have been decided for a group of rows. The context should
|
||||
* store any allocations for internally aligned cells at this point so
|
||||
* that they dont need to be recalculated at gtk_cell_area_render() time.
|
||||
* @reset: Clear any previously stored information about requested and
|
||||
* allocated sizes for the context.
|
||||
* @get_preferred_height_for_width: Returns the aligned height for the given
|
||||
* width that context must store while collecting sizes for it's rows.
|
||||
* @get_preferred_width_for_height: Returns the aligned width for the given
|
||||
* height that context must store while collecting sizes for it's rows.
|
||||
*/
|
||||
struct _GtkCellAreaContextClass
|
||||
{
|
||||
@ -70,17 +70,17 @@ struct _GtkCellAreaContextClass
|
||||
|
||||
/*< public >*/
|
||||
void (* allocate) (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint height);
|
||||
gint width,
|
||||
gint height);
|
||||
void (* reset) (GtkCellAreaContext *context);
|
||||
void (* get_preferred_height_for_width) (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
void (* get_preferred_width_for_height) (GtkCellAreaContext *context,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
|
||||
/*< private >*/
|
||||
/* Padding for future expansion */
|
||||
@ -97,36 +97,40 @@ GType gtk_cell_area_context_get_type (void) G_GNUC_CONST;
|
||||
/* Main apis */
|
||||
GtkCellArea *gtk_cell_area_context_get_area (GtkCellAreaContext *context);
|
||||
void gtk_cell_area_context_allocate (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint height);
|
||||
gint width,
|
||||
gint height);
|
||||
void gtk_cell_area_context_reset (GtkCellAreaContext *context);
|
||||
|
||||
/* Apis for GtkCellArea clients to consult cached values for a series of GtkTreeModel rows */
|
||||
/* Apis for GtkCellArea clients to consult cached values
|
||||
* for a series of GtkTreeModel rows
|
||||
*/
|
||||
void gtk_cell_area_context_get_preferred_width (GtkCellAreaContext *context,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
void gtk_cell_area_context_get_preferred_height (GtkCellAreaContext *context,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
void gtk_cell_area_context_get_preferred_height_for_width (GtkCellAreaContext *context,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
void gtk_cell_area_context_get_preferred_width_for_height (GtkCellAreaContext *context,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
void gtk_cell_area_context_get_allocation (GtkCellAreaContext *context,
|
||||
gint *width,
|
||||
gint *height);
|
||||
gint *width,
|
||||
gint *height);
|
||||
|
||||
/* Apis for GtkCellArea implementations to update cached values for multiple GtkTreeModel rows */
|
||||
/* Apis for GtkCellArea implementations to update cached values
|
||||
* for multiple GtkTreeModel rows
|
||||
*/
|
||||
void gtk_cell_area_context_push_preferred_width (GtkCellAreaContext *context,
|
||||
gint minimum_width,
|
||||
gint natural_width);
|
||||
gint minimum_width,
|
||||
gint natural_width);
|
||||
void gtk_cell_area_context_push_preferred_height (GtkCellAreaContext *context,
|
||||
gint minimum_height,
|
||||
gint natural_height);
|
||||
gint minimum_height,
|
||||
gint natural_height);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user