Mercurial > emacs
changeset 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 | 289388d8464e |
children | bdbbd721cc67 |
files | src/ChangeLog src/lisp.h src/macfns.c src/macmenu.c src/macterm.c src/macterm.h |
diffstat | 6 files changed, 50 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Fri May 14 01:03:03 2004 +0000 +++ b/src/ChangeLog Fri May 14 03:07:12 2004 +0000 @@ -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.
--- a/src/lisp.h Fri May 14 01:03:03 2004 +0000 +++ b/src/lisp.h Fri May 14 03:07:12 2004 +0000 @@ -2884,6 +2884,10 @@ 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 @@ #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));
--- a/src/macfns.c Fri May 14 01:03:03 2004 +0000 +++ b/src/macfns.c Fri May 14 03:07:12 2004 +0000 @@ -2598,7 +2598,7 @@ 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
--- a/src/macmenu.c Fri May 14 01:03:03 2004 +0000 +++ b/src/macmenu.c Fri May 14 03:07:12 2004 +0000 @@ -1424,7 +1424,8 @@ 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) {
--- 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);
--- a/src/macterm.h Fri May 14 01:03:03 2004 +0000 +++ b/src/macterm.h Fri May 14 03:07:12 2004 +0000 @@ -565,8 +565,18 @@ text from glomming up against the scroll bar */ #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) +struct frame; +struct face; +struct image; -struct frame * check_x_frame (Lisp_Object); +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);