diff --git a/.gitignore b/.gitignore index 80730e12..53eee01b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ Thumbs.db bii/build/* bii/cmake/* bii/deps/* +build/vc2013-bkl/* +build/makefile-bkl/* *.obj *.exe *.pdb @@ -38,3 +40,4 @@ CMakeCache.txt CMakeFiles/ cmake_install.cmake *.DS_Store +.idea/ diff --git a/CMakeLists.txt b/CMakeLists.txt index a6453263..5b65dadc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,48 +4,17 @@ # Robert Hauck - Enable support for PNG/Freetype # Qiangqiang Wu - Add biicode support +# 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 set(LIB_SRC ${BII_LIB_SRC}) - foreach(cpp ${BII_LIB_SRC}) - if(${cpp} MATCHES "/detail/(win32|linux_X11)/.+$") - list(APPEND trash_files ${cpp}) - endif() - endforeach() - - list(REMOVE_ITEM BII_LIB_SRC ${trash_files}) - - if(WIN32) - file(GLOB_RECURSE platform_files "*/detail/win32/*") - list(APPEND BII_LIB_SRC ${platform_files}) - elseif(APPLE) - file(GLOB_RECURSE platform_files "*/detail/macos_X11/*") - list(APPEND BII_LIB_SRC ${platform_files}) - elseif(UNIX) - file(GLOB_RECURSE platform_files "*/detail/linux_X11/*") - list(APPEND BII_LIB_SRC ${platform_files}) - else() - message(FATAL_ERROR "Only Windows and Unix are supported for the moment (Mac OS is experimental)") - endif() - - # 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") - - # we'll use the default config file so we can iliminate the following macro definitions - if(MSVC) - # More MSVC specific compilation flags - add_definitions(-D_SCL_SECURE_NO_WARNINGS) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) - if(MSVC14) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) - else() - add_definitions(-DNOT_IMPLEMENTED_KEYWORD_noexcept) - endif() - endif() - add_biicode_targets() return() @@ -54,69 +23,35 @@ endif() project(nana) cmake_minimum_required(VERSION 2.8) -#Select platform automatically -if(WIN32) - add_definitions(-DNANA_WINDOWS) - add_definitions(-DPLATFORM_SPEC_HPP=) - if(MSVC14) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) - else() - add_definitions(-DNOT_IMPLEMENTED_KEYWORD_noexcept) - endif() - - #Test if it is MINGW - if(MINGW) - add_definitions(-DNANA_MINGW) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.1") - option(NANA_THREAD_NOT_SUPPORTED "Use this flag if MinGW version is older than 4.8.1" ON) - endif() - endif() - if(NANA_THREAD_NOT_SUPPORTED) - add_definitions(-DSTD_THREAD_NOT_SUPPORTED) - endif() - endif() -endif() -if(APPLE) - add_definitions(-DNANA_MACOS) - add_definitions(-DNANA_X11) - add_definitions(-DPLATFORM_SPEC_HPP=) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) - include_directories(/opt/X11/include/) -elseif(UNIX) - add_definitions(-DNANA_LINUX) - add_definitions(-DNANA_X11) - add_definitions(-DPLATFORM_SPEC_HPP=) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) -endif() - #Global MSVC definitions if(WIN32) 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() - # More MSVC specific compilation flags - add_definitions(-D_SCL_SECURE_NO_WARNINGS) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) endif(MSVC) endif(WIN32) #Unicode -option(NANA_UNICODE "Use Unicode Character Set" ON) -if(NANA_UNICODE) - add_definitions(-DNANA_UNICODE) - if(WIN32) - add_definitions(-DUNICODE -D_UNICODE) - endif() +option(USE_UNICODE "Use Unicode Character Set") +if(USE_UNICODE) + add_definitions(-DNANA_UNICODE) endif() -#Find PNG +if(APPLE) + add_definitions(-DAPPLE) + include_directories(/opt/X11/include/) +elseif(UNIX) + add_definitions(-Dlinux) +endif() + + + if(UNIX) find_package(Freetype) if (FREETYPE_FOUND) @@ -124,30 +59,42 @@ if(UNIX) endif() endif() -option(NANA_ENABLE_PNG "Enable the use of PNG" ON) -if(NANA_ENABLE_PNG) - add_definitions(-DNANA_ENABLE_PNG) +if(WIN32) + add_definitions(-DWIN32) + if(MINGW) + add_definitions(-DMINGW) + endif() +endif() - option(NANA_LIBPNG "Use the included libpng" ON) - if(NANA_LIBPNG) - add_definitions(-DNANA_LIBPNG) - else() +#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) find_package(PNG) if (PNG_FOUND) include_directories( ${PNG_INCLUDE_DIRS}) + add_definitions(-DUSE_LIBPNG_FROM_OS) endif() endif() endif() -#Copy our new config.hpp (with removed defines) -execute_process(COMMAND ${CMAKE_COMMAND} - -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/include/nana/) - -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") +#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) + find_package(JPEG) + if (JPEG_FOUND) + include_directories( ${JPEG_INCLUDE_DIRS}) + add_definitions(-DUSE_LIBJPEG_FROM_OS) + endif() + endif() +endif() + + set(NANA_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source) set(NANA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include) diff --git a/build/bakefile/readme.md b/build/bakefile/readme.md new file mode 100644 index 00000000..88764041 --- /dev/null +++ b/build/bakefile/readme.md @@ -0,0 +1,4 @@ +## Instructions: +1. +2. + diff --git a/build/cmake/config.hpp b/build/cmake/config.hpp deleted file mode 100644 index 08527a55..00000000 --- a/build/cmake/config.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Nana Configuration - * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - * @file: nana/config.hpp - */ - -#ifndef NANA_CONFIG_HPP -#define NANA_CONFIG_HPP - -//All defines have been moved to the CMakelists.txt in the root directory. - -#endif //NANA_CONFIG_HPP diff --git a/build/codeblocks/nana.cbp b/build/codeblocks/nana.cbp index 03e6b72f..49f61ad7 100644 --- a/build/codeblocks/nana.cbp +++ b/build/codeblocks/nana.cbp @@ -49,14 +49,16 @@ - + + - + + diff --git a/build/makefile-bkl/makefile b/build/makefile-bkl/makefile deleted file mode 100644 index 03225611..00000000 --- a/build/makefile-bkl/makefile +++ /dev/null @@ -1,305 +0,0 @@ -# This file was automatically generated by bakefile. -# -# Any manual changes will be lost if it is regenerated, -# modify the source .bkl file instead if possible. - -# You may define standard make variables such as CFLAGS or -# CXXFLAGS to affect the build. For example, you could use: -# -# make CXXFLAGS=-g -# -# to build with debug information. The full list of variables -# that can be used by this makefile is: -# AR, CC, CFLAGS, CPPFLAGS, CXX, CXXFLAGS, LD, LDFLAGS, MAKE, RANLIB. - -# You may also specify config=Debug|Release -# or their corresponding lower case variants on make command line to select -# the corresponding default flags values. -ifeq ($(config),debug) -override config := Debug -endif -ifeq ($(config),release) -override config := Release -endif -ifeq ($(config),Debug) -override CPPFLAGS += -DDEBUG -override CFLAGS += -g -O0 -override CXXFLAGS += -g -O0 -override LDFLAGS += -g -else ifeq ($(config),Release) -override CPPFLAGS += -DNDEBUG -override CFLAGS += -O2 -override CXXFLAGS += -O2 -else ifneq (,$(config)) -$(warning Unknown configuration "$(config)") -endif - -# Use "make RANLIB=''" for platforms without ranlib. -RANLIB ?= ranlib - -CC := cc -CXX := c++ - -# The directory for the build files, may be overridden on make command line. -builddir = . - -ifneq ($(builddir),.) -_builddir := $(if $(findstring $(abspath $(builddir)),$(builddir)),,../../../)$(builddir)/../build/makefile/ -_builddir_error := $(shell mkdir -p $(_builddir) 2>&1) -$(if $(_builddir_error),$(error Failed to create build directory: $(_builddir_error))) -endif -all: $(_builddir)libnana.a - -$(_builddir)libnana.a: $(_builddir)nana_any.o $(_builddir)nana_basic_types.o $(_builddir)nana_charset.o $(_builddir)nana_datetime.o $(_builddir)nana_deploy.o $(_builddir)nana_exceptions.o $(_builddir)nana_internationalization.o $(_builddir)nana_traits.o $(_builddir)nana_unicode_bidi.o $(_builddir)nana_file_iterator.o $(_builddir)nana_fs_utility.o $(_builddir)nana_player.o $(_builddir)nana_audio_device.o $(_builddir)nana_audio_stream.o $(_builddir)nana_buffer_preparation.o $(_builddir)nana_animation.o $(_builddir)nana_basis.o $(_builddir)nana_dragger.o $(_builddir)nana_drawing.o $(_builddir)nana_effects.o $(_builddir)nana_element.o $(_builddir)nana_filebox.o $(_builddir)nana_layout_utility.o $(_builddir)nana_msgbox.o $(_builddir)nana_notifier.o $(_builddir)nana_place.o $(_builddir)nana_programming_interface.o $(_builddir)nana_screen.o $(_builddir)nana_state_cursor.o $(_builddir)nana_timer.o $(_builddir)nana_tooltip.o $(_builddir)nana_wvl.o $(_builddir)nana_basic_window.o $(_builddir)nana_bedrock_pi.o $(_builddir)nana_color_schemes.o $(_builddir)nana_drawer.o $(_builddir)nana_element_store.o $(_builddir)nana_events_operation.o $(_builddir)nana_native_window_interface.o $(_builddir)nana_window_layout.o $(_builddir)nana_window_manager.o $(_builddir)nana_button.o $(_builddir)nana_categorize.o $(_builddir)nana_checkbox.o $(_builddir)nana_combox.o $(_builddir)nana_date_chooser.o $(_builddir)nana_float_listbox.o $(_builddir)nana_form.o $(_builddir)nana_frame.o $(_builddir)nana_label.o $(_builddir)nana_listbox.o $(_builddir)nana_menubar.o $(_builddir)nana_menu.o $(_builddir)nana_panel.o $(_builddir)nana_picture.o $(_builddir)nana_progress.o $(_builddir)nana_scroll.o $(_builddir)nana_slider.o $(_builddir)nana_spinbox.o $(_builddir)nana_tabbar.o $(_builddir)nana_textbox.o $(_builddir)nana_toolbar.o $(_builddir)nana_treebox.o $(_builddir)nana_widget.o $(_builddir)nana_text_editor.o $(_builddir)nana_gadget.o $(_builddir)nana_graphics.o $(_builddir)nana_image.o $(_builddir)nana_image_process_selector.o $(_builddir)nana_pixel_buffer.o $(_builddir)nana_text_renderer.o $(_builddir)nana_image_process_provider.o $(_builddir)nana_native_paint_interface.o $(_builddir)nana_dataexch.o $(_builddir)nana_platform.o $(_builddir)nana_shared_wrapper.o $(_builddir)nana_timepiece.o $(_builddir)nana_pool.o $(_builddir)nana_platform_spec_selector.o $(_builddir)nana_bedrock_selector.o - $(AR) rcu $@ $(_builddir)nana_any.o $(_builddir)nana_basic_types.o $(_builddir)nana_charset.o $(_builddir)nana_datetime.o $(_builddir)nana_deploy.o $(_builddir)nana_exceptions.o $(_builddir)nana_internationalization.o $(_builddir)nana_traits.o $(_builddir)nana_unicode_bidi.o $(_builddir)nana_file_iterator.o $(_builddir)nana_fs_utility.o $(_builddir)nana_player.o $(_builddir)nana_audio_device.o $(_builddir)nana_audio_stream.o $(_builddir)nana_buffer_preparation.o $(_builddir)nana_animation.o $(_builddir)nana_basis.o $(_builddir)nana_dragger.o $(_builddir)nana_drawing.o $(_builddir)nana_effects.o $(_builddir)nana_element.o $(_builddir)nana_filebox.o $(_builddir)nana_layout_utility.o $(_builddir)nana_msgbox.o $(_builddir)nana_notifier.o $(_builddir)nana_place.o $(_builddir)nana_programming_interface.o $(_builddir)nana_screen.o $(_builddir)nana_state_cursor.o $(_builddir)nana_timer.o $(_builddir)nana_tooltip.o $(_builddir)nana_wvl.o $(_builddir)nana_basic_window.o $(_builddir)nana_bedrock_pi.o $(_builddir)nana_color_schemes.o $(_builddir)nana_drawer.o $(_builddir)nana_element_store.o $(_builddir)nana_events_operation.o $(_builddir)nana_native_window_interface.o $(_builddir)nana_window_layout.o $(_builddir)nana_window_manager.o $(_builddir)nana_button.o $(_builddir)nana_categorize.o $(_builddir)nana_checkbox.o $(_builddir)nana_combox.o $(_builddir)nana_date_chooser.o $(_builddir)nana_float_listbox.o $(_builddir)nana_form.o $(_builddir)nana_frame.o $(_builddir)nana_label.o $(_builddir)nana_listbox.o $(_builddir)nana_menubar.o $(_builddir)nana_menu.o $(_builddir)nana_panel.o $(_builddir)nana_picture.o $(_builddir)nana_progress.o $(_builddir)nana_scroll.o $(_builddir)nana_slider.o $(_builddir)nana_spinbox.o $(_builddir)nana_tabbar.o $(_builddir)nana_textbox.o $(_builddir)nana_toolbar.o $(_builddir)nana_treebox.o $(_builddir)nana_widget.o $(_builddir)nana_text_editor.o $(_builddir)nana_gadget.o $(_builddir)nana_graphics.o $(_builddir)nana_image.o $(_builddir)nana_image_process_selector.o $(_builddir)nana_pixel_buffer.o $(_builddir)nana_text_renderer.o $(_builddir)nana_image_process_provider.o $(_builddir)nana_native_paint_interface.o $(_builddir)nana_dataexch.o $(_builddir)nana_platform.o $(_builddir)nana_shared_wrapper.o $(_builddir)nana_timepiece.o $(_builddir)nana_pool.o $(_builddir)nana_platform_spec_selector.o $(_builddir)nana_bedrock_selector.o - $(RANLIB) $@ - -$(_builddir)nana_any.o: ../../source/any.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/any.cpp - -$(_builddir)nana_basic_types.o: ../../source/basic_types.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/basic_types.cpp - -$(_builddir)nana_charset.o: ../../source/charset.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/charset.cpp - -$(_builddir)nana_datetime.o: ../../source/datetime.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/datetime.cpp - -$(_builddir)nana_deploy.o: ../../source/deploy.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/deploy.cpp - -$(_builddir)nana_exceptions.o: ../../source/exceptions.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/exceptions.cpp - -$(_builddir)nana_internationalization.o: ../../source/internationalization.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/internationalization.cpp - -$(_builddir)nana_traits.o: ../../source/traits.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/traits.cpp - -$(_builddir)nana_unicode_bidi.o: ../../source/unicode_bidi.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/unicode_bidi.cpp - -$(_builddir)nana_file_iterator.o: ../../source/filesystem/file_iterator.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/filesystem/file_iterator.cpp - -$(_builddir)nana_fs_utility.o: ../../source/filesystem/fs_utility.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/filesystem/fs_utility.cpp - -$(_builddir)nana_player.o: ../../source/audio/player.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/audio/player.cpp - -$(_builddir)nana_audio_device.o: ../../source/audio/detail/audio_device.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/audio/detail/audio_device.cpp - -$(_builddir)nana_audio_stream.o: ../../source/audio/detail/audio_stream.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/audio/detail/audio_stream.cpp - -$(_builddir)nana_buffer_preparation.o: ../../source/audio/detail/buffer_preparation.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/audio/detail/buffer_preparation.cpp - -$(_builddir)nana_animation.o: ../../source/gui/animation.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/animation.cpp - -$(_builddir)nana_basis.o: ../../source/gui/basis.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/basis.cpp - -$(_builddir)nana_dragger.o: ../../source/gui/dragger.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/dragger.cpp - -$(_builddir)nana_drawing.o: ../../source/gui/drawing.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/drawing.cpp - -$(_builddir)nana_effects.o: ../../source/gui/effects.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/effects.cpp - -$(_builddir)nana_element.o: ../../source/gui/element.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/element.cpp - -$(_builddir)nana_filebox.o: ../../source/gui/filebox.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/filebox.cpp - -$(_builddir)nana_layout_utility.o: ../../source/gui/layout_utility.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/layout_utility.cpp - -$(_builddir)nana_msgbox.o: ../../source/gui/msgbox.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/msgbox.cpp - -$(_builddir)nana_notifier.o: ../../source/gui/notifier.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/notifier.cpp - -$(_builddir)nana_place.o: ../../source/gui/place.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/place.cpp - -$(_builddir)nana_programming_interface.o: ../../source/gui/programming_interface.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/programming_interface.cpp - -$(_builddir)nana_screen.o: ../../source/gui/screen.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/screen.cpp - -$(_builddir)nana_state_cursor.o: ../../source/gui/state_cursor.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/state_cursor.cpp - -$(_builddir)nana_timer.o: ../../source/gui/timer.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/timer.cpp - -$(_builddir)nana_tooltip.o: ../../source/gui/tooltip.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/tooltip.cpp - -$(_builddir)nana_wvl.o: ../../source/gui/wvl.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/wvl.cpp - -$(_builddir)nana_basic_window.o: ../../source/gui/detail/basic_window.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/basic_window.cpp - -$(_builddir)nana_bedrock_pi.o: ../../source/gui/detail/bedrock_pi.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/bedrock_pi.cpp - -$(_builddir)nana_color_schemes.o: ../../source/gui/detail/color_schemes.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/color_schemes.cpp - -$(_builddir)nana_drawer.o: ../../source/gui/detail/drawer.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/drawer.cpp - -$(_builddir)nana_element_store.o: ../../source/gui/detail/element_store.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/element_store.cpp - -$(_builddir)nana_events_operation.o: ../../source/gui/detail/events_operation.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/events_operation.cpp - -$(_builddir)nana_native_window_interface.o: ../../source/gui/detail/native_window_interface.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/native_window_interface.cpp - -$(_builddir)nana_window_layout.o: ../../source/gui/detail/window_layout.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/window_layout.cpp - -$(_builddir)nana_window_manager.o: ../../source/gui/detail/window_manager.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/window_manager.cpp - -$(_builddir)nana_button.o: ../../source/gui/widgets/button.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/button.cpp - -$(_builddir)nana_categorize.o: ../../source/gui/widgets/categorize.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/categorize.cpp - -$(_builddir)nana_checkbox.o: ../../source/gui/widgets/checkbox.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/checkbox.cpp - -$(_builddir)nana_combox.o: ../../source/gui/widgets/combox.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/combox.cpp - -$(_builddir)nana_date_chooser.o: ../../source/gui/widgets/date_chooser.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/date_chooser.cpp - -$(_builddir)nana_float_listbox.o: ../../source/gui/widgets/float_listbox.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/float_listbox.cpp - -$(_builddir)nana_form.o: ../../source/gui/widgets/form.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/form.cpp - -$(_builddir)nana_frame.o: ../../source/gui/widgets/frame.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/frame.cpp - -$(_builddir)nana_label.o: ../../source/gui/widgets/label.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/label.cpp - -$(_builddir)nana_listbox.o: ../../source/gui/widgets/listbox.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/listbox.cpp - -$(_builddir)nana_menubar.o: ../../source/gui/widgets/menubar.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/menubar.cpp - -$(_builddir)nana_menu.o: ../../source/gui/widgets/menu.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/menu.cpp - -$(_builddir)nana_panel.o: ../../source/gui/widgets/panel.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/panel.cpp - -$(_builddir)nana_picture.o: ../../source/gui/widgets/picture.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/picture.cpp - -$(_builddir)nana_progress.o: ../../source/gui/widgets/progress.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/progress.cpp - -$(_builddir)nana_scroll.o: ../../source/gui/widgets/scroll.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/scroll.cpp - -$(_builddir)nana_slider.o: ../../source/gui/widgets/slider.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/slider.cpp - -$(_builddir)nana_spinbox.o: ../../source/gui/widgets/spinbox.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/spinbox.cpp - -$(_builddir)nana_tabbar.o: ../../source/gui/widgets/tabbar.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/tabbar.cpp - -$(_builddir)nana_textbox.o: ../../source/gui/widgets/textbox.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/textbox.cpp - -$(_builddir)nana_toolbar.o: ../../source/gui/widgets/toolbar.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/toolbar.cpp - -$(_builddir)nana_treebox.o: ../../source/gui/widgets/treebox.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/treebox.cpp - -$(_builddir)nana_widget.o: ../../source/gui/widgets/widget.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/widget.cpp - -$(_builddir)nana_text_editor.o: ../../source/gui/widgets/skeletons/text_editor.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/widgets/skeletons/text_editor.cpp - -$(_builddir)nana_gadget.o: ../../source/paint/gadget.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/paint/gadget.cpp - -$(_builddir)nana_graphics.o: ../../source/paint/graphics.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/paint/graphics.cpp - -$(_builddir)nana_image.o: ../../source/paint/image.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/paint/image.cpp - -$(_builddir)nana_image_process_selector.o: ../../source/paint/image_process_selector.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/paint/image_process_selector.cpp - -$(_builddir)nana_pixel_buffer.o: ../../source/paint/pixel_buffer.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/paint/pixel_buffer.cpp - -$(_builddir)nana_text_renderer.o: ../../source/paint/text_renderer.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/paint/text_renderer.cpp - -$(_builddir)nana_image_process_provider.o: ../../source/paint/detail/image_process_provider.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/paint/detail/image_process_provider.cpp - -$(_builddir)nana_native_paint_interface.o: ../../source/paint/detail/native_paint_interface.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/paint/detail/native_paint_interface.cpp - -$(_builddir)nana_dataexch.o: ../../source/system/dataexch.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/system/dataexch.cpp - -$(_builddir)nana_platform.o: ../../source/system/platform.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/system/platform.cpp - -$(_builddir)nana_shared_wrapper.o: ../../source/system/shared_wrapper.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/system/shared_wrapper.cpp - -$(_builddir)nana_timepiece.o: ../../source/system/timepiece.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/system/timepiece.cpp - -$(_builddir)nana_pool.o: ../../source/threads/pool.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/threads/pool.cpp - -$(_builddir)nana_platform_spec_selector.o: ../../source/detail/platform_spec_selector.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/detail/platform_spec_selector.cpp - -$(_builddir)nana_bedrock_selector.o: ../../source/gui/detail/bedrock_selector.cpp - $(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) -MD -MP -fPIC -DPIC -pthread -I../../include -std=c++0x `pkg-config --cflags freetype2` ../../source/gui/detail/bedrock_selector.cpp - -clean: - rm -f $(_builddir)*.o - rm -f $(_builddir)*.d - rm -f $(_builddir)libnana.a - -.PHONY: all clean - -# Dependencies tracking: --include *.d diff --git a/build/makefile/readme.txt b/build/makefile/readme.md similarity index 98% rename from build/makefile/readme.txt rename to build/makefile/readme.md index fc8df43f..1b8d9b1b 100644 --- a/build/makefile/readme.txt +++ b/build/makefile/readme.md @@ -4,6 +4,7 @@ X11, pthread, Xpm, rt, dl, freetype2, Xft, fontconfig, ALSA Writing a makefile for creating applications with Nana C++ Library ------------------- +``` GCC = g++ NANAPATH = [The folder of Nana C++ Library] BIN = [The bin file what you want to create.] @@ -28,4 +29,5 @@ $(NANALIB): clean: rm -f $(LINKOBJ) +``` ------------------- diff --git a/build/vc2013-bkl/vc2013/nana.sln b/build/vc2013-bkl/vc2013/nana.sln deleted file mode 100644 index 8f49cc71..00000000 --- a/build/vc2013-bkl/vc2013/nana.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nana", "nana.vcxproj", "{78487472-4F43-5A69-93CC-4FDC4D124241}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {78487472-4F43-5A69-93CC-4FDC4D124241}.Debug|Win32.ActiveCfg = Debug|Win32 - {78487472-4F43-5A69-93CC-4FDC4D124241}.Debug|Win32.Build.0 = Debug|Win32 - {78487472-4F43-5A69-93CC-4FDC4D124241}.Release|Win32.ActiveCfg = Release|Win32 - {78487472-4F43-5A69-93CC-4FDC4D124241}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/build/vc2013-bkl/vc2013/nana.vcxproj b/build/vc2013-bkl/vc2013/nana.vcxproj deleted file mode 100644 index c3b2d3ac..00000000 --- a/build/vc2013-bkl/vc2013/nana.vcxproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - Debug - Win32 - - - Release - Win32 - - - - {78487472-4F43-5A69-93CC-4FDC4D124241} - Win32Proj - nana - nana - - - - StaticLibrary - true - Unicode - v120 - - - StaticLibrary - false - Unicode - v120 - - - - - - - - - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - false - ..\..\include - MultiThreadedDebugDLL - - - Windows - true - - - - - Level3 - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - false - ..\..\include - MultiThreadedDLL - - - Windows - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/vc2013-bkl/vc2013/nana.vcxproj.filters b/build/vc2013-bkl/vc2013/nana.vcxproj.filters deleted file mode 100644 index 2858b8fa..00000000 --- a/build/vc2013-bkl/vc2013/nana.vcxproj.filters +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - diff --git a/build/vc2013/nana.vcxproj b/build/vc2013/nana.vcxproj index 41477943..01db0e79 100644 --- a/build/vc2013/nana.vcxproj +++ b/build/vc2013/nana.vcxproj @@ -187,7 +187,7 @@ - + @@ -195,12 +195,12 @@ + - diff --git a/build/vc2013/nana.vcxproj.filters b/build/vc2013/nana.vcxproj.filters index 418bbf46..d2c700e8 100644 --- a/build/vc2013/nana.vcxproj.filters +++ b/build/vc2013/nana.vcxproj.filters @@ -25,9 +25,6 @@ {e2569be2-9e68-477d-8b59-e248595de6c7} - - {52ed7f8e-fa48-495e-af1f-4df013205a35} - {87d14798-9015-4162-b9ab-72c741cff063} @@ -37,9 +34,6 @@ {85c9c1bb-d87b-4481-bf3c-7425f680a12d} - - {8058b530-86ec-4d72-890d-345aa30db056} - {87b124cb-408d-460b-a81b-8a788bbae0d9} @@ -114,9 +108,6 @@ Source Files\nana\audio - - Source Files\nana\detail\win32 - Source Files\nana\filesystem @@ -126,9 +117,6 @@ Source Files\nana\filesystem - - Source Files\nana\gui\detail\win32 - Source Files\nana\gui\detail @@ -339,6 +327,12 @@ Source Files\nana\gui\widgets + + Source Files\nana\detail + + + Source Files\nana\gui\detail + diff --git a/build/vc2015/nana.sln b/build/vc2015/nana.sln index 6de06997..6aec89c0 100644 --- a/build/vc2015/nana.sln +++ b/build/vc2015/nana.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nana", "nana.vcxproj", "{98091380-2EC4-44B4-82A2-F0A6393BA908}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nana", "nana.vcxproj", "{25B21068-491B-4A9F-B99F-6C27BF31BAAD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -13,14 +13,14 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {98091380-2EC4-44B4-82A2-F0A6393BA908}.Debug|x64.ActiveCfg = Debug|x64 - {98091380-2EC4-44B4-82A2-F0A6393BA908}.Debug|x64.Build.0 = Debug|x64 - {98091380-2EC4-44B4-82A2-F0A6393BA908}.Debug|x86.ActiveCfg = Debug|Win32 - {98091380-2EC4-44B4-82A2-F0A6393BA908}.Debug|x86.Build.0 = Debug|Win32 - {98091380-2EC4-44B4-82A2-F0A6393BA908}.Release|x64.ActiveCfg = Release|x64 - {98091380-2EC4-44B4-82A2-F0A6393BA908}.Release|x64.Build.0 = Release|x64 - {98091380-2EC4-44B4-82A2-F0A6393BA908}.Release|x86.ActiveCfg = Release|Win32 - {98091380-2EC4-44B4-82A2-F0A6393BA908}.Release|x86.Build.0 = Release|Win32 + {25B21068-491B-4A9F-B99F-6C27BF31BAAD}.Debug|x64.ActiveCfg = Debug|x64 + {25B21068-491B-4A9F-B99F-6C27BF31BAAD}.Debug|x64.Build.0 = Debug|x64 + {25B21068-491B-4A9F-B99F-6C27BF31BAAD}.Debug|x86.ActiveCfg = Debug|Win32 + {25B21068-491B-4A9F-B99F-6C27BF31BAAD}.Debug|x86.Build.0 = Debug|Win32 + {25B21068-491B-4A9F-B99F-6C27BF31BAAD}.Release|x64.ActiveCfg = Release|x64 + {25B21068-491B-4A9F-B99F-6C27BF31BAAD}.Release|x64.Build.0 = Release|x64 + {25B21068-491B-4A9F-B99F-6C27BF31BAAD}.Release|x86.ActiveCfg = Release|Win32 + {25B21068-491B-4A9F-B99F-6C27BF31BAAD}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build/vc2015/nana.vcxproj b/build/vc2015/nana.vcxproj index 0f5dd3d3..89ceaaa3 100644 --- a/build/vc2015/nana.vcxproj +++ b/build/vc2015/nana.vcxproj @@ -181,7 +181,7 @@ - + @@ -189,12 +189,12 @@ + - diff --git a/build/vc2015/nana.vcxproj.filters b/build/vc2015/nana.vcxproj.filters index fab8ae53..8130c2bc 100644 --- a/build/vc2015/nana.vcxproj.filters +++ b/build/vc2015/nana.vcxproj.filters @@ -37,18 +37,12 @@ {b3023f5e-2759-409d-b6e8-5ef2fe6601ae} - - {2ce139f3-ef8e-48b7-a82a-68003eac75da} - {b9f9a5a8-fd1a-4b99-b530-d8a4c45e62ec} {4b04c197-4a1e-41f9-bfa3-d82c18bcad51} - - {cd6e7f3f-fe5b-44c6-ae8d-15554f926055} - {60f588f2-bdb9-4b1d-9e23-40a73f327283} @@ -93,9 +87,6 @@ Source Files\audio - - Source Files\detail\win32 - Source Files\filesystem @@ -132,9 +123,6 @@ Source Files\gui\detail - - Source Files\gui\detail\win32 - Source Files\gui\widgets\skeletons @@ -294,5 +282,11 @@ Source Files\paint + + Source Files\detail + + + Source Files\gui\detail + \ No newline at end of file diff --git a/include/nana/audio/detail/buffer_preparation.hpp b/include/nana/audio/detail/buffer_preparation.hpp index fdffc91c..c3e03d71 100644 --- a/include/nana/audio/detail/buffer_preparation.hpp +++ b/include/nana/audio/detail/buffer_preparation.hpp @@ -3,7 +3,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #include #include diff --git a/include/nana/charset.hpp b/include/nana/charset.hpp index 9e109b65..6c36159b 100644 --- a/include/nana/charset.hpp +++ b/include/nana/charset.hpp @@ -1,3 +1,17 @@ +/** + * The charset Implementation + * Nana C++ Library(http://www.nanapro.org) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * @file: nana/charset.hpp + * + * + */ + #ifndef NANA_CHARSET_HPP #define NANA_CHARSET_HPP #include @@ -13,6 +27,7 @@ namespace nana { class charset_encoding_interface; } + /// An intelligent charset class for character code conversion. class charset { diff --git a/include/nana/config.hpp b/include/nana/config.hpp index 188f7562..e97c70f6 100644 --- a/include/nana/config.hpp +++ b/include/nana/config.hpp @@ -1,7 +1,7 @@ -/* +/** * Nana Configuration * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -13,57 +13,133 @@ #ifndef NANA_CONFIG_HPP #define NANA_CONFIG_HPP -#if defined(_MSC_VER) - #define _SCL_SECURE_NO_WARNINGS - #define _CRT_SECURE_NO_DEPRECATE - #pragma warning(disable : 4996) +// Select platform ...... + + // Windows: + #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) + + #define NANA_WINDOWS + + // MINGW ... + #if defined(__MINGW32__) || defined(__MINGW64__) || defined(MINGW) + #define NANA_MINGW + #endif // MINGW + + // end Windows + + + // MacOS: who define APPLE ?? + //#define APPLE + #elif defined(APPLE) + #define NANA_MACOS + #define NANA_X11 + // how to add this: include_directories(/opt/X11/include/) + // end MacOS + + // Linux: (not sure about __GNU__ ??) + #elif (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC) + #define NANA_LINUX + #define NANA_X11 + // end Linux + #else + # static_assert(false, "Only Windows and Unix are supported now (Mac OS is experimental)"); + #endif // Select platform + + #if defined(NANA_LINUX) || defined(NANA_MACOS) + #define NANA_POSIX + #undef NANA_WINDOWS + #endif +// End Select platform ...... + +// compilers ... + +// MSVC++ versions +#if defined(_MSC_VER) + #define _SCL_SECURE_NO_WARNNGS + #define _CRT_SECURE_NO_DEPRECATE + #pragma warning(disable : 4996) - #if (_MSC_VER < 1900) - // is this a good idea? - #define NOT_IMPLEMENTED_KEYWORD_noexcept - #endif // _MSC_VER < 1900 #if (_MSC_VER == 1900) - // google: break any code that tries to use codecvt or codecvt. - // google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support. - // google: Those definitions are for codecvt::id, codecvt::id and codecvt::id respectively. - // However, the codecvt::id and codecvt::id definitions aren't there, and indeed, if you look at locale0.cpp in the CRT source code you'll see they're not defined at all. - // google: That's a known issue, tracked by an active bug (DevDiv#1060849). We were able to update the STL's headers in response to char16_t/char32_t, but we still need to update the separately compiled sources. + // google: break any code that tries to use codecvt or codecvt. + // google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support. + // google: Those definitions are for codecvt::id, codecvt::id and codecvt::id respectively. + // However, the codecvt::id and codecvt::id definitions aren't there, and indeed, if you look at locale0.cpp in the CRT source code you'll see they're not defined at all. + // google: That's a known issue, tracked by an active bug (DevDiv#1060849). We were able to update the STL's headers in response to char16_t/char32_t, but we still need to update the separately compiled sources. #define STD_CODECVT_NOT_SUPPORTED - #endif // _MSC_VER == 1900 + #endif // _MSC_VER == 1900 #endif // _MSVC -//Select platform automatically -#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -//Windows: - #define NANA_WINDOWS 1 - - //Test if it is MINGW - #if defined(__MINGW32__) || defined(__MINGW64__) - #define NANA_MINGW +#if defined(__clang__) + #if defined(__GLIBCPP__) || defined(__GLIBCXX__) + // is a known issue on libstdc++, it works on libc++ #define STD_CODECVT_NOT_SUPPORTED - #if (__GNUC__ == 4) && ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 1)) - //Use this flag if MinGW version is older than 4.8.1 + #endif + +#elif defined(__GNUC__) //GCC + #if defined(__GLIBCPP__) || defined(__GLIBCXX__) + // is a known issue on libstdc++, it works on libc++ + #define STD_CODECVT_NOT_SUPPORTED + #endif + + #if (__GNUC__ == 4) + #if ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 1)) #define STD_THREAD_NOT_SUPPORTED + + //boost.thread is preferred + //but if USE_github_com_meganz_mingw_std_threads is enabled, + //boost.thread will be replaced with meganz's mingw-std-threads. + // https://github.com/meganz/mingw-std-threads + //#define USE_github_com_meganz_mingw_std_threads + #endif + + #if defined(NANA_MINGW) + //It's a known issue under MinGW + #define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED + #endif + + #if ((__GNUC_MINOR__ < 8) || defined(NANA_MINGW)) + #define STD_TO_STRING_NOT_SUPPORTED #endif #endif -#elif (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC) -//Linux: - #define NANA_LINUX 1 - #define NANA_X11 1 - #define STD_CODECVT_NOT_SUPPORTED -#else -# static_assert(false, "Only Windows and Unix are supported now (Mac OS is experimental)"); #endif -#if defined(NANA_MINGW) || defined(NANA_LINUX) - #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && (__GNUC_PATCHLEVEL__ <= 1) - //Some functions which are specified in 21.5 Numeric conversions in Strings library have not yet implemented - #define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED + + +// End compilers ... + + +// Here defines some flags that tell Nana what features will be supported. + +/////////////////// +//Support for PNG +// Define the NANA_ENABLE_PNG to enable the support of PNG. +// +//#define NANA_ENABLE_PNG //! +//#define USE_LIBPNG_FROM_OS // Un-Comment it to use libpng from operating system. +#if defined(NANA_ENABLE_PNG) + #if !defined(USE_LIBPNG_FROM_OS) + #define NANA_LIBPNG #endif #endif -//Here defines some flags that tell Nana what features will be supported. -#define NANA_UNICODE +/////////////////// +//Support for JPEG +// Define the NANA_ENABLE_JPEG to enable the support of JPEG. +// +//#define NANA_ENABLE_JPEG //! +//#define USE_LIBJPEG_FROM_OS // Un-Comment it to use libjpeg from operating system. +#if defined(NANA_ENABLE_JPEG) + #if !defined(USE_LIBJPEG_FROM_OS) + #define NANA_LIBJPEG + #endif +#endif + + + +// always define NANA_UNICODE ?? it will be deprecated ?. +#ifndef NANA_UNICODE + #define NANA_UNICODE +#endif #if defined(NANA_UNICODE) && defined(NANA_WINDOWS) #ifndef _UNICODE @@ -75,23 +151,5 @@ #endif #endif -/////////////////// -//Support for PNG -// Define the NANA_ENABLE_PNG to enable the support of PNG. -// -//#define NANA_ENABLE_PNG //! -#if defined(NANA_ENABLE_PNG) - #define NANA_LIBPNG //Comment it to use libpng from operating system. -#endif - -/////////////////// -//Support for JPEG -// Define the NANA_ENABLE_JPEG to enable the support of JPEG. -// -//#define NANA_ENABLE_JPEG //! -#if defined(NANA_ENABLE_JPEG) - #define NANA_LIBJPEG //Comment this whole line to use libjpeg from operating system. -#endif - #endif //NANA_CONFIG_HPP diff --git a/include/nana/deploy.hpp b/include/nana/deploy.hpp index b3ac88d0..30d87935 100644 --- a/include/nana/deploy.hpp +++ b/include/nana/deploy.hpp @@ -19,9 +19,7 @@ #include #include -#if defined(NANA_LINUX) || defined(NANA_MACOS) -#undef NANA_WINDOWS -#endif + //Implement workarounds for GCC/MinGW which version is below 4.8.2 #if defined(STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED) @@ -58,8 +56,23 @@ namespace std //Workaround for no implemenation of std::stoull in MinGW. unsigned long long stoull(const std::string&, std::size_t* pos = nullptr, int base = 10); unsigned long long stoull(const std::wstring&, std::size_t* pos = nullptr, int base = 10); +} +#endif //STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED - //Workaround for no implemenation of std::to_wstring in MinGW. +#ifdef STD_TO_STRING_NOT_SUPPORTED +namespace std +{ + //Workaround for no implemenation of std::to_string/std::to_wstring in MinGW. + std::string to_string(long double); + std::string to_string(double); + std::string to_string(unsigned); + std::string to_string(int); + std::string to_string(long); + std::string to_string(unsigned long); + std::string to_string(long long); + std::string to_string(unsigned long long); + std::string to_string(float); + std::wstring to_wstring(long double); std::wstring to_wstring(double); std::wstring to_wstring(unsigned); diff --git a/include/nana/detail/linux_X11/platform_spec.hpp b/include/nana/detail/linux_X11/platform_spec.hpp index 461517f9..0a013ed6 100644 --- a/include/nana/detail/linux_X11/platform_spec.hpp +++ b/include/nana/detail/linux_X11/platform_spec.hpp @@ -13,6 +13,8 @@ * This file should not be included by any header files. */ +#if defined(NANA_LINUX) || defined(NANA_MACOS) + #ifndef NANA_DETAIL_PLATFORM_SPEC_HPP #define NANA_DETAIL_PLATFORM_SPEC_HPP @@ -323,5 +325,9 @@ namespace detail }//end namespace nana +// .h ward +#endif + +//#if defined(NANA_LINUX) || defined(NANA_MACOS) #endif diff --git a/include/nana/detail/win32/platform_spec.hpp b/include/nana/detail/win32/platform_spec.hpp index b0b90fad..b129406b 100644 --- a/include/nana/detail/win32/platform_spec.hpp +++ b/include/nana/detail/win32/platform_spec.hpp @@ -12,6 +12,7 @@ * This file provides basis class and data structrue that required by nana * This file should not be included by any header files. */ +#if defined(NANA_WINDOWS) #ifndef NANA_DETAIL_PLATFORM_SPEC_HPP #define NANA_DETAIL_PLATFORM_SPEC_HPP @@ -198,4 +199,9 @@ namespace detail }//end namespace detail }//end namespace nana + +// .h ward +#endif + +//#if defined(NANA_WINDOWS) #endif diff --git a/include/nana/filesystem/file_iterator.hpp b/include/nana/filesystem/file_iterator.hpp index b884638f..94f37001 100644 --- a/include/nana/filesystem/file_iterator.hpp +++ b/include/nana/filesystem/file_iterator.hpp @@ -38,7 +38,7 @@ namespace filesystem fileinfo(); #ifdef NANA_WINDOWS fileinfo(const WIN32_FIND_DATA& wfd); -#elif NANA_LINUX or NANA_MACOS +#elif defined(NANA_POSIX) fileinfo(const nana::string& filename, const struct stat &); #endif nana::string name; diff --git a/include/nana/gui/detail/events_operation.hpp b/include/nana/gui/detail/events_operation.hpp index 08a98b48..78f5c432 100644 --- a/include/nana/gui/detail/events_operation.hpp +++ b/include/nana/gui/detail/events_operation.hpp @@ -5,7 +5,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/include/nana/gui/detail/general_events.hpp b/include/nana/gui/detail/general_events.hpp index cdb6ac3a..a6f17bc6 100644 --- a/include/nana/gui/detail/general_events.hpp +++ b/include/nana/gui/detail/general_events.hpp @@ -427,11 +427,12 @@ namespace nana ::nana::point pos; ///< cursor position in the event window ::nana::mouse button; ///< indicates a button which triggers the event - bool left_button; ///< mouse left button is pressed? - bool mid_button; ///< mouse middle button is pressed? - bool right_button; ///< mouse right button is pressed? - bool shift; ///< keyboard Shift is pressed? - bool ctrl; ///< keyboard Ctrl is pressed? + bool left_button; ///< mouse left button is pressed? + bool mid_button; ///< mouse middle button is pressed? + bool right_button; ///< mouse right button is pressed? + bool alt; ///< keyboard alt is pressed? + bool shift; ///< keyboard Shift is pressed? + bool ctrl; ///< keyboard Ctrl is pressed? /// Checks if left button is operated, bool is_left_button() const @@ -521,7 +522,7 @@ namespace nana struct arg_click : public event_arg { ::nana::window window_handle; ///< A handle to the event window - bool by_mouse; ///< Determines whether the event is emitted by clicking mouse button + const arg_mouse* mouse_args; ///< If it is not null, it refers to the mouse arguments for click event emitted by mouse, nullptr otherwise. }; /// provides some fundamental events that every widget owns. diff --git a/include/nana/gui/detail/handle_manager.hpp b/include/nana/gui/detail/handle_manager.hpp index 91ac70f1..7e8f670d 100644 --- a/include/nana/gui/detail/handle_manager.hpp +++ b/include/nana/gui/detail/handle_manager.hpp @@ -17,7 +17,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/include/nana/gui/detail/window_manager.hpp b/include/nana/gui/detail/window_manager.hpp index c8229df6..b04c32dc 100644 --- a/include/nana/gui/detail/window_manager.hpp +++ b/include/nana/gui/detail/window_manager.hpp @@ -106,7 +106,7 @@ namespace detail //@brief: Delete window handle, the handle type must be a root and a frame. void destroy_handle(core_window_t*); - void default_icon(const paint::image& small_icon, const paint::image& big_icon); + void default_icon(const paint::image& _small_icon, const paint::image& big_icon); void icon(core_window_t*, const paint::image& small_icon, const paint::image& big_icon); //show diff --git a/include/nana/gui/programming_interface.hpp b/include/nana/gui/programming_interface.hpp index 520bc05c..6227f6bb 100644 --- a/include/nana/gui/programming_interface.hpp +++ b/include/nana/gui/programming_interface.hpp @@ -113,7 +113,7 @@ namespace API private: bool _m_enum_fn(::nana::widget* wd) override { - return _m_enum_call(wd, nullptr); + return _m_enum_call(wd); } template::value>::type* = nullptr> diff --git a/include/nana/gui/widgets/tabbar.hpp b/include/nana/gui/widgets/tabbar.hpp index 2ed73ab4..f0bcb3b2 100644 --- a/include/nana/gui/widgets/tabbar.hpp +++ b/include/nana/gui/widgets/tabbar.hpp @@ -40,7 +40,9 @@ namespace nana : arg_tabbar({wdg, v}) {} - bool remove = true; + bool remove = true; ///< determines whether to remove the item + bool close_attach_window = true; ///< determines whether to close the attached window. It is ignored if remove is false + }; namespace drawerbase @@ -51,11 +53,11 @@ namespace nana struct tabbar_events : public general_events { - typedef T value_type; + using value_type = T; basic_event> added; basic_event> activated; - basic_event> removed; + basic_event> removed; }; class event_agent_interface @@ -64,7 +66,7 @@ namespace nana virtual ~event_agent_interface() = default; virtual void added(std::size_t) = 0; virtual void activated(std::size_t) = 0; - virtual bool removed(std::size_t) = 0; + virtual bool removed(std::size_t, bool & close_attached) = 0; }; class item_renderer @@ -98,7 +100,7 @@ namespace nana : public event_agent_interface { public: - typedef ::nana::arg_tabbar arg_tabbar; + using arg_tabbar = ::nana::arg_tabbar; event_agent(::nana::tabbar& tb, DrawerTrigger & dtr) : tabbar_(tb), drawer_trigger_(dtr) @@ -119,14 +121,16 @@ namespace nana tabbar_.events().activated.emit(arg_tabbar({ tabbar_, tabbar_[pos]})); } - bool removed(std::size_t pos) override + bool removed(std::size_t pos, bool & close_attach) override { if (pos != npos) { ::nana::arg_tabbar_removed arg(tabbar_, tabbar_[pos]); tabbar_.events().removed.emit(arg); + close_attach = arg.close_attach_window; return arg.remove; } + close_attach = true; return true; } private: @@ -140,8 +144,6 @@ namespace nana : public drawer_trigger { public: - //enum toolbox_button_t{ButtonAdd, ButtonScroll, ButtonList, ButtonClose}; //deprecated - enum class kits { add, @@ -159,10 +161,11 @@ namespace nana const pat::cloneable & ext_renderer() const; void ext_renderer(const pat::cloneable&); void set_event_agent(event_agent_interface*); - void push_back(const nana::string&, const nana::any&); + void insert(std::size_t, nana::string&&, nana::any&&); std::size_t length() const; bool close_fly(bool); - void relate(size_t, window); + void attach(std::size_t, window); + void erase(std::size_t); void tab_color(std::size_t, bool is_bgcolor, const ::nana::color&); void tab_image(size_t, const nana::paint::image&); void text(std::size_t, const nana::string&); @@ -198,7 +201,7 @@ namespace nana struct button_close{}; ///< The type identifies the close button of the tabbar's toolbox. //This template class is deprecated, it will be removed in 1.3 - /// A template class identifies the buttons of the tabbar's toolbox. Refer to notes for more details. + /// A template class identifies the buttons of the tabbar's toolbox. Refer to notes for more details. template struct button_container { @@ -225,18 +228,6 @@ namespace nana this->create(wd, rectangle(), visible); } - tabbar(window wd, const nana::char_t* text, bool visible) - : tabbar(wd, ::nana::string(text), visible) - { - } - - tabbar(window wd, const nana::string& text, bool visible) - : tabbar() - { - this->create(wd, rectangle(), visible); - this->caption(text); - } - tabbar(window wd, const rectangle& r = rectangle(), bool visible = true) : tabbar() { @@ -253,7 +244,7 @@ namespace nana return static_cast(this->get_drawer_trigger().at_no_bound_check(pos)); } - void activate(std::size_t pos) /// Activates a tab specified by i. + void activated(std::size_t pos) /// Activates a tab specified by pos. { this->get_drawer_trigger().activate(pos); } @@ -263,23 +254,23 @@ namespace nana return this->get_drawer_trigger().activated(); } - value_type & at(std::size_t i) const /// Returns i'th element + value_type & at(std::size_t pos) const /// Returns pos'th element { - return static_cast(this->get_drawer_trigger().at(i)); + return static_cast(this->get_drawer_trigger().at(pos)); } void close_fly(bool fly) /// Draw or not a close button in each tab. { - if(this->get_drawer_trigger().close_fly(fly)) + if (this->get_drawer_trigger().close_fly(fly)) API::refresh_window(this->handle()); } - pat::cloneable& ext_renderer() const + pat::cloneable& renderer() const { return this->get_drawer_trigger().ext_renderer(); } - void ext_renderer(const pat::cloneable& ir) + void renderer(const pat::cloneable& ir) { this->get_drawer_trigger().ext_renderer(ir); } @@ -289,31 +280,73 @@ namespace nana return this->get_drawer_trigger().length(); } - void push_back(const nana::string& text) /// Append a new item. + tabbar& append(std::string text, window attach_wd, value_type value = {}) { - auto & t = this->get_drawer_trigger(); - t.push_back(text, value_type()); + return this->append(static_cast(nana::charset(text, nana::unicode::utf8)), attach_wd); + } + + tabbar& append(std::wstring text, window attach_wd, value_type value = {}) + { + this->get_drawer_trigger().insert(::nana::npos, std::move(text), std::move(value)); + if (attach_wd) + { + auto pos = this->get_drawer_trigger().length(); + relate(pos, attach_wd); + } + + API::update_window(*this); + return *this; + } + + void push_back(nana::string text) /// Append a new item. + { + this->get_drawer_trigger().insert(::nana::npos, std::move(text), value_type()); API::update_window(*this); } + void insert(std::size_t pos, std::string text, value_type value = {}) + { + return this->insert(pos, static_cast(nana::charset(text, nana::unicode::utf8)), std::move(value)); + } + + void insert(std::size_t pos, std::wstring text, value_type value = {}) + { + if (pos > length()) + throw std::out_of_range("tabbar::insert invalid position"); + + this->get_drawer_trigger().insert(pos, std::move(text), std::move(value)); + API::update_window(*this); + } + + //deprecated from 1.2.1, removed from 1.3 void relate(std::size_t pos, window wd) /// Binds a window to an item specified by pos, if the item is selected, shows the window, otherwise, hides it. { - this->get_drawer_trigger().relate(pos, wd); + this->get_drawer_trigger().attach(pos, wd); } - void tab_bgcolor(std::size_t i, const ::nana::color& clr) + void attach(std::size_t pos, window wd) { - this->get_drawer_trigger().tab_color(i, true, clr); + this->get_drawer_trigger().attach(pos, wd); } - void tab_fgcolor(std::size_t i, const ::nana::color& clr) + void erase(std::size_t pos) { - this->get_drawer_trigger().tab_color(i, false, clr); + this->get_drawer_trigger().erase(pos); } - void tab_image(std::size_t i, const nana::paint::image& img) + void tab_bgcolor(std::size_t pos, const ::nana::color& clr) { - this->get_drawer_trigger().tab_image(i, img); + this->get_drawer_trigger().tab_color(pos, true, clr); + } + + void tab_fgcolor(std::size_t pos, const ::nana::color& clr) + { + this->get_drawer_trigger().tab_color(pos, false, clr); + } + + void tab_image(std::size_t pos, const nana::paint::image& img) + { + this->get_drawer_trigger().tab_image(pos, img); } /// Sets buttons of the tabbar's toolbox, refer to notes for more details. template diff --git a/include/nana/std_condition_variable.hpp b/include/nana/std_condition_variable.hpp index 72399b59..0c9813fc 100644 --- a/include/nana/std_condition_variable.hpp +++ b/include/nana/std_condition_variable.hpp @@ -3,10 +3,14 @@ #include #if defined(STD_THREAD_NOT_SUPPORTED) +#if defined(USE_github_com_meganz_mingw_std_threads) + #include +#else #include namespace std { typedef boost::condition_variable condition_variable; } -#endif +#endif // (USE_github_com_meganz_mingw_std_threads) +#endif // (STD_THREAD_NOT_SUPPORTED) #endif // NANA_STD_CONDITION_VARIABLE_HPP diff --git a/include/nana/std_mutex.hpp b/include/nana/std_mutex.hpp index 9fdebfc6..5eb6528a 100644 --- a/include/nana/std_mutex.hpp +++ b/include/nana/std_mutex.hpp @@ -3,6 +3,20 @@ #include #if defined(STD_THREAD_NOT_SUPPORTED) + +#if defined(USE_github_com_meganz_mingw_std_threads) +#include +#include +#include +#include +#include +#include +#include +// http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno.h#L53 +#define EPROTO 71 /* Protocol error */ +#include +#include +#else #include #include #include @@ -18,5 +32,6 @@ namespace std typedef boost::mutex mutex; typedef boost::recursive_mutex recursive_mutex; } -#endif +#endif // (USE_github_com_meganz_mingw_std_threads) +#endif // (STD_THREAD_NOT_SUPPORTED) #endif // NANA_STD_MUTEX_HPP diff --git a/include/nana/std_thread.hpp b/include/nana/std_thread.hpp index 572193ac..321b3728 100644 --- a/include/nana/std_thread.hpp +++ b/include/nana/std_thread.hpp @@ -3,11 +3,15 @@ #include #if defined(STD_THREAD_NOT_SUPPORTED) + +#if defined(USE_github_com_meganz_mingw_std_threads) +#include +#else #include namespace std { typedef boost::thread thread; } -#endif - +#endif // (USE_github_com_meganz_mingw_std_threads) +#endif // (STD_THREAD_NOT_SUPPORTED) #endif // NANA_STD_THREAD_HPP diff --git a/source/deploy.cpp b/source/deploy.cpp index d61b0dd5..ce92982a 100644 --- a/source/deploy.cpp +++ b/source/deploy.cpp @@ -61,6 +61,13 @@ namespace std *pos = (std::size_t)(end - sptr); return ((int)result); } + using ::strtof; + using ::strtold; + using ::wcstold; + using ::strtoll; + using ::wcstoll; + using ::strtoull; + using ::wcstoull; float stof(const std::string& str, std::size_t * pos) { @@ -287,6 +294,74 @@ namespace std *pos = (std::size_t)(end - ptr); return result; } +}//end namespace std +#endif //STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED + +#ifdef STD_TO_STRING_NOT_SUPPORTED +namespace std +{ + std::string to_string(double v) + { + std::stringstream ss; + ss << v; + return ss.str(); + } + + std::string to_string(long double v) + { + std::stringstream ss; + ss << v; + return ss.str(); + } + + std::string to_string(unsigned v) + { + std::stringstream ss; + ss << v; + return ss.str(); + } + + std::string to_string(int v) + { + std::stringstream ss; + ss << v; + return ss.str(); + } + + std::string to_string(long v) + { + std::stringstream ss; + ss << v; + return ss.str(); + } + + std::string to_string(unsigned long v) + { + std::stringstream ss; + ss << v; + return ss.str(); + } + + std::string to_string(long long v) + { + std::stringstream ss; + ss << v; + return ss.str(); + } + + std::string to_string(unsigned long long v) + { + std::stringstream ss; + ss << v; + return ss.str(); + } + + std::string to_string(float v) + { + std::stringstream ss; + ss << v; + return ss.str(); + } std::wstring to_wstring(double v) { diff --git a/source/detail/linux_X11/platform_spec.cpp b/source/detail/platform_spec_posix.cpp similarity index 99% rename from source/detail/linux_X11/platform_spec.cpp rename to source/detail/platform_spec_posix.cpp index d2244430..33d81a75 100644 --- a/source/detail/linux_X11/platform_spec.cpp +++ b/source/detail/platform_spec_posix.cpp @@ -13,7 +13,9 @@ * * http://standards.freedesktop.org/clipboards-spec/clipboards-0.1.txt */ + #include +#if defined(NANA_POSIX) && defined(NANA_X11) #include #include #include @@ -27,7 +29,7 @@ #include #include -#include "msg_dispatcher.hpp" +#include "x11/msg_dispatcher.hpp" namespace nana { @@ -1411,3 +1413,4 @@ namespace detail } }//end namespace detail }//end namespace nana +#endif //NANA_POSIX && NANA_X11 diff --git a/source/detail/platform_spec_selector.cpp b/source/detail/platform_spec_selector.cpp deleted file mode 100644 index b09fbfe4..00000000 --- a/source/detail/platform_spec_selector.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Platform Specification Selector - * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) - * - * Distributed under the Nana Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://nanapro.org/LICENSE_1_0.txt) - * - * @file: nana/detail/platform_spec_selector.cpp - * - * This file is used to support the Nana project of some cross-platform IDE, - * - */ - -#include - -#if defined(NANA_WINDOWS) - #include "win32/platform_spec.cpp" -#elif defined(NANA_LINUX) || defined(NANA_MACOS) - #include "linux_X11/platform_spec.cpp" -#endif \ No newline at end of file diff --git a/source/detail/win32/platform_spec.cpp b/source/detail/platform_spec_windows.cpp similarity index 99% rename from source/detail/win32/platform_spec.cpp rename to source/detail/platform_spec_windows.cpp index ffc6dc28..0323dfc1 100644 --- a/source/detail/win32/platform_spec.cpp +++ b/source/detail/platform_spec_windows.cpp @@ -11,7 +11,11 @@ * * This file provides basis class and data structrue that required by nana */ + #include + +#if defined(NANA_WINDOWS) + #include #include @@ -289,3 +293,5 @@ namespace detail } }//end namespace detail }//end namespace nana + +#endif //NANA_WINDOWS diff --git a/source/detail/linux_X11/msg_dispatcher.hpp b/source/detail/x11/msg_dispatcher.hpp similarity index 100% rename from source/detail/linux_X11/msg_dispatcher.hpp rename to source/detail/x11/msg_dispatcher.hpp diff --git a/source/gui/animation.cpp b/source/gui/animation.cpp index 4b1c8e59..a82702e6 100644 --- a/source/gui/animation.cpp +++ b/source/gui/animation.cpp @@ -21,7 +21,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #include #include @@ -29,7 +29,7 @@ #include #include #include -#endif //NANA_MINGW +#endif // STD_THREAD_NOT_SUPPORTED namespace nana { diff --git a/source/gui/detail/linux_X11/bedrock.cpp b/source/gui/detail/bedrock_posix.cpp similarity index 98% rename from source/gui/detail/linux_X11/bedrock.cpp rename to source/gui/detail/bedrock_posix.cpp index 2bcf5715..ad8a8508 100644 --- a/source/gui/detail/linux_X11/bedrock.cpp +++ b/source/gui/detail/bedrock_posix.cpp @@ -11,6 +11,7 @@ */ #include +#if defined(NANA_POSIX) && defined(NANA_X11) #include #include #include @@ -467,8 +468,9 @@ namespace detail arg.left_button = ((Button1Mask & mask_state) != 0) || (::nana::mouse::left_button == arg.button) ; arg.right_button = ((Button2Mask & mask_state) != 0) || (::nana::mouse::right_button == arg.button); arg.mid_button = ((Button3Mask & mask_state) != 0) || (::nana::mouse::middle_button == arg.button); - arg.shift = (ShiftMask & mask_state); - arg.ctrl = (ControlMask & mask_state); + arg.alt = ((Mod1Mask & mask_state) != 0); + arg.shift = ((ShiftMask & mask_state) != 0); + arg.ctrl = ((ControlMask & mask_state) != 0); } @@ -815,21 +817,24 @@ namespace detail { auto retain = msgwnd->together.events_ptr; - arg_mouse arg; + ::nana::arg_mouse arg; assign_arg(arg, msgwnd, message, xevent); + ::nana::arg_click click_arg; + + //the window_handle of click_arg is used as a flag to determinate whether to emit click event. + click_arg.window_handle = nullptr; + click_arg.mouse_args = &arg; + const bool hit = msgwnd->dimension.is_hit(arg.pos); - bool fire_click = false; if(msgwnd == pressed_wd) { if((arg.button == ::nana::mouse::left_button) && hit) { msgwnd->flags.action = mouse_action::over; - arg_click arg; - arg.window_handle = reinterpret_cast(msgwnd); - arg.by_mouse = true; - emit_drawer(&drawer::click, msgwnd, arg, &context); - fire_click = true; + + click_arg.window_handle = reinterpret_cast(msgwnd); + emit_drawer(&drawer::click, msgwnd, click_arg, &context); } } @@ -845,13 +850,8 @@ namespace detail arg.evt_code = event_code::mouse_up; emit_drawer(&drawer::mouse_up, msgwnd, arg, &context); - if(fire_click) - { - arg_click arg; - arg.window_handle = reinterpret_cast(msgwnd); - arg.by_mouse = true; - evt_ptr->click.emit(arg); - } + if(click_arg.window_handle) + evt_ptr->click.emit(click_arg); if (brock.wd_manager().available(msgwnd)) { @@ -859,13 +859,9 @@ namespace detail evt_ptr->mouse_up.emit(arg); } } - else if(fire_click) - { - arg_click arg; - arg.window_handle = reinterpret_cast(msgwnd); - arg.by_mouse = true; - msgwnd->together.events_ptr->click.emit(arg); - } + else if(click_arg.window_handle) + msgwnd->together.events_ptr->click.emit(click_arg); + brock.wd_manager().do_lazy_refresh(msgwnd, false); } pressed_wd = nullptr; @@ -1404,3 +1400,4 @@ namespace detail } }//end namespace detail }//end namespace nana +#endif //NANA_POSIX && NANA_X11 \ No newline at end of file diff --git a/source/gui/detail/bedrock_selector.cpp b/source/gui/detail/bedrock_selector.cpp deleted file mode 100644 index 986d3538..00000000 --- a/source/gui/detail/bedrock_selector.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Bedrock Selector - * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) - * - * Distributed under the Nana Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://nanapro.sourceforge.net/LICENSE_1_0.txt) - * - * @file: nana/gui/detail/bedrock_selector.cpp - * - * This file is used to support the Nana project of some cross-platform IDE, - * - */ - -#include - -#if defined(NANA_WINDOWS) - #include "win32/bedrock.cpp" -#elif defined(NANA_LINUX) || defined(NANA_MACOS) - #include "linux_X11/bedrock.cpp" -#endif - diff --git a/source/gui/detail/win32/bedrock.cpp b/source/gui/detail/bedrock_windows.cpp similarity index 98% rename from source/gui/detail/win32/bedrock.cpp rename to source/gui/detail/bedrock_windows.cpp index 2a68f95a..eb48b9e9 100644 --- a/source/gui/detail/win32/bedrock.cpp +++ b/source/gui/detail/bedrock_windows.cpp @@ -12,6 +12,7 @@ */ #include +#if defined(NANA_WINDOWS) #include #include #include @@ -536,6 +537,7 @@ namespace detail { arg.pos.x = pmdec.mouse.x - wd->pos_root.x; arg.pos.y = pmdec.mouse.y - wd->pos_root.y; + arg.alt = (::GetKeyState(VK_MENU) < 0); arg.shift = pmdec.mouse.button.shift; arg.ctrl = pmdec.mouse.button.ctrl; arg.left_button = pmdec.mouse.button.left; @@ -1001,20 +1003,22 @@ namespace detail { auto retain = msgwnd->together.events_ptr; - nana::arg_mouse arg; + ::nana::arg_mouse arg; assign_arg(arg, msgwnd, message, pmdec); - bool fire_click = false; + ::nana::arg_click click_arg; + + //the window_handle of click_arg is used as a flag to determinate whether to emit click event + click_arg.window_handle = nullptr; + click_arg.mouse_args = &arg; + if (msgwnd->dimension.is_hit(arg.pos)) { msgwnd->flags.action = mouse_action::over; if (::nana::mouse::left_button == arg.button) { - arg_click arg; - arg.window_handle = reinterpret_cast(msgwnd); - arg.by_mouse = true; - emit_drawer(&drawer::click, msgwnd, arg, &context); - fire_click = true; + click_arg.window_handle = reinterpret_cast(msgwnd); + emit_drawer(&drawer::click, msgwnd, click_arg, &context); } } @@ -1024,13 +1028,8 @@ namespace detail arg.evt_code = event_code::mouse_up; emit_drawer(&drawer::mouse_up, msgwnd, arg, &context); - if (fire_click) - { - arg_click arg; - arg.window_handle = reinterpret_cast(msgwnd); - arg.by_mouse = true; - retain->click.emit(arg); - } + if (click_arg.window_handle) + retain->click.emit(click_arg); if (brock.wd_manager().available(msgwnd)) { @@ -1038,13 +1037,9 @@ namespace detail retain->mouse_up.emit(arg); } } - else if (fire_click) - { - arg_click arg; - arg.window_handle = reinterpret_cast(msgwnd); - arg.by_mouse = true; - retain->click.emit(arg); - } + else if (click_arg.window_handle) + retain->click.emit(click_arg); + brock.wd_manager().do_lazy_refresh(msgwnd, false); } pressed_wd = nullptr; @@ -1900,3 +1895,4 @@ namespace detail } }//end namespace detail }//end namespace nana +#endif //NANA_WINDOWS diff --git a/source/gui/detail/native_window_interface.cpp b/source/gui/detail/native_window_interface.cpp index fa3c2558..202a76d3 100644 --- a/source/gui/detail/native_window_interface.cpp +++ b/source/gui/detail/native_window_interface.cpp @@ -14,7 +14,7 @@ #include #include #if defined(NANA_WINDOWS) - #if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) + #if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/source/gui/detail/window_manager.cpp b/source/gui/detail/window_manager.cpp index eb56ff89..909cf193 100644 --- a/source/gui/detail/window_manager.cpp +++ b/source/gui/detail/window_manager.cpp @@ -463,10 +463,10 @@ namespace detail } } - void window_manager::default_icon(const nana::paint::image& small, const nana::paint::image& big) + void window_manager::default_icon(const nana::paint::image& _small, const nana::paint::image& big) { impl_->default_icon_big = big; - impl_->default_icon_small = small; + impl_->default_icon_small = _small; } void window_manager::icon(core_window_t* wd, const paint::image& small_icon, const paint::image& big_icon) diff --git a/source/gui/notifier.cpp b/source/gui/notifier.cpp index b9577bdb..242b0334 100644 --- a/source/gui/notifier.cpp +++ b/source/gui/notifier.cpp @@ -20,7 +20,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/source/gui/place.cpp b/source/gui/place.cpp index c31daf36..88ea8dd7 100644 --- a/source/gui/place.cpp +++ b/source/gui/place.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -95,13 +96,7 @@ namespace nana std::string pos_str() const { -#ifdef NANA_MINGW - std::stringstream ss; - ss< #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/source/gui/widgets/button.cpp b/source/gui/widgets/button.cpp index e68d9a3b..65972433 100644 --- a/source/gui/widgets/button.cpp +++ b/source/gui/widgets/button.cpp @@ -373,7 +373,7 @@ namespace nana{ namespace drawerbase { arg_click arg; arg.window_handle = wdg_->handle(); - arg.by_mouse = false; + arg.mouse_args = nullptr; API::emit_event(event_code::click, arg.window_handle, arg); } diff --git a/source/gui/widgets/tabbar.cpp b/source/gui/widgets/tabbar.cpp index c0acd9f3..19d18391 100644 --- a/source/gui/widgets/tabbar.cpp +++ b/source/gui/widgets/tabbar.cpp @@ -30,6 +30,12 @@ namespace nana ::nana::color bgcolor; ::nana::color fgcolor; + + item_t() = default; + + item_t(nana::string&& text, any && value) + : text(std::move(text)), value(std::move(value)) + {} }; class def_renderer @@ -414,13 +420,13 @@ namespace nana evt_agent_ = evt; } - void push_back(const nana::string& text, const nana::any & value) + void insert(std::size_t pos, nana::string&& text, nana::any&& value) { - item_t m; - m.text = text; - m.value = value; - list_.push_back(m); - activate(static_cast(list_.size() - 1)); + if (pos >= list_.size()) + pos = list_.size(); + + list_.emplace(iterator_at(pos), std::move(text), std::move(value)); + this->activate(pos); render(); } @@ -433,9 +439,13 @@ namespace nana { if(pos < list_.size()) { - if ((nullptr == evt_agent_) || evt_agent_->removed(pos)) + bool close_attach = true; + if ((nullptr == evt_agent_) || evt_agent_->removed(pos, close_attach)) { - API::show_window(iterator_at(pos)->relative, false); + if (close_attach) + API::close_window(iterator_at(pos)->relative); + else + API::show_window(iterator_at(pos)->relative, false); list_.erase(iterator_at(pos)); _m_adjust(); @@ -593,62 +603,62 @@ namespace nana return basis_.active; } - void relate(std::size_t pos, window wd) + void attach(std::size_t pos, window wd) { - if(pos < list_.size()) - { - iterator_at(pos)->relative = wd; - API::show_window(wd, basis_.active == pos); - } + if (pos >= list_.size()) + throw std::out_of_range("tabbar: invalid position"); + + API::show_window(wd, basis_.active == pos); } bool tab_color(std::size_t pos, bool is_bgcolor, const ::nana::color& clr) { - if(pos < list_.size()) + if (pos >= list_.size()) + throw std::out_of_range("tabbar: invalid position"); + + auto & m = *iterator_at(pos); + auto & m_clr = (is_bgcolor ? m.bgcolor : m.fgcolor); + if (m_clr != clr) { - auto & m = *iterator_at(pos); - auto & m_clr = (is_bgcolor ? m.bgcolor : m.fgcolor); - if (m_clr != clr) - { - m_clr = clr; - return true; - } + m_clr = clr; + return true; } return false; } - bool tab_image(std::size_t pos, const nana::paint::image& img) + void tab_image(std::size_t pos, const nana::paint::image& img) { - if(pos > list_.size()) return false; + if (pos >= list_.size()) + throw std::out_of_range("tabbar: invalid position"); auto & m = *iterator_at(pos); if(img) m.img = img; else m.img.close(); - return true; } bool text(std::size_t pos, const nana::string& str) { - if(pos < list_.size()) + if (pos >= list_.size()) + throw std::out_of_range("tabbar: invalid position"); + + auto & m = *iterator_at(pos); + if(m.text != str) { - auto & m = *iterator_at(pos); - if(m.text != str) - { - m.text = str; - return true; - } + m.text = str; + return true; } + return false; } nana::string text(std::size_t pos) const { - if(pos < list_.size()) - return iterator_at(pos)->text; + if (pos >= list_.size()) + throw std::out_of_range("tabbar: invalid position"); - return nana::string(); + return iterator_at(pos)->text; } bool toolbox_answer(const arg_mouse& arg) @@ -1152,9 +1162,9 @@ namespace nana layouter_->event_agent(evt); } - void trigger::push_back(const nana::string& text, const nana::any& value) + void trigger::insert(std::size_t pos, nana::string&& text, nana::any&& value) { - layouter_->push_back(text, value); + layouter_->insert(pos, std::move(text), std::move(value)); } std::size_t trigger::length() const @@ -1167,9 +1177,14 @@ namespace nana return layouter_->toolbox_object().close_fly(fly); } - void trigger::relate(std::size_t i, window wd) + void trigger::attach(std::size_t pos, window wd) { - layouter_->relate(i, wd); + layouter_->attach(pos, wd); + } + + void trigger::erase(std::size_t pos) + { + layouter_->erase(pos); } void trigger::tab_color(std::size_t i, bool is_bgcolor, const ::nana::color& clr) @@ -1180,8 +1195,8 @@ namespace nana void trigger::tab_image(std::size_t i, const nana::paint::image& img) { - if(layouter_->tab_image(i, img)) - API::refresh_window(layouter_->widget_handle()); + layouter_->tab_image(i, img); + API::refresh_window(layouter_->widget_handle()); } void trigger::text(std::size_t i, const nana::string& str) diff --git a/source/internationalization.cpp b/source/internationalization.cpp index 56bc327e..a83698a9 100644 --- a/source/internationalization.cpp +++ b/source/internationalization.cpp @@ -14,9 +14,14 @@ #include #include #include -#include -#include + +#if defined(STD_THREAD_NOT_SUPPORTED) +#include +#else #include +#endif + + #include namespace nana @@ -71,16 +76,20 @@ namespace nana if (escape) { escape = false; + str_ += *i; continue; } if ('"' == *i) { - str_.append(read_ptr_ + 1, i - read_ptr_ - 1); read_ptr_ = i + 1; reach_right_quota = true; break; } + else if ('\\' != *i) + str_ += *i; + else + escape = true; } _m_eat_ws(); if (read_ptr_ == end_ptr_ || '"' != *read_ptr_) @@ -261,9 +270,10 @@ namespace nana { auto result = mgr.table.emplace(wd, std::move(eval)); result.first->second.destroy = nana::API::events(wd).destroy([wd]{ - auto & mgr = get_eval_manager(); - std::lock_guard lock(mgr.mutex); - mgr.table.erase(wd); + auto & eval_mgr = get_eval_manager(); + std::lock_guard lockgd(eval_mgr.mutex); + + eval_mgr.table.erase(wd); }); } else diff --git a/source/threads/pool.cpp b/source/threads/pool.cpp index aa9bd461..d15180d5 100644 --- a/source/threads/pool.cpp +++ b/source/threads/pool.cpp @@ -17,8 +17,9 @@ #include #if defined(STD_THREAD_NOT_SUPPORTED) - #include #include + #include + #else #include #include