mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 20:41:43 +00:00
c30453f49d
2005-04-22 Raphael Quinet <raphael@gimp.org> * plug-ins/metadata/xmp-model.[ch]: Fixed crash occuring after a double free of some structured XMP properties. Added new type XMP_TYPE_GENERIC_STRUCTURE for unknown structured properties. Be more tolerant in parsing incorrectly written schema URIs and try to extract a valid URI from them. Converted to use g_print(). Moved the definitions of standard XMP schemas from here... * plug-ins/metadata/xmp-schemas.[ch]: ...to these new files. * plug-ins/metadata/xmp-encode.[ch]: Rewritten using GString instead of fixed buffers. * plug-ins/metadata/metadata.c * plug-ins/metadata/interface.c: Adapted to the new function xmp_generate_block() using GString. * plug-ins/metadata/base64.c (base64_encode): Fixed incorrect encoding of bytes with the sign bit set. * plug-ins/metadata/testbase64.c * plug-ins/metadata/Makefile.am: Added xmp-schema.[ch] and test program testbase64.c (testing base64 encoding and decoding). * plug-ins/metadata/xmpdump.c: Converted to use g_print(). * plug-ins/metadata/xmp-parse.c: Added some #ifdef's around debugging code, added more comments.
81 lines
3.1 KiB
C
81 lines
3.1 KiB
C
/* xmp-model.h - treeview model for XMP metadata
|
|
*
|
|
* Copyright (C) 2004, Raphaël Quinet <raphael@gimp.org>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library 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
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#ifndef XMP_MODEL_H
|
|
#define XMP_MODEL_H
|
|
|
|
#include <glib.h>
|
|
#include <gtk/gtk.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef struct _XMPModel XMPModel;
|
|
|
|
/* columns used in the GtkTreeStore model holding the XMP metadata */
|
|
typedef enum
|
|
{
|
|
COL_XMP_NAME = 0, /* G_TYPE_STRING - name */
|
|
COL_XMP_VALUE, /* G_TYPE_STRING - value as string (for viewing) */
|
|
COL_XMP_VALUE_RAW, /* G_TYPE_POINTER - value as array (from parser) */
|
|
COL_XMP_TYPE_XREF, /* G_TYPE_POINTER - XMPProperty or XMPSchema */
|
|
COL_XMP_WIDGET_XREF, /* G_TYPE_POINTER - GtkWidget cross-reference */
|
|
COL_XMP_EDITABLE, /* G_TYPE_INT - editable? */
|
|
COL_XMP_EDIT_ICON, /* GDK_TYPE_PIXBUF - edit icon */
|
|
COL_XMP_VISIBLE, /* G_TYPE_BOOLEAN - visible? */
|
|
COL_XMP_WEIGHT, /* G_TYPE_INT - font weight */
|
|
COL_XMP_WEIGHT_SET, /* G_TYPE_BOOLEAN - font weight set? */
|
|
XMP_MODEL_NUM_COLUMNS
|
|
} XMPModelColumns;
|
|
|
|
/* special value for the COL_XMP_EDITABLE column. not strictly boolean... */
|
|
#define XMP_AUTO_UPDATE 2
|
|
|
|
XMPModel *xmp_model_new (void);
|
|
|
|
void xmp_model_free (XMPModel *xmp_model);
|
|
|
|
gboolean xmp_model_is_empty (XMPModel *xmp_model);
|
|
|
|
gboolean xmp_model_parse_buffer (XMPModel *xmp_model,
|
|
const gchar *buffer,
|
|
gssize buffer_length,
|
|
gboolean skip_other_data,
|
|
GError **error);
|
|
|
|
gboolean xmp_model_parse_file (XMPModel *xmp_model,
|
|
const gchar *filename,
|
|
GError **error);
|
|
|
|
GtkTreeModel *xmp_model_get_tree_model (XMPModel *xmp_model);
|
|
|
|
const gchar *xmp_model_get_scalar_property (XMPModel *xmp_model,
|
|
const gchar *schema_name,
|
|
const gchar *property_name);
|
|
|
|
gboolean xmp_model_set_scalar_property (XMPModel *xmp_model,
|
|
const gchar *schema_name,
|
|
const gchar *property_name,
|
|
const gchar *property_value);
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* XMP_MODEL_H */
|