#include "w32heap.h" /* for prototype of sbrk */
#endif
+#ifdef NS_IMPL_GNUSTEP
+/* At least under Debian, GSConfig is in a subdirectory. --Stef */
+#include <GNUstepBase/GSConfig.h>
+#endif
+
#include "lisp.h"
#include "commands.h"
#include "intervals.h"
extern int inherited_pgroup;
#endif
-#ifdef HAVE_X_WINDOWS
+#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
/* If non-zero, -d was specified, meaning we're using some window system. */
int display_arg;
#endif
run_time_remap (argv[0]);
#endif
-#ifdef MAC_OSX
+#if defined (MAC_OSX) || defined (NS_IMPL_COCOA)
if (!initialized)
unexec_init_emacs_zone ();
#endif
no_loadup
= argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
+#ifdef HAVE_NS
+ ns_alloc_autorelease_pool();
+ if (!noninteractive)
+ {
+ char *tmp;
+ display_arg = 4;
+#ifdef NS_IMPL_COCOA
+ if (skip_args < argc)
+ {
+ if (!strncmp(argv[skip_args], "-psn", 4))
+ {
+ skip_args += 1;
+ }
+ else
+ {
+ if (skip_args+1 < argc && !strncmp(argv[skip_args+1], "-psn", 4))
+ skip_args += 2;
+ }
+ }
+#endif
+ /* This used for remote operation.. not fully implemented yet. */
+ if (argmatch (argv, argc, "-_NSMachLaunch", 0, 3, &tmp, &skip_args))
+ display_arg = 4;
+ else if (argmatch (argv, argc, "-MachLaunch", 0, 3, &tmp, &skip_args))
+ display_arg = 4;
+ else if (argmatch (argv, argc, "-macosx", 0, 2, NULL, &skip_args))
+ display_arg = 4;
+ else if (argmatch (argv, argc, "-NSHost", 0, 3, &tmp, &skip_args))
+ display_arg = 4;
+ }
+#endif /* HAVE_NS */
+
#ifdef HAVE_X_WINDOWS
/* Stupid kludge to catch command-line display spec. We can't
handle this argument entirely in window system dependent code
init_mac_osx_environment ();
#endif
+#ifdef HAVE_NS
+#ifndef CANNOT_DUMP
+ if (initialized)
+#endif
+ ns_init_paths ();
+#endif
+
/* egetenv is a pretty low-level facility, which may get called in
many circumstances; it seems flimsy to put off initializing it
until calling init_callproc. */
#ifdef HAVE_X_WINDOWS
syms_of_xterm ();
syms_of_xfns ();
+ syms_of_xmenu ();
syms_of_fontset ();
#ifdef HAVE_X_SM
syms_of_xsmfns ();
syms_of_menu ();
-#ifndef HAVE_NTGUI
-#ifndef MAC_OS
- /* Called before init_window_once for Mac OS Classic. */
- syms_of_xmenu ();
-#endif
-#endif
-
#ifdef HAVE_NTGUI
syms_of_w32term ();
syms_of_w32fns ();
syms_of_fontset ();
#endif /* MAC_OSX && HAVE_CARBON */
+#ifdef HAVE_NS
+ syms_of_nsterm ();
+ syms_of_nsfns ();
+ syms_of_nsmenu ();
+ syms_of_nsselect ();
+ syms_of_fontset ();
+#endif /* HAVE_NS */
+
#ifdef HAVE_DBUS
syms_of_dbusbind ();
#endif /* HAVE_DBUS */
{ "-color", "--color", 5, 0},
{ "-no-splash", "--no-splash", 3, 0 },
{ "-no-desktop", "--no-desktop", 3, 0 },
+#ifdef HAVE_NS
+ { "-NSAutoLaunch", 0, 5, 1 },
+ { "-NXAutoLaunch", 0, 5, 1 },
+ { "-disable-font-backend", "--disable-font-backend", 65, 0 },
+ { "-_NSMachLaunch", 0, 85, 1 },
+ { "-MachLaunch", 0, 85, 1 },
+ { "-macosx", 0, 85, 0 },
+ { "-NSHost", 0, 85, 1 },
+#endif
/* These have the same priority as ordinary file name args,
so they are not reordered with respect to those. */
{ "-L", "--directory", 0, 1 },
{ "-visit", "--visit", 0, 1 },
{ "-file", "--file", 0, 1 },
{ "-insert", "--insert", 0, 1 },
+#ifdef HAVE_NS
+ { "-NXOpen", 0, 0, 1 },
+ { "-NXOpenTemp", 0, 0, 1 },
+ { "-NSOpen", 0, 0, 1 },
+ { "-NSOpenTemp", 0, 0, 1 },
+ { "-GSFilePath", 0, 0, 1 },
+#endif
/* This should be processed after ordinary file name args and the like. */
{ "-kill", "--kill", -10, 0 },
};
#ifdef MSDOS
dos_cleanup ();
#endif
+
+#ifdef HAVE_NS
+ ns_term_shutdown (sig);
+#endif
}