aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2005-10-25 08:13:44 +0000
committerYAMAMOTO Mitsuharu2005-10-25 08:13:44 +0000
commit05f7d868db12381a1fd077dc39b221f166c90825 (patch)
tree19fd9b951a6a524f572a10c5e971e7eaae056742 /src
parentde297941ce40873d2ea0dc1babc1d37292416520 (diff)
downloademacs-05f7d868db12381a1fd077dc39b221f166c90825.tar.gz
emacs-05f7d868db12381a1fd077dc39b221f166c90825.zip
(last_mouse_glyph_frame): New var.
(note_mouse_movement): Say mouse moved if current frame differs from last_mouse_glyph_frame, and update last_mouse_glyph_frame. (XTmouse_position): Set last_mouse_glyph_frame. (XTread_socket): Clear last_mouse_glyph_frame on mouse up/down event. (mac_draw_string_common) [MAC_OSX && WORDS_BIG_ENDIAN]: Fix typo. Use EndianU16_BtoN. (mac_draw_string_common) [MAC_OSX]: Don't use ATSUClearLayoutControls. (x_per_char_metric, XLoadQueryFont) [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Use device origins to get glyph bounds. (mac_to_x_fontname, mac_do_list_fonts) (mac_initialize_display_info): Change screen resolutions to 72dpi.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog22
-rw-r--r--src/macterm.c48
2 files changed, 56 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cbf49b50302..9bb33016bb4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,25 @@
12005-10-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * image.c [MAC_OS] (image_load_qt_1): Check image size.
4 Use GraphicsImportGetImageDescription instead of
5 GraphicsImportGetNaturalBounds.
6 [MAC_OSX] (image_load_quartz2d): Check image size.
7 [MAC_OS] (xpm_load_image): Likewise.
8
9 * macterm.c (last_mouse_glyph_frame): New var.
10 (note_mouse_movement): Say mouse moved if current frame differs
11 from last_mouse_glyph_frame, and update last_mouse_glyph_frame.
12 (XTmouse_position): Set last_mouse_glyph_frame.
13 (XTread_socket): Clear last_mouse_glyph_frame on mouse up/down event.
14 (mac_draw_string_common) [MAC_OSX && WORDS_BIG_ENDIAN]: Fix typo.
15 Use EndianU16_BtoN.
16 (mac_draw_string_common) [MAC_OSX]: Don't use ATSUClearLayoutControls.
17 (x_per_char_metric, XLoadQueryFont)
18 [MAC_OS_X_VERSION_MAX_ALLOWED < 1020]: Use device origins to get
19 glyph bounds.
20 (mac_to_x_fontname, mac_do_list_fonts)
21 (mac_initialize_display_info): Change screen resolutions to 72dpi.
22
12005-10-25 Masatake YAMATO <jet@gyve.org> 232005-10-25 Masatake YAMATO <jet@gyve.org>
2 24
3 * minibuf.c (Fdisplay_completion_list): Small doc fix. 25 * minibuf.c (Fdisplay_completion_list): Small doc fix.
diff --git a/src/macterm.c b/src/macterm.c
index 4b2b8c998ed..cc5625bd324 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -165,6 +165,7 @@ struct frame *pending_autoraise_frame;
165/* Where the mouse was last time we reported a mouse event. */ 165/* Where the mouse was last time we reported a mouse event. */
166 166
167static Rect last_mouse_glyph; 167static Rect last_mouse_glyph;
168static FRAME_PTR last_mouse_glyph_frame;
168 169
169/* The scroll bar in which the last X motion event occurred. 170/* The scroll bar in which the last X motion event occurred.
170 171
@@ -716,10 +717,10 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, mode, bytes_per_char)
716#ifndef WORDS_BIG_ENDIAN 717#ifndef WORDS_BIG_ENDIAN
717 { 718 {
718 int i; 719 int i;
719 Unichar *text = (Unichar *)buf; 720 UniChar *text = (UniChar *)buf;
720 721
721 for (i = 0; i < nchars; i++) 722 for (i = 0; i < nchars; i++)
722 text[i] = buf[2*i] << 8 | buf[2*i+1]; 723 text[i] = EndianU16_BtoN (text[i]);
723 } 724 }
724#endif 725#endif
725 err = atsu_get_text_layout_with_text_ptr ((ConstUniCharArrayPtr)buf, 726 err = atsu_get_text_layout_with_text_ptr ((ConstUniCharArrayPtr)buf,
@@ -773,11 +774,18 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, mode, bytes_per_char)
773 ATSUDrawText (text_layout, 774 ATSUDrawText (text_layout,
774 kATSUFromTextBeginning, kATSUToTextEnd, 775 kATSUFromTextBeginning, kATSUToTextEnd,
775 Long2Fix (x), Long2Fix (port_height - y)); 776 Long2Fix (x), Long2Fix (port_height - y));
776 ATSUClearLayoutControls (text_layout,
777 sizeof (tags) / sizeof (tags[0]),
778 tags);
779 CGContextSynchronize (context); 777 CGContextSynchronize (context);
780 QDEndCGContext (port, &context); 778 QDEndCGContext (port, &context);
779#if 0
780 /* This doesn't work on Mac OS X 10.1. */
781 ATSUClearLayoutControls (text_layout,
782 sizeof (tags) / sizeof (tags[0]),
783 tags);
784#else
785 ATSUSetLayoutControls (text_layout,
786 sizeof (tags) / sizeof (tags[0]),
787 tags, sizes, values);
788#endif
781 } 789 }
782#endif 790#endif
783 } 791 }
@@ -1666,8 +1674,12 @@ x_per_char_metric (font, char2b)
1666 if (err == noErr) 1674 if (err == noErr)
1667 err = ATSUGetGlyphBounds (text_layout, 0, 0, 1675 err = ATSUGetGlyphBounds (text_layout, 0, 0,
1668 kATSUFromTextBeginning, kATSUToTextEnd, 1676 kATSUFromTextBeginning, kATSUToTextEnd,
1669 kATSUseFractionalOrigins, 1, 1677#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
1670 &glyph_bounds, NULL); 1678 kATSUseFractionalOrigins,
1679#else
1680 kATSUseDeviceOrigins,
1681#endif
1682 1, &glyph_bounds, NULL);
1671 UNBLOCK_INPUT; 1683 UNBLOCK_INPUT;
1672 if (err != noErr) 1684 if (err != noErr)
1673 pcm = NULL; 1685 pcm = NULL;
@@ -3910,13 +3922,15 @@ note_mouse_movement (frame, pos)
3910 return 1; 3922 return 1;
3911 } 3923 }
3912 /* Has the mouse moved off the glyph it was on at the last sighting? */ 3924 /* Has the mouse moved off the glyph it was on at the last sighting? */
3913 if (!PtInRect (*pos, &last_mouse_glyph)) 3925 if (frame != last_mouse_glyph_frame
3926 || !PtInRect (*pos, &last_mouse_glyph))
3914 { 3927 {
3915 frame->mouse_moved = 1; 3928 frame->mouse_moved = 1;
3916 last_mouse_scroll_bar = Qnil; 3929 last_mouse_scroll_bar = Qnil;
3917 note_mouse_highlight (frame, pos->h, pos->v); 3930 note_mouse_highlight (frame, pos->h, pos->v);
3918 /* Remember which glyph we're now on. */ 3931 /* Remember which glyph we're now on. */
3919 remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph); 3932 remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph);
3933 last_mouse_glyph_frame = frame;
3920 return 1; 3934 return 1;
3921 } 3935 }
3922 3936
@@ -4021,6 +4035,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
4021 GetMouse (&mouse_pos); 4035 GetMouse (&mouse_pos);
4022 remember_mouse_glyph (f1, mouse_pos.h, mouse_pos.v, 4036 remember_mouse_glyph (f1, mouse_pos.h, mouse_pos.v,
4023 &last_mouse_glyph); 4037 &last_mouse_glyph);
4038 last_mouse_glyph_frame = f1;
4024 4039
4025 *bar_window = Qnil; 4040 *bar_window = Qnil;
4026 *part = 0; 4041 *part = 0;
@@ -6572,7 +6587,7 @@ mac_to_x_fontname (name, size, style, charset)
6572 6587
6573 sprintf (xf, "%s-%c-normal--%d-%d-%d-%d-m-%d-%s", 6588 sprintf (xf, "%s-%c-normal--%d-%d-%d-%d-m-%d-%s",
6574 style & bold ? "bold" : "medium", style & italic ? 'i' : 'r', 6589 style & bold ? "bold" : "medium", style & italic ? 'i' : 'r',
6575 size, size * 10, size ? 75 : 0, size ? 75 : 0, size * 10, charset); 6590 size, size * 10, size ? 72 : 0, size ? 72 : 0, size * 10, charset);
6576 6591
6577 result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1); 6592 result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1);
6578 sprintf (result, "-%s-%s-%s", foundry, family, xf); 6593 sprintf (result, "-%s-%s-%s", foundry, family, xf);
@@ -7061,7 +7076,7 @@ mac_do_list_fonts (pattern, maxnames)
7061 continue; 7076 continue;
7062 memcpy (scaled, font_name_table[i], former_len); 7077 memcpy (scaled, font_name_table[i], former_len);
7063 sprintf (scaled + former_len, 7078 sprintf (scaled + former_len,
7064 "-%d-%d-75-75-m-%d-%s", 7079 "-%d-%d-72-72-m-%d-%s",
7065 scl_val[XLFD_SCL_PIXEL_SIZE], 7080 scl_val[XLFD_SCL_PIXEL_SIZE],
7066 scl_val[XLFD_SCL_POINT_SIZE], 7081 scl_val[XLFD_SCL_POINT_SIZE],
7067 scl_val[XLFD_SCL_AVGWIDTH], 7082 scl_val[XLFD_SCL_AVGWIDTH],
@@ -7409,8 +7424,12 @@ XLoadQueryFont (Display *dpy, char *fontname)
7409 if (err == noErr) 7424 if (err == noErr)
7410 err = ATSUGetGlyphBounds (text_layout, 0, 0, 7425 err = ATSUGetGlyphBounds (text_layout, 0, 0,
7411 kATSUFromTextBeginning, kATSUToTextEnd, 7426 kATSUFromTextBeginning, kATSUToTextEnd,
7412 kATSUseFractionalOrigins, 1, 7427#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
7413 &glyph_bounds, NULL); 7428 kATSUseFractionalOrigins,
7429#else
7430 kATSUseDeviceOrigins,
7431#endif
7432 1, &glyph_bounds, NULL);
7414 if (err == noErr) 7433 if (err == noErr)
7415 { 7434 {
7416 xassert (glyph_bounds.lowerRight.x - glyph_bounds.lowerLeft.x 7435 xassert (glyph_bounds.lowerRight.x - glyph_bounds.lowerLeft.x
@@ -9501,6 +9520,7 @@ XTread_socket (sd, expected, hold_quit)
9501 != eventNotHandledErr) 9520 != eventNotHandledErr)
9502 break; 9521 break;
9503#endif 9522#endif
9523 last_mouse_glyph_frame = 0;
9504 9524
9505 if (dpyinfo->grabbed && last_mouse_frame 9525 if (dpyinfo->grabbed && last_mouse_frame
9506 && FRAME_LIVE_P (last_mouse_frame)) 9526 && FRAME_LIVE_P (last_mouse_frame))
@@ -10230,8 +10250,8 @@ mac_initialize_display_info ()
10230 main_device_handle = LMGetMainDevice(); 10250 main_device_handle = LMGetMainDevice();
10231 10251
10232 dpyinfo->reference_count = 0; 10252 dpyinfo->reference_count = 0;
10233 dpyinfo->resx = 75.0; 10253 dpyinfo->resx = 72.0;
10234 dpyinfo->resy = 75.0; 10254 dpyinfo->resy = 72.0;
10235 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); 10255 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType);
10236#ifdef MAC_OSX 10256#ifdef MAC_OSX
10237 /* HasDepth returns true if it is possible to have a 32 bit display, 10257 /* HasDepth returns true if it is possible to have a 32 bit display,