ns_lisp_to_cursor_type (Lisp_Object arg)
{
char *str;
- if (XTYPE (arg) == Lisp_String)
+ if (STRINGP (arg))
str = SSDATA (arg);
- else if (XTYPE (arg) == Lisp_Symbol)
+ else if (SYMBOLP (arg))
str = SSDATA (SYMBOL_NAME (arg));
else return -1;
if (!strcmp (str, "box")) return FILLED_BOX_CURSOR;
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
int minibuffer_only = 0;
long window_prompting = 0;
int width, height;
- ptrdiff_t count = specpdl_ptr - specpdl;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
Lisp_Object display;
struct ns_display_info *dpyinfo = NULL;
FRAME_DISPLAY_INFO (f) = dpyinfo;
+ dynwind_begin ();
+
/* With FRAME_DISPLAY_INFO set up, this unwind-protect is safe. */
record_unwind_protect (unwind_create_frame, frame);
and similar functions. */
Vwindow_list = Qnil;
- return unbind_to (count, frame);
+ dynwind_end ();
+ return frame;
}
void
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;
{
int root_x, root_y;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- ptrdiff_t count = SPECPDL_INDEX ();
struct frame *f;
char *str;
NSSize size;
+ dynwind_begin ();
specbind (Qinhibit_redisplay, Qt);
GCPRO4 (string, parms, frame, timeout);
unblock_input ();
UNGCPRO;
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
void
syms_of_nsfns (void)
{
+#include "nsfns.x"
+
Qfontsize = intern_c_string ("fontsize");
staticpro (&Qfontsize);
doc: /* Toolkit version for NS Windowing. */);
Vns_version_string = ns_appkit_version_str ();
- defsubr (&Sns_read_file_name);
- defsubr (&Sns_get_resource);
- defsubr (&Sns_set_resource);
- defsubr (&Sxw_display_color_p); /* this and next called directly by C code */
- defsubr (&Sx_display_grayscale_p);
- defsubr (&Sns_font_name);
- defsubr (&Sns_list_colors);
-#ifdef NS_IMPL_COCOA
- defsubr (&Sns_do_applescript);
-#endif
- defsubr (&Sxw_color_defined_p);
- defsubr (&Sxw_color_values);
- defsubr (&Sx_server_max_request_size);
- defsubr (&Sx_server_vendor);
- defsubr (&Sx_server_version);
- defsubr (&Sx_display_pixel_width);
- defsubr (&Sx_display_pixel_height);
- defsubr (&Sns_display_monitor_attributes_list);
- defsubr (&Sx_display_mm_width);
- defsubr (&Sx_display_mm_height);
- defsubr (&Sx_display_screens);
- defsubr (&Sx_display_planes);
- defsubr (&Sx_display_color_cells);
- defsubr (&Sx_display_visual_class);
- defsubr (&Sx_display_backing_store);
- defsubr (&Sx_display_save_under);
- defsubr (&Sx_create_frame);
- defsubr (&Sx_open_connection);
- defsubr (&Sx_close_connection);
- defsubr (&Sx_display_list);
-
- defsubr (&Sns_hide_others);
- defsubr (&Sns_hide_emacs);
- defsubr (&Sns_emacs_info_panel);
- defsubr (&Sns_list_services);
- defsubr (&Sns_perform_service);
- defsubr (&Sns_convert_utf8_nfd_to_nfc);
- defsubr (&Sns_popup_font_panel);
- defsubr (&Sns_popup_color_panel);
-
- defsubr (&Sx_show_tip);
- defsubr (&Sx_hide_tip);
-
as_status = 0;
as_script = Qnil;
as_result = 0;