Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
authorSteven Tamm <steventamm@mac.com>
Fri, 14 May 2004 03:07:12 +0000 (03:07 +0000)
committerSteven Tamm <steventamm@mac.com>
Fri, 14 May 2004 03:07:12 +0000 (03:07 +0000)
prototypes and confusions between pointers and lisp objects

src/ChangeLog
src/lisp.h
src/macfns.c
src/macmenu.c
src/macterm.c
src/macterm.h

index 04b889c..2f5f8c5 100644 (file)
@@ -1,3 +1,20 @@
+2004-05-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * lisp.h (Vx_resource_name, Vx_resource_class): Move from xfns.c
+       section to frame.c section.
+       (Fxw_display_color_p, Fx_file_dialog): Declare if
+       HAVE_WINDOW_SYSTEM defined.     
+       * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup.
+       * macmenu.c (set_frame_menubar): Use NILP to test a lisp value.
+       * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers)
+       (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values.
+       (XTread_socket): Fix int/Lisp_Object mixup.
+       (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup.
+       * macterm.h (struct frame, struct face, struct image)
+       (display_x_get_resource, Fx_display_color_p)
+       (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs): Add
+       prototypes.
+
 2004-05-14  Kim F. Storm  <storm@cua.dk>
 
        * process.c (wait_reading_process_input): Make reentrant.
index bcd0663..8a73d85 100644 (file)
@@ -2884,6 +2884,10 @@ extern int indented_beyond_p P_ ((int, int, double));
 extern void syms_of_indent P_ ((void));
 
 /* defined in frame.c */
+#ifdef HAVE_WINDOW_SYSTEM
+extern Lisp_Object Vx_resource_name;
+extern Lisp_Object Vx_resource_class;
+#endif /* HAVE_WINDOW_SYSTEM */
 extern Lisp_Object Qvisible;
 extern void store_frame_param P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void store_in_alist P_ ((Lisp_Object *, Lisp_Object, Lisp_Object));
@@ -3104,11 +3108,12 @@ extern int getloadavg P_ ((double *, int));
 #ifdef HAVE_X_WINDOWS
 /* Defined in xfns.c */
 extern void syms_of_xfns P_ ((void));
-extern Lisp_Object Vx_resource_name;
-extern Lisp_Object Vx_resource_class;
+#endif /* HAVE_X_WINDOWS */
+#ifdef HAVE_WINDOW_SYSTEM
+/* Defined in xfns.c, w32fns.c, or macfns.c */
 EXFUN (Fxw_display_color_p, 1);
 EXFUN (Fx_file_dialog, 4);
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_WINDOW_SYSTEM */
 
 /* Defined in xsmfns.c */
 extern void syms_of_xsmfns P_ ((void));
index 02d0cb8..625ca29 100644 (file)
@@ -2598,7 +2598,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
 
   if (!NILP (parent))
     {
-      f->output_data.mac->parent_desc = (Window) parent;
+      f->output_data.mac->parent_desc = (Window) XFASTINT (parent);
       f->output_data.mac->explicit_parent = 1;
     }
   else
index 06b1b16..de768d4 100644 (file)
@@ -1424,7 +1424,8 @@ set_frame_menubar (f, first_time, deep_p)
 
       for (i = 0; i < previous_menu_items_used; i++)
        if (menu_items_used == i
-           || (!Fequal (previous_items[i], XVECTOR (menu_items)->contents[i])))
+           || (NILP (Fequal (previous_items[i],
+                             XVECTOR (menu_items)->contents[i]))))
          break;
       if (i == menu_items_used && i == previous_menu_items_used && i != 0)
        {
index 3999067..9523acc 100644 (file)
@@ -7033,8 +7033,8 @@ static int
 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 @@ mac_event_to_emacs_modifiers (EventRef eventRef)
   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 @@ mac_get_mouse_btn (EventRef ref)
   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 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
              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 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
                  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 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
                          = 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 @@ mac_check_for_quit_char ()
       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);
index 868ce88..f9bde77 100644 (file)
@@ -565,8 +565,18 @@ struct scroll_bar {
    text from glomming up against the scroll bar */
 #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
 
-
-struct frame * check_x_frame (Lisp_Object);
+struct frame;
+struct face;
+struct image;
+
+Lisp_Object display_x_get_resource P_ ((struct x_display_info *,
+                                       Lisp_Object, Lisp_Object,
+                                       Lisp_Object, Lisp_Object));
+struct frame *check_x_frame P_ ((Lisp_Object));
+EXFUN (Fx_display_color_p, 1);
+EXFUN (Fx_display_grayscale_p, 1);
+EXFUN (Fx_display_planes, 1);
+extern void x_free_gcs P_ ((struct frame *));
 
 void activate_scroll_bars (FRAME_PTR);
 void deactivate_scroll_bars (FRAME_PTR);