From 553415d5e00005f7d29de702e89f02c4cb983694 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Mon, 4 Aug 2008 16:17:18 +0200 Subject: [PATCH] Keep on documenting objects. --- docs/libmmanager/Makefile.am | 4 +++- libmmanager/mm-error.h | 34 ++++++++++++++++++++++++++++++++++ libmmanager/mm-module.h | 19 +++++++++++++++++++ libmmanager/mm-so-application.h | 21 +++++++++++++++++++++ libmmanager/mm-so-category.h | 21 +++++++++++++++++++++ libmmanager/mm-string-utils.h | 7 +++++++ libmmanager/mm-types.h | 30 ++++++++++++++++++++++-------- 7 files changed, 127 insertions(+), 9 deletions(-) diff --git a/docs/libmmanager/Makefile.am b/docs/libmmanager/Makefile.am index 024bd99..3e9cc27 100644 --- a/docs/libmmanager/Makefile.am +++ b/docs/libmmanager/Makefile.am @@ -15,7 +15,9 @@ CFILE_GLOB=$(top_srcdir)/libmmanager/*.c # Headers to ignore IGNORE_HFILES= \ - stamp-mm-type-builtins.h + stamp-mm-type-builtins.h \ + mm-type-builtins.h \ + mm.h # CFLAGS and LDFLAGS for compiling scan program. Only needed # if $(DOC_MODULE).types is non-empty. diff --git a/libmmanager/mm-error.h b/libmmanager/mm-error.h index 15b289f..569cf7d 100644 --- a/libmmanager/mm-error.h +++ b/libmmanager/mm-error.h @@ -28,6 +28,18 @@ #define MM_DBUS_ERROR_QUARK g_quark_from_static_string ("MMDBusError") #define MM_SO_ERROR_QUARK g_quark_from_static_string ("MMSoError") +/** + * MMXmlErrorEnum: + * @MM_XML_ERROR_UNSERIALIZE_FAILED: An unspecified error occurred. + * @MM_XML_ERROR_UNEXPECTED_EOF: The XML buffer ended unexpectedly. + * @MM_XML_ERROR_UNEXPECTED_NODE: A node different from the expected one + * was found while parsing the XML buffer. + * @MM_XML_ERROR_UNKNOWN_GTYPE: Failed to go from XML to #GType because the + * type seems to be unknown. + * + * Error codes for libmmanager XML operations. + */ + typedef enum { MM_XML_ERROR_UNSERIALIZE_FAILED, MM_XML_ERROR_UNEXPECTED_EOF, @@ -35,6 +47,20 @@ typedef enum { MM_XML_ERROR_UNKNOWN_GTYPE } MMXmlErrorEnum; +/** + * MMDBusErrorEnum: + * @MM_DBUS_ERROR_FAILED: An unspecified error occurred. + * @MM_DBUS_ERROR_BUS_UNAVAILABLE: Could not connect to the session bus. + * @MM_DBUS_ERROR_NULL_ATTRIBUTE: Failed validating the arguments. + * @MM_DBUS_ERROR_REMOTE_METHOD_FAILED: A remote method failed to execute. + * @MM_DBUS_ERROR_SERIALIZE_FAIL: An error occurred while serializing an + * object. + * @MM_DBUS_ERROR_UNSERIALIZE_FAIL: An error occurred while unserializing an + * object. + * + * Error codes for libmmanager DBus operations. + */ + typedef enum { MM_DBUS_ERROR_FAILED, MM_DBUS_ERROR_BUS_UNAVAILABLE, @@ -44,6 +70,14 @@ typedef enum { MM_DBUS_ERROR_UNSERIALIZE_FAIL } MMDBusErrorEnum; +/** + * MMSoErrorEnum: + * @MM_SO_ERROR_FAILED: An unspecified error occurred. + * @MM_SO_ERROR_NULL_PROVIDER: Error while validating a provider. + * + * Error codes for libmmanager Shared Object operations. + */ + typedef enum { MM_SO_ERROR_FAILED, MM_SO_ERROR_NULL_PROVIDER diff --git a/libmmanager/mm-module.h b/libmmanager/mm-module.h index fbfa4fa..e9e3db8 100644 --- a/libmmanager/mm-module.h +++ b/libmmanager/mm-module.h @@ -38,10 +38,29 @@ #define MM_IS_MODULE_CLASS(klass) (G_TYPE_CLASS_CHECK_CLASS_TYPE ((klass),\ MM_TYPE_MODULE)) +/** + * SECTION:mm-module + * @short_description: module. + * + * #MMModule is a #GTypeModule for a registered application. An application + * which wants to use the the library has to implement all the methods of the + * interface, and create his own implementations for all the three providers. + */ + typedef struct _MMModule MMModule; typedef struct _MMModuleDetails MMModuleDetails; typedef struct _MMModuleClass MMModuleClass; +/** + * MMModule: + * @initialize: function that will be called to initialize the module. + * @shutdown: function that will be called to shutdown the module. + * @get_types: returns an array of the #GType of provider implementations. + * @get_name: returns the module name. + * + * Class for extending libmmanager with new applications. + */ + struct _MMModule { GTypeModule parent; diff --git a/libmmanager/mm-so-application.h b/libmmanager/mm-so-application.h index a636461..784529b 100644 --- a/libmmanager/mm-so-application.h +++ b/libmmanager/mm-so-application.h @@ -37,7 +37,28 @@ #define MM_SO_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),\ MM_TYPE_SO_APPLICATION, MMSoApplicationClass)) +/** + * SECTION:mm-so-application + * @short_description: Shared Object implementation of #MMApplication. + * + * A #MMSoApplication is an implementation of #MMApplication for applications + * using the Shared Object interface of the library. + */ + +/** + * MMSoApplication: + * + * A Shared Object implementation of a #MMApplication. + */ + typedef struct _MMSoApplication MMSoApplication; + +/** + * MMSoApplicationClass: + * + * Class of #MMSoApplication objects. + */ + typedef struct _MMSoApplicationClass MMSoApplicationClass; struct _MMSoApplication { diff --git a/libmmanager/mm-so-category.h b/libmmanager/mm-so-category.h index f75204b..aa72f76 100644 --- a/libmmanager/mm-so-category.h +++ b/libmmanager/mm-so-category.h @@ -38,7 +38,28 @@ #define MM_SO_CATEGORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),\ MM_TYPE_SO_CATEGORY, MMSoCategoryClass)) +/** + * SECTION:mm-so-category + * @short_description: Shared Object implementation of #MMCategory. + * + * A #MMSoCategory is an implementation of #MMCategory for categories + * using the Shared Object interface of the library. + */ + +/** + * MMSoCategory: + * + * A Shared Object implementation of a #MMCategory. + */ + typedef struct _MMSoCategory MMSoCategory; + +/** + * MMSoCategoryClass: + * + * Class of #MMSoCategory objects. + */ + typedef struct _MMSoCategoryClass MMSoCategoryClass; struct _MMSoCategory { diff --git a/libmmanager/mm-string-utils.h b/libmmanager/mm-string-utils.h index eef26d3..d65fef1 100644 --- a/libmmanager/mm-string-utils.h +++ b/libmmanager/mm-string-utils.h @@ -25,6 +25,13 @@ #include "mm-filter.h" #include "mm-hit-collection.h" +/** + * SECTION:mm-string-utils + * @short_description: string utils. + * + * Utils to convert libmmanager and #GValue objects to string and viceversa. + */ + char * mm_filter_serialize (MMFilter *filter, GError **error); MMFilter * mm_filter_unserialize (const char *s, GError **error); char * mm_hit_collection_serialize (MMHitCollection *hc, GError **error); diff --git a/libmmanager/mm-types.h b/libmmanager/mm-types.h index cf4c611..5f5e3f9 100644 --- a/libmmanager/mm-types.h +++ b/libmmanager/mm-types.h @@ -21,6 +21,16 @@ #ifndef __MM_TYPES_H__ #define __MM_TYPES_H__ +/** + * MMApplicationType: + * @MM_APPLICATION_NONE: initializer. + * @MM_APPLICATION_PHOTO: application supports photo management. + * @MM_APPLICATION_MUSIC: application supports music management. + * @MM_APPLICATION_VIDEO: application supports video management. + * + * Media types that applications can support. + */ + typedef enum { MM_APPLICATION_NONE, MM_APPLICATION_PHOTO, @@ -28,6 +38,18 @@ typedef enum { MM_APPLICATION_VIDEO } MMApplicationType; +/** + * MMComparisionOperator: + * @MM_COMP_NONE: initializer. + * @MM_COMP_EQUAL: equal to. + * @MM_COMP_GREATER: greater than. + * @MM_COMP_LESS: less than. + * @MM_COMP_GREATER_EQUAL: greater or equal than. + * @MM_COMP_LESS_EQUAL: less or equal than. + * + * Comparision operators. + */ + typedef enum { MM_COMP_NONE, MM_COMP_EQUAL, @@ -37,12 +59,4 @@ typedef enum { MM_COMP_LESS_EQUAL } MMComparisionOperator; -/* FIXME: logical operators not implemented yet - typedef enum { - MM_LOGIC_NONE, - MM_LOGIC_OR, - MM_LOGIC_AND -} MMLogicOperator; -*/ - #endif /* __MM_TYPES_H__ */ -- 2.11.4.GIT