gtk+ r21959 - in trunk: . docs/reference docs/reference/gtk/tmpl gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21959 - in trunk: . docs/reference docs/reference/gtk/tmpl gtk
- Date: Mon, 29 Dec 2008 02:36:39 +0000 (UTC)
Author: matthiasc
Date: Mon Dec 29 02:36:39 2008
New Revision: 21959
URL: http://svn.gnome.org/viewvc/gtk+?rev=21959&view=rev
Log:
Merge docs inline
Modified:
trunk/ChangeLog
trunk/docs/reference/ChangeLog
trunk/docs/reference/gtk/tmpl/gtkscale.sgml
trunk/gtk/gtkscale.c
Modified: trunk/docs/reference/gtk/tmpl/gtkscale.sgml
==============================================================================
--- trunk/docs/reference/gtk/tmpl/gtkscale.sgml (original)
+++ trunk/docs/reference/gtk/tmpl/gtkscale.sgml Mon Dec 29 02:36:39 2008
@@ -29,53 +29,20 @@
<!-- ##### 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>
-
-<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>
-
-</tbody></tgroup></informaltable>
+The fields of the #GtkScale-struct struct should only be accessed via
+the accessor functions.
</para>
<!-- ##### 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
+
+</para>
+
+ scale:
+ value:
+ Returns:
+
<!-- ##### ARG GtkScale:digits ##### -->
<para>
@@ -104,61 +71,56 @@
<!-- ##### 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 ##### -->
Modified: trunk/gtk/gtkscale.c
==============================================================================
--- trunk/gtk/gtkscale.c (original)
+++ trunk/gtk/gtkscale.c Mon Dec 29 02:36:39 2008
@@ -138,6 +138,29 @@
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),
@@ -477,6 +500,16 @@
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)
@@ -502,6 +535,14 @@
}
}
+/**
+ * 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)
{
@@ -510,6 +551,14 @@
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)
@@ -534,6 +583,15 @@
}
}
+/**
+ * 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)
{
@@ -542,6 +600,13 @@
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)
@@ -560,6 +625,14 @@
}
}
+/**
+ * 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)
{
@@ -831,7 +904,7 @@
* if no user signal handlers, falls back to a default format.
*
* Return value: formatted value
- **/
+ */
gchar*
_gtk_scale_format_value (GtkScale *scale,
gdouble value)
@@ -873,7 +946,7 @@
* if the #GtkScale:draw-value property is %FALSE.
*
* Since: 2.4
- **/
+ */
PangoLayout *
gtk_scale_get_layout (GtkScale *scale)
{
@@ -914,7 +987,7 @@
* values are undefined.
*
* Since: 2.4
- **/
+ */
void
gtk_scale_get_layout_offsets (GtkScale *scale,
gint *x,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]