#ifdef WINDOWSNT
#include "w32term.h"
#endif
-#ifdef MAC_OS
-#include "macterm.h"
-#endif
#ifdef HAVE_NS
#include "nsterm.h"
#endif
#endif
+#ifdef HAVE_NS
+Lisp_Object Qns_parse_geometry;
+#endif
+
Lisp_Object Qframep, Qframe_live_p;
Lisp_Object Qicon, Qmodeline;
Lisp_Object Qonly;
Value is t for a termcap frame (a character-only terminal),
`x' for an Emacs frame that is really an X window,
`w32' for an Emacs frame that is a window on MS-Windows display,
-`mac' for an Emacs frame on a Macintosh Carbon display,
`ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
`pc' for a direct-write MS-DOS frame.
See also `frame-live-p'. */)
if (!NILP (mini_window))
CHECK_LIVE_WINDOW (mini_window);
-#ifdef MULTI_KBOARD
if (!NILP (mini_window)
&& FRAME_KBOARD (XFRAME (XWINDOW (mini_window)->frame)) != kb)
error ("Frame and minibuffer must be on the same terminal");
-#endif
/* Make a frame containing just a root window. */
f = make_frame (0);
f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
f->async_visible = 1; /* Don't let visible be cleared later. */
#ifdef MSDOS
- f->output_data.x = &the_only_x_display;
+ f->output_data.tty->display_info = &the_only_display_info;
if (!inhibit_window_system
&& (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))
|| XFRAME (selected_frame)->output_method == output_msdos_raw))
{
f->output_method = output_msdos_raw;
+#if 0
/* This initialization of foreground and background pixels is
only important for the initial frame created in temacs. If
we don't do that, we get black background and foreground in
- the dumped Emacs because the_only_x_display is a static
+ the dumped Emacs because the_only_display_info is a static
variable, hence it is born all-zeroes, and zero is the code
for the black color. Other frames all inherit their pixels
- from what's already in the_only_x_display. */
+ from what's already in the_only_display_info. */
if ((!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
&& FRAME_BACKGROUND_PIXEL (f) == 0
&& FRAME_FOREGROUND_PIXEL (f) == 0)
FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
}
+#endif
}
else
f->output_method = output_termcap;
abort ();
#else /* not MSDOS */
-#if 0
- /* This can happen for multi-tty when using both terminal frames and
- Carbon frames. */
- if (sf->output_method != output_mac)
- error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
-#else
#if 0 /* This should work now! */
if (sf->output_method != output_termcap)
error ("Not using an ASCII terminal now; cannot make a new ASCII frame");
#endif
-#endif
#endif /* not MSDOS */
{
if (!t)
{
+#ifdef MSDOS
+ /* msdos.c assumes a single tty_display_info object. */
+ error ("Multiple terminals are not supported on this platform");
+#else /* !MSDOS */
char *name = 0, *type = 0;
Lisp_Object tty, tty_type;
}
t = init_tty (name, type, 0); /* Errors are not fatal. */
+#endif /* !MSDOS */
}
f = make_terminal_frame (t);
if (FRAME_X_P (f))
x_clear_frame_selections (f);
#endif
-#ifdef MAC_OS
- if (FRAME_MAC_P (f))
- x_clear_frame_selections (f);
-#endif
/* Free glyphs.
This function must be called before the window tree of the
kb = NULL;
Fdelete_terminal (tmp, NILP (force) ? Qt : force);
}
-#ifdef MULTI_KBOARD
else
kb = terminal->kboard;
-#endif
}
/* If we've deleted the last_nonminibuf_frame, then try to find
\f
+#ifdef HAVE_NS
+
+/* We used to define x-parse-geometry directly in ns-win.el, but that
+ confused make-docfile: the documentation string in ns-win.el was
+ used for x-parse-geometry even in non-NS builds.. */
+
+DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0,
+ doc: /* Parse a Nextstep-style geometry string STRING.
+Returns an alist of the form ((top . TOP), (left . LEFT) ... ).
+The properties returned may include `top', `left', `height', and `width'.
+This works by calling `ns-parse-geometry'. */)
+ (string)
+ Lisp_Object string;
+{
+ call1 (Qns_parse_geometry, string);
+}
+
+#else /* !HAVE_NS */
+
DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0,
doc: /* Parse an X-style geometry string STRING.
Returns an alist of the form ((top . TOP), (left . LEFT) ... ).
geometry = XParseGeometry ((char *) SDATA (string),
&x, &y, &width, &height);
-
-#if 0
- if (!!(geometry & XValue) != !!(geometry & YValue))
- error ("Must specify both x and y position, or neither");
-#endif
-
result = Qnil;
if (geometry & XValue)
{
return result;
}
+#endif /* HAVE_NS */
+
/* Calculate the desired size and position of frame F.
Return the flags saying which aspects were specified.
Qterminal_live_p = intern ("terminal-live-p");
staticpro (&Qterminal_live_p);
+#ifdef HAVE_NS
+ Qns_parse_geometry = intern ("ns-parse-geometry");
+ staticpro (&Qns_parse_geometry);
+#endif
+
{
int i;
DEFVAR_LISP ("default-frame-scroll-bars", &Vdefault_frame_scroll_bars,
doc: /* Default position of scroll bars on this window-system. */);
#ifdef HAVE_WINDOW_SYSTEM
-#if defined(HAVE_NTGUI) || defined(MAC_OS) || defined(NS_IMPL_COCOA)
+#if defined(HAVE_NTGUI) || defined(NS_IMPL_COCOA)
/* MS-Windows and Mac OS X have scroll bars on the right by default. */
Vdefault_frame_scroll_bars = Qright;
#else
handles focus, since there is no way in general for Emacs to find out
automatically. */);
#ifdef HAVE_WINDOW_SYSTEM
-#if defined(HAVE_NTGUI) || defined(MAC_OS) || defined(HAVE_NS)
+#if defined(HAVE_NTGUI) || defined(HAVE_NS)
focus_follows_mouse = 0;
#else
focus_follows_mouse = 1;