diff src/macterm.c @ 55583:21f88361795c

Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing prototypes and confusions between pointers and lisp objects
author Steven Tamm <steventamm@mac.com>
date Fri, 14 May 2004 03:07:12 +0000
parents db942c4b4345
children f1d6a507dcfd ad01ab3c6f4d
line wrap: on
line diff
--- a/src/macterm.c	Fri May 14 01:03:03 2004 +0000
+++ b/src/macterm.c	Fri May 14 03:07:12 2004 +0000
@@ -7033,8 +7033,8 @@
 mac_get_emulated_btn ( UInt32 modifiers )
 {
   int result = 0;
-  if (Vmac_emulate_three_button_mouse != Qnil) {
-    int cmdIs3 = (Vmac_emulate_three_button_mouse != Qreverse);
+  if (!NILP (Vmac_emulate_three_button_mouse)) {
+    int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);
     if (modifiers & controlKey)
       result = cmdIs3 ? 2 : 1;
     else if (modifiers & optionKey)
@@ -7052,7 +7052,7 @@
   UInt32 mods = 0;
   GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,
 		    sizeof (UInt32), NULL, &mods);
-  if (Vmac_emulate_three_button_mouse != Qnil &&
+  if (!NILP (Vmac_emulate_three_button_mouse) &&
       GetEventClass(eventRef) == kEventClassMouse)
     {
       mods &= ~(optionKey & cmdKey);
@@ -7071,7 +7071,7 @@
   switch (result)
     {
     case kEventMouseButtonPrimary:
-      if (Vmac_emulate_three_button_mouse == Qnil)
+      if (NILP (Vmac_emulate_three_button_mouse))
 	return 0;
       else {
 	UInt32 mods = 0;
@@ -8227,7 +8227,7 @@
 	      inev.timestamp = er.when * (1000 / 60);
 	        /* ticks to milliseconds */
 
-              XSETINT (inev.x, tracked_scroll_bar->left + 2);
+              XSETINT (inev.x, XFASTINT (tracked_scroll_bar->left) + 2);
               XSETINT (inev.y, mouse_loc.v - 24);
               tracked_scroll_bar->dragging = Qnil;
               mouse_tracking_in_progress = mouse_tracking_none;
@@ -8312,6 +8312,8 @@
 		  else
 	            {
 		      Lisp_Object window;
+		      int x = mouse_loc.h;
+		      int y = mouse_loc.v;
 
 		      XSETFRAME (inev.frame_or_window, mwp->mFP);
 		      if (er.what == mouseDown)
@@ -8319,14 +8321,14 @@
 			  = mouse_tracking_mouse_movement;
 		      else
 			mouse_tracking_in_progress = mouse_tracking_none;
-		      window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1);
+		      window = window_from_coordinates (mwp->mFP, x, y, 0, 0, 0, 1);
 
 		      if (EQ (window, mwp->mFP->tool_bar_window))
 			{
 			  if (er.what == mouseDown)
-			    handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 1, 0);
+			    handle_tool_bar_click (mwp->mFP, x, y, 1, 0);
 			  else
-			    handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 0,
+			    handle_tool_bar_click (mwp->mFP, x, y, 0,
 #if USE_CARBON_EVENTS
 						   mac_event_to_emacs_modifiers (eventRef)
 #else
@@ -9024,7 +9026,7 @@
       EVENT_INIT (e);
       e.kind = ASCII_KEYSTROKE_EVENT;
       e.code = quit_char;
-      e.arg = NULL;
+      e.arg = Qnil;
       e.modifiers = NULL;
       e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60);
       XSETFRAME (e.frame_or_window, mwp->mFP);