diff --git a/cmake/options.cmake b/cmake/options.cmake index d70dfbb1..f50ae562 100755 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -56,15 +56,15 @@ find_package(RtAudio) set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES} ${RTAUDIO_INCLUDE_DIRS}") #message(FATAL_ERROR "RtAudio_INCLUDE_DIRS=${RtAudio_INCLUDE_DIR} RtAudio_FOUND=${RtAudio_FOUND}") list(APPEND CDROID_DEPLIBS - ${CAIRO_LIBRARIES} - ${PIXMAN_LIBRARIES} - ${FONTCONFIG_LIBRARIES} - ${FREETYPE2_LIBRARIES} - ${ZIP_LIBRARIES} - ${PNG_LIBRARIES} - ${EXPAT_LIBRARIES} ${ZLIB_LIBRARIES} + ${PNG_LIBRARIES} + ${FREETYPE2_LIBRARIES} + ${PIXMAN_LIBRARIES} + ${EXPAT_LIBRARIES} + ${FONTCONFIG_LIBRARIES} + ${CAIRO_LIBRARIES} ${UNIBREAK_LIBRARIES} + ${ZIP_LIBRARIES} ) if(RTAUDIO_FOUND AND ENABLE_AUDIO) list(APPEND CDROID_DEPLIBS ${RTAUDIO_LIBRARIES}) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 84241536..da0f01e0 100755 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -114,7 +114,7 @@ set(PKGCONFIG_LIBS "cairo bzip2 libzip")#do not use -l set(PKGCONFIG_LIBS_PRIVATE "expat bzip2 libzip") set(NONPKG_LIBS "-l${PROJECT_NAME} -ltvhal")#non pkgconfig libraries set(NONPKG_LIBS_PRIVATE "-ltvhal") -message("==CDROID_DEPLIBS=${CDROID_DEPLIBS}") +message("CDROID_DEPLIBS=${CDROID_DEPLIBS}") target_link_libraries(cdroid ${CDROID_DEPLIBS} tvhal) if(litehtml_FOUND) diff --git a/src/gui/view/motionevent.cc b/src/gui/view/motionevent.cc index 65657570..cc23a3e2 100644 --- a/src/gui/view/motionevent.cc +++ b/src/gui/view/motionevent.cc @@ -69,7 +69,7 @@ void PointerCoords::applyOffset(float xOffset, float yOffset) { } void PointerCoords::tooManyAxes(int axis) { - LOGD("Could not set value for axis %d because the PointerCoords structure is full and " + LOGW("Could not set value for axis %d because the PointerCoords structure is full and " "cannot contain more than %d axis values.", axis, int(MAX_AXES)); } diff --git a/src/gui/view/motionevent.h b/src/gui/view/motionevent.h index 1372fd15..63171fb6 100644 --- a/src/gui/view/motionevent.h +++ b/src/gui/view/motionevent.h @@ -194,18 +194,18 @@ public: MotionEvent(const MotionEvent&m); MotionEvent*copy()const override{return obtain(*this);} void initialize(int deviceId,int source,int displayId,int action,int actionButton, - int flags, int edgeFlags,int metaState, int buttonState, float xOffset, float yOffset, + int flags, int edgeFlags,int metaState, int buttonState, float xOffset, float yOffset, float xPrecision, float yPrecision,nsecs_t downTime, nsecs_t eventTime, size_t pointerCount, - const PointerProperties* pointerProperties,const PointerCoords* pointerCoords); + const PointerProperties* pointerProperties,const PointerCoords* pointerCoords); static MotionEvent*obtain(nsecs_t downTime, nsecs_t eventTime, int action, - int pointerCount, const PointerProperties* pointerProperties,const PointerCoords* pointerCoords, - int metaState, int buttonState, float xPrecision, float yPrecision, int deviceId, - int edgeFlags, int source, int flags); + int pointerCount, const PointerProperties* pointerProperties,const PointerCoords* pointerCoords, + int metaState, int buttonState, float xPrecision, float yPrecision, int deviceId, + int edgeFlags, int source, int flags); static MotionEvent* obtain(nsecs_t downTime, nsecs_t eventTime, int action, - float x, float y, float pressure, float size, int metaState, - float xPrecision, float yPrecision, int deviceId, int edgeFlags); + float x, float y, float pressure, float size, int metaState, + float xPrecision, float yPrecision, int deviceId, int edgeFlags); static MotionEvent* obtain(nsecs_t downTime, nsecs_t eventTime, int action, float x, float y, int metaState); static MotionEvent* obtain(const MotionEvent& other); diff --git a/src/gui/widget/patternlockview.cc b/src/gui/widget/patternlockview.cc index 9af35e72..4b6636ff 100644 --- a/src/gui/widget/patternlockview.cc +++ b/src/gui/widget/patternlockview.cc @@ -1,4 +1,3 @@ -#if 10 #include namespace cdroid{ static constexpr float FLOAT_MIN = std::numeric_limits::min(); @@ -926,4 +925,3 @@ void PatternLockView::checkRange(int row, int column) { } }//endof namespace -#endif diff --git a/tests/gui/looper_tests.cc b/tests/gui/looper_tests.cc index dce0afe3..f2c3a2b7 100755 --- a/tests/gui/looper_tests.cc +++ b/tests/gui/looper_tests.cc @@ -244,13 +244,16 @@ static void ms2timespec(int ms, struct timespec *ts){ } static int fdcallback(int fd, int events, void* data){ - uint64_t count; - int *loops=(int*)data; struct timespec cur; + int *loops=(int*)data; clock_gettime(CLOCK_MONOTONIC,&cur); - if(events&Looper::EVENT_INPUT) + if(events&Looper::EVENT_INPUT){ + uint64_t count; ::read(fd, &count, sizeof(uint64_t)); - if(*loops>20){ + (*loops)+=count; + LOGD("loops +%d = %d",count,*loops); + } + if(*loops>=20){ struct itimerspec new_value={{0,0},{0,0}}; timerfd_settime(fd,0,&new_value, NULL); Looper::getMainLooper()->removeFd(fd); @@ -269,34 +272,7 @@ TEST_F(LOOPER,timerfd){ int rc=timerfd_settime(fd, 0/*TFD_TIMER_ABSTIME*/, &new_value,NULL); mLooper->addFd(fd,0,Looper::EVENT_INPUT,fdcallback,&loops); - while(1)mLooper->pollAll(10); + while(loops<20)mLooper->pollAll(10); + ASSERT_EQ(loops,20); } -TEST_F(LOOPER,timerfd2){ - #define INTERVAL 200 //ms - App app; - int loops=0; - Looper*loop= Looper::getMainLooper(); - struct itimerspec new_value={{0,0},{0,0}}; - - ms2timespec(INTERVAL,&new_value.it_value); - ms2timespec(INTERVAL,&new_value.it_interval); - int fd=timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK | TFD_CLOEXEC); - - int rc=timerfd_settime(fd, 0/*TFD_TIMER_ABSTIME*/, &new_value, NULL); - loop->addFd(fd,0,Looper::EVENT_INPUT,fdcallback,&loops); - Window*w = new Window(0,0,-1,-1); - Button*btn= new Button("Test",200,200); - w->addView(btn); - int color=11,color2=0; - Runnable run={[&](){ - btn->setBackgroundColor(0xFF000000|color|(color2<<8)); - color+=8;color2+=4; - w->postDelayed(run,100); - }}; - w->postDelayed(run,100); - btn->setOnClickListener([](View&v){ - printf("button clicked \r\n"); - }); - app.exec(); -}