Commit bd6ce2ba authored by Adrian Robert's avatar Adrian Robert
Browse files

code cleanups in NS port

parent 0eafa5a7
2008-07-27 Adrian Robert <Adrian.B.Robert@gmail.com>
* nsfns.m (x-create-frame): Add copy of parms argument to beginning.
Set Vx_resource_name to a fallback. Replace read of 'buffered'
parameter with read of 'alpha' one.
(Qns_frame_parameter): Remove.
* nsselection.m (selection-coding-system)
(next-selection-coding-system, Vselection_coding_system)
(Vnext_selection_coding_system): Drop.
2008-07-27 Adrian Robert <Adrian.B.Robert@gmail.com> 2008-07-27 Adrian Robert <Adrian.B.Robert@gmail.com>
* nsfns.m (do-applescript, do_applescript): Rename to * nsfns.m (do-applescript, do_applescript): Rename to
......
...@@ -78,7 +78,6 @@ Updated by Christian Limpach (chris@nice.ch) ...@@ -78,7 +78,6 @@ Updated by Christian Limpach (chris@nice.ch)
extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle; extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle;
Lisp_Object Qnone; Lisp_Object Qnone;
Lisp_Object Qns_frame_parameter;
Lisp_Object Qbuffered; Lisp_Object Qbuffered;
Lisp_Object Qfontsize; Lisp_Object Qfontsize;
...@@ -1057,6 +1056,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -1057,6 +1056,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
check_ns (); check_ns ();
/* Seems a little strange, but other terms do it. Perhaps the code below
is modifying something? */
parms = Fcopy_alist (parms);
display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING); display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING);
if (EQ (display, Qunbound)) if (EQ (display, Qunbound))
display = Qnil; display = Qnil;
...@@ -1075,6 +1078,8 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -1075,6 +1078,8 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
if (STRINGP (name)) if (STRINGP (name))
Vx_resource_name = name; Vx_resource_name = name;
else
Vx_resource_name = Vinvocation_name;
parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER); parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER);
if (EQ (parent, Qunbound)) if (EQ (parent, Qunbound))
...@@ -1136,7 +1141,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -1136,7 +1141,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", f->icon_name = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
RES_TYPE_STRING); RES_TYPE_STRING);
if (EQ (f->icon_name, Qunbound) || (XTYPE (f->icon_name) != Lisp_String)) if (! STRINGP (f->icon_name))
f->icon_name = Qnil; f->icon_name = Qnil;
FRAME_NS_DISPLAY_INFO (f) = dpyinfo; FRAME_NS_DISPLAY_INFO (f) = dpyinfo;
...@@ -1275,18 +1280,18 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side ...@@ -1275,18 +1280,18 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
Vframe_list = Fcons (frame, Vframe_list); Vframe_list = Fcons (frame, Vframe_list);
/*FRAME_NS_DISPLAY_INFO (f)->reference_count++; */ /*FRAME_NS_DISPLAY_INFO (f)->reference_count++; */
x_default_parameter (f, parms, Qcursor_type, Qbox, "cursorType", "CursorType",
RES_TYPE_SYMBOL);
x_default_parameter (f, parms, Qscroll_bar_width, Qnil, "scrollBarWidth",
"ScrollBarWidth", RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qicon_type, Qnil, "bitmapIcon", "BitmapIcon", x_default_parameter (f, parms, Qicon_type, Qnil, "bitmapIcon", "BitmapIcon",
RES_TYPE_SYMBOL); RES_TYPE_SYMBOL);
x_default_parameter (f, parms, Qauto_raise, Qnil, "autoRaise", "AutoRaise", x_default_parameter (f, parms, Qauto_raise, Qnil, "autoRaise", "AutoRaiseLower",
RES_TYPE_BOOLEAN); RES_TYPE_BOOLEAN);
x_default_parameter (f, parms, Qauto_lower, Qnil, "autoLower", "AutoLower", x_default_parameter (f, parms, Qauto_lower, Qnil, "autoLower", "AutoLower",
RES_TYPE_BOOLEAN); RES_TYPE_BOOLEAN);
x_default_parameter (f, parms, Qbuffered, Qt, "buffered", "Buffered", x_default_parameter (f, parms, Qcursor_type, Qbox, "cursorType", "CursorType",
RES_TYPE_BOOLEAN); RES_TYPE_SYMBOL);
x_default_parameter (f, parms, Qscroll_bar_width, Qnil, "scrollBarWidth",
"ScrollBarWidth", RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qalpha, Qt, "alpha", "Alpha",
RES_TYPE_NUMBER);
width = FRAME_COLS (f); width = FRAME_COLS (f);
height = FRAME_LINES (f); height = FRAME_LINES (f);
...@@ -2603,8 +2608,6 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename ...@@ -2603,8 +2608,6 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename
{ {
int i; int i;
Qns_frame_parameter = intern ("ns-frame-parameter");
staticpro (&Qns_frame_parameter);
Qnone = intern ("none"); Qnone = intern ("none");
staticpro (&Qnone); staticpro (&Qnone);
Qbuffered = intern ("bufferd"); Qbuffered = intern ("bufferd");
......
...@@ -40,10 +40,6 @@ Updated by Christian Limpach (chris@nice.ch) ...@@ -40,10 +40,6 @@ Updated by Christian Limpach (chris@nice.ch)
static Lisp_Object Vselection_converter_alist; static Lisp_Object Vselection_converter_alist;
/* 23: new */ /* 23: new */
/* Coding system for communicating with other programs. */
static Lisp_Object Vselection_coding_system;
/* Coding system for the next communicating with other programs. */
static Lisp_Object Vnext_selection_coding_system;
static Lisp_Object Qforeign_selection; static Lisp_Object Qforeign_selection;
NSString *NXSecondaryPboard; NSString *NXSecondaryPboard;
...@@ -608,21 +604,6 @@ and the local selection value (whatever was given to `x-own-selection').\n\ ...@@ -608,21 +604,6 @@ and the local selection value (whatever was given to `x-own-selection').\n\
Vns_lost_selection_hooks = Qnil; Vns_lost_selection_hooks = Qnil;
/* 23: { */ /* 23: { */
DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,
doc: /* Coding system for communicating with other programs.
When sending or receiving text via cut_buffer, selection, and clipboard,
the text is encoded or decoded by this coding system.
The default value is determined by the system script code. */);
Vselection_coding_system = Qnil;
DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system,
doc: /* Coding system for the next communication with other programs.
Usually, `selection-coding-system' is used for communicating with
other programs. But, if this variable is set, it is used for the
next communication only. After the communication, this variable is
set to nil. */);
Vnext_selection_coding_system = Qnil;
Qforeign_selection = intern ("foreign-selection"); Qforeign_selection = intern ("foreign-selection");
staticpro (&Qforeign_selection); staticpro (&Qforeign_selection);
/* } */ /* } */
......
...@@ -4347,7 +4347,6 @@ - (void)keyDown: (NSEvent *)theEvent ...@@ -4347,7 +4347,6 @@ - (void)keyDown: (NSEvent *)theEvent
if (!emacs_event) if (!emacs_event)
return; return;
/*#if defined (COCOA_EXPERIMENTAL_CTRL_G) */
if (![[self window] isKeyWindow]) if (![[self window] isKeyWindow])
{ {
/* XXX: Using NO_SOCK_SIGIO like Carbon causes a condition in which, /* XXX: Using NO_SOCK_SIGIO like Carbon causes a condition in which,
...@@ -4361,7 +4360,6 @@ NSView most recently updated (I guess), which is not the correct one. ...@@ -4361,7 +4360,6 @@ NSView most recently updated (I guess), which is not the correct one.
[[(EmacsView *)[theEvent window] delegate] keyDown: theEvent]; [[(EmacsView *)[theEvent window] delegate] keyDown: theEvent];
return; return;
} }
/*#endif */
if (nsEvArray == nil) if (nsEvArray == nil)
nsEvArray = [[NSMutableArray alloc] initWithCapacity: 1]; nsEvArray = [[NSMutableArray alloc] initWithCapacity: 1];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment