[libgsf] Fixed as many introspection and gtk-doc issues as possible.
- From: Jean BrÃfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgsf] Fixed as many introspection and gtk-doc issues as possible.
- Date: Thu, 2 Aug 2012 19:11:36 +0000 (UTC)
commit 0f50fcba9bec68f447adcc33a0dca50f92f912f0
Author: Jean Brefort <jean brefort normalesup org>
Date: Thu Aug 2 21:11:13 2012 +0200
Fixed as many introspection and gtk-doc issues as possible.
ChangeLog | 41 ++++++++++++
doc/Makefile.am | 2 +-
doc/gsf-sections.txt | 18 +++++-
gsf/Makefile.am | 2 +-
gsf/gsf-blob.c | 4 +
gsf/gsf-blob.h | 4 -
gsf/gsf-clip-data.c | 13 ++++
gsf/gsf-clip-data.h | 4 -
gsf/gsf-doc-meta-data.c | 2 +-
gsf/gsf-infile-msvba.c | 10 ++-
gsf/gsf-infile-zip.c | 6 +-
gsf/gsf-libxml.c | 31 ++++++++-
gsf/gsf-msole-utils.c | 56 ++++++++++++++---
gsf/gsf-msole-utils.h | 10 +++
gsf/gsf-open-pkg-utils.c | 6 +-
gsf/gsf-open-pkg-utils.h | 4 +
gsf/gsf-opendoc-utils.c | 153 +++++++++++++++++++++++++++++++++++++++++-----
gsf/gsf-opendoc-utils.h | 23 ++++++-
gsf/gsf-outfile-zip.c | 4 +-
gsf/gsf-timestamp.c | 54 ++++++++++++++--
gsf/gsf-timestamp.h | 11 +++-
gsf/gsf-utils.c | 6 ++
gsf/gsf-zip-impl.h | 7 ++
gsf/gsf-zip-utils.c | 30 +++++++---
gsf/gsf.h | 6 ++
thumbnailer/main.c | 2 +-
26 files changed, 438 insertions(+), 71 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6a8ee60..fc044e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2012-08-02 Jean Brefort <jean brefort normalesup org>
+
+ * doc/Makefile.am: fixed as many introspection and gtk-doc issues as
+ possible.
+ * doc/gsf-sections.txt: ditto.
+ * gsf/Makefile.am: ditto.
+ * gsf/gsf-blob.c: ditto.
+ * gsf/gsf-blob.h: ditto.
+ * gsf/gsf-clip-data.c: ditto.
+ * gsf/gsf-clip-data.h: ditto.
+ * gsf/gsf-infile-msvba.c (gsf_input_find_vba): ditto.
+ * gsf/gsf-infile-zip.c (vdir_insert), (zip_info_unref): ditto.
+ * gsf/gsf-libxml.c (gsf_xml_gvalue_from_str),
+ (gsf_xml_out_get_output): ditto.
+ * gsf/gsf-msole-utils.c (msole_prop_parse),
+ (gsf_doc_meta_data_read_from_msole), (gsf_msole_metadata_read),
+ (gsf_doc_meta_data_write_to_msole), (gsf_msole_metadata_write):
+ * gsf/gsf-msole-utils.h: ditto.
+ * gsf/gsf-open-pkg-utils.h: ditto.
+ * gsf/gsf-opendoc-utils.c (gsf_odf_get_version_string),
+ (gsf_odf_get_version), (get_gsf_odf_version), (gsf_odf_get_ns),
+ (get_gsf_ooo_ns), (gsf_doc_meta_data_odf_subtree),
+ (gsf_opendoc_metadata_subtree), (gsf_doc_meta_data_read_from_odf),
+ (gsf_opendoc_metadata_read), (gsf_doc_meta_data_write_to_odf),
+ (gsf_opendoc_metadata_write): ditto.
+ * gsf/gsf-opendoc-utils.h: ditto.
+ * gsf/gsf-outfile-zip.c (gsf_outfile_zip_finalize),
+ (gsf_outfile_zip_new_child): ditto.
+ * gsf/gsf-timestamp.c (gsf_timestamp_load_from_string),
+ (gsf_timestamp_from_string), (gsf_timestamp_parse),
+ (gsf_timestamp_to_value): ditto.
+ * gsf/gsf-timestamp.h: ditto.
+ * gsf/gsf-utils.c (gsf_init_dynamic): ditto.
+ * gsf/gsf-zip-impl.h: ditto.
+ * gsf/gsf-zip-utils.c (gsf_vdir_free), (gsf_zip_vdir_free),
+ (gsf_zip_vdir_copy), (gsf_zip_vdir_destroy),
+ (gsf_zip_vdir_get_type), (gsf_vdir_add_child),
+ (gsf_zip_vdir_add_child): ditto.
+ * gsf/gsf.h: ditto.
+ * thumbnailer/main.c (msole_thumbnail): ditto.
+
2012-07-20 Jean Brefort <jean brefort normalesup org>
* all files: fix introspection and gtk-doc warnings.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index bb6b61c..292ac68 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -13,7 +13,7 @@ DOC_SOURCE_DIR=../gsf
SCANGOBJ_OPTIONS= --nogtkinit --type-init-func="gsf_init ()"
# Extra options to supply to gtkdoc-scan
-SCAN_OPTIONS=
+SCAN_OPTIONS=--deprecated-guards="GSF_DISABLE_DEPRECATED"
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--xml-mode --output-format=xml
diff --git a/doc/gsf-sections.txt b/doc/gsf-sections.txt
index e0bc3fd..ddd3c67 100644
--- a/doc/gsf-sections.txt
+++ b/doc/gsf-sections.txt
@@ -247,7 +247,6 @@ gsf_output_bzip_get_type
<SUBSECTION Private>
gsf_zip_dirent_get_type
gsf_zip_vdir_get_type
-gsf_zip_vdir_new
</SECTION>
<SECTION>
@@ -384,6 +383,9 @@ GsfMSOleSortingKey
<SECTION>
<TITLE>OASIS Open Document</TITLE>
<FILE>opendoc</FILE>
+gsf_odf_get_ns
+gsf_odf_get_version
+gsf_odf_get_version_string
gsf_opendoc_metadata_read
gsf_opendoc_metadata_subtree
gsf_opendoc_metadata_write
@@ -397,6 +399,10 @@ GSF_ODF_OUT
GSF_ODF_OUT_TYPE
GsfODFOutClass
gsf_odf_out_get_type
+<SUBSECTION Deprecated>
+get_gsf_odf_version
+get_gsf_odf_version_string
+get_gsf_ooo_ns
</SECTION>
<SECTION>
@@ -535,6 +541,9 @@ gsf_zip_dirent_new
gsf_zip_dirent_free
GsfZipVDir
+gsf_zip_vdir_new
+gsf_zip_vdir_free
+gsf_zip_vdir_add_child
gsf_vdir_free
gsf_vdir_new
gsf_vdir_add_child
@@ -765,9 +774,11 @@ gsf_timestamp_set_time
gsf_timestamp_copy
gsf_timestamp_free
gsf_timestamp_as_string
+gsf_timestamp_load_from_string
gsf_timestamp_from_string
gsf_timestamp_hash
gsf_timestamp_equal
+gsf_timestamp_to_value
gsf_value_set_timestamp
VAL_IS_GSF_TIMESTAMP
<SUBSECTION Standard>
@@ -795,6 +806,11 @@ gsf_doc_meta_data_store
gsf_doc_meta_data_foreach
gsf_doc_meta_data_size
gsf_doc_meta_dump
+gsf_doc_meta_data_odf_subtree
+gsf_doc_meta_data_read_from_odf
+gsf_doc_meta_data_write_to_odf
+gsf_doc_meta_data_read_from_msole
+gsf_doc_meta_data_write_to_msole
GsfDocProp
gsf_doc_prop_new
diff --git a/gsf/Makefile.am b/gsf/Makefile.am
index e68813d..e5ac649 100644
--- a/gsf/Makefile.am
+++ b/gsf/Makefile.am
@@ -7,7 +7,7 @@ include $(top_srcdir)/gsf.mk
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = \
- -v --warn-all --accept-unprefixed
+ -v --warn-all --accept-unprefixed -DGSF_DISABLE_DEPRECATED
INTROSPECTION_COMPILER_ARGS = \
--includedir=$(srcdir) \
--includedir=.
diff --git a/gsf/gsf-blob.c b/gsf/gsf-blob.c
index 4fc787c..a2e62a7 100644
--- a/gsf/gsf-blob.c
+++ b/gsf/gsf-blob.c
@@ -28,6 +28,10 @@
#include <glib/gi18n-lib.h>
#include <string.h>
+struct _GsfBlobClass {
+ GObjectClass parent_class;
+};
+
/* Private part of the GsfBlob structure */
struct _GsfBlobPrivate {
gsize size;
diff --git a/gsf/gsf-blob.h b/gsf/gsf-blob.h
index b278928..961e8c4 100644
--- a/gsf/gsf-blob.h
+++ b/gsf/gsf-blob.h
@@ -25,10 +25,6 @@ struct _GsfBlob {
GsfBlobPrivate *priv;
};
-struct _GsfBlobClass {
- GObjectClass parent_class;
-};
-
GType gsf_blob_get_type (void) G_GNUC_CONST;
/* void gsf_blob_register_type (GTypeModule *module); glib dynamic types are not thread safe */
diff --git a/gsf/gsf-clip-data.c b/gsf/gsf-clip-data.c
index 5dc4204..fa2bc04 100644
--- a/gsf/gsf-clip-data.c
+++ b/gsf/gsf-clip-data.c
@@ -25,6 +25,19 @@
#include "gsf-utils.h"
#include "gsf-impl-utils.h"
+/**
+ * GsfClipFormatWindows:
+ * @GSF_CLIP_FORMAT_WINDOWS_ERROR: error
+ * @GSF_CLIP_FORMAT_WINDOWS_UNKNOWN: unknown
+ * @GSF_CLIP_FORMAT_WINDOWS_METAFILE: CF_METAFILEPICT
+ * @GSF_CLIP_FORMAT_WINDOWS_DIB: CF_DIB
+ * @GSF_CLIP_FORMAT_WINDOWS_ENHANCED_METAFILE: CF_ENHMETAFILE
+**/
+
+struct _GsfClipDataClass {
+ GObjectClass parent_class;
+};
+
/* Private part of the GsfClipData structure */
struct _GsfClipDataPrivate {
GsfClipFormat format;
diff --git a/gsf/gsf-clip-data.h b/gsf/gsf-clip-data.h
index 5a90794..6c2927c 100644
--- a/gsf/gsf-clip-data.h
+++ b/gsf/gsf-clip-data.h
@@ -49,10 +49,6 @@ struct _GsfClipData {
GsfClipDataPrivate *priv;
};
-struct _GsfClipDataClass {
- GObjectClass parent_class;
-};
-
GType gsf_clip_data_get_type (void) G_GNUC_CONST;
/* void gsf_clip_data_register_type (GTypeModule *module); glib dynamic types are not thread safe */
diff --git a/gsf/gsf-doc-meta-data.c b/gsf/gsf-doc-meta-data.c
index b8f7635..0ab518c 100644
--- a/gsf/gsf-doc-meta-data.c
+++ b/gsf/gsf-doc-meta-data.c
@@ -305,7 +305,7 @@ gsf_doc_prop_free (GsfDocProp *prop)
g_free (prop);
}
}
-
+
}
static GsfDocProp *
diff --git a/gsf/gsf-infile-msvba.c b/gsf/gsf-infile-msvba.c
index 00f76a7..bdb9cf6 100644
--- a/gsf/gsf-infile-msvba.c
+++ b/gsf/gsf-infile-msvba.c
@@ -518,12 +518,14 @@ gsf_input_find_vba (GsfInput *input, GError **err)
g_object_unref (infile);
} else if (NULL != (infile = gsf_infile_zip_new (input, NULL))) {
- GsfInput *main_part = gsf_open_pkg_get_rel_by_type (GSF_INPUT (infile),
- "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument");
+ GsfInput *main_part = gsf_open_pkg_open_rel_by_type (GSF_INPUT (infile),
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
+ NULL);
if (NULL != main_part) {
- GsfInput *vba_stream = gsf_open_pkg_get_rel_by_type (main_part,
- "http://schemas.microsoft.com/office/2006/relationships/vbaProject");
+ GsfInput *vba_stream = gsf_open_pkg_open_rel_by_type (main_part,
+ "http://schemas.microsoft.com/office/2006/relationships/vbaProject",
+ NULL);
if (NULL != vba_stream) {
GsfInfile *ole = gsf_infile_msole_new (vba_stream, err);
if (NULL != ole) {
diff --git a/gsf/gsf-infile-zip.c b/gsf/gsf-infile-zip.c
index 936ca0b..890b25c 100644
--- a/gsf/gsf-infile-zip.c
+++ b/gsf/gsf-infile-zip.c
@@ -111,7 +111,7 @@ vdir_insert (GsfZipVDir *vdir, char const * name, GsfZipDirent *dirent)
child = vdir_child_by_name (vdir, dirname);
if (!child) {
child = gsf_zip_vdir_new (dirname, TRUE, NULL);
- gsf_vdir_add_child (vdir, child);
+ gsf_zip_vdir_add_child (vdir, child);
}
g_free (dirname);
if (*(p+1) != '\0') {
@@ -120,7 +120,7 @@ vdir_insert (GsfZipVDir *vdir, char const * name, GsfZipDirent *dirent)
}
} else { /* A simple file name */
child = gsf_zip_vdir_new (name, FALSE, dirent);
- gsf_vdir_add_child (vdir, child);
+ gsf_zip_vdir_add_child (vdir, child);
}
}
@@ -254,7 +254,7 @@ zip_info_unref (ZipInfo *info)
if (info->ref_count-- != 1)
return;
- gsf_vdir_free (info->vdir, FALSE);
+ gsf_zip_vdir_free (info->vdir, FALSE);
for (p = info->dirent_list; p != NULL; p = p->next)
gsf_zip_dirent_free ((GsfZipDirent *) p->data);
diff --git a/gsf/gsf-libxml.c b/gsf/gsf-libxml.c
index fa37d42..b8df513 100644
--- a/gsf/gsf-libxml.c
+++ b/gsf/gsf-libxml.c
@@ -260,9 +260,9 @@ gsf_xml_gvalue_from_str (GValue *res, GType t, char const *str)
default:
if (GSF_TIMESTAMP_TYPE == t) {
GsfTimestamp *ts = gsf_timestamp_new ();
- gboolean ok = gsf_timestamp_from_string (str, ts);
+ gboolean ok = gsf_timestamp_load_from_string (ts, str);
if (ok)
- gsf_value_set_timestamp (res, ts);
+ gsf_timestamp_to_value (ts, res);
gsf_timestamp_free (ts);
if (ok)
break;
@@ -531,6 +531,32 @@ gsf_xml_probe (GsfInput *input, GsfXMLProbeFunc func)
/***************************************************************************/
+/**
+ * GsfXMLInNS:
+ * @uri: URI
+ **/
+
+/**
+ * GsfXMLIn:
+ * @user_state: user data
+ * @content: the current node content
+ * @doc: #GsfXMLInDoc
+ * @node: current node (not on the stack)
+ **/
+
+/**
+ * GsfXMLInNode:
+ * @id: identifier unique in the entire tree
+ * @ns_id: namespace identifier
+ * @name: node name
+ * @parent_id: parent node identifier
+ * @start: callback for the node opening
+ * @end: callback for node end
+ * @has_content: whether the node has content
+ * @check_children_for_ns: whetehr to check namespace for children
+ * @share_children_with_parent: whether to share children with parent.
+ **/
+
typedef struct {
GsfXMLInNode pub;
/* internal state */
@@ -2027,4 +2053,3 @@ gsf_xml_out_get_output (GsfXMLOut const *xout)
g_return_val_if_fail (xout != NULL, NULL);
return xout->output;
}
-
diff --git a/gsf/gsf-msole-utils.c b/gsf/gsf-msole-utils.c
index a2201dc..2c415e2 100644
--- a/gsf/gsf-msole-utils.c
+++ b/gsf/gsf-msole-utils.c
@@ -796,7 +796,7 @@ msole_prop_parse (GsfMSOleMetaDataSection *section,
ts = gsf_timestamp_new ();
gsf_timestamp_set_time (ts, ft);
g_value_init (res, GSF_TIMESTAMP_TYPE);
- gsf_value_set_timestamp (res, ts);
+ gsf_timestamp_to_value (ts, res);
gsf_timestamp_free (ts);
ADVANCE;
@@ -1087,17 +1087,19 @@ msole_prop_cmp (gconstpointer a, gconstpointer b)
}
/**
- * gsf_msole_metadata_read:
- * @in: #GsfInput
+ * gsf_doc_meta_data_read_from_msole:
* @accum: #GsfDocMetaData
+ * @in: #GsfInput
*
* Read a stream formated as a set of MS OLE properties from @in and store the
* results in @accum.
*
+ * Since: 1.14.24
+ *
* Returns: GError which the caller must free on error.
**/
GError *
-gsf_msole_metadata_read (GsfInput *in, GsfDocMetaData *accum)
+gsf_doc_meta_data_read_from_msole (GsfDocMetaData *accum, GsfInput *in)
{
guint8 const *data;
guint16 version;
@@ -1301,6 +1303,24 @@ gsf_msole_metadata_read (GsfInput *in, GsfDocMetaData *accum)
return NULL;
}
+/**
+ * gsf_msole_metadata_read: (skip)
+ * @in: #GsfInput
+ * @accum: #GsfDocMetaData
+ *
+ * Read a stream formated as a set of MS OLE properties from @in and store the
+ * results in @accum.
+ *
+ * Deprecated: 1.14.24, use gsf_doc_meta_data_read_from_msole
+ *
+ * Returns: GError which the caller must free on error.
+ **/
+GError *
+gsf_msole_metadata_read (GsfInput *in, GsfDocMetaData *accum)
+{
+ return gsf_doc_meta_data_read_from_msole (accum, in);
+}
+
/****************************************************************************/
typedef struct {
@@ -1614,17 +1634,19 @@ cb_count_props (char const *name, GsfDocProp *prop, WritePropState *state)
}
/**
- * gsf_msole_metadata_write:
+ * gsf_doc_meta_data_write_to_msole:
* @out: #GsfOutput
* @meta_data: #GsfDocMetaData
* @doc_not_component: a kludge to differentiate DocumentSummary from Summary
*
+ * Since: 1.14.24
+ *
* Returns: %TRUE on success;
**/
gboolean
-gsf_msole_metadata_write (GsfOutput *out,
- GsfDocMetaData const *meta_data,
- gboolean doc_not_component)
+gsf_doc_meta_data_write_to_msole (GsfDocMetaData const *meta_data,
+ GsfOutput *out,
+ gboolean doc_not_component)
{
static guint8 const header[] = {
0xfe, 0xff, /* byte order */
@@ -1692,6 +1714,24 @@ err :
return success;
}
+/**
+ * gsf_msole_metadata_write: (skip)
+ * @out: #GsfOutput
+ * @meta_data: #GsfDocMetaData
+ * @doc_not_component: a kludge to differentiate DocumentSummary from Summary
+ *
+ * Deprecated: 1.14.24, use gsf_doc_meta_data_write_to_msole
+ *
+ * Returns: %TRUE on success;
+ **/
+gboolean
+gsf_msole_metadata_write (GsfOutput *out,
+ GsfDocMetaData const *meta_data,
+ gboolean doc_not_component)
+{
+ return gsf_doc_meta_data_write_to_msole (meta_data, out, doc_not_component);
+}
+
static struct {
char const *tag;
guint lid;
diff --git a/gsf/gsf-msole-utils.h b/gsf/gsf-msole-utils.h
index 9052479..ccf7e38 100644
--- a/gsf/gsf-msole-utils.h
+++ b/gsf/gsf-msole-utils.h
@@ -27,11 +27,21 @@
G_BEGIN_DECLS
+GError *gsf_doc_meta_data_read_from_msole (GsfDocMetaData *accum,
+ GsfInput *in);
+gboolean gsf_doc_meta_data_write_to_msole (GsfDocMetaData const *meta_data,
+ GsfOutput *out,
+ gboolean doc_not_component);
+
+#ifndef GSF_DISABLE_DEPRECATED
+GSF_DEPRECATED_FOR (gsf_doc_meta_data_read_from_msole)
GError *gsf_msole_metadata_read (GsfInput *in,
GsfDocMetaData *accum);
+GSF_DEPRECATED_FOR (gsf_doc_meta_data_write_to_msole)
gboolean gsf_msole_metadata_write (GsfOutput *out,
GsfDocMetaData const *meta_data,
gboolean doc_not_component);
+#endif
guint gsf_msole_lid_for_language (char const *lang);
guint gsf_msole_codepage_to_lid (int codepage);
diff --git a/gsf/gsf-open-pkg-utils.c b/gsf/gsf-open-pkg-utils.c
index 1c7e98c..d975268 100644
--- a/gsf/gsf-open-pkg-utils.c
+++ b/gsf/gsf-open-pkg-utils.c
@@ -140,7 +140,7 @@ gsf_open_pkg_rel_get_target (GsfOpenPkgRel const *rel)
/**
* gsf_open_pkg_rel_get_type:
* @rel: #GsfOpenPkgRel
- *
+ *
* Returns: const pointer to @rel's type.
**/
char const *
@@ -258,7 +258,7 @@ gsf_open_pkg_open_rel (GsfInput *opkg, GsfOpenPkgRel const *rel,
* New in 1.14.6
*
* Finds _a_ relation of @opkg with @type (no order is guaranteed)
- *
+ *
* NOTE: skipping because gsf_open_pkg_rel_get_type() does not return a GType.
*
* Returns: (transfer none): A #GsfOpenPkgRel or %NULL
@@ -278,7 +278,7 @@ gsf_open_pkg_lookup_rel_by_type (GsfInput *opkg, char const *type)
* New in 1.14.6
*
* Finds @opkg's relation with @id
- *
+ *
* NOTE: skipping because gsf_open_pkg_rel_get_type() does not return a GType.
*
* Returns: (transfer none): A #GsfOpenPkgRel or %NULL
diff --git a/gsf/gsf-open-pkg-utils.h b/gsf/gsf-open-pkg-utils.h
index a96658c..e2d1518 100644
--- a/gsf/gsf-open-pkg-utils.h
+++ b/gsf/gsf-open-pkg-utils.h
@@ -55,8 +55,12 @@ GError *gsf_open_pkg_parse_rel_by_id (GsfXMLIn *xin, char const *id,
GsfXMLInNS const *ns);
/* DEPRECATED in 1.14.6 */
+#ifndef GSF_DISABLE_DEPRECATED
+GSF_DEPRECATED_FOR (gsf_open_pkg_open_rel_by_id)
GsfInput *gsf_open_pkg_get_rel_by_type (GsfInput *opkg, char const *type);
+GSF_DEPRECATED_FOR (gsf_open_pkg_open_rel_by_id)
GsfInput *gsf_open_pkg_get_rel_by_id (GsfInput *opkg, char const *id);
+#endif
typedef struct _GsfOutfileOpenPkg GsfOutfileOpenPkg;
diff --git a/gsf/gsf-opendoc-utils.c b/gsf/gsf-opendoc-utils.c
index 97316c6..86580d8 100644
--- a/gsf/gsf-opendoc-utils.c
+++ b/gsf/gsf-opendoc-utils.c
@@ -44,19 +44,61 @@ typedef struct {
GType typ;
} GsfOOMetaIn;
-G_MODULE_EXPORT char const *
+/**
+ * gsf_odf_get_version_string:
+ * Gives the ODF version used by libgsf when writing Open Document files.
+ *
+ * Since: 1.14.24
+ *
+ * Returns: the ODF version as a string: "1.2".
+ **/
+char const *
+gsf_odf_get_version_string (void)
+{
+ return "1.2";
+}
+
+/**
+ * get_gsf_odf_version_string: (skip)
+ * Gives the ODF version used by libgsf when writing Open Document files.
+ *
+ * Deprecated: 1.14.24, use gsf_odf_get_version_string
+ *
+ * Returns: the ODF version as a string: "1.2".
+ **/
+char const *
get_gsf_odf_version_string (void)
{
return "1.2";
}
-G_MODULE_EXPORT short
-get_gsf_odf_version (void)
+/**
+ * gsf_odf_get_version:
+ * Gives the ODF version used by libgsf when writing Open Document files.
+ *
+ * Since: 1.14.24
+ *
+ * Returns: the ODF version: 102.
+ **/
+short
+gsf_odf_get_version (void)
{
return 102;
}
-
+/**
+ * get_gsf_odf_version: (skip)
+ * Gives the ODF version used by libgsf when writing Open Document files.
+ *
+ * Deprecated: 1.14.24, use gsf_odf_get_version
+ *
+ * Returns: the ODF version: 102.
+ **/
+short
+get_gsf_odf_version (void)
+{
+ return 102;
+}
/* Generated based on:
* http://www.oasis-open.org/committees/download.php/12572/OpenDocument-v1.0-os.pdf */
@@ -146,7 +188,28 @@ GsfXMLInNS gsf_ooo_ns[] = {
{ NULL, 0 }
};
-G_MODULE_EXPORT GsfXMLInNS *get_gsf_ooo_ns (void)
+/**
+ * gsf_odf_get_ns:
+ *
+ * Since: 1.14.24
+ *
+ * Returns: the used ODF namespace
+ **/
+GsfXMLInNS const *
+gsf_odf_get_ns (void)
+{
+ return gsf_ooo_ns;
+}
+
+/**
+ * get_gsf_ooo_ns: (skip)
+ *
+ * Deprecated: 1.14.24, use gsf_odf_get_ns
+ *
+ * Returns: the used ODF namespace
+ **/
+GsfXMLInNS *
+get_gsf_ooo_ns (void)
{
return gsf_ooo_ns;
}
@@ -362,14 +425,16 @@ gsf_opendoc_metadata_subtree_free (G_GNUC_UNUSED GsfXMLIn *xin, gpointer old_sta
static GsfXMLInDoc *doc_subtree = NULL;
/**
- * gsf_opendoc_metadata_subtree:
- * @doc: #GsfXMLInDoc
+ * gsf_doc_meta_data_odf_subtree:
* @md: #GsfDocMetaData
+ * @doc: #GsfXMLInDoc
*
* Extend @xin so that it can parse a subtree in OpenDoc metadata format
+ *
+ * Since: 1.14.24
**/
void
-gsf_opendoc_metadata_subtree (GsfXMLIn *xin, GsfDocMetaData *md)
+gsf_doc_meta_data_odf_subtree (GsfDocMetaData *md, GsfXMLIn *doc)
{
GsfOOMetaIn *state = NULL;
@@ -382,7 +447,22 @@ gsf_opendoc_metadata_subtree (GsfXMLIn *xin, GsfDocMetaData *md)
state->md = md;
state->typ = G_TYPE_NONE;
g_object_ref (md);
- gsf_xml_in_push_state (xin, doc_subtree, state, gsf_opendoc_metadata_subtree_free, NULL);
+ gsf_xml_in_push_state (doc, doc_subtree, state, gsf_opendoc_metadata_subtree_free, NULL);
+}
+
+/**
+ * gsf_opendoc_metadata_subtree: (skip)
+ * @doc: #GsfXMLInDoc
+ * @md: #GsfDocMetaData
+ *
+ * Deprecated: 1.14.24, use gsf_doc_meta_data_odf_subtree
+ *
+ * Extend @xin so that it can parse a subtree in OpenDoc metadata format
+ **/
+void
+gsf_opendoc_metadata_subtree (GsfXMLIn *xin, GsfDocMetaData *md)
+{
+ gsf_doc_meta_data_odf_subtree (md, xin);
}
/**
@@ -408,17 +488,19 @@ static GsfXMLInNode const gsf_opendoc_meta_dtd[] = {
};
/**
- * gsf_opendoc_metadata_read:
- * @input: #GsfInput
+ * gsf_doc_meta_data_read_from_odf:
* @md: #GsfDocMetaData
+ * @input: #GsfInput
*
* Read an OpenDocument metadata stream from @input and store the properties
* into @md. Overwrite any existing properties with the same id.
*
+ * Since: 1.14.24
+ *
* Returns: a GError if there is a problem.
**/
-GError *
-gsf_opendoc_metadata_read (GsfInput *input, GsfDocMetaData *md)
+GError *
+gsf_doc_meta_data_read_from_odf (GsfDocMetaData *md, GsfInput *input)
{
GsfXMLInDoc *doc;
GsfOOMetaIn state;
@@ -444,6 +526,23 @@ gsf_opendoc_metadata_read (GsfInput *input, GsfDocMetaData *md)
return state.err;
}
+/**
+ * gsf_opendoc_metadata_read: (skip)
+ * @input: #GsfInput
+ * @md: #GsfDocMetaData
+ *
+ * Read an OpenDocument metadata stream from @input and store the properties
+ * into @md. Overwrite any existing properties with the same id.
+ *
+ * Deprecated: 1.14.24, use gsf_doc_meta_data_read_from_odf
+ *
+ * Returns: a GError if there is a problem.
+ **/
+GError *
+gsf_opendoc_metadata_read (GsfInput *input, GsfDocMetaData *md)
+{
+ return gsf_doc_meta_data_read_from_odf (md, input);
+}
static char const *
od_map_prop_name (char const *name)
@@ -638,8 +737,17 @@ meta_write_props (char const *prop_name, GsfDocProp *prop, GsfXMLOut *output)
gsf_xml_out_end_element (output);
}
+/**
+ * gsf_doc_meta_data_write_to_odf:
+ * @md: #GsfDocMetaData
+ * @output: a pointer to a #GsfOutput.
+ *
+ * Since: 1.14.24
+ *
+ * Returns: TRUE if no error occured.
+ **/
gboolean
-gsf_opendoc_metadata_write (gpointer output, GsfDocMetaData const *md)
+gsf_doc_meta_data_write_to_odf (GsfDocMetaData const *md, gpointer output)
{
char *ver_str;
GsfXMLOut *xout;
@@ -655,7 +763,7 @@ gsf_opendoc_metadata_write (gpointer output, GsfDocMetaData const *md)
ver_str = oout
? gsf_odf_out_get_version_string (oout)
- : g_strdup (get_gsf_odf_version_string ());
+ : g_strdup (gsf_odf_get_version_string ());
gsf_xml_out_start_element (xout, OFFICE "document-meta");
gsf_xml_out_add_cstr_unchecked (xout, "xmlns:office",
@@ -680,6 +788,21 @@ gsf_opendoc_metadata_write (gpointer output, GsfDocMetaData const *md)
return TRUE;
}
+/**
+ * gsf_opendoc_metadata_write: (skip)
+ * @output: a pointer to a #GsfOutput.
+ * @md: #GsfDocMetaData
+ *
+ * Deprecated: 1.14.24, use gsf_doc_meta_data_write_to_odf
+ *
+ * Returns: TRUE if no error occured.
+ **/
+gboolean
+gsf_opendoc_metadata_write (gpointer output, GsfDocMetaData const *md)
+{
+ return gsf_doc_meta_data_write_to_odf (md, output);
+}
+
/****************************************************************************/
typedef struct _GsfODFOutPrivate {
diff --git a/gsf/gsf-opendoc-utils.h b/gsf/gsf-opendoc-utils.h
index fe29190..4d51241 100644
--- a/gsf/gsf-opendoc-utils.h
+++ b/gsf/gsf-opendoc-utils.h
@@ -128,16 +128,31 @@ enum {
OO_NS_CHART_OOO
};
-G_MODULE_EXPORT GsfXMLInNS *get_gsf_ooo_ns (void);
-G_MODULE_EXPORT char const *get_gsf_odf_version_string (void);
-G_MODULE_EXPORT short get_gsf_odf_version (void);
+GsfXMLInNS const *gsf_odf_get_ns (void);
+char const *gsf_odf_get_version_string (void);
+short gsf_odf_get_version (void);
+
+GError *gsf_doc_meta_data_read_from_odf (GsfDocMetaData *md, GsfInput *input);
+void gsf_doc_meta_data_odf_subtree (GsfDocMetaData *md, GsfXMLIn *doc);
+gboolean gsf_doc_meta_data_write_to_odf (GsfDocMetaData const *md, gpointer output);
-extern GsfXMLInNS gsf_ooo_ns[]; /* use get_gsf_ooo_ns instead */
/* For 1.15.x s/opendoc/odf/ and s/ooo/odf/ */
+#ifndef GSF_DISABLE_DEPRECATED
+extern GsfXMLInNS gsf_ooo_ns[]; /* use get_gsf_ooo_ns instead */
+GSF_DEPRECATED_FOR (gsf_odf_get_ns)
+GsfXMLInNS *get_gsf_ooo_ns (void);
+GSF_DEPRECATED_FOR (gsf_odf_get_version_string)
+char const *get_gsf_odf_version_string (void);
+GSF_DEPRECATED_FOR (gsf_odf_get_version)
+short get_gsf_odf_version (void);
+GSF_DEPRECATED_FOR (gsf_doc_meta_data_read_from_odf)
GError *gsf_opendoc_metadata_read (GsfInput *input, GsfDocMetaData *md);
+GSF_DEPRECATED_FOR (gsf_doc_meta_data_odf_subtree)
void gsf_opendoc_metadata_subtree (GsfXMLIn *doc, GsfDocMetaData *md);
+GSF_DEPRECATED_FOR (gsf_doc_meta_data_write_to_odf)
gboolean gsf_opendoc_metadata_write (gpointer output, GsfDocMetaData const *md);
+#endif
G_END_DECLS
diff --git a/gsf/gsf-outfile-zip.c b/gsf/gsf-outfile-zip.c
index 90defb8..e2760d5 100644
--- a/gsf/gsf-outfile-zip.c
+++ b/gsf/gsf-outfile-zip.c
@@ -108,7 +108,7 @@ gsf_outfile_zip_finalize (GObject *obj)
g_free (zip->buf);
if (zip == zip->root)
- gsf_vdir_free (zip->vdir, TRUE); /* Frees vdirs recursively */
+ gsf_zip_vdir_free (zip->vdir, TRUE); /* Frees vdirs recursively */
parent_class->finalize (obj);
}
@@ -600,7 +600,7 @@ gsf_outfile_zip_new_child (GsfOutfile *parent,
g_free (display_name);
gsf_output_set_container (GSF_OUTPUT (child), parent);
- gsf_vdir_add_child (zip_parent->vdir, child->vdir);
+ gsf_zip_vdir_add_child (zip_parent->vdir, child->vdir);
root_register_child (zip_parent->root, child);
return GSF_OUTPUT (child);
diff --git a/gsf/gsf-timestamp.c b/gsf/gsf-timestamp.c
index da9fe13..9d45f9a 100644
--- a/gsf/gsf-timestamp.c
+++ b/gsf/gsf-timestamp.c
@@ -118,21 +118,22 @@ static time_t gmt_to_local_win32(void)
}
#endif
+
/**
- * gsf_timestamp_from_string:
- * @spec: The string to parse
+ * gsf_timestamp_load_from_string:
* @stamp: #GsfTimestamp
+ * @spec: The string to parse
*
* Very simple parser for time stamps. Currently requires a format of
* 'YYYY-MM-DDThh:mm:ss'
* and does no bounds checking.
*
- * Since: 1.14.12
+ * Since: 1.14.24
*
* Returns: %TRUE on success
**/
int
-gsf_timestamp_from_string (char const *spec, GsfTimestamp *stamp)
+gsf_timestamp_load_from_string (GsfTimestamp *stamp, char const *spec)
{
int year, month, day, hour, minute, second;
GDateTime *dt;
@@ -153,6 +154,25 @@ gsf_timestamp_from_string (char const *spec, GsfTimestamp *stamp)
}
/**
+ * gsf_timestamp_from_string: (skip)
+ * @spec: The string to parse
+ * @stamp: #GsfTimestamp
+ *
+ * Very simple parser for time stamps. Currently requires a format of
+ * 'YYYY-MM-DDThh:mm:ss'
+ * and does no bounds checking.
+ *
+ * Deprecated: 1.14.24, use gsf_timestamp_load_from_string
+ *
+ * Returns: %TRUE on success
+ **/
+int
+gsf_timestamp_from_string (char const *spec, GsfTimestamp *stamp)
+{
+ return gsf_timestamp_load_from_string (stamp, spec);
+}
+
+/**
* gsf_timestamp_parse: (skip)
* @spec: The string to parse
* @stamp: #GsfTimestamp
@@ -161,14 +181,14 @@ gsf_timestamp_from_string (char const *spec, GsfTimestamp *stamp)
* 'YYYY-MM-DDThh:mm:ss'
* and does no bounds checking.
*
- * Deprecated: Use gsf_timestamp_from_string
+ * Deprecated: Use gsf_timestamp_load_from_string
*
* Returns: %TRUE on success
**/
int
gsf_timestamp_parse (char const *spec, GsfTimestamp *stamp)
{
- return gsf_timestamp_from_string (spec, stamp);
+ return gsf_timestamp_load_from_string (stamp, spec);
}
/**
@@ -225,6 +245,28 @@ gsf_timestamp_equal (GsfTimestamp const *a, GsfTimestamp const *b)
return a->timet == b->timet;
}
+/**
+ * gsf_timestamp_to_value:
+ * @stamp: #GsfTimestamp
+ * @value: #GValue
+ *
+ * Calls g_value_set_box (value, stamp);
+ *
+ * Since: 1.14.24
+ **/
+void
+gsf_timestamp_to_value (GsfTimestamp const *stamp, GValue *value)
+{
+ g_value_set_boxed (value, stamp);
+}
+
+/**
+ * gsf_value_set_timestamp: (skip)
+ * @value: #GValue
+ * @stamp: #GsfTimestamp
+ *
+ * Deprecated: 1.14.24, use gsf_timestamp_to_value.
+ **/
void
gsf_value_set_timestamp (GValue *value, GsfTimestamp const *stamp)
{
diff --git a/gsf/gsf-timestamp.h b/gsf/gsf-timestamp.h
index 060e0e6..d3cf006 100644
--- a/gsf/gsf-timestamp.h
+++ b/gsf/gsf-timestamp.h
@@ -46,7 +46,7 @@ GsfTimestamp *gsf_timestamp_new (void);
GsfTimestamp *gsf_timestamp_copy (GsfTimestamp const *stamp);
void gsf_timestamp_free (GsfTimestamp *stamp);
-int gsf_timestamp_from_string (char const *spec, GsfTimestamp *stamp);
+int gsf_timestamp_load_from_string (GsfTimestamp *stamp, char const *spec);
char *gsf_timestamp_as_string (GsfTimestamp const *stamp);
guint gsf_timestamp_hash (GsfTimestamp const *stamp);
gboolean gsf_timestamp_equal (GsfTimestamp const *a,
@@ -54,10 +54,17 @@ gboolean gsf_timestamp_equal (GsfTimestamp const *a,
void gsf_timestamp_set_time (GsfTimestamp *stamp, guint64 t);
-void gsf_value_set_timestamp (GValue *value, GsfTimestamp const *stamp);
+void gsf_timestamp_to_value (GsfTimestamp const *stamp, GValue *value);
/* Deprecated */
+#ifndef GSF_DISABLE_DEPRECATED
+GSF_DEPRECATED_FOR(gsf_timestamp_to_value)
+void gsf_value_set_timestamp (GValue *value, GsfTimestamp const *stamp);
+GSF_DEPRECATED_FOR(gsf_timestamp_load_from_string)
+int gsf_timestamp_from_string (char const *spec, GsfTimestamp *stamp);
+GSF_DEPRECATED_FOR(gsf_timestamp_load_from_string)
int gsf_timestamp_parse (char const *spec, GsfTimestamp *stamp);
+#endif
G_END_DECLS
diff --git a/gsf/gsf-utils.c b/gsf/gsf-utils.c
index 3a69ca6..71564ed 100644
--- a/gsf/gsf-utils.c
+++ b/gsf/gsf-utils.c
@@ -256,6 +256,12 @@ gsf_init_dynamic (GTypeModule *module)
REGISTER (gsf_clip_data);
REGISTER (gsf_doc_meta_data);
REGISTER (gsf_docprop_vector);
+
+#ifndef _GSF_GTYPE_THREADING_FIXED
+ /* add a test to avoid a set but unused variable warning */
+ if (t == 0)
+ g_warning ("Failed to register objects types");
+#endif
}
/**
diff --git a/gsf/gsf-zip-impl.h b/gsf/gsf-zip-impl.h
index 3ffbd34..6210bd5 100644
--- a/gsf/gsf-zip-impl.h
+++ b/gsf/gsf-zip-impl.h
@@ -112,10 +112,17 @@ void gsf_zip_dirent_free (GsfZipDirent *dirent);
GType gsf_zip_vdir_get_type (void);
GsfZipVDir *gsf_zip_vdir_new (char const *name, gboolean is_directory,
GsfZipDirent *dirent);
+void gsf_zip_vdir_free (GsfZipVDir *vdir, gboolean free_dirent);
+void gsf_zip_vdir_add_child (GsfZipVDir *vdir, GsfZipVDir *child);
+#ifndef GSF_DISABLE_DEPRECATED
+GSF_DEPRECATED_FOR(gsf_zip_vdir_new)
GsfZipVDir *gsf_vdir_new (char const *name, gboolean is_directory,
GsfZipDirent *dirent);
+GSF_DEPRECATED_FOR(gsf_zip_vdir_free)
void gsf_vdir_free (GsfZipVDir *vdir, gboolean free_dirent);
+GSF_DEPRECATED_FOR(gsf_zip_vdir_add_child)
void gsf_vdir_add_child (GsfZipVDir *vdir, GsfZipVDir *child);
+#endif
G_END_DECLS
diff --git a/gsf/gsf-zip-utils.c b/gsf/gsf-zip-utils.c
index 1334732..1a772cf 100644
--- a/gsf/gsf-zip-utils.c
+++ b/gsf/gsf-zip-utils.c
@@ -80,7 +80,9 @@ gsf_zip_dirent_get_type (void)
* @name:
* @is_directory:
* @dirent:
- *
+ *
+ * Since: 1.14.24
+ *
* Returns: the newly created #GsfZipVDir.
*/
GsfZipVDir *
@@ -113,13 +115,19 @@ gsf_vdir_new (char const *name, gboolean is_directory, GsfZipDirent *dirent)
void
gsf_vdir_free (GsfZipVDir *vdir, gboolean free_dirent)
{
+ gsf_zip_vdir_free (vdir, free_dirent);
+}
+
+void
+gsf_zip_vdir_free (GsfZipVDir *vdir, gboolean free_dirent)
+{
GSList *l;
if (!vdir)
return;
for (l = vdir->children; l; l = l->next)
- gsf_vdir_free ((GsfZipVDir *)l->data, free_dirent);
+ gsf_zip_vdir_free ((GsfZipVDir *)l->data, free_dirent);
g_slist_free (vdir->children);
g_free (vdir->name);
@@ -129,7 +137,7 @@ gsf_vdir_free (GsfZipVDir *vdir, gboolean free_dirent)
}
static GsfZipVDir *
-gsf_vdir_copy (GsfZipVDir *vdir)
+gsf_zip_vdir_copy (GsfZipVDir *vdir)
{
GsfZipVDir *res = g_new0 (GsfZipVDir, 1);
GSList *l;
@@ -141,14 +149,14 @@ gsf_vdir_copy (GsfZipVDir *vdir)
if (vdir->dirent)
res->dirent = gsf_zip_dirent_copy (vdir->dirent);
for (l = vdir->children; l; l = l->next)
- gsf_vdir_add_child (res, gsf_vdir_copy ((GsfZipVDir *)l->data));
+ gsf_zip_vdir_add_child (res, gsf_zip_vdir_copy ((GsfZipVDir *)l->data));
return res;
}
static void
-gsf_vdir_destroy (GsfZipVDir *vdir)
+gsf_zip_vdir_destroy (GsfZipVDir *vdir)
{
- gsf_vdir_free (vdir, TRUE);
+ gsf_zip_vdir_free (vdir, TRUE);
}
GType
@@ -159,8 +167,8 @@ gsf_zip_vdir_get_type (void)
if (type == 0)
type = g_boxed_type_register_static
("GsfZipVDir",
- (GBoxedCopyFunc) gsf_vdir_copy,
- (GBoxedFreeFunc) gsf_vdir_destroy);
+ (GBoxedCopyFunc) gsf_zip_vdir_copy,
+ (GBoxedFreeFunc) gsf_zip_vdir_destroy);
return type;
}
@@ -168,6 +176,12 @@ gsf_zip_vdir_get_type (void)
void
gsf_vdir_add_child (GsfZipVDir *vdir, GsfZipVDir *child)
{
+ gsf_zip_vdir_add_child(vdir, child);
+}
+
+void
+gsf_zip_vdir_add_child (GsfZipVDir *vdir, GsfZipVDir *child)
+{
GSList *tail = g_slist_append (NULL, child);
if (vdir->children)
vdir->last_child->next = tail;
diff --git a/gsf/gsf.h b/gsf/gsf.h
index 3a19305..ffe7697 100644
--- a/gsf/gsf.h
+++ b/gsf/gsf.h
@@ -99,6 +99,12 @@ typedef gint64 gsf_off_t;
*/
#define GSF_OFF_T_FORMAT G_GINT64_FORMAT
+#if GLIB_CHECK_VERSION(2,32,0)
+#define GSF_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
+#else
+#define GSF_DEPRECATED_FOR(f)
+#endif
+
G_END_DECLS
#endif /* GSF_H */
diff --git a/thumbnailer/main.c b/thumbnailer/main.c
index 4b32753..6176ae3 100644
--- a/thumbnailer/main.c
+++ b/thumbnailer/main.c
@@ -179,7 +179,7 @@ msole_thumbnail (GsfInfile *infile, const char *out_filename, int thumb_size)
show_error_string_and_exit ("Could not find the SummaryInformation stream");
meta_data = gsf_doc_meta_data_new ();
- error = gsf_msole_metadata_read (summary_stream, meta_data);
+ error = gsf_doc_meta_data_read_from_msole (meta_data, summary_stream);
if (error)
show_error_and_exit (error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]