[nautilus-actions] IO providers must define an id and a version number
- From: Pierre Wieser <pwieser src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus-actions] IO providers must define an id and a version number
- Date: Mon, 14 Dec 2009 18:47:09 +0000 (UTC)
commit 5dde469559058530b042c4b1211395c98fccb963
Author: Pierre Wieser <pwieser trychlos org>
Date: Sun Dec 13 00:36:01 2009 +0100
IO providers must define an id and a version number
ChangeLog | 10 +++++++
TODO | 9 ++++++
doc/io-provider-id | 10 +++++++
nautilus-actions/api/na-iio-provider.c | 2 +
nautilus-actions/api/na-iio-provider.h | 24 +++++++++++++++++
nautilus-actions/runtime/na-io-provider.c | 39 +++++++++++++++++++++++++++++
nautilus-actions/runtime/na-io-provider.h | 3 ++
7 files changed, 97 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 21f1a64..193ff1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2009-12-12 Pierre Wieser <pwieser trychlos org>
+ * doc/io-provider-id: New file to handle allocated providers ids.
+
+ * nautilus-actions/api/na-iio-provider.c:
+ * nautilus-actions/api/na-iio-provider.h (get_id, get_version):
+ New API functions.
+
+ * nautilus-actions/runtime/na-io-provider.c:
+ * nautilus-actions/runtime/na-io-provider.h
+ (na_io_provider_get_id, na_io_provider_get_version): New functions.
+
* nautilus-actions/nact/nact-iactions-list.c
(nact_iactions_list_initial_load_toplevel, display_label):
Label column is not editable when read-only or locked down.
diff --git a/TODO b/TODO
index 67aca4e..ae5cf0a 100644
--- a/TODO
+++ b/TODO
@@ -101,3 +101,12 @@
- lockdown:
all entry fields should be readonly
+
+- actually, each provider may be unwritable
+ a) because it returns FALSE on na_io_provider_is_writable
+ b) because the sysadmin has put a special key in GConf to lock this provider
+ So:
+ - each provider must be adressable by an id
+ - we have mandatory/io-provider/id/lockdown key
+
+- add a get_version to module api
diff --git a/doc/io-provider-id b/doc/io-provider-id
new file mode 100644
index 0000000..ec28386
--- /dev/null
+++ b/doc/io-provider-id
@@ -0,0 +1,10 @@
+Id's of I/O providers.
+
+These Id's are allocated by the Nautilus-Actions maintainer team.
+If you wish develop a new I/O provider, and so need a unique id,
+please contact the maintainers (see nautilus-actions.doap).
+
+id label holder
+---------- ---------------------- ----------------
+na-desktop NA Desktop IO Provider Nautilus-Actions
+na-gconf NA GConf IO Provider Nautilus-Actions
diff --git a/nautilus-actions/api/na-iio-provider.c b/nautilus-actions/api/na-iio-provider.c
index 4c4d2a6..f2ab2a2 100644
--- a/nautilus-actions/api/na-iio-provider.c
+++ b/nautilus-actions/api/na-iio-provider.c
@@ -102,6 +102,8 @@ interface_base_init( NAIIOProviderInterface *klass )
klass->private = g_new0( NAIIOProviderInterfacePrivate, 1 );
+ klass->get_id = NULL;
+ klass->get_version = NULL;
klass->read_items = NULL;
klass->is_willing_to_write = do_is_willing_to_write;
klass->is_writable = do_is_writable;
diff --git a/nautilus-actions/api/na-iio-provider.h b/nautilus-actions/api/na-iio-provider.h
index 6131f6b..1fe2cac 100644
--- a/nautilus-actions/api/na-iio-provider.h
+++ b/nautilus-actions/api/na-iio-provider.h
@@ -38,6 +38,8 @@
*
* This is the API all I/O Providers should implement in order to
* provide I/O storage resources to Nautilus-Actions.
+ *
+ * Nautilus-Actions v 2.30 - API version: 1
*/
#include <nautilus-actions/private/na-object-item-class.h>
@@ -62,6 +64,28 @@ typedef struct {
*/
/**
+ * get_id:
+ * @instance: the #NAIIOProvider provider.
+ *
+ * Returns: the id of the IO provider as a newly allocated string
+ * which should be g_free() by the caller.
+ *
+ * To avoid any collision, the IO provider id is allocated by the
+ * Nautilus-Actions maintainer team. If you wish develop a new IO
+ * provider, and so need a new provider id, please contact the
+ * maintainers (see nautilus-actions.doap)
+ */
+ gchar * ( *get_id ) ( const NAIIOProvider *instance );
+
+ /**
+ * get_version:
+ * @instance: the #NAIIOProvider provider.
+ *
+ * Returns: the version of this API supported by the IO provider.
+ */
+ guint ( *get_version ) ( const NAIIOProvider *instance );
+
+ /**
* read_items:
* @instance: the #NAIIOProvider provider.
* @messages: a pointer to a #GSList which has been initialized to
diff --git a/nautilus-actions/runtime/na-io-provider.c b/nautilus-actions/runtime/na-io-provider.c
index 0ef709d..4fce93e 100644
--- a/nautilus-actions/runtime/na-io-provider.c
+++ b/nautilus-actions/runtime/na-io-provider.c
@@ -76,6 +76,45 @@ na_io_provider_register_callbacks( const NAPivot *pivot )
}
/**
+ * na_io_provider_get_id:
+ * @provider: the #NAIIOProvider whose id is to be returned.
+ *
+ * Returns: the provider's id as a newly allocated string which should
+ * be g_free() by the caller, or NULL.
+ */
+gchar *
+na_io_provider_get_id( const NAPivot *pivot, const NAIIOProvider *provider )
+{
+ gchar *id;
+
+ id = NULL;
+ if( NA_IIO_PROVIDER_GET_INTERFACE( provider )->get_id ){
+ id = NA_IIO_PROVIDER_GET_INTERFACE( provider )->get_id( provider );
+ }
+
+ return( id );
+}
+
+/**
+ * na_io_provider_get_version:
+ * @provider: the #NAIIOProvider whose id is to be returned.
+ *
+ * Returns: the API's version the provider supports.
+ */
+guint
+na_io_provider_get_version( const NAPivot *pivot, const NAIIOProvider *provider )
+{
+ guint version;
+
+ version = 0;
+ if( NA_IIO_PROVIDER_GET_INTERFACE( provider )->get_version ){
+ version = NA_IIO_PROVIDER_GET_INTERFACE( provider )->get_version( provider );
+ }
+
+ return( version );
+}
+
+/**
* na_io_provider_get_name:
* @provider: the #NAIIOProvider whose name is to be returned.
*
diff --git a/nautilus-actions/runtime/na-io-provider.h b/nautilus-actions/runtime/na-io-provider.h
index a184caf..97d9191 100644
--- a/nautilus-actions/runtime/na-io-provider.h
+++ b/nautilus-actions/runtime/na-io-provider.h
@@ -46,6 +46,9 @@ G_BEGIN_DECLS
void na_io_provider_register_callbacks( const NAPivot *pivot );
+gchar *na_io_provider_get_id( const NAPivot *pivot, const NAIIOProvider *provider );
+guint na_io_provider_get_version( const NAPivot *pivot, const NAIIOProvider *provider );
+
gchar *na_io_provider_get_name( const NAPivot *pivot, const NAIIOProvider *provider );
GList *na_io_provider_read_items( const NAPivot *pivot, GSList **messages );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]