open source

This commit is contained in:
lvfulong
2020-11-11 16:17:13 +08:00
parent 4d989f3ecb
commit bc4ca748de
2441 changed files with 623057 additions and 2 deletions
@@ -0,0 +1,64 @@
/**
@file JSInput.h
@brief
@author James
@version 1.0
@date 2017_11_28
*/
#ifndef __JSInput_H__
#define __JSInput_H__
#include <stdio.h>
#include "../JSInterface/JSInterface.h"
#include "../../JCScriptRuntime.h"
#include <mutex>
namespace laya
{
struct TouchEventInfo
{
int nType;
int nID;
int x;
int y;
};
class IConchThreadCmdMgr;
class JSInput:public JsObjBase
{
public:
static JsObjClassInfo JSCLSINFO;
static void exportJS();
static JSInput* getInstance();
static void Reset();
public:
JSInput();
~JSInput();
void onInputCallJSFunction(inputEvent e);
void onDeviceOrientationCallJSFunction(DeviceOrientationEvent e);
void onDeviceMotionCallJSFunction(DeviceMotionEvent e);
bool activeCall( inputEvent param );
bool activeCall(DeviceOrientationEvent param);
bool activeCall(DeviceMotionEvent param);
void captureScreenCallBack(char *p_pBuffer,int p_nLen, int p_nW, int p_nH);
void onCaptureScreenCallJSFunction(char *p_pBuffer, int p_nLen, int p_nW, int p_nH);
void swapCurrentTouchEvent();
void setTouchMode( bool bMode );
bool getTouchMode();
public:
static JSInput* m_pInstance;
IConchThreadCmdMgr* m_pCmdPoster;
bool m_bTouchMode; ///<trueΪ²éѯģʽ falseΪ»Øµ÷ģʽ
std::vector<TouchEventInfo> m_vInputEvents;
std::vector<TouchEventInfo> m_vInputEventsJS;
std::recursive_mutex m_Lock;
int m_nTouchFrame;
};
}
//------------------------------------------------------------------------------
#endif //__JSInput_H__
//-----------------------------END FILE--------------------------------