aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Tamm2004-05-14 03:07:12 +0000
committerSteven Tamm2004-05-14 03:07:12 +0000
commita433994a5a3d2bab4c4d659f73b23524201b6819 (patch)
tree0866f6d4b49f14d7f289bc61a1880d4be463e9aa
parent97dad9d378e973c5bc9d3c13cb1fb399764db6dc (diff)
downloademacs-a433994a5a3d2bab4c4d659f73b23524201b6819.tar.gz
emacs-a433994a5a3d2bab4c4d659f73b23524201b6819.zip
Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
prototypes and confusions between pointers and lisp objects
-rw-r--r--src/ChangeLog17
-rw-r--r--src/lisp.h11
-rw-r--r--src/macfns.c2
-rw-r--r--src/macmenu.c3
-rw-r--r--src/macterm.c20
-rw-r--r--src/macterm.h14
6 files changed, 51 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 04b889cd70f..2f5f8c59315 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,20 @@
12004-05-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * lisp.h (Vx_resource_name, Vx_resource_class): Move from xfns.c
4 section to frame.c section.
5 (Fxw_display_color_p, Fx_file_dialog): Declare if
6 HAVE_WINDOW_SYSTEM defined.
7 * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup.
8 * macmenu.c (set_frame_menubar): Use NILP to test a lisp value.
9 * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers)
10 (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values.
11 (XTread_socket): Fix int/Lisp_Object mixup.
12 (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup.
13 * macterm.h (struct frame, struct face, struct image)
14 (display_x_get_resource, Fx_display_color_p)
15 (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs): Add
16 prototypes.
17
12004-05-14 Kim F. Storm <storm@cua.dk> 182004-05-14 Kim F. Storm <storm@cua.dk>
2 19
3 * process.c (wait_reading_process_input): Make reentrant. 20 * process.c (wait_reading_process_input): Make reentrant.
diff --git a/src/lisp.h b/src/lisp.h
index bcd066360b3..8a73d852c4b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2884,6 +2884,10 @@ extern int indented_beyond_p P_ ((int, int, double));
2884extern void syms_of_indent P_ ((void)); 2884extern void syms_of_indent P_ ((void));
2885 2885
2886/* defined in frame.c */ 2886/* defined in frame.c */
2887#ifdef HAVE_WINDOW_SYSTEM
2888extern Lisp_Object Vx_resource_name;
2889extern Lisp_Object Vx_resource_class;
2890#endif /* HAVE_WINDOW_SYSTEM */
2887extern Lisp_Object Qvisible; 2891extern Lisp_Object Qvisible;
2888extern void store_frame_param P_ ((struct frame *, Lisp_Object, Lisp_Object)); 2892extern void store_frame_param P_ ((struct frame *, Lisp_Object, Lisp_Object));
2889extern void store_in_alist P_ ((Lisp_Object *, Lisp_Object, Lisp_Object)); 2893extern void store_in_alist P_ ((Lisp_Object *, Lisp_Object, Lisp_Object));
@@ -3104,11 +3108,12 @@ extern int getloadavg P_ ((double *, int));
3104#ifdef HAVE_X_WINDOWS 3108#ifdef HAVE_X_WINDOWS
3105/* Defined in xfns.c */ 3109/* Defined in xfns.c */
3106extern void syms_of_xfns P_ ((void)); 3110extern void syms_of_xfns P_ ((void));
3107extern Lisp_Object Vx_resource_name; 3111#endif /* HAVE_X_WINDOWS */
3108extern Lisp_Object Vx_resource_class; 3112#ifdef HAVE_WINDOW_SYSTEM
3113/* Defined in xfns.c, w32fns.c, or macfns.c */
3109EXFUN (Fxw_display_color_p, 1); 3114EXFUN (Fxw_display_color_p, 1);
3110EXFUN (Fx_file_dialog, 4); 3115EXFUN (Fx_file_dialog, 4);
3111#endif /* HAVE_X_WINDOWS */ 3116#endif /* HAVE_WINDOW_SYSTEM */
3112 3117
3113/* Defined in xsmfns.c */ 3118/* Defined in xsmfns.c */
3114extern void syms_of_xsmfns P_ ((void)); 3119extern void syms_of_xsmfns P_ ((void));
diff --git a/src/macfns.c b/src/macfns.c
index 02d0cb88d1f..625ca29336c 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2598,7 +2598,7 @@ This function is an internal primitive--use `make-frame' instead. */)
2598 2598
2599 if (!NILP (parent)) 2599 if (!NILP (parent))
2600 { 2600 {
2601 f->output_data.mac->parent_desc = (Window) parent; 2601 f->output_data.mac->parent_desc = (Window) XFASTINT (parent);
2602 f->output_data.mac->explicit_parent = 1; 2602 f->output_data.mac->explicit_parent = 1;
2603 } 2603 }
2604 else 2604 else
diff --git a/src/macmenu.c b/src/macmenu.c
index 06b1b16cf41..de768d4aea5 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1424,7 +1424,8 @@ set_frame_menubar (f, first_time, deep_p)
1424 1424
1425 for (i = 0; i < previous_menu_items_used; i++) 1425 for (i = 0; i < previous_menu_items_used; i++)
1426 if (menu_items_used == i 1426 if (menu_items_used == i
1427 || (!Fequal (previous_items[i], XVECTOR (menu_items)->contents[i]))) 1427 || (NILP (Fequal (previous_items[i],
1428 XVECTOR (menu_items)->contents[i]))))
1428 break; 1429 break;
1429 if (i == menu_items_used && i == previous_menu_items_used && i != 0) 1430 if (i == menu_items_used && i == previous_menu_items_used && i != 0)
1430 { 1431 {
diff --git a/src/macterm.c b/src/macterm.c
index 3999067c76d..9523acce79d 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -7033,8 +7033,8 @@ static int
7033mac_get_emulated_btn ( UInt32 modifiers ) 7033mac_get_emulated_btn ( UInt32 modifiers )
7034{ 7034{
7035 int result = 0; 7035 int result = 0;
7036 if (Vmac_emulate_three_button_mouse != Qnil) { 7036 if (!NILP (Vmac_emulate_three_button_mouse)) {
7037 int cmdIs3 = (Vmac_emulate_three_button_mouse != Qreverse); 7037 int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);
7038 if (modifiers & controlKey) 7038 if (modifiers & controlKey)
7039 result = cmdIs3 ? 2 : 1; 7039 result = cmdIs3 ? 2 : 1;
7040 else if (modifiers & optionKey) 7040 else if (modifiers & optionKey)
@@ -7052,7 +7052,7 @@ mac_event_to_emacs_modifiers (EventRef eventRef)
7052 UInt32 mods = 0; 7052 UInt32 mods = 0;
7053 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, 7053 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,
7054 sizeof (UInt32), NULL, &mods); 7054 sizeof (UInt32), NULL, &mods);
7055 if (Vmac_emulate_three_button_mouse != Qnil && 7055 if (!NILP (Vmac_emulate_three_button_mouse) &&
7056 GetEventClass(eventRef) == kEventClassMouse) 7056 GetEventClass(eventRef) == kEventClassMouse)
7057 { 7057 {
7058 mods &= ~(optionKey & cmdKey); 7058 mods &= ~(optionKey & cmdKey);
@@ -7071,7 +7071,7 @@ mac_get_mouse_btn (EventRef ref)
7071 switch (result) 7071 switch (result)
7072 { 7072 {
7073 case kEventMouseButtonPrimary: 7073 case kEventMouseButtonPrimary:
7074 if (Vmac_emulate_three_button_mouse == Qnil) 7074 if (NILP (Vmac_emulate_three_button_mouse))
7075 return 0; 7075 return 0;
7076 else { 7076 else {
7077 UInt32 mods = 0; 7077 UInt32 mods = 0;
@@ -8227,7 +8227,7 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8227 inev.timestamp = er.when * (1000 / 60); 8227 inev.timestamp = er.when * (1000 / 60);
8228 /* ticks to milliseconds */ 8228 /* ticks to milliseconds */
8229 8229
8230 XSETINT (inev.x, tracked_scroll_bar->left + 2); 8230 XSETINT (inev.x, XFASTINT (tracked_scroll_bar->left) + 2);
8231 XSETINT (inev.y, mouse_loc.v - 24); 8231 XSETINT (inev.y, mouse_loc.v - 24);
8232 tracked_scroll_bar->dragging = Qnil; 8232 tracked_scroll_bar->dragging = Qnil;
8233 mouse_tracking_in_progress = mouse_tracking_none; 8233 mouse_tracking_in_progress = mouse_tracking_none;
@@ -8312,6 +8312,8 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8312 else 8312 else
8313 { 8313 {
8314 Lisp_Object window; 8314 Lisp_Object window;
8315 int x = mouse_loc.h;
8316 int y = mouse_loc.v;
8315 8317
8316 XSETFRAME (inev.frame_or_window, mwp->mFP); 8318 XSETFRAME (inev.frame_or_window, mwp->mFP);
8317 if (er.what == mouseDown) 8319 if (er.what == mouseDown)
@@ -8319,14 +8321,14 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit)
8319 = mouse_tracking_mouse_movement; 8321 = mouse_tracking_mouse_movement;
8320 else 8322 else
8321 mouse_tracking_in_progress = mouse_tracking_none; 8323 mouse_tracking_in_progress = mouse_tracking_none;
8322 window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1); 8324 window = window_from_coordinates (mwp->mFP, x, y, 0, 0, 0, 1);
8323 8325
8324 if (EQ (window, mwp->mFP->tool_bar_window)) 8326 if (EQ (window, mwp->mFP->tool_bar_window))
8325 { 8327 {
8326 if (er.what == mouseDown) 8328 if (er.what == mouseDown)
8327 handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 1, 0); 8329 handle_tool_bar_click (mwp->mFP, x, y, 1, 0);
8328 else 8330 else
8329 handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 0, 8331 handle_tool_bar_click (mwp->mFP, x, y, 0,
8330#if USE_CARBON_EVENTS 8332#if USE_CARBON_EVENTS
8331 mac_event_to_emacs_modifiers (eventRef) 8333 mac_event_to_emacs_modifiers (eventRef)
8332#else 8334#else
@@ -9024,7 +9026,7 @@ mac_check_for_quit_char ()
9024 EVENT_INIT (e); 9026 EVENT_INIT (e);
9025 e.kind = ASCII_KEYSTROKE_EVENT; 9027 e.kind = ASCII_KEYSTROKE_EVENT;
9026 e.code = quit_char; 9028 e.code = quit_char;
9027 e.arg = NULL; 9029 e.arg = Qnil;
9028 e.modifiers = NULL; 9030 e.modifiers = NULL;
9029 e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60); 9031 e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60);
9030 XSETFRAME (e.frame_or_window, mwp->mFP); 9032 XSETFRAME (e.frame_or_window, mwp->mFP);
diff --git a/src/macterm.h b/src/macterm.h
index 868ce88318c..f9bde772fcd 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -565,8 +565,18 @@ struct scroll_bar {
565 text from glomming up against the scroll bar */ 565 text from glomming up against the scroll bar */
566#define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) 566#define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
567 567
568 568struct frame;
569struct frame * check_x_frame (Lisp_Object); 569struct face;
570struct image;
571
572Lisp_Object display_x_get_resource P_ ((struct x_display_info *,
573 Lisp_Object, Lisp_Object,
574 Lisp_Object, Lisp_Object));
575struct frame *check_x_frame P_ ((Lisp_Object));
576EXFUN (Fx_display_color_p, 1);
577EXFUN (Fx_display_grayscale_p, 1);
578EXFUN (Fx_display_planes, 1);
579extern void x_free_gcs P_ ((struct frame *));
570 580
571void activate_scroll_bars (FRAME_PTR); 581void activate_scroll_bars (FRAME_PTR);
572void deactivate_scroll_bars (FRAME_PTR); 582void deactivate_scroll_bars (FRAME_PTR);