462
|
1 /* ui-gtk.h
|
|
2 **
|
|
3 ** Description:
|
|
4 **
|
|
5 ** Created by: William M. Perry
|
|
6 ** Copyright (c) 2000 Aventail Corporation
|
|
7 **
|
|
8 */
|
|
9
|
|
10 #ifndef __UI_GTK_H__
|
|
11 #define __UI_GTK_H__
|
|
12
|
|
13 /* Encapsulate a foreign function call */
|
|
14 #include <gtk/gtk.h>
|
|
15 #include "sysdll.h"
|
|
16 #include "lrecord.h"
|
|
17
|
|
18 typedef void (*ffi_actual_function) (void);
|
|
19 typedef void (*ffi_marshalling_function) (ffi_actual_function, GtkArg *);
|
|
20
|
|
21 #define MAX_GTK_ARGS 100
|
|
22
|
|
23 typedef struct {
|
2720
|
24 #ifdef MC_ALLOC
|
|
25 struct lrecord_header header;
|
|
26 #else /* MC_ALLOC */
|
462
|
27 struct lcrecord_header header;
|
2720
|
28 #endif /* MC_ALLOC */
|
462
|
29 GtkType return_type;
|
|
30 GtkType args[MAX_GTK_ARGS];
|
|
31 gint n_args;
|
|
32 Lisp_Object function_name;
|
|
33 dll_func function_ptr;
|
|
34 ffi_marshalling_function marshal;
|
|
35 } emacs_ffi_data;
|
|
36
|
|
37 DECLARE_LRECORD (emacs_ffi, emacs_ffi_data);
|
|
38
|
|
39 #define XFFI(x) XRECORD (x, emacs_ffi, emacs_ffi_data)
|
617
|
40 #define wrap_emacs_ffi(p) wrap_record (p, emacs_ffi)
|
462
|
41 #define FFIP(x) RECORDP (x, emacs_ffi)
|
|
42 #define CHECK_FFI(x) CHECK_RECORD (x, emacs_ffi)
|
|
43
|
|
44 /* Encapsulate a GtkObject in Lisp */
|
|
45 typedef struct {
|
2720
|
46 #ifdef MC_ALLOC
|
|
47 struct lrecord_header header;
|
|
48 #else /* MC_ALLOC */
|
462
|
49 struct lcrecord_header header;
|
2720
|
50 #endif /* MC_ALLOC */
|
462
|
51 gboolean alive_p;
|
|
52 GtkObject *object;
|
|
53 Lisp_Object plist;
|
|
54 } emacs_gtk_object_data;
|
|
55
|
|
56 DECLARE_LRECORD (emacs_gtk_object, emacs_gtk_object_data);
|
|
57
|
|
58 #define XGTK_OBJECT(x) XRECORD (x, emacs_gtk_object, emacs_gtk_object_data)
|
617
|
59 #define wrap_emacs_gtk_object(p) wrap_record (p, emacs_gtk_object)
|
462
|
60 #define GTK_OBJECTP(x) RECORDP (x, emacs_gtk_object)
|
|
61 #define CHECK_GTK_OBJECT(x) CHECK_RECORD (x, emacs_gtk_object)
|
|
62
|
|
63 extern Lisp_Object build_gtk_object (GtkObject *obj);
|
|
64
|
|
65 /* Encapsulate a GTK_TYPE_BOXED in lisp */
|
|
66 typedef struct {
|
2720
|
67 #ifdef MC_ALLOC
|
|
68 struct lrecord_header header;
|
|
69 #else /* MC_ALLOC */
|
462
|
70 struct lcrecord_header header;
|
2720
|
71 #endif /* MC_ALLOC */
|
462
|
72 GtkType object_type;
|
|
73 void *object;
|
|
74 } emacs_gtk_boxed_data;
|
|
75
|
|
76 DECLARE_LRECORD (emacs_gtk_boxed, emacs_gtk_boxed_data);
|
|
77
|
|
78 #define XGTK_BOXED(x) XRECORD (x, emacs_gtk_boxed, emacs_gtk_boxed_data)
|
617
|
79 #define wrap_emacs_gtk_boxed(p) wrap_record (p, emacs_gtk_boxed)
|
462
|
80 #define GTK_BOXEDP(x) RECORDP (x, emacs_gtk_boxed)
|
|
81 #define CHECK_GTK_BOXED(x) CHECK_RECORD (x, emacs_gtk_boxed)
|
|
82
|
778
|
83 extern Lisp_Object build_gtk_boxed (void *obj, GtkType t);
|
|
84
|
462
|
85 #endif /* __UI_GTK_H__ */
|