diff options
| author | Adrian Robert | 2008-07-15 18:15:18 +0000 |
|---|---|---|
| committer | Adrian Robert | 2008-07-15 18:15:18 +0000 |
| commit | edfda78355c5528eee489fa8a7f9c73bf8e734f2 (patch) | |
| tree | 78d2414d9791e1efc17ec9b35b438ae35602340a /src/w32gui.h | |
| parent | 1391cd548782097e34d7856ec4f20ca90bdf2c26 (diff) | |
| download | emacs-edfda78355c5528eee489fa8a7f9c73bf8e734f2.tar.gz emacs-edfda78355c5528eee489fa8a7f9c73bf8e734f2.zip | |
merging Emacs.app (NeXTstep port)
Diffstat (limited to 'src/w32gui.h')
| -rw-r--r-- | src/w32gui.h | 93 |
1 files changed, 35 insertions, 58 deletions
diff --git a/src/w32gui.h b/src/w32gui.h index aea3582b3ef..d9f09e33134 100644 --- a/src/w32gui.h +++ b/src/w32gui.h | |||
| @@ -21,66 +21,19 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 21 | #define EMACS_W32GUI_H | 21 | #define EMACS_W32GUI_H |
| 22 | #include <windows.h> | 22 | #include <windows.h> |
| 23 | 23 | ||
| 24 | #include "w32bdf.h" | ||
| 24 | 25 | ||
| 25 | /* Emulate widget_value from ../lwlib/lwlib.h, modified for Windows. */ | 26 | /* Emulate XCharStruct. */ |
| 26 | typedef void * XtPointer; | 27 | typedef struct _XCharStruct |
| 27 | typedef char Boolean; | ||
| 28 | enum button_type | ||
| 29 | { | 28 | { |
| 30 | BUTTON_TYPE_NONE, | 29 | short rbearing; |
| 31 | BUTTON_TYPE_TOGGLE, | 30 | short lbearing; |
| 32 | BUTTON_TYPE_RADIO | 31 | short width; |
| 33 | }; | 32 | short ascent; |
| 34 | typedef struct _widget_value | 33 | short descent; |
| 35 | { | 34 | } XCharStruct; |
| 36 | /* name of widget */ | 35 | |
| 37 | Lisp_Object lname; | 36 | |
| 38 | char* name; | ||
| 39 | /* value (meaning depend on widget type) */ | ||
| 40 | char* value; | ||
| 41 | /* keyboard equivalent. no implications for XtTranslations */ | ||
| 42 | Lisp_Object lkey; | ||
| 43 | char* key; | ||
| 44 | /* Help string or nil if none. | ||
| 45 | GC finds this string through the frame's menu_bar_vector | ||
| 46 | or through menu_items. */ | ||
| 47 | Lisp_Object help; | ||
| 48 | /* true if enabled */ | ||
| 49 | Boolean enabled; | ||
| 50 | /* true if selected */ | ||
| 51 | Boolean selected; | ||
| 52 | /* The type of a button. */ | ||
| 53 | enum button_type button_type; | ||
| 54 | /* true if menu title */ | ||
| 55 | Boolean title; | ||
| 56 | #if 0 | ||
| 57 | /* true if was edited (maintained by get_value) */ | ||
| 58 | Boolean edited; | ||
| 59 | /* true if has changed (maintained by lw library) */ | ||
| 60 | change_type change; | ||
| 61 | /* true if this widget itself has changed, | ||
| 62 | but not counting the other widgets found in the `next' field. */ | ||
| 63 | change_type this_one_change; | ||
| 64 | #endif | ||
| 65 | /* Contents of the sub-widgets, also selected slot for checkbox */ | ||
| 66 | struct _widget_value* contents; | ||
| 67 | /* data passed to callback */ | ||
| 68 | XtPointer call_data; | ||
| 69 | /* next one in the list */ | ||
| 70 | struct _widget_value* next; | ||
| 71 | #if 0 | ||
| 72 | /* slot for the toolkit dependent part. Always initialize to NULL. */ | ||
| 73 | void* toolkit_data; | ||
| 74 | /* tell us if we should free the toolkit data slot when freeing the | ||
| 75 | widget_value itself. */ | ||
| 76 | Boolean free_toolkit_data; | ||
| 77 | |||
| 78 | /* we resource the widget_value structures; this points to the next | ||
| 79 | one on the free list if this one has been deallocated. | ||
| 80 | */ | ||
| 81 | struct _widget_value *free_list; | ||
| 82 | #endif | ||
| 83 | } widget_value; | ||
| 84 | /* Local memory management for menus. */ | 37 | /* Local memory management for menus. */ |
| 85 | #define local_heap (GetProcessHeap ()) | 38 | #define local_heap (GetProcessHeap ()) |
| 86 | #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n))) | 39 | #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n))) |
| @@ -89,6 +42,30 @@ typedef struct _widget_value | |||
| 89 | #define malloc_widget_value() ((widget_value *) local_alloc (sizeof (widget_value))) | 42 | #define malloc_widget_value() ((widget_value *) local_alloc (sizeof (widget_value))) |
| 90 | #define free_widget_value(wv) (local_free ((wv))) | 43 | #define free_widget_value(wv) (local_free ((wv))) |
| 91 | 44 | ||
| 45 | |||
| 46 | enum w32_char_font_type | ||
| 47 | { | ||
| 48 | UNKNOWN_FONT = 0 /* FONT_TYPE_UNKNOWN */, | ||
| 49 | ANSI_FONT, | ||
| 50 | UNICODE_FONT, | ||
| 51 | BDF_1D_FONT, | ||
| 52 | BDF_2D_FONT | ||
| 53 | }; | ||
| 54 | |||
| 55 | typedef struct W32FontStruct { | ||
| 56 | enum w32_char_font_type font_type; | ||
| 57 | TEXTMETRIC tm; | ||
| 58 | HFONT hfont; | ||
| 59 | bdffont *bdf; | ||
| 60 | int double_byte_p; | ||
| 61 | XCharStruct max_bounds; | ||
| 62 | XCharStruct scratch; | ||
| 63 | /* Only store info for ascii chars, if not fixed pitch. */ | ||
| 64 | XCharStruct * per_char; | ||
| 65 | } W32FontStruct; | ||
| 66 | |||
| 67 | typedef struct W32FontStruct XFontStruct; | ||
| 68 | |||
| 92 | /* Emulate X GC's by keeping color and font info in a structure. */ | 69 | /* Emulate X GC's by keeping color and font info in a structure. */ |
| 93 | typedef struct _XGCValues | 70 | typedef struct _XGCValues |
| 94 | { | 71 | { |