void SensorEvent::Dispatch (SensorEvent* event) { if (SensorEvent::callback) { if (!init) { id_id = val_id ("id"); id_type = val_id ("type"); id_x = val_id ("x"); id_y = val_id ("y"); id_z = val_id ("z"); init = true; } value object = (SensorEvent::eventObject ? SensorEvent::eventObject->get () : alloc_empty_object ()); alloc_field (object, id_id, alloc_int (event->id)); alloc_field (object, id_type, alloc_int (event->type)); alloc_field (object, id_x, alloc_float (event->x)); alloc_field (object, id_y, alloc_float (event->y)); alloc_field (object, id_z, alloc_float (event->z)); val_call0 (SensorEvent::callback->get ()); } }
static gint onSyncCall( gpointer data ) { value *r = (value*)data; value f = *r; free_root(r); val_call0(f); return FALSE; }
void GamepadEvent::Dispatch (GamepadEvent* event) { if (GamepadEvent::callback) { if (!init) { id_axis = val_id ("axis"); id_button = val_id ("button"); id_id = val_id ("id"); id_type = val_id ("type"); id_value = val_id ("value"); init = true; } value object = (GamepadEvent::eventObject ? GamepadEvent::eventObject->get () : alloc_empty_object ()); alloc_field (object, id_axis, alloc_int (event->axis)); alloc_field (object, id_button, alloc_int (event->button)); alloc_field (object, id_id, alloc_int (event->id)); alloc_field (object, id_type, alloc_int (event->type)); alloc_field (object, id_value, alloc_float (event->axisValue)); val_call0 (GamepadEvent::callback->get ()); } }
extern "C" void hypsystem_networkinterface_onUpdate() { int top = 0; gc_set_top_of_stack(&top,true); val_call0(fOnEventListener->get()); }
virtual bool OnInit() { wxImage::AddHandler(new wxGIFHandler); //wxImage::AddHandler(new wxBMPHandler); val_call0(sgOnInit); SetExitOnFrameDelete(true); return true; }
static OSStatus handleEvents( EventHandlerCallRef ref, EventRef e, void *data ) { switch( GetEventKind(e) ) { case eCall: { value *r; value f; GetEventParameter(e,pFunc,typeVoidPtr,0,sizeof(void*),0,&r); f = *r; free_root(r); val_call0(f); break; }} return 0; }
void* ValuePointer::Call () { if (!hlValue) { return val_call0 ((value)Get ()); } else { return hl_dyn_call ((vclosure*)hlValue, 0, 0); } }
static LRESULT CALLBACK WindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { switch( msg ) { case WM_SYNC_CALL: { value *r = (value*)lparam; value f = *r; free_root(r); // There are some GC issues here when having a lot of threads // It seems that somehow the function is not called, it might // also trigger some crashes. val_call0(f); return 0; }} return DefWindowProc(hwnd,msg,wparam,lparam); }
void RenderEvent::Dispatch (RenderEvent* event) { if (RenderEvent::callback) { //if (!init) { //id_type = val_id ("type"); //} value object = (RenderEvent::eventObject ? RenderEvent::eventObject->get () : alloc_empty_object ()); //alloc_field (object, id_type, alloc_int (event->type)); val_call0 (RenderEvent::callback->get ()); } }
void DropEvent::Dispatch (DropEvent* event) { if (DropEvent::callback) { if (!init) { id_file = val_id("file"); id_type = val_id("type"); init = true; } value object = (DropEvent::eventObject ? DropEvent::eventObject->get() : alloc_empty_object()); alloc_field(object, id_file, alloc_string(event->file)); alloc_field(object, id_type, alloc_int (event->type)); val_call0 (DropEvent::callback->get ()); } }
void lime_cffi_finalizer (value abstract) { val_call0 ((value)val_data (abstract)); }
static void *wnd_callback( void *_w ) { window *w = (window*)_w; val_call0(w->click); return NULL; }
void menuEvent() { val_call0(clbkMenuEvent.get()); }
void finalize() { val_call0(clbkFinalize.get()); }
void initialize() { val_call0(clbkInitialize.get()); }
// Call Function value api_val_call0(value arg1) { return val_call0(arg1); }
extern "C" JNIEXPORT void JNICALL Java_hypsystem_net_NetworkInfos_onUpdate( JNIEnv * env, jobject obj) { AutoHaxe haxe("Java_hypsystem_net_NetworkInfos_onUpdate"); val_call0(fOnEventListener->get()); }
void render() { val_call0(onRender->get()); glutSwapBuffers(); }