1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef EMACS_W32GUI_H
20 #define EMACS_W32GUI_H
21 #include <windows.h>
22
23 #include "systime.h"
24
25
26 #define local_heap (GetProcessHeap ())
27 #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n)))
28 #define local_free(p) (HeapFree (local_heap, 0, ((LPVOID) (p))))
29
30 typedef HBITMAP Emacs_Pixmap;
31
32 typedef HWND Window;
33 typedef HDC Display;
34 typedef HCURSOR Emacs_Cursor;
35
36
37 typedef struct _XImage
38 {
39 unsigned char * data;
40 BITMAPINFO info;
41
42 } XImage;
43
44 struct image;
45 extern int w32_load_image (struct frame *f, struct image *img,
46 Lisp_Object spec_file, Lisp_Object spec_data);
47 extern bool w32_can_use_native_image_api (Lisp_Object);
48 extern void w32_gdiplus_shutdown (void);
49 extern size_t w32_image_size (Emacs_Pixmap);
50
51 #define FACE_DEFAULT (~0)
52
53 extern HINSTANCE hinst;
54
55
56
57 #define ForgetGravity 0
58 #define NorthWestGravity 1
59 #define NorthGravity 2
60 #define NorthEastGravity 3
61 #define WestGravity 4
62 #define CenterGravity 5
63 #define EastGravity 6
64 #define SouthWestGravity 7
65 #define SouthGravity 8
66 #define SouthEastGravity 9
67 #define StaticGravity 10
68
69 #define NoValue 0x0000
70 #define XValue 0x0001
71 #define YValue 0x0002
72 #define WidthValue 0x0004
73 #define HeightValue 0x0008
74 #define AllValues 0x000F
75 #define XNegative 0x0010
76 #define YNegative 0x0020
77
78 #define USPosition (1L << 0)
79 #define USSize (1L << 1)
80
81 #define PPosition (1L << 2)
82 #define PSize (1L << 3)
83 #define PMinSize (1L << 4)
84 #define PMaxSize (1L << 5)
85 #define PResizeInc (1L << 6)
86 #define PAspect (1L << 7)
87 #define PBaseSize (1L << 8)
88 #define PWinGravity (1L << 9)
89
90 #define NativeRectangle RECT
91
92 #define CONVERT_TO_EMACS_RECT(xr,nr) \
93 ((xr).x = (nr).left, \
94 (xr).y = (nr).top, \
95 (xr).width = ((nr).right - (nr).left), \
96 (xr).height = ((nr).bottom - (nr).top))
97
98 #define CONVERT_FROM_EMACS_RECT(xr,nr) \
99 ((nr).left = (xr).x, \
100 (nr).top = (xr).y, \
101 (nr).right = ((xr).x + (xr).width), \
102 (nr).bottom = ((xr).y + (xr).height))
103
104 #define STORE_NATIVE_RECT(nr,x,y,width,height) \
105 ((nr).left = (x), \
106 (nr).top = (y), \
107 (nr).right = ((nr).left + (width)), \
108 (nr).bottom = ((nr).top + (height)))
109
110
111 #endif