[Xfce4-commits] [apps/xfdashboard] 01/01: Add annotation for API documentation of XfdashboardActionButton
noreply at xfce.org
noreply at xfce.org
Fri Jun 24 15:27:58 CEST 2016
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to branch master
in repository apps/xfdashboard.
commit 4148f3f6343aee0a090e4707a5491438866f8a87
Author: Stephan Haller <nomad at froevel.de>
Date: Fri Jun 24 15:27:48 2016 +0200
Add annotation for API documentation of XfdashboardActionButton
---
libxfdashboard/action-button.c | 80 ++++++++++++++++++++++++++++++++++++++++--
libxfdashboard/action-button.h | 12 +++++++
libxfdashboard/view-selector.c | 3 +-
3 files changed, 90 insertions(+), 5 deletions(-)
diff --git a/libxfdashboard/action-button.c b/libxfdashboard/action-button.c
index 805d518..5b7fab9 100644
--- a/libxfdashboard/action-button.c
+++ b/libxfdashboard/action-button.c
@@ -21,6 +21,33 @@
*
*/
+/**
+ * SECTION:action-button
+ * @short_description: A button to perform a key binding action
+ * @include: xfdashboard/action-button.h
+ *
+ * This actor is a #XfdashboardButton and behaves exactly like a key binding which
+ * performs a specified action on a specific actor when the associated key
+ * combination is pressed. But instead of a key combination a button is displayed
+ * and the action performed when this button is clicked.
+ *
+ * A #XfdashboardActionButton is usually created in the layout definition
+ * of a theme but it can also be created with xfdashboard_action_button_new()
+ * followed by a call to xfdashboard_action_button_set_target() and
+ * xfdashboard_action_button_set_action() to configure it.
+ *
+ * For example a #XfdashboardActionButton can be created which will quit the
+ * application when clicked:
+ *
+ * |[<!-- language="C" -->
+ * ClutterActor *actionButton;
+ *
+ * actionButton=xfdashboard_action_button_new();
+ * xfdashboard_action_button_set_target(XFDASHBOARD_ACTION_BUTTON(actionButton), "XfdashboardApplication");
+ * xfdashboard_action_button_set_action(XFDASHBOARD_ACTION_BUTTON(actionButton), "exit");
+ * ]|
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -414,6 +441,12 @@ static void xfdashboard_action_button_class_init(XfdashboardActionButtonClass *k
g_type_class_add_private(klass, sizeof(XfdashboardActionButtonPrivate));
/* Define properties */
+ /**
+ * XfdashboardActionButton:target:
+ *
+ * A string with the class name of target at which the action should be
+ * performed.
+ */
XfdashboardActionButtonProperties[PROP_TARGET]=
g_param_spec_string("target",
_("Target"),
@@ -421,6 +454,11 @@ static void xfdashboard_action_button_class_init(XfdashboardActionButtonClass *k
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ /**
+ * XfdashboardActionButton:action:
+ *
+ * A string with the signal action name to perform at target.
+ */
XfdashboardActionButtonProperties[PROP_ACTION]=
g_param_spec_string("action",
_("Action"),
@@ -451,13 +489,27 @@ static void xfdashboard_action_button_init(XfdashboardActionButton *self)
/* IMPLEMENTATION: Public API */
-/* Create new actor */
+/**
+ * xfdashboard_action_button_new:
+ *
+ * Creates a new #XfdashboardActionButton actor
+ *
+ * Return value: The newly created #XfdashboardActionButton
+ */
ClutterActor* xfdashboard_action_button_new(void)
{
return(g_object_new(XFDASHBOARD_TYPE_ACTION_BUTTON, NULL));
}
-/* Get/set target to perform action at */
+/**
+ * xfdashboard_action_button_get_target:
+ * @self: A #XfdashboardActionButton
+ *
+ * Retrieves the target's class name of @self at which the action should be
+ * performed.
+ *
+ * Return value: A string with target's class name
+ */
const gchar* xfdashboard_action_button_get_target(XfdashboardActionButton *self)
{
g_return_val_if_fail(XFDASHBOARD_IS_ACTION_BUTTON(self), NULL);
@@ -465,6 +517,14 @@ const gchar* xfdashboard_action_button_get_target(XfdashboardActionButton *self)
return(self->priv->target);
}
+/**
+ * xfdashboard_action_button_set_target:
+ * @self: A #XfdashboardActionButton
+ * @inTarget: The target's class name
+ *
+ * Sets the target's class name at @self at which the action should be
+ * performed by this actor.
+ */
void xfdashboard_action_button_set_target(XfdashboardActionButton *self, const gchar *inTarget)
{
XfdashboardActionButtonPrivate *priv;
@@ -486,7 +546,14 @@ void xfdashboard_action_button_set_target(XfdashboardActionButton *self, const g
}
}
-/* Get/set action to perform at target */
+/**
+ * xfdashboard_action_button_get_target:
+ * @self: A #XfdashboardActionButton
+ *
+ * Retrieves the action's signal name of @self which will be performed at target.
+ *
+ * Return value: A string with action's signal name
+ */
const gchar* xfdashboard_action_button_get_action(XfdashboardActionButton *self)
{
g_return_val_if_fail(XFDASHBOARD_IS_ACTION_BUTTON(self), NULL);
@@ -494,6 +561,13 @@ const gchar* xfdashboard_action_button_get_action(XfdashboardActionButton *self)
return(self->priv->action);
}
+/**
+ * xfdashboard_action_button_set_action:
+ * @self: A #XfdashboardActionButton
+ * @inAction: The action's signal name
+ *
+ * Sets the action's signal name at @self which will be performed at target.
+ */
void xfdashboard_action_button_set_action(XfdashboardActionButton *self, const gchar *inAction)
{
XfdashboardActionButtonPrivate *priv;
diff --git a/libxfdashboard/action-button.h b/libxfdashboard/action-button.h
index 60db269..2ad49a8 100644
--- a/libxfdashboard/action-button.h
+++ b/libxfdashboard/action-button.h
@@ -43,8 +43,15 @@ typedef struct _XfdashboardActionButton XfdashboardActionButton;
typedef struct _XfdashboardActionButtonClass XfdashboardActionButtonClass;
typedef struct _XfdashboardActionButtonPrivate XfdashboardActionButtonPrivate;
+/**
+ * XfdashboardActionButton:
+ *
+ * The #XfdashboardActionButton structure contains only private data and
+ * should be accessed using the provided API
+ */
struct _XfdashboardActionButton
{
+ /*< private >*/
/* Parent instance */
XfdashboardButton parent_instance;
@@ -52,6 +59,11 @@ struct _XfdashboardActionButton
XfdashboardActionButtonPrivate *priv;
};
+/**
+ * XfdashboardActionButtonClass:
+ *
+ * The #XfdashboardActionButtonClass structure contains only private data
+ */
struct _XfdashboardActionButtonClass
{
/*< private >*/
diff --git a/libxfdashboard/view-selector.c b/libxfdashboard/view-selector.c
index 4da4ff2..9580103 100644
--- a/libxfdashboard/view-selector.c
+++ b/libxfdashboard/view-selector.c
@@ -502,7 +502,7 @@ ClutterActor* xfdashboard_view_selector_new(void)
* viewSelector=xfdashboard_view_selector_new();
* xfdashboard_view_selector_set_viewpad(XFDASHBOARD_VIEW_SELECTOR(viewSelector), viewpad);
* ]|
-
+ *
* Return value: The newly created #XfdashboardViewSelector
*/
ClutterActor* xfdashboard_view_selector_new_for_viewpad(XfdashboardViewpad *inViewpad)
@@ -623,7 +623,6 @@ void xfdashboard_view_selector_set_spacing(XfdashboardViewSelector *self, gfloat
g_object_notify_by_pspec(G_OBJECT(self), XfdashboardViewSelectorProperties[PROP_SPACING]);
}
-/* Get/set orientation */
/**
* xfdashboard_view_selector_get_orientation:
* @self: A #XfdashboardViewSelector
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list