[nautilus-actions: 3/30] Initialize API directory



commit ab081b103f362e9fdd1f625e92516af30fc16ef4
Author: Pierre Wieser <pwieser trychlos org>
Date:   Tue Nov 17 22:55:17 2009 +0100

    Initialize API directory
    
    na-api.h is the plugin interface
    na-gconf-keys.h contains the main GConf keys.

 nautilus-actions/api/Makefile.am     |   55 ++++++++++++++++++
 nautilus-actions/api/README          |    7 ++
 nautilus-actions/api/na-api.h        |  104 ++++++++++++++++++++++++++++++++++
 nautilus-actions/api/na-gconf-keys.h |   47 +++++++++++++++
 4 files changed, 213 insertions(+), 0 deletions(-)
---
diff --git a/nautilus-actions/api/Makefile.am b/nautilus-actions/api/Makefile.am
new file mode 100644
index 0000000..83f8e4c
--- /dev/null
+++ b/nautilus-actions/api/Makefile.am
@@ -0,0 +1,55 @@
+# Nautilus Actions
+# A Nautilus extension which offers configurable context menu actions.
+#
+# Copyright (C) 2005 The GNOME Foundation
+# Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+# Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+#
+# This Program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This Program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this Library; see the file COPYING.  If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307, USA.
+#
+# Authors:
+#   Frederic Ruaudel <grumz grumz net>
+#   Rodrigo Moya <rodrigo gnome-db org>
+#   Pierre Wieser <pwieser trychlos org>
+#   ... and many others (see AUTHORS)
+
+pkglib_LTLIBRARIES=libna-api.la
+
+AM_CPPFLAGS += \
+	$(NAUTILUS_ACTIONS_CFLAGS)							\
+	-DG_LOG_DOMAIN=\"${NA_LOGDOMAIN_API}\"				\
+	$(NULL)
+
+libna_api_includedir = $(pkgincludedir)/api
+
+libna_api_include_HEADERS = \
+	na-api.h											\
+	na-gconf-keys.h										\
+	$(NULL)
+
+libna_api_la_SOURCES = \
+	$(NULL)
+
+libna_api_la_LIBADD = \
+	$(NULL)
+
+#VERSION_INFO = `echo @VERSION@ | $(SED) -e 's/\./:/g' -e 's/[a-aA-Z]//g'`
+VERSION_INFO = 1:0:0
+libna_api_la_LDFLAGS = \
+	-module 											\
+	-no-undefined										\
+	-version-number $(VERSION_INFO)						\
+	$(NULL)
diff --git a/nautilus-actions/api/README b/nautilus-actions/api/README
new file mode 100644
index 0000000..2833de7
--- /dev/null
+++ b/nautilus-actions/api/README
@@ -0,0 +1,7 @@
+This is the Nautilus-Actions extension interface.
+
+These files are used by dynamic extensions (e.g. I/O providers).
+
+Headers are to be installed as part of a development environment of
+such a dynamic extension. They are to be included by the extension
+as '#include <nautilus-actions/api/header.h>'.
diff --git a/nautilus-actions/api/na-api.h b/nautilus-actions/api/na-api.h
new file mode 100644
index 0000000..d881d58
--- /dev/null
+++ b/nautilus-actions/api/na-api.h
@@ -0,0 +1,104 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifndef __NAUTILUS_ACTIONS_NA_API_H__
+#define __NAUTILUS_ACTIONS_NA_API_H__
+
+/**
+ * SECTION: na_api
+ * @short_description: #NAAPI interface definition.
+ * @include: api/na-api.h
+ *
+ * These are common functions a Nautilus-Actions extension should
+ * implement in order to be dynamically registered and identified.
+ */
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/**
+ * na_api_module_init:
+ * @module: the #GTypeModule of the library being loaded.
+ *
+ * This function is called by Nautilus-Actions each time the library
+ * is first loaded in memory.
+ *
+ * The dynamically loaded library may benefit of being triggered by
+ * initializing itself, registering its internal GTypes, etc.
+ */
+void         na_api_module_init      ( GTypeModule *module );
+
+/**
+ * na_api_module_list_types:
+ * @types: the array of #GType this dynamically library implements.
+ *
+ * This function is called by Nautilus-Actions in order to get the
+ * internal GTypes implemented by the dynamically loaded library.
+ *
+ * Returned GTypes should already have been registered in GType system
+ * (e.g. via na_api_module_init), and may implement one or more of the
+ * interfaces defined in Nautilus-Actions API.
+ *
+ * One object will be instantiated by Nautilus-Actions for each returned
+ * GType.
+ *
+ * Returns: the number of GTypes item in the @types array.
+ */
+gint         na_api_module_list_types( const GType **types );
+
+/**
+ * na_api_module_get_name:
+ * @type: the library #GType for which Nautilus-Actions wish the name.
+ *
+ * Returns: the name to be associated with this @type.
+ *
+ * Nautilus-Actions may ask the dynamically loadable library for a
+ * name associated to each #GType the library had previously declared.
+ * This is generally to be displayed in a user interface ; the name
+ * may be localized.
+ */
+const gchar *na_api_module_get_name  ( GType type );
+
+/**
+ * na_api_module_shutdown:
+ *
+ * This function is called by Nautilus-Actions when it is about to
+ * shutdown itself.
+ *
+ * The dynamicaly loaded library may benefit of this call to release
+ * any resource it may have previously allocated.
+ */
+void         na_api_module_shutdown  ( void );
+
+G_END_DECLS
+
+#endif /* __NAUTILUS_ACTIONS_NA_API_H__ */
diff --git a/nautilus-actions/api/na-gconf-keys.h b/nautilus-actions/api/na-gconf-keys.h
new file mode 100644
index 0000000..dd74c10
--- /dev/null
+++ b/nautilus-actions/api/na-gconf-keys.h
@@ -0,0 +1,47 @@
+/*
+ * Nautilus Actions
+ * A Nautilus extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009 Pierre Wieser and others (see AUTHORS)
+ *
+ * This Program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this Library; see the file COPYING.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place,
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifndef __NAUTILUS_ACTIONS_NA_GCONF_KEYS_H__
+#define __NAUTILUS_ACTIONS_NA_GCONF_KEYS_H__
+
+/**
+ * SECTION: na_gconf
+ * @short_description: GConf general information.
+ * @include: nautilus-actions/na-gconf-keys.h
+ *
+ * These keys are used both:
+ * - by GConf as a NAIIOProvider
+ * - by GConf as the preferences storage system
+ * - as a part of schemas path in import/export operations
+ */
+#define NAUTILUS_ACTIONS_GCONF_BASEDIR			"/apps/nautilus-actions"
+#define NAUTILUS_ACTIONS_GCONF_SCHEMASDIR		"/schemas"
+
+#endif /* __NAUTILUS_ACTIONS_NA_GCONF_KEYS_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]