changeset 15152:2dd4961cefaa

(struct win32_palette_entry): New structure. (win32_display_info): New fields has_palette, p_colors_in_use, n_colors_in_use, h_palette. (win32_output): New field h_old_palette. (WM_EMACS_SETWINDOWPOS): New macro. (WM_EMACS_DESTROY_WINDOW): Value redefined.
author Geoff Voelker <voelker@cs.washington.edu>
date Fri, 03 May 1996 18:48:05 +0000
parents ed6ddfc0d954
children c1494aa589e8
files src/w32term.h
diffstat 1 files changed, 51 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.h	Fri May 03 18:45:32 1996 +0000
+++ b/src/w32term.h	Fri May 03 18:48:05 1996 +0000
@@ -75,6 +75,23 @@
   /* Record some info about this pixmap.  */
   int height, width, depth;
 };
+
+/* Palette book-keeping stuff for mapping requested colors into the
+   system palette.  Keep a ref-counted list of requested colors and
+   regenerate the app palette whenever the requested list changes. */
+
+extern Lisp_Object Vwin32_enable_palette;
+
+struct win32_palette_entry {
+  struct win32_palette_entry * next;
+  PALETTEENTRY entry;
+#if 0
+  unsigned refcount;
+#endif
+};
+
+extern void win32_regenerate_palette(struct frame *f);
+
 
 /* For each display (currently only one on win32), we have a structure that
    records information about it.  */
@@ -102,6 +119,15 @@
   /* The cursor to use for vertical scroll bars.  */
   Cursor vertical_scroll_bar_cursor;
 
+  /* color palette information */
+  int has_palette;
+  struct win32_palette_entry * color_list;
+  unsigned num_colors;
+  HPALETTE palette;
+
+  /* deferred action flags checked when starting frame update */
+  int regen_palette;
+
   /* A table of all the fonts we have already loaded.  */
   struct font_info *font_table;
 
@@ -187,6 +213,9 @@
 
 struct win32_output
 {
+  /* Original palette (used to deselect real palette after drawing) */
+  HPALETTE old_palette;
+
   /* Position of the Win32 window (x and y offsets in root window).  */
   int left_pos;
   int top_pos;
@@ -548,18 +577,25 @@
 extern XFontStruct *win32_load_font ();
 extern void win32_unload_font ();
 
-extern HDC map_mode();
-
-#define my_get_dc(hwnd) (map_mode (GetDC (hwnd)))
-
 #define WM_EMACS_START                 (WM_USER + 1)
 #define WM_EMACS_KILL                  (WM_EMACS_START + 0x00)
 #define WM_EMACS_CREATEWINDOW          (WM_EMACS_START + 0x01)
 #define WM_EMACS_DONE                  (WM_EMACS_START + 0x02)
 #define WM_EMACS_CREATESCROLLBAR       (WM_EMACS_START + 0x03)
-#define WM_EMACS_DESTROYWINDOW         (WM_EMACS_START + 0x04)
+#define WM_EMACS_SHOWWINDOW            (WM_EMACS_START + 0x04)
+#define WM_EMACS_SETWINDOWPOS          (WM_EMACS_START + 0x05)
+#define WM_EMACS_DESTROYWINDOW         (WM_EMACS_START + 0x06)
 #define WM_EMACS_END                   (WM_EMACS_START + 0x10)
 
+typedef struct {
+  HWND hwndAfter;
+  int x;
+  int y;
+  int cx;
+  int cy;
+  int flags;
+} Win32WindowPos;
+
 #define WND_X_UNITS_INDEX      (0) 
 #define WND_Y_UNITS_INDEX      (4) 
 #define WND_BACKGROUND_INDEX   (8) 
@@ -578,11 +614,19 @@
     RECT rect;
 } Win32Msg;
 
+extern CRITICAL_SECTION critsect;
+
 extern void init_crit ();
-extern void enter_crit ();
-extern void leave_crit ();
 extern void delete_crit ();
 
+#define enter_crit() EnterCriticalSection (&critsect)
+#define leave_crit() LeaveCriticalSection (&critsect)
+
+extern void select_palette (struct frame * f, HDC hdc);
+extern void deselect_palette (struct frame * f, HDC hdc);
+extern HDC get_frame_dc (struct frame * f);
+extern int release_frame_dc (struct frame * f, HDC hDC);
+
 extern BOOL get_next_msg ();
 extern BOOL post_msg ();
 extern void wait_for_sync ();