2018-06-18 12:12:45 +03:00
|
|
|
namespace Get {
|
|
|
|
extern void library_path (string so_path, void *addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace LAview.ObjectExample {
|
|
|
|
|
|
|
|
class AppDirs : Object {
|
|
|
|
|
|
|
|
public static File so_path;
|
|
|
|
public static File exec_dir;
|
|
|
|
public static File common_dir;
|
|
|
|
public static string ui_dir;
|
|
|
|
public static string settings_dir;
|
|
|
|
|
|
|
|
public static void init () {
|
|
|
|
char _so_path[256];
|
|
|
|
Get.library_path ((string)_so_path, (void*)init);
|
|
|
|
so_path = File.new_for_path ((string)_so_path);
|
|
|
|
exec_dir = so_path.get_parent ();
|
|
|
|
common_dir = exec_dir.get_parent ();
|
|
|
|
common_dir = common_dir.get_parent().get_parent();
|
|
|
|
ui_dir = Path.build_path (Path.DIR_SEPARATOR_S, common_dir.get_path(),
|
|
|
|
"share/laview-object-example-"+Config.VERSION_MAJOR.to_string()+"/ui");
|
|
|
|
stdout.printf ("Vala:so_path=%s\n", so_path.get_path());
|
|
|
|
settings_dir = Path.build_path (Path.DIR_SEPARATOR_S, common_dir.get_path(), "share/glib-2.0/schemas");
|
2018-06-20 21:59:08 +03:00
|
|
|
string w32dhack_sdir = settings_dir+"/laview-object-example-"+Config.VERSION_MAJOR.to_string();
|
|
|
|
if (File.new_for_path(w32dhack_sdir+"/gschemas.compiled").query_exists ())
|
|
|
|
settings_dir = w32dhack_sdir;
|
2018-06-18 12:12:45 +03:00
|
|
|
stdout.printf ("ui_dir = %s\n", ui_dir);
|
|
|
|
stdout.printf ("settings_dir = %s\n", settings_dir);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void terminate () {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|