emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117636: * nsfns.m (x_icon): icon_top/left is int


From: Jan D.
Subject: [Emacs-diffs] emacs-24 r117636: * nsfns.m (x_icon): icon_top/left is int.
Date: Thu, 30 Oct 2014 17:24:01 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117636
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18889
committer: Jan D. <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-10-30 18:23:52 +0100
message:
  * nsfns.m (x_icon): icon_top/left is int.
  
  * nsterm.h (EmacsScroller): Replace Lisp_Object win with
  struct window*.
  Remove getMouseMotionPart.
  (ns_output): Make icon_top/left int.
  
  * nsterm.m (ns_mouse_position): Remove unused code.
  (initFrame:window:, dealloc): Use window instead of win.
  (getMouseMotionPart:window:x:y:): Remove, unused.
  (sendScrollEventAtLoc:fromEvent:): Make Lisp_Object win from window.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/nsfns.m                    nsfns.m-20091113204419-o5vbwnq5f7feedwu-8741
  src/nsterm.h                   nsterm.h-20091113204419-o5vbwnq5f7feedwu-8746
  src/nsterm.m                   nsterm.m-20091113204419-o5vbwnq5f7feedwu-8747
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-10-30 05:31:12 +0000
+++ b/src/ChangeLog     2014-10-30 17:23:52 +0000
@@ -1,3 +1,17 @@
+2014-10-30  Jan Djärv  <address@hidden>
+
+       * nsterm.h (EmacsScroller): Replace Lisp_Object win with
+       struct window* (Bug#18889).
+       Remove getMouseMotionPart.
+       (ns_output): Make icon_top/left int.
+
+       * nsfns.m (x_icon): icon_top/left is int.
+
+       * nsterm.m (ns_mouse_position): Remove unused code.
+       (initFrame:window:, dealloc): Use window instead of win.
+       (getMouseMotionPart:window:x:y:): Remove, unused.
+       (sendScrollEventAtLoc:fromEvent:): Make Lisp_Object win from window.
+
 2014-10-30  Samuel Bronson  <address@hidden>
 
        * unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (Bug#9927).

=== modified file 'src/nsfns.m'
--- a/src/nsfns.m       2014-02-11 18:05:01 +0000
+++ b/src/nsfns.m       2014-10-30 17:23:52 +0000
@@ -913,8 +913,8 @@
   Lisp_Object icon_x, icon_y;
   struct ns_display_info *dpyinfo = check_ns_display_info (Qnil);
 
-  f->output_data.ns->icon_top = Qnil;
-  f->output_data.ns->icon_left = Qnil;
+  f->output_data.ns->icon_top = -1;
+  f->output_data.ns->icon_left = -1;
 
   /* Set the position of the icon.  */
   icon_x = x_get_arg (dpyinfo, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
@@ -923,8 +923,8 @@
     {
       CHECK_NUMBER (icon_x);
       CHECK_NUMBER (icon_y);
-      f->output_data.ns->icon_top = icon_y;
-      f->output_data.ns->icon_left = icon_x;
+      f->output_data.ns->icon_top = XINT (icon_y);
+      f->output_data.ns->icon_left = XINT (icon_x);
     }
   else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
     error ("Both left and top icon corners of icon must be specified");

=== modified file 'src/nsterm.h'
--- a/src/nsterm.h      2014-07-20 13:18:47 +0000
+++ b/src/nsterm.h      2014-10-30 17:23:52 +0000
@@ -393,7 +393,7 @@
 
 @interface EmacsScroller : NSScroller
   {
-   Lisp_Object win;
+   struct window *window;
    struct frame *frame;
    NSResponder *prevResponder;
 
@@ -418,8 +418,6 @@
 - setPosition: (int) position portion: (int) portion whole: (int) whole;
 - (int) checkSamePosition: (int)position portion: (int)portion
                     whole: (int)whole;
-- (void) getMouseMotionPart: (int *)part window: (Lisp_Object *)window
-                          x: (Lisp_Object *)x y: ( Lisp_Object *)y;
 - (void) sendScrollEventAtLoc: (float)loc fromEvent: (NSEvent *)e;
 - repeatScroll: (NSTimer *)sender;
 - condemn;
@@ -685,8 +683,8 @@
      value contains an ID of the fontset, else -1.  */
   int fontset; /* only used with font_backend */
 
-  Lisp_Object icon_top;
-  Lisp_Object icon_left;
+  int icon_top;
+  int icon_left;
 
   /* The size of the extra width currently allotted for vertical
      scroll bars, in pixels.  */

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2014-09-09 17:46:28 +0000
+++ b/src/nsterm.m      2014-10-30 17:23:52 +0000
@@ -1902,51 +1902,37 @@
 
   block_input ();
 
-  if (dpyinfo->last_mouse_scroll_bar != nil && insist == 0)
+  /* Clear the mouse-moved flag for every frame on this display.  */
+  FOR_EACH_FRAME (tail, frame)
+    if (FRAME_NS_P (XFRAME (frame))
+        && FRAME_NS_DISPLAY (XFRAME (frame)) == FRAME_NS_DISPLAY (*fp))
+      XFRAME (frame)->mouse_moved = 0;
+
+  dpyinfo->last_mouse_scroll_bar = nil;
+  if (dpyinfo->last_mouse_frame
+      && FRAME_LIVE_P (dpyinfo->last_mouse_frame))
+    f = dpyinfo->last_mouse_frame;
+  else
+    f = dpyinfo->x_focus_frame ? dpyinfo->x_focus_frame : SELECTED_FRAME ();
+
+  if (f && FRAME_NS_P (f))
     {
-      /* TODO: we do not use this path at the moment because drag events will
-           go directly to the EmacsScroller.  Leaving code in for now. */
-      [dpyinfo->last_mouse_scroll_bar
-         getMouseMotionPart: (int *)part window: bar_window x: x y: y];
+      view = FRAME_NS_VIEW (*fp);
+
+      position = [[view window] mouseLocationOutsideOfEventStream];
+      position = [view convertPoint: position fromView: nil];
+      remember_mouse_glyph (f, position.x, position.y,
+                            &dpyinfo->last_mouse_glyph);
+/*fprintf (stderr, "ns_mouse_position: %.0f, %.0f\n", position.x, position.y); 
*/
+
+      if (bar_window) *bar_window = Qnil;
+      if (part) *part = 0; /*scroll_bar_handle; */
+
+      if (x) XSETINT (*x, lrint (position.x));
+      if (y) XSETINT (*y, lrint (position.y));
       if (time)
-       *time = dpyinfo->last_mouse_movement_time;
-      dpyinfo->last_mouse_scroll_bar = nil;
-    }
-  else
-    {
-      /* Clear the mouse-moved flag for every frame on this display.  */
-      FOR_EACH_FRAME (tail, frame)
-        if (FRAME_NS_P (XFRAME (frame))
-            && FRAME_NS_DISPLAY (XFRAME (frame)) == FRAME_NS_DISPLAY (*fp))
-          XFRAME (frame)->mouse_moved = 0;
-
-      dpyinfo->last_mouse_scroll_bar = nil;
-      if (dpyinfo->last_mouse_frame
-         && FRAME_LIVE_P (dpyinfo->last_mouse_frame))
-        f = dpyinfo->last_mouse_frame;
-      else
-        f = dpyinfo->x_focus_frame ? dpyinfo->x_focus_frame
-                                    : SELECTED_FRAME ();
-
-      if (f && FRAME_NS_P (f))
-        {
-          view = FRAME_NS_VIEW (*fp);
-
-          position = [[view window] mouseLocationOutsideOfEventStream];
-          position = [view convertPoint: position fromView: nil];
-          remember_mouse_glyph (f, position.x, position.y,
-                               &dpyinfo->last_mouse_glyph);
-/*fprintf (stderr, "ns_mouse_position: %.0f, %.0f\n", position.x, position.y); 
*/
-
-          if (bar_window) *bar_window = Qnil;
-          if (part) *part = 0; /*scroll_bar_handle; */
-
-          if (x) XSETINT (*x, lrint (position.x));
-          if (y) XSETINT (*y, lrint (position.y));
-          if (time)
-           *time = dpyinfo->last_mouse_movement_time;
-          *fp = f;
-        }
+        *time = dpyinfo->last_mouse_movement_time;
+      *fp = f;
     }
 
   unblock_input ();
@@ -7121,13 +7107,13 @@
   [self setAutoresizingMask: NSViewMinXMargin | NSViewHeightSizable];
 #endif
 
-  win = nwin;
+  window = XWINDOW (nwin);
   condemned = NO;
   pixel_height = NSHeight (r);
   if (pixel_height == 0) pixel_height = 1;
   min_portion = 20 / pixel_height;
 
-  frame = XFRAME (XWINDOW (win)->frame);
+  frame = XFRAME (window->frame);
   if (FRAME_LIVE_P (frame))
     {
       int i;
@@ -7165,8 +7151,9 @@
 - (void)dealloc
 {
   NSTRACE (EmacsScroller_dealloc);
-  if (!NILP (win))
-    wset_vertical_scroll_bar (XWINDOW (win), Qnil);
+  if (window)
+    wset_vertical_scroll_bar (window, Qnil);
+  window = 0;
   [super dealloc];
 }
 
@@ -7265,30 +7252,17 @@
   return self;
 }
 
-/* FIXME: unused at moment (see ns_mouse_position) at the moment because
-     drag events will go directly to the EmacsScroller.  Leaving in for now. */
--(void)getMouseMotionPart: (int *)part window: (Lisp_Object *)window
-                        x: (Lisp_Object *)x y: ( Lisp_Object *)y
-{
-  *part = last_hit_part;
-  *window = win;
-  XSETINT (*y, pixel_height);
-  if ([self floatValue] > 0.999F)
-    XSETINT (*x, pixel_height);
-  else
-    XSETINT (*x, pixel_height * [self floatValue]);
-}
-
-
 /* set up emacs_event */
 - (void) sendScrollEventAtLoc: (float)loc fromEvent: (NSEvent *)e
 {
+  Lisp_Object win;
   if (!emacs_event)
     return;
 
   emacs_event->part = last_hit_part;
   emacs_event->code = 0;
   emacs_event->modifiers = EV_MODIFIERS (e) | down_modifier;
+  XSETWINDOW (win, window);
   emacs_event->frame_or_window = win;
   emacs_event->timestamp = EV_TIMESTAMP (e);
   emacs_event->kind = SCROLL_BAR_CLICK_EVENT;


reply via email to

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