1 SDL2.flx
share/lib/sdl/SDL2.flx
open class SDL2
{
requires package "sdl2";
const SDL_INIT_EVERYTHING: uint32;
const SDL_INIT_NOPARACHUTE: uint32;
const SDL_INIT_JOYSTICK: uint32;
const SDL_INIT_HAPTIC: uint32;
const SDL_INIT_CDROM : uint32;
const SDL_INIT_VIDEO: uint32;
const SDL_INIT_AUDIO: uint32;
const SDL_INIT_TIMER: uint32;
proc SDL_Quit: 1;
proc SDL_QuitSubSystem: uint32;
gen SDL_Init: uint32 -> int;
gen SDL_InitSubSystem: uint32 -> int;
fun SDL_WasInit: uint32 -> uint32;
}
include "sdl/SDL_error";
include "sdl/SDL_version";
include "sdl/SDL_video";
include "sdl/SDL_events";
include "sdl/SDL_keyboard";
include "sdl/SDL_keycode";
include "sdl/SDL_scancode";
include "sdl/SDL_mouse";
include "sdl/SDL_rect";
include "sdl/SDL_rwops";
include "sdl/SDL_pixels";
include "sdl/SDL_surface";
include "sdl/SDL_render";
include "sdl/SDL_clipboard";
2 SDL_active.flx
share/lib/sdl/SDL_active.flx
open module SDL_active_h
{
requires package "sdl";
header '#include "SDL_active.h"';
fun SDL_GetAppState: 1 -> uint8;
}
3 SDL_audio.flx
share/lib/sdl/SDL_audio.flx
open module SDL_audio_h
{
requires package "sdl";
header '#include "SDL_audio.h"';
const SDL_MIX_MAXVOLUME : int;
const AUDIO_S16MSB : uint16;
const AUDIO_U16MSB : uint16;
const AUDIO_S16LSB : uint16;
const AUDIO_U16LSB : uint16;
const AUDIO_S16SYS : uint16;
const AUDIO_U16SYS : uint16;
const AUDIO_S16 : uint16;
const AUDIO_U16 : uint16;
const AUDIO_S8 : uint16;
const AUDIO_U8 : uint16;
type SDL_audiostatus = 'SDL_audiostatus';
fun eq:SDL_audiostatus * SDL_audiostatus -> bool = "$1==$2";
cstruct SDL_AudioCVT {
needed: int;
src_format: uint16;
dst_format: uint16;
rate_incr: double;
buf: &uint8;
len: int;
len_cvt: int;
len_mult: int;
len_ratio: double;
filters: &SDL_audio_h_cft_2;
filter_index: int;
};
cstruct SDL_AudioSpec {
freq: int;
format: uint16;
channels: uint8;
silence: uint8;
samples: uint16;
padding: uint16;
size: uint32;
callback_: SDL_audio_h_cft_1;
userdata: address;
};
fun get_callback: SDL_AudioSpec -> SDL_audio_h_cft_1 = "$1.callback";
header '''typedef void (*SDL_audio_h_cft_2)(struct SDL_AudioCVT *, Uint16);''';
type SDL_audio_h_cft_2 = 'SDL_audio_h_cft_2';
header '''typedef void (*SDL_audio_h_cft_1)(void *, Uint8 *, int);''';
type SDL_audio_h_cft_1 = 'SDL_audio_h_cft_1';
typedef flx_audio_callback_arg_t = &uint8 * int;
typedef flx_audio_callback_t = flx_audio_callback_arg_t -> void;
export type (flx_audio_callback_t) as "flx_audio_callback_t";
export type (flx_audio_callback_arg_t) as "flx_audio_callback_arg_t";
header """
void SDL_audio_callback(void *obj, Uint8 *stream, int len);
""";
body """
void SDL_audio_callback(void *obj, Uint8 *stream, int len) {
flx_audio_callback_t callback = (flx_audio_callback_t)obj;
flx::rtl::con_t *p =
callback->
clone()->
call(0,flx_audio_callback_arg_t(stream,len))
;
while(p) p = p->resume();
}
""";
const SDL_AUDIO_PAUSED: SDL_audiostatus = 'SDL_AUDIO_PAUSED';
const SDL_AUDIO_STOPPED: SDL_audiostatus = 'SDL_AUDIO_STOPPED';
const SDL_AUDIO_PLAYING: SDL_audiostatus = 'SDL_AUDIO_PLAYING';
proc SDL_AudioQuit: 1;
proc SDL_CloseAudio: 1;
proc SDL_FreeWAV: &uint8;
proc SDL_LockAudio: 1;
proc SDL_MixAudio: &uint8 * &uint8 * uint32 * int;
proc SDL_PauseAudio: int;
proc SDL_UnlockAudio: 1;
fun SDL_AudioDriverName: &char * int -> &char;
fun SDL_AudioInit: &char -> int;
fun SDL_BuildAudioCVT: &SDL_AudioCVT * uint16 * uint8 * int * uint16 * uint8 * int -> int;
fun SDL_ConvertAudio: &SDL_AudioCVT -> int;
fun SDL_GetAudioStatus: 1 -> SDL_audiostatus;
fun SDL_LoadWAV_RW: &SDL_RWops * int * &SDL_AudioSpec * &&uint8 * &uint32 -> &SDL_AudioSpec;
fun SDL_OpenAudio: &SDL_AudioSpec * &SDL_AudioSpec -> int;
fun SDL_LoadWAV: &char * &SDL_AudioSpec * &&uint8 * &uint32 -> &SDL_AudioSpec;
}
4 SDL_cdrom.flx
share/lib/sdl/SDL_cdrom.flx
open module SDL_cdrom_h
{
requires package "sdl";
header '#include "SDL_cdrom.h"';
type CDstatus = 'CDstatus';
cstruct SDL_CD {
id: int;
status: CDstatus;
numtracks: int;
cur_track: int;
cur_frame: int;
track: &SDL_CDtrack;
};
cstruct SDL_CDtrack {
id: uint8;
type_: uint8;
unused: uint16;
length: uint32;
offset: uint32;
};
const CD_TRAYEMPTY: int = 'CD_TRAYEMPTY';
const CD_PLAYING: int = 'CD_PLAYING';
const CD_ERROR: int = 'CD_ERROR';
const CD_PAUSED: int = 'CD_PAUSED';
const CD_STOPPED: int = 'CD_STOPPED';
proc SDL_CDClose: &SDL_CD;
fun SDL_CDEject: &SDL_CD -> int;
fun SDL_CDName: int -> &char;
fun SDL_CDNumDrives: 1 -> int;
fun SDL_CDOpen: int -> &SDL_CD;
fun SDL_CDPause: &SDL_CD -> int;
fun SDL_CDPlay: &SDL_CD * int * int -> int;
fun SDL_CDPlayTracks: &SDL_CD * int * int * int * int -> int;
fun SDL_CDResume: &SDL_CD -> int;
fun SDL_CDStatus: &SDL_CD -> CDstatus;
fun SDL_CDStop: &SDL_CD -> int;
}
5 SDL_clipboard.flx
share/lib/sdl/SDL_clipboard.flx
open class SDL_clipboard_h
{
requires package "sdl2";
gen SDL_SetClipboardText: string -> int = "SDL_SetClipboardText($1.c_str())";
private fun gcbt :1 -> +char = "SDL_GetClipboardText()";
fun SDL_GetClipboardText () : string =
{
var p = gcbt();
var s = string p;
free p;
return s;
}
fun SDL_HasClipboardText: 1 -> bool;
}
6 SDL_endian.flx
share/lib/sdl/SDL_endian.flx
open module SDL_endian_h
{
requires package "sdl";
header '#include "SDL_endian.h"';
fun SDL_ReadBE16: &SDL_RWops -> uint16;
fun SDL_ReadBE32: &SDL_RWops -> uint32;
fun SDL_ReadBE64: &SDL_RWops -> uint64;
fun SDL_ReadLE16: &SDL_RWops -> uint16;
fun SDL_ReadLE32: &SDL_RWops -> uint32;
fun SDL_ReadLE64: &SDL_RWops -> uint64;
fun SDL_Swap16: uint16 -> uint16;
fun SDL_Swap32: uint32 -> uint32;
fun SDL_Swap64: uint64 -> uint64;
fun SDL_WriteBE16: &SDL_RWops * uint16 -> int;
fun SDL_WriteBE32: &SDL_RWops * uint32 -> int;
fun SDL_WriteBE64: &SDL_RWops * uint64 -> int;
fun SDL_WriteLE16: &SDL_RWops * uint16 -> int;
fun SDL_WriteLE32: &SDL_RWops * uint32 -> int;
fun SDL_WriteLE64: &SDL_RWops * uint64 -> int;
}
7 SDL_error.flx
share/lib/sdl/SDL_error.flx
open class SDL_error_h
{
requires package "sdl2";
proc SDL_ClearError: 1;
fun SDL_GetError: 1 -> string = "::std::string(SDL_GetError())";
}
8 SDL_events.flx
share/lib/sdl/SDL_events.flx
open class SDL_events_h
{
requires package "sdl2";
cenum SDL_EventType =
SDL_FIRSTEVENT,
SDL_QUIT,
SDL_APP_TERMINATING,
SDL_APP_LOWMEMORY,
SDL_APP_WILLENTERBACKGROUND,
SDL_APP_DIDENTERBACKGROUND,
SDL_APP_WILLENTERFOREGROUND,
SDL_APP_DIDENTERFOREGROUND,
SDL_WINDOWEVENT,
SDL_SYSWMEVENT,
SDL_KEYDOWN,
SDL_KEYUP,
SDL_TEXTEDITING,
SDL_TEXTINPUT,
SDL_MOUSEMOTION,
SDL_MOUSEBUTTONDOWN,
SDL_MOUSEBUTTONUP,
SDL_MOUSEWHEEL,
SDL_JOYAXISMOTION,
SDL_JOYBALLMOTION,
SDL_JOYHATMOTION,
SDL_JOYBUTTONDOWN,
SDL_JOYBUTTONUP,
SDL_JOYDEVICEADDED,
SDL_JOYDEVICEREMOVED,
SDL_CONTROLLERAXISMOTION,
SDL_CONTROLLERBUTTONDOWN,
SDL_CONTROLLERBUTTONUP,
SDL_CONTROLLERDEVICEADDED,
SDL_CONTROLLERDEVICEREMOVED,
SDL_CONTROLLERDEVICEREMAPPED,
SDL_FINGERDOWN,
SDL_FINGERUP,
SDL_FINGERMOTION,
SDL_DOLLARGESTURE,
SDL_DOLLARRECORD,
SDL_MULTIGESTURE,
SDL_CLIPBOARDUPDATE,
SDL_DROPFILE,
SDL_USEREVENT,
SDL_LASTEVENT
;
instance Str[SDL_EventType] {
fun str: SDL_EventType -> string =
| $(SDL_FIRSTEVENT) => "SDL_FIRSTEVENT"
| $(SDL_QUIT) => "SDL_QUIT"
| $(SDL_APP_TERMINATING) => "SDL_APP_TERMINATING"
| $(SDL_APP_LOWMEMORY) => "SDL_APP_LOWMEMORY"
| $(SDL_APP_WILLENTERBACKGROUND) => "SDL_APP_WILLENTERBACKGROUND"
| $(SDL_APP_DIDENTERBACKGROUND) => "SDL_APP_DIDENTERBACKGROUND"
| $(SDL_APP_WILLENTERFOREGROUND) => "SDL_APP_WILLENTERFOREGROUND"
| $(SDL_APP_DIDENTERFOREGROUND) => "SDL_APP_DIDENTERFOREGROUND"
| $(SDL_WINDOWEVENT) => "SDL_WINDOWEVENT"
| $(SDL_SYSWMEVENT) => "SDL_SYSWMEVENT"
| $(SDL_KEYDOWN) => "SDL_KEYDOWN"
| $(SDL_KEYUP) => "SDL_KEYUP"
| $(SDL_TEXTEDITING) => "SDL_TEXTEDITING"
| $(SDL_TEXTINPUT) => "SDL_TEXTINPUT"
| $(SDL_MOUSEMOTION) => "SDL_MOUSEMOTION"
| $(SDL_MOUSEBUTTONDOWN) => "SDL_MOUSEBUTTONDOWN"
| $(SDL_MOUSEBUTTONUP) => "SDL_MOUSEBUTTONUP"
| $(SDL_MOUSEWHEEL) => "SDL_MOUSEWHEEL"
| $(SDL_JOYAXISMOTION) => "SDL_JOYAXISMOTION"
| $(SDL_JOYBALLMOTION) => "SDL_JOYBALLMOTION"
| $(SDL_JOYHATMOTION) => "SDL_JOYHATMOTION"
| $(SDL_JOYBUTTONDOWN) => "SDL_JOYBUTTONDOWN"
| $(SDL_JOYBUTTONUP) => "SDL_JOYBUTTONUP"
| $(SDL_JOYDEVICEADDED) => "SDL_JOYDEVICEADDED"
| $(SDL_JOYDEVICEREMOVED) => "SDL_JOYDEVICEREMOVED"
| $(SDL_CONTROLLERAXISMOTION) => "SDL_CONTROLLERAXISMOTION"
| $(SDL_CONTROLLERBUTTONDOWN) => "SDL_CONTROLLERBUTTONDOWN"
| $(SDL_CONTROLLERBUTTONUP) => "SDL_CONTROLLERBUTTONUP"
| $(SDL_CONTROLLERDEVICEADDED) => "SDL_CONTROLLERDEVICEADDED"
| $(SDL_CONTROLLERDEVICEREMOVED) => "SDL_CONTROLLERDEVICEREMOVED"
| $(SDL_CONTROLLERDEVICEREMAPPED) => "SDL_CONTROLLERDEVICEREMAPPED"
| $(SDL_FINGERDOWN) => "SDL_FINGERDOWN"
| $(SDL_FINGERUP) => "SDL_FINGERUP"
| $(SDL_FINGERMOTION) => "SDL_FINGERMOTION"
| $(SDL_DOLLARGESTURE) => "SDL_DOLLARGESTURE"
| $(SDL_DOLLARRECORD) => "SDL_DOLLARRECORD"
| $(SDL_MULTIGESTURE) => "SDL_MULTIGESTURE"
| $(SDL_CLIPBOARDUPDATE) => "SDL_CLIPBOARDUPDATE"
| $(SDL_DROPFILE) => "SDL_DROPFILE"
| $(SDL_USEREVENT) => "SDL_USEREVENT"
| x => "UNKNOWN_EVENT #"+x.uint32.str
;
}
ctor uint32 : SDL_EventType = "(uint32_t)$1";
ctor SDL_EventType : uint32 = "(SDL_EventType)$1";
cenum SDL_WindowEventID =
SDL_WINDOWEVENT_NONE,
SDL_WINDOWEVENT_SHOWN,
SDL_WINDOWEVENT_HIDDEN,
SDL_WINDOWEVENT_EXPOSED,
SDL_WINDOWEVENT_MOVED,
SDL_WINDOWEVENT_RESIZED,
SDL_WINDOWEVENT_SIZE_CHANGED,
SDL_WINDOWEVENT_MINIMIZED,
SDL_WINDOWEVENT_MAXIMIZED,
SDL_WINDOWEVENT_RESTORED,
SDL_WINDOWEVENT_ENTER,
SDL_WINDOWEVENT_LEAVE,
SDL_WINDOWEVENT_FOCUS_GAINED,
SDL_WINDOWEVENT_FOCUS_LOST,
SDL_WINDOWEVENT_CLOSE
;
instance Str[SDL_WindowEventID] {
fun str : SDL_WindowEventID -> string =
| $(SDL_WINDOWEVENT_NONE) => "none"
| $(SDL_WINDOWEVENT_SHOWN) => "shown"
| $(SDL_WINDOWEVENT_HIDDEN) => "hidden"
| $(SDL_WINDOWEVENT_EXPOSED) => "exposed"
| $(SDL_WINDOWEVENT_MOVED) => "moved"
| $(SDL_WINDOWEVENT_RESIZED) => "resized"
| $(SDL_WINDOWEVENT_SIZE_CHANGED) => "size_changed"
| $(SDL_WINDOWEVENT_MINIMIZED) => "minimised"
| $(SDL_WINDOWEVENT_MAXIMIZED) => "maximised"
| $(SDL_WINDOWEVENT_RESTORED) => "restored"
| $(SDL_WINDOWEVENT_ENTER) => "enter"
| $(SDL_WINDOWEVENT_LEAVE) => "leave"
| $(SDL_WINDOWEVENT_FOCUS_GAINED) => "focus_gained"
| $(SDL_WINDOWEVENT_FOCUS_LOST) => "focus_lost"
| $(SDL_WINDOWEVENT_CLOSE) => "close"
| x => "UnknownWindowEvent #"+x.uint8.str
;
}
ctor uint8 : SDL_WindowEventID = "(uint8_t)$1";
ctor SDL_WindowEventID : uint8 = "(SDL_WindowEventID)$1";
cstruct SDL_Event {
type : uint32;
window : SDL_WindowEvent;
key : SDL_KeyboardEvent;
edit : SDL_TextEditingEvent;
text : SDL_TextInputEvent;
motion : SDL_MouseMotionEvent;
button : SDL_MouseButtonEvent;
wheel : SDL_MouseWheelEvent;
quit : SDL_QuitEvent;
user : SDL_UserEvent;
syswm : SDL_SysWMEvent;
drop : SDL_DropEvent;
};
typedef struct SDL_CommonEvent
{
uint32 type;
uint32 timestamp;
} SDL_CommonEvent;
typedef struct SDL_WindowEvent
{
uint32 type;
uint32 timestamp;
uint32 windowID;
uint8 event;
uint8 padding1;
uint8 padding2;
uint8 padding3;
int32 data1;
int32 data2;
} SDL_WindowEvent;
typedef struct SDL_KeyboardEvent
{
uint32 type;
uint32 timestamp;
uint32 windowID;
uint8 state;
uint8 repeat;
uint8 padding2;
uint8 padding3;
SDL_Keysym keysym;
} SDL_KeyboardEvent;
macro val SDL_TEXTEDITINGEVENT_TEXT_SIZE = 32;
typedef struct SDL_TextEditingEvent
{
uint32 type;
uint32 timestamp;
uint32 windowID;
+char text;
int32 start;
int32 length;
} SDL_TextEditingEvent;
macro val SDL_TEXTINPUTEVENT_TEXT_SIZE = 32;
typedef struct SDL_TextInputEvent
{
uint32 type;
uint32 timestamp;
uint32 windowID;
+char text;
} SDL_TextInputEvent;
typedef struct SDL_MouseMotionEvent
{
uint32 type;
uint32 timestamp;
uint32 windowID;
uint32 which;
uint32 state;
int32 x;
int32 y;
int32 xrel;
int32 yrel;
} SDL_MouseMotionEvent;
typedef struct SDL_MouseButtonEvent
{
uint32 type;
uint32 timestamp;
uint32 windowID;
uint32 which;
uint8 button;
uint8 state;
uint8 padding1;
uint8 padding2;
int32 x;
int32 y;
} SDL_MouseButtonEvent;
typedef struct SDL_MouseWheelEvent
{
uint32 type;
uint32 timestamp;
uint32 windowID;
uint32 which;
int32 x;
int32 y;
} SDL_MouseWheelEvent;
typedef struct SDL_DropEvent
{
uint32 type;
uint32 timestamp;
+char file;
} SDL_DropEvent;
typedef struct SDL_QuitEvent
{
uint32 type;
uint32 timestamp;
} SDL_QuitEvent;
typedef struct SDL_OSEvent
{
uint32 type;
uint32 timestamp;
} SDL_OSEvent;
typedef struct SDL_UserEvent
{
uint32 type;
uint32 timestamp;
uint32 windowID;
int32 n"code";
address data1;
address data2;
} SDL_UserEvent;
typedef struct SDL_SysWMEvent
{
uint32 type;
uint32 timestamp;
address msg;
} SDL_SysWMEvent;
fun SDL_GetWindowID (w:SDL_Event) : opt[uint32] =>
match w.type.SDL_EventType with
| $(SDL_WINDOWEVENT) => Some w.window.windowID
| $(SDL_KEYDOWN) => Some w.key.windowID
| $(SDL_KEYUP) => Some w.key.windowID
| $(SDL_TEXTEDITING) => Some w.edit.windowID
| $(SDL_TEXTINPUT) => Some w.text.windowID
| $(SDL_MOUSEMOTION) => Some w.motion.windowID
| $(SDL_MOUSEBUTTONDOWN) => Some w.button.windowID
| $(SDL_MOUSEBUTTONUP) => Some w.button.windowID
| $(SDL_MOUSEWHEEL) => Some w.wheel.windowID
| _ => None[uint32]
endmatch
;
cenum SDL_eventaction =
SDL_ADDEVENT,
SDL_PEEKEVENT,
SDL_GETEVENT
;
gen SDL_PeepEvents:
+SDL_Event * int *
SDL_eventaction *
uint32 * uint32
-> int
;
proc SDL_PumpEvents: 1;
fun SDL_HasEvent:uint32 -> bool;
fun SDL_HasEvents:uint32 * uint32 -> bool;
proc SDL_FlushEvent:uint32;
proc SDL_FlushEvents: uint32 * uint32 ;
gen SDL_PollEvent: &SDL_Event -> int;
gen SDL_WaitEvent: &SDL_Event -> int;
gen SDL_WaitEventTimeout: &SDL_Event * int -> int;
gen SDL_PushEvent: &SDL_Event -> int;
typedef SDL_EventFilter = address * &SDL_Event --> int;
proc SDL_SetEventFilter: SDL_EventFilter * address;
gen SDL_GetEventFilter: &SDL_EventFilter * &address -> bool;
proc SDL_AddEventWatch: SDL_EventFilter * address;
proc SDL_DelEventWatch: SDL_EventFilter * address;
proc SDL_FilterEvents:SDL_EventFilter * address;
const SDL_QUERY : int;
const SDL_IGNORE: int;
const SDL_DISABLE : int;
const SDL_ENABLE : int;
gen SDL_EventState:uint32 * int -> int = "(int)SDL_EventState ($1,$2)";
}
9 SDL_framerate.flx
share/lib/sdl/SDL_framerate.flx
open module SDL_framerate_h
{
requires package "sdl";
header '#include "SDL_framerate.h"';
type FPSmanager = 'FPSmanager';
proc SDL_framerateDelay: &FPSmanager;
proc SDL_initFramerate: &FPSmanager;
fun SDL_getFramerate: &FPSmanager -> int;
fun SDL_setFramerate: &FPSmanager * int -> int;
}
10 SDL_gfxPrimitives.flx
share/lib/sdl/SDL_gfxPrimitives.flx
open module SDL_gfxPrimitives_h
{
requires package "sdl";
header '#include "SDL_gfxPrimitives.h"';
fun aacircleColor: &SDL_Surface * int16 * int16 * int16 * uint32 -> int;
fun aacircleRGBA: &SDL_Surface * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun aaellipseColor: &SDL_Surface * int16 * int16 * int16 * int16 * uint32 -> int;
fun aaellipseRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun aalineColor: &SDL_Surface * int16 * int16 * int16 * int16 * uint32 -> int;
fun aalineRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun aapolygonColor: &SDL_Surface * &int16 * &int16 * int * uint32 -> int;
fun aapolygonRGBA: &SDL_Surface * &int16 * &int16 * int * uint8 * uint8 * uint8 * uint8 -> int;
fun aatrigonColor: &SDL_Surface * int16 * int16 * int16 * int16 * int16 * int16 * uint32 -> int;
fun aatrigonRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun bezierColor: &SDL_Surface * &int16 * &int16 * int * int * uint32 -> int;
fun bezierRGBA: &SDL_Surface * &int16 * &int16 * int * int * uint8 * uint8 * uint8 * uint8 -> int;
fun boxColor: &SDL_Surface * int16 * int16 * int16 * int16 * uint32 -> int;
fun boxRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun characterColor: &SDL_Surface * int16 * int16 * char * uint32 -> int;
fun characterRGBA: &SDL_Surface * int16 * int16 * char * uint8 * uint8 * uint8 * uint8 -> int;
fun circleColor: &SDL_Surface * int16 * int16 * int16 * uint32 -> int;
fun circleRGBA: &SDL_Surface * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun ellipseColor: &SDL_Surface * int16 * int16 * int16 * int16 * uint32 -> int;
fun ellipseRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun filledCircleColor: &SDL_Surface * int16 * int16 * int16 * uint32 -> int;
fun filledCircleRGBA: &SDL_Surface * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun filledEllipseColor: &SDL_Surface * int16 * int16 * int16 * int16 * uint32 -> int;
fun filledEllipseRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun filledPolygonColor: &SDL_Surface * &int16 * &int16 * int * int -> int;
fun filledPolygonRGBA: &SDL_Surface * &int16 * &int16 * int * uint8 * uint8 * uint8 * uint8 -> int;
fun filledTrigonColor: &SDL_Surface * int16 * int16 * int16 * int16 * int16 * int16 * int -> int;
fun filledTrigonRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun filledpieColor: &SDL_Surface * int16 * int16 * int16 * int16 * int16 * uint32 -> int;
fun filledpieRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun hlineColor: &SDL_Surface * int16 * int16 * int16 * uint32 -> int;
fun hlineRGBA: &SDL_Surface * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun lineColor: &SDL_Surface * int16 * int16 * int16 * int16 * uint32 -> int;
fun lineRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun pixelColor: &SDL_Surface * int16 * int16 * uint32 -> int;
fun pixelRGBA: &SDL_Surface * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun polygonColor: &SDL_Surface * &int16 * &int16 * int * uint32 -> int;
fun polygonRGBA: &SDL_Surface * &int16 * &int16 * int * uint8 * uint8 * uint8 * uint8 -> int;
fun rectangleColor: &SDL_Surface * int16 * int16 * int16 * int16 * uint32 -> int;
fun rectangleRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun stringColor: &SDL_Surface * int16 * int16 * &char * uint32 -> int;
fun stringRGBA: &SDL_Surface * int16 * int16 * &char * uint8 * uint8 * uint8 * uint8 -> int;
fun trigonColor: &SDL_Surface * int16 * int16 * int16 * int16 * int16 * int16 * uint32 -> int;
fun trigonRGBA: &SDL_Surface * int16 * int16 * int16 * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
fun vlineColor: &SDL_Surface * int16 * int16 * int16 * uint32 -> int;
fun vlineRGBA: &SDL_Surface * int16 * int16 * int16 * uint8 * uint8 * uint8 * uint8 -> int;
}
11 SDL_gfxPrimitives_font.flx
share/lib/sdl/SDL_gfxPrimitives_font.flx
open module SDL_gfxPrimitives_font_h
{
requires package "sdl";
header '#include "SDL_gfxPrimitives_font.h"';
const gfxPrimitivesFontdata: &utiny = 'gfxPrimitivesFontdata';
}
12 SDL_image.flx
share/lib/sdl/SDL_image.flx
open class SDL_image_h
{
requires package "sdl2", package "sdl2_image";
fun IMG_Linked_Version: 1 -> SDL_version = "*(IMG_Linked_Version())";
proc IMG_Compiled_Version: &SDL_version = "SDL_IMAGE_VERSION($1);";
fun IMG_Compiled_Version () : SDL_version = {
var v: SDL_version;
IMG_Compiled_Version$ &v;
return v;
}
const IMG_INIT_JPG : uint32 ;
const IMG_INIT_PNG : uint32 ;
const IMG_INIT_TIF : uint32 ;
const IMG_INIT_WEBP : uint32 ;
gen IMG_Init : uint32 -> int;
gen IMG_GetError: 1 -> string = "::std::string(IMG_GetError())";
proc IMG_Quit: 1;
fun IMG_InvertAlpha: int -> int;
fun IMG_Load: +char -> &SDL_Surface;
fun IMG_LoadBMP_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadGIF_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadJPG_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadLBM_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadPCX_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadPNG_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadPNM_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadTGA_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadTIF_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadTyped_RW: SDL_RWops * int * &char -> &SDL_Surface;
fun IMG_LoadXCF_RW: SDL_RWops -> &SDL_Surface;
fun IMG_LoadXPM_RW: SDL_RWops -> &SDL_Surface;
fun IMG_Load_RW: SDL_RWops * int -> &SDL_Surface;
fun IMG_ReadXPMFromArray: &&char -> &SDL_Surface;
fun IMG_isBMP: SDL_RWops -> int;
fun IMG_isGIF: SDL_RWops -> int;
fun IMG_isJPG: SDL_RWops -> int;
fun IMG_isLBM: SDL_RWops -> int;
fun IMG_isPCX: SDL_RWops -> int;
fun IMG_isPNG: SDL_RWops -> int;
fun IMG_isPNM: SDL_RWops -> int;
fun IMG_isTIF: SDL_RWops -> int;
fun IMG_isXCF: SDL_RWops -> int;
fun IMG_isXPM: SDL_RWops -> int;
}
13 SDL_imageFilter.flx
share/lib/sdl/SDL_imageFilter.flx
open module SDL_imageFilter_h
{
requires package "sdl";
header '#include "SDL_imageFilter.h"';
proc SDL_imageFilterAlignStack: 1;
proc SDL_imageFilterMMXoff: 1;
proc SDL_imageFilterMMXon: 1;
proc SDL_imageFilterRestoreStack: 1;
fun SDL_imageFilterAbsDiff: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterAdd: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterAddByte: &utiny * &utiny * int * utiny -> int;
fun SDL_imageFilterAddByteToHalf: &utiny * &utiny * int * utiny -> int;
fun SDL_imageFilterBinarizeUsingThreshold: &utiny * &utiny * int * utiny -> int;
fun SDL_imageFilterBitAnd: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterBitNegation: &utiny * &utiny * int -> int;
fun SDL_imageFilterBitOr: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterClipToRange: &utiny * &utiny * int * utiny * utiny -> int;
fun SDL_imageFilterConvolveKernel3x3Divide: &utiny * &utiny * int * int * &short * utiny -> int;
fun SDL_imageFilterConvolveKernel3x3ShiftRight: &utiny * &utiny * int * int * &short * utiny -> int;
fun SDL_imageFilterConvolveKernel5x5Divide: &utiny * &utiny * int * int * &short * utiny -> int;
fun SDL_imageFilterConvolveKernel5x5ShiftRight: &utiny * &utiny * int * int * &short * utiny -> int;
fun SDL_imageFilterConvolveKernel7x7Divide: &utiny * &utiny * int * int * &short * utiny -> int;
fun SDL_imageFilterConvolveKernel7x7ShiftRight: &utiny * &utiny * int * int * &short * utiny -> int;
fun SDL_imageFilterConvolveKernel9x9Divide: &utiny * &utiny * int * int * &short * utiny -> int;
fun SDL_imageFilterConvolveKernel9x9ShiftRight: &utiny * &utiny * int * int * &short * utiny -> int;
fun SDL_imageFilterDiv: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterMMXdetect: 1 -> int;
fun SDL_imageFilterMean: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterMult: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterMultByByte: &utiny * &utiny * int * utiny -> int;
fun SDL_imageFilterMultDivby2: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterMultDivby4: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterMultNor: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterNormalizeLinear: &utiny * &utiny * int * int * int * int * int -> int;
fun SDL_imageFilterShiftLeft: &utiny * &utiny * int * utiny -> int;
fun SDL_imageFilterShiftLeftByte: &utiny * &utiny * int * utiny -> int;
fun SDL_imageFilterShiftRight: &utiny * &utiny * int * utiny -> int;
fun SDL_imageFilterShiftRightAndMultByByte: &utiny * &utiny * int * utiny * utiny -> int;
fun SDL_imageFilterSobelX: &utiny * &utiny * int * int -> int;
fun SDL_imageFilterSobelXShiftRight: &utiny * &utiny * int * int * utiny -> int;
fun SDL_imageFilterSub: &utiny * &utiny * &utiny * int -> int;
fun SDL_imageFilterSubByte: &utiny * &utiny * int * utiny -> int;
}
14 SDL_joystick.flx
share/lib/sdl/SDL_joystick.flx
open module SDL_joystick_h
{
requires package "sdl";
header '#include "SDL_joystick.h"';
type _struct__SDL_Joystick = 'struct _SDL_Joystick';
typedef SDL_Joystick = _struct__SDL_Joystick;
proc SDL_JoystickClose: &SDL_Joystick;
proc SDL_JoystickUpdate: 1;
fun SDL_JoystickEventState: int -> int;
fun SDL_JoystickGetAxis: &SDL_Joystick * int -> int16;
fun SDL_JoystickGetBall: &SDL_Joystick * int * &int * &int -> int;
fun SDL_JoystickGetButton: &SDL_Joystick * int -> uint8;
fun SDL_JoystickGetHat: &SDL_Joystick * int -> uint8;
fun SDL_JoystickIndex: &SDL_Joystick -> int;
fun SDL_JoystickName: int -> &char;
fun SDL_JoystickNumAxes: &SDL_Joystick -> int;
fun SDL_JoystickNumBalls: &SDL_Joystick -> int;
fun SDL_JoystickNumButtons: &SDL_Joystick -> int;
fun SDL_JoystickNumHats: &SDL_Joystick -> int;
fun SDL_JoystickOpen: int -> &SDL_Joystick;
fun SDL_JoystickOpened: int -> int;
fun SDL_NumJoysticks: 1 -> int;
}
15 SDL_keyboard.flx
share/lib/sdl/SDL_keyboard.flx
open module SDL_keyboard_h
{
requires package "sdl2";
typedef struct SDL_Keysym
{
SDL_Scancode scancode;
SDL_Keycode sym;
uint16 mod;
uint32 unicode;
} SDL_Keysym;
}
16 SDL_keycode.flx
share/lib/sdl/SDL_keycode.flx
open class SDL_keycode_h
{
requires package "sdl2";
cenum SDL_Keycode =
SDLK_UNKNOWN,
SDLK_RETURN,
SDLK_ESCAPE,
SDLK_BACKSPACE,
SDLK_TAB,
SDLK_SPACE,
SDLK_EXCLAIM,
SDLK_QUOTEDBL,
SDLK_HASH,
SDLK_PERCENT,
SDLK_DOLLAR,
SDLK_AMPERSAND,
SDLK_QUOTE,
SDLK_LEFTPAREN,
SDLK_RIGHTPAREN,
SDLK_ASTERISK,
SDLK_PLUS,
SDLK_COMMA,
SDLK_MINUS,
SDLK_PERIOD,
SDLK_SLASH,
SDLK_0,
SDLK_1,
SDLK_2,
SDLK_3,
SDLK_4,
SDLK_5,
SDLK_6,
SDLK_7,
SDLK_8,
SDLK_9,
SDLK_COLON,
SDLK_SEMICOLON,
SDLK_LESS,
SDLK_EQUALS,
SDLK_GREATER,
SDLK_QUESTION,
SDLK_AT,
SDLK_LEFTBRACKET,
SDLK_BACKSLASH,
SDLK_RIGHTBRACKET,
SDLK_CARET,
SDLK_UNDERSCORE,
SDLK_BACKQUOTE,
SDLK_a,
SDLK_b,
SDLK_c,
SDLK_d,
SDLK_e,
SDLK_f,
SDLK_g,
SDLK_h,
SDLK_i,
SDLK_j,
SDLK_k,
SDLK_l,
SDLK_m,
SDLK_n,
SDLK_o,
SDLK_p,
SDLK_q,
SDLK_r,
SDLK_s,
SDLK_t,
SDLK_u,
SDLK_v,
SDLK_w,
SDLK_x,
SDLK_y,
SDLK_z,
SDLK_CAPSLOCK,
SDLK_F1,
SDLK_F2,
SDLK_F3,
SDLK_F4,
SDLK_F5,
SDLK_F6,
SDLK_F7,
SDLK_F8,
SDLK_F9,
SDLK_F10,
SDLK_F11,
SDLK_F12,
SDLK_PRINTSCREEN,
SDLK_SCROLLLOCK,
SDLK_PAUSE,
SDLK_INSERT,
SDLK_HOME,
SDLK_PAGEUP,
SDLK_DELETE,
SDLK_END,
SDLK_PAGEDOWN,
SDLK_RIGHT,
SDLK_LEFT,
SDLK_DOWN,
SDLK_UP,
SDLK_NUMLOCKCLEAR,
SDLK_KP_DIVIDE,
SDLK_KP_MULTIPLY,
SDLK_KP_MINUS,
SDLK_KP_PLUS,
SDLK_KP_ENTER,
SDLK_KP_1,
SDLK_KP_2,
SDLK_KP_3,
SDLK_KP_4,
SDLK_KP_5,
SDLK_KP_6,
SDLK_KP_7,
SDLK_KP_8,
SDLK_KP_9,
SDLK_KP_0,
SDLK_KP_PERIOD,
SDLK_APPLICATION,
SDLK_POWER,
SDLK_KP_EQUALS,
SDLK_F13,
SDLK_F14,
SDLK_F15,
SDLK_F16,
SDLK_F17,
SDLK_F18,
SDLK_F19,
SDLK_F20,
SDLK_F21,
SDLK_F22,
SDLK_F23,
SDLK_F24,
SDLK_EXECUTE,
SDLK_HELP,
SDLK_MENU,
SDLK_SELECT,
SDLK_STOP,
SDLK_AGAIN,
SDLK_UNDO,
SDLK_CUT,
SDLK_COPY,
SDLK_PASTE,
SDLK_FIND,
SDLK_MUTE,
SDLK_VOLUMEUP,
SDLK_VOLUMEDOWN,
SDLK_KP_COMMA,
SDLK_KP_EQUALSAS400,
SDLK_ALTERASE,
SDLK_SYSREQ,
SDLK_CANCEL,
SDLK_CLEAR,
SDLK_PRIOR,
SDLK_RETURN2,
SDLK_SEPARATOR,
SDLK_OUT,
SDLK_OPER,
SDLK_CLEARAGAIN,
SDLK_CRSEL,
SDLK_EXSEL,
SDLK_KP_00,
SDLK_KP_000,
SDLK_THOUSANDSSEPARATOR,
SDLK_DECIMALSEPARATOR,
SDLK_CURRENCYUNIT,
SDLK_CURRENCYSUBUNIT,
SDLK_KP_LEFTPAREN,
SDLK_KP_RIGHTPAREN,
SDLK_KP_LEFTBRACE,
SDLK_KP_RIGHTBRACE,
SDLK_KP_TAB,
SDLK_KP_BACKSPACE,
SDLK_KP_A,
SDLK_KP_B,
SDLK_KP_C,
SDLK_KP_D,
SDLK_KP_E,
SDLK_KP_F,
SDLK_KP_XOR,
SDLK_KP_POWER,
SDLK_KP_PERCENT,
SDLK_KP_LESS,
SDLK_KP_GREATER,
SDLK_KP_AMPERSAND,
SDLK_KP_DBLAMPERSAND,
SDLK_KP_VERTICALBAR,
SDLK_KP_DBLVERTICALBAR,
SDLK_KP_COLON,
SDLK_KP_HASH,
SDLK_KP_SPACE,
SDLK_KP_AT,
SDLK_KP_EXCLAM,
SDLK_KP_MEMSTORE,
SDLK_KP_MEMRECALL,
SDLK_KP_MEMCLEAR,
SDLK_KP_MEMADD,
SDLK_KP_MEMSUBTRACT,
SDLK_KP_MEMMULTIPLY,
SDLK_KP_MEMDIVIDE,
SDLK_KP_PLUSMINUS,
SDLK_KP_CLEAR,
SDLK_KP_CLEARENTRY,
SDLK_KP_BINARY,
SDLK_KP_OCTAL,
SDLK_KP_DECIMAL,
SDLK_KP_HEXADECIMAL,
SDLK_LCTRL,
SDLK_LSHIFT,
SDLK_LALT,
SDLK_LGUI,
SDLK_RCTRL,
SDLK_RSHIFT,
SDLK_RALT,
SDLK_RGUI,
SDLK_MODE,
SDLK_AUDIONEXT,
SDLK_AUDIOPREV,
SDLK_AUDIOSTOP,
SDLK_AUDIOPLAY,
SDLK_AUDIOMUTE,
SDLK_MEDIASELECT,
SDLK_WWW,
SDLK_MAIL,
SDLK_CALCULATOR,
SDLK_COMPUTER,
SDLK_AC_SEARCH,
SDLK_AC_HOME,
SDLK_AC_BACK,
SDLK_AC_FORWARD,
SDLK_AC_STOP,
SDLK_AC_REFRESH,
SDLK_AC_BOOKMARKS,
SDLK_BRIGHTNESSDOWN,
SDLK_BRIGHTNESSUP,
SDLK_DISPLAYSWITCH,
SDLK_KBDILLUMTOGGLE,
SDLK_KBDILLUMDOWN,
SDLK_KBDILLUMUP,
SDLK_EJECT,
SDLK_SLEEP
;
ctor int : SDL_Keycode = "(int)$1";
ctor SDL_Keycode : int = "(SDL_Keycode)$1";
instance Str[SDL_Keycode] {
fun str : SDL_Keycode -> string =
| $(SDLK_UNKNOWN) => "SDLK_UNKNOWN"
| $(SDLK_RETURN) => "SDLK_RETURN"
| $(SDLK_ESCAPE) => "SDLK_ESCAPE"
| $(SDLK_BACKSPACE) => "SDLK_BACKSPACE"
| $(SDLK_TAB) => "SDLK_TAB"
| $(SDLK_SPACE) => "SDLK_SPACE"
| $(SDLK_EXCLAIM) => "SDLK_EXCLAIM"
| $(SDLK_QUOTEDBL) => "SDLK_QUOTEDBL"
| $(SDLK_HASH) => "SDLK_HASH"
| $(SDLK_PERCENT) => "SDLK_PERCENT"
| $(SDLK_DOLLAR) => "SDLK_DOLLAR"
| $(SDLK_AMPERSAND) => "SDLK_AMPERSAND"
| $(SDLK_QUOTE) => "SDLK_QUOTE"
| $(SDLK_LEFTPAREN) => "SDLK_LEFTPAREN"
| $(SDLK_RIGHTPAREN) => "SDLK_RIGHTPAREN"
| $(SDLK_ASTERISK) => "SDLK_ASTERISK"
| $(SDLK_PLUS) => "SDLK_PLUS"
| $(SDLK_COMMA) => "SDLK_COMMA"
| $(SDLK_MINUS) => "SDLK_MINUS"
| $(SDLK_PERIOD) => "SDLK_PERIOD"
| $(SDLK_SLASH) => "SDLK_SLASH"
| $(SDLK_0) => "SDLK_0"
| $(SDLK_1) => "SDLK_1"
| $(SDLK_2) => "SDLK_2"
| $(SDLK_3) => "SDLK_3"
| $(SDLK_4) => "SDLK_4"
| $(SDLK_5) => "SDLK_5"
| $(SDLK_6) => "SDLK_6"
| $(SDLK_7) => "SDLK_7"
| $(SDLK_8) => "SDLK_8"
| $(SDLK_9) => "SDLK_9"
| $(SDLK_COLON) => "SDLK_COLON"
| $(SDLK_SEMICOLON) => "SDLK_SEMICOLON"
| $(SDLK_LESS) => "SDLK_LESS"
| $(SDLK_EQUALS) => "SDLK_EQUALS"
| $(SDLK_GREATER) => "SDLK_GREATER"
| $(SDLK_QUESTION) => "SDLK_QUESTION"
| $(SDLK_AT) => "SDLK_AT"
| $(SDLK_LEFTBRACKET) => "SDLK_LEFTBRACKET"
| $(SDLK_BACKSLASH) => "SDLK_BACKSLASH"
| $(SDLK_RIGHTBRACKET) => "SDLK_RIGHTBRACKET"
| $(SDLK_CARET) => "SDLK_CARET"
| $(SDLK_UNDERSCORE) => "SDLK_UNDERSCORE"
| $(SDLK_BACKQUOTE) => "SDLK_BACKQUOTE"
| $(SDLK_a) => "SDLK_a"
| $(SDLK_b) => "SDLK_b"
| $(SDLK_c) => "SDLK_c"
| $(SDLK_d) => "SDLK_d"
| $(SDLK_e) => "SDLK_e"
| $(SDLK_f) => "SDLK_f"
| $(SDLK_g) => "SDLK_g"
| $(SDLK_h) => "SDLK_h"
| $(SDLK_i) => "SDLK_i"
| $(SDLK_j) => "SDLK_j"
| $(SDLK_k) => "SDLK_k"
| $(SDLK_l) => "SDLK_l"
| $(SDLK_m) => "SDLK_m"
| $(SDLK_n) => "SDLK_n"
| $(SDLK_o) => "SDLK_o"
| $(SDLK_p) => "SDLK_p"
| $(SDLK_q) => "SDLK_q"
| $(SDLK_r) => "SDLK_r"
| $(SDLK_s) => "SDLK_s"
| $(SDLK_t) => "SDLK_t"
| $(SDLK_u) => "SDLK_u"
| $(SDLK_v) => "SDLK_v"
| $(SDLK_w) => "SDLK_w"
| $(SDLK_x) => "SDLK_x"
| $(SDLK_y) => "SDLK_y"
| $(SDLK_z) => "SDLK_z"
| $(SDLK_CAPSLOCK) => "SDLK_CAPSLOCK"
| $(SDLK_F1) => "SDLK_F1"
| $(SDLK_F2) => "SDLK_F2"
| $(SDLK_F3) => "SDLK_F3"
| $(SDLK_F4) => "SDLK_F4"
| $(SDLK_F5) => "SDLK_F5"
| $(SDLK_F6) => "SDLK_F6"
| $(SDLK_F7) => "SDLK_F7"
| $(SDLK_F8) => "SDLK_F8"
| $(SDLK_F9) => "SDLK_F9"
| $(SDLK_F10) => "SDLK_F10"
| $(SDLK_F11) => "SDLK_F11"
| $(SDLK_F12) => "SDLK_F12"
| $(SDLK_PRINTSCREEN) => "SDLK_PRINTSCREEN"
| $(SDLK_SCROLLLOCK) => "SDLK_SCROLLLOCK"
| $(SDLK_PAUSE) => "SDLK_PAUSE"
| $(SDLK_INSERT) => "SDLK_INSERT"
| $(SDLK_HOME) => "SDLK_HOME"
| $(SDLK_PAGEUP) => "SDLK_PAGEUP"
| $(SDLK_DELETE) => "SDLK_DELETE"
| $(SDLK_END) => "SDLK_END"
| $(SDLK_PAGEDOWN) => "SDLK_PAGEDOWN"
| $(SDLK_RIGHT) => "SDLK_RIGHT"
| $(SDLK_LEFT) => "SDLK_LEFT"
| $(SDLK_DOWN) => "SDLK_DOWN"
| $(SDLK_UP) => "SDLK_UP"
| $(SDLK_NUMLOCKCLEAR) => "SDLK_NUMLOCKCLEAR"
| $(SDLK_KP_DIVIDE) => "SDLK_KP_DIVIDE"
| $(SDLK_KP_MULTIPLY) => "SDLK_KP_MULTIPLY"
| $(SDLK_KP_MINUS) => "SDLK_KP_MINUS"
| $(SDLK_KP_PLUS) => "SDLK_KP_PLUS"
| $(SDLK_KP_ENTER) => "SDLK_KP_ENTER"
| $(SDLK_KP_1) => "SDLK_KP_1"
| $(SDLK_KP_2) => "SDLK_KP_2"
| $(SDLK_KP_3) => "SDLK_KP_3"
| $(SDLK_KP_4) => "SDLK_KP_4"
| $(SDLK_KP_5) => "SDLK_KP_5"
| $(SDLK_KP_6) => "SDLK_KP_6"
| $(SDLK_KP_7) => "SDLK_KP_7"
| $(SDLK_KP_8) => "SDLK_KP_8"
| $(SDLK_KP_9) => "SDLK_KP_9"
| $(SDLK_KP_0) => "SDLK_KP_0"
| $(SDLK_KP_PERIOD) => "SDLK_KP_PERIOD"
| $(SDLK_APPLICATION) => "SDLK_APPLICATION"
| $(SDLK_POWER) => "SDLK_POWER"
| $(SDLK_KP_EQUALS) => "SDLK_KP_EQUALS"
| $(SDLK_F13) => "SDLK_F13"
| $(SDLK_F14) => "SDLK_F14"
| $(SDLK_F15) => "SDLK_F15"
| $(SDLK_F16) => "SDLK_F16"
| $(SDLK_F17) => "SDLK_F17"
| $(SDLK_F18) => "SDLK_F18"
| $(SDLK_F19) => "SDLK_F19"
| $(SDLK_F20) => "SDLK_F20"
| $(SDLK_F21) => "SDLK_F21"
| $(SDLK_F22) => "SDLK_F22"
| $(SDLK_F23) => "SDLK_F23"
| $(SDLK_F24) => "SDLK_F24"
| $(SDLK_EXECUTE) => "SDLK_EXECUTE"
| $(SDLK_HELP) => "SDLK_HELP"
| $(SDLK_MENU) => "SDLK_MENU"
| $(SDLK_SELECT) => "SDLK_SELECT"
| $(SDLK_STOP) => "SDLK_STOP"
| $(SDLK_AGAIN) => "SDLK_AGAIN"
| $(SDLK_UNDO) => "SDLK_UNDO"
| $(SDLK_CUT) => "SDLK_CUT"
| $(SDLK_COPY) => "SDLK_COPY"
| $(SDLK_PASTE) => "SDLK_PASTE"
| $(SDLK_FIND) => "SDLK_FIND"
| $(SDLK_MUTE) => "SDLK_MUTE"
| $(SDLK_VOLUMEUP) => "SDLK_VOLUMEUP"
| $(SDLK_VOLUMEDOWN) => "SDLK_VOLUMEDOWN"
| $(SDLK_KP_COMMA) => "SDLK_KP_COMMA"
| $(SDLK_KP_EQUALSAS400) => "SDLK_KP_EQUALSAS400"
| $(SDLK_ALTERASE) => "SDLK_ALTERASE"
| $(SDLK_SYSREQ) => "SDLK_SYSREQ"
| $(SDLK_CANCEL) => "SDLK_CANCEL"
| $(SDLK_CLEAR) => "SDLK_CLEAR"
| $(SDLK_PRIOR) => "SDLK_PRIOR"
| $(SDLK_RETURN2) => "SDLK_RETURN2"
| $(SDLK_SEPARATOR) => "SDLK_SEPARATOR"
| $(SDLK_OUT) => "SDLK_OUT"
| $(SDLK_OPER) => "SDLK_OPER"
| $(SDLK_CLEARAGAIN) => "SDLK_CLEARAGAIN"
| $(SDLK_CRSEL) => "SDLK_CRSEL"
| $(SDLK_EXSEL) => "SDLK_EXSEL"
| $(SDLK_KP_00) => "SDLK_KP_00"
| $(SDLK_KP_000) => "SDLK_KP_000"
| $(SDLK_THOUSANDSSEPARATOR) => "SDLK_THOUSANDSSEPARATOR"
| $(SDLK_DECIMALSEPARATOR) => "SDLK_DECIMALSEPARATOR"
| $(SDLK_CURRENCYUNIT) => "SDLK_CURRENCYUNIT"
| $(SDLK_CURRENCYSUBUNIT) => "SDLK_CURRENCYSUBUNIT"
| $(SDLK_KP_LEFTPAREN) => "SDLK_KP_LEFTPAREN"
| $(SDLK_KP_RIGHTPAREN) => "SDLK_KP_RIGHTPAREN"
| $(SDLK_KP_LEFTBRACE) => "SDLK_KP_LEFTBRACE"
| $(SDLK_KP_RIGHTBRACE) => "SDLK_KP_RIGHTBRACE"
| $(SDLK_KP_TAB) => "SDLK_KP_TAB"
| $(SDLK_KP_BACKSPACE) => "SDLK_KP_BACKSPACE"
| $(SDLK_KP_A) => "SDLK_KP_A"
| $(SDLK_KP_B) => "SDLK_KP_B"
| $(SDLK_KP_C) => "SDLK_KP_C"
| $(SDLK_KP_D) => "SDLK_KP_D"
| $(SDLK_KP_E) => "SDLK_KP_E"
| $(SDLK_KP_F) => "SDLK_KP_F"
| $(SDLK_KP_XOR) => "SDLK_KP_XOR"
| $(SDLK_KP_POWER) => "SDLK_KP_POWER"
| $(SDLK_KP_PERCENT) => "SDLK_KP_PERCENT"
| $(SDLK_KP_LESS) => "SDLK_KP_LESS"
| $(SDLK_KP_GREATER) => "SDLK_KP_GREATER"
| $(SDLK_KP_AMPERSAND) => "SDLK_KP_AMPERSAND"
| $(SDLK_KP_DBLAMPERSAND) => "SDLK_KP_DBLAMPERSAND"
| $(SDLK_KP_VERTICALBAR) => "SDLK_KP_VERTICALBAR"
| $(SDLK_KP_DBLVERTICALBAR) => "SDLK_KP_DBLVERTICALBAR"
| $(SDLK_KP_COLON) => "SDLK_KP_COLON"
| $(SDLK_KP_HASH) => "SDLK_KP_HASH"
| $(SDLK_KP_SPACE) => "SDLK_KP_SPACE"
| $(SDLK_KP_AT) => "SDLK_KP_AT"
| $(SDLK_KP_EXCLAM) => "SDLK_KP_EXCLAM"
| $(SDLK_KP_MEMSTORE) => "SDLK_KP_MEMSTORE"
| $(SDLK_KP_MEMRECALL) => "SDLK_KP_MEMRECALL"
| $(SDLK_KP_MEMCLEAR) => "SDLK_KP_MEMCLEAR"
| $(SDLK_KP_MEMADD) => "SDLK_KP_MEMADD"
| $(SDLK_KP_MEMSUBTRACT) => "SDLK_KP_MEMSUBTRACT"
| $(SDLK_KP_MEMMULTIPLY) => "SDLK_KP_MEMMULTIPLY"
| $(SDLK_KP_MEMDIVIDE) => "SDLK_KP_MEMDIVIDE"
| $(SDLK_KP_PLUSMINUS) => "SDLK_KP_PLUSMINUS"
| $(SDLK_KP_CLEAR) => "SDLK_KP_CLEAR"
| $(SDLK_KP_CLEARENTRY) => "SDLK_KP_CLEARENTRY"
| $(SDLK_KP_BINARY) => "SDLK_KP_BINARY"
| $(SDLK_KP_OCTAL) => "SDLK_KP_OCTAL"
| $(SDLK_KP_DECIMAL) => "SDLK_KP_DECIMAL"
| $(SDLK_KP_HEXADECIMAL) => "SDLK_KP_HEXADECIMAL"
| $(SDLK_LCTRL) => "SDLK_LCTRL"
| $(SDLK_LSHIFT) => "SDLK_LSHIFT"
| $(SDLK_LALT) => "SDLK_LALT"
| $(SDLK_LGUI) => "SDLK_LGUI"
| $(SDLK_RCTRL) => "SDLK_RCTRL"
| $(SDLK_RSHIFT) => "SDLK_RSHIFT"
| $(SDLK_RALT) => "SDLK_RALT"
| $(SDLK_RGUI) => "SDLK_RGUI"
| $(SDLK_MODE) => "SDLK_MODE"
| $(SDLK_AUDIONEXT) => "SDLK_AUDIONEXT"
| $(SDLK_AUDIOPREV) => "SDLK_AUDIOPREV"
| $(SDLK_AUDIOSTOP) => "SDLK_AUDIOSTOP"
| $(SDLK_AUDIOPLAY) => "SDLK_AUDIOPLAY"
| $(SDLK_AUDIOMUTE) => "SDLK_AUDIOMUTE"
| $(SDLK_MEDIASELECT) => "SDLK_MEDIASELECT"
| $(SDLK_WWW) => "SDLK_WWW"
| $(SDLK_MAIL) => "SDLK_MAIL"
| $(SDLK_CALCULATOR) => "SDLK_CALCULATOR"
| $(SDLK_COMPUTER) => "SDLK_COMPUTER"
| $(SDLK_AC_SEARCH) => "SDLK_AC_SEARCH"
| $(SDLK_AC_HOME) => "SDLK_AC_HOME"
| $(SDLK_AC_BACK) => "SDLK_AC_BACK"
| $(SDLK_AC_FORWARD) => "SDLK_AC_FORWARD"
| $(SDLK_AC_STOP) => "SDLK_AC_STOP"
| $(SDLK_AC_REFRESH) => "SDLK_AC_REFRESH"
| $(SDLK_AC_BOOKMARKS) => "SDLK_AC_BOOKMARKS"
| $(SDLK_BRIGHTNESSDOWN) => "SDLK_BRIGHTNESSDOWN"
| $(SDLK_BRIGHTNESSUP) => "SDLK_BRIGHTNESSUP"
| $(SDLK_DISPLAYSWITCH) => "SDLK_DISPLAYSWITCH"
| $(SDLK_KBDILLUMTOGGLE) => "SDLK_KBDILLUMTOGGLE"
| $(SDLK_KBDILLUMDOWN) => "SDLK_KBDILLUMDOWN"
| $(SDLK_KBDILLUMUP) => "SDLK_KBDILLUMUP"
| $(SDLK_EJECT) => "SDLK_EJECT"
| $(SDLK_SLEEP) => "SDL_EJECT"
| other => "KEY_"+other.int.str
;
}
cflags SDL_Keymod =
KMOD_NONE,
KMOD_LSHIFT,
KMOD_RSHIFT,
KMOD_LCTRL,
KMOD_RCTRL,
KMOD_LALT,
KMOD_RALT,
KMOD_LGUI,
KMOD_RGUI,
KMOD_NUM,
KMOD_CAPS,
KMOD_MODE,
KMOD_RESERVED,
KMOD_CTRL,
KMOD_SHIFT,
KMOD_ALT,
KMOD_GUI
;
ctor uint16 : SDL_Keymod = "$1";
fun strmods (m:uint16) =
{
var mods = "";
if m \& KMOD_LSHIFT.uint16 != 0u16 do mods += "LSHIFT-"; done;
if m \& KMOD_RSHIFT.uint16 != 0u16 do mods += "RSHIFT-"; done;
if m \& KMOD_LCTRL.uint16 != 0u16 do mods += "LCTRL-"; done;
if m \& KMOD_RCTRL.uint16 != 0u16 do mods += "RCTRL-"; done;
if m \& KMOD_LALT.uint16 != 0u16 do mods += "LALT-"; done;
if m \& KMOD_RALT.uint16 != 0u16 do mods += "RALT-"; done;
if m \& KMOD_LGUI.uint16 != 0u16 do mods += "LGUI-"; done;
if m \& KMOD_RGUI.uint16 != 0u16 do mods += "RGUI-"; done;
if m \& KMOD_NUM.uint16 != 0u16 do mods += "NUM-"; done;
if m \& KMOD_CAPS.uint16 != 0u16 do mods += "CAPS-"; done;
if m \& KMOD_MODE.uint16 != 0u16 do mods += "MODE-"; done;
return mods;
}
}
17 SDL_mixer.flx
share/lib/sdl/SDL_mixer.flx
open module SDL_mixer_h
{
requires package "sdl";
header '#include "SDL_mixer.h"';
type Mix_MusicType = 'Mix_MusicType';
type Mix_Chunk = 'Mix_Chunk';
type Mix_Fading = 'Mix_Fading';
header '''typedef void (*SDL_mixer_h_cft_3)(void *, Uint8 *, int);''';
type SDL_mixer_h_cft_3 = 'SDL_mixer_h_cft_3';
header '''typedef void (*SDL_mixer_h_cft_1)(int, void *, int, void *);''';
type SDL_mixer_h_cft_1 = 'SDL_mixer_h_cft_1';
header '''typedef void (*SDL_mixer_h_cft_2)(int, void *);''';
type SDL_mixer_h_cft_2 = 'SDL_mixer_h_cft_2';
header '''typedef void (*SDL_mixer_h_cft_5)(int);''';
type SDL_mixer_h_cft_5 = 'SDL_mixer_h_cft_5';
header '''typedef void (*SDL_mixer_h_cft_4)(void);''';
type SDL_mixer_h_cft_4 = 'SDL_mixer_h_cft_4';
type _struct__Mix_Music = 'struct _Mix_Music';
typedef Mix_Music = _struct__Mix_Music;
typedef Mix_EffectDone_t = SDL_mixer_h_cft_2;
typedef Mix_EffectFunc_t = SDL_mixer_h_cft_1;
const MUS_CMD: int = 'MUS_CMD';
const MIX_FADING_OUT: int = 'MIX_FADING_OUT';
const MIX_NO_FADING: int = 'MIX_NO_FADING';
const MIX_FADING_IN: int = 'MIX_FADING_IN';
const MUS_WAV: int = 'MUS_WAV';
const MUS_MID: int = 'MUS_MID';
const MUS_OGG: int = 'MUS_OGG';
const MUS_NONE: int = 'MUS_NONE';
const MUS_MOD: int = 'MUS_MOD';
const MUS_MP3: int = 'MUS_MP3';
proc Mix_ChannelFinished: SDL_mixer_h_cft_5;
proc Mix_CloseAudio: 1;
proc Mix_FreeChunk: &Mix_Chunk;
proc Mix_FreeMusic: &Mix_Music;
proc Mix_HookMusic: SDL_mixer_h_cft_3 * address;
proc Mix_HookMusicFinished: SDL_mixer_h_cft_4;
proc Mix_Pause: int;
proc Mix_PauseMusic: 1;
proc Mix_Resume: int;
proc Mix_ResumeMusic: 1;
proc Mix_RewindMusic: 1;
proc Mix_SetPostMix: SDL_mixer_h_cft_3 * address;
fun Mix_AllocateChannels: int -> int;
fun Mix_ExpireChannel: int * int -> int;
fun Mix_FadeInChannelTimed: int * &Mix_Chunk * int * int * int -> int;
fun Mix_FadeInMusic: &Mix_Music * int * int -> int;
fun Mix_FadeInMusicPos: &Mix_Music * int * int * double -> int;
fun Mix_FadeOutChannel: int * int -> int;
fun Mix_FadeOutGroup: int * int -> int;
fun Mix_FadeOutMusic: int -> int;
fun Mix_FadingChannel: int -> Mix_Fading;
fun Mix_FadingMusic: 1 -> Mix_Fading;
fun Mix_GetChunk: int -> &Mix_Chunk;
fun Mix_GetMusicHookData: 1 -> address;
fun Mix_GetMusicType: &Mix_Music -> Mix_MusicType;
fun Mix_GetSynchroValue: 1 -> int;
fun Mix_GroupAvailable: int -> int;
fun Mix_GroupChannel: int * int -> int;
fun Mix_GroupChannels: int * int * int -> int;
fun Mix_GroupCount: int -> int;
fun Mix_GroupNewer: int -> int;
fun Mix_GroupOldest: int -> int;
fun Mix_HaltChannel: int -> int;
fun Mix_HaltGroup: int -> int;
fun Mix_HaltMusic: 1 -> int;
fun Mix_Linked_Version: 1 -> &SDL_version;
fun Mix_LoadMUS: &char -> &Mix_Music;
fun Mix_LoadWAV_RW: &SDL_RWops * int -> &Mix_Chunk;
fun Mix_OpenAudio: int * uint16 * int * int -> int;
fun Mix_Paused: int -> int;
fun Mix_PausedMusic: 1 -> int;
fun Mix_PlayChannelTimed: int * &Mix_Chunk * int * int -> int;
fun Mix_PlayMusic: &Mix_Music * int -> int;
fun Mix_Playing: int -> int;
fun Mix_PlayingMusic: 1 -> int;
fun Mix_QuerySpec: &int * &uint16 * &int -> int;
fun Mix_QuickLoad_RAW: &uint8 * uint32 -> &Mix_Chunk;
fun Mix_QuickLoad_WAV: &uint8 -> &Mix_Chunk;
fun Mix_RegisterEffect: int * SDL_mixer_h_cft_1 * SDL_mixer_h_cft_2 * address -> int;
fun Mix_ReserveChannels: int -> int;
fun Mix_SetDistance: int * uint8 -> int;
fun Mix_SetMusicCMD: &char -> int;
fun Mix_SetMusicPosition: double -> int;
fun Mix_SetPanning: int * uint8 * uint8 -> int;
fun Mix_SetPosition: int * int16 * uint8 -> int;
fun Mix_SetReverseStereo: int * int -> int;
fun Mix_SetSynchroValue: int -> int;
fun Mix_UnregisterAllEffects: int -> int;
fun Mix_UnregisterEffect: int * SDL_mixer_h_cft_1 -> int;
fun Mix_Volume: int * int -> int;
fun Mix_VolumeChunk: &Mix_Chunk * int -> int;
fun Mix_VolumeMusic: int -> int;
typedef _fcbat_SDL_mixer_h_cft_2 = int;
export type (_fcbat_SDL_mixer_h_cft_2) as "_fcbat_SDL_mixer_h_cft_2";
typedef _fcbt_SDL_mixer_h_cft_2 = int -> void;
export type (_fcbt_SDL_mixer_h_cft_2) as "_fcbt_SDL_mixer_h_cft_2";
header '''void _fcbw_SDL_mixer_h_cft_2(int a1, void *a2);''';
const _fcbw_SDL_mixer_h_cft_2: SDL_mixer_h_cft_2 = "_fcbw_SDL_mixer_h_cft_2";
body '''
void _fcbw_SDL_mixer_h_cft_2(int a1, void *a2){
con_t *p = ((_fcbt_SDL_mixer_h_cft_2)a2)->call(0, a1);
while(p) p=p->resume();
}''';
typedef _fcbat_SDL_mixer_h_cft_3 = &uint8 * int;
export type (_fcbat_SDL_mixer_h_cft_3) as "_fcbat_SDL_mixer_h_cft_3";
typedef _fcbt_SDL_mixer_h_cft_3 = &uint8 * int -> void;
export type (_fcbt_SDL_mixer_h_cft_3) as "_fcbt_SDL_mixer_h_cft_3";
header '''void _fcbw_SDL_mixer_h_cft_3(void *a1, Uint8 *a2, int a3);''';
const _fcbw_SDL_mixer_h_cft_3: SDL_mixer_h_cft_3 = "_fcbw_SDL_mixer_h_cft_3";
body '''
void _fcbw_SDL_mixer_h_cft_3(void *a1, Uint8 *a2, int a3){
con_t *p = ((_fcbt_SDL_mixer_h_cft_3)a1)->call(0, _fcbat_SDL_mixer_h_cft_3(a2, a3));
while(p) p=p->resume();
}''';
proc wrapper_Mix_HookMusic(a1: _fcbt_SDL_mixer_h_cft_3) {
Mix_HookMusic(_fcbw_SDL_mixer_h_cft_3, C_hack::cast[address]a1);
}
fun wrapper_Mix_RegisterEffect(a1: int, a2: SDL_mixer_h_cft_1, a3: _fcbt_SDL_mixer_h_cft_2): int= {
return Mix_RegisterEffect(a1, a2, _fcbw_SDL_mixer_h_cft_2, C_hack::cast[address]a3);
}
proc wrapper_Mix_SetPostMix(a1: _fcbt_SDL_mixer_h_cft_3) {
Mix_SetPostMix(_fcbw_SDL_mixer_h_cft_3, C_hack::cast[address]a1);
}
}
18 SDL_mouse.flx
share/lib/sdl/SDL_mouse.flx
open class SDL_mouse_h
{
requires package "sdl2";
const SDL_BUTTON_RMASK : uint8;
const SDL_BUTTON_MMASK : uint8;
const SDL_BUTTON_LMASK : uint8;
const SDL_BUTTON_X1MASK : uint8;
const SDL_BUTTON_X2MASK : uint8;
const SDL_BUTTON_RIGHT : uint8;
const SDL_BUTTON_MIDDLE : uint8;
const SDL_BUTTON_LEFT : uint8;
const SDL_BUTTON_X1 : uint8;
const SDL_BUTTON_X2 : uint8;
cenum SDL_SystemCursor =
SDL_SYSTEM_CURSOR_ARROW,
SDL_SYSTEM_CURSOR_IBEAM,
SDL_SYSTEM_CURSOR_WAIT,
SDL_SYSTEM_CURSOR_CROSSHAIR,
SDL_SYSTEM_CURSOR_WAITARROW,
SDL_SYSTEM_CURSOR_SIZENWSE,
SDL_SYSTEM_CURSOR_SIZENESW,
SDL_SYSTEM_CURSOR_SIZEWE,
SDL_SYSTEM_CURSOR_SIZENS,
SDL_SYSTEM_CURSOR_SIZEALL,
SDL_SYSTEM_CURSOR_NO,
SDL_SYSTEM_CURSOR_HAND,
SDL_NUM_SYSTEM_CURSORS
;
type SDL_Cursor = "SDL_Cursor*";
proc SDL_FreeCursor: SDL_Cursor;
proc SDL_SetCursor: SDL_Cursor;
proc SDL_WarpMouseInWindow: &SDL_Window * uint16 * uint16;
fun SDL_CreateCursor: &uint8 * &uint8 * int * int * int * int -> SDL_Cursor;
fun SDL_CreateColorCursor : &SDL_Surface * int * int -> SDL_Cursor;
fun SDL_CreateSystemCursor : SDL_SystemCursor -> SDL_Cursor;
fun SDL_GetCursor: 1 -> SDL_Cursor;
fun SDL_GetDefaultCursor: 1 -> SDL_Cursor;
fun SDL_ShowCursor: int -> int;
fun SDL_GetMouseState: &int * &int -> uint8;
fun SDL_GetRelativeMouseState: &int * &int -> uint8;
fun SDL_GetMouseFocus : 1 -> &SDL_Window;
fun SDL_SetRelativeMouseMode : bool -> int;
fun SDL_GetRelativeMouseMode : 1 -> bool;
}
19 SDL_mutex.flx
share/lib/sdl/SDL_mutex.flx
open module SDL_mutex_h
{
requires package "sdl";
header '#include "SDL_mutex.h"';
incomplete ctypes SDL_mutex, SDL_cond, SDL_sem;
proc SDL_DestroyCond: &SDL_cond;
proc SDL_DestroyMutex: &SDL_mutex;
proc SDL_DestroySemaphore: &SDL_sem;
fun SDL_CondBroadcast: &SDL_cond -> int;
fun SDL_CondSignal: &SDL_cond -> int;
fun SDL_CondWait: &SDL_cond * &SDL_mutex -> int;
fun SDL_CondWaitTimeout: &SDL_cond * &SDL_mutex * uint32 -> int;
fun SDL_CreateCond: 1 -> &SDL_cond;
fun SDL_CreateMutex: 1 -> &SDL_mutex;
fun SDL_CreateSemaphore: uint32 -> &SDL_sem;
fun SDL_SemPost: &SDL_sem -> int;
fun SDL_SemTryWait: &SDL_sem -> int;
fun SDL_SemValue: &SDL_sem -> uint32;
fun SDL_SemWait: &SDL_sem -> int;
fun SDL_SemWaitTimeout: &SDL_sem * uint32 -> int;
fun SDL_mutexP: &SDL_mutex -> int;
fun SDL_mutexV: &SDL_mutex -> int;
fun SDL_LockMutex: &SDL_mutex -> int;
fun SDL_UnlockMutex: &SDL_mutex -> int;
}
20 SDL_net.flx
share/lib/sdl/SDL_net.flx
module SDL_net_h
{
requires package "sdl";
header '#include "SDL_net.h"';
type SDLNet_GenericSocket = 'SDLNet_GenericSocket';
type IPaddress = 'IPaddress';
type UDPpacket = 'UDPpacket';
type _struct__UDPsocket = 'struct _UDPsocket';
type _struct__SDLNet_SocketSet = 'struct _SDLNet_SocketSet';
type _struct__TCPsocket = 'struct _TCPsocket';
typedef UDPsocket = &_struct__UDPsocket;
typedef TCPsocket = &_struct__TCPsocket;
typedef SDLNet_SocketSet = &_struct__SDLNet_SocketSet;
proc SDLNet_FreePacket: &UDPpacket;
proc SDLNet_FreePacketV: &&UDPpacket;
proc SDLNet_FreeSocketSet: SDLNet_SocketSet;
proc SDLNet_Quit: 1;
proc SDLNet_TCP_Close: TCPsocket;
proc SDLNet_UDP_Close: UDPsocket;
proc SDLNet_UDP_Unbind: UDPsocket * int;
proc SDLNet_Write16: uint16 * address;
proc SDLNet_Write32: uint32 * address;
fun SDLNet_AddSocket: SDLNet_SocketSet * SDLNet_GenericSocket -> int;
fun SDLNet_AllocPacket: int -> &UDPpacket;
fun SDLNet_AllocPacketV: int * int -> &&UDPpacket;
fun SDLNet_AllocSocketSet: int -> SDLNet_SocketSet;
fun SDLNet_CheckSockets: SDLNet_SocketSet * uint32 -> int;
fun SDLNet_DelSocket: SDLNet_SocketSet * SDLNet_GenericSocket -> int;
fun SDLNet_Init: 1 -> int;
fun SDLNet_Read16: address -> uint16;
fun SDLNet_Read32: address -> uint32;
fun SDLNet_ResizePacket: &UDPpacket * int -> int;
fun SDLNet_ResolveHost: &IPaddress * &char * uint16 -> int;
fun SDLNet_ResolveIP: &IPaddress -> &char;
fun SDLNet_TCP_Accept: TCPsocket -> TCPsocket;
fun SDLNet_TCP_GetPeerAddress: TCPsocket -> &IPaddress;
fun SDLNet_TCP_Open: &IPaddress -> TCPsocket;
fun SDLNet_TCP_Recv: TCPsocket * address * int -> int;
fun SDLNet_TCP_Send: TCPsocket * address * int -> int;
fun SDLNet_UDP_Bind: UDPsocket * int * &IPaddress -> int;
fun SDLNet_UDP_GetPeerAddress: UDPsocket * int -> &IPaddress;
fun SDLNet_UDP_Open: uint16 -> UDPsocket;
fun SDLNet_UDP_Recv: UDPsocket * &UDPpacket -> int;
fun SDLNet_UDP_RecvV: UDPsocket * &&UDPpacket -> int;
fun SDLNet_UDP_Send: UDPsocket * int * &UDPpacket -> int;
fun SDLNet_UDP_SendV: UDPsocket * &&UDPpacket * int -> int;
}
21 SDL_opengl.flx
share/lib/sdl/SDL_opengl.flx
header '#include "SDL_opengl.h"';
include "GL/gl_lib";
include "GL/glu_lib";
open module SDL_opengl_h
{
inherit GL_gl_h;
inherit GL_glu_h;
}
22 SDL_pixels.flx
share/lib/sdl/SDL_pixels.flx
open class SDL_pixels_h
{
requires package "sdl2";
typedef struct SDL_Color
{
uint8 r;
uint8 g;
uint8 b;
uint8 a;
} SDL_Color;
typedef struct SDL_Palette
{
int ncolors;
+SDL_Color colors;
uint32 version;
int refcount;
} SDL_Palette;
typedef struct SDL_PixelFormat
{
uint32 format;
&SDL_Palette palette;
uint8 BitsPerPixel;
uint8 BytesPerPixel;
uint8 padding1; uint8 padding2;
uint32 Rmask;
uint32 Gmask;
uint32 Bmask;
uint32 Amask;
uint8 Rloss;
uint8 Gloss;
uint8 Bloss;
uint8 Aloss;
uint8 Rshift;
uint8 Gshift;
uint8 Bshift;
uint8 Ashift;
int refcount;
next: &SDL_PixelFormat;
} SDL_PixelFormat;
fun SDL_MapRGB: &SDL_PixelFormat * uint8 * uint8 * uint8 -> uint32;
fun SDL_MapRGBA: &SDL_PixelFormat * uint8 * uint8 * uint8 * uint8 -> uint32;
}
23 SDL_rect.flx
share/lib/sdl/SDL_rect.flx
open class SDL_rect_h
{
typedef struct
{
int x;
int y;
} SDL_Point;
typedef struct SDL_Rect
{
int x; int y;
int w; int h;
} SDL_Rect;
fun \(\in\) (p:SDL_Point, r:SDL_Rect) =>
p.x >= r.x and p.x < r.x + r.w and p.y >= r.y and p.y < r.y + r.h
;
fun inRect (x:int, y:int, r:SDL_Rect) => SDL_Point (x,y) in r;
instance Str[SDL_Rect] {
fun str (r:SDL_Rect)=>"Rect(x="+r.x.str+",y="+r.y.str+",h="+r.h.str+",w="+r.w.str+")";
}
}
24 SDL_render.flx
share/lib/sdl/SDL_render.flx
open class SDL_Render_h
{
type SDL_Renderer = "SDL_Renderer*";
fun SDL_CreateSoftwareRenderer : &SDL_Surface -> SDL_Renderer;
gen SDL_RenderDrawLine : SDL_Renderer * int * int * int * int -> int;
gen SDL_SetRenderDrawColor: SDL_Renderer * uint8 * uint8 * uint8 * uint8 -> int;
proc SDL_DestroyRenderer : SDL_Renderer;
gen SDL_RenderSetClipRect : SDL_Renderer * &SDL_Rect -> int;
gen SDL_RenderSetScale : SDL_Renderer * float * float -> int;
}
25 SDL_rotozoom.flx
share/lib/sdl/SDL_rotozoom.flx
open module SDL_rotozoom_h
{
requires package "sdl";
header '#include "SDL_rotozoom.h"';
cstruct tColorRGBA {
r: uint8;
g: uint8;
b: uint8;
a: uint8;
};
cstruct tColorY {
y: uint8;
};
typedef _struct_tColorY = tColorY;
typedef _struct_tColorRGBA = tColorRGBA;
proc rotozoomSurfaceSize: int * int * double * double * &int * ∫
proc zoomSurfaceSize: int * int * double * double * &int * ∫
fun rotozoomSurface: &SDL_Surface * double * double * int -> &SDL_Surface;
fun zoomSurface: &SDL_Surface * double * double * int -> &SDL_Surface;
}
26 SDL_rwops.flx
share/lib/sdl/SDL_rwops.flx
open class SDL_rwops_h
{
type SDL_RWops = 'SDL_RWops*';
proc SDL_FreeRW: SDL_RWops;
fun SDL_AllocRW: 1 -> SDL_RWops;
fun SDL_RWFromConstMem: address * int -> SDL_RWops;
fun SDL_RWFromFP: FILE * int -> SDL_RWops;
fun SDL_RWFromInputFile: string -> SDL_RWops = 'SDL_RWFromFile($1.c_str(),"r")';
fun SDL_RWFromFile: string -> SDL_RWops = 'SDL_RWFromFile($1.c_str(),"rw")';
fun SDL_RWFromMem: address * int -> SDL_RWops;
}
27 SDL_scancode.flx
share/lib/sdl/SDL_scancode.flx
open class SDL_scancode_h
{
requires package "sdl2";
cenum SDL_Scancode =
SDL_SCANCODE_UNKNOWN,
SDL_SCANCODE_A,
SDL_SCANCODE_B,
SDL_SCANCODE_C,
SDL_SCANCODE_D,
SDL_SCANCODE_E,
SDL_SCANCODE_F,
SDL_SCANCODE_G,
SDL_SCANCODE_H,
SDL_SCANCODE_I,
SDL_SCANCODE_J,
SDL_SCANCODE_K,
SDL_SCANCODE_L,
SDL_SCANCODE_M,
SDL_SCANCODE_N,
SDL_SCANCODE_O,
SDL_SCANCODE_P,
SDL_SCANCODE_Q,
SDL_SCANCODE_R,
SDL_SCANCODE_S,
SDL_SCANCODE_T,
SDL_SCANCODE_U,
SDL_SCANCODE_V,
SDL_SCANCODE_W,
SDL_SCANCODE_X,
SDL_SCANCODE_Y,
SDL_SCANCODE_Z,
SDL_SCANCODE_1,
SDL_SCANCODE_2,
SDL_SCANCODE_3,
SDL_SCANCODE_4,
SDL_SCANCODE_5,
SDL_SCANCODE_6,
SDL_SCANCODE_7,
SDL_SCANCODE_8,
SDL_SCANCODE_9,
SDL_SCANCODE_0,
SDL_SCANCODE_RETURN,
SDL_SCANCODE_ESCAPE,
SDL_SCANCODE_BACKSPACE,
SDL_SCANCODE_TAB,
SDL_SCANCODE_SPACE,
SDL_SCANCODE_MINUS,
SDL_SCANCODE_EQUALS,
SDL_SCANCODE_LEFTBRACKET,
SDL_SCANCODE_RIGHTBRACKET,
SDL_SCANCODE_BACKSLASH,
SDL_SCANCODE_NONUSHASH,
SDL_SCANCODE_SEMICOLON,
SDL_SCANCODE_APOSTROPHE,
SDL_SCANCODE_GRAVE,
SDL_SCANCODE_COMMA,
SDL_SCANCODE_PERIOD,
SDL_SCANCODE_SLASH,
SDL_SCANCODE_CAPSLOCK,
SDL_SCANCODE_F1,
SDL_SCANCODE_F2,
SDL_SCANCODE_F3,
SDL_SCANCODE_F4,
SDL_SCANCODE_F5,
SDL_SCANCODE_F6,
SDL_SCANCODE_F7,
SDL_SCANCODE_F8,
SDL_SCANCODE_F9,
SDL_SCANCODE_F10,
SDL_SCANCODE_F11,
SDL_SCANCODE_F12,
SDL_SCANCODE_PRINTSCREEN,
SDL_SCANCODE_SCROLLLOCK,
SDL_SCANCODE_PAUSE,
SDL_SCANCODE_INSERT,
SDL_SCANCODE_HOME,
SDL_SCANCODE_PAGEUP,
SDL_SCANCODE_DELETE,
SDL_SCANCODE_END,
SDL_SCANCODE_PAGEDOWN,
SDL_SCANCODE_RIGHT,
SDL_SCANCODE_LEFT,
SDL_SCANCODE_DOWN,
SDL_SCANCODE_UP,
SDL_SCANCODE_NUMLOCKCLEAR,
SDL_SCANCODE_KP_DIVIDE,
SDL_SCANCODE_KP_MULTIPLY,
SDL_SCANCODE_KP_MINUS,
SDL_SCANCODE_KP_PLUS,
SDL_SCANCODE_KP_ENTER,
SDL_SCANCODE_KP_1,
SDL_SCANCODE_KP_2,
SDL_SCANCODE_KP_3,
SDL_SCANCODE_KP_4,
SDL_SCANCODE_KP_5,
SDL_SCANCODE_KP_6,
SDL_SCANCODE_KP_7,
SDL_SCANCODE_KP_8,
SDL_SCANCODE_KP_9,
SDL_SCANCODE_KP_0,
SDL_SCANCODE_KP_PERIOD,
SDL_SCANCODE_NONUSBACKSLASH,
SDL_SCANCODE_APPLICATION,
SDL_SCANCODE_POWER,
SDL_SCANCODE_KP_EQUALS,
SDL_SCANCODE_F13,
SDL_SCANCODE_F14,
SDL_SCANCODE_F15,
SDL_SCANCODE_F16,
SDL_SCANCODE_F17,
SDL_SCANCODE_F18,
SDL_SCANCODE_F19,
SDL_SCANCODE_F20,
SDL_SCANCODE_F21,
SDL_SCANCODE_F22,
SDL_SCANCODE_F23,
SDL_SCANCODE_F24,
SDL_SCANCODE_EXECUTE,
SDL_SCANCODE_HELP,
SDL_SCANCODE_MENU,
SDL_SCANCODE_SELECT,
SDL_SCANCODE_STOP,
SDL_SCANCODE_AGAIN,
SDL_SCANCODE_UNDO,
SDL_SCANCODE_CUT,
SDL_SCANCODE_COPY,
SDL_SCANCODE_PASTE,
SDL_SCANCODE_FIND,
SDL_SCANCODE_MUTE,
SDL_SCANCODE_VOLUMEUP,
SDL_SCANCODE_VOLUMEDOWN,
SDL_SCANCODE_KP_COMMA,
SDL_SCANCODE_KP_EQUALSAS400,
SDL_SCANCODE_INTERNATIONAL1,
SDL_SCANCODE_INTERNATIONAL2,
SDL_SCANCODE_INTERNATIONAL3,
SDL_SCANCODE_INTERNATIONAL4,
SDL_SCANCODE_INTERNATIONAL5,
SDL_SCANCODE_INTERNATIONAL6,
SDL_SCANCODE_INTERNATIONAL7,
SDL_SCANCODE_INTERNATIONAL8,
SDL_SCANCODE_INTERNATIONAL9,
SDL_SCANCODE_LANG1,
SDL_SCANCODE_LANG2,
SDL_SCANCODE_LANG3,
SDL_SCANCODE_LANG4,
SDL_SCANCODE_LANG5,
SDL_SCANCODE_LANG6,
SDL_SCANCODE_LANG7,
SDL_SCANCODE_LANG8,
SDL_SCANCODE_LANG9,
SDL_SCANCODE_ALTERASE,
SDL_SCANCODE_SYSREQ,
SDL_SCANCODE_CANCEL,
SDL_SCANCODE_CLEAR,
SDL_SCANCODE_PRIOR,
SDL_SCANCODE_RETURN2,
SDL_SCANCODE_SEPARATOR,
SDL_SCANCODE_OUT,
SDL_SCANCODE_OPER,
SDL_SCANCODE_CLEARAGAIN,
SDL_SCANCODE_CRSEL,
SDL_SCANCODE_EXSEL,
SDL_SCANCODE_KP_00,
SDL_SCANCODE_KP_000,
SDL_SCANCODE_THOUSANDSSEPARATOR,
SDL_SCANCODE_DECIMALSEPARATOR,
SDL_SCANCODE_CURRENCYUNIT,
SDL_SCANCODE_CURRENCYSUBUNIT,
SDL_SCANCODE_KP_LEFTPAREN,
SDL_SCANCODE_KP_RIGHTPAREN,
SDL_SCANCODE_KP_LEFTBRACE,
SDL_SCANCODE_KP_RIGHTBRACE,
SDL_SCANCODE_KP_TAB,
SDL_SCANCODE_KP_BACKSPACE,
SDL_SCANCODE_KP_A,
SDL_SCANCODE_KP_B,
SDL_SCANCODE_KP_C,
SDL_SCANCODE_KP_D,
SDL_SCANCODE_KP_E,
SDL_SCANCODE_KP_F,
SDL_SCANCODE_KP_XOR,
SDL_SCANCODE_KP_POWER,
SDL_SCANCODE_KP_PERCENT,
SDL_SCANCODE_KP_LESS,
SDL_SCANCODE_KP_GREATER,
SDL_SCANCODE_KP_AMPERSAND,
SDL_SCANCODE_KP_DBLAMPERSAND,
SDL_SCANCODE_KP_VERTICALBAR,
SDL_SCANCODE_KP_DBLVERTICALBAR,
SDL_SCANCODE_KP_COLON,
SDL_SCANCODE_KP_HASH,
SDL_SCANCODE_KP_SPACE,
SDL_SCANCODE_KP_AT,
SDL_SCANCODE_KP_EXCLAM,
SDL_SCANCODE_KP_MEMSTORE,
SDL_SCANCODE_KP_MEMRECALL,
SDL_SCANCODE_KP_MEMCLEAR,
SDL_SCANCODE_KP_MEMADD,
SDL_SCANCODE_KP_MEMSUBTRACT,
SDL_SCANCODE_KP_MEMMULTIPLY,
SDL_SCANCODE_KP_MEMDIVIDE,
SDL_SCANCODE_KP_PLUSMINUS,
SDL_SCANCODE_KP_CLEAR,
SDL_SCANCODE_KP_CLEARENTRY,
SDL_SCANCODE_KP_BINARY,
SDL_SCANCODE_KP_OCTAL,
SDL_SCANCODE_KP_DECIMAL,
SDL_SCANCODE_KP_HEXADECIMAL,
SDL_SCANCODE_LCTRL,
SDL_SCANCODE_LSHIFT,
SDL_SCANCODE_LALT,
SDL_SCANCODE_LGUI,
SDL_SCANCODE_RCTRL,
SDL_SCANCODE_RSHIFT,
SDL_SCANCODE_RALT,
SDL_SCANCODE_RGUI,
SDL_SCANCODE_MODE,
SDL_SCANCODE_AUDIONEXT,
SDL_SCANCODE_AUDIOPREV,
SDL_SCANCODE_AUDIOSTOP,
SDL_SCANCODE_AUDIOPLAY,
SDL_SCANCODE_AUDIOMUTE,
SDL_SCANCODE_MEDIASELECT,
SDL_SCANCODE_WWW,
SDL_SCANCODE_MAIL,
SDL_SCANCODE_CALCULATOR,
SDL_SCANCODE_COMPUTER,
SDL_SCANCODE_AC_SEARCH,
SDL_SCANCODE_AC_HOME,
SDL_SCANCODE_AC_BACK,
SDL_SCANCODE_AC_FORWARD,
SDL_SCANCODE_AC_STOP,
SDL_SCANCODE_AC_REFRESH,
SDL_SCANCODE_AC_BOOKMARKS,
SDL_SCANCODE_BRIGHTNESSDOWN,
SDL_SCANCODE_BRIGHTNESSUP,
SDL_SCANCODE_DISPLAYSWITCH,
SDL_SCANCODE_KBDILLUMTOGGLE,
SDL_SCANCODE_KBDILLUMDOWN,
SDL_SCANCODE_KBDILLUMUP,
SDL_SCANCODE_EJECT,
SDL_SCANCODE_SLEEP,
SDL_SCANCODE_APP1,
SDL_SCANCODE_APP2,
SDL_NUM_SCANCODES
;
}
28 SDL_sound.flx
share/lib/sdl/SDL_sound.flx
open module SDL_sound_h
{
requires package "sdl";
header '#include "SDL_sound.h"';
type Sound_Sample = 'Sound_Sample';
type Sound_Version = 'Sound_Version';
type Sound_AudioInfo = 'Sound_AudioInfo';
type Sound_SampleFlags = 'Sound_SampleFlags';
type Sound_DecoderInfo = 'Sound_DecoderInfo';
const SOUND_SAMPLEFLAG_ERROR: int = 'SOUND_SAMPLEFLAG_ERROR';
const SOUND_SAMPLEFLAG_NONE: int = 'SOUND_SAMPLEFLAG_NONE';
const SOUND_SAMPLEFLAG_EAGAIN: int = 'SOUND_SAMPLEFLAG_EAGAIN';
const SOUND_SAMPLEFLAG_EOF: int = 'SOUND_SAMPLEFLAG_EOF';
const SOUND_SAMPLEFLAG_CANSEEK: int = 'SOUND_SAMPLEFLAG_CANSEEK';
proc Sound_ClearError: 1;
proc Sound_FreeSample: &Sound_Sample;
proc Sound_GetLinkedVersion: &Sound_Version;
fun Sound_AvailableDecoders: 1 -> &&Sound_DecoderInfo;
fun Sound_Decode: &Sound_Sample -> uint32;
fun Sound_DecodeAll: &Sound_Sample -> uint32;
fun Sound_GetError: 1 -> &char;
fun Sound_Init: 1 -> int;
fun Sound_NewSample: &SDL_RWops * &char * &Sound_AudioInfo * uint32 -> &Sound_Sample;
fun Sound_NewSampleFromFile: &char * &Sound_AudioInfo * uint32 -> &Sound_Sample;
fun Sound_Quit: 1 -> int;
fun Sound_Rewind: &Sound_Sample -> int;
fun Sound_Seek: &Sound_Sample * uint32 -> int;
fun Sound_SetBufferSize: &Sound_Sample * uint32 -> int;
}
29 SDL_surface.flx
share/lib/sdl/SDL_surface.flx
open class SDL_surface_h
{
requires package "sdl2";
typedef struct SDL_Surface
{
uint32 flags;
&SDL_PixelFormat format;
int w; int h;
int pitch;
address pixels;
address userdata;
int locked;
address lock_data;
SDL_Rect clip_rect;
int refcount;
} SDL_Surface;
gen SDL_BlitSurface : &SDL_Surface * &SDL_Rect * &SDL_Surface * &SDL_Rect -> int;
proc SDL_FreeSurface: &SDL_Surface;
gen SDL_FillRect : &SDL_Surface * &SDL_Rect * uint32 -> int;
gen SDL_FillSurface : &SDL_Surface * uint32 -> int = "SDL_FillRect ($1, NULL, $2)";
gen SDL_SetClipRect : &SDL_Surface * &SDL_Rect -> bool;
proc SDL_ClearClipRect : &SDL_Surface = "SDL_SetClipRect($1,NULL);";
fun SDL_MUSTLOCK: &SDL_Surface -> bool = "(SDL_MUSTLOCK($1)==SDL_TRUE)";
proc SDL_LockSurface : &SDL_Surface = "SDL_LockSurface($1);";
proc SDL_UnlockSurface : &SDL_Surface = "SDL_LockSurface($1);";
}
30 SDL_timer.flx
share/lib/sdl/SDL_timer.flx
open module SDL_timer_h
{
requires package "sdl";
header '#include "SDL_timer.h"';
header '''typedef Uint32 (*SDL_timer_h_cft_2)(Uint32, void *);''';
type SDL_timer_h_cft_2 = 'SDL_timer_h_cft_2';
header '''typedef Uint32 (*SDL_timer_h_cft_1)(Uint32);''';
type SDL_timer_h_cft_1 = 'SDL_timer_h_cft_1';
type _struct__SDL_TimerID = 'struct _SDL_TimerID';
typedef SDL_NewTimerCallback = SDL_timer_h_cft_2;
typedef SDL_TimerID = &_struct__SDL_TimerID;
typedef SDL_TimerCallback = SDL_timer_h_cft_1;
proc SDL_Delay: uint32;
fun SDL_AddTimer: uint32 * SDL_timer_h_cft_2 * address -> SDL_TimerID;
fun SDL_GetTicks: 1 -> uint32;
fun SDL_RemoveTimer: SDL_TimerID -> SDL_bool;
fun SDL_SetTimer: uint32 * SDL_timer_h_cft_1 -> int;
typedef _fcbat_SDL_timer_h_cft_2 = uint32;
export type (_fcbat_SDL_timer_h_cft_2) as "_fcbat_SDL_timer_h_cft_2";
typedef _fcbt_SDL_timer_h_cft_2 = uint32 -> uint32;
export type (_fcbt_SDL_timer_h_cft_2) as "_fcbt_SDL_timer_h_cft_2";
header '''Uint32 _fcbw_SDL_timer_h_cft_2(Uint32 a1, void *a2);''';
const _fcbw_SDL_timer_h_cft_2: SDL_timer_h_cft_2 = "_fcbw_SDL_timer_h_cft_2";
body '''
Uint32 _fcbw_SDL_timer_h_cft_2(Uint32 a1, void *a2){
return ((_fcbt_SDL_timer_h_cft_2)a2)->apply(a1);
}''';
fun wrapper_SDL_AddTimer(a1: uint32, a2: _fcbt_SDL_timer_h_cft_2): SDL_TimerID= {
return SDL_AddTimer(a1, _fcbw_SDL_timer_h_cft_2, C_hack::cast[address]a2);
}
}
31 SDL_ttf.flx
share/lib/sdl/SDL_ttf.flx
open class SDL_ttf_h
{
requires package "sdl2", package "sdl2_ttf";
proc TTF_Compiled_Version: &SDL_version = "SDL_TTF_VERSION($1);";
fun TTF_Linked_Version: 1 -> SDL_version = "*(TTF_Linked_Version())";
fun TTF_Compiled_Version () : SDL_version = {
var v: SDL_version;
TTF_Compiled_Version$ &v;
return v;
}
gen TTF_Init : 1 -> int;
gen TTF_GetError: 1 -> string = "::std::string(TTF_GetError())";
proc TTF_Quit: 1;
fun TTF_WasInit: 1 -> int;
proc TTF_ByteSwappedUNICODE: int;
type TTF_Font = 'TTF_Font*';
gen TTF_OpenFontIndexRW: SDL_RWops * int * int * long -> TTF_Font;
gen TTF_OpenFontIndex: string * int * long -> TTF_Font = "TTF_OpenFont($1.c_str(),$2, $3)";
fun TTF_OpenFontRW: SDL_RWops * int * int -> TTF_Font;
gen TTF_OpenFont: string * int -> TTF_Font = "TTF_OpenFont($1.c_str(),$2)";
proc TTF_CloseFont: TTF_Font;
fun TTF_ValidFont : TTF_Font -> bool = "($1!=NULL)";
fun TTF_GetFontStyle: TTF_Font -> int;
proc TTF_SetFontStyle: TTF_Font * int;
const TTF_STYLE_UNDERLINE : int;
const TTF_STYLE_ITALIC : int;
const TTF_STYLE_BOLD : int;
const TTF_STYLE_NORMAL : int;
fun TTF_GetFontOutline: TTF_Font -> int;
proc TTF_SetFontOutline: TTF_Font * int;
fun TTF_GetFontHeight: TTF_Font -> int;
fun TTF_GetFontHinting: TTF_Font -> int;
proc TTF_SetFontHinting: TTF_Font * int;
const TTF_HINTING_NORMAL :int;
const TTF_HINTING_LIGHT :int;
const TTF_HINTING_MONO :int;
const TTF_HINTING_NONE :int;
fun TTF_GetFontKerning: TTF_Font -> int;
proc TTF_SetFontKerning: TTF_Font * int;
fun TTF_FontHeight: TTF_Font -> int;
fun TTF_FontAscent: TTF_Font -> int;
fun TTF_FontDescent: TTF_Font -> int;
fun TTF_FontLineSkip: TTF_Font -> int;
fun TTF_FontFaces: TTF_Font -> long;
fun TTF_FontFaceIsFixedWidth: TTF_Font -> int;
fun TTF_FontFaceFamilyName: TTF_Font -> string = "::std::string(TTF_FontFaceFamilyName($1))";
fun TTF_FontFaceStyleName: TTF_Font -> string = "::std::string(TTF_FontFaceStyleName($1))";
fun TTF_GlyphIsProvided: TTF_Font * uint16 -> int;
fun TTF_GlyphMetrics: TTF_Font * uint16 * &int * &int * &int * &int * &int -> int;
gen TTF_SizeText: TTF_Font * string * &int * &int -> int =
"TTF_SizeText($1,$2.c_str(),$3,$4)"
;
gen TTF_SizeUNICODE: TTF_Font * +uint16 * &int * &int -> int;
gen TTF_SizeUTF8: TTF_Font * string * &int * &int -> int =
"TTF_SizeUTF8($1,$2.c_str(),$3,$4)"
;
fun TTF_RenderGlyph_Solid: TTF_Font * uint16 * SDL_Color -> &SDL_Surface;
fun TTF_RenderText_Solid: TTF_Font * string * SDL_Color -> &SDL_Surface =
"TTF_RenderText_Solid($1,$2.c_str(),$3)"
;
fun TTF_RenderUNICODE_Solid: TTF_Font * +uint16 * SDL_Color -> &SDL_Surface;
fun TTF_RenderUTF8_Solid: TTF_Font * string * SDL_Color -> &SDL_Surface =
"TTF_RenderUTF8_Solid($1,$2.c_str(),$3)"
;
fun TTF_RenderGlyph_Shaded: TTF_Font * uint16 * SDL_Color * SDL_Color -> &SDL_Surface;
fun TTF_RenderText_Shaded: TTF_Font * string * SDL_Color * SDL_Color -> &SDL_Surface =
"TTF_RenderText_Shaded($1,$2.c_str(),$3,$4)"
;
fun TTF_RenderUNICODE_Shaded: TTF_Font * +uint16 * SDL_Color * SDL_Color -> &SDL_Surface;
fun TTF_RenderUTF8_Shaded: TTF_Font * string * SDL_Color * SDL_Color -> &SDL_Surface =
"TTF_RenderUTF8_Shaded($1,$2.c_str(),$3,$4)"
;
fun TTF_RenderGlyph_Blended: TTF_Font * uint16 * SDL_Color -> &SDL_Surface;
fun TTF_RenderText_Blended: TTF_Font * string * SDL_Color -> &SDL_Surface =
"TTF_RenderText_Blended($1,$2.c_str(),$3)"
;
fun TTF_RenderUNICODE_Blended: TTF_Font * +uint16 * SDL_Color -> &SDL_Surface;
fun TTF_RenderUTF8_Blended: TTF_Font * string * SDL_Color -> &SDL_Surface =
"TTF_RenderUTF8_Blended($1,$2.c_str(),$3)"
;
fun TTF_RenderGlyph_Blended_Wrapped: TTF_Font * uint16 * SDL_Color * uint32 -> &SDL_Surface;
fun TTF_RenderText_Blended_Wrapped: TTF_Font * string * SDL_Color * uint32 -> &SDL_Surface=
"TTF_RenderText_Blended_Wrapped($1,$2.c_str(),$3,$4)"
;
fun TTF_RenderUNICODE_Blended_Wrapped: TTF_Font * +uint16 * SDL_Color * uint32 -> &SDL_Surface;
fun TTF_RenderUTF8_Blended_Wrapped: TTF_Font * string * SDL_Color * uint32 -> &SDL_Surface=
"TTF_RenderUTF8_Blended_Wrapped($1,$2.c_str(),$3,$4)"
;
fun TTF_GetFontKerningSize: TTF_Font * int * int -> int;
}
32 SDL_types.flx
share/lib/sdl/SDL_types.flx
open module SDL_types_h
{
requires package "sdl";
header '#include "SDL_types.h"';
type SDL_bool = 'SDL_bool';
type SDL_DUMMY_ENUM = 'SDL_DUMMY_ENUM';
typedef SDL_dummy_uint32 = ∫
typedef SDL_dummy_sint64 = ∫
typedef SDL_dummy_sint16 = ∫
typedef SDL_dummy_sint8 = ∫
typedef SDL_dummy_sint32 = ∫
typedef SDL_dummy_uint8 = ∫
typedef SDL_dummy_uint64 = ∫
typedef SDL_dummy_uint16 = ∫
typedef SDL_dummy_enum = ∫
const SDL_PRESSED: int = 'SDL_PRESSED';
const DUMMY_ENUM_VALUE: int = 'DUMMY_ENUM_VALUE';
const SDL_RELEASED: int = 'SDL_RELEASED';
const SDL_TRUE: int = 'SDL_TRUE';
const SDL_FALSE: int = 'SDL_FALSE';
}
33 SDL_version.flx
share/lib/sdl/SDL_version.flx
open class SDL_version_h
{
requires package "sdl2";
cstruct SDL_version {
major: uint8;
minor: uint8;
patch: uint8;
};
proc SDL_Linked_Version: &SDL_version = "SDL_GetVersion ($1);";
proc SDL_Compiled_Version: &SDL_version = "SDL_VERSION($1);";
fun SDL_Linked_Version () : SDL_version = {
var v: SDL_version;
SDL_Linked_Version$ &v;
return v;
}
fun SDL_Compiled_Version () : SDL_version = {
var v: SDL_version;
SDL_Compiled_Version$ &v;
return v;
}
}
34 SDL_video.flx
share/lib/sdl/SDL_video.flx
open class SDL_video_h
{
requires package "sdl2";
const SDL_WINDOWPOS_CENTERED : int;
const SDL_WINDOWPOS_UNDEFINED : int;
const SDL_WINDOW_FULLSCREEN : uint32;
const SDL_WINDOW_FULLSCREEN_DESKTOP : uint32;
const SDL_WINDOW_OPENGL : uint32;
const SDL_WINDOW_SHOWN : uint32;
const SDL_WINDOW_HIDDEN : uint32;
const SDL_WINDOW_BORDERLESS : uint32;
const SDL_WINDOW_RESIZABLE : uint32;
const SDL_WINDOW_MINIMIZED : uint32;
const SDL_WINDOW_MAXIMIZED : uint32;
const SDL_WINDOW_INPUT_GRABBED : uint32;
const SDL_WINDOW_INPUT_FOCUS : uint32;
const SDL_WINDOW_MOUSE_FOCUS : uint32;
const SDL_WINDOW_FOREIGN: uint32;
const SDL_WINDOW_ALLOW_HIGHDPI: uint32;
type SDL_Window = "SDL_Window*";
gen SDL_CreateWindow: string * int * int * int * int * uint32 -> SDL_Window =
"SDL_CreateWindow ($1.c_str(), $2, $3, $4, $5, $6)"
;
proc SDL_DestroyWindow : SDL_Window;
fun SDL_GetWindowSurface : SDL_Window -> &SDL_Surface;
gen SDL_UpdateWindowSurface: SDL_Window -> int;
fun SDL_GetWindowID: SDL_Window -> uint32;
proc SDL_GetWindowPosition : SDL_Window * &int * ∫
proc SDL_GetWindowSize: SDL_Window * &int * ∫
proc SDL_SetWindowGrab: SDL_Window * bool = "SDL_SetWindowGrab($1,SDL_bool($2));";
fun SDL_GetWindowGrab: SDL_Window -> bool;
proc SDL_SetWindowMinumumSize: SDL_Window * int * int;
proc SDL_GetWindowMinumumSize: SDL_Window * &int * ∫
proc SDL_SetWindowMaximumSize: SDL_Window * int * int;
proc SDL_GetWindowMaximumSize: SDL_Window * &int * ∫
proc SDL_ShowWindow: SDL_Window;
proc SDL_HideWindow: SDL_Window;
proc SDL_RaiseWindow: SDL_Window;
proc SDL_MaximizeWindow: SDL_Window;
proc SDL_MinimizeWindow: SDL_Window;
proc SDL_RestoreWindow: SDL_Window;
proc SDL_SetWindowFullScreen: SDL_Window;
proc SDL_SetWindowBrightness: SDL_Window * float;
fun SDL_SetWindowBrightness: SDL_Window -> float;
fun SDL_GetWindowBordered: SDL_Window -> bool;
proc SDL_SetWindowBordered: SDL_Window * bool = "SDL_SetWindowBordered($1,SDL_bool($2));";
}
35 flx_faio_sdl.flx
share/lib/sdl/flx_faio_sdl.flx
open module SDL_events
{
requires package "sdl";
open C_hack;
fun event_type: SDL_Event -> uint8 = "$1.type";
proc block_sdl_events(m:&SDL_mutex)
{
var dummy = SDL_UserEvent(cast[uint32] SDL_USEREVENT,0,NULL,NULL);
ignore(SDL_PushEvent(cast [&SDL_Event] (&dummy)));
ignore(SDL_LockMutex(m));
}
proc unblock_sdl_events(m:&SDL_mutex)
{
ignore(SDL_UnlockMutex(m));
}
}
36 Package Configuration
$PWD/src/config/linux/sdl2.fpc
Name: SDL2
Description: Simple Direct Media Layer 2.0
cflags: -I/usr/local/include/SDL2
includes: '"SDL.h"'
provides_dlib: -L/usr/local/lib -lSDL2
provides_slib: -L/usr/local/lib -lSDL2
$PWD/src/config/linux/sdl2_image.fpc
Name: SDL2_image
Description: Simple Direct Media Layer 2.0: image loader
cflags: -I/usr/local/include/SDL2
includes: '"SDL_image.h"'
provides_dlib: -L/usr/local/lib -lSDL2_image
provides_slib: -L/usr/local/lib -lSDL2_image
requires_dlibs: -ljpeg -ltiff -lpng
requires_slibs: -ljpeg -ltiff -lpng
$PWD/src/config/linux/sdl2_ttf.fpc
Name: SDL2_ttf
Description: Simple Direct Media Layer 2.0: free type interface
cflags: -I/usr/local/include/SDL2
includes: '"SDL_ttf.h"'
provides_dlib: -L/usr/local/lib -lSDL2_ttf
provides_slib: -L/usr/local/lib -lSDL2_ttf
requires_dlibs: -lfreetype
requires_slibs: -lfreetype
$PWD/src/config/macosx/sdl2.fpc
Name: SDL2
Description: Simple Direct Media Layer 2.0
cflags: -I/usr/local/include/SDL2
includes: '"SDL.h"'
provides_dlib: -L/usr/local/lib -lSDL2
provides_slib: -L/usr/local/lib -lSDL2
requires_dlibs: ---framework=OpenGL
requires_slibs: ---framework=OpenGL
$PWD/src/config/macosx/sdl2_image.fpc
Name: SDL2_image
Description: Simple Direct Media Layer 2.0: image loader
cflags: -I/usr/local/include/SDL2
includes: '"SDL_image.h"'
provides_dlib: -L/usr/local/lib -lSDL2_image
provides_slib: -L/usr/local/lib -lSDL2_image
$PWD/src/config/macosx/sdl2_ttf.fpc
Name: SDL2_ttf
Description: Simple Direct Media Layer 2.0: free type interface
cflags: -I/usr/local/include/SDL2
includes: '"SDL_ttf.h"'
provides_dlib: -L/usr/local/lib -lSDL2_ttf
provides_slib: -L/usr/local/lib -lSDL2_ttf
requires_dlibs: -lfreetype
requires_slibs: -lfreetype
$PWD/src/config/macosx/SDL2_gfx.fpc
Name: SDL2_gfx
Description: Simple Direct Media Layer 2.0: SDL2_gfx
cflags: -I/usr/local/include/SDL2
includes: '"SDL2_gfxPrimitives.h"'
provides_dlib: -L/usr/local/lib -lSDL2_gfx
provides_slib: -L/usr/local/lib -lSDL2_gfx
$PWD/src/config/win/sdl2.fpc
Name: SDL2
Description: Simple Direct Media Layer 2.0
cflags: /I\Users\skaller\Desktop\SDL2-2.0.3\include
includes: '"SDL.h"'
provides_dlib: /DEFAULTLIB:\Users\skaller\Desktop\SDL2-2.0.3\lib\x64\SDL2
$PWD/src/config/win/sdl2_image.fpc
Name: SDL2_image
Description: Simple Direct Media Layer 2.0: image loader
cflags: /I\Users\skaller\Desktop\SDL2_image-2.0.0\include
includes: '"SDL_image.h"'
provides_dlib: /DEFAULTLIB:\Users\skaller\Desktop\SDL2_image-2.0.0\lib\x64\SDL2_image
$PWD/src/config/win/sdl2_ttf.fpc
Name: SDL2_ttf
Description: Simple Direct Media Layer 2.0: free type interface
cflags: /I\Users\skaller\Desktop\SDL2_ttf-2.0.12\include
includes: '"SDL_ttf.h"'
provides_dlib: /DEFAULTLIB:\Users\skaller\Desktop\SDL2_ttf-2.0.12\lib\x64\SDL2_ttf