make gui_features.h hidden(used only internal)

This commit is contained in:
侯歌 2024-06-26 14:37:19 +08:00
parent 796682dfff
commit c0a308e8d1
10 changed files with 19 additions and 36 deletions

View File

@ -29,7 +29,6 @@ void AnimationHandler::MyFrameCallbackProvider::setFrameDelay(long delay) {
AnimationHandler::AnimationHandler(){
mProvider = nullptr;
mListDirty = false;
//mInLooper = false;
mFrameCallback = std::bind(&AnimationHandler::doFrame,this,std::placeholders::_1);
}
@ -37,15 +36,6 @@ AnimationHandler::~AnimationHandler(){
delete mProvider;
}
/*int AnimationHandler::checkEvents(){
return mAnimationCallbacks.size();
}
int AnimationHandler::handleEvents(){
const long currentTime = getProvider()->getFrameTime();
doAnimationFrame(currentTime);
return 1;
}*/
void AnimationHandler::doFrame(long frameTimeNanos){
LOGV("not used,frame refresh callback");
@ -107,10 +97,6 @@ void AnimationHandler::cleanUpList(){
static NeverDestroyed<AnimationHandler>mInst;
AnimationHandler&AnimationHandler::getInstance(){
/*if(!mInst->mInLooper){
Looper::getDefault()->addEventHandler(mInst.get());
mInst->mInLooper = true;
}*/
return *mInst;
}
@ -180,7 +166,7 @@ long AnimationHandler::getFrameDelay() {
void AnimationHandler::autoCancelBasedOn(ObjectAnimator* objectAnimator){
for(auto cb:mAnimationCallbacks){
if(cb == nullptr)continue;
if(cb == nullptr) continue;
if(objectAnimator->shouldAutoCancel(cb))
dynamic_cast<Animator*>(cb)->cancel();
}

View File

@ -7,7 +7,7 @@
namespace cdroid{
class ObjectAnimator;
class AnimationHandler/*:EventHandler*/{
class AnimationHandler{
public:
class AnimationFrameCallback{
public:
@ -32,7 +32,6 @@ private:
void setFrameDelay(long delay)override;
};
bool mListDirty;
//bool mInLooper;
AnimationFrameCallbackProvider* mProvider;
Choreographer::FrameCallback mFrameCallback;
std::list<AnimationFrameCallback*> mAnimationCallbacks;
@ -49,9 +48,6 @@ private:
void commitAnimationFrame(AnimationFrameCallback* callback, long frameTime);
void cleanUpList();
int getCallbackSize()const;
protected:
//int checkEvents()override;
//int handleEvents()override;
public:
static AnimationHandler& getInstance();
void setProvider(const AnimationFrameCallbackProvider* provider);

View File

@ -17,7 +17,7 @@
*/
#include <core/app.h>
#include <core/build.h>
#include <gui/gui_features.h>
//#include <gui/gui_features.h>
#include <view/viewgroup.h>
#include <view/viewoverlay.h>
#include <widget/viewpager.h>

View File

@ -180,22 +180,22 @@ void InputEventSource::recordEvent(InputEvent&inputEvent){
oss<<(4 + m.getAction())<<","<<m.getX(0)<<","<<m.getY()<<","<<m.getEventTime()<<std::endl;
}else if(type==InputEvent::INPUT_EVENT_TYPE_KEY){
KeyEvent& k = (KeyEvent&)inputEvent;
oss<<k.getAction()<<","<<k.getKeyCode()<<","<<k.getEventTime()<<std::endl;
oss<<k.getAction()<<","<<k.getLabel()<<","<<k.getEventTime()<<std::endl;
}
}
InputEvent*InputEventSource::parseEvent(const char*line){
const char*tokens[16]={0};
const char*p = line;
int tokenCount=0;
int action = atoi(line);
int tokenCount = 0;
while( p && ( tokenCount < sizeof(tokens)/sizeof(tokens[0]) )){
tokens[tokenCount++]=p;
tokens[tokenCount++] = p;
p = strchr(p+1,',');
}
if(action<4){/*KeyEvent*/
if(tokenCount<4){/*KeyEvent*/
const int keyCode = atoi(tokens[1]);
const nsecs_t etime = atoi(tokens[2]);
const int action = atoi(line);
KeyEvent* k = KeyEvent::obtain(etime,etime,action,keyCode,
0/*repeat*/, 0/*metaState*/, 0/*deviceId*/, keyCode/*scancode*/,
0/*flags*/, 0/*source*/,0/*displayid*/);
@ -203,7 +203,7 @@ InputEvent*InputEventSource::parseEvent(const char*line){
}else if(tokenCount>=4){/*MotionEvent*/
int tkIdx = tokenCount>4?1:0;
const int pointer =(tokenCount>4) ? atoi(tokens[0]) : 0;
action = atoi(tokens[tkIdx]);
const int action = atoi(tokens[tkIdx]);
const int x = atoi(tokens[tkIdx+1]);
const int y = atoi(tokens[tkIdx+2]);
const nsecs_t etime = atoll(tokens[tkIdx+3]);
@ -216,6 +216,10 @@ InputEvent*InputEventSource::parseEvent(const char*line){
return nullptr;
}
void InputEventSource::record(const std::string&fname){
frecord.open(fname);
}
void InputEventSource::playback(const std::string&fname){
auto func = [this](const std::string&fname){
std::fstream in(fname);

View File

@ -40,6 +40,7 @@ public:
void setScreenSaver(ScreenSaver func,int timeout);
void closeScreenSaver();
bool isScreenSaverActived()const;
void record(const std::string&fname);
void playback(const std::string&fname);
int checkEvents()override;
int handleEvents()override;

View File

@ -1,7 +1,6 @@
#include <drawables/animatedimagedrawable.h>
#include <systemclock.h>
#include <cdlog.h>
#include <gui/gui_features.h>
#include <view/view.h>
#include <image-decoders/imagedecoder.h>
#include <image-decoders/framesequence.h>

View File

@ -2,7 +2,6 @@
#include <cairomm/context.h>
#include <cairomm/surface.h>
#include <image-decoders/imagedecoder.h>
#include <gui/gui_features.h>
#include <core/systemclock.h>
#include <cdlog.h>
#include "png.h" /* original (unpatched) libpng is ok */

View File

@ -1,7 +1,6 @@
#include <core/context.h>
#include <cairomm/surface.h>
#include <image-decoders/imagedecoder.h>
#include <gui/gui_features.h>
#include <gif_lib.h>
#include <cdlog.h>

View File

@ -7,7 +7,6 @@
#include <drawables/animatedimagedrawable.h>
#include <image-decoders/imagedecoder.h>
#include <core/textutils.h>
#include <gui/gui_features.h>
namespace cdroid{

View File

@ -245,7 +245,7 @@ enum{
KEYCODE_AT = 77,
KEYCODE_NUM = 78,
KEYCODE_HEADSETHOOK = 79,
KEYCODE_FOCUS = 80, // *Camera* focus
KEYCODE_FOCUS = 80,/*Camera focus*/
KEYCODE_PLUS = 81,
KEYCODE_MENU = 82,
KEYCODE_NOTIFICATION = 83,
@ -328,7 +328,7 @@ enum{
KEYCODE_NUMPAD_ENTER = 160,
KEYCODE_NUMPAD_EQUALS = 161,
KEYCODE_NUMPAD_LEFT_PAREN = 162,
KEYCODE_NUMPAD_RIGHT_PAREN = 163,
KEYCODE_NUMPAD_RIGHT_PAREN= 163,
KEYCODE_VOLUME_MUTE = 164,
KEYCODE_INFO = 165,
KEYCODE_CHANNEL_UP = 166,
@ -401,7 +401,7 @@ enum{
KEYCODE_TV_TELETEXT = 233,
KEYCODE_TV_NUMBER_ENTRY = 234,
KEYCODE_TV_TERRESTRIAL_ANALOG = 235,
KEYCODE_TV_TERRESTRIAL_DIGITAL = 236,
KEYCODE_TV_TERRESTRIAL_DIGITAL= 236,
KEYCODE_TV_SATELLITE = 237,
KEYCODE_TV_SATELLITE_BS = 238,
KEYCODE_TV_SATELLITE_CS = 239,
@ -437,9 +437,9 @@ enum{
KEYCODE_DPAD_UP_RIGHT = 270,
KEYCODE_DPAD_DOWN_RIGHT = 271,
KEYCODE_MEDIA_SKIP_FORWARD = 272,
KEYCODE_MEDIA_SKIP_BACKWARD = 273,
KEYCODE_MEDIA_SKIP_BACKWARD= 273,
KEYCODE_MEDIA_STEP_FORWARD = 274,
KEYCODE_MEDIA_STEP_BACKWARD = 275,
KEYCODE_MEDIA_STEP_BACKWARD= 275,
KEYCODE_SOFT_SLEEP = 276,
KEYCODE_CUT = 277,
KEYCODE_COPY = 278,