gchar* pluma_dirs_get_pluma_lib_dir(void) { gchar* lib_dir; #ifdef G_OS_WIN32 gchar* win32_dir; win32_dir = g_win32_get_package_installation_directory_of_module(NULL); lib_dir = g_build_filename(win32_dir, "lib", "pluma", NULL); g_free(win32_dir); #elif defined(OS_OSX) IgeMacBundle* bundle = ige_mac_bundle_get_default(); if (ige_mac_bundle_get_is_app_bundle(bundle)) { const gchar* path = ige_mac_bundle_get_resourcesdir(bundle); lib_dir = g_build_filename(path, "lib", "pluma", NULL); } else { lib_dir = g_build_filename(LIBDIR, "pluma", NULL); } #else lib_dir = g_build_filename(LIBDIR, "pluma", NULL); #endif return lib_dir; }
void gtr_dirs_init () { #ifdef G_OS_WIN32 gchar *win32_dir; win32_dir = g_win32_get_package_installation_directory_of_module (NULL); gtr_data_dir = g_build_filename (win32_dir, "share", "gtranslator", NULL); gtr_help_dir = g_build_filename (win32_dir, "share", "gtranslator", "help", NULL); gtr_locale_dir = g_build_filename (win32_dir, "share", "locale", NULL); gtr_lib_dir = g_build_filename (win32_dir, "lib", "gtranslator", NULL); g_free (win32_dir); #else /* !G_OS_WIN32 */ #ifdef OS_OSX IgeMacBundle *bundle = ige_mac_bundle_get_default (); if (ige_mac_bundle_get_is_app_bundle (bundle)) { const gchar *bundle_data_dir = ige_mac_bundle_get_datadir (bundle); const gchar *bundle_resource_dir = ige_mac_bundle_get_resourcesdir (bundle); gtr_data_dir = g_build_filename (bundle_data_dir, "gtranslator", NULL); gtr_help_dir = g_build_filename (bundle_data_dir, "gtranslator", "help" NULL); gtr_locale_dir = g_strdup (ige_mac_bundle_get_localedir (bundle)); gtr_lib_dir = g_build_filename (bundle_resource_dir, "lib", "gtranslator", NULL); } #endif /* !OS_OSX */ if (gtr_data_dir == NULL) { gtr_data_dir = g_build_filename (DATADIR, "gtranslator", NULL); gtr_help_dir = g_build_filename (DATADIR, "gnome", "help", NULL); gtr_locale_dir = g_build_filename (DATADIR, "locale", NULL); gtr_lib_dir = g_build_filename (LIBDIR, "gtranslator", NULL); } #endif /* !G_OS_WIN32 */ user_cache_dir = g_build_filename (g_get_user_cache_dir (), "gtranslator", NULL); user_config_dir = g_build_filename (g_get_user_config_dir (), "gtranslator", NULL); user_plugins_dir = g_build_filename (g_get_user_data_dir (), "gtranslator", "plugins", NULL); gtr_plugins_dir = g_build_filename (gtr_lib_dir, "plugins", NULL); gtr_plugins_data_dir = g_build_filename (gtr_data_dir, "plugins", NULL); gtr_pixmaps_dir = g_build_filename (gtr_data_dir, "pixmaps", NULL); }