/* Functions for the NeXT/Open/GNUstep and MacOSX window system.
-Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2012
- Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
/* Need forward declaration here to preserve organizational integrity of file */
Lisp_Object Fx_open_connection (Lisp_Object, Lisp_Object, Lisp_Object);
-extern BOOL ns_in_resize;
-
/* Static variables to handle applescript execution. */
static Lisp_Object as_script, *as_result;
static int as_status;
NSView *view = FRAME_NS_VIEW (f);
NSTRACE (x_set_icon_name);
- if (ns_in_resize)
- return;
-
/* see if it's changed */
if (STRINGP (arg))
{
{
NSTRACE (ns_set_name);
- if (ns_in_resize)
- return;
-
/* Make sure that requests from lisp code override requests from
Emacs redisplay code. */
if (explicit)
NSString *str;
NSTRACE (ns_set_name_as_filename);
- if (f->explicit_name || ! NILP (f->title) || ns_in_resize)
+ if (f->explicit_name || ! NILP (f->title))
return;
block_input ();
f = make_frame (1);
XSETFRAME (frame, f);
- FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
f->terminal = dpyinfo->terminal;
RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qalpha, Qnil,
"alpha", "Alpha", RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qfullscreen, Qnil,
+ "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
width = FRAME_COLS (f);
height = FRAME_LINES (f);
check_ns ();
svcs = [[NSMenu alloc] initWithTitle: @"Services"];
- [NSApp setServicesMenu: svcs]; /* this and next rebuild on <10.4 */
+ [NSApp setServicesMenu: svcs];
[NSApp registerServicesMenuSendTypes: ns_send_types
returnTypes: ns_return_types];
/* On Tiger, services menu updating was made lazier (waits for user to
actually click on the menu), so we have to force things along: */
#ifdef NS_IMPL_COCOA
- if (NSAppKitVersionNumber >= 744.0)
+ delegate = [svcs delegate];
+ if (delegate != nil)
{
- delegate = [svcs delegate];
- if (delegate != nil)
+ if ([delegate respondsToSelector: @selector (menuNeedsUpdate:)])
+ [delegate menuNeedsUpdate: svcs];
+ if ([delegate respondsToSelector:
+ @selector (menu:updateItem:atIndex:shouldCancel:)])
{
- if ([delegate respondsToSelector: @selector (menuNeedsUpdate:)])
- [delegate menuNeedsUpdate: svcs];
- if ([delegate respondsToSelector:
- @selector (menu:updateItem:atIndex:shouldCancel:)])
- {
- int i, len = [delegate numberOfItemsInMenu: svcs];
- for (i =0; i<len; i++)
- [svcs addItemWithTitle: @"" action: NULL keyEquivalent: @""];
- for (i =0; i<len; i++)
- if (![delegate menu: svcs
- updateItem: (NSMenuItem *)[svcs itemAtIndex: i]
- atIndex: i shouldCancel: NO])
- break;
- }
+ int i, len = [delegate numberOfItemsInMenu: svcs];
+ for (i =0; i<len; i++)
+ [svcs addItemWithTitle: @"" action: NULL keyEquivalent: @""];
+ for (i =0; i<len; i++)
+ if (![delegate menu: svcs
+ updateItem: (NSMenuItem *)[svcs itemAtIndex: i]
+ atIndex: i shouldCancel: NO])
+ break;
}
}
#endif
*result = Qt;
// script returned an AppleScript result
if ((typeUnicodeText == [returnDescriptor descriptorType]) ||
-#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+#if defined (NS_IMPL_COCOA)
(typeUTF16ExternalRepresentation
== [returnDescriptor descriptorType]) ||
#endif
void
ns_run_ascript (void)
{
- as_status = ns_do_applescript (as_script, as_result);
+ if (! NILP (as_script))
+ as_status = ns_do_applescript (as_script, as_result);
+ as_script = Qnil;
}
DEFUN ("ns-do-applescript", Fns_do_applescript, Sns_do_applescript, 1, 1, 0,
data2: NSAPP_DATA2_RUNASSCRIPT];
[NSApp postEvent: nxev atStart: NO];
- [NSApp run];
+
+ // If there are other events, the event loop may exit. Keep running
+ // until the script has been handeled. */
+ while (! NILP (as_script))
+ [NSApp run];
status = as_status;
as_status = 0;
- as_script = Qnil;
as_result = 0;
unblock_input ();
if (status == 0)
}
-int
-x_char_width (struct frame *f)
-{
- return FRAME_COLUMN_WIDTH (f);
-}
-
-
-int
-x_char_height (struct frame *f)
-{
- return FRAME_LINE_HEIGHT (f);
-}
-
-
int
x_screen_planes (struct frame *f)
{