13543
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
1 /* Definitions and headers for communication with Win32 GUI.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
2 Copyright (C) 1995 Free Software Foundation, Inc.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
3
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
4 This file is part of GNU Emacs.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
5
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
6 GNU Emacs is free software; you can redistribute it and/or modify
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
7 it under the terms of the GNU General Public License as published by
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
8 the Free Software Foundation; either version 2, or (at your option)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
9 any later version.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
10
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
11 GNU Emacs is distributed in the hope that it will be useful,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
14 GNU General Public License for more details.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
15
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
16 You should have received a copy of the GNU General Public License
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
17 along with GNU Emacs; see the file COPYING. If not, write to
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
19
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
20 /* Added by Kevin Gallo */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
21
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
22 #include <win32.h>
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
23
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
24 /* The class of this X application. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
25 #define EMACS_CLASS "Emacs"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
26
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
27 #define BLACK_PIX_DEFAULT(f) RGB(0,0,0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
28 #define WHITE_PIX_DEFAULT(f) RGB(255,255,255)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
29
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
30 #define FONT_WIDTH(f) ((f)->tm.tmMaxCharWidth)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
31 #define FONT_HEIGHT(f) ((f)->tm.tmHeight)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
32 #define FONT_BASE(f) ((f)->tm.tmAscent)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
33
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
34 #define CHECK_WIN32_FRAME(f, frame) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
35 if (NILP (frame)) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
36 f = selected_frame; \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
37 else \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
38 { \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
39 CHECK_LIVE_FRAME (frame, 0); \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
40 f = XFRAME (frame); \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
41 } \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
42 if (! FRAME_WIN32_P (f))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
43
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
44 /* Indicates whether we are in the readsocket call and the message we
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
45 are processing in the current loop */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
46
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
47 extern MSG CurMsg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
48 extern BOOL bUseDflt;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
49
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
50 extern struct frame *x_window_to_frame ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
51
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
52 enum text_cursor_kinds {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
53 filled_box_cursor, hollow_box_cursor, bar_cursor
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
54 };
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
55
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
56 /* This data type is used for the font_table field
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
57 of struct win32_display_info. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
58
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
59 struct font_info
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
60 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
61 XFontStruct *font;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
62 char *name;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
63 };
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
64
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
65 /* Structure recording bitmaps and reference count.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
66 If REFCOUNT is 0 then this record is free to be reused. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
67
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
68 struct win32_bitmap_record
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
69 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
70 Pixmap pixmap;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
71 char *file;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
72 HINSTANCE hinst; /* Used to load the file */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
73 int refcount;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
74 /* Record some info about this pixmap. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
75 int height, width, depth;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
76 };
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
77
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
78 /* For each display (currently only one on win32), we have a structure that
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
79 records information about it. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
80
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
81 struct win32_display_info
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
82 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
83 /* Chain of all win32_display_info structures. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
84 struct win32_display_info *next;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
85 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE).
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
86 The same cons cell also appears in x_display_name_list. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
87 Lisp_Object name_list_element;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
88 /* Number of frames that are on this display. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
89 int reference_count;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
90 /* Number of planes on this screen. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
91 int n_planes;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
92 /* Number of bits per pixel on this screen. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
93 int n_cbits;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
94 /* Dimensions of this screen. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
95 int height, width;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
96 int height_in,width_in;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
97 /* Mask of things that cause the mouse to be grabbed. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
98 int grabbed;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
99 /* The root window of this screen. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
100 Window root_window;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
101 /* The cursor to use for vertical scroll bars. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
102 Cursor vertical_scroll_bar_cursor;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
103
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
104 /* A table of all the fonts we have already loaded. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
105 struct font_info *font_table;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
106
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
107 /* The current capacity of x_font_table. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
108 int font_table_size;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
109
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
110 /* These variables describe the range of text currently shown
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
111 in its mouse-face, together with the window they apply to.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
112 As long as the mouse stays within this range, we need not
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
113 redraw anything on its account. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
114 int mouse_face_beg_row, mouse_face_beg_col;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
115 int mouse_face_end_row, mouse_face_end_col;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
116 int mouse_face_past_end;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
117 Lisp_Object mouse_face_window;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
118 int mouse_face_face_id;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
119
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
120 /* 1 if a mouse motion event came and we didn't handle it right away because
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
121 gc was in progress. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
122 int mouse_face_deferred_gc;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
123
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
124 /* FRAME and X, Y position of mouse when last checked for
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
125 highlighting. X and Y can be negative or out of range for the frame. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
126 struct frame *mouse_face_mouse_frame;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
127 int mouse_face_mouse_x, mouse_face_mouse_y;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
128
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
129 /* Nonzero means defer mouse-motion highlighting. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
130 int mouse_face_defer;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
131
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
132 char *win32_id_name;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
133
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
134 /* The number of fonts actually stored in win32_font_table.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
135 font_table[n] is used and valid iff 0 <= n < n_fonts.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
136 0 <= n_fonts <= font_table_size. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
137 int n_fonts;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
138
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
139 /* Pointer to bitmap records. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
140 struct win32_bitmap_record *bitmaps;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
141
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
142 /* Allocated size of bitmaps field. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
143 int bitmaps_size;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
144
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
145 /* Last used bitmap index. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
146 int bitmaps_last;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
147
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
148 /* The frame (if any) which has the window that has keyboard focus.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
149 Zero if none. This is examined by Ffocus_frame in w32fns.c. Note
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
150 that a mere EnterNotify event can set this; if you need to know the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
151 last frame specified in a FocusIn or FocusOut event, use
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
152 win32_focus_event_frame. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
153 struct frame *win32_focus_frame;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
154
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
155 /* The last frame mentioned in a FocusIn or FocusOut event. This is
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
156 separate from win32_focus_frame, because whether or not LeaveNotify
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
157 events cause us to lose focus depends on whether or not we have
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
158 received a FocusIn event for it. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
159 struct frame *win32_focus_event_frame;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
160
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
161 /* The frame which currently has the visual highlight, and should get
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
162 keyboard input (other sorts of input have the frame encoded in the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
163 event). It points to the focus frame's selected window's
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
164 frame. It differs from win32_focus_frame when we're using a global
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
165 minibuffer. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
166 struct frame *win32_highlight_frame;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
167 };
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
168
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
169 /* This is a chain of structures for all the displays currently in use. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
170 extern struct win32_display_info one_win32_display_info;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
171
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
172 /* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE),
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
173 one for each element of win32_display_list and in the same order.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
174 NAME is the name of the frame.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
175 FONT-LIST-CACHE records previous values returned by x-list-fonts. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
176 extern Lisp_Object win32_display_name_list;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
177
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
178 extern struct win32_display_info *x_display_info_for_display ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
179 extern struct win32_display_info *x_display_info_for_name ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
180
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
181 extern struct win32_display_info *win32_term_init ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
182
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
183 /* Each Win32 frame object points to its own struct win32_display object
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
184 in the output_data.win32 field. The win32_display structure contains all
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
185 the information that is specific to Win32 windows. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
186
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
187 struct win32_output
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
188 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
189 /* Position of the Win32 window (x and y offsets in root window). */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
190 int left_pos;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
191 int top_pos;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
192
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
193 /* Border width of the Win32 window as known by the window system. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
194 int border_width;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
195
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
196 /* Size of the Win32 window in pixels. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
197 int pixel_height, pixel_width;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
198
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
199 /* Height of a line, in pixels. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
200 int line_height;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
201
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
202 /* Width of the internal border. This is a line of background color
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
203 just inside the window's border. When the frame is selected,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
204 a highlighting is displayed inside the internal border. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
205 int internal_border_width;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
206
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
207 /* The window used for this frame.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
208 May be zero while the frame object is being created
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
209 and the window has not yet been created. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
210 Window window_desc;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
211
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
212 /* The window that is the parent of this window.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
213 Usually this is a window that was made by the window manager,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
214 but it can be the root window, and it can be explicitly specified
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
215 (see the explicit_parent field, below). */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
216 Window parent_desc;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
217
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
218 XFontStruct *font;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
219
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
220 /* Pixel values used for various purposes.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
221 border_pixel may be -1 meaning use a gray tile. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
222 unsigned long background_pixel;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
223 unsigned long foreground_pixel;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
224 unsigned long cursor_pixel;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
225 unsigned long border_pixel;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
226 unsigned long mouse_pixel;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
227 unsigned long cursor_foreground_pixel;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
228
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
229 /* Descriptor for the cursor in use for this window. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
230 Cursor text_cursor;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
231 Cursor nontext_cursor;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
232 Cursor modeline_cursor;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
233 Cursor cross_cursor;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
234
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
235 /* Flag to set when the window needs to be completely repainted. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
236 int needs_exposure;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
237
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
238 /* What kind of text cursor is drawn in this window right now?
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
239 (If there is no cursor (phys_cursor_x < 0), then this means nothing.) */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
240 enum text_cursor_kinds current_cursor;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
241
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
242 /* What kind of text cursor should we draw in the future?
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
243 This should always be filled_box_cursor or bar_cursor. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
244 enum text_cursor_kinds desired_cursor;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
245
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
246 /* Width of bar cursor (if we are using that). */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
247 int cursor_width;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
248
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
249 DWORD dwStyle;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
250
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
251 /* The size of the extra width currently allotted for vertical
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
252 scroll bars, in pixels. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
253 int vertical_scroll_bar_extra;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
254
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
255 /* Table of parameter faces for this frame. Any resources (pixel
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
256 values, fonts) referred to here have been allocated explicitly
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
257 for this face, and should be freed if we change the face. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
258 struct face **param_faces;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
259 int n_param_faces;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
260
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
261 /* Table of computed faces for this frame. These are the faces
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
262 whose indexes go into the upper bits of a glyph, computed by
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
263 combining the parameter faces specified by overlays, text
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
264 properties, and what have you. The resources mentioned here
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
265 are all shared with parameter faces. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
266 struct face **computed_faces;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
267 int n_computed_faces; /* How many are valid */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
268 int size_computed_faces; /* How many are allocated */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
269
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
270 /* This is the gravity value for the specified window position. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
271 int win_gravity;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
272
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
273 /* The geometry flags for this window. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
274 int size_hint_flags;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
275
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
276 /* This is the Emacs structure for the display this frame is on. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
277 /* struct win32_display_info *display_info; */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
278
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
279 /* Nonzero means our parent is another application's window
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
280 and was explicitly specified. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
281 char explicit_parent;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
282
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
283 /* Nonzero means tried already to make this frame visible. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
284 char asked_for_visible;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
285 };
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
286
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
287 /* Get at the computed faces of an X window frame. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
288 #define FRAME_PARAM_FACES(f) ((f)->output_data.win32->param_faces)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
289 #define FRAME_N_PARAM_FACES(f) ((f)->output_data.win32->n_param_faces)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
290 #define FRAME_DEFAULT_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[0])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
291 #define FRAME_MODE_LINE_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[1])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
292
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
293 #define FRAME_COMPUTED_FACES(f) ((f)->output_data.win32->computed_faces)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
294 #define FRAME_N_COMPUTED_FACES(f) ((f)->output_data.win32->n_computed_faces)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
295 #define FRAME_SIZE_COMPUTED_FACES(f) ((f)->output_data.win32->size_computed_faces)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
296 #define FRAME_DEFAULT_FACE(f) ((f)->output_data.win32->computed_faces[0])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
297 #define FRAME_MODE_LINE_FACE(f) ((f)->output_data.win32->computed_faces[1])
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
298
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
299 /* Return the window associated with the frame F. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
300 #define FRAME_WIN32_WINDOW(f) ((f)->output_data.win32->window_desc)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
301
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
302 #define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.win32->foreground_pixel)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
303 #define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.win32->background_pixel)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
304 #define FRAME_FONT(f) ((f)->output_data.win32->font)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
305 #define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->output_data.win32->internal_border_width)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
306
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
307 /* This gives the win32_display_info structure for the display F is on. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
308 #define FRAME_WIN32_DISPLAY_INFO(f) (&one_win32_display_info)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
309
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
310 /* These two really ought to be called FRAME_PIXEL_{WIDTH,HEIGHT}. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
311 #define PIXEL_WIDTH(f) ((f)->output_data.win32->pixel_width)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
312 #define PIXEL_HEIGHT(f) ((f)->output_data.win32->pixel_height)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
313 #define FRAME_LINE_HEIGHT(f) ((f)->output_data.win32->line_height)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
314
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
315 #define FRAME_DESIRED_CURSOR(f) ((f)->output_data.win32->desired_cursor)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
316
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
317
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
318 /* Win32-specific scroll bar stuff. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
319
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
320 /* We represent scroll bars as lisp vectors. This allows us to place
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
321 references to them in windows without worrying about whether we'll
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
322 end up with windows referring to dead scroll bars; the garbage
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
323 collector will free it when its time comes.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
324
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
325 We use struct scroll_bar as a template for accessing fields of the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
326 vector. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
327
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
328 struct scroll_bar {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
329
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
330 /* These fields are shared by all vectors. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
331 EMACS_INT size_from_Lisp_Vector_struct;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
332 struct Lisp_Vector *next_from_Lisp_Vector_struct;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
333
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
334 /* The window we're a scroll bar for. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
335 Lisp_Object window;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
336
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
337 /* The next and previous in the chain of scroll bars in this frame. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
338 Lisp_Object next, prev;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
339
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
340 /* The window representing this scroll bar. Since this is a full
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
341 32-bit quantity, we store it split into two 32-bit values. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
342 Lisp_Object win32_window_low, win32_window_high;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
343
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
344 /* The position and size of the scroll bar in pixels, relative to the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
345 frame. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
346 Lisp_Object top, left, width, height;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
347
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
348 /* The starting and ending positions of the handle, relative to the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
349 handle area (i.e. zero is the top position, not
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
350 SCROLL_BAR_TOP_BORDER). If they're equal, that means the handle
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
351 hasn't been drawn yet.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
352
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
353 These are not actually the locations where the beginning and end
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
354 are drawn; in order to keep handles from becoming invisible when
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
355 editing large files, we establish a minimum height by always
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
356 drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
357 where they would be normally; the bottom and top are in a
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
358 different co-ordinate system. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
359 Lisp_Object start, end;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
360
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
361 /* If the scroll bar handle is currently being dragged by the user,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
362 this is the number of pixels from the top of the handle to the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
363 place where the user grabbed it. If the handle isn't currently
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
364 being dragged, this is Qnil. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
365 Lisp_Object dragging;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
366 };
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
367
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
368 /* The number of elements a vector holding a struct scroll_bar needs. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
369 #define SCROLL_BAR_VEC_SIZE \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
370 ((sizeof (struct scroll_bar) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
371 - sizeof (EMACS_INT) - sizeof (struct Lisp_Vector *)) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
372 / sizeof (Lisp_Object))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
373
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
374 /* Turning a lisp vector value into a pointer to a struct scroll_bar. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
375 #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
376
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
377
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
378 /* Building a 32-bit C integer from two 16-bit lisp integers. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
379 #define SCROLL_BAR_PACK(low, high) (XINT (high) << 16 | XINT (low))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
380
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
381 /* Setting two lisp integers to the low and high words of a 32-bit C int. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
382 #define SCROLL_BAR_UNPACK(low, high, int32) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
383 (XSETINT ((low), (int32) & 0xffff), \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
384 XSETINT ((high), ((int32) >> 16) & 0xffff))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
385
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
386
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
387 /* Extract the window id of the scroll bar from a struct scroll_bar. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
388 #define SCROLL_BAR_WIN32_WINDOW(ptr) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
389 ((Window) SCROLL_BAR_PACK ((ptr)->win32_window_low, (ptr)->win32_window_high))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
390
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
391 /* Store a window id in a struct scroll_bar. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
392 #define SET_SCROLL_BAR_WIN32_WINDOW(ptr, id) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
393 (SCROLL_BAR_UNPACK ((ptr)->win32_window_low, (ptr)->win32_window_high, (int) id))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
394
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
395
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
396 /* Return the outside pixel height for a vertical scroll bar HEIGHT
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
397 rows high on frame F. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
398 #define VERTICAL_SCROLL_BAR_PIXEL_HEIGHT(f, height) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
399 ((height) * (f)->output_data.win32->line_height)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
400
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
401 /* Return the inside width of a vertical scroll bar, given the outside
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
402 width. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
403 #define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(width) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
404 ((width) - VERTICAL_SCROLL_BAR_LEFT_BORDER - VERTICAL_SCROLL_BAR_RIGHT_BORDER)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
405
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
406 /* Return the length of the rectangle within which the top of the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
407 handle must stay. This isn't equivalent to the inside height,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
408 because the scroll bar handle has a minimum height.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
409
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
410 This is the real range of motion for the scroll bar, so when we're
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
411 scaling buffer positions to scroll bar positions, we use this, not
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
412 VERTICAL_SCROLL_BAR_INSIDE_HEIGHT. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
413 #define VERTICAL_SCROLL_BAR_TOP_RANGE(height) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
414 (VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (height) - VERTICAL_SCROLL_BAR_MIN_HANDLE)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
415
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
416 /* Return the inside height of vertical scroll bar, given the outside
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
417 height. See VERTICAL_SCROLL_BAR_TOP_RANGE too. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
418 #define VERTICAL_SCROLL_BAR_INSIDE_HEIGHT(height) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
419 ((height) - VERTICAL_SCROLL_BAR_TOP_BORDER - VERTICAL_SCROLL_BAR_BOTTOM_BORDER)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
420
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
421
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
422 /* Border widths for scroll bars.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
423
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
424 Scroll bar windows don't have any borders; their border width is
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
425 set to zero, and we redraw borders ourselves. This makes the code
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
426 a bit cleaner, since we don't have to convert between outside width
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
427 (used when relating to the rest of the screen) and inside width
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
428 (used when sizing and drawing the scroll bar window itself).
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
429
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
430 The handle moves up and down/back and forth in a rectangle inset
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
431 from the edges of the scroll bar. These are widths by which we
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
432 inset the handle boundaries from the scroll bar edges. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
433 #define VERTICAL_SCROLL_BAR_LEFT_BORDER (0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
434 #define VERTICAL_SCROLL_BAR_RIGHT_BORDER (0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
435 #define VERTICAL_SCROLL_BAR_TOP_BORDER (0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
436 #define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
437
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
438 /* Minimum lengths for scroll bar handles, in pixels. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
439 #define VERTICAL_SCROLL_BAR_MIN_HANDLE (0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
440
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
441
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
442 /* Manipulating pixel sizes and character sizes.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
443 Knowledge of which factors affect the overall size of the window should
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
444 be hidden in these macros, if that's possible.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
445
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
446 Return the upper/left pixel position of the character cell on frame F
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
447 at ROW/COL. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
448 #define CHAR_TO_PIXEL_ROW(f, row) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
449 ((f)->output_data.win32->internal_border_width \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
450 + (row) * (f)->output_data.win32->line_height)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
451 #define CHAR_TO_PIXEL_COL(f, col) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
452 ((f)->output_data.win32->internal_border_width \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
453 + (col) * FONT_WIDTH ((f)->output_data.win32->font))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
454
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
455 /* Return the pixel width/height of frame F if it has
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
456 WIDTH columns/HEIGHT rows. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
457 #define CHAR_TO_PIXEL_WIDTH(f, width) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
458 (CHAR_TO_PIXEL_COL (f, width) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
459 + (f)->output_data.win32->vertical_scroll_bar_extra \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
460 + (f)->output_data.win32->internal_border_width)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
461 #define CHAR_TO_PIXEL_HEIGHT(f, height) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
462 (CHAR_TO_PIXEL_ROW (f, height) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
463 + (f)->output_data.win32->internal_border_width)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
464
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
465
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
466 /* Return the row/column (zero-based) of the character cell containing
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
467 the pixel on FRAME at ROW/COL. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
468 #define PIXEL_TO_CHAR_ROW(f, row) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
469 (((row) - (f)->output_data.win32->internal_border_width) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
470 / (f)->output_data.win32->line_height)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
471 #define PIXEL_TO_CHAR_COL(f, col) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
472 (((col) - (f)->output_data.win32->internal_border_width) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
473 / FONT_WIDTH ((f)->output_data.win32->font))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
474
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
475 /* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
476 frame F? */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
477 #define PIXEL_TO_CHAR_WIDTH(f, width) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
478 (PIXEL_TO_CHAR_COL (f, ((width) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
479 - (f)->output_data.win32->internal_border_width \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
480 - (f)->output_data.win32->vertical_scroll_bar_extra)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
481 #define PIXEL_TO_CHAR_HEIGHT(f, height) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
482 (PIXEL_TO_CHAR_ROW (f, ((height) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
483 - (f)->output_data.win32->internal_border_width)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
484
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
485 /* Interface to the face code functions. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
486
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
487 /* Create the first two computed faces for a frame -- the ones that
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
488 have GC's. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
489 extern void init_frame_faces (/* FRAME_PTR */);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
490
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
491 /* Free the resources for the faces associated with a frame. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
492 extern void free_frame_faces (/* FRAME_PTR */);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
493
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
494 /* Given a computed face, find or make an equivalent display face
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
495 in face_vector, and return a pointer to it. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
496 extern struct face *intern_face (/* FRAME_PTR, struct face * */);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
497
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
498 /* Given a frame and a face name, return the face's ID number, or
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
499 zero if it isn't a recognized face name. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
500 extern int face_name_id_number (/* FRAME_PTR, Lisp_Object */);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
501
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
502 /* Return non-zero if FONT1 and FONT2 have the same size bounding box.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
503 We assume that they're both character-cell fonts. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
504 extern int same_size_fonts (/* XFontStruct *, XFontStruct * */);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
505
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
506 /* Recompute the GC's for the default and modeline faces.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
507 We call this after changing frame parameters on which those GC's
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
508 depend. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
509 extern void recompute_basic_faces (/* FRAME_PTR */);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
510
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
511 /* Return the face ID associated with a buffer position POS. Store
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
512 into *ENDPTR the next position at which a different face is
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
513 needed. This does not take account of glyphs that specify their
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
514 own face codes. F is the frame in use for display, and W is a
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
515 window displaying the current buffer.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
516
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
517 REGION_BEG, REGION_END delimit the region, so it can be highlighted. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
518 extern int compute_char_face (/* FRAME_PTR frame,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
519 struct window *w,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
520 int pos,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
521 int region_beg, int region_end,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
522 int *endptr */);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
523 /* Return the face ID to use to display a special glyph which selects
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
524 FACE_CODE as the face ID, assuming that ordinarily the face would
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
525 be BASIC_FACE. F is the frame. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
526 extern int compute_glyph_face (/* FRAME_PTR, int */);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
527
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
528 extern void win32_fill_rect ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
529 extern void win32_clear_window ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
530
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
531 #define win32_fill_area(f,hdc,pix,x,y,nx,ny) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
532 { \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
533 RECT rect; \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
534 rect.left = x; \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
535 rect.top = y; \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
536 rect.right = x + nx; \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
537 rect.bottom = y + ny; \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
538 win32_fill_rect (f,hdc,pix,&rect); \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
539 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
540
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
541 #define win32_clear_rect(f,hdc,lprect) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
542 win32_fill_rect (f,hdc,f->output_data.win32->background_pixel,lprect)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
543
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
544 #define win32_clear_area(f,hdc,x,y,nx,ny) \
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
545 win32_fill_area (f,hdc,f->output_data.win32->background_pixel,x,y,nx,ny)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
546
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
547 extern XFontStruct *win32_load_font ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
548 extern void win32_unload_font ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
549
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
550 extern HDC map_mode();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
551
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
552 #define my_get_dc(hwnd) (map_mode (GetDC (hwnd)))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
553
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
554 #define WM_EMACS_START (WM_USER + 1)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
555 #define WM_EMACS_KILL (WM_EMACS_START + 0x00)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
556 #define WM_EMACS_CREATEWINDOW (WM_EMACS_START + 0x01)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
557 #define WM_EMACS_DONE (WM_EMACS_START + 0x02)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
558 #define WM_EMACS_CREATESCROLLBAR (WM_EMACS_START + 0x03)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
559 #define WM_EMACS_DESTROYWINDOW (WM_EMACS_START + 0x04)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
560 #define WM_EMACS_END (WM_EMACS_START + 0x10)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
561
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
562 #define WND_X_UNITS_INDEX (0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
563 #define WND_Y_UNITS_INDEX (4)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
564 #define WND_BACKGROUND_INDEX (8)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
565
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
566 #define WND_LAST_INDEX (16)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
567 #define WND_EXTRA_BYTES (WND_LAST_INDEX)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
568
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
569 extern DWORD dwWinThreadId;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
570 extern HANDLE hWinThread;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
571 extern DWORD dwMainThreadId;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
572 extern HANDLE hMainThread;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
573
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
574 typedef struct Win32Msg {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
575 MSG msg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
576 DWORD dwModifiers;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
577 RECT rect;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
578 } Win32Msg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
579
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
580 extern void init_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
581 extern void enter_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
582 extern void leave_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
583 extern void delete_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
584
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
585 extern BOOL get_next_msg ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
586 extern BOOL post_msg ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
587 extern void wait_for_sync ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
588
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
589 extern BOOL parse_button ();
|