comparison src/w32term.h @ 14240:629d8f6813a3

(win32_palette_entry): New structure. (has_palette, p_colors_in_use, n_colors_in_use, h_palette, regen_palette): Declare variables. (struct win32_output): New field. (my_get_dc): Macro removed. (GetFrameDC, ReleaseFrameDC): Declare functions.
author Geoff Voelker <voelker@cs.washington.edu>
date Sun, 21 Jan 1996 00:21:35 +0000
parents ee40177f6c68
children d0d8d9d73f7f
comparison
equal deleted inserted replaced
14239:78ef3e237424 14240:629d8f6813a3
73 HINSTANCE hinst; /* Used to load the file */ 73 HINSTANCE hinst; /* Used to load the file */
74 int refcount; 74 int refcount;
75 /* Record some info about this pixmap. */ 75 /* Record some info about this pixmap. */
76 int height, width, depth; 76 int height, width, depth;
77 }; 77 };
78
79 /* Palette book-keeping stuff for mapping requested colors into the
80 system palette. Keep a ref-counted list of requested colors and
81 regenerate the app palette whenever the requested list changes. */
82
83 extern Lisp_Object Vwin32_enable_palette;
84
85 struct win32_palette_entry {
86 struct win32_palette_entry * next;
87 PALETTEENTRY entry;
88 #if 0
89 unsigned refcount;
90 #endif
91 };
92
93 extern void win32_regenerate_palette(struct frame *f);
94
78 95
79 /* For each display (currently only one on win32), we have a structure that 96 /* For each display (currently only one on win32), we have a structure that
80 records information about it. */ 97 records information about it. */
81 98
82 struct win32_display_info 99 struct win32_display_info
100 /* The root window of this screen. */ 117 /* The root window of this screen. */
101 Window root_window; 118 Window root_window;
102 /* The cursor to use for vertical scroll bars. */ 119 /* The cursor to use for vertical scroll bars. */
103 Cursor vertical_scroll_bar_cursor; 120 Cursor vertical_scroll_bar_cursor;
104 121
122 /* color palette information */
123 int has_palette;
124 struct win32_palette_entry * p_colors_in_use;
125 unsigned n_colors_in_use;
126 HPALETTE h_palette;
127
128 /* deferred action flags checked when starting frame update */
129 int regen_palette;
130
105 /* A table of all the fonts we have already loaded. */ 131 /* A table of all the fonts we have already loaded. */
106 struct font_info *font_table; 132 struct font_info *font_table;
107 133
108 /* The current capacity of x_font_table. */ 134 /* The current capacity of x_font_table. */
109 int font_table_size; 135 int font_table_size;
185 in the output_data.win32 field. The win32_display structure contains all 211 in the output_data.win32 field. The win32_display structure contains all
186 the information that is specific to Win32 windows. */ 212 the information that is specific to Win32 windows. */
187 213
188 struct win32_output 214 struct win32_output
189 { 215 {
216 /* Original palette (used to deselect real palette after drawing) */
217 HPALETTE h_old_palette;
218
190 /* Position of the Win32 window (x and y offsets in root window). */ 219 /* Position of the Win32 window (x and y offsets in root window). */
191 int left_pos; 220 int left_pos;
192 int top_pos; 221 int top_pos;
193 222
194 /* Border width of the Win32 window as known by the window system. */ 223 /* Border width of the Win32 window as known by the window system. */
546 win32_fill_area (f,hdc,f->output_data.win32->background_pixel,x,y,nx,ny) 575 win32_fill_area (f,hdc,f->output_data.win32->background_pixel,x,y,nx,ny)
547 576
548 extern XFontStruct *win32_load_font (); 577 extern XFontStruct *win32_load_font ();
549 extern void win32_unload_font (); 578 extern void win32_unload_font ();
550 579
551 extern HDC map_mode();
552
553 #define my_get_dc(hwnd) (map_mode (GetDC (hwnd)))
554
555 #define WM_EMACS_START (WM_USER + 1) 580 #define WM_EMACS_START (WM_USER + 1)
556 #define WM_EMACS_KILL (WM_EMACS_START + 0x00) 581 #define WM_EMACS_KILL (WM_EMACS_START + 0x00)
557 #define WM_EMACS_CREATEWINDOW (WM_EMACS_START + 0x01) 582 #define WM_EMACS_CREATEWINDOW (WM_EMACS_START + 0x01)
558 #define WM_EMACS_DONE (WM_EMACS_START + 0x02) 583 #define WM_EMACS_DONE (WM_EMACS_START + 0x02)
559 #define WM_EMACS_CREATESCROLLBAR (WM_EMACS_START + 0x03) 584 #define WM_EMACS_CREATESCROLLBAR (WM_EMACS_START + 0x03)
576 MSG msg; 601 MSG msg;
577 DWORD dwModifiers; 602 DWORD dwModifiers;
578 RECT rect; 603 RECT rect;
579 } Win32Msg; 604 } Win32Msg;
580 605
606 /* Identifiers for array of critical sections; we need one for
607 serializing access to hand-crafter message queue, and another
608 for preventing palette changes during GDI calls. */
609 enum win32_critical_section {
610 CRIT_MSG, /* message queue */
611 CRIT_GDI, /* GDI calls */
612 CRIT_TOTAL /* num of critical sections */
613 };
614
615 extern CRITICAL_SECTION critsect[CRIT_TOTAL];
616
581 extern void init_crit (); 617 extern void init_crit ();
582 extern void enter_crit ();
583 extern void leave_crit ();
584 extern void delete_crit (); 618 extern void delete_crit ();
619
620 #define enter_crit(index) EnterCriticalSection (&critsect[index])
621 #define leave_crit(index) LeaveCriticalSection (&critsect[index])
622
623 extern HDC GetFrameDC (struct frame * f);
624 extern int ReleaseFrameDC (struct frame * f, HDC hDC);
585 625
586 extern BOOL get_next_msg (); 626 extern BOOL get_next_msg ();
587 extern BOOL post_msg (); 627 extern BOOL post_msg ();
588 extern void wait_for_sync (); 628 extern void wait_for_sync ();
589 629