1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #include "w32gui.h"
22 #include "frame.h"
23 #include "atimer.h"
24
25
26
27
28
29
30
31
32
33 #ifdef __GNUC__
34 # if USE_STACK_LISP_OBJECTS && !defined _WIN64 && !defined __x86_64__ \
35 && __GNUC__ + (__GNUC_MINOR__ > 1) >= 5
36 # define ALIGN_STACK __attribute__((force_align_arg_pointer))
37 # else
38 # define ALIGN_STACK
39 # endif
40 #endif
41
42
43 #define BLACK_PIX_DEFAULT(f) PALETTERGB(0,0,0)
44 #define WHITE_PIX_DEFAULT(f) PALETTERGB(255,255,255)
45
46 #define CP_DEFAULT 1004
47
48
49
50
51 extern MSG CurMsg;
52 extern BOOL bUseDflt;
53
54
55
56
57 struct w32_bitmap_record
58 {
59 Emacs_Pixmap pixmap;
60 char *file;
61 HINSTANCE hinst;
62 int refcount;
63
64 int height, width, depth;
65 };
66
67 struct w32_palette_entry {
68 struct w32_palette_entry * next;
69 PALETTEENTRY entry;
70 #if 0
71 unsigned refcount;
72 #endif
73 };
74
75 extern void w32_regenerate_palette (struct frame *f);
76 extern void w32_fullscreen_rect (HWND hwnd, int fsmode, RECT normal,
77 RECT *rect);
78
79
80
81
82 struct w32_display_info
83 {
84
85 struct w32_display_info *next;
86
87
88 struct terminal *terminal;
89
90
91 Lisp_Object name_list_element;
92
93
94 int reference_count;
95
96
97 double resx, resy;
98
99
100 int n_planes;
101
102
103 int n_cbits;
104
105
106 int grabbed;
107
108
109
110 ptrdiff_t icon_bitmap_id;
111
112
113 Window root_window;
114
115
116 HCURSOR vertical_scroll_bar_cursor;
117
118
119 HCURSOR horizontal_scroll_bar_cursor;
120
121
122 const char *rdb;
123
124
125 int has_palette;
126 struct w32_palette_entry * color_list;
127 unsigned num_colors;
128 HPALETTE palette;
129
130
131 int regen_palette;
132
133
134
135 int faked_key;
136
137
138 int smallest_char_width;
139
140
141 int smallest_font_height;
142
143
144 Emacs_GC *scratch_cursor_gc;
145
146
147
148 Mouse_HLInfo mouse_highlight;
149
150 char *w32_id_name;
151
152
153
154
155 int n_fonts;
156
157
158 struct w32_bitmap_record *bitmaps;
159
160
161 ptrdiff_t bitmaps_size;
162
163
164 ptrdiff_t bitmaps_last;
165
166
167
168
169
170
171 struct frame *w32_focus_frame;
172
173
174
175
176
177 struct frame *w32_focus_event_frame;
178
179
180
181
182
183
184 struct frame *highlight_frame;
185
186
187 struct frame *w32_pending_autoraise_frame;
188
189
190 struct frame *last_mouse_frame;
191
192
193 struct frame *last_mouse_motion_frame;
194
195
196 struct frame *last_mouse_glyph_frame;
197
198
199
200 int last_mouse_motion_x;
201 int last_mouse_motion_y;
202
203
204
205 RECT last_mouse_glyph;
206
207
208 struct scroll_bar *last_mouse_scroll_bar;
209
210
211
212 int last_mouse_scroll_bar_pos;
213
214
215 Time last_mouse_movement_time;
216
217
218 int cursor_display_counter;
219 };
220
221
222 extern struct w32_display_info *x_display_list;
223 extern struct w32_display_info one_w32_display_info;
224
225
226 extern HMENU current_popup_menu;
227 extern int menubar_in_use;
228
229 extern struct frame *w32_window_to_frame (struct w32_display_info *, HWND);
230
231 extern void w32_real_positions (struct frame *f, int *xptr, int *yptr);
232
233 extern void w32_clear_under_internal_border (struct frame *);
234
235 extern void w32_change_tab_bar_height (struct frame *, int);
236 extern void w32_change_tool_bar_height (struct frame *, int);
237 extern void w32_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
238 extern void w32_set_scroll_bar_default_width (struct frame *);
239 extern void w32_set_scroll_bar_default_height (struct frame *);
240
241
242 extern struct w32_display_info *w32_term_init (Lisp_Object,
243 char *, char *);
244 extern bool w32_defined_color (struct frame *, const char *, Emacs_Color *,
245 bool, bool);
246 extern int w32_display_pixel_height (struct w32_display_info *);
247 extern int w32_display_pixel_width (struct w32_display_info *);
248 extern void initialize_frame_menubar (struct frame *);
249 extern void w32_dialog_in_progress (Lisp_Object in_progress);
250 extern void w32_query_frame_background_color (struct frame *f,
251 Emacs_Color *bgcolor);
252
253 extern void w32_make_frame_visible (struct frame *f);
254 extern void w32_make_frame_invisible (struct frame *f);
255 extern void w32_iconify_frame (struct frame *f);
256 extern void w32_free_frame_resources (struct frame *);
257 extern void w32_wm_set_size_hint (struct frame *, long, bool);
258
259
260 extern int w32_kbd_patch_key (KEY_EVENT_RECORD *event, int cpId);
261 extern int w32_kbd_mods_to_emacs (DWORD mods, WORD key);
262
263
264 extern void w32con_hide_cursor (void);
265 extern void w32con_show_cursor (void);
266
267
268 extern const char *w32_get_string_resource (void *v_rdb,
269 const char *name,
270 const char *class);
271
272
273 extern void w32_default_font_parameter (struct frame* f, Lisp_Object parms);
274
275
276 #define PIX_TYPE COLORREF
277
278
279
280
281
282
283
284
285 struct x_output
286 {
287
288
289
290 int focus_state;
291 };
292
293 enum
294 {
295
296
297
298
299
300 FOCUS_NONE = 0,
301 FOCUS_IMPLICIT = 1,
302 FOCUS_EXPLICIT = 2
303 };
304
305 struct w32_output
306 {
307
308 struct x_output x_compatible;
309
310
311 HMENU menubar_widget;
312
313
314 HPALETTE old_palette;
315
316
317 Emacs_GC *cursor_gc;
318
319
320
321
322 Window window_desc;
323
324
325
326
327
328 Window parent_desc;
329
330
331 struct font *font;
332
333
334 int baseline_offset;
335
336
337
338 int fontset;
339
340
341
342 COLORREF cursor_pixel;
343 COLORREF border_pixel;
344 COLORREF mouse_pixel;
345 COLORREF cursor_foreground_pixel;
346
347
348
349 COLORREF scroll_bar_foreground_pixel;
350
351
352
353
354 COLORREF scroll_bar_background_pixel;
355
356
357 HCURSOR text_cursor;
358 HCURSOR nontext_cursor;
359 HCURSOR modeline_cursor;
360 HCURSOR hand_cursor;
361 HCURSOR hourglass_cursor;
362 HCURSOR horizontal_drag_cursor;
363 HCURSOR vertical_drag_cursor;
364 HCURSOR left_edge_cursor;
365 HCURSOR top_left_corner_cursor;
366 HCURSOR top_edge_cursor;
367 HCURSOR top_right_corner_cursor;
368 HCURSOR right_edge_cursor;
369 HCURSOR bottom_right_corner_cursor;
370 HCURSOR bottom_edge_cursor;
371 HCURSOR bottom_left_corner_cursor;
372
373
374 unsigned hourglass_p : 1;
375
376
377 HCURSOR current_cursor;
378
379
380
381
382
383 DWORD dwStyle;
384
385
386
387
388
389
390 unsigned explicit_parent : 1;
391
392
393 unsigned asked_for_visible : 1;
394
395
396 unsigned menubar_active : 1;
397
398
399 struct relief
400 {
401 Emacs_GC *gc;
402 unsigned long pixel;
403 }
404 black_relief, white_relief;
405
406
407
408 unsigned long relief_background;
409
410
411
412
413 WINDOWPLACEMENT normal_placement;
414 int prev_fsmode;
415
416
417
418 HBITMAP paint_buffer;
419
420
421
422 HDC paint_dc, paint_buffer_handle;
423
424
425 HGDIOBJ paint_dc_object;
426
427
428 int paint_buffer_width, paint_buffer_height;
429
430
431
432 unsigned paint_buffer_dirty : 1;
433
434
435 unsigned want_paint_buffer : 1;
436 };
437
438 extern struct w32_output w32term_display;
439
440
441 #define FRAME_OUTPUT_DATA(f) ((f)->output_data.w32)
442
443
444 #define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
445 #define FRAME_NATIVE_WINDOW(f) FRAME_W32_WINDOW (f)
446
447 #define FRAME_FONT(f) ((f)->output_data.w32->font)
448 #define FRAME_FONTSET(f) ((f)->output_data.w32->fontset)
449 #define FRAME_BASELINE_OFFSET(f) ((f)->output_data.w32->baseline_offset)
450
451
452 #define FRAME_DISPLAY_INFO(f) ((void) (f), (&one_w32_display_info))
453
454 #define FRAME_NORMAL_PLACEMENT(F) ((F)->output_data.w32->normal_placement)
455 #define FRAME_PREV_FSMODE(F) ((F)->output_data.w32->prev_fsmode)
456
457
458
459
460
461
462
463
464
465
466
467
468 struct scroll_bar {
469
470
471 union vectorlike_header header;
472
473
474 Lisp_Object window;
475
476
477 Lisp_Object next, prev;
478
479
480
481 Lisp_Object w32_window_low, w32_window_high;
482
483
484 Lisp_Object w32_widget_low, w32_widget_high;
485
486
487
488 int top, left, width, height;
489
490
491
492
493
494
495
496
497
498
499
500
501 int start, end;
502
503
504
505
506
507 int dragging;
508
509
510 bool horizontal;
511 };
512
513
514 #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec))
515
516 #ifdef _WIN64
517
518 #define SCROLL_BAR_PACK(low, high) (XFIXNUM (high) << 32 | XFIXNUM (low))
519
520
521 #define SCROLL_BAR_UNPACK(low, high, int64) \
522 (XSETINT ((low), ((DWORDLONG)(int64)) & 0xffffffff), \
523 XSETINT ((high), ((DWORDLONG)(int64) >> 32) & 0xffffffff))
524 #else
525
526 #define SCROLL_BAR_PACK(low, high) ((UINT_PTR)(XFIXNUM (high) << 16 | XFIXNUM (low)))
527
528
529 #define SCROLL_BAR_UNPACK(low, high, int32) \
530 (XSETINT ((low), (int32) & 0xffff), \
531 XSETINT ((high), ((int32) >> 16) & 0xffff))
532 #endif
533
534
535 #define SCROLL_BAR_W32_WINDOW(ptr) \
536 ((Window) SCROLL_BAR_PACK ((ptr)->w32_window_low, (ptr)->w32_window_high))
537
538
539 #define SET_SCROLL_BAR_W32_WINDOW(ptr, id) \
540 (SCROLL_BAR_UNPACK ((ptr)->w32_window_low, (ptr)->w32_window_high, (intptr_t) id))
541
542
543
544 #define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(f,width) \
545 ((width) \
546 - VERTICAL_SCROLL_BAR_LEFT_BORDER \
547 - VERTICAL_SCROLL_BAR_RIGHT_BORDER)
548
549
550
551
552
553
554
555
556 #define VERTICAL_SCROLL_BAR_TOP_RANGE(f,height) \
557 (VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, height) - VERTICAL_SCROLL_BAR_MIN_HANDLE)
558
559
560
561 #define VERTICAL_SCROLL_BAR_INSIDE_HEIGHT(f,height) \
562 ((height) - VERTICAL_SCROLL_BAR_TOP_BORDER - VERTICAL_SCROLL_BAR_BOTTOM_BORDER)
563
564
565
566 #define HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT(f,height) \
567 ((height) \
568 - HORIZONTAL_SCROLL_BAR_TOP_BORDER \
569 - HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
570
571
572
573
574
575
576
577
578 #define HORIZONTAL_SCROLL_BAR_LEFT_RANGE(f,width) \
579 (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH (f, width) - HORIZONTAL_SCROLL_BAR_MIN_HANDLE)
580
581
582
583 #define HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH(f,width) \
584 ((width) - HORIZONTAL_SCROLL_BAR_LEFT_BORDER - HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
585
586
587
588
589
590
591
592
593
594
595
596
597
598 #define VERTICAL_SCROLL_BAR_LEFT_BORDER (0)
599 #define VERTICAL_SCROLL_BAR_RIGHT_BORDER (0)
600 #define VERTICAL_SCROLL_BAR_TOP_BORDER (vertical_scroll_bar_top_border)
601 #define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (vertical_scroll_bar_bottom_border)
602
603 #define HORIZONTAL_SCROLL_BAR_LEFT_BORDER (horizontal_scroll_bar_left_border)
604 #define HORIZONTAL_SCROLL_BAR_RIGHT_BORDER (horizontal_scroll_bar_right_border)
605 #define HORIZONTAL_SCROLL_BAR_TOP_BORDER (0)
606 #define HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER (0)
607
608
609 #define VERTICAL_SCROLL_BAR_MIN_HANDLE (vertical_scroll_bar_min_handle)
610 #define HORIZONTAL_SCROLL_BAR_MIN_HANDLE (horizontal_scroll_bar_min_handle)
611
612 struct frame;
613
614 extern void w32_fill_rect (struct frame *, HDC, COLORREF, RECT *);
615 extern void w32_clear_window (struct frame *);
616
617 #define w32_fill_area(f,hdc,pix,x,y,nx,ny) \
618 do { \
619 RECT rect; \
620 rect.left = x; \
621 rect.top = y; \
622 rect.right = x + nx; \
623 rect.bottom = y + ny; \
624 w32_fill_rect (f,hdc,pix,&rect); \
625 } while (0)
626
627 #define w32_fill_area_abs(f,hdc,pix,x0,y0,x1,y1) \
628 do { \
629 RECT rect; \
630 rect.left = x0; \
631 rect.top = y0; \
632 rect.right = x1; \
633 rect.bottom = y1; \
634 w32_fill_rect (f,hdc,pix,&rect); \
635 } while (0)
636
637 #define w32_clear_rect(f,hdc,lprect) \
638 w32_fill_rect (f, hdc, FRAME_BACKGROUND_PIXEL (f), lprect)
639
640 #define w32_clear_area(f,hdc,px,py,nx,ny) \
641 w32_fill_area (f, hdc, FRAME_BACKGROUND_PIXEL (f), px, py, nx, ny)
642
643
644 #ifndef WM_MOUSEWHEEL
645 #define WM_MOUSEWHEEL (WM_MOUSELAST + 1)
646 #endif
647 #ifndef MSH_MOUSEWHEEL
648 #define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
649 #endif
650 #ifndef WM_XBUTTONDOWN
651 #define WM_XBUTTONDOWN (WM_MOUSEWHEEL + 1)
652 #define WM_XBUTTONUP (WM_MOUSEWHEEL + 2)
653 #endif
654 #ifndef WM_MOUSEHWHEEL
655 #define WM_MOUSEHWHEEL (WM_MOUSEWHEEL + 4)
656 #endif
657 #ifndef WM_APPCOMMAND
658 #define WM_APPCOMMAND 0x319
659 #define GET_APPCOMMAND_LPARAM(lParam) (HIWORD(lParam) & 0x7fff)
660 #endif
661 #ifndef WM_UNICHAR
662 #define WM_UNICHAR 0x109
663 #endif
664 #ifndef UNICODE_NOCHAR
665 #define UNICODE_NOCHAR 0xFFFF
666 #endif
667
668 #define WM_EMACS_START (WM_USER + 1)
669 #define WM_EMACS_KILL (WM_EMACS_START + 0)
670 #define WM_EMACS_CREATEWINDOW (WM_EMACS_START + 1)
671 #define WM_EMACS_DONE (WM_EMACS_START + 2)
672 #define WM_EMACS_CREATEVSCROLLBAR (WM_EMACS_START + 3)
673 #define WM_EMACS_CREATEHSCROLLBAR (WM_EMACS_START + 4)
674 #define WM_EMACS_SHOWWINDOW (WM_EMACS_START + 5)
675 #define WM_EMACS_SETWINDOWPOS (WM_EMACS_START + 6)
676 #define WM_EMACS_DESTROYWINDOW (WM_EMACS_START + 7)
677 #define WM_EMACS_TRACKPOPUPMENU (WM_EMACS_START + 8)
678 #define WM_EMACS_SETFOCUS (WM_EMACS_START + 9)
679 #define WM_EMACS_SETFOREGROUND (WM_EMACS_START + 10)
680 #define WM_EMACS_SETLOCALE (WM_EMACS_START + 11)
681 #define WM_EMACS_SETKEYBOARDLAYOUT (WM_EMACS_START + 12)
682 #define WM_EMACS_REGISTER_HOT_KEY (WM_EMACS_START + 13)
683 #define WM_EMACS_UNREGISTER_HOT_KEY (WM_EMACS_START + 14)
684 #define WM_EMACS_TOGGLE_LOCK_KEY (WM_EMACS_START + 15)
685 #define WM_EMACS_TRACK_CARET (WM_EMACS_START + 16)
686 #define WM_EMACS_DESTROY_CARET (WM_EMACS_START + 17)
687 #define WM_EMACS_SHOW_CARET (WM_EMACS_START + 18)
688 #define WM_EMACS_HIDE_CARET (WM_EMACS_START + 19)
689 #define WM_EMACS_SETCURSOR (WM_EMACS_START + 20)
690 #define WM_EMACS_SHOWCURSOR (WM_EMACS_START + 21)
691 #define WM_EMACS_PAINT (WM_EMACS_START + 22)
692 #define WM_EMACS_BRINGTOTOP (WM_EMACS_START + 23)
693 #define WM_EMACS_INPUT_READY (WM_EMACS_START + 24)
694 #define WM_EMACS_FILENOTIFY (WM_EMACS_START + 25)
695 #define WM_EMACS_IME_STATUS (WM_EMACS_START + 26)
696 #define WM_EMACS_END (WM_EMACS_START + 27)
697
698 #define WND_FONTWIDTH_INDEX (0)
699 #define WND_LINEHEIGHT_INDEX (4)
700 #define WND_BORDER_INDEX (8)
701 #define WND_VSCROLLBAR_INDEX (12)
702 #define WND_HSCROLLBAR_INDEX (16)
703 #define WND_BACKGROUND_INDEX (20)
704 #define WND_LAST_INDEX (24)
705
706 #define WND_EXTRA_BYTES (WND_LAST_INDEX)
707
708 extern DWORD dwWindowsThreadId;
709 extern HANDLE hWindowsThread;
710 extern DWORD dwMainThreadId;
711 extern HANDLE hMainThread;
712
713 typedef struct W32Msg {
714 MSG msg;
715 DWORD dwModifiers;
716 RECT rect;
717 } W32Msg;
718
719 extern BOOL prepend_msg (W32Msg *lpmsg);
720
721
722
723
724 typedef struct deferred_msg
725 {
726 struct deferred_msg * next;
727 W32Msg w32msg;
728 LRESULT result;
729 int completed;
730 } deferred_msg;
731
732 extern CRITICAL_SECTION critsect;
733
734 extern void init_crit (void);
735 extern void delete_crit (void);
736
737 extern void signal_quit (void);
738
739 #define enter_crit() EnterCriticalSection (&critsect)
740 #define leave_crit() LeaveCriticalSection (&critsect)
741
742 extern void select_palette (struct frame * f, HDC hdc);
743 extern void deselect_palette (struct frame * f, HDC hdc);
744 extern HDC get_frame_dc (struct frame * f);
745 extern int release_frame_dc (struct frame * f, HDC hDC);
746
747 extern int drain_message_queue (void);
748
749 extern BOOL get_next_msg (W32Msg *, BOOL);
750 extern BOOL post_msg (W32Msg *);
751 extern void complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result);
752
753 extern BOOL parse_button (int, int, int *, int *);
754
755 extern void w32_sys_ring_bell (struct frame *f);
756 extern void w32_query_color (struct frame *, Emacs_Color *);
757 extern void w32_delete_display (struct w32_display_info *dpyinfo);
758
759 #define FILE_NOTIFICATIONS_SIZE 16384
760
761
762
763 struct notifications_set {
764 LPBYTE notifications;
765 DWORD size;
766 void *desc;
767 struct notifications_set *next;
768 struct notifications_set *prev;
769 };
770 extern struct notifications_set *notifications_set_head;
771 extern Lisp_Object w32_get_watch_object (void *);
772 extern Lisp_Object w32_lispy_file_action (DWORD);
773 extern int handle_file_notifications (struct input_event *);
774
775 extern void w32_initialize_display_info (Lisp_Object);
776 extern void initialize_w32_display (struct terminal *, int *, int *);
777
778 extern bool w32_image_rotations_p (void);
779
780 #ifdef WINDOWSNT
781
782 extern void setup_w32_kbdhook (void);
783 extern void remove_w32_kbdhook (void);
784 extern int check_w32_winkey_state (int);
785 #define w32_kbdhook_active (os_subtype != OS_SUBTYPE_9X)
786 #else
787 #define w32_kbdhook_active 0
788 #endif
789
790
791
792
793 #define VK_NUMPAD_BEGIN 0x92
794 #define VK_NUMPAD_CLEAR (VK_NUMPAD_BEGIN + 0)
795 #define VK_NUMPAD_ENTER (VK_NUMPAD_BEGIN + 1)
796 #define VK_NUMPAD_PRIOR (VK_NUMPAD_BEGIN + 2)
797 #define VK_NUMPAD_NEXT (VK_NUMPAD_BEGIN + 3)
798 #define VK_NUMPAD_END (VK_NUMPAD_BEGIN + 4)
799 #define VK_NUMPAD_HOME (VK_NUMPAD_BEGIN + 5)
800 #define VK_NUMPAD_LEFT (VK_NUMPAD_BEGIN + 6)
801 #define VK_NUMPAD_UP (VK_NUMPAD_BEGIN + 7)
802 #define VK_NUMPAD_RIGHT (VK_NUMPAD_BEGIN + 8)
803 #define VK_NUMPAD_DOWN (VK_NUMPAD_BEGIN + 9)
804 #define VK_NUMPAD_INSERT (VK_NUMPAD_BEGIN + 10)
805 #define VK_NUMPAD_DELETE (VK_NUMPAD_BEGIN + 11)
806
807 #ifndef VK_LWIN
808
809 #define VK_LWIN 0x5B
810 #define VK_RWIN 0x5C
811 #define VK_APPS 0x5D
812 #endif
813
814
815
816
817 #define LEFT_WIN_PRESSED 0x8000
818 #define RIGHT_WIN_PRESSED 0x4000
819 #define APPS_PRESSED 0x2000
820
821
822 extern int w32_keyboard_codepage;
823
824
825
826 #ifndef WM_MOUSELEAVE
827 #define WM_MOUSELEAVE 0x02A3
828 #define TME_LEAVE 0x00000002;
829
830 typedef struct tagTRACKMOUSEEVENT
831 {
832 DWORD cbSize;
833 DWORD dwFlags;
834 HWND hwndTrack;
835 DWORD dwHoverTime;
836 } TRACKMOUSEEVENT;
837 #endif
838
839 struct image;
840 struct face;
841
842 Emacs_GC *XCreateGC (void *, HWND, unsigned long, Emacs_GC *);
843
844 typedef DWORD (WINAPI * ClipboardSequence_Proc) (void);
845 typedef BOOL (WINAPI * AppendMenuW_Proc) (
846 IN HMENU,
847 IN UINT,
848 IN UINT_PTR,
849 IN LPCWSTR);
850
851 extern HWND w32_system_caret_hwnd;
852 extern int w32_system_caret_height;
853 extern int w32_system_caret_x;
854 extern int w32_system_caret_y;
855 extern struct window *w32_system_caret_window;
856 extern int w32_system_caret_hdr_height;
857 extern int w32_system_caret_mode_height;
858
859 extern Window tip_window;
860
861 #ifdef _MSC_VER
862 #ifndef EnumSystemLocales
863
864 typedef BOOL (CALLBACK *LOCALE_ENUMPROCA)(LPSTR);
865 typedef BOOL (CALLBACK *LOCALE_ENUMPROCW)(LPWSTR);
866 BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD);
867 BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD);
868 #ifdef UNICODE
869 #define EnumSystemLocales EnumSystemLocalesW
870 #else
871 #define EnumSystemLocales EnumSystemLocalesA
872 #endif
873 #endif
874 #endif
875
876 #if EMACSDEBUG
877 extern const char*
878 w32_name_of_message (UINT msg);
879 #endif
880
881 #ifdef NTGUI_UNICODE
882 extern Lisp_Object ntgui_encode_system (Lisp_Object str);
883 #define GUISTR(x) (L ## x)
884 #define GUI_ENCODE_FILE GUI_ENCODE_SYSTEM
885 #define GUI_ENCODE_SYSTEM(x) ntgui_encode_system (x)
886 #define GUI_FN(fn) fn ## W
887 typedef wchar_t guichar_t;
888 #else
889 #define GUISTR(x) x
890 #define GUI_ENCODE_FILE ENCODE_FILE
891 #define GUI_ENCODE_SYSTEM ENCODE_SYSTEM
892 #define GUI_FN(fn) fn
893 typedef char guichar_t;
894 #endif
895
896 #define GUI_SDATA(x) ((guichar_t*) SDATA (x))
897
898 extern Lisp_Object w32_popup_dialog (struct frame *, Lisp_Object, Lisp_Object);
899 extern void w32_arrow_cursor (void);
900 extern void w32_release_paint_buffer (struct frame *);
901 extern void w32_flip_buffers_if_dirty (struct frame *);
902
903 extern void syms_of_w32term (void);
904 extern void syms_of_w32menu (void);
905 extern void syms_of_w32fns (void);
906
907 extern void globals_of_w32menu (void);
908 extern void globals_of_w32fns (void);
909 extern void globals_of_w32notify (void);
910
911 extern void w32_init_main_thread (void);
912
913 #ifdef CYGWIN
914 extern int w32_message_fd;
915 #endif