summaryrefslogtreecommitdiff
path: root/libmatemixer/matemixer-toggle.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-09-05 16:36:05 +0200
committerMichal Ratajsky <[email protected]>2014-09-05 16:36:05 +0200
commit1a9410a38aebb6ce05d43433c020e198416761df (patch)
treeb2db9e589c88585063101d87388fd515217214de /libmatemixer/matemixer-toggle.c
parentb100e0045c0cb0b60bc381bc99dca18db82f3eba (diff)
downloadlibmatemixer-1a9410a38aebb6ce05d43433c020e198416761df.tar.bz2
libmatemixer-1a9410a38aebb6ce05d43433c020e198416761df.tar.xz
Documentation additions and fixes
Diffstat (limited to 'libmatemixer/matemixer-toggle.c')
-rw-r--r--libmatemixer/matemixer-toggle.c43
1 files changed, 38 insertions, 5 deletions
diff --git a/libmatemixer/matemixer-toggle.c b/libmatemixer/matemixer-toggle.c
index 869807a..5a85076 100644
--- a/libmatemixer/matemixer-toggle.c
+++ b/libmatemixer/matemixer-toggle.c
@@ -24,6 +24,7 @@
/**
* SECTION:matemixer-toggle
+ * @short_description: On/Off switch
* @include: libmatemixer/matemixer.h
*/
@@ -80,6 +81,12 @@ mate_mixer_toggle_class_init (MateMixerToggleClass *klass)
switch_class->get_option = mate_mixer_toggle_get_option;
switch_class->list_options = mate_mixer_toggle_list_options;
+ /**
+ * MateMixerToggle:state:
+ *
+ * The current state of the toggle. %TRUE corresponds to the 'on' state and
+ * %FALSE to the 'off' state.
+ */
properties[PROP_STATE] =
g_param_spec_boolean ("state",
"State",
@@ -88,19 +95,29 @@ mate_mixer_toggle_class_init (MateMixerToggleClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
+ /**
+ * MateMixerToggle:on-state-option:
+ *
+ * The #MateMixerSwitchOption representing the 'on' value of the toggle.
+ */
properties[PROP_ON_STATE_OPTION] =
g_param_spec_object ("on-state-option",
- "State option for on",
- "Option corresponding to the 'on' value of the toggle",
+ "On state option",
+ "On state option",
MATE_MIXER_TYPE_SWITCH_OPTION,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
+ /**
+ * MateMixerToggle:off-state-option:
+ *
+ * The #MateMixerSwitchOption representing the 'off' value of the toggle.
+ */
properties[PROP_OFF_STATE_OPTION] =
g_param_spec_object ("off-state-option",
- "State option for off",
- "Option corresponding to the 'off' value of the toggle",
+ "Off state option",
+ "Off state option",
MATE_MIXER_TYPE_SWITCH_OPTION,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
@@ -193,6 +210,11 @@ mate_mixer_toggle_dispose (GObject *object)
/**
* mate_mixer_toggle_get_state:
* @toggle: a #MateMixerToggle
+ *
+ * Gets the current state of the toggle. %TRUE corresponds to the 'on' state and
+ * %FALSE to the 'off' state.
+ *
+ * Returns: %TRUE or %FALSE.
*/
gboolean
mate_mixer_toggle_get_state (MateMixerToggle *toggle)
@@ -214,7 +236,11 @@ mate_mixer_toggle_get_state (MateMixerToggle *toggle)
/**
* mate_mixer_toggle_get_state_option:
* @toggle: a #MateMixerToggle
- * @state: the state to retrieve
+ * @state: the state to get the #MateMixerSwitchOption for
+ *
+ * Gets the #MateMixerSwitchOption representing the selected state.
+ *
+ * Returns: a #MateMixerSwitchOption.
*/
MateMixerSwitchOption *
mate_mixer_toggle_get_state_option (MateMixerToggle *toggle, gboolean state)
@@ -231,6 +257,13 @@ mate_mixer_toggle_get_state_option (MateMixerToggle *toggle, gboolean state)
* mate_mixer_toggle_set_state:
* @toggle: a #MateMixerToggle
* @state: the state to set
+ *
+ * Sets the @toggle to the selected state.
+ *
+ * This function is equivalent to using mate_mixer_switch_set_active_option()
+ * with a #MateMixerSwitchOption representing the selected state.
+ *
+ * Returns: %TRUE on success or %FALSE on failure.
*/
gboolean
mate_mixer_toggle_set_state (MateMixerToggle *toggle, gboolean state)