svnno****@sourc*****
svnno****@sourc*****
Thu Apr 5 12:50:10 JST 2007
Revision: 3149 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3149 Author: kous Date: 2007-04-05 12:50:09 +0900 (Thu, 05 Apr 2007) Log Message: ----------- * src/kz-app.[ch], src/kazehakase.h, src/Makefile.am, configure.ac, src/kz-embed.c, src/kz-ext.c, src/kz-search.c, ext/ruby/kz-rb-ext.c: used KZ_GET_* macros for getting directory name. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/configure.ac kazehakase/trunk/ext/ruby/kz-rb-ext.c kazehakase/trunk/src/Makefile.am kazehakase/trunk/src/kazehakase.h kazehakase/trunk/src/kz-app.c kazehakase/trunk/src/kz-app.h kazehakase/trunk/src/kz-embed.c kazehakase/trunk/src/kz-ext.c kazehakase/trunk/src/kz-search.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/ChangeLog 2007-04-05 03:50:09 UTC (rev 3149) @@ -1,5 +1,12 @@ 2007-04-05 Kouhei Sutou <kou****@cozmi*****> + * src/kz-app.[ch], src/kazehakase.h, src/Makefile.am, configure.ac, + src/kz-embed.c, src/kz-ext.c, src/kz-search.c, ext/ruby/kz-rb-ext.c: + used KZ_GET_* macros for getting directory name. + + * data/ext/ruby/kazehakase-init-pre.rb (Kz::TMP_DIR): added PID + for temporary directory name. + * src/prefs_ui/prefs_browser.c (set_layout_engine): Use 'Default' instead of 'None'. Modified: kazehakase/trunk/configure.ac =================================================================== --- kazehakase/trunk/configure.ac 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/configure.ac 2007-04-05 03:50:09 UTC (rev 3149) @@ -34,9 +34,15 @@ fi dnl ************************************************************** +dnl Configure for module direcotry. +dnl ************************************************************** +kzlibdir="\$(libdir)/\$(PACKAGE)" +AC_SUBST(kzlibdir) + +dnl ************************************************************** dnl Configure for embed module. dnl ************************************************************** -embeddir="${libdir}/\$(PACKAGE)/embed" +embeddir="\$(kzlibdir)/embed" AC_SUBST(embeddir) dnl ************************************************************** @@ -283,7 +289,7 @@ dnl ************************************************************** dnl Configure for extentions. dnl ************************************************************** -extdir="${libdir}/\$(PACKAGE)/ext" +extdir="\$(kzlibdir)/ext" AC_SUBST(extdir) dnl ************************************************************** @@ -407,7 +413,7 @@ dnl ************************************************************** dnl Configure for history search module. dnl ************************************************************** -searchdir="${libdir}/\$(PACKAGE)/search" +searchdir="\$(kzlibdir)/search" AC_SUBST(searchdir) dnl ************************************************************** Modified: kazehakase/trunk/ext/ruby/kz-rb-ext.c =================================================================== --- kazehakase/trunk/ext/ruby/kz-rb-ext.c 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/ext/ruby/kz-rb-ext.c 2007-04-05 03:50:09 UTC (rev 3149) @@ -175,7 +175,6 @@ void kz_rb_ext_init (gpointer initial_address) { - gchar *dirname; char *argv[] = {"kazehakase"}; kz_rb_ext_ruby_init(); @@ -193,11 +192,8 @@ _kz_rb_ext_version = g_strdup(StringValueCStr(version)); } - dirname = g_build_filename(KZ_GET_SYSTEM_KZ_DATA_DIR, "ext", "ruby", NULL); - rb_ary_unshift(rb_load_path, rb_str_new2(dirname)); - g_free(dirname); - rb_ary_unshift(rb_load_path, rb_str_new2(KZ_GET_SYSTEM_RUBY_EXT_DIR)); + rb_ary_unshift(rb_load_path, rb_str_new2(KZ_GET_SYSTEM_RUBY_EXT_DATA_DIR)); Init_kz(); require_init_pre_rb(); Modified: kazehakase/trunk/src/Makefile.am =================================================================== --- kazehakase/trunk/src/Makefile.am 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/src/Makefile.am 2007-04-05 03:50:09 UTC (rev 3149) @@ -11,6 +11,7 @@ -DLOCALEDIR=\""$(localedir)"\" \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DDATADIR=\""$(datadir)"\" \ + -DKZ_LIBDIR=\""$(kzlibdir)"\" \ -DKZ_EXTDIR=\""$(extdir)"\" \ -DKZ_RUBY_EXTDIR=\""$(extrubydir)"\" \ -DKZ_SYSCONFDIR=\""$(sysconfdir)/$(PACKAGE)"\" \ Modified: kazehakase/trunk/src/kazehakase.h =================================================================== --- kazehakase/trunk/src/kazehakase.h 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/src/kazehakase.h 2007-04-05 03:50:09 UTC (rev 3149) @@ -77,14 +77,23 @@ #define KZ_GET_FORM_DATA_DIR kz_app_get_form_data_dir(kz_app) #define KZ_GET_CLIPS_DIR kz_app_get_clips_dir(kz_app) #define KZ_GET_THUMBNAILS_DIR kz_app_get_thumbnails_dir(kz_app) + #define KZ_GET_SYSTEM_DATA_DIR kz_app_get_system_data_dir(kz_app) #define KZ_GET_SYSTEM_KZ_DATA_DIR kz_app_get_system_kz_data_dir(kz_app) -#define KZ_GET_SYSTEM_RUBY_EXT_DIR kz_app_get_system_ruby_ext_dir(kz_app) +#define KZ_GET_SYSTEM_LIB_DIR kz_app_get_system_lib_dir(kz_app) #define KZ_GET_SYSTEM_CONFIG_DIR kz_app_get_system_config_dir(kz_app) + #define KZ_GET_SYSTEM_ICONS_DIR kz_app_get_system_icons_dir(kz_app) #define KZ_GET_SYSTEM_PIXMAPS_DIR kz_app_get_system_pixmaps_dir(kz_app) +#define KZ_GET_SYSTEM_EMBED_MODULE_DIR kz_app_get_system_embed_module_dir(kz_app) +#define KZ_GET_SYSTEM_SEARCH_MODULE_DIR kz_app_get_system_search_module_dir(kz_app) +#define KZ_GET_SYSTEM_EXT_DIR kz_app_get_system_ext_dir(kz_app) +#define KZ_GET_SYSTEM_RUBY_EXT_DIR kz_app_get_system_ruby_ext_dir(kz_app) +#define KZ_GET_SYSTEM_RUBY_EXT_DATA_DIR kz_app_get_system_ruby_ext_data_dir(kz_app) + + #define KZ_SET_SEARCH(engine_name) kz_app_set_search(kz_app, engine_name) Modified: kazehakase/trunk/src/kz-app.c =================================================================== --- kazehakase/trunk/src/kz-app.c 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/src/kz-app.c 2007-04-05 03:50:09 UTC (rev 3149) @@ -91,12 +91,21 @@ gchar *form_data_dir; gchar *clips_dir; gchar *thumbnails_dir; + gchar *system_data_dir; gchar *system_kz_data_dir; - gchar *system_ruby_ext_dir; + gchar *system_lib_dir; gchar *system_config_dir; + gchar *system_icons_dir; gchar *system_pixmaps_dir; + + gchar *system_embed_module_dir; + gchar *system_search_module_dir; + + gchar *system_ext_dir; + gchar *system_ruby_ext_dir; + gchar *system_ruby_ext_data_dir; }; #define KZ_APP_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), KZ_TYPE_APP, KzAppPrivate)) @@ -275,15 +284,30 @@ "share", NULL); priv->system_kz_data_dir = g_build_filename(priv->system_data_dir, PACKAGE, NULL); - priv->system_ruby_ext_dir = g_build_filename(priv->system_kz_data_dir, - "ext", "ruby", NULL); + priv->system_lib_dir = g_build_filename(kz_win32_base_path(), + "lib", PACKAGE, NULL); priv->system_config_dir = g_build_filename(kz_win32_base_path(), "etc", PACKAGE, NULL); + + priv->system_embed_module_dir = g_build_filename(priv->system_lib_dir, + "embed", NULL); + priv->system_search_module_dir = g_build_filename(priv->system_lib_dir, + "search", NULL); + + priv->system_ext_dir = g_strdup(priv->system_lib_dir); + priv->system_ruby_ext_dir = g_build_filename(priv->system_ext_dir, + "ruby", NULL); #else priv->system_data_dir = g_strdup(DATADIR); priv->system_kz_data_dir = g_strdup(KZ_DATADIR); + priv->system_config_dir = g_strdup(KZ_SYSCONFDIR); + priv->system_lib_dir = g_strdup(KZ_LIBDIR); + + priv->system_embed_module_dir = g_strdup(KZ_EMBED_MODULEDIR); + priv->system_search_module_dir = g_strdup(KZ_SEARCH_MODULEDIR); + + priv->system_ext_dir = g_strdup(KZ_EXTDIR); priv->system_ruby_ext_dir = g_strdup(KZ_RUBY_EXTDIR); - priv->system_config_dir = g_strdup(KZ_SYSCONFDIR); #endif priv->system_icons_dir = g_build_filename(priv->system_kz_data_dir, @@ -291,6 +315,9 @@ priv->system_pixmaps_dir = g_build_filename(priv->system_data_dir, "pixmaps", NULL); + priv->system_ruby_ext_data_dir = + g_build_filename(priv->system_kz_data_dir, "ext", "ruby", NULL); + ensure_directories(app); } @@ -308,13 +335,22 @@ g_free(priv->form_data_dir); g_free(priv->clips_dir); g_free(priv->thumbnails_dir); + g_free(priv->system_data_dir); g_free(priv->system_kz_data_dir); - g_free(priv->system_ruby_ext_dir); + g_free(priv->system_lib_dir); g_free(priv->system_config_dir); + g_free(priv->system_icons_dir); g_free(priv->system_pixmaps_dir); + g_free(priv->system_embed_module_dir); + g_free(priv->system_search_module_dir); + + g_free(priv->system_ext_dir); + g_free(priv->system_ruby_ext_dir); + g_free(priv->system_ruby_ext_data_dir); + priv->user_dir = NULL; priv->history_dir = NULL; priv->history_time_stamp = NULL; @@ -324,12 +360,21 @@ priv->form_data_dir = NULL; priv->clips_dir = NULL; priv->thumbnails_dir = NULL; + priv->system_data_dir = NULL; priv->system_kz_data_dir = NULL; - priv->system_ruby_ext_dir = NULL; + priv->system_lib_dir = NULL; priv->system_config_dir = NULL; + priv->system_icons_dir = NULL; priv->system_pixmaps_dir = NULL; + + priv->system_embed_module_dir = NULL; + priv->system_search_module_dir = NULL; + + priv->system_ext_dir = NULL; + priv->system_ruby_ext_dir = NULL; + priv->system_ruby_ext_data_dir = NULL; } #define DEFINE_PATH_GETTER(name) \ @@ -350,14 +395,23 @@ DEFINE_PATH_GETTER(form_data_dir) DEFINE_PATH_GETTER(clips_dir) DEFINE_PATH_GETTER(thumbnails_dir) + DEFINE_PATH_GETTER(system_data_dir) DEFINE_PATH_GETTER(system_kz_data_dir) -DEFINE_PATH_GETTER(system_ruby_ext_dir) +DEFINE_PATH_GETTER(system_lib_dir) DEFINE_PATH_GETTER(system_config_dir) + DEFINE_PATH_GETTER(system_icons_dir) DEFINE_PATH_GETTER(system_pixmaps_dir) +DEFINE_PATH_GETTER(system_embed_module_dir) +DEFINE_PATH_GETTER(system_search_module_dir) +DEFINE_PATH_GETTER(system_ext_dir) +DEFINE_PATH_GETTER(system_ruby_ext_dir) +DEFINE_PATH_GETTER(system_ruby_ext_data_dir) + + static void kz_app_init (KzApp *app) { Modified: kazehakase/trunk/src/kz-app.h =================================================================== --- kazehakase/trunk/src/kz-app.h 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/src/kz-app.h 2007-04-05 03:50:09 UTC (rev 3149) @@ -64,13 +64,22 @@ const gchar *kz_app_get_form_data_dir (KzApp *app); const gchar *kz_app_get_clips_dir (KzApp *app); const gchar *kz_app_get_thumbnails_dir (KzApp *app); + const gchar *kz_app_get_system_data_dir (KzApp *app); const gchar *kz_app_get_system_kz_data_dir (KzApp *app); -const gchar *kz_app_get_system_ruby_ext_dir (KzApp *app); +const gchar *kz_app_get_system_lib_dir (KzApp *app); const gchar *kz_app_get_system_config_dir (KzApp *app); + const gchar *kz_app_get_system_icons_dir (KzApp *app); const gchar *kz_app_get_system_pixmaps_dir (KzApp *app); +const gchar *kz_app_get_system_embed_module_dir (KzApp *app); +const gchar *kz_app_get_system_search_module_dir (KzApp *app); + +const gchar *kz_app_get_system_ext_dir (KzApp *app); +const gchar *kz_app_get_system_ruby_ext_dir (KzApp *app); +const gchar *kz_app_get_system_ruby_ext_data_dir (KzApp *app); + GtkWidget *kz_app_create_new_window (KzApp *app, const gchar *uri); GtkWidget *kz_app_restore_session (KzApp *app); Modified: kazehakase/trunk/src/kz-embed.c =================================================================== --- kazehakase/trunk/src/kz-embed.c 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/src/kz-embed.c 2007-04-05 03:50:09 UTC (rev 3149) @@ -33,7 +33,7 @@ base_dir = g_getenv("KZ_EMBED_MODULE_DIR"); if (base_dir) return base_dir; - return KZ_EMBED_MODULEDIR; + return KZ_GET_SYSTEM_EMBED_MODULE_DIR; } void Modified: kazehakase/trunk/src/kz-ext.c =================================================================== --- kazehakase/trunk/src/kz-ext.c 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/src/kz-ext.c 2007-04-05 03:50:09 UTC (rev 3149) @@ -77,21 +77,23 @@ void kz_ext_init (gpointer initial_address) { - GList *node; - const gchar *base_dir; - base_dir = g_getenv("KZ_EXT_DIR"); - if (!base_dir) - base_dir = KZ_EXTDIR; + GList *node; + const gchar *base_dir; + base_dir = g_getenv("KZ_EXT_DIR"); + if (!base_dir) + base_dir = KZ_GET_SYSTEM_EXT_DIR; - ext_mods = kz_module_load_modules(base_dir); - for (node = ext_mods; node; node = g_list_next(node)) - { - KzExt *ext; - KzModule *module = node->data; + ext_mods = kz_module_load_modules(base_dir); + for (node = ext_mods; node; node = g_list_next(node)) + { + KzExt *ext; + KzModule *module = node->data; - ext = _kz_ext_new(module, "initial-address", initial_address, NULL); - exts = g_list_prepend(exts, ext); - } + ext = _kz_ext_new(module, + "initial-address", initial_address, + NULL); + exts = g_list_prepend(exts, ext); + } } static void Modified: kazehakase/trunk/src/kz-search.c =================================================================== --- kazehakase/trunk/src/kz-search.c 2007-04-05 03:48:34 UTC (rev 3148) +++ kazehakase/trunk/src/kz-search.c 2007-04-05 03:50:09 UTC (rev 3149) @@ -37,7 +37,7 @@ base_dir = g_getenv("KZ_SEARCH_MODULE_DIR"); if (base_dir) return base_dir; - return KZ_SEARCH_MODULEDIR; + return KZ_GET_SYSTEM_SEARCH_MODULE_DIR; } void