Exemplo n.º 1
0
	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 ());
			
		}
		
	}
Exemplo n.º 2
0
static gint onSyncCall( gpointer data ) {
	value *r = (value*)data;
	value f = *r;
	free_root(r);
	val_call0(f);
	return FALSE;
}
Exemplo n.º 3
0
	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 ());
			
		}
		
	}
Exemplo n.º 4
0
extern "C" void hypsystem_networkinterface_onUpdate()
{
	int top = 0;
	gc_set_top_of_stack(&top,true);
	
	val_call0(fOnEventListener->get());
}
Exemplo n.º 5
0
Arquivo: App.cpp Projeto: Jens-G/waxe
    virtual bool OnInit()
    {
       wxImage::AddHandler(new wxGIFHandler);
       //wxImage::AddHandler(new wxBMPHandler);

       val_call0(sgOnInit);

       SetExitOnFrameDelete(true);

       return true;
    }
Exemplo n.º 6
0
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;
}
Exemplo n.º 7
0
	void* ValuePointer::Call () {

		if (!hlValue) {

			return val_call0 ((value)Get ());

		} else {

			return hl_dyn_call ((vclosure*)hlValue, 0, 0);

		}

	}
Exemplo n.º 8
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);
}
Exemplo n.º 9
0
	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 ());
			
		}
		
	}
Exemplo n.º 10
0
	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 ());
			
		}
		
	}
Exemplo n.º 11
0
	void lime_cffi_finalizer (value abstract) {
		
		val_call0 ((value)val_data (abstract));
		
	}
Exemplo n.º 12
0
static void *wnd_callback( void *_w ) {
	window *w = (window*)_w;
	val_call0(w->click);
	return NULL;
}
Exemplo n.º 13
0
 void menuEvent()
 {
     val_call0(clbkMenuEvent.get());
 }
Exemplo n.º 14
0
 void finalize()
 {
     val_call0(clbkFinalize.get());
 }
Exemplo n.º 15
0
 void initialize()
 {
     val_call0(clbkInitialize.get());
 }
Exemplo n.º 16
0
// Call Function 
value  api_val_call0(value  arg1)
{
	return val_call0(arg1);
}
Exemplo n.º 17
0
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());
}
Exemplo n.º 18
0
	void render() {
		val_call0(onRender->get());
	    glutSwapBuffers();
	}