/* Functions for the NeXT/Open/GNUstep and MacOSX window system.
-Copyright (C) 1989, 1992, 1993, 1994, 2005, 2006, 2008, 2009, 2010,
- 2011 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2011
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle;
extern Lisp_Object Qnone;
-extern Lisp_Object Vframe_title_format, Vicon_title_format;
-/* The below are defined in frame.c. */
-
-extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
Lisp_Object Qbuffered;
Lisp_Object Qfontsize;
/* hack for OS X file panels */
char panelOK = 0;
-/* Alist of elements (REGEXP . IMAGE) for images of icons associated
- to frames.*/
-static Lisp_Object Vns_icon_type_alist;
-
-/* Toolkit version support. */
-static Lisp_Object Vns_version_string;
-
EmacsTooltip *ns_tooltip;
/* Need forward declaration here to preserve organizational integrity of file */
if (!STRINGP (f->icon_name))
encoded_icon_name = encoded_name;
else
- encoded_icon_name = ENCODE_UTF_8 (f->icon_name);
+ encoded_icon_name = ENCODE_UTF_8 (f->icon_name);
str = [NSString stringWithUTF8String: SDATA (encoded_icon_name)];
BLOCK_INPUT;
pool = [[NSAutoreleasePool alloc] init];
- filename = XBUFFER (buf)->filename;
- name = XBUFFER (buf)->name;
+ filename = BVAR (XBUFFER (buf), filename);
+ name = BVAR (XBUFFER (buf), name);
if (NILP (name))
{
if (FRAME_ICONIFIED_P (f))
[[view window] setMiniwindowTitle: str];
- else
+ else
{
NSString *fstr;
0, /* x_set_fullscreen will ignore */
x_set_font_backend, /* generic OK */
x_set_alpha,
- 0, /* x_set_sticky */
- 0, /* x_set_tool_bar_position */
+ 0, /* x_set_sticky */
+ 0, /* x_set_tool_bar_position */
};
}
if (FRAME_HAS_MINIBUF_P (f)
- && (!FRAMEP (kb->Vdefault_minibuffer_frame)
- || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
- kb->Vdefault_minibuffer_frame = frame;
+ && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
+ || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
+ KVAR (kb, Vdefault_minibuffer_frame) = frame;
/* All remaining specified parameters, which have not been "used"
by x_get_arg and friends, now go in the misc. alist of the frame. */
DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 4, 0,
doc: /* Use a graphical panel to read a file name, using prompt PROMPT.
Optional arg DIR, if non-nil, supplies a default directory.
-Optional arg ISLOAD, if non-nil, means read a file name for saving.
+Optional arg MUSTMATCH, if non-nil, means the returned file or
+directory must exist.
Optional arg INIT, if non-nil, provides a default file name to use. */)
- (Lisp_Object prompt, Lisp_Object dir, Lisp_Object isLoad, Lisp_Object init)
+ (Lisp_Object prompt, Lisp_Object dir, Lisp_Object mustmatch, Lisp_Object init)
{
static id fileDelegate = nil;
int ret;
NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil :
[NSString stringWithUTF8String: SDATA (prompt)];
NSString *dirS = NILP (dir) || !STRINGP (dir) ?
- [NSString stringWithUTF8String: SDATA (current_buffer->directory)] :
+ [NSString stringWithUTF8String: SDATA (BVAR (current_buffer, directory))] :
[NSString stringWithUTF8String: SDATA (dir)];
NSString *initS = NILP (init) || !STRINGP (init) ? nil :
[NSString stringWithUTF8String: SDATA (init)];
if ([dirS characterAtIndex: 0] == '~')
dirS = [dirS stringByExpandingTildeInPath];
- panel = NILP (isLoad) ?
+ panel = NILP (mustmatch) ?
(id)[EmacsSavePanel savePanel] : (id)[EmacsOpenPanel openPanel];
[panel setTitle: promptS];
panelOK = 0;
BLOCK_INPUT;
- if (NILP (isLoad))
+ if (NILP (mustmatch))
{
ret = [panel runModalForDirectory: dirS file: initS];
}
(Lisp_Object script)
{
Lisp_Object result;
- long status;
+ int status;
CHECK_STRING (script);
check_ns ();
{
struct ns_display_info *dpyinfo;
check_ns ();
-
+
dpyinfo = check_ns_display_info (display);
/* We force 24+ bit depths to 24-bit to prevent an overflow. */
return make_number (1 << min (dpyinfo->n_planes, 24));
pt.y = x_display_pixel_height (FRAME_NS_DISPLAY_INFO (f)) - XINT (top)
- height;
}
-
+
/* Ensure in bounds. (Note, screen origin = lower left.) */
if (INTEGERP (left))
*root_x = pt.x;
Qfontsize = intern_c_string ("fontsize");
staticpro (&Qfontsize);
- DEFVAR_LISP ("ns-icon-type-alist", &Vns_icon_type_alist,
+ DEFVAR_LISP ("ns-icon-type-alist", Vns_icon_type_alist,
doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames.
If the title of a frame matches REGEXP, then IMAGE.tiff is
selected as the image of the icon representing the frame when it's
be used as the image of the icon representing the frame. */);
Vns_icon_type_alist = Fcons (Qt, Qnil);
- DEFVAR_LISP ("ns-version-string", &Vns_version_string,
+ DEFVAR_LISP ("ns-version-string", Vns_version_string,
doc: /* Toolkit version for NS Windowing. */);
Vns_version_string = ns_appkit_version_str ();
check_window_system_func = check_ns;
}
-