From 594787580b3e649f1ba52606339f38345e636e2d Mon Sep 17 00:00:00 2001 From: titan Date: Fri, 16 Mar 2007 04:34:22 +0000 Subject: [PATCH] Make libexif an optional requirement now. You do not have to have it to use ephoto. SVN revision: 28763 --- configure.in | 22 +++++++++++++++------- po/ephoto.pot | 10 +++++----- src/bin/config.h.in | 6 +++--- src/bin/ephoto.h | 4 ++++ src/bin/ephoto_exif.c | 3 ++- src/bin/ephoto_main.c | 11 ++++++++--- 6 files changed, 37 insertions(+), 19 deletions(-) diff --git a/configure.in b/configure.in index c4dc9a5..d76b73d 100644 --- a/configure.in +++ b/configure.in @@ -73,11 +73,19 @@ AC_CHECK_HEADERS(sqlite3.h, ) AC_SUBST(SQLITE_LIBS) -AC_CHECK_HEADERS(libexif/exif-data.h, - EXIF_LIBS="$EXIF_LIBS -lexif", - AC_MSG_ERROR([Ephoto needs libexif to compile.]) - ) -AC_SUBST(EXIF_LIBS) +if pkg-config --exists 'sqlite3 >= 3.3'; then + have_sqlite3="Yes" +else + have_sqlite3="No" + AC_MSG_ERROR([Ephoto needs sqlite3 to compile.]) +fi + +if pkg-config --exists 'libexif >= 0.6.13'; then + have_exif="Yes" + AC_DEFINE(BUILD_EXIF_SUPPORT, 1, [Enable Exif Support]) +else + have_exif="No" +fi PROG="evas-config"; AC_PATH_PROG(EVAS_CONFIG, $PROG, "", $PATH) @@ -182,8 +190,8 @@ echo " Ecore ...........: Yes" echo " Edje ............: Yes" echo " Epsilon .........: Yes" echo " EWL .............: Yes" -echo " Libexif .........: Yes" -echo " Sqlite3 .........: Yes" +echo " Libexif .........: $have_exif" +echo " Sqlite3 .........: $have_sqlite3" echo echo "Installation Path.........: $prefix" echo diff --git a/po/ephoto.pot b/po/ephoto.pot index 8533952..4d4ec09 100644 --- a/po/ephoto.pot +++ b/po/ephoto.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-02-15 07:12-0600\n" +"POT-Creation-Date: 2007-03-15 17:29-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,22 +15,22 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/bin/ephoto_utils.c:43 +#: src/bin/ephoto_utils.c:9 #, c-format msgid "%'.0f Bytes" msgstr "" -#: src/bin/ephoto_utils.c:47 +#: src/bin/ephoto_utils.c:13 #, c-format msgid "%'.0f KB" msgstr "" -#: src/bin/ephoto_utils.c:51 +#: src/bin/ephoto_utils.c:17 #, c-format msgid "%'.0f MB" msgstr "" -#: src/bin/ephoto_utils.c:55 +#: src/bin/ephoto_utils.c:21 #, c-format msgid "%'.1f GB" msgstr "" diff --git a/src/bin/config.h.in b/src/bin/config.h.in index 088f5a6..32fea76 100644 --- a/src/bin/config.h.in +++ b/src/bin/config.h.in @@ -1,5 +1,8 @@ /* src/bin/config.h.in. Generated from configure.in by autoheader. */ +/* Enable Exif Support */ +#undef BUILD_EXIF_SUPPORT + /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS @@ -20,9 +23,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBEXIF_EXIF_DATA_H - /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h index 892d963..1ba9e45 100644 --- a/src/bin/ephoto.h +++ b/src/bin/ephoto.h @@ -8,8 +8,10 @@ #include #include #include +#ifdef BUILD_EXIF_SUPPORT #include #include +#endif #include #include #include @@ -47,8 +49,10 @@ Ecore_List *get_directories(const char *directory); Ecore_List *get_images(const char *directory); /* Ephoto Exif */ +#ifdef BUILD_EXIF_SUPPORT Ecore_Hash *get_exif_data(const char *file); void display_exif_dialog(Ewl_Widget *w, void *event, void *data); +#endif /* Ephoto Databasing */ sqlite3 *ephoto_db_init(void); diff --git a/src/bin/ephoto_exif.c b/src/bin/ephoto_exif.c index 853da2b..1e08d4b 100644 --- a/src/bin/ephoto_exif.c +++ b/src/bin/ephoto_exif.c @@ -1,5 +1,6 @@ #include "ephoto.h" +#ifdef BUILD_EXIF_SUPPORT static const char *get_image(void); static void close_dialog(Ewl_Widget *w, void *event, void *data); static void add_exif_to_container(Ewl_Widget *w, void *event, void *data); @@ -186,4 +187,4 @@ void display_exif_dialog(Ewl_Widget *w, void *event, void *data) return; } - +#endif diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c index ef8d7cd..29cb3a2 100644 --- a/src/bin/ephoto_main.c +++ b/src/bin/ephoto_main.c @@ -116,7 +116,7 @@ void create_main_gui(void) ewl_container_child_append(EWL_CONTAINER(vbox), hsep); ewl_widget_show(hsep); - em->toolbar = ewl_toolbar_new(); + em->toolbar = ewl_htoolbar_new(); ewl_box_spacing_set(EWL_BOX(em->toolbar), 5); ewl_object_minimum_h_set(EWL_OBJECT(em->toolbar), 30); ewl_object_alignment_set(EWL_OBJECT(em->toolbar), EWL_FLAG_ALIGN_CENTER); @@ -140,10 +140,15 @@ void create_main_gui(void) ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); ewl_widget_show(vsep); - button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/get_exif.png", display_exif_dialog, NULL); + button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/get_exif.png", NULL, NULL); ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 30); + ewl_attach_tooltip_text_set(button, "You do not have libexif 0.6.13"); +#ifdef BUILD_EXIF_SUPPORT + ewl_callback_append(button, EWL_CALLBACK_CLICKED, display_exif_dialog, NULL); ewl_attach_tooltip_text_set(button, "View Exif Data"); - button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/stock_fullscreen.png", window_fullscreen, NULL); +#endif + + button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/stock_fullscreen.png", window_fullscreen, NULL); ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 30); ewl_attach_tooltip_text_set(button, "Toggle Fullscreen");