comparison src/w32gui.h @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents fce1df45a956
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 /* Definitions and headers for communication on the Microsoft W32 API. 1 /* Definitions and headers for communication on the Microsoft W32 API.
2 Copyright (C) 1995 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
6 GNU Emacs is free software; you can redistribute it and/or modify 6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to 17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02111-1307, USA. */ 19 Boston, MA 02110-1301, USA. */
20 20
21 #ifndef EMACS_W32GUI_H 21 #ifndef EMACS_W32GUI_H
22 #define EMACS_W32GUI_H 22 #define EMACS_W32GUI_H
23 #include <windows.h> 23 #include <windows.h>
24 24
34 short descent; 34 short descent;
35 } XCharStruct; 35 } XCharStruct;
36 36
37 enum w32_char_font_type 37 enum w32_char_font_type
38 { 38 {
39 UNKNOWN_FONT, 39 UNKNOWN_FONT = 0 /* FONT_TYPE_UNKNOWN */,
40 ANSI_FONT, 40 ANSI_FONT,
41 UNICODE_FONT, 41 UNICODE_FONT,
42 BDF_1D_FONT, 42 BDF_1D_FONT,
43 BDF_2D_FONT 43 BDF_2D_FONT
44 }; 44 };
70 #define GCFont 0x03 70 #define GCFont 0x03
71 71
72 typedef HBITMAP Pixmap; 72 typedef HBITMAP Pixmap;
73 typedef HBITMAP Bitmap; 73 typedef HBITMAP Bitmap;
74 74
75 typedef char * XrmDatabase;
76
75 typedef XGCValues * GC; 77 typedef XGCValues * GC;
76 typedef COLORREF Color; 78 typedef COLORREF Color;
77 typedef DWORD Time; 79 typedef DWORD Time;
78 typedef HWND Window; 80 typedef HWND Window;
81 typedef HDC Display; /* HDC so it doesn't conflict with xpm lib. */
79 typedef HCURSOR Cursor; 82 typedef HCURSOR Cursor;
83
84 #define No_Cursor (0)
85
86 #define XChar2b wchar_t
87
88 /* Dealing with bits of wchar_t as if they were an XChar2b. */
89 #define STORE_XCHAR2B(chp, byte1, byte2) \
90 ((*chp) = ((XChar2b)((((byte1) & 0x00ff) << 8) | ((byte2) & 0x00ff))))
91
92 #define XCHAR2B_BYTE1(chp) \
93 (((*chp) & 0xff00) >> 8)
94
95 #define XCHAR2B_BYTE2(chp) \
96 ((*chp) & 0x00ff)
97
80 98
81 /* Windows equivalent of XImage. */ 99 /* Windows equivalent of XImage. */
82 typedef struct _XImage 100 typedef struct _XImage
83 { 101 {
84 unsigned char * data; 102 unsigned char * data;
128 #define PBaseSize (1L << 8) /* program specified base for incrementing */ 146 #define PBaseSize (1L << 8) /* program specified base for incrementing */
129 #define PWinGravity (1L << 9) /* program specified window gravity */ 147 #define PWinGravity (1L << 9) /* program specified window gravity */
130 148
131 extern int XParseGeometry (); 149 extern int XParseGeometry ();
132 150
151
152 typedef struct {
153 int x, y;
154 unsigned width, height;
155 } XRectangle;
156
157 #define NativeRectangle RECT
158
159 #define CONVERT_TO_XRECT(xr,nr) \
160 ((xr).x = (nr).left, \
161 (xr).y = (nr).top, \
162 (xr).width = ((nr).right - (nr).left), \
163 (xr).height = ((nr).bottom - (nr).top))
164
165 #define CONVERT_FROM_XRECT(xr,nr) \
166 ((nr).left = (xr).x, \
167 (nr).top = (xr).y, \
168 (nr).right = ((xr).x + (xr).width), \
169 (nr).bottom = ((xr).y + (xr).height))
170
171 #define STORE_NATIVE_RECT(nr,x,y,width,height) \
172 ((nr).left = (x), \
173 (nr).top = (y), \
174 (nr).right = ((nr).left + (width)), \
175 (nr).bottom = ((nr).top + (height)))
176
177
133 #endif /* EMACS_W32GUI_H */ 178 #endif /* EMACS_W32GUI_H */
179
180 /* arch-tag: 9172e5fb-45a5-4684-afd9-ca0e81324604
181 (do not change this comment) */