diff --git a/.gitignore b/.gitignore
index 53eee01b..71a1545a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,7 @@ lib/
*.ninja*
CMakeCache.txt
CMakeFiles/
+.idea/
cmake_install.cmake
*.DS_Store
.idea/
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..60697f01
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,51 @@
+sudo: false
+language: generic
+
+cache:
+ apt: true
+ directories:
+ - /tmp/tools
+
+matrix:
+ include:
+ - env: CXX=g++-5 CC=gcc-5
+ addons:
+ apt:
+ packages:
+ - g++-5
+ - libjpeg8-dev
+ - libasound2-dev
+ - alsa-utils
+ - alsa-oss
+ sources: &sources
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-precise
+ - llvm-toolchain-precise-3.7
+ - llvm-toolchain-precise-3.6
+ - env: CXX=g++-4.9 CC=gcc-4.9
+ addons:
+ apt:
+ packages:
+ - g++-4.9
+ - libjpeg8-dev
+ - libasound2-dev
+ - alsa-utils
+ - alsa-oss
+ sources: *sources
+
+before_install:
+ - export PATH="$HOME/bin:$PATH"
+ - mkdir ~/bin
+ - wget --no-check-certificate --no-clobber -O /tmp/tools/cmake https://cmake.org/files/v3.4/cmake-3.4.0-rc3-Linux-x86_64.sh || true
+ - chmod -R +x /tmp/tools
+
+install:
+ - /tmp/tools/cmake --prefix="$HOME" --exclude-subdir
+
+before_script :
+ - mkdir bld
+ - cd bld
+
+script:
+ - cmake -G"Unix Makefiles" .. -DENABLE_JPEG=ON
+ - make
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b65dadc..b30ebcea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,15 +1,29 @@
-# CMake configuration for Nana
+# CMake configuration for Nana
# Author: Andrew Kornilov(https://github.com/ierofant)
# Contributor:
# Robert Hauck - Enable support for PNG/Freetype
# Qiangqiang Wu - Add biicode support
+# Ariel Vina-Rodriguez (qPCR4vir)
+
+#https://cmake.org/cmake-tutorial/
+#https://cmake.org/cmake/help/v3.3/module/CMakeDependentOption.html?highlight=cmakedependentoption
+# use CACHE FORCE or set(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ ON) or delete CMakecache.txt or the entirely build dir
+# if your changes don't execute
+option(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ "replaced boost.thread with meganz's mingw-std-threads." OFF)
+option(ENABLE_PNG "Enable the use of PNG" OFF)
+option(LIBPNG_FROM_OS "Use libpng from operating system." ON)
+option(ENABLE_JPEG "Enable the use of JPEG" OFF)
+option(LIBJPEG_FROM_OS "Use libjpeg from operating system." ON)
+option(ENABLE_AUDIO "Enable class audio::play for PCM playback." OFF)
+option(CMAKE_VERBOSE_PREPROCESSOR "Show annoying debug messages during compilation." OFF)
+option(CMAKE_STOP_VERBOSE_PREPROCESSOR "Stop compilation after showing the annoying debug messages." ON)
+option(BUILD_NANA_DEMOS "Build all the demos form the nana_demo repository." OFF)
# set compile flags
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-
# move this to the end ??
if(BIICODE)
# prepare BII_LIB_SRC
@@ -18,37 +32,45 @@ if(BIICODE)
add_biicode_targets()
return()
-endif()
+endif(BIICODE)
project(nana)
cmake_minimum_required(VERSION 2.8)
+# Compatibility with CMake 3.1
+if(POLICY CMP0054)
+ # http://www.cmake.org/cmake/help/v3.1/policy/CMP0054.html
+ cmake_policy(SET CMP0054 OLD)
+endif()
+
+add_definitions(-DNANA_IGNORE_CONF)
-#Global MSVC definitions
if(WIN32)
- if(MSVC)
+ add_definitions(-DWIN32)
+
+ #Global MSVC definitions
+ if(MSVC)
option(WIN32_USE_MP "Set to ON to build nana with the /MP option (Visual Studio 2005 and above)." ON)
# ??
if(WIN32_USE_MP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
- endif()
-
+ endif(WIN32_USE_MP)
endif(MSVC)
+
+ if(MINGW)
+ if(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
+ add_definitions(-DNANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
+ endif(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
+ endif(MINGW)
endif(WIN32)
-#Unicode
-option(USE_UNICODE "Use Unicode Character Set")
-if(USE_UNICODE)
- add_definitions(-DNANA_UNICODE)
-endif()
-
if(APPLE)
add_definitions(-DAPPLE)
include_directories(/opt/X11/include/)
elseif(UNIX)
add_definitions(-Dlinux)
-endif()
+endif(APPLE)
@@ -56,19 +78,10 @@ if(UNIX)
find_package(Freetype)
if (FREETYPE_FOUND)
include_directories( ${FREETYPE_INCLUDE_DIRS})
- endif()
-endif()
-
-if(WIN32)
- add_definitions(-DWIN32)
- if(MINGW)
- add_definitions(-DMINGW)
- endif()
-endif()
+ endif(FREETYPE_FOUND)
+endif(UNIX)
#Find PNG
-option(ENABLE_PNG "Enable the use of PNG")
-option(LIBPNG_FROM_OS "Use libpng from operating system.")
if(ENABLE_PNG)
add_definitions(-DNANA_ENABLE_PNG)
if(LIBPNG_FROM_OS)
@@ -76,13 +89,11 @@ if(ENABLE_PNG)
if (PNG_FOUND)
include_directories( ${PNG_INCLUDE_DIRS})
add_definitions(-DUSE_LIBPNG_FROM_OS)
- endif()
- endif()
-endif()
+ endif(PNG_FOUND)
+ endif(LIBPNG_FROM_OS)
+endif(ENABLE_PNG)
#Find JPEG
-option(ENABLE_JPEG "Enable the use of JPEG")
-option(LIBJPEG_FROM_OS "Use libjpeg from operating system.")
if(ENABLE_JPEG)
add_definitions(-DNANA_ENABLE_JPEG)
if(LIBJPEG_FROM_OS)
@@ -90,14 +101,30 @@ if(ENABLE_JPEG)
if (JPEG_FOUND)
include_directories( ${JPEG_INCLUDE_DIRS})
add_definitions(-DUSE_LIBJPEG_FROM_OS)
- endif()
- endif()
-endif()
+ endif(JPEG_FOUND)
+ endif(LIBJPEG_FROM_OS)
+endif(ENABLE_JPEG)
+
+if(ENABLE_AUDIO)
+ add_definitions(-DNANA_ENABLE_AUDIO)
+ if(UNIX)
+ find_package(asound)
+ if (ASOUND_FOUND)
+ include_directories( ${ASOUND_INCLUDE_DIRS})
+ else(ASOUND_FOUND)
+ message(FATAL_ERROR "libasound is not found")
+ endif(ASOUND_FOUND)
+ endif(UNIX)
+endif(ENABLE_AUDIO)
+
+#Unicode
+if(CMAKE_VERBOSE_PREPROCESSOR)
+ add_definitions(-DVERBOSE_PREPROCESSOR)
+endif(CMAKE_VERBOSE_PREPROCESSOR)
-
-set(NANA_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source)
-set(NANA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
+set(NANA_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source)
+set(NANA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${NANA_INCLUDE_DIR})
aux_source_directory(${NANA_SOURCE_DIR} NANA_SOURCE)
@@ -116,13 +143,15 @@ aux_source_directory(${NANA_SOURCE_DIR}/paint/detail NANA_PAINT_DETAIL_SOURCE)
aux_source_directory(${NANA_SOURCE_DIR}/system NANA_SYSTEM_SOURCE)
aux_source_directory(${NANA_SOURCE_DIR}/threads NANA_THREADS_SOURCE)
+#To show .h files in Visual Studio, add them to the list of sources in add_executable / add_library
+#and Use SOURCE_GROUP if all your sources are in the same directory
+
+if(NOT APPLE)
add_library(${PROJECT_NAME} ${NANA_SOURCE}
${NANA_DETAIL_SOURCE}
${NANA_FILESYSTEM_SOURCE}
-#if(NOT APPLE)
${NANA_AUDIO_SOURCE}
${NANA_AUDIO_DETAIL_SOURCE}
-#endif
${NANA_GUI_SOURCE}
${NANA_GUI_DETAIL_SOURCE}
${NANA_GUI_WIDGETS_SOURCE}
@@ -130,19 +159,99 @@ add_library(${PROJECT_NAME} ${NANA_SOURCE}
${NANA_PAINT_SOURCE}
${NANA_PAINT_DETAIL_SOURCE}
${NANA_SYSTEM_SOURCE}
- ${NANA_THREADS_SOURCE})
+ ${NANA_THREADS_SOURCE})
+endif (NOT APPLE)
+
-#if(APPLE)
-target_link_libraries(${PROJECT_NAME} -L/opt/X11/lib/ -lX11 -lXft -lpng -liconv)
-#endif()
+if(APPLE)
+add_library(${PROJECT_NAME} ${NANA_SOURCE}
+ ${NANA_DETAIL_SOURCE}
+ ${NANA_FILESYSTEM_SOURCE}
+ ${NANA_AUDIO_SOURCE}
+ ${NANA_AUDIO_DETAIL_SOURCE}
+ ${NANA_GUI_SOURCE}
+ ${NANA_GUI_DETAIL_SOURCE}
+ ${NANA_GUI_WIDGETS_SOURCE}
+ ${NANA_GUI_WIDGETS_SKELETONS_SOURCE}
+ ${NANA_PAINT_SOURCE}
+ ${NANA_PAINT_DETAIL_SOURCE}
+ ${NANA_SYSTEM_SOURCE}
+ ${NANA_THREADS_SOURCE})
+ #Headers: use INCLUDE_DIRECTORIES
+ # Libraries: use FIND_LIBRARY and link with the result of it (try to avoid LINK_DIRECTORIES
+ target_link_libraries(${PROJECT_NAME} -L/opt/X11/lib/ -lX11 -lXft -lpng -liconv)
+
+endif(APPLE)
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
+# ??
install(DIRECTORY ${NANA_INCLUDE_DIR}/nana DESTINATION include)
set_property( TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14 )
-add_executable(nana_test test.cpp)
-set_property( TARGET nana_test PROPERTY CXX_STANDARD 14 )
-target_link_libraries(nana_test ${PROJECT_NAME})
+if (BUILD_NANA_DEMOS)
+ set (CMAKE_INSTALL_PREFIX ${DEMO_BIN})
+ set(DEMO_BIN ${NANA_SOURCE_DIR}../nana-demo/bin)
+ set(CMAKE_INSTALL_PREFIX )
+ add_executable(file_explorer ../nana-demo/file_explorer.cpp)
+ set_property( TARGET file_explorer PROPERTY CXX_STANDARD 14 )
+ target_link_libraries(file_explorer ${PROJECT_NAME})
+ install(TARGETS file_explorer RUNTIME DESTINATION &{DEMO_BIN})
+
+ add_executable(calculator ../nana-demo/calculator.cpp)
+ set_property( TARGET calculator PROPERTY CXX_STANDARD 14 )
+ target_link_libraries(calculator ${PROJECT_NAME})
+ install(TARGETS calculator RUNTIME DESTINATION &{DEMO_BIN})
+
+ add_executable(FreeMe ../nana-demo/FreeMe.cpp)
+ set_property( TARGET FreeMe PROPERTY CXX_STANDARD 14 )
+ target_link_libraries(FreeMe ${PROJECT_NAME})
+ install(TARGETS FreeMe RUNTIME DESTINATION &{DEMO_BIN})
+
+ add_executable(notepad ../nana-demo/notepad.cpp)
+ set_property( TARGET notepad PROPERTY CXX_STANDARD 14 )
+ target_link_libraries(notepad ${PROJECT_NAME})
+ install(TARGETS notepad RUNTIME DESTINATION &{DEMO_BIN})
+
+ add_executable(widget_show ../nana-demo/widget_show.cpp)
+ set_property( TARGET widget_show PROPERTY CXX_STANDARD 14 )
+ target_link_libraries(widget_show ${PROJECT_NAME})
+ install(TARGETS widget_show RUNTIME DESTINATION &{DEMO_BIN})
+
+ add_executable(widget_show2 ../nana-demo/widget_show2.cpp)
+ set_property( TARGET widget_show2 PROPERTY CXX_STANDARD 14 )
+ target_link_libraries(widget_show2 ${PROJECT_NAME})
+ install(TARGETS widget_show2 RUNTIME DESTINATION &{DEMO_BIN})
+
+ add_executable(a_group_impl ../nana-demo/Examples/a_group_impl.cpp)
+ set_property( TARGET a_group_impl PROPERTY CXX_STANDARD 14 )
+ target_link_libraries(a_group_impl ${PROJECT_NAME})
+
+ add_executable(animate-bmp ../nana-demo/Examples/animate-bmp.cpp)
+ set_property( TARGET animate-bmp PROPERTY CXX_STANDARD 14 )
+ target_link_libraries(animate-bmp ${PROJECT_NAME})
+
+ add_executable(audio_player ../nana-demo/Examples/audio_player.cpp)
+ set_property( TARGET audio_player PROPERTY CXX_STANDARD 14 )
+ target_link_libraries(audio_player ${PROJECT_NAME})
+
+
+ #add_executable(nana_test test.cpp)
+ #set_property( TARGET nana_test PROPERTY CXX_STANDARD 14 )
+ #target_link_libraries(nana_test ${PROJECT_NAME})
+
+ #set(NANA_DEMOS_DIR ${CMAKE_SOURCE_DIR}/../nana-demo)
+ #set(NANA_EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/../Examples/nana-demo/)
+ # https://cmake.org/cmake/help/v3.3/command/file.html?highlight=glob#file
+ #file( GLOB_RECURSE DEMO_SOURCES RELATIVE ../nana-demo *.cpp )
+
+ #foreach( demofile ${DEMO_SOURCES} )
+ # string( REPLACE ".cpp" "" demoname ${demofile} )
+ # add_executable( ${demoname} ${demofile} )
+ # set_property( TARGET ${demoname} PROPERTY CXX_STANDARD 14 )
+ # target_link_libraries(${demoname} ${PROJECT_NAME})
+ #endforeach( demofile ${DEMO_SOURCES} )
+endif(BUILD_NANA_DEMOS)
+
diff --git a/README.md b/README.md
index 7b427aef..240581f8 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,11 @@
-# Nana C++ Library
-[](https://www.biicode.com/qiangwu/nana)
+# Nana C++ Library [](https://www.biicode.com/qiangwu/nana) [](https://travis-ci.org/cnjinhao/nana) [](LICENSE_1_0.txt)
+
Nana is a C++ library designed to allow developers to easily create cross-platform GUI applications with modern C++11 style, currently it can work on Linux(X11) and Windows. The nana repository contains the entire source of library, you can browse the source code and submit your pull request for contributing.
## License
-Nana is licensed under the [Boost Software License].
-
-[Boost Software License]: http://www.boost.org/LICENSE_1_0.txt
+Nana is licensed under the [Boost Software License](http://www.boost.org/LICENSE_1_0.txt)
## Members
diff --git a/build/codeblocks/nana.cbp b/build/codeblocks/nana.cbp
index 49f61ad7..18e276ca 100644
--- a/build/codeblocks/nana.cbp
+++ b/build/codeblocks/nana.cbp
@@ -51,8 +51,7 @@
-
-
+
@@ -119,7 +118,6 @@
-
diff --git a/build/codeblocks/nana.depend b/build/codeblocks/nana.depend
index bc77979b..8d95a36f 100644
--- a/build/codeblocks/nana.depend
+++ b/build/codeblocks/nana.depend
@@ -548,7 +548,7 @@
-1439496157 source:d:\git.repo\nana\source\audio\detail\audio_stream.cpp
+1452100459 source:d:\git.repo\nana\source\audio\detail\audio_stream.cpp
@@ -556,7 +556,7 @@
-1353253406 source:d:\git.repo\nana\source\audio\player.cpp
+1452100459 source:d:\git.repo\nana\source\audio\player.cpp
@@ -570,12 +570,13 @@
-1439496157 source:d:\git.repo\nana\source\charset.cpp
+1452100459 source:d:\git.repo\nana\source\charset.cpp
+
@@ -585,12 +586,16 @@
-1439496157 source:d:\git.repo\nana\source\deploy.cpp
+1452100459 source:d:\git.repo\nana\source\deploy.cpp
+
+
+
+
1439496157 source:d:\git.repo\nana\source\detail\platform_spec_selector.cpp
@@ -636,9 +641,9 @@
1365203878 source:d:\git.repo\nana\source\filesystem\file_iterator.cpp
-1365203878 source:d:\git.repo\nana\source\filesystem\fs_utility.cpp
+1453128389 source:d:\git.repo\nana\source\filesystem\fs_utility.cpp
-
+
@@ -653,7 +658,7 @@
-1444647306 source:d:\git.repo\nana\source\gui\animation.cpp
+1449510853 source:d:\git.repo\nana\source\gui\animation.cpp
@@ -676,8 +681,8 @@
-1444585389 source:d:\git.repo\nana\source\gui\detail\bedrock_pi.cpp
-
+1447167067 source:d:\git.repo\nana\source\gui\detail\bedrock_pi.cpp
+
@@ -721,7 +726,7 @@
-1444567878 source:d:\git.repo\nana\source\gui\detail\color_schemes.cpp
+1447167067 source:d:\git.repo\nana\source\gui\detail\color_schemes.cpp