* exiv2-iptc*: iptc support, Patch contributed by Mike Gemuende

svn path=/trunk/exiv2-sharp/; revision=129564
This commit is contained in:
Stephane Delcroix 2009-03-17 11:19:31 +00:00
Родитель adeff39430
Коммит fd82d051d6
14 изменённых файлов: 1223 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,7 @@
2009-03-17 Stephane Delcroix <sdelcroix@novell.com>
* exiv2-iptc*: iptc support, Patch contributed by Mike Gemuende
2009-01-07 Stephane Delcroix <sdelcroix@novell.com>
* exiv-exifdata.h|cpp: _erase_range (), as added in 0.18

Просмотреть файл

@ -34,6 +34,18 @@ libexiv2glue_la_SOURCES = \
exiv2-image-private.h \
exiv2-imagefactory.cpp \
exiv2-imagefactory.h \
exiv2-iptcdata.cpp \
exiv2-iptcdata.h \
exiv2-iptcdata-private.h \
exiv2-iptcdatum.cpp \
exiv2-iptcdatum.h \
exiv2-iptcdatum-iterator.cpp \
exiv2-iptcdatum-iterator.h \
exiv2-iptcdatum-iterator-private.h \
exiv2-iptcdatum-private.h \
exiv2-iptckey.cpp \
exiv2-iptckey.h \
exiv2-iptckey-private.h \
exiv2-key.cpp \
exiv2-key.h \
exiv2-nikon1makernote.cpp \

Просмотреть файл

@ -0,0 +1,47 @@
/*
* exiv2-iptcdata-private.h
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __EXIV2_IPTCDATA_PRIVATE_H__
#define __EXIV2_IPTCDATA_PRIVATE_H__
#include "exiv2-iptcdata.h"
#include <exiv2/iptc.hpp>
G_BEGIN_DECLS
struct _Exiv2IptcDataPrivate
{
Exiv2::IptcData* data;
};
G_END_DECLS
#endif /* __EXIV2_IPTCDATA_PRIVATE_H__ */

151
glue/exiv2-iptcdata.cpp Normal file
Просмотреть файл

@ -0,0 +1,151 @@
/*
* exiv2-iptcdata.cpp
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "exiv2-iptcdata.h"
#include "exiv2-iptcdata-private.h"
#include "exiv2-iptcdatum-private.h"
#include "exiv2-iptcdatum-iterator-private.h"
#include "exiv2-iptckey-private.h"
#include <exiv2/iptc.hpp>
G_BEGIN_DECLS
G_DEFINE_TYPE (Exiv2IptcData, exiv2_iptcdata, G_TYPE_OBJECT);
static void exiv2_iptcdata_finalize (GObject *gobject);
static void
exiv2_iptcdata_init (Exiv2IptcData *self)
{
Exiv2IptcDataPrivate *priv;
self->priv = priv = EXIV2_IPTCDATA_GET_PRIVATE (self);
}
static void
exiv2_iptcdata_class_init (Exiv2IptcDataClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = exiv2_iptcdata_finalize;
g_type_class_add_private (klass, sizeof (Exiv2IptcDataPrivate));
}
static void
exiv2_iptcdata_finalize (GObject *gobject)
{
Exiv2IptcData *self = EXIV2_IPTCDATA (gobject);
if (self->priv->data) {
delete self->priv->data;
self->priv->data = NULL;
}
G_OBJECT_CLASS (exiv2_iptcdata_parent_class)->finalize (gobject);
}
Exiv2IptcData*
exiv2_iptcdata_new ()
{
Exiv2IptcData *iptcdata;
iptcdata = EXIV2_IPTCDATA (g_object_new (EXIV2_TYPE_IPTCDATA, NULL));
iptcdata->priv->data = new Exiv2::IptcData ();
return iptcdata;
}
long
exiv2_iptcdata_get_count (Exiv2IptcData *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATA (self), -1);
return self->priv->data->count ();
}
gboolean
exiv2_iptcdata_get_isEmpty (Exiv2IptcData *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATA (self), true);
return self->priv->data->empty ();
}
Exiv2IptcDatumIterator*
exiv2_iptcdata_begin (Exiv2IptcData *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATA (self), NULL);
Exiv2IptcDatumIterator *datum;
datum = EXIV2_IPTCDATUMITERATOR (g_object_new (EXIV2_TYPE_IPTCDATUMITERATOR, NULL));
datum->priv->iterator = self->priv->data->begin ();
return datum;
}
Exiv2IptcDatumIterator*
exiv2_iptcdata_end (Exiv2IptcData *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATA (self), NULL);
Exiv2IptcDatumIterator *datum;
datum = EXIV2_IPTCDATUMITERATOR (g_object_new (EXIV2_TYPE_IPTCDATUMITERATOR, NULL));
datum->priv->iterator = self->priv->data->end ();
return datum;
}
Exiv2IptcDatum*
exiv2_iptcdata_get_this (Exiv2IptcData *self, const char *key)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATA (self), NULL);
Exiv2IptcDatum *datum;
datum = EXIV2_IPTCDATUM (g_object_new (EXIV2_TYPE_IPTCDATUM, NULL));
Exiv2::IptcData* data = self->priv->data;
Exiv2::Iptcdatum* edatum = &((*data) [key]);
datum->priv->datum = edatum;
return datum;
}
Exiv2IptcDatum*
exiv2_iptcdata_find_key (Exiv2IptcData *self, Exiv2IptcKey* key)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATA (self), NULL);
Exiv2IptcDatumIterator *iterator;
iterator = EXIV2_IPTCDATUMITERATOR (g_object_new (EXIV2_TYPE_IPTCDATUMITERATOR, NULL));
iterator->priv->iterator = self->priv->data->findKey (*(key->priv->key));
return EXIV2_IPTCDATUM(iterator);
}
void
exiv2_iptcdata_erase (Exiv2IptcData *self, Exiv2IptcKey* key)
{
g_return_if_fail (EXIV2_IS_IPTCDATA (self));
self->priv->data->erase (self->priv->data->findKey (*(key->priv->key)));
}
G_END_DECLS

85
glue/exiv2-iptcdata.h Normal file
Просмотреть файл

@ -0,0 +1,85 @@
/*
* exiv2-iptcdata.h
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __EXIV2_IPTCDATA_H__
#define __EXIV2_IPTCDATA_H__
#include <glib-object.h>
#include "exiv2-iptcdatum-iterator.h"
#include "exiv2-iptckey.h"
G_BEGIN_DECLS
#define EXIV2_TYPE_IPTCDATA (exiv2_iptcdata_get_type ())
#define EXIV2_IPTCDATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXIV2_TYPE_IPTCDATA, Exiv2IptcData))
#define EXIV2_IS_IPTCDATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXIV2_TYPE_IPTCDATA))
#define EXIV2_IPTCDATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXIV2_TYPE_IPTCDATA, Exiv2IptcDataClass))
#define EXIV2_IS_IPTCDATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXIV2_TYPE_IPTCDATA))
#define EXIV2_IPTCDATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXIV2_TYPE_IPTCDATA, Exiv2IptcDataClass))
#define EXIV2_IPTCDATA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EXIV2_TYPE_IPTCDATA, Exiv2IptcDataPrivate))
typedef struct _Exiv2IptcData Exiv2IptcData;
typedef struct _Exiv2IptcDataClass Exiv2IptcDataClass;
typedef struct _Exiv2IptcDataPrivate Exiv2IptcDataPrivate;
struct _Exiv2IptcData
{
GObject parent_instance;
/*< private >*/
Exiv2IptcDataPrivate *priv;
};
struct _Exiv2IptcDataClass
{
GObjectClass parent_class;
};
GType exiv2_iptcdata_get_type (void);
Exiv2IptcData* exiv2_iptcdata_new ();
long exiv2_iptcdata_get_count (Exiv2IptcData *self);
gboolean exiv2_iptcdata_get_isEmpty (Exiv2IptcData *self);
Exiv2IptcDatumIterator* exiv2_iptcdata_begin (Exiv2IptcData *self);
Exiv2IptcDatumIterator* exiv2_iptcdata_end (Exiv2IptcData *self);
Exiv2IptcDatum* exiv2_iptcdata_get_this (Exiv2IptcData *self, const char* key);
Exiv2IptcDatum* exiv2_iptcdata_find_key (Exiv2IptcData *self, Exiv2IptcKey* key);
void exiv2_iptcdata_erase (Exiv2IptcData *self, Exiv2IptcKey* key);
G_END_DECLS
#endif /* __EXIV2_IPTCDATA_H__ */

Просмотреть файл

@ -0,0 +1,47 @@
/*
* exiv2-iptcdatum-iterator-private.h
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __EXIV2_IPTCDATUMITERATOR_PRIVATE_H__
#define __EXIV2_IPTCDATUMITERATOR_PRIVATE_H__
#include "exiv2-iptcdatum-iterator.h"
#include <exiv2/iptc.hpp>
G_BEGIN_DECLS
struct _Exiv2IptcDatumIteratorPrivate
{
Exiv2::IptcMetadata::iterator iterator;
};
G_END_DECLS
#endif /* __EXIV2_IPTCDATUMITERATOR_PRIVATE_H__ */

Просмотреть файл

@ -0,0 +1,125 @@
/*
* exiv2-iptcdatum-iterator.cpp
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "exiv2-iptcdatum-iterator.h"
#include "exiv2-iptcdatum-iterator-private.h"
#include <exiv2/exif.hpp>
G_BEGIN_DECLS
G_DEFINE_TYPE (Exiv2IptcDatumIterator, exiv2_iptcdatumiterator, EXIV2_TYPE_IPTCDATUM);
const char* exiv2_iptcdatumiterator_real_get_key (Exiv2IptcDatum *self);
guint16 exiv2_iptcdatumiterator_real_get_tag (Exiv2IptcDatum *self);
const char* exiv2_iptcdatumiterator_real_get_typename (Exiv2IptcDatum *self);
glong exiv2_iptcdatumiterator_real_get_count (Exiv2IptcDatum *self);
const char* exiv2_iptcdatumiterator_real_toString (Exiv2IptcDatum *self);
static void
exiv2_iptcdatumiterator_init (Exiv2IptcDatumIterator *self)
{
Exiv2IptcDatumIteratorPrivate *priv;
self->priv = priv = EXIV2_IPTCDATUMITERATOR_GET_PRIVATE (self);
}
static void
exiv2_iptcdatumiterator_class_init (Exiv2IptcDatumIteratorClass *klass)
{
Exiv2IptcDatumClass *iptcdatum_class = EXIV2_IPTCDATUM_CLASS (klass);
iptcdatum_class->get_key = exiv2_iptcdatumiterator_real_get_key;
iptcdatum_class->get_tag = exiv2_iptcdatumiterator_real_get_tag;
iptcdatum_class->get_typename = exiv2_iptcdatumiterator_real_get_typename;
iptcdatum_class->get_count = exiv2_iptcdatumiterator_real_get_count;
iptcdatum_class->toString = exiv2_iptcdatumiterator_real_toString;
g_type_class_add_private (klass, sizeof (Exiv2IptcDatumIteratorPrivate));
}
void
exiv2_iptcdatumiterator_next (Exiv2IptcDatumIterator *self)
{
g_return_if_fail (EXIV2_IS_IPTCDATUMITERATOR (self));
self->priv->iterator = self->priv->iterator + 1;
}
gboolean
exiv2_iptcdatumiterator_equals (Exiv2IptcDatumIterator *self, Exiv2IptcDatumIterator *other)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUMITERATOR (self), false);
g_return_val_if_fail (EXIV2_IS_IPTCDATUMITERATOR (other), false);
return self->priv->iterator == other->priv->iterator;
}
const char*
exiv2_iptcdatumiterator_real_get_key (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUMITERATOR (self), NULL);
Exiv2IptcDatumIterator* iterator = EXIV2_IPTCDATUMITERATOR (self);
return iterator->priv->iterator->key ().c_str ();
}
guint16
exiv2_iptcdatumiterator_real_get_tag (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUMITERATOR (self), -1);
Exiv2IptcDatumIterator* iterator = EXIV2_IPTCDATUMITERATOR (self);
return iterator->priv->iterator->tag ();
}
const char*
exiv2_iptcdatumiterator_real_get_typename (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUMITERATOR (self), NULL);
Exiv2IptcDatumIterator* iterator = EXIV2_IPTCDATUMITERATOR (self);
return iterator->priv->iterator->typeName ();
}
glong
exiv2_iptcdatumiterator_real_get_count (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUMITERATOR (self), -1);
Exiv2IptcDatumIterator* iterator = EXIV2_IPTCDATUMITERATOR (self);
return iterator->priv->iterator->count ();
}
const char*
exiv2_iptcdatumiterator_real_toString (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUMITERATOR (self), NULL);
Exiv2IptcDatumIterator* iterator = EXIV2_IPTCDATUMITERATOR (self);
return iterator->priv->iterator->toString ().c_str ();
}
G_END_DECLS

Просмотреть файл

@ -0,0 +1,73 @@
/*
* exiv2-iptcdatum-iterator.h
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __EXIV2_IPTCDATUMITERATOR_H__
#define __EXIV2_IPTCDATUMITERATOR_H__
#include <glib-object.h>
#include "exiv2-iptcdatum.h"
G_BEGIN_DECLS
#define EXIV2_TYPE_IPTCDATUMITERATOR (exiv2_iptcdatumiterator_get_type ())
#define EXIV2_IPTCDATUMITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXIV2_TYPE_IPTCDATUMITERATOR, Exiv2IptcDatumIterator))
#define EXIV2_IS_IPTCDATUMITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXIV2_TYPE_IPTCDATUMITERATOR))
#define EXIV2_IPTCDATUMITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXIV2_TYPE_IPTCDATUMITERATOR, Exiv2IptcDatumIteratorClass))
#define EXIV2_IS_IPTCDATUMITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXIV2_TYPE_IPTCDATUMITERATOR))
#define EXIV2_IPTCDATUMITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXIV2_TYPE_IPTCDATUMITERATOR, Exiv2IptcDatumIteratorClass))
#define EXIV2_IPTCDATUMITERATOR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EXIV2_TYPE_IPTCDATUMITERATOR, Exiv2IptcDatumIteratorPrivate))
typedef struct _Exiv2IptcDatumIterator Exiv2IptcDatumIterator;
typedef struct _Exiv2IptcDatumIteratorClass Exiv2IptcDatumIteratorClass;
typedef struct _Exiv2IptcDatumIteratorPrivate Exiv2IptcDatumIteratorPrivate;
struct _Exiv2IptcDatumIterator
{
Exiv2IptcDatum parent_instance;
/*< private >*/
Exiv2IptcDatumIteratorPrivate *priv;
};
struct _Exiv2IptcDatumIteratorClass
{
Exiv2IptcDatumClass parent_class;
};
GType exiv2_iptcdatumiterator_get_type (void);
void exiv2_iptcdatumiterator_next (Exiv2IptcDatumIterator *self);
gboolean exiv2_iptcdatumiterator_equals (Exiv2IptcDatumIterator *self, Exiv2IptcDatumIterator *other);
G_END_DECLS
#endif /* __EXIV2_IPTCDATUMITERATOR_H__ */

Просмотреть файл

@ -0,0 +1,46 @@
/*
* exiv2-iptcdatum-private.h
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __EXIV2_IPTCDATUM_PRIVATE_H__
#define __EXIV2_IPTCDATUM_PRIVATE_H__
#include "exiv2-iptcdatum.h"
#include <exiv2/iptc.hpp>
G_BEGIN_DECLS
struct _Exiv2IptcDatumPrivate
{
Exiv2::Iptcdatum* datum;
};
G_END_DECLS
#endif /* __EXIV2_IPTCDATUM_PRIVATE_H__ */

251
glue/exiv2-iptcdatum.cpp Normal file
Просмотреть файл

@ -0,0 +1,251 @@
/*
* exiv2-iptcdatum.cpp
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "exiv2-iptcdatum.h"
#include "exiv2-iptcdatum-private.h"
#include "exiv2-rational-private.h"
#include "exiv2-urational-private.h"
#include <exiv2/iptc.hpp>
G_BEGIN_DECLS
G_DEFINE_TYPE (Exiv2IptcDatum, exiv2_iptcdatum, G_TYPE_OBJECT);
static void exiv2_iptcdatum_finalize (GObject *gobject);
const char* exiv2_iptcdatum_real_get_key (Exiv2IptcDatum *self);
guint16 exiv2_iptcdatum_real_get_tag (Exiv2IptcDatum *self);
const char* exiv2_iptcdatum_real_get_typename (Exiv2IptcDatum *self);
glong exiv2_iptcdatum_real_get_count (Exiv2IptcDatum *self);
const char* exiv2_iptcdatum_real_toString (Exiv2IptcDatum *self);
void exiv2_iptcdatum_real_setValueUShort (Exiv2IptcDatum *self, const guint16 value);
//void exiv2_iptcdatum_real_setValueULong (Exiv2IptcDatum *self, const guint32 value);
//void exiv2_iptcdatum_real_setValueURational (Exiv2IptcDatum *self, Exiv2URational *urational);
//void exiv2_iptcdatum_real_setValueSShort (Exiv2IptcDatum *self, const gint16 value);
//void exiv2_iptcdatum_real_setValueSLong (Exiv2IptcDatum *self, const gint32 value);
//void exiv2_iptcdatum_real_setValueRational (Exiv2IptcDatum *self, Exiv2Rational *rational);
void exiv2_iptcdatum_real_setValueString (Exiv2IptcDatum *self, const char* value);
static void
exiv2_iptcdatum_init (Exiv2IptcDatum *self)
{
Exiv2IptcDatumPrivate *priv;
self->priv = priv = EXIV2_IPTCDATUM_GET_PRIVATE (self);
}
static void
exiv2_iptcdatum_class_init (Exiv2IptcDatumClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = exiv2_iptcdatum_finalize;
klass->get_key = exiv2_iptcdatum_real_get_key;
klass->get_tag = exiv2_iptcdatum_real_get_tag;
klass->get_typename = exiv2_iptcdatum_real_get_typename;
klass->get_count = exiv2_iptcdatum_real_get_count;
klass->toString = exiv2_iptcdatum_real_toString;
klass->set_value_ushort = exiv2_iptcdatum_real_setValueUShort;
// klass->set_value_ulong = exiv2_iptcdatum_real_setValueULong;
// klass->set_value_urational = exiv2_iptcdatum_real_setValueURational;
// klass->set_value_sshort = exiv2_iptcdatum_real_setValueSShort;
// klass->set_value_slong = exiv2_iptcdatum_real_setValueSLong;
// klass->set_value_rational = exiv2_iptcdatum_real_setValueRational;
klass->set_value_string = exiv2_iptcdatum_real_setValueString;
g_type_class_add_private (klass, sizeof (Exiv2IptcDatumPrivate));
}
static void
exiv2_iptcdatum_finalize (GObject *gobject)
{
Exiv2IptcDatum *self = EXIV2_IPTCDATUM (gobject);
if (self->priv->datum) {
delete self->priv->datum;
self->priv->datum = NULL;
}
G_OBJECT_CLASS (exiv2_iptcdatum_parent_class)->finalize (gobject);
}
const char*
exiv2_iptcdatum_get_key (Exiv2IptcDatum *self)
{
return EXIV2_IPTCDATUM_GET_CLASS (self)->get_key (self);
}
guint16
exiv2_iptcdatum_get_tag (Exiv2IptcDatum *self)
{
return EXIV2_IPTCDATUM_GET_CLASS (self)->get_tag (self);
}
const char*
exiv2_iptcdatum_get_typename (Exiv2IptcDatum *self)
{
return EXIV2_IPTCDATUM_GET_CLASS (self)->get_typename (self);
}
glong
exiv2_iptcdatum_get_count (Exiv2IptcDatum *self)
{
return EXIV2_IPTCDATUM_GET_CLASS (self)->get_count (self);
}
const char*
exiv2_iptcdatum_toString (Exiv2IptcDatum *self)
{
return EXIV2_IPTCDATUM_GET_CLASS (self)->toString (self);
}
void exiv2_iptcdatum_setValueUShort (Exiv2IptcDatum *self, const guint16 value)
{
return EXIV2_IPTCDATUM_GET_CLASS (self)->set_value_ushort (self, value);
}
//void exiv2_iptcdatum_setValueULong (Exiv2IptcDatum *self, const guint32 value)
//{
// return EXIV2_IPTCDATUM_GET_CLASS (self)->set_value_ulong (self, value);
//}
//void exiv2_iptcdatum_setValueURational (Exiv2IptcDatum *self, Exiv2URational *urational)
//{
// return EXIV2_IPTCDATUM_GET_CLASS (self)->set_value_urational (self, urational);
//}
//void exiv2_iptcdatum_setValueSShort (Exiv2IptcDatum *self, const gint16 value)
//{
// return EXIV2_IPTCDATUM_GET_CLASS (self)->set_value_sshort (self, value);
//}
//void exiv2_iptcdatum_setValueSLong (Exiv2IptcDatum *self, const gint32 value)
//{
// return EXIV2_IPTCDATUM_GET_CLASS (self)->set_value_slong (self, value);
//}
//void exiv2_iptcdatum_setValueRational (Exiv2IptcDatum *self, Exiv2Rational *rational)
//{
// return EXIV2_IPTCDATUM_GET_CLASS (self)->set_value_rational (self, rational);
//}
void exiv2_iptcdatum_setValueString (Exiv2IptcDatum *self, const char* value)
{
return EXIV2_IPTCDATUM_GET_CLASS (self)->set_value_string (self, value);
}
const char*
exiv2_iptcdatum_real_get_key (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUM (self), NULL);
return self->priv->datum->key ().c_str ();
}
guint16
exiv2_iptcdatum_real_get_tag (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUM (self), -1);
return self->priv->datum->tag ();
}
const char*
exiv2_iptcdatum_real_get_typename (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUM (self), NULL);
return self->priv->datum->typeName ();
}
glong
exiv2_iptcdatum_real_get_count (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUM (self), -1);
return self->priv->datum->count ();
}
const char*
exiv2_iptcdatum_real_toString (Exiv2IptcDatum *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCDATUM (self), NULL);
return self->priv->datum->toString ().c_str ();
}
void exiv2_iptcdatum_real_setValueUShort (Exiv2IptcDatum *self, const uint16_t value)
{
g_return_if_fail (EXIV2_IS_IPTCDATUM (self));
Exiv2::Iptcdatum* datum = self->priv->datum;
(*datum) = value;
}
//void exiv2_iptcdatum_real_setValueULong (Exiv2IptcDatum *self, const uint32_t value)
//{
// g_return_if_fail (EXIV2_IS_IPTCDATUM (self));
// Exiv2::Iptcdatum* datum = self->priv->datum;
// (*datum) = value;
//}
//void exiv2_iptcdatum_real_setValueURational (Exiv2IptcDatum *self, Exiv2URational *urational)
//{
// g_return_if_fail (EXIV2_IS_IPTCDATUM (self));
// g_return_if_fail (EXIV2_IS_URATIONAL (urational));
// Exiv2::Iptcdatum* datum = self->priv->datum;
// (*datum) = urational->priv->urational;
//}
//void exiv2_iptcdatum_real_setValueSShort (Exiv2IptcDatum *self, const int16_t value)
//{
// g_return_if_fail (EXIV2_IS_IPTCDATUM (self));
// Exiv2::Iptcdatum* datum = self->priv->datum;
// (*datum) = value;
//}
//void exiv2_iptcdatum_real_setValueSLong (Exiv2IptcDatum *self, const int32_t value)
//{
// g_return_if_fail (EXIV2_IS_IPTCDATUM (self));
// Exiv2::Iptcdatum* datum = self->priv->datum;
// (*datum) = value;
//}
//void exiv2_iptcdatum_real_setValueRational (Exiv2IptcDatum *self, Exiv2Rational *rational)
//{
// g_return_if_fail (EXIV2_IS_IPTCDATUM (self));
// g_return_if_fail (EXIV2_IS_RATIONAL (rational));
// Exiv2::Iptcdatum* datum = self->priv->datum;
// (*datum) = rational->priv->rational;
//}
void exiv2_iptcdatum_real_setValueString (Exiv2IptcDatum *self, const char* value)
{
g_return_if_fail (EXIV2_IS_IPTCDATUM (self));
Exiv2::Iptcdatum* datum = self->priv->datum;
(*datum) = value;
}
G_END_DECLS

99
glue/exiv2-iptcdatum.h Normal file
Просмотреть файл

@ -0,0 +1,99 @@
/*
* exiv2-iptcdatum.h
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __EXIV2_IPTCDATUM_H__
#define __EXIV2_IPTCDATUM_H__
#include <glib-object.h>
#include "exiv2-rational.h"
#include "exiv2-urational.h"
G_BEGIN_DECLS
#define EXIV2_TYPE_IPTCDATUM (exiv2_iptcdatum_get_type ())
#define EXIV2_IPTCDATUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXIV2_TYPE_IPTCDATUM, Exiv2IptcDatum))
#define EXIV2_IS_IPTCDATUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXIV2_TYPE_IPTCDATUM))
#define EXIV2_IPTCDATUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXIV2_TYPE_IPTCDATUM, Exiv2IptcDatumClass))
#define EXIV2_IS_IPTCDATUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXIV2_TYPE_IPTCDATUM))
#define EXIV2_IPTCDATUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXIV2_TYPE_IPTCDATUM, Exiv2IptcDatumClass))
#define EXIV2_IPTCDATUM_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EXIV2_TYPE_IPTCDATUM, Exiv2IptcDatumPrivate))
typedef struct _Exiv2IptcDatum Exiv2IptcDatum;
typedef struct _Exiv2IptcDatumClass Exiv2IptcDatumClass;
typedef struct _Exiv2IptcDatumPrivate Exiv2IptcDatumPrivate;
struct _Exiv2IptcDatum
{
GObject parent_instance;
/*< private >*/
Exiv2IptcDatumPrivate *priv;
};
struct _Exiv2IptcDatumClass
{
GObjectClass parent_class;
/* virtual public methods */
const char* (*get_key) (Exiv2IptcDatum *self);
guint16 (*get_tag) (Exiv2IptcDatum *self);
const char* (*get_typename) (Exiv2IptcDatum *self);
glong (*get_count) (Exiv2IptcDatum *self);
const char* (*toString) (Exiv2IptcDatum *self);
void (*set_value_ushort) (Exiv2IptcDatum *self, const guint16 value);
// void (*set_value_ulong) (Exiv2IptcDatum *self, const guint32 value);
// void (*set_value_urational) (Exiv2IptcDatum *self, Exiv2URational *urational);
// void (*set_value_sshort) (Exiv2IptcDatum *self, const gint16 value);
// void (*set_value_slong) (Exiv2IptcDatum *self, const gint32 value);
// void (*set_value_rational) (Exiv2IptcDatum *self, Exiv2Rational *rational);
void (*set_value_string) (Exiv2IptcDatum *self, const char* value);
};
GType exiv2_iptcdatum_get_type (void);
const char* exiv2_iptcdatum_get_key (Exiv2IptcDatum *self);
guint16 exiv2_iptcdatum_get_tag (Exiv2IptcDatum *self);
const char* exiv2_iptcdatum_get_typename (Exiv2IptcDatum *self);
glong exiv2_iptcdatum_get_count (Exiv2IptcDatum *self);
const char* exiv2_iptcdatum_toString (Exiv2IptcDatum *self);
void exiv2_iptcdatum_setValueUShort (Exiv2IptcDatum *self, const guint16 value);
//void exiv2_iptcdatum_setValueULong (Exiv2IptcDatum *self, const guint32 value);
//void exiv2_iptcdatum_setValueURational (Exiv2IptcDatum *self, Exiv2URational *urational);
//void exiv2_iptcdatum_setValueSShort (Exiv2IptcDatum *self, const gint16 value);
//void exiv2_iptcdatum_setValueSLong (Exiv2IptcDatum *self, const gint32 value);
//void exiv2_iptcdatum_setValueRational (Exiv2IptcDatum *self, Exiv2Rational *rational);
void exiv2_iptcdatum_setValueString (Exiv2IptcDatum *self, const char* value);
G_END_DECLS
#endif /* __EXIV2_IPTCDATUM_H__ */

Просмотреть файл

@ -0,0 +1,48 @@
/*
* exiv2-iptckey-private.h
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __EXIV2_IPTCKEY_PRIVATE_H__
#define __EXIV2_IPTCKEY_PRIVATE_H__
#include "exiv2-iptckey.h"
#include <exiv2/datasets.hpp>
G_BEGIN_DECLS
struct _Exiv2IptcKeyPrivate
{
Exiv2::IptcKey *key;
};
G_END_DECLS
#endif /* __EXIV2_IPTCKEY_PRIVATE_H__ */

158
glue/exiv2-iptckey.cpp Normal file
Просмотреть файл

@ -0,0 +1,158 @@
/*
* exiv2-iptckey.cpp
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "exiv2-key.h"
#include "exiv2-iptckey.h"
#include "exiv2-iptckey-private.h"
G_BEGIN_DECLS
G_DEFINE_TYPE (Exiv2IptcKey, exiv2_iptckey, EXIV2_TYPE_KEY);
static void exiv2_iptckey_finalize (GObject *gobject);
const char* exiv2_iptckey_real_to_string (Exiv2Key *self);
const char* exiv2_iptckey_real_get_familyName (Exiv2Key *self);
const char* exiv2_iptckey_real_get_groupName (Exiv2Key *self);
const char* exiv2_iptckey_real_get_tagName (Exiv2Key *self);
const char* exiv2_iptckey_real_get_tagLabel (Exiv2Key *self);
guint16 exiv2_iptckey_real_get_tag (Exiv2Key *self);
static void
exiv2_iptckey_init (Exiv2IptcKey *self)
{
Exiv2IptcKeyPrivate *priv;
self->priv = priv = EXIV2_IPTCKEY_GET_PRIVATE (self);
}
static void
exiv2_iptckey_class_init (Exiv2IptcKeyClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = exiv2_iptckey_finalize;
Exiv2KeyClass *key_class = EXIV2_KEY_CLASS (klass);
key_class->to_string = exiv2_iptckey_real_to_string;
key_class->get_familyName = exiv2_iptckey_real_get_familyName;
key_class->get_groupName = exiv2_iptckey_real_get_groupName;
key_class->get_tagName = exiv2_iptckey_real_get_tagName;
key_class->get_tagLabel = exiv2_iptckey_real_get_tagLabel;
key_class->get_tag = exiv2_iptckey_real_get_tag;
g_type_class_add_private (klass, sizeof (Exiv2IptcKeyPrivate));
}
static void
exiv2_iptckey_finalize (GObject *gobject)
{
Exiv2IptcKey *self = EXIV2_IPTCKEY (gobject);
if (self->priv->key) {
delete self->priv->key;
self->priv->key = NULL;
}
G_OBJECT_CLASS (exiv2_iptckey_parent_class)->finalize (gobject);
}
Exiv2IptcKey*
exiv2_iptckey_new (const char* key)
{
Exiv2IptcKey *iptckey;
iptckey = EXIV2_IPTCKEY (g_object_new (EXIV2_TYPE_IPTCKEY, NULL));
iptckey->priv->key = new Exiv2::IptcKey (key);
return iptckey;
}
const char*
exiv2_iptckey_real_to_string (Exiv2Key *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCKEY (self), NULL);
Exiv2IptcKey* key = EXIV2_IPTCKEY (self);
return key->priv->key->key ().c_str ();
}
const char*
exiv2_iptckey_real_get_familyName (Exiv2Key *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCKEY (self), NULL);
Exiv2IptcKey* key = EXIV2_IPTCKEY (self);
return key->priv->key->familyName ();
}
const char*
exiv2_iptckey_real_get_groupName (Exiv2Key *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCKEY (self), NULL);
Exiv2IptcKey* key = EXIV2_IPTCKEY (self);
return key->priv->key->groupName ().c_str ();
}
const char*
exiv2_iptckey_real_get_tagName (Exiv2Key *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCKEY (self), NULL);
Exiv2IptcKey* key = EXIV2_IPTCKEY (self);
return key->priv->key->tagName ().c_str ();
}
const char*
exiv2_iptckey_real_get_tagLabel (Exiv2Key *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCKEY (self), NULL);
Exiv2IptcKey* key = EXIV2_IPTCKEY (self);
return key->priv->key->tagLabel ().c_str ();
}
guint16
exiv2_iptckey_real_get_tag (Exiv2Key *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCKEY (self), NULL);
Exiv2IptcKey* key = EXIV2_IPTCKEY (self);
return key->priv->key->tag ();
}
const char*
exiv2_iptckey_get_recordName (Exiv2IptcKey *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCKEY (self), NULL);
return self->priv->key->recordName ().c_str();
}
guint16
exiv2_iptckey_get_record (Exiv2IptcKey *self)
{
g_return_val_if_fail (EXIV2_IS_IPTCKEY (self), NULL);
return self->priv->key->record ();
}
G_END_DECLS

77
glue/exiv2-iptckey.h Normal file
Просмотреть файл

@ -0,0 +1,77 @@
/*
* exiv2-iptckey.h
*
* Author(s):
* Stephane Delcroix (stephane@delcroix.org)
* Mike Gemuende (mike@gemuende.de)
*
* Copyright (c) 2008-2009 Novell, Inc
*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __EXIV2_IPTCKEY_H__
#define __EXIV2_IPTCKEY_H__
#include <glib-object.h>
#include "exiv2-key.h"
G_BEGIN_DECLS
#define EXIV2_TYPE_IPTCKEY (exiv2_iptckey_get_type ())
#define EXIV2_IPTCKEY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXIV2_TYPE_IPTCKEY, Exiv2IptcKey))
#define EXIV2_IS_IPTCKEY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXIV2_TYPE_IPTCKEY))
#define EXIV2_IPTCKEY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXIV2_TYPE_IPTCKEY, Exiv2IptcKeyClass))
#define EXIV2_IS_IPTCKEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXIV2_TYPE_IPTCKEY))
#define EXIV2_IPTCKEY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXIV2_TYPE_IPTCKEY, Exiv2IptcKeyClass))
#define EXIV2_IPTCKEY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EXIV2_TYPE_IPTCKEY, Exiv2IptcKeyPrivate))
typedef struct _Exiv2IptcKey Exiv2IptcKey;
typedef struct _Exiv2IptcKeyClass Exiv2IptcKeyClass;
typedef struct _Exiv2IptcKeyPrivate Exiv2IptcKeyPrivate;
struct _Exiv2IptcKey
{
Exiv2Key parent_instance;
/*< private >*/
Exiv2IptcKeyPrivate *priv;
};
struct _Exiv2IptcKeyClass
{
Exiv2KeyClass parent_class;
};
GType exiv2_iptckey_get_type (void);
Exiv2IptcKey* exiv2_iptckey_new (const char* key);
const char* exiv2_iptckey_get_recordName (Exiv2IptcKey *self);
guint16 exiv2_iptckey_get_record (Exiv2IptcKey *self);
G_END_DECLS
#endif /* __EXIV2_IPTCKEY_H__ */