D-Bus: Emit cast to avoid C warning for signal handling in clients
[vala-lang.git] / vapi / sdl.vapi
blobf11d96fbe44ccb4d08f4b9f741724e0ba8e7a72d
1 [CCode (cprefix="SDL_", cheader_filename="SDL.h")]
2 namespace SDL {
3         ///
4         /// Initialization
5         ///
6         [Flags, CCode (cname="int", cprefix="SDL_INIT_")]
7         public enum InitFlag {
8                 TIMER, AUDIO, VIDEO, CDROM, JOYSTICK, 
9                 NOPARACHUTE, EVENTTHREAD, EVERYTHING
10         }// InitFlag
12         [CCode (cname="SDL_Init")]
13         public static int init(uint32 flags = SDL.InitFlag.EVERYTHING);
15         [CCode (cname="SDL_InitSubSystem")]
16         public static int init_subsystem(uint32 flags);
18         [CCode (cname="SDL_WasInit")]
19         public static uint32 get_initialized(uint32 flags);
21         [CCode (cname="SDL_Quit")]
22         public static void quit();
24         [CCode (cname="SDL_QuitSubSystem")]
25         public static void quit_subsystem(uint32 flags);
27         [CCode (type_id="SDL_version", cheader_filename="SDL_version.h", cname="SDL_version")]
28         public class Version {
29                 public uchar major;
30                 public uchar minor;
31                 public uchar patch;
33                 [CCode (cheader_filename="SDL_version.h", cname="SDL_Linked_Version")]
34                 public static unowned Version linked();
35         }// Version
38         ///
39         /// Error
40         ///
41         [CCode (cname="int", cprefix="SDL_")]
42         public enum Error {
43                 ENOMEM, EFREAD, EFWRITE, EFSEEK, 
44                 UNSUPPORTED, LASTERROR
45         }// Error
47         [CCode (cname="SDL_SetError")]
48         public static void set_error(string format, ...);
50         [CCode (cname="SDL_GetError")]
51         public static unowned string get_error();
53         [CCode (cname="SDL_ClearError")]
54         public static void clear_error();
56         [CCode (cname="SDL_Error")]
57         public static void error(Error code);
60         ///
61         /// Video
62         ///
63         [CCode (cname="int", cprefix="SDL_ALPHA_")]
64         public enum Opacity {
65                 OPAQUE, TRANSPARENT
66         }// Opacity
68         [Compact]
69         public class Video {
70                 [CCode (cname="SDL_VideoDriverName")]
71                 public static unowned string? driver_name(string namebuf, int maxlen);
73                 [CCode (cname="SDL_SetGamma")]
74                 public static int set_gamma(float red, float green, float blue);
76                 [CCode (cname="SDL_SetGammaRamp")]
77                 public static int set_gamma_ramp(uint16* red, uint16* green, uint16* blue);
79                 [CCode (cname="SDL_GetGammaRamp")]
80                 public static int get_gamma_ramp(uint16* red, uint16* green, uint16* blue);
82                 [CCode (cname="SDL_ListModes")]
83                 public static void* _list_modes(PixelFormat? format, uint32 flags);
85                 [CCode (array_length = false, array_null_terminated = true)]
86                 public static unowned SDL.Rect*[]? list_modes(SDL.PixelFormat? format, uint32 flags, out bool any) {
87                         var p = SDL.Video._list_modes (format, flags);
88                         any = ((int) p == -1);
89                         return any ? null : (SDL.Rect*[]?) p;
90                 }
91         }// Video
93         [Flags, CCode (cname="int", cprefix="SDL_")]
94         public enum SurfaceFlag {
95                 SWSURFACE, HWSURFACE, ASYNCBLIT, ANYFORMAT, HWPALETTE, DOUBLEBUF, 
96                 FULLSCREEN, OPENGL, OPENGLBLIT, RESIZABLE, NOFRAME, HWACCEL, 
97                 SRCCOLORKEY, RLEACCEL, SRCALPHA
98         }// SurfaceFlag
100         [CCode (cname="SDL_Surface", free_function="SDL_FreeSurface", copy_function="SDL_DisplayFormat")]
101         [Compact]
102         public class Surface {
103                 public uint32 flags;
104                 public PixelFormat format;
105                 public int w;
106                 public int h;
107                 public uint16 pitch;
108                 public void* pixels;
109                 public int ref_count;
111                 [CCode (cname="SDL_CreateRGBSurface")]
112                 public Surface.RGB(uint32 flags, int width, int height, int depth, 
113                         uint32 rmask, uint32 gmask, uint32 bmask, uint32 amask);
115                 [CCode (cname="SDL_CreateRGBSurfaceFrom")]
116                 public Surface.from_RGB(void* pixels, int width, int height, int depth, 
117                         int pitch, uint32 rmask, uint32 gmask, uint32 bmask, uint32 amask);
119                 [CCode (cname="SDL_LoadBMP_RW")]
120                 public static Surface.load(RWops src, int freesrc=0);
122                 // Instance methods
123                 [CCode (cname="SDL_UpdateRects")]
124                 public void update_rects(int numrects, Rect* rects);
126                 [CCode (cname="SDL_UpdateRect")]
127                 public void update_rect(int32 x, int32 y, uint32 w, uint32 h);
129                 [CCode (cname="SDL_Flip")]
130                 public int flip();
132                 [CCode (cname="SDL_SetColors")]
133                 public int set_colors(Color* colors, int firstcolor, int ncolors);
135                 [CCode (cname="SDL_SetPalette")]
136                 public int set_palette(int flags, Color* colors, int firstcolor, int ncolors);
138                 [CCode (cname="SDL_LockSurface")]
139                 public int do_lock();
141                 [CCode (cname="SDL_UnlockSurface")]
142                 public void unlock();
144                 [CCode (cname="SDL_SaveBMP_RW")]
145                 public int save(RWops dst, int freedst=0);
147                 [CCode (cname="SDL_SetColorKey")]
148                 public int set_colorkey(uint32 flag, uint32 key);
150                 [CCode (cname="SDL_SetAlpha")]
151                 public int set_alpha(uint32 flag, uchar alpha);
153                 [CCode (cname="SDL_SetClipRect")]
154                 public bool set_cliprect(Rect? rect);
156                 [CCode (cname="SDL_GetClipRect")]
157                 public void get_cliprect(Rect rect);
159                 [CCode (cname="SDL_ConvertSurface")]
160                 public Surface? convert(PixelFormat? fmt, uint32 flags);
162                 [CCode (cname="SDL_UpperBlit")]
163                 public int blit(Rect? srcrect, Surface dst, Rect? dstrect);
165                 [CCode (cname="SDL_FillRect")]
166                 public int fill(Rect? dst, uint32 color);
167         }// Surface
169         [CCode (cname="SDL_Surface")]
170         [Compact]
171         public class Screen : Surface {
172                 [CCode (cname="SDL_GetVideoSurface")]
173                 public static unowned Screen instance();
175                 [CCode (cname="SDL_SetVideoMode")]
176                 public static unowned Screen? set_video_mode(int width, int height, int bpp, uint32 flags);
178                 [CCode (cname="SDL_VideoModeOK")]
179                 public static int check_video_mode(int width, int height, int bpp, uint32 flags);
180         }// Screen
182         [CCode (cname="SDL_PixelFormat")]
183         [Compact]
184         public class PixelFormat {
185                 public Palette palette;
186                 public uchar BitsPerPixel;
187                 public uchar BytesPerPixel;
188                 public uchar Rloss;
189                 public uchar Gloss;
190                 public uchar Bloss;
191                 public uchar Aloss;
192                 public uchar Rshift;
193                 public uchar Gshift;
194                 public uchar Bshift;
195                 public uchar Ashift;
196                 public uchar Rmask;
197                 public uchar Gmask;
198                 public uchar Bmask;
199                 public uchar Amask;
201                 public uint32 colorkey;
202                 public uchar alpha;
204                 [CCode (cname="SDL_MapRGB")]
205                 public uint32 map_rgb(uchar r, uchar g, uchar b);
207                 [CCode (cname="SDL_MapRGBA")]
208                 public uint32 map_rgba(uchar r, uchar g, uchar b, uchar a);
210                 [CCode (cname="SDL_GetRGB")]
211                 public static void get_rgb(uint32 pixel, PixelFormat fmt, ref uchar r, ref uchar g, ref uchar b);
213                 [CCode (cname="SDL_GetRGBA")]
214                 public static void get_rgba(uint32 pixel, PixelFormat fmt, ref uchar r, ref uchar g, ref uchar b, ref uchar a);
215         }// PixelFormat
217         [CCode (cname="SDL_Rect", has_type_id=false)]
218         public struct Rect {
219                 public int16 x; 
220                 public int16 y;
221                 public uint16 w;
222                 public uint16 h;
223         }// Rect
225         [CCode (cname="SDL_Color", has_type_id=false)]
226         [SimpleType]
227         public struct Color {
228                 public uchar r;
229                 public uchar g;
230                 public uchar b;
231                 public uchar unused;
232         }// Color
234         [CCode (cname="int", cprefix="SDL_")]
235         public enum PaletteFlags {
236                 LOGPAL, PHYSPAL
237         }// PaletteFlags
239         [CCode (cname="SDL_Palette")]
240         public class Palette {
241                 public int ncolors;
243                 public Color* colors;
244         }// Palette
246         [CCode (cname="SDL_VideoInfo")]
247         [Compact]
248         public class VideoInfo {
249                 public uint32 hw_available      ;
250                 public uint32 wm_available      ;
251                 public uint32 UnusedBits1       ;
252                 public uint32 UnusedBits2       ;
253                 public uint32 blit_hw           ;
254                 public uint32 bliw_hw_CC        ;
255                 public uint32 blit_hw_A ;
256                 public uint32 blit_sw           ;
257                 public uint32 blit_sw_CC        ;
258                 public uint32 blit_sw_A ;
259                 public uint32 blit_fill ;
260                 public uint32 UnusedBits3       ;
262                 public uint32 video_mem;
263                 public PixelFormat vfmt;
264                 public int      current_w;
265                 public int      current_h;
267                 [CCode (cname="SDL_GetVideoInfo")]
268                 public static unowned VideoInfo get();
269         }// VideoInfo
271         [CCode (cname="int", cprefix="SDL_")]
272         public enum OverlayFormat {
273                 YV12_OVERLAY, IYUV_OVERLAY, YUY2_OVERLAY, 
274                 UYVY_OVERLAY, YVYU_OVERLAY
275         }// OverlayFormat
277         [CCode (cname="SDL_Overlay", free_function="SDL_FreeYUVOverlay")]
278         [Compact]
279         public class Overlay {
280                 public uint32 format;
281                 public int w;
282                 public int h;
283                 public int planes;
284                 uint16* pitches;
285                 uchar** pixels;
287                 uint32 hw_overlay;
288                 uint32 UnusedBits;
290                 [CCode (cname="SDL_CreateYUVOverlay")]
291                 public Overlay(int width, int height, OverlayFormat format, Surface display);
293                 [CCode (cname="SDL_LockYUVOverlay")]
294                 public int do_lock();
296                 [CCode (cname="SDL_UnlockYUVOverlay")]
297                 public void unlock();
299                 [CCode (cname="SDL_DisplayYUVOverlay")]
300                 public void display(Rect dst);
301         }// Overlay
304         ///
305         /// RWops
306         ///
307         [CCode (cname="SDL_RWops", free_function="SDL_FreeRW")]
308         [Compact]
309         public class RWops {
310                 [CCode (cname="SDL_RWFromFile")]
311                 public RWops.from_file(string file, string mode);
313                 [CCode (cname="SDL_RWFromMem")]
314                 public RWops.from_mem(void* mem, int size);
315         }// RWops
318         ///
319         /// OpenGL
320         ///
321         [CCode (cname="int", cprefix="SDL_GL_")]
322         public enum GLattr {
323                 RED_SIZE, GREEN_SIZE, BLUE_SIZE, ALPHA_SIZE, 
324                 BUFFER_SIZE, DOUBLEBUFFER, DEPTH_SIZE, STENCIL_SIZE, 
325                 ACCUM_RED_SIZE, ACCUM_GREEN_SIZE, ACCUM_BLUE_SIZE, 
326                 ACCUM_ALPHA_SIZE, STEREO, MULTISAMPLEBUFFERS, 
327                 MULTISAMPLESAMPLES, ACCELERATED_VISUAL, SWAP_CONTROL
328         }// GLattr
330         [CCode (cprefix="SDL_GL_", cheader_filename="SDL.h")]
331         [Compact]
332         public class GL {
333                 [CCode (cname="SDL_GL_LoadLibrary")]
334                 public static int load_library(string path);
336                 [CCode (cname="SDL_GL_GetProcAddress")]
337                 public static void* get_proc_address(string proc);
339                 [CCode (cname="SDL_GL_SetAttribute")]
340                 public static int set_attribute(GLattr attr, int val);
342                 [CCode (cname="SDL_GL_GetAttribute")]
343                 public static int get_attribute(GLattr attr, ref int val);
345                 [CCode (cname="SDL_GL_SwapBuffers")]
346                 public static void swap_buffers();
347         }// GL
350         ///
351         /// Window manager
352         ///
353         [CCode (cname="int", cprefix="SDL_GRAB_")]
354         public enum GrabMode {
355                 QUERY, OFF, ON
356         }// GrabMode
358         [CCode (cprefix="SDL_WM_", cheader_filename="SDL.h")]
359         [Compact]
360         public class WindowManager {
361                 [CCode (cname="SDL_WM_SetCaption")]
362                 public static void set_caption(string title, string icon);
364                 [CCode (cname="SDL_WM_GetCaption")]
365                public static void get_caption(out string title, out string icon);
367                 [CCode (cname="SDL_WM_SetIcon")]
368                 public static void set_icon(Surface icon, uchar* mask);
370                 [CCode (cname="SDL_WM_IconifyWindow")]
371                 public static int iconify();
373                 [CCode (cname="SDL_WM_ToggleFullScreen")]
374                 public static int toggle_fullscreen(Surface surface);
376                 [CCode (cname="SDL_WM_GrabInput")]
377                 public static GrabMode grab_input(GrabMode mode);
378         }// WindowManager
381         ///
382         /// Events
383         ///
384         [CCode (cname="int", cprefix="SDL_")]
385         public enum EventType {
386                 NOEVENT, ACTIVEEVENT, KEYDOWN, KEYUP, MOUSEMOTION, 
387                 MOUSEBUTTONDOWN, MOUSEBUTTONUP, JOYAXISMOTION, 
388                 JOYBALLMOTION, JOYHATMOTION, JOYBUTTONDOWN, JOYBUTTONUP, 
389                 QUIT, SYSWMEVENT, VIDEORESIZE, VIDEOEXPOSE, USEREVENT, 
390                 NUMEVENTS
391         }// EventType
393         [CCode (cname="int", cprefix="SDL_")]
394         public enum EventMask {
395                 ACTIVEEVENTMASK, KEYDOWNMASK, KEYUPMASK, KEYEVENTMASK, 
396                 MOUSEMOTIONMASK, MOUSEBUTTONDOWNMASK, MOUSEBUTTONUPMASK, 
397                 MOUSEEVENTMASK, JOYAXISMOTIONMASK, JOYBALLMOTIONMASK, 
398                 JOYHATMOTIONMASK, JOYBUTTONDOWNMASK, JOYBUTTONUPMASK, 
399                 JOYEVENTMASK, VIDEORESIZEMASK, VIDEOEXPOSEMASK, QUITMASK, 
400                 SYSWMEVENTMASK
401         }// EventMask
403         [CCode (cname="SDL_MouseButtonEvent", has_type_id=false)]
404         public struct MouseButtonEvent {
405                 public uchar type;
406                 public uchar which;
407                 public uchar button;
408                 public uchar state;
409                 public uint16 x;
410                 public uint16 y;
411         }// MouseButtonEvent
413         [CCode (cheader_filename="SDL_active.h", cname="int", cprefix="SDL_APP")]
414         public enum ActiveState {
415                 MOUSEFOCUS,
416                 INPUTFOCUS,
417                 ACTIVE
418         }// ActiveState
420         [CCode (cname="SDL_ActiveEvent", has_type_id=false)]
421         public struct ActiveEvent {
422                 public uchar type;
423                 public uchar gain;
424                 public uchar state;
425         }// ActiveEvent
427         [CCode (cname="SDL_KeyboardEvent", has_type_id=false)]
428         public struct KeyboardEvent {
429                 public uchar type;
430                 public uchar which;
431                 public uchar state;
432                 public Key keysym;
433         }// KeyboardEvent
435         [CCode (cname="SDL_MouseMotionEvent", has_type_id=false)]
436         public struct MouseMotionEvent {
437                 public uchar type;
438                 public uchar which;
439                 public uchar state;
440                 public uint16 x;
441                 public uint16 y;
442                 public int16 xrel;
443                 public int16 yrel;
444         }// MouseMotionEvent
446         [CCode (cname="SDL_JoyAxisEvent", has_type_id=false)]
447         public struct JoyAxisEvent {
448                 public uchar type;
449                 public uchar which;
450                 public uchar axis;
451                 public uint16 @value;
452         }// JoyAxisEvent
454         [CCode (cname="SDL_JoyBallEvent", has_type_id=false)]
455         public struct JoyBallEvent {
456                 public uchar type;
457                 public uchar which;
458                 public uchar ball;
459                 public int16 xrel;
460                 public int16 yrel;
461         }// JoyBallEvent
463         [CCode (cname="SDL_JoyHatEvent", has_type_id=false)]
464         public struct JoyHatEvent {
465                 public uchar type;
466                 public uchar which;
467                 public uchar hat;
468                 public uchar @value;
469         }// JoyHatEvent
471         [CCode (cname="SDL_JoyButtonEvent", has_type_id=false)]
472         public struct JoyButtonEvent {
473                 public uchar type;
474                 public uchar which;
475                 public uchar button;
476                 public uchar state;
477         }// JoyButtonEvent
479         [CCode (cname="SDL_ResizeEvent", has_type_id=false)]
480         public struct ResizeEvent {
481                 public uchar type;
482                 public int w;
483                 public int h;
484         }// ResizeEvent
486         [CCode (cname="SDL_ExposeEvent", has_type_id=false)]
487         public struct ExposeEvent {
488                 public uchar type;
489         }// ExposeEvent
491         [CCode (cname="SDL_QuitEvent", has_type_id=false)]
492         public struct QuitEvent {
493                 public uchar type;
494         }// QuitEvent
496         [CCode (cname="SDL_UserEvent", has_type_id=false)]
497         public struct UserEvent {
498                 public uchar type;
499                 public int code;
500                 public void* data1;
501                 public void* data2;
502         }// UserEvent
504         [CCode (cname="SDL_SysWMEvent", has_type_id=false)]
505         public struct SysWMEvent {
506                 public uchar type;
507                 public weak SysWMmsg msg;
508         }// WMEvent
510         [CCode (cname="SDL_SysWMmsg", cheader="SDL_syswm.h")]
511         public class SysWMmsg {
512         }// SysWMmsg
514         [CCode (cname="SDL_Event", has_type_id=false)]
515         public struct Event {
516                 public uchar type;
517                 public ActiveEvent active;
518                 public KeyboardEvent key;
519                 public MouseMotionEvent motion;
520                 public MouseButtonEvent button;
521                 public JoyAxisEvent jaxis;
522                 public JoyBallEvent jball;
523                 public JoyHatEvent jhat;
524                 public JoyButtonEvent jbutton;
525                 public ResizeEvent resize;
526                 public ExposeEvent expose;
527                 public QuitEvent quit;
528                 public UserEvent user;
529                 public SysWMEvent syswm;
531                 [CCode (cname="SDL_PumpEvents")]
532                 public static void pump();
534                 [CCode (cname="SDL_PeepEvents")]
535                 public static void peep(Event* events, int numevents, 
536                         EventAction action, EventMask mask);
538                 [CCode (cname="SDL_PollEvent")]
539                 public static int poll(Event ev);
541                 [CCode (cname="SDL_WaitEvent")]
542                 public static int wait(Event ev);
544                 [CCode (cname="SDL_PushEvent")]
545                 public static int push(Event ev);
547                 [CCode (cname="SDL_EventState")]
548                 public static uchar state(uchar type, EventState state);
549         }// Event
551         [CCode (cname="int", cprefix="SDL_")]
552         public enum EventAction {
553                 ADDEVENT, PEEKEVENT, GETEVENT
554         }// EventAction
556         [CCode (cname="int", cprefix="SDL_")]
557         public enum EventState {
558                 QUERY, IGNORE, DISABLE, ENABLE
559         }// EventState
560         
562         ///
563         /// Input
564         ///
565         [CCode (cname="int", cprefix="SDL_")]
566         public enum ButtonState {
567                 RELEASED, PRESSED
568         }// ButtonState
570         [CCode (cname="SDL_keysym", has_type_id=false)]
571         public struct Key {
572                 public uchar scancode;
573                 public KeySymbol sym;
574                 public KeyModifier mod;
575                 public uint16 unicode;
577                 [CCode (cname="SDL_EnableUNICODE")]
578                 public static int enable_unicode(int enable);
580                 [CCode (cname="SDL_EnableKeyRepeat")]
581                 public static int set_repeat(int delay, int interval);
583                 [CCode (cname="SDL_GetKeyRepeat")]
584                 public static void get_repeat(ref int delay, ref int interval);
586                 [CCode (cname="SDL_GetKeyState")]
587                 public static unowned uchar[] get_keys();
589                 [CCode (cname="SDL_GetModState")]
590                 public static KeyModifier get_modifiers();
592                 [CCode (cname="SDL_SetModState")]
593                 public static void set_modifiers(KeyModifier modstate);
595                 [CCode (cname="SDL_GetKeyName")]
596                 public static unowned string get_name(KeySymbol key);
597         }// Key
599         [CCode (cname="int", cprefix="SDLK_", cheader_filename="SDL_keysym.h")]
600         public enum KeySymbol {
601                 UNKNOWN,
602                 FIRST,
603                 BACKSPACE,
604                 TAB,
605                 CLEAR,
606                 RETURN,
607                 PAUSE,
608                 ESCAPE,
609                 SPACE,
610                 EXCLAIM,
611                 QUOTEDBL,
612                 HASH,
613                 DOLLAR,
614                 AMPERSAND,
615                 QUOTE,
616                 LEFTPAREN,
617                 RIGHTPAREN,
618                 ASTERISK,
619                 PLUS,
620                 COMMA,
621                 MINUS,
622                 PERIOD,
623                 SLASH,
624                 ZERO = 48,
625                 ONE = 49,
626                 TWO = 50,
627                 THREE = 51,
628                 FOUR = 52,
629                 FIVE = 53,
630                 SIX = 54,
631                 SEVEN = 55,
632                 EIGHT = 56,
633                 NINE = 57,
634                 COLON,
635                 SEMICOLON,
636                 LESS,
637                 EQUALS,
638                 GREATER,
639                 QUESTION,
640                 AT,
641                 /* 
642                    Skip uppercase letters
643                  */
644                 LEFTBRACKET,
645                 BACKSLASH,
646                 RIGHTBRACKET,
647                 CARET,
648                 UNDERSCORE,
649                 BACKQUOTE,
650                 a,
651                 b,
652                 c,
653                 d,
654                 e,
655                 f,
656                 g,
657                 h,
658                 i,
659                 j,
660                 k,
661                 l,
662                 m,
663                 n,
664                 o,
665                 p,
666                 q,
667                 r,
668                 s,
669                 t,
670                 u,
671                 v,
672                 w,
673                 x,
674                 y,
675                 z,
676                 DELETE,
677                 /* End of ASCII mapped keysyms */
679                 /* International keyboard syms */
680                 WORLD_0,                /* 0xA0 */
681                 WORLD_1,
682                 WORLD_2,
683                 WORLD_3,
684                 WORLD_4,
685                 WORLD_5,
686                 WORLD_6,
687                 WORLD_7,
688                 WORLD_8,
689                 WORLD_9,
690                 WORLD_10,
691                 WORLD_11,
692                 WORLD_12,
693                 WORLD_13,
694                 WORLD_14,
695                 WORLD_15,
696                 WORLD_16,
697                 WORLD_17,
698                 WORLD_18,
699                 WORLD_19,
700                 WORLD_20,
701                 WORLD_21,
702                 WORLD_22,
703                 WORLD_23,
704                 WORLD_24,
705                 WORLD_25,
706                 WORLD_26,
707                 WORLD_27,
708                 WORLD_28,
709                 WORLD_29,
710                 WORLD_30,
711                 WORLD_31,
712                 WORLD_32,
713                 WORLD_33,
714                 WORLD_34,
715                 WORLD_35,
716                 WORLD_36,
717                 WORLD_37,
718                 WORLD_38,
719                 WORLD_39,
720                 WORLD_40,
721                 WORLD_41,
722                 WORLD_42,
723                 WORLD_43,
724                 WORLD_44,
725                 WORLD_45,
726                 WORLD_46,
727                 WORLD_47,
728                 WORLD_48,
729                 WORLD_49,
730                 WORLD_50,
731                 WORLD_51,
732                 WORLD_52,
733                 WORLD_53,
734                 WORLD_54,
735                 WORLD_55,
736                 WORLD_56,
737                 WORLD_57,
738                 WORLD_58,
739                 WORLD_59,
740                 WORLD_60,
741                 WORLD_61,
742                 WORLD_62,
743                 WORLD_63,
744                 WORLD_64,
745                 WORLD_65,
746                 WORLD_66,
747                 WORLD_67,
748                 WORLD_68,
749                 WORLD_69,
750                 WORLD_70,
751                 WORLD_71,
752                 WORLD_72,
753                 WORLD_73,
754                 WORLD_74,
755                 WORLD_75,
756                 WORLD_76,
757                 WORLD_77,
758                 WORLD_78,
759                 WORLD_79,
760                 WORLD_80,
761                 WORLD_81,
762                 WORLD_82,
763                 WORLD_83,
764                 WORLD_84,
765                 WORLD_85,
766                 WORLD_86,
767                 WORLD_87,
768                 WORLD_88,
769                 WORLD_89,
770                 WORLD_90,
771                 WORLD_91,
772                 WORLD_92,
773                 WORLD_93,
774                 WORLD_94,
775                 WORLD_95,               /* 0xFF */
777                 /* Numeric keypad */
778                 KP0,
779                 KP1,
780                 KP2,
781                 KP3,
782                 KP4,
783                 KP5,
784                 KP6,
785                 KP7,
786                 KP8,
787                 KP9,
788                 KP_PERIOD,
789                 KP_DIVIDE,
790                 KP_MULTIPLY,
791                 KP_MINUS,
792                 KP_PLUS,
793                 KP_ENTER,
794                 KP_EQUALS,
796                 /* Arrows + Home/End pad */
797                 UP,
798                 DOWN,
799                 RIGHT,
800                 LEFT,
801                 INSERT,
802                 HOME,
803                 END,
804                 PAGEUP,
805                 PAGEDOWN,
807                 /* Function keys */
808                 F1,
809                 F2,
810                 F3,
811                 F4,
812                 F5,
813                 F6,
814                 F7,
815                 F8,
816                 F9,
817                 F10,
818                 F11,
819                 F12,
820                 F13,
821                 F14,
822                 F15,
824                 /* Key state modifier keys */
825                 NUMLOCK,
826                 CAPSLOCK,
827                 SCROLLOCK,
828                 RSHIFT,
829                 LSHIFT,
830                 RCTRL,
831                 LCTRL,
832                 RALT,
833                 LALT,
834                 RMETA,
835                 LMETA,
836                 LSUPER,         /* Left "Windows" key */
837                 RSUPER,         /* Right "Windows" key */
838                 MODE,           /* "Alt Gr" key */
839                 COMPOSE,                /* Multi-key compose key */
841                 /* Miscellaneous function keys */
842                 HELP,
843                 PRINT,
844                 SYSREQ,
845                 BREAK,
846                 MENU,
847                 POWER,          /* Power Macintosh power key */
848                 EURO,           /* Some european keyboards */
849                 UNDO,           /* Atari keyboard has Undo */
851                 /* Add any other keys here */
853                 LAST
854         }// KeySymbol
856         [CCode (cname="int", cprefix="KMOD_", cheader_filename="SDL_keysym.h")]
857         public enum KeyModifier {
858                 NONE,
859                 LSHIFT,
860                 RSHIFT,
861                 LCTRL,
862                 RCTRL,
863                 LALT,
864                 RALT,
865                 LMETA,
866                 RMETA,
867                 NUM,
868                 CAPS,
869                 MODE,
870                 RESERVED,
871                 CTRL,
872                 SHIFT,
873                 ALT,
874                 META
875         }// KeyModifier
877         [CCode (cname="int", cprefix="SDL_BUTTON_")]
878         public enum MouseButton {
879                 LEFT, MIDDLE, RIGHT, WHEELUP, WHEELDOWN
880         }// Buttons
882         [CCode (cname="SDL_Cursor", free_function="SDL_FreeCursor")]
883         [Compact]
884         public class Cursor {
885                 public Rect area;
886                 public int16 hot_x;
887                 public int16 hot_y;
888                 public uchar* data;
889                 public uchar* mask;
890                 public uchar** save;
892                 [CCode (cname="SDL_GetMouseState")]
893                 public static uchar get_state(ref int x, ref int y);
895                 [CCode (cname="SDL_GetRelativeMouseState")]
896                 public static uchar get_relative_state(ref int x, ref int y);
898                 [CCode (cname="SDL_WarpMouse")]
899                 public static void warp(uint16 x, uint16 y);
901                 [CCode (cname="SDL_CreateCursor")]
902                 public Cursor(uchar* data, uchar* mask, int w, int h, 
903                         int hot_x, int hot_y);
905                 [CCode (cname="SDL_GetCursor")]
906                 public static Cursor get();
908                 [CCode (cname="SDL_SetCursor")]
909                 public static void set(Cursor cursor);
911                 [CCode (cname="SDL_ShowCursor")]
912                 public static int show(int toggle);
913         }// Cursor
915         [CCode (cname="int", cprefix="SDL_HAT_")]
916         public enum HatValue {
917                 CENTERED, UP, RIGHT, DOWN, LEFT, 
918                 RIGHTUP, RIGHTDOWN, LEFTUP, LEFTDOWN
919         }// HatValue
921         [CCode (cname="SDL_Joystick", free_function="SDL_JoystickClose")]
922         [Compact]
923         public class Joystick {
924                 [CCode (cname="SDL_JoystickName")]
925                 public static unowned string get_name(int device_index);
927                 [CCode (cname="SDL_JoystickOpened")]
928                 public static int is_open(int device_index);
930                 [CCode (cname="SDL_JoystickUpdate")]
931                 public static void update_all();
933                 [CCode (cname="SDL_JoystickEventState")]
934                 public static int event_state(EventState state);
936                 [CCode (cname="SDL_NumJoysticks")]
937                 public static int count();
939                 [CCode (cname="SDL_JoystickOpen")]
940                 public Joystick(int device_index);
942                 [CCode (cname="SDL_JoystickIndex")]
943                 public int index();
945                 [CCode (cname="SDL_JoystickNumAxes")]
946                 public int num_axes();
948                 [CCode (cname="SDL_JoystickNumBalls")]
949                 public int num_balls();
951                 [CCode (cname="SDL_JoystickNumHats")]
952                 public int num_hats();
954                 [CCode (cname="SDL_JoystickNumButtons")]
955                 public int num_buttons();
957                 [CCode (cname="SDL_JoystickGetAxis")]
958                 public int16 get_axis(int axis);
960                 [CCode (cname="SDL_JoystickGetHat")]
961                 public HatValue get_hat(int hat);
963                 [CCode (cname="SDL_JoystickGetBall")]
964                 public HatValue get_ball(int ball, ref int dx, ref int dy);
966                 [CCode (cname="SDL_JoystickGetButton")]
967                 public ButtonState get_button(int button);
968         }// Joystick
971         ///
972         /// Audio
973         ///
974         [CCode (cname="int", cprefix="AUDIO_")]
975         public enum AudioFormat {
976                 U8, S8, U16LSB, S16LSB, U16MSB, S16MSB, U16, S16, 
977                 U16SYS, S16SYS
978         }// AudioFormat
980         [CCode (cname="int", cprefix="SDL_AUDIO_")]
981         public enum AudioStatus {
982                 STOPPED, PLAYING, PAUSED
983         }// AudioStatus
985         [CCode (cname="SDL_AudioSpec")]
986         [Compact]
987         public class AudioSpec {
988                 public int freq;
989                 public AudioFormat format;
990                 public uchar channels;
991                 public uchar silence;
992                 public uint16 samples;
993                 public uint16 padding;
994                 public uint32 size;
996                 public void* userdata;
997         }// AudioSpec
999         [CCode (cname="SDL_AudioCVT")]
1000         [Compact]
1001         public class AudioConverter {
1002                 public int needed;
1003                 public AudioFormat src_format;
1004                 public AudioFormat dst_format;
1005                 public double rate_incr;
1007                 public uchar* buf;
1008                 public int len;
1009                 public int len_cvt;
1010                 public int len_mult;
1011                 public double len_ratio;
1012                 public int filter_index;
1014                 [CCode (cname="SDL_BuildAudioCVT")]
1015                 public static int build(AudioConverter cvt, AudioFormat src_format, 
1016                         uchar src_channels, int src_rate, AudioFormat dst_format, 
1017                         uchar dst_channels, int dst_rate);
1019                 [CCode (cname="SDL_ConvertAudio")]
1020                 public int convert();
1021         }// AudioConverter
1023         [Compact]
1024         public class Audio {
1025                 [CCode (cname="SDL_AudioDriverName")]
1026                 public static unowned string driver_name(string namebuf, int maxlen);
1027                 
1028                 [CCode (cname="SDL_OpenAudio")]
1029                 public static int open(AudioSpec desired, AudioSpec obtained);
1031                 [CCode (cname="SDL_GetAudioStatus")]
1032                 public static AudioStatus status();
1034                 [CCode (cname="SDL_PauseAudio")]
1035                 public static void pause(int pause_on);
1037                 [CCode (cname="SDL_LoadWAV_RW")]
1038                 public static AudioSpec load(RWops src, int freesrc=0, AudioSpec spec, uchar** audio_buf, ref uint32 audio_len);
1040                 [CCode (cname="SDL_FreeWAV")]
1041                 public static void free(uchar* audio_buf);
1043                 [CCode (cname="SDL_MixAudio")]
1044                 public static void mix(uchar[] dst, uchar[] src, uint32 len, int volume);
1046                 [CCode (cname="SDL_LockAudio")]
1047                 public static void do_lock();
1049                 [CCode (cname="SDL_UnlockAudio")]
1050                 public static void unlock();
1052                 [CCode (cname="SDL_CloseAudio")]
1053                 public static void close();
1054         }// Audio
1057         ///
1058         /// Threading
1059         ///
1060         public delegate int ThreadFunc(void* data);
1062         [CCode (cname="SDL_Thread", free_function="SDL_WaitThread")]
1063         [Compact]
1064         public class Thread {
1065                 [CCode (cname="SDL_ThreadID")]
1066                 public static uint32 id();
1068                 [CCode (cname="SDL_CreateThread")]
1069                 public Thread(ThreadFunc f, void* data);
1070         }// Thread
1072         [CCode (cname="SDL_mutex", free_function="SDL_DestroyMutex")]
1073         [Compact]
1074         public class Mutex {
1075                 [CCode (cname="SDL_CreateMutex")]
1076                 public Mutex();
1078                 [CCode (cname="SDL_mutexP")]
1079                 public int do_lock();
1081                 [CCode (cname="SDL_mutexV")]
1082                 public int unlock();
1083         }// Mutex
1085         [CCode (cname="SDL_sem", free_function="SDL_DestroySemaphore")]
1086         [Compact]
1087         public class Semaphore {
1088                 [CCode (cname="SDL_CreateSemaphore")]
1089                 public Semaphore(uint32 initial_value);
1091                 [CCode (cname="SDL_SemWait")]
1092                 public int wait();
1094                 [CCode (cname="SDL_SemTryWait")]
1095                 public int try_wait();
1097                 [CCode (cname="SDL_SemWaitTimeout")]
1098                 public int wait_timeout(uint32 ms);
1100                 [CCode (cname="SDL_SemPost")]
1101                 public int post();
1103                 [CCode (cname="SDL_SemValue")]
1104                 public uint32 count();
1105         }// Semaphore
1107         [CCode (cname="SDL_cond", free_function="SDL_DestroyCond")]
1108         [Compact]
1109         public class Condition {
1110                 [CCode (cname="SDL_CreateCond")]
1111                 public Condition();
1113                 [CCode (cname="SDL_CondSignal")]
1114                 public int @signal();
1116                 [CCode (cname="SDL_CondBroadcast")]
1117                 public int broadcast();
1119                 [CCode (cname="SDL_CondWait")]
1120                 public int wait(Mutex mut);
1122                 [CCode (cname="SDL_CondWaitTimeout")]
1123                 public int wait_timeout(Mutex mut, uint32 ms);
1124         }// Condition
1127         ///
1128         /// Timers
1129         ///
1130         public delegate uint32 TimerCallback(uint32 interval, void* param);
1132         [CCode (cname="struct _SDL_TimerID", free_function="SDL_RemoveTimer")]
1133         [Compact]
1134         public class Timer {
1135                 [CCode (cname="SDL_GetTicks")]
1136                 public static uint32 get_ticks();
1138                 [CCode (cname="SDL_Delay")]
1139                 public static void delay(uint32 ms);
1141                 [CCode (cname="SDL_AddTimer")]
1142                 public Timer(uint32 interval, TimerCallback callback, void* param);
1143         }// Timer
1144 }// SDL