diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c index 1b315b6177..a8d4ff7763 100644 --- a/gtk/gtksizerequest.c +++ b/gtk/gtksizerequest.c @@ -461,11 +461,12 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget, * position for the natural size, or %NULL * * Measures @widget in the orientation @orientation and for the given @for_size. - * As an example, if @orientation is %GTK_ORIENTATION_HORIZONTAL and @for_size is 300, - * this functions will compute the minimum and natural width of @widget if - * it is allocated at a height of 300 pixels. * - * See [GtkWidget’s geometry management section][geometry-management] for + * As an example, if @orientation is %GTK_ORIENTATION_HORIZONTAL and @for_size + * is 300, this functions will compute the minimum and natural width of @widget + * if it is allocated at a height of 300 pixels. + * + * See [GtkWidget’s geometry management section](class.Widget.html#height-for-width-geometry-management) for * a more details on implementing #GtkWidgetClass.measure(). */ void @@ -545,17 +546,17 @@ gtk_widget_measure (GtkWidget *widget, /** * gtk_widget_get_request_mode: - * @widget: a #GtkWidget instance + * @widget: a `GtkWidget` instance * * Gets whether the widget prefers a height-for-width layout * or a width-for-height layout. * - * #GtkBin widgets generally propagate the preference of - * their child, container widgets need to request something either in - * context of their children or in context of their allocation - * capabilities. + * Single-child widgets generally propagate the preference of + * their child, more complex widgets need to request something + * either in context of their children or in context of their + * allocation capabilities. * - * Returns: The #GtkSizeRequestMode preferred by @widget. + * Returns: The `GtkSizeRequestMode` preferred by @widget. */ GtkSizeRequestMode gtk_widget_get_request_mode (GtkWidget *widget) @@ -575,7 +576,7 @@ gtk_widget_get_request_mode (GtkWidget *widget) /** * gtk_widget_get_preferred_size: - * @widget: a #GtkWidget instance + * @widget: a `GtkWidget` instance * @minimum_size: (out) (allow-none): location for storing the minimum size, or %NULL * @natural_size: (out) (allow-none): location for storing the natural size, or %NULL * @@ -585,15 +586,14 @@ gtk_widget_get_request_mode (GtkWidget *widget) * This is used to retrieve a suitable size by container widgets which do * not impose any restrictions on the child placement. It can be used * to deduce toplevel window and menu sizes as well as child widgets in - * free-form containers such as GtkLayout. + * free-form containers such as `GtkFixed`. * * Handle with care. Note that the natural height of a height-for-width - * widget will generally be a smaller size than the minimum height, since the required - * height for the natural width is generally smaller than the required height for - * the minimum width. + * widget will generally be a smaller size than the minimum height, since + * the required height for the natural width is generally smaller than the + * required height for the minimum width. * - * Use gtk_widget_measure() if you want to support - * baseline alignment. + * Use [id@gtk_widget_measure] if you want to support baseline alignment. */ void gtk_widget_get_preferred_size (GtkWidget *widget, @@ -683,7 +683,7 @@ compare_gap (gconstpointer p1, * children up to natural size first. * * The remaining space will be added to the @minimum_size member of the - * GtkRequestedSize struct. If all sizes reach their natural size then + * `GtkRequestedSize` struct. If all sizes reach their natural size then * the remaining space is returned. * * Returns: The remainder of @extra_space after redistributing space diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index a80e991266..520e15edd9 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -91,7 +91,7 @@ /** * GtkWidget: * - * The base class for all widgets + * The base class for all widgets. * * `GtkWidget` is the base class all widgets in GTK derive from. It manages the * widget lifecycle, layout, states and style. @@ -108,20 +108,20 @@ * Height-for-width geometry management is implemented in GTK by way * of two virtual methods: * - * - `GtkWidgetClass.get_request_mode()` - * - `GtkWidgetClass.measure()` + * - [vfunc@Gtk.Widget.get_request_mode] + * - [vfunc@Gtk.Widget.measure] * * There are some important things to keep in mind when implementing * height-for-width and when using it in widget implementations. * * If you implement a direct `GtkWidget` subclass that supports * height-for-width or width-for-height geometry management for itself - * or its child widgets, the `GtkWidgetClass.get_request_mode()` virtual + * or its child widgets, the [vfunc@Gtk.Widget.get_request_mode] virtual * function must be implemented as well and return the widget's preferred * request mode. The default implementation of this virtual function * returns %GTK_SIZE_REQUEST_CONSTANT_SIZE, which means that the widget will - * only ever get -1 passed as the for_size value to its `GtkWidgetClass.measure()` - * implementation. + * only ever get -1 passed as the for_size value to its + * [vfunc@Gtk.Widget.measure] implementation. * * The geometry management system will query a widget hierarchy in * only one orientation at a time. When widgets are initially queried @@ -163,7 +163,7 @@ * trades sizes in a single orientation. * * For instance, a [class@Gtk.Label] that does height-for-width word wrapping - * will not expect to have `GtkWidgetClass.measure()` with an orientation of + * will not expect to have [vfunc@Gtk.Widget.measure] with an orientation of * %GTK_ORIENTATION_VERTICAL called because that call is specific to a * width-for-height request. In this case the label must return the height * required for its own minimum possible width. By following this rule any @@ -189,24 +189,24 @@ * } * else // VERTICAL * { - * if (i_am_in_height_for_width_mode) - * { - * int min_width, dummy; + * if (i_am_in_height_for_width_mode) + * { + * int min_width, dummy; * - * // First, get the minimum width of our widget - * GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_HORIZONTAL, -1, - * &min_width, &dummy, &dummy, &dummy); + * // First, get the minimum width of our widget + * GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_HORIZONTAL, -1, + * &min_width, &dummy, &dummy, &dummy); * - * // Now use the minimum width to retrieve the minimum and natural height to display - * // that width. - * GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_VERTICAL, min_width, - * minimum_size, natural_size, &dummy, &dummy); - * } - * else - * { - * // ... some widgets do both. - * } - * } + * // Now use the minimum width to retrieve the minimum and natural height to display + * // that width. + * GTK_WIDGET_GET_CLASS (widget)->measure (widget, GTK_ORIENTATION_VERTICAL, min_width, + * minimum_size, natural_size, &dummy, &dummy); + * } + * else + * { + * // ... some widgets do both. + * } + * } * } * ``` * @@ -218,7 +218,7 @@ * example above. * * It will not work to use the wrapper function [method@Gtk.Widget.measure] - * inside your own `GtkWidgetClass.size_allocate()` implementation. + * inside your own [vfunc@Gtk.Widget.size_allocate] implementation. * These return a request adjusted by [class@Gtk.SizeGroup], the widget's * align and expand flags, as well as its CSS style. * @@ -240,8 +240,8 @@ * the baseline, or a baseline assigned to it by the grandparent. * * Baseline alignment support for a widget is also done by the - * `GtkWidgetClass.measure()` virtual function. It allows you to report both - * a minimum and natural size. + * [vfunc@Gtk.Widget.measure] virtual function. It allows you to report + * both a minimum and natural size. * * If a widget ends up baseline aligned it will be allocated all the space in * the parent as if it was %GTK_ALIGN_FILL, but the selected baseline can be @@ -251,7 +251,7 @@ * * ### GtkWidget as GtkBuildable * - * The `GtkWidget` implementation of the [iface@Gtk.Buildable] interface + * The `GtkWidget` implementation of the `GtkBuildable` interface * supports various custom elements to specify additional aspects of widgets * that are not directly expressed as properties. * @@ -313,19 +313,19 @@ * `GtkWidget `exposes some facilities to automate the procedure * of creating composite widgets using "templates". * - * To create composite widgets with #GtkBuilder XML, one must associate + * To create composite widgets with `GtkBuilder` XML, one must associate * the interface description with the widget class at class initialization - * time using `gtk_widget_class_set_template()`. + * time using [method@Gtk.WidgetClass.set_template]. * * The interface description semantics expected in composite template descriptions * is slightly different from regular [class@Gtk.Builder] XML. * - * Unlike regular interface descriptions, `gtk_widget_class_set_template()` will + * Unlike regular interface descriptions, [method@Gtk.WidgetClass.set_template] will * expect a `