You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(22) |
Sep
(57) |
Oct
(39) |
Nov
(93) |
Dec
(72) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(15) |
Feb
(8) |
Mar
(12) |
Apr
(25) |
May
(2) |
Jun
|
Jul
(11) |
Aug
(32) |
Sep
(18) |
Oct
(53) |
Nov
|
Dec
(11) |
2004 |
Jan
(19) |
Feb
(1) |
Mar
(15) |
Apr
(17) |
May
(56) |
Jun
(19) |
Jul
(6) |
Aug
(16) |
Sep
(44) |
Oct
(31) |
Nov
(36) |
Dec
(13) |
2005 |
Jan
(2) |
Feb
(41) |
Mar
(304) |
Apr
(176) |
May
(19) |
Jun
(33) |
Jul
(14) |
Aug
(21) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
(8) |
2006 |
Jan
(18) |
Feb
(9) |
Mar
(5) |
Apr
(2) |
May
(2) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
(7) |
Oct
(10) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(124) |
Jun
(59) |
Jul
(1) |
Aug
(13) |
Sep
(3) |
Oct
(11) |
Nov
(30) |
Dec
(35) |
2008 |
Jan
(31) |
Feb
(42) |
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
(12) |
Jul
(8) |
Aug
(2) |
Sep
(4) |
Oct
(5) |
Nov
(89) |
Dec
(23) |
2009 |
Jan
(71) |
Feb
(5) |
Mar
(8) |
Apr
(7) |
May
(8) |
Jun
(7) |
Jul
|
Aug
(4) |
Sep
(58) |
Oct
(74) |
Nov
(53) |
Dec
(32) |
2010 |
Jan
(8) |
Feb
(13) |
Mar
(4) |
Apr
|
May
|
Jun
(10) |
Jul
(1) |
Aug
(2) |
Sep
(12) |
Oct
(17) |
Nov
(2) |
Dec
(24) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(24) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
(20) |
Mar
(18) |
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(12) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(8) |
Jun
|
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(5) |
From: Lutz M. <lu...@us...> - 2004-10-19 05:55:56
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29515 Modified Files: ChangeLog configure.in Log Message: 2004-10-18 Lutz Mueller <lu...@us...> Patch by Krisztian VASAS <ir...@ir...>: * configure.in: Create po/Makefile.in from po/Makefile.in.in Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.156 retrieving revision 1.157 diff -u -d -r1.156 -r1.157 --- ChangeLog 16 Oct 2004 12:41:08 -0000 1.156 +++ ChangeLog 19 Oct 2004 05:55:46 -0000 1.157 @@ -1,3 +1,9 @@ +2004-10-18 Lutz Mueller <lu...@us...> + + Patch by Krisztian VASAS <ir...@ir...>: + + * configure.in: Create po/Makefile.in from po/Makefile.in.in + 2004-10-16 Lutz Mueller <lu...@us...> * configure.in: We are now working on version 0.6.12. Index: configure.in =================================================================== RCS file: /cvsroot/libexif/libexif/configure.in,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- configure.in 16 Oct 2004 12:41:08 -0000 1.69 +++ configure.in 19 Oct 2004 05:55:46 -0000 1.70 @@ -60,6 +60,7 @@ fi AC_OUTPUT([ + po/Makefile.in Makefile libexif.spec libexif/Makefile |
From: Lutz M. <lu...@us...> - 2004-10-18 19:20:14
|
Update of /cvsroot/libexif/libexif-gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6709 Modified Files: ChangeLog configure.in Log Message: 2004-10-18 Lutz Mueller <lu...@us...> * configure.in: We are now working on 0.3.6. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/ChangeLog,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ChangeLog 17 Oct 2004 15:35:32 -0000 1.19 +++ ChangeLog 18 Oct 2004 19:20:03 -0000 1.20 @@ -1,3 +1,14 @@ +2004-10-18 Lutz Mueller <lu...@us...> + + * configure.in: We are now working on 0.3.6. + +2004-10-18 Lutz Mueller <lu...@us...> + + * libexif-gtk/gtk-exif-entry-generic.c: + * libexif-gtk/gtk-exif-content-list.c: + * configure.in: Make libexif-gtk work with versions < 0.6.12. We + are now working on 0.3.5. + 2004-10-17 Lutz Mueller <lu...@us...> * configure.in: We have been working on 0.3.4 all the time. Index: configure.in =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/configure.in,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- configure.in 17 Oct 2004 15:35:32 -0000 1.20 +++ configure.in 18 Oct 2004 19:20:03 -0000 1.21 @@ -1,6 +1,6 @@ AC_PREREQ(2.50) AC_INIT(libexif-gtk/gtk-exif-browser.c) -AM_INIT_AUTOMAKE(libexif-gtk, 0.3.4) +AM_INIT_AUTOMAKE(libexif-gtk, 0.3.6) AM_MAINTAINER_MODE AC_CONFIG_HEADERS(config.h) @@ -46,6 +46,18 @@ AC_SUBST(GTK_LIBS) AC_SUBST(GTK_CFLAGS) +dnl --------------------------------------------------------------------------- +dnl There are still some old version of libexif around. For now, don't force +dnl users to upgrade +dnl --------------------------------------------------------------------------- +CPPFLAGS_save="$CPPFLAGS" +CPPFLAGS=$LIBEXIF_GTK_CFLAGS +AC_CHECK_HEADER([exif-mem.h], [ + exif_msg=">= 0.6.12" + AC_DEFINE(HAVE_EXIF_0_6_12,1,[whether we use a version of libexif greater than 0.6.12])],[ + exif_msg="< 0.6.12 (think about upgrading)"]) +CPPFLAGS="$CPPFLAGS_save" + CFLAGS="$CFLAGS -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith" AC_SUBST(CFLAGS) @@ -56,3 +68,15 @@ gtk-extensions/Makefile tests/Makefile ]) + +echo " + +Configuration (${PACKAGE}): + + Source code location: $(srcdir) + Version: ${VERSION} + Compiler: ${CC} + + libexif: ${exif_msg} + +" |
From: Lutz M. <lu...@us...> - 2004-10-17 15:35:42
|
Update of /cvsroot/libexif/libexif-gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19135 Modified Files: ChangeLog configure.in Log Message: 2004-10-17 Lutz Mueller <lu...@us...> * configure.in: We have been working on 0.3.4 all the time. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ChangeLog 17 Oct 2004 15:32:47 -0000 1.18 +++ ChangeLog 17 Oct 2004 15:35:32 -0000 1.19 @@ -1,5 +1,9 @@ 2004-10-17 Lutz Mueller <lu...@us...> + * configure.in: We have been working on 0.3.4 all the time. + +2004-10-17 Lutz Mueller <lu...@us...> + * libexif-gtk/gtk-exif-entry-version.c and others: Adapt to new gtk API Index: configure.in =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/configure.in,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- configure.in 17 Oct 2004 13:54:23 -0000 1.19 +++ configure.in 17 Oct 2004 15:35:32 -0000 1.20 @@ -1,6 +1,6 @@ AC_PREREQ(2.50) AC_INIT(libexif-gtk/gtk-exif-browser.c) -AM_INIT_AUTOMAKE(libexif-gtk, 0.3.3) +AM_INIT_AUTOMAKE(libexif-gtk, 0.3.4) AM_MAINTAINER_MODE AC_CONFIG_HEADERS(config.h) |
From: Lutz M. <lu...@us...> - 2004-10-17 15:33:12
|
Update of /cvsroot/libexif/libexif-gtk/libexif-gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18459/libexif-gtk Modified Files: gtk-exif-entry-option.c gtk-exif-entry-resolution.c gtk-exif-entry-user-comment.c gtk-exif-entry-version.c Log Message: 2004-10-17 Lutz Mueller <lu...@us...> * libexif-gtk/gtk-exif-entry-version.c and others: Adapt to new gtk API Index: gtk-exif-entry-option.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/gtk-exif-entry-option.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gtk-exif-entry-option.c 17 Oct 2004 13:54:23 -0000 1.8 +++ gtk-exif-entry-option.c 17 Oct 2004 15:32:47 -0000 1.9 @@ -33,6 +33,8 @@ #include <gtk/gtkcombobox.h> #include <gtk/gtkmenuitem.h> #include <gtk/gtkmenu.h> +#include <gtk/gtkcellrenderertext.h> +#include <gtk/gtkcelllayout.h> #include <gtk/gtkhbox.h> #include <libexif/exif-utils.h> @@ -122,8 +124,8 @@ o = exif_data_get_byte_order (entry->priv->entry->parent->parent); value = exif_get_short (entry->priv->entry->data, o); tm = gtk_combo_box_get_model (entry->priv->menu); - gtk_tree_model_get_iter_from_option (tm, value, &iter); - gtk_combo_box_set_active_iter (entry->priv->menu, &iter); + if (gtk_tree_model_get_iter_from_option (tm, value, &iter)) + gtk_combo_box_set_active_iter (entry->priv->menu, &iter); } static void @@ -225,6 +227,7 @@ GtkWidget *hbox, *label, *menu; GtkOptions *options; const gchar *title; + GtkCellRenderer *cell; g_return_val_if_fail (e != NULL, NULL); g_return_val_if_fail (e->format == EXIF_FORMAT_SHORT, NULL); @@ -287,6 +290,10 @@ gtk_widget_show (menu); gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0); entry->priv->menu = GTK_COMBO_BOX (menu); + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (menu), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (menu), cell, + "text", GTK_OPTIONS_NAME_COLUMN, NULL); g_signal_connect (G_OBJECT (menu), "changed", G_CALLBACK (on_changed), entry); Index: gtk-exif-entry-version.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/gtk-exif-entry-version.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- gtk-exif-entry-version.c 15 Dec 2002 11:41:29 -0000 1.7 +++ gtk-exif-entry-version.c 17 Oct 2004 15:32:47 -0000 1.8 @@ -30,7 +30,9 @@ #include <gtk/gtkframe.h> #include <gtk/gtklabel.h> #include <gtk/gtkentry.h> -#include <gtk/gtkoptionmenu.h> +#include <gtk/gtkcombobox.h> +#include <gtk/gtkcellrenderertext.h> +#include <gtk/gtkcelllayout.h> #include <gtk/gtkmenuitem.h> #include <gtk/gtkmenu.h> #include <gtk/gtkhbox.h> @@ -56,7 +58,6 @@ # define N_(String) (String) #endif -#include "gtk-extensions/gtk-option-menu-option.h" #include "gtk-extensions/gtk-options.h" #include <string.h> @@ -64,7 +65,7 @@ struct _GtkExifEntryVersionPrivate { ExifEntry *entry; - GtkOptionMenuOption *menu; + GtkComboBox *menu; }; #define PARENT_TYPE GTK_EXIF_TYPE_ENTRY @@ -114,7 +115,8 @@ enum _ExifVersion { EXIF_VERSION_2_0, EXIF_VERSION_2_1, - EXIF_VERSION_2_2 + EXIF_VERSION_2_2, + EXIF_VERSION_2_21 }; typedef enum _FlashPixVersion FlashPixVersion; @@ -123,9 +125,10 @@ }; static GtkOptions exif_list[] = { - {EXIF_VERSION_2_0, N_("Exif Format Version 2.0")}, - {EXIF_VERSION_2_1, N_("Exif Format Version 2.1")}, - {EXIF_VERSION_2_2, N_("Exif Format Version 2.2")}, + {EXIF_VERSION_2_0 , N_("Exif Format Version 2.0")}, + {EXIF_VERSION_2_1 , N_("Exif Format Version 2.1")}, + {EXIF_VERSION_2_2 , N_("Exif Format Version 2.2")}, + {EXIF_VERSION_2_21, N_("Exif Format Version 2.21")}, {0, NULL} }; @@ -138,9 +141,10 @@ ExifVersion version; const guchar *data; } exif_versions[] = { - {EXIF_VERSION_2_0, "0200"}, - {EXIF_VERSION_2_1, "0210"}, - {EXIF_VERSION_2_2, "0220"}, + {EXIF_VERSION_2_0 , "0200"}, + {EXIF_VERSION_2_1 , "0210"}, + {EXIF_VERSION_2_2 , "0220"}, + {EXIF_VERSION_2_21, "0221"}, {0, NULL} }; @@ -156,16 +160,20 @@ gtk_exif_entry_version_load (GtkExifEntryVersion *entry) { guint i; + GtkTreeIter iter; + GtkTreeModel *tm; g_return_if_fail (GTK_EXIF_IS_ENTRY_VERSION (entry)); + tm = gtk_combo_box_get_model (entry->priv->menu); switch (entry->priv->entry->tag) { case EXIF_TAG_EXIF_VERSION: for (i = 0; exif_versions[i].data; i++) if (!memcmp (exif_versions[i].data, entry->priv->entry->data, 4)) { - gtk_option_menu_option_set (entry->priv->menu, - exif_versions[i].version); + if (!gtk_tree_model_get_iter_from_option (tm, + exif_versions[i].version, &iter)) + return; break; } break; @@ -173,26 +181,34 @@ for (i = 0; flash_pix_versions[i].data; i++) if (!memcmp (flash_pix_versions[i].data, entry->priv->entry->data, 4)) { - gtk_option_menu_option_set (entry->priv->menu, - flash_pix_versions[i].version); + if (!gtk_tree_model_get_iter_from_option (tm, + flash_pix_versions[i].version, &iter)) + return; break; } break; default: - break; + return; } + gtk_combo_box_set_active_iter (entry->priv->menu, &iter); } static void gtk_exif_entry_version_save (GtkExifEntryVersion *entry) { - guint option, i; + guint i; + GtkTreeIter iter; + GtkTreeModel *tm; + GValue v = {0,}; - option = gtk_option_menu_option_get (entry->priv->menu); + tm = gtk_combo_box_get_model (entry->priv->menu); + gtk_combo_box_get_active_iter (entry->priv->menu, &iter); + gtk_tree_model_get_value (tm, &iter, GTK_OPTIONS_OPTION_COLUMN, &v); switch (entry->priv->entry->tag) { case EXIF_TAG_EXIF_VERSION: for (i = 0; exif_versions[i].data; i++) - if (option == exif_versions[i].version) { + if (g_value_get_int (&v) == + exif_versions[i].version) { memcpy (entry->priv->entry->data, exif_versions[i].data, 4); break; @@ -200,7 +216,8 @@ break; case EXIF_TAG_FLASH_PIX_VERSION: for (i = 0; flash_pix_versions[i].data; i++) - if (option == flash_pix_versions[i].version) { + if (g_value_get_int (&v) == + flash_pix_versions[i].version) { memcpy (entry->priv->entry->data, flash_pix_versions[i].data, 4); break; @@ -213,7 +230,7 @@ } static void -on_option_selected (GtkOptions *options, guint option, GtkExifEntryVersion *entry) +on_changed (GtkComboBox *cb, GtkExifEntryVersion *entry) { gtk_exif_entry_version_save (entry); } @@ -223,6 +240,8 @@ { GtkExifEntryVersion *entry; GtkWidget *hbox, *label, *options; + GtkTreeModel *tm = NULL; + GtkCellRenderer *cell; g_return_val_if_fail (e != NULL, NULL); g_return_val_if_fail ((e->tag == EXIF_TAG_EXIF_VERSION) || @@ -246,18 +265,23 @@ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); switch (e->tag) { case EXIF_TAG_EXIF_VERSION: - options = gtk_option_menu_option_new (exif_list); + tm = gtk_tree_model_new_from_options (exif_list); break; case EXIF_TAG_FLASH_PIX_VERSION: default: - options = gtk_option_menu_option_new (flash_pix_list); + tm = gtk_tree_model_new_from_options (flash_pix_list); break; } + options = gtk_combo_box_new_with_model (tm); gtk_widget_show (options); gtk_box_pack_start (GTK_BOX (hbox), options, FALSE, FALSE, 0); - entry->priv->menu = GTK_OPTION_MENU_OPTION (options); - g_signal_connect (GTK_OBJECT (options), "option_selected", - G_CALLBACK (on_option_selected), entry); + entry->priv->menu = GTK_COMBO_BOX (options); + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (options), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (options), cell, + "text", GTK_OPTIONS_NAME_COLUMN, NULL); + g_signal_connect (G_OBJECT (options), "changed", + G_CALLBACK (on_changed), entry); gtk_exif_entry_version_load (entry); Index: gtk-exif-entry-user-comment.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/gtk-exif-entry-user-comment.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gtk-exif-entry-user-comment.c 15 Dec 2002 11:41:29 -0000 1.2 +++ gtk-exif-entry-user-comment.c 17 Oct 2004 15:32:47 -0000 1.3 @@ -12,10 +12,12 @@ #include <gtk/gtklabel.h> #include <gtk/gtkhbox.h> #include <gtk/gtkentry.h> +#include <gtk/gtkcellrenderertext.h> +#include <gtk/gtkcelllayout.h> +#include <gtk/gtkcombobox.h> #include "gtk-exif-util.h" -#include "gtk-extensions/gtk-option-menu-option.h" #include "gtk-extensions/gtk-options.h" #ifdef ENABLE_NLS @@ -40,7 +42,7 @@ struct _GtkExifEntryUserCommentPrivate { ExifEntry *entry; - GtkOptionMenuOption *menu; + GtkComboBox *menu; GtkEntry *entry_widget; }; @@ -111,25 +113,25 @@ { guint i; gchar *s; + GtkTreeIter iter; + GtkTreeModel *tm; g_return_if_fail (GTK_EXIF_IS_ENTRY_USER_COMMENT (entry)); - /* Make sure we have enough data to figure out the character code. */ - if (entry->priv->entry->size < 8) - return; - for (i = 0; character_codes[i].data; i++) - if (!memcmp (character_codes[i].data, - entry->priv->entry->data, 8)) { - gtk_option_menu_option_set (entry->priv->menu, - character_codes[i].code); - break; - } + tm = gtk_combo_box_get_model (entry->priv->menu); + if (entry->priv->entry->size < 8) return; + for (i = 0; character_codes[i].data && + memcmp (character_codes[i].data, + entry->priv->entry->data, 8); i++); + if (!memcmp (character_codes[i].data, entry->priv->entry->data, 8)) { + gtk_tree_model_get_iter_from_option (tm, + character_codes[i].code, &iter); + gtk_combo_box_set_active_iter (entry->priv->menu, &iter); + } - if (entry->priv->entry->size < 9) - return; + if (entry->priv->entry->size < 9) return; s = g_new0 (gchar, entry->priv->entry->size - 8 + 1); - if (!s) - return; + if (!s) return; memcpy (s, entry->priv->entry->data + 8, entry->priv->entry->size - 8); gtk_entry_set_text (entry->priv->entry_widget, s); g_free (s); @@ -138,31 +140,35 @@ static void gtk_exif_entry_user_comment_save (GtkExifEntryUserComment *entry) { - guint option, i; + guint i; char *d; unsigned int s; const gchar *t; + GtkTreeIter iter; + GtkTreeModel *tm; + GValue v = {0,}; - option = gtk_option_menu_option_get (entry->priv->menu); - for (i = 0; character_codes[i].data; i++) - if (option == character_codes[i].code) { + tm = gtk_combo_box_get_model (entry->priv->menu); + gtk_combo_box_get_active_iter (entry->priv->menu, &iter); + gtk_tree_model_get_value (tm, &iter, GTK_OPTIONS_OPTION_COLUMN, &v); + for (i = 0; character_codes[i].data && + (g_value_get_int (&v) != character_codes[i].code); i++); + if (g_value_get_int (&v) == character_codes[i].code) { - /* - * Make sure we have enough data left to save - * the character code. - */ - if (entry->priv->entry->size < 8) { - s = sizeof (char) * 8; - d = realloc (entry->priv->entry->data, s); - if (!d) - return; - entry->priv->entry->data = d; - entry->priv->entry->size = s; - } - memcpy (entry->priv->entry->data, - character_codes[i].data, 8); - break; + /* + * Make sure we have enough data left to save + * the character code. + */ + if (entry->priv->entry->size < 8) { + s = sizeof (char) * 8; + d = realloc (entry->priv->entry->data, s); + if (!d) return; + entry->priv->entry->data = d; + entry->priv->entry->size = s; } + memcpy (entry->priv->entry->data, + character_codes[i].data, 8); + } /* Save the actual comment. */ t = gtk_entry_get_text (entry->priv->entry_widget); @@ -182,8 +188,7 @@ } static void -on_option_selected (GtkOptions *options, guint option, - GtkExifEntryUserComment *entry) +on_character_code_changed (GtkComboBox *cb, GtkExifEntryUserComment *entry) { gtk_exif_entry_user_comment_save (entry); } @@ -207,6 +212,7 @@ { GtkExifEntryUserComment *entry; GtkWidget *hbox, *w; + GtkCellRenderer *cell; g_return_val_if_fail (e != NULL, NULL); g_return_val_if_fail (e->format == EXIF_FORMAT_UNDEFINED, NULL); @@ -225,12 +231,17 @@ w = gtk_label_new (_("Character Code:")); gtk_widget_show (w); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); - w = gtk_option_menu_option_new (character_codes_list); + w = gtk_combo_box_new_with_model ( + gtk_tree_model_new_from_options (character_codes_list)); gtk_widget_show (w); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); - entry->priv->menu = GTK_OPTION_MENU_OPTION (w); - g_signal_connect (w, "option_selected", G_CALLBACK (on_option_selected), - entry); + entry->priv->menu = GTK_COMBO_BOX (w); + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (w), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (w), cell, + "text", GTK_OPTIONS_NAME_COLUMN, NULL); + g_signal_connect (G_OBJECT (w), "changed", + G_CALLBACK (on_character_code_changed), entry); w = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (entry), w, FALSE, FALSE, 5); gtk_widget_show (w); Index: gtk-exif-entry-resolution.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/gtk-exif-entry-resolution.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- gtk-exif-entry-resolution.c 17 Oct 2004 13:54:23 -0000 1.11 +++ gtk-exif-entry-resolution.c 17 Oct 2004 15:32:47 -0000 1.12 @@ -27,13 +27,14 @@ #include <gtk/gtkradiobutton.h> #include <gtk/gtkvbox.h> #include <gtk/gtkhbox.h> +#include <gtk/gtkcellrenderertext.h> +#include <gtk/gtkcelllayout.h> #include <gtk/gtksignal.h> #include <gtk/gtkframe.h> #include <gtk/gtkcombobox.h> #include <gtk/gtkmenuitem.h> #include <gtk/gtkmenu.h> #include <gtk/gtklabel.h> -#include <gtk/gtktreestore.h> #include <libexif/exif-utils.h> @@ -231,10 +232,13 @@ case EXIF_FORMAT_SHORT: tm = gtk_combo_box_get_model (entry->priv->u.menu); gtk_tree_model_get_iter_first (tm, &iter); - gtk_tree_model_get_value (tm, &iter, UNIT_COLUMN, &v); - while ((g_value_get_int (&v) != exif_get_short (e->data, o)) && - gtk_tree_model_iter_next (tm, &iter)) + do { gtk_tree_model_get_value (tm, &iter, UNIT_COLUMN, &v); + if (g_value_get_int (&v) == + exif_get_short (e->data, o)) + break; + g_value_unset (&v); + } while (gtk_tree_model_iter_next (tm, &iter)); gtk_combo_box_set_active_iter (entry->priv->u.menu, &iter); break; default: @@ -374,6 +378,7 @@ ExifEntry *e; GtkTreeIter iter; GtkTreeModel *tm; + GtkCellRenderer *cell; g_return_val_if_fail (content != NULL, NULL); @@ -481,22 +486,27 @@ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (c), (e != NULL)); g_signal_connect (GTK_OBJECT (c), "toggled", G_CALLBACK (on_unit_toggled), entry); - tm = GTK_TREE_MODEL (gtk_list_store_new (N_COLUMNS, UNIT_COLUMN, - NAME_COLUMN)); + tm = GTK_TREE_MODEL (gtk_list_store_new (N_COLUMNS, G_TYPE_INT, + G_TYPE_STRING)); gtk_list_store_append (GTK_LIST_STORE (tm), &iter); - gtk_tree_store_set (GTK_TREE_STORE (tm), UNIT_COLUMN, UNIT_CENTIMETER, + gtk_list_store_set (GTK_LIST_STORE (tm), &iter, + UNIT_COLUMN, UNIT_CENTIMETER, NAME_COLUMN, _("Centimeter"), -1); gtk_list_store_append (GTK_LIST_STORE (tm), &iter); - gtk_tree_store_set (GTK_TREE_STORE (tm), UNIT_COLUMN, UNIT_INCH, + gtk_list_store_set (GTK_LIST_STORE (tm), &iter, + UNIT_COLUMN, UNIT_INCH, NAME_COLUMN, _("Inch"), -1); o = gtk_combo_box_new_with_model (tm); gtk_widget_show (o); gtk_box_pack_start (GTK_BOX (hbox), o, TRUE, TRUE, 0); + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (o), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (o), cell, + "text", NAME_COLUMN, NULL); g_signal_connect (G_OBJECT (o), "changed", G_CALLBACK (on_unit_changed), entry); entry->priv->u.menu = GTK_COMBO_BOX (o); - if (e) - gtk_exif_entry_resolution_load_unit (entry, e); + if (e) gtk_exif_entry_resolution_load_unit (entry, e); return (GTK_WIDGET (entry)); } |
From: Lutz M. <lu...@us...> - 2004-10-17 15:33:12
|
Update of /cvsroot/libexif/libexif-gtk/gtk-extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18459/gtk-extensions Modified Files: Makefile.am gtk-options.c Log Message: 2004-10-17 Lutz Mueller <lu...@us...> * libexif-gtk/gtk-exif-entry-version.c and others: Adapt to new gtk API Index: gtk-options.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/gtk-extensions/gtk-options.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gtk-options.c 17 Oct 2004 13:54:23 -0000 1.4 +++ gtk-options.c 17 Oct 2004 15:32:47 -0000 1.5 @@ -22,6 +22,7 @@ #include "gtk-options.h" #include <gtk/gtkliststore.h> +#include <gtk/gtktreemodel.h> #include <string.h> @@ -50,13 +51,13 @@ guint i; GtkTreeIter iter; - ls = gtk_list_store_new (GTK_OPTIONS_N_COLUMNS, - GTK_OPTIONS_OPTION_COLUMN, GTK_OPTIONS_NAME_COLUMN); - for (i = 0; i < G_N_ELEMENTS (options); i++) { + ls = gtk_list_store_new (GTK_OPTIONS_N_COLUMNS, G_TYPE_INT, + G_TYPE_STRING); + for (i = 0; options[i].name; i++) { gtk_list_store_append (ls, &iter); - gtk_tree_model_set (GTK_TREE_MODEL (ls), - OPTION_COLUMN, options[i].option, - NAME_COLUMN, options[i].name, -1); + gtk_list_store_set (ls, &iter, + GTK_OPTIONS_OPTION_COLUMN, options[i].option, + GTK_OPTIONS_NAME_COLUMN, options[i].name, -1); } return GTK_TREE_MODEL (ls); @@ -71,9 +72,14 @@ g_return_val_if_fail (GTK_IS_TREE_MODEL (tm), FALSE); g_return_val_if_fail (iter != NULL, FALSE); + /* Search the option in the list store. */ if (!gtk_tree_model_get_iter_first (tm, iter)) return FALSE; - gtk_tree_model_get_value (tm, iter, GTK_OPTIONS_OPTION_COLUMN, &v); - while ((option != g_value_get_int (&v)) && - gtk_tree_model_iter_next (tm, iter)); + do { + gtk_tree_model_get_value (tm, iter, GTK_OPTIONS_OPTION_COLUMN, + &v); + if (option == g_value_get_int (&v)) break; + g_value_unset (&v); + } while (gtk_tree_model_iter_next (tm, iter)); + return (option == g_value_get_int (&v)); } Index: Makefile.am =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/gtk-extensions/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 17 Oct 2004 13:54:23 -0000 1.4 +++ Makefile.am 17 Oct 2004 15:32:47 -0000 1.5 @@ -5,8 +5,7 @@ $(GTK_CFLAGS) noinst_LTLIBRARIES = libgtk-extensions.la -libgtk_extensions_la_SOURCES = \ - gtk-menu-option.c gtk-menu-option.h \ +libgtk_extensions_la_SOURCES = \ + gtk-menu-option.c gtk-menu-option.h \ gtk-options.c gtk-options.h -libgtk_extensions_la_LIBADD = \ - $(GTK_LIBS) +libgtk_extensions_la_LIBADD = $(GTK_LIBS) |
From: Lutz M. <lu...@us...> - 2004-10-17 15:32:55
|
Update of /cvsroot/libexif/libexif-gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18459 Modified Files: ChangeLog Log Message: 2004-10-17 Lutz Mueller <lu...@us...> * libexif-gtk/gtk-exif-entry-version.c and others: Adapt to new gtk API Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/ChangeLog,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ChangeLog 17 Oct 2004 13:54:23 -0000 1.17 +++ ChangeLog 17 Oct 2004 15:32:47 -0000 1.18 @@ -1,5 +1,10 @@ 2004-10-17 Lutz Mueller <lu...@us...> + * libexif-gtk/gtk-exif-entry-version.c and others: Adapt to new + gtk API + +2004-10-17 Lutz Mueller <lu...@us...> + First part of a patch to get libexif-gtk to compile again against current gtk. For now, libexif-gtk does not compile at all. |
From: Lutz M. <lu...@us...> - 2004-10-17 13:54:33
|
Update of /cvsroot/libexif/libexif-gtk/libexif-gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27336/libexif-gtk Modified Files: Makefile.am gtk-exif-browser.c gtk-exif-content-list.c gtk-exif-entry-generic.c gtk-exif-entry-option.c gtk-exif-entry-resolution.c Removed Files: gtk-exif-entry-exposure.c gtk-exif-entry-exposure.h gtk-exif-tag-menu.c gtk-exif-tag-menu.h Log Message: 2004-10-17 Lutz Mueller <lu...@us...> First part of a patch to get libexif-gtk to compile again against current gtk. For now, libexif-gtk does not compile at all. * gtk-extensions/gtk-option-menu-option.[c,h]: Removed. * libexif-gtk/gtk-exif-browser.c: Redirect EXPOSURE_PROGRAM to the generic entry. * libexif-gtk/gtk-exif-tag-menu.[c,h]: Removed. * libexif-gtk/gtk-exif-entry-exposure.[c,h]: Removed. Now covered by the generic entry. * configure.in: CURRENT = 5. --- gtk-exif-tag-menu.h DELETED --- Index: Makefile.am =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.am 7 Jan 2003 17:43:50 -0000 1.12 +++ Makefile.am 17 Oct 2004 13:54:23 -0000 1.13 @@ -16,7 +16,6 @@ gtk-exif-entry-ascii.h \ gtk-exif-entry-copyright.h \ gtk-exif-entry-date.h \ - gtk-exif-entry-exposure.h \ gtk-exif-entry-generic.h \ gtk-exif-entry-flash.h \ gtk-exif-entry-number.h \ @@ -24,8 +23,7 @@ gtk-exif-entry-rational.h \ gtk-exif-entry-resolution.h \ gtk-exif-entry-user-comment.h \ - gtk-exif-entry-version.h \ - gtk-exif-tag-menu.h + gtk-exif-entry-version.h libexif_gtk_la_SOURCES = \ gtk-exif-browser.c \ @@ -35,7 +33,6 @@ gtk-exif-entry-copyright.c \ gtk-exif-entry-date.c \ gtk-exif-entry-generic.c \ - gtk-exif-entry-exposure.c \ gtk-exif-entry-flash.c \ gtk-exif-entry-number.c \ gtk-exif-entry-option.c \ @@ -43,7 +40,6 @@ gtk-exif-entry-resolution.c \ gtk-exif-entry-user-comment.c \ gtk-exif-entry-version.c \ - gtk-exif-tag-menu.c \ gtk-exif-util.h libexif_gtk_la_LDFLAGS = -version-info @LIBEXIF_GTK_VERSION_INFO@ libexif_gtk_la_LIBADD = \ Index: gtk-exif-entry-option.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/gtk-exif-entry-option.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- gtk-exif-entry-option.c 15 Dec 2002 11:41:29 -0000 1.7 +++ gtk-exif-entry-option.c 17 Oct 2004 13:54:23 -0000 1.8 @@ -30,14 +30,13 @@ #include <gtk/gtkframe.h> #include <gtk/gtklabel.h> #include <gtk/gtkentry.h> -#include <gtk/gtkoptionmenu.h> +#include <gtk/gtkcombobox.h> #include <gtk/gtkmenuitem.h> #include <gtk/gtkmenu.h> #include <gtk/gtkhbox.h> #include <libexif/exif-utils.h> -#include "gtk-extensions/gtk-option-menu-option.h" #include "gtk-extensions/gtk-options.h" #include "gtk-exif-util.h" @@ -64,7 +63,7 @@ struct _GtkExifEntryOptionPrivate { ExifEntry *entry; - GtkOptionMenuOption *menu; + GtkComboBox *menu; }; #define PARENT_TYPE GTK_EXIF_TYPE_ENTRY @@ -115,31 +114,31 @@ { ExifShort value; ExifByteOrder o; + GtkTreeIter iter; + GtkTreeModel *tm; g_return_if_fail (GTK_EXIF_IS_ENTRY_OPTION (entry)); o = exif_data_get_byte_order (entry->priv->entry->parent->parent); value = exif_get_short (entry->priv->entry->data, o); - gtk_option_menu_option_set (entry->priv->menu, value); + tm = gtk_combo_box_get_model (entry->priv->menu); + gtk_tree_model_get_iter_from_option (tm, value, &iter); + gtk_combo_box_set_active_iter (entry->priv->menu, &iter); } static void -gtk_exif_entry_option_save (GtkExifEntryOption *entry) +on_changed (GtkComboBox *cb, GtkExifEntryOption *e) { - ExifShort value; + GValue v = {0,}; ExifByteOrder o; + GtkTreeModel *tm = gtk_combo_box_get_model (cb); + GtkTreeIter iter; - o = exif_data_get_byte_order (entry->priv->entry->parent->parent); - value = gtk_option_menu_option_get (entry->priv->menu); - exif_set_short (entry->priv->entry->data, o, value); - g_signal_emit_by_name (GTK_OBJECT (entry), "entry_changed", - entry->priv->entry); -} - -static void -on_option_selected (GtkOptions *options, guint option, GtkExifEntryOption *entry) -{ - gtk_exif_entry_option_save (entry); + gtk_combo_box_get_active_iter (cb, &iter); + gtk_tree_model_get_value (tm, &iter, GTK_OPTIONS_OPTION_COLUMN, &v); + o = exif_data_get_byte_order (e->priv->entry->parent->parent); + exif_set_short (e->priv->entry->data, o, g_value_get_int (&v)); + gtk_exif_entry_changed (GTK_EXIF_ENTRY (e), e->priv->entry); } static GtkOptions options_sensing_method[] = { @@ -204,6 +203,21 @@ { 0, NULL} }; +static GtkOptions options_exposure_program[] = { + {0, N_("Not defined")}, + {1, N_("Manual")}, + {2, N_("Normal program")}, + {3, N_("Aperture priority")}, + {4, N_("Shutter priority")}, + {5, N_("Creative program (biased toward depth of field)")}, + {6, N_("Action program (biased toward fast shutter speed)")}, + {7, N_("Portrait mode (for closeup photos with the " + "background out of focus")}, + {8, N_("Landscape mode (for landscape photos with the " + "background in focus")}, + {0, NULL} +}; + GtkWidget * gtk_exif_entry_option_new (ExifEntry *e) { @@ -219,6 +233,7 @@ (e->tag == EXIF_TAG_LIGHT_SOURCE) || (e->tag == EXIF_TAG_ORIENTATION) || (e->tag == EXIF_TAG_YCBCR_POSITIONING) || + (e->tag == EXIF_TAG_EXPOSURE_PROGRAM) || (e->tag == EXIF_TAG_COMPRESSION), NULL); switch (e->tag) { @@ -246,6 +261,10 @@ title = N_("YCbCr Positioning:"); options = options_ycbcr_positioning; break; + case EXIF_TAG_EXPOSURE_PROGRAM: + title = N_("Exposure Program:"); + options = options_exposure_program; + break; default: return (NULL); } @@ -263,12 +282,13 @@ label = gtk_label_new (_(title)); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - menu = gtk_option_menu_option_new (options); + menu = gtk_combo_box_new_with_model ( + gtk_tree_model_new_from_options (options)); gtk_widget_show (menu); gtk_box_pack_start (GTK_BOX (hbox), menu, FALSE, FALSE, 0); - entry->priv->menu = GTK_OPTION_MENU_OPTION (menu); - g_signal_connect (G_OBJECT (menu), "option_selected", - G_CALLBACK (on_option_selected), entry); + entry->priv->menu = GTK_COMBO_BOX (menu); + g_signal_connect (G_OBJECT (menu), "changed", + G_CALLBACK (on_changed), entry); gtk_exif_entry_option_load (entry); --- gtk-exif-entry-exposure.h DELETED --- Index: gtk-exif-content-list.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/gtk-exif-content-list.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- gtk-exif-content-list.c 1 Aug 2003 20:43:00 -0000 1.9 +++ gtk-exif-content-list.c 17 Oct 2004 13:54:23 -0000 1.10 @@ -29,7 +29,8 @@ #include <gtk/gtkcellrenderertext.h> #include <gtk/gtktreeselection.h> -#include "gtk-exif-tag-menu.h" +#include <gtk-extensions/gtk-menu-option.h> + #include "gtk-exif-util.h" #ifdef ENABLE_NLS @@ -396,13 +397,15 @@ gtk_exif_content_list_update_entry (GtkExifContentList *list, ExifEntry *e) { GtkTreeIter iter; + gchar s[1024]; g_return_if_fail (GTK_EXIF_IS_CONTENT_LIST (list)); g_return_if_fail (e != NULL); if (!gtk_exif_content_list_get_iter (list, e, &iter)) return; gtk_list_store_set (list->priv->store, &iter, - VALUE_COLUMN, exif_entry_get_value (e), -1); + VALUE_COLUMN, + exif_entry_get_value (e, s, sizeof (s)), -1); } void @@ -418,18 +421,19 @@ } void -gtk_exif_content_list_add_entry (GtkExifContentList *list, ExifEntry *entry) +gtk_exif_content_list_add_entry (GtkExifContentList *list, ExifEntry *e) { GtkTreeIter iter; + gchar s[1024]; g_return_if_fail (GTK_EXIF_IS_CONTENT_LIST (list)); gtk_list_store_append (list->priv->store, &iter); gtk_list_store_set (GTK_LIST_STORE (list->priv->store), &iter, - NAME_COLUMN, exif_tag_get_name (entry->tag), - VALUE_COLUMN, exif_entry_get_value (entry), - ENTRY_COLUMN, entry, -1); - g_signal_emit (list, signals[ENTRY_ADDED], 0, entry); + NAME_COLUMN, exif_tag_get_name (e->tag), + VALUE_COLUMN, exif_entry_get_value (e, s, sizeof (s)), + ENTRY_COLUMN, e, -1); + g_signal_emit (list, signals[ENTRY_ADDED], 0, e); } void --- gtk-exif-tag-menu.c DELETED --- Index: gtk-exif-browser.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/gtk-exif-browser.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- gtk-exif-browser.c 1 Aug 2003 20:43:00 -0000 1.16 +++ gtk-exif-browser.c 17 Oct 2004 13:54:23 -0000 1.17 @@ -43,7 +43,6 @@ #include "gtk-exif-entry-ascii.h" #include "gtk-exif-entry-copyright.h" #include "gtk-exif-entry-date.h" -#include "gtk-exif-entry-exposure.h" #include "gtk-exif-entry-flash.h" #include "gtk-exif-entry-generic.h" #include "gtk-exif-entry-number.h" @@ -264,8 +263,6 @@ w = gtk_exif_entry_flash_new (entry); break; case EXIF_TAG_EXPOSURE_PROGRAM: - w = gtk_exif_entry_exposure_new (entry); - break; case EXIF_TAG_SENSING_METHOD: case EXIF_TAG_ORIENTATION: case EXIF_TAG_METERING_MODE: Index: gtk-exif-entry-resolution.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/gtk-exif-entry-resolution.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- gtk-exif-entry-resolution.c 1 Aug 2003 20:43:00 -0000 1.10 +++ gtk-exif-entry-resolution.c 17 Oct 2004 13:54:23 -0000 1.11 @@ -29,10 +29,11 @@ #include <gtk/gtkhbox.h> #include <gtk/gtksignal.h> #include <gtk/gtkframe.h> -#include <gtk/gtkoptionmenu.h> +#include <gtk/gtkcombobox.h> #include <gtk/gtkmenuitem.h> #include <gtk/gtkmenu.h> #include <gtk/gtklabel.h> +#include <gtk/gtktreestore.h> #include <libexif/exif-utils.h> @@ -69,7 +70,7 @@ struct _ResolutionUnitObjects { GtkToggleButton *check; - GtkOptionMenu *menu; + GtkComboBox *menu; }; struct _GtkExifEntryResolutionPrivate @@ -126,31 +127,33 @@ GTK_EXIF_CLASS (entry_resolution, EntryResolution, "EntryResolution") -static void -on_inch_activate (GtkMenuItem *item, GtkExifEntryResolution *entry) -{ - ExifEntry *e; - ExifByteOrder o; +enum { + UNIT_CENTIMETER = 3, + UNIT_INCH = 2 +}; - e = exif_content_get_entry (entry->priv->content, - entry->priv->tag_u); - g_return_if_fail (e != NULL); - o = exif_data_get_byte_order (e->parent->parent); - exif_set_short (e->data, o, 2); - gtk_exif_entry_changed (GTK_EXIF_ENTRY (entry), e); -} +enum { + UNIT_COLUMN, + NAME_COLUMN, + N_COLUMNS +}; static void -on_centimeter_activate (GtkMenuItem *item, GtkExifEntryResolution *entry) +on_unit_changed (GtkComboBox *cb, GtkExifEntryResolution *entry) { - ExifEntry *e; + GtkTreeModel *tm = gtk_combo_box_get_model (cb); + GtkTreeIter iter; + GValue v = {0,}; ExifByteOrder o; + ExifEntry *e; - e = exif_content_get_entry (entry->priv->content, - entry->priv->tag_u); - g_return_if_fail (e != NULL); + gtk_combo_box_get_active_iter (cb, &iter); + gtk_tree_model_get_value (tm, &iter, UNIT_COLUMN, &v); + + e = exif_content_get_entry (entry->priv->content, entry->priv->tag_u); + g_return_if_fail (e); o = exif_data_get_byte_order (e->parent->parent); - exif_set_short (e->data, o, 3); + exif_set_short (e->data, o, g_value_get_int (&v)); gtk_exif_entry_changed (GTK_EXIF_ENTRY (entry), e); } @@ -219,20 +222,20 @@ ExifEntry *e) { ExifByteOrder o; + GtkTreeModel *tm; + GValue v = {0,}; + GtkTreeIter iter; o = exif_data_get_byte_order (e->parent->parent); switch (e->format) { case EXIF_FORMAT_SHORT: - switch (exif_get_short (e->data, o)) { - case 2: - gtk_option_menu_set_history (entry->priv->u.menu, 1); - break; - case 3: - gtk_option_menu_set_history (entry->priv->u.menu, 0); - break; - default: - g_warning ("Invalid unit!"); - } + tm = gtk_combo_box_get_model (entry->priv->u.menu); + gtk_tree_model_get_iter_first (tm, &iter); + gtk_tree_model_get_value (tm, &iter, UNIT_COLUMN, &v); + while ((g_value_get_int (&v) != exif_get_short (e->data, o)) && + gtk_tree_model_iter_next (tm, &iter)) + gtk_tree_model_get_value (tm, &iter, UNIT_COLUMN, &v); + gtk_combo_box_set_active_iter (entry->priv->u.menu, &iter); break; default: g_warning ("Invalid format!"); @@ -366,9 +369,11 @@ gtk_exif_entry_resolution_new (ExifContent *content, gboolean focal_plane) { GtkExifEntryResolution *entry; - GtkWidget *hbox, *sp, *sq, *label, *menu, *item, *o, *c; + GtkWidget *hbox, *sp, *sq, *label, *o, *c; GtkObject *ap, *aq; ExifEntry *e; + GtkTreeIter iter; + GtkTreeModel *tm; g_return_val_if_fail (content != NULL, NULL); @@ -476,23 +481,20 @@ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (c), (e != NULL)); g_signal_connect (GTK_OBJECT (c), "toggled", G_CALLBACK (on_unit_toggled), entry); - o = gtk_option_menu_new (); + tm = GTK_TREE_MODEL (gtk_list_store_new (N_COLUMNS, UNIT_COLUMN, + NAME_COLUMN)); + gtk_list_store_append (GTK_LIST_STORE (tm), &iter); + gtk_tree_store_set (GTK_TREE_STORE (tm), UNIT_COLUMN, UNIT_CENTIMETER, + NAME_COLUMN, _("Centimeter"), -1); + gtk_list_store_append (GTK_LIST_STORE (tm), &iter); + gtk_tree_store_set (GTK_TREE_STORE (tm), UNIT_COLUMN, UNIT_INCH, + NAME_COLUMN, _("Inch"), -1); + o = gtk_combo_box_new_with_model (tm); gtk_widget_show (o); gtk_box_pack_start (GTK_BOX (hbox), o, TRUE, TRUE, 0); - entry->priv->u.menu = GTK_OPTION_MENU (o); - menu = gtk_menu_new (); - gtk_widget_show (menu); - item = gtk_menu_item_new_with_label (_("Centimeter")); - gtk_widget_show (item); - gtk_container_add (GTK_CONTAINER (menu), item); - g_signal_connect (GTK_OBJECT (item), "activate", - G_CALLBACK (on_centimeter_activate), entry); - item = gtk_menu_item_new_with_label (_("Inch")); - gtk_widget_show (item); - gtk_container_add (GTK_CONTAINER (menu), item); - g_signal_connect (GTK_OBJECT (item), "activate", - G_CALLBACK (on_inch_activate), entry); - gtk_option_menu_set_menu (GTK_OPTION_MENU (o), menu); + g_signal_connect (G_OBJECT (o), "changed", + G_CALLBACK (on_unit_changed), entry); + entry->priv->u.menu = GTK_COMBO_BOX (o); if (e) gtk_exif_entry_resolution_load_unit (entry, e); --- gtk-exif-entry-exposure.c DELETED --- Index: gtk-exif-entry-generic.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/libexif-gtk/gtk-exif-entry-generic.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- gtk-exif-entry-generic.c 15 Dec 2002 11:41:29 -0000 1.5 +++ gtk-exif-entry-generic.c 17 Oct 2004 13:54:23 -0000 1.6 @@ -88,7 +88,7 @@ { GtkExifEntryGeneric *entry; GtkWidget *table, *label; - gchar *txt; + gchar *txt, s[1024]; g_return_val_if_fail (e != NULL, NULL); @@ -136,7 +136,7 @@ label = gtk_label_new ("Value:"); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, 0, 0, 0, 0); - label = gtk_label_new (exif_entry_get_value (e)); + label = gtk_label_new (exif_entry_get_value (e, s, sizeof (s))); gtk_widget_show (label); gtk_table_attach (GTK_TABLE (table), label, 1, 2, 3, 4, 0, 0, 0, 0); |
From: Lutz M. <lu...@us...> - 2004-10-17 13:54:32
|
Update of /cvsroot/libexif/libexif-gtk/gtk-extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27336/gtk-extensions Modified Files: Makefile.am gtk-options.c gtk-options.h Removed Files: gtk-option-menu-option.c gtk-option-menu-option.h Log Message: 2004-10-17 Lutz Mueller <lu...@us...> First part of a patch to get libexif-gtk to compile again against current gtk. For now, libexif-gtk does not compile at all. * gtk-extensions/gtk-option-menu-option.[c,h]: Removed. * libexif-gtk/gtk-exif-browser.c: Redirect EXPOSURE_PROGRAM to the generic entry. * libexif-gtk/gtk-exif-tag-menu.[c,h]: Removed. * libexif-gtk/gtk-exif-entry-exposure.[c,h]: Removed. Now covered by the generic entry. * configure.in: CURRENT = 5. Index: gtk-options.c =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/gtk-extensions/gtk-options.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gtk-options.c 15 Dec 2002 11:41:28 -0000 1.3 +++ gtk-options.c 17 Oct 2004 13:54:23 -0000 1.4 @@ -21,6 +21,8 @@ #include "config.h" #include "gtk-options.h" +#include <gtk/gtkliststore.h> + #include <string.h> void @@ -41,3 +43,37 @@ } } +GtkTreeModel * +gtk_tree_model_new_from_options (GtkOptions *options) +{ + GtkListStore *ls; + guint i; + GtkTreeIter iter; + + ls = gtk_list_store_new (GTK_OPTIONS_N_COLUMNS, + GTK_OPTIONS_OPTION_COLUMN, GTK_OPTIONS_NAME_COLUMN); + for (i = 0; i < G_N_ELEMENTS (options); i++) { + gtk_list_store_append (ls, &iter); + gtk_tree_model_set (GTK_TREE_MODEL (ls), + OPTION_COLUMN, options[i].option, + NAME_COLUMN, options[i].name, -1); + } + + return GTK_TREE_MODEL (ls); +} + +gboolean +gtk_tree_model_get_iter_from_option (GtkTreeModel *tm, guint option, + GtkTreeIter *iter) +{ + GValue v = {0,}; + + g_return_val_if_fail (GTK_IS_TREE_MODEL (tm), FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + + if (!gtk_tree_model_get_iter_first (tm, iter)) return FALSE; + gtk_tree_model_get_value (tm, iter, GTK_OPTIONS_OPTION_COLUMN, &v); + while ((option != g_value_get_int (&v)) && + gtk_tree_model_iter_next (tm, iter)); + return (option == g_value_get_int (&v)); +} Index: gtk-options.h =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/gtk-extensions/gtk-options.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gtk-options.h 15 Dec 2002 11:41:28 -0000 1.2 +++ gtk-options.h 17 Oct 2004 13:54:23 -0000 1.3 @@ -21,7 +21,7 @@ #ifndef __GTK_OPTIONS_H__ #define __GTK_OPTIONS_H__ -#include <glib.h> +#include <gtk/gtktreemodel.h> typedef struct _GtkOptions GtkOptions; struct _GtkOptions { @@ -29,7 +29,17 @@ const gchar *name; }; -void gtk_options_sort (GtkOptions *options); +void gtk_options_sort (GtkOptions *); + +enum { + GTK_OPTIONS_OPTION_COLUMN, + GTK_OPTIONS_NAME_COLUMN, + GTK_OPTIONS_N_COLUMNS +}; + +GtkTreeModel *gtk_tree_model_new_from_options (GtkOptions *); +gboolean gtk_tree_model_get_iter_from_option (GtkTreeModel *, guint, + GtkTreeIter *); #endif /* __GTK_OPTIONS_H__ */ Index: Makefile.am =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/gtk-extensions/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 15 Sep 2002 13:22:41 -0000 1.3 +++ Makefile.am 17 Oct 2004 13:54:23 -0000 1.4 @@ -7,7 +7,6 @@ noinst_LTLIBRARIES = libgtk-extensions.la libgtk_extensions_la_SOURCES = \ gtk-menu-option.c gtk-menu-option.h \ - gtk-option-menu-option.c gtk-option-menu-option.h \ gtk-options.c gtk-options.h libgtk_extensions_la_LIBADD = \ $(GTK_LIBS) --- gtk-option-menu-option.c DELETED --- --- gtk-option-menu-option.h DELETED --- |
From: Lutz M. <lu...@us...> - 2004-10-17 13:54:32
|
Update of /cvsroot/libexif/libexif-gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27336 Modified Files: ChangeLog configure.in Makefile.am Log Message: 2004-10-17 Lutz Mueller <lu...@us...> First part of a patch to get libexif-gtk to compile again against current gtk. For now, libexif-gtk does not compile at all. * gtk-extensions/gtk-option-menu-option.[c,h]: Removed. * libexif-gtk/gtk-exif-browser.c: Redirect EXPOSURE_PROGRAM to the generic entry. * libexif-gtk/gtk-exif-tag-menu.[c,h]: Removed. * libexif-gtk/gtk-exif-entry-exposure.[c,h]: Removed. Now covered by the generic entry. * configure.in: CURRENT = 5. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ChangeLog 1 Aug 2003 20:43:00 -0000 1.16 +++ ChangeLog 17 Oct 2004 13:54:23 -0000 1.17 @@ -1,3 +1,16 @@ +2004-10-17 Lutz Mueller <lu...@us...> + + First part of a patch to get libexif-gtk to compile again against + current gtk. For now, libexif-gtk does not compile at all. + + * gtk-extensions/gtk-option-menu-option.[c,h]: Removed. + * libexif-gtk/gtk-exif-browser.c: Redirect EXPOSURE_PROGRAM to + the generic entry. + * libexif-gtk/gtk-exif-tag-menu.[c,h]: Removed. + * libexif-gtk/gtk-exif-entry-exposure.[c,h]: Removed. Now covered + by the generic entry. + * configure.in: CURRENT = 5. + 2003-08-01 Lutz Mueller <lu...@us...> * libexif-gtk/gtk-exif-browser.c: Implement removal of entries. Index: Makefile.am =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 17 Nov 2002 17:17:20 -0000 1.7 +++ Makefile.am 17 Oct 2004 13:54:23 -0000 1.8 @@ -1 +1,5 @@ -SUBDIRS = gtk-extensions libexif-gtk tests po +SUBDIRS = m4 gtk-extensions libexif-gtk tests po + +ACLOCAL_AMFLAGS = -I m4 + +EXTRA_DIST = config.rpath mkinstalldirs Index: configure.in =================================================================== RCS file: /cvsroot/libexif/libexif-gtk/configure.in,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- configure.in 13 Apr 2003 10:45:22 -0000 1.18 +++ configure.in 17 Oct 2004 13:54:23 -0000 1.19 @@ -1,8 +1,8 @@ AC_PREREQ(2.50) AC_INIT(libexif-gtk/gtk-exif-browser.c) -AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(libexif-gtk, 0.3.3) AM_MAINTAINER_MODE +AC_CONFIG_HEADERS(config.h) AC_ISC_POSIX AC_PROG_CC @@ -21,7 +21,7 @@ dnl --------------------------------------------------------------------------- LIBEXIF_GTK_AGE=0 LIBEXIF_GTK_REVISION=0 -LIBEXIF_GTK_CURRENT=4 +LIBEXIF_GTK_CURRENT=5 AC_SUBST(LIBEXIF_GTK_AGE) AC_SUBST(LIBEXIF_GTK_REVISION) AC_SUBST(LIBEXIF_GTK_CURRENT) @@ -49,7 +49,7 @@ CFLAGS="$CFLAGS -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith" AC_SUBST(CFLAGS) -AC_OUTPUT([ +AC_OUTPUT([ po/Makefile.in m4/Makefile Makefile libexif-gtk/Makefile libexif-gtk/libexif-gtk.pc |
From: Lutz M. <lu...@us...> - 2004-10-16 12:41:21
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25884 Modified Files: ChangeLog configure.in Log Message: 2004-10-16 Lutz Mueller <lu...@us...> * configure.in: We are now working on version 0.6.12. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.155 retrieving revision 1.156 diff -u -d -r1.155 -r1.156 --- ChangeLog 16 Oct 2004 12:21:14 -0000 1.155 +++ ChangeLog 16 Oct 2004 12:41:08 -0000 1.156 @@ -1,5 +1,9 @@ 2004-10-16 Lutz Mueller <lu...@us...> + * configure.in: We are now working on version 0.6.12. + +2004-10-16 Lutz Mueller <lu...@us...> + * configure.in: set CURRENT to 12. There have been quite a few additions to the header files. Index: configure.in =================================================================== RCS file: /cvsroot/libexif/libexif/configure.in,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- configure.in 16 Oct 2004 12:21:14 -0000 1.68 +++ configure.in 16 Oct 2004 12:41:08 -0000 1.69 @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT(libexif/exif-data.h) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libexif, 0.6.11) +AM_INIT_AUTOMAKE(libexif, 0.6.12) AM_MAINTAINER_MODE dnl --------------------------------------------------------------------------- |
From: Lutz M. <lu...@us...> - 2004-10-16 12:21:24
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21866 Modified Files: ChangeLog configure.in Log Message: 2004-10-16 Lutz Mueller <lu...@us...> * configure.in: set CURRENT to 12. There have been quite a few additions to the header files. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.154 retrieving revision 1.155 diff -u -d -r1.154 -r1.155 --- ChangeLog 5 Oct 2004 19:14:12 -0000 1.154 +++ ChangeLog 16 Oct 2004 12:21:14 -0000 1.155 @@ -1,3 +1,15 @@ +2004-10-16 Lutz Mueller <lu...@us...> + + * configure.in: set CURRENT to 12. There have been quite a few + additions to the header files. + +2004-10-16 Lutz Mueller <lu...@us...> + + Martin Willers <wi...@xm...> found an off-by-one error: + + * libexif/exif-entry.c: libexif forget to add 1 + to tm_mon from struct tm + 2004-10-05 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Support for WatCom. Convert debugging code Index: configure.in =================================================================== RCS file: /cvsroot/libexif/libexif/configure.in,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- configure.in 9 Sep 2004 06:27:21 -0000 1.67 +++ configure.in 16 Oct 2004 12:21:14 -0000 1.68 @@ -16,7 +16,7 @@ dnl --------------------------------------------------------------------------- LIBEXIF_AGE=0 LIBEXIF_REVISION=0 -LIBEXIF_CURRENT=11 +LIBEXIF_CURRENT=12 AC_SUBST(LIBEXIF_AGE) AC_SUBST(LIBEXIF_REVISION) AC_SUBST(LIBEXIF_CURRENT) |
From: Lutz M. <lu...@us...> - 2004-10-05 19:16:23
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19550 Modified Files: exif-content.c exif-entry.c Log Message: 2004-10-05 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Support for WatCom. Convert debugging code to exif-log API. * libexif/i18n.h: Support for WatCom. Patch by Angela Wrobel. Index: exif-entry.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-entry.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- exif-entry.c 4 Oct 2004 06:26:59 -0000 1.66 +++ exif-entry.c 5 Oct 2004 19:16:00 -0000 1.67 @@ -31,8 +31,6 @@ #include <time.h> #include <math.h> -/* #define DEBUG */ - #undef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) Index: exif-content.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-content.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- exif-content.c 4 Oct 2004 06:26:59 -0000 1.12 +++ exif-content.c 5 Oct 2004 19:16:00 -0000 1.13 @@ -25,8 +25,6 @@ #include <stdio.h> #include <string.h> -/* #define DEBUG */ - static const unsigned char ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; struct _ExifContentPrivate |
From: Lutz M. <lu...@us...> - 2004-10-05 19:14:51
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19252 Modified Files: ChangeLog Log Message: 2004-10-05 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Support for WatCom. Convert debugging code to exif-log API. * libexif/i18n.h: Support for WatCom. Patch by Angela Wrobel. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.153 retrieving revision 1.154 diff -u -d -r1.153 -r1.154 --- ChangeLog 5 Oct 2004 18:57:15 -0000 1.153 +++ ChangeLog 5 Oct 2004 19:14:12 -0000 1.154 @@ -1,5 +1,11 @@ 2004-10-05 Lutz Mueller <lu...@us...> + * libexif/exif-data.c: Support for WatCom. Convert debugging code + to exif-log API. + * libexif/i18n.h: Support for WatCom. Patch by Angela Wrobel. + +2004-10-05 Lutz Mueller <lu...@us...> + * contrib/watcom: Files contributed by Angela Wrobel. 2004-10-04 Lutz Mueller <lu...@us...> |
From: Lutz M. <lu...@us...> - 2004-10-05 19:14:49
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19252/libexif Modified Files: exif-data.c i18n.h Log Message: 2004-10-05 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Support for WatCom. Convert debugging code to exif-log API. * libexif/i18n.h: Support for WatCom. Patch by Angela Wrobel. Index: i18n.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/i18n.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- i18n.h 28 Apr 2003 18:22:18 -0000 1.3 +++ i18n.h 5 Oct 2004 19:14:12 -0000 1.4 @@ -35,8 +35,13 @@ # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) -# define bind_textdomain_codeset(Domain,Codeset) (Codeset) -# define bindtextdomain(Domain,Directory) (Domain) +#ifdef __WATCOMC__ +# define bind_textdomain_codeset(Domain,Codeset) +# define bindtextdomain(Domain,Directory) +#else +# define bind_textdomain_codeset(Domain,Codeset) (Codeset) +# define bindtextdomain(Domain,Directory) (Domain) +#endif # define _(String) (String) # define N_(String) (String) #endif Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- exif-data.c 4 Oct 2004 06:26:59 -0000 1.50 +++ exif-data.c 5 Oct 2004 19:14:12 -0000 1.51 @@ -40,7 +40,9 @@ #undef MAX #define MAX(a, b) (((a) > (b)) ? (a) : (b)) -/* #define DEBUG */ +#ifdef __WATCOMC__ +# define strncasecmp strnicmp +#endif static const unsigned char ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; @@ -166,6 +168,7 @@ memcpy (entry->data, d + doff, s); } +#ifndef EXIF_DONT_CHANGE_MAKER_NOTE /* If this is the MakerNote, remember the offset */ if (entry->tag == EXIF_TAG_MAKER_NOTE) { if (entry->size > 6) exif_log (data->priv->log, @@ -177,6 +180,7 @@ entry->data[6]); data->priv->offset_mnote = doff; } +#endif exif_entry_fix (entry); } @@ -300,9 +304,6 @@ data->ifd[EXIF_IFD_INTEROPERABILITY], d, ds, o); break; case EXIF_TAG_JPEG_INTERCHANGE_FORMAT: -#ifdef DEBUG - printf ("Thumbnail at %i.\n", (int) o); -#endif thumbnail_offset = o; if (thumbnail_offset && thumbnail_length) exif_data_load_data_thumbnail (data, d, @@ -310,9 +311,6 @@ thumbnail_length); break; case EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH: -#ifdef DEBUG - printf ("Thumbnail size: %i.\n", (int) o); -#endif thumbnail_length = o; if (thumbnail_offset && thumbnail_length) exif_data_load_data_thumbnail (data, d, @@ -402,12 +400,10 @@ (ExifShort) (ifd->count + n_ptr + n_thumb)); offset += 2; -#ifdef DEBUG - printf ("Saving %i entries (IFD '%s', offset: %i)...\n", - ifd->count, exif_ifd_get_name (i), offset); -#endif - /* Save each entry */ + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "Saving %i entries (IFD '%s', offset: %i)...", + ifd->count, exif_ifd_get_name (i), offset); for (j = 0; j < ifd->count; j++) exif_data_save_data_entry (data, ifd->entries[j], d, ds, offset + 12 * j); @@ -502,11 +498,6 @@ } memcpy (*d + *ds - data->size, data->data, data->size); offset += 12; -#ifdef DEBUG - printf ("Wrote %i bytes of thumbnail data at offset " - "%i.\n", data->size, *ds - data->size); - printf ("We currently have %i bytes EXIF data.\n", *ds); -#endif /* EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH */ exif_set_short (*d + 6 + offset + 0, data->priv->order, @@ -561,20 +552,14 @@ * not, search the EXIF marker. */ if (ds < 6) { -#ifdef DEBUG - printf ("Size too small.\n"); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "Size too small."); return; } if (!memcmp (d, ExifHeader, 6)) { -#ifdef DEBUG - printf ("Found EXIF header.\n"); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "Found EXIF header."); } else { -#ifdef DEBUG - printf ("Data begins with 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x " - "0x%x...\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6]); -#endif while (1) { while ((d[0] == 0xff) && ds) { d++; @@ -605,23 +590,21 @@ break; /* Unknown marker or data. Give up. */ -#ifdef DEBUG - printf ("EXIF marker not found.\n"); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, + "ExifData", "EXIF marker not found."); return; } d++; ds--; if (ds < 2) { -#ifdef DEBUG - printf ("Size too small.\n"); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, + "ExifData", "Size too small."); return; } len = (d[0] << 8) | d[1]; -#ifdef DEBUG - printf ("We have to deal with %i byte(s) of EXIF data.\n", len); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "We have to deal with %i byte(s) of EXIF data.", + len); d += 2; ds -= 2; } @@ -631,21 +614,18 @@ * (offset 2, length 6). */ if (ds < 6) { -#ifdef DEBUG - printf ("Size too small.\n"); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "Size too small."); return; } if (memcmp (d, ExifHeader, 6)) { -#ifdef DEBUG - printf ("EXIF header not found.\n"); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "EXIF header not found."); return; } -#ifdef DEBUG - printf ("Found EXIF header.\n"); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "Found EXIF header."); /* Byte order (offset 6, length 2) */ if (ds < 12) @@ -663,9 +643,8 @@ /* IFD 0 offset */ offset = exif_get_long (d + 10, data->priv->order); -#ifdef DEBUG - printf ("IFD 0 at %i.\n", (int) offset); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "IFD 0 at %i.", (int) offset); /* Parse the actual exif data (offset 14) */ exif_data_load_data_content (data, data->ifd[EXIF_IFD_0], d + 6, @@ -675,15 +654,13 @@ n = exif_get_short (d + 6 + offset, data->priv->order); offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order); if (offset) { -#ifdef DEBUG - printf ("IFD 1 at %i.\n", (int) offset); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "IFD 1 at %i.", (int) offset); /* Sanity check. */ if (offset > ds - 6) { -#ifdef DEBUG - printf ("Bogus offset!\n"); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, + "ExifData", "Bogus offset!"); return; } @@ -771,15 +748,12 @@ exif_set_long (*d + 10, data->priv->order, 8); /* Now save IFD 0. IFD 1 will be saved automatically. */ -#ifdef DEBUG - printf ("Saving IFDs...\n"); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "Saving IFDs..."); exif_data_save_data_content (data, data->ifd[EXIF_IFD_0], d, ds, *ds - 6); - -#ifdef DEBUG - printf ("Saved %i byte(s) EXIF data.\n", *ds); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "Saved %i byte(s) EXIF data.", *ds); } ExifData * |
From: Lutz M. <lu...@us...> - 2004-10-05 18:57:35
|
Update of /cvsroot/libexif/libexif/contrib/watcom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14635/contrib/watcom Added Files: Makefile.wat _stdint_watcom.h Log Message: 2004-10-05 Lutz Mueller <lu...@us...> * contrib/watcom: Files contributed by Angela Wrobel. --- NEW FILE: _stdint_watcom.h --- /* This file is generated automatically by configure */ #ifndef __STDINT_H #define __STDINT_H #include <sys/types.h> typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; typedef signed long int32_t; #endif --- NEW FILE: Makefile.wat --- # This makefile is made for OpenWatcom/NT and runs on my system. # It should not be too hard to make it run on other systems, too. # # FIRST, rename libexif\_stdint_watcom.h to libexif\_stdint.h # # WARNING: there as no care been taken that the depencencies are # correct. This should be fixed in the future. Currently, this makefile # builds only, so after critical changes to the code, you should type # "wmake clean" before rebuilding. Sorry... # # WARNING: This makefile might run on your system, however, I made it # mainly for myself and don't want to waste my time to make it look "nice". # # WARNING: I used another makefile as template, so some things might be # thrown away. Don't hesitate to improve this makefile! # # LICENSE: no restrictions at all, but USE ON YOUR OWN RISK ONLY. # # USAGE: Simply type "wmake -f Makefile.wat" or # rename "Makefile.wat" to "Makefile" and type "wmake" # # Angela Wrobel <http://www.wrobelnet.de/> # Uncomment line for desired system #SYSTEM=DOS #SYSTEM=OS2 SYSTEM=NT # The name of your C compiler: CC= wcl386 # We're using similar constants like wxWidgets !ifeq FINAL 1 OPTFLAGS= -5r -zp8 -otexan !else OPTFLAGS= -5r -od -d2 !endif LIBEXIFDIR=libexif TESTEXIFDIR=test IFLAGS= -i=. WINVERFLAGS= EXTRACPPFLAGS=-dEXIF_DONT_CHANGE_MAKER_NOTE DEBUGCFLAGS= EXTRACFLAGS= OUTPUTDIR=$(LIBEXIFDIR) CPPFLAGS = /dWIN32 /bm /fo=$(OUTPUTDIR)\ /fr -zq $(IFLAGS) $(OPTFLAGS) $(WINVERFLAGS) $(EXTRACPPFLAGS) # zm and zv as well as the linker options below are used to make the resulting # .exe smaller CFLAGS = $(CPPFLAGS) $(DEBUGCFLAGS) $(EXTRACFLAGS) /zm # Link-time cc options: !ifeq SYSTEM DOS LDFLAGS= -zq -l=dos4g !else ifeq SYSTEM OS2 LDFLAGS= -zq -l=os2v2 !else ifeq SYSTEM NT LDFLAGS= -zq -l=nt !endif # End of configurable options. LIBOBJECTS = & $(LIBEXIFDIR)\exif-byte-order.obj $(LIBEXIFDIR)\exif-content.obj & $(LIBEXIFDIR)\exif-data.obj $(LIBEXIFDIR)\exif-entry.obj & $(LIBEXIFDIR)\exif-format.obj $(LIBEXIFDIR)\exif-ifd.obj & $(LIBEXIFDIR)\exif-loader.obj $(LIBEXIFDIR)\exif-log.obj & $(LIBEXIFDIR)\exif-mnote-data.obj $(LIBEXIFDIR)\exif-tag.obj & $(LIBEXIFDIR)\exif-utils.obj & $(LIBEXIFDIR)\exif-mnote-data-olympus.obj & $(LIBEXIFDIR)\mnote-olympus-entry.obj & $(LIBEXIFDIR)\mnote-olympus-tag.obj & $(LIBEXIFDIR)\exif-mnote-data-pentax.obj & $(LIBEXIFDIR)\mnote-pentax-entry.obj & $(LIBEXIFDIR)\mnote-pentax-tag.obj & $(LIBEXIFDIR)\exif-mnote-data-canon.obj & $(LIBEXIFDIR)\mnote-canon-entry.obj & $(LIBEXIFDIR)\mnote-canon-tag.obj #CFLAGS = /dWIN32 /bm /fr -zq -i=. -5r -od -d2 /d2 /zm /fo=$(LIBEXIFDIR)\ all : libexif.lib test-mem.exe test-mnote.exe test-value.exe # test-tree.exe libexif.lib: $(LIBOBJECTS) - del libexif.lib * wlib -n libexif.lib $(LIBOBJECTS) $(LIBEXIFDIR)\exif-byte-order.obj : $(LIBEXIFDIR)\exif-byte-order.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-content.obj : $(LIBEXIFDIR)\exif-content.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-data.obj : $(LIBEXIFDIR)\exif-data.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-entry.obj : $(LIBEXIFDIR)\exif-entry.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-format.obj : $(LIBEXIFDIR)\exif-format.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-ifd.obj : $(LIBEXIFDIR)\exif-ifd.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-loader.obj : $(LIBEXIFDIR)\exif-loader.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-log.obj : $(LIBEXIFDIR)\exif-log.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-mnote-data.obj : $(LIBEXIFDIR)\exif-mnote-data.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-tag.obj : $(LIBEXIFDIR)\exif-tag.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-utils.obj : $(LIBEXIFDIR)\exif-utils.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-mnote-data-olympus.obj : $(LIBEXIFDIR)\olympus\exif-mnote-data-olympus.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\mnote-olympus-entry.obj : $(LIBEXIFDIR)\olympus\mnote-olympus-entry.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\mnote-olympus-tag.obj : $(LIBEXIFDIR)\olympus\mnote-olympus-tag.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-mnote-data-pentax.obj : $(LIBEXIFDIR)\pentax\exif-mnote-data-pentax.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\mnote-pentax-entry.obj : $(LIBEXIFDIR)\pentax\mnote-pentax-entry.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\mnote-pentax-tag.obj : $(LIBEXIFDIR)\pentax\mnote-pentax-tag.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\exif-mnote-data-canon.obj : $(LIBEXIFDIR)\canon\exif-mnote-data-canon.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\mnote-canon-entry.obj : $(LIBEXIFDIR)\canon\mnote-canon-entry.c $(CC) -c $(CFLAGS) $[* $(LIBEXIFDIR)\mnote-canon-tag.obj : $(LIBEXIFDIR)\canon\mnote-canon-tag.c $(CC) -c $(CFLAGS) $[* test-mem.exe : $(TESTEXIFDIR)\test-mem.c $(CC) $(CFLAGS) $(LDFRLAGS) $< libexif.lib test-mnote.exe : $(TESTEXIFDIR)\test-mnote.c $(CC) $(CFLAGS) $(LDFRLAGS) $< libexif.lib test-tree.exe : $(TESTEXIFDIR)\test-tree.c $(CC) $(CFLAGS) $(LDFRLAGS) $< libexif.lib test-value.exe : $(TESTEXIFDIR)\test-value.c $(CC) $(CFLAGS) $(LDFRLAGS) $< libexif.lib clean: .SYMBOLIC - del $(LIBEXIFDIR)\*.obj - del *.exe - del libexif.lib |
From: Lutz M. <lu...@us...> - 2004-10-05 18:57:33
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14635 Modified Files: ChangeLog Log Message: 2004-10-05 Lutz Mueller <lu...@us...> * contrib/watcom: Files contributed by Angela Wrobel. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.152 retrieving revision 1.153 diff -u -d -r1.152 -r1.153 --- ChangeLog 4 Oct 2004 06:32:36 -0000 1.152 +++ ChangeLog 5 Oct 2004 18:57:15 -0000 1.153 @@ -1,3 +1,7 @@ +2004-10-05 Lutz Mueller <lu...@us...> + + * contrib/watcom: Files contributed by Angela Wrobel. + 2004-10-04 Lutz Mueller <lu...@us...> * libexif/exif-mem.h: Documentation. |
From: Lutz M. <lu...@us...> - 2004-10-05 18:55:43
|
Update of /cvsroot/libexif/libexif/contrib/watcom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14181/watcom Log Message: Directory /cvsroot/libexif/libexif/contrib/watcom added to the repository |
From: Lutz M. <lu...@us...> - 2004-10-04 06:32:50
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11422/libexif Modified Files: exif-mem.h Log Message: 2004-10-04 Lutz Mueller <lu...@us...> * libexif/exif-mem.h: Documentation. Index: exif-mem.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-mem.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- exif-mem.h 4 Oct 2004 06:26:59 -0000 1.2 +++ exif-mem.h 4 Oct 2004 06:32:36 -0000 1.3 @@ -27,7 +27,9 @@ extern "C" { #endif /* __cplusplus */ +/* Should work like calloc: Needs to return initialized memory. */ typedef void * (* ExifMemAllocFunc) (ExifLong); + typedef void * (* ExifMemReallocFunc) (void *, ExifLong); typedef void (* ExifMemFreeFunc) (void *); |
From: Lutz M. <lu...@us...> - 2004-10-04 06:32:49
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11422 Modified Files: ChangeLog Log Message: 2004-10-04 Lutz Mueller <lu...@us...> * libexif/exif-mem.h: Documentation. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.151 retrieving revision 1.152 diff -u -d -r1.151 -r1.152 --- ChangeLog 4 Oct 2004 06:26:58 -0000 1.151 +++ ChangeLog 4 Oct 2004 06:32:36 -0000 1.152 @@ -1,5 +1,9 @@ 2004-10-04 Lutz Mueller <lu...@us...> + * libexif/exif-mem.h: Documentation. + +2004-10-04 Lutz Mueller <lu...@us...> + * libexif/*: Finish replaceable memory-management. 2004-10-02 Lutz Mueller <lu...@us...> |
From: Lutz M. <lu...@us...> - 2004-10-04 06:27:13
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10678/libexif Modified Files: exif-content.c exif-data.c exif-entry.c exif-loader.c exif-log.c exif-log.h exif-mem.c exif-mem.h exif-mnote-data-priv.h exif-mnote-data.c Log Message: 2004-10-04 Lutz Mueller <lu...@us...> * libexif/*: Finish replaceable memory-management. Index: exif-log.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-log.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- exif-log.c 9 Sep 2004 06:27:21 -0000 1.3 +++ exif-log.c 4 Oct 2004 06:26:59 -0000 1.4 @@ -30,6 +30,8 @@ ExifLogFunc func; void *data; + + ExifMem *mem; }; static struct { @@ -65,15 +67,28 @@ } ExifLog * -exif_log_new (void) +exif_log_new_mem (ExifMem *mem) { ExifLog *log; - log = malloc (sizeof (ExifLog)); + log = exif_mem_alloc (mem, sizeof (ExifLog)); if (!log) return NULL; - memset (log, 0, sizeof (ExifLog)); log->ref_count = 1; + log->mem = mem; + exif_mem_ref (mem); + + return log; +} + +ExifLog * +exif_log_new (void) +{ + ExifMem *mem = exif_mem_new_default (); + ExifLog *log = exif_log_new_mem (mem); + + exif_mem_unref (mem); + return log; } @@ -96,8 +111,8 @@ exif_log_free (ExifLog *log) { if (!log) return; - memset (log, 0, sizeof (ExifLog)); - free (log); + + exif_mem_free (log->mem, log); } void Index: exif-mnote-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-mnote-data.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- exif-mnote-data.c 13 Jul 2004 15:16:37 -0000 1.7 +++ exif-mnote-data.c 4 Oct 2004 06:26:59 -0000 1.8 @@ -31,14 +31,17 @@ }; void -exif_mnote_data_construct (ExifMnoteData *d) +exif_mnote_data_construct (ExifMnoteData *d, ExifMem *mem) { - if (!d) return; + if (!d || !mem) return; if (d->priv) return; - d->priv = malloc (sizeof (ExifMnoteDataPriv)); + d->priv = exif_mem_alloc (mem, sizeof (ExifMnoteDataPriv)); if (!d->priv) return; - memset (d->priv, 0, sizeof (ExifMnoteDataPriv)); + d->priv->ref_count = 1; + + d->mem = mem; + exif_mem_ref (mem); } void @@ -53,9 +56,11 @@ if (!d) return; if (d->priv) { if (d->methods.free) d->methods.free (d); - free (d->priv); + exif_mem_free (d->mem, d->priv); d->priv = NULL; } + exif_mem_unref (d->mem); + d->mem = NULL; } void Index: exif-content.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-content.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- exif-content.c 2 Oct 2004 05:55:25 -0000 1.11 +++ exif-content.c 4 Oct 2004 06:26:59 -0000 1.12 @@ -39,11 +39,9 @@ ExifContent * exif_content_new (void) { - ExifContent *content; - ExifMem *mem = exif_mem_new (exif_mem_alloc_func, - exif_mem_realloc_func, exif_mem_free_func); + ExifMem *mem = exif_mem_new_default (); + ExifContent *content = exif_content_new_mem (mem); - content = exif_content_new_mem (mem); exif_mem_unref (mem); return content; Index: exif-mnote-data-priv.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-mnote-data-priv.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- exif-mnote-data-priv.h 13 Jul 2004 15:16:37 -0000 1.6 +++ exif-mnote-data-priv.h 4 Oct 2004 06:26:59 -0000 1.7 @@ -60,9 +60,12 @@ /* Logging */ ExifLog *log; + + /* Memory management */ + ExifMem *mem; }; -void exif_mnote_data_construct (ExifMnoteData *); +void exif_mnote_data_construct (ExifMnoteData *, ExifMem *mem); void exif_mnote_data_set_byte_order (ExifMnoteData *, ExifByteOrder); void exif_mnote_data_set_offset (ExifMnoteData *, unsigned int); Index: exif-loader.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- exif-loader.c 2 Oct 2004 05:55:26 -0000 1.11 +++ exif-loader.c 4 Oct 2004 06:26:59 -0000 1.12 @@ -183,11 +183,9 @@ ExifLoader * exif_loader_new (void) { - ExifLoader *l; - ExifMem *mem = exif_mem_new (exif_mem_alloc_func, - exif_mem_realloc_func, exif_mem_free_func); + ExifMem *mem = exif_mem_new_default (); + ExifLoader *l = exif_loader_new_mem (mem); - l = exif_loader_new_mem (mem); exif_mem_unref (mem); return l; Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- exif-data.c 2 Oct 2004 05:55:25 -0000 1.49 +++ exif-data.c 4 Oct 2004 06:26:59 -0000 1.50 @@ -82,11 +82,9 @@ ExifData * exif_data_new (void) { - ExifData *d; - ExifMem *mem = exif_mem_new (exif_mem_alloc_func, - exif_mem_realloc_func, exif_mem_free_func); + ExifMem *mem = exif_mem_new_default (); + ExifData *d = exif_data_new_mem (mem); - d = exif_data_new_mem (mem); exif_mem_unref (mem); return d; @@ -705,7 +703,7 @@ /* Olympus & Nikon */ if ((e->size >= 5) && (!memcmp (e->data, "OLYMP", 5) || !memcmp (e->data, "Nikon", 5))) { - data->priv->md = exif_mnote_data_olympus_new (); + data->priv->md = exif_mnote_data_olympus_new (data->priv->mem); } else { char value[7]; em = exif_data_get_entry (data, EXIF_TAG_MAKE); @@ -713,9 +711,9 @@ if ((e->size >= 2) && (e->data[0] == 0x00) && (e->data[1] == 0x1b)) { if (em && !strncasecmp (exif_entry_get_value (em, value, sizeof(value)), "Nikon", 5)) { - data->priv->md = exif_mnote_data_olympus_new (); + data->priv->md = exif_mnote_data_olympus_new (data->priv->mem); } else { - data->priv->md = exif_mnote_data_pentax_new (); + data->priv->md = exif_mnote_data_pentax_new (data->priv->mem); } } else { @@ -723,7 +721,7 @@ if (em) { if (!strcmp (exif_entry_get_value (em, value, sizeof(value)), "Canon")) - data->priv->md = exif_mnote_data_canon_new (); + data->priv->md = exif_mnote_data_canon_new (data->priv->mem); } } } Index: exif-log.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-log.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- exif-log.h 12 Sep 2004 19:52:23 -0000 1.4 +++ exif-log.h 4 Oct 2004 06:26:59 -0000 1.5 @@ -25,14 +25,16 @@ extern "C" { #endif /* __cplusplus */ +#include <libexif/exif-mem.h> #include <stdarg.h> typedef struct _ExifLog ExifLog; -ExifLog *exif_log_new (void); -void exif_log_ref (ExifLog *log); -void exif_log_unref (ExifLog *log); -void exif_log_free (ExifLog *log); +ExifLog *exif_log_new (void); +ExifLog *exif_log_new_mem (ExifMem *); +void exif_log_ref (ExifLog *log); +void exif_log_unref (ExifLog *log); +void exif_log_free (ExifLog *log); typedef enum { EXIF_LOG_CODE_NONE, Index: exif-entry.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-entry.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- exif-entry.c 2 Oct 2004 05:55:25 -0000 1.65 +++ exif-entry.c 4 Oct 2004 06:26:59 -0000 1.66 @@ -98,11 +98,9 @@ ExifEntry * exif_entry_new (void) { - ExifEntry *e; - ExifMem *mem = exif_mem_new (exif_mem_alloc_func, - exif_mem_realloc_func, exif_mem_free_func); + ExifMem *mem = exif_mem_new_default (); + ExifEntry *e = exif_entry_new_mem (mem); - e = exif_entry_new_mem (mem); exif_mem_unref (mem); return e; Index: exif-mem.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-mem.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- exif-mem.h 2 Oct 2004 05:55:26 -0000 1.1 +++ exif-mem.h 4 Oct 2004 06:26:59 -0000 1.2 @@ -43,9 +43,7 @@ void exif_mem_free (ExifMem *, void *); /* For your convenience */ -void *exif_mem_alloc_func (ExifLong); -void *exif_mem_realloc_func (void *, ExifLong); -void exif_mem_free_func (void *); +ExifMem *exif_mem_new_default (void); #ifdef __cplusplus } Index: exif-mem.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-mem.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- exif-mem.c 2 Oct 2004 05:55:26 -0000 1.1 +++ exif-mem.c 4 Oct 2004 06:26:59 -0000 1.2 @@ -9,19 +9,19 @@ ExifMemFreeFunc free_func; }; -void * +static void * exif_mem_alloc_func (ExifLong ds) { return calloc ((size_t) ds, 1); } -void * +static void * exif_mem_realloc_func (void *d, ExifLong ds) { return realloc (d, (size_t) ds); } -void +static void exif_mem_free_func (void *d) { free (d); @@ -86,3 +86,10 @@ { return (mem && mem->realloc_func) ? mem->realloc_func (d, ds) : NULL; } + +ExifMem * +exif_mem_new_default (void) +{ + return exif_mem_new (exif_mem_alloc_func, exif_mem_realloc_func, + exif_mem_free_func); +} |
From: Lutz M. <lu...@us...> - 2004-10-04 06:27:12
|
Update of /cvsroot/libexif/libexif/libexif/pentax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10678/libexif/pentax Modified Files: exif-mnote-data-pentax.c exif-mnote-data-pentax.h Log Message: 2004-10-04 Lutz Mueller <lu...@us...> * libexif/*: Finish replaceable memory-management. Index: exif-mnote-data-pentax.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/pentax/exif-mnote-data-pentax.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- exif-mnote-data-pentax.h 26 Oct 2003 22:30:27 -0000 1.2 +++ exif-mnote-data-pentax.h 4 Oct 2004 06:26:59 -0000 1.3 @@ -25,6 +25,7 @@ #include <libexif/exif-mnote-data.h> #include <libexif/exif-mnote-data-priv.h> #include <libexif/pentax/mnote-pentax-entry.h> +#include <libexif/exif-mem.h> typedef struct _ExifMnoteDataPentax ExifMnoteDataPentax; @@ -38,6 +39,6 @@ unsigned int offset; }; -ExifMnoteData *exif_mnote_data_pentax_new (void); +ExifMnoteData *exif_mnote_data_pentax_new (ExifMem *); #endif /* __EXIF_MNOTE_DATA_PENTAX_H__ */ Index: exif-mnote-data-pentax.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/pentax/exif-mnote-data-pentax.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- exif-mnote-data-pentax.c 26 Aug 2004 20:08:09 -0000 1.8 +++ exif-mnote-data-pentax.c 4 Oct 2004 06:26:59 -0000 1.9 @@ -33,6 +33,7 @@ static void exif_mnote_data_pentax_clear (ExifMnoteDataPentax *n) { + ExifMnoteData *d = (ExifMnoteData *) n; unsigned int i; if (!n) return; @@ -40,10 +41,10 @@ if (n->entries) { for (i = 0; i < n->count; i++) if (n->entries[i].data) { - free (n->entries[i].data); + exif_mem_free (d->mem, n->entries[i].data); n->entries[i].data = NULL; } - free (n->entries); + exif_mem_free (d->mem, n->entries); n->entries = NULL; n->count = 0; } @@ -78,9 +79,8 @@ /* Number of entries */ if (buf_size < 2) return; c = exif_get_short (buf + 6 + n->offset, n->order); - n->entries = malloc (sizeof (MnotePentaxEntry) * c); + n->entries = exif_mem_alloc (en->mem, sizeof (MnotePentaxEntry) * c); if (!n->entries) return; - memset (n->entries, 0, sizeof (MnotePentaxEntry) * c); for (i = 0; i < c; i++) { o = 6 + 2 + n->offset + 12 * i; @@ -104,9 +104,8 @@ if (o + s > buf_size) return; /* Sanity check */ - n->entries[i].data = malloc (sizeof (char) * s); + n->entries[i].data = exif_mem_alloc (en->mem, sizeof (char) * s); if (!n->entries[i].data) return; - memset (n->entries[i].data, 0, sizeof (char) * s); n->entries[i].size = s; memcpy (n->entries[i].data, buf + o, s); } @@ -234,14 +233,16 @@ } ExifMnoteData * -exif_mnote_data_pentax_new (void) +exif_mnote_data_pentax_new (ExifMem *mem) { ExifMnoteData *d; - d = calloc (1, sizeof (ExifMnoteDataPentax)); + if (!mem) return NULL; + + d = exif_mem_alloc (mem, sizeof (ExifMnoteDataPentax)); if (!d) return NULL; - exif_mnote_data_construct (d); + exif_mnote_data_construct (d, mem); /* Set up function pointers */ d->methods.free = exif_mnote_data_pentax_free; |
From: Lutz M. <lu...@us...> - 2004-10-04 06:27:12
|
Update of /cvsroot/libexif/libexif/libexif/canon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10678/libexif/canon Modified Files: exif-mnote-data-canon.c exif-mnote-data-canon.h Log Message: 2004-10-04 Lutz Mueller <lu...@us...> * libexif/*: Finish replaceable memory-management. Index: exif-mnote-data-canon.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/canon/exif-mnote-data-canon.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- exif-mnote-data-canon.c 13 Jul 2004 15:16:37 -0000 1.6 +++ exif-mnote-data-canon.c 4 Oct 2004 06:26:59 -0000 1.7 @@ -35,6 +35,7 @@ static void exif_mnote_data_canon_clear (ExifMnoteDataCanon *n) { + ExifMnoteData *d = (ExifMnoteData *) n; unsigned int i; if (!n) return; @@ -42,10 +43,10 @@ if (n->entries) { for (i = 0; i < n->count; i++) if (n->entries[i].data) { - free (n->entries[i].data); + exif_mem_free (d->mem, n->entries[i].data); n->entries[i].data = NULL; } - free (n->entries); + exif_mem_free (d->mem, n->entries); n->entries = NULL; n->count = 0; } @@ -159,9 +160,8 @@ * of entries. */ *buf_size = 2 + n->count * 12 + 4; - *buf = malloc (sizeof (char) * *buf_size); + *buf = exif_mem_alloc (ne->mem, sizeof (char) * *buf_size); if (!*buf) return; - memset (*buf, 0, sizeof (char) * *buf_size); /* Save the number of entries */ exif_set_short (*buf, n->order, (ExifShort) n->count); @@ -230,9 +230,8 @@ if (o + s > buf_size) return; /* Sanity check */ - n->entries[i].data = malloc (sizeof (char) * s); + n->entries[i].data = exif_mem_alloc (ne->mem, sizeof (char) * s); if (!n->entries[i].data) return; - memset (n->entries[i].data, 0, sizeof (char) * s); n->entries[i].size = s; memcpy (n->entries[i].data, buf + o, s); } @@ -284,14 +283,16 @@ } ExifMnoteData * -exif_mnote_data_canon_new (void) +exif_mnote_data_canon_new (ExifMem *mem) { ExifMnoteData *d; - d = calloc (1, sizeof (ExifMnoteDataCanon)); + if (!mem) return NULL; + + d = exif_mem_alloc (mem, sizeof (ExifMnoteDataCanon)); if (!d) return NULL; - exif_mnote_data_construct (d); + exif_mnote_data_construct (d, mem); /* Set up function pointers */ d->methods.free = exif_mnote_data_canon_free; Index: exif-mnote-data-canon.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/canon/exif-mnote-data-canon.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- exif-mnote-data-canon.h 26 Oct 2003 22:30:26 -0000 1.2 +++ exif-mnote-data-canon.h 4 Oct 2004 06:26:59 -0000 1.3 @@ -24,6 +24,7 @@ #include <libexif/exif-byte-order.h> #include <libexif/exif-mnote-data.h> #include <libexif/exif-mnote-data-priv.h> +#include <libexif/exif-mem.h> typedef struct _ExifMnoteDataCanon ExifMnoteDataCanon; @@ -39,6 +40,6 @@ unsigned int offset; }; -ExifMnoteData *exif_mnote_data_canon_new (void); +ExifMnoteData *exif_mnote_data_canon_new (ExifMem *mem); #endif /* __EXIF_MNOTE_DATA_CANON_H__ */ |
From: Lutz M. <lu...@us...> - 2004-10-04 06:27:11
|
Update of /cvsroot/libexif/libexif/libexif/olympus In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10678/libexif/olympus Modified Files: exif-mnote-data-olympus.c exif-mnote-data-olympus.h Log Message: 2004-10-04 Lutz Mueller <lu...@us...> * libexif/*: Finish replaceable memory-management. Index: exif-mnote-data-olympus.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/olympus/exif-mnote-data-olympus.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- exif-mnote-data-olympus.h 11 May 2004 15:11:17 -0000 1.3 +++ exif-mnote-data-olympus.h 4 Oct 2004 06:26:59 -0000 1.4 @@ -24,6 +24,7 @@ #include <libexif/exif-mnote-data-priv.h> #include <libexif/olympus/mnote-olympus-entry.h> #include <libexif/exif-byte-order.h> +#include <libexif/exif-mem.h> typedef struct _ExifMnoteDataOlympus ExifMnoteDataOlympus; @@ -39,6 +40,6 @@ int version; }; -ExifMnoteData *exif_mnote_data_olympus_new (void); +ExifMnoteData *exif_mnote_data_olympus_new (ExifMem *); #endif /* __MNOTE_OLYMPUS_CONTENT_H__ */ Index: exif-mnote-data-olympus.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/olympus/exif-mnote-data-olympus.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- exif-mnote-data-olympus.c 12 Sep 2004 19:52:39 -0000 1.19 +++ exif-mnote-data-olympus.c 4 Oct 2004 06:26:59 -0000 1.20 @@ -33,6 +33,7 @@ static void exif_mnote_data_olympus_clear (ExifMnoteDataOlympus *n) { + ExifMnoteData *d = (ExifMnoteData *) n; unsigned int i; if (!n) return; @@ -40,10 +41,10 @@ if (n->entries) { for (i = 0; i < n->count; i++) if (n->entries[i].data) { - free (n->entries[i].data); + exif_mem_free (d->mem, n->entries[i].data); n->entries[i].data = NULL; } - free (n->entries); + exif_mem_free (d->mem, n->entries); n->entries = NULL; n->count = 0; } @@ -86,9 +87,8 @@ *buf_size = 6 + 2 + 2 + n->count * 12; switch (n->version) { case 0: /* Olympus */ - *buf = malloc (*buf_size); + *buf = exif_mem_alloc (ne->mem, *buf_size); if (!*buf) return; - memset (*buf, 0, *buf_size); /* Write the header and the number of entries. */ strcpy (*buf, "OLYMP"); @@ -101,9 +101,8 @@ /* Fall through */ case 2: /* Nikon v2 */ *buf_size += 8; - *buf = malloc (*buf_size); + *buf = exif_mem_alloc (ne->mem, *buf_size); if (!*buf) return; - memset (*buf, 0, *buf_size); /* Write the header and the number of entries. */ strcpy (*buf, "Nikon"); @@ -267,9 +266,8 @@ /* Read the number of entries and remove old ones. */ exif_mnote_data_olympus_clear (n); - n->entries = malloc (sizeof (MnoteOlympusEntry) * c); + n->entries = exif_mem_alloc (en->mem, sizeof (MnoteOlympusEntry) * c); if (!n->entries) return; - memset (n->entries, 0, sizeof (MnoteOlympusEntry) * c); /* Parse the entries */ for (i = 0; i < c; i++) { @@ -298,7 +296,7 @@ if (o + s > buf_size) continue; /* Sanity check */ - n->entries[i].data = malloc (s); + n->entries[i].data = exif_mem_alloc (en->mem, s); if (!n->entries[i].data) continue; n->entries[i].size = s; memcpy (n->entries[i].data, buf + o, s); @@ -428,14 +426,16 @@ } ExifMnoteData * -exif_mnote_data_olympus_new (void) +exif_mnote_data_olympus_new (ExifMem *mem) { ExifMnoteData *d; - d = calloc (1, sizeof (ExifMnoteDataOlympus)); + if (!mem) return NULL; + + d = exif_mem_alloc (mem, sizeof (ExifMnoteDataOlympus)); if (!d) return NULL; - exif_mnote_data_construct (d); + exif_mnote_data_construct (d, mem); /* Set up function pointers */ d->methods.free = exif_mnote_data_olympus_free; |
From: Lutz M. <lu...@us...> - 2004-10-04 06:27:09
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10678 Modified Files: ChangeLog Log Message: 2004-10-04 Lutz Mueller <lu...@us...> * libexif/*: Finish replaceable memory-management. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.150 retrieving revision 1.151 diff -u -d -r1.150 -r1.151 --- ChangeLog 2 Oct 2004 05:55:24 -0000 1.150 +++ ChangeLog 4 Oct 2004 06:26:58 -0000 1.151 @@ -1,3 +1,7 @@ +2004-10-04 Lutz Mueller <lu...@us...> + + * libexif/*: Finish replaceable memory-management. + 2004-10-02 Lutz Mueller <lu...@us...> * libexif/exif-mem.[c,h]: New. First attempt to offer out-sourcing |
From: Lutz M. <lu...@us...> - 2004-10-02 05:57:12
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24033/libexif Modified Files: Makefile.am exif-content.c exif-content.h exif-data.c exif-data.h exif-entry.c exif-entry.h exif-loader.c exif-loader.h Added Files: exif-mem.c exif-mem.h Log Message: 2004-10-02 Lutz Mueller <lu...@us...> * libexif/exif-mem.[c,h]: New. First attempt to offer out-sourcing of memory management. Index: exif-content.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-content.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- exif-content.c 16 May 2004 14:06:37 -0000 1.10 +++ exif-content.c 2 Oct 2004 05:55:25 -0000 1.11 @@ -32,27 +32,46 @@ struct _ExifContentPrivate { unsigned int ref_count; + + ExifMem *mem; }; ExifContent * exif_content_new (void) { ExifContent *content; + ExifMem *mem = exif_mem_new (exif_mem_alloc_func, + exif_mem_realloc_func, exif_mem_free_func); - content = malloc (sizeof (ExifContent)); + content = exif_content_new_mem (mem); + exif_mem_unref (mem); + + return content; +} + +ExifContent * +exif_content_new_mem (ExifMem *mem) +{ + ExifContent *content; + + if (!mem) return NULL; + + content = exif_mem_alloc (mem, (ExifLong) sizeof (ExifContent)); if (!content) - return (NULL); - memset (content, 0, sizeof (ExifContent)); - content->priv = malloc (sizeof (ExifContentPrivate)); + return NULL; + content->priv = exif_mem_alloc (mem, + (ExifLong) sizeof (ExifContentPrivate)); if (!content->priv) { - free (content); - return (NULL); + exif_mem_free (mem, content); + return NULL; } - memset (content->priv, 0, sizeof (ExifContentPrivate)); content->priv->ref_count = 1; - return (content); + content->priv->mem = mem; + exif_mem_ref (mem); + + return content; } void @@ -74,11 +93,17 @@ { unsigned int i; + if (!content) return; + for (i = 0; i < content->count; i++) exif_entry_unref (content->entries[i]); - free (content->entries); - free (content->priv); - free (content); + if (content->priv) { + ExifMem *mem = content->priv->mem; + exif_mem_free (mem, content->entries); + exif_mem_free (mem, content->priv); + exif_mem_free (mem, content); + exif_mem_unref (mem); + } } void @@ -103,14 +128,12 @@ void exif_content_add_entry (ExifContent *content, ExifEntry *entry) { - if (entry->parent) - return; + if (!content || !content->priv || !entry || entry->parent) return; entry->parent = content; - content->entries = realloc (content->entries, - sizeof (ExifEntry) * (content->count + 1)); - if (!content->entries) - return; + content->entries = exif_mem_realloc (content->priv->mem, + content->entries, sizeof (ExifEntry) * (content->count + 1)); + if (!content->entries) return; content->entries[content->count] = entry; exif_entry_ref (entry); content->count++; @@ -121,8 +144,7 @@ { unsigned int i; - if (!c || !e) return; - if (e->parent != c) return; + if (!c || !c->priv || !e || (e->parent != c)) return; /* Search the entry */ for (i = 0; i < c->count; i++) if (c->entries[i] == e) break; @@ -134,7 +156,8 @@ c->count--; e->parent = NULL; exif_entry_unref (e); - c->entries = realloc(c->entries,sizeof(ExifEntry) * c->count); + c->entries = exif_mem_realloc (c->priv->mem, c->entries, + sizeof(ExifEntry) * c->count); } ExifEntry * Index: exif-loader.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- exif-loader.c 15 Sep 2004 16:43:53 -0000 1.10 +++ exif-loader.c 2 Oct 2004 05:55:26 -0000 1.11 @@ -29,6 +29,7 @@ unsigned int ref_count; ExifLog *log; + ExifMem *mem; }; static void * @@ -36,13 +37,12 @@ { void *d; - if (!i) return NULL; + if (!l || !i) return NULL; - /* This is the only call to calloc in this file. */ - d = calloc (i, 1); + d = exif_mem_alloc (l->mem, i); if (d) return d; - if (l) EXIF_LOG_NO_MEMORY (l->log, "ExifLog", i); + EXIF_LOG_NO_MEMORY (l->log, "ExifLog", i); return NULL; } @@ -183,12 +183,30 @@ ExifLoader * exif_loader_new (void) { + ExifLoader *l; + ExifMem *mem = exif_mem_new (exif_mem_alloc_func, + exif_mem_realloc_func, exif_mem_free_func); + + l = exif_loader_new_mem (mem); + exif_mem_unref (mem); + + return l; +} + +ExifLoader * +exif_loader_new_mem (ExifMem *mem) +{ ExifLoader *loader; + + if (!mem) return NULL; - loader = exif_loader_alloc (NULL, sizeof (ExifLoader)); + loader = exif_mem_alloc (mem, sizeof (ExifLoader)); if (!loader) return NULL; loader->ref_count = 1; + loader->mem = mem; + exif_mem_ref (mem); + return loader; } @@ -198,21 +216,32 @@ if (loader) loader->ref_count++; } +static void +exif_loader_free (ExifLoader *loader) +{ + ExifMem *mem; + + if (!loader) return; + + mem = loader->mem; + exif_loader_reset (loader); + exif_mem_free (mem, loader); + exif_mem_unref (mem); +} + void exif_loader_unref (ExifLoader *loader) { if (!loader) return; - if (!--loader->ref_count) { - exif_loader_reset (loader); - free (loader); - } + if (!--loader->ref_count) + exif_loader_free (loader); } void exif_loader_reset (ExifLoader *loader) { if (!loader) return; - free (loader->buf); loader->buf = NULL; + exif_mem_free (loader->mem, loader->buf); loader->buf = NULL; loader->size = 0; loader->bytes_read = 0; loader->last_marker = 0; @@ -226,7 +255,7 @@ if (!loader) return NULL; - ed = exif_data_new (); + ed = exif_data_new_mem (loader->mem); exif_data_log (ed, loader->log); exif_data_load_data (ed, loader->buf, loader->bytes_read); Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- exif-data.c 17 Sep 2004 20:59:15 -0000 1.48 +++ exif-data.c 2 Oct 2004 05:55:25 -0000 1.49 @@ -51,6 +51,7 @@ ExifMnoteData *md; ExifLog *log; + ExifMem *mem; unsigned int ref_count; @@ -63,11 +64,12 @@ { void *d; - /* This is the only call to calloc in this file. */ - d = calloc (i, 1); + if (!data || !i) return NULL; + + d = exif_mem_alloc (data->priv->mem, i); if (d) return d; - if (data) EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", i); + EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", i); return NULL; } @@ -80,17 +82,35 @@ ExifData * exif_data_new (void) { + ExifData *d; + ExifMem *mem = exif_mem_new (exif_mem_alloc_func, + exif_mem_realloc_func, exif_mem_free_func); + + d = exif_data_new_mem (mem); + exif_mem_unref (mem); + + return d; +} + +ExifData * +exif_data_new_mem (ExifMem *mem) +{ ExifData *data; unsigned int i; - data = exif_data_alloc (NULL, sizeof (ExifData)); + if (!mem) return NULL; + + data = exif_mem_alloc (mem, sizeof (ExifData)); if (!data) return (NULL); - data->priv = exif_data_alloc (data, sizeof (ExifDataPrivate)); - if (!data->priv) { free (data); return (NULL); } + data->priv = exif_mem_alloc (mem, sizeof (ExifDataPrivate)); + if (!data->priv) { exif_mem_free (mem, data); return (NULL); } data->priv->ref_count = 1; + data->priv->mem = mem; + exif_mem_ref (mem); + for (i = 0; i < EXIF_IFD_COUNT; i++) { - data->ifd[i] = exif_content_new (); + data->ifd[i] = exif_content_new_mem (data->priv->mem); if (!data->ifd[i]) { exif_data_free (data); return (NULL); @@ -170,6 +190,8 @@ { unsigned int doff, s; + if (!data || !data->priv) return; + /* * Each entry is 12 bytes long. The memory for the entry has * already been allocated. @@ -181,7 +203,7 @@ /* If this is the maker note tag, update it. */ if ((e->tag == EXIF_TAG_MAKER_NOTE) && data->priv->md) { - free (e->data); + exif_mem_free (data->priv->mem, e->data); e->data = NULL; e->size = 0; exif_mnote_data_set_offset (data->priv->md, *ds - 6); @@ -200,7 +222,7 @@ if (s > 4) { doff = *ds - 6; *ds += s; - *d = realloc (*d, *ds); + *d = exif_mem_realloc (data->priv->mem, *d, *ds); if (!*d) { EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", *ds); return; @@ -225,7 +247,7 @@ (int) ds, (int) offset, (int) size); return; } - if (data->data) free (data->data); + if (data->data) exif_mem_free (data->priv->mem, data->data); data->size = size; data->data = exif_data_alloc (data, data->size); if (!data->data) return; @@ -243,6 +265,8 @@ unsigned int i; ExifTag tag; + if (!data || !data->priv) return; + /* Read the number of entries */ if (offset >= ds - 1) return; n = exif_get_short (d + offset, data->priv->order); @@ -308,7 +332,7 @@ * that the EXIF data does not follow the standard. */ if (!exif_tag_get_name (tag)) return; - entry = exif_entry_new (); + entry = exif_entry_new_mem (data->priv->mem); exif_content_add_entry (ifd, entry); exif_data_load_data_entry (data, entry, d, ds, offset + 12 * i); @@ -326,8 +350,7 @@ unsigned int j, n_ptr = 0, n_thumb = 0; ExifIfd i; - if (!data || !ifd || !d || !ds) - return; + if (!data || !data->priv || !ifd || !d || !ds) return; for (i = 0; i < EXIF_IFD_COUNT; i++) if (ifd == data->ifd[i]) @@ -370,7 +393,7 @@ * and the number of entries. */ *ds += (2 + (ifd->count + n_ptr + n_thumb) * 12 + 4); - *d = realloc (*d, *ds); + *d = exif_mem_realloc (data->priv->mem, *d, *ds); if (!*d) { EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", *ds); return; @@ -473,7 +496,7 @@ exif_set_long (*d + 6 + offset + 8, data->priv->order, *ds - 6); *ds += data->size; - *d = realloc (*d, *ds); + *d = exif_mem_realloc (data->priv->mem, *d, *ds); if (!*d) { EXIF_LOG_NO_MEMORY (data->priv->log, "ExifData", *ds); @@ -530,14 +553,10 @@ const unsigned char *d = d_orig; unsigned int ds = ds_orig, len; - if (!data) - return; - if (!d || !ds) - return; + if (!data || !data->priv || !d || !ds) return; -#ifdef DEBUG - printf ("Parsing %i byte(s) EXIF data...\n", ds); -#endif + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", + "Parsing %i byte(s) EXIF data...\n", ds); /* * It can be that the data starts with the EXIF header. If it does @@ -804,8 +823,7 @@ { unsigned int i; - if (!data) - return; + if (!data) return; for (i = 0; i < EXIF_IFD_COUNT; i++) { if (data->ifd[i]) { @@ -813,19 +831,21 @@ data->ifd[i] = NULL; } } - if (data->data) { - free (data->data); - data->data = NULL; - } + if (data->priv) { + ExifMem *mem = data->priv->mem; + if (data->data) { + exif_mem_free (data->priv->mem, data->data); + data->data = NULL; + } if (data->priv->md) { exif_mnote_data_unref (data->priv->md); data->priv->md = NULL; } - free (data->priv); - data->priv = NULL; + exif_mem_free (mem, data->priv); + exif_mem_free (mem, data); + exif_mem_unref (mem); } - free (data); } void --- NEW FILE: exif-mem.h --- (This appears to be a binary file; contents omitted.) Index: Makefile.am =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/Makefile.am,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Makefile.am 20 May 2004 10:50:35 -0000 1.26 +++ Makefile.am 2 Oct 2004 05:55:25 -0000 1.27 @@ -18,6 +18,7 @@ exif-ifd.c \ exif-loader.c \ exif-log.c \ + exif-mem.c \ exif-mnote-data.c \ exif-mnote-data-priv.h \ exif-tag.c \ @@ -38,6 +39,7 @@ exif-ifd.h \ exif-loader.h \ exif-log.h \ + exif-mem.h \ exif-mnote-data.h \ exif-result.h \ exif-tag.h \ Index: exif-content.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-content.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- exif-content.h 7 Jan 2004 23:36:16 -0000 1.9 +++ exif-content.h 2 Oct 2004 05:55:25 -0000 1.10 @@ -31,6 +31,7 @@ #include <libexif/exif-tag.h> #include <libexif/exif-entry.h> #include <libexif/exif-data.h> +#include <libexif/exif-mem.h> struct _ExifContent { @@ -44,10 +45,11 @@ }; /* Lifecycle */ -ExifContent *exif_content_new (void); -void exif_content_ref (ExifContent *content); -void exif_content_unref (ExifContent *content); -void exif_content_free (ExifContent *content); +ExifContent *exif_content_new (void); +ExifContent *exif_content_new_mem (ExifMem *); +void exif_content_ref (ExifContent *content); +void exif_content_unref (ExifContent *content); +void exif_content_free (ExifContent *content); void exif_content_add_entry (ExifContent *content, ExifEntry *e); void exif_content_remove_entry (ExifContent *content, ExifEntry *e); Index: exif-entry.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-entry.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- exif-entry.h 17 Sep 2004 20:59:15 -0000 1.11 +++ exif-entry.h 2 Oct 2004 05:55:26 -0000 1.12 @@ -30,6 +30,7 @@ #include <libexif/exif-content.h> #include <libexif/exif-format.h> +#include <libexif/exif-mem.h> struct _ExifEntry { ExifTag tag; @@ -46,9 +47,10 @@ }; /* Lifecycle */ -ExifEntry *exif_entry_new (void); -void exif_entry_ref (ExifEntry *entry); -void exif_entry_unref (ExifEntry *entry); +ExifEntry *exif_entry_new (void); +ExifEntry *exif_entry_new_mem (ExifMem *); +void exif_entry_ref (ExifEntry *entry); +void exif_entry_unref (ExifEntry *entry); void exif_entry_free (ExifEntry *entry); void exif_entry_initialize (ExifEntry *entry, ExifTag tag); Index: exif-loader.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- exif-loader.h 20 May 2004 10:50:35 -0000 1.2 +++ exif-loader.h 2 Oct 2004 05:55:26 -0000 1.3 @@ -24,6 +24,7 @@ #include <libexif/exif-data.h> #include <libexif/exif-loader.h> #include <libexif/exif-log.h> +#include <libexif/exif-mem.h> #ifdef __cplusplus extern "C" { @@ -31,9 +32,10 @@ typedef struct _ExifLoader ExifLoader; -ExifLoader *exif_loader_new (void); -void exif_loader_ref (ExifLoader *); -void exif_loader_unref (ExifLoader *); +ExifLoader *exif_loader_new (void); +ExifLoader *exif_loader_new_mem (ExifMem *); +void exif_loader_ref (ExifLoader *); +void exif_loader_unref (ExifLoader *); void exif_loader_write_file (ExifLoader *, const char *fname); Index: exif-entry.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-entry.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- exif-entry.c 1 Oct 2004 12:26:17 -0000 1.64 +++ exif-entry.c 2 Oct 2004 05:55:25 -0000 1.65 @@ -39,6 +39,8 @@ struct _ExifEntryPrivate { unsigned int ref_count; + + ExifMem *mem; }; /* This function is hidden in exif-data.c */ @@ -63,16 +65,14 @@ void *d; ExifLog *l = NULL; - if (!i) return NULL; + if (!e || !e->priv || !i) return NULL; - /* This is the only call to calloc in this file. */ - d = calloc (i, 1); + d = exif_mem_alloc (e->priv->mem, i); if (d) return d; - if (e && e->parent && e->parent->parent) + if (e->parent && e->parent->parent) l = exif_data_get_log (e->parent->parent); EXIF_LOG_NO_MEMORY (l, "ExifEntry", i); - return NULL; } @@ -82,38 +82,53 @@ void *d; ExifLog *l = NULL; - if (!i) { free (d_orig); return NULL; } + if (!e || !e->priv) return NULL; - /* This is the only call to realloc in this file. */ - d = realloc (d_orig, i); + if (!i) { exif_mem_free (e->priv->mem, d_orig); return NULL; } + + d = exif_mem_realloc (e->priv->mem, d_orig, i); if (d) return d; - if (e && e->parent && e->parent->parent) + if (e->parent && e->parent->parent) l = exif_data_get_log (e->parent->parent); EXIF_LOG_NO_MEMORY (l, "ExifEntry", i); - return NULL; } ExifEntry * exif_entry_new (void) { + ExifEntry *e; + ExifMem *mem = exif_mem_new (exif_mem_alloc_func, + exif_mem_realloc_func, exif_mem_free_func); + + e = exif_entry_new_mem (mem); + exif_mem_unref (mem); + + return e; +} + +ExifEntry * +exif_entry_new_mem (ExifMem *mem) +{ ExifEntry *e = NULL; - e = exif_entry_alloc (e, sizeof (ExifEntry)); + e = exif_mem_alloc (mem, sizeof (ExifEntry)); if (!e) return NULL; - e->priv = exif_entry_alloc (e, sizeof (ExifEntryPrivate)); - if (!e->priv) { free (e); return NULL; } + e->priv = exif_mem_alloc (mem, sizeof (ExifEntryPrivate)); + if (!e->priv) { exif_mem_free (mem, e); return NULL; } e->priv->ref_count = 1; - return (e); + e->priv->mem = mem; + exif_mem_ref (mem); + + return e; } void exif_entry_ref (ExifEntry *e) { - if (!e) - return; + if (!e) return; e->priv->ref_count++; } @@ -121,8 +136,7 @@ void exif_entry_unref (ExifEntry *e) { - if (!e) - return; + if (!e) return; e->priv->ref_count--; if (!e->priv->ref_count) @@ -132,13 +146,16 @@ void exif_entry_free (ExifEntry *e) { - if (!e) - return; + if (!e) return; - if (e->data) - free (e->data); - free (e->priv); - free (e); + if (e->priv) { + ExifMem *mem = e->priv->mem; + if (e->data) + exif_mem_free (mem, e->data); + exif_mem_free (mem, e->priv); + exif_mem_free (mem, e); + exif_mem_unref (mem); + } } void @@ -147,7 +164,7 @@ unsigned int i; ExifByteOrder o; - if (!e) return; + if (!e || !e->priv) return; switch (e->tag) { @@ -217,7 +234,7 @@ exif_entry_log (e, EXIF_LOG_CODE_DEBUG, "Tag 'UserComment' contained unnecessary " "data which has been removed."); - free (e->data); + exif_mem_free (e->priv->mem, e->data); e->data = NULL; e->size = 0; e->components = 0; Index: exif-data.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- exif-data.h 20 May 2004 10:50:35 -0000 1.8 +++ exif-data.h 2 Oct 2004 05:55:25 -0000 1.9 @@ -35,6 +35,7 @@ #include <libexif/exif-content.h> #include <libexif/exif-mnote-data.h> +#include <libexif/exif-mem.h> struct _ExifData { @@ -46,7 +47,8 @@ ExifDataPrivate *priv; }; -ExifData *exif_data_new (void); +ExifData *exif_data_new (void); +ExifData *exif_data_new_mem (ExifMem *); ExifData *exif_data_new_from_file (const char *path); ExifData *exif_data_new_from_data (const unsigned char *data, unsigned int size); --- NEW FILE: exif-mem.c --- #include <exif-mem.h> #include <stdlib.h> struct _ExifMem { unsigned int ref_count; ExifMemAllocFunc alloc_func; ExifMemReallocFunc realloc_func; ExifMemFreeFunc free_func; }; void * exif_mem_alloc_func (ExifLong ds) { return calloc ((size_t) ds, 1); } void * exif_mem_realloc_func (void *d, ExifLong ds) { return realloc (d, (size_t) ds); } void exif_mem_free_func (void *d) { free (d); } ExifMem * exif_mem_new (ExifMemAllocFunc alloc_func, ExifMemReallocFunc realloc_func, ExifMemFreeFunc free_func) { ExifMem *mem; if (!alloc_func || !realloc_func) return NULL; mem = alloc_func ? alloc_func (sizeof (ExifMem)) : realloc_func (NULL, sizeof (ExifMem)); if (!mem) return NULL; mem->ref_count = 1; mem->alloc_func = alloc_func; mem->realloc_func = realloc_func; mem->free_func = free_func; return mem; } void exif_mem_ref (ExifMem *mem) { if (!mem) return; mem->ref_count++; } void exif_mem_unref (ExifMem *mem) { if (!mem) return; if (!--mem->ref_count) exif_mem_free (mem, mem); } void exif_mem_free (ExifMem *mem, void *d) { if (!mem) return; if (mem->free_func) { mem->free_func (d); return; } } void * exif_mem_alloc (ExifMem *mem, ExifLong ds) { if (!mem) return NULL; if (mem->alloc_func || mem->realloc_func) return mem->alloc_func ? mem->alloc_func (ds) : mem->realloc_func (NULL, ds); return NULL; } void * exif_mem_realloc (ExifMem *mem, void *d, ExifLong ds) { return (mem && mem->realloc_func) ? mem->realloc_func (d, ds) : NULL; } |