windowcontrols: Convert docs

This commit is contained in:
Matthias Clasen 2021-02-27 00:15:10 -05:00 committed by Emmanuele Bassi
parent 9104420c87
commit 4bed24a816

View File

@ -33,19 +33,18 @@
#include "gtkwindowprivate.h"
/**
* SECTION:gtkwindowcontrols
* @Short_description: A widget displaying window buttons
* @Title: GtkWindowControls
* @See_also: #GtkHeaderBar
* GtkWindowControls:
*
* GtkWindowControls shows window frame controls, such as minimize, maximize
* `GtkWindowControls` shows window frame controls, such as minimize, maximize
* and close buttons, and the window icon.
*
* #GtkWindowControls only displays start or end side of the controls (see
* #GtkWindowControls:side), so it's intended to be always used in pair with
* another #GtkWindowControls using the opposite side, for example:
* ![An example GtkWindowControls](windowcontrols.png)
*
* |[
* `GtkWindowControls` only displays start or end side of the controls (see
* [property@Gtk.WindowControls:side]), so it's intended to be always used
* in pair with another `GtkWindowControls` for the opposite side, for example:
*
* ```xml
* <object class="GtkBox">
* <child>
* <object class="GtkWindowControls">
@ -61,7 +60,7 @@
* </object>
* </child>
* </object>
* ]|
* ```
*
* # CSS nodes
*
@ -73,16 +72,17 @@
* [button.close]
* ]|
*
* A #GtkWindowControls' CSS node is called windowcontrols. It contains
* A `GtkWindowControls`' CSS node is called windowcontrols. It contains
* subnodes corresponding to each title button. Which of the title buttons
* exist and where they are placed exactly depends on the desktop environment
* and #GtkWindowControls:decoration-layout value.
* and [property@Gtk.WindowControls:decoration-layout] value.
*
* When #GtkWindowControls:empty is %TRUE, it gets the .empty style class.
* When [property@Gtk.WindowControls:empty] is %TRUE, it gets the .empty
* style class.
*
* # Accessibility
*
* GtkWindowHandle uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
* `GtkWindowControls` uses the %GTK_ACCESSIBLE_ROLE_GROUP role.
*/
struct _GtkWindowControls {
@ -506,11 +506,11 @@ gtk_window_controls_class_init (GtkWindowControlsClass *klass)
widget_class->unroot = gtk_window_controls_unroot;
/**
* GtkWindowControls:side:
* GtkWindowControls:side: (attributes org.gtk.Property.get=gtk_window_controls_get_side org.gtk.Property.set=gtk_window_controls_set_side)
*
* Whether the widget shows start or end side of the decoration layout.
*
* See gtk_window_controls_set_decoration_layout().
* See [property@Gtk.WindowControls:decoration_layout].
*/
props[PROP_SIDE] =
g_param_spec_enum ("side",
@ -521,13 +521,12 @@ gtk_window_controls_class_init (GtkWindowControlsClass *klass)
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWindowControls:decoration-layout:
* GtkWindowControls:decoration-layout: (attributes org.gtk.Property.get=gtk_window_controls_get_decoration_layout org.gtk.Property.set=gtk_window_controls_set_decoration_layout)
*
* The decoration layout for window buttons. If this property is not set,
* the #GtkSettings:gtk-decoration-layout setting is used.
* The decoration layout for window buttons.
*
* See gtk_window_controls_set_decoration_layout() for information
* about the format of this string.
* If this property is not set, the
* [property@Gtk.Settings:gtk-decoration-layout] setting is used.
*/
props[PROP_DECORATION_LAYOUT] =
g_param_spec_string ("decoration-layout",
@ -537,7 +536,7 @@ gtk_window_controls_class_init (GtkWindowControlsClass *klass)
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkWindowControls:empty:
* GtkWindowControls:empty: (attributes org.gtk.Property.get=gtk_window_controls_get_empty)
*
* Whether the widget has any window buttons.
*/
@ -572,9 +571,9 @@ gtk_window_controls_init (GtkWindowControls *self)
* gtk_window_controls_new:
* @side: the side
*
* Creates a new #GtkWindowControls.
* Creates a new `GtkWindowControls`.
*
* Returns: a new #GtkWindowControls.
* Returns: a new `GtkWindowControls`.
**/
GtkWidget *
gtk_window_controls_new (GtkPackType side)
@ -585,10 +584,10 @@ gtk_window_controls_new (GtkPackType side)
}
/**
* gtk_window_controls_get_side:
* @self: a #GtkWindowControls
* gtk_window_controls_get_side: (attributes org.gtk.Method.get_property=side)
* @self: a `GtkWindowControls`
*
* Gets the side set with gtk_window_controls_set_side().
* Gets the side to which this `GtkWindowControls` instance belongs.
*
* Returns: the side
*/
@ -601,13 +600,13 @@ gtk_window_controls_get_side (GtkWindowControls *self)
}
/**
* gtk_window_controls_set_side:
* @self: a #GtkWindowControls
* gtk_window_controls_set_side: (attributes org.gtk.Method.set_property=side)
* @self: a `GtkWindowControls`
* @side: a side
*
* Sets the side for @self, determining which part of decoration layout it uses.
* Determines which part of decoration layout the `GtkWindowControls` uses.
*
* See gtk_window_controls_set_decoration_layout()
* See [property@Gtk.WindowControls:decoration-layout].
*/
void
gtk_window_controls_set_side (GtkWindowControls *self,
@ -643,11 +642,10 @@ gtk_window_controls_set_side (GtkWindowControls *self,
}
/**
* gtk_window_controls_get_decoration_layout:
* @self: a #GtkWindowControls
* gtk_window_controls_get_decoration_layout: (attributes org.gtk.Method.get_property=decoration-layout)
* @self: a `GtkWindowControls`
*
* Gets the decoration layout set with
* gtk_window_controls_set_decoration_layout().
* Gets the decoration layout of this `GtkWindowControls`.
*
* Returns: (nullable): the decoration layout or %NULL if it is unset
*/
@ -660,13 +658,15 @@ gtk_window_controls_get_decoration_layout (GtkWindowControls *self)
}
/**
* gtk_window_controls_set_decoration_layout:
* @self: a #GtkWindowControls
* gtk_window_controls_set_decoration_layout: (attributes org.gtk.Method.set_property=decoration-layout)
* @self: a `GtkWindowControls`
* @layout: (nullable): a decoration layout, or %NULL to
* unset the layout
*
* Sets the decoration layout for the title buttons, overriding
* the #GtkSettings:gtk-decoration-layout setting.
* Sets the decoration layout for the title buttons.
*
* This overrides the [property@Gtk.Settings:gtk-decoration-layout]
* setting.
*
* The format of the string is button names, separated by commas.
* A colon separates the buttons that should appear on the left
@ -676,8 +676,8 @@ gtk_window_controls_get_decoration_layout (GtkWindowControls *self)
* For example, icon:minimize,maximize,close specifies a icon
* on the left, and minimize, maximize and close buttons on the right.
*
* If #GtkWindowControls:side value is @GTK_PACK_START, @self will
* display the part before the colon, otherwise after that.
* If [property@Gtk.WindowControls:side] value is @GTK_PACK_START, @self
* will display the part before the colon, otherwise after that.
*/
void
gtk_window_controls_set_decoration_layout (GtkWindowControls *self,
@ -694,8 +694,8 @@ gtk_window_controls_set_decoration_layout (GtkWindowControls *self,
}
/**
* gtk_window_controls_get_empty:
* @self: a #GtkWindowControls
* gtk_window_controls_get_empty: (attributes org.gtk.Method.get_property=empty)
* @self: a `GtkWindowControls`
*
* Gets whether the widget has any window buttons.
*