/* Functions for the NeXT/Open/GNUstep and MacOSX window system.
-Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2013 Free Software
+Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2014 Free Software
Foundation, Inc.
This file is part of GNU Emacs.
if (!NILP (Fstring_equal (XCAR (dpyinfo->name_list_element), name)))
return dpyinfo;
- error ("Emacs for OpenStep does not yet support multi-display.");
+ error ("Emacs for Nextstep does not yet support multi-display");
Fx_open_connection (name, Qnil, Qnil);
dpyinfo = x_display_list;
if (dpyinfo == 0)
- error ("OpenStep on %s not responding.\n", SDATA (name));
+ error ("Display on %s not responding.\n", SDATA (name));
return dpyinfo;
}
str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)];
- if ([[view window] miniwindowTitle] &&
- ! [[[view window] miniwindowTitle] isEqualToString: str])
+ if ([[view window] miniwindowTitle]
+ && ! [[[view window] miniwindowTitle] isEqualToString: str])
[[view window] setMiniwindowTitle: str];
}
/* If we're switching from explicit to implicit, we had better
update the mode lines and thereby update the title. */
if (f->explicit_name && NILP (name))
- update_mode_lines = 1;
+ update_mode_lines = 21;
f->explicit_name = ! NILP (name);
}
return;
if (NILP (name))
- name = build_string([ns_app_name UTF8String]);
+ name = build_string ([ns_app_name UTF8String]);
else
CHECK_STRING (name);
fset_name (f, name);
- /* title overrides explicit name */
+ /* Title overrides explicit name. */
if (! NILP (f->title))
name = f->title;
if (EQ (name, f->title))
return;
- update_mode_lines = 1;
+ update_mode_lines = 22;
fset_title (f, name);
}
}
- x_set_window_size (f, 0, f->text_cols, f->text_lines);
+ x_set_window_size (f, 0, f->text_cols, f->text_lines, 0);
}
static Lisp_Object
ns_appkit_version_str (void)
{
- char tmp[80];
+ char tmp[256];
#ifdef NS_IMPL_GNUSTEP
sprintf(tmp, "gnustep-gui-%s", Xstr(GNUSTEP_GUI_VERSION));
#elif defined (NS_IMPL_COCOA)
- sprintf(tmp, "apple-appkit-%.2f", NSAppKitVersionNumber);
+ NSString *osversion
+ = [[NSProcessInfo processInfo] operatingSystemVersionString];
+ sprintf(tmp, "appkit-%.2f %s",
+ NSAppKitVersionNumber,
+ [osversion UTF8String]);
#else
tmp = "ns-unknown";
#endif
x_set_icon_name,
x_set_icon_type,
x_set_internal_border_width, /* generic OK */
+ 0, /* x_set_right_divider_width */
+ 0, /* x_set_bottom_divider_width */
x_set_menu_bar_lines,
x_set_mouse_color,
x_explicitly_set_name,
};
int i;
- for (i = 0; i < sizeof (r)/sizeof (r[0]); ++i)
+ for (i = 0; i < ARRAYELTS (r); ++i)
{
if (NILP (Fassq (r[i].tem, parms)))
{
init_frame_faces (f);
+ /* Read comment about this code in corresponding place in xfns.c. */
+ width = FRAME_TEXT_WIDTH (f);
+ height = FRAME_TEXT_HEIGHT (f);
+ FRAME_TEXT_HEIGHT (f) = 0;
+ SET_FRAME_WIDTH (f, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 1);
+
/* The resources controlling the menu-bar and tool-bar are
processed specially at startup, and reflected in the mode
variables; ignore them here. */
f->output_data.ns->hand_cursor = [NSCursor pointingHandCursor];
f->output_data.ns->hourglass_cursor = [NSCursor disappearingItemCursor];
f->output_data.ns->horizontal_drag_cursor = [NSCursor resizeLeftRightCursor];
+ f->output_data.ns->vertical_drag_cursor = [NSCursor resizeUpDownCursor];
FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor
= [NSCursor arrowCursor];
f->output_data.ns->current_pointer = f->output_data.ns->text_cursor;
x_default_parameter (f, parms, Qfullscreen, Qnil,
"fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
- width = FRAME_COLS (f);
- height = FRAME_LINES (f);
-
- SET_FRAME_COLS (f, 0);
- FRAME_LINES (f) = 0;
- change_frame_size (f, height, width, 1, 0, 0);
+ width = FRAME_TEXT_WIDTH (f);
+ height = FRAME_TEXT_HEIGHT (f);
+ FRAME_TEXT_HEIGHT (f) = 0;
+ SET_FRAME_WIDTH (f, 0);
+ change_frame_size (f, width, height, 1, 0, 0, 1);
if (! f->output_data.ns->explicit_parent)
{
if (dpyinfo == 0)
{
if (!NILP (must_succeed))
- fatal ("OpenStep on %s not responding.\n",
+ fatal ("Display on %s not responding.\n",
SSDATA (display));
else
- error ("OpenStep on %s not responding.\n",
+ error ("Display on %s not responding.\n",
SSDATA (display));
}
returnDescriptor = [scriptObject executeAndReturnError: &errorDict];
[scriptObject release];
-
*result = Qnil;
if (returnDescriptor != NULL)
Lisp_Object result;
int status;
NSEvent *nxev;
+ struct input_event ev;
CHECK_STRING (script);
check_window_system (NULL);
// If there are other events, the event loop may exit. Keep running
// until the script has been handled. */
+ ns_init_events (&ev);
while (! NILP (as_script))
[NSApp run];
+ ns_finish_events ();
status = as_status;
as_status = 0;
if (ns_lisp_to_color (color, &col))
return Qnil;
- [[col colorUsingColorSpaceName: NSCalibratedRGBColorSpace]
+ [[col colorUsingDefaultColorSpace]
getRed: &red green: &green blue: &blue alpha: &alpha];
return list3i (lrint (red * 65280), lrint (green * 65280),
lrint (blue * 65280));