]> code.delx.au - gnu-emacs/blobdiff - src/w32term.h
Convert consecutive FSF copyright years to ranges.
[gnu-emacs] / src / w32term.h
index 5af3eac8ade000001303ade8cb113f9ecd7fe572..c79352a8db80376844f41a7b6c025e3481641894 100644 (file)
@@ -1,13 +1,12 @@
 /* Definitions and headers for communication on the Microsoft W32 API.
-   Copyright (C) 1995, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2011 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,9 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Added by Kevin Gallo */
 
@@ -27,22 +24,12 @@ Boston, MA 02110-1301, USA.  */
 #define BLACK_PIX_DEFAULT(f) PALETTERGB(0,0,0)
 #define WHITE_PIX_DEFAULT(f) PALETTERGB(255,255,255)
 
-#define FONT_WIDTH(f)       \
-  ((f)->bdf ? (f)->bdf->width : (f)->tm.tmMaxCharWidth)
-#define FONT_HEIGHT(f)      \
-   ((f)->bdf ? (f)->bdf->height : (f)->tm.tmHeight)
-#define FONT_BASE(f)        \
-  ((f)->bdf ? (f)->bdf->ury : (f)->tm.tmAscent)
-#define FONT_DESCENT(f)     \
-  ((f)->bdf ? -((f)->bdf->lly) : (f)->tm.tmDescent)
-#define FONT_AVG_WIDTH(f)   \
-  ((f)->bdf ? (f)->bdf->width : (f)->tm.tmAveCharWidth)
+#define FONT_WIDTH(f)     ((f)->max_width)
+#define FONT_HEIGHT(f)    ((f)->height)
+#define FONT_BASE(f)      ((f)->ascent)
+#define FONT_DESCENT(f)   ((f)->descent)
 
 #define CP_DEFAULT 1004
-/* Special pseudo-codepages. */
-#define CP_8BIT      -1
-#define CP_UNICODE   -2
-#define CP_UNKNOWN   -3
 
 #define CHECK_W32_FRAME(f, frame)              \
   if (NILP (frame))                            \
@@ -60,8 +47,6 @@ Boston, MA 02110-1301, USA.  */
 extern MSG CurMsg;
 extern BOOL bUseDflt;
 
-extern struct frame *x_window_to_frame ();
-
 /* Structure recording bitmaps and reference count.
    If REFCOUNT is 0 then this record is free to be reused.  */
 
@@ -75,12 +60,6 @@ struct w32_bitmap_record
   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 Vw32_enable_palette;
-
 struct w32_palette_entry {
   struct w32_palette_entry * next;
   PALETTEENTRY entry;
@@ -119,10 +98,6 @@ struct w32_display_info
   /* Number of bits per pixel on this screen.  */
   int n_cbits;
 
-  /* Dimensions of this screen.  */
-  int height, width;
-  int height_in,width_in;
-
   /* Mask of things that cause the mouse to be grabbed.  */
   int grabbed;
 
@@ -152,12 +127,6 @@ struct w32_display_info
      received; value is reset after key is received.  */
   int faked_key;
 
-  /* A table of all the fonts we have already loaded.  */
-  struct font_info *font_table;
-
-  /* The current capacity of font_table.  */
-  int font_table_size;
-
   /* Minimum width over all characters in all fonts in font_table.  */
   int smallest_char_width;
 
@@ -167,36 +136,9 @@ struct w32_display_info
   /* Reusable Graphics Context for drawing a cursor in a non-default face. */
   XGCValues *scratch_cursor_gc;
 
-  /* These variables describe the range of text currently shown in its
-     mouse-face, together with the window they apply to. As long as
-     the mouse stays within this range, we need not redraw anything on
-     its account.  Rows and columns are glyph matrix positions in
-     MOUSE_FACE_WINDOW.  */
-  int mouse_face_beg_row, mouse_face_beg_col;
-  int mouse_face_beg_x, mouse_face_beg_y;
-  int mouse_face_end_row, mouse_face_end_col;
-  int mouse_face_end_x, mouse_face_end_y;
-  int mouse_face_past_end;
-  Lisp_Object mouse_face_window;
-  int mouse_face_face_id;
-  Lisp_Object mouse_face_overlay;
-
-  /* 1 if a mouse motion event came and we didn't handle it right away because
-     gc was in progress.  */
-  int mouse_face_deferred_gc;
-
-  /* FRAME and X, Y position of mouse when last checked for
-     highlighting.  X and Y can be negative or out of range for the frame.  */
-  struct frame *mouse_face_mouse_frame;
-  int mouse_face_mouse_x, mouse_face_mouse_y;
-
-  /* Nonzero means defer mouse-motion highlighting.  */
-  int mouse_face_defer;
-
-  /* Nonzero means that the mouse highlight should not be shown.  */
-  int mouse_face_hidden;
-
-  int mouse_face_image_state;
+  /* Information about the range of text currently shown in
+     mouse-face.  */
+  Mouse_HLInfo mouse_highlight;
 
   char *w32_id_name;
 
@@ -245,23 +187,20 @@ extern struct w32_display_info one_w32_display_info;
    FONT-LIST-CACHE records previous values returned by x-list-fonts.  */
 extern Lisp_Object w32_display_name_list;
 
-/* Regexp matching a font name whose width is the same as `PIXEL_SIZE'.  */
-extern Lisp_Object Vx_pixel_size_width_font_regexp;
+extern struct frame *x_window_to_frame (struct w32_display_info *, HWND);
 
-struct w32_display_info *x_display_info_for_name ();
+struct w32_display_info *x_display_info_for_name (Lisp_Object);
 
-Lisp_Object display_x_get_resource P_ ((struct w32_display_info *,
-                                       Lisp_Object, Lisp_Object,
-                                       Lisp_Object, Lisp_Object));
+Lisp_Object display_x_get_resource (struct w32_display_info *,
+                                    Lisp_Object, Lisp_Object,
+                                    Lisp_Object, Lisp_Object);
+
+extern struct w32_display_info *w32_term_init (Lisp_Object,
+                                              char *, char *);
+
+extern int x_display_pixel_height (struct w32_display_info *);
+extern int x_display_pixel_width (struct w32_display_info *);
 
-extern struct w32_display_info *w32_term_init ();
-\f
-extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
-extern struct font_info *w32_get_font_info (), *w32_query_font ();
-extern void w32_cache_char_metrics (XFontStruct *font);
-extern void w32_find_ccl_program();
-extern Lisp_Object x_get_font_repertory P_ ((struct frame *,
-                                            struct font_info *));
 \f
 #define PIX_TYPE COLORREF
 
@@ -324,11 +263,7 @@ struct w32_output
   Window parent_desc;
 
   /* Default ASCII font of this frame. */
-  XFontStruct *font;
-
-#ifdef USE_FONT_BACKEND
-  struct font *fontp;
-#endif /* USE_FONT_BACKEND */
+  struct font *font;
 
   /* The baseline offset of the default ASCII font.  */
   int baseline_offset;
@@ -416,10 +351,6 @@ extern struct w32_output w32term_display;
 #define FRAME_FONTSET(f) ((f)->output_data.w32->fontset)
 #define FRAME_BASELINE_OFFSET(f) ((f)->output_data.w32->baseline_offset)
 
-#ifdef USE_FONT_BACKEND
-#define FRAME_FONT_OBJECT(f) ((f)->output_data.w32->fontp)
-#endif /* USE_FONT_BACKEND */
-
 /* This gives the w32_display_info structure for the display F is on.  */
 #define FRAME_W32_DISPLAY_INFO(f) (&one_w32_display_info)
 #define FRAME_X_DISPLAY_INFO(f) (&one_w32_display_info)
@@ -427,9 +358,6 @@ extern struct w32_output w32term_display;
 /* This is the `Display *' which frame F is on.  */
 #define FRAME_X_DISPLAY(f) (0)
 
-/* This is the 'font_info *' which frame F has.  */
-#define FRAME_W32_FONT_TABLE(f) (FRAME_W32_DISPLAY_INFO (f)->font_table)
-
 /* Value is the smallest width of any character in any font on frame F.  */
 
 #define FRAME_SMALLEST_CHAR_WIDTH(F) \
@@ -580,8 +508,10 @@ struct scroll_bar {
 #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
 
 \f
-extern void w32_fill_rect ();
-extern void w32_clear_window ();
+struct frame;  /* from frame.h */
+
+extern void w32_fill_rect (struct frame *, HDC, COLORREF, RECT *);
+extern void w32_clear_window (struct frame *);
 
 #define w32_fill_area(f,hdc,pix,x,y,nx,ny) \
 do { \
@@ -599,9 +529,6 @@ do { \
 #define w32_clear_area(f,hdc,px,py,nx,ny) \
   w32_fill_area (f, hdc, FRAME_BACKGROUND_PIXEL (f), px, py, nx, ny)
 
-extern struct font_info *w32_load_font ();
-extern void w32_unload_font ();
-
 /* Define for earlier versions of Visual C */
 #ifndef WM_MOUSEWHEEL
 #define WM_MOUSEWHEEL                 (WM_MOUSELAST + 1)
@@ -648,7 +575,8 @@ extern void w32_unload_font ();
 #define WM_EMACS_SHOW_CARET            (WM_EMACS_START + 17)
 #define WM_EMACS_HIDE_CARET            (WM_EMACS_START + 18)
 #define WM_EMACS_SETCURSOR             (WM_EMACS_START + 19)
-#define WM_EMACS_END                   (WM_EMACS_START + 20)
+#define WM_EMACS_PAINT                 (WM_EMACS_START + 20)
+#define WM_EMACS_END                   (WM_EMACS_START + 21)
 
 #define WND_FONTWIDTH_INDEX    (0)
 #define WND_LINEHEIGHT_INDEX   (4)
@@ -683,10 +611,10 @@ typedef struct deferred_msg
 
 extern CRITICAL_SECTION critsect;
 
-extern void init_crit ();
-extern void delete_crit ();
+extern void init_crit (void);
+extern void delete_crit (void);
 
-extern void signal_quit ();
+extern void signal_quit (void);
 
 #define enter_crit() EnterCriticalSection (&critsect)
 #define leave_crit() LeaveCriticalSection (&critsect)
@@ -696,14 +624,13 @@ 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 void drain_message_queue ();
+extern void drain_message_queue (void);
 
-extern BOOL get_next_msg ();
-extern BOOL post_msg ();
+extern BOOL get_next_msg (W32Msg *, BOOL);
+extern BOOL post_msg (W32Msg *);
 extern void complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result);
-extern void wait_for_sync ();
 
-extern BOOL parse_button ();
+extern BOOL parse_button (int, int, int *, int *);
 
 extern void w32_sys_ring_bell (struct frame *f);
 extern void x_delete_display (struct w32_display_info *dpyinfo);
@@ -763,21 +690,10 @@ struct frame * check_x_frame (Lisp_Object);
 EXFUN (Fx_display_color_p, 1);
 EXFUN (Fx_display_grayscale_p, 1);
 
-#define FONT_TYPE_FOR_UNIBYTE(font, ch)                        \
-  ((font)->bdf ? BDF_1D_FONT : ANSI_FONT)
-
-#define FONT_TYPE_FOR_MULTIBYTE(font, ch)              \
-  (!(font)->bdf                                                \
-   ? UNICODE_FONT                                      \
-   : ((CHARSET_DIMENSION (CHAR_CHARSET ((ch))) == 1)   \
-      ? BDF_1D_FONT : BDF_2D_FONT))
-
-typedef DWORD (WINAPI * ClipboardSequence_Proc) ();
+typedef DWORD (WINAPI * ClipboardSequence_Proc) (void);
 typedef BOOL (WINAPI * AppendMenuW_Proc) (
     IN HMENU,
     IN UINT,
     IN UINT_PTR,
     IN LPCWSTR);
 
-/* arch-tag: f201d05a-1240-4fc5-8ea4-ca24d4ee5671
-   (do not change this comment) */