diff --recursive -u gnome-launch-box-0.1/configure.ac gnome-launch-box-0.1-apkg/configure.ac --- gnome-launch-box-0.1/configure.ac 2008-01-31 21:50:01.000000000 +0100 +++ gnome-launch-box-0.1-apkg/configure.ac 2008-01-31 21:45:10.000000000 +0100 @@ -23,8 +23,15 @@ PKG_CHECK_MODULES(LB, gtk+-2.0 >= 2.4 \ gnome-vfs-2.0 \ libgnomeui-2.0 \ - libgnome-menu \ - libebook-1.2) + libgnome-menu) + +PKG_CHECK_MODULES(EVO, libebook-1.2, have_ebook=true, have_ebook=false) +AM_CONDITIONAL(EBOOK, test x$have_ebook = xtrue) + +if test x$have_ebook = xtrue; then + AC_DEFINE(HAVE_EBOOK, 1, [Have libebook-1.2.so]) + RELAYTOOL("ebook-1.2", EVO_LIBS, EVO_CFLAGS, ) +fi AC_OUTPUT([ Makefile diff --recursive -u gnome-launch-box-0.1/src/Makefile.am gnome-launch-box-0.1-apkg/src/Makefile.am --- gnome-launch-box-0.1/src/Makefile.am 2008-01-31 21:50:01.000000000 +0100 +++ gnome-launch-box-0.1-apkg/src/Makefile.am 2008-01-31 21:45:45.000000000 +0100 @@ -1,7 +1,7 @@ AM_CPPFLAGS = \ -DMENU_I_KNOW_THIS_IS_UNSTABLE \ - -DIMAGEDIR=\"$(datadir)/lb/images\" \ - @LB_CFLAGS@ + -DDATADIR=\"$(datadir)\" \ + @LB_CFLAGS@ @EVO_CFLAGS@ bin_PROGRAMS = gnome-launch-box @@ -27,8 +27,6 @@ lb-module.h \ lb-module-bookmarks.c \ lb-module-bookmarks.h \ - lb-module-evolution.c \ - lb-module-evolution.h \ lb-module-manager.c \ lb-module-manager.h \ lb-module-dummy.c \ @@ -53,9 +51,14 @@ lb-xml-parser.c \ lb-xml-parser.h \ bacon-message-connection.c \ - bacon-message-connection.h + bacon-message-connection.h \ + binreloc.c -gnome_launch_box_LDADD = @LB_LIBS@ +gnome_launch_box_LDADD = @LB_LIBS@ @EVO_LIBS@ + +if EBOOK +gnome_launch_box_SOURCES += lb-module-evolution.c lb-module-evolution.h +endif lb-marshal.h: lb-marshal.list (cd $(srcdir) && \ diff --recursive -u gnome-launch-box-0.1/src/lb-module-manager.c gnome-launch-box-0.1-apkg/src/lb-module-manager.c --- gnome-launch-box-0.1/src/lb-module-manager.c 2008-01-31 21:50:01.000000000 +0100 +++ gnome-launch-box-0.1-apkg/src/lb-module-manager.c 2008-01-31 21:45:45.000000000 +0100 @@ -30,7 +30,9 @@ #include "lb-module-applications.h" #include "lb-module-bookmarks.h" -#include "lb-module-evolution.h" +#ifdef HAVE_EBOOK +# include "lb-module-evolution.h" +#endif #include "lb-module-manager.h" #include "lb-module-recent.h" #include "lb-module-files.h" @@ -70,6 +72,8 @@ #endif } +RELAYTOOL_EBOOK_1_2 + static void lb_module_manager_init (LbModuleManager *manager) { @@ -82,9 +86,12 @@ manager->modules = g_list_append (manager->modules, g_object_new (LB_TYPE_MODULE_BOOKMARKS, NULL)); - manager->modules = g_list_append (manager->modules, - g_object_new (LB_TYPE_MODULE_EVOLUTION, - NULL)); +#ifdef HAVE_EBOOK + if (libebook_1_2_is_present) + manager->modules = g_list_append (manager->modules, + g_object_new (LB_TYPE_MODULE_EVOLUTION, + NULL)); +#endif manager->modules = g_list_append (manager->modules, g_object_new (LB_TYPE_MODULE_FILES, NULL)); diff --recursive -u gnome-launch-box-0.1/src/lb-window.c gnome-launch-box-0.1-apkg/src/lb-window.c --- gnome-launch-box-0.1/src/lb-window.c 2008-01-31 21:50:01.000000000 +0100 +++ gnome-launch-box-0.1-apkg/src/lb-window.c 2008-01-31 21:45:45.000000000 +0100 @@ -36,6 +36,8 @@ #include "lb-utils.h" #include "lb-action.h" +#include "binreloc.h" + #define FRAME_SIZE 30 #define SEARCH_TIMEOUT 150 #define SEARCH_RESET_TIMEOUT 2000 @@ -871,6 +873,18 @@ } } +static gchar *imagedir; + +/* will be called automatically before main() */ +static void __attribute__((constructor)) +locate_image_dir () +{ + if (gbr_init (NULL)) + imagedir = g_build_filename (gbr_find_data_dir (DATADIR), "lb", "images", NULL); + else + imagedir = DATADIR "/lb/images"; +} + /* * Hack to get a transparent rounded window. */ @@ -881,15 +895,18 @@ { gint frame_width, frame_height; GdkPixbuf *piece; - gint width, height; - + gint width, height; + gchar *filename; + frame_width = gdk_pixbuf_get_width (pixbuf); frame_height = gdk_pixbuf_get_height (pixbuf); width = frame_width - 2 * FRAME_SIZE; height = FRAME_SIZE; - piece = gdk_pixbuf_new_from_file_at_scale (IMAGEDIR "/lb-middle.png", + filename = g_build_filename (imagedir, "lb-middle.png", NULL); + + piece = gdk_pixbuf_new_from_file_at_scale (filename, width, height, FALSE, NULL); @@ -912,7 +929,7 @@ width = FRAME_SIZE; height = frame_height - 2 * FRAME_SIZE; - piece = gdk_pixbuf_new_from_file_at_scale (IMAGEDIR "/lb-middle.png", + piece = gdk_pixbuf_new_from_file_at_scale (filename, width, height, FALSE, NULL); @@ -935,7 +952,7 @@ width = frame_width - 2 * FRAME_SIZE; height = frame_height - 2 * FRAME_SIZE; - piece = gdk_pixbuf_new_from_file_at_scale (IMAGEDIR "/lb-middle.png", + piece = gdk_pixbuf_new_from_file_at_scale (filename, width, height, FALSE, NULL); @@ -948,6 +965,8 @@ FRAME_SIZE, FRAME_SIZE); g_object_unref (piece); + + g_free (filename); } static void @@ -958,7 +977,7 @@ gint frame_width, frame_height; GdkPixbuf *piece; gint width, height; - const gchar *filename; + gchar *filename; gint x, y; frame_width = gdk_pixbuf_get_width (pixbuf); @@ -966,16 +985,16 @@ switch (corner) { case LB_WINDOW_CORNER_TOP_LEFT: - filename = IMAGEDIR "/lb-top-left.png"; + filename = g_build_filename (imagedir, "lb-top-left.png", NULL); break; case LB_WINDOW_CORNER_TOP_RIGHT: - filename = IMAGEDIR "/lb-top-right.png"; + filename = g_build_filename (imagedir, "lb-top-right.png", NULL); break; case LB_WINDOW_CORNER_BOTTOM_LEFT: - filename = IMAGEDIR "/lb-bottom-left.png"; + filename = g_build_filename (imagedir, "lb-bottom-left.png", NULL); break; case LB_WINDOW_CORNER_BOTTOM_RIGHT: - filename = IMAGEDIR "/lb-bottom-right.png"; + filename = g_build_filename (imagedir, "lb-bottom-right.png", NULL); break; default: @@ -984,6 +1003,7 @@ } piece = gdk_pixbuf_new_from_file (filename, NULL); + g_free (filename); g_return_if_fail (piece != NULL); width = gdk_pixbuf_get_width (piece); diff --recursive -u gnome-launch-box-0.1/tests/Makefile.am gnome-launch-box-0.1-apkg/tests/Makefile.am --- gnome-launch-box-0.1/tests/Makefile.am 2008-01-31 21:50:01.000000000 +0100 +++ gnome-launch-box-0.1-apkg/tests/Makefile.am 2008-01-31 21:45:45.000000000 +0100 @@ -1,12 +1,17 @@ AM_CPPFLAGS = -I$(top_srcdir) \ -DMENU_I_KNOW_THIS_IS_UNSTABLE \ - $(LB_CFLAGS) + $(LB_CFLAGS) $(EVO_CFLAGS) noinst_PROGRAMS = search-home \ search-applications \ - search-addresses \ mime-actions +if EBOOK +noinst_PROGRAMS += search-addresses +search_addresses_SOURCES = search-addresses.c +search_addresses_LDADD = $(LB_LIBS) $(EVO_LIBS) +endif + search_home_SOURCES = search-home.c search_home_LDADD = $(LB_LIBS) @@ -16,6 +21,3 @@ mime_actions_SOURCES = mime-actions.c mime_actions_LDADD = $(LB_LIBS) -search_addresses_SOURCES = search-addresses.c -search_addresses_LDADD = $(LB_LIBS) -