From: Javier Jardón Date: Mon, 11 Apr 2011 01:04:11 +0000 (+0100) Subject: Move documentation to inline comments: GtkMisc X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=3662744eaa93dd2857ce364dc38ad9dddf86c061;p=~andy%2Fgtk Move documentation to inline comments: GtkMisc --- diff --git a/docs/reference/gtk/tmpl/.gitignore b/docs/reference/gtk/tmpl/.gitignore index fcae2f505..70cc4997d 100644 --- a/docs/reference/gtk/tmpl/.gitignore +++ b/docs/reference/gtk/tmpl/.gitignore @@ -42,6 +42,7 @@ gtkmenu.sgml gtkmenubar.sgml gtkmenushell.sgml gtkmessagedialog.sgml +gtkmisc.sgml gtknotebook.sgml gtkobject.sgml gtkorientable.sgml diff --git a/docs/reference/gtk/tmpl/gtkmisc.sgml b/docs/reference/gtk/tmpl/gtkmisc.sgml deleted file mode 100644 index c9016e2b0..000000000 --- a/docs/reference/gtk/tmpl/gtkmisc.sgml +++ /dev/null @@ -1,137 +0,0 @@ - -GtkMisc - - -Base class for widgets with alignments and padding - - - -The #GtkMisc widget is an abstract widget which is not useful itself, but -is used to derive subclasses which have alignment and padding attributes. - - -The horizontal and vertical padding attributes allows extra space to be -added around the widget. - - -The horizontal and vertical alignment attributes enable the widget to be -positioned within its allocated area. Note that if the widget is added to -a container in such a way that it expands automatically to fill its -allocated area, the alignment settings will not alter the widgets position. - - - -Note that the desired effect can in most cases be achieved by using the -#GtkWidget:halign, #GtkWidget:valign and #GtkWidget:margin properties -on the child widget, so GtkMisc should not be used in new code. - - - - - - - - - - - - - - - - -The #GtkMisc-struct struct contains the following fields. -(These fields should be considered read-only. They should never be set by -an application.) - - - - - - -#gfloat xalign; -the horizontal alignment, from 0 (left) to 1 (right). - - - -#gfloat yalign; -the vertical alignment, from 0 (top) to 1 (bottom). - - - -#guint16 xpad; -the amount of space to add on the left and right of the widget, -in pixels. - - - -#guint16 ypad; -the amount of space to add on the top and bottom of the widget, -in pixels. - - - - - - - - - - - - - - - - - - - - - - - - - - - -Sets the alignment of the widget. - - -@misc: a #GtkMisc. -@xalign: the horizontal alignment, from 0 (left) to 1 (right). -@yalign: the vertical alignment, from 0 (top) to 1 (bottom). - - - - -Sets the amount of space to add around the widget. - - -@misc: a #GtkMisc. -@xpad: the amount of space to add on the left and right of the widget, -in pixels. -@ypad: the amount of space to add on the top and bottom of the widget, -in pixels. - - - - - - - -@misc: -@xalign: -@yalign: - - - - - - - -@misc: -@xpad: -@ypad: - - diff --git a/gtk/gtkmisc.c b/gtk/gtkmisc.c index c35bd73d2..ea5adc4ee 100644 --- a/gtk/gtkmisc.c +++ b/gtk/gtkmisc.c @@ -31,6 +31,30 @@ #include "gtkprivate.h" +/** + * SECTION:gtkmisc + * @Short_description: Base class for widgets with alignments and padding + * @Title: GtkMisc + * + * The #GtkMisc widget is an abstract widget which is not useful itself, but + * is used to derive subclasses which have alignment and padding attributes. + * + * The horizontal and vertical padding attributes allows extra space to be + * added around the widget. + * + * The horizontal and vertical alignment attributes enable the widget to be + * positioned within its allocated area. Note that if the widget is added to + * a container in such a way that it expands automatically to fill its + * allocated area, the alignment settings will not alter the widgets position. + * + * + * Note that the desired effect can in most cases be achieved by using the + * #GtkWidget:halign, #GtkWidget:valign and #GtkWidget:margin properties + * on the child widget, so GtkMisc should not be used in new code. + * + */ + + struct _GtkMiscPrivate { gfloat xalign; @@ -192,6 +216,14 @@ gtk_misc_get_property (GObject *object, } } +/** + * gtk_misc_set_alignment: + * @misc: a #GtkMisc. + * @xalign: the horizontal alignment, from 0 (left) to 1 (right). + * @yalign: the vertical alignment, from 0 (top) to 1 (bottom). + * + * Sets the alignment of the widget. + */ void gtk_misc_set_alignment (GtkMisc *misc, gfloat xalign, @@ -262,6 +294,16 @@ gtk_misc_get_alignment (GtkMisc *misc, *yalign = priv->yalign; } +/** + * gtk_misc_set_padding: + * @misc: a #GtkMisc. + * @xpad: the amount of space to add on the left and right of the widget, + * in pixels. + * @ypad: the amount of space to add on the top and bottom of the widget, + * in pixels. + * + * Sets the amount of space to add around the widget. + */ void gtk_misc_set_padding (GtkMisc *misc, gint xpad,