+2008-12-28 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkscale.c: Merge docs inline.
+
2008-12-28 Ryan Lortie <desrt@desrt.ca>
small fix for "Paned Window Widgets" example
2008-12-28 Matthias Clasen <mclasen@redhat.com>
- * docs/reference/gtk/gtk-sections.txt: Remove overridden INCLUDEs
+ * gtk/tmpl/gtkscale.sgml: Merge docs inline.
+
+2008-12-28 Matthias Clasen <mclasen@redhat.com>
+
+ * docs/reference/gtk/gtk-sections.txt: Remove overridden INCLUDE
* gtk/tmpl/gtkfontsel.sgml:
* gtk/tmpl/gtkeditable.sgml: Merge docs inline.
<!-- ##### STRUCT GtkScale ##### -->
<para>
-The #GtkScale-struct struct contains the following fields.
-(These fields should be considered read-only. They should never be set by
-an application.)
-
-<informaltable pgwide="1" frame="none" role="struct">
-<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
-<tbody>
+The fields of the #GtkScale-struct struct should only be accessed via
+the accessor functions.
+</para>
-<row>
-<entry>#guint <structfield>draw_value</structfield>;</entry>
-<entry>non-zero if the scale's current value is displayed next to the
-slider.</entry>
-</row>
-<row>
-<entry>#guint <structfield>value_pos</structfield>;</entry>
-<entry>the position in which the textual value is displayed, selected from
-#GtkPositionType.</entry>
-</row>
+<!-- ##### SIGNAL GtkScale::format-value ##### -->
+<para>
-</tbody></tgroup></informaltable>
</para>
+@scale:
+@value:
+@Returns:
-<!-- ##### SIGNAL GtkScale::format-value ##### -->
-<para>
-Signal which allows you to change how the scale value is displayed. Connect a
-signal handler which returns an allocated string representing @value.
-That string will then be used to display the scale's value.
-Here's an example signal handler which displays a value 1.0 as
-with "-->1.0<--".
-<informalexample><programlisting>
-static gchar*
-format_value_callback (GtkScale *scale,
- gdouble value)
-{
- return g_strdup_printf ("-->%0.*g<--",
- gtk_scale_get_digits (scale), value);
-}
-</programlisting></informalexample>
-</para>
-
-@scale: the object which received the signal.
-@arg1:
-@Returns: allocated string representing @value
-<!-- # Unused Parameters # -->
-@value: value to format
<!-- ##### ARG GtkScale:digits ##### -->
<para>
<!-- ##### FUNCTION gtk_scale_set_digits ##### -->
<para>
-Sets the number of decimal places that are displayed in the value. Also causes
-the value of the adjustment to be rounded off to this number of digits, so the
-retrieved value matches the value the user saw.
+
</para>
-@scale: a #GtkScale.
-@digits: the number of decimal places to display, e.g. use 1 to display 1.0,
-2 to display 1.00 etc.
+@scale:
+@digits:
<!-- ##### FUNCTION gtk_scale_set_draw_value ##### -->
<para>
-Specifies whether the current value is displayed as a string next to the
-slider.
+
</para>
-@scale: a #GtkScale.
-@draw_value: a boolean.
+@scale:
+@draw_value:
<!-- ##### FUNCTION gtk_scale_set_value_pos ##### -->
<para>
-Sets the position in which the current value is displayed.
+
</para>
-@scale: a #GtkScale.
-@pos: the position in which the current value is displayed.
+@scale:
+@pos:
<!-- ##### FUNCTION gtk_scale_get_digits ##### -->
<para>
-Gets the number of decimal places that are displayed in the value.
+
</para>
-@scale: a #GtkScale.
-@Returns: the number of decimal places that are displayed.
+@scale:
+@Returns:
<!-- ##### FUNCTION gtk_scale_get_draw_value ##### -->
<para>
-Returns whether the current value is displayed as a string next to the
-slider.
+
</para>
-@scale: a #GtkScale.
-@Returns: whether the current value is displayed as a string.
+@scale:
+@Returns:
<!-- ##### FUNCTION gtk_scale_get_value_pos ##### -->
<para>
-Gets the position in which the current value is displayed.
+
</para>
-@scale: a #GtkScale.
-@Returns: the position in which the current value is displayed.
+@scale:
+@Returns:
<!-- ##### FUNCTION gtk_scale_get_layout ##### -->
class->get_layout_offsets = gtk_scale_real_get_layout_offsets;
+ /**
+ * GtkScale::format-value:
+ * @scale: the object which received the signal
+ * @value: the value to format
+ *
+ * Signal which allows you to change how the scale value is displayed.
+ * Connect a signal handler which returns an allocated string representing
+ * @value. That string will then be used to display the scale's value.
+ *
+ * Here's an example signal handler which displays a value 1.0 as
+ * with "-->1.0<--".
+ * |[
+ * static gchar*
+ * format_value_callback (GtkScale *scale,
+ * gdouble value)
+ * {
+ * return g_strdup_printf ("-->%0.*g<--",
+ * gtk_scale_get_digits (scale), value);
+ * }
+ * ]|
+ *
+ * Return value: allocated string representing @value
+ */
signals[FORMAT_VALUE] =
g_signal_new (I_("format-value"),
G_TYPE_FROM_CLASS (gobject_class),
NULL);
}
+/**
+ * gtk_scale_set_digits:
+ * @scale: a #GtkScale
+ * @digits: the number of decimal places to display,
+ * e.g. use 1 to display 1.0, 2 to display 1.00, etc
+ *
+ * Sets the number of decimal places that are displayed in the value.
+ * Also causes the value of the adjustment to be rounded off to this
+ * number of digits, so the retrieved value matches the value the user saw.
+ */
void
gtk_scale_set_digits (GtkScale *scale,
gint digits)
}
}
+/**
+ * gtk_scale_get_digits:
+ * @scale: a #GtkScale
+ *
+ * Gets the number of decimal places that are displayed in the value.
+ *
+ * Returns: the number of decimal places that are displayed
+ */
gint
gtk_scale_get_digits (GtkScale *scale)
{
return scale->digits;
}
+/**
+ * gtk_scale_set_draw_value:
+ * @scale: a #GtkScale
+ * draw_value: %TRUE to draw the value
+ *
+ * Specifies whether the current value is displayed as a string next
+ * to the slider.
+ */
void
gtk_scale_set_draw_value (GtkScale *scale,
gboolean draw_value)
}
}
+/**
+ * gtk_scale_get_draw_value:
+ * @scale: a #GtkScale
+ *
+ * Returns whether the current value is displayed as a string
+ * next to the slider.
+ *
+ * Returns: whether the current value is displayed as a string
+ */
gboolean
gtk_scale_get_draw_value (GtkScale *scale)
{
return scale->draw_value;
}
+/**
+ * gtk_scale_set_value_pos:
+ * @scale: a #GtkScale
+ * @pos: the position in which the current value is displayed
+ *
+ * Sets the position in which the current value is displayed.
+ */
void
gtk_scale_set_value_pos (GtkScale *scale,
GtkPositionType pos)
}
}
+/**
+ * gtk_scale_get_value_pos:
+ * @scale: a #GtkScale
+ *
+ * Gets the position in which the current value is displayed.
+ *
+ * Returns: the position in which the current value is displayed
+ */
GtkPositionType
gtk_scale_get_value_pos (GtkScale *scale)
{
* if no user signal handlers, falls back to a default format.
*
* Return value: formatted value
- **/
+ */
gchar*
_gtk_scale_format_value (GtkScale *scale,
gdouble value)
* if the #GtkScale:draw-value property is %FALSE.
*
* Since: 2.4
- **/
+ */
PangoLayout *
gtk_scale_get_layout (GtkScale *scale)
{
* values are undefined.
*
* Since: 2.4
- **/
+ */
void
gtk_scale_get_layout_offsets (GtkScale *scale,
gint *x,