...
 
Commits (25)
......@@ -6517,7 +6517,7 @@ mark_frame (struct Lisp_Vector *ptr)
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);
......
......@@ -176,7 +176,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
/* Maximum length of a string of glyphs. XftGlyphExtents limits
this to INT_MAX, and Emacs limits it further. Divide INT_MAX - 1
by 2 because x_produce_glyphs computes glyph_len * 2 + 1. Divide
by 2 because gui_produce_glyphs computes glyph_len * 2 + 1. Divide
the size by MAX_MULTIBYTE_LENGTH because encode_terminal_code
multiplies glyph_len by MAX_MULTIBYTE_LENGTH. */
enum {
......
......@@ -1680,7 +1680,7 @@ struct face
/* 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). */
......@@ -2897,6 +2897,11 @@ struct redisplay_interface
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
......@@ -3274,19 +3279,19 @@ extern void get_font_ascent_descent (struct font *, int *, int *);
extern void dump_glyph_string (struct glyph_string *) EXTERNALLY_VISIBLE;
#endif
extern void x_get_glyph_overhangs (struct glyph *, struct frame *,
int *, int *);
extern void gui_get_glyph_overhangs (struct glyph *, struct frame *,
int *, int *);
extern struct font *font_for_underline_metrics (struct glyph_string *);
extern void x_produce_glyphs (struct it *);
extern void x_write_glyphs (struct window *, struct glyph_row *,
struct glyph *, enum glyph_row_area, int);
extern void x_insert_glyphs (struct window *, struct glyph_row *,
struct glyph *, enum glyph_row_area, int);
extern void x_clear_end_of_line (struct window *, struct glyph_row *,
enum glyph_row_area, int);
extern void x_fix_overlapping_area (struct window *, struct glyph_row *,
enum glyph_row_area, int);
extern void gui_produce_glyphs (struct it *);
extern void gui_write_glyphs (struct window *, struct glyph_row *,
struct glyph *, enum glyph_row_area, int);
extern void gui_insert_glyphs (struct window *, struct glyph_row *,
struct glyph *, enum glyph_row_area, int);
extern void gui_clear_end_of_line (struct window *, struct glyph_row *,
enum glyph_row_area, int);
extern void gui_fix_overlapping_area (struct window *, struct glyph_row *,
enum glyph_row_area, int);
extern void draw_phys_cursor_glyph (struct window *,
struct glyph_row *,
enum draw_glyphs_face);
......@@ -3294,10 +3299,10 @@ extern void get_phys_cursor_geometry (struct window *, struct glyph_row *,
struct glyph *, int *, int *, int *);
extern void erase_phys_cursor (struct window *);
extern void display_and_set_cursor (struct window *, bool, int, int, int, int);
extern void x_update_cursor (struct frame *, bool);
extern void x_clear_cursor (struct window *);
extern void x_draw_vertical_border (struct window *w);
extern void x_draw_right_divider (struct window *w);
extern void gui_update_cursor (struct frame *, bool);
extern void gui_clear_cursor (struct window *);
extern void gui_draw_vertical_border (struct window *w);
extern void gui_draw_right_divider (struct window *w);
extern int get_glyph_string_clip_rects (struct glyph_string *,
NativeRectangle *, int);
......@@ -3309,11 +3314,11 @@ extern void handle_tool_bar_click (struct frame *,
int, int, bool, int);
extern void expose_frame (struct frame *, int, int, int, int);
extern bool x_intersect_rectangles (XRectangle *, XRectangle *, XRectangle *);
extern bool gui_intersect_rectangles (XRectangle *, XRectangle *, XRectangle *);
#endif /* HAVE_WINDOW_SYSTEM */
extern void note_mouse_highlight (struct frame *, int, int);
extern void x_clear_window_mouse_face (struct window *);
extern void gui_clear_window_mouse_face (struct window *);
extern void cancel_mouse_face (struct frame *);
extern bool clear_mouse_face (Mouse_HLInfo *);
extern bool cursor_in_mouse_face_p (struct window *w);
......@@ -3347,20 +3352,22 @@ extern bool buffer_flipping_blocked_p (void);
#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);
......@@ -3406,6 +3413,9 @@ void x_free_colors (struct frame *, unsigned long *, int);
void update_face_from_frame_parameter (struct frame *, Lisp_Object,
Lisp_Object);
extern bool tty_defined_color (struct frame *f, const char *, XColor *, bool,
bool);
Lisp_Object tty_color_name (struct frame *, int);
void clear_face_cache (bool);
unsigned long load_color (struct frame *, struct face *, Lisp_Object,
......@@ -3446,11 +3456,6 @@ void gamma_correct (struct frame *, COLORREF *);
#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);
......@@ -3586,23 +3591,21 @@ enum resource_types
};
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 */
......
......@@ -5551,7 +5551,7 @@ change_frame_size_1 (struct frame *f, int new_width, int new_height,
* 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);
......
......@@ -1061,7 +1061,7 @@ font_for_char (struct face *face, int c, ptrdiff_t pos, Lisp_Object object)
/* 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)
......@@ -1743,13 +1743,14 @@ static Lisp_Object auto_fontset_alist;
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)
......
This diff is collapsed.
......@@ -397,9 +397,9 @@ struct frame
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;
......@@ -543,6 +543,10 @@ struct frame
}
output_data;
/* Interface for accessing frame data generic constructs that are
device-dependent. */
struct frame_output_interface *foif;
/* List of font-drivers available on the frame. */
struct font_driver_list *font_driver_list;
......@@ -786,8 +790,8 @@ default_pixels_per_inch_y (void)
#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)
......@@ -1544,59 +1548,44 @@ FRAME_BOTTOM_DIVIDER_WIDTH (struct frame *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);
......@@ -1608,22 +1597,18 @@ extern char *x_get_resource_string (const char *, const char *);
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));
if (CONSP (obj) && !NILP (XCDR (obj))
&& FRAME_TERMINAL (f)->set_bitmap_icon_hook)
FRAME_TERMINAL (f)->set_bitmap_icon_hook (f, XCDR (obj));
}
#endif /* !HAVE_NS */
......
......@@ -385,7 +385,7 @@ xg_get_image_for_pixmap (struct frame *f,
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)
......@@ -935,7 +935,7 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight)
|| 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);
......@@ -963,7 +963,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
&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);
......@@ -1029,7 +1029,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
/* Try to restore fullscreen state. */
{
store_frame_param (f, Qfullscreen, fullscreen);
x_set_fullscreen (f, fullscreen, fullscreen);
gui_set_fullscreen (f, fullscreen, fullscreen);
}
}
else
......@@ -1147,8 +1147,8 @@ style_changed_cb (GObject *go,
&& 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));
}
}
......@@ -4405,7 +4405,7 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
/* 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 *
......
This diff is collapsed.
......@@ -3892,10 +3892,12 @@ kbd_buffer_get_event (KBOARD **kbp,
#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
......@@ -6510,7 +6512,7 @@ modify_event_symbol (ptrdiff_t symbol_num, int modifiers, Lisp_Object symbol_kin
#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);
}
......
......@@ -4679,7 +4679,7 @@ extern void syms_of_xterm (void);
#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. */
......
......@@ -47,14 +47,17 @@ extern widget_value *digest_single_submenu (int, int, bool);
#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 **);
......
This diff is collapsed.
......@@ -117,9 +117,6 @@ typedef void * 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. */
......
......@@ -193,7 +193,7 @@ + (instancetype)allocInitFromFile: (Lisp_Object)file
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);
......
......@@ -470,7 +470,7 @@
}
void
x_activate_menubar (struct frame *f)
ns_activate_menubar (struct frame *f)
{
#ifdef NS_IMPL_COCOA
ns_update_menubar (f, true, nil);
......
......@@ -869,7 +869,7 @@ struct ns_display_info
Window root_window;
/* Xism */
XrmDatabase xrdb;
Lisp_Object rdb;
/* The cursor to use for vertical scroll bars. */
Cursor vertical_scroll_bar_cursor;
......@@ -881,8 +881,8 @@ struct ns_display_info
mouse-face. */
Mouse_HLInfo mouse_highlight;
struct frame *x_highlight_frame;
struct frame *x_focus_frame;
struct frame *highlight_frame;
struct frame *ns_focus_frame;
/* The frame where the mouse was last time we reported a mouse event. */
struct frame *last_mouse_frame;
......@@ -993,9 +993,9 @@ struct x_output
/* 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)
......@@ -1122,6 +1122,9 @@ extern Lisp_Object ns_list_fonts (struct frame *f, Lisp_Object pattern,
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);
......@@ -1140,7 +1143,7 @@ ns_defined_color (struct frame *f,
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);
......@@ -1151,6 +1154,15 @@ extern void ns_check_menu_open (NSMenu *menu);
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);
......@@ -1172,6 +1184,8 @@ extern Lisp_Object find_and_return_menu_selection (struct frame *f,
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);
......@@ -1201,22 +1215,23 @@ extern unsigned long ns_get_pixel (void *img, int x, int y);
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);
......
This diff is collapsed.
......@@ -3839,6 +3839,7 @@ clear_tty_hooks (struct terminal *terminal)
terminal->update_begin_hook = 0;
terminal->update_end_hook = 0;
terminal->set_terminal_window_hook = 0;
terminal->defined_color_hook = 0;
terminal->mouse_position_hook = 0;
terminal->frame_rehighlight_hook = 0;
terminal->frame_raise_lower_hook = 0;
......@@ -3882,6 +3883,7 @@ set_tty_hooks (struct terminal *terminal)
terminal->menu_show_hook = &tty_menu_show;
#endif
terminal->set_terminal_window_hook = &tty_set_terminal_window;
terminal->defined_color_hook = &tty_defined_color; /* xfaces.c */
terminal->read_socket_hook = &tty_read_avail_input; /* keyboard.c */
terminal->delete_frame_hook = &tty_free_frame_resources;
terminal->delete_terminal_hook = &delete_tty;
......
......@@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
/* Miscellanea. */
#include "lisp.h"
#include "dispextern.h"
#include "systime.h" /* for Time */
struct glyph;
......@@ -488,8 +489,40 @@ struct terminal
void (*update_end_hook) (struct frame *);
void (*set_terminal_window_hook) (struct frame *, int);
/* Decide if color named COLOR_NAME is valid for the display
associated with the frame F; if so, return the RGB values in
COLOR_DEF. If ALLOC (and MAKEINDEX for NS), allocate a new
colormap cell.
If MAKEINDEX (on NS), set COLOR_DEF pixel to ARGB. */
bool (*defined_color_hook) (struct frame *f, const char *color_name,
XColor *color_def,
bool alloc,
bool makeIndex);
/* 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
*/
/* This hook is called to store the frame's background color into
BGCOLOR. */
void (*query_frame_background_color) (struct frame *f, XColor *bgcolor);
#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
......@@ -512,6 +545,12 @@ struct terminal
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. */
......@@ -529,19 +568,65 @@ struct terminal
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
......@@ -583,6 +668,11 @@ struct terminal
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
......@@ -645,6 +735,11 @@ struct terminal
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);
/* Called to delete the device-specific portions of a frame that is
on this terminal device. */
......
This diff is collapsed.
......@@ -678,7 +678,7 @@ w32font_draw (struct glyph_string *s, int from, int to,
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
......
......@@ -42,8 +42,6 @@ typedef struct _XGCValues
typedef HBITMAP Pixmap;
typedef HBITMAP Bitmap;
typedef char * XrmDatabase;
typedef XGCValues * GC;
typedef COLORREF Color;
typedef HWND Window;
......
......@@ -680,7 +680,7 @@ handle_file_notifications (struct input_event *hold_quit)
already be defined at this point. */
Lisp_Object fname
= code_convert_string_norecord (utf_16_fn, cs, 0);
Lisp_Object action = lispy_file_action (fni->Action);
Lisp_Object action = w32_lispy_file_action (fni->Action);
inev.kind = FILE_NOTIFY_EVENT;
inev.timestamp = GetTickCount ();
......
......@@ -153,7 +153,7 @@ w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
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);
......@@ -1469,7 +1469,7 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags)
{
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
......
......@@ -21,8 +21,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
#include "lisp.h"
#include "w32term.h" /* for XrmDatabase, xrdb */
#include "blockinput.h"
#include "w32term.h"
#include <stdio.h>
......@@ -73,8 +73,8 @@ w32_get_rdb_resource (const char *rdb, const char *resource)
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;
......@@ -134,15 +134,17 @@ w32_get_string_resource (const char *name, const char *class, DWORD dwexptype)
/* 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;
......@@ -157,5 +159,5 @@ x_get_string_resource (XrmDatabase rdb, const char *name, const char *class)
/* --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);
}
This diff is collapsed.
......@@ -120,7 +120,7 @@ struct w32_display_info
Cursor horizontal_scroll_bar_cursor;
/* Resource data base */
XrmDatabase xrdb;
const char *rdb;
/* color palette information. */
int has_palette;
......@@ -182,7 +182,7 @@ struct w32_display_info
event). It points to the focus frame's selected window's
frame. It differs from w32_focus_frame when we're using a global
minibuffer. */
struct frame *x_highlight_frame;
struct frame *highlight_frame;
/* The frame waiting to be auto-raised in w32_read_socket. */
struct frame *w32_pending_autoraise_frame;
......@@ -227,28 +227,33 @@ extern struct w32_display_info one_w32_display_info;
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 bool w32_defined_color (struct frame *, const char *, XColor *,
bool, bool);
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);
......@@ -257,6 +262,10 @@ 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);
#define PIX_TYPE COLORREF
......@@ -397,12 +406,12 @@ struct w32_output
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)
......@@ -715,9 +724,8 @@ extern void complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result);
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
......@@ -732,7 +740,7 @@ struct notifications_set {
};
extern struct notifications_set *notifications_set_head;
extern Lisp_Object w32_get_watch_object (void *);
extern Lisp_Object lispy_file_action (DWORD);
extern Lisp_Object w32_lispy_file_action (DWORD);
extern int handle_file_notifications (struct input_event *);
extern void w32_initialize_display_info (Lisp_Object);
......
......@@ -220,7 +220,7 @@ static void
wset_update_mode_line (struct window *w)
{
/* If this window is the selected window on its frame, set the
global variable update_mode_lines, so that x_consider_frame_title
global variable update_mode_lines, so that gui_consider_frame_title
will consider this frame's title for redisplay. */
Lisp_Object fselected_window = XFRAME (WINDOW_FRAME (w))->selected_window;
......@@ -3434,7 +3434,7 @@ run_window_configuration_change_hook (struct frame *f)
XSETFRAME (frame, f);
if (NILP (Vrun_hooks)
|| !f->can_x_set_window_size
|| !f->can_set_window_size
|| !f->after_make_frame)
return;
......@@ -3763,7 +3763,7 @@ run_window_change_functions (void)
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
......@@ -4683,7 +4683,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
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)
{
......@@ -6867,8 +6867,8 @@ the return value is nil. Otherwise the value is t. */)
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 ();
......@@ -7072,9 +7072,9 @@ the return value is nil. Otherwise the value is t. */)
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);
......
This diff is collapsed.
......@@ -343,7 +343,7 @@ struct named_merge_point;
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 *);
......@@ -777,13 +777,13 @@ load_pixmap (struct frame *f, Lisp_Object name)
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 ();
......@@ -898,11 +898,11 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color,
return false;
}
/* A version of defined_color for non-X frames. */
/* An implementation of defined_color_hook for tty frames. */
static bool
bool
tty_defined_color (struct frame *f, const char *color_name,
XColor *color_def, bool alloc)
XColor *color_def, bool alloc, bool _makeIndex)
{
bool status = true;
......@@ -929,36 +929,6 @@ tty_defined_color (struct frame *f, const char *color_name,
return status;
}
/* Decide if color named COLOR_NAME is valid for the display
associated with the frame F; if so, return the rgb values in
COLOR_DEF. If ALLOC, allocate a new colormap cell.
This does the right thing for any type of frame. */
static bool
defined_color (struct frame *f, const char *color_name, XColor *color_def,
bool alloc)
{
if (!FRAME_WINDOW_P (f))
return tty_defined_color (f, color_name, color_def, alloc);
#ifdef HAVE_X_WINDOWS
else if (FRAME_X_P (f))
return x_defined_color (f, color_name, color_def, alloc);
#endif
#ifdef HAVE_NTGUI
else if (FRAME_W32_P (f))
return w32_defined_color (f, color_name, color_def, alloc);
#endif
#ifdef HAVE_NS
else if (FRAME_NS_P (f))
return ns_defined_color (f, color_name, color_def, alloc, true);
#endif
else
emacs_abort ();
}
/* Given the index IDX of a tty color on frame F, return its name, a
Lisp string. */
......@@ -1003,7 +973,8 @@ face_color_gray_p (struct frame *f, const char *color_name)
XColor color;
bool gray_p;
if (defined_color (f, color_name, &color, false))
if (FRAME_TERMINAL (f)->defined_color_hook
(f, color_name, &color, false, true))
gray_p = (/* Any color sufficiently close to black counts as gray. */
(color.red < 5000 && color.green < 5000 && color.blue < 5000)
||
......@@ -1043,7 +1014,7 @@ face_color_supported_p (struct frame *f, const char *color_name,
&& face_color_gray_p (f, color_name)))
:
#endif
tty_defined_color (f, color_name, &not_used, false);
tty_defined_color (f, color_name, &not_used, false, false);
}
......@@ -1087,9 +1058,10 @@ load_color2 (struct frame *f, struct face *face, Lisp_Object name,
|| target_index == LFACE_STRIKE_THROUGH_INDEX
|| target_index == LFACE_BOX_INDEX);
/* if the color map is full, defined_color will return a best match
/* if the color map is full, defined_color_hook will return a best match
to the values in an existing cell. */
if (!defined_color (f, SSDATA (name), color, true))
if (!FRAME_TERMINAL (f)->defined_color_hook
(f, SSDATA (name), color, true, true))
{
add_to_log ("Unable to load color \"%s\"", name);
......@@ -1188,7 +1160,7 @@ load_face_colors (struct frame *f, struct face *face,
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);
}
......@@ -3484,8 +3456,8 @@ ordinary `x-get-resource' doesn't take a frame argument. */)
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;
}
......@@ -4153,7 +4125,7 @@ free_realized_face (struct frame *f, struct face *face)
#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 */
......@@ -4188,7 +4160,7 @@ prepare_face_for_display (struct frame *f, struct face *face)
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
......@@ -4243,11 +4215,19 @@ two lists of the form (RED GREEN BLUE) aforementioned. */)
if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1))
&& !(STRINGP (color1)
&& defined_color (f, SSDATA (color1), &cdef1, false)))
&& FRAME_TERMINAL (f)->defined_color_hook (f,
SSDATA (color1),
&cdef1,
false,
true)))
signal_error ("Invalid color", color1);
if (!(CONSP (color2) && parse_rgb_list (color2, &cdef2))
&& !(STRINGP (color2)
&& defined_color (f, SSDATA (color2), &cdef2, false)))
&& FRAME_TERMINAL (f)->defined_color_hook (f,
SSDATA (color2),
&cdef2,
false,
true)))
signal_error ("Invalid color", color2);
if (NILP (metric))
......@@ -4799,9 +4779,9 @@ DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector,
(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;
......@@ -5138,7 +5118,7 @@ face for italic. */)
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;
......@@ -5458,7 +5438,7 @@ realize_default_face (struct frame *f)
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;
......@@ -5524,7 +5504,7 @@ realize_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE],
}
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))
......@@ -5575,14 +5555,14 @@ realize_non_ascii_face (struct frame *f, Lisp_Object font_object,
/* 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
......
This diff is collapsed.
......@@ -60,12 +60,12 @@ x_get_customization_string (XrmDatabase db, const char *name,
{
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;
}
......@@ -547,19 +547,20 @@ x_get_resource (XrmDatabase rdb, const char *name, const char *class,
/* 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;
}
/* Stand-alone test facilities. */
......@@ -648,7 +649,7 @@ main (int argc, char **argv)
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);
......
This diff is collapsed.
......@@ -249,7 +249,7 @@ struct x_display_info
#endif
/* X Resource data base */
XrmDatabase xrdb;
XrmDatabase rdb;
/* Minimum width over all characters in all fonts in font_table. */
int smallest_char_width;
......@@ -364,7 +364,7 @@ struct x_display_info
event). It points to the X focus frame's selected window's
frame. It differs from x_focus_frame when we're using a global
minibuffer. */
struct frame *x_highlight_frame;
struct frame *highlight_frame;
/* The frame waiting to be auto-raised in XTread_socket. */
struct frame *x_pending_autoraise_frame;
......@@ -764,9 +764,11 @@ enum
/* 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)
......@@ -1087,6 +1089,7 @@ extern void x_real_pos_and_offsets (struct frame *f,
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 */
......@@ -1103,8 +1106,13 @@ extern bool x_had_errors_p (Display *);
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 *);