/[emacs]/emacs/src/macfns.c
ViewVC logotype

Diff of /emacs/src/macfns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3.2.11 by miles, Sat Sep 4 09:26:25 2004 UTC revision 1.3.2.12 by miles, Sat Sep 4 09:28:15 2004 UTC
# Line 324  x_real_positions (f, xptr, yptr) Line 324  x_real_positions (f, xptr, yptr)
324    Point pt;    Point pt;
325    GrafPtr oldport;    GrafPtr oldport;
326    
327  #ifdef TARGET_API_MAC_CARBON    GetPort (&oldport);
328      SetPortWindowPort (FRAME_MAC_WINDOW (f));
329    
330    #if TARGET_API_MAC_CARBON
331    {    {
332      Rect r;      Rect r;
333    
334      GetWindowPortBounds (f->output_data.mac->mWP, &r);      GetWindowPortBounds (FRAME_MAC_WINDOW (f), &r);
335      SetPt (&pt, r.left, r.top);      SetPt (&pt, r.left, r.top);
336    }    }
337  #else /* not TARGET_API_MAC_CARBON */  #else /* not TARGET_API_MAC_CARBON */
338    SetPt (&pt,    SetPt (&pt,
339           f->output_data.mac->mWP->portRect.left,           FRAME_MAC_WINDOW (f)->portRect.left,
340           f->output_data.mac->mWP->portRect.top);           FRAME_MAC_WINDOW (f)->portRect.top);
341  #endif /* not TARGET_API_MAC_CARBON */  #endif /* not TARGET_API_MAC_CARBON */
   GetPort (&oldport);  
342    LocalToGlobal (&pt);    LocalToGlobal (&pt);
343    SetPort (oldport);    SetPort (oldport);
344    
# Line 1934  x_set_name (f, name, explicit) Line 1936  x_set_name (f, name, explicit)
1936    if (FRAME_MAC_WINDOW (f))    if (FRAME_MAC_WINDOW (f))
1937      {      {
1938        if (STRING_MULTIBYTE (name))        if (STRING_MULTIBYTE (name))
1939  #if 0 /* MAC_TODO: encoding title string */  #if TARGET_API_MAC_CARBON
1940          name = ENCODE_SYSTEM (name);          name = ENCODE_UTF_8 (name);
1941  #else  #else
1942          return;          return;
1943  #endif  #endif
# Line 1943  x_set_name (f, name, explicit) Line 1945  x_set_name (f, name, explicit)
1945        BLOCK_INPUT;        BLOCK_INPUT;
1946    
1947        {        {
1948    #if TARGET_API_MAC_CARBON
1949            CFStringRef windowTitle =
1950              CFStringCreateWithCString (NULL, SDATA (name),
1951                                         kCFStringEncodingUTF8);
1952    
1953            SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle);
1954            CFRelease (windowTitle);
1955    #else
1956          Str255 windowTitle;          Str255 windowTitle;
1957          if (strlen (SDATA (name)) < 255)          if (strlen (SDATA (name)) < 255)
1958            {            {
# Line 1950  x_set_name (f, name, explicit) Line 1960  x_set_name (f, name, explicit)
1960              c2pstr (windowTitle);              c2pstr (windowTitle);
1961              SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);              SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);
1962            }            }
1963    #endif
1964        }        }
1965    
1966        UNBLOCK_INPUT;        UNBLOCK_INPUT;
# Line 2008  x_set_title (f, name, old_name) Line 2019  x_set_title (f, name, old_name)
2019    if (FRAME_MAC_WINDOW (f))    if (FRAME_MAC_WINDOW (f))
2020      {      {
2021        if (STRING_MULTIBYTE (name))        if (STRING_MULTIBYTE (name))
2022  #if 0 /* MAC_TODO: encoding title string */  #if TARGET_API_MAC_CARBON
2023          name = ENCODE_SYSTEM (name);          name = ENCODE_UTF_8 (name);
2024  #else  #else
2025          return;          return;
2026  #endif  #endif
# Line 2017  x_set_title (f, name, old_name) Line 2028  x_set_title (f, name, old_name)
2028        BLOCK_INPUT;        BLOCK_INPUT;
2029    
2030        {        {
2031    #if TARGET_API_MAC_CARBON
2032            CFStringRef windowTitle =
2033              CFStringCreateWithCString (NULL, SDATA (name),
2034                                         kCFStringEncodingUTF8);
2035    
2036            SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle);
2037            CFRelease (windowTitle);
2038    #else
2039          Str255 windowTitle;          Str255 windowTitle;
2040          if (strlen (SDATA (name)) < 255)          if (strlen (SDATA (name)) < 255)
2041            {            {
# Line 2024  x_set_title (f, name, old_name) Line 2043  x_set_title (f, name, old_name)
2043              c2pstr (windowTitle);              c2pstr (windowTitle);
2044              SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);              SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);
2045            }            }
2046    #endif
2047        }        }
2048    
2049        UNBLOCK_INPUT;        UNBLOCK_INPUT;
# Line 2981  If omitted or nil, that stands for the s Line 3001  If omitted or nil, that stands for the s
3001    (display)    (display)
3002       Lisp_Object display;       Lisp_Object display;
3003  {  {
3004    int mac_major_version, mac_minor_version;    int mac_major_version;
3005    SInt32 response;    SInt32 response;
3006    
3007    if (Gestalt (gestaltSystemVersion, &response) != noErr)    if (Gestalt (gestaltSystemVersion, &response) != noErr)
3008      error ("Cannot get Mac OS version");      error ("Cannot get Mac OS version");
3009    
3010    mac_major_version = (response >> 8) & 0xf;    mac_major_version = (response >> 8) & 0xff;
3011    mac_minor_version = (response >> 4) & 0xf;    /* convert BCD to int */
3012      mac_major_version -= (mac_major_version >> 4) * 6;
3013    
3014    return Fcons (make_number (mac_major_version),    return Fcons (make_number (mac_major_version),
3015                  Fcons (make_number (mac_minor_version), Qnil));                  Fcons (make_number ((response >> 4) & 0xf),
3016                           Fcons (make_number (response & 0xf),
3017                                  Qnil)));
3018  }  }
3019    
3020  DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,  DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,

Legend:
Removed from v.1.3.2.11  
changed lines
  Added in v.1.3.2.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26