1 typedef unsigned int                           size_t;
2 typedef unsigned char                          __u_char;
3 typedef unsigned short int                     __u_short;
4 typedef unsigned int                           __u_int;
5 typedef unsigned long int                      __u_long;
6 typedef signed char                            __int8_t;
7 typedef unsigned char                          __uint8_t;
8 typedef signed short int                       __int16_t;
9 typedef unsigned short int                     __uint16_t;
10 typedef signed int                             __int32_t;
11 typedef unsigned int                           __uint32_t;
12 __extension__ typedef signed long long int     __int64_t;
13 __extension__ typedef unsigned long long int   __uint64_t;
14 __extension__ typedef long long int            __quad_t;
15 __extension__ typedef unsigned long long int   __u_quad_t;
16 __extension__ typedef __u_quad_t               __dev_t;
17 __extension__ typedef unsigned int             __uid_t;
18 __extension__ typedef unsigned int             __gid_t;
19 __extension__ typedef unsigned long int        __ino_t;
20 __extension__ typedef __u_quad_t               __ino64_t;
21 __extension__ typedef unsigned int             __mode_t;
22 __extension__ typedef unsigned int             __nlink_t;
23 __extension__ typedef long int                 __off_t;
24 __extension__ typedef __quad_t                 __off64_t;
25 __extension__ typedef int                      __pid_t;
26 __extension__ typedef struct
27 {
28    int __val[2];
29 } __fsid_t;
30 __extension__ typedef long int                 __clock_t;
31 __extension__ typedef unsigned long int        __rlim_t;
32 __extension__ typedef __u_quad_t               __rlim64_t;
33 __extension__ typedef unsigned int             __id_t;
34 __extension__ typedef long int                 __time_t;
35 __extension__ typedef unsigned int             __useconds_t;
36 __extension__ typedef long int                 __suseconds_t;
37 __extension__ typedef int                      __daddr_t;
38 __extension__ typedef long int                 __swblk_t;
39 __extension__ typedef int                      __key_t;
40 __extension__ typedef int                      __clockid_t;
41 __extension__ typedef int                      __timer_t;
42 __extension__ typedef long int                 __blksize_t;
43 __extension__ typedef long int                 __blkcnt_t;
44 __extension__ typedef __quad_t                 __blkcnt64_t;
45 __extension__ typedef unsigned long int        __fsblkcnt_t;
46 __extension__ typedef __u_quad_t               __fsblkcnt64_t;
47 __extension__ typedef unsigned long int        __fsfilcnt_t;
48 __extension__ typedef __u_quad_t               __fsfilcnt64_t;
49 __extension__ typedef int                      __ssize_t;
50 typedef __off64_t                              __loff_t;
51 typedef __quad_t *                             __qaddr_t;
52 typedef char *                                 __caddr_t;
53 __extension__ typedef int                      __intptr_t;
54 __extension__ typedef unsigned int             __socklen_t;
55 typedef __u_char                               u_char;
56 typedef __u_short                              u_short;
57 typedef __u_int                                u_int;
58 typedef __u_long                               u_long;
59 typedef __quad_t                               quad_t;
60 typedef __u_quad_t                             u_quad_t;
61 typedef __fsid_t                               fsid_t;
62 typedef __loff_t                               loff_t;
63 typedef __ino_t                                ino_t;
64 typedef __dev_t                                dev_t;
65 typedef __gid_t                                gid_t;
66 typedef __mode_t                               mode_t;
67 typedef __nlink_t                              nlink_t;
68 typedef __uid_t                                uid_t;
69 typedef __off_t                                off_t;
70 typedef __pid_t                                pid_t;
71 typedef __id_t                                 id_t;
72 typedef __ssize_t                              ssize_t;
73 typedef __daddr_t                              daddr_t;
74 typedef __caddr_t                              caddr_t;
75 typedef __key_t                                key_t;
76 typedef __time_t                               time_t;
77 typedef __clockid_t                            clockid_t;
78 typedef __timer_t                              timer_t;
79 typedef unsigned long int                      ulong;
80 typedef unsigned short int                     ushort;
81 typedef unsigned int                           uint;
82 typedef int                                    int8_t __attribute__((__mode__(__QI__)));
83 typedef int                                    int16_t __attribute__((__mode__(__HI__)));
84 typedef int                                    int32_t __attribute__((__mode__(__SI__)));
85 typedef int                                    int64_t __attribute__((__mode__(__DI__)));
86 typedef unsigned int                           u_int8_t __attribute__((__mode__(__QI__)));
87 typedef unsigned int                           u_int16_t __attribute__((__mode__(__HI__)));
88 typedef unsigned int                           u_int32_t __attribute__((__mode__(__SI__)));
89 typedef unsigned int                           u_int64_t __attribute__((__mode__(__DI__)));
90 typedef int                                    register_t __attribute__((__mode__(__word__)));
91 typedef int                                    __sig_atomic_t;
92 typedef struct
93 {
94    unsigned long int __val[(1024 / (8 * sizeof(unsigned long int)))];
95 } __sigset_t;
96 typedef __sigset_t                             sigset_t;
97 struct timespec
98 {
99    __time_t tv_sec;
100    long int tv_nsec;
101 };
102 struct timeval
103 {
104    __time_t      tv_sec;
105    __suseconds_t tv_usec;
106 };
107 typedef __suseconds_t   suseconds_t;
108 typedef long int        __fd_mask;
109 typedef struct
110 {
111    __fd_mask __fds_bits[1024 / (8 * sizeof(__fd_mask))];
112 } fd_set;
113 typedef __fd_mask       fd_mask;
114 extern int select(int __nfds, fd_set *__restrict __readfds,
115                   fd_set *__restrict __writefds,
116                   fd_set *__restrict __exceptfds,
117                   struct timeval *__restrict __timeout);
118 __extension__
119 extern __inline unsigned int gnu_dev_major(unsigned long long int __dev)
120 __attribute__((__nothrow__));
121 __extension__
122 extern __inline unsigned int gnu_dev_minor(unsigned long long int __dev)
123 __attribute__((__nothrow__));
124 __extension__
125 extern __inline unsigned long long int gnu_dev_makedev(unsigned int __major,
126                                                        unsigned int __minor)
127 __attribute__((__nothrow__));
128 
129 __extension__ extern __inline unsigned int
gnu_dev_major(unsigned long long int __dev)130 __attribute__((__nothrow__)) gnu_dev_major(unsigned long long int __dev)
131 {
132    return(((__dev >> 8) & 0xfff) | ((unsigned int)(__dev >> 32) & ~0xfff));
133 }
134 
135 __extension__ extern __inline unsigned int
gnu_dev_minor(unsigned long long int __dev)136 __attribute__((__nothrow__)) gnu_dev_minor(unsigned long long int __dev)
137 {
138    return((__dev & 0xff) | ((unsigned int)(__dev >> 12) & ~0xff));
139 }
140 
141 __extension__ extern __inline unsigned long long int
gnu_dev_makedev(unsigned int __major,unsigned int __minor)142 __attribute__((__nothrow__)) gnu_dev_makedev(unsigned int __major, unsigned int __minor)
143 {
144    return((__minor & 0xff) | ((__major & 0xfff) << 8)
145           | (((unsigned long long int)(__minor & ~0xff)) << 12)
146           | (((unsigned long long int)(__major & ~0xfff)) << 32));
147 }
148 
149 typedef __blkcnt_t     blkcnt_t;
150 typedef __fsblkcnt_t   fsblkcnt_t;
151 typedef __fsfilcnt_t   fsfilcnt_t;
152 struct __sched_param
153 {
154    int __sched_priority;
155 };
156 typedef int            __atomic_lock_t;
157 struct _pthread_fastlock
158 {
159    long int        __status;
160    __atomic_lock_t __spinlock;
161 };
162 typedef struct _pthread_descr_struct *_pthread_descr;
163 typedef struct __pthread_attr_s
164 {
165    int                  __detachstate;
166    int                  __schedpolicy;
167    struct __sched_param __schedparam;
168    int                  __inheritsched;
169    int                  __scope;
170    size_t               __guardsize;
171    int                  __stackaddr_set;
172    void                 *__stackaddr;
173    size_t               __stacksize;
174 } pthread_attr_t;
175 __extension__ typedef long long __pthread_cond_align_t;
176 typedef struct
177 {
178    struct _pthread_fastlock __c_lock;
179    _pthread_descr           __c_waiting;
180    char                     __padding[48 - sizeof(struct _pthread_fastlock)
181                                       - sizeof(_pthread_descr) - sizeof(__pthread_cond_align_t)];
182    __pthread_cond_align_t   __align;
183 } pthread_cond_t;
184 typedef struct
185 {
186    int __dummy;
187 } pthread_condattr_t;
188 typedef unsigned int pthread_key_t;
189 typedef struct
190 {
191    int                      __m_reserved;
192    int                      __m_count;
193    _pthread_descr           __m_owner;
194    int                      __m_kind;
195    struct _pthread_fastlock __m_lock;
196 } pthread_mutex_t;
197 typedef struct
198 {
199    int __mutexkind;
200 } pthread_mutexattr_t;
201 typedef int               pthread_once_t;
202 typedef unsigned long int pthread_t;
203 typedef struct
204 {
205    unsigned long fds_bits [(1024 / (8 * sizeof(unsigned long)))];
206 } __kernel_fd_set;
207 typedef void (*__kernel_sighandler_t)(int);
208 typedef int                  __kernel_key_t;
209 typedef int                  __kernel_mqd_t;
210 typedef unsigned long        __kernel_ino_t;
211 typedef unsigned short       __kernel_mode_t;
212 typedef unsigned short       __kernel_nlink_t;
213 typedef long                 __kernel_off_t;
214 typedef int                  __kernel_pid_t;
215 typedef unsigned short       __kernel_ipc_pid_t;
216 typedef unsigned short       __kernel_uid_t;
217 typedef unsigned short       __kernel_gid_t;
218 typedef unsigned int         __kernel_size_t;
219 typedef int                  __kernel_ssize_t;
220 typedef int                  __kernel_ptrdiff_t;
221 typedef long                 __kernel_time_t;
222 typedef long                 __kernel_suseconds_t;
223 typedef long                 __kernel_clock_t;
224 typedef int                  __kernel_timer_t;
225 typedef int                  __kernel_clockid_t;
226 typedef int                  __kernel_daddr_t;
227 typedef char *               __kernel_caddr_t;
228 typedef unsigned short       __kernel_uid16_t;
229 typedef unsigned short       __kernel_gid16_t;
230 typedef unsigned int         __kernel_uid32_t;
231 typedef unsigned int         __kernel_gid32_t;
232 typedef unsigned short       __kernel_old_uid_t;
233 typedef unsigned short       __kernel_old_gid_t;
234 typedef unsigned short       __kernel_old_dev_t;
235 typedef long long            __kernel_loff_t;
236 typedef struct
237 {
238    int __val[2];
239 } __kernel_fsid_t;
240 typedef unsigned short       umode_t;
241 typedef __signed__ char      __s8;
242 typedef unsigned char        __u8;
243 typedef __signed__ short     __s16;
244 typedef unsigned short       __u16;
245 typedef __signed__ int       __s32;
246 typedef unsigned int         __u32;
247 typedef __signed__ long long __s64;
248 typedef unsigned long long   __u64;
249 typedef __u16                __le16;
250 typedef __u16                __be16;
251 typedef __u32                __le32;
252 typedef __u32                __be32;
253 typedef __u64                __le64;
254 typedef __u64                __be64;
255 struct timezone
256 {
257    int tz_minuteswest;
258    int tz_dsttime;
259 };
260 typedef struct timezone *__restrict __timezone_ptr_t;
261 extern int gettimeofday(struct timeval *__restrict __tv,
262                         __timezone_ptr_t __tz) __attribute__((__nothrow__));
263 extern int settimeofday(__const struct timeval *__tv,
264                         __const struct timezone *__tz) __attribute__((__nothrow__));
265 extern int adjtime(__const struct timeval *__delta,
266                    struct timeval *__olddelta) __attribute__((__nothrow__));
267 
268 enum __itimer_which
269 {
270    ITIMER_REAL    = 0,
271    ITIMER_VIRTUAL = 1,
272    ITIMER_PROF    = 2
273 };
274 struct itimerval
275 {
276    struct timeval it_interval;
277    struct timeval it_value;
278 };
279 typedef int __itimer_which_t;
280 extern int getitimer(__itimer_which_t __which,
281                      struct itimerval *__value) __attribute__((__nothrow__));
282 extern int setitimer(__itimer_which_t __which,
283                      __const struct itimerval *__restrict __new,
284                      struct itimerval *__restrict __old) __attribute__((__nothrow__));
285 extern int utimes(__const char *__file, __const struct timeval __tvp[2])
286 __attribute__((__nothrow__));
287 extern int lutimes(__const char *__file, __const struct timeval __tvp[2])
288 __attribute__((__nothrow__));
289 extern int futimes(int __fd, __const struct timeval __tvp[2]) __attribute__((__nothrow__));
290 
291 typedef enum
292 {
293    DIKT_UNICODE    = 0x0000,
294    DIKT_SPECIAL    = 0xF000,
295    DIKT_FUNCTION   = 0xF100,
296    DIKT_MODIFIER   = 0xF200,
297    DIKT_LOCK       = 0xF300,
298    DIKT_DEAD       = 0xF400,
299    DIKT_CUSTOM     = 0xF500,
300    DIKT_IDENTIFIER = 0xF600
301 } DFBInputDeviceKeyType;
302 typedef enum
303 {
304    DIMKI_SHIFT,
305    DIMKI_CONTROL,
306    DIMKI_ALT,
307    DIMKI_ALTGR,
308    DIMKI_META,
309    DIMKI_SUPER,
310    DIMKI_HYPER,
311    DIMKI_FIRST = DIMKI_SHIFT,
312    DIMKI_LAST  = DIMKI_HYPER
313 } DFBInputDeviceModifierKeyIdentifier;
314 typedef enum
315 {
316    DIKI_UNKNOWN = ((DIKT_IDENTIFIER) | (0)),
317    DIKI_A,
318    DIKI_B,
319    DIKI_C,
320    DIKI_D,
321    DIKI_E,
322    DIKI_F,
323    DIKI_G,
324    DIKI_H,
325    DIKI_I,
326    DIKI_J,
327    DIKI_K,
328    DIKI_L,
329    DIKI_M,
330    DIKI_N,
331    DIKI_O,
332    DIKI_P,
333    DIKI_Q,
334    DIKI_R,
335    DIKI_S,
336    DIKI_T,
337    DIKI_U,
338    DIKI_V,
339    DIKI_W,
340    DIKI_X,
341    DIKI_Y,
342    DIKI_Z,
343    DIKI_0,
344    DIKI_1,
345    DIKI_2,
346    DIKI_3,
347    DIKI_4,
348    DIKI_5,
349    DIKI_6,
350    DIKI_7,
351    DIKI_8,
352    DIKI_9,
353    DIKI_F1,
354    DIKI_F2,
355    DIKI_F3,
356    DIKI_F4,
357    DIKI_F5,
358    DIKI_F6,
359    DIKI_F7,
360    DIKI_F8,
361    DIKI_F9,
362    DIKI_F10,
363    DIKI_F11,
364    DIKI_F12,
365    DIKI_SHIFT_L,
366    DIKI_SHIFT_R,
367    DIKI_CONTROL_L,
368    DIKI_CONTROL_R,
369    DIKI_ALT_L,
370    DIKI_ALT_R,
371    DIKI_ALTGR,
372    DIKI_META_L,
373    DIKI_META_R,
374    DIKI_SUPER_L,
375    DIKI_SUPER_R,
376    DIKI_HYPER_L,
377    DIKI_HYPER_R,
378    DIKI_CAPS_LOCK,
379    DIKI_NUM_LOCK,
380    DIKI_SCROLL_LOCK,
381    DIKI_ESCAPE,
382    DIKI_LEFT,
383    DIKI_RIGHT,
384    DIKI_UP,
385    DIKI_DOWN,
386    DIKI_TAB,
387    DIKI_ENTER,
388    DIKI_SPACE,
389    DIKI_BACKSPACE,
390    DIKI_INSERT,
391    DIKI_DELETE,
392    DIKI_HOME,
393    DIKI_END,
394    DIKI_PAGE_UP,
395    DIKI_PAGE_DOWN,
396    DIKI_PRINT,
397    DIKI_PAUSE,
398    DIKI_QUOTE_LEFT,
399    DIKI_MINUS_SIGN,
400    DIKI_EQUALS_SIGN,
401    DIKI_BRACKET_LEFT,
402    DIKI_BRACKET_RIGHT,
403    DIKI_BACKSLASH,
404    DIKI_SEMICOLON,
405    DIKI_QUOTE_RIGHT,
406    DIKI_COMMA,
407    DIKI_PERIOD,
408    DIKI_SLASH,
409    DIKI_LESS_SIGN,
410    DIKI_KP_DIV,
411    DIKI_KP_MULT,
412    DIKI_KP_MINUS,
413    DIKI_KP_PLUS,
414    DIKI_KP_ENTER,
415    DIKI_KP_SPACE,
416    DIKI_KP_TAB,
417    DIKI_KP_F1,
418    DIKI_KP_F2,
419    DIKI_KP_F3,
420    DIKI_KP_F4,
421    DIKI_KP_EQUAL,
422    DIKI_KP_SEPARATOR,
423    DIKI_KP_DECIMAL,
424    DIKI_KP_0,
425    DIKI_KP_1,
426    DIKI_KP_2,
427    DIKI_KP_3,
428    DIKI_KP_4,
429    DIKI_KP_5,
430    DIKI_KP_6,
431    DIKI_KP_7,
432    DIKI_KP_8,
433    DIKI_KP_9,
434    DIKI_KEYDEF_END,
435    DIKI_NUMBER_OF_KEYS = DIKI_KEYDEF_END - ((DIKT_IDENTIFIER) | (0))
436 } DFBInputDeviceKeyIdentifier;
437 typedef enum
438 {
439    DIKS_NULL                  = ((DIKT_UNICODE) | (0x00)),
440    DIKS_BACKSPACE             = ((DIKT_UNICODE) | (0x08)),
441    DIKS_TAB                   = ((DIKT_UNICODE) | (0x09)),
442    DIKS_RETURN                = ((DIKT_UNICODE) | (0x0D)),
443    DIKS_CANCEL                = ((DIKT_UNICODE) | (0x18)),
444    DIKS_ESCAPE                = ((DIKT_UNICODE) | (0x1B)),
445    DIKS_SPACE                 = ((DIKT_UNICODE) | (0x20)),
446    DIKS_EXCLAMATION_MARK      = ((DIKT_UNICODE) | (0x21)),
447    DIKS_QUOTATION             = ((DIKT_UNICODE) | (0x22)),
448    DIKS_NUMBER_SIGN           = ((DIKT_UNICODE) | (0x23)),
449    DIKS_DOLLAR_SIGN           = ((DIKT_UNICODE) | (0x24)),
450    DIKS_PERCENT_SIGN          = ((DIKT_UNICODE) | (0x25)),
451    DIKS_AMPERSAND             = ((DIKT_UNICODE) | (0x26)),
452    DIKS_APOSTROPHE            = ((DIKT_UNICODE) | (0x27)),
453    DIKS_PARENTHESIS_LEFT      = ((DIKT_UNICODE) | (0x28)),
454    DIKS_PARENTHESIS_RIGHT     = ((DIKT_UNICODE) | (0x29)),
455    DIKS_ASTERISK              = ((DIKT_UNICODE) | (0x2A)),
456    DIKS_PLUS_SIGN             = ((DIKT_UNICODE) | (0x2B)),
457    DIKS_COMMA                 = ((DIKT_UNICODE) | (0x2C)),
458    DIKS_MINUS_SIGN            = ((DIKT_UNICODE) | (0x2D)),
459    DIKS_PERIOD                = ((DIKT_UNICODE) | (0x2E)),
460    DIKS_SLASH                 = ((DIKT_UNICODE) | (0x2F)),
461    DIKS_0                     = ((DIKT_UNICODE) | (0x30)),
462    DIKS_1                     = ((DIKT_UNICODE) | (0x31)),
463    DIKS_2                     = ((DIKT_UNICODE) | (0x32)),
464    DIKS_3                     = ((DIKT_UNICODE) | (0x33)),
465    DIKS_4                     = ((DIKT_UNICODE) | (0x34)),
466    DIKS_5                     = ((DIKT_UNICODE) | (0x35)),
467    DIKS_6                     = ((DIKT_UNICODE) | (0x36)),
468    DIKS_7                     = ((DIKT_UNICODE) | (0x37)),
469    DIKS_8                     = ((DIKT_UNICODE) | (0x38)),
470    DIKS_9                     = ((DIKT_UNICODE) | (0x39)),
471    DIKS_COLON                 = ((DIKT_UNICODE) | (0x3A)),
472    DIKS_SEMICOLON             = ((DIKT_UNICODE) | (0x3B)),
473    DIKS_LESS_THAN_SIGN        = ((DIKT_UNICODE) | (0x3C)),
474    DIKS_EQUALS_SIGN           = ((DIKT_UNICODE) | (0x3D)),
475    DIKS_GREATER_THAN_SIGN     = ((DIKT_UNICODE) | (0x3E)),
476    DIKS_QUESTION_MARK         = ((DIKT_UNICODE) | (0x3F)),
477    DIKS_AT                    = ((DIKT_UNICODE) | (0x40)),
478    DIKS_CAPITAL_A             = ((DIKT_UNICODE) | (0x41)),
479    DIKS_CAPITAL_B             = ((DIKT_UNICODE) | (0x42)),
480    DIKS_CAPITAL_C             = ((DIKT_UNICODE) | (0x43)),
481    DIKS_CAPITAL_D             = ((DIKT_UNICODE) | (0x44)),
482    DIKS_CAPITAL_E             = ((DIKT_UNICODE) | (0x45)),
483    DIKS_CAPITAL_F             = ((DIKT_UNICODE) | (0x46)),
484    DIKS_CAPITAL_G             = ((DIKT_UNICODE) | (0x47)),
485    DIKS_CAPITAL_H             = ((DIKT_UNICODE) | (0x48)),
486    DIKS_CAPITAL_I             = ((DIKT_UNICODE) | (0x49)),
487    DIKS_CAPITAL_J             = ((DIKT_UNICODE) | (0x4A)),
488    DIKS_CAPITAL_K             = ((DIKT_UNICODE) | (0x4B)),
489    DIKS_CAPITAL_L             = ((DIKT_UNICODE) | (0x4C)),
490    DIKS_CAPITAL_M             = ((DIKT_UNICODE) | (0x4D)),
491    DIKS_CAPITAL_N             = ((DIKT_UNICODE) | (0x4E)),
492    DIKS_CAPITAL_O             = ((DIKT_UNICODE) | (0x4F)),
493    DIKS_CAPITAL_P             = ((DIKT_UNICODE) | (0x50)),
494    DIKS_CAPITAL_Q             = ((DIKT_UNICODE) | (0x51)),
495    DIKS_CAPITAL_R             = ((DIKT_UNICODE) | (0x52)),
496    DIKS_CAPITAL_S             = ((DIKT_UNICODE) | (0x53)),
497    DIKS_CAPITAL_T             = ((DIKT_UNICODE) | (0x54)),
498    DIKS_CAPITAL_U             = ((DIKT_UNICODE) | (0x55)),
499    DIKS_CAPITAL_V             = ((DIKT_UNICODE) | (0x56)),
500    DIKS_CAPITAL_W             = ((DIKT_UNICODE) | (0x57)),
501    DIKS_CAPITAL_X             = ((DIKT_UNICODE) | (0x58)),
502    DIKS_CAPITAL_Y             = ((DIKT_UNICODE) | (0x59)),
503    DIKS_CAPITAL_Z             = ((DIKT_UNICODE) | (0x5A)),
504    DIKS_SQUARE_BRACKET_LEFT   = ((DIKT_UNICODE) | (0x5B)),
505    DIKS_BACKSLASH             = ((DIKT_UNICODE) | (0x5C)),
506    DIKS_SQUARE_BRACKET_RIGHT  = ((DIKT_UNICODE) | (0x5D)),
507    DIKS_CIRCUMFLEX_ACCENT     = ((DIKT_UNICODE) | (0x5E)),
508    DIKS_UNDERSCORE            = ((DIKT_UNICODE) | (0x5F)),
509    DIKS_GRAVE_ACCENT          = ((DIKT_UNICODE) | (0x60)),
510    DIKS_SMALL_A               = ((DIKT_UNICODE) | (0x61)),
511    DIKS_SMALL_B               = ((DIKT_UNICODE) | (0x62)),
512    DIKS_SMALL_C               = ((DIKT_UNICODE) | (0x63)),
513    DIKS_SMALL_D               = ((DIKT_UNICODE) | (0x64)),
514    DIKS_SMALL_E               = ((DIKT_UNICODE) | (0x65)),
515    DIKS_SMALL_F               = ((DIKT_UNICODE) | (0x66)),
516    DIKS_SMALL_G               = ((DIKT_UNICODE) | (0x67)),
517    DIKS_SMALL_H               = ((DIKT_UNICODE) | (0x68)),
518    DIKS_SMALL_I               = ((DIKT_UNICODE) | (0x69)),
519    DIKS_SMALL_J               = ((DIKT_UNICODE) | (0x6A)),
520    DIKS_SMALL_K               = ((DIKT_UNICODE) | (0x6B)),
521    DIKS_SMALL_L               = ((DIKT_UNICODE) | (0x6C)),
522    DIKS_SMALL_M               = ((DIKT_UNICODE) | (0x6D)),
523    DIKS_SMALL_N               = ((DIKT_UNICODE) | (0x6E)),
524    DIKS_SMALL_O               = ((DIKT_UNICODE) | (0x6F)),
525    DIKS_SMALL_P               = ((DIKT_UNICODE) | (0x70)),
526    DIKS_SMALL_Q               = ((DIKT_UNICODE) | (0x71)),
527    DIKS_SMALL_R               = ((DIKT_UNICODE) | (0x72)),
528    DIKS_SMALL_S               = ((DIKT_UNICODE) | (0x73)),
529    DIKS_SMALL_T               = ((DIKT_UNICODE) | (0x74)),
530    DIKS_SMALL_U               = ((DIKT_UNICODE) | (0x75)),
531    DIKS_SMALL_V               = ((DIKT_UNICODE) | (0x76)),
532    DIKS_SMALL_W               = ((DIKT_UNICODE) | (0x77)),
533    DIKS_SMALL_X               = ((DIKT_UNICODE) | (0x78)),
534    DIKS_SMALL_Y               = ((DIKT_UNICODE) | (0x79)),
535    DIKS_SMALL_Z               = ((DIKT_UNICODE) | (0x7A)),
536    DIKS_CURLY_BRACKET_LEFT    = ((DIKT_UNICODE) | (0x7B)),
537    DIKS_VERTICAL_BAR          = ((DIKT_UNICODE) | (0x7C)),
538    DIKS_CURLY_BRACKET_RIGHT   = ((DIKT_UNICODE) | (0x7D)),
539    DIKS_TILDE                 = ((DIKT_UNICODE) | (0x7E)),
540    DIKS_DELETE                = ((DIKT_UNICODE) | (0x7F)),
541    DIKS_ENTER                 = DIKS_RETURN,
542    DIKS_CURSOR_LEFT           = ((DIKT_SPECIAL) | (0x00)),
543    DIKS_CURSOR_RIGHT          = ((DIKT_SPECIAL) | (0x01)),
544    DIKS_CURSOR_UP             = ((DIKT_SPECIAL) | (0x02)),
545    DIKS_CURSOR_DOWN           = ((DIKT_SPECIAL) | (0x03)),
546    DIKS_INSERT                = ((DIKT_SPECIAL) | (0x04)),
547    DIKS_HOME                  = ((DIKT_SPECIAL) | (0x05)),
548    DIKS_END                   = ((DIKT_SPECIAL) | (0x06)),
549    DIKS_PAGE_UP               = ((DIKT_SPECIAL) | (0x07)),
550    DIKS_PAGE_DOWN             = ((DIKT_SPECIAL) | (0x08)),
551    DIKS_PRINT                 = ((DIKT_SPECIAL) | (0x09)),
552    DIKS_PAUSE                 = ((DIKT_SPECIAL) | (0x0A)),
553    DIKS_OK                    = ((DIKT_SPECIAL) | (0x0B)),
554    DIKS_SELECT                = ((DIKT_SPECIAL) | (0x0C)),
555    DIKS_GOTO                  = ((DIKT_SPECIAL) | (0x0D)),
556    DIKS_CLEAR                 = ((DIKT_SPECIAL) | (0x0E)),
557    DIKS_POWER                 = ((DIKT_SPECIAL) | (0x0F)),
558    DIKS_POWER2                = ((DIKT_SPECIAL) | (0x10)),
559    DIKS_OPTION                = ((DIKT_SPECIAL) | (0x11)),
560    DIKS_MENU                  = ((DIKT_SPECIAL) | (0x12)),
561    DIKS_HELP                  = ((DIKT_SPECIAL) | (0x13)),
562    DIKS_INFO                  = ((DIKT_SPECIAL) | (0x14)),
563    DIKS_TIME                  = ((DIKT_SPECIAL) | (0x15)),
564    DIKS_VENDOR                = ((DIKT_SPECIAL) | (0x16)),
565    DIKS_ARCHIVE               = ((DIKT_SPECIAL) | (0x17)),
566    DIKS_PROGRAM               = ((DIKT_SPECIAL) | (0x18)),
567    DIKS_CHANNEL               = ((DIKT_SPECIAL) | (0x19)),
568    DIKS_FAVORITES             = ((DIKT_SPECIAL) | (0x1A)),
569    DIKS_EPG                   = ((DIKT_SPECIAL) | (0x1B)),
570    DIKS_PVR                   = ((DIKT_SPECIAL) | (0x1C)),
571    DIKS_MHP                   = ((DIKT_SPECIAL) | (0x1D)),
572    DIKS_LANGUAGE              = ((DIKT_SPECIAL) | (0x1E)),
573    DIKS_TITLE                 = ((DIKT_SPECIAL) | (0x1F)),
574    DIKS_SUBTITLE              = ((DIKT_SPECIAL) | (0x20)),
575    DIKS_ANGLE                 = ((DIKT_SPECIAL) | (0x21)),
576    DIKS_ZOOM                  = ((DIKT_SPECIAL) | (0x22)),
577    DIKS_MODE                  = ((DIKT_SPECIAL) | (0x23)),
578    DIKS_KEYBOARD              = ((DIKT_SPECIAL) | (0x24)),
579    DIKS_PC                    = ((DIKT_SPECIAL) | (0x25)),
580    DIKS_SCREEN                = ((DIKT_SPECIAL) | (0x26)),
581    DIKS_TV                    = ((DIKT_SPECIAL) | (0x27)),
582    DIKS_TV2                   = ((DIKT_SPECIAL) | (0x28)),
583    DIKS_VCR                   = ((DIKT_SPECIAL) | (0x29)),
584    DIKS_VCR2                  = ((DIKT_SPECIAL) | (0x2A)),
585    DIKS_SAT                   = ((DIKT_SPECIAL) | (0x2B)),
586    DIKS_SAT2                  = ((DIKT_SPECIAL) | (0x2C)),
587    DIKS_CD                    = ((DIKT_SPECIAL) | (0x2D)),
588    DIKS_TAPE                  = ((DIKT_SPECIAL) | (0x2E)),
589    DIKS_RADIO                 = ((DIKT_SPECIAL) | (0x2F)),
590    DIKS_TUNER                 = ((DIKT_SPECIAL) | (0x30)),
591    DIKS_PLAYER                = ((DIKT_SPECIAL) | (0x31)),
592    DIKS_TEXT                  = ((DIKT_SPECIAL) | (0x32)),
593    DIKS_DVD                   = ((DIKT_SPECIAL) | (0x33)),
594    DIKS_AUX                   = ((DIKT_SPECIAL) | (0x34)),
595    DIKS_MP3                   = ((DIKT_SPECIAL) | (0x35)),
596    DIKS_PHONE                 = ((DIKT_SPECIAL) | (0x36)),
597    DIKS_AUDIO                 = ((DIKT_SPECIAL) | (0x37)),
598    DIKS_VIDEO                 = ((DIKT_SPECIAL) | (0x38)),
599    DIKS_INTERNET              = ((DIKT_SPECIAL) | (0x39)),
600    DIKS_MAIL                  = ((DIKT_SPECIAL) | (0x3A)),
601    DIKS_NEWS                  = ((DIKT_SPECIAL) | (0x3B)),
602    DIKS_DIRECTORY             = ((DIKT_SPECIAL) | (0x3C)),
603    DIKS_LIST                  = ((DIKT_SPECIAL) | (0x3D)),
604    DIKS_CALCULATOR            = ((DIKT_SPECIAL) | (0x3E)),
605    DIKS_MEMO                  = ((DIKT_SPECIAL) | (0x3F)),
606    DIKS_CALENDAR              = ((DIKT_SPECIAL) | (0x40)),
607    DIKS_EDITOR                = ((DIKT_SPECIAL) | (0x41)),
608    DIKS_RED                   = ((DIKT_SPECIAL) | (0x42)),
609    DIKS_GREEN                 = ((DIKT_SPECIAL) | (0x43)),
610    DIKS_YELLOW                = ((DIKT_SPECIAL) | (0x44)),
611    DIKS_BLUE                  = ((DIKT_SPECIAL) | (0x45)),
612    DIKS_CHANNEL_UP            = ((DIKT_SPECIAL) | (0x46)),
613    DIKS_CHANNEL_DOWN          = ((DIKT_SPECIAL) | (0x47)),
614    DIKS_BACK                  = ((DIKT_SPECIAL) | (0x48)),
615    DIKS_FORWARD               = ((DIKT_SPECIAL) | (0x49)),
616    DIKS_FIRST                 = ((DIKT_SPECIAL) | (0x4A)),
617    DIKS_LAST                  = ((DIKT_SPECIAL) | (0x4B)),
618    DIKS_VOLUME_UP             = ((DIKT_SPECIAL) | (0x4C)),
619    DIKS_VOLUME_DOWN           = ((DIKT_SPECIAL) | (0x4D)),
620    DIKS_MUTE                  = ((DIKT_SPECIAL) | (0x4E)),
621    DIKS_AB                    = ((DIKT_SPECIAL) | (0x4F)),
622    DIKS_PLAYPAUSE             = ((DIKT_SPECIAL) | (0x50)),
623    DIKS_PLAY                  = ((DIKT_SPECIAL) | (0x51)),
624    DIKS_STOP                  = ((DIKT_SPECIAL) | (0x52)),
625    DIKS_RESTART               = ((DIKT_SPECIAL) | (0x53)),
626    DIKS_SLOW                  = ((DIKT_SPECIAL) | (0x54)),
627    DIKS_FAST                  = ((DIKT_SPECIAL) | (0x55)),
628    DIKS_RECORD                = ((DIKT_SPECIAL) | (0x56)),
629    DIKS_EJECT                 = ((DIKT_SPECIAL) | (0x57)),
630    DIKS_SHUFFLE               = ((DIKT_SPECIAL) | (0x58)),
631    DIKS_REWIND                = ((DIKT_SPECIAL) | (0x59)),
632    DIKS_FASTFORWARD           = ((DIKT_SPECIAL) | (0x5A)),
633    DIKS_PREVIOUS              = ((DIKT_SPECIAL) | (0x5B)),
634    DIKS_NEXT                  = ((DIKT_SPECIAL) | (0x5C)),
635    DIKS_BEGIN                 = ((DIKT_SPECIAL) | (0x5D)),
636    DIKS_DIGITS                = ((DIKT_SPECIAL) | (0x5E)),
637    DIKS_TEEN                  = ((DIKT_SPECIAL) | (0x5F)),
638    DIKS_TWEN                  = ((DIKT_SPECIAL) | (0x60)),
639    DIKS_BREAK                 = ((DIKT_SPECIAL) | (0x61)),
640    DIKS_EXIT                  = ((DIKT_SPECIAL) | (0x62)),
641    DIKS_SETUP                 = ((DIKT_SPECIAL) | (0x63)),
642    DIKS_CURSOR_LEFT_UP        = ((DIKT_SPECIAL) | (0x64)),
643    DIKS_CURSOR_LEFT_DOWN      = ((DIKT_SPECIAL) | (0x65)),
644    DIKS_CURSOR_UP_RIGHT       = ((DIKT_SPECIAL) | (0x66)),
645    DIKS_CURSOR_DOWN_RIGHT     = ((DIKT_SPECIAL) | (0x67)),
646    DIKS_F1                    = (((DIKT_FUNCTION) | (1))),
647    DIKS_F2                    = (((DIKT_FUNCTION) | (2))),
648    DIKS_F3                    = (((DIKT_FUNCTION) | (3))),
649    DIKS_F4                    = (((DIKT_FUNCTION) | (4))),
650    DIKS_F5                    = (((DIKT_FUNCTION) | (5))),
651    DIKS_F6                    = (((DIKT_FUNCTION) | (6))),
652    DIKS_F7                    = (((DIKT_FUNCTION) | (7))),
653    DIKS_F8                    = (((DIKT_FUNCTION) | (8))),
654    DIKS_F9                    = (((DIKT_FUNCTION) | (9))),
655    DIKS_F10                   = (((DIKT_FUNCTION) | (10))),
656    DIKS_F11                   = (((DIKT_FUNCTION) | (11))),
657    DIKS_F12                   = (((DIKT_FUNCTION) | (12))),
658    DIKS_SHIFT                 = (((DIKT_MODIFIER) | ((1 << DIMKI_SHIFT)))),
659    DIKS_CONTROL               = (((DIKT_MODIFIER) | ((1 << DIMKI_CONTROL)))),
660    DIKS_ALT                   = (((DIKT_MODIFIER) | ((1 << DIMKI_ALT)))),
661    DIKS_ALTGR                 = (((DIKT_MODIFIER) | ((1 << DIMKI_ALTGR)))),
662    DIKS_META                  = (((DIKT_MODIFIER) | ((1 << DIMKI_META)))),
663    DIKS_SUPER                 = (((DIKT_MODIFIER) | ((1 << DIMKI_SUPER)))),
664    DIKS_HYPER                 = (((DIKT_MODIFIER) | ((1 << DIMKI_HYPER)))),
665    DIKS_CAPS_LOCK             = ((DIKT_LOCK) | (0x00)),
666    DIKS_NUM_LOCK              = ((DIKT_LOCK) | (0x01)),
667    DIKS_SCROLL_LOCK           = ((DIKT_LOCK) | (0x02)),
668    DIKS_DEAD_ABOVEDOT         = ((DIKT_DEAD) | (0x00)),
669    DIKS_DEAD_ABOVERING        = ((DIKT_DEAD) | (0x01)),
670    DIKS_DEAD_ACUTE            = ((DIKT_DEAD) | (0x02)),
671    DIKS_DEAD_BREVE            = ((DIKT_DEAD) | (0x03)),
672    DIKS_DEAD_CARON            = ((DIKT_DEAD) | (0x04)),
673    DIKS_DEAD_CEDILLA          = ((DIKT_DEAD) | (0x05)),
674    DIKS_DEAD_CIRCUMFLEX       = ((DIKT_DEAD) | (0x06)),
675    DIKS_DEAD_DIAERESIS        = ((DIKT_DEAD) | (0x07)),
676    DIKS_DEAD_DOUBLEACUTE      = ((DIKT_DEAD) | (0x08)),
677    DIKS_DEAD_GRAVE            = ((DIKT_DEAD) | (0x09)),
678    DIKS_DEAD_IOTA             = ((DIKT_DEAD) | (0x0A)),
679    DIKS_DEAD_MACRON           = ((DIKT_DEAD) | (0x0B)),
680    DIKS_DEAD_OGONEK           = ((DIKT_DEAD) | (0x0C)),
681    DIKS_DEAD_SEMIVOICED_SOUND = ((DIKT_DEAD) | (0x0D)),
682    DIKS_DEAD_TILDE            = ((DIKT_DEAD) | (0x0E)),
683    DIKS_DEAD_VOICED_SOUND     = ((DIKT_DEAD) | (0x0F)),
684    DIKS_CUSTOM0               = (((DIKT_CUSTOM) | (0))),
685    DIKS_CUSTOM1               = (((DIKT_CUSTOM) | (1))),
686    DIKS_CUSTOM2               = (((DIKT_CUSTOM) | (2))),
687    DIKS_CUSTOM3               = (((DIKT_CUSTOM) | (3))),
688    DIKS_CUSTOM4               = (((DIKT_CUSTOM) | (4))),
689    DIKS_CUSTOM5               = (((DIKT_CUSTOM) | (5))),
690    DIKS_CUSTOM6               = (((DIKT_CUSTOM) | (6))),
691    DIKS_CUSTOM7               = (((DIKT_CUSTOM) | (7))),
692    DIKS_CUSTOM8               = (((DIKT_CUSTOM) | (8))),
693    DIKS_CUSTOM9               = (((DIKT_CUSTOM) | (9)))
694 } DFBInputDeviceKeySymbol;
695 typedef enum
696 {
697    DILS_SCROLL = 0x00000001,
698    DILS_NUM    = 0x00000002,
699    DILS_CAPS   = 0x00000004
700 } DFBInputDeviceLockState;
701 typedef enum
702 {
703    DIKSI_BASE       = 0x00,
704    DIKSI_BASE_SHIFT = 0x01,
705    DIKSI_ALT        = 0x02,
706    DIKSI_ALT_SHIFT  = 0x03,
707    DIKSI_LAST       = DIKSI_ALT_SHIFT
708 } DFBInputDeviceKeymapSymbolIndex;
709 typedef struct
710 {
711    int                         code;
712    DFBInputDeviceLockState     locks;
713    DFBInputDeviceKeyIdentifier identifier;
714    DFBInputDeviceKeySymbol     symbols[DIKSI_LAST + 1];
715 } DFBInputDeviceKeymapEntry;
716 extern const unsigned int directfb_major_version;
717 extern const unsigned int directfb_minor_version;
718 extern const unsigned int directfb_micro_version;
719 extern const unsigned int directfb_binary_age;
720 extern const unsigned int directfb_interface_age;
721 const char *DirectFBCheckVersion(unsigned int required_major,
722                                  unsigned int required_minor,
723                                  unsigned int required_micro);
724 
725 typedef struct _IDirectFB              IDirectFB;
726 typedef struct _IDirectFBScreen        IDirectFBScreen;
727 typedef struct _IDirectFBDisplayLayer  IDirectFBDisplayLayer;
728 typedef struct _IDirectFBSurface       IDirectFBSurface;
729 typedef struct _IDirectFBPalette       IDirectFBPalette;
730 typedef struct _IDirectFBWindow        IDirectFBWindow;
731 typedef struct _IDirectFBInputDevice   IDirectFBInputDevice;
732 typedef struct _IDirectFBEventBuffer   IDirectFBEventBuffer;
733 typedef struct _IDirectFBFont          IDirectFBFont;
734 typedef struct _IDirectFBImageProvider IDirectFBImageProvider;
735 typedef struct _IDirectFBVideoProvider IDirectFBVideoProvider;
736 typedef struct _IDirectFBDataBuffer    IDirectFBDataBuffer;
737 typedef struct _IDirectFBGL            IDirectFBGL;
738 typedef enum
739 {
740    DFB_OK,
741    DFB_FAILURE,
742    DFB_INIT,
743    DFB_BUG,
744    DFB_DEAD,
745    DFB_UNSUPPORTED,
746    DFB_UNIMPLEMENTED,
747    DFB_ACCESSDENIED,
748    DFB_INVARG,
749    DFB_NOSYSTEMMEMORY,
750    DFB_NOVIDEOMEMORY,
751    DFB_LOCKED,
752    DFB_BUFFEREMPTY,
753    DFB_FILENOTFOUND,
754    DFB_IO,
755    DFB_BUSY,
756    DFB_NOIMPL,
757    DFB_MISSINGFONT,
758    DFB_TIMEOUT,
759    DFB_MISSINGIMAGE,
760    DFB_THIZNULL,
761    DFB_IDNOTFOUND,
762    DFB_INVAREA,
763    DFB_DESTROYED,
764    DFB_FUSION,
765    DFB_BUFFERTOOLARGE,
766    DFB_INTERRUPTED,
767    DFB_NOCONTEXT,
768    DFB_TEMPUNAVAIL,
769    DFB_LIMITEXCEEDED,
770    DFB_NOSUCHMETHOD,
771    DFB_NOSUCHINSTANCE,
772    DFB_ITEMNOTFOUND,
773    DFB_VERSIONMISMATCH,
774    DFB_NOSHAREDMEMORY
775 } DFBResult;
776 typedef enum
777 {
778    DFB_FALSE = 0,
779    DFB_TRUE  = !DFB_FALSE
780 } DFBBoolean;
781 typedef struct
782 {
783    int x;
784    int y;
785 } DFBPoint;
786 typedef struct
787 {
788    int x;
789    int w;
790 } DFBSpan;
791 typedef struct
792 {
793    int w;
794    int h;
795 } DFBDimension;
796 typedef struct
797 {
798    int x;
799    int y;
800    int w;
801    int h;
802 } DFBRectangle;
803 typedef struct
804 {
805    float x;
806    float y;
807    float w;
808    float h;
809 } DFBLocation;
810 typedef struct
811 {
812    int x1;
813    int y1;
814    int x2;
815    int y2;
816 } DFBRegion;
817 typedef struct
818 {
819    int l;
820    int t;
821    int r;
822    int b;
823 } DFBInsets;
824 typedef struct
825 {
826    int x1;
827    int y1;
828    int x2;
829    int y2;
830    int x3;
831    int y3;
832 } DFBTriangle;
833 typedef struct
834 {
835    __u8 a;
836    __u8 r;
837    __u8 g;
838    __u8 b;
839 } DFBColor;
840 DFBResult DirectFBError(
841    const char *msg,
842    DFBResult result
843    );
844 DFBResult DirectFBErrorFatal(
845    const char *msg,
846    DFBResult result
847    );
848 const char *DirectFBErrorString(
849    DFBResult result
850    );
851 const char *DirectFBUsageString(void);
852 DFBResult DirectFBInit(
853    int *argc,
854    char **argv[]
855    );
856 DFBResult DirectFBSetOption(
857    const char *name,
858    const char *value
859    );
860 DFBResult DirectFBCreate(
861    IDirectFB **interface
862    );
863 
864 typedef unsigned int DFBScreenID;
865 typedef unsigned int DFBDisplayLayerID;
866 typedef unsigned int DFBDisplayLayerSourceID;
867 typedef unsigned int DFBWindowID;
868 typedef unsigned int DFBInputDeviceID;
869 typedef __u32        DFBDisplayLayerIDs;
870 typedef enum
871 {
872    DFSCL_NORMAL = 0x00000000,
873    DFSCL_FULLSCREEN,
874    DFSCL_EXCLUSIVE
875 } DFBCooperativeLevel;
876 typedef enum
877 {
878    DLCAPS_NONE              = 0x00000000,
879    DLCAPS_SURFACE           = 0x00000001,
880    DLCAPS_OPACITY           = 0x00000002,
881    DLCAPS_ALPHACHANNEL      = 0x00000004,
882    DLCAPS_SCREEN_LOCATION   = 0x00000008,
883    DLCAPS_FLICKER_FILTERING = 0x00000010,
884    DLCAPS_DEINTERLACING     = 0x00000020,
885    DLCAPS_SRC_COLORKEY      = 0x00000040,
886    DLCAPS_DST_COLORKEY      = 0x00000080,
887    DLCAPS_BRIGHTNESS        = 0x00000100,
888    DLCAPS_CONTRAST          = 0x00000200,
889    DLCAPS_HUE               = 0x00000400,
890    DLCAPS_SATURATION        = 0x00000800,
891    DLCAPS_LEVELS            = 0x00001000,
892    DLCAPS_FIELD_PARITY      = 0x00002000,
893    DLCAPS_WINDOWS           = 0x00004000,
894    DLCAPS_SOURCES           = 0x00008000,
895    DLCAPS_ALPHA_RAMP        = 0x00010000,
896    DLCAPS_PREMULTIPLIED     = 0x00020000,
897    DLCAPS_SCREEN_POSITION   = 0x00100000,
898    DLCAPS_SCREEN_SIZE       = 0x00200000,
899    DLCAPS_ALL               = 0x0033FFFF
900 } DFBDisplayLayerCapabilities;
901 typedef enum
902 {
903    DSCCAPS_NONE             = 0x00000000,
904    DSCCAPS_VSYNC            = 0x00000001,
905    DSCCAPS_POWER_MANAGEMENT = 0x00000002,
906    DSCCAPS_MIXERS           = 0x00000010,
907    DSCCAPS_ENCODERS         = 0x00000020,
908    DSCCAPS_OUTPUTS          = 0x00000040,
909    DSCCAPS_ALL              = 0x00000073
910 } DFBScreenCapabilities;
911 typedef enum
912 {
913    DLOP_NONE              = 0x00000000,
914    DLOP_ALPHACHANNEL      = 0x00000001,
915    DLOP_FLICKER_FILTERING = 0x00000002,
916    DLOP_DEINTERLACING     = 0x00000004,
917    DLOP_SRC_COLORKEY      = 0x00000008,
918    DLOP_DST_COLORKEY      = 0x00000010,
919    DLOP_OPACITY           = 0x00000020,
920    DLOP_FIELD_PARITY      = 0x00000040
921 } DFBDisplayLayerOptions;
922 typedef enum
923 {
924    DLBM_UNKNOWN    = 0x00000000,
925    DLBM_FRONTONLY  = 0x00000001,
926    DLBM_BACKVIDEO  = 0x00000002,
927    DLBM_BACKSYSTEM = 0x00000004,
928    DLBM_TRIPLE     = 0x00000008,
929    DLBM_WINDOWS    = 0x00000010
930 } DFBDisplayLayerBufferMode;
931 typedef enum
932 {
933    DSDESC_CAPS         = 0x00000001,
934    DSDESC_WIDTH        = 0x00000002,
935    DSDESC_HEIGHT       = 0x00000004,
936    DSDESC_PIXELFORMAT  = 0x00000008,
937    DSDESC_PREALLOCATED = 0x00000010,
938    DSDESC_PALETTE      = 0x00000020
939 } DFBSurfaceDescriptionFlags;
940 typedef enum
941 {
942    DPDESC_CAPS    = 0x00000001,
943    DPDESC_SIZE    = 0x00000002,
944    DPDESC_ENTRIES = 0x00000004
945 } DFBPaletteDescriptionFlags;
946 typedef enum
947 {
948    DSCAPS_NONE          = 0x00000000,
949    DSCAPS_PRIMARY       = 0x00000001,
950    DSCAPS_SYSTEMONLY    = 0x00000002,
951    DSCAPS_VIDEOONLY     = 0x00000004,
952    DSCAPS_DOUBLE        = 0x00000010,
953    DSCAPS_SUBSURFACE    = 0x00000020,
954    DSCAPS_INTERLACED    = 0x00000040,
955    DSCAPS_SEPARATED     = 0x00000080,
956    DSCAPS_STATIC_ALLOC  = 0x00000100,
957    DSCAPS_TRIPLE        = 0x00000200,
958    DSCAPS_PREMULTIPLIED = 0x00001000,
959    DSCAPS_DEPTH         = 0x00010000,
960    DSCAPS_ALL           = 0x000113F7,
961    DSCAPS_FLIPPING      = DSCAPS_DOUBLE | DSCAPS_TRIPLE
962 } DFBSurfaceCapabilities;
963 typedef enum
964 {
965    DPCAPS_NONE = 0x00000000
966 } DFBPaletteCapabilities;
967 typedef enum
968 {
969    DSDRAW_NOFX            = 0x00000000,
970    DSDRAW_BLEND           = 0x00000001,
971    DSDRAW_DST_COLORKEY    = 0x00000002,
972    DSDRAW_SRC_PREMULTIPLY = 0x00000004,
973    DSDRAW_DST_PREMULTIPLY = 0x00000008,
974    DSDRAW_DEMULTIPLY      = 0x00000010,
975    DSDRAW_XOR             = 0x00000020
976 } DFBSurfaceDrawingFlags;
977 typedef enum
978 {
979    DSBLIT_NOFX               = 0x00000000,
980    DSBLIT_BLEND_ALPHACHANNEL = 0x00000001,
981    DSBLIT_BLEND_COLORALPHA   = 0x00000002,
982    DSBLIT_COLORIZE           = 0x00000004,
983    DSBLIT_SRC_COLORKEY       = 0x00000008,
984    DSBLIT_DST_COLORKEY       = 0x00000010,
985    DSBLIT_SRC_PREMULTIPLY    = 0x00000020,
986    DSBLIT_DST_PREMULTIPLY    = 0x00000040,
987    DSBLIT_DEMULTIPLY         = 0x00000080,
988    DSBLIT_DEINTERLACE        = 0x00000100
989 } DFBSurfaceBlittingFlags;
990 typedef enum
991 {
992    DFXL_NONE          = 0x00000000,
993    DFXL_FILLRECTANGLE = 0x00000001,
994    DFXL_DRAWRECTANGLE = 0x00000002,
995    DFXL_DRAWLINE      = 0x00000004,
996    DFXL_FILLTRIANGLE  = 0x00000008,
997    DFXL_BLIT          = 0x00010000,
998    DFXL_STRETCHBLIT   = 0x00020000,
999    DFXL_TEXTRIANGLES  = 0x00040000,
1000    DFXL_DRAWSTRING    = 0x01000000,
1001    DFXL_ALL           = 0x0107000F
1002 } DFBAccelerationMask;
1003 typedef struct
1004 {
1005    DFBAccelerationMask     acceleration_mask;
1006    DFBSurfaceDrawingFlags  drawing_flags;
1007    DFBSurfaceBlittingFlags blitting_flags;
1008    unsigned int            video_memory;
1009 } DFBCardCapabilities;
1010 typedef enum
1011 {
1012    DLTF_NONE          = 0x00000000,
1013    DLTF_GRAPHICS      = 0x00000001,
1014    DLTF_VIDEO         = 0x00000002,
1015    DLTF_STILL_PICTURE = 0x00000004,
1016    DLTF_BACKGROUND    = 0x00000008,
1017    DLTF_ALL           = 0x0000000F
1018 } DFBDisplayLayerTypeFlags;
1019 typedef enum
1020 {
1021    DIDTF_NONE     = 0x00000000,
1022    DIDTF_KEYBOARD = 0x00000001,
1023    DIDTF_MOUSE    = 0x00000002,
1024    DIDTF_JOYSTICK = 0x00000004,
1025    DIDTF_REMOTE   = 0x00000008,
1026    DIDTF_VIRTUAL  = 0x00000010,
1027    DIDTF_ALL      = 0x0000001F
1028 } DFBInputDeviceTypeFlags;
1029 typedef enum
1030 {
1031    DICAPS_KEYS    = 0x00000001,
1032    DICAPS_AXES    = 0x00000002,
1033    DICAPS_BUTTONS = 0x00000004,
1034    DICAPS_ALL     = 0x00000007
1035 } DFBInputDeviceCapabilities;
1036 typedef enum
1037 {
1038    DIBI_LEFT   = 0x00000000,
1039    DIBI_RIGHT  = 0x00000001,
1040    DIBI_MIDDLE = 0x00000002,
1041    DIBI_FIRST  = DIBI_LEFT,
1042    DIBI_LAST   = 0x0000001F
1043 } DFBInputDeviceButtonIdentifier;
1044 typedef enum
1045 {
1046    DIAI_X     = 0x00000000,
1047    DIAI_Y     = 0x00000001,
1048    DIAI_Z     = 0x00000002,
1049    DIAI_FIRST = DIAI_X,
1050    DIAI_LAST  = 0x0000001F
1051 } DFBInputDeviceAxisIdentifier;
1052 typedef enum
1053 {
1054    DWDESC_CAPS         = 0x00000001,
1055    DWDESC_WIDTH        = 0x00000002,
1056    DWDESC_HEIGHT       = 0x00000004,
1057    DWDESC_PIXELFORMAT  = 0x00000008,
1058    DWDESC_POSX         = 0x00000010,
1059    DWDESC_POSY         = 0x00000020,
1060    DWDESC_SURFACE_CAPS = 0x00000040
1061 } DFBWindowDescriptionFlags;
1062 typedef enum
1063 {
1064    DBDESC_FILE   = 0x00000001,
1065    DBDESC_MEMORY = 0x00000002
1066 } DFBDataBufferDescriptionFlags;
1067 typedef enum
1068 {
1069    DWCAPS_NONE         = 0x00000000,
1070    DWCAPS_ALPHACHANNEL = 0x00000001,
1071    DWCAPS_DOUBLEBUFFER = 0x00000002,
1072    DWCAPS_INPUTONLY    = 0x00000004,
1073    DWCAPS_NODECORATION = 0x00000008,
1074    DWCAPS_ALL          = 0x0000000F
1075 } DFBWindowCapabilities;
1076 typedef enum
1077 {
1078    DFFA_NONE       = 0x00000000,
1079    DFFA_NOKERNING  = 0x00000001,
1080    DFFA_NOHINTING  = 0x00000002,
1081    DFFA_MONOCHROME = 0x00000004,
1082    DFFA_NOCHARMAP  = 0x00000008
1083 } DFBFontAttributes;
1084 typedef enum
1085 {
1086    DFDESC_ATTRIBUTES   = 0x00000001,
1087    DFDESC_HEIGHT       = 0x00000002,
1088    DFDESC_WIDTH        = 0x00000004,
1089    DFDESC_INDEX        = 0x00000008,
1090    DFDESC_FIXEDADVANCE = 0x00000010
1091 } DFBFontDescriptionFlags;
1092 typedef struct
1093 {
1094    DFBFontDescriptionFlags flags;
1095    DFBFontAttributes       attributes;
1096    int                     height;
1097    int                     width;
1098    unsigned int            index;
1099    int                     fixed_advance;
1100 } DFBFontDescription;
1101 typedef enum
1102 {
1103    DSPF_UNKNOWN  = 0x00000000,
1104    DSPF_ARGB1555 = ((((0) & 0x7F)) | (((15) & 0x1F) << 7) | (((1) & 0x0F) << 12) | (((1) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((2) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1105    DSPF_RGB16    = ((((1) & 0x7F)) | (((16) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((2) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1106    DSPF_RGB24    = ((((2) & 0x7F)) | (((24) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((3) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1107    DSPF_RGB32    = ((((3) & 0x7F)) | (((24) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((4) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1108    DSPF_ARGB     = ((((4) & 0x7F)) | (((24) & 0x1F) << 7) | (((8) & 0x0F) << 12) | (((1) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((4) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1109    DSPF_A8       = ((((5) & 0x7F)) | (((0) & 0x1F) << 7) | (((8) & 0x0F) << 12) | (((1) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((1) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1110    DSPF_YUY2     = ((((6) & 0x7F)) | (((16) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((2) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1111    DSPF_RGB332   = ((((7) & 0x7F)) | (((8) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((1) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1112    DSPF_UYVY     = ((((8) & 0x7F)) | (((16) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((2) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1113    DSPF_I420     = ((((9) & 0x7F)) | (((12) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((1) & 0x07) << 20) | (((0) & 0x07) << 23) | (((2) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1114    DSPF_YV12     = ((((10) & 0x7F)) | (((12) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((1) & 0x07) << 20) | (((0) & 0x07) << 23) | (((2) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1115    DSPF_LUT8     = ((((11) & 0x7F)) | (((8) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((1) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((1) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((1) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1116    DSPF_ALUT44   = ((((12) & 0x7F)) | (((4) & 0x1F) << 7) | (((4) & 0x0F) << 12) | (((1) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((1) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((1) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1117    DSPF_AiRGB    = ((((13) & 0x7F)) | (((24) & 0x1F) << 7) | (((8) & 0x0F) << 12) | (((1) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((4) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((1) ? 1 : 0) << 31)),
1118    DSPF_A1       = ((((14) & 0x7F)) | (((0) & 0x1F) << 7) | (((1) & 0x0F) << 12) | (((1) ? 1 : 0) << 16) | (((1) & 0x07) << 17) | (((0) & 0x07) << 20) | (((7) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1119    DSPF_NV12     = ((((15) & 0x7F)) | (((12) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((1) & 0x07) << 20) | (((0) & 0x07) << 23) | (((2) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1120    DSPF_NV16     = ((((16) & 0x7F)) | (((24) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((1) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((2) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1121    DSPF_ARGB2554 = ((((17) & 0x7F)) | (((14) & 0x1F) << 7) | (((2) & 0x0F) << 12) | (((1) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((2) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1122    DSPF_ARGB4444 = ((((18) & 0x7F)) | (((12) & 0x1F) << 7) | (((4) & 0x0F) << 12) | (((1) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((2) & 0x07) << 20) | (((0) & 0x07) << 23) | (((0) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31)),
1123    DSPF_NV21     = ((((19) & 0x7F)) | (((12) & 0x1F) << 7) | (((0) & 0x0F) << 12) | (((0) ? 1 : 0) << 16) | (((0) & 0x07) << 17) | (((1) & 0x07) << 20) | (((0) & 0x07) << 23) | (((2) & 0x03) << 26) | (((0) & 0x03) << 28) | (((0) ? 1 : 0) << 30) | (((0) ? 1 : 0) << 31))
1124 } DFBSurfacePixelFormat;
1125 typedef struct
1126 {
1127    DFBSurfaceDescriptionFlags flags;
1128    DFBSurfaceCapabilities     caps;
1129    int                        width;
1130    int                        height;
1131    DFBSurfacePixelFormat      pixelformat;
1132    struct
1133    {
1134       void *data;
1135       int  pitch;
1136    }                          preallocated[2];
1137    struct
1138    {
1139       DFBColor     *entries;
1140       unsigned int size;
1141    }                          palette;
1142 } DFBSurfaceDescription;
1143 typedef struct
1144 {
1145    DFBPaletteDescriptionFlags flags;
1146    DFBPaletteCapabilities     caps;
1147    unsigned int               size;
1148    DFBColor                   *entries;
1149 } DFBPaletteDescription;
1150 typedef struct
1151 {
1152    DFBDisplayLayerTypeFlags    type;
1153    DFBDisplayLayerCapabilities caps;
1154    char                        name[32];
1155    int                         level;
1156    int                         regions;
1157    int                         sources;
1158 } DFBDisplayLayerDescription;
1159 typedef struct
1160 {
1161    DFBDisplayLayerSourceID source_id;
1162    char                    name[24];
1163 } DFBDisplayLayerSourceDescription;
1164 typedef struct
1165 {
1166    DFBScreenCapabilities caps;
1167    char                  name[32];
1168    int                   mixers;
1169    int                   encoders;
1170    int                   outputs;
1171 } DFBScreenDescription;
1172 typedef struct
1173 {
1174    DFBInputDeviceTypeFlags        type;
1175    DFBInputDeviceCapabilities     caps;
1176    int                            min_keycode;
1177    int                            max_keycode;
1178    DFBInputDeviceAxisIdentifier   max_axis;
1179    DFBInputDeviceButtonIdentifier max_button;
1180    char                           name[32];
1181    char                           vendor[40];
1182 } DFBInputDeviceDescription;
1183 typedef struct
1184 {
1185    DFBWindowDescriptionFlags flags;
1186    DFBWindowCapabilities     caps;
1187    int                       width;
1188    int                       height;
1189    DFBSurfacePixelFormat     pixelformat;
1190    int                       posx;
1191    int                       posy;
1192    DFBSurfaceCapabilities    surface_caps;
1193 } DFBWindowDescription;
1194 typedef struct
1195 {
1196    DFBDataBufferDescriptionFlags flags;
1197    const char                    *file;
1198    struct
1199    {
1200       const void   *data;
1201       unsigned int length;
1202    }                             memory;
1203 } DFBDataBufferDescription;
1204 typedef enum
1205 {
1206    DFENUM_OK     = 0x00000000,
1207    DFENUM_CANCEL = 0x00000001
1208 } DFBEnumerationResult;
1209 typedef DFBEnumerationResult (*DFBVideoModeCallback)(
1210    int width,
1211    int height,
1212    int bpp,
1213    void *callbackdata
1214    );
1215 typedef DFBEnumerationResult (*DFBScreenCallback)(
1216    DFBScreenID screen_id,
1217    DFBScreenDescription desc,
1218    void *callbackdata
1219    );
1220 typedef DFBEnumerationResult (*DFBDisplayLayerCallback)(
1221    DFBDisplayLayerID layer_id,
1222    DFBDisplayLayerDescription desc,
1223    void *callbackdata
1224    );
1225 typedef DFBEnumerationResult (*DFBInputDeviceCallback)(
1226    DFBInputDeviceID device_id,
1227    DFBInputDeviceDescription desc,
1228    void *callbackdata
1229    );
1230 typedef int (*DFBGetDataCallback)(
1231    void *buffer,
1232    unsigned int length,
1233    void *callbackdata
1234    );
1235 typedef enum
1236 {
1237    DVCAPS_BASIC      = 0x00000000,
1238    DVCAPS_SEEK       = 0x00000001,
1239    DVCAPS_SCALE      = 0x00000002,
1240    DVCAPS_INTERLACED = 0x00000004,
1241    DVCAPS_BRIGHTNESS = 0x00000010,
1242    DVCAPS_CONTRAST   = 0x00000020,
1243    DVCAPS_HUE        = 0x00000040,
1244    DVCAPS_SATURATION = 0x00000080
1245 } DFBVideoProviderCapabilities;
1246 typedef enum
1247 {
1248    DCAF_NONE       = 0x00000000,
1249    DCAF_BRIGHTNESS = 0x00000001,
1250    DCAF_CONTRAST   = 0x00000002,
1251    DCAF_HUE        = 0x00000004,
1252    DCAF_SATURATION = 0x00000008
1253 } DFBColorAdjustmentFlags;
1254 typedef struct
1255 {
1256    DFBColorAdjustmentFlags flags;
1257    __u16                   brightness;
1258    __u16                   contrast;
1259    __u16                   hue;
1260    __u16                   saturation;
1261 } DFBColorAdjustment;
1262 struct _IDirectFB
1263 {
1264    void      *priv;
1265    int       magic;
1266    DFBResult (*AddRef)(IDirectFB *thiz);
1267    DFBResult (*Release)(IDirectFB *thiz);
1268    DFBResult (*SetCooperativeLevel)(IDirectFB *thiz, DFBCooperativeLevel level);
1269    DFBResult (*SetVideoMode)(IDirectFB *thiz, int width, int height, int bpp);
1270    DFBResult (*GetCardCapabilities)(IDirectFB *thiz, DFBCardCapabilities *ret_caps);
1271    DFBResult (*EnumVideoModes)(IDirectFB *thiz, DFBVideoModeCallback callback, void *callbackdata);
1272    DFBResult (*CreateSurface)(IDirectFB *thiz, const DFBSurfaceDescription *desc, IDirectFBSurface **ret_interface);
1273    DFBResult (*CreatePalette)(IDirectFB *thiz, const DFBPaletteDescription *desc, IDirectFBPalette **ret_interface);
1274    DFBResult (*EnumScreens)(IDirectFB *thiz, DFBScreenCallback callback, void *callbackdata);
1275    DFBResult (*GetScreen)(IDirectFB *thiz, DFBScreenID screen_id, IDirectFBScreen **ret_interface);
1276    DFBResult (*EnumDisplayLayers)(IDirectFB *thiz, DFBDisplayLayerCallback callback, void *callbackdata);
1277    DFBResult (*GetDisplayLayer)(IDirectFB *thiz, DFBDisplayLayerID layer_id, IDirectFBDisplayLayer **ret_interface);
1278    DFBResult (*EnumInputDevices)(IDirectFB *thiz, DFBInputDeviceCallback callback, void *callbackdata);
1279    DFBResult (*GetInputDevice)(IDirectFB *thiz, DFBInputDeviceID device_id, IDirectFBInputDevice **ret_interface);
1280    DFBResult (*CreateEventBuffer)(IDirectFB *thiz, IDirectFBEventBuffer **ret_buffer);
1281    DFBResult (*CreateInputEventBuffer)(IDirectFB *thiz, DFBInputDeviceCapabilities caps, DFBBoolean global, IDirectFBEventBuffer **ret_buffer);
1282    DFBResult (*CreateImageProvider)(IDirectFB *thiz, const char *filename, IDirectFBImageProvider **ret_interface);
1283    DFBResult (*CreateVideoProvider)(IDirectFB *thiz, const char *filename, IDirectFBVideoProvider **ret_interface);
1284    DFBResult (*CreateFont)(IDirectFB *thiz, const char *filename, const DFBFontDescription *desc, IDirectFBFont **ret_interface);
1285    DFBResult (*CreateDataBuffer)(IDirectFB *thiz, const DFBDataBufferDescription *desc, IDirectFBDataBuffer **ret_interface);
1286    DFBResult (*SetClipboardData)(IDirectFB *thiz, const char *mime_type, const void *data, unsigned int size, struct timeval *ret_timestamp);
1287    DFBResult (*GetClipboardData)(IDirectFB *thiz, char **ret_mimetype, void **ret_data, unsigned int *ret_size);
1288    DFBResult (*GetClipboardTimeStamp)(IDirectFB *thiz, struct timeval *ret_timestamp);
1289    DFBResult (*Suspend)(IDirectFB *thiz);
1290    DFBResult (*Resume)(IDirectFB *thiz);
1291    DFBResult (*WaitIdle)(IDirectFB *thiz);
1292    DFBResult (*WaitForSync)(IDirectFB *thiz);
1293    DFBResult (*GetInterface)(IDirectFB *thiz, const char *type, const char *implementation, void *arg, void **ret_interface);
1294 };
1295 typedef enum
1296 {
1297    DLSCL_SHARED = 0,
1298    DLSCL_EXCLUSIVE,
1299    DLSCL_ADMINISTRATIVE
1300 } DFBDisplayLayerCooperativeLevel;
1301 typedef enum
1302 {
1303    DLBM_DONTCARE = 0,
1304    DLBM_COLOR,
1305    DLBM_IMAGE,
1306    DLBM_TILE
1307 } DFBDisplayLayerBackgroundMode;
1308 typedef enum
1309 {
1310    DLCONF_NONE         = 0x00000000,
1311    DLCONF_WIDTH        = 0x00000001,
1312    DLCONF_HEIGHT       = 0x00000002,
1313    DLCONF_PIXELFORMAT  = 0x00000004,
1314    DLCONF_BUFFERMODE   = 0x00000008,
1315    DLCONF_OPTIONS      = 0x00000010,
1316    DLCONF_SOURCE       = 0x00000020,
1317    DLCONF_SURFACE_CAPS = 0x00000040,
1318    DLCONF_ALL          = 0x0000007F
1319 } DFBDisplayLayerConfigFlags;
1320 typedef struct
1321 {
1322    DFBDisplayLayerConfigFlags flags;
1323    int                        width;
1324    int                        height;
1325    DFBSurfacePixelFormat      pixelformat;
1326    DFBDisplayLayerBufferMode  buffermode;
1327    DFBDisplayLayerOptions     options;
1328    DFBDisplayLayerSourceID    source;
1329    DFBSurfaceCapabilities     surface_caps;
1330 } DFBDisplayLayerConfig;
1331 typedef enum
1332 {
1333    DSPM_ON = 0,
1334    DSPM_STANDBY,
1335    DSPM_SUSPEND,
1336    DSPM_OFF
1337 } DFBScreenPowerMode;
1338 typedef enum
1339 {
1340    DSMCAPS_NONE       = 0x00000000,
1341    DSMCAPS_FULL       = 0x00000001,
1342    DSMCAPS_SUB_LEVEL  = 0x00000002,
1343    DSMCAPS_SUB_LAYERS = 0x00000004,
1344    DSMCAPS_BACKGROUND = 0x00000008
1345 } DFBScreenMixerCapabilities;
1346 typedef struct
1347 {
1348    DFBScreenMixerCapabilities caps;
1349    DFBDisplayLayerIDs         layers;
1350    int                        sub_num;
1351    DFBDisplayLayerIDs         sub_layers;
1352    char                       name[24];
1353 } DFBScreenMixerDescription;
1354 typedef enum
1355 {
1356    DSMCONF_NONE       = 0x00000000,
1357    DSMCONF_TREE       = 0x00000001,
1358    DSMCONF_LEVEL      = 0x00000002,
1359    DSMCONF_LAYERS     = 0x00000004,
1360    DSMCONF_BACKGROUND = 0x00000010,
1361    DSMCONF_ALL        = 0x00000017
1362 } DFBScreenMixerConfigFlags;
1363 typedef enum
1364 {
1365    DSMT_UNKNOWN    = 0x00000000,
1366    DSMT_FULL       = 0x00000001,
1367    DSMT_SUB_LEVEL  = 0x00000002,
1368    DSMT_SUB_LAYERS = 0x00000003
1369 } DFBScreenMixerTree;
1370 typedef struct
1371 {
1372    DFBScreenMixerConfigFlags flags;
1373    DFBScreenMixerTree        tree;
1374    int                       level;
1375    DFBDisplayLayerIDs        layers;
1376    DFBColor                  background;
1377 } DFBScreenMixerConfig;
1378 typedef enum
1379 {
1380    DSOCAPS_NONE          = 0x00000000,
1381    DSOCAPS_CONNECTORS    = 0x00000001,
1382    DSOCAPS_ENCODER_SEL   = 0x00000010,
1383    DSOCAPS_SIGNAL_SEL    = 0x00000020,
1384    DSOCAPS_CONNECTOR_SEL = 0x00000040,
1385    DSOCAPS_ALL           = 0x00000071
1386 } DFBScreenOutputCapabilities;
1387 typedef enum
1388 {
1389    DSOC_UNKNOWN = 0x00000000,
1390    DSOC_VGA     = 0x00000001,
1391    DSOC_SCART   = 0x00000002,
1392    DSOC_YC      = 0x00000004,
1393    DSOC_CVBS    = 0x00000008
1394 } DFBScreenOutputConnectors;
1395 typedef enum
1396 {
1397    DSOS_NONE  = 0x00000000,
1398    DSOS_VGA   = 0x00000001,
1399    DSOS_YC    = 0x00000002,
1400    DSOS_CVBS  = 0x00000004,
1401    DSOS_RGB   = 0x00000008,
1402    DSOS_YCBCR = 0x00000010
1403 } DFBScreenOutputSignals;
1404 typedef struct
1405 {
1406    DFBScreenOutputCapabilities caps;
1407    DFBScreenOutputConnectors   all_connectors;
1408    DFBScreenOutputSignals      all_signals;
1409    char                        name[24];
1410 } DFBScreenOutputDescription;
1411 typedef enum
1412 {
1413    DSOCONF_NONE       = 0x00000000,
1414    DSOCONF_ENCODER    = 0x00000001,
1415    DSOCONF_SIGNALS    = 0x00000002,
1416    DSOCONF_CONNECTORS = 0x00000004,
1417    DSOCONF_ALL        = 0x00000007
1418 } DFBScreenOutputConfigFlags;
1419 typedef struct
1420 {
1421    DFBScreenOutputConfigFlags flags;
1422    int                        encoder;
1423    DFBScreenOutputSignals     out_signals;
1424    DFBScreenOutputConnectors  out_connectors;
1425 } DFBScreenOutputConfig;
1426 typedef enum
1427 {
1428    DSECAPS_NONE         = 0x00000000,
1429    DSECAPS_TV_STANDARDS = 0x00000001,
1430    DSECAPS_TEST_PICTURE = 0x00000002,
1431    DSECAPS_MIXER_SEL    = 0x00000004,
1432    DSECAPS_OUT_SIGNALS  = 0x00000008,
1433    DSECAPS_SCANMODE     = 0x00000010,
1434    DSECAPS_BRIGHTNESS   = 0x00000100,
1435    DSECAPS_CONTRAST     = 0x00000200,
1436    DSECAPS_HUE          = 0x00000400,
1437    DSECAPS_SATURATION   = 0x00000800,
1438    DSECAPS_ALL          = 0x00000f1f
1439 } DFBScreenEncoderCapabilities;
1440 typedef enum
1441 {
1442    DSET_UNKNOWN = 0x00000000,
1443    DSET_CRTC    = 0x00000001,
1444    DSET_TV      = 0x00000002
1445 } DFBScreenEncoderType;
1446 typedef enum
1447 {
1448    DSETV_UNKNOWN = 0x00000000,
1449    DSETV_PAL     = 0x00000001,
1450    DSETV_NTSC    = 0x00000002,
1451    DSETV_SECAM   = 0x00000004
1452 } DFBScreenEncoderTVStandards;
1453 typedef enum
1454 {
1455    DSESM_UNKNOWN     = 0x00000000,
1456    DSESM_INTERLACED  = 0x00000001,
1457    DSESM_PROGRESSIVE = 0x00000002
1458 } DFBScreenEncoderScanMode;
1459 typedef struct
1460 {
1461    DFBScreenEncoderCapabilities caps;
1462    DFBScreenEncoderType         type;
1463    DFBScreenEncoderTVStandards  tv_standards;
1464    DFBScreenOutputSignals       out_signals;
1465    char                         name[24];
1466 } DFBScreenEncoderDescription;
1467 typedef enum
1468 {
1469    DSECONF_NONE         = 0x00000000,
1470    DSECONF_TV_STANDARD  = 0x00000001,
1471    DSECONF_TEST_PICTURE = 0x00000002,
1472    DSECONF_MIXER        = 0x00000004,
1473    DSECONF_OUT_SIGNALS  = 0x00000008,
1474    DSECONF_SCANMODE     = 0x00000010,
1475    DSECONF_TEST_COLOR   = 0x00000020,
1476    DSECONF_ADJUSTMENT   = 0x00000040,
1477    DSECONF_ALL          = 0x0000007F
1478 } DFBScreenEncoderConfigFlags;
1479 typedef enum
1480 {
1481    DSETP_OFF     = 0x00000000,
1482    DSETP_MULTI   = 0x00000001,
1483    DSETP_SINGLE  = 0x00000002,
1484    DSETP_WHITE   = 0x00000010,
1485    DSETP_YELLOW  = 0x00000020,
1486    DSETP_CYAN    = 0x00000030,
1487    DSETP_GREEN   = 0x00000040,
1488    DSETP_MAGENTA = 0x00000050,
1489    DSETP_RED     = 0x00000060,
1490    DSETP_BLUE    = 0x00000070,
1491    DSETP_BLACK   = 0x00000080
1492 } DFBScreenEncoderTestPicture;
1493 typedef struct
1494 {
1495    DFBScreenEncoderConfigFlags flags;
1496    DFBScreenEncoderTVStandards tv_standard;
1497    DFBScreenEncoderTestPicture test_picture;
1498    int                         mixer;
1499    DFBScreenOutputSignals      out_signals;
1500    DFBScreenEncoderScanMode    scanmode;
1501    DFBColor                    test_color;
1502    DFBColorAdjustment          adjustment;
1503 } DFBScreenEncoderConfig;
1504 struct _IDirectFBScreen
1505 {
1506    void      *priv;
1507    int       magic;
1508    DFBResult (*AddRef)(IDirectFBScreen *thiz);
1509    DFBResult (*Release)(IDirectFBScreen *thiz);
1510    DFBResult (*GetID)(IDirectFBScreen *thiz, DFBScreenID *ret_screen_id);
1511    DFBResult (*GetDescription)(IDirectFBScreen *thiz, DFBScreenDescription *ret_desc);
1512    DFBResult (*EnumDisplayLayers)(IDirectFBScreen *thiz, DFBDisplayLayerCallback callback, void *callbackdata);
1513    DFBResult (*SetPowerMode)(IDirectFBScreen *thiz, DFBScreenPowerMode mode);
1514    DFBResult (*WaitForSync)(IDirectFBScreen *thiz);
1515    DFBResult (*GetMixerDescriptions)(IDirectFBScreen *thiz, DFBScreenMixerDescription *ret_descriptions);
1516    DFBResult (*GetMixerConfiguration)(IDirectFBScreen *thiz, int mixer, DFBScreenMixerConfig *ret_config);
1517    DFBResult (*TestMixerConfiguration)(IDirectFBScreen *thiz, int mixer, const DFBScreenMixerConfig *config, DFBScreenMixerConfigFlags *ret_failed);
1518    DFBResult (*SetMixerConfiguration)(IDirectFBScreen *thiz, int mixer, const DFBScreenMixerConfig *config);
1519    DFBResult (*GetEncoderDescriptions)(IDirectFBScreen *thiz, DFBScreenEncoderDescription *ret_descriptions);
1520    DFBResult (*GetEncoderConfiguration)(IDirectFBScreen *thiz, int encoder, DFBScreenEncoderConfig *ret_config);
1521    DFBResult (*TestEncoderConfiguration)(IDirectFBScreen *thiz, int encoder, const DFBScreenEncoderConfig *config, DFBScreenEncoderConfigFlags *ret_failed);
1522    DFBResult (*SetEncoderConfiguration)(IDirectFBScreen *thiz, int encoder, const DFBScreenEncoderConfig *config);
1523    DFBResult (*GetOutputDescriptions)(IDirectFBScreen *thiz, DFBScreenOutputDescription *ret_descriptions);
1524    DFBResult (*GetOutputConfiguration)(IDirectFBScreen *thiz, int output, DFBScreenOutputConfig *ret_config);
1525    DFBResult (*TestOutputConfiguration)(IDirectFBScreen *thiz, int output, const DFBScreenOutputConfig *config, DFBScreenOutputConfigFlags *ret_failed);
1526    DFBResult (*SetOutputConfiguration)(IDirectFBScreen *thiz, int output, const DFBScreenOutputConfig *config);
1527 };
1528 struct _IDirectFBDisplayLayer
1529 {
1530    void      *priv;
1531    int       magic;
1532    DFBResult (*AddRef)(IDirectFBDisplayLayer *thiz);
1533    DFBResult (*Release)(IDirectFBDisplayLayer *thiz);
1534    DFBResult (*GetID)(IDirectFBDisplayLayer *thiz, DFBDisplayLayerID *ret_layer_id);
1535    DFBResult (*GetDescription)(IDirectFBDisplayLayer *thiz, DFBDisplayLayerDescription *ret_desc);
1536    DFBResult (*GetSourceDescriptions)(IDirectFBDisplayLayer *thiz, DFBDisplayLayerSourceDescription *ret_descriptions);
1537    DFBResult (*GetCurrentOutputField)(IDirectFBDisplayLayer *thiz, int *ret_field);
1538    DFBResult (*GetSurface)(IDirectFBDisplayLayer *thiz, IDirectFBSurface **ret_interface);
1539    DFBResult (*GetScreen)(IDirectFBDisplayLayer *thiz, IDirectFBScreen **ret_interface);
1540    DFBResult (*SetCooperativeLevel)(IDirectFBDisplayLayer *thiz, DFBDisplayLayerCooperativeLevel level);
1541    DFBResult (*GetConfiguration)(IDirectFBDisplayLayer *thiz, DFBDisplayLayerConfig *ret_config);
1542    DFBResult (*TestConfiguration)(IDirectFBDisplayLayer *thiz, const DFBDisplayLayerConfig *config, DFBDisplayLayerConfigFlags *ret_failed);
1543    DFBResult (*SetConfiguration)(IDirectFBDisplayLayer *thiz, const DFBDisplayLayerConfig *config);
1544    DFBResult (*SetScreenLocation)(IDirectFBDisplayLayer *thiz, float x, float y, float width, float height);
1545    DFBResult (*SetScreenPosition)(IDirectFBDisplayLayer *thiz, int x, int y);
1546    DFBResult (*SetScreenRectangle)(IDirectFBDisplayLayer *thiz, int x, int y, int width, int height);
1547    DFBResult (*SetOpacity)(IDirectFBDisplayLayer *thiz, __u8 opacity);
1548    DFBResult (*SetSourceRectangle)(IDirectFBDisplayLayer *thiz, int x, int y, int width, int height);
1549    DFBResult (*SetFieldParity)(IDirectFBDisplayLayer *thiz, int field);
1550    DFBResult (*SetSrcColorKey)(IDirectFBDisplayLayer *thiz, __u8 r, __u8 g, __u8 b);
1551    DFBResult (*SetDstColorKey)(IDirectFBDisplayLayer *thiz, __u8 r, __u8 g, __u8 b);
1552    DFBResult (*GetLevel)(IDirectFBDisplayLayer *thiz, int *ret_level);
1553    DFBResult (*SetLevel)(IDirectFBDisplayLayer *thiz, int level);
1554    DFBResult (*SetBackgroundMode)(IDirectFBDisplayLayer *thiz, DFBDisplayLayerBackgroundMode mode);
1555    DFBResult (*SetBackgroundImage)(IDirectFBDisplayLayer *thiz, IDirectFBSurface *surface);
1556    DFBResult (*SetBackgroundColor)(IDirectFBDisplayLayer *thiz, __u8 r, __u8 g, __u8 b, __u8 a);
1557    DFBResult (*GetColorAdjustment)(IDirectFBDisplayLayer *thiz, DFBColorAdjustment *ret_adj);
1558    DFBResult (*SetColorAdjustment)(IDirectFBDisplayLayer *thiz, const DFBColorAdjustment *adj);
1559    DFBResult (*CreateWindow)(IDirectFBDisplayLayer *thiz, const DFBWindowDescription *desc, IDirectFBWindow **ret_interface);
1560    DFBResult (*GetWindow)(IDirectFBDisplayLayer *thiz, DFBWindowID window_id, IDirectFBWindow **ret_interface);
1561    DFBResult (*EnableCursor)(IDirectFBDisplayLayer *thiz, int enable);
1562    DFBResult (*GetCursorPosition)(IDirectFBDisplayLayer *thiz, int *ret_x, int *ret_y);
1563    DFBResult (*WarpCursor)(IDirectFBDisplayLayer *thiz, int x, int y);
1564    DFBResult (*SetCursorAcceleration)(IDirectFBDisplayLayer *thiz, int numerator, int denominator, int threshold);
1565    DFBResult (*SetCursorShape)(IDirectFBDisplayLayer *thiz, IDirectFBSurface *shape, int hot_x, int hot_y);
1566    DFBResult (*SetCursorOpacity)(IDirectFBDisplayLayer *thiz, __u8 opacity);
1567    DFBResult (*WaitForSync)(IDirectFBDisplayLayer *thiz);
1568 };
1569 typedef enum
1570 {
1571    DSFLIP_NONE        = 0x00000000,
1572    DSFLIP_WAIT        = 0x00000001,
1573    DSFLIP_BLIT        = 0x00000002,
1574    DSFLIP_ONSYNC      = 0x00000004,
1575    DSFLIP_PIPELINE    = 0x00000008,
1576    DSFLIP_WAITFORSYNC = DSFLIP_WAIT | DSFLIP_ONSYNC
1577 } DFBSurfaceFlipFlags;
1578 typedef enum
1579 {
1580    DSTF_LEFT         = 0x00000000,
1581    DSTF_CENTER       = 0x00000001,
1582    DSTF_RIGHT        = 0x00000002,
1583    DSTF_TOP          = 0x00000004,
1584    DSTF_BOTTOM       = 0x00000008,
1585    DSTF_TOPLEFT      = DSTF_TOP | DSTF_LEFT,
1586    DSTF_TOPCENTER    = DSTF_TOP | DSTF_CENTER,
1587    DSTF_TOPRIGHT     = DSTF_TOP | DSTF_RIGHT,
1588    DSTF_BOTTOMLEFT   = DSTF_BOTTOM | DSTF_LEFT,
1589    DSTF_BOTTOMCENTER = DSTF_BOTTOM | DSTF_CENTER,
1590    DSTF_BOTTOMRIGHT  = DSTF_BOTTOM | DSTF_RIGHT
1591 } DFBSurfaceTextFlags;
1592 typedef enum
1593 {
1594    DSLF_READ  = 0x00000001,
1595    DSLF_WRITE = 0x00000002
1596 } DFBSurfaceLockFlags;
1597 typedef enum
1598 {
1599    DSPD_NONE     = 0,
1600    DSPD_CLEAR    = 1,
1601    DSPD_SRC      = 2,
1602    DSPD_SRC_OVER = 3,
1603    DSPD_DST_OVER = 4,
1604    DSPD_SRC_IN   = 5,
1605    DSPD_DST_IN   = 6,
1606    DSPD_SRC_OUT  = 7,
1607    DSPD_DST_OUT  = 8
1608 } DFBSurfacePorterDuffRule;
1609 typedef enum
1610 {
1611    DSBF_ZERO         = 1,
1612    DSBF_ONE          = 2,
1613    DSBF_SRCCOLOR     = 3,
1614    DSBF_INVSRCCOLOR  = 4,
1615    DSBF_SRCALPHA     = 5,
1616    DSBF_INVSRCALPHA  = 6,
1617    DSBF_DESTALPHA    = 7,
1618    DSBF_INVDESTALPHA = 8,
1619    DSBF_DESTCOLOR    = 9,
1620    DSBF_INVDESTCOLOR = 10,
1621    DSBF_SRCALPHASAT  = 11
1622 } DFBSurfaceBlendFunction;
1623 typedef struct
1624 {
1625    float x;
1626    float y;
1627    float z;
1628    float w;
1629    float s;
1630    float t;
1631 } DFBVertex;
1632 typedef enum
1633 {
1634    DTTF_LIST,
1635    DTTF_STRIP,
1636    DTTF_FAN
1637 } DFBTriangleFormation;
1638 struct _IDirectFBSurface
1639 {
1640    void      *priv;
1641    int       magic;
1642    DFBResult (*AddRef)(IDirectFBSurface *thiz);
1643    DFBResult (*Release)(IDirectFBSurface *thiz);
1644    DFBResult (*GetCapabilities)(IDirectFBSurface *thiz, DFBSurfaceCapabilities *ret_caps);
1645    DFBResult (*GetSize)(IDirectFBSurface *thiz, int *ret_width, int *ret_height);
1646    DFBResult (*GetVisibleRectangle)(IDirectFBSurface *thiz, DFBRectangle *ret_rect);
1647    DFBResult (*GetPixelFormat)(IDirectFBSurface *thiz, DFBSurfacePixelFormat *ret_format);
1648    DFBResult (*GetAccelerationMask)(IDirectFBSurface *thiz, IDirectFBSurface *source, DFBAccelerationMask *ret_mask);
1649    DFBResult (*GetPalette)(IDirectFBSurface *thiz, IDirectFBPalette **ret_interface);
1650    DFBResult (*SetPalette)(IDirectFBSurface *thiz, IDirectFBPalette *palette);
1651    DFBResult (*SetAlphaRamp)(IDirectFBSurface *thiz, __u8 a0, __u8 a1, __u8 a2, __u8 a3);
1652    DFBResult (*Lock)(IDirectFBSurface *thiz, DFBSurfaceLockFlags flags, void **ret_ptr, int *ret_pitch);
1653    DFBResult (*Unlock)(IDirectFBSurface *thiz);
1654    DFBResult (*Flip)(IDirectFBSurface *thiz, const DFBRegion *region, DFBSurfaceFlipFlags flags);
1655    DFBResult (*SetField)(IDirectFBSurface *thiz, int field);
1656    DFBResult (*Clear)(IDirectFBSurface *thiz, __u8 r, __u8 g, __u8 b, __u8 a);
1657    DFBResult (*SetClip)(IDirectFBSurface *thiz, const DFBRegion *clip);
1658    DFBResult (*SetColor)(IDirectFBSurface *thiz, __u8 r, __u8 g, __u8 b, __u8 a);
1659    DFBResult (*SetColorIndex)(IDirectFBSurface *thiz, unsigned int index);
1660    DFBResult (*SetSrcBlendFunction)(IDirectFBSurface *thiz, DFBSurfaceBlendFunction function);
1661    DFBResult (*SetDstBlendFunction)(IDirectFBSurface *thiz, DFBSurfaceBlendFunction function);
1662    DFBResult (*SetPorterDuff)(IDirectFBSurface *thiz, DFBSurfacePorterDuffRule rule);
1663    DFBResult (*SetSrcColorKey)(IDirectFBSurface *thiz, __u8 r, __u8 g, __u8 b);
1664    DFBResult (*SetSrcColorKeyIndex)(IDirectFBSurface *thiz, unsigned int index);
1665    DFBResult (*SetDstColorKey)(IDirectFBSurface *thiz, __u8 r, __u8 g, __u8 b);
1666    DFBResult (*SetDstColorKeyIndex)(IDirectFBSurface *thiz, unsigned int index);
1667    DFBResult (*SetBlittingFlags)(IDirectFBSurface *thiz, DFBSurfaceBlittingFlags flags);
1668    DFBResult (*Blit)(IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rect, int x, int y);
1669    DFBResult (*TileBlit)(IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rect, int x, int y);
1670    DFBResult (*BatchBlit)(IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rects, const DFBPoint *dest_points, int num);
1671    DFBResult (*StretchBlit)(IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rect, const DFBRectangle *destination_rect);
1672    DFBResult (*TextureTriangles)(IDirectFBSurface *thiz, IDirectFBSurface *texture, const DFBVertex *vertices, const int *indices, int num, DFBTriangleFormation formation);
1673    DFBResult (*SetDrawingFlags)(IDirectFBSurface *thiz, DFBSurfaceDrawingFlags flags);
1674    DFBResult (*FillRectangle)(IDirectFBSurface *thiz, int x, int y, int w, int h);
1675    DFBResult (*DrawRectangle)(IDirectFBSurface *thiz, int x, int y, int w, int h);
1676    DFBResult (*DrawLine)(IDirectFBSurface *thiz, int x1, int y1, int x2, int y2);
1677    DFBResult (*DrawLines)(IDirectFBSurface *thiz, const DFBRegion *lines, unsigned int num_lines);
1678    DFBResult (*FillTriangle)(IDirectFBSurface *thiz, int x1, int y1, int x2, int y2, int x3, int y3);
1679    DFBResult (*FillRectangles)(IDirectFBSurface *thiz, const DFBRectangle *rects, unsigned int num);
1680    DFBResult (*FillSpans)(IDirectFBSurface *thiz, int y, const DFBSpan *spans, unsigned int num);
1681    DFBResult (*SetFont)(IDirectFBSurface *thiz, IDirectFBFont *font);
1682    DFBResult (*GetFont)(IDirectFBSurface *thiz, IDirectFBFont **ret_font);
1683    DFBResult (*DrawString)(IDirectFBSurface *thiz, const char *text, int bytes, int x, int y, DFBSurfaceTextFlags flags);
1684    DFBResult (*DrawGlyph)(IDirectFBSurface *thiz, unsigned int index, int x, int y, DFBSurfaceTextFlags flags);
1685    DFBResult (*GetSubSurface)(IDirectFBSurface *thiz, const DFBRectangle *rect, IDirectFBSurface **ret_interface);
1686    DFBResult (*GetGL)(IDirectFBSurface *thiz, IDirectFBGL **ret_interface);
1687    DFBResult (*Dump)(IDirectFBSurface *thiz, const char *directory, const char *prefix);
1688 };
1689 struct _IDirectFBPalette
1690 {
1691    void      *priv;
1692    int       magic;
1693    DFBResult (*AddRef)(IDirectFBPalette *thiz);
1694    DFBResult (*Release)(IDirectFBPalette *thiz);
1695    DFBResult (*GetCapabilities)(IDirectFBPalette *thiz, DFBPaletteCapabilities *ret_caps);
1696    DFBResult (*GetSize)(IDirectFBPalette *thiz, unsigned int *ret_size);
1697    DFBResult (*SetEntries)(IDirectFBPalette *thiz, const DFBColor *entries, unsigned int num_entries, unsigned int offset);
1698    DFBResult (*GetEntries)(IDirectFBPalette *thiz, DFBColor *ret_entries, unsigned int num_entries, unsigned int offset);
1699    DFBResult (*FindBestMatch)(IDirectFBPalette *thiz, __u8 r, __u8 g, __u8 b, __u8 a, unsigned int *ret_index);
1700    DFBResult (*CreateCopy)(IDirectFBPalette *thiz, IDirectFBPalette **ret_interface);
1701 };
1702 typedef enum
1703 {
1704    DIKS_UP   = 0x00000000,
1705    DIKS_DOWN = 0x00000001
1706 } DFBInputDeviceKeyState;
1707 typedef enum
1708 {
1709    DIBS_UP   = 0x00000000,
1710    DIBS_DOWN = 0x00000001
1711 } DFBInputDeviceButtonState;
1712 typedef enum
1713 {
1714    DIBM_LEFT   = 0x00000001,
1715    DIBM_RIGHT  = 0x00000002,
1716    DIBM_MIDDLE = 0x00000004
1717 } DFBInputDeviceButtonMask;
1718 typedef enum
1719 {
1720    DIMM_SHIFT   = (1 << DIMKI_SHIFT),
1721    DIMM_CONTROL = (1 << DIMKI_CONTROL),
1722    DIMM_ALT     = (1 << DIMKI_ALT),
1723    DIMM_ALTGR   = (1 << DIMKI_ALTGR),
1724    DIMM_META    = (1 << DIMKI_META),
1725    DIMM_SUPER   = (1 << DIMKI_SUPER),
1726    DIMM_HYPER   = (1 << DIMKI_HYPER)
1727 } DFBInputDeviceModifierMask;
1728 struct _IDirectFBInputDevice
1729 {
1730    void      *priv;
1731    int       magic;
1732    DFBResult (*AddRef)(IDirectFBInputDevice *thiz);
1733    DFBResult (*Release)(IDirectFBInputDevice *thiz);
1734    DFBResult (*GetID)(IDirectFBInputDevice *thiz, DFBInputDeviceID *ret_device_id);
1735    DFBResult (*GetDescription)(IDirectFBInputDevice *thiz, DFBInputDeviceDescription *ret_desc);
1736    DFBResult (*GetKeymapEntry)(IDirectFBInputDevice *thiz, int keycode, DFBInputDeviceKeymapEntry *ret_entry);
1737    DFBResult (*CreateEventBuffer)(IDirectFBInputDevice *thiz, IDirectFBEventBuffer **ret_buffer);
1738    DFBResult (*AttachEventBuffer)(IDirectFBInputDevice *thiz, IDirectFBEventBuffer *buffer);
1739    DFBResult (*GetKeyState)(IDirectFBInputDevice *thiz, DFBInputDeviceKeyIdentifier key_id, DFBInputDeviceKeyState *ret_state);
1740    DFBResult (*GetModifiers)(IDirectFBInputDevice *thiz, DFBInputDeviceModifierMask *ret_modifiers);
1741    DFBResult (*GetLockState)(IDirectFBInputDevice *thiz, DFBInputDeviceLockState *ret_locks);
1742    DFBResult (*GetButtons)(IDirectFBInputDevice *thiz, DFBInputDeviceButtonMask *ret_buttons);
1743    DFBResult (*GetButtonState)(IDirectFBInputDevice *thiz, DFBInputDeviceButtonIdentifier button, DFBInputDeviceButtonState *ret_state);
1744    DFBResult (*GetAxis)(IDirectFBInputDevice *thiz, DFBInputDeviceAxisIdentifier axis, int *ret_pos);
1745    DFBResult (*GetXY)(IDirectFBInputDevice *thiz, int *ret_x, int *ret_y);
1746 };
1747 typedef enum
1748 {
1749    DFEC_NONE   = 0x00,
1750    DFEC_INPUT  = 0x01,
1751    DFEC_WINDOW = 0x02,
1752    DFEC_USER   = 0x03
1753 } DFBEventClass;
1754 typedef enum
1755 {
1756    DIET_UNKNOWN = 0,
1757    DIET_KEYPRESS,
1758    DIET_KEYRELEASE,
1759    DIET_BUTTONPRESS,
1760    DIET_BUTTONRELEASE,
1761    DIET_AXISMOTION
1762 } DFBInputEventType;
1763 typedef enum
1764 {
1765    DIEF_NONE      = 0x000,
1766    DIEF_TIMESTAMP = 0x001,
1767    DIEF_AXISABS   = 0x002,
1768    DIEF_AXISREL   = 0x004,
1769    DIEF_KEYCODE   = 0x008,
1770    DIEF_KEYID     = 0x010,
1771    DIEF_KEYSYMBOL = 0x020,
1772    DIEF_MODIFIERS = 0x040,
1773    DIEF_LOCKS     = 0x080,
1774    DIEF_BUTTONS   = 0x100,
1775    DIEF_GLOBAL    = 0x200
1776 } DFBInputEventFlags;
1777 typedef struct
1778 {
1779    DFBEventClass                  clazz;
1780    DFBInputEventType              type;
1781    DFBInputDeviceID               device_id;
1782    DFBInputEventFlags             flags;
1783    struct timeval                 timestamp;
1784    int                            key_code;
1785    DFBInputDeviceKeyIdentifier    key_id;
1786    DFBInputDeviceKeySymbol        key_symbol;
1787    DFBInputDeviceModifierMask     modifiers;
1788    DFBInputDeviceLockState        locks;
1789    DFBInputDeviceButtonIdentifier button;
1790    DFBInputDeviceButtonMask       buttons;
1791    DFBInputDeviceAxisIdentifier   axis;
1792    int                            axisabs;
1793    int                            axisrel;
1794 } DFBInputEvent;
1795 typedef enum
1796 {
1797    DWET_NONE          = 0x00000000,
1798    DWET_POSITION      = 0x00000001,
1799    DWET_SIZE          = 0x00000002,
1800    DWET_CLOSE         = 0x00000004,
1801    DWET_DESTROYED     = 0x00000008,
1802    DWET_GOTFOCUS      = 0x00000010,
1803    DWET_LOSTFOCUS     = 0x00000020,
1804    DWET_KEYDOWN       = 0x00000100,
1805    DWET_KEYUP         = 0x00000200,
1806    DWET_BUTTONDOWN    = 0x00010000,
1807    DWET_BUTTONUP      = 0x00020000,
1808    DWET_MOTION        = 0x00040000,
1809    DWET_ENTER         = 0x00080000,
1810    DWET_LEAVE         = 0x00100000,
1811    DWET_WHEEL         = 0x00200000,
1812    DWET_POSITION_SIZE = DWET_POSITION | DWET_SIZE,
1813    DWET_ALL           = 0x003F033F
1814 } DFBWindowEventType;
1815 typedef struct
1816 {
1817    DFBEventClass                  clazz;
1818    DFBWindowEventType             type;
1819    DFBWindowID                    window_id;
1820    int                            x;
1821    int                            y;
1822    int                            cx;
1823    int                            cy;
1824    int                            step;
1825    int                            w;
1826    int                            h;
1827    int                            key_code;
1828    DFBInputDeviceKeyIdentifier    key_id;
1829    DFBInputDeviceKeySymbol        key_symbol;
1830    DFBInputDeviceModifierMask     modifiers;
1831    DFBInputDeviceLockState        locks;
1832    DFBInputDeviceButtonIdentifier button;
1833    DFBInputDeviceButtonMask       buttons;
1834    struct timeval                 timestamp;
1835 } DFBWindowEvent;
1836 typedef struct
1837 {
1838    DFBEventClass clazz;
1839    unsigned int  type;
1840    void          *data;
1841 } DFBUserEvent;
1842 typedef union
1843 {
1844    DFBEventClass  clazz;
1845    DFBInputEvent  input;
1846    DFBWindowEvent window;
1847    DFBUserEvent   user;
1848 } DFBEvent;
1849 struct _IDirectFBEventBuffer
1850 {
1851    void      *priv;
1852    int       magic;
1853    DFBResult (*AddRef)(IDirectFBEventBuffer *thiz);
1854    DFBResult (*Release)(IDirectFBEventBuffer *thiz);
1855    DFBResult (*Reset)(IDirectFBEventBuffer *thiz);
1856    DFBResult (*WaitForEvent)(IDirectFBEventBuffer *thiz);
1857    DFBResult (*WaitForEventWithTimeout)(IDirectFBEventBuffer *thiz, unsigned int seconds, unsigned int milli_seconds);
1858    DFBResult (*GetEvent)(IDirectFBEventBuffer *thiz, DFBEvent *ret_event);
1859    DFBResult (*PeekEvent)(IDirectFBEventBuffer *thiz, DFBEvent *ret_event);
1860    DFBResult (*HasEvent)(IDirectFBEventBuffer *thiz);
1861    DFBResult (*PostEvent)(IDirectFBEventBuffer *thiz, const DFBEvent *event);
1862    DFBResult (*WakeUp)(IDirectFBEventBuffer *thiz);
1863    DFBResult (*CreateFileDescriptor)(IDirectFBEventBuffer *thiz, int *ret_fd);
1864 };
1865 typedef enum
1866 {
1867    DWOP_NONE           = 0x00000000,
1868    DWOP_COLORKEYING    = 0x00000001,
1869    DWOP_ALPHACHANNEL   = 0x00000002,
1870    DWOP_OPAQUE_REGION  = 0x00000004,
1871    DWOP_SHAPED         = 0x00000008,
1872    DWOP_KEEP_POSITION  = 0x00000010,
1873    DWOP_KEEP_SIZE      = 0x00000020,
1874    DWOP_KEEP_STACKING  = 0x00000040,
1875    DWOP_GHOST          = 0x00001000,
1876    DWOP_INDESTRUCTIBLE = 0x00002000,
1877    DWOP_ALL            = 0x0000307F
1878 } DFBWindowOptions;
1879 typedef enum
1880 {
1881    DWSC_MIDDLE = 0x00000000,
1882    DWSC_UPPER  = 0x00000001,
1883    DWSC_LOWER  = 0x00000002
1884 } DFBWindowStackingClass;
1885 struct _IDirectFBWindow
1886 {
1887    void      *priv;
1888    int       magic;
1889    DFBResult (*AddRef)(IDirectFBWindow *thiz);
1890    DFBResult (*Release)(IDirectFBWindow *thiz);
1891    DFBResult (*GetID)(IDirectFBWindow *thiz, DFBWindowID *ret_window_id);
1892    DFBResult (*GetPosition)(IDirectFBWindow *thiz, int *ret_x, int *ret_y);
1893    DFBResult (*GetSize)(IDirectFBWindow *thiz, int *ret_width, int *ret_height);
1894    DFBResult (*CreateEventBuffer)(IDirectFBWindow *thiz, IDirectFBEventBuffer **ret_buffer);
1895    DFBResult (*AttachEventBuffer)(IDirectFBWindow *thiz, IDirectFBEventBuffer *buffer);
1896    DFBResult (*EnableEvents)(IDirectFBWindow *thiz, DFBWindowEventType mask);
1897    DFBResult (*DisableEvents)(IDirectFBWindow *thiz, DFBWindowEventType mask);
1898    DFBResult (*GetSurface)(IDirectFBWindow *thiz, IDirectFBSurface **ret_surface);
1899    DFBResult (*SetOptions)(IDirectFBWindow *thiz, DFBWindowOptions options);
1900    DFBResult (*GetOptions)(IDirectFBWindow *thiz, DFBWindowOptions *ret_options);
1901    DFBResult (*SetColorKey)(IDirectFBWindow *thiz, __u8 r, __u8 g, __u8 b);
1902    DFBResult (*SetColorKeyIndex)(IDirectFBWindow *thiz, unsigned int index);
1903    DFBResult (*SetOpacity)(IDirectFBWindow *thiz, __u8 opacity);
1904    DFBResult (*SetOpaqueRegion)(IDirectFBWindow *thiz, int x1, int y1, int x2, int y2);
1905    DFBResult (*GetOpacity)(IDirectFBWindow *thiz, __u8 *ret_opacity);
1906    DFBResult (*SetCursorShape)(IDirectFBWindow *thiz, IDirectFBSurface *shape, int hot_x, int hot_y);
1907    DFBResult (*RequestFocus)(IDirectFBWindow *thiz);
1908    DFBResult (*GrabKeyboard)(IDirectFBWindow *thiz);
1909    DFBResult (*UngrabKeyboard)(IDirectFBWindow *thiz);
1910    DFBResult (*GrabPointer)(IDirectFBWindow *thiz);
1911    DFBResult (*UngrabPointer)(IDirectFBWindow *thiz);
1912    DFBResult (*GrabKey)(IDirectFBWindow *thiz, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers);
1913    DFBResult (*UngrabKey)(IDirectFBWindow *thiz, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers);
1914    DFBResult (*Move)(IDirectFBWindow *thiz, int dx, int dy);
1915    DFBResult (*MoveTo)(IDirectFBWindow *thiz, int x, int y);
1916    DFBResult (*Resize)(IDirectFBWindow *thiz, int width, int height);
1917    DFBResult (*SetStackingClass)(IDirectFBWindow *thiz, DFBWindowStackingClass stacking_class);
1918    DFBResult (*Raise)(IDirectFBWindow *thiz);
1919    DFBResult (*Lower)(IDirectFBWindow *thiz);
1920    DFBResult (*RaiseToTop)(IDirectFBWindow *thiz);
1921    DFBResult (*LowerToBottom)(IDirectFBWindow *thiz);
1922    DFBResult (*PutAtop)(IDirectFBWindow *thiz, IDirectFBWindow *lower);
1923    DFBResult (*PutBelow)(IDirectFBWindow *thiz, IDirectFBWindow *upper);
1924    DFBResult (*Close)(IDirectFBWindow *thiz);
1925    DFBResult (*Destroy)(IDirectFBWindow *thiz);
1926 };
1927 struct _IDirectFBFont
1928 {
1929    void      *priv;
1930    int       magic;
1931    DFBResult (*AddRef)(IDirectFBFont *thiz);
1932    DFBResult (*Release)(IDirectFBFont *thiz);
1933    DFBResult (*GetAscender)(IDirectFBFont *thiz, int *ret_ascender);
1934    DFBResult (*GetDescender)(IDirectFBFont *thiz, int *ret_descender);
1935    DFBResult (*GetHeight)(IDirectFBFont *thiz, int *ret_height);
1936    DFBResult (*GetMaxAdvance)(IDirectFBFont *thiz, int *ret_maxadvance);
1937    DFBResult (*GetKerning)(IDirectFBFont *thiz, unsigned int prev_index, unsigned int current_index, int *ret_kern_x, int *ret_kern_y);
1938    DFBResult (*GetStringWidth)(IDirectFBFont *thiz, const char *text, int bytes, int *ret_width);
1939    DFBResult (*GetStringExtents)(IDirectFBFont *thiz, const char *text, int bytes, DFBRectangle *ret_logical_rect, DFBRectangle *ret_ink_rect);
1940    DFBResult (*GetGlyphExtents)(IDirectFBFont *thiz, unsigned int index, DFBRectangle *ret_rect, int *ret_advance);
1941 };
1942 typedef enum
1943 {
1944    DICAPS_NONE         = 0x00000000,
1945    DICAPS_ALPHACHANNEL = 0x00000001,
1946    DICAPS_COLORKEY     = 0x00000002
1947 } DFBImageCapabilities;
1948 typedef struct
1949 {
1950    DFBImageCapabilities caps;
1951    __u8                 colorkey_r;
1952    __u8                 colorkey_g;
1953    __u8                 colorkey_b;
1954 } DFBImageDescription;
1955 typedef void (*DIRenderCallback)(DFBRectangle *rect, void *ctx);
1956 struct _IDirectFBImageProvider
1957 {
1958    void      *priv;
1959    int       magic;
1960    DFBResult (*AddRef)(IDirectFBImageProvider *thiz);
1961    DFBResult (*Release)(IDirectFBImageProvider *thiz);
1962    DFBResult (*GetSurfaceDescription)(IDirectFBImageProvider *thiz, DFBSurfaceDescription *ret_dsc);
1963    DFBResult (*GetImageDescription)(IDirectFBImageProvider *thiz, DFBImageDescription *ret_dsc);
1964    DFBResult (*RenderTo)(IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *destination_rect);
1965    DFBResult (*SetRenderCallback)(IDirectFBImageProvider *thiz, DIRenderCallback callback, void *callback_data);
1966 };
1967 typedef int (*DVFrameCallback)(void *ctx);
1968 struct _IDirectFBVideoProvider
1969 {
1970    void      *priv;
1971    int       magic;
1972    DFBResult (*AddRef)(IDirectFBVideoProvider *thiz);
1973    DFBResult (*Release)(IDirectFBVideoProvider *thiz);
1974    DFBResult (*GetCapabilities)(IDirectFBVideoProvider *thiz, DFBVideoProviderCapabilities *ret_caps);
1975    DFBResult (*GetSurfaceDescription)(IDirectFBVideoProvider *thiz, DFBSurfaceDescription *ret_dsc);
1976    DFBResult (*PlayTo)(IDirectFBVideoProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *destination_rect, DVFrameCallback callback, void *ctx);
1977    DFBResult (*Stop)(IDirectFBVideoProvider *thiz);
1978    DFBResult (*SeekTo)(IDirectFBVideoProvider *thiz, double seconds);
1979    DFBResult (*GetPos)(IDirectFBVideoProvider *thiz, double *ret_seconds);
1980    DFBResult (*GetLength)(IDirectFBVideoProvider *thiz, double *ret_seconds);
1981    DFBResult (*GetColorAdjustment)(IDirectFBVideoProvider *thiz, DFBColorAdjustment *ret_adj);
1982    DFBResult (*SetColorAdjustment)(IDirectFBVideoProvider *thiz, const DFBColorAdjustment *adj);
1983 };
1984 struct _IDirectFBDataBuffer
1985 {
1986    void      *priv;
1987    int       magic;
1988    DFBResult (*AddRef)(IDirectFBDataBuffer *thiz);
1989    DFBResult (*Release)(IDirectFBDataBuffer *thiz);
1990    DFBResult (*Flush)(IDirectFBDataBuffer *thiz);
1991    DFBResult (*SeekTo)(IDirectFBDataBuffer *thiz, unsigned int offset);
1992    DFBResult (*GetPosition)(IDirectFBDataBuffer *thiz, unsigned int *ret_offset);
1993    DFBResult (*GetLength)(IDirectFBDataBuffer *thiz, unsigned int *ret_length);
1994    DFBResult (*WaitForData)(IDirectFBDataBuffer *thiz, unsigned int length);
1995    DFBResult (*WaitForDataWithTimeout)(IDirectFBDataBuffer *thiz, unsigned int length, unsigned int seconds, unsigned int milli_seconds);
1996    DFBResult (*GetData)(IDirectFBDataBuffer *thiz, unsigned int length, void *ret_data, unsigned int *ret_read);
1997    DFBResult (*PeekData)(IDirectFBDataBuffer *thiz, unsigned int length, int offset, void *ret_data, unsigned int *ret_read);
1998    DFBResult (*HasData)(IDirectFBDataBuffer *thiz);
1999    DFBResult (*PutData)(IDirectFBDataBuffer *thiz, const void *data, unsigned int length);
2000    DFBResult (*CreateImageProvider)(IDirectFBDataBuffer *thiz, IDirectFBImageProvider **interface);
2001 };
2002