LMMS
Loading...
Searching...
No Matches
wasm.c File Reference
#include "wasm.h"
#include "internal.h"
#include <stdio.h>
#include <emscripten/html5.h>

Macros

#define PUGL_INIT_STRUCT

Functions

PuglWorldInternalspuglInitWorldInternals (const PuglWorldType type, const PuglWorldFlags flags)
 Allocate and initialise world internals (implemented once per platform).
voidpuglGetNativeWorld (PuglWorld *)
PuglInternalspuglInitViewInternals (PuglWorld *const world)
 Allocate and initialise view internals (implemented once per platform).
static PuglStatus puglDispatchEventWithContext (PuglView *const view, const PuglEvent *event)
static PuglKey keyCodeToSpecial (const unsigned long code, const unsigned long location)
static PuglMods translateModifiers (const EM_BOOL ctrlKey, const EM_BOOL shiftKey, const EM_BOOL altKey, const EM_BOOL metaKey)
static bool decodeCharacterString (const unsigned long keyCode, const EM_UTF8 key[EM_HTML5_SHORT_STRING_LEN_BYTES], char str[8])
static EM_BOOL puglKeyCallback (const int eventType, const EmscriptenKeyboardEvent *const keyEvent, void *const userData)
static EM_BOOL puglMouseCallback (const int eventType, const EmscriptenMouseEvent *const mouseEvent, void *const userData)
static EM_BOOL puglFocusCallback (const int eventType, const EmscriptenFocusEvent *, void *const userData)
static EM_BOOL puglPointerLockChangeCallback (const int eventType, const EmscriptenPointerlockChangeEvent *event, void *const userData)
static EM_BOOL puglWheelCallback (const int eventType, const EmscriptenWheelEvent *const wheelEvent, void *const userData)
static EM_BOOL puglUiCallback (const int eventType, const EmscriptenUiEvent *const uiEvent, void *const userData)
PuglStatus puglRealize (PuglView *const view)
PuglStatus puglShow (PuglView *const view)
PuglStatus puglHide (PuglView *const view)
 Hide the current window.
void puglFreeViewInternals (PuglView *const view)
 Destroy and free view internals (implemented once per platform).
void puglFreeWorldInternals (PuglWorld *const world)
 Destroy and free world internals (implemented once per platform).
PuglStatus puglGrabFocus (PuglView *)
PuglStatus puglAcceptOffer (PuglView *const view, const PuglDataOfferEvent *const offer, const uint32_t typeIndex)
PuglStatus puglPaste (PuglView *const view)
uint32_t puglGetNumClipboardTypes (const PuglView *const view)
const char * puglGetClipboardType (const PuglView *const view, const uint32_t typeIndex)
double puglGetScaleFactor (const PuglView *const view)
double puglGetTime (const PuglWorld *)
PuglStatus puglUpdate (PuglWorld *const world, const double timeout)
PuglStatus puglPostRedisplay (PuglView *const view)
PuglStatus puglPostRedisplayRect (PuglView *const view, const PuglRect rect)
PuglNativeView puglGetNativeView (PuglView *const view)
 Return the native window handle.
PuglStatus puglSetWindowTitle (PuglView *const view, const char *const title)
PuglStatus puglSetSizeHint (PuglView *const view, const PuglSizeHint hint, const PuglSpan width, const PuglSpan height)
static EM_BOOL puglTimerLoopCallback (double timeout, void *const arg)
PuglStatus puglStartTimer (PuglView *const view, const uintptr_t id, const double timeout)
PuglStatus puglStopTimer (PuglView *const view, const uintptr_t id)
const voidpuglGetClipboard (PuglView *const view, const uint32_t typeIndex, size_t *const len)
PuglStatus puglSetClipboard (PuglView *const view, const char *const type, const void *const data, const size_t len)
PuglStatus puglSetCursor (PuglView *const view, const PuglCursor cursor)
PuglStatus puglSetTransientParent (PuglView *const view, const PuglNativeView parent)
PuglStatus puglSetPosition (PuglView *const view, const int x, const int y)

Macro Definition Documentation

◆ PUGL_INIT_STRUCT

#define PUGL_INIT_STRUCT
Value:
{ \
0 \
}

Function Documentation

◆ decodeCharacterString()

bool decodeCharacterString ( const unsigned long keyCode,
const EM_UTF8 key[EM_HTML5_SHORT_STRING_LEN_BYTES],
char str[8] )
static

◆ keyCodeToSpecial()

PuglKey keyCodeToSpecial ( const unsigned long code,
const unsigned long location )
static

◆ puglDispatchEventWithContext()

PuglStatus puglDispatchEventWithContext ( PuglView *const view,
const PuglEvent * event )
static

◆ puglFocusCallback()

EM_BOOL puglFocusCallback ( const int eventType,
const EmscriptenFocusEvent * ,
void *const userData )
static

◆ puglFreeViewInternals()

void puglFreeViewInternals ( PuglView *const view)

Destroy and free view internals (implemented once per platform).

◆ puglFreeWorldInternals()

void puglFreeWorldInternals ( PuglWorld *const world)

Destroy and free world internals (implemented once per platform).

◆ puglInitViewInternals()

PuglInternals * puglInitViewInternals ( PuglWorld *const world)

Allocate and initialise view internals (implemented once per platform).

◆ puglInitWorldInternals()

PuglWorldInternals * puglInitWorldInternals ( const PuglWorldType type,
const PuglWorldFlags flags )

Allocate and initialise world internals (implemented once per platform).

◆ puglKeyCallback()

EM_BOOL puglKeyCallback ( const int eventType,
const EmscriptenKeyboardEvent *const keyEvent,
void *const userData )
static

◆ puglMouseCallback()

EM_BOOL puglMouseCallback ( const int eventType,
const EmscriptenMouseEvent *const mouseEvent,
void *const userData )
static

◆ puglPointerLockChangeCallback()

EM_BOOL puglPointerLockChangeCallback ( const int eventType,
const EmscriptenPointerlockChangeEvent * event,
void *const userData )
static

◆ puglTimerLoopCallback()

EM_BOOL puglTimerLoopCallback ( double timeout,
void *const arg )
static

◆ puglUiCallback()

EM_BOOL puglUiCallback ( const int eventType,
const EmscriptenUiEvent *const uiEvent,
void *const userData )
static

◆ puglWheelCallback()

EM_BOOL puglWheelCallback ( const int eventType,
const EmscriptenWheelEvent *const wheelEvent,
void *const userData )
static

◆ translateModifiers()

PuglMods translateModifiers ( const EM_BOOL ctrlKey,
const EM_BOOL shiftKey,
const EM_BOOL altKey,
const EM_BOOL metaKey )
static