parin.bindings.em

The em module provides access to Emscripten functions.

fn emscripten_cancel_animation_frame emscripten_cancel_main_loop emscripten_date_now emscripten_enter_soft_fullscreen emscripten_exit_fullscreen emscripten_exit_pointerlock emscripten_exit_soft_fullscreen emscripten_get_battery_status emscripten_get_canvas_element_size emscripten_get_device_pixel_ratio emscripten_get_element_css_size emscripten_get_fullscreen_status emscripten_get_gamepad_status emscripten_get_mouse_status emscripten_get_num_gamepads emscripten_get_pointerlock_status emscripten_get_visibility_status emscripten_hide_mouse emscripten_html5_remove_all_event_listeners emscripten_html5_remove_event_listener emscripten_lock_orientation emscripten_performance_now emscripten_request_animation_frame emscripten_request_animation_frame_loop emscripten_request_fullscreen emscripten_request_fullscreen_strategy emscripten_request_pointerlock emscripten_sample_gamepad_data emscripten_set_batterychargingchange_callback_on_thread emscripten_set_batterylevelchange_callback_on_thread emscripten_set_beforeunload_callback_on_thread emscripten_set_blur_callback_on_thread emscripten_set_canvas_element_size emscripten_set_click_callback_on_thread emscripten_set_contextmenu_callback_on_thread emscripten_set_dblclick_callback_on_thread emscripten_set_devicemotion_callback_on_thread emscripten_set_deviceorientation_callback_on_thread emscripten_set_element_css_size emscripten_set_focus_callback_on_thread emscripten_set_focusin_callback_on_thread emscripten_set_focusout_callback_on_thread emscripten_set_fullscreenchange_callback_on_thread emscripten_set_gamepadconnected_callback_on_thread emscripten_set_gamepaddisconnected_callback_on_thread emscripten_set_keydown_callback_on_thread emscripten_set_keypress_callback_on_thread emscripten_set_keyup_callback_on_thread emscripten_set_main_loop emscripten_set_main_loop_timing emscripten_set_mousedown_callback_on_thread emscripten_set_mouseenter_callback_on_thread emscripten_set_mouseleave_callback_on_thread emscripten_set_mousemove_callback_on_thread emscripten_set_mouseout_callback_on_thread emscripten_set_mouseover_callback_on_thread emscripten_set_mouseup_callback_on_thread emscripten_set_orientationchange_callback_on_thread emscripten_set_pointerlockchange_callback_on_thread emscripten_set_pointerlockerror_callback_on_thread emscripten_set_resize_callback_on_thread emscripten_set_scroll_callback_on_thread emscripten_set_touchcancel_callback_on_thread emscripten_set_touchend_callback_on_thread emscripten_set_touchmove_callback_on_thread emscripten_set_touchstart_callback_on_thread emscripten_set_visibilitychange_callback_on_thread emscripten_set_wheel_callback_on_thread emscripten_set_window_title emscripten_unlock_orientation emscripten_vibrate emscripten_vibrate_pattern

Types 36

aliasem_pthread_t = size_t

This type is used to return the result of most functions in this API. Zero and positive values denote success, while negative values signal failure.

aliasem_mouse_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenMouseEvent * mouseEvent, void * userData)
aliasem_key_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenKeyboardEvent * keyEvent, void * userData)
aliasem_wheel_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenWheelEvent * wheelEvent, void * userData)
aliasem_ui_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenUiEvent * uiEvent, void * userData)
aliasem_focus_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenFocusEvent * focusEvent, void * userData)
aliasem_deviceorientation_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenDeviceOrientationEvent * deviceOrientationEvent, void * userData)
aliasem_devicemotion_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenDeviceMotionEvent * deviceMotionEvent, void * userData)
aliasem_orientationchange_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenOrientationChangeEvent * orientationChangeEvent, void * userData)
aliasem_fullscreenchange_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenFullscreenChangeEvent * fullscreenChangeEvent, void * userData)
aliasem_pointerlockchange_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenPointerlockChangeEvent * pointerlockChangeEvent, void * userData)
aliasem_pointerlockerror_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, void * reserved, void * userData)
aliasem_visibilitychange_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenVisibilityChangeEvent * visibilityChangeEvent, void * userData)
aliasem_touch_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenTouchEvent * touchEvent, void * userData)
aliasem_gamepad_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenGamepadEvent * gamepadEvent, void * userData)
aliasem_battery_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, EmscriptenBatteryEvent * batteryEvent, void * userData)
aliasem_beforeunload_callback = const(char) * function(EMSCRIPTEN_EVENT_TYPE eventType, void * reserved, void * userData)
aliasem_canvasresized_callback_func = bool function(EMSCRIPTEN_EVENT_TYPE eventType, void * reserved, void * userData)
Fields
double timestamp
int screenX
int screenY
int clientX
int clientY
bool ctrlKey
bool shiftKey
bool altKey
bool metaKey
ushort button
ushort buttons
int movementX
int movementY
int targetX
int targetY
int canvasX
int canvasY
int padding
Fields
int identifier
int screenX
int screenY
int clientX
int clientY
int pageX
int pageY
bool isChanged
bool onTarget
int targetX
int targetY
int canvasX
int canvasY
Fields
double timestamp
int numTouches
bool ctrlKey
bool shiftKey
bool altKey
bool metaKey
Fields
double timestamp
uint location
bool ctrlKey
bool shiftKey
bool altKey
bool metaKey
bool repeat
uint charCode
uint keyCode
uint which
char[EM_HTML5_SHORT_STRING_LEN_BYTES] key
char[EM_HTML5_SHORT_STRING_LEN_BYTES] code
char[EM_HTML5_SHORT_STRING_LEN_BYTES] charValue
char[EM_HTML5_SHORT_STRING_LEN_BYTES] locale
Fields
double deltaX
double deltaY
double deltaZ
uint deltaMode
Fields
int detail
int documentBodyClientWidth
int documentBodyClientHeight
int windowInnerWidth
int windowInnerHeight
int windowOuterWidth
int windowOuterHeight
int scrollTop
int scrollLeft
Fields
char[EM_HTML5_LONG_STRING_LEN_BYTES] nodeName
char[EM_HTML5_LONG_STRING_LEN_BYTES] id
Fields
double alpha
double beta
double gamma
bool absolute
Fields
double accelerationX
double accelerationY
double accelerationZ
double accelerationIncludingGravityX
double accelerationIncludingGravityY
double accelerationIncludingGravityZ
double rotationRateAlpha
double rotationRateBeta
double rotationRateGamma
int supportedFields
Fields
int orientationIndex
int orientationAngle
Fields
bool isFullscreen
bool fullscreenEnabled
char[EM_HTML5_LONG_STRING_LEN_BYTES] nodeName
char[EM_HTML5_LONG_STRING_LEN_BYTES] id
int elementWidth
int elementHeight
int screenWidth
int screenHeight
Fields
bool isActive
char[EM_HTML5_LONG_STRING_LEN_BYTES] nodeName
char[EM_HTML5_LONG_STRING_LEN_BYTES] id
Fields
bool hidden
int visibilityState
Fields
double timestamp
int numAxes
int numButtons
double[64] axis
double[64] analogButton
bool[64] digitalButton
bool connected
int index
char[EM_HTML5_MEDIUM_STRING_LEN_BYTES] id
char[EM_HTML5_MEDIUM_STRING_LEN_BYTES] mapping
Fields
double chargingTime
double dischargingTime
double level
bool charging
Fields
int scaleMode
int canvasResolutionScaleMode
int filteringMode
em_canvasresized_callback_func canvasResizedCallback
void * canvasResizedCallbackUserData
em_pthread_t canvasResizedCallbackTargetThread

Functions 72

fnEMSCRIPTEN_RESULT emscripten_set_keypress_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_key_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_keydown_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_key_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_keyup_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_key_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_click_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_mousedown_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_mouseup_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_dblclick_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_mousemove_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_mouseenter_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_mouseleave_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_mouseover_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_mouseout_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_contextmenu_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_mouse_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_get_mouse_status(EmscriptenMouseEvent * mouseState) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_wheel_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_wheel_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_resize_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_ui_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_scroll_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_ui_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_blur_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_focus_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_focus_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_focus_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_focusin_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_focus_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_focusout_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_focus_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_deviceorientation_callback_on_thread(void * userData, bool useCapture, em_deviceorientation_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_devicemotion_callback_on_thread(void * userData, bool useCapture, em_devicemotion_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_orientationchange_callback_on_thread(void * userData, bool useCapture, em_orientationchange_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_lock_orientation(int allowedOrientations) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_unlock_orientation() extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_request_fullscreen(const(char) * target, bool deferUntilInEventHandler) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_request_fullscreen_strategy(const(char) * target, bool deferUntilInEventHandler, const EmscriptenFullscreenStrategy * fullscreenStrategy) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_exit_fullscreen() extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_enter_soft_fullscreen(const(char) * target, const EmscriptenFullscreenStrategy * fullscreenStrategy) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_exit_soft_fullscreen() extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_fullscreenchange_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_fullscreenchange_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_get_fullscreen_status(EmscriptenFullscreenChangeEvent * fullscreenStatus) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_request_pointerlock(const(char) * target, bool deferUntilInEventHandler) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_exit_pointerlock() extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_pointerlockchange_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_pointerlockchange_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_pointerlockerror_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_pointerlockerror_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_get_pointerlock_status(EmscriptenPointerlockChangeEvent * pointerlockStatus) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_visibilitychange_callback_on_thread(void * userData, bool useCapture, em_visibilitychange_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_get_visibility_status(EmscriptenVisibilityChangeEvent * visibilityStatus) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_touchstart_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_touch_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_touchend_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_touch_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_touchmove_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_touch_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_touchcancel_callback_on_thread(const(char) * target, void * userData, bool useCapture, em_touch_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_gamepadconnected_callback_on_thread(void * userData, bool useCapture, em_gamepad_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_gamepaddisconnected_callback_on_thread(void * userData, bool useCapture, em_gamepad_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_sample_gamepad_data() extern(C) @system nothrow @nogc
fnint emscripten_get_num_gamepads() extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_get_gamepad_status(int index, EmscriptenGamepadEvent * gamepadState) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_batterychargingchange_callback_on_thread(void * userData, em_battery_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_batterylevelchange_callback_on_thread(void * userData, em_battery_callback_func callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_get_battery_status(EmscriptenBatteryEvent * batteryState) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_vibrate(int msecs) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_vibrate_pattern(int * msecsArray, int numEntries) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_beforeunload_callback_on_thread(void * userData, em_beforeunload_callback callback, em_pthread_t targetThread) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_html5_remove_event_listener(const(char) * target, void * userData, EMSCRIPTEN_EVENT_TYPE eventTypeId, void * callback) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_get_canvas_element_size(const(char) * target, int * width, int * height) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_canvas_element_size(const(char) * target, int width, int height) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_get_element_css_size(const(char) * target, double * width, double * height) extern(C) @system nothrow @nogc
fnEMSCRIPTEN_RESULT emscripten_set_element_css_size(const(char) * target, double width, double height) extern(C) @system nothrow @nogc
fnvoid emscripten_html5_remove_all_event_listeners() extern(C) @system nothrow @nogc
fnvoid emscripten_set_main_loop(void * ptr, int fps, bool loop) extern(C) @system nothrow @nogc
fnvoid emscripten_cancel_main_loop() extern(C) @system nothrow @nogc
fndouble emscripten_get_device_pixel_ratio() extern(C) @system nothrow @nogc
fnvoid emscripten_set_window_title(const(char) * title) extern(C) @system nothrow @nogc
fnvoid emscripten_hide_mouse() extern(C) @system nothrow @nogc
fnint emscripten_set_main_loop_timing(int mode, int value) extern(C) @system nothrow @nogc
fnint emscripten_request_animation_frame(bool function(double time, void * userData) cb, void * userData) extern(C) @system nothrow @nogc
fnvoid emscripten_cancel_animation_frame(int requestAnimationFrameId) extern(C) @system nothrow @nogc
fnvoid emscripten_request_animation_frame_loop(bool function(double time, void * userData) cb, void * userData) extern(C) @system nothrow @nogc
fndouble emscripten_date_now() extern(C) @system nothrow @nogc
fndouble emscripten_performance_now() extern(C) @system nothrow @nogc

Variables 26

enumvarEM_TIMING_SETTIMEOUT = 0
enumvarEM_TIMING_RAF = 1
enumvarEM_TIMING_SETIMMEDIATE = 2
enumvarEM_CALLBACK_THREAD_CONTEXT_MAIN_RUNTIME_THREAD = 1
enumvarEM_CALLBACK_THREAD_CONTEXT_CALLING_THREAD = 2
enumvarEM_HTML5_SHORT_STRING_LEN_BYTES = 32
enumvarEM_HTML5_MEDIUM_STRING_LEN_BYTES = 64
enumvarEM_HTML5_LONG_STRING_LEN_BYTES = 128
enumvarDOM_DELTA_PIXEL = 0
enumvarDOM_DELTA_LINE = 1
enumvarDOM_DELTA_PAGE = 2
enumvarEMSCRIPTEN_ORIENTATION_UNSUPPORTED = 0
enumvarEMSCRIPTEN_ORIENTATION_PORTRAIT_PRIMARY = 1
enumvarEMSCRIPTEN_ORIENTATION_PORTRAIT_SECONDARY = 2
enumvarEMSCRIPTEN_ORIENTATION_LANDSCAPE_PRIMARY = 4
enumvarEMSCRIPTEN_ORIENTATION_LANDSCAPE_SECONDARY = 8
enumvarEMSCRIPTEN_FULLSCREEN_SCALE_DEFAULT = 0
enumvarEMSCRIPTEN_FULLSCREEN_SCALE_STRETCH = 1
enumvarEMSCRIPTEN_FULLSCREEN_SCALE_ASPECT = 2
enumvarEMSCRIPTEN_FULLSCREEN_SCALE_CENTER = 3
enumvarEMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE = 0
enumvarEMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF = 1
enumvarEMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_HIDEF = 2
enumvarEMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT = 0
enumvarEMSCRIPTEN_FULLSCREEN_FILTERING_NEAREST = 1
enumvarEMSCRIPTEN_FULLSCREEN_FILTERING_BILINEAR = 2