emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/macterm.c


From: YAMAMOTO Mitsuharu
Subject: [Emacs-diffs] Changes to emacs/src/macterm.c
Date: Tue, 25 Oct 2005 04:13:17 -0400

Index: emacs/src/macterm.c
diff -c emacs/src/macterm.c:1.140 emacs/src/macterm.c:1.141
*** emacs/src/macterm.c:1.140   Tue Oct 18 08:07:06 2005
--- emacs/src/macterm.c Tue Oct 25 08:13:16 2005
***************
*** 165,170 ****
--- 165,171 ----
  /* Where the mouse was last time we reported a mouse event.  */
  
  static Rect last_mouse_glyph;
+ static FRAME_PTR last_mouse_glyph_frame;
  
  /* The scroll bar in which the last X motion event occurred.
  
***************
*** 716,725 ****
  #ifndef WORDS_BIG_ENDIAN
        {
        int i;
!       Unichar *text = (Unichar *)buf;
  
        for (i = 0; i < nchars; i++)
!         text[i] = buf[2*i] << 8 | buf[2*i+1];
        }
  #endif
        err = atsu_get_text_layout_with_text_ptr ((ConstUniCharArrayPtr)buf,
--- 717,726 ----
  #ifndef WORDS_BIG_ENDIAN
        {
        int i;
!       UniChar *text = (UniChar *)buf;
  
        for (i = 0; i < nchars; i++)
!         text[i] = EndianU16_BtoN (text[i]);
        }
  #endif
        err = atsu_get_text_layout_with_text_ptr ((ConstUniCharArrayPtr)buf,
***************
*** 773,783 ****
                ATSUDrawText (text_layout,
                              kATSUFromTextBeginning, kATSUToTextEnd,
                              Long2Fix (x), Long2Fix (port_height - y));
-             ATSUClearLayoutControls (text_layout,
-                                      sizeof (tags) / sizeof (tags[0]),
-                                      tags);
              CGContextSynchronize (context);
              QDEndCGContext (port, &context);
            }
  #endif
        }
--- 774,791 ----
                ATSUDrawText (text_layout,
                              kATSUFromTextBeginning, kATSUToTextEnd,
                              Long2Fix (x), Long2Fix (port_height - y));
              CGContextSynchronize (context);
              QDEndCGContext (port, &context);
+ #if 0
+             /* This doesn't work on Mac OS X 10.1.  */
+             ATSUClearLayoutControls (text_layout, 
+                                      sizeof (tags) / sizeof (tags[0]),
+                                      tags);
+ #else
+             ATSUSetLayoutControls (text_layout,
+                                    sizeof (tags) / sizeof (tags[0]),
+                                    tags, sizes, values);
+ #endif
            }
  #endif
        }
***************
*** 1666,1673 ****
          if (err == noErr)
            err = ATSUGetGlyphBounds (text_layout, 0, 0,
                                      kATSUFromTextBeginning, kATSUToTextEnd,
!                                     kATSUseFractionalOrigins, 1,
!                                     &glyph_bounds, NULL);
          UNBLOCK_INPUT;
          if (err != noErr)
            pcm = NULL;
--- 1674,1685 ----
          if (err == noErr)
            err = ATSUGetGlyphBounds (text_layout, 0, 0,
                                      kATSUFromTextBeginning, kATSUToTextEnd,
! #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
!                                     kATSUseFractionalOrigins,
! #else
!                                     kATSUseDeviceOrigins,
! #endif
!                                     1, &glyph_bounds, NULL);
          UNBLOCK_INPUT;
          if (err != noErr)
            pcm = NULL;
***************
*** 3910,3922 ****
        return 1;
      }
    /* Has the mouse moved off the glyph it was on at the last sighting?  */
!   if (!PtInRect (*pos, &last_mouse_glyph))
      {
        frame->mouse_moved = 1;
        last_mouse_scroll_bar = Qnil;
        note_mouse_highlight (frame, pos->h, pos->v);
        /* Remember which glyph we're now on.  */
        remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph);
        return 1;
      }
  
--- 3922,3936 ----
        return 1;
      }
    /* Has the mouse moved off the glyph it was on at the last sighting?  */
!   if (frame != last_mouse_glyph_frame
!       || !PtInRect (*pos, &last_mouse_glyph))
      {
        frame->mouse_moved = 1;
        last_mouse_scroll_bar = Qnil;
        note_mouse_highlight (frame, pos->h, pos->v);
        /* Remember which glyph we're now on.  */
        remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph);
+       last_mouse_glyph_frame = frame;
        return 1;
      }
  
***************
*** 4021,4026 ****
--- 4035,4041 ----
          GetMouse (&mouse_pos);
          remember_mouse_glyph (f1, mouse_pos.h, mouse_pos.v,
                                &last_mouse_glyph);
+         last_mouse_glyph_frame = f1;
  
          *bar_window = Qnil;
          *part = 0;
***************
*** 6572,6578 ****
  
    sprintf (xf, "%s-%c-normal--%d-%d-%d-%d-m-%d-%s",
           style & bold ? "bold" : "medium", style & italic ? 'i' : 'r',
!          size, size * 10, size ? 75 : 0, size ? 75 : 0, size * 10, charset);
  
    result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1);
    sprintf (result, "-%s-%s-%s", foundry, family, xf);
--- 6587,6593 ----
  
    sprintf (xf, "%s-%c-normal--%d-%d-%d-%d-m-%d-%s",
           style & bold ? "bold" : "medium", style & italic ? 'i' : 'r',
!          size, size * 10, size ? 72 : 0, size ? 72 : 0, size * 10, charset);
  
    result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1);
    sprintf (result, "-%s-%s-%s", foundry, family, xf);
***************
*** 7061,7067 ****
            continue;
          memcpy (scaled, font_name_table[i], former_len);
          sprintf (scaled + former_len,
!                  "-%d-%d-75-75-m-%d-%s",
                   scl_val[XLFD_SCL_PIXEL_SIZE],
                   scl_val[XLFD_SCL_POINT_SIZE],
                   scl_val[XLFD_SCL_AVGWIDTH],
--- 7076,7082 ----
            continue;
          memcpy (scaled, font_name_table[i], former_len);
          sprintf (scaled + former_len,
!                  "-%d-%d-72-72-m-%d-%s",
                   scl_val[XLFD_SCL_PIXEL_SIZE],
                   scl_val[XLFD_SCL_POINT_SIZE],
                   scl_val[XLFD_SCL_AVGWIDTH],
***************
*** 7409,7416 ****
          if (err == noErr)
            err = ATSUGetGlyphBounds (text_layout, 0, 0,
                                      kATSUFromTextBeginning, kATSUToTextEnd,
!                                     kATSUseFractionalOrigins, 1,
!                                     &glyph_bounds, NULL);
          if (err == noErr)
            {
              xassert (glyph_bounds.lowerRight.x - glyph_bounds.lowerLeft.x
--- 7424,7435 ----
          if (err == noErr)
            err = ATSUGetGlyphBounds (text_layout, 0, 0,
                                      kATSUFromTextBeginning, kATSUToTextEnd,
! #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
!                                     kATSUseFractionalOrigins,
! #else
!                                     kATSUseDeviceOrigins,
! #endif
!                                     1, &glyph_bounds, NULL);
          if (err == noErr)
            {
              xassert (glyph_bounds.lowerRight.x - glyph_bounds.lowerLeft.x
***************
*** 9501,9506 ****
--- 9520,9526 ----
                != eventNotHandledErr)
              break;
  #endif
+           last_mouse_glyph_frame = 0;
  
            if (dpyinfo->grabbed && last_mouse_frame
                && FRAME_LIVE_P (last_mouse_frame))
***************
*** 10230,10237 ****
    main_device_handle = LMGetMainDevice();
  
    dpyinfo->reference_count = 0;
!   dpyinfo->resx = 75.0;
!   dpyinfo->resy = 75.0;
    dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType);
  #ifdef MAC_OSX
    /* HasDepth returns true if it is possible to have a 32 bit display,
--- 10250,10257 ----
    main_device_handle = LMGetMainDevice();
  
    dpyinfo->reference_count = 0;
!   dpyinfo->resx = 72.0;
!   dpyinfo->resy = 72.0;
    dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType);
  #ifdef MAC_OSX
    /* HasDepth returns true if it is possible to have a 32 bit display,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]