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

       val_call0(sgOnInit);

       SetExitOnFrameDelete(true);

       return true;
    }
示例#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;
}
示例#7
0
	void* ValuePointer::Call () {

		if (!hlValue) {

			return val_call0 ((value)Get ());

		} else {

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

		}

	}
示例#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);
}
示例#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 ());
			
		}
		
	}
示例#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 ());
			
		}
		
	}
示例#11
0
	void lime_cffi_finalizer (value abstract) {
		
		val_call0 ((value)val_data (abstract));
		
	}
示例#12
0
文件: api.c 项目: 0b1kn00b/xcross
static void *wnd_callback( void *_w ) {
	window *w = (window*)_w;
	val_call0(w->click);
	return NULL;
}
示例#13
0
 void menuEvent()
 {
     val_call0(clbkMenuEvent.get());
 }
示例#14
0
 void finalize()
 {
     val_call0(clbkFinalize.get());
 }
示例#15
0
 void initialize()
 {
     val_call0(clbkInitialize.get());
 }
示例#16
0
// Call Function 
value  api_val_call0(value  arg1)
{
	return val_call0(arg1);
}
示例#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());
}
示例#18
0
文件: Frame.cpp 项目: bradparks/Foo3D
	void render() {
		val_call0(onRender->get());
	    glutSwapBuffers();
	}