summaryrefslogtreecommitdiff
path: root/libcaja-extension/caja-menu-provider.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-08-23 16:02:36 +0300
committermonsta <[email protected]>2016-08-23 16:02:36 +0300
commitfafdebc5741aef1b6eb64db0a0447eb0210ee186 (patch)
treecc8f3ba2885fc12f4bd614865e5a68ab7c5f231b /libcaja-extension/caja-menu-provider.c
parent3b62e6d5d6fe861e8be862b0a20ba32fdf05e701 (diff)
downloadcaja-fafdebc5741aef1b6eb64db0a0447eb0210ee186.tar.bz2
caja-fafdebc5741aef1b6eb64db0a0447eb0210ee186.tar.xz
libcaja-extension: fix docs generation and fix some indent
docs are still far from perfect, but most build warnings are gone
Diffstat (limited to 'libcaja-extension/caja-menu-provider.c')
-rw-r--r--libcaja-extension/caja-menu-provider.c65
1 files changed, 34 insertions, 31 deletions
diff --git a/libcaja-extension/caja-menu-provider.c b/libcaja-extension/caja-menu-provider.c
index 7198b8c3..c0d0400d 100644
--- a/libcaja-extension/caja-menu-provider.c
+++ b/libcaja-extension/caja-menu-provider.c
@@ -28,13 +28,22 @@
#include <glib-object.h>
+/**
+ * SECTION:caja-menu-provider
+ * @title: CajaMenuProvider
+ * @short_description: Interface to provide additional menu items
+ * @include: libcaja-extension/caja-menu-provider.h
+ *
+ * #CajaMenuProvider allows extension to provide additional menu items
+ * in the file manager menus.
+ */
+
static void
caja_menu_provider_base_init (gpointer g_class)
{
static gboolean initialized = FALSE;
- if (!initialized)
- {
+ if (!initialized) {
/* This signal should be emited each time the extension modify the list of menu items */
g_signal_new ("items_updated",
CAJA_TYPE_MENU_PROVIDER,
@@ -52,10 +61,8 @@ caja_menu_provider_get_type (void)
{
static GType type = 0;
- if (!type)
- {
- const GTypeInfo info =
- {
+ if (!type) {
+ const GTypeInfo info = {
sizeof (CajaMenuProviderIface),
caja_menu_provider_base_init,
NULL,
@@ -86,18 +93,15 @@ caja_menu_provider_get_type (void)
*/
GList *
caja_menu_provider_get_file_items (CajaMenuProvider *provider,
- GtkWidget *window,
- GList *files)
+ GtkWidget *window,
+ GList *files)
{
g_return_val_if_fail (CAJA_IS_MENU_PROVIDER (provider), NULL);
- if (CAJA_MENU_PROVIDER_GET_IFACE (provider)->get_file_items)
- {
+ if (CAJA_MENU_PROVIDER_GET_IFACE (provider)->get_file_items) {
return CAJA_MENU_PROVIDER_GET_IFACE (provider)->get_file_items
(provider, window, files);
- }
- else
- {
+ } else {
return NULL;
}
}
@@ -112,41 +116,40 @@ caja_menu_provider_get_file_items (CajaMenuProvider *provider,
*/
GList *
caja_menu_provider_get_background_items (CajaMenuProvider *provider,
- GtkWidget *window,
- CajaFileInfo *current_folder)
+ GtkWidget *window,
+ CajaFileInfo *current_folder)
{
- if (!CAJA_IS_MENU_PROVIDER (provider)) {
- return NULL;
- }
-
+ g_return_val_if_fail (CAJA_IS_MENU_PROVIDER (provider), NULL);
g_return_val_if_fail (CAJA_IS_FILE_INFO (current_folder), NULL);
- if (CAJA_MENU_PROVIDER_GET_IFACE (provider)->get_background_items)
- {
+ if (CAJA_MENU_PROVIDER_GET_IFACE (provider)->get_background_items) {
return CAJA_MENU_PROVIDER_GET_IFACE (provider)->get_background_items
(provider, window, current_folder);
- }
- else
- {
+ } else {
return NULL;
}
}
+/**
+ * caja_menu_provider_get_toolbar_items:
+ * @provider: a #CajaMenuProvider
+ * @window: the parent #GtkWidget window
+ * @current_folder: the folder for which toolbar items are requested
+ *
+ * Returns: (element-type CajaMenuItem) (transfer full): the provided list of #CajaMenuItem
+ */
GList *
caja_menu_provider_get_toolbar_items (CajaMenuProvider *provider,
- GtkWidget *window,
- CajaFileInfo *current_folder)
+ GtkWidget *window,
+ CajaFileInfo *current_folder)
{
g_return_val_if_fail (CAJA_IS_MENU_PROVIDER (provider), NULL);
g_return_val_if_fail (CAJA_IS_FILE_INFO (current_folder), NULL);
- if (CAJA_MENU_PROVIDER_GET_IFACE (provider)->get_toolbar_items)
- {
+ if (CAJA_MENU_PROVIDER_GET_IFACE (provider)->get_toolbar_items) {
return CAJA_MENU_PROVIDER_GET_IFACE (provider)->get_toolbar_items
(provider, window, current_folder);
- }
- else
- {
+ } else {
return NULL;
}
}