char *color;
unsigned long colorval;
int i, pos;
- pos = 0;
+ pos = 16;
colorval = 0;
color = colorname + 4;
if (value == ULONG_MAX)
break;
colorval |= (value << pos);
- pos += 0x8;
+ pos -= 0x8;
if (i == 2)
{
if (*end != '\0')
char *color;
unsigned long colorval;
int i, pos;
- pos = 0;
+ pos = 16;
colorval = 0;
color = colorname + 5;
if (val == 0x100)
val = 0xFF;
colorval |= (val << pos);
- pos += 0x8;
+ pos -= 0x8;
if (i == 2)
{
if (*end != '\0')
if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt))
return;
}
- else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil))
+ else if (!NILP (arg) || NILP (oldval))
return;
f->icon_name = arg;
x_set_scroll_bar_width (f, arg, oldval);
}
+static void
+mac_set_font (f, arg, oldval)
+ struct frame *f;
+ Lisp_Object arg, oldval;
+{
+ x_set_font (f, arg, oldval);
+#if USE_MAC_FONT_PANEL
+ {
+ Lisp_Object focus_frame = x_get_focus_frame (f);
+
+ if ((NILP (focus_frame) && f == SELECTED_FRAME ())
+ || XFRAME (focus_frame) == f)
+ {
+ BLOCK_INPUT;
+ mac_set_font_info_for_selection (f, DEFAULT_FACE_ID, 0);
+ UNBLOCK_INPUT;
+ }
+ }
+#endif
+}
+
#if TARGET_API_MAC_CARBON
static void
mac_update_proxy_icon (f)
#endif
}
-static void
-mac_set_font (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
-{
- x_set_font (f, arg, oldval);
-#if USE_MAC_FONT_PANEL
- if (FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame == f)
- {
- BLOCK_INPUT;
- mac_set_font_info_for_selection (f);
- UNBLOCK_INPUT;
- }
-#endif
-}
-
\f
/* Subroutines of creating a frame. */
error ("Cannot find any usable font");
UNBLOCK_INPUT;
- x_default_parameter (f, parms, Qfont, font,
- "font", "Font", RES_TYPE_STRING);
+ x_set_frame_parameters (f, Fcons (Fcons (Qfont, font), Qnil));
}
x_default_parameter (f, parms, Qborder_width, make_number (0),
Lisp_Object frame;
{
struct frame *f = check_x_frame (frame);
- struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
- if (dpyinfo->x_focus_frame != f)
- {
- BLOCK_INPUT;
+ BLOCK_INPUT;
#ifdef MAC_OSX
- ActivateWindow (ActiveNonFloatingWindow (), false);
- ActivateWindow (FRAME_MAC_WINDOW (f), true);
+ ActivateWindow (ActiveNonFloatingWindow (), false);
+ ActivateWindow (FRAME_MAC_WINDOW (f), true);
#else
#if !TARGET_API_MAC_CARBON
- /* SelectWindow (Non-Carbon) does not issue deactivate events if
- the possibly inactive window that is to be selected is
- already the frontmost one. */
- SendBehind (FRAME_MAC_WINDOW (f), NULL);
+ /* SelectWindow (Non-Carbon) does not issue deactivate events if the
+ possibly inactive window that is to be selected is already the
+ frontmost one. */
+ SendBehind (FRAME_MAC_WINDOW (f), NULL);
#endif
- /* This brings the window to the front. */
- SelectWindow (FRAME_MAC_WINDOW (f));
+ /* This brings the window to the front. */
+ SelectWindow (FRAME_MAC_WINDOW (f));
#endif
- UNBLOCK_INPUT;
- }
+ UNBLOCK_INPUT;
return Qnil;
}
{
if (response >= 0x00001040)
{
- err = Gestalt ('sys1', &major); /* gestaltSystemVersionMajor */
+ err = Gestalt (gestaltSystemVersionMajor, &major);
if (err == noErr)
- err = Gestalt ('sys2', &minor); /* gestaltSystemVersionMinor */
+ err = Gestalt (gestaltSystemVersionMinor, &minor);
if (err == noErr)
- err = Gestalt ('sys3', &bugfix); /* gestaltSystemVersionBugFix */
+ err = Gestalt (gestaltSystemVersionBugFix, &bugfix);
}
else
{
(display)
Lisp_Object display;
{
- /* MAC_TODO: this is an approximation, and only of the main display */
-
struct mac_display_info *dpyinfo = check_x_display_info (display);
+ /* Only of the main display. */
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+ CGSize size;
+
+ BLOCK_INPUT;
+ size = CGDisplayScreenSize (kCGDirectMainDisplay);
+ UNBLOCK_INPUT;
+ return make_number ((int) (size.height + .5f));
+#else
+ /* This is an approximation. */
return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy));
+#endif
}
DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
(display)
Lisp_Object display;
{
- /* MAC_TODO: this is an approximation, and only of the main display */
-
struct mac_display_info *dpyinfo = check_x_display_info (display);
+ /* Only of the main display. */
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+ CGSize size;
+ BLOCK_INPUT;
+ size = CGDisplayScreenSize (kCGDirectMainDisplay);
+ UNBLOCK_INPUT;
+
+ return make_number ((int) (size.width + .5f));
+#else
+ /* This is an approximation. */
return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx));
+#endif
}
DEFUN ("x-display-backing-store", Fx_display_backing_store,
#if USE_MAC_FONT_PANEL
DEFUN ("mac-set-font-panel-visibility", Fmac_set_font_panel_visibility,
Smac_set_font_panel_visibility, 1, 1, 0,
- doc: /* Set the font panel visibile if and only if VISIBLE is non-nil.
+ doc: /* Make the font panel visible if and only if VISIBLE is non-nil.
This is for internal use only. Use `mac-font-panel-mode' instead. */)
(visible)
Lisp_Object visible;
check_mac ();
BLOCK_INPUT;
- if (NILP (visible) == (FPIsFontPanelVisible () == true))
- err = FPShowHideFontPanel ();
+ if (NILP (visible) != !mac_font_panel_visible_p ())
+ {
+ err = mac_show_hide_font_panel ();
+ if (err == noErr && !NILP (visible))
+ {
+ Lisp_Object focus_frame = x_get_focus_frame (SELECTED_FRAME ());
+ struct frame *f = (NILP (focus_frame) ? SELECTED_FRAME ()
+ : XFRAME (focus_frame));
+
+ mac_set_font_info_for_selection (f, DEFAULT_FACE_ID, 0);
+ }
+ }
UNBLOCK_INPUT;
if (err != noErr)