From ea462ec7939c15cba337eadf4cb33cbbef963d78 Mon Sep 17 00:00:00 2001 From: houzh Date: Sun, 6 Nov 2022 23:49:41 +0000 Subject: [PATCH] remove namespace Cairo from all header --- apps/samples/CMakeLists.txt | 3 +- apps/samples/gridview.cc | 2 +- apps/samples/horzscroll.cc | 2 +- apps/samples/viewpager3.cc | 2 +- apps/uidemo1/CMakeLists.txt | 2 + apps/uidemo1/nm1.h | 17 ++++ apps/uidemo1/nm2.cc | 10 +++ apps/uidemo1/nm2.h | 11 +++ apps/uidemo2/CMakeLists.txt | 2 + cmake/modules/FindCairo.cmake | 75 ++++++++++++++++ cmake/modules/FindFreetype2.cmake | 88 +++++++++++++++++++ .../cairo-1.16.0/Configure_config.cmake | 2 +- src/3rdparty/libpng/CMakeLists.txt | 19 ++-- src/gui/CMakeLists.txt | 4 +- src/gui/animation/animation.cc | 1 + src/gui/animation/propertyvaluesholder.cc | 1 + src/gui/animation/propertyvaluesholder.h | 1 - src/gui/cairomm/cairo_jpg.cc | 2 +- src/gui/cairomm/surface.h | 8 +- src/gui/core/app.h | 1 - src/gui/core/assets.cc | 2 +- src/gui/core/assets.h | 2 +- src/gui/core/canvas.h | 9 +- src/gui/core/context.h | 6 +- src/gui/core/graphdevice.h | 5 +- src/gui/core/inputmethod.cc | 2 +- src/gui/core/layout.cc | 2 +- src/gui/core/layout.h | 2 +- src/gui/core/windowmanager.cc | 2 +- src/gui/drawables/animatedimagedrawable.h | 2 +- src/gui/drawables/animatedrotatedrawable.cc | 2 +- src/gui/drawables/bitmapdrawable.cc | 1 + src/gui/drawables/bitmapdrawable.h | 13 ++- src/gui/drawables/colormatrix.cc | 1 + src/gui/drawables/colormatrix.h | 3 +- src/gui/drawables/drawable.cc | 1 + src/gui/drawables/gradientdrawable.cc | 1 + src/gui/drawables/gradientdrawable.h | 4 +- src/gui/drawables/ninepatchdrawable.cc | 2 +- src/gui/drawables/ninepatchdrawable.h | 6 +- src/gui/drawables/picturedrawable.h | 2 +- src/gui/drawables/rotatedrawable.cc | 2 +- src/gui/drawables/shape.cc | 2 +- src/gui/drawables/shape.h | 4 +- src/gui/view/menu.cc | 2 + src/gui/view/menu.h | 2 +- src/gui/view/rendernode.cc | 1 + src/gui/view/rendernode.h | 6 +- src/gui/view/view.cc | 2 +- src/gui/view/view.h | 8 +- src/gui/view/viewgroup.cc | 1 + src/gui/view/viewgroup.h | 2 +- src/gui/view/viewpropertyanimator.cc | 1 + src/gui/widget/adapter.h | 1 - src/gui/widget/cdwindow.cc | 1 + src/gui/widget/cdwindow.h | 6 +- src/gui/widget/fastscroller.cc | 1 + src/gui/widget/forwardinglistener.cc | 1 + src/gui/widget/imageview.cc | 1 + src/gui/widget/imageview.h | 2 +- src/gui/widget/listpopupwindow.cc | 1 + src/gui/widget/pagetransformers.cc | 1 + src/gui/widget/plotview.cc | 2 +- src/gui/widget/plotview.h | 4 +- src/gui/widget/popupwindow.cc | 1 + src/gui/widget/relativelayout.cc | 1 + src/gui/widget/tablayout.cc | 1 + src/porting/x86/CMakeLists.txt | 1 + tests/CMakeLists.txt | 2 + tests/gui/benchmark_tests.cc | 2 +- tests/gui/drawable_tests.cc | 1 + tests/gui/drawablemutate_tests.cc | 1 + tests/gui/surface_unittests.cc | 2 +- x86build.sh | 1 + 74 files changed, 309 insertions(+), 81 deletions(-) create mode 100644 apps/uidemo1/nm1.h create mode 100644 apps/uidemo1/nm2.cc create mode 100644 apps/uidemo1/nm2.h create mode 100755 cmake/modules/FindCairo.cmake create mode 100755 cmake/modules/FindFreetype2.cmake diff --git a/apps/samples/CMakeLists.txt b/apps/samples/CMakeLists.txt index f2aeacb2..4c0bc300 100755 --- a/apps/samples/CMakeLists.txt +++ b/apps/samples/CMakeLists.txt @@ -20,7 +20,8 @@ add_custom_target(build_app_examples COMMENT A target that requires all the exam if(NOT ENABLE_PLPLOT) list(REMOVE_ITEM ExamplesFileList plot.cc) endif() - +add_definitions(--include cdtypes.h) +add_definitions(--include cdlog.h) foreach(Example ${ExamplesFileList}) message(STATUS "\tCreating build rule for ${Example}") # Get the name without extension or directory diff --git a/apps/samples/gridview.cc b/apps/samples/gridview.cc index f2c82960..45f865f3 100755 --- a/apps/samples/gridview.cc +++ b/apps/samples/gridview.cc @@ -9,7 +9,7 @@ #include #include #include - +using namespace Cairo; class MyAdapter:public ArrayAdapter{ public: MyAdapter():ArrayAdapter(){ diff --git a/apps/samples/horzscroll.cc b/apps/samples/horzscroll.cc index cde72caa..4679e0d1 100755 --- a/apps/samples/horzscroll.cc +++ b/apps/samples/horzscroll.cc @@ -1,6 +1,6 @@ #include #include - +using namespace Cairo; int main(int argc,const char*argv[]){ App app(argc,argv); Window*w=new Window(0,0,1280,600); diff --git a/apps/samples/viewpager3.cc b/apps/samples/viewpager3.cc index a6c98996..e0d275f4 100755 --- a/apps/samples/viewpager3.cc +++ b/apps/samples/viewpager3.cc @@ -1,7 +1,7 @@ #include #include #include - +using namespace Cairo; class MyPageAdapter:public PagerAdapter{ std::vectorurls; std::map< int,RefPtr >imgs; diff --git a/apps/uidemo1/CMakeLists.txt b/apps/uidemo1/CMakeLists.txt index 3b9043d6..00031158 100755 --- a/apps/uidemo1/CMakeLists.txt +++ b/apps/uidemo1/CMakeLists.txt @@ -15,6 +15,8 @@ include_directories( ${DEPS_DIR}/include/freetype2 ) aux_source_directory(./ DEMO_SRCS) +add_definitions(--include cdtypes.h) +add_definitions(--include cdlog.h) link_directories(${DEPS_DIR}/lib) add_executable(uidemo1 ${DEMO_SRCS}) diff --git a/apps/uidemo1/nm1.h b/apps/uidemo1/nm1.h new file mode 100644 index 00000000..191aef15 --- /dev/null +++ b/apps/uidemo1/nm1.h @@ -0,0 +1,17 @@ +#ifndef __NM__1_H__ +#define __NM__1_H__ +namespace n2{ + class test2; +} +namespace n1{ + +class test1{ +private: + friend n2::test2; + struct Student{ + char *name; + }; + Student a; +}; +}; +#endif diff --git a/apps/uidemo1/nm2.cc b/apps/uidemo1/nm2.cc new file mode 100644 index 00000000..8ea7d3dd --- /dev/null +++ b/apps/uidemo1/nm2.cc @@ -0,0 +1,10 @@ +#include +#include +namespace n2{ + +test2::test2(){ + n1::test1 tt; + tt.a.name="test"; +} + +} diff --git a/apps/uidemo1/nm2.h b/apps/uidemo1/nm2.h new file mode 100644 index 00000000..a6fb8085 --- /dev/null +++ b/apps/uidemo1/nm2.h @@ -0,0 +1,11 @@ +#ifndef __NM2_H__ +#define __NM2_H__ + +namespace n2{ +class test2{ +private: + test2(); +}; + +} +#endif diff --git a/apps/uidemo2/CMakeLists.txt b/apps/uidemo2/CMakeLists.txt index 926beb78..24c2a2db 100755 --- a/apps/uidemo2/CMakeLists.txt +++ b/apps/uidemo2/CMakeLists.txt @@ -14,6 +14,8 @@ include_directories( ${DEPS_DIR}/include/epg ${DEPS_DIR}/include/freetype2 ) +add_definitions(--include cdtypes.h) +add_definitions(--include cdlog.h) aux_source_directory(./ DEMO_SRCS) link_directories(${DEPS_DIR}/lib) add_executable(uidemo2 ${DEMO_SRCS}) diff --git a/cmake/modules/FindCairo.cmake b/cmake/modules/FindCairo.cmake new file mode 100755 index 00000000..d0130ad5 --- /dev/null +++ b/cmake/modules/FindCairo.cmake @@ -0,0 +1,75 @@ +# - Try to find Cairo +# Once done, this will define +# +# CAIRO_FOUND - system has Cairo +# CAIRO_INCLUDE_DIRS - the Cairo include directories +# CAIRO_LIBRARIES - link these to use Cairo +# +# Copyright (C) 2012 Raphael Kubo da Costa +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS +# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +find_package(PkgConfig) +pkg_check_modules(PC_CAIRO QUIET cairo) + +find_path(CAIRO_INCLUDE_DIRS + NAMES cairo.h + HINTS ${PC_CAIRO_INCLUDEDIR} + ${PC_CAIRO_INCLUDE_DIRS} + PATH_SUFFIXES cairo +) + +find_library(CAIRO_LIBRARIES + NAMES cairo + HINTS ${PC_CAIRO_LIBDIR} + ${PC_CAIRO_LIBRARY_DIRS} +) + +if (CAIRO_INCLUDE_DIRS) + if (EXISTS "${CAIRO_INCLUDE_DIRS}/cairo-version.h") + file(READ "${CAIRO_INCLUDE_DIRS}/cairo-version.h" CAIRO_VERSION_CONTENT) + + string(REGEX MATCH "#define +CAIRO_VERSION_MAJOR +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}") + set(CAIRO_VERSION_MAJOR "${CMAKE_MATCH_1}") + + string(REGEX MATCH "#define +CAIRO_VERSION_MINOR +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}") + set(CAIRO_VERSION_MINOR "${CMAKE_MATCH_1}") + + string(REGEX MATCH "#define +CAIRO_VERSION_MICRO +([0-9]+)" _dummy "${CAIRO_VERSION_CONTENT}") + set(CAIRO_VERSION_MICRO "${CMAKE_MATCH_1}") + + set(CAIRO_VERSION "${CAIRO_VERSION_MAJOR}.${CAIRO_VERSION_MINOR}.${CAIRO_VERSION_MICRO}") + endif () +endif () + +if ("${Cairo_FIND_VERSION}" VERSION_GREATER "${CAIRO_VERSION}") + message(FATAL_ERROR "Required version (" ${Cairo_FIND_VERSION} ") is higher than found version (" ${CAIRO_VERSION} ")") +endif () + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cairo REQUIRED_VARS CAIRO_INCLUDE_DIRS CAIRO_LIBRARIES + VERSION_VAR CAIRO_VERSION) + +mark_as_advanced( + CAIRO_INCLUDE_DIRS + CAIRO_LIBRARIES +) diff --git a/cmake/modules/FindFreetype2.cmake b/cmake/modules/FindFreetype2.cmake new file mode 100755 index 00000000..fdcc2c92 --- /dev/null +++ b/cmake/modules/FindFreetype2.cmake @@ -0,0 +1,88 @@ +# Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +find_package(PkgConfig) +pkg_check_modules(PC_FREETYPE2 REQUIRED freetype2) + +find_path(FREETYPE2_HEADER_DIR + NAMES freetype.h + HINTS ${PC_FREETYPE2_INCLUDE_DIRS} + ${PC_FREETYPE2_INCLUDEDIR} + PATH_SUFFIXES freetype +) + +find_path(FREETYPE2_ROOT_INCLUDE_DIR + NAMES freetype/freetype.h + HINTS ${PC_FREETYPE2_INCLUDE_DIRS} + ${PC_FREETYPE2_INCLUDEDIR} +) + +find_library(FREETYPE2_LIBRARIES + NAMES freetype + HINTS ${PC_FREETYPE2_LIBDIR} + ${PC_FREETYPE2_LIBRARY_DIRS} +) + +set(FREETYPE2_INCLUDE_DIRS ${FREETYPE2_HEADER_DIR}) + +# Since Freetype 2.5.1 there is no freetype/freetype.h, so this variable can be null +if (FREETYPE2_ROOT_INCLUDE_DIR) + list(APPEND FREETYPE2_INCLUDE_DIRS ${FREETYPE2_ROOT_INCLUDE_DIR}) +endif () + +# Inspired in the original FindFreetype.cmake +if (FREETYPE2_HEADER_DIR AND EXISTS "${FREETYPE2_HEADER_DIR}/freetype.h") + file(STRINGS "${FREETYPE2_HEADER_DIR}/freetype.h" freetype_version_str + REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$") + + unset(FREETYPE2_VERSION_STRING) + foreach (VPART MAJOR MINOR PATCH) + foreach (VLINE ${freetype_version_str}) + if (VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}") + string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1" + FREETYPE2_VERSION_PART "${VLINE}") + if (FREETYPE2_VERSION_STRING) + set(FREETYPE2_VERSION_STRING "${FREETYPE2_VERSION_STRING}.${FREETYPE2_VERSION_PART}") + else () + set(FREETYPE2_VERSION_STRING "${FREETYPE2_VERSION_PART}") + endif () + unset(FREETYPE2_VERSION_PART) + endif () + endforeach () + endforeach () +endif () + +set(VERSION_OK TRUE) +if (FREETYPE2_VERSION_STRING) + if (PC_FREETYPE2_FIND_VERSION_EXACT) + if (NOT("${Freetype2_FIND_VERSION}" VERSION_EQUAL "${FREETYPE2_VERSION_STRING}")) + set(VERSION_OK FALSE) + endif () + else () + if ("${FREETYPE2_VERSION_STRING}" VERSION_LESS "${Freetype2_FIND_VERSION}") + set(VERSION_OK FALSE) + endif () + endif () +endif () + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype2 DEFAULT_MSG FREETYPE2_INCLUDE_DIRS FREETYPE2_LIBRARIES VERSION_OK) diff --git a/src/3rdparty/cairo-1.16.0/Configure_config.cmake b/src/3rdparty/cairo-1.16.0/Configure_config.cmake index 00243f88..eddae542 100755 --- a/src/3rdparty/cairo-1.16.0/Configure_config.cmake +++ b/src/3rdparty/cairo-1.16.0/Configure_config.cmake @@ -157,7 +157,7 @@ endif() if(SIZEOF_UINT128_T) set(HAVE_UINT128_T 1) endif() -if(SIZEOF_UINT64_T) +if(TRUE)##SIZEOF_UINT64_T) set(HAVE_UINT64_T 1) endif() diff --git a/src/3rdparty/libpng/CMakeLists.txt b/src/3rdparty/libpng/CMakeLists.txt index d89ff086..5a7a1b2a 100755 --- a/src/3rdparty/libpng/CMakeLists.txt +++ b/src/3rdparty/libpng/CMakeLists.txt @@ -44,7 +44,8 @@ if(NOT PNG_BUILD_ZLIB) endif() if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU) - find_library(M_LIBRARY m) + set(M_LIBRARY "m") + #find_library(M_LIBRARY "m") else() # libm is not needed and/or not available set(M_LIBRARY "") @@ -63,7 +64,6 @@ set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names") set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings") if(PNG_HARDWARE_OPTIMIZATIONS) - # set definitions and sources for arm if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64") @@ -489,6 +489,8 @@ set(libpng_sources ${libpng_mips_sources} ${libpng_powerpc_sources} ) + +if (FALSE) set(pngtest_sources pngtest.c ) @@ -510,6 +512,7 @@ set(pngfix_sources set(png_fix_itxt_sources contrib/tools/png-fix-itxt.c ) +endif() if(MSVC) add_definitions(-D_CRT_SECURE_NO_DEPRECATE) @@ -746,13 +749,13 @@ if(BUILD_TESTS AND PNG_SHARED) endif() if(PNG_SHARED) - add_executable(pngfix ${pngfix_sources}) - target_link_libraries(pngfix png) - set(PNG_BIN_TARGETS pngfix) + #add_executable(pngfix ${pngfix_sources}) + #target_link_libraries(pngfix png) + #set(PNG_BIN_TARGETS pngfix) - add_executable(png-fix-itxt ${png_fix_itxt_sources}) - target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY}) - list(APPEND PNG_BIN_TARGETS png-fix-itxt) + #add_executable(png-fix-itxt ${png_fix_itxt_sources}) + #target_link_libraries(png-fix-itxt ${ZLIB_LIBRARY} ${M_LIBRARY}) + #list(APPEND PNG_BIN_TARGETS png-fix-itxt) endif() # Set a variable with CMake code which: diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b43cc266..424e1a06 100755 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -26,6 +26,7 @@ include_directories( ./core/svg ./luabinding ${CMAKE_BINARY_DIR}/include ${PNG_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIR} ${PLPLOT_INCLUDE_DIR} + ${CMAKE_BINARY_DIR}/include/gui ${CMAKE_BINARY_DIR}/include/pixman ${CMAKE_BINARY_DIR}/include/cairo ${CMAKE_BINARY_DIR}/include/porting @@ -41,7 +42,8 @@ include_directories( ) add_definitions(-DRAPIDJSON_HAS_STDSTRING) - +add_definitions(--include cdtypes.h) +add_definitions(--include cdlog.h) set(SOURCES_GUI ${SRCS_GUICORE} ${SRCS_VIEWS} ${SRCS_CAIROMM} ${SRCS_WIDGET} ${SRCS_DRAWABLES} diff --git a/src/gui/animation/animation.cc b/src/gui/animation/animation.cc index 7f28f740..91b81b10 100755 --- a/src/gui/animation/animation.cc +++ b/src/gui/animation/animation.cc @@ -5,6 +5,7 @@ #include #include +using namespace Cairo; namespace cdroid{ Animation::Animation() { diff --git a/src/gui/animation/propertyvaluesholder.cc b/src/gui/animation/propertyvaluesholder.cc index e5166412..6bb911b0 100755 --- a/src/gui/animation/propertyvaluesholder.cc +++ b/src/gui/animation/propertyvaluesholder.cc @@ -1,4 +1,5 @@ #include +#include "cdlog.h" namespace cdroid{ PropertyValuesHolder::PropertyValuesHolder(){ diff --git a/src/gui/animation/propertyvaluesholder.h b/src/gui/animation/propertyvaluesholder.h index 8080dace..de94c945 100755 --- a/src/gui/animation/propertyvaluesholder.h +++ b/src/gui/animation/propertyvaluesholder.h @@ -7,7 +7,6 @@ #include #include #include -#include #include #include //reference: diff --git a/src/gui/cairomm/cairo_jpg.cc b/src/gui/cairomm/cairo_jpg.cc index e5c53cdf..0713ab17 100644 --- a/src/gui/cairomm/cairo_jpg.cc +++ b/src/gui/cairomm/cairo_jpg.cc @@ -53,7 +53,7 @@ #include #include #include "cairo_jpg.h" -#include +#include #include #include #include diff --git a/src/gui/cairomm/surface.h b/src/gui/cairomm/surface.h index 5b3d4e34..6405259d 100755 --- a/src/gui/cairomm/surface.h +++ b/src/gui/cairomm/surface.h @@ -39,7 +39,7 @@ #include #include #include -#include +#include //See xlib_surface.h for XlibSurface. //See win32_surface.h for Win32Surface. @@ -271,9 +271,9 @@ public: * in the middle 6 bits, and blue in the lower 5 bits */ RGB16_565 = CAIRO_FORMAT_RGB16_565, - RGB30 =CAIRO_FORMAT_RGB30 , /*like RGB24 but with 10bpc. (Since 1.12)*/ - RGB96F = CAIRO_FORMAT_RGB96F, /*3 floats, R, G, B. (Since 1.17.2)*/ - RGB128F = CAIRO_FORMAT_RGBA128F/*4 floats, R, G, B, A. (Since 1.17.2)*/ + //RGB30 =CAIRO_FORMAT_RGB30 , /*like RGB24 but with 10bpc. (Since 1.12)*/ + //RGB96F = CAIRO_FORMAT_RGB96F, /*3 floats, R, G, B. (Since 1.17.2)*/ + //RGB128F = CAIRO_FORMAT_RGBA128F/*4 floats, R, G, B, A. (Since 1.17.2)*/ }; /** For example: * diff --git a/src/gui/core/app.h b/src/gui/core/app.h index 99b0ba65..4a580a90 100644 --- a/src/gui/core/app.h +++ b/src/gui/core/app.h @@ -8,7 +8,6 @@ #include #include struct option; -using namespace Cairo; namespace cdroid{ diff --git a/src/gui/core/assets.cc b/src/gui/core/assets.cc index aff508e6..6a56511c 100755 --- a/src/gui/core/assets.cc +++ b/src/gui/core/assets.cc @@ -11,7 +11,7 @@ #include #include #include - +using namespace Cairo; namespace cdroid{ Assets::Assets(){ diff --git a/src/gui/core/assets.h b/src/gui/core/assets.h index f96608a0..30a644d7 100755 --- a/src/gui/core/assets.h +++ b/src/gui/core/assets.h @@ -44,7 +44,7 @@ public: const DisplayMetrics&getDisplayMetrics()override; int getId(const std::string&)const override; const std::string& getString(const std::string&id,const std::string&lan="")override; - RefPtr getImage(const std::string&resname)override; + Cairo::RefPtr getImage(const std::string&resname)override; std::vector getStringArray(const std::string&resname,const std::string&arrayname)const; std::unique_ptr getInputStream(const std::string&resname,std::string*outpkg=nullptr)override; Drawable * getDrawable(const std::string&resid)override; diff --git a/src/gui/core/canvas.h b/src/gui/core/canvas.h index 89d982fd..9ca6e6ac 100644 --- a/src/gui/core/canvas.h +++ b/src/gui/core/canvas.h @@ -5,8 +5,7 @@ #include #include #include -#include -using namespace Cairo; +#include namespace cdroid{ @@ -29,7 +28,7 @@ protected: friend class GraphDevice; friend class WindowManager; public: - Canvas(const RefPtr&target); + Canvas(const Cairo::RefPtr&target); Canvas(unsigned int width,unsigned int height); ~Canvas(); void get_text_size(const std::string&txt,int*w,int*h); @@ -38,11 +37,11 @@ public: void set_color(UINT color); void rectangle(int x,int y,int w,int h); void rectangle(const RECT &r); - void draw_image(const RefPtr&img,const RECT&dst,const RECT*src); + void draw_image(const Cairo::RefPtr&img,const RECT&dst,const RECT*src); void rotate(float degrees,float px,float py); void dump2png(const char*fname); }; -extern void DumpRegion(const std::string&label,RefPtrrgn); +extern void DumpRegion(const std::string&label,Cairo::RefPtrrgn); }//namspace #endif diff --git a/src/gui/core/context.h b/src/gui/core/context.h index 2695e57b..e8081084 100755 --- a/src/gui/core/context.h +++ b/src/gui/core/context.h @@ -9,8 +9,6 @@ #include #include -using namespace Cairo; - namespace cdroid{ class Drawable; @@ -22,11 +20,11 @@ public: virtual const DisplayMetrics&getDisplayMetrics()=0; virtual int getId(const std::string&)const=0; virtual const std::string& getString(const std::string&id,const std::string&lan="")=0; - static RefPtr loadImage( std::istream&istream ){ + static Cairo::RefPtr loadImage( std::istream&istream ){ return Cairo::ImageSurface::create_from_stream(istream); } virtual std::unique_ptrgetInputStream(const std::string&,std::string*outpkg=nullptr)=0; - virtual RefPtr getImage(const std::string&resname)=0; + virtual Cairo::RefPtr getImage(const std::string&resname)=0; virtual Drawable* getDrawable(const std::string&resid)=0; Drawable* getDrawable(const AttributeSet&atts,const std::string&key){ return atts.hasAttribute(key)?getDrawable(atts.getString(key)):nullptr; diff --git a/src/gui/core/graphdevice.h b/src/gui/core/graphdevice.h index 64535a18..5451182d 100755 --- a/src/gui/core/graphdevice.h +++ b/src/gui/core/graphdevice.h @@ -6,7 +6,6 @@ #include #include -using namespace Cairo; namespace cdroid{ class GraphDevice{ private: @@ -27,12 +26,12 @@ private: HANDLE mBannerSurface; class Canvas*mPrimaryContext; Canvas *mBannerContext; - RefPtrmInvalidateRgn; + Cairo::RefPtrmInvalidateRgn; static GraphDevice*mInst; GraphDevice(int format=-1); void trackFPS(); void doCompose(); - void computeVisibleRegion(std::vector&windows,std::vector>®ions); + void computeVisibleRegion(std::vector&windows,std::vector>®ions); public: static GraphDevice&getInstance(); ~GraphDevice(); diff --git a/src/gui/core/inputmethod.cc b/src/gui/core/inputmethod.cc index 2e638838..e6385c6a 100644 --- a/src/gui/core/inputmethod.cc +++ b/src/gui/core/inputmethod.cc @@ -3,7 +3,7 @@ #include #include #include -#include +#include #ifndef ENABLE_PINYIN2HZ #include #endif diff --git a/src/gui/core/layout.cc b/src/gui/core/layout.cc index 6d57da3f..17243b75 100644 --- a/src/gui/core/layout.cc +++ b/src/gui/core/layout.cc @@ -5,7 +5,7 @@ #include #include #include - +using namespace Cairo; namespace cdroid{ #define START 0 #define TOP 1 diff --git a/src/gui/core/layout.h b/src/gui/core/layout.h index 2d84309f..f24aa613 100644 --- a/src/gui/core/layout.h +++ b/src/gui/core/layout.h @@ -23,7 +23,7 @@ private: int mLayout; //mLayout>0 need relayout Rect mCaretRect; void pushLineData(int start,int ytop,int descent,int width); - float measureSize(const std::wstring&text,TextExtents&te,FontExtents*fe=nullptr)const; + float measureSize(const std::wstring&text,Cairo::TextExtents&te,Cairo::FontExtents*fe=nullptr)const; void calculateEllipsis(int line,int linewidth); void setEllipse(int line,int start,int count); const std::wstring getLineText(int line,bool expandSllipsis=false)const; diff --git a/src/gui/core/windowmanager.cc b/src/gui/core/windowmanager.cc index 07e07edf..8a71e7da 100755 --- a/src/gui/core/windowmanager.cc +++ b/src/gui/core/windowmanager.cc @@ -22,7 +22,7 @@ #include #include - +using namespace Cairo; namespace cdroid { // Initialize the instance of the singleton to nullptr WindowManager* WindowManager::mInst = nullptr; diff --git a/src/gui/drawables/animatedimagedrawable.h b/src/gui/drawables/animatedimagedrawable.h index 7f4cf9f3..93e5d548 100755 --- a/src/gui/drawables/animatedimagedrawable.h +++ b/src/gui/drawables/animatedimagedrawable.h @@ -13,7 +13,7 @@ private: int mCurrentFrame; int mFrameCount; void*mHandler; - RefPtrmImage; + Cairo::RefPtrmImage; State(); ~State(); }; diff --git a/src/gui/drawables/animatedrotatedrawable.cc b/src/gui/drawables/animatedrotatedrawable.cc index cf4e79a4..eb233977 100755 --- a/src/gui/drawables/animatedrotatedrawable.cc +++ b/src/gui/drawables/animatedrotatedrawable.cc @@ -4,7 +4,7 @@ #include #include - +using namespace Cairo; namespace cdroid{ AnimatedRotateDrawable::AnimatedRotateState::AnimatedRotateState(){ diff --git a/src/gui/drawables/bitmapdrawable.cc b/src/gui/drawables/bitmapdrawable.cc index 567fcc86..6b5d4da8 100755 --- a/src/gui/drawables/bitmapdrawable.cc +++ b/src/gui/drawables/bitmapdrawable.cc @@ -3,6 +3,7 @@ #include #include +using namespace Cairo; namespace cdroid{ BitmapDrawable::BitmapState::BitmapState(){ diff --git a/src/gui/drawables/bitmapdrawable.h b/src/gui/drawables/bitmapdrawable.h index 96332b59..7fec1b36 100755 --- a/src/gui/drawables/bitmapdrawable.h +++ b/src/gui/drawables/bitmapdrawable.h @@ -3,7 +3,6 @@ #include #include #include -using namespace Cairo; namespace cdroid{ enum TileMode{ @@ -29,9 +28,9 @@ private: int mTileModeY; int mSrcDensityOverride; int mTargetDensity; - RefPtrmBitmap; + Cairo::RefPtrmBitmap; BitmapState(); - BitmapState(RefPtrbitmap); + BitmapState(Cairo::RefPtrbitmap); BitmapState(const BitmapState&bitmapState); ~BitmapState()override; Drawable* newDrawable()override; @@ -52,12 +51,12 @@ protected: bool mDstRectAndInsetsDirty; void onBoundsChange(const Rect&r)override; bool onStateChange(const std::vector&)override; - static int computeTransparency(RefPtrbmp); + static int computeTransparency(Cairo::RefPtrbmp); public: - BitmapDrawable(RefPtrimg); + BitmapDrawable(Cairo::RefPtrimg); BitmapDrawable(Context*ctx,const std::string&resname); - RefPtr getBitmap()const; - void setBitmap(RefPtrbmp); + Cairo::RefPtr getBitmap()const; + void setBitmap(Cairo::RefPtrbmp); void setAlpha(int a)override; int getAlpha()const override; int getGravity()const; diff --git a/src/gui/drawables/colormatrix.cc b/src/gui/drawables/colormatrix.cc index b36bbf0f..9b98bf6a 100644 --- a/src/gui/drawables/colormatrix.cc +++ b/src/gui/drawables/colormatrix.cc @@ -2,6 +2,7 @@ #include #include #include +using namespace Cairo; namespace cdroid{ ColorVector::ColorVector(){ diff --git a/src/gui/drawables/colormatrix.h b/src/gui/drawables/colormatrix.h index 47cc2fba..f5f09d78 100644 --- a/src/gui/drawables/colormatrix.h +++ b/src/gui/drawables/colormatrix.h @@ -3,7 +3,6 @@ #include #include #include -using namespace Cairo; namespace cdroid{ class ColorVector{ @@ -35,7 +34,7 @@ public: void setRGB2YUV(); void setYUV2RGB(); unsigned int transform(unsigned int color); - RefPtrtransform(const RefPtr&img); + Cairo::RefPtrtransform(const Cairo::RefPtr&img); }; ColorVector operator * (const ColorMatrix &m , const ColorVector &v); diff --git a/src/gui/drawables/drawable.cc b/src/gui/drawables/drawable.cc index 7fffb9ac..42465d84 100755 --- a/src/gui/drawables/drawable.cc +++ b/src/gui/drawables/drawable.cc @@ -6,6 +6,7 @@ #include #include +using namespace Cairo; namespace cdroid{ Drawable::ConstantState::~ConstantState(){ diff --git a/src/gui/drawables/gradientdrawable.cc b/src/gui/drawables/gradientdrawable.cc index f7da64d0..16836691 100755 --- a/src/gui/drawables/gradientdrawable.cc +++ b/src/gui/drawables/gradientdrawable.cc @@ -1,6 +1,7 @@ #include #include #include +using namespace Cairo; namespace cdroid{ #define DEFAULT_INNER_RADIUS_RATIO 3.0f diff --git a/src/gui/drawables/gradientdrawable.h b/src/gui/drawables/gradientdrawable.h index 11e3bc07..01f5c310 100755 --- a/src/gui/drawables/gradientdrawable.h +++ b/src/gui/drawables/gradientdrawable.h @@ -116,8 +116,8 @@ private: std::shared_ptrmGradientState; std::vectormDashArray; double mStrokeWidth; - RefPtrmStrokePaint; - RefPtrmFillPaint; + Cairo::RefPtrmStrokePaint; + Cairo::RefPtrmFillPaint; bool ensureValidRect(); void buildPathIfDirty(); bool isOpaqueForState()const; diff --git a/src/gui/drawables/ninepatchdrawable.cc b/src/gui/drawables/ninepatchdrawable.cc index 5822db21..febe7525 100755 --- a/src/gui/drawables/ninepatchdrawable.cc +++ b/src/gui/drawables/ninepatchdrawable.cc @@ -1,7 +1,7 @@ #include #include #include - +using namespace Cairo; namespace cdroid{ //https://github.com/soramimi/QtNinePatch/blob/master/NinePatch.cpp diff --git a/src/gui/drawables/ninepatchdrawable.h b/src/gui/drawables/ninepatchdrawable.h index d3de49a8..defdc99e 100755 --- a/src/gui/drawables/ninepatchdrawable.h +++ b/src/gui/drawables/ninepatchdrawable.h @@ -24,10 +24,10 @@ private: std::vector
mHorz; std::vector
mVert; ColorStateList*mTint; - RefPtrmNinePatch; + Cairo::RefPtrmNinePatch; NinePatchState(); NinePatchState(const NinePatchState&state); - NinePatchState(RefPtrbitmap,const Rect*padding=nullptr); + NinePatchState(Cairo::RefPtrbitmap,const Rect*padding=nullptr); Drawable*newDrawable()override; void draw(Canvas&canvas,const Rect&rect); int getChangingConfigurations()const override; @@ -48,7 +48,7 @@ protected: bool onStateChange(const std::vector& stateSet)override; public: NinePatchDrawable(Context*,const std::string&resid); - NinePatchDrawable(RefPtrbmp); + NinePatchDrawable(Cairo::RefPtrbmp); ~NinePatchDrawable(); void setTargetDensity(int density); Insets getOpticalInsets()override; diff --git a/src/gui/drawables/picturedrawable.h b/src/gui/drawables/picturedrawable.h index 9cc75472..7014c38a 100755 --- a/src/gui/drawables/picturedrawable.h +++ b/src/gui/drawables/picturedrawable.h @@ -3,7 +3,7 @@ namespace cdroid{ -typedef RefPtrPicture; +typedef Cairo::RefPtrPicture; class PictureDrawable:public Drawable{ private: diff --git a/src/gui/drawables/rotatedrawable.cc b/src/gui/drawables/rotatedrawable.cc index cd18506a..814e0aaf 100755 --- a/src/gui/drawables/rotatedrawable.cc +++ b/src/gui/drawables/rotatedrawable.cc @@ -1,7 +1,7 @@ #include #include - +using namespace Cairo; namespace cdroid{ #define MAX_LEVEL 10000 RotateDrawable::RotateState::RotateState() diff --git a/src/gui/drawables/shape.cc b/src/gui/drawables/shape.cc index df991838..e9b4d1ca 100755 --- a/src/gui/drawables/shape.cc +++ b/src/gui/drawables/shape.cc @@ -1,7 +1,7 @@ #include #include #include - +using namespace Cairo; namespace cdroid{ Shape::Shape(){ diff --git a/src/gui/drawables/shape.h b/src/gui/drawables/shape.h index 8a282d6a..aa9d47f0 100755 --- a/src/gui/drawables/shape.h +++ b/src/gui/drawables/shape.h @@ -18,7 +18,7 @@ protected: float mGradientCenterY; bool bUseLevel; std::vectormGradientColors;//size 0:nofill, 1:solid fill 2,3:gradient fill - RefPtrmPaint;//used to fill + Cairo::RefPtrmPaint;//used to fill void rebuildPattern(int x,int y); virtual void onResize(int width,int height){} void fill_stroke(Canvas&canvas,int x,int y); @@ -57,7 +57,7 @@ protected: std::vectormInnerRadii; Rect mInset; Rect mInnerRect; - RefPtrmPath; + Cairo::RefPtrmPath; protected: RectShape(const RectShape&o); void onResize(int width,int height)override; diff --git a/src/gui/view/menu.cc b/src/gui/view/menu.cc index d9d627d9..47012a7b 100644 --- a/src/gui/view/menu.cc +++ b/src/gui/view/menu.cc @@ -1,4 +1,6 @@ #include + +using namespace Cairo; namespace cdroid{ MenuItem::MenuItem(){ diff --git a/src/gui/view/menu.h b/src/gui/view/menu.h index 06126737..b9cac26e 100755 --- a/src/gui/view/menu.h +++ b/src/gui/view/menu.h @@ -48,7 +48,7 @@ protected: bool mChecked; bool mVisible; bool mEnabled; - RefPtrmIcon; + Cairo::RefPtrmIcon; SubMenu*mSubMenu; friend class Menu; public: diff --git a/src/gui/view/rendernode.cc b/src/gui/view/rendernode.cc index fe2d8b45..4ad2d7b9 100644 --- a/src/gui/view/rendernode.cc +++ b/src/gui/view/rendernode.cc @@ -1,4 +1,5 @@ #include +using namespace Cairo; namespace cdroid{ RenderNode::RenderNode(){ diff --git a/src/gui/view/rendernode.h b/src/gui/view/rendernode.h index e5e21ca7..dcc3bca5 100644 --- a/src/gui/view/rendernode.h +++ b/src/gui/view/rendernode.h @@ -12,12 +12,12 @@ private: float mRotationX,mRotationY,mRotation; float mPivotX,mPivotY; float mTranslationX,mTranslationY,mTranslationZ; - Matrix mMatrix; + Cairo::Matrix mMatrix; public: RenderNode(); bool hasIdentityMatrix()const; - Matrix getMatrix()const; - Matrix getInverseMatrix()const; + Cairo::Matrix getMatrix()const; + Cairo::Matrix getInverseMatrix()const; void setAlpha(float); float getAlpha()const; void setElevation(float); diff --git a/src/gui/view/view.cc b/src/gui/view/view.cc index 0b9eda30..7cda2a38 100755 --- a/src/gui/view/view.cc +++ b/src/gui/view/view.cc @@ -14,7 +14,7 @@ #include #define UNDEFINED_PADDING INT_MIN - +using namespace Cairo; namespace cdroid{ DECLARE_WIDGET(View) diff --git a/src/gui/view/view.h b/src/gui/view/view.h index 0a6c339c..1d5ab937 100755 --- a/src/gui/view/view.h +++ b/src/gui/view/view.h @@ -189,7 +189,7 @@ protected: bool mKeepScreenOn; bool mDebugLayout; bool mDisplayState;/*true display is on*/ - RefPtr mCanvas; + Cairo::RefPtr mCanvas; Drawable*mAutofilledDrawable; View* mTooltipHost; View* mViewRequestingLayout; @@ -484,8 +484,8 @@ protected: bool mLastIsOpaque; std::string mHint; std::string mContentDescription; - RefPtr mDrawingCache; - RefPtr mUnscaledDrawingCache; + Cairo::RefPtr mDrawingCache; + Cairo::RefPtr mUnscaledDrawingCache; void * mTag; Context* mContext; LayoutParams* mLayoutParams; @@ -524,7 +524,7 @@ protected: void invalidateParentIfNeededAndWasQuickRejected(); virtual void invalidateInheritedLayoutMode(int); void destroyDrawingCache(); - RefPtrgetDrawingCache(bool autoScale); + Cairo::RefPtrgetDrawingCache(bool autoScale); virtual bool hasWindowFocus()const; virtual bool setFrame(int x,int y,int w,int h); diff --git a/src/gui/view/viewgroup.cc b/src/gui/view/viewgroup.cc index 1ea1a41b..9e39c820 100755 --- a/src/gui/view/viewgroup.cc +++ b/src/gui/view/viewgroup.cc @@ -26,6 +26,7 @@ #define CHILD_LEFT_INDEX 0 #define CHILD_TOP_INDEX 1 +using namespace Cairo; namespace cdroid { DECLARE_WIDGET(ViewGroup) diff --git a/src/gui/view/viewgroup.h b/src/gui/view/viewgroup.h index 286bcdc4..71254a47 100755 --- a/src/gui/view/viewgroup.h +++ b/src/gui/view/viewgroup.h @@ -158,7 +158,7 @@ protected: int mPersistentDrawingCache; std::vector mChildren; std::vectormDisappearingChildren; - RefPtrmInvalidRgn; + Cairo::RefPtrmInvalidRgn; Transformation*mInvalidationTransformation; LONGLONG time_lastframe; OnHierarchyChangeListener mOnHierarchyChangeListener; diff --git a/src/gui/view/viewpropertyanimator.cc b/src/gui/view/viewpropertyanimator.cc index 12abb8b2..9f47d5b7 100644 --- a/src/gui/view/viewpropertyanimator.cc +++ b/src/gui/view/viewpropertyanimator.cc @@ -1,5 +1,6 @@ #include #include +#include "cdlog.h" namespace cdroid{ diff --git a/src/gui/widget/adapter.h b/src/gui/widget/adapter.h index 357f0e13..fe136441 100755 --- a/src/gui/widget/adapter.h +++ b/src/gui/widget/adapter.h @@ -67,7 +67,6 @@ private: //If no custom field is assigned, assume the whole resource is a TextView //Otherwise, find the TextView field within the layout TextView* text = (mFieldId==0)?(TextView*)view:(TextView*)view->findViewById(mFieldId); - LOGD_IF(text==nullptr,"Failed to find view with ID %d in item layout",mFieldId); T& item = getItemAt(position); if(text&&onSetText)onSetText(*text,item); return view; diff --git a/src/gui/widget/cdwindow.cc b/src/gui/widget/cdwindow.cc index d85506aa..501fdf37 100755 --- a/src/gui/widget/cdwindow.cc +++ b/src/gui/widget/cdwindow.cc @@ -24,6 +24,7 @@ #include #include +using namespace Cairo; namespace cdroid { constexpr int FORWARD = 0; constexpr int FINISH_HANDLED = 1; diff --git a/src/gui/widget/cdwindow.h b/src/gui/widget/cdwindow.h index 10ab7c72..ca177025 100755 --- a/src/gui/widget/cdwindow.h +++ b/src/gui/widget/cdwindow.h @@ -49,7 +49,7 @@ private: static View*inflate(Context*ctx,std::istream&stream); protected: std::vectormLayoutRequesters; - RefPtrmVisibleRgn; + Cairo::RefPtrmVisibleRgn; int window_type;/*window type*/ int mLayer;/*surface layer*/ std::string mText; @@ -66,7 +66,7 @@ protected: int processInputEvent(InputEvent&event); int processKeyEvent(KeyEvent&event); int processPointerEvent(MotionEvent&event); - RefPtrgetCanvas(); + Cairo::RefPtrgetCanvas(); ViewGroup::LayoutParams* generateDefaultLayoutParams()const override; bool checkLayoutParams(const ViewGroup::LayoutParams* p)const override; ViewGroup::LayoutParams* generateLayoutParams(const ViewGroup::LayoutParams* lp)const override; @@ -84,7 +84,7 @@ public: Window(int x,int y,int w,int h,int type=TYPE_APPLICATION); Window(Context*,const AttributeSet&); ~Window()override; - void setRegion(const RefPtr®ion); + void setRegion(const Cairo::RefPtr®ion); void draw(); virtual void setText(const std::string&); const std::string getText()const; diff --git a/src/gui/widget/fastscroller.cc b/src/gui/widget/fastscroller.cc index 820fcd93..724d6a78 100755 --- a/src/gui/widget/fastscroller.cc +++ b/src/gui/widget/fastscroller.cc @@ -3,6 +3,7 @@ #include #include #include +#include namespace cdroid{ diff --git a/src/gui/widget/forwardinglistener.cc b/src/gui/widget/forwardinglistener.cc index eb92bc01..dc5fcbfb 100755 --- a/src/gui/widget/forwardinglistener.cc +++ b/src/gui/widget/forwardinglistener.cc @@ -1,5 +1,6 @@ #include #include +#include namespace cdroid{ ForwardingListener::ForwardingListener(View* src){ diff --git a/src/gui/widget/imageview.cc b/src/gui/widget/imageview.cc index ad2a1c4b..9b9c8197 100755 --- a/src/gui/widget/imageview.cc +++ b/src/gui/widget/imageview.cc @@ -1,6 +1,7 @@ #include #include #include +using namespace Cairo; namespace cdroid{ DECLARE_WIDGET(ImageView) diff --git a/src/gui/widget/imageview.h b/src/gui/widget/imageview.h index 0fd7aae2..cb11e212 100755 --- a/src/gui/widget/imageview.h +++ b/src/gui/widget/imageview.h @@ -82,7 +82,7 @@ public: void setAdjustViewBounds(bool adjustViewBounds); void setImageResource(const std::string&resid); void setImageDrawable(Drawable* drawable); - void setImageBitmap(RefPtrbitmap); + void setImageBitmap(Cairo::RefPtrbitmap); void setImageTintList(ColorStateList*tint); ColorStateList* getImageTintList(); void setImageTintMode(int mode); diff --git a/src/gui/widget/listpopupwindow.cc b/src/gui/widget/listpopupwindow.cc index 365f8536..0b1d9549 100755 --- a/src/gui/widget/listpopupwindow.cc +++ b/src/gui/widget/listpopupwindow.cc @@ -1,5 +1,6 @@ #include #include +#include namespace cdroid{ class PopupDataSetObserver:public DataSetObserver{ diff --git a/src/gui/widget/pagetransformers.cc b/src/gui/widget/pagetransformers.cc index 09429a8e..0e8e946d 100644 --- a/src/gui/widget/pagetransformers.cc +++ b/src/gui/widget/pagetransformers.cc @@ -1,4 +1,5 @@ #include +#include namespace cdroid{ void ABaseTransformer::transformPage(View& page, float position) { diff --git a/src/gui/widget/plotview.cc b/src/gui/widget/plotview.cc index addf9ad7..53ada026 100644 --- a/src/gui/widget/plotview.cc +++ b/src/gui/widget/plotview.cc @@ -1,5 +1,5 @@ #include -#include +#include #ifdef ENABLE_PLPLOT #include #endif diff --git a/src/gui/widget/plotview.h b/src/gui/widget/plotview.h index 2afea0f3..4db8c940 100644 --- a/src/gui/widget/plotview.h +++ b/src/gui/widget/plotview.h @@ -6,8 +6,8 @@ namespace cdroid{ class PlotView:public View{ private: - RefPtrmImage; - RefPtrmImageContext; + Cairo::RefPtrmImage; + Cairo::RefPtrmImageContext; plstream*pls; public: PlotView(int w,int h); diff --git a/src/gui/widget/popupwindow.cc b/src/gui/widget/popupwindow.cc index 3db20c0b..dcad821f 100755 --- a/src/gui/widget/popupwindow.cc +++ b/src/gui/widget/popupwindow.cc @@ -1,4 +1,5 @@ #include +#include namespace cdroid{ PopupWindow::PopupWindow(Context* context,const AttributeSet& attrs){ diff --git a/src/gui/widget/relativelayout.cc b/src/gui/widget/relativelayout.cc index 035a8c9a..7d95abf8 100755 --- a/src/gui/widget/relativelayout.cc +++ b/src/gui/widget/relativelayout.cc @@ -1,5 +1,6 @@ #include #include +#include namespace cdroid{ static constexpr int RULES_VERTICAL[] = { diff --git a/src/gui/widget/tablayout.cc b/src/gui/widget/tablayout.cc index e79f44b9..9592b88a 100755 --- a/src/gui/widget/tablayout.cc +++ b/src/gui/widget/tablayout.cc @@ -1,5 +1,6 @@ #include #include +#include namespace cdroid{ static constexpr int DEFAULT_HEIGHT_WITH_TEXT_ICON = 72; diff --git a/src/porting/x86/CMakeLists.txt b/src/porting/x86/CMakeLists.txt index 0ea55a44..48c06849 100755 --- a/src/porting/x86/CMakeLists.txt +++ b/src/porting/x86/CMakeLists.txt @@ -63,6 +63,7 @@ endif() list(APPEND X86LIBS pthread) find_package(ZLIB) +message("ZLIB_INCLUDE=${ZLIB_INCLUDE_DIR}") include_directories(./ ../include ${CMAKE_SOURCE_DIR}/src/gui/ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 80127359..be55cc29 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(--include cdtypes.h) +add_definitions(--include cdlog.h) if (BUILD_CDROID_TESTS) add_subdirectory(gui) add_subdirectory(porting) diff --git a/tests/gui/benchmark_tests.cc b/tests/gui/benchmark_tests.cc index 68ac1c08..a83800da 100755 --- a/tests/gui/benchmark_tests.cc +++ b/tests/gui/benchmark_tests.cc @@ -4,7 +4,7 @@ #include using namespace cdroid; - +using namespace Cairo; class BENCHMARK:public testing::Test{ public : diff --git a/tests/gui/drawable_tests.cc b/tests/gui/drawable_tests.cc index 5c268857..ee511447 100755 --- a/tests/gui/drawable_tests.cc +++ b/tests/gui/drawable_tests.cc @@ -7,6 +7,7 @@ #include #include #define SLEEP(x) usleep((x)*1000) +using namespace Cairo; class DRAWABLE:public testing::Test{ public: static Canvas*ctx; diff --git a/tests/gui/drawablemutate_tests.cc b/tests/gui/drawablemutate_tests.cc index d9493251..caff4c48 100755 --- a/tests/gui/drawablemutate_tests.cc +++ b/tests/gui/drawablemutate_tests.cc @@ -9,6 +9,7 @@ #include #include +using namespace Cairo; class MUTATE:public testing::Test{ public: static void SetUpTestCase(){ diff --git a/tests/gui/surface_unittests.cc b/tests/gui/surface_unittests.cc index 0cb292bb..3818707e 100755 --- a/tests/gui/surface_unittests.cc +++ b/tests/gui/surface_unittests.cc @@ -13,7 +13,7 @@ #include #include #include - +using namespace Cairo; using namespace cdroid; #define SLEEP(x) usleep((x)*1000) class CONTEXT:public testing::Test{ diff --git a/x86build.sh b/x86build.sh index b4fe7877..40d7bb5f 100755 --- a/x86build.sh +++ b/x86build.sh @@ -12,6 +12,7 @@ fi cmake -DCDROID_CHIPSET=x86 -DENABLE_RFB=ON \ -DCMAKE_INSTALL_PREFIX=./ \ -DCMAKE_BUILD_TYPE=${TYPE} \ + -DM_LIBRARY=m \ .. popd