mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-11-01 20:17:33 +09:00
parent
470a6e4401
commit
13fcc4a046
949 changed files with 95662 additions and 444 deletions
|
|
@ -29,6 +29,10 @@
|
|||
#include <linux/fadvise.h>
|
||||
#endif // defined(XP_LINUX)
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#include "copyfile.h"
|
||||
#endif // defined(XP_MACOSX)
|
||||
|
||||
#if defined(XP_WIN)
|
||||
#include <windows.h>
|
||||
#include <accctrl.h>
|
||||
|
|
@ -127,6 +131,22 @@ struct Paths {
|
|||
nsString winStartMenuProgsDir;
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
/**
|
||||
* The user's Library directory.
|
||||
*/
|
||||
nsString macUserLibDir;
|
||||
/**
|
||||
* The Application directory, that stores applications installed in the
|
||||
* system.
|
||||
*/
|
||||
nsString macLocalApplicationsDir;
|
||||
/**
|
||||
* The user's trash directory.
|
||||
*/
|
||||
nsString macTrashDir;
|
||||
#endif // defined(XP_MACOSX)
|
||||
|
||||
Paths()
|
||||
{
|
||||
libDir.SetIsVoid(true);
|
||||
|
|
@ -141,6 +161,12 @@ struct Paths {
|
|||
winAppDataDir.SetIsVoid(true);
|
||||
winStartMenuProgsDir.SetIsVoid(true);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
macUserLibDir.SetIsVoid(true);
|
||||
macLocalApplicationsDir.SetIsVoid(true);
|
||||
macTrashDir.SetIsVoid(true);
|
||||
#endif // defined(XP_MACOSX)
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -285,6 +311,12 @@ nsresult InitOSFileConstants()
|
|||
GetPathToSpecialDir(NS_WIN_PROGRAMS_DIR, paths->winStartMenuProgsDir);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
GetPathToSpecialDir(NS_MAC_USER_LIB_DIR, paths->macUserLibDir);
|
||||
GetPathToSpecialDir(NS_OSX_LOCAL_APPLICATIONS_DIR, paths->macLocalApplicationsDir);
|
||||
GetPathToSpecialDir(NS_MAC_TRASH_DIR, paths->macTrashDir);
|
||||
#endif // defined(XP_MACOSX)
|
||||
|
||||
gPaths = paths.forget();
|
||||
|
||||
// Get the umask from the system-info service.
|
||||
|
|
@ -940,12 +972,20 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global)
|
|||
// Note that we don't actually provide the full path, only the name of the
|
||||
// library, which is sufficient to link to the library using js-ctypes.
|
||||
|
||||
// On all supported platforms, libxul is a library "xul" with regular
|
||||
#if defined(XP_MACOSX)
|
||||
// Under MacOS X, for some reason, libxul is called simply "XUL",
|
||||
// and we need to provide the full path.
|
||||
nsAutoString libxul;
|
||||
libxul.Append(gPaths->libDir);
|
||||
libxul.AppendLiteral("/XUL");
|
||||
#else
|
||||
// On other platforms, libxul is a library "xul" with regular
|
||||
// library prefix/suffix.
|
||||
nsAutoString libxul;
|
||||
libxul.AppendLiteral(DLL_PREFIX);
|
||||
libxul.AppendLiteral("xul");
|
||||
libxul.AppendLiteral(DLL_SUFFIX);
|
||||
#endif // defined(XP_MACOSX)
|
||||
|
||||
if (!SetStringProperty(cx, objPath, "libxul", libxul)) {
|
||||
return false;
|
||||
|
|
@ -993,6 +1033,20 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global)
|
|||
}
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
if (!SetStringProperty(cx, objPath, "macUserLibDir", gPaths->macUserLibDir)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!SetStringProperty(cx, objPath, "macLocalApplicationsDir", gPaths->macLocalApplicationsDir)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!SetStringProperty(cx, objPath, "macTrashDir", gPaths->macTrashDir)) {
|
||||
return false;
|
||||
}
|
||||
#endif // defined(XP_MACOSX)
|
||||
|
||||
// sqlite3 is always a shared lib
|
||||
nsAutoString libsqlite3;
|
||||
libsqlite3.AppendLiteral(DLL_PREFIX);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue