/* This should be the first include, as it may set up #defines affecting
interpretation of even the system includes. */
-#include "config.h"
+#include <config.h>
#include <math.h>
#include <sys/types.h>
the Command modifier. May be any of the modifier lisp symbols. */
Lisp_Object ns_command_modifier;
+/* Specifies which emacs modifier should be generated when NS receives
+ the right Command modifier. Has same values as ns_command_modifier plus
+ the value Qleft which means whatever value ns_command_modifier has. */
+Lisp_Object ns_right_command_modifier;
+
/* Specifies which emacs modifier should be generated when NS receives
the Control modifier. May be any of the modifier lisp symbols. */
Lisp_Object ns_control_modifier;
+/* Specifies which emacs modifier should be generated when NS receives
+ the right Control modifier. Has same values as ns_control_modifier plus
+ the value Qleft which means whatever value ns_control_modifier has. */
+Lisp_Object ns_right_control_modifier;
+
/* Specifies which emacs modifier should be generated when NS receives
the Function modifier (laptops). May be any of the modifier lisp symbols. */
Lisp_Object ns_function_modifier;
/* Convert modifiers in a NeXTSTEP event to emacs style modifiers. */
#define NS_FUNCTION_KEY_MASK 0x800000
+#define NSLeftControlKeyMask (0x000001 | NSControlKeyMask)
+#define NSRightControlKeyMask (0x002000 | NSControlKeyMask)
+#define NSLeftCommandKeyMask (0x000008 | NSCommandKeyMask)
+#define NSRightCommandKeyMask (0x000010 | NSCommandKeyMask)
+#define NSLeftAlternateKeyMask (0x000020 | NSAlternateKeyMask)
#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
#define EV_MODIFIERS(e) \
((([e modifierFlags] & NSHelpKeyMask) ? \
parse_solitary_modifier (ns_alternate_modifier) : 0) \
| (([e modifierFlags] & NSShiftKeyMask) ? \
shift_modifier : 0) \
+ | (!EQ (ns_right_control_modifier, Qleft) && \
+ (([e modifierFlags] & NSRightControlKeyMask) \
+ == NSRightControlKeyMask) ? \
+ parse_solitary_modifier (ns_right_control_modifier) : 0) \
| (([e modifierFlags] & NSControlKeyMask) ? \
parse_solitary_modifier (ns_control_modifier) : 0) \
| (([e modifierFlags] & NS_FUNCTION_KEY_MASK) ? \
parse_solitary_modifier (ns_function_modifier) : 0) \
+ | (!EQ (ns_right_command_modifier, Qleft) && \
+ (([e modifierFlags] & NSRightCommandKeyMask) \
+ == NSRightCommandKeyMask) ? \
+ parse_solitary_modifier (ns_right_command_modifier) : 0) \
| (([e modifierFlags] & NSCommandKeyMask) ? \
parse_solitary_modifier (ns_command_modifier):0))
void
-ns_init_paths ()
+ns_init_paths (void)
/* --------------------------------------------------------------------------
Used to allow emacs to find its resources under Emacs.app
Called from emacs.c at startup.
void *
-ns_alloc_autorelease_pool ()
+ns_alloc_autorelease_pool (void)
/* --------------------------------------------------------------------------
Allocate a pool for temporary objects (callable from C)
-------------------------------------------------------------------------- */
-------------------------------------------------------------------------- */
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
NSTRACE (ns_update_window_begin);
updated_window = w;
BLOCK_INPUT;
- if (f == dpyinfo->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
/* Don't do highlighting for mouse motion during the update. */
- dpyinfo->mouse_face_defer = 1;
+ hlinfo->mouse_face_defer = 1;
/* If the frame needs to be redrawn,
simply forget about any prior mouse highlighting. */
if (FRAME_GARBAGED_P (f))
- dpyinfo->mouse_face_window = Qnil;
+ hlinfo->mouse_face_window = Qnil;
/* (further code for mouse faces ifdef'd out in other terms elided) */
}
external (RIF) call; for one window called before update_end
-------------------------------------------------------------------------- */
{
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (XFRAME (w->frame));
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
/* note: this fn is nearly identical in all terms */
if (!w->pseudo_window_p)
frame_up_to_date to redisplay the mouse highlight. */
if (mouse_face_overwritten_p)
{
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_window = Qnil;
+ hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
+ hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
+ hlinfo->mouse_face_window = Qnil;
}
updated_window = NULL;
{
NSView *view = FRAME_NS_VIEW (f);
-/* if (f == FRAME_NS_DISPLAY_INFO (f)->mouse_face_mouse_frame) */
- FRAME_NS_DISPLAY_INFO (f)->mouse_face_defer = 0;
+/* if (f == MOUSE_HL_INFO (f)->mouse_face_mouse_frame) */
+ MOUSE_HL_INFO (f)->mouse_face_defer = 0;
BLOCK_INPUT;
static void
-ns_ring_bell ()
+ns_ring_bell (struct frame *f)
/* --------------------------------------------------------------------------
"Beep" routine
-------------------------------------------------------------------------- */
{
NSView *view = FRAME_NS_VIEW (f);
struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
NSTRACE (x_destroy_window);
check_ns ();
dpyinfo->x_focus_frame = 0;
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
- if (f == dpyinfo->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_window = Qnil;
- dpyinfo->mouse_face_deferred_gc = 0;
- dpyinfo->mouse_face_mouse_frame = 0;
+ hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
+ hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
+ hlinfo->mouse_face_window = Qnil;
+ hlinfo->mouse_face_deferred_gc = 0;
+ hlinfo->mouse_face_mouse_frame = 0;
}
xfree (f->output_data.ns);
difference between the real width and Emacs' imagined one. For
right-hand bars, don't worry about it since the extra is never used.
(Obviously doesn't work for vertically split windows tho..) */
- NSPoint origin = FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)
- ? NSMakePoint (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)
- - NS_SCROLL_BAR_WIDTH (f), 0)
- : NSMakePoint (0, 0);
- [view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)];
- [view setBoundsOrigin: origin];
+ {
+ NSPoint origin = FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)
+ ? NSMakePoint (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)
+ - NS_SCROLL_BAR_WIDTH (f), 0)
+ : NSMakePoint (0, 0);
+ [view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)];
+ [view setBoundsOrigin: origin];
+ }
change_frame_size (f, rows, cols, 0, 1, 0); /* pretend, delay, safe */
FRAME_PIXEL_WIDTH (f) = pixelwidth;
int
-ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc,
+ns_defined_color (struct frame *f,
+ const char *name,
+ XColor *color_def,
+ int alloc,
char makeIndex)
/* --------------------------------------------------------------------------
Return 1 if named color found, and set color_def rgb accordingly.
if (FRAME_NS_P (f))
{
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
- if ((dpyinfo->mouse_face_deferred_gc||f ==dpyinfo->mouse_face_mouse_frame)
- /*&& dpyinfo->mouse_face_mouse_frame*/)
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
+ if ((hlinfo->mouse_face_deferred_gc || f ==hlinfo->mouse_face_mouse_frame)
+ /*&& hlinfo->mouse_face_mouse_frame*/)
{
BLOCK_INPUT;
- ns_update_begin(f);
- if (dpyinfo->mouse_face_mouse_frame)
- note_mouse_highlight (dpyinfo->mouse_face_mouse_frame,
- dpyinfo->mouse_face_mouse_x,
- dpyinfo->mouse_face_mouse_y);
- dpyinfo->mouse_face_deferred_gc = 0;
- ns_update_end(f);
+ ns_update_begin(f);
+ if (hlinfo->mouse_face_mouse_frame)
+ note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
+ hlinfo->mouse_face_mouse_x,
+ hlinfo->mouse_face_mouse_y);
+ hlinfo->mouse_face_deferred_gc = 0;
+ ns_update_end(f);
UNBLOCK_INPUT;
}
}
EmacsView *view = FRAME_NS_VIEW (f);
FRAME_POINTER_TYPE (f) = cursor;
[[view window] invalidateCursorRectsForView: view];
+ /* Redisplay assumes this function also draws the changed frame
+ cursor, but this function doesn't, so do it explicitly. */
+ x_update_cursor (f, 1);
}
}
{
EmacsImage **newBimgs
= xmalloc (max_used_fringe_bitmap * sizeof (EmacsImage *));
- bzero (newBimgs, max_used_fringe_bitmap * sizeof (EmacsImage *));
+ memset (newBimgs, 0, max_used_fringe_bitmap * sizeof (EmacsImage *));
if (nBimgs)
{
- bcopy (bimgs, newBimgs, nBimgs * sizeof (EmacsImage *));
+ memcpy (newBimgs, bimgs, nBimgs * sizeof (EmacsImage *));
xfree (bimgs);
}
int yAdjust = rowY - FRAME_INTERNAL_BORDER_WIDTH (f) < 5 ?
-FRAME_INTERNAL_BORDER_WIDTH (f) : 0;
int yIncr = FRAME_PIXEL_HEIGHT (f) - (p->by+yAdjust + p->ny) < 5 ?
- FRAME_INTERNAL_BORDER_WIDTH (f) : 0;
- if (yAdjust)
- yIncr += FRAME_INTERNAL_BORDER_WIDTH (f);
+ FRAME_INTERNAL_BORDER_WIDTH (f) : 0
+ + (yAdjust ? FRAME_INTERNAL_BORDER_WIDTH (f) : 0);
NSRect r = NSMakeRect (p->bx+xAdjust, p->by+yAdjust, p->nx, p->ny+yIncr);
NSRectClip (r);
[ns_lookup_indexed_color(face->background, f) set];
struct frame *f = WINDOW_XFRAME (w);
struct glyph *phys_cursor_glyph;
int overspill;
+ struct glyph *cursor_glyph;
+
+ /* If cursor is out of bounds, don't draw garbage. This can happen
+ in mini-buffer windows when switching between echo area glyphs
+ and mini-buffer. */
NSTRACE (dumpcursor);
//fprintf(stderr, "drawcursor (%d,%d) activep = %d\tonp = %d\tc_type = %d\twidth = %d\n",x,y, active_p,on_p,cursor_type,cursor_width);
case BAR_CURSOR:
s = r;
s.size.width = min (cursor_width, 2); //FIXME(see above)
+
+ /* If the character under cursor is R2L, draw the bar cursor
+ on the right of its glyph, rather than on the left. */
+ cursor_glyph = get_phys_cursor_glyph (w);
+ if ((cursor_glyph->resolved_level & 1) != 0)
+ s.origin.x += cursor_glyph->pixel_width - s.size.width;
+
NSRectFill (s);
break;
}
void
-hide_hourglass ()
+hide_hourglass (void)
{
if (!hourglass_shown_p)
return;
if (s->hl == DRAW_MOUSE_FACE)
{
- face = FACE_FROM_ID
- (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
struct face *face;
if (s->hl == DRAW_MOUSE_FACE)
{
- face = FACE_FROM_ID
- (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ face = FACE_FROM_ID (s->f,
+ MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
with its background color), we must clear just the image area. */
if (s->hl == DRAW_MOUSE_FACE)
{
- face = FACE_FROM_ID
- (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
if (s->hl == DRAW_MOUSE_FACE)
{
- face = FACE_FROM_ID
- (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
if (ns_tmp_font == NULL)
ns_tmp_font = (struct nsfont_info *)FRAME_FONT (s->f);
+ if (s->hl == DRAW_CURSOR && s->w->phys_cursor_type == FILLED_BOX_CURSOR)
+ {
+ unsigned long tmp = NS_FACE_BACKGROUND (s->face);
+ NS_FACE_BACKGROUND (s->face) = NS_FACE_FOREGROUND (s->face);
+ NS_FACE_FOREGROUND (s->face) = tmp;
+ }
+
ns_tmp_font->font.driver->draw
(s, 0, s->nchars, s->x, s->y,
(ns_tmp_flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p)
|| ns_tmp_flags == NS_DUMPGLYPH_MOUSEFACE);
+ if (s->hl == DRAW_CURSOR && s->w->phys_cursor_type == FILLED_BOX_CURSOR)
+ {
+ unsigned long tmp = NS_FACE_BACKGROUND (s->face);
+ NS_FACE_BACKGROUND (s->face) = NS_FACE_FOREGROUND (s->face);
+ NS_FACE_FOREGROUND (s->face) = tmp;
+ }
+
+ ns_unfocus (s->f);
+ break;
+
+ case GLYPHLESS_GLYPH:
+ n = ns_get_glyph_string_clip_rect (s, r);
+ ns_focus (s->f, r, n);
+
+ if (s->for_overlaps || (s->cmp_from > 0
+ && ! s->first_glyph->u.cmp.automatic))
+ s->background_filled_p = 1;
+ else
+ ns_maybe_dumpglyphs_background
+ (s, s->first_glyph->type == COMPOSITE_GLYPH);
+ /* ... */
+ /* Not yet implemented. */
+ /* ... */
ns_unfocus (s->f);
break;
========================================================================== */
int
-x_display_pixel_height (dpyinfo)
- struct ns_display_info *dpyinfo;
+x_display_pixel_height (struct ns_display_info *dpyinfo)
{
NSScreen *screen = [NSScreen mainScreen];
return [screen frame].size.height;
}
int
-x_display_pixel_width (dpyinfo)
- struct ns_display_info *dpyinfo;
+x_display_pixel_width (struct ns_display_info *dpyinfo)
{
NSScreen *screen = [NSScreen mainScreen];
return [screen frame].size.width;
{
NSScreen *screen = [NSScreen mainScreen];
NSWindowDepth depth = [screen depth];
+ Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
dpyinfo->resx = 72.27; /* used 75.0, but this makes pt == pixel, expected */
dpyinfo->resy = 72.27;
dpyinfo->color_table->colors = NULL;
dpyinfo->root_window = 42; /* a placeholder.. */
- dpyinfo->mouse_face_mouse_frame = NULL;
- dpyinfo->mouse_face_deferred_gc = 0;
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID;
- dpyinfo->mouse_face_window = dpyinfo->mouse_face_overlay = Qnil;
- dpyinfo->mouse_face_hidden = 0;
+ hlinfo->mouse_face_mouse_frame = NULL;
+ hlinfo->mouse_face_deferred_gc = 0;
+ hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
+ hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
+ hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
+ hlinfo->mouse_face_window = hlinfo->mouse_face_overlay = Qnil;
+ hlinfo->mouse_face_hidden = 0;
- dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0;
- dpyinfo->mouse_face_defer = 0;
+ hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0;
+ hlinfo->mouse_face_defer = 0;
dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame = NULL;
name: nil object: nil]; */
dpyinfo = (struct ns_display_info *)xmalloc (sizeof (struct ns_display_info));
- bzero (dpyinfo, sizeof (struct ns_display_info));
+ memset (dpyinfo, 0, sizeof (struct ns_display_info));
ns_initialize_display_info (dpyinfo);
terminal = ns_create_terminal (dpyinfo);
- (void)keyDown: (NSEvent *)theEvent
{
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe);
int code;
unsigned fnKeysym = 0;
int flags;
[NSCursor setHiddenUntilMouseMoves: YES];
- if (dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
+ if (hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
{
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_hidden = 1;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_hidden = 1;
}
if (!processingCompose)
code = ([[theEvent charactersIgnoringModifiers] length] == 0) ?
0 : [[theEvent charactersIgnoringModifiers] characterAtIndex: 0];
/* (Carbon way: [theEvent keyCode]) */
-
+
/* is it a "function key"? */
fnKeysym = ns_convert_key (code);
if (fnKeysym)
if (flags & NSShiftKeyMask)
emacs_event->modifiers |= shift_modifier;
- if (flags & NSCommandKeyMask)
+ if ((flags & NSRightCommandKeyMask) == NSRightCommandKeyMask)
+ emacs_event->modifiers |= parse_solitary_modifier
+ (EQ (ns_right_command_modifier, Qleft)
+ ? ns_command_modifier
+ : ns_right_command_modifier);
+
+ if ((flags & NSLeftCommandKeyMask) == NSLeftCommandKeyMask)
{
- emacs_event->modifiers |= parse_solitary_modifier (ns_command_modifier);
+ emacs_event->modifiers |= parse_solitary_modifier
+ (ns_command_modifier);
+
/* if super (default), take input manager's word so things like
dvorak / qwerty layout work */
if (EQ (ns_command_modifier, Qsuper)
}
}
- if (flags & NSControlKeyMask)
- emacs_event->modifiers |=
- parse_solitary_modifier (ns_control_modifier);
+ if ((flags & NSRightControlKeyMask) == NSRightControlKeyMask)
+ emacs_event->modifiers |= parse_solitary_modifier
+ (EQ (ns_right_control_modifier, Qleft)
+ ? ns_control_modifier
+ : ns_right_control_modifier);
+
+ if ((flags & NSLeftControlKeyMask) == NSLeftControlKeyMask)
+ emacs_event->modifiers |= parse_solitary_modifier
+ (ns_control_modifier);
if (flags & NS_FUNCTION_KEY_MASK && !fnKeysym)
emacs_event->modifiers |=
parse_solitary_modifier (ns_function_modifier);
- if (!EQ (ns_right_alternate_modifier, Qleft)
- && ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask))
- {
- emacs_event->modifiers |= parse_solitary_modifier
- (ns_right_alternate_modifier);
- }
- else if (flags & NSAlternateKeyMask) /* default = meta */
+ if ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask)
+ {
+ if ((NILP (ns_right_alternate_modifier)
+ || EQ (ns_right_alternate_modifier, Qnone))
+ && !fnKeysym)
+ { /* accept pre-interp alt comb */
+ if ([[theEvent characters] length] > 0)
+ code = [[theEvent characters] characterAtIndex: 0];
+ /*HACK: clear lone shift modifier to stop next if from firing */
+ if (emacs_event->modifiers == shift_modifier)
+ emacs_event->modifiers = 0;
+ }
+ else
+ emacs_event->modifiers |= parse_solitary_modifier
+ (EQ (ns_right_alternate_modifier, Qleft)
+ ? ns_alternate_modifier
+ : ns_right_alternate_modifier);
+ }
+
+ if ((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask) /* default = meta */
{
- if ((NILP (ns_alternate_modifier) || EQ (ns_alternate_modifier, Qnone))
+ if ((NILP (ns_alternate_modifier)
+ || EQ (ns_alternate_modifier, Qnone))
&& !fnKeysym)
{ /* accept pre-interp alt comb */
if ([[theEvent characters] length] > 0)
/* Tell emacs the mouse has moved. */
- (void)mouseMoved: (NSEvent *)e
{
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe);
Lisp_Object frame;
// NSTRACE (mouseMoved);
= [self convertPoint: [e locationInWindow] fromView: nil];
/* update any mouse face */
- if (dpyinfo->mouse_face_hidden)
+ if (hlinfo->mouse_face_hidden)
{
- dpyinfo->mouse_face_hidden = 0;
- clear_mouse_face (dpyinfo);
+ hlinfo->mouse_face_hidden = 0;
+ clear_mouse_face (hlinfo);
}
/* tooltip handling */
{
NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil];
NSRect r;
- struct ns_display_info *dpyinfo
- = emacsframe ? FRAME_NS_DISPLAY_INFO (emacsframe) : NULL;
+ Mouse_HLInfo *hlinfo = emacsframe ? MOUSE_HL_INFO (emacsframe) : NULL;
NSTRACE (mouseExited);
- if (dpyinfo || !emacsframe)
+ if (!hlinfo)
return;
last_mouse_movement_time = EV_TIMESTAMP (theEvent);
- if (emacsframe == dpyinfo->mouse_face_mouse_frame)
+ if (emacsframe == hlinfo->mouse_face_mouse_frame)
{
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_mouse_frame = 0;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_mouse_frame = 0;
}
}
NSTRACE (performDragOperation);
if (!emacs_event)
- return;
+ return NO;
position = [self convertPoint: [sender draggingLocation] fromView: nil];
x = lrint (position.x); y = lrint (position.y);
NSTRACE (judge);
if (condemned)
{
+ EmacsView *view;
BLOCK_INPUT;
/* ensure other scrollbar updates after deletion */
- EmacsView *view = (EmacsView *)FRAME_NS_VIEW (frame);
+ view = (EmacsView *)FRAME_NS_VIEW (frame);
if (view != nil)
view->scrollbarsNeedingUpdate++;
[self removeFromSuperview];
void
-syms_of_nsterm ()
+syms_of_nsterm (void)
{
NSTRACE (syms_of_nsterm);
Set to control, meta, alt, super, or hyper means it is taken to be that key.");
ns_command_modifier = Qsuper;
+ DEFVAR_LISP ("ns-right-command-modifier", &ns_right_command_modifier,
+ "This variable describes the behavior of the right command key.\n\
+Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
+Set to left means be the same key as `ns-command-modifier'.\n\
+Set to none means that the command / option key is not interpreted by Emacs\n\
+at all, allowing it to be used at a lower level for accented character entry.");
+ ns_right_command_modifier = Qleft;
+
DEFVAR_LISP ("ns-control-modifier", &ns_control_modifier,
"This variable describes the behavior of the control key.\n\
Set to control, meta, alt, super, or hyper means it is taken to be that key.");
ns_control_modifier = Qcontrol;
+ DEFVAR_LISP ("ns-right-control-modifier", &ns_right_control_modifier,
+ "This variable describes the behavior of the right control key.\n\
+Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
+Set to left means be the same key as `ns-control-modifier'.\n\
+Set to none means that the control / option key is not interpreted by Emacs\n\
+at all, allowing it to be used at a lower level for accented character entry.");
+ ns_right_control_modifier = Qleft;
+
DEFVAR_LISP ("ns-function-modifier", &ns_function_modifier,
"This variable describes the behavior of the function key (on laptops).\n\
Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\