* Usually users dont have to interact with the `GtkCellArea` directly
* unless they are implementing a cell-layouting widget themselves.
*
- * # Requesting area sizes
+ * ## Requesting area sizes
*
* As outlined in
* [GtkWidget’s geometry management section](class.Widget.html#height-for-width-geometry-management),
* values while more and more height is required for the row heights
* that are calculated in the background.
*
- * # Rendering Areas
+ * ## Rendering Areas
*
* Once area sizes have been acquired at least for the rows in the
* visible area of the layouting widget they can be rendered at
* would make sense to calculate the allocation for each row at
* the time the widget is allocated using [func@Gtk.distribute_natural_allocation].
*
- * # Handling Events and Driving Keyboard Focus
+ * ## Handling Events and Driving Keyboard Focus
*
* Passing events to the area is as simple as handling events on any
* normal widget and then passing them to the [method@Gtk.CellArea.event]
* Note that the layouting widget is responsible for matching the
* `GtkDirectionType` values to the way it lays out its cells.
*
- * # Cell Properties
+ * ## Cell Properties
*
* The `GtkCellArea` introduces cell properties for `GtkCellRenderer`s.
* This provides some general interfaces for defining the relationship
* [method@Gtk.CellArea.cell_set] or [method@Gtk.CellArea.cell_set_valist]. To obtain
* the value of a cell property, use [method@Gtk.CellArea.cell_get_property]
* [method@Gtk.CellArea.cell_get] or [method@Gtk.CellArea.cell_get_valist].
+ *
+ * Deprecated: 4.10: List views use widgets for displaying their
+ * contents
*/
#include "config.h"
* configured by configuring the `GtkCellAreaBox` align child cell property
* with gtk_cell_area_cell_set_property() or by specifying the "align"
* argument to gtk_cell_area_box_pack_start() and gtk_cell_area_box_pack_end().
+ *
+ * Deprecated: 4.10: List views use widgets for displaying their
+ * contents
*/
#include "config.h"
CellInfo *info = l->data;
/* A new group starts with any aligned cell, or
- * at the beginning and end of a fixed size cell.
+ * at the beginning and end of a fixed size cell.
* the first group is implied */
if ((info->align || info->fixed || last_cell_fixed) && l != cells)
{
if (visible_cells == 0)
continue;
- /* If were not aligned, place the cell after the last cell
+ /* If were not aligned, place the cell after the last cell
* and eat up the extra space
*/
if (group->align)
{
GtkCellAreaBoxPrivate *priv = gtk_cell_area_box_get_instance_private (box);
CellGroup *group;
-
+
g_assert (group_idx >= 0 && group_idx < priv->groups->len);
group = &g_array_index (priv->groups, CellGroup, group_idx);
return array;
}
-static gboolean
+static gboolean
group_expands (GtkCellAreaBoxContext *context,
int group_idx)
{
if (priv->expand[i])
expand++;
}
-
+
return expand;
}
NULL, (GDestroyNotify)free_cache_array);
}
-static void
+static void
_gtk_cell_area_box_context_class_init (GtkCellAreaBoxContextClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
box_orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (area));
array = get_array (context, orientation, for_size);
- /* Get the last visible aligned group
+ /* Get the last visible aligned group
* (we need to get space at least up till this group) */
for (i = array->len - 1; i >= 0; i--)
{
- if (priv->align[i] &&
+ if (priv->align[i] &&
_gtk_cell_area_box_group_visible (area, i))
break;
}
int *minimum_height,
int *natural_height)
{
- _gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_VERTICAL,
+ _gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_VERTICAL,
width, minimum_height, natural_height);
}
int *minimum_width,
int *natural_width)
{
- _gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_HORIZONTAL,
+ _gtk_cell_area_box_context_sum (GTK_CELL_AREA_BOX_CONTEXT (context), GTK_ORIENTATION_HORIZONTAL,
height, minimum_width, natural_width);
}
int last_aligned_group_idx = 0;
int i, j;
- /* Get the last visible aligned group
+ /* Get the last visible aligned group
* (we need to get space at least up till this group) */
for (i = priv->base_widths->len - 1; i >= 0; i--)
{
- if (priv->align[i] &&
+ if (priv->align[i] &&
_gtk_cell_area_box_group_visible (area, i))
break;
}
gtk_cell_area_context_get_allocation (ctx, &width, &height);
if (orientation == GTK_ORIENTATION_HORIZONTAL && width > 0)
- allocs = allocate_for_orientation (context, area, orientation,
+ allocs = allocate_for_orientation (context, area, orientation,
spacing, width, height,
&alloc_count);
else if (orientation == GTK_ORIENTATION_VERTICAL && height > 0)
- allocs = allocate_for_orientation (context, area, orientation,
+ allocs = allocate_for_orientation (context, area, orientation,
spacing, height, width,
&alloc_count);
* The `GtkCellEditable` interface must be implemented for widgets to be usable
* to edit the contents of a `GtkTreeView` cell. It provides a way to specify how
* temporary widgets should be configured for editing, get the new value, etc.
+ *
+ * Deprecated: 4.10: List views use widgets for displaying their
+ * contents. See [iface@Gtk.Editable] for editable text widgets
*/
#include "config.h"
* want to provide a `GtkTreeViewColumn` like API for packing cells,
* setting attributes and data funcs.
*
- * One of the notable features provided by implementations of
+ * One of the notable features provided by implementations of
* `GtkCellLayout` are attributes. Attributes let you set the properties
* in flexible ways. They can just be set to constant values like regular
* properties. But they can also be mapped to a column of the underlying
* gtk_cell_layout_set_cell_data_func() that is called to determine the
* value of the attribute for each cell that is rendered.
*
- * # GtkCellLayouts as GtkBuildable
+ * ## GtkCellLayouts as GtkBuildable
*
* Implementations of GtkCellLayout which also implement the GtkBuildable
* interface (`GtkCellView`, `GtkIconView`, `GtkComboBox`,
* </object>
* ```
*
- * # Subclassing GtkCellLayout implementations
+ * ## Subclassing GtkCellLayout implementations
*
* When subclassing a widget that implements `GtkCellLayout` like
* `GtkIconView` or `GtkComboBox`, there are some considerations related
* to support alternative cell areas, you can do so by moving the
* problematic calls out of `init()` and into a `constructor()`
* for your class.
+ *
+ * Deprecated: 4.10: List views use widgets to display their contents.
+ * See [class@Gtk.LayoutManager] for layout manager delegate objects
*/
#include "config.h"
area = iface->get_area (cell_layout);
if (area)
- _gtk_cell_area_set_cell_data_func_with_proxy (area, cell,
- (GFunc)func, func_data, destroy,
+ _gtk_cell_area_set_cell_data_func_with_proxy (area, cell,
+ (GFunc)func, func_data, destroy,
cell_layout);
else
warn_no_cell_area ("GtkCellLayoutIface->set_cell_data_func()");
* @cell: a `GtkCellRenderer`
* @...: a %NULL-terminated list of attributes
*
- * Sets the attributes in the parameter list as the attributes
+ * Sets the attributes in the parameter list as the attributes
* of @cell_layout.
*
* See [method@Gtk.CellLayout.add_attribute] for more details.
g_return_if_fail (GTK_IS_CELL_LAYOUT (cell_layout));
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
- GTK_CELL_LAYOUT_GET_IFACE
+ GTK_CELL_LAYOUT_GET_IFACE
(cell_layout)->set_cell_data_func (cell_layout, cell, func, func_data, destroy);
}
g_return_val_if_fail (GTK_IS_CELL_LAYOUT (cell_layout), NULL);
- iface = GTK_CELL_LAYOUT_GET_IFACE (cell_layout);
+ iface = GTK_CELL_LAYOUT_GET_IFACE (cell_layout);
if (iface->get_area)
return iface->get_area (cell_layout);
* corresponding “set” property, e.g. “cell-background-set” corresponds
* to “cell-background”. These “set” properties reflect whether a property
* has been set or not. You should not set them independently.
+ *
+ * Deprecated: 4.10: List views use widgets for displaying their
+ * contents
*/
*
* This signal gets emitted when the user cancels the process of editing a
* cell. For example, an editable cell renderer could be written to cancel
- * editing when the user presses Escape.
+ * editing when the user presses Escape.
*
* See also: gtk_cell_renderer_stop_editing().
*/
* const char *path,
* gpointer data)
* {
- * if (GTK_IS_ENTRY (editable))
+ * if (GTK_IS_ENTRY (editable))
* {
* GtkEntry *entry = GTK_ENTRY (editable);
- *
+ *
* // ... create a GtkEntryCompletion
- *
+ *
* gtk_entry_set_completion (entry, completion);
* }
* }
* @cell: a `GtkCellRenderer`
* @snapshot: a `GtkSnapshot` to draw to
* @widget: the widget owning @window
- * @background_area: entire cell area (including tree expanders and maybe
+ * @background_area: entire cell area (including tree expanders and maybe
* padding on the sides)
* @cell_area: area normally rendered by a cell renderer
* @flags: flags that affect rendering
gtk_widget_add_css_class (GTK_WIDGET (editable), "cell");
- g_signal_emit (cell,
+ g_signal_emit (cell,
cell_renderer_signals[EDITING_STARTED], 0,
editable, path);
}
}
-static GtkSizeRequestMode
+static GtkSizeRequestMode
gtk_cell_renderer_real_get_request_mode (GtkCellRenderer *cell)
{
/* By default cell renderers are height-for-width. */
int *minimum_size,
int *natural_size)
{
- gtk_cell_renderer_real_get_preferred_size (cell, widget, GTK_ORIENTATION_HORIZONTAL,
+ gtk_cell_renderer_real_get_preferred_size (cell, widget, GTK_ORIENTATION_HORIZONTAL,
minimum_size, natural_size);
}
int *minimum_size,
int *natural_size)
{
- gtk_cell_renderer_real_get_preferred_size (cell, widget, GTK_ORIENTATION_VERTICAL,
+ gtk_cell_renderer_real_get_preferred_size (cell, widget, GTK_ORIENTATION_VERTICAL,
minimum_size, natural_size);
}
/* Trim up the aligned size */
if (gtk_cell_renderer_get_request_mode (cell) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
{
- gtk_cell_renderer_get_preferred_width (cell, widget,
+ gtk_cell_renderer_get_preferred_width (cell, widget,
NULL, &natural_size);
aligned_area->width = MIN (aligned_area->width, natural_size);
- gtk_cell_renderer_get_preferred_height_for_width (cell, widget,
- aligned_area->width,
+ gtk_cell_renderer_get_preferred_height_for_width (cell, widget,
+ aligned_area->width,
NULL, &opposite_size);
aligned_area->height = MIN (opposite_size, aligned_area->height);
}
else
{
- gtk_cell_renderer_get_preferred_height (cell, widget,
+ gtk_cell_renderer_get_preferred_height (cell, widget,
NULL, &natural_size);
aligned_area->height = MIN (aligned_area->width, natural_size);
- gtk_cell_renderer_get_preferred_width_for_height (cell, widget,
- aligned_area->height,
+ gtk_cell_renderer_get_preferred_width_for_height (cell, widget,
+ aligned_area->height,
NULL, &opposite_size);
aligned_area->width = MIN (opposite_size, aligned_area->width);
}
/* offset the cell position */
- _gtk_cell_renderer_calc_offset (cell, cell_area,
+ _gtk_cell_renderer_calc_offset (cell, cell_area,
gtk_widget_get_direction (widget),
- aligned_area->width,
+ aligned_area->width,
aligned_area->height,
&x_offset, &y_offset);
int height,
int *x_offset,
int *y_offset)
-{
+{
GtkCellRendererPrivate *priv;
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
if (x_offset)
{
*x_offset = (((direction == GTK_TEXT_DIR_RTL) ?
- (1.0 - priv->xalign) : priv->xalign) *
+ (1.0 - priv->xalign) : priv->xalign) *
(cell_area->width - width));
*x_offset = MAX (*x_offset, 0);
}
#if DEBUG_CELL_SIZE_REQUEST
g_message ("%s returning minimum width: %d and natural width: %d",
- G_OBJECT_TYPE_NAME (cell),
- minimum_size ? *minimum_size : 20000,
+ G_OBJECT_TYPE_NAME (cell),
+ minimum_size ? *minimum_size : 20000,
natural_size ? *natural_size : 20000);
#endif
}
#if DEBUG_CELL_SIZE_REQUEST
g_message ("%s returning minimum height: %d and natural height: %d",
- G_OBJECT_TYPE_NAME (cell),
- minimum_size ? *minimum_size : 20000,
+ G_OBJECT_TYPE_NAME (cell),
+ minimum_size ? *minimum_size : 20000,
natural_size ? *natural_size : 20000);
#endif
}
* @minimum_width: (out) (optional): location for storing the minimum size
* @natural_width: (out) (optional): location for storing the preferred size
*
- * Retrieves a cell renderers’s minimum and natural width if it were rendered to
+ * Retrieves a cell renderers’s minimum and natural width if it were rendered to
* @widget with the specified @height.
*
* Deprecated: 4.10
#if DEBUG_CELL_SIZE_REQUEST
g_message ("%s width for height: %d is minimum %d and natural: %d",
G_OBJECT_TYPE_NAME (cell), height,
- minimum_width ? *minimum_width : 20000,
+ minimum_width ? *minimum_width : 20000,
natural_width ? *natural_width : 20000);
#endif
}
* @minimum_height: (out) (optional): location for storing the minimum size
* @natural_height: (out) (optional): location for storing the preferred size
*
- * Retrieves a cell renderers’s minimum and natural height if it were rendered to
+ * Retrieves a cell renderers’s minimum and natural height if it were rendered to
* @widget with the specified @width.
*
* Deprecated: 4.10
#if DEBUG_CELL_SIZE_REQUEST
g_message ("%s height for width: %d is minimum %d and natural: %d",
G_OBJECT_TYPE_NAME (cell), width,
- minimum_height ? *minimum_height : 20000,
+ minimum_height ? *minimum_height : 20000,
natural_height ? *natural_height : 20000);
#endif
}
* `GtkCellRendererAccel` displays a keyboard accelerator (i.e. a key
* combination like `Control + a`). If the cell renderer is editable,
* the accelerator can be changed by simply typing the new combination.
+ *
+ * Deprecated: 4.10: Applications editing keyboard accelerators should
+ * provide their own implementation according to platform design
+ * guidelines
*/
guint param_id,
const GValue *value,
GParamSpec *pspec);
-static void gtk_cell_renderer_accel_get_preferred_width
+static void gtk_cell_renderer_accel_get_preferred_width
(GtkCellRenderer *cell,
GtkWidget *widget,
int *minimum_size,
G_MAXINT,
0,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
+
/**
* GtkCellRendererAccel:accel-mods:
*
* The hardware keycode of the accelerator. Note that the hardware keycode is
* only relevant if the key does not have a keyval. Normally, the keyboard
* configuration should assign keyvals to all keys.
- */
+ */
g_object_class_install_property (object_class,
PROP_KEYCODE,
g_param_spec_uint ("keycode", NULL, NULL,
GTK_TYPE_CELL_RENDERER_ACCEL_MODE,
GTK_CELL_RENDERER_ACCEL_MODE_GTK,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
+
/**
* GtkCellRendererAccel::accel-edited:
* @accel: the object reveiving the signal
* gtk_cell_renderer_accel_new:
*
* Creates a new `GtkCellRendererAccel`.
- *
+ *
* Returns: the new cell renderer
*
* Deprecated: 4.10
* a disabled accelerator key combination.
*/
return g_strdup (C_("Accelerator", "Disabled"));
- else
+ else
{
if (priv->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_GTK)
{
return gtk_accelerator_get_label (keysym, mask);
}
- else
+ else
{
char *name;
g_object_notify (object, "accel-mode");
}
break;
-
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
}
event = gtk_event_controller_get_current_event (GTK_EVENT_CONTROLLER (key));
if (!gdk_key_event_get_match (event, &accel_key, &accel_mods))
return FALSE;
-
+
if (accel_mods == 0)
{
switch (keyval)
gtk_cell_editable_widget_unrealize (GtkWidget *widget)
{
gtk_grab_remove (widget);
-
- GTK_WIDGET_CLASS (gtk_cell_editable_widget_parent_class)->unrealize (widget);
+
+ GTK_WIDGET_CLASS (gtk_cell_editable_widget_parent_class)->unrealize (widget);
}
static void
* box and sets it to display the column specified by its
* `GtkCellRendererCombo`:text-column property. Further properties of the combo box
* can be set in a handler for the `GtkCellRenderer::editing-started` signal.
+ *
+ * Deprecated: 4.10: List views use widgets to display their contents. You
+ * should use [class@Gtk.DropDown] instead
*/
typedef struct _GtkCellRendererComboPrivate GtkCellRendererComboPrivate;
/**
* GtkCellRendererCombo:model:
*
- * Holds a tree model containing the possible values for the combo box.
+ * Holds a tree model containing the possible values for the combo box.
* Use the text_column property to specify the column holding the values.
*/
g_object_class_install_property (object_class,
/**
* GtkCellRendererCombo:text-column:
*
- * Specifies the model column which holds the possible values for the
- * combo box.
+ * Specifies the model column which holds the possible values for the
+ * combo box.
*
- * Note that this refers to the model specified in the model property,
- * not the model backing the tree view to which
+ * Note that this refers to the model specified in the model property,
+ * not the model backing the tree view to which
* this cell renderer is attached.
- *
- * `GtkCellRendererCombo` automatically adds a text cell renderer for
+ *
+ * `GtkCellRendererCombo` automatically adds a text cell renderer for
* this column to its combo box.
*/
g_object_class_install_property (object_class,
-1,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- /**
+ /**
* GtkCellRendererCombo:has-entry:
*
- * If %TRUE, the cell renderer will include an entry and allow to enter
- * values other than the ones in the popup list.
+ * If %TRUE, the cell renderer will include an entry and allow to enter
+ * values other than the ones in the popup list.
*/
g_object_class_install_property (object_class,
PROP_HAS_ENTRY,
GtkCellRenderer *
gtk_cell_renderer_combo_new (void)
{
- return g_object_new (GTK_TYPE_CELL_RENDERER_COMBO, NULL);
+ return g_object_new (GTK_TYPE_CELL_RENDERER_COMBO, NULL);
}
static void
{
GtkCellRendererCombo *cell = GTK_CELL_RENDERER_COMBO (object);
GtkCellRendererComboPrivate *priv = gtk_cell_renderer_combo_get_instance_private (cell);
-
+
if (priv->model)
{
g_object_unref (priv->model);
priv->model = NULL;
}
-
+
G_OBJECT_CLASS (gtk_cell_renderer_combo_parent_class)->finalize (object);
}
{
case PROP_MODEL:
g_value_set_object (value, priv->model);
- break;
+ break;
case PROP_TEXT_COLUMN:
g_value_set_int (value, priv->text_column);
break;
entry = GTK_ENTRY (gtk_combo_box_get_child (GTK_COMBO_BOX (combo)));
new_text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
}
- else
+ else
{
model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
gtk_cell_renderer_combo_editing_done (GTK_CELL_EDITABLE (widget), data);
}
-typedef struct
+typedef struct
{
GtkCellRendererCombo *cell;
gboolean found;
GtkTreeIter iter;
} SearchData;
-static gboolean
-find_text (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
+static gboolean
+find_text (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
gpointer data)
{
SearchData *search_data = (SearchData *)data;
g_free (cell_text);
g_free (text);
-
+
return search_data->found;
}
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), priv->model);
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo),
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo),
cell, "text", priv->text_column,
NULL);
* renders that pixbuf, if the `GtkCellRenderer:is-expanded` property is %FALSE
* and the `GtkCellRendererPixbuf:pixbuf-expander-closed` property is set to a
* pixbuf, it renders that one.
+ *
+ * Deprecated: 4.10: List views use widgets to display their contents. You
+ * should use [class@Gtk.Image] for icons, and [class@Gtk.Picture] for images
*/
{
GtkCellRendererPixbufPrivate *priv = gtk_cell_renderer_pixbuf_get_instance_private (cellpixbuf);
GtkImageType old_storage_type, new_storage_type;
-
+
if (def == NULL)
def = gtk_image_definition_new_empty ();
old_storage_type = gtk_image_definition_get_storage_type (priv->image_def);
new_storage_type = gtk_image_definition_get_storage_type (def);
-
+
if (new_storage_type != old_storage_type)
notify_storage_type (cellpixbuf, old_storage_type);
/**
* gtk_cell_renderer_pixbuf_new:
- *
+ *
* Creates a new `GtkCellRendererPixbuf`. Adjust rendering
* parameters using object properties. Object properties can be set
* globally (with g_object_set()). Also, with `GtkTreeViewColumn`, you
* can bind the “pixbuf” property on the cell renderer to a pixbuf value
* in the model, thus rendering a different image in each row of the
* `GtkTreeView`.
- *
+ *
* Returns: the new cell renderer
*
* Deprecated: 4.10
pixbuf_height = gdk_paintable_get_intrinsic_height (paintable);
}
else
- pixbuf_width = pixbuf_height = gtk_icon_helper_get_size (icon_helper);
+ pixbuf_width = pixbuf_height = gtk_icon_helper_get_size (icon_helper);
g_object_unref (icon_helper);
gtk_style_context_restore (context);
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
calc_width = (int) xpad * 2 + pixbuf_width;
calc_height = (int) ypad * 2 + pixbuf_height;
-
+
if (cell_area && pixbuf_width > 0 && pixbuf_height > 0)
{
float xalign, yalign;
if (width)
*width = calc_width;
-
+
if (height)
*height = calc_height;
}
gtk_cell_renderer_pixbuf_get_size (cellpixbuf, widget,
cell_area,
- &pix_rect.x,
+ &pix_rect.x,
&pix_rect.y,
&pix_rect.width,
&pix_rect.height);
*
* `GtkCellRendererProgress` renders a numeric value as a progress par in a cell.
* Additionally, it can display a text on top of the progress bar.
+ *
+ * Deprecated: 4.10: List views use widgets to display their contents.
+ * You should use [class@Gtk.ProgressBar] instead
*/
* of `GtkCellRendererSpin:digits` to display. Other `GtkSpinButton` properties
* can be set in a handler for the `GtkCellRenderer::editing-started` signal.
*
- * The `GtkCellRendererSpin` cell renderer was added in GTK 2.10.
+ * Deprecated: 4.10: List views use widgets to display their contents.
+ * You should use [class@Gtk.SpinButton] instead
*/
typedef struct _GtkCellRendererSpinClass GtkCellRendererSpinClass;
/**
* GtkCellRendererSpin:adjustment:
*
- * The adjustment that holds the value of the spinbutton.
+ * The adjustment that holds the value of the spinbutton.
* This must be non-%NULL for the cell renderer to be editable.
*/
g_object_class_install_property (object_class,
PROP_CLIMB_RATE,
g_param_spec_double ("climb-rate", NULL, NULL,
0.0, G_MAXDOUBLE, 0.0,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE));
/**
* GtkCellRendererSpin:digits:
*
PROP_DIGITS,
g_param_spec_uint ("digits", NULL, NULL,
0, 20, 0,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
}
static void
/**
* gtk_cell_renderer_spin_new:
*
- * Creates a new `GtkCellRendererSpin`.
+ * Creates a new `GtkCellRendererSpin`.
*
* Returns: a new `GtkCellRendererSpin`
*
* at regular intervals. The usual way to set the cell renderer properties
* for each cell is to bind them to columns in your tree model using e.g.
* gtk_tree_view_column_add_attribute().
+ *
+ * Deprecated: 4.10: List views use widgets to display their contents.
+ * You should use [class@Gtk.Spinner] instead
*/
*
* If the `GtkCellRenderer:mode` is %GTK_CELL_RENDERER_MODE_EDITABLE,
* the `GtkCellRendererText` allows to edit its text using an entry.
+ *
+ * Deprecated: 4.10: List views use widgets to display their contents.
+ * You should use [class@Gtk.Inscription] or [class@Gtk.Label] instead
*/
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class);
object_class->finalize = gtk_cell_renderer_text_finalize;
-
+
object_class->get_property = gtk_cell_renderer_text_get_property;
object_class->set_property = gtk_cell_renderer_text_set_property;
case PROP_FONT:
g_value_take_string (value, pango_font_description_to_string (priv->font));
break;
-
+
case PROP_FONT_DESC:
g_value_set_boxed (value, priv->font);
break;
case PROP_SCALE:
g_value_set_double (value, priv->font_scale);
break;
-
+
case PROP_EDITABLE:
g_value_set_boolean (value, priv->editable);
break;
case PROP_RISE:
g_value_set_int (value, priv->rise);
- break;
+ break;
case PROP_LANGUAGE:
g_value_set_static_string (value, pango_language_to_string (priv->language));
case PROP_ELLIPSIZE:
g_value_set_enum (value, priv->ellipsize);
break;
-
+
case PROP_WRAP_MODE:
g_value_set_enum (value, priv->wrap_mode);
break;
case PROP_WRAP_WIDTH:
g_value_set_int (value, priv->wrap_width);
break;
-
+
case PROP_ALIGN:
g_value_set_enum (value, priv->align);
break;
{
PangoFontMask mask = get_property_font_set_mask (param_id);
g_value_set_boolean (value, (pango_font_description_get_set_fields (priv->font) & mask) != 0);
-
+
break;
}
case PROP_SCALE_SET:
g_value_set_boolean (value, priv->scale_set);
break;
-
+
case PROP_EDITABLE_SET:
g_value_set_boolean (value, priv->editable_set);
break;
case PROP_ALIGN_SET:
g_value_set_boolean (value, priv->align_set);
break;
-
+
case PROP_WIDTH_CHARS:
g_value_set_int (value, priv->width_chars);
- break;
+ break;
case PROP_MAX_WIDTH_CHARS:
g_value_set_int (value, priv->max_width_chars);
- break;
+ break;
case PROP_PLACEHOLDER_TEXT:
g_value_set_string (value, priv->placeholder_text);
PangoFontMask to_set)
{
PangoFontMask changed_mask = 0;
-
+
if (to_set & PANGO_FONT_MASK_FAMILY)
{
const char *family = pango_font_description_get_family (desc);
size = 10 * PANGO_SCALE;
changed_mask |= PANGO_FONT_MASK_SIZE;
}
-
+
pango_font_description_set_size (desc, size);
}
/**
* gtk_cell_renderer_text_new:
- *
+ *
* Creates a new `GtkCellRendererText`. Adjust how text is drawn using
* object properties. Object properties can be
* set globally (with g_object_set()). Also, with `GtkTreeViewColumn`,
* you can bind the “text” property on the cell renderer to a string
* value in the model, thus rendering a different string in each row
* of the `GtkTreeView`.
- *
+ *
* Returns: the new cell renderer
*
* Deprecated: 4.10
{
attr->start_index = 0;
attr->end_index = G_MAXINT;
-
+
pango_attr_list_insert (attr_list, attr);
}
if (!placeholder_layout && cell_area)
{
/* Add options that affect appearance but not size */
-
+
/* note that background doesn't go here, since it affects
* background_area not the PangoLayout area
*/
-
+
if (priv->foreground_set
&& (flags & GTK_CELL_RENDERER_SELECTED) == 0)
{
pango_layout_set_alignment (layout, align);
}
-
+
return layout;
}
gtk_cell_renderer_set_fixed_size (cell,
cell_width, 2 * ypad +
priv->fixed_height_rows * PANGO_PIXELS (row_height));
-
+
if (height)
{
*height = cell_height;
if (priv->text)
gtk_editable_set_text (GTK_EDITABLE (priv->entry), priv->text);
g_object_set_data_full (G_OBJECT (priv->entry), I_(GTK_CELL_RENDERER_TEXT_PATH), g_strdup (path), g_free);
-
+
gtk_editable_select_region (GTK_EDITABLE (priv->entry), 0, -1);
priv->in_entry_menu = FALSE;
* gtk_cell_renderer_text_set_fixed_height_from_font:
* @renderer: A `GtkCellRendererText`
* @number_of_rows: Number of rows of text each cell renderer is allocated, or -1
- *
+ *
* Sets the height of a renderer to explicitly be determined by the “font” and
* “y_pad” property set on it. Further changes in these properties do not
* affect the height, so they must be accompanied by a subsequent call to this
if (priv->max_width_chars > 0)
{
int max_width = xpad * 2 + PANGO_PIXELS (char_width) * priv->max_width_chars;
-
+
min_width = MIN (min_width, max_width);
nat_width = MIN (nat_width, max_width);
}
int y_offset = 0;
layout = get_layout (celltext, widget, cell_area, flags);
- get_size (cell, widget, cell_area, layout, &x_offset, &y_offset,
+ get_size (cell, widget, cell_area, layout, &x_offset, &y_offset,
&aligned_area->width, &aligned_area->height);
aligned_area->x = cell_area->x + x_offset;
* button is drawn as a radio or a checkbutton, depending on the
* `GtkCellRendererToggle:radio` property.
* When activated, it emits the `GtkCellRendererToggle::toggled` signal.
+ *
+ * Deprecated: 4.10: List views use widgets to display their contents.
+ * You should use [class@Gtk.ToggleButton] instead
*/
cell_class->get_preferred_height = gtk_cell_renderer_toggle_get_preferred_height;
cell_class->snapshot = gtk_cell_renderer_toggle_snapshot;
cell_class->activate = gtk_cell_renderer_toggle_activate;
-
+
g_object_class_install_property (object_class,
PROP_ACTIVE,
g_param_spec_boolean ("active", NULL, NULL,
g_param_spec_boolean ("inconsistent", NULL, NULL,
FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
+
g_object_class_install_property (object_class,
PROP_ACTIVATABLE,
g_param_spec_boolean ("activatable", NULL, NULL,
FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
+
/**
* GtkCellRendererToggle::toggled:
* @cell_renderer: the object which received the signal
- * @path: string representation of `GtkTreePath` describing the
+ * @path: string representation of `GtkTreePath` describing the
* event location
*
- * The ::toggled signal is emitted when the cell is toggled.
+ * The ::toggled signal is emitted when the cell is toggled.
*
* It is the responsibility of the application to update the model
* with the correct value to store at @path. Often this is simply the
if (priv->inconsistent)
state |= GTK_STATE_FLAG_INCONSISTENT;
-
+
if (priv->active)
state |= GTK_STATE_FLAG_CHECKED;
* gtk_cell_renderer_toggle_set_radio:
* @toggle: a `GtkCellRendererToggle`
* @radio: %TRUE to make the toggle look like a radio button
- *
+ *
* If @radio is %TRUE, the cell renderer renders a radio toggle
* (i.e. a toggle in a group of mutually-exclusive toggles).
* If %FALSE, it renders a check toggle (a standalone boolean option).
* gtk_cell_renderer_toggle_get_radio:
* @toggle: a `GtkCellRendererToggle`
*
- * Returns whether we’re rendering radio toggles rather than checkboxes.
- *
+ * Returns whether we’re rendering radio toggles rather than checkboxes.
+ *
* Returns: %TRUE if we’re rendering radio toggles rather than checkboxes
*
* Deprecated: 4.10
* A widget displaying a single row of a GtkTreeModel
*
* A `GtkCellView` displays a single row of a `GtkTreeModel` using a `GtkCellArea`
- * and `GtkCellAreaContext`. A `GtkCellAreaContext` can be provided to the
+ * and `GtkCellAreaContext`. A `GtkCellAreaContext` can be provided to the
* `GtkCellView` at construction time in order to keep the cellview in context
* of a group of cell views, this ensures that the renderers displayed will
* be properly aligned with each other (like the aligned cells in the menus
* individual heights (left-to-right menus should be allocated vertically since
* they all share the same height but may have variable widths).
*
- * # CSS nodes
+ * ## CSS nodes
*
* GtkCellView has a single CSS node with name cellview.
+ *
+ * Deprecated: 4.10: List views use widgets to display their contents.
+ * You can use [class@Gtk.Box] instead
*/
static void gtk_cell_view_constructed (GObject *object);
*
* The `GtkCellArea` rendering cells
*
- * If no area is specified when creating the cell view with gtk_cell_view_new_with_context()
+ * If no area is specified when creating the cell view with gtk_cell_view_new_with_context()
* a horizontally oriented `GtkCellArea`Box will be used.
*
* since 3.0
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
if (for_size < 0)
- gtk_cell_area_get_preferred_width (priv->area, priv->context,
+ gtk_cell_area_get_preferred_width (priv->area, priv->context,
GTK_WIDGET (cellview), &min, &nat);
else
- gtk_cell_area_get_preferred_width_for_height (priv->area, priv->context,
+ gtk_cell_area_get_preferred_width_for_height (priv->area, priv->context,
GTK_WIDGET (cellview), for_size, &min, &nat);
}
else
{
if (for_size < 0)
- gtk_cell_area_get_preferred_height (priv->area, priv->context,
+ gtk_cell_area_get_preferred_height (priv->area, priv->context,
GTK_WIDGET (cellview), &min, &nat);
else
- gtk_cell_area_get_preferred_height_for_width (priv->area, priv->context,
+ gtk_cell_area_get_preferred_height_for_width (priv->area, priv->context,
GTK_WIDGET (cellview), for_size, &min, &nat);
}
}
}
-static GtkSizeRequestMode
+static GtkSizeRequestMode
gtk_cell_view_get_request_mode (GtkWidget *widget)
{
GtkCellView *cellview = GTK_CELL_VIEW (widget);
gtk_tree_model_get_iter (priv->model, &iter, path);
gtk_tree_path_free (path);
- gtk_cell_area_apply_attributes (priv->area,
- priv->model,
+ gtk_cell_area_apply_attributes (priv->area,
+ priv->model,
&iter, FALSE, FALSE);
if (priv->draw_sensitive)
{
- GList *l, *cells =
+ GList *l, *cells =
gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->area));
for (l = cells; l; l = l->next)
g_return_val_if_fail (GTK_IS_CELL_AREA (area), NULL);
g_return_val_if_fail (context == NULL || GTK_IS_CELL_AREA_CONTEXT (context), NULL);
- return (GtkWidget *)g_object_new (GTK_TYPE_CELL_VIEW,
+ return (GtkWidget *)g_object_new (GTK_TYPE_CELL_VIEW,
"cell-area", area,
"cell-area-context", context,
NULL);
* @renderer: one of the renderers of @cell_view
* @property: the name of the property of @renderer to set
* @value: the new value to set the property to
- *
+ *
* Sets a property of a cell renderer of @cell_view, and
* makes sure the display of @cell_view is updated.
*
{
g_object_ref (priv->model);
- priv->row_changed_id =
+ priv->row_changed_id =
g_signal_connect (priv->model, "row-changed",
G_CALLBACK (row_changed_cb), cell_view);
}
* gtk_cell_view_get_displayed_row:
* @cell_view: a `GtkCellView`
*
- * Returns a `GtkTreePath` referring to the currently
- * displayed row. If no row is currently displayed,
+ * Returns a `GtkTreePath` referring to the currently
+ * displayed row. If no row is currently displayed,
* %NULL is returned.
*
* Returns: (nullable) (transfer full): the currently displayed row