annotate src/w32term.h @ 26729:f5dded41adcc

Changes for automatic remapping of X colors on terminal frames: * xfaces.c (XColor) [!HAVE_X_WINDOWS]: Provide a typedef for non-X frames. (Vface_tty_color_alist): Remove. (tty_defined_color): New function. (defined_color): Rewrite to support any type of frame. (tty_color_name): New function. (face_color_supported_p, Fface_color_gray_p, Fface_color_supported_p): Support non-X frames. (load_color): Enclose the color name in quotes, in the log messages. Remove DOS-specific version of load_color. (realize_tty_face): Take the supported colors from tty-color-alist. Support translation of X colors to the closest tty color, for both MSDOS and tty frames. [MSDOS]: Don't invert face colors if they were taken from the frame colors. (Fface_register_tty_color, Fface_clear_tty_colors): Remove. * frame.h (struct x_output) [!MSDOS, !WINDOWSNT, !HAVE_X_WINDOWS]: Define a mostly empty surrogate. (tty_display): Declare. * frame.c (make_terminal_frame) [!macintosh]: Don't use tty_display. (Fframe_parameters): Don't invert colors of non-FRAME_WINDOW_P frames when the frame's param_alist includes 'reverse. (tty_display): Define. (make_terminal_frame) [!MSDOS]: Assign &tty_display to the output_data.x member. (Fframe_parameters): Return foreground and background color names on tty frames as well, in addition to MSDOS frames. * msdos.h (DisplayWidth, DisplayHeight): Changes for Lisp_Object selected_frame. (struct x_output): Remove unused members; document who uses each member. (FRAME_PARAM_FACES, FRAME_N_PARAM_FACES, FRAME_DEFAULT_PARAM_FACE, FRAME_MODE_LINE_PARAM_FACE, FRAME_COMPUTED_FACES, FRAME_N_COMPUTED_FACES, FRAME_SIZE_COMPUTED_FACES, FRAME_DEFAULT_FACE, FRAME_MODE_LINE_FACE, unload_color): Remove unused macro definintions. * msdos.c (IT_set_frame_parameters): Don't call recompute_basic_faces, the next redisplay will, anyway. (x_current_display): Remove unused variable. Many functions: changes for Lisp_object selected_frame. (IT_set_face): If the tty_reverse_p flag is set for the face, reverse the foreground and background colors. (Fmsdos_remember_default_colors): New function. (syms_of_msdos): Defsubr it. (IT_set_frame_parameters): Use initial_screen_colors[] when creating a new frame. If the frame parameters include 'reverse, swap the foreground and background colors. (internal_terminal_init): Initialize initial_screen_colors to -1. (syms_of_msdos): Add DEFVAR_BOOL for x-stretch-cursor, to shut up cus-start.el. * Makefile.in (lisp, shortlisp): Add lisp/term/tty-colors.elc. * xfns.c (x_defined_color): Rename from defined_color. All callers changed. (Fxw_color_defined_p): Renamed from Fx_color_defined_p; all callers changed. (Fxw_color_values): Renamed from Fx_color_values; all callers changed. (Fxw_display_color_p): Renamed from Fx_display_color_p; all callers changed. (x_window_to_frame, x_any_window_to_frame, x_non_menubar_window_to_frame, x_menubar_window_to_frame, x_top_window_to_frame): Use !FRAME_X_P instead of f->output_data.nothing. * xterm.h (x_defined_color): Rename from defined_color. * w32fns.c (x_window_to_frame): Use FRAME_W32_P instead of f->output_data.nothing. (Fxw_color_defined_p): Renamed from Fx_color_defined_p; all callers changed. (Fxw_color_values): Renamed from Fx_color_values; all callers changed. (Fxw_display_color_p): Renamed from Fx_display_color_p; all callers changed. * dispextern.h (tty_color_name): Add prototype. * xmenu.c (menubar_id_to_frame): Use FRAME_WINDOW_P instead of f->output_data.nothing. * w32menu.c (menubar_id_to_frame): Likewise. * w32term.h (w32_output): Declare. * dosfns.c (Qmsdos_color_translate): Remove. (msdos_stdcolor_name): Now returns a Lisp_Object. * dosfns.h (Qmsdos_color_translate): Remove. * s/msdos.h (INTERNAL_TERMINAL): Add entries for color support.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 06 Dec 1999 16:54:09 +0000
parents dcad7c5b7add
children 220407a99b21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16886
c686d4f3728a Change all uses of win95, winnt, and win32 into Windows 95, Windows
Geoff Voelker <voelker@cs.washington.edu>
parents: 16588
diff changeset
1 /* Definitions and headers for communication on the Microsoft W32 API.
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4 This file is part of GNU Emacs.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
5
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
9 any later version.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
10
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
14 GNU General Public License for more details.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
15
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13543
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13543
diff changeset
19 Boston, MA 02111-1307, USA. */
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
20
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
21 /* Added by Kevin Gallo */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
22
16888
380c7e461c14 Use new name w32gui.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16886
diff changeset
23 #include <w32gui.h>
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
24
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
25 /* The class of this X application. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
26 #define EMACS_CLASS "Emacs"
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
27
14984
e8a969370f33 (BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14809
diff changeset
28 #define BLACK_PIX_DEFAULT(f) PALETTERGB(0,0,0)
e8a969370f33 (BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14809
diff changeset
29 #define WHITE_PIX_DEFAULT(f) PALETTERGB(255,255,255)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
30
24145
95d0947c83b2 (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_MAX_WIDTH):
Geoff Voelker <voelker@cs.washington.edu>
parents: 23807
diff changeset
31 #define FONT_WIDTH(f) \
95d0947c83b2 (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_MAX_WIDTH):
Geoff Voelker <voelker@cs.washington.edu>
parents: 23807
diff changeset
32 ((f)->bdf ? (f)->bdf->width : (f)->tm.tmAveCharWidth)
95d0947c83b2 (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_MAX_WIDTH):
Geoff Voelker <voelker@cs.washington.edu>
parents: 23807
diff changeset
33 #define FONT_HEIGHT(f) \
95d0947c83b2 (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_MAX_WIDTH):
Geoff Voelker <voelker@cs.washington.edu>
parents: 23807
diff changeset
34 ((f)->bdf ? (f)->bdf->height : (f)->tm.tmHeight)
95d0947c83b2 (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_MAX_WIDTH):
Geoff Voelker <voelker@cs.washington.edu>
parents: 23807
diff changeset
35 /* No idea why 5 seems to work in here, but it does */
95d0947c83b2 (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_MAX_WIDTH):
Geoff Voelker <voelker@cs.washington.edu>
parents: 23807
diff changeset
36 #define FONT_BASE(f) \
95d0947c83b2 (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_MAX_WIDTH):
Geoff Voelker <voelker@cs.washington.edu>
parents: 23807
diff changeset
37 ((f)->bdf ? (f)->bdf->ury : (f)->tm.tmAscent)
95d0947c83b2 (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_MAX_WIDTH):
Geoff Voelker <voelker@cs.washington.edu>
parents: 23807
diff changeset
38 #define FONT_MAX_WIDTH(f) \
95d0947c83b2 (FONT_WIDTH, FONT_HEIGHT, FONT_BASE, FONT_MAX_WIDTH):
Geoff Voelker <voelker@cs.washington.edu>
parents: 23807
diff changeset
39 ((f)->bdf ? (f)->bdf->width : (f)->tm.tmMaxCharWidth)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
40
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
41 #define CHECK_W32_FRAME(f, frame) \
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
42 if (NILP (frame)) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
43 f = selected_frame; \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
44 else \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
45 { \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
46 CHECK_LIVE_FRAME (frame, 0); \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
47 f = XFRAME (frame); \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
48 } \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
49 if (! FRAME_W32_P (f))
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
50
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
51 /* Indicates whether we are in the readsocket call and the message we
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
52 are processing in the current loop */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
53
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
54 extern MSG CurMsg;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
55 extern BOOL bUseDflt;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
56
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
57 extern struct frame *x_window_to_frame ();
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
58
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
59 enum text_cursor_kinds {
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
60 filled_box_cursor, hollow_box_cursor, bar_cursor
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
61 };
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
62
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
63 /* Structure recording bitmaps and reference count.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
64 If REFCOUNT is 0 then this record is free to be reused. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
65
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
66 struct w32_bitmap_record
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
67 {
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
68 Pixmap pixmap;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
69 char *file;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
70 HINSTANCE hinst; /* Used to load the file */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
71 int refcount;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
72 /* Record some info about this pixmap. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
73 int height, width, depth;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
74 };
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
75
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
76 /* Palette book-keeping stuff for mapping requested colors into the
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
77 system palette. Keep a ref-counted list of requested colors and
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
78 regenerate the app palette whenever the requested list changes. */
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
79
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
80 extern Lisp_Object Vw32_enable_palette;
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
81
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
82 struct w32_palette_entry {
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
83 struct w32_palette_entry * next;
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
84 PALETTEENTRY entry;
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
85 #if 0
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
86 unsigned refcount;
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
87 #endif
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
88 };
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
89
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
90 extern void w32_regenerate_palette(struct frame *f);
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
91
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
92
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
93 /* For each display (currently only one on w32), we have a structure that
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
94 records information about it. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
95
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
96 struct w32_display_info
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
97 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
98 /* Chain of all w32_display_info structures. */
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
99 struct w32_display_info *next;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
100 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE).
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
101 The same cons cell also appears in x_display_name_list. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
102 Lisp_Object name_list_element;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
103 /* Number of frames that are on this display. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
104 int reference_count;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
105 /* Number of planes on this screen. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
106 int n_planes;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
107 /* Number of bits per pixel on this screen. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
108 int n_cbits;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
109 /* Dimensions of this screen. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
110 int height, width;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
111 int height_in,width_in;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
112 /* Mask of things that cause the mouse to be grabbed. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
113 int grabbed;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
114 /* The root window of this screen. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
115 Window root_window;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
116 /* The cursor to use for vertical scroll bars. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
117 Cursor vertical_scroll_bar_cursor;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
118
23676
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
119 /* color palette information. */
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
120 int has_palette;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
121 struct w32_palette_entry * color_list;
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
122 unsigned num_colors;
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
123 HPALETTE palette;
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
124
23676
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
125 /* deferred action flags checked when starting frame update. */
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
126 int regen_palette;
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
127
23676
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
128 /* Keystroke that has been faked by Emacs and will be ignored when
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
129 received; value is reset after key is received. */
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
130 int faked_key;
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
131
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
132 /* A table of all the fonts we have already loaded. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
133 struct font_info *font_table;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
134
23508
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
135 /* The current capacity of font_table. */
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
136 int font_table_size;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
137
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
138 /* These variables describe the range of text currently shown
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
139 in its mouse-face, together with the window they apply to.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
140 As long as the mouse stays within this range, we need not
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
141 redraw anything on its account. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
142 int mouse_face_beg_row, mouse_face_beg_col;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
143 int mouse_face_end_row, mouse_face_end_col;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
144 int mouse_face_past_end;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
145 Lisp_Object mouse_face_window;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
146 int mouse_face_face_id;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
147
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
148 /* 1 if a mouse motion event came and we didn't handle it right away because
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
149 gc was in progress. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
150 int mouse_face_deferred_gc;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
151
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
152 /* FRAME and X, Y position of mouse when last checked for
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
153 highlighting. X and Y can be negative or out of range for the frame. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
154 struct frame *mouse_face_mouse_frame;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
155 int mouse_face_mouse_x, mouse_face_mouse_y;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
156
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
157 /* Nonzero means defer mouse-motion highlighting. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
158 int mouse_face_defer;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
159
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
160 char *w32_id_name;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
161
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
162 /* The number of fonts actually stored in w32_font_table.
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
163 font_table[n] is used and valid iff 0 <= n < n_fonts.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
164 0 <= n_fonts <= font_table_size. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
165 int n_fonts;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
166
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
167 /* Pointer to bitmap records. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
168 struct w32_bitmap_record *bitmaps;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
169
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
170 /* Allocated size of bitmaps field. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
171 int bitmaps_size;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
172
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
173 /* Last used bitmap index. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
174 int bitmaps_last;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
175
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
176 /* The frame (if any) which has the window that has keyboard focus.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
177 Zero if none. This is examined by Ffocus_frame in w32fns.c. Note
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
178 that a mere EnterNotify event can set this; if you need to know the
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
179 last frame specified in a FocusIn or FocusOut event, use
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
180 w32_focus_event_frame. */
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
181 struct frame *w32_focus_frame;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
182
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
183 /* The last frame mentioned in a FocusIn or FocusOut event. This is
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
184 separate from w32_focus_frame, because whether or not LeaveNotify
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
185 events cause us to lose focus depends on whether or not we have
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
186 received a FocusIn event for it. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
187 struct frame *w32_focus_event_frame;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
188
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
189 /* The frame which currently has the visual highlight, and should get
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
190 keyboard input (other sorts of input have the frame encoded in the
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
191 event). It points to the focus frame's selected window's
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
192 frame. It differs from w32_focus_frame when we're using a global
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
193 minibuffer. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
194 struct frame *w32_highlight_frame;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
195 };
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
196
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
197 /* This is a chain of structures for all the displays currently in use. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
198 extern struct w32_display_info one_w32_display_info;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
199
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
200 /* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE),
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
201 one for each element of w32_display_list and in the same order.
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
202 NAME is the name of the frame.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
203 FONT-LIST-CACHE records previous values returned by x-list-fonts. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
204 extern Lisp_Object w32_display_name_list;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
205
23508
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
206 /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. */
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
207 extern Lisp_Object Vx_pixel_size_width_font_regexp;
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
208
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
209 /* A flag to control how to display unibyte 8-bit character. */
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
210 extern int unibyte_display_via_language_environment;
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
211
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
212 extern struct w32_display_info *x_display_info_for_display ();
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
213 extern struct w32_display_info *x_display_info_for_name ();
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
214
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
215 extern struct w32_display_info *w32_term_init ();
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
216
23508
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
217 extern Lisp_Object w32_list_fonts ();
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
218 extern struct font_info *w32_get_font_info (), *w32_query_font ();
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
219 extern void w32_find_ccl_program();
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
220
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
221 /* Each W32 frame object points to its own struct w32_display object
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
222 in the output_data.w32 field. The w32_display structure contains all
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
223 the information that is specific to W32 windows. */
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
224
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
225 struct w32_output
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
226 {
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
227 /* Menubar "widget" handle. */
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
228 HMENU menubar_widget;
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
229
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
230 /* Original palette (used to deselect real palette after drawing) */
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
231 HPALETTE old_palette;
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
232
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
233 /* Position of the W32 window (x and y offsets in root window). */
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
234 int left_pos;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
235 int top_pos;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
236
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
237 /* Border width of the W32 window as known by the window system. */
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
238 int border_width;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
239
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
240 /* Size of the W32 window in pixels. */
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
241 int pixel_height, pixel_width;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
242
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
243 /* Height of a line, in pixels. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
244 int line_height;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
245
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
246 /* Width of the internal border. This is a line of background color
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
247 just inside the window's border. When the frame is selected,
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
248 a highlighting is displayed inside the internal border. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
249 int internal_border_width;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
250
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
251 /* The window used for this frame.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
252 May be zero while the frame object is being created
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
253 and the window has not yet been created. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
254 Window window_desc;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
255
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
256 /* The window that is the parent of this window.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
257 Usually this is a window that was made by the window manager,
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
258 but it can be the root window, and it can be explicitly specified
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
259 (see the explicit_parent field, below). */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
260 Window parent_desc;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
261
23508
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
262 /* Default ASCII font of this frame. */
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
263 XFontStruct *font;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
264
23508
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
265 /* The baseline position of the default ASCII font. */
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
266 int font_baseline;
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
267
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
268 /* If a fontset is specified for this frame instead of font, this
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
269 value contains an ID of the fontset, else -1. */
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
270 int fontset;
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
271
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
272 /* Pixel values used for various purposes.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
273 border_pixel may be -1 meaning use a gray tile. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
274 unsigned long background_pixel;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
275 unsigned long foreground_pixel;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
276 unsigned long cursor_pixel;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
277 unsigned long border_pixel;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
278 unsigned long mouse_pixel;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
279 unsigned long cursor_foreground_pixel;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
280
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
281 /* Descriptor for the cursor in use for this window. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
282 Cursor text_cursor;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
283 Cursor nontext_cursor;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
284 Cursor modeline_cursor;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
285 Cursor cross_cursor;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
286
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
287 /* Flag to set when the window needs to be completely repainted. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
288 int needs_exposure;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
289
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
290 /* What kind of text cursor is drawn in this window right now?
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
291 (If there is no cursor (phys_cursor_x < 0), then this means nothing.) */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
292 enum text_cursor_kinds current_cursor;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
293
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
294 /* What kind of text cursor should we draw in the future?
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
295 This should always be filled_box_cursor or bar_cursor. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
296 enum text_cursor_kinds desired_cursor;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
297
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
298 /* Width of bar cursor (if we are using that). */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
299 int cursor_width;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
300
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
301 DWORD dwStyle;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
302
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
303 /* The size of the extra width currently allotted for vertical
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
304 scroll bars, in pixels. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
305 int vertical_scroll_bar_extra;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
306
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
307 /* Table of parameter faces for this frame. Any resources (pixel
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
308 values, fonts) referred to here have been allocated explicitly
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
309 for this face, and should be freed if we change the face. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
310 struct face **param_faces;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
311 int n_param_faces;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
312
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
313 /* Table of computed faces for this frame. These are the faces
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
314 whose indexes go into the upper bits of a glyph, computed by
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
315 combining the parameter faces specified by overlays, text
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
316 properties, and what have you. The resources mentioned here
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
317 are all shared with parameter faces. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
318 struct face **computed_faces;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
319 int n_computed_faces; /* How many are valid */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
320 int size_computed_faces; /* How many are allocated */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
321
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
322 /* This is the gravity value for the specified window position. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
323 int win_gravity;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
324
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
325 /* The geometry flags for this window. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
326 int size_hint_flags;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
327
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
328 /* This is the Emacs structure for the display this frame is on. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
329 /* struct w32_display_info *display_info; */
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
330
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
331 /* Nonzero means our parent is another application's window
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
332 and was explicitly specified. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
333 char explicit_parent;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
334
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
335 /* Nonzero means tried already to make this frame visible. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
336 char asked_for_visible;
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
337
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
338 /* Nonzero means menubar is currently active. */
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
339 char menubar_active;
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
340
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
341 /* Nonzero means menubar is about to become active, but should be
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
342 brought up to date first. */
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
343 volatile char pending_menu_activation;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
344 };
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
345
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 24916
diff changeset
346 /* A (mostly empty) structure describing a w32 terminal frame display. */
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 24916
diff changeset
347 extern struct w32_output w32term_display;
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 24916
diff changeset
348
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
349 /* Get at the computed faces of an X window frame. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
350 #define FRAME_PARAM_FACES(f) ((f)->output_data.w32->param_faces)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
351 #define FRAME_N_PARAM_FACES(f) ((f)->output_data.w32->n_param_faces)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
352 #define FRAME_DEFAULT_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[0])
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
353 #define FRAME_MODE_LINE_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[1])
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
354
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
355 #define FRAME_COMPUTED_FACES(f) ((f)->output_data.w32->computed_faces)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
356 #define FRAME_N_COMPUTED_FACES(f) ((f)->output_data.w32->n_computed_faces)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
357 #define FRAME_SIZE_COMPUTED_FACES(f) ((f)->output_data.w32->size_computed_faces)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
358 #define FRAME_DEFAULT_FACE(f) ((f)->output_data.w32->computed_faces[0])
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
359 #define FRAME_MODE_LINE_FACE(f) ((f)->output_data.w32->computed_faces[1])
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
360
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
361 /* Return the window associated with the frame F. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
362 #define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
363
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
364 #define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.w32->foreground_pixel)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
365 #define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.w32->background_pixel)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
366 #define FRAME_FONT(f) ((f)->output_data.w32->font)
23508
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
367 #define FRAME_FONTSET(f) ((f)->output_data.w32->fontset)
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
368 #define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->output_data.w32->internal_border_width)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
369
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
370 /* This gives the w32_display_info structure for the display F is on. */
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
371 #define FRAME_W32_DISPLAY_INFO(f) (&one_w32_display_info)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
372
23508
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
373 /* This is the 'font_info *' which frame F has. */
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
374 #define FRAME_W32_FONT_TABLE(f) (FRAME_W32_DISPLAY_INFO (f)->font_table)
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
375
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
376 /* These two really ought to be called FRAME_PIXEL_{WIDTH,HEIGHT}. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
377 #define PIXEL_WIDTH(f) ((f)->output_data.w32->pixel_width)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
378 #define PIXEL_HEIGHT(f) ((f)->output_data.w32->pixel_height)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
379 #define FRAME_LINE_HEIGHT(f) ((f)->output_data.w32->line_height)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
380
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
381 #define FRAME_DESIRED_CURSOR(f) ((f)->output_data.w32->desired_cursor)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
382
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
383
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
384 /* W32-specific scroll bar stuff. */
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
385
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
386 /* We represent scroll bars as lisp vectors. This allows us to place
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
387 references to them in windows without worrying about whether we'll
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
388 end up with windows referring to dead scroll bars; the garbage
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
389 collector will free it when its time comes.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
390
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
391 We use struct scroll_bar as a template for accessing fields of the
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
392 vector. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
393
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
394 struct scroll_bar {
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
395
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
396 /* These fields are shared by all vectors. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
397 EMACS_INT size_from_Lisp_Vector_struct;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
398 struct Lisp_Vector *next_from_Lisp_Vector_struct;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
399
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
400 /* The window we're a scroll bar for. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
401 Lisp_Object window;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
402
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
403 /* The next and previous in the chain of scroll bars in this frame. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
404 Lisp_Object next, prev;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
405
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
406 /* The window representing this scroll bar. Since this is a full
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
407 32-bit quantity, we store it split into two 32-bit values. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
408 Lisp_Object w32_window_low, w32_window_high;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
409
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
410 /* The position and size of the scroll bar in pixels, relative to the
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
411 frame. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
412 Lisp_Object top, left, width, height;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
413
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
414 /* The starting and ending positions of the handle, relative to the
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
415 handle area (i.e. zero is the top position, not
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
416 SCROLL_BAR_TOP_BORDER). If they're equal, that means the handle
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
417 hasn't been drawn yet.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
418
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
419 These are not actually the locations where the beginning and end
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
420 are drawn; in order to keep handles from becoming invisible when
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
421 editing large files, we establish a minimum height by always
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
422 drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
423 where they would be normally; the bottom and top are in a
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
424 different co-ordinate system. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
425 Lisp_Object start, end;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
426
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
427 /* If the scroll bar handle is currently being dragged by the user,
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
428 this is the number of pixels from the top of the handle to the
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
429 place where the user grabbed it. If the handle isn't currently
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
430 being dragged, this is Qnil. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
431 Lisp_Object dragging;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
432 };
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
433
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
434 /* The number of elements a vector holding a struct scroll_bar needs. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
435 #define SCROLL_BAR_VEC_SIZE \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
436 ((sizeof (struct scroll_bar) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
437 - sizeof (EMACS_INT) - sizeof (struct Lisp_Vector *)) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
438 / sizeof (Lisp_Object))
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
439
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
440 /* Turning a lisp vector value into a pointer to a struct scroll_bar. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
441 #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec))
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
442
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
443
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
444 /* Building a 32-bit C integer from two 16-bit lisp integers. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
445 #define SCROLL_BAR_PACK(low, high) (XINT (high) << 16 | XINT (low))
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
446
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
447 /* Setting two lisp integers to the low and high words of a 32-bit C int. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
448 #define SCROLL_BAR_UNPACK(low, high, int32) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
449 (XSETINT ((low), (int32) & 0xffff), \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
450 XSETINT ((high), ((int32) >> 16) & 0xffff))
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
451
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
452
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
453 /* Extract the window id of the scroll bar from a struct scroll_bar. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
454 #define SCROLL_BAR_W32_WINDOW(ptr) \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
455 ((Window) SCROLL_BAR_PACK ((ptr)->w32_window_low, (ptr)->w32_window_high))
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
456
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
457 /* Store a window id in a struct scroll_bar. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
458 #define SET_SCROLL_BAR_W32_WINDOW(ptr, id) \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
459 (SCROLL_BAR_UNPACK ((ptr)->w32_window_low, (ptr)->w32_window_high, (int) id))
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
460
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
461
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
462 /* Return the outside pixel height for a vertical scroll bar HEIGHT
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
463 rows high on frame F. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
464 #define VERTICAL_SCROLL_BAR_PIXEL_HEIGHT(f, height) \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
465 ((height) * (f)->output_data.w32->line_height)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
466
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
467 /* Return the inside width of a vertical scroll bar, given the outside
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
468 width. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
469 #define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(width) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
470 ((width) - VERTICAL_SCROLL_BAR_LEFT_BORDER - VERTICAL_SCROLL_BAR_RIGHT_BORDER)
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
471
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
472 /* Return the length of the rectangle within which the top of the
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
473 handle must stay. This isn't equivalent to the inside height,
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
474 because the scroll bar handle has a minimum height.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
475
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
476 This is the real range of motion for the scroll bar, so when we're
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
477 scaling buffer positions to scroll bar positions, we use this, not
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
478 VERTICAL_SCROLL_BAR_INSIDE_HEIGHT. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
479 #define VERTICAL_SCROLL_BAR_TOP_RANGE(height) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
480 (VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (height) - VERTICAL_SCROLL_BAR_MIN_HANDLE)
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
481
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
482 /* Return the inside height of vertical scroll bar, given the outside
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
483 height. See VERTICAL_SCROLL_BAR_TOP_RANGE too. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
484 #define VERTICAL_SCROLL_BAR_INSIDE_HEIGHT(height) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
485 ((height) - VERTICAL_SCROLL_BAR_TOP_BORDER - VERTICAL_SCROLL_BAR_BOTTOM_BORDER)
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
486
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
487
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
488 /* Border widths for scroll bars.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
489
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
490 Scroll bar windows don't have any borders; their border width is
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
491 set to zero, and we redraw borders ourselves. This makes the code
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
492 a bit cleaner, since we don't have to convert between outside width
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
493 (used when relating to the rest of the screen) and inside width
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
494 (used when sizing and drawing the scroll bar window itself).
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
495
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
496 The handle moves up and down/back and forth in a rectangle inset
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
497 from the edges of the scroll bar. These are widths by which we
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
498 inset the handle boundaries from the scroll bar edges. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
499 #define VERTICAL_SCROLL_BAR_LEFT_BORDER (0)
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
500 #define VERTICAL_SCROLL_BAR_RIGHT_BORDER (0)
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
501 #define VERTICAL_SCROLL_BAR_TOP_BORDER (vertical_scroll_bar_top_border)
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
502 #define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (vertical_scroll_bar_bottom_border)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
503
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
504 /* Minimum lengths for scroll bar handles, in pixels. */
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
505 #define VERTICAL_SCROLL_BAR_MIN_HANDLE (vertical_scroll_bar_min_handle)
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
506
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
507
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
508
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
509 /* Manipulating pixel sizes and character sizes.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
510 Knowledge of which factors affect the overall size of the window should
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
511 be hidden in these macros, if that's possible.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
512
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
513 Return the upper/left pixel position of the character cell on frame F
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
514 at ROW/COL. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
515 #define CHAR_TO_PIXEL_ROW(f, row) \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
516 ((f)->output_data.w32->internal_border_width \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
517 + (row) * (f)->output_data.w32->line_height)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
518 #define CHAR_TO_PIXEL_COL(f, col) \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
519 ((f)->output_data.w32->internal_border_width \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
520 + (col) * FONT_WIDTH ((f)->output_data.w32->font))
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
521
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
522 /* Return the pixel width/height of frame F if it has
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
523 WIDTH columns/HEIGHT rows. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
524 #define CHAR_TO_PIXEL_WIDTH(f, width) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
525 (CHAR_TO_PIXEL_COL (f, width) \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
526 + (f)->output_data.w32->vertical_scroll_bar_extra \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
527 + (f)->output_data.w32->internal_border_width)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
528 #define CHAR_TO_PIXEL_HEIGHT(f, height) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
529 (CHAR_TO_PIXEL_ROW (f, height) \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
530 + (f)->output_data.w32->internal_border_width)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
531
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
532
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
533 /* Return the row/column (zero-based) of the character cell containing
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
534 the pixel on FRAME at ROW/COL. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
535 #define PIXEL_TO_CHAR_ROW(f, row) \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
536 (((row) - (f)->output_data.w32->internal_border_width) \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
537 / (f)->output_data.w32->line_height)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
538 #define PIXEL_TO_CHAR_COL(f, col) \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
539 (((col) - (f)->output_data.w32->internal_border_width) \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
540 / FONT_WIDTH ((f)->output_data.w32->font))
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
541
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
542 /* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
543 frame F? */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
544 #define PIXEL_TO_CHAR_WIDTH(f, width) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
545 (PIXEL_TO_CHAR_COL (f, ((width) \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
546 - (f)->output_data.w32->internal_border_width \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
547 - (f)->output_data.w32->vertical_scroll_bar_extra)))
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
548 #define PIXEL_TO_CHAR_HEIGHT(f, height) \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
549 (PIXEL_TO_CHAR_ROW (f, ((height) \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
550 - (f)->output_data.w32->internal_border_width)))
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
551
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
552 /* Interface to the face code functions. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
553
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
554 /* Create the first two computed faces for a frame -- the ones that
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
555 have GC's. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
556 extern void init_frame_faces (/* FRAME_PTR */);
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
557
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
558 /* Free the resources for the faces associated with a frame. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
559 extern void free_frame_faces (/* FRAME_PTR */);
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
560
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
561 /* Given a computed face, find or make an equivalent display face
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
562 in face_vector, and return a pointer to it. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
563 extern struct face *intern_face (/* FRAME_PTR, struct face * */);
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
564
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
565 /* Given a frame and a face name, return the face's ID number, or
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
566 zero if it isn't a recognized face name. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
567 extern int face_name_id_number (/* FRAME_PTR, Lisp_Object */);
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
568
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
569 /* Return non-zero if FONT1 and FONT2 have the same size bounding box.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
570 We assume that they're both character-cell fonts. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
571 extern int same_size_fonts (/* XFontStruct *, XFontStruct * */);
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
572
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
573 /* Recompute the GC's for the default and modeline faces.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
574 We call this after changing frame parameters on which those GC's
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
575 depend. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
576 extern void recompute_basic_faces (/* FRAME_PTR */);
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
577
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
578 /* Return the face ID associated with a buffer position POS. Store
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
579 into *ENDPTR the next position at which a different face is
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
580 needed. This does not take account of glyphs that specify their
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
581 own face codes. F is the frame in use for display, and W is a
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
582 window displaying the current buffer.
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
583
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
584 REGION_BEG, REGION_END delimit the region, so it can be highlighted. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
585 extern int compute_char_face (/* FRAME_PTR frame,
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
586 struct window *w,
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
587 int pos,
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
588 int region_beg, int region_end,
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
589 int *endptr */);
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
590 /* Return the face ID to use to display a special glyph which selects
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
591 FACE_CODE as the face ID, assuming that ordinarily the face would
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
592 be BASIC_FACE. F is the frame. */
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
593 extern int compute_glyph_face (/* FRAME_PTR, int */);
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
594
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
595 extern void w32_fill_rect ();
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
596 extern void w32_clear_window ();
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
597
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
598 #define w32_fill_area(f,hdc,pix,x,y,nx,ny) \
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
599 { \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
600 RECT rect; \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
601 rect.left = x; \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
602 rect.top = y; \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
603 rect.right = x + nx; \
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
604 rect.bottom = y + ny; \
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
605 w32_fill_rect (f,hdc,pix,&rect); \
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
606 }
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
607
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
608 #define w32_clear_rect(f,hdc,lprect) \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
609 w32_fill_rect (f,hdc,f->output_data.w32->background_pixel,lprect)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
610
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
611 #define w32_clear_area(f,hdc,x,y,nx,ny) \
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
612 w32_fill_area (f,hdc,f->output_data.w32->background_pixel,x,y,nx,ny)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
613
23508
4e067ce42325 Remove redundant font_info struct definition.
Geoff Voelker <voelker@cs.washington.edu>
parents: 22080
diff changeset
614 extern struct font_info *w32_load_font ();
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
615 extern void w32_unload_font ();
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
616
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
617 /* Define for earlier versions of Visual C */
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
618 #ifndef WM_MOUSEWHEEL
21876
52ebc509a367 (WM_MOUSEWHEEL): Define relative to WM_MOUSELAST.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21615
diff changeset
619 #define WM_MOUSEWHEEL (WM_MOUSELAST + 1)
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
620 #endif /* WM_MOUSEWHEEL */
21876
52ebc509a367 (WM_MOUSEWHEEL): Define relative to WM_MOUSELAST.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21615
diff changeset
621 #ifndef MSH_MOUSEWHEEL
52ebc509a367 (WM_MOUSEWHEEL): Define relative to WM_MOUSELAST.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21615
diff changeset
622 #define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
52ebc509a367 (WM_MOUSEWHEEL): Define relative to WM_MOUSELAST.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21615
diff changeset
623 #endif /* MSH_MOUSEWHEEL */
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
624
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
625 #define WM_EMACS_START (WM_USER + 1)
23676
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
626 #define WM_EMACS_KILL (WM_EMACS_START + 0)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
627 #define WM_EMACS_CREATEWINDOW (WM_EMACS_START + 1)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
628 #define WM_EMACS_DONE (WM_EMACS_START + 2)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
629 #define WM_EMACS_CREATESCROLLBAR (WM_EMACS_START + 3)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
630 #define WM_EMACS_SHOWWINDOW (WM_EMACS_START + 4)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
631 #define WM_EMACS_SETWINDOWPOS (WM_EMACS_START + 5)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
632 #define WM_EMACS_DESTROYWINDOW (WM_EMACS_START + 6)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
633 #define WM_EMACS_TRACKPOPUPMENU (WM_EMACS_START + 7)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
634 #define WM_EMACS_SETFOCUS (WM_EMACS_START + 8)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
635 #define WM_EMACS_SETFOREGROUND (WM_EMACS_START + 9)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
636 #define WM_EMACS_SETLOCALE (WM_EMACS_START + 10)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
637 #define WM_EMACS_SETKEYBOARDLAYOUT (WM_EMACS_START + 11)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
638 #define WM_EMACS_REGISTER_HOT_KEY (WM_EMACS_START + 12)
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
639 #define WM_EMACS_UNREGISTER_HOT_KEY (WM_EMACS_START + 13)
23805
44ad68548ff9 (WM_EMACS_TOGGLE_LOCK_KEY): New define.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23676
diff changeset
640 #define WM_EMACS_TOGGLE_LOCK_KEY (WM_EMACS_START + 14)
44ad68548ff9 (WM_EMACS_TOGGLE_LOCK_KEY): New define.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23676
diff changeset
641 #define WM_EMACS_END (WM_EMACS_START + 15)
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
642
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
643 #define WND_FONTWIDTH_INDEX (0)
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
644 #define WND_LINEHEIGHT_INDEX (4)
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
645 #define WND_BORDER_INDEX (8)
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
646 #define WND_SCROLLBAR_INDEX (12)
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
647 #define WND_BACKGROUND_INDEX (16)
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
648 #define WND_LAST_INDEX (20)
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
649
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
650 #define WND_EXTRA_BYTES (WND_LAST_INDEX)
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
651
16886
c686d4f3728a Change all uses of win95, winnt, and win32 into Windows 95, Windows
Geoff Voelker <voelker@cs.washington.edu>
parents: 16588
diff changeset
652 extern DWORD dwWindowsThreadId;
c686d4f3728a Change all uses of win95, winnt, and win32 into Windows 95, Windows
Geoff Voelker <voelker@cs.washington.edu>
parents: 16588
diff changeset
653 extern HANDLE hWindowsThread;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
654 extern DWORD dwMainThreadId;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
655 extern HANDLE hMainThread;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
656
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
657 typedef struct W32Msg {
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
658 MSG msg;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
659 DWORD dwModifiers;
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
660 RECT rect;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
661 } W32Msg;
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
662
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
663 /* Structure for recording message when input thread must return a
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
664 result that depends on lisp thread to compute. Lisp thread can
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
665 complete deferred messages out of order. */
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
666 typedef struct deferred_msg
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
667 {
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
668 struct deferred_msg * next;
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
669 W32Msg w32msg;
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
670 LRESULT result;
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
671 int completed;
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
672 } deferred_msg;
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
673
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
674 extern CRITICAL_SECTION critsect;
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
675
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
676 extern void init_crit ();
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
677 extern void delete_crit ();
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
678
22080
f519dedee9bc (signal_quit): Add prototype.
Richard M. Stallman <rms@gnu.org>
parents: 21876
diff changeset
679 extern void signal_quit ();
f519dedee9bc (signal_quit): Add prototype.
Richard M. Stallman <rms@gnu.org>
parents: 21876
diff changeset
680
15152
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
681 #define enter_crit() EnterCriticalSection (&critsect)
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
682 #define leave_crit() LeaveCriticalSection (&critsect)
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
683
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
684 extern void select_palette (struct frame * f, HDC hdc);
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
685 extern void deselect_palette (struct frame * f, HDC hdc);
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
686 extern HDC get_frame_dc (struct frame * f);
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
687 extern int release_frame_dc (struct frame * f, HDC hDC);
2dd4961cefaa (struct win32_palette_entry): New structure.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14984
diff changeset
688
24916
dcad7c5b7add (drain_message_queue): Add extern.
Andrew Innes <andrewi@gnu.org>
parents: 24145
diff changeset
689 extern void drain_message_queue ();
dcad7c5b7add (drain_message_queue): Add extern.
Andrew Innes <andrewi@gnu.org>
parents: 24145
diff changeset
690
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
691 extern BOOL get_next_msg ();
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
692 extern BOOL post_msg ();
19714
72fa0e75a0fe (w32_output): New fields menubar_widget, menubar_active,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16888
diff changeset
693 extern void complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result);
13543
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
694 extern void wait_for_sync ();
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
695
23c68d2e061f Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
696 extern BOOL parse_button ();
14809
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
697
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15152
diff changeset
698 /* Keypad command key support. W32 doesn't have virtual keys defined
14809
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
699 for the function keys on the keypad (they are mapped to the standard
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
700 fuction keys), so we define our own. */
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
701 #define VK_NUMPAD_BEGIN 0x92
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
702 #define VK_NUMPAD_CLEAR (VK_NUMPAD_BEGIN + 0)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
703 #define VK_NUMPAD_ENTER (VK_NUMPAD_BEGIN + 1)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
704 #define VK_NUMPAD_PRIOR (VK_NUMPAD_BEGIN + 2)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
705 #define VK_NUMPAD_NEXT (VK_NUMPAD_BEGIN + 3)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
706 #define VK_NUMPAD_END (VK_NUMPAD_BEGIN + 4)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
707 #define VK_NUMPAD_HOME (VK_NUMPAD_BEGIN + 5)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
708 #define VK_NUMPAD_LEFT (VK_NUMPAD_BEGIN + 6)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
709 #define VK_NUMPAD_UP (VK_NUMPAD_BEGIN + 7)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
710 #define VK_NUMPAD_RIGHT (VK_NUMPAD_BEGIN + 8)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
711 #define VK_NUMPAD_DOWN (VK_NUMPAD_BEGIN + 9)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
712 #define VK_NUMPAD_INSERT (VK_NUMPAD_BEGIN + 10)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
713 #define VK_NUMPAD_DELETE (VK_NUMPAD_BEGIN + 11)
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
714
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
715 #ifndef VK_LWIN
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
716 /* Older compiler environments don't have these defined. */
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
717 #define VK_LWIN 0x5B
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
718 #define VK_RWIN 0x5C
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
719 #define VK_APPS 0x5D
fb9e2125fc2e (VK_NUMPAD_*, VK_LWIN, VK_RWIN, VK_APPS):
Geoff Voelker <voelker@cs.washington.edu>
parents: 14521
diff changeset
720 #endif
23676
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
721
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
722 /* Support for treating Windows and Apps keys as modifiers. These
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
723 constants must not overlap with any of the dwControlKeyState flags in
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
724 KEY_EVENT_RECORD. */
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
725 #define LEFT_WIN_PRESSED 0x8000
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
726 #define RIGHT_WIN_PRESSED 0x4000
704d2e178bcb (struct w32_display_info): New element faked_key.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23508
diff changeset
727 #define APPS_PRESSED 0x2000