* src/image.c: Rename x_* procedures to image_*.
* src/frame.c: Rename x_* procedures to gui_*. Rename
xrdb_get_resource to gui_display_get_resource. Rename x_get_arg to
gui_display_get arg.
* src/frame.h: Rename can_x_set_window_size to can_set_window_size.
* src/xfaces.c: Rename realize_x_face to realize_gui_face. Rename
x_supports_face_attributes_p to gui_supports_face_attributes_p.
* src/keyboard.c:
* src/lisp.h:
* src/nsterm.m:
* src/w32term.c:
* src/xterm.c: Rename x_get_keysym_name to get_keysym_name.
* src/nsfns.c:
* src/nsterm.m: Rename x_* procedures to ns_*.
* src/w32fns.c:
* src/w32term.c: Rename x_* procedures to w32_*.
* src/termhooks.h (query_colors, get_focus_frame, focus_frame_hook)
(frame_visible_invisible_hook, iconify_frame_hook)
(set_window_size_hook, set_frame_offset_hook, set_frame_alpha_hook)
(set_new_font_hook, set_bitmap_icon_hook, implicit_set_name_hook)
(activate_menubar_hook, change_tool_bar_height_hook)
(set_scroll_bar_default_width_hook)
(set_scroll_bar_default_height_hook, get_string_resource_hook): New
terminal hooks to replace backend-specific x_* procedures.
* src/dispextern.h (clear_under_internal_border): New RIF procedure.
* src/alloc.c:
* src/frame.c:
* src/xdisp.c: Use FRAME_OUTPUT_DATA instead of FRAME_X_OUTPUT.
* src/frame.c:
* src/w32term.c:
* src/w32fns.c: Use FRAME_NATIVE_WINDOW instead of FRAME_X_WINDOW.
mark_vectorlike (&ptr->header);
mark_face_cache (f->face_cache);
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (f) && FRAME_X_OUTPUT (f))
+ if (FRAME_WINDOW_P (f) && FRAME_OUTPUT_DATA (f))
{
struct font *font = FRAME_FONT (f);
/* True means that colors of this face may not be freed because they
have been copied bitwise from a base face (see
- realize_x_face). */
+ realize_gui_face). */
bool_bf colors_copied_bitwise_p : 1;
/* If non-zero, use overstrike (to simulate bold-face). */
void (*clear_frame_area) (struct frame *f, int x, int y,
int width, int height);
+ /* Clear area of frame F's internal border. If the internal border
+ face of F has been specified (is not null), fill the area with
+ that face. */
+ void (*clear_under_internal_border) (struct frame *f);
+
/* Draw specified cursor CURSOR_TYPE of width CURSOR_WIDTH
at row GLYPH_ROW on window W if ON_P is true. If ON_P is
false, don't draw cursor. If ACTIVE_P is true, system caret
#ifdef HAVE_WINDOW_SYSTEM
-extern ptrdiff_t x_bitmap_pixmap (struct frame *, ptrdiff_t);
-extern void x_reference_bitmap (struct frame *, ptrdiff_t);
-extern ptrdiff_t x_create_bitmap_from_data (struct frame *, char *,
- unsigned int, unsigned int);
-extern ptrdiff_t x_create_bitmap_from_file (struct frame *, Lisp_Object);
+extern ptrdiff_t image_bitmap_pixmap (struct frame *, ptrdiff_t);
+extern void image_reference_bitmap (struct frame *, ptrdiff_t);
+extern ptrdiff_t image_create_bitmap_from_data (struct frame *, char *,
+ unsigned int, unsigned int);
+extern ptrdiff_t image_create_bitmap_from_file (struct frame *, Lisp_Object);
#if defined HAVE_XPM && defined HAVE_X_WINDOWS && !defined USE_GTK
extern ptrdiff_t x_create_bitmap_from_xpm_data (struct frame *, const char **);
#endif
-#ifndef x_destroy_bitmap
-extern void x_destroy_bitmap (struct frame *, ptrdiff_t);
+#ifndef image_destroy_bitmap
+extern void image_destroy_bitmap (struct frame *, ptrdiff_t);
#endif
-extern void x_destroy_all_bitmaps (Display_Info *);
+extern void image_destroy_all_bitmaps (Display_Info *);
+#ifdef HAVE_X_WINDOWS
extern void x_create_bitmap_mask (struct frame *, ptrdiff_t);
-extern Lisp_Object x_find_image_file (Lisp_Object);
+#endif
+extern Lisp_Object image_find_image_file (Lisp_Object);
void x_kill_gs_process (Pixmap, struct frame *);
struct image_cache *make_image_cache (void);
#ifdef HAVE_WINDOW_SYSTEM
-void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
-void x_change_tool_bar_height (struct frame *f, int);
-
-extern frame_parm_handler x_frame_parm_handlers[];
-
extern void start_hourglass (void);
extern void cancel_hourglass (void);
};
extern Display_Info *check_x_display_info (Lisp_Object);
-extern Lisp_Object x_get_arg (Display_Info *, Lisp_Object,
- Lisp_Object, const char *, const char *class,
- enum resource_types);
-extern Lisp_Object x_frame_get_and_record_arg (struct frame *, Lisp_Object,
- Lisp_Object,
- const char *, const char *,
- enum resource_types);
-extern Lisp_Object x_default_parameter (struct frame *, Lisp_Object,
- Lisp_Object, Lisp_Object,
- const char *, const char *,
+extern Lisp_Object gui_display_get_arg (Display_Info *, Lisp_Object,
+ Lisp_Object, const char *, const char *,
enum resource_types);
-extern char *x_get_string_resource (XrmDatabase, const char *,
- const char *);
+extern Lisp_Object gui_frame_get_and_record_arg (struct frame *, Lisp_Object,
+ Lisp_Object,
+ const char *, const char *,
+ enum resource_types);
+extern Lisp_Object gui_default_parameter (struct frame *, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ const char *, const char *,
+ enum resource_types);
#ifndef HAVE_NS /* These both used on W32 and X only. */
-extern bool x_mouse_grabbed (Display_Info *);
-extern void x_redo_mouse_highlight (Display_Info *);
+extern bool gui_mouse_grabbed (Display_Info *);
+extern void gui_redo_mouse_highlight (Display_Info *);
#endif /* HAVE_NS */
#endif /* HAVE_WINDOW_SYSTEM */
* FRAME_LINE_HEIGHT (f));
}
- /* Adjust frame size but make sure x_set_window_size does not
+ /* Adjust frame size but make sure set_window_size_hook does not
get called. */
adjust_frame_size (f, new_width, new_height, 5, pretend,
Qchange_frame_size);
/* Make a realized fontset for ASCII face FACE on frame F from the
base fontset BASE_FONTSET_ID. If BASE_FONTSET_ID is -1, use the
default fontset as the base. Value is the id of the new fontset.
- Called from realize_x_face. */
+ Called from realize_gui_face. */
int
make_fontset_for_ascii_face (struct frame *f, int base_fontset_id, struct face *face)
static ptrdiff_t num_auto_fontsets;
/* Return a fontset synthesized from FONT-OBJECT. This is called from
- x_new_font when FONT-OBJECT is used for the default ASCII font of a
- frame, and the returned fontset is used for the default fontset of
- that frame. The fontset specifies a font of the same registry as
- FONT-OBJECT for all characters in the repertory of the registry
- (see Vfont_encoding_alist). If the repertory is not known, the
- fontset specifies the font for all Latin characters assuming that a
- user intends to use FONT-OBJECT for Latin characters. */
+ the terminal hook set_new_font_hook when FONT-OBJECT is used for
+ the default ASCII font of a frame, and the returned fontset is used
+ for the default fontset of that frame. The fontset specifies a
+ font of the same registry as FONT-OBJECT for all characters in the
+ repertory of the registry (see Vfont_encoding_alist). If the
+ repertory is not known, the fontset specifies the font for all
+ Latin characters assuming that a user intends to use FONT-OBJECT
+ for Latin characters. */
int
fontset_from_font (Lisp_Object font_object)
#endif
#ifdef HAVE_WINDOW_SYSTEM
-static void x_report_frame_params (struct frame *, Lisp_Object *);
+static void gui_report_frame_params (struct frame *, Lisp_Object *);
#endif
/* These setters are used only in this file, so they can be private. */
f->top_pos = pos_y;
}
- x_set_offset (f, pos_x, pos_y, -1);
+ FRAME_TERMINAL (f)->set_frame_offset_hook (f, pos_x, pos_y, -1);
}
if (!CONSP (keep_ratio) || !NILP (Fcar (keep_ratio)))
* text size of F in pixels. A value of -1 means no change is requested
* for that direction (but the frame may still have to be resized to
* accommodate windows with their minimum sizes). This can either issue
- * a request to resize the frame externally (via x_set_window_size), to
+ * a request to resize the frame externally (via set_window_size_hook), to
* resize the frame internally (via resize_frame_windows) or do nothing
* at all.
*
* The argument INHIBIT can assume the following values:
*
- * 0 means to unconditionally call x_set_window_size even if sizes
+ * 0 means to unconditionally call set_window_size_hook even if sizes
* apparently do not change. Fx_create_frame uses this to pass the
* initial size to the window manager.
*
- * 1 means to call x_set_window_size if the native frame size really
+ * 1 means to call set_window_size_hook if the native frame size really
* changes. Fset_frame_size, Fset_frame_height, ... use this.
*
- * 2 means to call x_set_window_size provided frame_inhibit_resize
+ * 2 means to call set_window_size_hook provided frame_inhibit_resize
* allows it. The menu and tool bar code use this ("3" won't work
* here in general because menu and tool bar are often not counted in
* the frame's text height).
*
- * 3 means call x_set_window_size if window minimum sizes must be
- * preserved or frame_inhibit_resize allows it. x_set_left_fringe,
- * x_set_scroll_bar_width, x_new_font ... use (or should use) this.
+ * 3 means call set_window_size_hook if window minimum sizes must be
+ * preserved or frame_inhibit_resize allows it.
+ * gui_set_left_fringe, gui_set_scroll_bar_width, gui_new_font
+ * ... use (or should use) this.
*
- * 4 means call x_set_window_size only if window minimum sizes must be
- * preserved. x_set_right_divider_width, x_set_border_width and the
- * code responsible for wrapping the tool bar use this.
+ * 4 means call set_window_size_hook only if window minimum sizes must
+ * be preserved. x_set_right_divider_width, x_set_border_width and
+ * the code responsible for wrapping the tool bar use this.
*
- * 5 means to never call x_set_window_size. change_frame_size uses
+ * 5 means to never call set_window_size_hook. change_frame_size uses
* this.
*
- * Note that even when x_set_window_size is not called, individual
+ * Note that even when set_window_size_hook is not called, individual
* windows may have to be resized (via `window--sanitize-window-sizes')
* in order to support minimum size constraints.
*
/* The following two values are calculated from the old frame pixel
sizes and any "new" settings for tool bar, menu bar and internal
borders. We do it this way to detect whether we have to call
- x_set_window_size as consequence of the new settings. */
+ set_window_size_hook as consequence of the new settings. */
int windows_width = FRAME_WINDOWS_WIDTH (f);
int windows_height = FRAME_WINDOWS_HEIGHT (f);
int min_windows_width, min_windows_height;
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f)
- && f->can_x_set_window_size
+ && f->can_set_window_size
&& ((!inhibit_horizontal
&& (new_pixel_width != old_pixel_width
|| inhibit == 0 || inhibit == 2))
list2 (inhibit_horizontal ? Qt : Qnil,
inhibit_vertical ? Qt : Qnil));
- x_set_window_size (f, 0, new_text_width, new_text_height, 1);
+ FRAME_TERMINAL (f)->set_window_size_hook (f,
+ 0,
+ new_text_width,
+ new_text_height,
+ 1);
f->resized_p = true;
return;
f->wants_modeline = true;
f->redisplay = true;
f->garbaged = true;
- f->can_x_set_window_size = false;
+ f->can_set_window_size = false;
f->after_make_frame = false;
f->inhibit_horizontal_resize = false;
f->inhibit_vertical_resize = false;
last_nonminibuf_frame = f;
- f->can_x_set_window_size = true;
+ f->can_set_window_size = true;
f->after_make_frame = true;
return f;
for (tem = f->face_alist; CONSP (tem); tem = XCDR (tem))
XSETCDR (XCAR (tem), Fcopy_sequence (XCDR (XCAR (tem))));
- f->can_x_set_window_size = true;
+ f->can_set_window_size = true;
f->after_make_frame = true;
return frame;
#ifdef HAVE_WINDOW_SYSTEM
if (track && FRAME_WINDOW_P (f))
{
- Lisp_Object focus, xfocus;
+ Lisp_Object focus, gfocus;
- xfocus = x_get_focus_frame (f);
- if (FRAMEP (xfocus))
+ gfocus = FRAME_TERMINAL (f)->get_focus_frame (f);
+ if (FRAMEP (gfocus))
{
- focus = FRAME_FOCUS_FRAME (XFRAME (xfocus));
+ focus = FRAME_FOCUS_FRAME (XFRAME (gfocus));
if ((FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
/* Redirect frame focus also when FRAME has its minibuffer
window on the selected frame (see Bug#24500). */
|| (NILP (focus)
&& EQ (FRAME_MINIBUF_WINDOW (f), sf->selected_window)))
- Fredirect_frame_focus (xfocus, frame);
+ Fredirect_frame_focus (gfocus, frame);
}
}
#endif /* HAVE_X_WINDOWS */
{
struct frame *f = decode_live_frame (frame);
- /* I think this should be done with a hook. */
-#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (f))
- x_make_frame_visible (f);
-#endif
+ if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook)
+ FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, true);
make_frame_visible_1 (f->root_window);
/* Don't allow minibuf_window to remain on an invisible frame. */
check_minibuf_window (frame, EQ (minibuf_window, selected_window));
- /* I think this should be done with a hook. */
-#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (f))
- x_make_frame_invisible (f);
-#endif
+ if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook)
+ FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, false);
/* Make menu bar update for the Buffers and Frames menus. */
windows_or_buffers_changed = 16;
/* Don't allow minibuf_window to remain on an iconified frame. */
check_minibuf_window (frame, EQ (minibuf_window, selected_window));
- /* I think this should be done with a hook. */
- if (FRAME_WINDOW_P (f))
- {
-#ifdef HAVE_WINDOW_SYSTEM
- x_iconify_frame (f);
-#endif
- }
+ if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->iconify_frame_hook)
+ FRAME_TERMINAL (f)->iconify_frame_hook (f);
return Qnil;
}
Fmake_frame_visible (frame);
if (FRAME_TERMINAL (f)->frame_raise_lower_hook)
- (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 1);
+ (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, true);
return Qnil;
}
struct frame *f = decode_live_frame (frame);
if (FRAME_TERMINAL (f)->frame_raise_lower_hook)
- (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 0);
+ (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, false);
return Qnil;
}
(Lisp_Object frame, Lisp_Object noactivate)
{
#ifdef HAVE_WINDOW_SYSTEM
- x_focus_frame (decode_window_system_frame (frame), !NILP (noactivate));
+ struct frame *f = decode_window_system_frame (frame);
+ if (f)
+ FRAME_TERMINAL (f)->focus_frame_hook (f, !NILP (noactivate));
#endif
return Qnil;
}
}
/* Set the name of the terminal frame. Also used by MSDOS frames.
- Modeled after x_set_name which is used for WINDOW frames. */
+ Modeled after *_set_name which is used for WINDOW frames. */
static void
set_term_frame_name (struct frame *f, Lisp_Object name)
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
- x_report_frame_params (f, &alist);
+ gui_report_frame_params (f, &alist);
else
#endif
{
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
- x_set_frame_parameters (f, alist);
+ gui_set_frame_parameters (f, alist);
else
#endif
#ifdef MSDOS
CHECK_TYPE_RANGED_INTEGER (int, x);
CHECK_TYPE_RANGED_INTEGER (int, y);
- /* I think this should be done with a hook. */
if (FRAME_WINDOW_P (f))
{
#ifdef HAVE_WINDOW_SYSTEM
- x_set_offset (f, XFIXNUM (x), XFIXNUM (y), 1);
+ FRAME_TERMINAL (f)->set_frame_offset_hook (f,
+ XFIXNUM (x),
+ XFIXNUM (y),
+ 1);
#endif
}
Frame Parameters
***********************************************************************/
-/* Connect the frame-parameter names for X frames
- to the ways of passing the parameter values to the window system.
+/* Connect the frame-parameter names for frames to the ways of passing
+ the parameter values to the window system.
- The name of a parameter, as a Lisp symbol,
- has an `x-frame-parameter' property which is an integer in Lisp
- that is an index in this table. */
+ The name of a parameter, as a Lisp symbol, has a
+ `frame-parameter-pos' property which is an integer in Lisp that is
+ an index in this table. */
struct frame_parm_table {
const char *name;
/* Change the parameters of frame F as specified by ALIST.
If a parameter is not specially recognized, do nothing special;
- otherwise call the `x_set_...' function for that parameter.
+ otherwise call the `gui_set_...' function for that parameter.
Except for certain geometry properties, always call store_frame_param
to store the new value in the parameter alist. */
void
-x_set_frame_parameters (struct frame *f, Lisp_Object alist)
+gui_set_frame_parameters (struct frame *f, Lisp_Object alist)
{
Lisp_Object tail, frame;
all. With the old setting it can get a Heisenbug when
EmacsFrameResize intermittently provokes a delayed
change_frame_size in the middle of adjust_frame_size. */
- /** || (f->can_x_set_window_size && (f->new_height || f->new_width))) **/
+ /** || (f->can_set_window_size && (f->new_height || f->new_width))) **/
adjust_frame_size (f, width, height, 1, 0, Qx_set_frame_parameters);
if ((!NILP (left) || !NILP (top))
f->win_gravity = NorthWestGravity;
/* Actually set that position, and convert to absolute. */
- x_set_offset (f, leftpos, toppos, -1);
+ FRAME_TERMINAL (f)->set_frame_offset_hook (f, leftpos, toppos, -1);
}
if (fullscreen_change)
store_frame_param (f, Qfullscreen, fullscreen);
if (!EQ (fullscreen, old_value))
- x_set_fullscreen (f, fullscreen, old_value);
+ gui_set_fullscreen (f, fullscreen, old_value);
}
}
-/* Insert a description of internally-recorded parameters of frame X
+/* Insert a description of internally-recorded parameters of frame F
into the parameter alist *ALISTPTR that is to be given to the user.
Only parameters that are specific to the X window system
and whose values are not correctly recorded in the frame's
param_alist need to be considered here. */
void
-x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
+gui_report_frame_params (struct frame *f, Lisp_Object *alistptr)
{
Lisp_Object tem;
uprintmax_t w;
/* nil means "use default height"
for non-toolkit scroll bar. */
: Qnil));
- /* FRAME_X_WINDOW is not guaranteed to return an integer. E.g., on
- MS-Windows it returns a value whose type is HANDLE, which is
- actually a pointer. Explicit casting avoids compiler
+ /* FRAME_NATIVE_WINDOW is not guaranteed to return an integer.
+ E.g., on MS-Windows it returns a value whose type is HANDLE,
+ which is actually a pointer. Explicit casting avoids compiler
warnings. */
- w = (uintptr_t) FRAME_X_WINDOW (f);
+ w = (uintptr_t) FRAME_NATIVE_WINDOW (f);
store_in_alist (alistptr, Qwindow_id,
make_formatted_string (buf, "%"pMu, w));
#ifdef HAVE_X_WINDOWS
store_in_alist (alistptr, Qdisplay,
XCAR (FRAME_DISPLAY_INFO (f)->name_list_element));
- if (FRAME_X_OUTPUT (f)->parent_desc == FRAME_DISPLAY_INFO (f)->root_window)
+ if (FRAME_OUTPUT_DATA (f)->parent_desc == FRAME_DISPLAY_INFO (f)->root_window)
tem = Qnil;
else
- tem = make_fixed_natnum ((uintptr_t) FRAME_X_OUTPUT (f)->parent_desc);
+ tem = make_fixed_natnum ((uintptr_t) FRAME_OUTPUT_DATA (f)->parent_desc);
store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil));
store_in_alist (alistptr, Qparent_id, tem);
store_in_alist (alistptr, Qtool_bar_position, FRAME_TOOL_BAR_POSITION (f));
the previous value of that parameter, NEW_VALUE is the new value. */
void
-x_set_fullscreen (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+gui_set_fullscreen (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (NILP (new_value))
f->want_fullscreen = FULLSCREEN_NONE;
the previous value of that parameter, NEW_VALUE is the new value. */
void
-x_set_line_spacing (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+gui_set_line_spacing (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (NILP (new_value))
f->extra_line_spacing = 0;
the previous value of that parameter, NEW_VALUE is the new value. */
void
-x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+gui_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
Lisp_Object bgcolor;
void
-x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
Lisp_Object font_object;
int fontset = -1;
/* SPEC might be nil because ASCII_FONT's name doesn't parse
according to stupid XLFD rules, which, for example,
disallow font names that include a dash followed by a
- number. So in those cases we simply request x_new_font
- below to generate a new fontset. */
+ number. So in those cases we simply call
+ set_new_font_hook below to generate a new fontset. */
if (NILP (spec) || ! font_match_p (spec, font_object))
fontset = -1;
}
if (! NILP (Fequal (font_object, oldval)))
return;
- x_new_font (f, font_object, fontset);
+ FRAME_TERMINAL (f)->set_new_font_hook (f, font_object, fontset);
store_frame_param (f, Qfont, arg);
#ifdef HAVE_X_WINDOWS
store_frame_param (f, Qfont_parameter, font_param);
void
-x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+gui_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (! NILP (new_value)
&& !CONSP (new_value))
Lisp_Object frame;
XSETFRAME (frame, f);
- x_set_font (f, Fframe_parameter (frame, Qfont), Qnil);
+ gui_set_font (f, Fframe_parameter (frame, Qfont), Qnil);
face_change = true;
windows_or_buffers_changed = 18;
}
}
void
-x_set_left_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+gui_set_left_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
int unit = FRAME_COLUMN_WIDTH (f);
int old_width = FRAME_LEFT_FRINGE_WIDTH (f);
f->fringe_cols /* Round up. */
= (new_width + FRAME_RIGHT_FRINGE_WIDTH (f) + unit - 1) / unit;
- if (FRAME_X_WINDOW (f) != 0)
+ if (FRAME_NATIVE_WINDOW (f) != 0)
adjust_frame_size (f, -1, -1, 3, 0, Qleft_fringe);
SET_FRAME_GARBAGED (f);
void
-x_set_right_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+gui_set_right_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
int unit = FRAME_COLUMN_WIDTH (f);
int old_width = FRAME_RIGHT_FRINGE_WIDTH (f);
f->fringe_cols /* Round up. */
= (new_width + FRAME_LEFT_FRINGE_WIDTH (f) + unit - 1) / unit;
- if (FRAME_X_WINDOW (f) != 0)
+ if (FRAME_NATIVE_WINDOW (f) != 0)
adjust_frame_size (f, -1, -1, 3, 0, Qright_fringe);
SET_FRAME_GARBAGED (f);
void
-x_set_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
CHECK_TYPE_RANGED_INTEGER (int, arg);
if (XFIXNUM (arg) == f->border_width)
return;
- if (FRAME_X_WINDOW (f) != 0)
+ if (FRAME_NATIVE_WINDOW (f) != 0)
error ("Cannot change the border width of a frame");
f->border_width = XFIXNUM (arg);
}
void
-x_set_right_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_right_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int old = FRAME_RIGHT_DIVIDER_WIDTH (f);
CHECK_TYPE_RANGED_INTEGER (int, arg);
}
void
-x_set_bottom_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_bottom_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int old = FRAME_BOTTOM_DIVIDER_WIDTH (f);
CHECK_TYPE_RANGED_INTEGER (int, arg);
}
void
-x_set_visibility (struct frame *f, Lisp_Object value, Lisp_Object oldval)
+gui_set_visibility (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
Lisp_Object frame;
XSETFRAME (frame, f);
}
void
-x_set_autoraise (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_autoraise (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
f->auto_raise = !NILP (arg);
}
void
-x_set_autolower (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_autolower (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
f->auto_lower = !NILP (arg);
}
void
-x_set_unsplittable (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_unsplittable (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
f->no_split = !NILP (arg);
}
void
-x_set_vertical_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_vertical_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
if ((EQ (arg, Qleft) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
|| (EQ (arg, Qright) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))
? vertical_scroll_bar_right
: vertical_scroll_bar_none);
- /* We set this parameter before creating the X window for the
- frame, so we can get the geometry right from the start.
+ /* We set this parameter before creating the native window for
+ the frame, so we can get the geometry right from the start.
However, if the window hasn't been created yet, we shouldn't
- call x_set_window_size. */
- if (FRAME_X_WINDOW (f))
+ call set_window_size_hook. */
+ if (FRAME_NATIVE_WINDOW (f))
adjust_frame_size (f, -1, -1, 3, 0, Qvertical_scroll_bars);
SET_FRAME_GARBAGED (f);
}
void
-x_set_horizontal_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_horizontal_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
#if USE_HORIZONTAL_SCROLL_BARS
if ((NILP (arg) && FRAME_HAS_HORIZONTAL_SCROLL_BARS (f))
{
f->horizontal_scroll_bars = NILP (arg) ? false : true;
- /* We set this parameter before creating the X window for the
- frame, so we can get the geometry right from the start.
+ /* We set this parameter before creating the native window for
+ the frame, so we can get the geometry right from the start.
However, if the window hasn't been created yet, we shouldn't
- call x_set_window_size. */
- if (FRAME_X_WINDOW (f))
+ call set_window_size_hook. */
+ if (FRAME_NATIVE_WINDOW (f))
adjust_frame_size (f, -1, -1, 3, 0, Qhorizontal_scroll_bars);
SET_FRAME_GARBAGED (f);
}
void
-x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int unit = FRAME_COLUMN_WIDTH (f);
{
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = XFIXNAT (arg);
FRAME_CONFIG_SCROLL_BAR_COLS (f) = (XFIXNAT (arg) + unit - 1) / unit;
- if (FRAME_X_WINDOW (f))
+ if (FRAME_NATIVE_WINDOW (f))
adjust_frame_size (f, -1, -1, 3, 0, Qscroll_bar_width);
SET_FRAME_GARBAGED (f);
}
else
{
- x_set_scroll_bar_default_width (f);
+ FRAME_TERMINAL (f)->set_scroll_bar_default_width_hook (f);
- if (FRAME_X_WINDOW (f))
+ if (FRAME_NATIVE_WINDOW (f))
adjust_frame_size (f, -1, -1, 3, 0, Qscroll_bar_width);
SET_FRAME_GARBAGED (f);
}
void
-x_set_scroll_bar_height (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_scroll_bar_height (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
#if USE_HORIZONTAL_SCROLL_BARS
int unit = FRAME_LINE_HEIGHT (f);
{
FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) = XFIXNAT (arg);
FRAME_CONFIG_SCROLL_BAR_LINES (f) = (XFIXNAT (arg) + unit - 1) / unit;
- if (FRAME_X_WINDOW (f))
+ if (FRAME_NATIVE_WINDOW (f))
adjust_frame_size (f, -1, -1, 3, 0, Qscroll_bar_height);
SET_FRAME_GARBAGED (f);
}
else
{
- x_set_scroll_bar_default_height (f);
+ FRAME_TERMINAL (f)->set_scroll_bar_default_height_hook (f);
- if (FRAME_X_WINDOW (f))
+ if (FRAME_NATIVE_WINDOW (f))
adjust_frame_size (f, -1, -1, 3, 0, Qscroll_bar_height);
SET_FRAME_GARBAGED (f);
}
void
-x_set_alpha (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+gui_set_alpha (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
double alpha = 1.0;
double newval[2];
for (i = 0; i < 2; i++)
f->alpha[i] = newval[i];
-#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) || defined (NS_IMPL_COCOA)
- block_input ();
- x_set_frame_alpha (f);
- unblock_input ();
-#endif
-
- return;
+ if (FRAME_TERMINAL (f)->set_frame_alpha_hook)
+ {
+ block_input ();
+ FRAME_TERMINAL (f)->set_frame_alpha_hook (f);
+ unblock_input ();
+ }
}
/**
- * x_set_no_special_glyphs:
+ * gui_set_no_special_glyphs:
*
* Set frame F's `no-special-glyphs' parameter which, if non-nil,
* suppresses the display of truncation and continuation glyphs
* outside fringes.
*/
void
-x_set_no_special_glyphs (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+gui_set_no_special_glyphs (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (!EQ (new_value, old_value))
FRAME_NO_SPECIAL_GLYPHS (f) = !NILP (new_value);
/* Non-zero if mouse is grabbed on DPYINFO
and we know the frame where it is. */
-bool x_mouse_grabbed (Display_Info *dpyinfo)
+bool
+gui_mouse_grabbed (Display_Info *dpyinfo)
{
return (dpyinfo->grabbed
&& dpyinfo->last_mouse_frame
on DPYINFO using saved frame and mouse position. */
void
-x_redo_mouse_highlight (Display_Info *dpyinfo)
+gui_redo_mouse_highlight (Display_Info *dpyinfo)
{
if (dpyinfo->last_mouse_motion_frame
&& FRAME_LIVE_P (dpyinfo->last_mouse_motion_frame))
}
}
-/* Get specified attribute from resource database RDB.
+/* Get a GUI resource, like Fx_get_resource, but for display DPYINFO.
See Fx_get_resource below for other parameters. */
-static Lisp_Object
-xrdb_get_resource (XrmDatabase rdb, Lisp_Object attribute, Lisp_Object class, Lisp_Object component, Lisp_Object subclass)
+Lisp_Object
+gui_display_get_resource (Display_Info *dpyinfo, Lisp_Object attribute,
+ Lisp_Object class, Lisp_Object component,
+ Lisp_Object subclass)
{
CHECK_STRING (attribute);
CHECK_STRING (class);
*nz++ = '.';
lispstpcpy (nz, attribute);
- char *value = x_get_string_resource (rdb, name_key, class_key);
+ const char *value =
+ dpyinfo->terminal->get_string_resource_hook (&dpyinfo->rdb,
+ name_key,
+ class_key);
SAFE_FREE();
if (value && *value)
{
check_window_system (NULL);
- return xrdb_get_resource (check_x_display_info (Qnil)->xrdb,
- attribute, class, component, subclass);
-}
-
-/* Get an X resource, like Fx_get_resource, but for display DPYINFO. */
-
-Lisp_Object
-display_x_get_resource (Display_Info *dpyinfo, Lisp_Object attribute,
- Lisp_Object class, Lisp_Object component,
- Lisp_Object subclass)
-{
- return xrdb_get_resource (dpyinfo->xrdb,
- attribute, class, component, subclass);
+ return gui_display_get_resource (check_x_display_info (Qnil),
+ attribute, class, component, subclass);
}
#if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT && !defined USE_GTK
/* Used when C code wants a resource value. */
/* Called from oldXMenu/Create.c. */
-char *
+const char *
x_get_resource_string (const char *attribute, const char *class)
{
- char *result;
+ const char *result;
struct frame *sf = SELECTED_FRAME ();
ptrdiff_t invocation_namelen = SBYTES (Vinvocation_name);
USE_SAFE_ALLOCA;
esprintf (name_key, "%s.%s", SSDATA (Vinvocation_name), attribute);
sprintf (class_key, "%s.%s", EMACS_CLASS, class);
- result = x_get_string_resource (FRAME_DISPLAY_INFO (sf)->xrdb,
- name_key, class_key);
+ result = gui_display_get_resource (&FRAME_DISPLAY_INFO (sf)->rdb,
+ name_key, class_key);
SAFE_FREE ();
return result;
}
/* Return the value of parameter PARAM.
- First search ALIST, then Vdefault_frame_alist, then the X defaults
- database, using ATTRIBUTE as the attribute name and CLASS as its class.
+ First search ALIST, then Vdefault_frame_alist, then the GUI
+ resource database, using ATTRIBUTE as the attribute name and CLASS
+ as its class.
Convert the resource to the type specified by desired_type.
If no default is specified, return Qunbound. If you call
- x_get_arg, make sure you deal with Qunbound in a reasonable way,
- and don't let it get stored in any Lisp-visible variables! */
+ gui_display_get_arg, make sure you deal with Qunbound in a
+ reasonable way, and don't let it get stored in any Lisp-visible
+ variables! */
Lisp_Object
-x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param,
- const char *attribute, const char *class, enum resource_types type)
+gui_display_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param,
+ const char *attribute, const char *class,
+ enum resource_types type)
{
Lisp_Object tem;
{
AUTO_STRING (at, attribute);
AUTO_STRING (cl, class);
- tem = display_x_get_resource (dpyinfo, at, cl, Qnil, Qnil);
+ tem = gui_display_get_resource (dpyinfo, at, cl, Qnil, Qnil);
if (NILP (tem))
return Qunbound;
}
static Lisp_Object
-x_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param,
- const char *attribute, const char *class,
- enum resource_types type)
+gui_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param,
+ const char *attribute, const char *class,
+ enum resource_types type)
{
- return x_get_arg (FRAME_DISPLAY_INFO (f),
- alist, param, attribute, class, type);
+ return gui_display_get_arg (FRAME_DISPLAY_INFO (f),
+ alist, param, attribute, class, type);
}
-/* Like x_frame_get_arg, but also record the value in f->param_alist. */
+/* Like gui_frame_get_arg, but also record the value in f->param_alist. */
Lisp_Object
-x_frame_get_and_record_arg (struct frame *f, Lisp_Object alist,
- Lisp_Object param,
- const char *attribute, const char *class,
- enum resource_types type)
+gui_frame_get_and_record_arg (struct frame *f, Lisp_Object alist,
+ Lisp_Object param,
+ const char *attribute, const char *class,
+ enum resource_types type)
{
Lisp_Object value;
- value = x_get_arg (FRAME_DISPLAY_INFO (f), alist, param,
- attribute, class, type);
+ value = gui_display_get_arg (FRAME_DISPLAY_INFO (f), alist, param,
+ attribute, class, type);
if (! NILP (value) && ! EQ (value, Qunbound))
store_frame_param (f, param, value);
If that is not found either, use the value DEFLT. */
Lisp_Object
-x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop,
- Lisp_Object deflt, const char *xprop, const char *xclass,
- enum resource_types type)
+gui_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop,
+ Lisp_Object deflt, const char *xprop, const char *xclass,
+ enum resource_types type)
{
Lisp_Object tem;
- tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type);
+ tem = gui_frame_get_arg (f, alist, prop, xprop, xclass, type);
if (EQ (tem, Qunbound))
tem = deflt;
AUTO_FRAME_ARG (arg, prop, tem);
- x_set_frame_parameters (f, arg);
+ gui_set_frame_parameters (f, arg);
return tem;
}
#define DEFAULT_COLS 80
long
-x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p, int *x_width, int *x_height)
+gui_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p,
+ int *x_width, int *x_height)
{
Lisp_Object height, width, user_size, top, left, user_position;
long window_prompting = 0;
override what we specify below. */
f->new_width = f->new_height = 0;
- height = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
- width = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
+ height = gui_display_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
+ width = gui_display_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
if (!EQ (width, Qunbound) || !EQ (height, Qunbound))
{
if (!EQ (width, Qunbound))
}
}
- user_size = x_get_arg (dpyinfo, parms, Quser_size, 0, 0, RES_TYPE_NUMBER);
+ user_size = gui_display_get_arg (dpyinfo, parms, Quser_size, 0, 0,
+ RES_TYPE_NUMBER);
if (!NILP (user_size) && !EQ (user_size, Qunbound))
window_prompting |= USSize;
else
window_prompting |= PSize;
}
- top = x_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER);
- left = x_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER);
- user_position = x_get_arg (dpyinfo, parms, Quser_position, 0, 0, RES_TYPE_NUMBER);
+ top = gui_display_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER);
+ left = gui_display_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER);
+ user_position = gui_display_get_arg (dpyinfo, parms, Quser_position, 0, 0,
+ RES_TYPE_NUMBER);
if (! EQ (top, Qunbound) || ! EQ (left, Qunbound))
{
if (EQ (top, Qminus))
in pixels. */
bool_bf new_pixelwise : 1;
- /* True means x_set_window_size requests can be processed for this
- frame. */
- bool_bf can_x_set_window_size : 1;
+ /* True means set_window_size_hook requests can be processed for
+ this frame. */
+ bool_bf can_set_window_size : 1;
/* Set to true after this frame was made by `make-frame'. */
bool_bf after_make_frame : 1;
#define FRAME_NS_P(f) ((f)->output_method == output_ns)
#endif
-/* FRAME_WINDOW_P tests whether the frame is a window, and is
- defined to be the predicate for the window system being used. */
+/* FRAME_WINDOW_P tests whether the frame is a graphical window system
+ frame. */
#ifdef HAVE_X_WINDOWS
#define FRAME_WINDOW_P(f) FRAME_X_P (f)
/* The class of this X application. */
#define EMACS_CLASS "Emacs"
-extern void x_set_scroll_bar_default_width (struct frame *);
-extern void x_set_scroll_bar_default_height (struct frame *);
-extern void x_set_offset (struct frame *, int, int, int);
-extern void x_wm_set_size_hint (struct frame *f, long flags, bool user_position);
-extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int);
-extern void x_set_frame_parameters (struct frame *, Lisp_Object);
-extern void x_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_screen_gamma (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_font (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_font_backend (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_left_fringe (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_right_fringe (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_border_width (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_right_divider_width (struct frame *, Lisp_Object,
- Lisp_Object);
-extern void x_set_bottom_divider_width (struct frame *, Lisp_Object,
- Lisp_Object);
-extern void x_set_visibility (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_autoraise (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_autolower (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_unsplittable (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_vertical_scroll_bars (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_horizontal_scroll_bars (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_scroll_bar_width (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_scroll_bar_height (struct frame *, Lisp_Object, Lisp_Object);
-
-extern long x_figure_window_size (struct frame *, Lisp_Object, bool, int *, int *);
-
-extern void x_set_alpha (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_no_special_glyphs (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_frame_parameters (struct frame *, Lisp_Object);
+extern void gui_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_screen_gamma (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_font (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_font_backend (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_left_fringe (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_right_fringe (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_border_width (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_right_divider_width (struct frame *, Lisp_Object,
+ Lisp_Object);
+extern void gui_set_bottom_divider_width (struct frame *, Lisp_Object,
+ Lisp_Object);
+extern void gui_set_visibility (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_autoraise (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_autolower (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_unsplittable (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_vertical_scroll_bars (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_horizontal_scroll_bars (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_scroll_bar_width (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_scroll_bar_height (struct frame *, Lisp_Object, Lisp_Object);
+
+extern long gui_figure_window_size (struct frame *, Lisp_Object, bool, int *, int *);
+
+extern void gui_set_alpha (struct frame *, Lisp_Object, Lisp_Object);
+extern void gui_set_no_special_glyphs (struct frame *, Lisp_Object, Lisp_Object);
extern void validate_x_resource_name (void);
-extern Lisp_Object display_x_get_resource (Display_Info *,
- Lisp_Object attribute,
- Lisp_Object class,
- Lisp_Object component,
- Lisp_Object subclass);
+extern Lisp_Object gui_display_get_resource (Display_Info *,
+ Lisp_Object attribute,
+ Lisp_Object class,
+ Lisp_Object component,
+ Lisp_Object subclass);
extern void set_frame_menubar (struct frame *f, bool first_time, bool deep_p);
-extern void x_set_window_size (struct frame *f, bool change_gravity,
- int width, int height, bool pixelwise);
-extern Lisp_Object x_get_focus_frame (struct frame *);
extern void frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
-extern void x_make_frame_visible (struct frame *f);
-extern void x_make_frame_invisible (struct frame *f);
-extern void x_iconify_frame (struct frame *f);
-extern void x_set_frame_alpha (struct frame *f);
-extern void x_activate_menubar (struct frame *);
-extern void x_real_positions (struct frame *, int *, int *);
extern void free_frame_menubar (struct frame *);
-extern void x_free_frame_resources (struct frame *);
extern bool frame_ancestor_p (struct frame *af, struct frame *df);
extern enum internal_border_part frame_internal_border_part (struct frame *f, int x, int y);
extern void x_sync (struct frame *);
#endif /* HAVE_X_WINDOWS */
-extern void x_query_colors (struct frame *f, XColor *, int);
-extern void x_focus_frame (struct frame *, bool);
-
#ifndef HAVE_NS
-extern bool x_bitmap_icon (struct frame *, Lisp_Object);
-
/* Set F's bitmap icon, if specified among F's parameters. */
INLINE void
-x_set_bitmap_icon (struct frame *f)
+gui_set_bitmap_icon (struct frame *f)
{
Lisp_Object obj = assq_no_quit (Qicon_type, f->param_alist);
if (CONSP (obj) && !NILP (XCDR (obj)))
- x_bitmap_icon (f, XCDR (obj));
+ FRAME_TERMINAL (f)->set_bitmap_icon_hook (f, XCDR (obj));
}
#endif /* !HAVE_NS */
In that case, use the pixmap already loaded. */
if (STRINGP (specified_file)
- && STRINGP (file = x_find_image_file (specified_file)))
+ && STRINGP (file = image_find_image_file (specified_file)))
{
char *encoded_file = SSDATA (ENCODE_FILE (file));
if (! old_widget)
|| pixelwidth != FRAME_PIXEL_WIDTH (f)
|| pixelheight != FRAME_PIXEL_HEIGHT (f))
{
- x_clear_under_internal_border (f);
+ FRAME_RIF (f)->clear_under_internal_border (f);
change_frame_size (f, width, height, 0, 1, 0, 1);
SET_FRAME_GARBAGED (f);
cancel_mouse_face (f);
&gwidth, &gheight);
/* Do this before resize, as we don't know yet if we will be resized. */
- x_clear_under_internal_border (f);
+ FRAME_RIF (f)->clear_under_internal_border (f);
totalheight /= xg_get_scale (f);
totalwidth /= xg_get_scale (f);
/* Try to restore fullscreen state. */
{
store_frame_param (f, Qfullscreen, fullscreen);
- x_set_fullscreen (f, fullscreen, fullscreen);
+ gui_set_fullscreen (f, fullscreen, fullscreen);
}
}
else
&& FRAME_X_P (f)
&& FRAME_X_DISPLAY (f) == dpy)
{
- x_set_scroll_bar_default_width (f);
- x_set_scroll_bar_default_height (f);
+ FRAME_TERMINAL (f)->set_scroll_bar_default_width_hook (f);
+ FRAME_TERMINAL (f)->set_scroll_bar_default_height_hook (f);
xg_frame_set_char_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f));
}
}
/* Return focus to the frame after we have clicked on a detached
tool bar button. */
- x_focus_frame (f, false);
+ FRAME_TERMINAL (f)->focus_frame_hook (f, false);
}
static GtkWidget *
# define COLOR_TABLE_SUPPORT 1
#endif
-static void x_disable_image (struct frame *, struct image *);
-static void x_edge_detection (struct frame *, struct image *, Lisp_Object,
- Lisp_Object);
+static void image_disable_image (struct frame *, struct image *);
+static void image_edge_detection (struct frame *, struct image *, Lisp_Object,
+ Lisp_Object);
static void init_color_table (void);
static unsigned long lookup_rgb_color (struct frame *f, int r, int g, int b);
Bitmap indices are guaranteed to be > 0, so a negative number can
be used to indicate no bitmap.
- If you use x_create_bitmap_from_data, then you must keep track of
- the bitmaps yourself. That is, creating a bitmap from the same
+ If you use image_create_bitmap_from_data, then you must keep track
+ of the bitmaps yourself. That is, creating a bitmap from the same
data more than once will not be caught. */
#ifdef HAVE_NS
#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI)
ptrdiff_t
-x_bitmap_pixmap (struct frame *f, ptrdiff_t id)
+image_bitmap_pixmap (struct frame *f, ptrdiff_t id)
{
/* HAVE_NTGUI needs the explicit cast here. */
return (ptrdiff_t) FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap;
/* Allocate a new bitmap record. Returns index of new record. */
static ptrdiff_t
-x_allocate_bitmap_record (struct frame *f)
+image_allocate_bitmap_record (struct frame *f)
{
Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
ptrdiff_t i;
/* Add one reference to the reference count of the bitmap with id ID. */
void
-x_reference_bitmap (struct frame *f, ptrdiff_t id)
+image_reference_bitmap (struct frame *f, ptrdiff_t id)
{
++FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].refcount;
}
/* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */
ptrdiff_t
-x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsigned int height)
+image_create_bitmap_from_data (struct frame *f, char *bits,
+ unsigned int width, unsigned int height)
{
Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
ptrdiff_t id;
return -1;
#endif
- id = x_allocate_bitmap_record (f);
+ id = image_allocate_bitmap_record (f);
#ifdef HAVE_NS
dpyinfo->bitmaps[id - 1].img = bitmap;
/* Create bitmap from file FILE for frame F. */
ptrdiff_t
-x_create_bitmap_from_file (struct frame *f, Lisp_Object file)
+image_create_bitmap_from_file (struct frame *f, Lisp_Object file)
{
#ifdef HAVE_NTGUI
return -1; /* W32_TODO : bitmap support */
return -1;
- id = x_allocate_bitmap_record (f);
+ id = image_allocate_bitmap_record (f);
dpyinfo->bitmaps[id - 1].img = bitmap;
dpyinfo->bitmaps[id - 1].refcount = 1;
dpyinfo->bitmaps[id - 1].file = xlispstrdup (file);
if (result != BitmapSuccess)
return -1;
- id = x_allocate_bitmap_record (f);
+ id = image_allocate_bitmap_record (f);
dpyinfo->bitmaps[id - 1].pixmap = bitmap;
dpyinfo->bitmaps[id - 1].have_mask = false;
dpyinfo->bitmaps[id - 1].refcount = 1;
/* Remove reference to bitmap with id number ID. */
void
-x_destroy_bitmap (struct frame *f, ptrdiff_t id)
+image_destroy_bitmap (struct frame *f, ptrdiff_t id)
{
Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
/* Free all the bitmaps for the display specified by DPYINFO. */
void
-x_destroy_all_bitmaps (Display_Info *dpyinfo)
+image_destroy_all_bitmaps (Display_Info *dpyinfo)
{
ptrdiff_t i;
Bitmap_Record *bm = dpyinfo->bitmaps;
}
#ifndef HAVE_XRENDER
-/* Required for the definition of x_create_x_image_and_pixmap below. */
+/* Required for the definition of image_create_x_image_and_pixmap_1 below. */
typedef void Picture;
#endif
-static bool x_create_x_image_and_pixmap (struct frame *, int, int, int,
- XImagePtr *, Pixmap *, Picture *);
-static void x_destroy_x_image (XImagePtr ximg);
+static bool image_create_x_image_and_pixmap_1 (struct frame *, int, int, int,
+ XImagePtr *, Pixmap *, Picture *);
+static void image_destroy_x_image (XImagePtr ximg);
#ifdef HAVE_NTGUI
static XImagePtr_or_DC image_get_x_image_or_dc (struct frame *, struct image *,
if (!(id > 0))
return;
- pixmap = x_bitmap_pixmap (f, id);
+ pixmap = image_bitmap_pixmap (f, id);
width = x_bitmap_width (f, id);
height = x_bitmap_height (f, id);
return;
}
- result = x_create_x_image_and_pixmap (f, width, height, 1,
- &mask_img, &mask, NULL);
+ result = image_create_x_image_and_pixmap_1 (f, width, height, 1,
+ &mask_img, &mask, NULL);
unblock_input ();
if (!result)
dpyinfo->bitmaps[id - 1].mask = mask;
XDestroyImage (ximg);
- x_destroy_x_image (mask_img);
+ image_destroy_x_image (mask_img);
}
#endif /* HAVE_X_WINDOWS */
/* Forward function prototypes. */
static struct image_type *lookup_image_type (Lisp_Object);
-static void x_laplace (struct frame *, struct image *);
-static void x_emboss (struct frame *, struct image *);
-static void x_build_heuristic_mask (struct frame *, struct image *,
+static void image_laplace (struct frame *, struct image *);
+static void image_emboss (struct frame *, struct image *);
+static void image_build_heuristic_mask (struct frame *, struct image *,
Lisp_Object);
#ifdef WINDOWSNT
#define CACHE_IMAGE_TYPE(type, status) \
/* Store F's background color into *BGCOLOR. */
static void
-x_query_frame_background_color (struct frame *f, XColor *bgcolor)
+image_query_frame_background_color (struct frame *f, XColor *bgcolor)
{
#ifndef HAVE_NS
bgcolor->pixel = FRAME_BACKGROUND_PIXEL (f);
#define CLEAR_IMAGE_COLORS (1 << 2)
static void
-x_clear_image_1 (struct frame *f, struct image *img, int flags)
+image_clear_image_1 (struct frame *f, struct image *img, int flags)
{
if (flags & CLEAR_IMAGE_PIXMAP)
{
#ifdef HAVE_X_WINDOWS
if (img->ximg)
{
- x_destroy_x_image (img->ximg);
+ image_destroy_x_image (img->ximg);
img->ximg = NULL;
img->background_valid = 0;
}
#ifdef HAVE_X_WINDOWS
if (img->mask_img)
{
- x_destroy_x_image (img->mask_img);
+ image_destroy_x_image (img->mask_img);
img->mask_img = NULL;
img->background_transparent_valid = 0;
}
/* Free X resources of image IMG which is used on frame F. */
static void
-x_clear_image (struct frame *f, struct image *img)
+image_clear_image (struct frame *f, struct image *img)
{
block_input ();
#ifdef USE_CAIRO
if (img->cr_data)
cairo_surface_destroy ((cairo_surface_t *)img->cr_data);
#endif
- x_clear_image_1 (f, img,
+ image_clear_image_1 (f, img,
CLEAR_IMAGE_PIXMAP | CLEAR_IMAGE_MASK | CLEAR_IMAGE_COLORS);
unblock_input ();
}
color. */
static unsigned long
-x_alloc_image_color (struct frame *f, struct image *img, Lisp_Object color_name,
- unsigned long dflt)
+image_alloc_image_color (struct frame *f, struct image *img,
+ Lisp_Object color_name, unsigned long dflt)
{
XColor color;
unsigned long result;
mask = image_spec_value (spec, QCheuristic_mask, NULL);
if (!NILP (mask))
- x_build_heuristic_mask (f, img, mask);
+ image_build_heuristic_mask (f, img, mask);
else
{
bool found_p;
mask = image_spec_value (spec, QCmask, &found_p);
if (EQ (mask, Qheuristic))
- x_build_heuristic_mask (f, img, Qt);
+ image_build_heuristic_mask (f, img, Qt);
else if (CONSP (mask)
&& EQ (XCAR (mask), Qheuristic))
{
if (CONSP (XCDR (mask)))
- x_build_heuristic_mask (f, img, XCAR (XCDR (mask)));
+ image_build_heuristic_mask (f, img, XCAR (XCDR (mask)));
else
- x_build_heuristic_mask (f, img, XCDR (mask));
+ image_build_heuristic_mask (f, img, XCDR (mask));
}
else if (NILP (mask) && found_p && img->mask)
- x_clear_image_1 (f, img, CLEAR_IMAGE_MASK);
+ image_clear_image_1 (f, img, CLEAR_IMAGE_MASK);
}
/* Should we apply an image transformation algorithm? */
conversion = image_spec_value (spec, QCconversion, NULL);
if (EQ (conversion, Qdisabled))
- x_disable_image (f, img);
+ image_disable_image (f, img);
else if (EQ (conversion, Qlaplace))
- x_laplace (f, img);
+ image_laplace (f, img);
else if (EQ (conversion, Qemboss))
- x_emboss (f, img);
+ image_emboss (f, img);
else if (CONSP (conversion)
&& EQ (XCAR (conversion), Qedge_detection))
{
Lisp_Object tem;
tem = XCDR (conversion);
if (CONSP (tem))
- x_edge_detection (f, img,
- Fplist_get (tem, QCmatrix),
- Fplist_get (tem, QCcolor_adjustment));
+ image_edge_detection (f, img,
+ Fplist_get (tem, QCmatrix),
+ Fplist_get (tem, QCcolor_adjustment));
}
}
}
#endif /* HAVE_IMAGEMAGICK || HAVE_NATIVE_SCALING */
static void
-x_set_image_size (struct frame *f, struct image *img)
+image_set_image_size (struct frame *f, struct image *img)
{
#ifdef HAVE_NATIVE_SCALING
# ifdef HAVE_IMAGEMAGICK
`:background COLOR'. */
Lisp_Object ascent, margin, relief, bg;
int relief_bound;
- x_set_image_size (f, img);
+ image_set_image_size (f, img);
ascent = image_spec_value (spec, QCascent, NULL);
if (FIXNUMP (ascent))
if (!NILP (bg))
{
img->background
- = x_alloc_image_color (f, img, bg,
- FRAME_BACKGROUND_PIXEL (f));
+ = image_alloc_image_color (f, img, bg,
+ FRAME_BACKGROUND_PIXEL (f));
img->background_valid = 1;
}
}
WIDTH and HEIGHT must both be positive.
If XIMG is null, assume it is a bitmap. */
static bool
-x_check_image_size (XImagePtr ximg, int width, int height)
+image_check_image_size (XImagePtr ximg, int width, int height)
{
#ifdef HAVE_X_WINDOWS
/* Respect Xlib's limits: it cannot deal with images that have more
should indicate the bit depth of the image. */
static bool
-x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth,
- XImagePtr *ximg, Pixmap *pixmap, Picture *picture)
+image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int depth,
+ XImagePtr *ximg, Pixmap *pixmap, Picture *picture)
{
#ifdef HAVE_X_WINDOWS
Display *display = FRAME_X_DISPLAY (f);
return 0;
}
- if (! x_check_image_size (*ximg, width, height))
+ if (! image_check_image_size (*ximg, width, height))
{
- x_destroy_x_image (*ximg);
+ image_destroy_x_image (*ximg);
*ximg = NULL;
image_error ("Image too large (%dx%d)",
make_fixnum (width), make_fixnum (height));
*pixmap = XCreatePixmap (display, drawable, width, height, depth);
if (*pixmap == NO_PIXMAP)
{
- x_destroy_x_image (*ximg);
+ image_destroy_x_image (*ximg);
*ximg = NULL;
image_error ("Unable to create X pixmap");
return 0;
/* All system errors are < 10000, so the following is safe. */
XSETINT (errcode, err);
image_error ("Unable to create bitmap, error code %d", errcode);
- x_destroy_x_image (*ximg);
+ image_destroy_x_image (*ximg);
*ximg = NULL;
return 0;
}
/* Destroy XImage XIMG. Free XIMG->data. */
static void
-x_destroy_x_image (XImagePtr ximg)
+image_destroy_x_image (XImagePtr ximg)
{
eassert (input_blocked_p ());
if (ximg)
are width and height of both the image and pixmap. */
static void
-x_put_x_image (struct frame *f, XImagePtr ximg, Pixmap pixmap, int width, int height)
+gui_put_x_image (struct frame *f, XImagePtr ximg, Pixmap pixmap,
+ int width, int height)
{
#ifdef HAVE_X_WINDOWS
GC gc;
#endif
}
-/* Thin wrapper for x_create_x_image_and_pixmap, so that it matches
+/* Thin wrapper for image_create_x_image_and_pixmap_1, so that it matches
with image_put_x_image. */
static bool
#ifdef HAVE_XRENDER
picture = !mask_p ? &img->picture : &img->mask_picture;
#endif
- return x_create_x_image_and_pixmap (f, width, height, depth, ximg,
- !mask_p ? &img->pixmap : &img->mask,
- picture);
+ return image_create_x_image_and_pixmap_1 (f, width, height, depth, ximg,
+ !mask_p ? &img->pixmap : &img->mask,
+ picture);
}
/* Put X image XIMG into image IMG on frame F, as a mask if and only
img->mask_img = ximg;
}
#else
- x_put_x_image (f, ximg, !mask_p ? img->pixmap : img->mask,
- img->width, img->height);
- x_destroy_x_image (ximg);
+ gui_put_x_image (f, ximg, !mask_p ? img->pixmap : img->mask,
+ img->width, img->height);
+ image_destroy_x_image (ximg);
#endif
}
{
if (img->ximg)
{
- x_put_x_image (f, img->ximg, img->pixmap, img->width, img->height);
- x_destroy_x_image (img->ximg);
+ gui_put_x_image (f, img->ximg, img->pixmap, img->width, img->height);
+ image_destroy_x_image (img->ximg);
img->ximg = NULL;
}
if (img->mask_img)
{
- x_put_x_image (f, img->mask_img, img->mask, img->width, img->height);
- x_destroy_x_image (img->mask_img);
+ gui_put_x_image (f, img->mask_img, img->mask, img->width, img->height);
+ image_destroy_x_image (img->mask_img);
img->mask_img = NULL;
}
}
PFD is null, do not open the file. */
static Lisp_Object
-x_find_image_fd (Lisp_Object file, int *pfd)
+image_find_image_fd (Lisp_Object file, int *pfd)
{
Lisp_Object file_found, search_path;
int fd;
found, or nil if not found. */
Lisp_Object
-x_find_image_file (Lisp_Object file)
+image_find_image_file (Lisp_Object file)
{
- return x_find_image_fd (file, 0);
+ return image_find_image_fd (file, 0);
}
/* Read FILE into memory. Value is a pointer to a buffer allocated
SYMBOL_INDEX (Qxbm),
xbm_image_p,
xbm_load,
- x_clear_image,
+ image_clear_image,
NULL,
NULL
};
#else
img->pixmap =
- (x_check_image_size (0, img->width, img->height)
+ (image_check_image_size (0, img->width, img->height)
? XCreatePixmapFromBitmapData (FRAME_X_DISPLAY (f),
FRAME_X_DRAWABLE (f),
data,
expect ('=');
expect ('{');
- if (! x_check_image_size (0, *width, *height))
+ if (! image_check_image_size (0, *width, *height))
{
if (!inhibit_image_error)
image_error ("Image too large (%dx%d)",
value = image_spec_value (img->spec, QCforeground, NULL);
if (!NILP (value))
{
- foreground = x_alloc_image_color (f, img, value, foreground);
+ foreground = image_alloc_image_color (f, img, value, foreground);
non_default_colors = 1;
}
value = image_spec_value (img->spec, QCbackground, NULL);
if (!NILP (value))
{
- background = x_alloc_image_color (f, img, value, background);
+ background = image_alloc_image_color (f, img, value, background);
img->background = background;
img->background_valid = 1;
non_default_colors = 1;
if (img->pixmap == NO_PIXMAP)
{
- x_clear_image (f, img);
+ image_clear_image (f, img);
image_error ("Unable to create X pixmap for `%s'", img->spec);
}
else
if (STRINGP (file_name))
{
int fd;
- Lisp_Object file = x_find_image_fd (file_name, &fd);
+ Lisp_Object file = image_find_image_fd (file_name, &fd);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", file_name);
if (fmt[XBM_FOREGROUND].count
&& STRINGP (fmt[XBM_FOREGROUND].value))
{
- foreground = x_alloc_image_color (f, img, fmt[XBM_FOREGROUND].value,
- foreground);
+ foreground = image_alloc_image_color (f,
+ img,
+ fmt[XBM_FOREGROUND].value,
+ foreground);
non_default_colors = 1;
}
if (fmt[XBM_BACKGROUND].count
&& STRINGP (fmt[XBM_BACKGROUND].value))
{
- background = x_alloc_image_color (f, img, fmt[XBM_BACKGROUND].value,
- background);
+ background = image_alloc_image_color (f,
+ img,
+ fmt[XBM_BACKGROUND].value,
+ background);
non_default_colors = 1;
}
#endif
/* Create the pixmap. */
- if (x_check_image_size (0, img->width, img->height))
+ if (image_check_image_size (0, img->width, img->height))
Create_Pixmap_From_Bitmap_Data (f, img, bits,
foreground, background,
non_default_colors);
{
image_error ("Unable to create pixmap for XBM image `%s'",
img->spec);
- x_clear_image (f, img);
+ image_clear_image (f, img);
}
SAFE_FREE ();
SYMBOL_INDEX (Qxpm),
xpm_image_p,
xpm_load,
- x_clear_image,
+ image_clear_image,
init_xpm_functions,
NULL
};
return -1;
}
- id = x_allocate_bitmap_record (f);
+ id = image_allocate_bitmap_record (f);
dpyinfo->bitmaps[id - 1].pixmap = bitmap;
dpyinfo->bitmaps[id - 1].have_mask = true;
dpyinfo->bitmaps[id - 1].mask = mask;
if (STRINGP (specified_file))
{
- Lisp_Object file = x_find_image_file (specified_file);
+ Lisp_Object file = image_find_image_file (specified_file);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", specified_file);
else
{
rc = XpmFileInvalid;
- x_clear_image (f, img);
+ image_clear_image (f, img);
}
#else
#ifdef HAVE_X_WINDOWS
img->ximg->depth);
if (img->pixmap == NO_PIXMAP)
{
- x_clear_image (f, img);
+ image_clear_image (f, img);
rc = XpmNoMemory;
}
else if (img->mask_img)
img->mask_img->depth);
if (img->mask == NO_PIXMAP)
{
- x_clear_image (f, img);
+ image_clear_image (f, img);
rc = XpmNoMemory;
}
}
}
else
{
- x_destroy_x_image (mask_img);
- x_clear_image_1 (f, img, CLEAR_IMAGE_MASK);
+ image_destroy_x_image (mask_img);
+ image_clear_image_1 (f, img, CLEAR_IMAGE_MASK);
}
#endif
return 1;
failure:
image_error ("Invalid XPM3 file (%s)", img->spec);
- x_destroy_x_image (ximg);
- x_destroy_x_image (mask_img);
- x_clear_image (f, img);
+ image_destroy_x_image (ximg);
+ image_destroy_x_image (mask_img);
+ image_clear_image (f, img);
return 0;
#undef match
if (STRINGP (file_name))
{
int fd;
- Lisp_Object file = x_find_image_fd (file_name, &fd);
+ Lisp_Object file = image_find_image_fd (file_name, &fd);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", file_name);
#ifdef HAVE_X_WINDOWS
cmap = FRAME_X_COLORMAP (f);
color.pixel = pixel;
- x_query_color (f, &color);
+ x_query_colors (f, &color, 1);
rc = x_alloc_nearest_color (f, cmap, &color);
#else
block_input ();
allocated with xmalloc; it must be freed by the caller. */
static XColor *
-x_to_xcolors (struct frame *f, struct image *img, bool rgb_p)
+image_to_xcolors (struct frame *f, struct image *img, bool rgb_p)
{
int x, y;
XColor *colors, *p;
for (x = 0; x < img->width; ++x, ++p)
p->pixel = GET_PIXEL (ximg, x, y);
if (rgb_p)
- x_query_colors (f, row, img->width);
-
+ {
+ FRAME_TERMINAL (f)->query_colors (f, row, img->width);
+ }
#else
for (x = 0; x < img->width; ++x, ++p)
COLORS will be freed; an existing IMG->pixmap will be freed, too. */
static void
-x_from_xcolors (struct frame *f, struct image *img, XColor *colors)
+image_from_xcolors (struct frame *f, struct image *img, XColor *colors)
{
int x, y;
XImagePtr oimg = NULL;
init_color_table ();
- x_clear_image_1 (f, img, CLEAR_IMAGE_PIXMAP | CLEAR_IMAGE_COLORS);
+ image_clear_image_1 (f, img, CLEAR_IMAGE_PIXMAP | CLEAR_IMAGE_COLORS);
image_create_x_image_and_pixmap (f, img, img->width, img->height, 0,
&oimg, 0);
p = colors;
outgoing image. */
static void
-x_detect_edges (struct frame *f, struct image *img, int *matrix, int color_adjust)
+image_detect_edges (struct frame *f, struct image *img,
+ int *matrix, int color_adjust)
{
- XColor *colors = x_to_xcolors (f, img, 1);
+ XColor *colors = image_to_xcolors (f, img, 1);
XColor *new, *p;
int x, y, i, sum;
ptrdiff_t nbytes;
}
xfree (colors);
- x_from_xcolors (f, img, new);
+ image_from_xcolors (f, img, new);
#undef COLOR
}
on frame F. */
static void
-x_emboss (struct frame *f, struct image *img)
+image_emboss (struct frame *f, struct image *img)
{
- x_detect_edges (f, img, emboss_matrix, 0xffff / 2);
+ image_detect_edges (f, img, emboss_matrix, 0xffff / 2);
}
to draw disabled buttons, for example. */
static void
-x_laplace (struct frame *f, struct image *img)
+image_laplace (struct frame *f, struct image *img)
{
- x_detect_edges (f, img, laplace_matrix, 45000);
+ image_detect_edges (f, img, laplace_matrix, 45000);
}
number. */
static void
-x_edge_detection (struct frame *f, struct image *img, Lisp_Object matrix,
- Lisp_Object color_adjust)
+image_edge_detection (struct frame *f, struct image *img,
+ Lisp_Object matrix, Lisp_Object color_adjust)
{
int i = 0;
int trans[9];
color_adjust = make_fixnum (0xffff / 2);
if (i == 9 && NUMBERP (color_adjust))
- x_detect_edges (f, img, trans, XFLOATINT (color_adjust));
+ image_detect_edges (f, img, trans, XFLOATINT (color_adjust));
}
/* Transform image IMG on frame F so that it looks disabled. */
static void
-x_disable_image (struct frame *f, struct image *img)
+image_disable_image (struct frame *f, struct image *img)
{
Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
#ifdef HAVE_NTGUI
/* Color (or grayscale). Convert to gray, and equalize. Just
drawing such images with a stipple can look very odd, so
we're using this method instead. */
- XColor *colors = x_to_xcolors (f, img, 1);
+ XColor *colors = image_to_xcolors (f, img, 1);
XColor *p, *end;
const int h = 15000;
const int l = 30000;
p->red = p->green = p->blue = i2;
}
- x_from_xcolors (f, img, colors);
+ image_from_xcolors (f, img, colors);
}
/* Draw a cross over the disabled image, if we must or if we
heuristically. */
static void
-x_build_heuristic_mask (struct frame *f, struct image *img, Lisp_Object how)
+image_build_heuristic_mask (struct frame *f, struct image *img,
+ Lisp_Object how)
{
XImagePtr_or_DC ximg;
#ifdef HAVE_NTGUI
unsigned long bg = 0;
if (img->mask)
- x_clear_image_1 (f, img, CLEAR_IMAGE_MASK);
+ image_clear_image_1 (f, img, CLEAR_IMAGE_MASK);
#ifndef HAVE_NTGUI
#ifndef HAVE_NS
#ifdef HAVE_NTGUI
0x00ffffff & /* Filter out palette info. */
#endif /* HAVE_NTGUI */
- x_alloc_image_color (f, img, build_string (color_name), 0));
+ image_alloc_image_color (f, img, build_string (color_name), 0));
use_img_background = 0;
}
}
SelectObject (ximg, img->mask);
image_background_transparent (img, f, ximg);
- /* Was: x_destroy_x_image ((XImagePtr )mask_img); which seems bogus ++kfs */
+ /* Was: image_destroy_x_image ((XImagePtr )mask_img); which seems bogus ++kfs */
xfree (mask_img);
#endif /* HAVE_NTGUI */
SYMBOL_INDEX (Qpbm),
pbm_image_p,
pbm_load,
- x_clear_image,
+ image_clear_image,
NULL,
NULL
};
if (STRINGP (specified_file))
{
int fd;
- Lisp_Object file = x_find_image_fd (specified_file, &fd);
+ Lisp_Object file = image_find_image_fd (specified_file, &fd);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", specified_file);
|| ! x_defined_color (f, SSDATA (fmt[PBM_FOREGROUND].value), &xfg, 0))
{
xfg.pixel = fg;
- x_query_color (f, &xfg);
+ x_query_colors (f, &xfg, 1);
}
fga32 = xcolor_to_argb32 (xfg);
|| ! x_defined_color (f, SSDATA (fmt[PBM_BACKGROUND].value), &xbg, 0))
{
xbg.pixel = bg;
- x_query_color (f, &xbg);
+ x_query_colors (f, &xbg, 1);
}
bga32 = xcolor_to_argb32 (xbg);
#else
if (fmt[PBM_FOREGROUND].count
&& STRINGP (fmt[PBM_FOREGROUND].value))
- fg = x_alloc_image_color (f, img, fmt[PBM_FOREGROUND].value, fg);
+ fg = image_alloc_image_color (f, img, fmt[PBM_FOREGROUND].value, fg);
if (fmt[PBM_BACKGROUND].count
&& STRINGP (fmt[PBM_BACKGROUND].value))
{
- bg = x_alloc_image_color (f, img, fmt[PBM_BACKGROUND].value, bg);
+ bg = image_alloc_image_color (f, img, fmt[PBM_BACKGROUND].value, bg);
img->background = bg;
img->background_valid = 1;
}
#ifdef USE_CAIRO
cairo_surface_destroy (surface);
#else
- x_destroy_x_image (ximg);
+ image_destroy_x_image (ximg);
#endif
- x_clear_image (f, img);
+ image_clear_image (f, img);
image_error ("Invalid image size in image `%s'",
img->spec);
goto error;
#ifdef USE_CAIRO
cairo_surface_destroy (surface);
#else
- x_destroy_x_image (ximg);
+ image_destroy_x_image (ximg);
#endif
- x_clear_image (f, img);
+ image_clear_image (f, img);
image_error ("Invalid image size in image `%s'", img->spec);
goto error;
}
#ifdef USE_CAIRO
cairo_surface_destroy (surface);
#else
- x_destroy_x_image (ximg);
+ image_destroy_x_image (ximg);
#endif
image_error ("Invalid pixel value in image `%s'", img->spec);
goto error;
SYMBOL_INDEX (Qpng),
png_image_p,
png_load,
- x_clear_image,
+ image_clear_image,
init_png_functions,
NULL
};
if (NILP (specified_data))
{
int fd;
- Lisp_Object file = x_find_image_fd (specified_file, &fd);
+ Lisp_Object file = image_find_image_fd (specified_file, &fd);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", specified_file);
color set by the image. */
if (STRINGP (specified_bg)
? x_defined_color (f, SSDATA (specified_bg), &color, false)
- : (x_query_frame_background_color (f, &color), true))
+ : (image_query_frame_background_color (f, &color), true))
/* The user specified `:background', use that. */
{
int shift = bit_depth == 16 ? 0 : 8;
&& !image_create_x_image_and_pixmap (f, img, width, height, 1,
&mask_img, 1))
{
- x_destroy_x_image (ximg);
- x_clear_image_1 (f, img, CLEAR_IMAGE_PIXMAP);
+ image_destroy_x_image (ximg);
+ image_clear_image_1 (f, img, CLEAR_IMAGE_PIXMAP);
goto error;
}
#endif
SYMBOL_INDEX (Qjpeg),
jpeg_image_p,
jpeg_load,
- x_clear_image,
+ image_clear_image,
init_jpeg_functions,
NULL
};
if (NILP (specified_data))
{
int fd;
- Lisp_Object file = x_find_image_fd (specified_file, &fd);
+ Lisp_Object file = image_find_image_fd (specified_file, &fd);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", specified_file);
/* If we already have an XImage, free that. */
#ifndef USE_CAIRO
- x_destroy_x_image (ximg);
+ image_destroy_x_image (ximg);
#endif
/* Free pixmap and colors. */
- x_clear_image (f, img);
+ image_clear_image (f, img);
return 0;
}
SYMBOL_INDEX (Qtiff),
tiff_image_p,
tiff_load,
- x_clear_image,
+ image_clear_image,
init_tiff_functions,
NULL
};
if (NILP (specified_data))
{
/* Read from a file */
- Lisp_Object file = x_find_image_file (specified_file);
+ Lisp_Object file = image_find_image_file (specified_file);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", specified_file);
gif_clear_image (struct frame *f, struct image *img)
{
img->lisp_data = Qnil;
- x_clear_image (f, img);
+ image_clear_image (f, img);
}
/* Return true if OBJECT is a valid GIF image specification. */
if (NILP (specified_data))
{
- Lisp_Object file = x_find_image_file (specified_file);
+ Lisp_Object file = image_find_image_file (specified_file);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", specified_file);
#ifndef USE_CAIRO
unsigned long bgcolor UNINIT;
if (STRINGP (specified_bg))
- bgcolor = x_alloc_image_color (f, img, specified_bg,
- FRAME_BACKGROUND_PIXEL (f));
+ bgcolor = image_alloc_image_color (f, img, specified_bg,
+ FRAME_BACKGROUND_PIXEL (f));
#endif
for (j = 0; j <= idx; ++j)
imagemagick_clear_image (struct frame *f,
struct image *img)
{
- x_clear_image (f, img);
+ image_clear_image (f, img);
}
/* Return true if OBJECT is a valid IMAGEMAGICK image specification. Do
specified_bg = image_spec_value (img->spec, QCbackground, NULL);
if (!STRINGP (specified_bg)
|| !x_defined_color (f, SSDATA (specified_bg), &bgcolor, 0))
- x_query_frame_background_color (f, &bgcolor);
+ image_query_frame_background_color (f, &bgcolor);
bg_wand = NewPixelWand ();
PixelSetRed (bg_wand, (double) bgcolor.red / 65535);
free_color_table ();
#endif
#ifndef USE_CAIRO
- x_destroy_x_image (ximg);
+ image_destroy_x_image (ximg);
#endif
image_error ("Imagemagick pixel iterator creation failed");
goto imagemagick_error;
file_name = image_spec_value (img->spec, QCfile, NULL);
if (STRINGP (file_name))
{
- Lisp_Object file = x_find_image_file (file_name);
+ Lisp_Object file = image_find_image_file (file_name);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", file_name);
SYMBOL_INDEX (Qsvg),
svg_image_p,
svg_load,
- x_clear_image,
+ image_clear_image,
init_svg_functions,
NULL
};
if (STRINGP (file_name))
{
int fd;
- Lisp_Object file = x_find_image_fd (file_name, &fd);
+ Lisp_Object file = image_find_image_fd (file_name, &fd);
if (!STRINGP (file))
{
image_error ("Cannot find image file `%s'", file_name);
Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL);
if (!STRINGP (specified_bg)
|| !x_defined_color (f, SSDATA (specified_bg), &background, 0))
- x_query_frame_background_color (f, &background);
+ image_query_frame_background_color (f, &background);
/* SVG pixmaps specify transparency in the last byte, so right
shift 8 bits to get rid of it, since emacs doesn't support
static void
gs_clear_image (struct frame *f, struct image *img)
{
- x_clear_image (f, img);
+ image_clear_image (f, img);
}
/* Create the pixmap. */
eassert (img->pixmap == NO_PIXMAP);
- if (x_check_image_size (0, img->width, img->height))
+ if (image_check_image_size (0, img->width, img->height))
{
/* Only W32 version did BLOCK_INPUT here. ++kfs */
block_input ();
XDestroyImage (ximg);
#if 0 /* This doesn't seem to be the case. If we free the colors
- here, we get a BadAccess later in x_clear_image when
+ here, we get a BadAccess later in image_clear_image when
freeing the colors. */
/* We have allocated colors once, but Ghostscript has also
allocated colors on behalf of us. So, to get the
#ifdef HAVE_EXT_MENU_BAR
case MENU_BAR_ACTIVATE_EVENT:
{
+ struct frame *f;
kbd_fetch_ptr = next_kbd_event (event);
input_pending = readable_events (0);
- if (FRAME_LIVE_P (XFRAME (event->ie.frame_or_window)))
- x_activate_menubar (XFRAME (event->ie.frame_or_window));
+ f = (XFRAME (event->ie.frame_or_window));
+ if (FRAME_LIVE_P (f) && FRAME_TERMINAL (f)->activate_menubar_hook)
+ FRAME_TERMINAL (f)->activate_menubar_hook (f);
}
break;
#endif
#ifdef HAVE_WINDOW_SYSTEM
if (NILP (value))
{
- char *name = x_get_keysym_name (symbol_num);
+ char *name = get_keysym_name (symbol_num);
if (name)
value = intern (name);
}
#ifdef HAVE_WINDOW_SYSTEM
/* Defined in xterm.c, nsterm.m, w32term.c. */
-extern char *x_get_keysym_name (int);
+extern char *get_keysym_name (int);
#endif /* HAVE_WINDOW_SYSTEM */
/* Defined in xml.c. */
#if defined (HAVE_X_WINDOWS) || defined (MSDOS)
extern Lisp_Object x_menu_show (struct frame *, int, int, int,
Lisp_Object, const char **);
+extern void x_activate_menubar (struct frame *);
#endif
#ifdef HAVE_NTGUI
extern Lisp_Object w32_menu_show (struct frame *, int, int, int,
Lisp_Object, const char **);
+extern void w32_activate_menubar (struct frame *);
#endif
#ifdef HAVE_NS
extern Lisp_Object ns_menu_show (struct frame *, int, int, int,
Lisp_Object, const char **);
+extern void ns_activate_menubar (struct frame *);
#endif
extern Lisp_Object tty_menu_show (struct frame *, int, int, int,
Lisp_Object, const char **);
static void
-x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
NSColor *col;
EmacsCGFloat r, g, b, alpha;
static void
-x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
struct face *face;
NSColor *col;
static void
-x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
NSColor *col;
static void
-x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
NSView *view = FRAME_NS_VIEW (f);
- NSTRACE ("x_set_icon_name");
+ NSTRACE ("ns_set_icon_name");
/* See if it's changed. */
if (STRINGP (arg))
specified a name for the frame; the name will override any set by the
redisplay code. */
static void
-x_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
- NSTRACE ("x_explicitly_set_name");
+ NSTRACE ("ns_explicitly_set_name");
ns_set_name (f, arg, 1);
}
name; names set this way will never override names set by the user's
lisp code. */
void
-x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
- NSTRACE ("x_implicitly_set_name");
+ NSTRACE ("ns_implicitly_set_name");
if (ns_use_proxy_icon)
ns_set_represented_filename (f);
If NAME is nil, use the frame name as the title. */
static void
-x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
+ns_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
{
- NSTRACE ("x_set_title");
+ NSTRACE ("ns_set_title");
/* Don't change the title if it's already NAME. */
if (EQ (name, f->title))
return;
static void
-x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
+ns_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int nlines;
if (FRAME_MINIBUF_ONLY_P (f))
/* toolbar support */
static void
-x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
+ns_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
/* Currently, when the tool bar changes state, the frame is resized.
`frame-inhibit-implied-resize'. */
int nlines;
- NSTRACE ("x_set_tool_bar_lines");
+ NSTRACE ("ns_set_tool_bar_lines");
if (FRAME_MINIBUF_ONLY_P (f))
return;
static void
-x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int old_width = FRAME_INTERNAL_BORDER_WIDTH (f);
if (FRAME_INTERNAL_BORDER_WIDTH (f) == old_width)
return;
- if (FRAME_X_WINDOW (f) != 0)
+ if (FRAME_NATIVE_WINDOW (f) != 0)
adjust_frame_size (f, -1, -1, 3, 0, Qinternal_border_width);
SET_FRAME_GARBAGED (f);
static void
-x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
EmacsView *view = FRAME_NS_VIEW (f);
id image = nil;
BOOL setMini = YES;
- NSTRACE ("x_set_icon_type");
+ NSTRACE ("ns_set_icon_type");
if (!NILP (arg) && SYMBOLP (arg))
{
/* This is the same as the xfns.c definition. */
static void
-x_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
set_frame_cursor_types (f, arg);
}
/* called to set mouse pointer color, but all other terms use it to
initialize pointer types (and don't set the color ;) */
static void
-x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
/* Don't think we can do this on Nextstep. */
}
static void
-x_icon (struct frame *f, Lisp_Object parms)
+ns_icon (struct frame *f, Lisp_Object parms)
/* --------------------------------------------------------------------------
Strangely-named function to set icon position parameters in frame.
This is irrelevant under macOS, but might be needed under GNUstep,
f->output_data.ns->icon_left = -1;
/* Set the position of the icon. */
- icon_x = x_get_arg (dpyinfo, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
- icon_y = x_get_arg (dpyinfo, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
+ icon_x = gui_display_get_arg (dpyinfo, parms, Qicon_left, 0, 0,
+ RES_TYPE_NUMBER);
+ icon_y = gui_display_get_arg (dpyinfo, parms, Qicon_top, 0, 0,
+ RES_TYPE_NUMBER);
if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
{
CHECK_FIXNUM (icon_x);
implemented. */
frame_parm_handler ns_frame_parm_handlers[] =
{
- x_set_autoraise, /* generic OK */
- x_set_autolower, /* generic OK */
- x_set_background_color,
+ gui_set_autoraise, /* generic OK */
+ gui_set_autolower, /* generic OK */
+ ns_set_background_color,
0, /* x_set_border_color, may be impossible under Nextstep */
0, /* x_set_border_width, may be impossible under Nextstep */
- x_set_cursor_color,
- x_set_cursor_type,
- x_set_font, /* generic OK */
- x_set_foreground_color,
- x_set_icon_name,
- x_set_icon_type,
- x_set_internal_border_width, /* generic OK */
- x_set_right_divider_width,
- x_set_bottom_divider_width,
- x_set_menu_bar_lines,
- x_set_mouse_color,
- x_explicitly_set_name,
- x_set_scroll_bar_width, /* generic OK */
- x_set_scroll_bar_height, /* generic OK */
- x_set_title,
- x_set_unsplittable, /* generic OK */
- x_set_vertical_scroll_bars, /* generic OK */
- x_set_horizontal_scroll_bars, /* generic OK */
- x_set_visibility, /* generic OK */
- x_set_tool_bar_lines,
+ ns_set_cursor_color,
+ ns_set_cursor_type,
+ gui_set_font, /* generic OK */
+ ns_set_foreground_color,
+ ns_set_icon_name,
+ ns_set_icon_type,
+ ns_set_internal_border_width,
+ gui_set_right_divider_width, /* generic OK */
+ gui_set_bottom_divider_width, /* generic OK */
+ ns_set_menu_bar_lines,
+ ns_set_mouse_color,
+ ns_explicitly_set_name,
+ gui_set_scroll_bar_width, /* generic OK */
+ gui_set_scroll_bar_height, /* generic OK */
+ ns_set_title,
+ gui_set_unsplittable, /* generic OK */
+ gui_set_vertical_scroll_bars, /* generic OK */
+ gui_set_horizontal_scroll_bars, /* generic OK */
+ gui_set_visibility, /* generic OK */
+ ns_set_tool_bar_lines,
0, /* x_set_scroll_bar_foreground, will ignore (not possible on NS) */
0, /* x_set_scroll_bar_background, will ignore (not possible on NS) */
- x_set_screen_gamma, /* generic OK */
- x_set_line_spacing, /* generic OK, sets f->extra_line_spacing to int */
- x_set_left_fringe, /* generic OK */
- x_set_right_fringe, /* generic OK */
+ gui_set_screen_gamma, /* generic OK */
+ gui_set_line_spacing, /* generic OK, sets f->extra_line_spacing to int */
+ gui_set_left_fringe, /* generic OK */
+ gui_set_right_fringe, /* generic OK */
0, /* x_set_wait_for_wm, will ignore */
- x_set_fullscreen, /* generic OK */
- x_set_font_backend, /* generic OK */
- x_set_alpha,
+ gui_set_fullscreen, /* generic OK */
+ gui_set_font_backend, /* generic OK */
+ gui_set_alpha,
0, /* x_set_sticky */
0, /* x_set_tool_bar_position */
0, /* x_set_inhibit_double_buffering */
#ifdef NS_IMPL_COCOA
- x_set_undecorated,
+ ns_set_undecorated,
#else
- 0, /* x_set_undecorated */
+ 0, /* ns_set_undecorated */
#endif
- x_set_parent_frame,
+ ns_set_parent_frame,
0, /* x_set_skip_taskbar */
- x_set_no_focus_on_map,
- x_set_no_accept_focus,
- x_set_z_group, /* x_set_z_group */
+ ns_set_no_focus_on_map,
+ ns_set_no_accept_focus,
+ ns_set_z_group,
0, /* x_set_override_redirect */
- x_set_no_special_glyphs,
+ gui_set_no_special_glyphs,
#ifdef NS_IMPL_COCOA
ns_set_appearance,
ns_set_transparent_titlebar,
private shadow variable, it means we are unwinding a frame
for which we didn't yet call init_frame_faces, where the
refcount is incremented. Therefore, we increment it here, so
- that free_frame_faces, called in x_free_frame_resources
+ that free_frame_faces, called in ns_free_frame_resources
below, will not mistakenly decrement the counter that was not
incremented yet to account for this new frame. */
if (FRAME_IMAGE_CACHE (f) != NULL
&& FRAME_IMAGE_CACHE (f)->refcount == image_cache_refcount)
FRAME_IMAGE_CACHE (f)->refcount++;
- x_free_frame_resources (f);
+ ns_free_frame_resources (f);
free_glyphs (f);
#if defined GLYPH_DEBUG && defined ENABLE_CHECKING
if (NILP (Fassq (r[i].tem, parms)))
{
Lisp_Object value
- = x_get_arg (dpyinfo, parms, r[i].tem, r[i].val, r[i].cls,
- RES_TYPE_NUMBER);
+ = gui_display_get_arg (dpyinfo, parms, r[i].tem, r[i].val, r[i].cls,
+ RES_TYPE_NUMBER);
if (! EQ (value, Qunbound))
parms = Fcons (Fcons (r[i].tem, value), parms);
}
static int desc_ctr = 1;
int x_width = 0, x_height = 0;
- /* x_get_arg modifies parms. */
+ /* gui_display_get_arg modifies parms. */
parms = Fcopy_alist (parms);
/* Use this general default value to start with
until we know if this frame has a specified name. */
Vx_resource_name = Vinvocation_name;
- display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_STRING);
+ display = gui_display_get_arg (dpyinfo, parms, Qterminal, 0, 0,
+ RES_TYPE_STRING);
if (EQ (display, Qunbound))
display = Qnil;
dpyinfo = check_ns_display_info (display);
if (!dpyinfo->terminal->name)
error ("Terminal is not live, can't create new frames on it");
- name = x_get_arg (dpyinfo, parms, Qname, 0, 0, RES_TYPE_STRING);
+ name = gui_display_get_arg (dpyinfo, parms, Qname, 0, 0,
+ RES_TYPE_STRING);
if (!STRINGP (name)
&& ! EQ (name, Qunbound)
&& ! NILP (name))
if (STRINGP (name))
Vx_resource_name = name;
- parent = x_get_arg (dpyinfo, parms, Qparent_id, 0, 0, RES_TYPE_NUMBER);
+ parent = gui_display_get_arg (dpyinfo, parms, Qparent_id, 0, 0,
+ RES_TYPE_NUMBER);
if (EQ (parent, Qunbound))
parent = Qnil;
if (! NILP (parent))
/* No need to protect DISPLAY because that's not used after passing
it to make_frame_without_minibuffer. */
frame = Qnil;
- tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer",
- RES_TYPE_SYMBOL);
+ tem = gui_display_get_arg (dpyinfo, 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))
FRAME_FONTSET (f) = -1;
- fset_icon_name (f, x_get_arg (dpyinfo, parms, Qicon_name,
- "iconName", "Title",
- RES_TYPE_STRING));
+ fset_icon_name (f, gui_display_get_arg (dpyinfo, parms, Qicon_name,
+ "iconName", "Title",
+ RES_TYPE_STRING));
if (! STRINGP (f->icon_name))
fset_icon_name (f, Qnil);
image_cache_refcount =
FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
- x_default_parameter (f, parms, Qfont_backend, Qnil,
- "fontBackend", "FontBackend", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
{
/* use for default font name */
id font = [NSFont userFixedPitchFontOfSize: -1.0]; /* default */
- x_default_parameter (f, parms, Qfontsize,
- make_fixnum (0 /* (int)[font pointSize] */),
- "fontSize", "FontSize", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qfontsize,
+ make_fixnum (0 /* (int)[font pointSize] */),
+ "fontSize", "FontSize", RES_TYPE_NUMBER);
// Remove ' Regular', not handled by backends.
char *fontname = xstrdup ([[font displayName] UTF8String]);
int len = strlen (fontname);
if (len > 8 && strcmp (fontname + len - 8, " Regular") == 0)
fontname[len-8] = '\0';
- x_default_parameter (f, parms, Qfont,
- build_string (fontname),
- "font", "Font", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qfont,
+ build_string (fontname),
+ "font", "Font", RES_TYPE_STRING);
xfree (fontname);
}
unblock_input ();
- x_default_parameter (f, parms, Qborder_width, make_fixnum (0),
- "borderwidth", "BorderWidth", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qinternal_border_width, make_fixnum (2),
- "internalBorderWidth", "InternalBorderWidth",
- RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
+ gui_default_parameter (f, parms, Qborder_width, make_fixnum (0),
+ "borderwidth", "BorderWidth", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (2),
+ "internalBorderWidth", "InternalBorderWidth",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
+ gui_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
NULL, NULL, RES_TYPE_NUMBER);
/* default vertical scrollbars on right on Mac */
#else
= Qright;
#endif
- x_default_parameter (f, parms, Qvertical_scroll_bars, spos,
- "verticalScrollBars", "VerticalScrollBars",
- RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qvertical_scroll_bars, spos,
+ "verticalScrollBars", "VerticalScrollBars",
+ RES_TYPE_SYMBOL);
}
- x_default_parameter (f, parms, Qhorizontal_scroll_bars, Qnil,
- "horizontalScrollBars", "HorizontalScrollBars",
- RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qforeground_color, build_string ("Black"),
- "foreground", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qbackground_color, build_string ("White"),
- "background", "Background", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qline_spacing, Qnil,
- "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qleft_fringe, Qnil,
- "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qright_fringe, Qnil,
- "rightFringe", "RightFringe", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qno_special_glyphs, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qhorizontal_scroll_bars, Qnil,
+ "horizontalScrollBars", "HorizontalScrollBars",
+ RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qforeground_color, build_string ("Black"),
+ "foreground", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qbackground_color, build_string ("White"),
+ "background", "Background", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qline_spacing, Qnil,
+ "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qleft_fringe, Qnil,
+ "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qright_fringe, Qnil,
+ "rightFringe", "RightFringe", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qno_special_glyphs, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
init_frame_faces (f);
/* Read comment about this code in corresponding place in xfns.c. */
- tem = x_get_arg (dpyinfo, parms, Qmin_width, NULL, NULL, RES_TYPE_NUMBER);
+ tem = gui_display_get_arg (dpyinfo, parms, Qmin_width, NULL, NULL,
+ RES_TYPE_NUMBER);
if (FIXNUMP (tem))
store_frame_param (f, Qmin_width, tem);
- tem = x_get_arg (dpyinfo, parms, Qmin_height, NULL, NULL, RES_TYPE_NUMBER);
+ tem = gui_display_get_arg (dpyinfo, parms, Qmin_height, NULL, NULL,
+ RES_TYPE_NUMBER);
if (FIXNUMP (tem))
store_frame_param (f, Qmin_height, tem);
adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 5, 1,
Qx_create_frame_1);
- tem = x_get_arg (dpyinfo, parms, Qundecorated, NULL, NULL, RES_TYPE_BOOLEAN);
+ tem = gui_display_get_arg (dpyinfo, parms, Qundecorated, NULL, NULL,
+ RES_TYPE_BOOLEAN);
FRAME_UNDECORATED (f) = !NILP (tem) && !EQ (tem, Qunbound);
store_frame_param (f, Qundecorated, FRAME_UNDECORATED (f) ? Qt : Qnil);
#ifdef NS_IMPL_COCOA
- tem = x_get_arg (dpyinfo, parms, Qns_appearance, NULL, NULL, RES_TYPE_SYMBOL);
+ tem = gui_display_get_arg (dpyinfo, parms, Qns_appearance, NULL, NULL,
+ RES_TYPE_SYMBOL);
FRAME_NS_APPEARANCE (f) = EQ (tem, Qdark)
? ns_appearance_vibrant_dark : ns_appearance_aqua;
store_frame_param (f, Qns_appearance, tem);
- tem = x_get_arg (dpyinfo, parms, Qns_transparent_titlebar,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ tem = gui_display_get_arg (dpyinfo, parms, Qns_transparent_titlebar,
+ NULL, NULL, RES_TYPE_BOOLEAN);
FRAME_NS_TRANSPARENT_TITLEBAR (f) = !NILP (tem) && !EQ (tem, Qunbound);
store_frame_param (f, Qns_transparent_titlebar, tem);
#endif
- parent_frame = x_get_arg (dpyinfo, parms, Qparent_frame, NULL, NULL,
- RES_TYPE_SYMBOL);
+ parent_frame = gui_display_get_arg (dpyinfo, parms, Qparent_frame, NULL, NULL,
+ RES_TYPE_SYMBOL);
/* Accept parent-frame iff parent-id was not specified. */
if (!NILP (parent)
|| EQ (parent_frame, Qunbound)
fset_parent_frame (f, parent_frame);
store_frame_param (f, Qparent_frame, parent_frame);
- x_default_parameter (f, parms, Qz_group, Qnil, NULL, NULL, RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qno_focus_on_map, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qno_accept_focus, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qz_group, Qnil, NULL, NULL, RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qno_focus_on_map, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qno_accept_focus, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
/* The resources controlling the menu-bar and tool-bar are
processed specially at startup, and reflected in the mode
variables; ignore them here. */
- x_default_parameter (f, parms, Qmenu_bar_lines,
- NILP (Vmenu_bar_mode)
- ? make_fixnum (0) : make_fixnum (1),
- NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qtool_bar_lines,
- NILP (Vtool_bar_mode)
- ? make_fixnum (0) : make_fixnum (1),
- NULL, NULL, RES_TYPE_NUMBER);
-
- x_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate",
- "BufferPredicate", RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title",
- RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qmenu_bar_lines,
+ NILP (Vmenu_bar_mode)
+ ? make_fixnum (0) : make_fixnum (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qtool_bar_lines,
+ NILP (Vtool_bar_mode)
+ ? make_fixnum (0) : make_fixnum (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+
+ gui_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate",
+ "BufferPredicate", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qtitle, Qnil, "title", "Title",
+ RES_TYPE_STRING);
parms = get_geometry_from_preferences (dpyinfo, parms);
- window_prompting = x_figure_window_size (f, parms, true, &x_width, &x_height);
+ window_prompting = gui_figure_window_size (f, parms, true,
+ &x_width, &x_height);
- tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
+ tem = gui_display_get_arg (dpyinfo, parms, Qunsplittable, 0, 0,
+ RES_TYPE_BOOLEAN);
f->no_split = minibuffer_only || (!EQ (tem, Qunbound) && !NILP (tem));
/* NOTE: on other terms, this is done in set_mouse_color, however this
[[EmacsView alloc] initFrameFromEmacs: f];
- x_icon (f, parms);
+ ns_icon (f, parms);
/* ns_display_info does not have a reference_count. */
f->terminal->reference_count++;
won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- x_default_parameter (f, parms, Qicon_type, Qnil,
- "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL);
-
- x_default_parameter (f, parms, Qauto_raise, Qnil,
- "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qauto_lower, Qnil,
- "autoLower", "AutoLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qcursor_type, Qbox,
- "cursorType", "CursorType", RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
- "scrollBarWidth", "ScrollBarWidth",
- RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qscroll_bar_height, Qnil,
- "scrollBarHeight", "ScrollBarHeight",
- RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qalpha, Qnil,
- "alpha", "Alpha", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qfullscreen, Qnil,
- "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
-
- /* Allow x_set_window_size, now. */
- f->can_x_set_window_size = true;
+ gui_default_parameter (f, parms, Qicon_type, Qnil,
+ "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL);
+
+ gui_default_parameter (f, parms, Qauto_raise, Qnil,
+ "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qauto_lower, Qnil,
+ "autoLower", "AutoLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qcursor_type, Qbox,
+ "cursorType", "CursorType", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qscroll_bar_width, Qnil,
+ "scrollBarWidth", "ScrollBarWidth",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qscroll_bar_height, Qnil,
+ "scrollBarHeight", "ScrollBarHeight",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qalpha, Qnil,
+ "alpha", "Alpha", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qfullscreen, Qnil,
+ "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
+
+ /* Allow set_window_size_hook, now. */
+ f->can_set_window_size = true;
if (x_width > 0)
SET_FRAME_WIDTH (f, x_width);
{
Lisp_Object visibility;
- visibility = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
- RES_TYPE_SYMBOL);
+ visibility = gui_display_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
+ RES_TYPE_SYMBOL);
if (EQ (visibility, Qunbound))
visibility = Qt;
if (EQ (visibility, Qicon))
- x_iconify_frame (f);
+ ns_iconify_frame (f);
else if (! NILP (visibility))
{
- x_make_frame_visible (f);
+ ns_make_frame_visible (f);
[[FRAME_NS_VIEW (f) window] makeKeyWindow];
}
else
|| !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
kset_default_minibuffer_frame (kb, frame);
- /* All remaining specified parameters, which have not been "used"
- by x_get_arg and friends, now go in the misc. alist of the frame. */
+ /* All remaining specified parameters, which have not been "used" by
+ gui_display_get_arg and friends, now go in the misc. alist of the
+ frame. */
for (tem = parms; CONSP (tem); tem = XCDR (tem))
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
fset_param_alist (f, Fcons (XCAR (tem), f->param_alist));
if (window_prompting & USPosition)
- x_set_offset (f, f->left_pos, f->top_pos, 1);
+ ns_set_offset (f, f->left_pos, f->top_pos, 1);
/* Make sure windows on this frame appear in calls to next-window
and similar functions. */
return unbind_to (count, frame);
}
-void
-x_focus_frame (struct frame *f, bool noactivate)
-{
- struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
-
- if (dpyinfo->x_focus_frame != f)
- {
- EmacsView *view = FRAME_NS_VIEW (f);
- block_input ();
- [NSApp activateIgnoringOtherApps: YES];
- [[view window] makeKeyAndOrderFront: view];
- unblock_input ();
- }
-}
-
static BOOL
ns_window_is_ancestor (NSWindow *win, NSWindow *candidate)
/* Test whether CANDIDATE is an ancestor window of WIN. */
{
struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
- return make_fixnum (x_display_pixel_height (dpyinfo) / (92.0/25.4));
+ return make_fixnum (ns_display_pixel_height (dpyinfo) / (92.0/25.4));
}
{
struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
- return make_fixnum (x_display_pixel_width (dpyinfo) / (92.0/25.4));
+ return make_fixnum (ns_display_pixel_width (dpyinfo) / (92.0/25.4));
}
void
-x_set_scroll_bar_default_width (struct frame *f)
+ns_set_scroll_bar_default_width (struct frame *f)
{
int wid = FRAME_COLUMN_WIDTH (f);
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = NS_SCROLL_BAR_WIDTH_DEFAULT;
}
void
-x_set_scroll_bar_default_height (struct frame *f)
+ns_set_scroll_bar_default_height (struct frame *f)
{
int height = FRAME_LINE_HEIGHT (f);
FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) = NS_SCROLL_BAR_WIDTH_DEFAULT;
}
/* Terms implement this instead of x-get-resource directly. */
-char *
-x_get_string_resource (XrmDatabase rdb, const char *name, const char *class)
+const char *
+ns_get_string_resource (void *_rdb, const char *name, const char *class)
{
/* remove appname prefix; TODO: allow for !="Emacs" */
const char *res, *toCheck = class + (!strncmp (class, "Emacs.", 6) ? 6 : 0);
return NULL;
res = ns_get_defaults_value (toCheck);
- return (char *) (!res ? NULL
- : !c_strncasecmp (res, "YES", 3) ? "true"
- : !c_strncasecmp (res, "NO", 2) ? "false"
- : res);
-}
-
-
-Lisp_Object
-x_get_focus_frame (struct frame *frame)
-{
- struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
- Lisp_Object nsfocus;
-
- if (!dpyinfo->x_focus_frame)
- return Qnil;
-
- XSETFRAME (nsfocus, dpyinfo->x_focus_frame);
- return nsfocus;
+ return (const char *) (!res ? NULL
+ : !c_strncasecmp (res, "YES", 3) ? "true"
+ : !c_strncasecmp (res, "NO", 2) ? "false"
+ : res);
}
/* ==========================================================================
{
struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
- return make_fixnum (x_display_pixel_width (dpyinfo));
+ return make_fixnum (ns_display_pixel_width (dpyinfo));
}
{
struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
- return make_fixnum (x_display_pixel_height (dpyinfo));
+ return make_fixnum (ns_display_pixel_height (dpyinfo));
}
#ifdef NS_IMPL_COCOA
{
/* Absolute coordinates. */
pt.x = FIXNUMP (left) ? XFIXNUM (left) : XFIXNUM (right);
- pt.y = (x_display_pixel_height (FRAME_DISPLAY_INFO (f))
+ pt.y = (ns_display_pixel_height (FRAME_DISPLAY_INFO (f))
- (FIXNUMP (top) ? XFIXNUM (top) : XFIXNUM (bottom))
- height);
}
else
Fx_hide_tip ();
- t = x_get_arg (NULL, parms, Qbackground_color, NULL, NULL, RES_TYPE_STRING);
+ t = gui_display_get_arg (NULL, parms, Qbackground_color, NULL, NULL,
+ RES_TYPE_STRING);
if (ns_lisp_to_color (t, &color) == 0)
[ns_tooltip setBackgroundColor: color];
- t = x_get_arg (NULL, parms, Qforeground_color, NULL, NULL, RES_TYPE_STRING);
+ t = gui_display_get_arg (NULL, parms, Qforeground_color, NULL, NULL,
+ RES_TYPE_STRING);
if (ns_lisp_to_color (t, &color) == 0)
[ns_tooltip setForegroundColor: color];
typedef int Window;
typedef int Display;
-/* Xism */
-typedef Lisp_Object XrmDatabase;
-
/* Some sort of attempt to normalize rectangle handling. Seems a bit
much for what is accomplished. */
EmacsImage *image;
/* Search bitmap-file-path for the file, if appropriate. */
- found = x_find_image_file (file);
+ found = image_find_image_file (file);
if (!STRINGP (found))
return nil;
found = ENCODE_FILE (found);
}
void
-x_activate_menubar (struct frame *f)
+ns_activate_menubar (struct frame *f)
{
#ifdef NS_IMPL_COCOA
ns_update_menubar (f, true, nil);
Window root_window;
/* Xism */
- XrmDatabase xrdb;
+ Lisp_Object rdb;
/* The cursor to use for vertical scroll bars. */
Cursor vertical_scroll_bar_cursor;
Mouse_HLInfo mouse_highlight;
struct frame *x_highlight_frame;
- struct frame *x_focus_frame;
+ struct frame *ns_focus_frame;
/* The frame where the mouse was last time we reported a mouse event. */
struct frame *last_mouse_frame;
/* This gives the ns_display_info structure for the display F is on. */
#define FRAME_DISPLAY_INFO(f) ((f)->output_data.ns->display_info)
-#define FRAME_X_OUTPUT(f) ((f)->output_data.ns)
+#define FRAME_OUTPUT_DATA(f) ((f)->output_data.ns)
#define FRAME_NS_WINDOW(f) ((f)->output_data.ns->window_desc)
-#define FRAME_X_WINDOW(f) ((f)->output_data.ns->window_desc)
+#define FRAME_NATIVE_WINDOW(f) FRAME_NS_WINDOW (f)
/* This is the `Display *' which frame F is on. */
#define FRAME_NS_DISPLAY(f) (0)
int size, int maxnames);
extern void ns_clear_frame (struct frame *f);
+extern void ns_set_offset (struct frame *f, int xoff, int yoff,
+ int change_grav);
+
extern const char *ns_xlfd_to_fontname (const char *xlfd);
extern Lisp_Object ns_map_event_to_object (void);
XColor *color_def, bool alloc,
bool makeIndex);
extern void
-ns_query_color (void *col, XColor *color_def, int setPixel);
+ns_query_color (void *col, XColor *color_def, bool setPixel);
#ifdef __OBJC__
extern int ns_lisp_to_color (Lisp_Object color, NSColor **col);
extern void ns_check_pending_open_menu (void);
#endif
+/* Implemented in nsfns, published in nsterm. */
+extern void ns_implicitly_set_name (struct frame *f, Lisp_Object arg,
+ Lisp_Object oldval);
+extern void ns_set_scroll_bar_default_width (struct frame *f);
+extern void ns_set_scroll_bar_default_height (struct frame *f);
+extern const char *ns_get_string_resource (void *_rdb,
+ const char *name,
+ const char *class);
+
/* C access to ObjC functionality */
extern void ns_release_object (void *obj);
extern void ns_retain_object (void *obj);
extern Lisp_Object ns_popup_dialog (struct frame *, Lisp_Object header,
Lisp_Object contents);
+extern void ns_free_frame_resources (struct frame *);
+
#define NSAPP_DATA2_RUNASSCRIPT 10
extern void ns_run_ascript (void);
extern void ns_put_pixel (void *img, int x, int y, unsigned long argb);
extern void ns_set_alpha (void *img, int x, int y, unsigned char a);
-extern int x_display_pixel_height (struct ns_display_info *);
-extern int x_display_pixel_width (struct ns_display_info *);
+extern int ns_display_pixel_height (struct ns_display_info *);
+extern int ns_display_pixel_width (struct ns_display_info *);
/* This in nsterm.m */
extern float ns_antialias_threshold;
-extern void x_destroy_window (struct frame *f);
-extern void x_set_undecorated (struct frame *f, Lisp_Object new_value,
- Lisp_Object old_value);
-extern void x_set_parent_frame (struct frame *f, Lisp_Object new_value,
+extern void ns_make_frame_visible (struct frame *f);
+extern void ns_iconify_frame (struct frame *f);
+extern void ns_set_undecorated (struct frame *f, Lisp_Object new_value,
Lisp_Object old_value);
-extern void x_set_no_focus_on_map (struct frame *f, Lisp_Object new_value,
- Lisp_Object old_value);
-extern void x_set_no_accept_focus (struct frame *f, Lisp_Object new_value,
- Lisp_Object old_value);
-extern void x_set_z_group (struct frame *f, Lisp_Object new_value,
- Lisp_Object old_value);
+extern void ns_set_parent_frame (struct frame *f, Lisp_Object new_value,
+ Lisp_Object old_value);
+extern void ns_set_no_focus_on_map (struct frame *f, Lisp_Object new_value,
+ Lisp_Object old_value);
+extern void ns_set_no_accept_focus (struct frame *f, Lisp_Object new_value,
+ Lisp_Object old_value);
+extern void ns_set_z_group (struct frame *f, Lisp_Object new_value,
+ Lisp_Object old_value);
#ifdef NS_IMPL_COCOA
extern void ns_set_appearance (struct frame *f, Lisp_Object new_value,
Lisp_Object old_value);
NSDisableScreenUpdates.
We use these functions to prevent the user seeing a blank frame
- after it has been resized. x_set_window_size disables updates and
+ after it has been resized. ns_set_window_size disables updates and
when redisplay completes unwind_redisplay enables them again
(bug#30699). */
========================================================================== */
+static Lisp_Object
+ns_get_focus_frame (struct frame *f)
+/* --------------------------------------------------------------------------
+ External (hook)
+ -------------------------------------------------------------------------- */
+{
+ Lisp_Object lisp_focus;
+
+ struct frame *focus = FRAME_DISPLAY_INFO (f)->ns_focus_frame;
+
+ if (!focus)
+ return Qnil;
+
+ XSETFRAME (lisp_focus, focus);
+ return lisp_focus;
+}
+
+static void
+ns_focus_frame (struct frame *f, bool noactivate)
+/* --------------------------------------------------------------------------
+ External (hook)
+ -------------------------------------------------------------------------- */
+{
+ struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
+
+ if (dpyinfo->ns_focus_frame != f)
+ {
+ EmacsView *view = FRAME_NS_VIEW (f);
+ block_input ();
+ [NSApp activateIgnoringOtherApps: YES];
+ [[view window] makeKeyAndOrderFront: view];
+ unblock_input ();
+ }
+}
static void
ns_raise_frame (struct frame *f, BOOL make_key)
ns_lower_frame (f);
}
+static void ns_set_frame_alpha (struct frame *f);
static void
ns_frame_rehighlight (struct frame *frame)
struct frame *old_highlight = dpyinfo->x_highlight_frame;
NSTRACE ("ns_frame_rehighlight");
- if (dpyinfo->x_focus_frame)
+ if (dpyinfo->ns_focus_frame)
{
dpyinfo->x_highlight_frame
- = (FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))
- ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))
- : dpyinfo->x_focus_frame);
+ = (FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->ns_focus_frame))
+ ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->ns_focus_frame))
+ : dpyinfo->ns_focus_frame);
if (!FRAME_LIVE_P (dpyinfo->x_highlight_frame))
{
- fset_focus_frame (dpyinfo->x_focus_frame, Qnil);
- dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame;
+ fset_focus_frame (dpyinfo->ns_focus_frame, Qnil);
+ dpyinfo->x_highlight_frame = dpyinfo->ns_focus_frame;
}
}
else
if (old_highlight)
{
gui_update_cursor (old_highlight, 1);
- x_set_frame_alpha (old_highlight);
+ ns_set_frame_alpha (old_highlight);
}
if (dpyinfo->x_highlight_frame)
{
gui_update_cursor (dpyinfo->x_highlight_frame, 1);
- x_set_frame_alpha (dpyinfo->x_highlight_frame);
+ ns_set_frame_alpha (dpyinfo->x_highlight_frame);
}
}
}
void
-x_make_frame_visible (struct frame *f)
+ns_make_frame_visible (struct frame *f)
/* --------------------------------------------------------------------------
External: Show the window (X11 semantics)
-------------------------------------------------------------------------- */
{
- NSTRACE ("x_make_frame_visible");
+ NSTRACE ("ns_make_frame_visible");
/* XXX: at some points in past this was not needed, as the only place that
called this (frame.c:Fraise_frame ()) also called raise_lower;
if this ends up the case again, comment this out again. */
/* If the parent frame moved while the child frame was
invisible, the child frame's position won't have been
updated. Make sure it's in the right place now. */
- x_set_offset(f, f->left_pos, f->top_pos, 0);
+ ns_set_offset(f, f->left_pos, f->top_pos, 0);
}
}
}
-void
-x_make_frame_invisible (struct frame *f)
+static void
+ns_make_frame_invisible (struct frame *f)
/* --------------------------------------------------------------------------
- External: Hide the window (X11 semantics)
+ Hide the window (X11 semantics)
-------------------------------------------------------------------------- */
{
NSView *view;
- NSTRACE ("x_make_frame_invisible");
+ NSTRACE ("ns_make_frame_invisible");
check_window_system (f);
view = FRAME_NS_VIEW (f);
[[view window] orderOut: NSApp];
SET_FRAME_ICONIFIED (f, 0);
}
+static void
+ns_make_frame_visible_invisible (struct frame *f, bool visible)
+/* --------------------------------------------------------------------------
+ External (hook)
+ -------------------------------------------------------------------------- */
+{
+ if (visible)
+ ns_make_frame_visible (f);
+ else
+ ns_make_frame_invisible (f);
+}
void
-x_iconify_frame (struct frame *f)
+ns_iconify_frame (struct frame *f)
/* --------------------------------------------------------------------------
- External: Iconify window
+ External (hook): Iconify window
-------------------------------------------------------------------------- */
{
NSView *view;
struct ns_display_info *dpyinfo;
- NSTRACE ("x_iconify_frame");
+ NSTRACE ("ns_iconify_frame");
check_window_system (f);
view = FRAME_NS_VIEW (f);
dpyinfo = FRAME_DISPLAY_INFO (f);
unblock_input();
}
-/* Free X resources of frame F. */
+/* Free resources of frame F. */
void
-x_free_frame_resources (struct frame *f)
+ns_free_frame_resources (struct frame *f)
{
NSView *view;
struct ns_display_info *dpyinfo;
Mouse_HLInfo *hlinfo;
- NSTRACE ("x_free_frame_resources");
+ NSTRACE ("ns_free_frame_resources");
check_window_system (f);
view = FRAME_NS_VIEW (f);
dpyinfo = FRAME_DISPLAY_INFO (f);
free_frame_menubar (f);
free_frame_faces (f);
- if (f == dpyinfo->x_focus_frame)
- dpyinfo->x_focus_frame = 0;
+ if (f == dpyinfo->ns_focus_frame)
+ dpyinfo->ns_focus_frame = 0;
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
if (f == hlinfo->mouse_face_mouse_frame)
unblock_input ();
}
-void
-x_destroy_window (struct frame *f)
+static void
+ns_destroy_window (struct frame *f)
/* --------------------------------------------------------------------------
External: Delete the window
-------------------------------------------------------------------------- */
{
- NSTRACE ("x_destroy_window");
+ NSTRACE ("ns_destroy_window");
/* If this frame has a parent window, detach it as not doing so can
cause a crash in GNUStep. */
}
check_window_system (f);
- x_free_frame_resources (f);
+ ns_free_frame_resources (f);
ns_window_num--;
}
void
-x_set_offset (struct frame *f, int xoff, int yoff, int change_grav)
+ns_set_offset (struct frame *f, int xoff, int yoff, int change_grav)
/* --------------------------------------------------------------------------
External: Position the window
-------------------------------------------------------------------------- */
NSView *view = FRAME_NS_VIEW (f);
NSScreen *screen = [[view window] screen];
- NSTRACE ("x_set_offset");
+ NSTRACE ("ns_set_offset");
block_input ();
}
-void
-x_set_window_size (struct frame *f,
- bool change_gravity,
- int width,
- int height,
- bool pixelwise)
+static void
+ns_set_window_size (struct frame *f,
+ bool change_gravity,
+ int width,
+ int height,
+ bool pixelwise)
/* --------------------------------------------------------------------------
Adjust window pixel size based on given character grid size
Impl is a bit more complex than other terms, need to do some
int pixelwidth, pixelheight;
int orig_height = wr.size.height;
- NSTRACE ("x_set_window_size");
+ NSTRACE ("ns_set_window_size");
if (view == nil)
return;
#ifdef NS_IMPL_COCOA
void
-x_set_undecorated (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+ns_set_undecorated (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
/* --------------------------------------------------------------------------
Set frame F's `undecorated' parameter. If non-nil, F's window-system
window is drawn without decorations, title, minimize/maximize boxes
EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f);
NSWindow *window = [view window];
- NSTRACE ("x_set_undecorated");
+ NSTRACE ("ns_set_undecorated");
if (!EQ (new_value, old_value))
{
#endif /* NS_IMPL_COCOA */
void
-x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+ns_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
/* --------------------------------------------------------------------------
Set frame F's `parent-frame' parameter. If non-nil, make F a child
frame of the frame specified by that parameter. Technically, this
struct frame *p = NULL;
NSWindow *parent, *child;
- NSTRACE ("x_set_parent_frame");
+ NSTRACE ("ns_set_parent_frame");
if (!NILP (new_value)
&& (!FRAMEP (new_value)
}
void
-x_set_no_focus_on_map (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+ns_set_no_focus_on_map (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
/* Set frame F's `no-focus-on-map' parameter which, if non-nil, means
* that F's window-system window does not want to receive input focus
* when it is mapped. (A frame's window is mapped when the frame is
*
* Some window managers may not honor this parameter. */
{
- NSTRACE ("x_set_no_focus_on_map");
+ NSTRACE ("ns_set_no_focus_on_map");
if (!EQ (new_value, old_value))
{
}
void
-x_set_no_accept_focus (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+ns_set_no_accept_focus (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
/* Set frame F's `no-accept-focus' parameter which, if non-nil, hints
* that F's window-system window does not want to receive input focus
* via mouse clicks or by moving the mouse into it.
*
* Some window managers may not honor this parameter. */
{
- NSTRACE ("x_set_no_accept_focus");
+ NSTRACE ("ns_set_no_accept_focus");
if (!EQ (new_value, old_value))
FRAME_NO_ACCEPT_FOCUS (f) = !NILP (new_value);
}
void
-x_set_z_group (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+ns_set_z_group (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
/* Set frame F's `z-group' parameter. If `above', F's window-system
window is displayed above all windows that do not have the `above'
property set. If nil, F's window is shown below all windows that
EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f);
NSWindow *window = [view window];
- NSTRACE ("x_set_z_group");
+ NSTRACE ("ns_set_z_group");
if (NILP (new_value))
{
}
void
-ns_query_color(void *col, XColor *color_def, int setPixel)
+ns_query_color(void *col, XColor *color_def, bool setPixel)
/* --------------------------------------------------------------------------
Get ARGB values out of NSColor col and put them into color_def.
If setPixel, set the pixel to a concatenated version.
(int)(r*255), (int)(g*255), (int)(b*255));
}
-
bool
ns_defined_color (struct frame *f,
const char *name,
}
-void
-x_set_frame_alpha (struct frame *f)
+static void
+ns_set_frame_alpha (struct frame *f)
/* --------------------------------------------------------------------------
change the entire-frame transparency
-------------------------------------------------------------------------- */
double alpha = 1.0;
double alpha_min = 1.0;
- NSTRACE ("x_set_frame_alpha");
+ NSTRACE ("ns_set_frame_alpha");
if (dpyinfo->x_highlight_frame == f)
alpha = f->alpha[0];
&& FRAME_LIVE_P (dpyinfo->last_mouse_frame))
f = dpyinfo->last_mouse_frame;
else
- f = dpyinfo->x_focus_frame ? dpyinfo->x_focus_frame : SELECTED_FRAME ();
+ f = dpyinfo->ns_focus_frame ? dpyinfo->ns_focus_frame : SELECTED_FRAME ();
if (f && FRAME_NS_P (f))
{
char *
-x_get_keysym_name (int keysym)
+get_keysym_name (int keysym)
/* --------------------------------------------------------------------------
Called by keyboard.c. Not sure if the return val is important, except
that it be unique.
-------------------------------------------------------------------------- */
{
static char value[16];
- NSTRACE ("x_get_keysym_name");
+ NSTRACE ("get_keysym_name");
sprintf (value, "%d", keysym);
return value;
}
========================================================================== */
int
-x_display_pixel_height (struct ns_display_info *dpyinfo)
+ns_display_pixel_height (struct ns_display_info *dpyinfo)
{
NSArray *screens = [NSScreen screens];
NSEnumerator *enumerator = [screens objectEnumerator];
}
int
-x_display_pixel_width (struct ns_display_info *dpyinfo)
+ns_display_pixel_width (struct ns_display_info *dpyinfo)
{
NSArray *screens = [NSScreen screens];
NSEnumerator *enumerator = [screens objectEnumerator];
dpyinfo->color_table = xmalloc (sizeof *dpyinfo->color_table);
dpyinfo->color_table->colors = NULL;
dpyinfo->root_window = 42; /* A placeholder. */
- dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame = NULL;
+ dpyinfo->x_highlight_frame = dpyinfo->ns_focus_frame = NULL;
dpyinfo->n_fonts = 0;
dpyinfo->smallest_font_height = 1;
dpyinfo->smallest_char_width = 1;
ns_draw_glyph_string,
ns_define_frame_cursor,
ns_clear_frame_area,
+ 0, /* clear_under_internal_border */
ns_draw_window_cursor,
ns_draw_vertical_window_border,
ns_draw_window_divider,
block_input ();
- x_destroy_all_bitmaps (dpyinfo);
+ image_destroy_all_bitmaps (dpyinfo);
ns_delete_display (dpyinfo);
unblock_input ();
}
+static Lisp_Object ns_new_font (struct frame *f, Lisp_Object font_object,
+ int fontset);
static struct terminal *
ns_create_terminal (struct ns_display_info *dpyinfo)
terminal->read_socket_hook = ns_read_socket;
terminal->frame_up_to_date_hook = ns_frame_up_to_date;
terminal->mouse_position_hook = ns_mouse_position;
+ terminal->get_focus_frame = ns_get_focus_frame;
+ terminal->focus_frame_hook = ns_focus_frame;
terminal->frame_rehighlight_hook = ns_frame_rehighlight;
terminal->frame_raise_lower_hook = ns_frame_raise_lower;
+ terminal->frame_visible_invisible_hook = ns_make_frame_visible_invisible;
terminal->fullscreen_hook = ns_fullscreen_hook;
+ terminal->iconify_frame_hook = ns_iconify_frame;
+ terminal->set_window_size_hook = ns_set_window_size;
+ terminal->set_frame_offset_hook = ns_set_offset;
+ terminal->set_frame_alpha_hook = ns_set_frame_alpha;
+ terminal->set_new_font_hook = ns_new_font;
+ terminal->implicit_set_name_hook = ns_implicitly_set_name;
terminal->menu_show_hook = ns_menu_show;
+ terminal->activate_menubar_hook = ns_activate_menubar;
terminal->popup_dialog_hook = ns_popup_dialog;
terminal->set_vertical_scroll_bar_hook = ns_set_vertical_scroll_bar;
terminal->set_horizontal_scroll_bar_hook = ns_set_horizontal_scroll_bar;
+ terminal->set_scroll_bar_default_width_hook = ns_set_scroll_bar_default_width;
+ terminal->set_scroll_bar_default_height_hook = ns_set_scroll_bar_default_height;
terminal->condemn_scroll_bars_hook = ns_condemn_scroll_bars;
terminal->redeem_scroll_bar_hook = ns_redeem_scroll_bar;
terminal->judge_scroll_bars_hook = ns_judge_scroll_bars;
- terminal->delete_frame_hook = x_destroy_window;
+ terminal->get_string_resource_hook = ns_get_string_resource;
+ terminal->delete_frame_hook = ns_destroy_window;
terminal->delete_terminal_hook = ns_delete_terminal;
/* Other hooks are NULL by default. */
struct ns_display_info *di;
BOOL has_focus = NO;
for (di = x_display_list; ! has_focus && di; di = di->next)
- has_focus = di->x_focus_frame != 0;
+ has_focus = di->ns_focus_frame != 0;
if (! has_focus)
return;
}
- (void)windowDidBecomeKey /* for direct calls */
{
struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (emacsframe);
- struct frame *old_focus = dpyinfo->x_focus_frame;
+ struct frame *old_focus = dpyinfo->ns_focus_frame;
NSTRACE ("[EmacsView windowDidBecomeKey]");
if (emacsframe != old_focus)
- dpyinfo->x_focus_frame = emacsframe;
+ dpyinfo->ns_focus_frame = emacsframe;
ns_frame_rehighlight (emacsframe);
/* cf. x_detect_focus_change(), x_focus_changed(), x_new_focus_frame() */
{
struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (emacsframe);
- BOOL is_focus_frame = dpyinfo->x_focus_frame == emacsframe;
+ BOOL is_focus_frame = dpyinfo->ns_focus_frame == emacsframe;
NSTRACE ("[EmacsView windowDidResignKey:]");
if (is_focus_frame)
- dpyinfo->x_focus_frame = 0;
+ dpyinfo->ns_focus_frame = 0;
emacsframe->mouse_moved = 0;
ns_frame_rehighlight (emacsframe);
if (!windowClosing && [[self window] isVisible] == YES)
{
gui_update_cursor (emacsframe, 1);
- x_set_frame_alpha (emacsframe);
+ ns_set_frame_alpha (emacsframe);
}
if (any_help_event_p)
/* Called AFTER method below, but before our windowWillResize call there leads
- to windowDidResize -> x_set_window_size. Update emacs' notion of frame
+ to windowDidResize -> ns_set_window_size. Update emacs' notion of frame
location so set_window_size moves the frame. */
- (BOOL)windowShouldZoom: (NSWindow *)sender toFrame: (NSRect)newFrame
{
========================================================================== */
-Lisp_Object
-x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
+static Lisp_Object
+ns_new_font (struct frame *f, Lisp_Object font_object, int fontset)
{
+ /* --------------------------------------------------------------------------
+ External (hook)
+ -------------------------------------------------------------------------- */
struct font *font = XFONT_OBJECT (font_object);
EmacsView *view = FRAME_NS_VIEW (f);
int font_ascent, font_descent;
/* Multi-frame and mouse support hooks. */
+ /* Graphical window systems are expected to define all of the
+ following hooks with the possible exception of:
+
+ * query_colors
+ * activate_menubar_hook
+ * change_tool_bar_height_hook
+ * set_bitmap_icon_hook
+ * buffer_flipping_unblocked_hook
+
+ */
+
+#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI)
+ /* On frame F, translate pixel colors to RGB values for the NCOLORS
+ colors in COLORS. Use cached information, if available. */
+
+ void (*query_colors) (struct frame *f, XColor *colors, int ncolors);
+#endif
/* Return the current position of the mouse.
Set *f to the frame the mouse is in, or zero if the mouse is in no
Lisp_Object *y,
Time *);
+ /* This hook is called to get the focus frame. */
+ Lisp_Object (*get_focus_frame) (struct frame *f);
+
+ /* This hook is called to shift frame focus. */
+ void (*focus_frame_hook) (struct frame *f, bool noactivate);
+
/* When a frame's focus redirection is changed, this hook tells the
window system code to re-decide where to put the highlight. Under
X, this means that Emacs lies about where the focus is. */
windows. */
void (*frame_raise_lower_hook) (struct frame *f, bool raise_flag);
+ /* This hook is called to make the frame F visible if VISIBLE is
+ true, or invisible otherwise. */
+ void (*frame_visible_invisible_hook) (struct frame *f, bool visible);
+
/* If the value of the frame parameter changed, this hook is called.
For example, if going from fullscreen to not fullscreen this hook
may do something OS dependent, like extended window manager hints on X11. */
void (*fullscreen_hook) (struct frame *f);
+ /* This hook is called to iconify the frame. */
+ void (*iconify_frame_hook) (struct frame *f);
+
+ /* This hook is called to change the size of frame F's native
+ (underlying) window. If CHANGE_GRAVITY, change to top-left-corner
+ window gravity for this size change and subsequent size changes.
+ Otherwise we leave the window gravity unchanged. */
+ void (*set_window_size_hook) (struct frame *f, bool change_gravity,
+ int width, int height, bool pixelwise);
+
+ /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
+ to really change the position, and 0 when calling from
+ *_make_frame_visible (in that case, XOFF and YOFF are the current
+ position values). It is -1 when calling from gui_set_frame_parameters,
+ which means, do adjust for borders but don't change the gravity. */
+
+ void (*set_frame_offset_hook) (struct frame *f, register int xoff,
+ register int yoff, int change_gravity);
+
+ /* This hook is called to set the frame's transparency. */
+ void (*set_frame_alpha_hook) (struct frame *f);
+
+ /* This hook is called to set a new font for the frame. */
+ Lisp_Object (*set_new_font_hook) (struct frame *f, Lisp_Object font_object,
+ int fontset);
+
+ /* This hook is called to set the GUI window icon of F using FILE. */
+ bool (*set_bitmap_icon_hook) (struct frame *f, Lisp_Object file);
+
+ /* This hook is called to set the name of the GUI window of F by
+ redisplay unless another name was explicitly requested. */
+ void (*implicit_set_name_hook) (struct frame *f, Lisp_Object arg,
+ Lisp_Object oldval);
+
/* This hook is called to display menus. */
Lisp_Object (*menu_show_hook) (struct frame *f, int x, int y, int menuflags,
Lisp_Object title, const char **error_name);
+#ifdef HAVE_EXT_MENU_BAR
+ /* This hook is called to activate the menu bar. */
+ void (*activate_menubar_hook) (struct frame *f);
+#endif
+
/* This hook is called to display popup dialog. */
Lisp_Object (*popup_dialog_hook) (struct frame *f, Lisp_Object header,
Lisp_Object contents);
+ /* This hook is called to change the frame's (internal) tool-bar. */
+ void (*change_tool_bar_height_hook) (struct frame *f, int height);
+
/* Scroll bar hooks. */
/* The representation of scroll bars is determined by the code which
int portion, int whole,
int position);
+ /* Set the default scroll bar width on FRAME. */
+ void (*set_scroll_bar_default_width_hook) (struct frame *frame);
+
+ /* Set the default scroll bar height on FRAME. */
+ void (*set_scroll_bar_default_height_hook) (struct frame *frame);
/* The following three hooks are used when we're doing a thorough
redisplay of the frame. We don't explicitly know which scroll bars
while it runs. */
void (*buffer_flipping_unblocked_hook) (struct frame *);
+ /* Retrieve the string resource specified by NAME with CLASS from
+ database RDB. */
+ const char * (*get_string_resource_hook) (void *rdb,
+ const char *name,
+ const char *class);
\f
/* Called to delete the device-specific portions of a frame that is
on this terminal device. */
/* stdin, from w32console.c */
extern HANDLE keyboard_handle;
+static struct w32_display_info *w32_display_info_for_name (Lisp_Object);
+
/* Let the user specify a display with a frame.
nil stands for the selected frame--or, if that is not a w32 frame,
the first display on the list. */
return t->display_info.w32;
}
else if (STRINGP (object))
- return x_display_info_for_name (object);
+ return w32_display_info_for_name (object);
else
{
struct frame *f;
It could be the frame's main window or an icon window. */
struct frame *
-x_window_to_frame (struct w32_display_info *dpyinfo, HWND wdesc)
+w32_window_to_frame (struct w32_display_info *dpyinfo, HWND wdesc)
{
Lisp_Object tail, frame;
struct frame *f;
static void my_create_tip_window (struct frame *);
/* TODO: Native Input Method support; see x_create_im. */
-void x_set_foreground_color (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_background_color (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_mouse_color (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_cursor_color (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_border_color (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_icon_type (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_icon_name (struct frame *, Lisp_Object, Lisp_Object);
-void x_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_title (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_set_foreground_color (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_set_background_color (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_set_mouse_color (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_set_border_color (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_set_cursor_color (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_set_icon_type (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_set_icon_name (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
+static void w32_set_title (struct frame *, Lisp_Object, Lisp_Object);
\f
/* Store the screen positions of frame F into XPTR and YPTR.
not Emacs's own window. */
void
-x_real_positions (struct frame *f, int *xptr, int *yptr)
+w32_real_positions (struct frame *f, int *xptr, int *yptr)
{
RECT rect;
ARG says. */
static int
-x_decode_color (struct frame *f, Lisp_Object arg, int def)
+w32_decode_color (struct frame *f, Lisp_Object arg, int def)
{
XColor cdef;
\f
-/* Functions called only from `x_set_frame_param'
+/* Functions called only from `gui_set_frame_parameters'
to set individual parameters.
If FRAME_W32_WINDOW (f) is 0,
In that case, just record the parameter's new value
in the standard place; do not attempt to change the window. */
-void
-x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
struct w32_output *x = f->output_data.w32;
PIX_TYPE fg, old_fg;
- fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
+ fg = w32_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
old_fg = FRAME_FOREGROUND_PIXEL (f);
FRAME_FOREGROUND_PIXEL (f) = fg;
}
}
-void
-x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
FRAME_BACKGROUND_PIXEL (f)
- = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
+ = w32_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
if (FRAME_W32_WINDOW (f) != 0)
{
}
}
-void
-x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
#if 0
Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
if (!EQ (Qnil, arg))
f->output_data.w32->mouse_pixel
- = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
+ = w32_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
mask_color = FRAME_BACKGROUND_PIXEL (f);
/* Don't let pointers be invisible. */
#endif /* TODO */
}
-void
-x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
unsigned long fore_pixel, pixel;
if (!NILP (Vx_cursor_fore_pixel))
- fore_pixel = x_decode_color (f, Vx_cursor_fore_pixel,
+ fore_pixel = w32_decode_color (f, Vx_cursor_fore_pixel,
WHITE_PIX_DEFAULT (f));
else
fore_pixel = FRAME_BACKGROUND_PIXEL (f);
- pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
+ pixel = w32_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
/* Make sure that the cursor color differs from the background color. */
if (pixel == FRAME_BACKGROUND_PIXEL (f))
F has a window. */
static void
-x_set_border_pixel (struct frame *f, int pix)
+w32_set_border_pixel (struct frame *f, int pix)
{
f->output_data.w32->border_pixel = pix;
Note that this does not fully take effect if done before
F has a window; it must be redone when the window is created. */
-void
-x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int pix;
CHECK_STRING (arg);
- pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
- x_set_border_pixel (f, pix);
+ pix = w32_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
+ w32_set_border_pixel (f, pix);
update_face_from_frame_parameter (f, Qborder_color, arg);
}
-void
-x_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
set_frame_cursor_types (f, arg);
}
-void
-x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
bool result;
block_input ();
- result = x_bitmap_icon (f, arg);
+ result = FRAME_TERMINAL (f)->set_bitmap_icon_hook (f, arg);
if (result)
{
unblock_input ();
unblock_input ();
}
-void
-x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
if (STRINGP (arg))
{
}
\f
/**
- * x_clear_under_internal_border:
+ * w32_clear_under_internal_border:
*
* Clear area of frame F's internal border. If the internal border face
* of F has been specified (is not null), fill the area with that face.
*/
void
-x_clear_under_internal_border (struct frame *f)
+w32_clear_under_internal_border (struct frame *f)
{
int border = FRAME_INTERNAL_BORDER_WIDTH (f);
/**
- * x_set_internal_border_width:
+ * w32_set_internal_border_width:
*
* Set width of frame F's internal border to ARG pixels. ARG < 0 is
* treated like ARG = 0.
*/
-void
-x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int border;
{
f->internal_border_width = border;
- if (FRAME_X_WINDOW (f) != 0)
+ if (FRAME_NATIVE_WINDOW (f) != 0)
{
adjust_frame_size (f, -1, -1, 3, false, Qinternal_border_width);
if (FRAME_VISIBLE_P (f))
- x_clear_under_internal_border (f);
+ w32_clear_under_internal_border (f);
}
}
}
/**
- * x_set_menu_bar_lines:
+ * w32_set_menu_bar_lines:
*
* Set number of lines of frame F's menu bar to VALUE. An integer
* greater zero specifies 1 line and turns the menu bar on if it was off
* before. Any other value specifies 0 lines and turns the menu bar off
* if it was on before.
*/
-void
-x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
+static void
+w32_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
/* Right now, menu bars don't work properly in minibuf-only frames;
most of the commands try to apply themselves to the minibuffer
}
if (FRAME_W32_WINDOW (f))
- x_clear_under_internal_border (f);
+ w32_clear_under_internal_border (f);
/* Don't store anything but 1 or 0 in the parameter. */
store_frame_param (f, Qmenu_bar_lines, make_fixnum (new ? 1 : 0));
height. By design, the frame's height doesn't change (but maybe it
should if we don't get enough space otherwise). */
-void
-x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
+static void
+w32_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int nlines;
else
nlines = 0;
- x_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
+ w32_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
}
/* Set the pixel height of the tool bar of frame F to HEIGHT. */
void
-x_change_tool_bar_height (struct frame *f, int height)
+w32_change_tool_bar_height (struct frame *f, int height)
{
int unit = FRAME_LINE_HEIGHT (f);
int old_height = FRAME_TOOL_BAR_HEIGHT (f);
adjust_frame_glyphs (f);
SET_FRAME_GARBAGED (f);
if (FRAME_W32_WINDOW (f))
- x_clear_under_internal_border (f);
+ w32_clear_under_internal_border (f);
}
static void
F->explicit_name is set, ignore the new name; otherwise, set it. */
static void
-x_set_name (struct frame *f, Lisp_Object name, bool explicit)
+w32_set_name (struct frame *f, Lisp_Object name, bool explicit)
{
/* Make sure that requests from lisp code override requests from
Emacs redisplay code. */
/* This function should be called when the user's lisp code has
specified a name for the frame; the name will override any set by the
redisplay code. */
-void
-x_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+static void
+w32_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
- x_set_name (f, arg, true);
+ w32_set_name (f, arg, true);
}
/* This function should be called by Emacs redisplay code to set the
name; names set this way will never override names set by the user's
lisp code. */
void
-x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+w32_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
- x_set_name (f, arg, false);
+ w32_set_name (f, arg, false);
}
\f
/* Change the title of frame F to NAME.
If NAME is nil, use the frame name as the title. */
-void
-x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
+static void
+w32_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
{
/* Don't change the title if it's already NAME. */
if (EQ (name, f->title))
}
void
-x_set_scroll_bar_default_width (struct frame *f)
+w32_set_scroll_bar_default_width (struct frame *f)
{
int unit = FRAME_COLUMN_WIDTH (f);
void
-x_set_scroll_bar_default_height (struct frame *f)
+w32_set_scroll_bar_default_height (struct frame *f)
{
int unit = FRAME_LINE_HEIGHT (f);
}
/**
- * x_set_undecorated:
+ * w32_set_undecorated:
*
* Set frame F's `undecorated' parameter. If non-nil, F's window-system
* window is drawn without decorations, title, minimize/maximize boxes
* Some window managers may not honor this parameter.
*/
static void
-x_set_undecorated (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+w32_set_undecorated (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
HWND hwnd = FRAME_W32_WINDOW (f);
DWORD dwStyle = GetWindowLong (hwnd, GWL_STYLE);
}
/**
- * x_set_parent_frame:
+ * w32_set_parent_frame:
*
* Set frame F's `parent-frame' parameter. If non-nil, make F a child
* frame of the frame specified by that parameter. Technically, this
* Some window managers may not honor this parameter.
*/
static void
-x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+w32_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
struct frame *p = NULL;
}
/**
- * x_set_skip_taskbar:
+ * w32_set_skip_taskbar:
*
* Set frame F's `skip-taskbar' parameter. If non-nil, this should
* remove F's icon from the taskbar associated with the display of F's
* Some window managers may not honor this parameter.
*/
static void
-x_set_skip_taskbar (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+w32_set_skip_taskbar (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (!EQ (new_value, old_value))
{
}
/**
- * x_set_no_focus_on_map:
+ * w32_set_no_focus_on_map:
*
* Set frame F's `no-focus-on-map' parameter which, if non-nil, means
* that F's window-system window does not want to receive input focus
* Some window managers may not honor this parameter.
*/
static void
-x_set_no_focus_on_map (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+w32_set_no_focus_on_map (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (!EQ (new_value, old_value))
FRAME_NO_FOCUS_ON_MAP (f) = !NILP (new_value);
}
/**
- * x_set_no_accept_focus:
+ * w32_set_no_accept_focus:
*
* Set frame F's `no-accept-focus' parameter which, if non-nil, hints
* that F's window-system window does not want to receive input focus
* Some window managers may not honor this parameter.
*/
static void
-x_set_no_accept_focus (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+w32_set_no_accept_focus (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (!EQ (new_value, old_value))
FRAME_NO_ACCEPT_FOCUS (f) = !NILP (new_value);
}
/**
- * x_set_z_group:
+ * w32_set_z_group:
*
* Set frame F's `z-group' parameter. If `above', F's window-system
* window is displayed above all windows that do not have the `above'
* progress.
*/
static void
-x_set_z_group (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+w32_set_z_group (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
HWND hwnd = FRAME_W32_WINDOW (f);
int windows_translate;
int key;
- /* Note that it is okay to call x_window_to_frame, even though we are
+ /* Note that it is okay to call w32_window_to_frame, even though we are
not running in the main lisp thread, because frame deletion
requires the lisp thread to synchronize with this thread. Thus, if
a frame struct is returned, it can be used without concern that the
switch (msg)
{
case WM_ERASEBKGND:
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f)
{
HDC hdc = get_frame_dc (f);
/* ignore our own changes */
if ((HWND)wParam != hwnd)
{
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f)
/* get_frame_dc will realize our palette and force all
frames to be redrawn if needed. */
RECT update_rect;
memset (&update_rect, 0, sizeof (update_rect));
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f == 0)
{
DebPrint (("WM_PAINT received for unknown window %p\n", hwnd));
careful not to move the IME window if the window
described by W was deleted, as indicated by its buffer
field being reset to nil. */
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (!(f && FRAME_LIVE_P (f)))
goto dflt;
w = XWINDOW (FRAME_SELECTED_WINDOW (f));
int button;
/* Ignore middle and extra buttons as long as the menu is active. */
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f && f->output_data.w32->menubar_active)
return 0;
return (msg == WM_XBUTTONDOWN || msg == WM_XBUTTONUP);
case WM_MOUSEMOVE:
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f)
{
/* Ignore mouse movements as long as the menu is active.
{
KillTimer (hwnd, menu_free_timer);
menu_free_timer = 0;
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
/* If a popup menu is active, don't wipe its strings. */
if (menubar_in_use
&& current_popup_menu == NULL)
this (there is no possibility of confusion with real menubar
being active). */
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f
&& (f->output_data.w32->menubar_active
/* We can receive this message even in the absence of a
}
case WM_EXITMENULOOP:
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
/* If a menu is still active, check again after a short delay,
since Windows often (always?) sends the WM_EXITMENULOOP
return 0;
case WM_MEASUREITEM:
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f)
{
MEASUREITEMSTRUCT * pMis = (MEASUREITEMSTRUCT *) lParam;
return 0;
case WM_DRAWITEM:
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f)
{
DRAWITEMSTRUCT * pDis = (DRAWITEMSTRUCT *) lParam;
user to click anywhere without changing point (or worse!).
Don't eat mouse clicks on scrollbars though!! */
- if ((f = x_window_to_frame (dpyinfo, hwnd))
+ if ((f = w32_window_to_frame (dpyinfo, hwnd))
&& FRAME_NO_ACCEPT_FOCUS (f)
/* Ignore child frames, they don't accept focus anyway. */
&& !FRAME_PARENT_FRAME (f))
goto command;
case WM_COMMAND:
menubar_in_use = 0;
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f && HIWORD (wParam) == 0)
{
if (menu_free_timer)
case WM_SETCURSOR:
if (LOWORD (lParam) == HTCLIENT)
{
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f)
{
if (f->output_data.w32->hourglass_p
case WM_EMACS_SETCURSOR:
{
Cursor cursor = (Cursor) wParam;
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f && cursor)
{
f->output_data.w32->current_cursor = cursor;
/* Use menubar_active to indicate that WM_INITMENU is from
TrackPopupMenu below, and should be ignored. */
- f = x_window_to_frame (dpyinfo, hwnd);
+ f = w32_window_to_frame (dpyinfo, hwnd);
if (f)
f->output_data.w32->menubar_active = 1;
Lisp_Object left, top;
struct w32_display_info *dpyinfo = &one_w32_display_info;
- /* When called with RES_TYPE_NUMBER, x_get_arg will return zero for
- anything that is not a number and is not Qunbound. */
- left = x_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER);
- top = x_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER);
+ /* When called with RES_TYPE_NUMBER, gui_display_get_arg will return
+ zero for anything that is not a number and is not Qunbound. */
+ left = gui_display_get_arg (dpyinfo, Qnil, Qleft, "left", "Left",
+ RES_TYPE_NUMBER);
+ top = gui_display_get_arg (dpyinfo, Qnil, Qtop, "top", "Top",
+ RES_TYPE_NUMBER);
if (EQ (left, Qunbound))
coords[0] = CW_USEDEFAULT;
else
validate_x_resource_name ();
- /* x_set_name normally ignores requests to set the name if the
+ /* w32_set_name normally ignores requests to set the name if the
requested name is the same as the current name. This is the one
place where that assumption isn't correct; f->name is set, but
the server hasn't been told. */
f->explicit_name = 0;
name = f->name;
fset_name (f, Qnil);
- x_set_name (f, name, explicit);
+ w32_set_name (f, name, explicit);
}
unblock_input ();
well. */
static void
-x_icon (struct frame *f, Lisp_Object parms)
+w32_icon (struct frame *f, Lisp_Object parms)
{
Lisp_Object icon_x, icon_y;
struct w32_display_info *dpyinfo = &one_w32_display_info;
/* Set the position of the icon. Note that Windows 95 groups all
icons in the tray. */
- icon_x = x_get_arg (dpyinfo, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
- icon_y = x_get_arg (dpyinfo, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
+ icon_x = gui_display_get_arg (dpyinfo, parms, Qicon_left, 0, 0,
+ RES_TYPE_NUMBER);
+ icon_y = gui_display_get_arg (dpyinfo, parms, Qicon_top, 0, 0,
+ RES_TYPE_NUMBER);
if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
{
CHECK_FIXNUM (icon_x);
block_input ();
-#if 0 /* TODO */
- /* Start up iconic or window? */
- x_wm_set_window_state
- (f, (EQ (x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL), Qicon)
- ? IconicState
- : NormalState));
-
- x_text_icon (f, SSDATA ((!NILP (f->icon_name)
- ? f->icon_name
- : f->name)));
-#endif
+ /* TODO: Start up iconic or window? */
unblock_input ();
}
static void
-x_make_gc (struct frame *f)
+w32_make_gc (struct frame *f)
{
XGCValues gc_values;
}
-/* Handler for signals raised during x_create_frame and
- x_create_tip_frame. FRAME is the frame which is partially
+/* Handler for signals raised during Fx_create_frame and
+ w32_create_tip_frame. FRAME is the frame which is partially
constructed. */
static Lisp_Object
private shadow variable, it means we are unwinding a frame
for which we didn't yet call init_frame_faces, where the
refcount is incremented. Therefore, we increment it here, so
- that free_frame_faces, called in x_free_frame_resources
+ that free_frame_faces, called in w32_free_frame_resources
below, will not mistakenly decrement the counter that was not
incremented yet to account for this new frame. */
if (FRAME_IMAGE_CACHE (f) != NULL
FRAME_IMAGE_CACHE (f)->refcount++;
#endif
- x_free_frame_resources (f);
+ w32_free_frame_resources (f);
free_glyphs (f);
#ifdef GLYPH_DEBUG
}
static void
-x_default_font_parameter (struct frame *f, Lisp_Object parms)
+w32_default_font_parameter (struct frame *f, Lisp_Object parms)
{
struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
- Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
- RES_TYPE_STRING);
+ Lisp_Object font_param = gui_display_get_arg (dpyinfo,
+ parms, Qfont, NULL, NULL,
+ RES_TYPE_STRING);
Lisp_Object font;
if (EQ (font_param, Qunbound))
font_param = Qnil;
font = !NILP (font_param) ? font_param
- : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING);
+ : gui_display_get_arg (dpyinfo, parms, Qfont, "font", "Font",
+ RES_TYPE_STRING);
if (!STRINGP (font))
{
{
/* Remember the explicit font parameter, so we can re-apply it after
we've applied the `default' face settings. */
- x_set_frame_parameters (f, Fcons (Fcons (Qfont_parameter, font_param),
- Qnil));
+ gui_set_frame_parameters (f, Fcons (Fcons (Qfont_parameter, font_param),
+ Qnil));
}
- x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
}
DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
until we know if this frame has a specified name. */
Vx_resource_name = Vinvocation_name;
- display = x_get_arg (dpyinfo, parameters, Qterminal, 0, 0, RES_TYPE_NUMBER);
+ display = gui_display_get_arg (dpyinfo, parameters, Qterminal, 0, 0,
+ RES_TYPE_NUMBER);
if (EQ (display, Qunbound))
- display = x_get_arg (dpyinfo, parameters, Qdisplay, 0, 0, RES_TYPE_STRING);
+ display = gui_display_get_arg (dpyinfo, parameters, Qdisplay, 0, 0,
+ RES_TYPE_STRING);
if (EQ (display, Qunbound))
display = Qnil;
dpyinfo = check_x_display_info (display);
if (!dpyinfo->terminal->name)
error ("Terminal is not live, can't create new frames on it");
- name = x_get_arg (dpyinfo, parameters, Qname, "name", "Name", RES_TYPE_STRING);
+ name = gui_display_get_arg (dpyinfo, parameters, Qname, "name", "Name",
+ RES_TYPE_STRING);
if (!STRINGP (name)
&& ! EQ (name, Qunbound)
&& ! NILP (name))
Vx_resource_name = name;
/* See if parent window is specified. */
- parent = x_get_arg (dpyinfo, parameters, Qparent_id, NULL, NULL,
- RES_TYPE_NUMBER);
+ parent = gui_display_get_arg (dpyinfo, parameters, Qparent_id, NULL, NULL,
+ RES_TYPE_NUMBER);
if (EQ (parent, Qunbound))
parent = Qnil;
else if (!NILP (parent))
/* No need to protect DISPLAY because that's not used after passing
it to make_frame_without_minibuffer. */
frame = Qnil;
- tem = x_get_arg (dpyinfo, parameters, Qminibuffer, "minibuffer", "Minibuffer",
- RES_TYPE_SYMBOL);
+ tem = gui_display_get_arg (dpyinfo, parameters, 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))
XSETFRAME (frame, f);
- parent_frame = x_get_arg (dpyinfo, parameters, Qparent_frame, NULL, NULL,
- RES_TYPE_SYMBOL);
+ parent_frame = gui_display_get_arg (dpyinfo, parameters, Qparent_frame,
+ NULL, NULL,
+ RES_TYPE_SYMBOL);
/* Apply `parent-frame' parameter only when no `parent-id' was
specified. */
if (!NILP (parent_frame)
fset_parent_frame (f, parent_frame);
store_frame_param (f, Qparent_frame, parent_frame);
- tem = x_get_arg (dpyinfo, parameters, Qundecorated, NULL, NULL,
- RES_TYPE_BOOLEAN);
+ tem = gui_display_get_arg (dpyinfo, parameters, Qundecorated, NULL, NULL,
+ RES_TYPE_BOOLEAN);
FRAME_UNDECORATED (f) = !NILP (tem) && !EQ (tem, Qunbound);
store_frame_param (f, Qundecorated, FRAME_UNDECORATED (f) ? Qt : Qnil);
- tem = x_get_arg (dpyinfo, parameters, Qskip_taskbar, NULL, NULL,
- RES_TYPE_BOOLEAN);
+ tem = gui_display_get_arg (dpyinfo, parameters, Qskip_taskbar, NULL, NULL,
+ RES_TYPE_BOOLEAN);
FRAME_SKIP_TASKBAR (f) = !NILP (tem) && !EQ (tem, Qunbound);
store_frame_param (f, Qskip_taskbar,
(NILP (tem) || EQ (tem, Qunbound)) ? Qnil : Qt);
f->output_data.w32 = xzalloc (sizeof (struct w32_output));
FRAME_FONTSET (f) = -1;
- fset_icon_name
- (f, x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title",
- RES_TYPE_STRING));
+ fset_icon_name (f, gui_display_get_arg (dpyinfo,
+ parameters,
+ Qicon_name,
+ "iconName",
+ "Title",
+ RES_TYPE_STRING));
if (! STRINGP (f->icon_name))
fset_icon_name (f, Qnil);
register_font_driver (&uniscribe_font_driver, f);
register_font_driver (&w32font_driver, f);
- x_default_parameter (f, parameters, Qfont_backend, Qnil,
- "fontBackend", "FontBackend", RES_TYPE_STRING);
+ gui_default_parameter (f, parameters, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
/* Extract the window parameters from the supplied values
that are needed to determine window geometry. */
- x_default_font_parameter (f, parameters);
+ w32_default_font_parameter (f, parameters);
/* Default BorderWidth to 0 to match other platforms. */
- x_default_parameter (f, parameters, Qborder_width, make_fixnum (0),
- "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qborder_width, make_fixnum (0),
+ "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
/* We recognize either internalBorderWidth or internalBorder
(which is what xterm calls it). */
{
Lisp_Object value;
- value = x_get_arg (dpyinfo, parameters, Qinternal_border_width,
- "internalBorder", "InternalBorder", RES_TYPE_NUMBER);
+ value = gui_display_get_arg (dpyinfo, parameters, Qinternal_border_width,
+ "internalBorder", "InternalBorder",
+ RES_TYPE_NUMBER);
if (! EQ (value, Qunbound))
parameters = Fcons (Fcons (Qinternal_border_width, value),
parameters);
}
- x_default_parameter (f, parameters, Qinternal_border_width, make_fixnum (0),
- "internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qright_divider_width, make_fixnum (0),
- NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qbottom_divider_width, make_fixnum (0),
- NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qvertical_scroll_bars, Qright,
- "verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
- x_default_parameter (f, parameters, Qhorizontal_scroll_bars, Qnil,
- "horizontalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parameters, Qinternal_border_width, make_fixnum (0),
+ "internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qright_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qbottom_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qvertical_scroll_bars, Qright,
+ "verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parameters, Qhorizontal_scroll_bars, Qnil,
+ "horizontalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
/* Also do the stuff which must be set before the window exists. */
- x_default_parameter (f, parameters, Qforeground_color, build_string ("black"),
- "foreground", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qbackground_color, build_string ("white"),
- "background", "Background", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qmouse_color, build_string ("black"),
- "pointerColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qborder_color, build_string ("black"),
- "borderColor", "BorderColor", RES_TYPE_STRING);
- x_default_parameter (f, parameters, Qscreen_gamma, Qnil,
- "screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
- x_default_parameter (f, parameters, Qline_spacing, Qnil,
- "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qleft_fringe, Qnil,
- "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qright_fringe, Qnil,
- "rightFringe", "RightFringe", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qno_focus_on_map, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
- x_default_parameter (f, parameters, Qno_accept_focus, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
- x_default_parameter (f, parameters, Qno_special_glyphs, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parameters, Qforeground_color, build_string ("black"),
+ "foreground", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parameters, Qbackground_color, build_string ("white"),
+ "background", "Background", RES_TYPE_STRING);
+ gui_default_parameter (f, parameters, Qmouse_color, build_string ("black"),
+ "pointerColor", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parameters, Qborder_color, build_string ("black"),
+ "borderColor", "BorderColor", RES_TYPE_STRING);
+ gui_default_parameter (f, parameters, Qscreen_gamma, Qnil,
+ "screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
+ gui_default_parameter (f, parameters, Qline_spacing, Qnil,
+ "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qleft_fringe, Qnil,
+ "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qright_fringe, Qnil,
+ "rightFringe", "RightFringe", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qno_focus_on_map, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parameters, Qno_accept_focus, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parameters, Qno_special_glyphs, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
/* Process alpha here (Bug#16619). On XP this fails with child
frames. For `no-focus-on-map' frames delay processing of alpha
until the frame becomes visible. */
if (!FRAME_NO_FOCUS_ON_MAP (f))
- x_default_parameter (f, parameters, Qalpha, Qnil,
+ gui_default_parameter (f, parameters, Qalpha, Qnil,
"alpha", "Alpha", RES_TYPE_NUMBER);
/* Init faces first since we need the frame's column width/line
init_frame_faces (f);
/* We have to call adjust_frame_size here since otherwise
- x_set_tool_bar_lines will already work with the character sizes
+ w32_set_tool_bar_lines will already work with the character sizes
installed by init_frame_faces while the frame's pixel size is still
calculated from a character size of 1 and we subsequently hit the
(height >= 0) assertion in window_box_height.
Also process `min-width' and `min-height' parameters right here
because `frame-windows-min-size' needs them. */
- tem = x_get_arg (dpyinfo, parameters, Qmin_width, NULL, NULL,
- RES_TYPE_NUMBER);
+ tem = gui_display_get_arg (dpyinfo, parameters, Qmin_width, NULL, NULL,
+ RES_TYPE_NUMBER);
if (FIXNUMP (tem))
store_frame_param (f, Qmin_width, tem);
- tem = x_get_arg (dpyinfo, parameters, Qmin_height, NULL, NULL,
- RES_TYPE_NUMBER);
+ tem = gui_display_get_arg (dpyinfo, parameters, Qmin_height, NULL, NULL,
+ RES_TYPE_NUMBER);
if (FIXNUMP (tem))
store_frame_param (f, Qmin_height, tem);
adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
variables; ignore them here. */
if (NILP (parent_frame))
{
- x_default_parameter (f, parameters, Qmenu_bar_lines,
- NILP (Vmenu_bar_mode)
- ? make_fixnum (0) : make_fixnum (1),
- NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qmenu_bar_lines,
+ NILP (Vmenu_bar_mode)
+ ? make_fixnum (0) : make_fixnum (1),
+ NULL, NULL, RES_TYPE_NUMBER);
}
else
/* No menu bar for child frames. */
store_frame_param (f, Qmenu_bar_lines, make_fixnum (0));
- x_default_parameter (f, parameters, Qtool_bar_lines,
- NILP (Vtool_bar_mode)
- ? make_fixnum (0) : make_fixnum (1),
- NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qtool_bar_lines,
+ NILP (Vtool_bar_mode)
+ ? make_fixnum (0) : make_fixnum (1),
+ NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qbuffer_predicate, Qnil,
- "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
- x_default_parameter (f, parameters, Qtitle, Qnil,
- "title", "Title", RES_TYPE_STRING);
+ gui_default_parameter (f, parameters, Qbuffer_predicate, Qnil,
+ "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parameters, Qtitle, Qnil,
+ "title", "Title", RES_TYPE_STRING);
f->output_data.w32->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
f->output_data.w32->text_cursor = w32_load_cursor (IDC_IBEAM);
f->output_data.w32->current_cursor = f->output_data.w32->nontext_cursor;
- window_prompting = x_figure_window_size (f, parameters, true, &x_width, &x_height);
+ window_prompting = gui_figure_window_size (f, parameters, true,
+ &x_width, &x_height);
- tem = x_get_arg (dpyinfo, parameters, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
+ tem = gui_display_get_arg (dpyinfo, parameters, Qunsplittable, 0, 0,
+ RES_TYPE_BOOLEAN);
f->no_split = minibuffer_only || EQ (tem, Qt);
w32_window (f, window_prompting, minibuffer_only);
- x_icon (f, parameters);
+ w32_icon (f, parameters);
- x_make_gc (f);
+ w32_make_gc (f);
/* Now consider the frame official. */
f->terminal->reference_count++;
/* We need to do this after creating the window, so that the
icon-creation functions can say whose icon they're describing. */
- x_default_parameter (f, parameters, Qicon_type, Qnil,
- "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL);
-
- x_default_parameter (f, parameters, Qauto_raise, Qnil,
- "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parameters, Qauto_lower, Qnil,
- "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parameters, Qcursor_type, Qbox,
- "cursorType", "CursorType", RES_TYPE_SYMBOL);
- x_default_parameter (f, parameters, Qscroll_bar_width, Qnil,
- "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qscroll_bar_height, Qnil,
- "scrollBarHeight", "ScrollBarHeight", RES_TYPE_NUMBER);
-
- /* Allow x_set_window_size, now. */
- f->can_x_set_window_size = true;
+ gui_default_parameter (f, parameters, Qicon_type, Qnil,
+ "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL);
+
+ gui_default_parameter (f, parameters, Qauto_raise, Qnil,
+ "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parameters, Qauto_lower, Qnil,
+ "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parameters, Qcursor_type, Qbox,
+ "cursorType", "CursorType", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parameters, Qscroll_bar_width, Qnil,
+ "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qscroll_bar_height, Qnil,
+ "scrollBarHeight", "ScrollBarHeight", RES_TYPE_NUMBER);
+
+ /* Allow set_window_size_hook, now. */
+ f->can_set_window_size = true;
if (x_width > 0)
SET_FRAME_WIDTH (f, x_width);
badly we want them. This should be done after we have the menu
bar so that its size can be taken into account. */
block_input ();
- x_wm_set_size_hint (f, window_prompting, false);
+ w32_wm_set_size_hint (f, window_prompting, false);
unblock_input ();
adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 0, true,
/* Process fullscreen parameter here in the hope that normalizing a
fullheight/fullwidth frame will produce the size set by the last
adjust_frame_size call. */
- x_default_parameter (f, parameters, Qfullscreen, Qnil,
- "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
- x_default_parameter (f, parameters, Qz_group, Qnil,
- NULL, NULL, RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parameters, Qfullscreen, Qnil,
+ "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parameters, Qz_group, Qnil,
+ NULL, NULL, RES_TYPE_SYMBOL);
/* Make the window appear on the frame and enable display, unless
the caller says not to. However, with explicit parent, Emacs
if (!f->output_data.w32->explicit_parent)
{
Lisp_Object visibility
- = x_get_arg (dpyinfo, parameters, Qvisibility, 0, 0, RES_TYPE_SYMBOL);
+ = gui_display_get_arg (dpyinfo, parameters, Qvisibility, 0, 0,
+ RES_TYPE_SYMBOL);
if (EQ (visibility, Qicon))
- x_iconify_frame (f);
+ w32_iconify_frame (f);
else
{
if (EQ (visibility, Qunbound))
visibility = Qt;
if (!NILP (visibility))
- x_make_frame_visible (f);
+ w32_make_frame_visible (f);
}
store_frame_param (f, Qvisibility, visibility);
/* For `no-focus-on-map' frames set alpha here. */
if (FRAME_NO_FOCUS_ON_MAP (f))
- x_default_parameter (f, parameters, Qalpha, Qnil,
- "alpha", "Alpha", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parameters, Qalpha, Qnil,
+ "alpha", "Alpha", RES_TYPE_NUMBER);
/* Initialize `default-minibuffer-frame' in case this is the first
frame on this terminal. */
|| !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
kset_default_minibuffer_frame (kb, frame);
- /* All remaining specified parameters, which have not been "used"
- by x_get_arg and friends, now go in the misc. alist of the frame. */
+ /* All remaining specified parameters, which have not been "used" by
+ gui_display_get_arg and friends, now go in the misc. alist of the
+ frame. */
for (tem = parameters; CONSP (tem); tem = XCDR (tem))
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
fset_param_alist (f, Fcons (XCAR (tem), f->param_alist));
return unbind_to (count, frame);
}
-/* FRAME is used only to get a handle on the X display. We don't pass the
- display info directly because we're called from frame.c, which doesn't
- know about that structure. */
-Lisp_Object
-x_get_focus_frame (struct frame *frame)
-{
- struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
- Lisp_Object xfocus;
- if (! dpyinfo->w32_focus_frame)
- return Qnil;
-
- XSETFRAME (xfocus, dpyinfo->w32_focus_frame);
- return xfocus;
-}
-
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* SKIP: real doc in xfns.c. */)
(Lisp_Object color, Lisp_Object frame)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
- return make_fixnum (x_display_pixel_width (dpyinfo));
+ return make_fixnum (w32_display_pixel_width (dpyinfo));
}
DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
- return make_fixnum (x_display_pixel_height (dpyinfo));
+ return make_fixnum (w32_display_pixel_height (dpyinfo));
}
DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
/ GetDeviceCaps (hdc, VERTRES));
ReleaseDC (NULL, hdc);
- return make_fixnum (x_display_pixel_height (dpyinfo) * mm_per_pixel + 0.5);
+ return make_fixnum (w32_display_pixel_height (dpyinfo) * mm_per_pixel + 0.5);
}
DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
/ GetDeviceCaps (hdc, HORZRES));
ReleaseDC (NULL, hdc);
- return make_fixnum (x_display_pixel_width (dpyinfo) * mm_per_pixel + 0.5);
+ return make_fixnum (w32_display_pixel_width (dpyinfo) * mm_per_pixel + 0.5);
}
DEFUN ("x-display-backing-store", Fx_display_backing_store,
}
attributes = Fcons (Fcons (Qframes, frames), attributes);
- pixel_width = x_display_pixel_width (dpyinfo);
- pixel_height = x_display_pixel_height (dpyinfo);
+ pixel_width = w32_display_pixel_width (dpyinfo);
+ pixel_height = w32_display_pixel_height (dpyinfo);
hdc = GetDC (NULL);
mm_per_pixel = ((double) GetDeviceCaps (hdc, HORZSIZE)
return sound;
}
-#if 0 /* unused */
-int
-x_screen_planes (register struct frame *f)
-{
- return FRAME_DISPLAY_INFO (f)->n_planes;
-}
-#endif
\f
/* Return the display structure for the display named NAME.
Open a new connection if necessary. */
-struct w32_display_info *
-x_display_info_for_name (Lisp_Object name)
+static struct w32_display_info *
+w32_display_info_for_name (Lisp_Object name)
{
struct w32_display_info *dpyinfo;
error ("Display still has frames on it");
block_input ();
- x_destroy_all_bitmaps (dpyinfo);
+ image_destroy_all_bitmaps (dpyinfo);
- x_delete_display (dpyinfo);
+ w32_delete_display (dpyinfo);
unblock_input ();
return Qnil;
/* Create a frame for a tooltip on the display described by DPYINFO.
PARMS is a list of frame parameters. Value is the frame.
- Note that functions called here, esp. x_default_parameter can
+ Note that functions called here, esp. gui_default_parameter can
signal errors, for instance when a specified color name is
undefined. We have to make sure that we're in a consistent state
when this happens. */
static Lisp_Object
-x_create_tip_frame (struct w32_display_info *dpyinfo, Lisp_Object parms)
+w32_create_tip_frame (struct w32_display_info *dpyinfo, Lisp_Object parms)
{
struct frame *f;
Lisp_Object frame;
kb = dpyinfo->terminal->kboard;
- /* The calls to x_get_arg remove elements from PARMS, so copy it to
- avoid destructive changes behind our caller's back. */
+ /* The calls to gui_display_get_arg remove elements from PARMS, so
+ copy it to avoid destructive changes behind our caller's
+ back. */
parms = Fcopy_alist (parms);
/* Get the name of the frame to use for resource lookup. */
- name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
+ name = gui_display_get_arg (dpyinfo, parms, Qname, "name", "Name",
+ RES_TYPE_STRING);
if (!STRINGP (name)
&& !EQ (name, Qunbound)
&& !NILP (name))
/* By setting the output method, we're essentially saying that
the frame is live, as per FRAME_LIVE_P. If we get a signal
- from this point on, x_destroy_window might screw up reference
+ from this point on, w32_destroy_window might screw up reference
counts etc. */
f->terminal = dpyinfo->terminal;
f->output_method = output_w32;
register_font_driver (&uniscribe_font_driver, f);
register_font_driver (&w32font_driver, f);
- x_default_parameter (f, parms, Qfont_backend, Qnil,
- "fontBackend", "FontBackend", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
/* Extract the window parameters from the supplied values
that are needed to determine window geometry. */
- x_default_font_parameter (f, parms);
+ w32_default_font_parameter (f, parms);
- x_default_parameter (f, parms, Qborder_width, make_fixnum (2),
- "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qborder_width, make_fixnum (2),
+ "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
/* This defaults to 2 in order to match xterm. We recognize either
internalBorderWidth or internalBorder (which is what xterm calls
it). */
{
Lisp_Object value;
- value = x_get_arg (dpyinfo, parms, Qinternal_border_width,
- "internalBorder", "internalBorder", RES_TYPE_NUMBER);
+ value = gui_display_get_arg (dpyinfo, parms, Qinternal_border_width,
+ "internalBorder", "internalBorder",
+ RES_TYPE_NUMBER);
if (! EQ (value, Qunbound))
parms = Fcons (Fcons (Qinternal_border_width, value),
parms);
}
- x_default_parameter (f, parms, Qinternal_border_width, make_fixnum (1),
- "internalBorderWidth", "internalBorderWidth",
- RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (1),
+ "internalBorderWidth", "internalBorderWidth",
+ RES_TYPE_NUMBER);
/* Also do the stuff which must be set before the window exists. */
- x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
- "foreground", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
- "background", "Background", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qmouse_color, build_string ("black"),
- "pointerColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qcursor_color, build_string ("black"),
- "cursorColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qborder_color, build_string ("black"),
- "borderColor", "BorderColor", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qno_special_glyphs, Qt,
- NULL, NULL, RES_TYPE_BOOLEAN);
-
- /* Init faces before x_default_parameter is called for the
+ gui_default_parameter (f, parms, Qforeground_color, build_string ("black"),
+ "foreground", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qbackground_color, build_string ("white"),
+ "background", "Background", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qmouse_color, build_string ("black"),
+ "pointerColor", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qcursor_color, build_string ("black"),
+ "cursorColor", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qborder_color, build_string ("black"),
+ "borderColor", "BorderColor", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qno_special_glyphs, Qt,
+ NULL, NULL, RES_TYPE_BOOLEAN);
+
+ /* Init faces before gui_default_parameter is called for the
scroll-bar-width parameter because otherwise we end up in
init_iterator with a null face cache, which should not happen. */
init_frame_faces (f);
f->output_data.w32->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
f->output_data.w32->explicit_parent = false;
- x_figure_window_size (f, parms, true, &x_width, &x_height);
+ gui_figure_window_size (f, parms, true, &x_width, &x_height);
/* No fringes on tip frame. */
f->fringe_cols = 0;
my_create_tip_window (f);
unblock_input ();
- x_make_gc (f);
+ w32_make_gc (f);
- x_default_parameter (f, parms, Qauto_raise, Qnil,
- "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qauto_lower, Qnil,
- "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qcursor_type, Qbox,
- "cursorType", "CursorType", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qauto_raise, Qnil,
+ "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qauto_lower, Qnil,
+ "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qcursor_type, Qbox,
+ "cursorType", "CursorType", RES_TYPE_SYMBOL);
/* Process alpha here (Bug#17344). */
- x_default_parameter (f, parms, Qalpha, Qnil,
- "alpha", "Alpha", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qalpha, Qnil,
+ "alpha", "Alpha", RES_TYPE_NUMBER);
/* Dimensions, especially FRAME_LINES (f), must be done via
change_frame_size. Change will not be effected unless different
below. And the frame needs to be on Vframe_list or making it
visible won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- f->can_x_set_window_size = true;
+ f->can_set_window_size = true;
/* Setting attributes of faces of the tooltip frame from resources
and similar will set face_change, which leads to the
/* Default min and max values. */
min_x = 0;
min_y = 0;
- max_x = x_display_pixel_width (FRAME_DISPLAY_INFO (f));
- max_y = x_display_pixel_height (FRAME_DISPLAY_INFO (f));
+ max_x = w32_display_pixel_width (FRAME_DISPLAY_INFO (f));
+ max_y = w32_display_pixel_height (FRAME_DISPLAY_INFO (f));
block_input ();
GetCursorPos (&pt);
}
/**
- * x_hide_tip:
+ * w32_hide_tip:
*
* Hide currently visible tooltip and cancel its timer.
*
* otherwise.
*/
static Lisp_Object
-x_hide_tip (bool delete)
+w32_hide_tip (bool delete)
{
if (!NILP (tip_timer))
{
tip_frame = Qnil;
}
else
- x_make_frame_invisible (XFRAME (tip_frame));
+ w32_make_frame_invisible (XFRAME (tip_frame));
was_open = Qt;
}
}
}
- x_hide_tip (delete);
+ w32_hide_tip (delete);
}
else
- x_hide_tip (true);
+ w32_hide_tip (true);
}
else
- x_hide_tip (true);
+ w32_hide_tip (true);
tip_last_frame = frame;
tip_last_string = string;
/* Create a frame for the tooltip and record it in the global
variable tip_frame. */
struct frame *f; /* The value is unused. */
- if (NILP (tip_frame = x_create_tip_frame (FRAME_DISPLAY_INFO (f), parms)))
+ if (NILP (tip_frame = w32_create_tip_frame (FRAME_DISPLAY_INFO (f), parms)))
{
/* Creating the tip frame failed. */
unblock_input ();
doc: /* SKIP: real doc in xfns.c. */)
(void)
{
- return x_hide_tip (!tooltip_reuse_hidden_frame);
+ return w32_hide_tip (!tooltip_reuse_hidden_frame);
}
\f
/***********************************************************************
struct frame *f = XFRAME (frame);
if (!NILP (in_progress) && FRAME_Z_GROUP_ABOVE (f))
- x_set_z_group (f, Qabove_suspended, Qabove);
+ w32_set_z_group (f, Qabove_suspended, Qabove);
else if (NILP (in_progress) && FRAME_Z_GROUP_ABOVE_SUSPENDED (f))
- x_set_z_group (f, Qabove, Qabove_suspended);
+ w32_set_z_group (f, Qabove, Qabove_suspended);
}
}
while (window)
{
- struct frame *f = x_window_to_frame (dpyinfo, window);
+ struct frame *f = w32_window_to_frame (dpyinfo, window);
if (f)
{
frame_parm_handler w32_frame_parm_handlers[] =
{
- x_set_autoraise,
- x_set_autolower,
- x_set_background_color,
- x_set_border_color,
- x_set_border_width,
- x_set_cursor_color,
- x_set_cursor_type,
- x_set_font,
- x_set_foreground_color,
- x_set_icon_name,
- x_set_icon_type,
- x_set_internal_border_width,
- x_set_right_divider_width,
- x_set_bottom_divider_width,
- x_set_menu_bar_lines,
- x_set_mouse_color,
- x_explicitly_set_name,
- x_set_scroll_bar_width,
- x_set_scroll_bar_height,
- x_set_title,
- x_set_unsplittable,
- x_set_vertical_scroll_bars,
- x_set_horizontal_scroll_bars,
- x_set_visibility,
- x_set_tool_bar_lines,
+ gui_set_autoraise,
+ gui_set_autolower,
+ w32_set_background_color,
+ w32_set_border_color,
+ gui_set_border_width,
+ w32_set_cursor_color,
+ w32_set_cursor_type,
+ gui_set_font,
+ w32_set_foreground_color,
+ w32_set_icon_name,
+ w32_set_icon_type,
+ w32_set_internal_border_width,
+ gui_set_right_divider_width,
+ gui_set_bottom_divider_width,
+ w32_set_menu_bar_lines,
+ w32_set_mouse_color,
+ w32_explicitly_set_name,
+ gui_set_scroll_bar_width,
+ gui_set_scroll_bar_height,
+ w32_set_title,
+ gui_set_unsplittable,
+ gui_set_vertical_scroll_bars,
+ gui_set_horizontal_scroll_bars,
+ gui_set_visibility,
+ w32_set_tool_bar_lines,
0, /* x_set_scroll_bar_foreground, */
0, /* x_set_scroll_bar_background, */
- x_set_screen_gamma,
- x_set_line_spacing,
- x_set_left_fringe,
- x_set_right_fringe,
+ gui_set_screen_gamma,
+ gui_set_line_spacing,
+ gui_set_left_fringe,
+ gui_set_right_fringe,
0, /* x_set_wait_for_wm, */
- x_set_fullscreen,
- x_set_font_backend,
- x_set_alpha,
+ gui_set_fullscreen,
+ gui_set_font_backend,
+ gui_set_alpha,
0, /* x_set_sticky */
0, /* x_set_tool_bar_position */
0, /* x_set_inhibit_double_buffering */
- x_set_undecorated,
- x_set_parent_frame,
- x_set_skip_taskbar,
- x_set_no_focus_on_map,
- x_set_no_accept_focus,
- x_set_z_group,
+ w32_set_undecorated,
+ w32_set_parent_frame,
+ w32_set_skip_taskbar,
+ w32_set_no_focus_on_map,
+ w32_set_no_accept_focus,
+ w32_set_z_group,
0, /* x_set_override_redirect */
- x_set_no_special_glyphs,
+ gui_set_no_special_glyphs,
};
void
characters, because drawing background with font dimensions
in those cases makes the display illegible. There's only one
more call to the draw method with with_background set to
- true, and that's in x_draw_glyph_string_foreground, when
+ true, and that's in w32_draw_glyph_string_foreground, when
drawing the cursor, where we have no such heuristics
available. FIXME. */
if (s->first_glyph->type == GLYPHLESS_GLYPH
typedef HBITMAP Pixmap;
typedef HBITMAP Bitmap;
-typedef char * XrmDatabase;
-
typedef XGCValues * GC;
typedef COLORREF Color;
typedef HWND Window;
This way we can safely execute Lisp code. */
void
-x_activate_menubar (struct frame *f)
+w32_activate_menubar (struct frame *f)
{
set_frame_menubar (f, false, true);
{
if (get_menu_item_info)
{
- struct frame *f = x_window_to_frame (&one_w32_display_info, owner);
+ struct frame *f = w32_window_to_frame (&one_w32_display_info, owner);
Lisp_Object frame, help;
/* No help echo on owner-draw menu items, or when the keyboard
#include <config.h>
#include "lisp.h"
-#include "w32term.h" /* for XrmDatabase, xrdb */
#include "blockinput.h"
+#include "w32term.h"
#include <stdio.h>
return NULL;
}
-static char *
-w32_get_string_resource (const char *name, const char *class, DWORD dwexptype)
+static const char *
+w32_get_string_resource_1 (const char *name, const char *class, DWORD dwexptype)
{
LPBYTE lpvalue = NULL;
HKEY hrootkey = NULL;
/* Check if there are Windows specific defaults defined. */
return w32_get_rdb_resource (SYSTEM_DEFAULT_RESOURCES, name);
}
- return (char *)lpvalue;
+ return (const char *)lpvalue;
}
/* Retrieve the string resource specified by NAME with CLASS from
database RDB. */
-char *
-x_get_string_resource (XrmDatabase rdb, const char *name, const char *class)
+const char *
+w32_get_string_resource (void *v_rdb, const char *name, const char *class)
{
+ const char *rdb = v_rdb;
+
if (rdb)
{
char *resource;
/* --quick was passed, so this is a no-op. */
return NULL;
- return w32_get_string_resource (name, class, REG_SZ);
+ return w32_get_string_resource_1 (name, class, REG_SZ);
}
extern int w32_codepage_for_font (char *fontname);
extern Cursor w32_load_cursor (LPCTSTR name);
-#define x_any_window_to_frame x_window_to_frame
-#define x_top_window_to_frame x_window_to_frame
-
\f
/* This is display since w32 does not support multiple ones. */
struct w32_display_info one_w32_display_info;
struct input_event *);
static void w32_define_cursor (Window, Cursor);
-void x_lower_frame (struct frame *);
-void x_scroll_bar_clear (struct frame *);
-void x_raise_frame (struct frame *);
-void x_wm_set_window_state (struct frame *, int);
-void x_wm_set_icon_pixmap (struct frame *, int);
+static void w32_scroll_bar_clear (struct frame *);
+static void w32_raise_frame (struct frame *);
+static void w32_lower_frame (struct frame *);
static void w32_initialize (void);
-static void x_update_end (struct frame *);
+static void w32_update_end (struct frame *);
static void w32_frame_up_to_date (struct frame *);
-static void x_clear_frame (struct frame *);
+static void w32_clear_frame (struct frame *);
static void w32_frame_highlight (struct frame *);
static void w32_frame_unhighlight (struct frame *);
-static void x_new_focus_frame (struct w32_display_info *,
- struct frame *);
-static void x_focus_changed (int, int, struct w32_display_info *,
+static void w32_new_focus_frame (struct w32_display_info *,
+ struct frame *);
+static void w32_focus_changed (int, int, struct w32_display_info *,
struct frame *, struct input_event *);
static void w32_detect_focus_change (struct w32_display_info *,
W32Msg *, struct input_event *);
static void w32_frame_rehighlight (struct frame *);
-static void x_frame_rehighlight (struct w32_display_info *);
-static void x_draw_hollow_cursor (struct window *, struct glyph_row *);
-static void x_draw_bar_cursor (struct window *, struct glyph_row *, int,
+static void w32_frame_rehighlight_1 (struct w32_display_info *);
+static void w32_draw_hollow_cursor (struct window *, struct glyph_row *);
+static void w32_draw_bar_cursor (struct window *, struct glyph_row *, int,
enum text_cursor_kinds);
static void w32_clip_to_row (struct window *, struct glyph_row *,
enum glyph_row_area, HDC);
static void w32fullscreen_hook (struct frame *);
#ifdef GLYPH_DEBUG
-static void x_check_font (struct frame *, struct font *);
+static void w32_check_font (struct frame *, struct font *);
#endif
\f
return gc;
}
-#if 0 /* unused for now, see x_draw_image_glyph_string below */
+#if 0 /* unused for now, see w32_draw_image_glyph_string below */
static void
XGetGCValues (void *ignore, XGCValues *gc,
unsigned long mask, XGCValues *xgcv)
}
static void
-x_get_scale_factor(struct w32_display_info *dpyinfo, int *scale_x, int *scale_y)
+w32_get_scale_factor(struct w32_display_info *dpyinfo, int *scale_x, int *scale_y)
{
const int base_res = 96;
struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (s->f);
int scale_x, scale_y;
- x_get_scale_factor (dpyinfo, &scale_x, &scale_y);
+ w32_get_scale_factor (dpyinfo, &scale_x, &scale_y);
int wave_height = 3 * scale_y, wave_length = 2 * scale_x, thickness = scale_y;
int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
#define OPAQUE_FRAME 255
-void
-x_set_frame_alpha (struct frame *f)
+static void
+w32_set_frame_alpha (struct frame *f)
{
struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
double alpha = 1.0;
}
int
-x_display_pixel_height (struct w32_display_info *dpyinfo)
+w32_display_pixel_height (struct w32_display_info *dpyinfo)
{
int pixels = GetSystemMetrics (SM_CYVIRTUALSCREEN);
}
int
-x_display_pixel_width (struct w32_display_info *dpyinfo)
+w32_display_pixel_width (struct w32_display_info *dpyinfo)
{
int pixels = GetSystemMetrics (SM_CXVIRTUALSCREEN);
/* Start an update of frame F. This function is installed as a hook
for update_begin, i.e. it is called when update_begin is called.
- This function is called prior to calls to x_update_window_begin for
- each window being updated. */
+ This function is called prior to calls to w32_update_window_begin
+ for each window being updated. */
static void
-x_update_begin (struct frame *f)
+w32_update_begin (struct frame *f)
{
struct w32_display_info *display_info = FRAME_DISPLAY_INFO (f);
/* Start update of window W. */
static void
-x_update_window_begin (struct window *w)
+w32_update_window_begin (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
here. */
static void
-x_update_window_end (struct window *w, bool cursor_on_p,
+w32_update_window_end (struct window *w, bool cursor_on_p,
bool mouse_face_overwritten_p)
{
if (!w->pseudo_window_p)
/* Unhide the caret. This won't actually show the cursor, unless it
was visible before the corresponding call to HideCaret in
- x_update_window_begin. */
+ w32_update_window_begin. */
if (w32_use_visible_system_caret && w32_system_caret_hwnd)
{
SendMessageTimeout (w32_system_caret_hwnd, WM_EMACS_SHOW_CARET, 0, 0,
update_end. */
static void
-x_update_end (struct frame *f)
+w32_update_end (struct frame *f)
{
if (! FRAME_W32_P (f))
return;
between bitmaps to be drawn between current row and DESIRED_ROW. */
static void
-x_after_update_window_line (struct window *w, struct glyph_row *desired_row)
+w32_after_update_window_line (struct window *w, struct glyph_row *desired_row)
{
struct frame *f;
int width, height;
/* Function prototypes of this page. */
-static void x_set_glyph_string_clipping (struct glyph_string *);
-static void x_set_glyph_string_gc (struct glyph_string *);
-static void x_draw_glyph_string_background (struct glyph_string *,
- bool);
-static void x_draw_glyph_string_foreground (struct glyph_string *);
-static void x_draw_composite_glyph_string_foreground (struct glyph_string *);
-static void x_draw_glyph_string_box (struct glyph_string *);
-static void x_draw_glyph_string (struct glyph_string *);
-static void x_set_cursor_gc (struct glyph_string *);
-static void x_set_mode_line_face_gc (struct glyph_string *);
-static void x_set_mouse_face_gc (struct glyph_string *);
+static void w32_set_glyph_string_clipping (struct glyph_string *);
+static void w32_set_glyph_string_gc (struct glyph_string *);
+static void w32_draw_glyph_string_background (struct glyph_string *,
+ bool);
+static void w32_draw_glyph_string_foreground (struct glyph_string *);
+static void w32_draw_composite_glyph_string_foreground (struct glyph_string *);
+static void w32_draw_glyph_string_box (struct glyph_string *);
+static void w32_draw_glyph_string (struct glyph_string *);
+static void w32_set_cursor_gc (struct glyph_string *);
+static void w32_set_mode_line_face_gc (struct glyph_string *);
+static void w32_set_mouse_face_gc (struct glyph_string *);
static int w32_alloc_lighter_color (struct frame *, COLORREF *, double, int);
static void w32_setup_relief_color (struct frame *, struct relief *,
double, int, COLORREF);
-static void x_setup_relief_colors (struct glyph_string *);
-static void x_draw_image_glyph_string (struct glyph_string *);
-static void x_draw_image_relief (struct glyph_string *);
-static void x_draw_image_foreground (struct glyph_string *);
+static void w32_setup_relief_colors (struct glyph_string *);
+static void w32_draw_image_glyph_string (struct glyph_string *);
+static void w32_draw_image_relief (struct glyph_string *);
+static void w32_draw_image_foreground (struct glyph_string *);
static void w32_draw_image_foreground_1 (struct glyph_string *, HBITMAP);
-static void x_clear_glyph_string_rect (struct glyph_string *, int,
- int, int, int);
+static void w32_clear_glyph_string_rect (struct glyph_string *, int,
+ int, int, int);
static void w32_draw_relief_rect (struct frame *, int, int, int, int,
int, int, int, int, int, int,
RECT *);
face. */
static void
-x_set_cursor_gc (struct glyph_string *s)
+w32_set_cursor_gc (struct glyph_string *s)
{
if (s->font == FRAME_FONT (s->f)
&& s->face->background == FRAME_BACKGROUND_PIXEL (s->f)
xgcv.foreground = s->face->background;
}
- IF_DEBUG (x_check_font (s->f, s->font));
+ IF_DEBUG (w32_check_font (s->f, s->font));
xgcv.font = s->font;
mask = GCForeground | GCBackground | GCFont;
/* Set up S->gc of glyph string S for drawing text in mouse face. */
static void
-x_set_mouse_face_gc (struct glyph_string *s)
+w32_set_mouse_face_gc (struct glyph_string *s)
{
int face_id;
struct face *face;
xgcv.background = s->face->background;
xgcv.foreground = s->face->foreground;
- IF_DEBUG (x_check_font (s->f, s->font));
+ IF_DEBUG (w32_check_font (s->f, s->font));
xgcv.font = s->font;
mask = GCForeground | GCBackground | GCFont;
matrix was built, so there isn't much to do, here. */
static inline void
-x_set_mode_line_face_gc (struct glyph_string *s)
+w32_set_mode_line_face_gc (struct glyph_string *s)
{
s->gc = s->face->gc;
}
pattern. */
static inline void
-x_set_glyph_string_gc (struct glyph_string *s)
+w32_set_glyph_string_gc (struct glyph_string *s)
{
prepare_face_for_display (s->f, s->face);
}
else if (s->hl == DRAW_INVERSE_VIDEO)
{
- x_set_mode_line_face_gc (s);
+ w32_set_mode_line_face_gc (s);
s->stippled_p = s->face->stipple != 0;
}
else if (s->hl == DRAW_CURSOR)
{
- x_set_cursor_gc (s);
+ w32_set_cursor_gc (s);
s->stippled_p = false;
}
else if (s->hl == DRAW_MOUSE_FACE)
{
- x_set_mouse_face_gc (s);
+ w32_set_mouse_face_gc (s);
s->stippled_p = s->face->stipple != 0;
}
else if (s->hl == DRAW_IMAGE_RAISED
line or menu if we don't have X toolkit support. */
static inline void
-x_set_glyph_string_clipping (struct glyph_string *s)
+w32_set_glyph_string_clipping (struct glyph_string *s)
{
RECT *r = s->clip;
int n = get_glyph_string_clip_rects (s, r, 2);
the area of SRC. */
static void
-x_set_glyph_string_clipping_exactly (struct glyph_string *src,
- struct glyph_string *dst)
+w32_set_glyph_string_clipping_exactly (struct glyph_string *src,
+ struct glyph_string *dst)
{
RECT r;
/* Fill rectangle X, Y, W, H with background color of glyph string S. */
static inline void
-x_clear_glyph_string_rect (struct glyph_string *s,
+w32_clear_glyph_string_rect (struct glyph_string *s,
int x, int y, int w, int h)
{
int real_x = x;
contains the first component of a composition. */
static void
-x_draw_glyph_string_background (struct glyph_string *s, bool force_p)
+w32_draw_glyph_string_background (struct glyph_string *s, bool force_p)
{
/* Nothing to do if background has already been drawn or if it
shouldn't be drawn in the first place. */
|| s->extends_to_end_of_line_p
|| force_p)
{
- x_clear_glyph_string_rect (s, s->x, s->y + box_line_width,
+ w32_clear_glyph_string_rect (s, s->x, s->y + box_line_width,
s->background_width,
s->height - 2 * box_line_width);
s->background_filled_p = true;
/* Draw the foreground of glyph string S. */
static void
-x_draw_glyph_string_foreground (struct glyph_string *s)
+w32_draw_glyph_string_foreground (struct glyph_string *s)
{
int i, x;
/* Draw the foreground of composite glyph string S. */
static void
-x_draw_composite_glyph_string_foreground (struct glyph_string *s)
+w32_draw_composite_glyph_string_foreground (struct glyph_string *s)
{
int i, j, x;
struct font *font = s->font;
/* Draw the foreground of glyph string S for glyphless characters. */
static void
-x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
+w32_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
{
struct glyph *glyph = s->first_glyph;
XChar2b char2b[8];
/* On frame F, translate pixel colors to RGB values for the NCOLORS
colors in COLORS. On W32, we no longer try to map colors to
a palette. */
-void
-x_query_colors (struct frame *f, XColor *colors, int ncolors)
+static void
+w32_query_colors (struct frame *f, XColor *colors, int ncolors)
{
int i;
}
}
-void
-x_query_color (struct frame *f, XColor *color)
-{
- x_query_colors (f, color, 1);
-}
-
/* Set up the foreground color for drawing relief lines of glyph
string S. RELIEF is a pointer to a struct relief containing the GC
/* Set up colors for the relief lines around glyph string S. */
static void
-x_setup_relief_colors (struct glyph_string *s)
+w32_setup_relief_colors (struct glyph_string *s)
{
struct w32_output *di = s->f->output_data.w32;
COLORREF color;
/* Draw a box around glyph string S. */
static void
-x_draw_glyph_string_box (struct glyph_string *s)
+w32_draw_glyph_string_box (struct glyph_string *s)
{
int width, left_x, right_x, top_y, bottom_y, last_x;
bool left_p, right_p, raised_p;
left_p, right_p, &clip_rect);
else
{
- x_setup_relief_colors (s);
+ w32_setup_relief_colors (s);
w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
width, raised_p, 1, 1, left_p, right_p, &clip_rect);
}
/* Draw foreground of image glyph string S. */
static void
-x_draw_image_foreground (struct glyph_string *s)
+w32_draw_image_foreground (struct glyph_string *s)
{
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
DIBSECTION dib;
SetBkColor (compat_hdc, RGB (255, 255, 255));
SetTextColor (s->hdc, RGB (0, 0, 0));
- x_set_glyph_string_clipping (s);
+ w32_set_glyph_string_clipping (s);
/* Extract the original dimensions of the bitmap. */
if (GetObject (s->img->pixmap, sizeof (dib), &dib) > 0)
{
}
else
{
- DebPrint (("x_draw_image_foreground: GetObject failed!\n"));
+ DebPrint (("w32_draw_image_foreground: GetObject failed!\n"));
orig_width = s->slice.width;
orig_height = s->slice.height;
}
/* Draw a relief around the image glyph string S. */
static void
-x_draw_image_relief (struct glyph_string *s)
+w32_draw_image_relief (struct glyph_string *s)
{
int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p;
int extra_x, extra_y;
if (s->slice.y + s->slice.height == s->img->height)
y1 += thick + extra_y, bot_p = 1;
- x_setup_relief_colors (s);
+ w32_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
w32_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p,
top_p, bot_p, left_p, right_p, &r);
/* FIXME (maybe): The below doesn't support image scaling. But it
seems to never be called, because the conditions for its call in
- x_draw_image_glyph_string are never fulfilled (they will be if
+ w32_draw_image_glyph_string are never fulfilled (they will be if
the #ifdef'ed away part of that function is ever activated). */
if (s->img->pixmap)
{
give the rectangle to draw. */
static void
-x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h)
+w32_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h)
{
#if 0 /* TODO: stipple */
if (s->stippled_p)
}
else
#endif
- x_clear_glyph_string_rect (s, x, y, w, h);
+ w32_clear_glyph_string_rect (s, x, y, w, h);
}
*/
static void
-x_draw_image_glyph_string (struct glyph_string *s)
+w32_draw_image_glyph_string (struct glyph_string *s)
{
int x, y;
int box_line_hwidth = eabs (s->face->box_line_width);
}
else
#endif
- x_draw_glyph_string_bg_rect (s, x, y, width, height);
+ w32_draw_glyph_string_bg_rect (s, x, y, width, height);
s->background_filled_p = true;
}
if (pixmap != 0)
{
w32_draw_image_foreground_1 (s, pixmap);
- x_set_glyph_string_clipping (s);
+ w32_set_glyph_string_clipping (s);
{
HDC compat_hdc = CreateCompatibleDC (s->hdc);
HBRUSH fg_brush = CreateSolidBrush (s->gc->foreground);
pixmap = 0;
}
else
- x_draw_image_foreground (s);
+ w32_draw_image_foreground (s);
/* If we must draw a relief around the image, do it. */
if (s->img->relief
|| s->hl == DRAW_IMAGE_RAISED
|| s->hl == DRAW_IMAGE_SUNKEN)
- x_draw_image_relief (s);
+ w32_draw_image_relief (s);
}
/* Draw stretch glyph string S. */
static void
-x_draw_stretch_glyph_string (struct glyph_string *s)
+w32_draw_stretch_glyph_string (struct glyph_string *s)
{
eassert (s->first_glyph->type == STRETCH_GLYPH);
x -= width;
/* Draw cursor. */
- x_draw_glyph_string_bg_rect (s, x, s->y, width, s->height);
+ w32_draw_glyph_string_bg_rect (s, x, s->y, width, s->height);
/* Clear rest using the GC of the original non-cursor face. */
if (width < background_width)
if (s->row->mouse_face_p
&& cursor_in_mouse_face_p (s->w))
{
- x_set_mouse_face_gc (s);
+ w32_set_mouse_face_gc (s);
gc = s->gc;
}
else
x = left_x;
}
if (background_width > 0)
- x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
+ w32_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
}
s->background_filled_p = true;
/* Draw glyph string S. */
static void
-x_draw_glyph_string (struct glyph_string *s)
+w32_draw_glyph_string (struct glyph_string *s)
{
bool relief_drawn_p = 0;
width += next->width, next = next->next)
if (next->first_glyph->type != IMAGE_GLYPH)
{
- x_set_glyph_string_gc (next);
- x_set_glyph_string_clipping (next);
+ w32_set_glyph_string_gc (next);
+ w32_set_glyph_string_clipping (next);
if (next->first_glyph->type == STRETCH_GLYPH)
- x_draw_stretch_glyph_string (next);
+ w32_draw_stretch_glyph_string (next);
else
- x_draw_glyph_string_background (next, true);
+ w32_draw_glyph_string_background (next, true);
next->num_clips = 0;
}
}
/* Set up S->gc, set clipping and draw S. */
- x_set_glyph_string_gc (s);
+ w32_set_glyph_string_gc (s);
/* Draw relief (if any) in advance for char/composition so that the
glyph string can be drawn over it. */
|| s->first_glyph->type == COMPOSITE_GLYPH))
{
- x_set_glyph_string_clipping (s);
- x_draw_glyph_string_background (s, true);
- x_draw_glyph_string_box (s);
- x_set_glyph_string_clipping (s);
+ w32_set_glyph_string_clipping (s);
+ w32_draw_glyph_string_background (s, true);
+ w32_draw_glyph_string_box (s);
+ w32_set_glyph_string_clipping (s);
relief_drawn_p = 1;
}
else if (!s->clip_head /* draw_glyphs didn't specify a clip mask. */
/* We must clip just this glyph. left_overhang part has already
drawn when s->prev was drawn, and right_overhang part will be
drawn later when s->next is drawn. */
- x_set_glyph_string_clipping_exactly (s, s);
+ w32_set_glyph_string_clipping_exactly (s, s);
else
- x_set_glyph_string_clipping (s);
+ w32_set_glyph_string_clipping (s);
switch (s->first_glyph->type)
{
case IMAGE_GLYPH:
- x_draw_image_glyph_string (s);
+ w32_draw_image_glyph_string (s);
break;
case STRETCH_GLYPH:
- x_draw_stretch_glyph_string (s);
+ w32_draw_stretch_glyph_string (s);
break;
case CHAR_GLYPH:
if (s->for_overlaps)
s->background_filled_p = true;
else
- x_draw_glyph_string_background (s, false);
- x_draw_glyph_string_foreground (s);
+ w32_draw_glyph_string_background (s, false);
+ w32_draw_glyph_string_foreground (s);
break;
case COMPOSITE_GLYPH:
&& ! s->first_glyph->u.cmp.automatic))
s->background_filled_p = true;
else
- x_draw_glyph_string_background (s, true);
- x_draw_composite_glyph_string_foreground (s);
+ w32_draw_glyph_string_background (s, true);
+ w32_draw_composite_glyph_string_foreground (s);
break;
case GLYPHLESS_GLYPH:
if (s->for_overlaps)
s->background_filled_p = true;
else
- x_draw_glyph_string_background (s, false);
- x_draw_glyphless_glyph_string_foreground (s);
+ w32_draw_glyph_string_background (s, false);
+ w32_draw_glyphless_glyph_string_foreground (s);
break;
default:
/* Draw relief if not yet drawn. */
if (!relief_drawn_p && s->face->box != FACE_NO_BOX)
- x_draw_glyph_string_box (s);
+ w32_draw_glyph_string_box (s);
if (s->prev)
{
enum draw_glyphs_face save = prev->hl;
prev->hl = s->hl;
- x_set_glyph_string_gc (prev);
- x_set_glyph_string_clipping_exactly (s, prev);
+ w32_set_glyph_string_gc (prev);
+ w32_set_glyph_string_clipping_exactly (s, prev);
if (prev->first_glyph->type == CHAR_GLYPH)
- x_draw_glyph_string_foreground (prev);
+ w32_draw_glyph_string_foreground (prev);
else
- x_draw_composite_glyph_string_foreground (prev);
+ w32_draw_composite_glyph_string_foreground (prev);
w32_set_clip_rectangle (prev->hdc, NULL);
prev->hl = save;
prev->num_clips = 0;
enum draw_glyphs_face save = next->hl;
next->hl = s->hl;
- x_set_glyph_string_gc (next);
- x_set_glyph_string_clipping_exactly (s, next);
+ w32_set_glyph_string_gc (next);
+ w32_set_glyph_string_clipping_exactly (s, next);
if (next->first_glyph->type == CHAR_GLYPH)
- x_draw_glyph_string_foreground (next);
+ w32_draw_glyph_string_foreground (next);
else
- x_draw_composite_glyph_string_foreground (next);
+ w32_draw_composite_glyph_string_foreground (next);
w32_set_clip_rectangle (next->hdc, NULL);
next->hl = save;
next->num_clips = 0;
for X frames. */
static void
-x_delete_glyphs (struct frame *f, register int n)
+w32_delete_glyphs (struct frame *f, register int n)
{
if (! FRAME_W32_P (f))
return;
/* Clear entire frame. */
static void
-x_clear_frame (struct frame *f)
+w32_clear_frame (struct frame *f)
{
if (! FRAME_W32_P (f))
return;
/* We have to clear the scroll bars, too. If we have changed
colors or something like that, then they should be notified. */
- x_scroll_bar_clear (f);
+ w32_scroll_bar_clear (f);
unblock_input ();
}
lines or deleting -N lines at vertical position VPOS. */
static void
-x_ins_del_lines (struct frame *f, int vpos, int n)
+w32_ins_del_lines (struct frame *f, int vpos, int n)
{
if (! FRAME_W32_P (f))
return;
/* Scroll part of the display as described by RUN. */
static void
-x_scroll_run (struct window *w, struct run *run)
+w32_scroll_run (struct window *w, struct run *run)
{
struct frame *f = XFRAME (w->frame);
int x, y, width, height, from_y, to_y, bottom_y;
block_input ();
- /* Cursor off. Will be switched on again in x_update_window_end. */
+ /* Cursor off. Will be switched on again in w32_update_window_end. */
gui_clear_cursor (w);
{
w32_frame_highlight (struct frame *f)
{
gui_update_cursor (f, 1);
- x_set_frame_alpha (f);
+ w32_set_frame_alpha (f);
}
static void
w32_frame_unhighlight (struct frame *f)
{
gui_update_cursor (f, 1);
- x_set_frame_alpha (f);
+ w32_set_frame_alpha (f);
}
/* The focus has changed. Update the frames as necessary to reflect
Lisp code can tell when the switch took place by examining the events. */
static void
-x_new_focus_frame (struct w32_display_info *dpyinfo, struct frame *frame)
+w32_new_focus_frame (struct w32_display_info *dpyinfo, struct frame *frame)
{
struct frame *old_focus = dpyinfo->w32_focus_frame;
dpyinfo->w32_focus_frame = frame;
if (old_focus && old_focus->auto_lower)
- x_lower_frame (old_focus);
+ w32_lower_frame (old_focus);
if (dpyinfo->w32_focus_frame && dpyinfo->w32_focus_frame->auto_raise)
dpyinfo->w32_pending_autoraise_frame = dpyinfo->w32_focus_frame;
dpyinfo->w32_pending_autoraise_frame = NULL;
}
- x_frame_rehighlight (dpyinfo);
+ w32_reframe_highlight_1 (dpyinfo);
}
a FOCUS_IN_EVENT into *BUFP. */
static void
-x_focus_changed (int type, int state, struct w32_display_info *dpyinfo,
+w32_focus_changed (int type, int state, struct w32_display_info *dpyinfo,
struct frame *frame, struct input_event *bufp)
{
if (type == WM_SETFOCUS)
{
if (dpyinfo->w32_focus_event_frame != frame)
{
- x_new_focus_frame (dpyinfo, frame);
+ w32_new_focus_frame (dpyinfo, frame);
dpyinfo->w32_focus_event_frame = frame;
bufp->kind = FOCUS_IN_EVENT;
XSETFRAME (bufp->frame_or_window, frame);
if (dpyinfo->w32_focus_event_frame == frame)
{
dpyinfo->w32_focus_event_frame = 0;
- x_new_focus_frame (dpyinfo, 0);
+ w32_new_focus_frame (dpyinfo, 0);
bufp->kind = FOCUS_OUT_EVENT;
XSETFRAME (bufp->frame_or_window, frame);
{
struct frame *frame;
- frame = x_any_window_to_frame (dpyinfo, event->msg.hwnd);
+ frame = w32_window_to_frame (dpyinfo, event->msg.hwnd);
if (! frame)
return;
/* On w32, this is only called from focus events, so no switch needed. */
- x_focus_changed (event->msg.message,
- (event->msg.message == WM_KILLFOCUS ?
- FOCUS_IMPLICIT : FOCUS_EXPLICIT),
- dpyinfo, frame, bufp);
+ w32_focus_changed (event->msg.message,
+ (event->msg.message == WM_KILLFOCUS ?
+ FOCUS_IMPLICIT : FOCUS_EXPLICIT),
+ dpyinfo, frame, bufp);
}
/* Handle an event saying the mouse has moved out of an Emacs frame. */
static void
-x_mouse_leave (struct w32_display_info *dpyinfo)
+w32_mouse_leave (struct w32_display_info *dpyinfo)
{
- x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame);
+ w32_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame);
}
#endif
{
if (! FRAME_W32_P (frame))
return;
- x_frame_rehighlight (FRAME_DISPLAY_INFO (frame));
+ w32_frame_rehighlight_1 (FRAME_DISPLAY_INFO (frame));
}
static void
-x_frame_rehighlight (struct w32_display_info *dpyinfo)
+w32_frame_rehighlight_1 (struct w32_display_info *dpyinfo)
{
struct frame *old_highlight = dpyinfo->x_highlight_frame;
/* Convert a keysym to its name. */
char *
-x_get_keysym_name (int keysym)
+get_keysym_name (int keysym)
{
/* Make static so we can always return it */
static char value[100];
int mouse_y = HIWORD (msg->lParam);
RECT *r;
- if (!FRAME_X_OUTPUT (frame))
+ if (!FRAME_OUTPUT_DATA (frame))
return 0;
dpyinfo = FRAME_DISPLAY_INFO (frame);
Mouse Face
************************************************************************/
-static struct scroll_bar *x_window_to_scroll_bar (Window, int);
-static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *,
- enum scroll_bar_part *,
- Lisp_Object *, Lisp_Object *,
- Time *);
-static void x_horizontal_scroll_bar_report_motion (struct frame **, Lisp_Object *,
- enum scroll_bar_part *,
- Lisp_Object *, Lisp_Object *,
- Time *);
+static struct scroll_bar *w32_window_to_scroll_bar (Window, int);
+static void w32_scroll_bar_report_motion (struct frame **, Lisp_Object *,
+ enum scroll_bar_part *,
+ Lisp_Object *, Lisp_Object *,
+ Time *);
+static void w32_horizontal_scroll_bar_report_motion (struct frame **, Lisp_Object *,
+ enum scroll_bar_part *,
+ Lisp_Object *, Lisp_Object *,
+ Time *);
static void
w32_define_cursor (Window window, Cursor cursor)
{
struct scroll_bar *bar = dpyinfo->last_mouse_scroll_bar;
if (bar->horizontal)
- x_horizontal_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
+ w32_horizontal_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
else
- x_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
+ w32_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
}
else
{
/* If mouse was grabbed on a frame, give coords for that
frame even if the mouse is now outside it. Otherwise
check for window under mouse on one of our frames. */
- if (x_mouse_grabbed (dpyinfo))
+ if (gui_mouse_grabbed (dpyinfo))
f1 = dpyinfo->last_mouse_frame;
else
{
if (wfp)
{
- f1 = x_any_window_to_frame (dpyinfo, wfp);
+ f1 = w32_window_to_frame (dpyinfo, wfp);
if (f1)
{
HWND cwfp = ChildWindowFromPoint (wfp, pt);
if (cwfp)
{
- struct frame *f2 = x_any_window_to_frame (dpyinfo, cwfp);
+ struct frame *f2 = w32_window_to_frame (dpyinfo, cwfp);
/* If a child window was found, make sure that its
frame is a child frame (Bug#26615, maybe). */
if (! f1)
{
struct scroll_bar *bar
- = x_window_to_scroll_bar (WindowFromPoint (pt), 2);
+ = w32_window_to_scroll_bar (WindowFromPoint (pt), 2);
if (bar)
f1 = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
strip off mark bits. */
static struct scroll_bar *
-x_window_to_scroll_bar (Window window_id, int type)
+w32_window_to_scroll_bar (Window window_id, int type)
{
Lisp_Object tail, frame;
scroll bar. */
static struct scroll_bar *
-x_scroll_bar_create (struct window *w, int left, int top, int width, int height, bool horizontal)
+w32_scroll_bar_create (struct window *w, int left, int top,
+ int width, int height, bool horizontal)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
HWND hwnd;
nil. */
static void
-x_scroll_bar_remove (struct scroll_bar *bar)
+w32_scroll_bar_remove (struct scroll_bar *bar)
{
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
}
unblock_input ();
- bar = x_scroll_bar_create (w, left, top, width, height, false);
+ bar = w32_scroll_bar_create (w, left, top, width, height, false);
}
else
{
for them on the frame, we have to clear "under" them. */
w32_clear_area (f, hdc, left, top, width, height);
release_frame_dc (f, hdc);
- x_clear_under_internal_border (f);
+ w32_clear_under_internal_border (f);
}
/* Make sure scroll bar is "visible" before moving, to ensure the
area of the parent window now exposed will be refreshed. */
}
unblock_input ();
- bar = x_scroll_bar_create (w, left, top, width, height, true);
+ bar = w32_scroll_bar_create (w, left, top, width, height, true);
}
else
{
for them on the frame, we have to clear "under" them. */
w32_clear_area (f, hdc, clear_left, top, clear_width, height);
release_frame_dc (f, hdc);
- x_clear_under_internal_border (f);
+ w32_clear_under_internal_border (f);
}
/* Make sure scroll bar is "visible" before moving, to ensure the
area of the parent window now exposed will be refreshed. */
{
struct scroll_bar *b = XSCROLL_BAR (bar);
- x_scroll_bar_remove (b);
+ w32_scroll_bar_remove (b);
next = b->next;
b->next = b->prev = Qnil;
/* Return information to the user about the current position of the mouse
on the vertical scroll bar. */
static void
-x_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window,
+w32_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window,
enum scroll_bar_part *part,
Lisp_Object *x, Lisp_Object *y,
Time *time)
/* Return information to the user about the current position of the mouse
on the horizontal scroll bar. */
static void
-x_horizontal_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window,
- enum scroll_bar_part *part,
- Lisp_Object *x, Lisp_Object *y,
- Time *time)
+w32_horizontal_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window,
+ enum scroll_bar_part *part,
+ Lisp_Object *x, Lisp_Object *y,
+ Time *time)
{
struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (*fp);
struct scroll_bar *bar = dpyinfo->last_mouse_scroll_bar;
Clear out the scroll bars, and ask for expose events, so we can
redraw them. */
-void
-x_scroll_bar_clear (struct frame *f)
+static void
+w32_scroll_bar_clear (struct frame *f)
{
Lisp_Object bar;
GetClientRect (window, &rect);
select_palette (f, hdc);
w32_clear_rect (f, hdc, &rect);
- x_clear_under_internal_border (f);
+ w32_clear_under_internal_border (f);
deselect_palette (f, hdc);
ReleaseDC (window, hdc);
switch (msg.msg.message)
{
case WM_EMACS_PAINT:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
msg.rect.top,
msg.rect.right - msg.rect.left,
msg.rect.bottom - msg.rect.top);
- x_clear_under_internal_border (f);
+ w32_clear_under_internal_border (f);
}
}
break;
case WM_INPUTLANGCHANGE:
/* Generate a language change event. */
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
/* lParam contains the input language ID in its low 16 bits.
Use it to update our record of the keyboard codepage. */
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f && !FRAME_ICONIFIED_P (f))
{
case WM_UNICHAR:
case WM_SYSCHAR:
case WM_CHAR:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f && !FRAME_ICONIFIED_P (f))
{
break;
case WM_APPCOMMAND:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f && !FRAME_ICONIFIED_P (f))
{
previous_help_echo_string = help_echo_string;
help_echo_string = Qnil;
- f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
- : x_window_to_frame (dpyinfo, msg.msg.hwnd));
+ f = (gui_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
+ : w32_window_to_frame (dpyinfo, msg.msg.hwnd));
if (hlinfo->mouse_face_hidden)
{
int button = 0;
int up = 0;
- f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
- : x_window_to_frame (dpyinfo, msg.msg.hwnd));
+ f = (gui_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
+ : w32_window_to_frame (dpyinfo, msg.msg.hwnd));
if (f)
{
case WM_MOUSEWHEEL:
case WM_MOUSEHWHEEL:
{
- f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
- : x_window_to_frame (dpyinfo, msg.msg.hwnd));
+ f = (gui_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
+ : w32_window_to_frame (dpyinfo, msg.msg.hwnd));
if (f)
{
dpyinfo->last_mouse_frame = f;
}
else if (FRAME_NO_ACCEPT_FOCUS (f)
- && !x_mouse_grabbed (dpyinfo))
+ && !gui_mouse_grabbed (dpyinfo))
{
Lisp_Object frame1 = get_frame_param (f, Qmouse_wheel_frame);
struct frame *f1 = FRAMEP (frame1) ? XFRAME (frame1) : NULL;
break;
case WM_DROPFILES:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
w32_construct_drag_n_drop (&inev, &msg, f);
case WM_HSCROLL:
{
struct scroll_bar *bar =
- x_window_to_scroll_bar ((HWND)msg.msg.lParam, 1);
+ w32_window_to_scroll_bar ((HWND)msg.msg.lParam, 1);
if (bar)
w32_horizontal_scroll_bar_handle_click (bar, &msg, &inev);
case WM_VSCROLL:
{
struct scroll_bar *bar =
- x_window_to_scroll_bar ((HWND)msg.msg.lParam, 0);
+ w32_window_to_scroll_bar ((HWND)msg.msg.lParam, 0);
if (bar)
w32_scroll_bar_handle_click (bar, &msg, &inev);
}
case WM_WINDOWPOSCHANGED:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
case WM_ACTIVATE:
case WM_ACTIVATEAPP:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
/* Run the full-screen hook function also when we are
being activated, to actually install the required
size in effect, if the WAIT flag is set. This is
- because when the hook is run from x_set_fullscreen,
+ because when the hook is run from gui_set_fullscreen,
the frame might not yet be visible, if that call is a
result of make-frame, and in that case the hook just
sets the WAIT flag. */
break;
case WM_MOVE:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f && FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P(f))
{
- x_real_positions (f, &f->left_pos, &f->top_pos);
+ w32_real_positions (f, &f->left_pos, &f->top_pos);
inev.kind = MOVE_FRAME_EVENT;
XSETFRAME (inev.frame_or_window, f);
}
if (!msg.msg.wParam && msg.msg.hwnd == tip_window)
{
tip_window = NULL;
- x_redo_mouse_highlight (dpyinfo);
+ gui_redo_mouse_highlight (dpyinfo);
}
/* If window has been obscured or exposed by another window
check_visibility = 1;
else
{
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
f->async_visible = msg.msg.wParam;
}
#endif
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
- x_clear_under_internal_border (f);
+ w32_clear_under_internal_border (f);
check_visibility = 1;
break;
case WM_SIZE:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
/* Inform lisp of whether frame has been iconified etc. */
if (f)
BEFORE telling us the Window is minimized
when the Window is iconified, with 3000,3000
as the co-ords. */
- x_real_positions (f, &x, &y);
+ w32_real_positions (f, &x, &y);
f->left_pos = x;
f->top_pos = y;
{
int x, y;
- x_real_positions (f, &x, &y);
+ w32_real_positions (f, &x, &y);
if (x < 0 && y < 0)
store_frame_param (f, Qfullscreen, Qmaximized);
}
BEFORE telling us the Window is minimized
when the Window is iconified, with 3000,3000
as the co-ords. */
- x_real_positions (f, &f->left_pos, &f->top_pos);
+ w32_real_positions (f, &f->left_pos, &f->top_pos);
inev.kind = DEICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
break;
case WM_MOUSELEAVE:
- f = x_any_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
if (f == hlinfo->mouse_face_mouse_frame)
case WM_KILLFOCUS:
w32_detect_focus_change (dpyinfo, &msg, &inev);
- f = x_top_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
break;
case WM_CLOSE:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
break;
case WM_INITMENU:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
break;
case WM_COMMAND:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
break;
case WM_DISPLAYCHANGE:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
The following code is untested yet. */
if (!NILP (fullscreen))
{
- x_set_fullscreen (f, fullscreen, fullscreen);
+ gui_set_fullscreen (f, fullscreen, fullscreen);
w32fullscreen_hook (f);
}
#if HAVE_W32NOTIFY
case WM_EMACS_FILENOTIFY:
- f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+ f = w32_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
w32_queue_notifications (&inev, &msg, f, &count);
break;
raise it now. FIXME: handle more than one such frame. */
if (dpyinfo->w32_pending_autoraise_frame)
{
- x_raise_frame (dpyinfo->w32_pending_autoraise_frame);
+ w32_raise_frame (dpyinfo->w32_pending_autoraise_frame);
dpyinfo->w32_pending_autoraise_frame = NULL;
}
/* Draw a hollow box cursor on window W in glyph row ROW. */
static void
-x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
+w32_draw_hollow_cursor (struct window *w, struct glyph_row *row)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
HDC hdc;
--gerd. */
static void
-x_draw_bar_cursor (struct window *w, struct glyph_row *row,
+w32_draw_bar_cursor (struct window *w, struct glyph_row *row,
int width, enum text_cursor_kinds kind)
{
struct frame *f = XFRAME (w->frame);
switch (cursor_type)
{
case HOLLOW_BOX_CURSOR:
- x_draw_hollow_cursor (w, glyph_row);
+ w32_draw_hollow_cursor (w, glyph_row);
break;
case FILLED_BOX_CURSOR:
break;
case BAR_CURSOR:
- x_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR);
+ w32_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR);
break;
case HBAR_CURSOR:
- x_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR);
+ w32_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR);
break;
case NO_CURSOR:
\f
/* Icons. */
-bool
-x_bitmap_icon (struct frame *f, Lisp_Object icon)
+static bool
+w32_bitmap_icon (struct frame *f, Lisp_Object icon)
{
HANDLE main_icon;
HANDLE small_icon = NULL;
\f
/* Changing the font of the frame. */
-Lisp_Object
-x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
+static Lisp_Object
+w32_new_font (struct frame *f, Lisp_Object font_object, int fontset)
{
struct font *font = XFONT_OBJECT (font_object);
int unit, font_ascent, font_descent;
}
/* Now make the frame display the given font. */
- if (FRAME_X_WINDOW (f) != 0)
+ if (FRAME_NATIVE_WINDOW (f) != 0)
{
/* Don't change the size of a tip frame; there's no point in
doing it because it's done in Fx_show_tip, and it leads to
from its current recorded position values and gravity. */
static void
-x_calc_absolute_position (struct frame *f)
+w32_calc_absolute_position (struct frame *f)
{
int flags = f->size_hint_flags;
+ f->left_pos
- left_right_borders_width);
else
- f->left_pos = (x_display_pixel_width (FRAME_DISPLAY_INFO (f))
+ f->left_pos = (w32_display_pixel_width (FRAME_DISPLAY_INFO (f))
+ display_left
- FRAME_PIXEL_WIDTH (f)
+ f->left_pos
+ f->top_pos
- top_bottom_borders_height);
else
- f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f))
+ f->top_pos = (w32_display_pixel_height (FRAME_DISPLAY_INFO (f))
+ display_top
- FRAME_PIXEL_HEIGHT (f)
+ f->top_pos
/* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
to really change the position, and 0 when calling from
- x_make_frame_visible (in that case, XOFF and YOFF are the current
- position values). It is -1 when calling from x_set_frame_parameters,
+ w32_make_frame_visible (in that case, XOFF and YOFF are the current
+ position values). It is -1 when calling from gui_set_frame_parameters,
which means, do adjust for borders but don't change the gravity. */
-void
-x_set_offset (struct frame *f, register int xoff, register int yoff,
- int change_gravity)
+static void
+w32_set_offset (struct frame *f, register int xoff, register int yoff,
+ int change_gravity)
{
int modified_top, modified_left;
f->size_hint_flags |= YNegative;
f->win_gravity = NorthWestGravity;
}
- x_calc_absolute_position (f);
+ w32_calc_absolute_position (f);
block_input ();
- x_wm_set_size_hint (f, (long) 0, false);
+ w32_wm_set_size_hint (f, (long) 0, false);
modified_left = f->left_pos;
modified_top = f->top_pos;
f->want_fullscreen |= FULLSCREEN_WAIT;
}
-/* Call this to change the size of frame F's x-window.
+/* Call this to change the size of frame F's native window.
If CHANGE_GRAVITY, change to top-left-corner window gravity
for this size change and subsequent size changes.
Otherwise we leave the window gravity unchanged. */
-void
-x_set_window_size (struct frame *f, bool change_gravity,
+static void
+w32_set_window_size (struct frame *f, bool change_gravity,
int width, int height, bool pixelwise)
{
int pixelwidth, pixelheight;
}
f->win_gravity = NorthWestGravity;
- x_wm_set_size_hint (f, (long) 0, false);
+ w32_wm_set_size_hint (f, (long) 0, false);
rect.left = rect.top = 0;
rect.right = pixelwidth;
unblock_input ();
}
+static Lisp_Object
+w32_get_focus_frame (struct frame *f)
+{
+ Lisp_Object lisp_focus;
+
+ struct frame *focus = FRAME_DISPLAY_INFO (f)->w32_focus_frame;
+
+ if (!focus)
+ return Qnil;
+
+ XSETFRAME (lisp_focus, focus);
+ return lisp_focus;
+}
+
\f
/* Focus shifting, raising and lowering. */
Windows API: An application cannot activate an inactive window
without also bringing it to the top of the Z order. */
-void
-x_focus_frame (struct frame *f, bool noactivate)
+static void
+w32_focus_frame (struct frame *f, bool noactivate)
{
#if 0
struct w32_display_info *dpyinfo = &one_w32_display_info;
block_input ();
#if 0
/* Try not to change its Z-order if possible. */
- if (x_window_to_frame (dpyinfo, GetForegroundWindow ()))
+ if (w32_window_to_frame (dpyinfo, GetForegroundWindow ()))
my_set_focus (f, FRAME_W32_WINDOW (f));
else
#endif
}
/* Raise frame F. */
-void
-x_raise_frame (struct frame *f)
+static void
+w32_raise_frame (struct frame *f)
{
block_input ();
}
/* Lower frame F. */
-void
-x_lower_frame (struct frame *f)
+static void
+w32_lower_frame (struct frame *f)
{
block_input ();
my_set_window_pos (FRAME_W32_WINDOW (f),
return;
if (raise_flag)
- x_raise_frame (f);
+ w32_raise_frame (f);
else
- x_lower_frame (f);
+ w32_lower_frame (f);
}
\f
/* Change of visibility. */
finishes with it. */
void
-x_make_frame_visible (struct frame *f)
+w32_make_frame_visible (struct frame *f)
{
block_input ();
- x_set_bitmap_icon (f);
+ gui_set_bitmap_icon (f);
if (! FRAME_VISIBLE_P (f))
{
/* We test FRAME_GARBAGED_P here to make sure we don't
- call x_set_offset a second time
- if we get to x_make_frame_visible a second time
+ call w32_set_offset a second time
+ if we get to w32_make_frame_visible a second time
before the window gets really visible. */
if (! FRAME_ICONIFIED_P (f)
&& ! f->output_data.w32->asked_for_visible)
workarea_rect.top);
}
- x_set_offset (f, f->left_pos, f->top_pos, 0);
+ w32_set_offset (f, f->left_pos, f->top_pos, 0);
}
f->output_data.w32->asked_for_visible = 1;
/* Make the frame visible (mapped and not iconified). */
void
-x_make_frame_invisible (struct frame *f)
+w32_make_frame_invisible (struct frame *f)
{
/* Don't keep the highlight on an invisible frame. */
if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f)
unblock_input ();
}
+static void
+w32_make_frame_visible_invisible (struct frame *f, bool visible)
+{
+ if (visible)
+ w32_make_frame_visible (f);
+ else
+ w32_make_frame_invisible (f);
+}
+
/* Change window state from mapped to iconified. */
void
-x_iconify_frame (struct frame *f)
+w32_iconify_frame (struct frame *f)
{
/* Don't keep the highlight on an invisible frame. */
if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f)
block_input ();
- x_set_bitmap_icon (f);
+ gui_set_bitmap_icon (f);
/* Simulate the user minimizing the frame. */
SendMessageTimeout (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MINIMIZE, 0,
}
\f
-/* Free X resources of frame F. */
+/* Free resources of frame F. */
void
-x_free_frame_resources (struct frame *f)
+w32_free_frame_resources (struct frame *f)
{
struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
/* Destroy the window of frame F. */
static void
-x_destroy_window (struct frame *f)
+w32_destroy_window (struct frame *f)
{
struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
- x_free_frame_resources (f);
+ w32_free_frame_resources (f);
dpyinfo->reference_count--;
}
If USER_POSITION, set the USPosition
flag (this is useful when FLAGS is 0). */
void
-x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
+w32_wm_set_size_hint (struct frame *f, long flags, bool user_position)
{
Window window = FRAME_W32_WINDOW (f);
font table. */
static void
-x_check_font (struct frame *f, struct font *font)
+w32_check_font (struct frame *f, struct font *font)
{
eassert (font != NULL && ! NILP (font->props[FONT_TYPE_INDEX]));
if (font->driver->check)
{
if (!menubar_in_use && !current_popup_menu)
{
- struct w32_output *w32 = FRAME_X_OUTPUT (f);
+ struct w32_output *w32 = FRAME_OUTPUT_DATA (f);
w32->hourglass_p = 1;
SetCursor (w32->hourglass_cursor);
static void
w32_hide_hourglass (struct frame *f)
{
- struct w32_output *w32 = FRAME_X_OUTPUT (f);
+ struct w32_output *w32 = FRAME_OUTPUT_DATA (f);
w32->hourglass_p = 0;
if (f->pointer_invisible)
gui_write_glyphs,
gui_insert_glyphs,
gui_clear_end_of_line,
- x_scroll_run,
- x_after_update_window_line,
- x_update_window_begin,
- x_update_window_end,
+ w32_scroll_run,
+ w32_after_update_window_line,
+ w32_update_window_begin,
+ w32_update_window_end,
0, /* flush_display */
gui_clear_window_mouse_face,
gui_get_glyph_overhangs,
w32_define_fringe_bitmap,
w32_destroy_fringe_bitmap,
w32_compute_glyph_string_overhangs,
- x_draw_glyph_string,
+ w32_draw_glyph_string,
w32_define_frame_cursor,
w32_clear_frame_area,
+ w32_clear_under_internal_border,
w32_draw_window_cursor,
w32_draw_vertical_window_border,
w32_draw_window_divider,
w32_hide_hourglass
};
-static void x_delete_terminal (struct terminal *term);
+static void w32_delete_terminal (struct terminal *term);
static struct terminal *
w32_create_terminal (struct w32_display_info *dpyinfo)
/* MSVC does not type K&R functions with no arguments correctly, and
so we must explicitly cast them. */
- terminal->clear_frame_hook = x_clear_frame;
- terminal->ins_del_lines_hook = x_ins_del_lines;
- terminal->delete_glyphs_hook = x_delete_glyphs;
+ terminal->clear_frame_hook = w32_clear_frame;
+ terminal->ins_del_lines_hook = w32_ins_del_lines;
+ terminal->delete_glyphs_hook = w32_delete_glyphs;
terminal->ring_bell_hook = w32_ring_bell;
terminal->toggle_invisible_pointer_hook = w32_toggle_invisible_pointer;
- terminal->update_begin_hook = x_update_begin;
- terminal->update_end_hook = x_update_end;
+ terminal->update_begin_hook = w32_update_begin;
+ terminal->update_end_hook = w32_update_end;
terminal->read_socket_hook = w32_read_socket;
terminal->frame_up_to_date_hook = w32_frame_up_to_date;
+ terminal->query_colors = w32_query_colors;
terminal->mouse_position_hook = w32_mouse_position;
+ terminal->get_focus_frame = w32_get_focus_frame;
+ terminal->focus_frame_hook = w32_focus_frame;
terminal->frame_rehighlight_hook = w32_frame_rehighlight;
terminal->frame_raise_lower_hook = w32_frame_raise_lower;
+ terminal->frame_visible_invisible_hook = w32_make_frame_visible_invisible;
terminal->fullscreen_hook = w32fullscreen_hook;
+ terminal->iconify_frame_hook = w32_iconify_frame;
+ terminal->set_window_size_hook = w32_set_window_size;
+ terminal->set_frame_offset_hook = w32_set_offset;
+ terminal->set_frame_alpha_hook = w32_set_frame_alpha;
+ terminal->set_new_font_hook = w32_new_font;
+ terminal->set_bitmap_icon_hook = w32_bitmap_icon;
+ terminal->implicit_set_name_hook = w32_implicitly_set_name;
terminal->menu_show_hook = w32_menu_show;
+ terminal->activate_menubar_hook = w32_activate_menubar;
terminal->popup_dialog_hook = w32_popup_dialog;
+ terminal->change_tool_bar_height_hook = w32_change_tool_bar_height;
terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
terminal->set_horizontal_scroll_bar_hook = w32_set_horizontal_scroll_bar;
+ terminal->set_scroll_bar_default_width_hook = w32_set_scroll_bar_default_width;
+ terminal->set_scroll_bar_default_height_hook = w32_set_scroll_bar_default_height;
terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars;
terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;
terminal->judge_scroll_bars_hook = w32_judge_scroll_bars;
- terminal->delete_frame_hook = x_destroy_window;
- terminal->delete_terminal_hook = x_delete_terminal;
+ terminal->get_string_resource_hook = w32_get_string_resource;
+ terminal->delete_frame_hook = w32_destroy_window;
+ terminal->delete_terminal_hook = w32_delete_terminal;
/* Other hooks are NULL by default. */
/* We don't yet support separate terminals on W32, so don't try to share
}
static void
-x_delete_terminal (struct terminal *terminal)
+w32_delete_terminal (struct terminal *terminal)
{
struct w32_display_info *dpyinfo = terminal->display_info.w32;
block_input ();
- x_delete_display (dpyinfo);
+ w32_delete_display (dpyinfo);
unblock_input ();
}
/* Set the name of the terminal. */
terminal->name = xlispstrdup (display_name);
- dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL;
+ dpyinfo->rdb = xrm_option ? w32_make_rdb (xrm_option) : NULL;
/* Put this display on the chain. */
dpyinfo->next = x_display_list;
\f
/* Get rid of display DPYINFO, assuming all frames are already gone. */
void
-x_delete_display (struct w32_display_info *dpyinfo)
+w32_delete_display (struct w32_display_info *dpyinfo)
{
/* FIXME: the only display info apparently can't be deleted. */
/* free palette table */
Cursor horizontal_scroll_bar_cursor;
/* Resource data base */
- XrmDatabase xrdb;
+ const char *rdb;
/* color palette information. */
int has_palette;
extern HMENU current_popup_menu;
extern int menubar_in_use;
-extern struct frame *x_window_to_frame (struct w32_display_info *, HWND);
+extern struct frame *w32_window_to_frame (struct w32_display_info *, HWND);
-struct w32_display_info *x_display_info_for_name (Lisp_Object);
+extern void w32_real_positions (struct frame *f, int *xptr, int *yptr);
+
+extern void w32_clear_under_internal_border (struct frame *);
+
+extern void w32_change_tool_bar_height (struct frame *, int);
+extern void w32_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
+extern void w32_set_scroll_bar_default_width (struct frame *);
+extern void w32_set_scroll_bar_default_height (struct frame *);
-/* also defined in xterm.h XXX: factor out to common header */
extern struct w32_display_info *w32_term_init (Lisp_Object,
char *, char *);
extern int w32_defined_color (struct frame *f, const char *color,
XColor *color_def, bool alloc_p);
-extern int x_display_pixel_height (struct w32_display_info *);
-extern int x_display_pixel_width (struct w32_display_info *);
-extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_tool_bar_lines (struct frame *f,
- Lisp_Object value,
- Lisp_Object oldval);
-extern void x_set_internal_border_width (struct frame *f,
- Lisp_Object value,
- Lisp_Object oldval);
+extern int w32_display_pixel_height (struct w32_display_info *);
+extern int w32_display_pixel_width (struct w32_display_info *);
extern void initialize_frame_menubar (struct frame *);
extern void w32_dialog_in_progress (Lisp_Object in_progress);
+extern void w32_make_frame_visible (struct frame *f);
+extern void w32_make_frame_invisible (struct frame *f);
+extern void w32_iconify_frame (struct frame *f);
+extern void w32_free_frame_resources (struct frame *);
+extern void w32_wm_set_size_hint (struct frame *, long, bool);
+
/* w32inevt.c */
extern int w32_kbd_patch_key (KEY_EVENT_RECORD *event, int cpId);
extern int w32_kbd_mods_to_emacs (DWORD mods, WORD key);
extern void w32con_hide_cursor (void);
extern void w32con_show_cursor (void);
+/* w32reg.c */
+extern const char *w32_get_string_resource (void *v_rdb,
+ const char *name,
+ const char *class);
\f
#define PIX_TYPE COLORREF
extern struct w32_output w32term_display;
-/* Return the X output data for frame F. */
-#define FRAME_X_OUTPUT(f) ((f)->output_data.w32)
+/* Return the output data for frame F. */
+#define FRAME_OUTPUT_DATA(f) ((f)->output_data.w32)
/* Return the window associated with the frame F. */
#define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
-#define FRAME_X_WINDOW(f) FRAME_W32_WINDOW (f)
+#define FRAME_NATIVE_WINDOW(f) FRAME_W32_WINDOW (f)
#define FRAME_FONT(f) ((f)->output_data.w32->font)
#define FRAME_FONTSET(f) ((f)->output_data.w32->fontset)
extern BOOL parse_button (int, int, int *, int *);
extern void w32_sys_ring_bell (struct frame *f);
-extern void x_delete_display (struct w32_display_info *dpyinfo);
-extern void x_clear_under_internal_border (struct frame *f);
-extern void x_query_color (struct frame *, XColor *);
+extern void w32_query_color (struct frame *, XColor *);
+extern void w32_delete_display (struct w32_display_info *dpyinfo);
#define FILE_NOTIFICATIONS_SIZE 16384
/* Notifications come in sets. We use a doubly linked list with a
XSETFRAME (frame, f);
if (NILP (Vrun_hooks)
- || !f->can_x_set_window_size
+ || !f->can_set_window_size
|| !f->after_make_frame)
return;
ptrdiff_t number_of_windows;
if (!FRAME_LIVE_P (f)
- || !f->can_x_set_window_size
+ || !f->can_set_window_size
|| !f->after_make_frame
|| FRAME_TOOLTIP_P (f)
|| !(frame_window_change
int unit = horflag ? FRAME_COLUMN_WIDTH (f) : FRAME_LINE_HEIGHT (f);
/* Don't let the size drop below one unit. This is more comforting
- when we are called from x_set_tool_bar_lines since the latter may
+ when we are called from *_set_tool_bar_lines since the latter may
have implicitly given us a zero or negative height. */
if (pixelwise)
{
call1 (Qrecord_window_buffer, window);
}
- /* Disallow x_set_window_size, temporarily. */
- f->can_x_set_window_size = false;
+ /* Disallow set_window_size_hook, temporarily. */
+ f->can_set_window_size = false;
/* The mouse highlighting code could get screwed up
if it runs during this. */
block_input ();
if (NILP (leaf_windows[i]->contents))
free_window_matrices (leaf_windows[i]);
- /* Allow x_set_window_size again and apply frame size changes if
- needed. */
- f->can_x_set_window_size = true;
+ /* Allow set_window_size_hook again and apply frame size changes
+ if needed. */
+ f->can_set_window_size = true;
adjust_frame_size (f, -1, -1, 1, false, Qset_window_configuration);
adjust_frame_glyphs (f);
#include TERM_HEADER
#endif /* HAVE_WINDOW_SYSTEM */
-#ifndef FRAME_X_OUTPUT
-#define FRAME_X_OUTPUT(f) ((f)->output_data.x)
+#ifndef FRAME_OUTPUT_DATA
+#define FRAME_OUTPUT_DATA(f) (NULL)
#endif
#define DISP_INFINITY 10000000
/* Nil means don't try to resize. */
if ((NILP (Vresize_mini_windows)
&& (NILP (resize_mini_frames) || !FRAME_MINIBUF_ONLY_P (f)))
- || (FRAME_X_P (f) && FRAME_X_OUTPUT (f) == NULL))
+ || (FRAME_X_P (f) && FRAME_OUTPUT_DATA (f) == NULL))
return false;
/* By default, start display at the beginning. */
else
clear_current_matrices (f);
-#if defined (HAVE_WINDOW_SYSTEM) && !defined (HAVE_NS)
- x_clear_under_internal_border (f);
-#endif /* HAVE_WINDOW_SYSTEM && !HAVE_NS */
-
+#ifdef HAVE_WINDOW_SYSTEM
+ if (FRAME_RIF (f)->clear_under_internal_border)
+ FRAME_RIF (f)->clear_under_internal_border (f);
+#endif
fset_redisplay (f);
f->garbaged = false;
f->resized_p = false;
{
n = redisplay_mode_lines (FRAME_ROOT_WINDOW (f), false);
-#if defined (HAVE_WINDOW_SYSTEM) && !defined (HAVE_NS)
- x_clear_under_internal_border (f);
-#endif /* HAVE_WINDOW_SYSTEM && !HAVE_NS */
-
+#ifdef HAVE_WINDOW_SYSTEM
+ if (FRAME_RIF (f)->clear_under_internal_border)
+ FRAME_RIF (f)->clear_under_internal_border (f);
+#endif
}
if (window_height_changed_p
if (! STRINGP (f->name)
|| SBYTES (f->name) != len
|| memcmp (title, SDATA (f->name), len) != 0)
- x_implicitly_set_name (f, make_string (title, len), Qnil);
+ FRAME_TERMINAL (f)->implicit_set_name_hook (f,
+ make_string (title, len),
+ Qnil);
}
}
if (new_height != WINDOW_PIXEL_HEIGHT (w))
{
- x_change_tool_bar_height (f, new_height);
+ FRAME_TERMINAL (f)->change_tool_bar_height_hook (f, new_height);
frame_default_tool_bar_height = new_height;
/* Always do that now. */
clear_glyph_matrix (w->desired_matrix);
if (change_height_p)
{
- x_change_tool_bar_height (f, new_height);
+ FRAME_TERMINAL (f)->change_tool_bar_height_hook (f, new_height);
frame_default_tool_bar_height = new_height;
clear_glyph_matrix (w->desired_matrix);
f->n_tool_bar_rows = nrows;
clear_mouse_face (hlinfo);
/* Mouse is down, but on different tool-bar item? */
- mouse_down_p = (x_mouse_grabbed (dpyinfo)
+ mouse_down_p = (gui_mouse_grabbed (dpyinfo)
&& f == dpyinfo->last_mouse_frame);
if (mouse_down_p && f->last_tool_bar_item != prop_idx)
&& garbaged_frame_retries++ < MAX_GARBAGED_FRAME_RETRIES)
goto retry;
-#if defined (HAVE_WINDOW_SYSTEM) && !defined (HAVE_NS)
- x_clear_under_internal_border (f);
-#endif /* HAVE_WINDOW_SYSTEM && !HAVE_NS */
-
+#ifdef HAVE_WINDOW_SYSTEM
+ if (FRAME_RIF (f)->clear_under_internal_border)
+ FRAME_RIF (f)->clear_under_internal_border (f);
+#endif
/* Prevent various kinds of signals during display
update. stdio is not robust about handling
signals, which can cause an apparent I/O error. */
#ifndef HAVE_EXT_TOOL_BAR
if (draw == DRAW_NORMAL_TEXT
&& !EQ (hlinfo->mouse_face_window, f->tool_bar_window))
- FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
+ FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->text_cursor);
else
#endif
if (draw == DRAW_MOUSE_FACE)
- FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
+ FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->hand_cursor);
else
- FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
+ FRAME_RIF (f)->define_frame_cursor (f, FRAME_OUTPUT_DATA (f)->nontext_cursor);
}
#endif /* HAVE_WINDOW_SYSTEM */
}
if (!NILP (pointer))
{
if (EQ (pointer, Qarrow))
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
else if (EQ (pointer, Qhand))
- cursor = FRAME_X_OUTPUT (f)->hand_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->hand_cursor;
else if (EQ (pointer, Qtext))
- cursor = FRAME_X_OUTPUT (f)->text_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->text_cursor;
else if (EQ (pointer, intern ("hdrag")))
- cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor;
else if (EQ (pointer, intern ("nhdrag")))
- cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor;
# ifdef HAVE_X_WINDOWS
else if (EQ (pointer, intern ("vdrag")))
cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor;
# endif
else if (EQ (pointer, intern ("hourglass")))
- cursor = FRAME_X_OUTPUT (f)->hourglass_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->hourglass_cursor;
else if (EQ (pointer, Qmodeline))
- cursor = FRAME_X_OUTPUT (f)->modeline_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->modeline_cursor;
else
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
}
if (cursor != No_Cursor)
if (STRINGP (string))
{
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
if (NILP (pointer))
pointer = Fget_text_property (pos, Qpointer, string);
if (!KEYMAPP (map))
map = Fget_text_property (pos, Qkeymap, string);
if (!KEYMAPP (map) && draggable && area == ON_MODE_LINE)
- cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor;
}
}
else if (draggable && area == ON_MODE_LINE)
- cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor;
else
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
}
#endif
}
switch (part)
{
case INTERNAL_BORDER_NONE:
- if (cursor != FRAME_X_OUTPUT (f)->nontext_cursor)
+ if (cursor != FRAME_OUTPUT_DATA (f)->nontext_cursor)
/* Reset cursor. */
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
break;
case INTERNAL_BORDER_LEFT_EDGE:
- cursor = FRAME_X_OUTPUT (f)->left_edge_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->left_edge_cursor;
break;
case INTERNAL_BORDER_TOP_LEFT_CORNER:
- cursor = FRAME_X_OUTPUT (f)->top_left_corner_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->top_left_corner_cursor;
break;
case INTERNAL_BORDER_TOP_EDGE:
- cursor = FRAME_X_OUTPUT (f)->top_edge_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->top_edge_cursor;
break;
case INTERNAL_BORDER_TOP_RIGHT_CORNER:
- cursor = FRAME_X_OUTPUT (f)->top_right_corner_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->top_right_corner_cursor;
break;
case INTERNAL_BORDER_RIGHT_EDGE:
- cursor = FRAME_X_OUTPUT (f)->right_edge_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->right_edge_cursor;
break;
case INTERNAL_BORDER_BOTTOM_RIGHT_CORNER:
- cursor = FRAME_X_OUTPUT (f)->bottom_right_corner_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->bottom_right_corner_cursor;
break;
case INTERNAL_BORDER_BOTTOM_EDGE:
- cursor = FRAME_X_OUTPUT (f)->bottom_edge_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->bottom_edge_cursor;
break;
case INTERNAL_BORDER_BOTTOM_LEFT_CORNER:
- cursor = FRAME_X_OUTPUT (f)->bottom_left_corner_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->bottom_left_corner_cursor;
break;
default:
/* This should not happen. */
- if (cursor != FRAME_X_OUTPUT (f)->nontext_cursor)
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ if (cursor != FRAME_OUTPUT_DATA (f)->nontext_cursor)
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
}
- if (cursor != FRAME_X_OUTPUT (f)->nontext_cursor)
+ if (cursor != FRAME_OUTPUT_DATA (f)->nontext_cursor)
{
/* Do we really want a help echo here? */
help_echo_string = build_string ("drag-mouse-1: resize frame");
#ifdef HAVE_WINDOW_SYSTEM
if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN)
{
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
/* Show non-text cursor (Bug#16647). */
goto set_cursor;
}
#ifdef HAVE_WINDOW_SYSTEM
if (part == ON_VERTICAL_BORDER)
{
- cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor;
help_echo_string = build_string ("drag-mouse-1: resize");
goto set_cursor;
}
else if (part == ON_RIGHT_DIVIDER)
{
- cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->horizontal_drag_cursor;
help_echo_string = build_string ("drag-mouse-1: resize");
goto set_cursor;
}
|| minibuf_level
|| NILP (Vresize_mini_windows))
{
- cursor = FRAME_X_OUTPUT (f)->vertical_drag_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->vertical_drag_cursor;
help_echo_string = build_string ("drag-mouse-1: resize");
goto set_cursor;
}
else
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE
|| part == ON_VERTICAL_SCROLL_BAR
|| part == ON_HORIZONTAL_SCROLL_BAR)
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
else
- cursor = FRAME_X_OUTPUT (f)->text_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->text_cursor;
#endif
/* Are we in a window whose display is up to date?
{
#ifdef HAVE_WINDOW_SYSTEM
if (area != TEXT_AREA)
- cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
else
pointer = Vvoid_text_area_pointer;
#endif
static struct face *realize_face (struct face_cache *, Lisp_Object *,
int);
-static struct face *realize_x_face (struct face_cache *, Lisp_Object *);
+static struct face *realize_gui_face (struct face_cache *, Lisp_Object *);
static struct face *realize_tty_face (struct face_cache *, Lisp_Object *);
static bool realize_basic_faces (struct frame *);
static bool realize_default_face (struct frame *);
h = XFIXNUM (Fcar (Fcdr (name)));
bits = Fcar (Fcdr (Fcdr (name)));
- bitmap_id = x_create_bitmap_from_data (f, SSDATA (bits),
- w, h);
+ bitmap_id = image_create_bitmap_from_data (f, SSDATA (bits),
+ w, h);
}
else
{
/* It must be a string -- a file name. */
- bitmap_id = x_create_bitmap_from_file (f, name);
+ bitmap_id = image_create_bitmap_from_file (f, name);
}
unblock_input ();
if (!face_color_supported_p (f, SSDATA (bg), false)
&& !NILP (Fbitmap_spec_p (Vface_default_stipple)))
{
- x_destroy_bitmap (f, face->stipple);
+ image_destroy_bitmap (f, face->stipple);
face->stipple = load_pixmap (f, Vface_default_stipple);
}
CHECK_STRING (class);
f = decode_live_frame (frame);
block_input ();
- value = display_x_get_resource (FRAME_DISPLAY_INFO (f),
- resource, class, Qnil, Qnil);
+ value = gui_display_get_resource (FRAME_DISPLAY_INFO (f),
+ resource, class, Qnil, Qnil);
unblock_input ();
return value;
}
#ifdef HAVE_X_WINDOWS
free_face_colors (f, face);
#endif /* HAVE_X_WINDOWS */
- x_destroy_bitmap (f, face->stipple);
+ image_destroy_bitmap (f, face->stipple);
}
#endif /* HAVE_WINDOW_SYSTEM */
if (face->stipple)
{
xgcv.fill_style = FillOpaqueStippled;
- xgcv.stipple = x_bitmap_pixmap (f, face->stipple);
+ xgcv.stipple = image_bitmap_pixmap (f, face->stipple);
mask |= GCFillStyle | GCStipple;
}
#endif
(2) `close in spirit' to what the attributes specify, if not exact. */
static bool
-x_supports_face_attributes_p (struct frame *f,
- Lisp_Object attrs[LFACE_VECTOR_SIZE],
- struct face *def_face)
+gui_supports_face_attributes_p (struct frame *f,
+ Lisp_Object attrs[LFACE_VECTOR_SIZE],
+ struct face *def_face)
{
Lisp_Object *def_attrs = def_face->lface;
supports = tty_supports_face_attributes_p (f, attrs, def_face);
#ifdef HAVE_WINDOW_SYSTEM
else
- supports = x_supports_face_attributes_p (f, attrs, def_face);
+ supports = gui_supports_face_attributes_p (f, attrs, def_face);
#endif
return supports ? Qt : Qnil;
acceptable as a font for the default face (perhaps because
auto-scaled fonts are rejected), so we must adjust the frame
font. */
- x_set_font (f, LFACE_FONT (lface), Qnil);
+ gui_set_font (f, LFACE_FONT (lface), Qnil);
}
#endif
return true;
}
if (FRAME_WINDOW_P (cache->f))
- face = realize_x_face (cache, attrs);
+ face = realize_gui_face (cache, attrs);
else if (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f))
face = realize_tty_face (cache, attrs);
else if (FRAME_INITIAL_P (cache->f))
/* Realize the fully-specified face with attributes ATTRS in face
- cache CACHE for ASCII characters. Do it for X frame CACHE->f. If
- the new face doesn't share font with the default face, a fontname
- is allocated from the heap and set in `font_name' of the new face,
- but it is not yet loaded here. Value is a pointer to the newly
- created realized face. */
+ cache CACHE for ASCII characters. Do it for GUI frame CACHE->f.
+ If the new face doesn't share font with the default face, a
+ fontname is allocated from the heap and set in `font_name' of the
+ new face, but it is not yet loaded here. Value is a pointer to the
+ newly created realized face. */
static struct face *
-realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE])
+realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE])
{
struct face *face = NULL;
#ifdef HAVE_WINDOW_SYSTEM
bool result = false;
Lisp_Object found;
- found = x_find_image_file (file);
+ found = image_find_image_file (file);
if (! NILP (found))
{
#endif /* USE_GTK */
-/* Functions called only from `x_set_frame_param'
+/* Functions called only from `gui_set_frame_parameters'
to set individual parameters.
If FRAME_X_WINDOW (f) is 0,
? f->icon_name
: f->name)));
else
- result = x_bitmap_icon (f, arg);
+ result = FRAME_TERMINAL (f)->set_bitmap_icon_hook (f, arg);
if (result)
{
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
Lisp_Object tem;
- tem = x_get_arg (dpyinfo, alist, prop, xprop, xclass, RES_TYPE_STRING);
+ tem = gui_display_get_arg (dpyinfo, alist, prop, xprop, xclass,
+ RES_TYPE_STRING);
if (EQ (tem, Qunbound))
{
#ifdef USE_TOOLKIT_SCROLL_BARS
AUTO_STRING (foreground, "foreground");
AUTO_STRING (background, "foreground");
AUTO_STRING (verticalScrollBar, "verticalScrollBar");
- tem = (display_x_get_resource
+ tem = (gui_display_get_resource
(dpyinfo, foreground_p ? foreground : background,
empty_unibyte_string,
verticalScrollBar,
}
AUTO_FRAME_ARG (arg, prop, tem);
- x_set_frame_parameters (f, arg);
+ gui_set_frame_parameters (f, arg);
return tem;
}
/* Set the position of the icon. Note that twm groups all
icons in an icon window. */
- icon_x = x_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
- icon_y = x_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
+ icon_x = gui_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
+ icon_y = gui_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
{
CHECK_FIXNUM (icon_x);
/* Set the position of the icon. Note that twm groups all
icons in an icon window. */
Lisp_Object icon_x
- = x_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
+ = gui_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
Lisp_Object icon_y
- = x_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
+ = gui_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
{
CHECK_TYPE_RANGED_INTEGER (int, icon_x);
if (! EQ (icon_x, Qunbound))
x_wm_set_icon_position (f, XFIXNUM (icon_x), XFIXNUM (icon_y));
-#if false /* x_get_arg removes the visibility parameter as a side effect,
- but x_create_frame still needs it. */
+#if false /* gui_display_get_arg removes the visibility parameter as a
+ side effect, but x_create_frame still needs it. */
/* Start up iconic or window? */
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
x_wm_set_window_state
- (f, (EQ (x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL),
+ (f, (EQ (gui_display_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
+ RES_TYPE_SYMBOL),
Qicon)
? IconicState
: NormalState));
/* Handler for signals raised during x_create_frame and
- x_create_tip_frame. FRAME is the frame which is partially
+ Fx_create_tip_frame. FRAME is the frame which is partially
constructed. */
static Lisp_Object
/* If frame is already dead, nothing to do. This can happen if the
display is disconnected after the frame has become official, but
- before x_create_frame removes the unwind protect. */
+ before Fx_create_frame removes the unwind protect. */
if (!FRAME_LIVE_P (f))
return Qnil;
x_default_font_parameter (struct frame *f, Lisp_Object parms)
{
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
- Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
- RES_TYPE_STRING);
+ Lisp_Object font_param = gui_display_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
+ RES_TYPE_STRING);
Lisp_Object font = Qnil;
if (EQ (font_param, Qunbound))
font_param = Qnil;
if (NILP (font))
font = !NILP (font_param) ? font_param
- : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING);
+ : gui_display_get_arg (dpyinfo, parms, Qfont, "font", "Font",
+ RES_TYPE_STRING);
if (! FONTP (font) && ! STRINGP (font))
{
/* Remember the explicit font parameter, so we can re-apply it after
we've applied the `default' face settings. */
AUTO_FRAME_ARG (arg, Qfont_parameter, font_param);
- x_set_frame_parameters (f, arg);
+ gui_set_frame_parameters (f, arg);
}
/* This call will make X resources override any system font setting. */
- x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
}
until we know if this frame has a specified name. */
Vx_resource_name = Vinvocation_name;
- display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_NUMBER);
+ display = gui_display_get_arg (dpyinfo, parms, Qterminal, 0, 0,
+ RES_TYPE_NUMBER);
if (EQ (display, Qunbound))
- display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING);
+ display = gui_display_get_arg (dpyinfo, parms, Qdisplay, 0, 0,
+ RES_TYPE_STRING);
if (EQ (display, Qunbound))
display = Qnil;
dpyinfo = check_x_display_info (display);
if (!dpyinfo->terminal->name)
error ("Terminal is not live, can't create new frames on it");
- name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
+ name = gui_display_get_arg (dpyinfo, parms, Qname, "name", "Name",
+ RES_TYPE_STRING);
if (!STRINGP (name)
&& ! EQ (name, Qunbound)
&& ! NILP (name))
Vx_resource_name = name;
/* See if parent window is specified. */
- parent = x_get_arg (dpyinfo, parms, Qparent_id, NULL, NULL, RES_TYPE_NUMBER);
+ parent = gui_display_get_arg (dpyinfo, parms, Qparent_id, NULL, NULL,
+ RES_TYPE_NUMBER);
if (EQ (parent, Qunbound))
parent = Qnil;
if (! NILP (parent))
CHECK_FIXNUM (parent);
frame = Qnil;
- tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer",
- RES_TYPE_SYMBOL);
+ tem = gui_display_get_arg (dpyinfo,
+ 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))
else
f = make_frame (true);
- parent_frame = x_get_arg (dpyinfo, parms, Qparent_frame, NULL, NULL,
- RES_TYPE_SYMBOL);
+ parent_frame = gui_display_get_arg (dpyinfo,
+ parms,
+ Qparent_frame,
+ NULL,
+ NULL,
+ RES_TYPE_SYMBOL);
/* Accept parent-frame iff parent-id was not specified. */
if (!NILP (parent)
|| EQ (parent_frame, Qunbound)
fset_parent_frame (f, parent_frame);
store_frame_param (f, Qparent_frame, parent_frame);
- if (!NILP (tem = (x_get_arg (dpyinfo, parms, Qundecorated, NULL, NULL,
- RES_TYPE_BOOLEAN)))
+ if (!NILP (tem = (gui_display_get_arg (dpyinfo,
+ parms,
+ Qundecorated,
+ NULL,
+ NULL,
+ RES_TYPE_BOOLEAN)))
&& !(EQ (tem, Qunbound)))
undecorated = true;
FRAME_UNDECORATED (f) = undecorated;
store_frame_param (f, Qundecorated, undecorated ? Qt : Qnil);
- if (!NILP (tem = (x_get_arg (dpyinfo, parms, Qoverride_redirect, NULL, NULL,
- RES_TYPE_BOOLEAN)))
+ if (!NILP (tem = (gui_display_get_arg (dpyinfo,
+ parms,
+ Qoverride_redirect,
+ NULL,
+ NULL,
+ RES_TYPE_BOOLEAN)))
&& !(EQ (tem, Qunbound)))
override_redirect = true;
f->output_data.x->white_relief.pixel = -1;
f->output_data.x->black_relief.pixel = -1;
- fset_icon_name (f,
- x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
- RES_TYPE_STRING));
+ fset_icon_name (f, gui_display_get_arg (dpyinfo,
+ parms,
+ Qicon_name,
+ "iconName",
+ "Title",
+ RES_TYPE_STRING));
if (! STRINGP (f->icon_name))
fset_icon_name (f, Qnil);
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
- x_default_parameter (f, parms, Qfont_backend, Qnil,
- "fontBackend", "FontBackend", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
/* Extract the window parameters from the supplied values
that are needed to determine window geometry. */
/* Frame contents get displaced if an embedded X window has a border. */
if (! FRAME_X_EMBEDDED_P (f))
- x_default_parameter (f, parms, Qborder_width, make_fixnum (0),
- "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qborder_width, make_fixnum (0),
+ "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
/* This defaults to 1 in order to match xterm. We recognize either
internalBorderWidth or internalBorder (which is what xterm calls
{
Lisp_Object value;
- value = x_get_arg (dpyinfo, parms, Qinternal_border_width,
- "internalBorder", "internalBorder", RES_TYPE_NUMBER);
+ value = gui_display_get_arg (dpyinfo, parms, Qinternal_border_width,
+ "internalBorder", "internalBorder",
+ RES_TYPE_NUMBER);
if (! EQ (value, Qunbound))
parms = Fcons (Fcons (Qinternal_border_width, value),
parms);
}
- x_default_parameter (f, parms, Qinternal_border_width,
+ gui_default_parameter (f, parms, Qinternal_border_width,
#ifdef USE_GTK /* We used to impose 0 in xg_create_frame_widgets. */
- make_fixnum (0),
+ make_fixnum (0),
#else
- make_fixnum (1),
+ make_fixnum (1),
#endif
- "internalBorderWidth", "internalBorderWidth",
- RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
- NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
- NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qvertical_scroll_bars,
+ "internalBorderWidth", "internalBorderWidth",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qvertical_scroll_bars,
#if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS)
- Qright,
+ Qright,
#else
- Qleft,
+ Qleft,
#endif
- "verticalScrollBars", "ScrollBars",
- RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qhorizontal_scroll_bars, Qnil,
- "horizontalScrollBars", "ScrollBars",
- RES_TYPE_SYMBOL);
+ "verticalScrollBars", "ScrollBars",
+ RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qhorizontal_scroll_bars, Qnil,
+ "horizontalScrollBars", "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"),
- "foreground", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
- "background", "Background", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qmouse_color, build_string ("black"),
- "pointerColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qborder_color, build_string ("black"),
- "borderColor", "BorderColor", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qscreen_gamma, Qnil,
- "screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
- x_default_parameter (f, parms, Qline_spacing, Qnil,
- "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qleft_fringe, Qnil,
- "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qright_fringe, Qnil,
- "rightFringe", "RightFringe", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qno_special_glyphs, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qforeground_color, build_string ("black"),
+ "foreground", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qbackground_color, build_string ("white"),
+ "background", "Background", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qmouse_color, build_string ("black"),
+ "pointerColor", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qborder_color, build_string ("black"),
+ "borderColor", "BorderColor", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qscreen_gamma, Qnil,
+ "screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
+ gui_default_parameter (f, parms, Qline_spacing, Qnil,
+ "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qleft_fringe, Qnil,
+ "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qright_fringe, Qnil,
+ "rightFringe", "RightFringe", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qno_special_glyphs, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
x_default_scroll_bar_color_parameter (f, parms, Qscroll_bar_foreground,
"scrollBarForeground",
"scrollBarBackground",
"ScrollBarBackground", false);
- /* Init faces before x_default_parameter is called for the
+ /* Init faces before gui_default_parameter is called for the
scroll-bar-width parameter because otherwise we end up in
init_iterator with a null face cache, which should not happen. */
init_frame_faces (f);
Also process `min-width' and `min-height' parameters right here
because `frame-windows-min-size' needs them. */
- tem = x_get_arg (dpyinfo, parms, Qmin_width, NULL, NULL, RES_TYPE_NUMBER);
+ tem = gui_display_get_arg (dpyinfo, parms, Qmin_width, NULL, NULL,
+ RES_TYPE_NUMBER);
if (FIXNUMP (tem))
store_frame_param (f, Qmin_width, tem);
- tem = x_get_arg (dpyinfo, parms, Qmin_height, NULL, NULL, RES_TYPE_NUMBER);
+ tem = gui_display_get_arg (dpyinfo, parms, Qmin_height, NULL, NULL,
+ RES_TYPE_NUMBER);
if (FIXNUMP (tem))
store_frame_param (f, Qmin_height, tem);
adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
here; they are processed specially at startup, and reflected in
the values of the mode variables. */
- x_default_parameter (f, parms, Qmenu_bar_lines,
- NILP (Vmenu_bar_mode)
- ? make_fixnum (0) : make_fixnum (1),
- NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qtool_bar_lines,
- NILP (Vtool_bar_mode)
- ? make_fixnum (0) : make_fixnum (1),
- NULL, NULL, RES_TYPE_NUMBER);
-
- x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
- "bufferPredicate", "BufferPredicate",
- RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qtitle, Qnil,
- "title", "Title", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qwait_for_wm, Qt,
- "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qtool_bar_position,
- FRAME_TOOL_BAR_POSITION (f), 0, 0, RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qinhibit_double_buffering, Qnil,
- "inhibitDoubleBuffering", "InhibitDoubleBuffering",
- RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qmenu_bar_lines,
+ NILP (Vmenu_bar_mode)
+ ? make_fixnum (0) : make_fixnum (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qtool_bar_lines,
+ NILP (Vtool_bar_mode)
+ ? make_fixnum (0) : make_fixnum (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+
+ gui_default_parameter (f, parms, Qbuffer_predicate, Qnil,
+ "bufferPredicate", "BufferPredicate",
+ RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qtitle, Qnil,
+ "title", "Title", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qwait_for_wm, Qt,
+ "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qtool_bar_position,
+ FRAME_TOOL_BAR_POSITION (f), 0, 0, RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qinhibit_double_buffering, Qnil,
+ "inhibitDoubleBuffering", "InhibitDoubleBuffering",
+ RES_TYPE_BOOLEAN);
/* Compute the size of the X window. */
- window_prompting = x_figure_window_size (f, parms, true, &x_width, &x_height);
+ window_prompting = gui_figure_window_size (f, parms, true,
+ &x_width, &x_height);
- tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
+ tem = gui_display_get_arg (dpyinfo, parms, Qunsplittable, 0, 0,
+ RES_TYPE_BOOLEAN);
f->no_split = minibuffer_only || EQ (tem, Qt);
x_icon_verify (f, parms);
/* We need to do this after creating the X window, so that the
icon-creation functions can say whose icon they're describing. */
- x_default_parameter (f, parms, Qicon_type, Qt,
- "bitmapIcon", "BitmapIcon", RES_TYPE_BOOLEAN);
-
- x_default_parameter (f, parms, Qauto_raise, Qnil,
- "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qauto_lower, Qnil,
- "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qcursor_type, Qbox,
- "cursorType", "CursorType", RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
- "scrollBarWidth", "ScrollBarWidth",
- RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qscroll_bar_height, Qnil,
- "scrollBarHeight", "ScrollBarHeight",
- RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qalpha, Qnil,
- "alpha", "Alpha", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qicon_type, Qt,
+ "bitmapIcon", "BitmapIcon", RES_TYPE_BOOLEAN);
+
+ gui_default_parameter (f, parms, Qauto_raise, Qnil,
+ "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qauto_lower, Qnil,
+ "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qcursor_type, Qbox,
+ "cursorType", "CursorType", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qscroll_bar_width, Qnil,
+ "scrollBarWidth", "ScrollBarWidth",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qscroll_bar_height, Qnil,
+ "scrollBarHeight", "ScrollBarHeight",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qalpha, Qnil,
+ "alpha", "Alpha", RES_TYPE_NUMBER);
if (!NILP (parent_frame))
{
unblock_input ();
}
- x_default_parameter (f, parms, Qno_focus_on_map, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qno_accept_focus, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qno_focus_on_map, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qno_accept_focus, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
/* Create the menu bar. */
#endif /* USE_X_TOOLKIT || USE_GTK */
/* Consider frame official, now. */
- f->can_x_set_window_size = true;
+ f->can_set_window_size = true;
if (x_width > 0)
SET_FRAME_WIDTH (f, x_width);
/* Process fullscreen parameter here in the hope that normalizing a
fullheight/fullwidth frame will produce the size set by the last
adjust_frame_size call. */
- x_default_parameter (f, parms, Qfullscreen, Qnil,
- "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qfullscreen, Qnil,
+ "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
/* Make the window appear on the frame and enable display, unless
the caller says not to. However, with explicit parent, Emacs
if (!f->output_data.x->explicit_parent)
{
Lisp_Object visibility
- = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL);
+ = gui_display_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
+ RES_TYPE_SYMBOL);
if (EQ (visibility, Qicon))
x_iconify_frame (f);
unblock_input ();
/* Works iff frame has been already mapped. */
- x_default_parameter (f, parms, Qskip_taskbar, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qskip_taskbar, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
/* The `z-group' parameter works only for visible frames. */
- x_default_parameter (f, parms, Qz_group, Qnil,
- NULL, NULL, RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qz_group, Qnil,
+ NULL, NULL, RES_TYPE_SYMBOL);
/* Initialize `default-minibuffer-frame' in case this is the first
frame on this terminal. */
|| !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
kset_default_minibuffer_frame (kb, frame);
- /* All remaining specified parameters, which have not been "used"
- by x_get_arg and friends, now go in the misc. alist of the frame. */
+ /* All remaining specified parameters, which have not been "used" by
+ gui_display_get_arg and friends, now go in the misc. alist of the
+ frame. */
for (tem = parms; CONSP (tem); tem = XCDR (tem))
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
fset_param_alist (f, Fcons (XCAR (tem), f->param_alist));
return unbind_to (count, frame);
}
-
-/* FRAME is used only to get a handle on the X display. We don't pass the
- display info directly because we're called from frame.c, which doesn't
- know about that structure. */
-
-Lisp_Object
-x_get_focus_frame (struct frame *frame)
-{
- struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
- Lisp_Object xfocus;
- if (! dpyinfo->x_focus_frame)
- return Qnil;
-
- XSETFRAME (xfocus, dpyinfo->x_focus_frame);
- return xfocus;
-}
-
-
-/* In certain situations, when the window manager follows a
- click-to-focus policy, there seems to be no way around calling
- XSetInputFocus to give another frame the input focus .
-
- In an ideal world, XSetInputFocus should generally be avoided so
- that applications don't interfere with the window manager's focus
- policy. But I think it's okay to use when it's clearly done
- following a user-command. */
-
-void
-x_focus_frame (struct frame *f, bool noactivate)
-{
- Display *dpy = FRAME_X_DISPLAY (f);
-
- block_input ();
- x_catch_errors (dpy);
-
- if (FRAME_X_EMBEDDED_P (f))
- {
- /* For Xembedded frames, normally the embedder forwards key
- events. See XEmbed Protocol Specification at
- http://freedesktop.org/wiki/Specifications/xembed-spec */
- xembed_request_focus (f);
- }
- else
- {
- XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- RevertToParent, CurrentTime);
- if (!noactivate)
- x_ewmh_activate_frame (f);
- }
-
- x_uncatch_errors ();
- unblock_input ();
-}
-
\f
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Internal function called by `color-defined-p'.
/* See if a visual is specified. */
AUTO_STRING (visualClass, "visualClass");
AUTO_STRING (VisualClass, "VisualClass");
- Lisp_Object value = display_x_get_resource (dpyinfo, visualClass,
- VisualClass, Qnil, Qnil);
+ Lisp_Object value = gui_display_get_resource (dpyinfo, visualClass,
+ VisualClass, Qnil, Qnil);
if (STRINGP (value))
{
PARMS is a list of frame parameters. TEXT is the string to
display in the tip frame. Value is the frame.
- Note that functions called here, esp. x_default_parameter can
+ Note that functions called here, esp. gui_default_parameter can
signal errors, for instance when a specified color name is
undefined. We have to make sure that we're in a consistent state
when this happens. */
parms = Fcopy_alist (parms);
/* Get the name of the frame to use for resource lookup. */
- name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
+ name = gui_display_get_arg (dpyinfo, parms, Qname, "name", "Name",
+ RES_TYPE_STRING);
if (!STRINGP (name)
&& !EQ (name, Qunbound)
&& !NILP (name))
dpyinfo_refcount = dpyinfo->reference_count;
#endif /* GLYPH_DEBUG */
- x_default_parameter (f, parms, Qfont_backend, Qnil,
- "fontBackend", "FontBackend", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qfont_backend, Qnil,
+ "fontBackend", "FontBackend", RES_TYPE_STRING);
/* Extract the window parameters from the supplied values that are
needed to determine window geometry. */
x_default_font_parameter (f, parms);
- x_default_parameter (f, parms, Qborder_width, make_fixnum (0),
- "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qborder_width, make_fixnum (0),
+ "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
/* This defaults to 2 in order to match xterm. We recognize either
internalBorderWidth or internalBorder (which is what xterm calls
{
Lisp_Object value;
- value = x_get_arg (dpyinfo, parms, Qinternal_border_width,
- "internalBorder", "internalBorder", RES_TYPE_NUMBER);
+ value = gui_display_get_arg (dpyinfo, parms, Qinternal_border_width,
+ "internalBorder", "internalBorder",
+ RES_TYPE_NUMBER);
if (! EQ (value, Qunbound))
parms = Fcons (Fcons (Qinternal_border_width, value),
parms);
}
- x_default_parameter (f, parms, Qinternal_border_width, make_fixnum (1),
- "internalBorderWidth", "internalBorderWidth",
- RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
- NULL, NULL, RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
- NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qinternal_border_width, make_fixnum (1),
+ "internalBorderWidth", "internalBorderWidth",
+ RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qright_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qbottom_divider_width, make_fixnum (0),
+ NULL, NULL, RES_TYPE_NUMBER);
/* Also do the stuff which must be set before the window exists. */
- x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
- "foreground", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
- "background", "Background", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qmouse_color, build_string ("black"),
- "pointerColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qcursor_color, build_string ("black"),
- "cursorColor", "Foreground", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qborder_color, build_string ("black"),
- "borderColor", "BorderColor", RES_TYPE_STRING);
- x_default_parameter (f, parms, Qno_special_glyphs, Qnil,
- NULL, NULL, RES_TYPE_BOOLEAN);
-
- /* Init faces before x_default_parameter is called for the
+ gui_default_parameter (f, parms, Qforeground_color, build_string ("black"),
+ "foreground", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qbackground_color, build_string ("white"),
+ "background", "Background", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qmouse_color, build_string ("black"),
+ "pointerColor", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qcursor_color, build_string ("black"),
+ "cursorColor", "Foreground", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qborder_color, build_string ("black"),
+ "borderColor", "BorderColor", RES_TYPE_STRING);
+ gui_default_parameter (f, parms, Qno_special_glyphs, Qnil,
+ NULL, NULL, RES_TYPE_BOOLEAN);
+
+ /* Init faces before gui_default_parameter is called for the
scroll-bar-width parameter because otherwise we end up in
init_iterator with a null face cache, which should not happen. */
init_frame_faces (f);
f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
- x_figure_window_size (f, parms, false, &x_width, &x_height);
+ gui_figure_window_size (f, parms, false, &x_width, &x_height);
{
XSetWindowAttributes attrs;
x_make_gc (f);
- x_default_parameter (f, parms, Qauto_raise, Qnil,
- "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qauto_lower, Qnil,
- "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
- x_default_parameter (f, parms, Qcursor_type, Qbox,
- "cursorType", "CursorType", RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qalpha, Qnil,
- "alpha", "Alpha", RES_TYPE_NUMBER);
+ gui_default_parameter (f, parms, Qauto_raise, Qnil,
+ "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qauto_lower, Qnil,
+ "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
+ gui_default_parameter (f, parms, Qcursor_type, Qbox,
+ "cursorType", "CursorType", RES_TYPE_SYMBOL);
+ gui_default_parameter (f, parms, Qalpha, Qnil,
+ "alpha", "Alpha", RES_TYPE_NUMBER);
/* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
Change will not be effected unless different from the current
below. And the frame needs to be on Vframe_list or making it
visible won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- f->can_x_set_window_size = true;
+ f->can_set_window_size = true;
/* Setting attributes of faces of the tooltip frame from resources
and similar will set face_change, which leads to the clearing of
frame_parm_handler x_frame_parm_handlers[] =
{
- x_set_autoraise,
- x_set_autolower,
+ gui_set_autoraise,
+ gui_set_autolower,
x_set_background_color,
x_set_border_color,
- x_set_border_width,
+ gui_set_border_width,
x_set_cursor_color,
x_set_cursor_type,
- x_set_font,
+ gui_set_font,
x_set_foreground_color,
x_set_icon_name,
x_set_icon_type,
x_set_internal_border_width,
- x_set_right_divider_width,
- x_set_bottom_divider_width,
+ gui_set_right_divider_width,
+ gui_set_bottom_divider_width,
x_set_menu_bar_lines,
x_set_mouse_color,
x_explicitly_set_name,
- x_set_scroll_bar_width,
- x_set_scroll_bar_height,
+ gui_set_scroll_bar_width,
+ gui_set_scroll_bar_height,
x_set_title,
- x_set_unsplittable,
- x_set_vertical_scroll_bars,
- x_set_horizontal_scroll_bars,
- x_set_visibility,
+ gui_set_unsplittable,
+ gui_set_vertical_scroll_bars,
+ gui_set_horizontal_scroll_bars,
+ gui_set_visibility,
x_set_tool_bar_lines,
x_set_scroll_bar_foreground,
x_set_scroll_bar_background,
- x_set_screen_gamma,
- x_set_line_spacing,
- x_set_left_fringe,
- x_set_right_fringe,
+ gui_set_screen_gamma,
+ gui_set_line_spacing,
+ gui_set_left_fringe,
+ gui_set_right_fringe,
x_set_wait_for_wm,
- x_set_fullscreen,
- x_set_font_backend,
- x_set_alpha,
+ gui_set_fullscreen,
+ gui_set_font_backend,
+ gui_set_alpha,
x_set_sticky,
x_set_tool_bar_position,
x_set_inhibit_double_buffering,
x_set_no_accept_focus,
x_set_z_group,
x_set_override_redirect,
- x_set_no_special_glyphs,
+ gui_set_no_special_glyphs,
};
void
{
char *full_name = alloca (strlen (name) + sizeof "customization" + 3);
char *full_class = alloca (strlen (class) + sizeof "Customization" + 3);
- char *result;
+ const char *result;
sprintf (full_name, "%s.%s", name, "customization");
sprintf (full_class, "%s.%s", class, "Customization");
- result = x_get_string_resource (db, full_name, full_class);
+ result = x_get_string_resource (&db, full_name, full_class);
return result ? xstrdup (result) : NULL;
}
/* Retrieve the string resource specified by NAME with CLASS from
database RDB. */
-char *
-x_get_string_resource (XrmDatabase rdb, const char *name, const char *class)
+const char *
+x_get_string_resource (void *v_rdb, const char *name, const char *class)
{
+ XrmDatabase *rdb = v_rdb;
XrmValue value;
if (inhibit_x_resources)
/* --quick was passed, so this is a no-op. */
return NULL;
- if (x_get_resource (rdb, name, class, x_rm_string, &value))
- return (char *) value.addr;
+ if (x_get_resource (*rdb, name, class, x_rm_string, &value))
+ return (const char *) value.addr;
- return 0;
+ return NULL;
}
\f
/* Stand-alone test facilities. */
printf ("Class: ");
gets (query_class);
- value = x_get_string_resource (xdb, query_name, query_class);
+ value = x_get_string_resource (&xdb, query_name, query_class);
if (value != NULL)
printf ("\t%s(%s): %s\n\n", query_name, query_class, value);
XGetGCValues (FRAME_X_DISPLAY (f), gc, GCForeground, &xgcv);
color.pixel = xgcv.foreground;
- x_query_color (f, &color);
+ x_query_colors (f, &color, 1);
cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0,
color.green / 65535.0, color.blue / 65535.0);
}
XGetGCValues (FRAME_X_DISPLAY (f), gc, GCBackground, &xgcv);
color.pixel = xgcv.background;
- x_query_color (f, &color);
+ x_query_colors (f, &color, 1);
cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0,
color.green / 65535.0, color.blue / 65535.0);
}
#define OPAQUE 0xffffffff
-void
+static void
x_set_frame_alpha (struct frame *f)
{
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
}
-/* On frame F, translate pixel color to RGB values for the color in
- COLOR. Use cached information, if available. */
-
-void
-x_query_color (struct frame *f, XColor *color)
-{
- x_query_colors (f, color, 1);
-}
-
-
/* On frame F, translate the color name to RGB values. Use cached
information, if possible.
color.pixel = pixel;
block_input ();
/* The color could still be found in the color_cells array. */
- x_query_color (f, &color);
+ x_query_colors (f, &color, 1);
XAllocColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &color);
unblock_input ();
#ifdef DEBUG_X_COLORS
/* Get RGB color values. */
color.pixel = *pixel;
- x_query_color (f, &color);
+ x_query_colors (f, &color, 1);
/* Change RGB values by specified FACTOR. Avoid overflow! */
eassert (factor >= 0);
/* Convert a keysym to its name. */
char *
-x_get_keysym_name (int keysym)
+get_keysym_name (int keysym)
{
char *value;
x_catch_errors (FRAME_X_DISPLAY (*fp));
- if (x_mouse_grabbed (dpyinfo))
+ if (gui_mouse_grabbed (dpyinfo))
{
/* If mouse was grabbed on a frame, give coords for that frame
even if the mouse is now outside it. */
if (event->xunmap.window == tip_window)
{
tip_window = None;
- x_redo_mouse_highlight (dpyinfo);
+ gui_redo_mouse_highlight (dpyinfo);
}
f = x_top_window_to_frame (dpyinfo, event->xunmap.window);
previous_help_echo_string = help_echo_string;
help_echo_string = Qnil;
- f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
+ f = (gui_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
: x_window_to_frame (dpyinfo, event->xmotion.window));
if (hlinfo->mouse_face_hidden)
dpyinfo->last_mouse_glyph_frame = NULL;
x_display_set_last_user_time (dpyinfo, event->xbutton.time);
- if (x_mouse_grabbed (dpyinfo))
+ if (gui_mouse_grabbed (dpyinfo))
f = dpyinfo->last_mouse_frame;
else
{
/* Make the x-window of frame F use the gnu icon bitmap. */
-bool
+static bool
x_bitmap_icon (struct frame *f, Lisp_Object file)
{
ptrdiff_t bitmap_id;
/* Free up our existing icon bitmap and mask if any. */
if (f->output_data.x->icon_bitmap > 0)
- x_destroy_bitmap (f, f->output_data.x->icon_bitmap);
+ image_destroy_bitmap (f, f->output_data.x->icon_bitmap);
f->output_data.x->icon_bitmap = 0;
if (STRINGP (file))
if (xg_set_icon (f, file))
return false;
#endif /* USE_GTK */
- bitmap_id = x_create_bitmap_from_file (f, file);
+ bitmap_id = image_create_bitmap_from_file (f, file);
x_create_bitmap_mask (f, bitmap_id);
}
else
/* If all else fails, use the (black and white) xbm image. */
if (rc == -1)
{
- rc = x_create_bitmap_from_data (f, (char *) gnu_xbm_bits,
- gnu_xbm_width, gnu_xbm_height);
+ rc = image_create_bitmap_from_data (f,
+ (char *) gnu_xbm_bits,
+ gnu_xbm_width,
+ gnu_xbm_height);
if (rc == -1)
return true;
this increments the ref-count one extra time.
As a result, the GNU bitmap and mask are never freed.
That way, we don't have to worry about allocating it again. */
- x_reference_bitmap (f, FRAME_DISPLAY_INFO (f)->icon_bitmap_id);
+ image_reference_bitmap (f, FRAME_DISPLAY_INFO (f)->icon_bitmap_id);
bitmap_id = FRAME_DISPLAY_INFO (f)->icon_bitmap_id;
}
}
if (f->output_data.x->icon_bitmap > 0)
- x_destroy_bitmap (f, f->output_data.x->icon_bitmap);
+ image_destroy_bitmap (f, f->output_data.x->icon_bitmap);
f->output_data.x->icon_bitmap = 0;
x_wm_set_icon_pixmap (f, 0);
frame. If it is negative, generate a new fontset from
FONT-OBJECT. */
-Lisp_Object
+static Lisp_Object
x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
{
struct font *font = XFONT_OBJECT (font_object);
{
if (dpyinfo->xim)
XCloseIM (dpyinfo->xim);
- xim = XOpenIM (dpyinfo->display, dpyinfo->xrdb, resource_name,
+ xim = XOpenIM (dpyinfo->display, dpyinfo->rdb, resource_name,
emacs_class);
dpyinfo->xim = xim;
xim_inst->dpyinfo = dpyinfo;
xim_inst->resource_name = xstrdup (resource_name);
ret = XRegisterIMInstantiateCallback
- (dpyinfo->display, dpyinfo->xrdb, xim_inst->resource_name,
+ (dpyinfo->display, dpyinfo->rdb, xim_inst->resource_name,
emacs_class, xim_instantiate_callback,
/* This is XPointer in XFree86 but (XPointer *)
on Tru64, at least, hence the configure test. */
if (dpyinfo->display)
{
Bool ret = XUnregisterIMInstantiateCallback
- (dpyinfo->display, dpyinfo->xrdb, xim_inst->resource_name,
+ (dpyinfo->display, dpyinfo->rdb, xim_inst->resource_name,
emacs_class, xim_instantiate_callback,
(XRegisterIMInstantiateCallback_arg6) xim_inst);
eassert (ret == True);
/* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
to really change the position, and 0 when calling from
x_make_frame_visible (in that case, XOFF and YOFF are the current
- position values). It is -1 when calling from x_set_frame_parameters,
+ position values). It is -1 when calling from gui_set_frame_parameters,
which means, do adjust for borders but don't change the gravity. */
-void
+static void
x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity)
{
int modified_top, modified_left;
int cur;
bool dummy;
- get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy);
+ x_get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy);
/* Some window managers don't say they support _NET_WM_STATE, but they do say
they support _NET_WM_STATE_FULLSCREEN. Try that also. */
/* Try to restore fullscreen state. */
{
store_frame_param (f, Qfullscreen, fullscreen);
- x_set_fullscreen (f, fullscreen, fullscreen);
+ gui_set_fullscreen (f, fullscreen, fullscreen);
}
}
else
\f
/* Raise frame F. */
-void
+static void
x_raise_frame (struct frame *f)
{
block_input ();
}
}
+static void
+XTframe_raise_lower (struct frame *f, bool raise_flag)
+{
+ if (raise_flag)
+ x_raise_frame (f);
+ else
+ x_lower_frame (f);
+}
+
/* Request focus with XEmbed */
-void
+static void
xembed_request_focus (struct frame *f)
{
/* See XEmbed Protocol Specification at
/* Activate frame with Extended Window Manager Hints */
-void
+static void
x_ewmh_activate_frame (struct frame *f)
{
/* See Window Manager Specification/Extended Window Manager Hints at
}
}
+static Lisp_Object
+x_get_focus_frame (struct frame *f)
+{
+ Lisp_Object lisp_focus;
+
+ struct frame *focus = FRAME_DISPLAY_INFO (f)->x_focus_frame;
+
+ if (!focus)
+ return Qnil;
+
+ XSETFRAME (lisp_focus, focus);
+ return lisp_focus;
+}
+
+/* In certain situations, when the window manager follows a
+ click-to-focus policy, there seems to be no way around calling
+ XSetInputFocus to give another frame the input focus .
+
+ In an ideal world, XSetInputFocus should generally be avoided so
+ that applications don't interfere with the window manager's focus
+ policy. But I think it's okay to use when it's clearly done
+ following a user-command. */
+
static void
-XTframe_raise_lower (struct frame *f, bool raise_flag)
+x_focus_frame (struct frame *f, bool noactivate)
{
- if (raise_flag)
- x_raise_frame (f);
+ Display *dpy = FRAME_X_DISPLAY (f);
+
+ block_input ();
+ x_catch_errors (dpy);
+
+ if (FRAME_X_EMBEDDED_P (f))
+ {
+ /* For Xembedded frames, normally the embedder forwards key
+ events. See XEmbed Protocol Specification at
+ http://freedesktop.org/wiki/Specifications/xembed-spec */
+ xembed_request_focus (f);
+ }
else
- x_lower_frame (f);
+ {
+ XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ RevertToParent, CurrentTime);
+ if (!noactivate)
+ x_ewmh_activate_frame (f);
+ }
+
+ x_uncatch_errors ();
+ unblock_input ();
}
+
\f
/* XEmbed implementation. */
block_input ();
- x_set_bitmap_icon (f);
+ gui_set_bitmap_icon (f);
if (! FRAME_VISIBLE_P (f))
{
unblock_input ();
}
+static void
+x_make_frame_visible_invisible (struct frame *f, bool visible)
+{
+ if (visible)
+ x_make_frame_visible (f);
+ else
+ x_make_frame_invisible (f);
+}
+
/* Change window state from mapped to iconified. */
void
block_input ();
- x_set_bitmap_icon (f);
+ gui_set_bitmap_icon (f);
#if defined (USE_GTK)
if (FRAME_GTK_OUTER_WIDGET (f))
if (pixmap_id > 0)
{
- icon_pixmap = x_bitmap_pixmap (f, pixmap_id);
+ icon_pixmap = image_bitmap_pixmap (f, pixmap_id);
f->output_data.x->wm_hints.icon_pixmap = icon_pixmap;
icon_mask = x_bitmap_mask (f, pixmap_id);
f->output_data.x->wm_hints.icon_mask = icon_mask;
#endif
/* Put the rdb where we can find it in a way that works on
all versions. */
- dpyinfo->xrdb = xrdb;
+ dpyinfo->rdb = xrdb;
dpyinfo->screen = ScreenOfDisplay (dpyinfo->display,
DefaultScreen (dpyinfo->display));
AUTO_STRING (privateColormap, "privateColormap");
AUTO_STRING (PrivateColormap, "PrivateColormap");
Lisp_Object value
- = display_x_get_resource (dpyinfo, privateColormap,
- PrivateColormap, Qnil, Qnil);
+ = gui_display_get_resource (dpyinfo, privateColormap,
+ PrivateColormap, Qnil, Qnil);
if (STRINGP (value)
&& (!strcmp (SSDATA (value), "true")
|| !strcmp (SSDATA (value), "on")))
{
AUTO_STRING (synchronous, "synchronous");
AUTO_STRING (Synchronous, "Synchronous");
- Lisp_Object value = display_x_get_resource (dpyinfo, synchronous,
- Synchronous, Qnil, Qnil);
+ Lisp_Object value = gui_display_get_resource (dpyinfo, synchronous,
+ Synchronous, Qnil, Qnil);
if (STRINGP (value)
&& (!strcmp (SSDATA (value), "true")
|| !strcmp (SSDATA (value), "on")))
{
AUTO_STRING (useXIM, "useXIM");
AUTO_STRING (UseXIM, "UseXIM");
- Lisp_Object value = display_x_get_resource (dpyinfo, useXIM, UseXIM,
- Qnil, Qnil);
+ Lisp_Object value = gui_display_get_resource (dpyinfo, useXIM, UseXIM,
+ Qnil, Qnil);
#ifdef USE_XIM
if (STRINGP (value)
&& (!strcmp (SSDATA (value), "false")
\f
/* Set up use of X before we make the first connection. */
+extern frame_parm_handler x_frame_parm_handlers[];
+
static struct redisplay_interface x_redisplay_interface =
{
x_frame_parm_handlers,
x_draw_glyph_string,
x_define_frame_cursor,
x_clear_frame_area,
+ x_clear_under_internal_border,
x_draw_window_cursor,
x_draw_vertical_window_border,
x_draw_window_divider,
/* Normally, the display is available... */
if (dpyinfo->display)
{
- x_destroy_all_bitmaps (dpyinfo);
+ image_destroy_all_bitmaps (dpyinfo);
XSetCloseDownMode (dpyinfo->display, DestroyAll);
/* Whether or not XCloseDisplay destroys the associated resource
database depends on the version of libX11. To avoid both
crash and memory leak, we dissociate the database from the
- display and then destroy dpyinfo->xrdb ourselves.
+ display and then destroy dpyinfo->rdb ourselves.
Unfortunately, the above strategy does not work in some
situations due to a bug in newer versions of libX11: because
/* We used to call XrmDestroyDatabase from x_delete_display, but
some older versions of libX11 crash if we call it after
closing all the displays. */
- XrmDestroyDatabase (dpyinfo->xrdb);
+ XrmDestroyDatabase (dpyinfo->rdb);
#endif
#ifdef USE_GTK
terminal->read_socket_hook = XTread_socket;
terminal->frame_up_to_date_hook = XTframe_up_to_date;
terminal->buffer_flipping_unblocked_hook = XTbuffer_flipping_unblocked_hook;
+ terminal->query_colors = x_query_colors;
terminal->mouse_position_hook = XTmouse_position;
+ terminal->get_focus_frame = x_get_focus_frame;
+ terminal->focus_frame_hook = x_focus_frame;
terminal->frame_rehighlight_hook = XTframe_rehighlight;
terminal->frame_raise_lower_hook = XTframe_raise_lower;
+ terminal->frame_visible_invisible_hook = x_make_frame_visible_invisible;
terminal->fullscreen_hook = XTfullscreen_hook;
+ terminal->iconify_frame_hook = x_iconify_frame;
+ terminal->set_window_size_hook = x_set_window_size;
+ terminal->set_frame_offset_hook = x_set_offset;
+ terminal->set_frame_alpha_hook = x_set_frame_alpha;
+ terminal->set_new_font_hook = x_new_font;
+ terminal->set_bitmap_icon_hook = x_bitmap_icon;
+ terminal->implicit_set_name_hook = x_implicitly_set_name;
terminal->menu_show_hook = x_menu_show;
+#ifdef HAVE_EXT_MENU_BAR
+ terminal->activate_menubar_hook = x_activate_menubar;
+#endif
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
terminal->popup_dialog_hook = xw_popup_dialog;
+#endif
+#ifndef HAVE_EXT_TOOL_BAR
+ terminal->change_tool_bar_height_hook = x_change_tool_bar_height;
#endif
terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
terminal->set_horizontal_scroll_bar_hook = XTset_horizontal_scroll_bar;
+ terminal->set_scroll_bar_default_width_hook = x_set_scroll_bar_default_width;
+ terminal->set_scroll_bar_default_height_hook = x_set_scroll_bar_default_height;
terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
terminal->judge_scroll_bars_hook = XTjudge_scroll_bars;
+ terminal->get_string_resource_hook = x_get_string_resource;
terminal->delete_frame_hook = x_destroy_window;
terminal->delete_terminal_hook = x_delete_terminal;
/* Other hooks are NULL by default. */
#endif
/* X Resource data base */
- XrmDatabase xrdb;
+ XrmDatabase rdb;
/* Minimum width over all characters in all fonts in font_table. */
int smallest_char_width;
/* Return the X output data for frame F. */
#define FRAME_X_OUTPUT(f) ((f)->output_data.x)
+#define FRAME_OUTPUT_DATA(f) FRAME_X_OUTPUT (f)
/* Return the X window used for displaying data in frame F. */
#define FRAME_X_WINDOW(f) ((f)->output_data.x->window_desc)
+#define FRAME_NATIVE_WINDOW(f) FRAME_X_WINDOW (f)
/* Return the drawable used for rendering to frame F. */
#define FRAME_X_RAW_DRAWABLE(f) ((f)->output_data.x->draw_desc)
XrmDatabase x_load_resources (Display *, const char *, const char *,
const char *);
+extern const char *x_get_string_resource (void *, const char *, const char *);
/* Defined in xterm.c */
extern void x_uncatch_errors (void);
extern void x_uncatch_errors_after_check (void);
extern void x_clear_errors (Display *);
-extern void xembed_request_focus (struct frame *);
-extern void x_ewmh_activate_frame (struct frame *);
+extern void x_set_window_size (struct frame *f, bool, int, int, bool);
+extern void x_make_frame_visible (struct frame *f);
+extern void x_make_frame_invisible (struct frame *f);
+extern void x_iconify_frame (struct frame *f);
+extern void x_free_frame_resources (struct frame *);
+extern void x_wm_set_size_hint (struct frame *, long, bool);
+
extern void x_delete_terminal (struct terminal *terminal);
extern unsigned long x_copy_color (struct frame *, unsigned long);
#ifdef USE_X_TOOLKIT
double, int);
#endif
extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *);
-extern void x_query_color (struct frame *f, XColor *);
+extern void x_query_colors (struct frame *f, XColor *, int);
extern void x_clear_area (struct frame *f, int, int, int, int);
#if !defined USE_X_TOOLKIT && !defined USE_GTK
extern void x_mouse_leave (struct x_display_info *);
extern void tear_down_x_back_buffer (struct frame *f);
extern void initial_set_up_x_back_buffer (struct frame *f);
+/* Defined in xfns.c. */
+extern void x_real_positions (struct frame *, int *, int *);
+extern void x_change_tool_bar_height (struct frame *, int);
+extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_scroll_bar_default_width (struct frame *);
+extern void x_set_scroll_bar_default_height (struct frame *);
+
/* Defined in xselect.c. */
extern void x_handle_property_notify (const XPropertyEvent *);