emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/nsterm.m,v


From: Adrian Robert
Subject: [Emacs-diffs] Changes to emacs/src/nsterm.m,v
Date: Tue, 05 Aug 2008 03:05:17 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Adrian Robert <arobert> 08/08/05 03:05:15

Index: src/nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- src/nsterm.m        4 Aug 2008 14:39:26 -0000       1.22
+++ src/nsterm.m        5 Aug 2008 03:05:14 -0000       1.23
@@ -78,6 +78,7 @@
 #define KEY_NS_INSERT_WORKING_TEXT     ((1<<28)|(0<<16)|9)
 #define KEY_NS_DELETE_WORKING_TEXT     ((1<<28)|(0<<16)|10)
 #define KEY_NS_SPI_SERVICE_CALL        ((1<<28)|(0<<16)|11)
+#define KEY_NS_NEW_FRAME               ((1<<28)|(0<<16)|12)
 
 /* Convert a symbol indexed with an NSxxx value to a value as defined
    in keyboard.c (lispy_function_key). I hope this is a correct way
@@ -3880,6 +3881,7 @@
     appMenu = [[EmacsMenu alloc] initWithTitle: @"Emacs"];
     [appMenu setAutoenablesItems: NO];
     mainMenu = [[EmacsMenu alloc] initWithTitle: @""];
+    dockMenu = [[EmacsMenu alloc] initWithTitle: @""];
 
     [appMenu insertItemWithTitle: @"About Emacs"
                           action: @selector (orderFrontStandardAboutPanel:)
@@ -3918,6 +3920,10 @@
                            keyEquivalent: @""
                                  atIndex: 0];
     [mainMenu setSubmenu: appMenu forItem: item];
+    [dockMenu insertItemWithTitle: @"New Frame"
+                          action: @selector (newFrame:)
+                   keyEquivalent: @""
+                         atIndex: 0];
 
     [NSApp setMainMenu: mainMenu];
     [NSApp setAppleMenu: appMenu];
@@ -4026,6 +4032,20 @@
 }
 
 
+- (void)newFrame: (id)sender
+{
+  struct frame *emacsframe = SELECTED_FRAME ();
+  NSEvent *theEvent = [NSApp currentEvent];
+
+  if (!emacs_event)
+    return;
+  emacs_event->kind = NON_ASCII_KEYSTROKE_EVENT;
+  emacs_event->code = KEY_NS_NEW_FRAME;
+  emacs_event->modifiers = 0;
+  EV_TRAILER (theEvent);
+}
+
+
 /* Open a file (used by below, after going into queue read by ns_read_socket) 
*/
 - (BOOL) openFile: (NSString *)fileName
 {
@@ -4137,6 +4157,14 @@
 
 }
 
+
+/* Handle dock menu requests.  */
+- (NSMenu *)applicationDockMenu: (NSApplication *) sender
+{
+  return dockMenu;
+}
+
+
 /* TODO: these may help w/IO switching btwn terminal and NSApp */
 - (void)applicationDidBecomeActive: (NSNotification *)notification
 {
@@ -4834,8 +4862,6 @@
 
   NSTRACE (windowShouldClose);
   windowClosing = YES;
-  if (ns_window_num <= 1)
-    return NO;
   if (!emacs_event)
     return NO;
   emacs_event->kind = DELETE_WINDOW_EVENT;
@@ -4943,7 +4969,7 @@
 
   ns_send_appdefined (-1);
 
-  /* The following line causes a crash on GNUstep.  Adrian Roberts
+  /* The following line causes a crash on GNUstep.  Adrian Robert
      says he doesn't remember why he added this line, but removing it
      doesn't seem to cause problems on OSX, either.  */
 #if 0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]