[eog] EogExifDetails: Rename to EogMetadataDetails



commit 2969a58b0ceeb8c6af1e04c39aa230e72b70ea20
Author: Felix Riemann <friemann gnome org>
Date:   Wed Oct 30 19:05:12 2013 +0100

    EogExifDetails: Rename to EogMetadataDetails
    
    The widget is not specific to Exif, and is used for XMP as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=509406

 doc/reference/Makefile.am                          |    2 +-
 po/POTFILES.in                                     |    2 +-
 src/Makefile.am                                    |   10 +-
 src/eog-exif-details.h                             |   72 ----------------
 src/{eog-exif-details.c => eog-metadata-details.c} |   88 ++++++++++----------
 src/eog-metadata-details.h                         |   74 ++++++++++++++++
 src/eog-properties-dialog.c                        |    8 +-
 7 files changed, 129 insertions(+), 127 deletions(-)
---
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
index 036afcc..55e3a35 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -70,7 +70,7 @@ if !HAVE_EXIF
 if !HAVE_EXEMPI
 IGNORE_HFILES +=                       \
        eog-exif-util.h                 \
-       eog-exif-details.h
+       eog-metadata-details.h
 endif
 endif
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 33294f3..fde510e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -18,7 +18,7 @@ plugins/statusbar-date/statusbar-date.plugin.desktop.in
 src/eog-application.c
 src/eog-close-confirmation-dialog.c
 src/eog-error-message-area.c
-src/eog-exif-details.c
+src/eog-metadata-details.c
 src/eog-exif-util.c
 src/eog-file-chooser.c
 src/eog-image.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 8ab2566..503a905 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -111,24 +111,24 @@ libeog_la_SOURCES =                       \
 
 if HAVE_EXIF
 INST_H_FILES +=                                \
-       eog-exif-details.h              \
+       eog-metadata-details.h          \
        eog-exif-util.h
 
 libeog_c_files +=                      \
-       eog-exif-details.c              \
+       eog-metadata-details.c          \
        eog-exif-util.c
 endif
 
 if HAVE_EXEMPI
-# We need to make sure eog-exif-details.h
+# We need to make sure eog-metadata-details.h
 # is only listed once in INST_H_FILES
 # or the build will break with automake-1.11
 if !HAVE_EXIF
 INST_H_FILES +=                                \
-       eog-exif-details.h
+       eog-metadata-details.h
 endif !HAVE_EXIF
 libeog_la_SOURCES +=                   \
-       eog-exif-details.c
+       eog-metadata-details.c
 endif HAVE_EXEMPI
 
 libeog_la_CPPFLAGS =                                           \
diff --git a/src/eog-exif-details.c b/src/eog-metadata-details.c
similarity index 90%
rename from src/eog-exif-details.c
rename to src/eog-metadata-details.c
index 4db3bbc..ccca410 100644
--- a/src/eog-exif-details.c
+++ b/src/eog-metadata-details.c
@@ -1,4 +1,4 @@
-/* Eye Of Gnome - EOG Image Exif Details
+/* Eye Of Gnome - EOG Metadata Details
  *
  * Copyright (C) 2006 The Free Software Foundation
  *
@@ -23,7 +23,7 @@
 #include <config.h>
 #endif
 
-#include "eog-exif-details.h"
+#include "eog-metadata-details.h"
 #include "eog-util.h"
 
 #if HAVE_EXIF
@@ -53,7 +53,7 @@ typedef enum {
        XMP_CATEGORY_RIGHTS,
        XMP_CATEGORY_OTHER
 #endif
-} ExifCategory;
+} MetadataCategory;
 
 typedef struct {
        char *label;
@@ -78,7 +78,7 @@ static ExifCategoryInfo exif_categories[] = {
 
 typedef struct {
        int id;
-       ExifCategory category;
+       MetadataCategory category;
 } ExifTagCategory;
 
 #ifdef HAVE_EXIF
@@ -193,7 +193,7 @@ static ExifTagCategory exif_tag_category_map[] = {
 #define MODEL_COLUMN_ATTRIBUTE 0
 #define MODEL_COLUMN_VALUE     1
 
-struct _EogExifDetailsPrivate {
+struct _EogMetadataDetailsPrivate {
        GtkTreeModel *model;
 
        GHashTable   *id_path_hash;
@@ -202,16 +202,16 @@ struct _EogExifDetailsPrivate {
 
 static char*  set_row_data (GtkTreeStore *store, char *path, char *parent, const char *attribute, const char 
*value);
 
-static void eog_exif_details_reset (EogExifDetails *exif_details);
+static void eog_metadata_details_reset (EogMetadataDetails *details);
 
-G_DEFINE_TYPE_WITH_PRIVATE (EogExifDetails, eog_exif_details, GTK_TYPE_TREE_VIEW)
+G_DEFINE_TYPE_WITH_PRIVATE (EogMetadataDetails, eog_metadata_details, GTK_TYPE_TREE_VIEW)
 
 static void
-eog_exif_details_dispose (GObject *object)
+eog_metadata_details_dispose (GObject *object)
 {
-       EogExifDetailsPrivate *priv;
+       EogMetadataDetailsPrivate *priv;
 
-       priv = EOG_EXIF_DETAILS (object)->priv;
+       priv = EOG_METADATA_DETAILS (object)->priv;
 
        if (priv->model) {
                g_object_unref (priv->model);
@@ -227,19 +227,19 @@ eog_exif_details_dispose (GObject *object)
                g_hash_table_destroy (priv->id_path_hash_mnote);
                priv->id_path_hash_mnote = NULL;
        }
-       G_OBJECT_CLASS (eog_exif_details_parent_class)->dispose (object);
+       G_OBJECT_CLASS (eog_metadata_details_parent_class)->dispose (object);
 }
 
 static void
-eog_exif_details_init (EogExifDetails *exif_details)
+eog_metadata_details_init (EogMetadataDetails *details)
 {
-       EogExifDetailsPrivate *priv;
+       EogMetadataDetailsPrivate *priv;
        GtkTreeViewColumn *column;
        GtkCellRenderer *cell;
 
-       exif_details->priv = eog_exif_details_get_instance_private (exif_details);
+       details->priv = eog_metadata_details_get_instance_private (details);
 
-       priv = exif_details->priv;
+       priv = details->priv;
 
        priv->model = GTK_TREE_MODEL (gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_STRING));
        priv->id_path_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
@@ -250,36 +250,36 @@ eog_exif_details_init (EogExifDetails *exif_details)
         column = gtk_tree_view_column_new_with_attributes (_("Tag"), cell,
                                                            "text", MODEL_COLUMN_ATTRIBUTE,
                                                           NULL);
-       gtk_tree_view_append_column (GTK_TREE_VIEW (exif_details), column);
+       gtk_tree_view_append_column (GTK_TREE_VIEW (details), column);
 
        /* Value column */
        cell = gtk_cell_renderer_text_new ();
         column = gtk_tree_view_column_new_with_attributes (_("Value"), cell,
                                                            "text", MODEL_COLUMN_VALUE,
                                                            NULL);
-       gtk_tree_view_append_column (GTK_TREE_VIEW (exif_details), column);
+       gtk_tree_view_append_column (GTK_TREE_VIEW (details), column);
 
-       gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (exif_details), TRUE);
+       gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (details), TRUE);
 
-       eog_exif_details_reset (exif_details);
+       eog_metadata_details_reset (details);
 
-       gtk_tree_view_set_model (GTK_TREE_VIEW (exif_details),
+       gtk_tree_view_set_model (GTK_TREE_VIEW (details),
                                 GTK_TREE_MODEL (priv->model));
 }
 
 static void
-eog_exif_details_class_init (EogExifDetailsClass *klass)
+eog_metadata_details_class_init (EogMetadataDetailsClass *klass)
 {
        GObjectClass *object_class = (GObjectClass*) klass;
 
-       object_class->dispose = eog_exif_details_dispose;
+       object_class->dispose = eog_metadata_details_dispose;
 }
 
 #ifdef HAVE_EXIF
-static ExifCategory
+static MetadataCategory
 get_exif_category (ExifEntry *entry)
 {
-       ExifCategory cat = EXIF_CATEGORY_OTHER;
+       MetadataCategory cat = EXIF_CATEGORY_OTHER;
        int i;
 
        /* Some GPS tag IDs overlap with other ones, so check the IFD */
@@ -443,9 +443,9 @@ static void
 exif_entry_cb (ExifEntry *entry, gpointer data)
 {
        GtkTreeStore *store;
-       EogExifDetails *view;
-       EogExifDetailsPrivate *priv;
-       ExifCategory cat;
+       EogMetadataDetails *view;
+       EogMetadataDetailsPrivate *priv;
+       MetadataCategory cat;
        ExifIfd ifd = exif_entry_get_ifd (entry);
        char *path;
        char b[1024];
@@ -454,7 +454,7 @@ exif_entry_cb (ExifEntry *entry, gpointer data)
        /* This should optimize away if comparison is correct */
        g_warn_if_fail (EXIF_IFD_COUNT <= G_MAXUINT16);
 
-       view = EOG_EXIF_DETAILS (data);
+       view = EOG_METADATA_DETAILS (data);
        priv = view->priv;
 
        store = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view)));
@@ -523,20 +523,20 @@ exif_content_cb (ExifContent *content, gpointer data)
 #endif
 
 GtkWidget *
-eog_exif_details_new (void)
+eog_metadata_details_new (void)
 {
        GObject *object;
 
-       object = g_object_new (EOG_TYPE_EXIF_DETAILS, NULL);
+       object = g_object_new (EOG_TYPE_METADATA_DETAILS, NULL);
 
        return GTK_WIDGET (object);
 }
 
 static void
-eog_exif_details_reset (EogExifDetails *exif_details)
+eog_metadata_details_reset (EogMetadataDetails *details)
 {
+       EogMetadataDetailsPrivate *priv = details->priv;
        int i;
-       EogExifDetailsPrivate *priv = exif_details->priv;
 
        gtk_tree_store_clear (GTK_TREE_STORE (priv->model));
 
@@ -558,13 +558,13 @@ eog_exif_details_reset (EogExifDetails *exif_details)
 
 #ifdef HAVE_EXIF
 void
-eog_exif_details_update (EogExifDetails *exif_details, ExifData *data)
+eog_metadata_details_update (EogMetadataDetails *details, ExifData *data)
 {
-       g_return_if_fail (EOG_IS_EXIF_DETAILS (exif_details));
+       g_return_if_fail (EOG_IS_METADATA_DETAILS (details));
 
-       eog_exif_details_reset (exif_details);
+       eog_metadata_details_reset (details);
        if (data) {
-               exif_data_foreach_content (data, exif_content_cb, exif_details);
+               exif_data_foreach_content (data, exif_content_cb, details);
        }
 }
 #endif /* HAVE_EXIF */
@@ -572,7 +572,7 @@ eog_exif_details_update (EogExifDetails *exif_details, ExifData *data)
 #ifdef HAVE_EXEMPI
 typedef struct {
        const char *id;
-       ExifCategory category;
+       MetadataCategory category;
 } XmpNsCategory;
 
 static XmpNsCategory xmp_ns_category_map[] = {
@@ -587,10 +587,10 @@ static XmpNsCategory xmp_ns_category_map[] = {
        { NULL, -1}
 };
 
-static ExifCategory
+static MetadataCategory
 get_xmp_category (XmpStringPtr schema)
 {
-       ExifCategory cat = XMP_CATEGORY_OTHER;
+       MetadataCategory cat = XMP_CATEGORY_OTHER;
        const char *s = xmp_string_cstr(schema);
        int i;
 
@@ -605,12 +605,12 @@ get_xmp_category (XmpStringPtr schema)
 }
 
 static void
-xmp_entry_insert (EogExifDetails *view, XmpStringPtr xmp_schema,
+xmp_entry_insert (EogMetadataDetails *view, XmpStringPtr xmp_schema,
                  XmpStringPtr xmp_path, XmpStringPtr xmp_prop)
 {
        GtkTreeStore *store;
-       EogExifDetailsPrivate *priv;
-       ExifCategory cat;
+       EogMetadataDetailsPrivate *priv;
+       MetadataCategory cat;
        char *path;
        gchar *key;
 
@@ -642,9 +642,9 @@ xmp_entry_insert (EogExifDetails *view, XmpStringPtr xmp_schema,
 }
 
 void
-eog_exif_details_xmp_update (EogExifDetails *view, XmpPtr data)
+eog_metadata_details_xmp_update (EogMetadataDetails *view, XmpPtr data)
 {
-       g_return_if_fail (EOG_IS_EXIF_DETAILS (view));
+       g_return_if_fail (EOG_IS_METADATA_DETAILS (view));
 
        if (data) {
                XmpIteratorPtr iter = xmp_iterator_new(data, NULL, NULL, XMP_ITER_JUSTLEAFNODES);
diff --git a/src/eog-metadata-details.h b/src/eog-metadata-details.h
new file mode 100644
index 0000000..917b378
--- /dev/null
+++ b/src/eog-metadata-details.h
@@ -0,0 +1,74 @@
+/* Eye Of Gnome - EOG Metadata Details
+ *
+ * Copyright (C) 2006 The Free Software Foundation
+ *
+ * Author: Lucas Rocha <lucasr gnome org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __EOG_METADATA_DETAILS__
+#define __EOG_METADATA_DETAILS__
+
+
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#if HAVE_EXIF
+#include <libexif/exif-data.h>
+#endif
+#if HAVE_EXEMPI
+#include <exempi/xmp.h>
+#endif
+
+G_BEGIN_DECLS
+
+typedef struct _EogMetadataDetails EogMetadataDetails;
+typedef struct _EogMetadataDetailsClass EogMetadataDetailsClass;
+typedef struct _EogMetadataDetailsPrivate EogMetadataDetailsPrivate;
+
+#define EOG_TYPE_METADATA_DETAILS            (eog_metadata_details_get_type ())
+#define EOG_METADATA_DETAILS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EOG_TYPE_METADATA_DETAILS, 
EogMetadataDetails))
+#define EOG_METADATA_DETAILS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), EOG_TYPE_METADATA_DETAILS, 
EogMetadataDetailsClass))
+#define EOG_IS_METADATA_DETAILS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOG_TYPE_METADATA_DETAILS))
+#define EOG_IS_METADATA_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EOG_TYPE_METADATA_DETAILS))
+#define EOG_METADATA_DETAILS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), EOG_TYPE_METADATA_DETAILS, 
EogMetadataDetailsClass))
+
+struct _EogMetadataDetails {
+        GtkTreeView parent;
+
+        EogMetadataDetailsPrivate *priv;
+};
+
+struct _EogMetadataDetailsClass {
+       GtkTreeViewClass parent_class;
+};
+
+GType               eog_metadata_details_get_type    (void) G_GNUC_CONST;
+
+GtkWidget          *eog_metadata_details_new         (void);
+
+#if HAVE_EXIF
+void                eog_metadata_details_update      (EogMetadataDetails *details,
+                                                     ExifData       *data);
+#endif
+#if HAVE_EXEMPI
+void                eog_metadata_details_xmp_update  (EogMetadataDetails *view,
+                                                     XmpPtr          xmp_data);
+#endif
+
+G_END_DECLS
+
+#endif /* __EOG_METADATA_DETAILS__ */
diff --git a/src/eog-properties-dialog.c b/src/eog-properties-dialog.c
index d4cc7ca..f53c8f5 100644
--- a/src/eog-properties-dialog.c
+++ b/src/eog-properties-dialog.c
@@ -48,7 +48,7 @@
 #endif
 
 #if HAVE_METADATA
-#include "eog-exif-details.h"
+#include "eog-metadata-details.h"
 #endif
 
 enum {
@@ -314,7 +314,7 @@ pd_update_metadata_tab (EogPropertiesDialog *prop_dlg,
        eog_exif_util_set_label_text (GTK_LABEL (priv->exif_date_label),
                                      exif_data, EXIF_TAG_DATE_TIME_ORIGINAL);
 
-       eog_exif_details_update (EOG_EXIF_DETAILS (priv->exif_details),
+       eog_metadata_details_update (EOG_METADATA_DETAILS (priv->exif_details),
                                 exif_data);
 
        /* exif_data_unref can handle NULL-values */
@@ -350,7 +350,7 @@ pd_update_metadata_tab (EogPropertiesDialog *prop_dlg,
                                   "rights",
                                   priv->xmp_rights_label);
 
-               eog_exif_details_xmp_update (EOG_EXIF_DETAILS (priv->exif_details), xmp_data);
+               eog_metadata_details_xmp_update (EOG_METADATA_DETAILS (priv->exif_details), xmp_data);
 
                xmp_free (xmp_data);
        } else {
@@ -682,7 +682,7 @@ eog_properties_dialog_init (EogPropertiesDialog *prop_dlg)
                                        GTK_POLICY_AUTOMATIC,
                                        GTK_POLICY_AUTOMATIC);
 
-       priv->exif_details = eog_exif_details_new ();
+       priv->exif_details = eog_metadata_details_new ();
        gtk_widget_set_size_request (priv->exif_details, -1, 170);
        gtk_container_set_border_width (GTK_CONTAINER (sw), 6);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]