mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-11-29 18:59:14 +08:00
add some MotionEvent's missing api
This commit is contained in:
parent
f5ffaebcb5
commit
1cc9a0570f
@ -300,13 +300,13 @@ void Assets::loadStrings(const std::string&lan) {
|
||||
const std::string suffix = "/strings-"+lan+".xml";
|
||||
for(auto a:mResources) {
|
||||
std::vector<std::string>files;
|
||||
a.second->getEntries(files);
|
||||
for(auto fileName:files){
|
||||
a.second->getEntries(files);
|
||||
for(auto fileName:files){
|
||||
if( (TextUtils::endWith(fileName,".xml") && TextUtils::endWith(fileName,suffix) )==false)continue;
|
||||
loadKeyValues(fileName,nullptr,std::bind(&Assets::parseItem,this,a.first,fileName,std::placeholders::_1,
|
||||
std::placeholders::_2,std::placeholders::_3,std::placeholders::_4));
|
||||
LOGD("load %s for '%s'",fileName.c_str(),lan.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -604,7 +604,35 @@ float MotionEvent::getHistoricalX(size_t pointerIndex, size_t historicalIndex) c
|
||||
}
|
||||
|
||||
float MotionEvent::getHistoricalY(size_t pointerIndex, size_t historicalIndex) const{
|
||||
return getHistoricalRawAxisValue(AXIS_Y, pointerIndex, historicalIndex);
|
||||
return getHistoricalRawAxisValue(AXIS_Y, pointerIndex, historicalIndex);
|
||||
}
|
||||
|
||||
float MotionEvent::getHistoricalPressure(size_t pointerIndex, size_t historicalIndex) const{
|
||||
return getHistoricalRawAxisValue(AXIS_PRESSURE, pointerIndex, historicalIndex);
|
||||
}
|
||||
|
||||
float MotionEvent::getHistoricalSize(size_t pointerIndex, size_t historicalIndex) const{
|
||||
return getHistoricalRawAxisValue(AXIS_SIZE, pointerIndex, historicalIndex);
|
||||
}
|
||||
|
||||
float MotionEvent::getHistoricalTouchMajor(size_t pointerIndex, size_t historicalIndex) const{
|
||||
return getHistoricalRawAxisValue(AXIS_TOUCH_MAJOR, pointerIndex, historicalIndex);
|
||||
}
|
||||
|
||||
float MotionEvent::getHistoricalTouchMinor(size_t pointerIndex, size_t historicalIndex) const{
|
||||
return getHistoricalRawAxisValue(AXIS_TOUCH_MINOR, pointerIndex, historicalIndex);
|
||||
}
|
||||
|
||||
float MotionEvent::getHistoricalToolMajor(size_t pointerIndex, size_t historicalIndex) const{
|
||||
return getHistoricalRawAxisValue(AXIS_TOOL_MAJOR, pointerIndex, historicalIndex);
|
||||
}
|
||||
|
||||
float MotionEvent::getHistoricalToolMinor(size_t pointerIndex, size_t historicalIndex) const{
|
||||
return getHistoricalRawAxisValue(AXIS_TOOL_MINOR, pointerIndex, historicalIndex);
|
||||
}
|
||||
|
||||
float MotionEvent::getHistoricalOrientation(size_t pointerIndex, size_t historicalIndex) const{
|
||||
return getHistoricalRawAxisValue(AXIS_ORIENTATION, pointerIndex, historicalIndex);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -612,6 +640,7 @@ static void appendUnless(T defValue, std::ostringstream& os,const std::string& k
|
||||
if (/*DEBUG_CONCISE_TOSTRING &&*/ defValue==value) return;
|
||||
os<<key<<value;
|
||||
}
|
||||
|
||||
void MotionEvent::toStream(std::ostream& os)const{
|
||||
os<<"MotionEvent { action="<<actionToString(getAction());
|
||||
//appendUnless("0", msg, ", actionButton=", buttonStateToString(getActionButton()));
|
||||
|
@ -263,6 +263,13 @@ public:
|
||||
float getHistoricalAxisValue(int axis, size_t pointerIndex,size_t historicalIndex) const;
|
||||
float getHistoricalX(size_t pointerIndex, size_t historicalIndex) const;
|
||||
float getHistoricalY(size_t pointerIndex, size_t historicalIndex) const;
|
||||
float getHistoricalPressure(size_t pointerIndex, size_t historicalIndex) const;
|
||||
float getHistoricalSize(size_t pointerIndex, size_t historicalIndex) const;
|
||||
float getHistoricalTouchMajor(size_t pointerIndex, size_t historicalIndex) const;
|
||||
float getHistoricalTouchMinor(size_t pointerIndex, size_t historicalIndex) const;
|
||||
float getHistoricalToolMajor(size_t pointerIndex, size_t historicalIndex) const;
|
||||
float getHistoricalToolMinor(size_t pointerIndex, size_t historicalIndex) const;
|
||||
float getHistoricalOrientation(size_t pointerIndex, size_t historicalIndex) const;
|
||||
float getAxisValue(int32_t axis)const;
|
||||
float getAxisValue(int32_t axis, size_t pointerIndex)const;
|
||||
float getX(size_t pointerIndex=0) const { return getAxisValue(AXIS_X,pointerIndex); }
|
||||
|
Loading…
Reference in New Issue
Block a user