/* Graphical user interface functions for Mac OS.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Emacs.
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */
+/* Contributed by Andrew Choi (akochoi@mac.com). */
#include <config.h>
#include <stdlib.h>
#include <string.h>
+#ifndef MAC_OSX
#include <alloca.h>
-#if 0
-#include <unistd.h>
#endif
+#ifdef MAC_OSX
+#undef mktime
+#undef DEBUG
+#undef Z
+#undef free
+#undef malloc
+#undef realloc
+/* Macros max and min defined in lisp.h conflict with those in
+ precompiled header Carbon.h. */
+#undef max
+#undef min
+#include <Carbon/Carbon.h>
+#undef Z
+#define Z (current_buffer->text->z)
+#undef free
+#define free unexec_free
+#undef malloc
+#define malloc unexec_malloc
+#undef realloc
+#define realloc unexec_realloc
+#undef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#undef max
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#else /* not MAC_OSX */
#include <Windows.h>
#include <Gestalt.h>
#include <TextUtils.h>
-
-#ifndef min
-#define min(a,b) ((a) < (b) ? (a) : (b))
-#endif
-#ifndef max
-#define max(a,b) ((a) > (b) ? (a) : (b))
-#endif
+#endif /* not MAC_OSX */
/*extern void free_frame_menubar ();
-extern void x_compute_fringe_widths (struct frame *, int);
extern double atof ();
extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state);
extern int quit_char;*/
Lisp_Object Qface_set_after_frame_default;
+extern int mac_initialized;
+
/* Functions in macterm.c. */
extern void x_set_offset (struct frame *, int, int, int);
extern void x_wm_set_icon_position (struct frame *, int, int);
extern void x_display_cursor (struct window *, int, int, int, int, int);
extern void x_set_window_size (struct frame *, int, int, int);
extern void x_make_frame_visible (struct frame *);
-extern struct mac_display_info *x_term_init (Lisp_Object, char *, char *);
+extern struct mac_display_info *mac_term_init (Lisp_Object, char *, char *);
extern struct font_info *x_get_font_info (FRAME_PTR, int);
extern struct font_info *x_load_font (struct frame *, char *, int);
extern void x_find_ccl_program (struct font_info *);
extern struct font_info *x_query_font (struct frame *, char *);
-
+extern void mac_initialize ();
/* compare two strings ignoring case */
if (NILP (frame))
frame = selected_frame;
- CHECK_LIVE_FRAME (frame, 0);
+ CHECK_LIVE_FRAME (frame);
f = XFRAME (frame);
if (! FRAME_MAC_P (f))
error ("non-mac frame used");
check_x_display_info (frame)
Lisp_Object frame;
{
+ if (!mac_initialized)
+ {
+ mac_initialize ();
+ mac_initialized = 1;
+ }
+
if (NILP (frame))
{
struct frame *sf = XFRAME (selected_frame);
{
FRAME_PTR f;
- CHECK_LIVE_FRAME (frame, 0);
+ CHECK_LIVE_FRAME (frame);
f = XFRAME (frame);
if (! FRAME_MAC_P (f))
error ("non-mac frame used");
f = XFRAME (frame);
if (!FRAME_W32_P (f) || FRAME_MAC_DISPLAY_INFO (f) != dpyinfo)
continue;
- /*if (f->output_data.w32->busy_window == wdesc)
+ /*if (f->output_data.w32->hourglass_window == wdesc)
return f;*/
/* MAC_TODO: Check tooltips when supported. */
}
/* Search bitmap-file-path for the file, if appropriate. */
- fd = openp (Vx_bitmap_file_path, file, Qnil, &found, 0);
+ fd = openp (Vx_bitmap_file_path, file, "", &found, 0);
if (fd < 0)
return -1;
/* LoadLibraryEx won't handle special files handled by Emacs handler. */
void x_set_icon_type P_ ((struct frame *, Lisp_Object, Lisp_Object));
void x_set_icon_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
void x_set_font P_ ((struct frame *, Lisp_Object, Lisp_Object));
-static void x_set_fringe_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
void x_set_border_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
void x_set_internal_border_width P_ ((struct frame *, Lisp_Object,
Lisp_Object));
"scroll-bar-background", x_set_scroll_bar_background,
#endif
"screen-gamma", x_set_screen_gamma,
- "line-spacing", x_set_line_spacing,
- "left-fringe", x_set_fringe_width,
- "right-fringe", x_set_fringe_width
+ "line-spacing", x_set_line_spacing
};
/* Attach the `x-frame-parameter' properties to
/* Process foreground_color and background_color before anything else.
They are independent of other properties, but other properties (e.g.,
cursor_color) are dependent upon them. */
- /* Process default font as well, since fringe widths depends on it. */
for (p = 0; p < i; p++)
{
Lisp_Object prop, val;
prop = parms[p];
val = values[p];
- if (EQ (prop, Qforeground_color)
- || EQ (prop, Qbackground_color)
- || EQ (prop, Qfont))
+ if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color))
{
register Lisp_Object param_index, old_value;
icon_top = val;
else if (EQ (prop, Qicon_left))
icon_left = val;
- else if (EQ (prop, Qforeground_color)
- || EQ (prop, Qbackground_color)
- || EQ (prop, Qfont))
+ else if (EQ (prop, Qforeground_color) || EQ (prop, Qbackground_color))
/* Processed above. */
continue;
else
Point pt;
GrafPtr oldport;
+#ifdef TARGET_API_MAC_CARBON
+ {
+ Rect r;
+
+ GetWindowPortBounds (f->output_data.mac->mWP, &r);
+ SetPt (&pt, r.left, r.top);
+ }
+#else /* not TARGET_API_MAC_CARBON */
SetPt (&pt,
f->output_data.mac->mWP->portRect.left,
f->output_data.mac->mWP->portRect.top);
+#endif /* not TARGET_API_MAC_CARBON */
GetPort (&oldport);
LocalToGlobal (&pt);
SetPort (oldport);
make_number (f->output_data.mac->border_width));
store_in_alist (alistptr, Qinternal_border_width,
make_number (f->output_data.mac->internal_border_width));
- store_in_alist (alistptr, Qleft_fringe,
- make_number (f->output_data.mac->left_fringe_width));
- store_in_alist (alistptr, Qright_fringe,
- make_number (f->output_data.mac->right_fringe_width));
- store_in_alist (alistptr, Qscroll_bar_width,
- make_number (FRAME_HAS_VERTICAL_SCROLL_BARS (f)
- ? FRAME_SCROLL_BAR_PIXEL_WIDTH(f)
- : 0));
sprintf (buf, "%ld", (long) FRAME_MAC_WINDOW (f));
store_in_alist (alistptr, Qwindow_id,
build_string (buf));
{
XColor cdef;
- CHECK_STRING (arg, 0);
+ CHECK_STRING (arg);
if (strcmp (XSTRING (arg)->data, "black") == 0)
return BLACK_PIX_DEFAULT (f);
if (!EQ (Qnil, Vx_pointer_shape))
{
- CHECK_NUMBER (Vx_pointer_shape, 0);
+ CHECK_NUMBER (Vx_pointer_shape);
cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XINT (Vx_pointer_shape));
}
else
if (!EQ (Qnil, Vx_nontext_pointer_shape))
{
- CHECK_NUMBER (Vx_nontext_pointer_shape, 0);
+ CHECK_NUMBER (Vx_nontext_pointer_shape);
nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
XINT (Vx_nontext_pointer_shape));
}
if (!EQ (Qnil, Vx_hourglass_pointer_shape))
{
- CHECK_NUMBER (Vx_hourglass_pointer_shape, 0);
+ CHECK_NUMBER (Vx_hourglass_pointer_shape);
hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
XINT (Vx_hourglass_pointer_shape));
}
x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
if (!EQ (Qnil, Vx_mode_pointer_shape))
{
- CHECK_NUMBER (Vx_mode_pointer_shape, 0);
+ CHECK_NUMBER (Vx_mode_pointer_shape);
mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
XINT (Vx_mode_pointer_shape));
}
if (!EQ (Qnil, Vx_sensitive_text_pointer_shape))
{
- CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0);
+ CHECK_NUMBER (Vx_sensitive_text_pointer_shape);
cross_cursor
= XCreateFontCursor (FRAME_W32_DISPLAY (f),
XINT (Vx_sensitive_text_pointer_shape));
if (!NILP (Vx_window_horizontal_drag_shape))
{
- CHECK_NUMBER (Vx_window_horizontal_drag_shape, 0);
+ CHECK_NUMBER (Vx_window_horizontal_drag_shape);
horizontal_drag_cursor
- = XCreateFontCursor (FRAME_X_DISPLAY (f),
+ = XCreateFontCursor (FRAME_W32_DISPLAY (f),
XINT (Vx_window_horizontal_drag_shape));
}
else
horizontal_drag_cursor
- = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_sb_h_double_arrow);
+ = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_sb_h_double_arrow);
/* Check and report errors with the above calls. */
x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s");
{
int pix;
- CHECK_STRING (arg, 0);
+ CHECK_STRING (arg);
pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
x_set_border_pixel (f, pix);
update_face_from_frame_parameter (f, Qborder_color, arg);
UNBLOCK_INPUT;
}
-#endif
+#endif /* MAC_TODO */
/* Return non-nil if frame F wants a bitmap icon. */
f->icon_name = arg;
-#if 0
+#if 0 /* MAC_TODO */
if (f->output_data.w32->icon_bitmap != 0)
return;
XFlush (FRAME_W32_DISPLAY (f));
UNBLOCK_INPUT;
-#endif
+#endif /* MAC_TODO */
}
extern Lisp_Object x_new_font ();
Lisp_Object result;
Lisp_Object fontset_name;
Lisp_Object frame;
+ int old_fontset = FRAME_FONTSET(f);
- CHECK_STRING (arg, 1);
+ CHECK_STRING (arg);
fontset_name = Fquery_fontset (arg, Qnil);
error ("The characters of the given font have varying widths");
else if (STRINGP (result))
{
- if (!NILP (Fequal (result, oldval)))
- return;
+ if (STRINGP (fontset_name))
+ {
+ /* Fontset names are built from ASCII font names, so the
+ names may be equal despite there was a change. */
+ if (old_fontset == FRAME_FONTSET (f))
+ return;
+ }
+ else if (!NILP (Fequal (result, oldval)))
+ return;
+
store_frame_param (f, Qfont, result);
recompute_basic_faces (f);
}
}
}
-static void
-x_set_fringe_width (f, new_value, old_value)
- struct frame *f;
- Lisp_Object new_value, old_value;
-{
- x_compute_fringe_widths (f, 1);
-}
-
void
x_set_border_width (f, arg, oldval)
struct frame *f;
Lisp_Object arg, oldval;
{
- CHECK_NUMBER (arg, 0);
+ CHECK_NUMBER (arg);
if (XINT (arg) == f->output_data.mac->border_width)
return;
-#if 0
+#if 0 /* MAC_TODO */
if (FRAME_MAC_WINDOW (f) != 0)
error ("Cannot change the border width of a window");
#endif
{
int old = f->output_data.mac->internal_border_width;
- CHECK_NUMBER (arg, 0);
+ CHECK_NUMBER (arg);
f->output_data.mac->internal_border_width = XINT (arg);
if (f->output_data.mac->internal_border_width < 0)
f->output_data.mac->internal_border_width = 0;
SET_FRAME_GARBAGED (f);
do_pending_window_change (0);
}
+ else
+ SET_FRAME_GARBAGED (f);
}
void
adjust_glyphs (f);
}
+
/* Set the number of lines used for the tool bar of frame F to VALUE.
VALUE not an integer, or < 0 means set the lines to zero. OLDVAL
is the old number of tool bar lines. This function changes the
XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
0, y, width, height, 0);
UNBLOCK_INPUT;
+
+ if (WINDOWP (f->tool_bar_window))
+ clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
}
}
name = build_string (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name);
}
else
- CHECK_STRING (name, 0);
+ CHECK_STRING (name);
/* Don't change the name if it's already NAME. */
if (! NILP (Fstring_equal (name, f->name)))
if (NILP (arg))
{
+#ifdef MAC_OSX
+ FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 16; /* Aqua scroll bars. */
+ FRAME_SCROLL_BAR_COLS (f) = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) +
+ wid - 1) / wid;
+#else /* not MAC_OSX */
/* Make the actual width at least 14 pixels and a multiple of a
character width. */
FRAME_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
/* Use all of that space (aside from required margins) for the
scroll bar. */
FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0;
-
+#endif /* not MAC_OSX */
if (FRAME_MAC_WINDOW (f))
x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
do_pending_window_change (0);
extern char *x_get_string_resource ();
DEFUN ("x-get-resource", Fx_get_resource, Sx_get_resource, 2, 4, 0,
- "Return the value of ATTRIBUTE, of class CLASS, from the X defaults database.\n\
-This uses `INSTANCE.ATTRIBUTE' as the key and `Emacs.CLASS' as the\n\
-class, where INSTANCE is the name under which Emacs was invoked, or\n\
-the name specified by the `-name' or `-rn' command-line arguments.\n\
-\n\
-The optional arguments COMPONENT and SUBCLASS add to the key and the\n\
-class, respectively. You must specify both of them or neither.\n\
-If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE'\n\
-and the class is `Emacs.CLASS.SUBCLASS'.")
+ doc: /* Return the value of ATTRIBUTE, of class CLASS, from the X defaults database.
+This uses `INSTANCE.ATTRIBUTE' as the key and `Emacs.CLASS' as the
+class, where INSTANCE is the name under which Emacs was invoked, or
+the name specified by the `-name' or `-rn' command-line arguments.
+
+The optional arguments COMPONENT and SUBCLASS add to the key and the
+class, respectively. You must specify both of them or neither.
+If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE'
+and the class is `Emacs.CLASS.SUBCLASS'. */)
(attribute, class, component, subclass)
Lisp_Object attribute, class, component, subclass;
{
char *name_key;
char *class_key;
- CHECK_STRING (attribute, 0);
- CHECK_STRING (class, 0);
+ CHECK_STRING (attribute);
+ CHECK_STRING (class);
if (!NILP (component))
- CHECK_STRING (component, 1);
+ CHECK_STRING (component);
if (!NILP (subclass))
- CHECK_STRING (subclass, 2);
+ CHECK_STRING (subclass);
if (NILP (component) != NILP (subclass))
error ("x-get-resource: must specify both COMPONENT and SUBCLASS or neither");
return x_get_string_resource (sf, name_key, class_key);
}
-#endif
+#endif /* MAC_TODO */
/* Types we might convert a resource string into. */
enum resource_types
}
}
else
-#endif
+#endif /* MAC_TODO */
return Qunbound;
}
return Fcdr (tem);
return tem;
}
\f
+/* XParseGeometry copied from w32xfns.c */
+
+/*
+ * XParseGeometry parses strings of the form
+ * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
+ * width, height, xoffset, and yoffset are unsigned integers.
+ * Example: "=80x24+300-49"
+ * The equal sign is optional.
+ * It returns a bitmask that indicates which of the four values
+ * were actually found in the string. For each value found,
+ * the corresponding argument is updated; for each value
+ * not found, the corresponding argument is left unchanged.
+ */
+
+static int
+read_integer (string, NextString)
+ register char *string;
+ char **NextString;
+{
+ register int Result = 0;
+ int Sign = 1;
+
+ if (*string == '+')
+ string++;
+ else if (*string == '-')
+ {
+ string++;
+ Sign = -1;
+ }
+ for (; (*string >= '0') && (*string <= '9'); string++)
+ {
+ Result = (Result * 10) + (*string - '0');
+ }
+ *NextString = string;
+ if (Sign >= 0)
+ return (Result);
+ else
+ return (-Result);
+}
+
+int
+XParseGeometry (string, x, y, width, height)
+ char *string;
+ int *x, *y;
+ unsigned int *width, *height; /* RETURN */
+{
+ int mask = NoValue;
+ register char *strind;
+ unsigned int tempWidth, tempHeight;
+ int tempX, tempY;
+ char *nextCharacter;
+
+ if ((string == NULL) || (*string == '\0')) return (mask);
+ if (*string == '=')
+ string++; /* ignore possible '=' at beg of geometry spec */
+
+ strind = (char *)string;
+ if (*strind != '+' && *strind != '-' && *strind != 'x')
+ {
+ tempWidth = read_integer (strind, &nextCharacter);
+ if (strind == nextCharacter)
+ return (0);
+ strind = nextCharacter;
+ mask |= WidthValue;
+ }
+
+ if (*strind == 'x' || *strind == 'X')
+ {
+ strind++;
+ tempHeight = read_integer (strind, &nextCharacter);
+ if (strind == nextCharacter)
+ return (0);
+ strind = nextCharacter;
+ mask |= HeightValue;
+ }
+
+ if ((*strind == '+') || (*strind == '-'))
+ {
+ if (*strind == '-')
+ {
+ strind++;
+ tempX = -read_integer (strind, &nextCharacter);
+ if (strind == nextCharacter)
+ return (0);
+ strind = nextCharacter;
+ mask |= XNegative;
+
+ }
+ else
+ {
+ strind++;
+ tempX = read_integer (strind, &nextCharacter);
+ if (strind == nextCharacter)
+ return (0);
+ strind = nextCharacter;
+ }
+ mask |= XValue;
+ if ((*strind == '+') || (*strind == '-'))
+ {
+ if (*strind == '-')
+ {
+ strind++;
+ tempY = -read_integer (strind, &nextCharacter);
+ if (strind == nextCharacter)
+ return (0);
+ strind = nextCharacter;
+ mask |= YNegative;
+
+ }
+ else
+ {
+ strind++;
+ tempY = read_integer (strind, &nextCharacter);
+ if (strind == nextCharacter)
+ return (0);
+ strind = nextCharacter;
+ }
+ mask |= YValue;
+ }
+ }
+
+ /* If strind isn't at the end of the string the it's an invalid
+ geometry specification. */
+
+ if (*strind != '\0') return (0);
+
+ if (mask & XValue)
+ *x = tempX;
+ if (mask & YValue)
+ *y = tempY;
+ if (mask & WidthValue)
+ *width = tempWidth;
+ if (mask & HeightValue)
+ *height = tempHeight;
+ return (mask);
+}
+
DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0,
- "Parse an X-style geometry string STRING.\n\
-Returns an alist of the form ((top . TOP), (left . LEFT) ... ).\n\
-The properties returned may include `top', `left', `height', and `width'.\n\
-The value of `left' or `top' may be an integer,\n\
-or a list (+ N) meaning N pixels relative to top/left corner,\n\
-or a list (- N) meaning -N pixels relative to bottom/right corner.")
+ doc: /* Parse an X-style geometry string STRING.
+Returns an alist of the form ((top . TOP), (left . LEFT) ... ).
+The properties returned may include `top', `left', `height', and `width'.
+The value of `left' or `top' may be an integer,
+or a list (+ N) meaning N pixels relative to top/left corner,
+or a list (- N) meaning -N pixels relative to bottom/right corner. */)
(string)
Lisp_Object string;
{
unsigned int width, height;
Lisp_Object result;
- CHECK_STRING (string, 0);
+ CHECK_STRING (string);
geometry = XParseGeometry ((char *) XSTRING (string)->data,
&x, &y, &width, &height);
{
if (!EQ (tem0, Qunbound))
{
- CHECK_NUMBER (tem0, 0);
+ CHECK_NUMBER (tem0);
f->height = XINT (tem0);
}
if (!EQ (tem1, Qunbound))
{
- CHECK_NUMBER (tem1, 0);
+ CHECK_NUMBER (tem1);
SET_FRAME_WIDTH (f, XINT (tem1));
}
if (!NILP (tem2) && !EQ (tem2, Qunbound))
: FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
: (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.mac->font)));
+
x_compute_fringe_widths (f, 0);
+
f->output_data.mac->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
f->output_data.mac->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
f->output_data.mac->top_pos = 0;
else
{
- CHECK_NUMBER (tem0, 0);
+ CHECK_NUMBER (tem0);
f->output_data.mac->top_pos = XINT (tem0);
if (f->output_data.mac->top_pos < 0)
window_prompting |= YNegative;
f->output_data.mac->left_pos = 0;
else
{
- CHECK_NUMBER (tem1, 0);
+ CHECK_NUMBER (tem1);
f->output_data.mac->left_pos = XINT (tem1);
if (f->output_data.mac->left_pos < 0)
window_prompting |= XNegative;
}
\f
-#if 0
+#if 0 /* MAC_TODO */
/* Create and set up the Mac window for frame F. */
static void
if (FRAME_MAC_WINDOW (f) == 0)
error ("Unable to create window");
}
-#endif
+#endif /* MAC_TODO */
/* Handle the icon stuff for this window. Perhaps later we might
want an x_set_icon_position which can be called interactively as
icon_y = mac_get_arg (parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
{
- CHECK_NUMBER (icon_x, 0);
- CHECK_NUMBER (icon_y, 0);
+ CHECK_NUMBER (icon_x);
+ CHECK_NUMBER (icon_y);
}
else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
error ("Both left and top icon corners of icon must be specified");
}
-static void
+void
x_make_gc (f)
struct frame *f;
{
/* Normal video */
gc_values.font = f->output_data.mac->font;
- gc_values.foreground = f->output_data.mac->foreground_pixel;
- gc_values.background = f->output_data.mac->background_pixel;
+ gc_values.foreground = FRAME_FOREGROUND_PIXEL (f);
+ gc_values.background = FRAME_BACKGROUND_PIXEL (f);
f->output_data.mac->normal_gc = XCreateGC (FRAME_MAC_DISPLAY (f),
FRAME_MAC_WINDOW (f),
GCFont | GCForeground | GCBackground,
&gc_values);
/* Reverse video style. */
- gc_values.foreground = f->output_data.mac->background_pixel;
- gc_values.background = f->output_data.mac->foreground_pixel;
+ gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
+ gc_values.background = FRAME_FOREGROUND_PIXEL (f);
f->output_data.mac->reverse_gc = XCreateGC (FRAME_MAC_DISPLAY (f),
FRAME_MAC_WINDOW (f),
GCFont | GCForeground | GCBackground,
&gc_values);
/* Cursor has cursor-color background, background-color foreground. */
- gc_values.foreground = f->output_data.mac->background_pixel;
+ gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
gc_values.background = f->output_data.mac->cursor_pixel;
f->output_data.mac->cursor_gc = XCreateGC (FRAME_MAC_DISPLAY (f),
FRAME_MAC_WINDOW (f),
DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1, 1, 0,
- "Make a new window, which is called a \"frame\" in Emacs terms.\n\
-Returns an Emacs frame object.\n\
-ALIST is an alist of frame parameters.\n\
-If the parameters specify that the frame should not have a minibuffer,\n\
-and do not specify a specific minibuffer window to use,\n\
-then `default-minibuffer-frame' must be a frame whose minibuffer can\n\
-be shared by the new frame.\n\
-\n\
-This function is an internal primitive--use `make-frame' instead.")
+ doc: /* Make a new window, which is called a \"frame\" in Emacs terms.
+Returns an Emacs frame object.
+ALIST is an alist of frame parameters.
+If the parameters specify that the frame should not have a minibuffer,
+and do not specify a specific minibuffer window to use,
+then `default-minibuffer-frame' must be a frame whose minibuffer can
+be shared by the new frame.
+
+This function is an internal primitive--use `make-frame' instead. */)
(parms)
Lisp_Object parms;
{
Lisp_Object parent;
struct kboard *kb;
char x_frame_name[10];
- static int x_frame_count = 2; /* starts from 2 because terminal frame is F1 */
+ static int x_frame_count = 2; /* begins at 2 because terminal frame is F1 */
check_mac ();
if (EQ (parent, Qunbound))
parent = Qnil;
if (! NILP (parent))
- CHECK_NUMBER (parent, 0);
+ CHECK_NUMBER (parent);
/* make_frame_without_minibuffer can run Lisp code and garbage collect. */
/* No need to protect DISPLAY because that's not used after passing
it to make_frame_without_minibuffer. */
frame = Qnil;
GCPRO4 (parms, parent, name, frame);
- tem = mac_get_arg (parms, Qminibuffer, 0, 0, RES_TYPE_SYMBOL);
+ tem = mac_get_arg (parms, Qminibuffer, "minibuffer", "Minibuffer",
+ RES_TYPE_SYMBOL);
if (EQ (tem, Qnone) || NILP (tem))
f = make_frame_without_minibuffer (Qnil, kb, display);
else if (EQ (tem, Qonly))
f->output_method = output_mac;
f->output_data.mac = (struct mac_output *) xmalloc (sizeof (struct mac_output));
bzero (f->output_data.mac, sizeof (struct mac_output));
- f->output_data.mac->fontset = -1;
+ FRAME_FONTSET (f) = -1;
f->output_data.mac->scroll_bar_foreground_pixel = -1;
f->output_data.mac->scroll_bar_background_pixel = -1;
Lisp_Object value;
value = mac_get_arg (parms, Qinternal_border_width,
- "internalBorder", "BorderWidth", RES_TYPE_NUMBER);
+ "internalBorder", "InternalBorder", RES_TYPE_NUMBER);
if (! EQ (value, Qunbound))
parms = Fcons (Fcons (Qinternal_border_width, value),
parms);
}
-
/* Default internalBorderWidth to 0 on Windows to match other programs. */
x_default_parameter (f, parms, Qinternal_border_width, make_number (0),
- "internalBorderWidth", "BorderWidth", RES_TYPE_NUMBER);
-
- x_default_parameter (f, parms, Qvertical_scroll_bars, Qt,
- "verticalScrollBars", "ScrollBars", RES_TYPE_BOOLEAN);
+ "internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qvertical_scroll_bars, Qright,
+ "verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
/* Also do the stuff which must be set before the window exists. */
x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
x_default_parameter (f, parms, Qright_fringe, Qnil,
"rightFringe", "RightFringe", RES_TYPE_NUMBER);
+
/* Init faces before x_default_parameter is called for scroll-bar
parameters because that function calls x_set_scroll_bar_width,
which calls change_frame_size, which calls Fset_window_buffer,
"menuBar", "MenuBar", RES_TYPE_NUMBER);
x_default_parameter (f, parms, Qtool_bar_lines, make_number (0),
"toolBar", "ToolBar", RES_TYPE_NUMBER);
-#if 0
x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
"bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
-#endif
x_default_parameter (f, parms, Qtitle, Qnil,
"title", "Title", RES_TYPE_STRING);
/* Dimensions, especially f->height, must be done via change_frame_size.
Change will not be effected unless different from the current
f->height. */
-
width = f->width;
height = f->height;
+
f->height = 0;
SET_FRAME_WIDTH (f, 0);
change_frame_size (f, height, width, 1, 0, 0);
/* Must have been Qnil. */
;
}
-
UNGCPRO;
+
+ /* Make sure windows on this frame appear in calls to next-window
+ and similar functions. */
+ Vwindow_list = Qnil;
+
return unbind_to (count, frame);
}
}
\f
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
- "Internal function called by `color-defined-p', which see.")
+ doc: /* Internal function called by `color-defined-p', which see. */)
(color, frame)
Lisp_Object color, frame;
{
XColor foo;
FRAME_PTR f = check_x_frame (frame);
- CHECK_STRING (color, 1);
+ CHECK_STRING (color);
if (mac_defined_color (f, XSTRING (color)->data, &foo, 0))
return Qt;
}
DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
- "Internal function called by `color-values', which see.")
+ doc: /* Internal function called by `color-values', which see. */)
(color, frame)
Lisp_Object color, frame;
{
XColor foo;
FRAME_PTR f = check_x_frame (frame);
- CHECK_STRING (color, 1);
+ CHECK_STRING (color);
if (mac_defined_color (f, XSTRING (color)->data, &foo, 0))
{
}
DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
- "Internal function called by `display-color-p', which see.")
+ doc: /* Internal function called by `display-color-p', which see. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p,
- 0, 1, 0,
- "Return t if the X display supports shades of gray.\n\
-Note that color displays do support shades of gray.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ 0, 1, 0,
+ doc: /* Return t if the X display supports shades of gray.
+Note that color displays do support shades of gray.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
- 0, 1, 0,
- "Returns the width in pixels of the X display DISPLAY.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ 0, 1, 0,
+ doc: /* Returns the width in pixels of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
- Sx_display_pixel_height, 0, 1, 0,
- "Returns the height in pixels of the X display DISPLAY.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ Sx_display_pixel_height, 0, 1, 0,
+ doc: /* Returns the height in pixels of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
- 0, 1, 0,
- "Returns the number of bitplanes of the display DISPLAY.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ 0, 1, 0,
+ doc: /* Returns the number of bitplanes of the display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
- 0, 1, 0,
- "Returns the number of color cells of the display DISPLAY.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ 0, 1, 0,
+ doc: /* Returns the number of color cells of the display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
Sx_server_max_request_size,
- 0, 1, 0,
- "Returns the maximum request size of the server of display DISPLAY.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ 0, 1, 0,
+ doc: /* Returns the maximum request size of the server of display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
- "Returns the vendor ID string of the W32 system (Microsoft).\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ doc: /* Returns the vendor ID string of the Mac OS system (Apple).
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
- "Returns the version numbers of the server of display DISPLAY.\n\
-The value is a list of three integers: the major and minor\n\
-version numbers, and the vendor-specific release\n\
-number. See also the function `x-server-vendor'.\n\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ doc: /* Returns the version numbers of the server of display DISPLAY.
+The value is a list of three integers: the major and minor
+version numbers, and the vendor-specific release
+number. See also the function `x-server-vendor'.
+
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
- "Returns the number of screens on the server of display DISPLAY.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ doc: /* Return the number of screens on the server of display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
- "Returns the height in millimeters of the X display DISPLAY.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ doc: /* Return the height in millimeters of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
- "Returns the width in millimeters of the X display DISPLAY.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ doc: /* Return the width in millimeters of the X display DISPLAY.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-backing-store", Fx_display_backing_store,
- Sx_display_backing_store, 0, 1, 0,
- "Returns an indication of whether display DISPLAY does backing store.\n\
-The value may be `always', `when-mapped', or `not-useful'.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ Sx_display_backing_store, 0, 1, 0,
+ doc: /* Returns an indication of whether display DISPLAY does backing store.
+The value may be `always', `when-mapped', or `not-useful'.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
}
DEFUN ("x-display-visual-class", Fx_display_visual_class,
- Sx_display_visual_class, 0, 1, 0,
- "Returns the visual class of the display DISPLAY.\n\
-The value is one of the symbols `static-gray', `gray-scale',\n\
-`static-color', `pseudo-color', `true-color', or `direct-color'.\n\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ Sx_display_visual_class, 0, 1, 0,
+ doc: /* Returns the visual class of the display DISPLAY.
+The value is one of the symbols `static-gray', `gray-scale',
+`static-color', `pseudo-color', `true-color', or `direct-color'.
+
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
default:
error ("Display has an unknown visual class");
}
-#endif
+#endif /* 0 */
error ("Display has an unknown visual class");
}
DEFUN ("x-display-save-under", Fx_display_save_under,
- Sx_display_save_under, 0, 1, 0,
- "Returns t if the display DISPLAY supports the save-under feature.\n\
-The optional argument DISPLAY specifies which display to ask about.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If omitted or nil, that stands for the selected frame's display.")
+ Sx_display_save_under, 0, 1, 0,
+ doc: /* Returns t if the display DISPLAY supports the save-under feature.
+The optional argument DISPLAY specifies which display to ask about.
+DISPLAY should be either a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
Lisp_Object names;
struct mac_display_info *dpyinfo;
- CHECK_STRING (name, 0);
+ CHECK_STRING (name);
for (dpyinfo = &one_mac_display_info, names = x_display_name_list;
dpyinfo;
validate_x_resource_name ();
- dpyinfo = x_term_init (name, (unsigned char *) 0,
+ dpyinfo = mac_term_init (name, (unsigned char *) 0,
(char *) XSTRING (Vx_resource_name)->data);
if (dpyinfo == 0)
#if 0 /* MAC_TODO: implement network support */
DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection,
- 1, 3, 0, "Open a connection to a server.\n\
-DISPLAY is the name of the display to connect to.\n\
-Optional second arg XRM-STRING is a string of resources in xrdb format.\n\
-If the optional third arg MUST-SUCCEED is non-nil,\n\
-terminate Emacs if we can't open the connection.")
+ 1, 3, 0,
+ doc: /* Open a connection to a server.
+DISPLAY is the name of the display to connect to.
+Optional second arg XRM-STRING is a string of resources in xrdb format.
+If the optional third arg MUST-SUCCEED is non-nil,
+terminate Emacs if we can't open the connection. */)
(display, xrm_string, must_succeed)
Lisp_Object display, xrm_string, must_succeed;
{
unsigned char *xrm_option;
struct mac_display_info *dpyinfo;
- CHECK_STRING (display, 0);
+ CHECK_STRING (display);
if (! NILP (xrm_string))
- CHECK_STRING (xrm_string, 1);
+ CHECK_STRING (xrm_string);
if (! EQ (Vwindow_system, intern ("mac")))
error ("Not using Mac OS");
DEFUN ("x-close-connection", Fx_close_connection,
Sx_close_connection, 1, 1, 0,
- "Close the connection to DISPLAY's server.\n\
-For DISPLAY, specify either a frame or a display name (a string).\n\
-If DISPLAY is nil, that stands for the selected frame's display.")
+ doc: /* Close the connection to DISPLAY's server.
+For DISPLAY, specify either a frame or a display name (a string).
+If DISPLAY is nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
return Qnil;
}
-#endif
+#endif /* 0 */
DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
- "Return the list of display names that Emacs has connections to.")
+ doc: /* Return the list of display names that Emacs has connections to. */)
()
{
Lisp_Object tail, result;
}
DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
- "If ON is non-nil, report errors as soon as the erring request is made.\n\
-If ON is nil, allow buffering of requests.\n\
-This is a noop on W32 systems.\n\
-The optional second argument DISPLAY specifies which display to act on.\n\
-DISPLAY should be either a frame or a display name (a string).\n\
-If DISPLAY is omitted or nil, that stands for the selected frame's display.")
+ doc: /* If ON is non-nil, report errors as soon as the erring request is made.
+If ON is nil, allow buffering of requests.
+This is a noop on Mac OS systems.
+The optional second argument DISPLAY specifies which display to act on.
+DISPLAY should be either a frame or a display name (a string).
+If DISPLAY is omitted or nil, that stands for the selected frame's display. */)
(on, display)
Lisp_Object display, on;
{
/* Keywords. */
extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile;
-extern Lisp_Object QCdata;
-Lisp_Object QCtype, QCascent, QCmargin, QCrelief;
+extern Lisp_Object QCdata, QCtype;
+Lisp_Object QCascent, QCmargin, QCrelief;
Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
Lisp_Object QCindex;
img->colors = NULL;
img->ncolors = 0;
}
-#endif
+#endif /* MAC_TODO */
}
else
result = dflt;
return result;
-#endif
+#endif /* MAC_TODO */
return 0;
}
for (i = 0; i < c->used; ++i)
free_image (f, c->images[i]);
xfree (c->images);
- xfree (c);
xfree (c->buckets);
+ xfree (c);
FRAME_X_IMAGE_CACHE (f) = NULL;
}
}
DEFUN ("clear-image-cache", Fclear_image_cache, Sclear_image_cache,
0, 1, 0,
- "Clear the image cache of FRAME.\n\
-FRAME nil or omitted means use the selected frame.\n\
-FRAME t means clear the image caches of all frames.")
+ doc: /* Clear the image cache of FRAME.
+FRAME nil or omitted means use the selected frame.
+FRAME t means clear the image caches of all frames. */)
(frame)
Lisp_Object frame;
{
img = make_image (spec, hash);
cache_image (f, img);
img->load_failed_p = img->type->load (f, img) == 0;
+ xassert (!interrupt_input_blocked);
/* If we can't load the image, and we don't have a width and
height, use some arbitrary width and height so that we can
image_error ("Unable to create X pixmap", Qnil, Qnil);
return 0;
}
-#endif
+#endif /* MAC_TODO */
return 1;
}
XFreeGC (NULL, gc);
}
-#endif
+#endif /* MAC_TODO */
\f
/***********************************************************************
success_p = 1;
UNBLOCK_INPUT;
-#endif
+#endif /* MAC_TODO */
}
else
image_error ("Error loading XBM image `%s'", img->spec, Qnil);
for (x = 0; x < width; ++x)
XPutPixel (ximg, x, y, pixels[x]);
}
-#endif
+#endif /* MAC_TODO */
/* Transform image IMG which is used on frame F with a Laplace
edge-detection algorithm. The result is an image that can be used
DEFUN ("x-change-window-property", Fx_change_window_property,
Sx_change_window_property, 2, 3, 0,
- "Change window property PROP to VALUE on the X window of FRAME.\n\
-PROP and VALUE must be strings. FRAME nil or omitted means use the\n\
-selected frame. Value is VALUE.")
+ doc: /* Change window property PROP to VALUE on the X window of FRAME.
+PROP and VALUE must be strings. FRAME nil or omitted means use the
+selected frame. Value is VALUE. */)
(prop, value, frame)
Lisp_Object frame, prop, value;
{
struct frame *f = check_x_frame (frame);
Atom prop_atom;
- CHECK_STRING (prop, 1);
- CHECK_STRING (value, 2);
+ CHECK_STRING (prop);
+ CHECK_STRING (value);
BLOCK_INPUT;
prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False);
DEFUN ("x-delete-window-property", Fx_delete_window_property,
Sx_delete_window_property, 1, 2, 0,
- "Remove window property PROP from X window of FRAME.\n\
-FRAME nil or omitted means use the selected frame. Value is PROP.")
+ doc: /* Remove window property PROP from X window of FRAME.
+FRAME nil or omitted means use the selected frame. Value is PROP. */)
(prop, frame)
Lisp_Object prop, frame;
{
struct frame *f = check_x_frame (frame);
Atom prop_atom;
- CHECK_STRING (prop, 1);
+ CHECK_STRING (prop);
BLOCK_INPUT;
prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False);
XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom);
DEFUN ("x-window-property", Fx_window_property, Sx_window_property,
1, 2, 0,
- "Value is the value of window property PROP on FRAME.\n\
-If FRAME is nil or omitted, use the selected frame. Value is nil\n\
-if FRAME hasn't a property with name PROP or if PROP has no string\n\
-value.")
+ doc: /* Value is the value of window property PROP on FRAME.
+If FRAME is nil or omitted, use the selected frame. Value is nil
+if FRAME hasn't a property with name PROP or if PROP has no string
+value. */)
(prop, frame)
Lisp_Object prop, frame;
{
int actual_format;
unsigned long actual_size, bytes_remaining;
- CHECK_STRING (prop, 1);
+ CHECK_STRING (prop);
BLOCK_INPUT;
prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False);
rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
\f
/***********************************************************************
- Busy cursor
+ Hourglass cursor
***********************************************************************/
/* If non-null, an asynchronous timer that, when it expires, displays
void
start_hourglass ()
{
-#if 0 /* TODO: cursor shape changes. */
+#if 0 /* MAC_TODO: cursor shape changes. */
EMACS_TIME delay;
int secs, usecs = 0;
EMACS_SET_SECS_USECS (delay, secs, usecs);
hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,
- show_hourglass, NULL);
-#endif
+ show_hourglass, NULL);
+#endif /* MAC_TODO */
}
hourglass_shown_p = 1;
UNBLOCK_INPUT;
}
-#endif
+#endif /* MAC_TODO */
}
static void
hide_hourglass ()
{
-#if 0 /* TODO: cursor shape changes. */
+#if 0 /* MAC_TODO: cursor shape changes. */
if (hourglass_shown_p)
{
Lisp_Object rest, frame;
hourglass_shown_p = 0;
UNBLOCK_INPUT;
}
-#endif
+#endif /* MAC_TODO */
}
Tool tips
***********************************************************************/
-static Lisp_Object x_create_tip_frame P_ ((struct w32_display_info *,
+static Lisp_Object x_create_tip_frame P_ ((struct mac_display_info *,
Lisp_Object));
/* The frame of a currently visible tooltip, or null. */
Lisp_Object tip_timer;
Window tip_window;
+/* If non-nil, a vector of 3 elements containing the last args
+ with which x-show-tip was called. See there. */
+
+Lisp_Object last_show_tip_args;
+
/* Create a frame for a tooltip on the display described by DPYINFO.
PARMS is a list of frame parameters. Value is the frame. */
static Lisp_Object
x_create_tip_frame (dpyinfo, parms)
- struct w32_display_info *dpyinfo;
+ struct mac_display_info *dpyinfo;
Lisp_Object parms;
{
#if 0 /* MAC_TODO : Mac version */
return Qnil;
}
-#ifdef TODO /* Tooltip support not complete. */
+
DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
- "Show STRING in a \"tooltip\" window on frame FRAME.\n\
-A tooltip window is a small window displaying a string.\n\
-\n\
-FRAME nil or omitted means use the selected frame.\n\
-\n\
-PARMS is an optional list of frame parameters which can be\n\
-used to change the tooltip's appearance.\n\
-\n\
-Automatically hide the tooltip after TIMEOUT seconds.\n\
-TIMEOUT nil means use the default timeout of 5 seconds.\n\
-\n\
-If the list of frame parameters PARAMS contains a `left' parameters,\n\
-the tooltip is displayed at that x-position. Otherwise it is\n\
-displayed at the mouse position, with offset DX added (default is 5 if\n\
-DX isn't specified). Likewise for the y-position; if a `top' frame\n\
-parameter is specified, it determines the y-position of the tooltip\n\
-window, otherwise it is displayed at the mouse position, with offset\n\
-DY added (default is 10).")
+ doc : /* Show STRING in a "tooltip" window on frame FRAME.
+A tooltip window is a small window displaying a string.
+
+FRAME nil or omitted means use the selected frame.
+
+PARMS is an optional list of frame parameters which can be used to
+change the tooltip's appearance.
+
+Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil
+means use the default timeout of 5 seconds.
+
+If the list of frame parameters PARAMS contains a `left' parameters,
+the tooltip is displayed at that x-position. Otherwise it is
+displayed at the mouse position, with offset DX added (default is 5 if
+DX isn't specified). Likewise for the y-position; if a `top' frame
+parameter is specified, it determines the y-position of the tooltip
+window, otherwise it is displayed at the mouse position, with offset
+DY added (default is 10). */)
(string, frame, parms, timeout, dx, dy)
Lisp_Object string, frame, parms, timeout, dx, dy;
{
GCPRO4 (string, parms, frame, timeout);
- CHECK_STRING (string, 0);
+ CHECK_STRING (string);
f = check_x_frame (frame);
if (NILP (timeout))
timeout = make_number (5);
else
- CHECK_NATNUM (timeout, 2);
+ CHECK_NATNUM (timeout);
if (NILP (dx))
dx = make_number (5);
else
- CHECK_NUMBER (dx, 5);
+ CHECK_NUMBER (dx);
if (NILP (dy))
dy = make_number (-10);
else
- CHECK_NUMBER (dy, 6);
+ CHECK_NUMBER (dy);
if (NILP (last_show_tip_args))
last_show_tip_args = Fmake_vector (make_number (3), Qnil);
call1 (Qcancel_timer, timer);
}
+#if 0 /* MAC_TODO : Mac specifics */
BLOCK_INPUT;
compute_tip_xy (f, parms, dx, dy, &root_x, &root_y);
XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
root_x, root_y - PIXEL_HEIGHT (f));
UNBLOCK_INPUT;
+#endif /* MAC_TODO */
goto start_timer;
}
}
/* Move the tooltip window where the mouse pointer is. Resize and
show it. */
+#if 0 /* TODO : Mac specifics */
compute_tip_xy (f, parms, dx, dy, &root_x, &root_y);
-#if 0 /* TODO : Mac specifics */
BLOCK_INPUT;
- XMoveResizeWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- root_x, root_y - height, width, height);
- XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
+ XQueryPointer (FRAME_W32_DISPLAY (f), FRAME_W32_DISPLAY_INFO (f)->root_window,
+ &root, &child, &root_x, &root_y, &win_x, &win_y, &pmask);
+ XMoveResizeWindow (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
+ root_x + 5, root_y - height - 5, width, height);
+ XMapRaised (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f));
UNBLOCK_INPUT;
-#endif /* TODO */
+#endif /* MAC_TODO */
/* Draw into the window. */
w->must_be_updated_p = 1;
DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0,
- "Hide the current tooltip window, if there is any.\n\
-Value is t is tooltip was open, nil otherwise.")
+ doc: /* Hide the current tooltip window, if there is any.
+Value is t is tooltip was open, nil otherwise. */)
()
{
int count;
UNGCPRO;
return unbind_to (count, deleted);
}
-#endif
\f
extern Lisp_Object Qfile_name_history;
DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 4, 0,
- "Read file name, prompting with PROMPT in directory DIR.\n\
-Use a file selection dialog.\n\
-Select DEFAULT-FILENAME in the dialog's file selection box, if\n\
-specified. Don't let the user enter a file name in the file\n\
-selection dialog's entry field, if MUSTMATCH is non-nil.")
+ doc: /* Read file name, prompting with PROMPT in directory DIR.
+Use a file selection dialog.
+Select DEFAULT-FILENAME in the dialog's file selection box, if
+specified. Don't let the user enter a file name in the file
+selection dialog's entry field, if MUSTMATCH is non-nil. */)
(prompt, dir, default_filename, mustmatch)
Lisp_Object prompt, dir, default_filename, mustmatch;
{
int use_dialog_p = 1;
GCPRO5 (prompt, dir, default_filename, mustmatch, file);
- CHECK_STRING (prompt, 0);
- CHECK_STRING (dir, 1);
+ CHECK_STRING (prompt);
+ CHECK_STRING (dir);
/* Create the dialog with PROMPT as title, using DIR as initial
directory and using "*" as pattern. */
return unbind_to (count, file);
}
-#endif
+#endif /* MAC_TODO */
\f
#if GLYPH_DEBUG
DEFUN ("imagep", Fimagep, Simagep, 1, 1, 0,
- "Value is non-nil if SPEC is a valid image specification.")
+ doc: /* Value is non-nil if SPEC is a valid image specification. */)
(spec)
Lisp_Object spec;
{
staticpro (&Qline_spacing);
Qcenter = intern ("center");
staticpro (&Qcenter);
- Qcancel_timer = intern ("cancel-timer");
- staticpro (&Qcancel_timer);
/* This is the end of symbol initialization. */
Qhyper = intern ("hyper");
init_x_parm_symbols ();
DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path,
- "List of directories to search for bitmap files for w32.");
+ doc: /* List of directories to search for bitmap files for w32. */);
Vx_bitmap_file_path = decode_env_path ((char *) 0, "PATH");
DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape,
- "The shape of the pointer when over text.\n\
-Changing the value does not affect existing frames\n\
-unless you set the mouse color.");
+ doc: /* The shape of the pointer when over text.
+Changing the value does not affect existing frames
+unless you set the mouse color. */);
Vx_pointer_shape = Qnil;
DEFVAR_LISP ("x-resource-name", &Vx_resource_name,
- "The name Emacs uses to look up resources; for internal use only.\n\
-`x-get-resource' uses this as the first component of the instance name\n\
-when requesting resource values.\n\
-Emacs initially sets `x-resource-name' to the name under which Emacs\n\
-was invoked, or to the value specified with the `-name' or `-rn'\n\
-switches, if present.");
+ doc: /* The name Emacs uses to look up resources; for internal use only.
+`x-get-resource' uses this as the first component of the instance name
+when requesting resource values.
+Emacs initially sets `x-resource-name' to the name under which Emacs
+was invoked, or to the value specified with the `-name' or `-rn'
+switches, if present. */);
Vx_resource_name = Qnil;
Vx_nontext_pointer_shape = Qnil;
Vx_mode_pointer_shape = Qnil;
DEFVAR_LISP ("x-hourglass-pointer-shape", &Vx_hourglass_pointer_shape,
- "The shape of the pointer when Emacs is busy.\n\
-This variable takes effect when you create a new frame\n\
-or when you set the mouse color.");
+ doc: /* The shape of the pointer when Emacs is hourglass.
+This variable takes effect when you create a new frame
+or when you set the mouse color. */);
Vx_hourglass_pointer_shape = Qnil;
DEFVAR_BOOL ("display-hourglass", &display_hourglass_p,
- "Non-zero means Emacs displays an hourglass pointer on window systems.");
+ doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */);
display_hourglass_p = 1;
DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay,
- "*Seconds to wait before displaying an hourglass pointer.\n\
-Value must be an integer or float.");
+ doc: /* *Seconds to wait before displaying an hourglass pointer.
+Value must be an integer or float. */);
Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
DEFVAR_LISP ("x-sensitive-text-pointer-shape",
- &Vx_sensitive_text_pointer_shape,
- "The shape of the pointer when over mouse-sensitive text.\n\
-This variable takes effect when you create a new frame\n\
-or when you set the mouse color.");
+ &Vx_sensitive_text_pointer_shape,
+ doc: /* The shape of the pointer when over mouse-sensitive text.
+This variable takes effect when you create a new frame
+or when you set the mouse color. */);
Vx_sensitive_text_pointer_shape = Qnil;
DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel,
- "A string indicating the foreground color of the cursor box.");
+ doc: /* A string indicating the foreground color of the cursor box. */);
Vx_cursor_fore_pixel = Qnil;
DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,
- "Non-nil if no window manager is in use.\n\
-Emacs doesn't try to figure this out; this is always nil\n\
-unless you set it to something else.");
+ doc: /* Non-nil if no window manager is in use.
+Emacs doesn't try to figure this out; this is always nil
+unless you set it to something else. */);
/* We don't have any way to find this out, so set it to nil
and maybe the user would like to set it to t. */
Vx_no_window_manager = Qnil;
DEFVAR_LISP ("x-pixel-size-width-font-regexp",
&Vx_pixel_size_width_font_regexp,
- "Regexp matching a font name whose width is the same as `PIXEL_SIZE'.\n\
-\n\
-Since Emacs gets width of a font matching with this regexp from\n\
-PIXEL_SIZE field of the name, font finding mechanism gets faster for\n\
-such a font. This is especially effective for such large fonts as\n\
-Chinese, Japanese, and Korean.");
+ doc: /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'.
+
+Since Emacs gets width of a font matching with this regexp from
+PIXEL_SIZE field of the name, font finding mechanism gets faster for
+such a font. This is especially effective for such large fonts as
+Chinese, Japanese, and Korean. */);
Vx_pixel_size_width_font_regexp = Qnil;
DEFVAR_LISP ("image-cache-eviction-delay", &Vimage_cache_eviction_delay,
- "Time after which cached images are removed from the cache.\n\
-When an image has not been displayed this many seconds, remove it\n\
-from the image cache. Value must be an integer or nil with nil\n\
-meaning don't clear the cache.");
+ doc: /* Time after which cached images are removed from the cache.
+When an image has not been displayed this many seconds, remove it
+from the image cache. Value must be an integer or nil with nil
+meaning don't clear the cache. */);
Vimage_cache_eviction_delay = make_number (30 * 60);
#if 0 /* MAC_TODO: implement get X resource */
defsubr (&Simagep);
defsubr (&Slookup_image);
#endif
-#endif /* TODO */
+#endif /* MAC_TODO */
hourglass_atimer = NULL;
hourglass_shown_p = 0;
-#ifdef TODO /* Tooltip support not complete. */
+
defsubr (&Sx_show_tip);
defsubr (&Sx_hide_tip);
-#endif
- tip_timer = Qnil;
staticpro (&tip_timer);
- tip_frame = Qnil;
- staticpro (&tip_frame);
+ tip_timer = Qnil;
#if 0 /* MAC_TODO */
defsubr (&Sx_file_dialog);
image_types = NULL;
Vimage_types = Qnil;
-#if 0 /* TODO : Image support for W32 */
define_image_type (&xbm_type);
+#if 0 /* NTEMACS_TODO : Image support for W32 */
define_image_type (&gs_type);
define_image_type (&pbm_type);
#endif
#endif /* NTEMACS_TODO */
}
-
-#undef abort
-
-#if 0
-void
-w32_abort()
-{
- int button;
- button = MessageBox (NULL,
- "A fatal error has occurred!\n\n"
- "Select Abort to exit, Retry to debug, Ignore to continue",
- "Emacs Abort Dialog",
- MB_ICONEXCLAMATION | MB_TASKMODAL
- | MB_SETFOREGROUND | MB_ABORTRETRYIGNORE);
- switch (button)
- {
- case IDRETRY:
- DebugBreak ();
- break;
- case IDIGNORE:
- break;
- case IDABORT:
- default:
- abort ();
- break;
- }
-}
-
-/* For convenience when debugging. */
-int
-w32_last_error()
-{
- return GetLastError ();
-}
-#endif