Merge branch 'develop' into CMake

This commit is contained in:
qPCR4vir
2018-08-27 11:55:16 +02:00
25 changed files with 273 additions and 611 deletions

View File

@@ -220,14 +220,14 @@
#endif
#undef _nana_std_has_string_view
#undef _nana_std_has_returnable_emplace_back
#undef _nana_std_has_emplace_return_type
#if ((defined(_MSC_VER) && (_MSC_VER >= 1912) && defined(_MSVC_LANG) && _MSVC_LANG >= 201703)) || \
((__cplusplus >= 201703L) && \
(defined(__clang__) && (__clang_major__ * 100 + __clang_minor__ >= 400) || \
(!defined(__clang__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 701))) \
)
# define _nana_std_has_string_view
# define _nana_std_has_returnable_emplace_back
# define _nana_std_has_emplace_return_type
#endif

View File

@@ -1,6 +1,6 @@
/*
* A Tooltip Implementation
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at

View File

@@ -809,7 +809,6 @@ namespace nana
/// operate with absolute positions and contain only the position but montain pointers to parts of the real items
/// item_proxy self, it references and iterators are not invalidated by sort()
class item_proxy
//: public std::iterator<std::input_iterator_tag, item_proxy> //deprecated
: public ::nana::widgets::detail::widget_iterator<std::input_iterator_tag, item_proxy>
{
public:
@@ -989,7 +988,6 @@ namespace nana
};
class cat_proxy
//: public std::iterator<std::input_iterator_tag, cat_proxy> //deprecated
: public ::nana::widgets::detail::widget_iterator<std::input_iterator_tag, cat_proxy>
{
public:

View File

@@ -191,14 +191,14 @@ namespace nana{ namespace widgets
void draw_corner();
void render(bool focused);
public:
void put(std::wstring);
void put(std::wstring, bool perform_event);
void put(wchar_t);
void copy() const;
void cut();
void paste();
void enter(bool record_undo = true);
void enter(bool record_undo, bool perform_event);
void del();
void backspace(bool record_undo = true);
void backspace(bool record_undo, bool perform_event);
void undo(bool reverse);
void set_undo_queue_length(std::size_t len);
void move_ns(bool to_north); //Moves up and down
@@ -243,9 +243,9 @@ namespace nana{ namespace widgets
void _m_reset();
//Inserts text at position where the caret is
::nana::upoint _m_put(::std::wstring);
::nana::upoint _m_put(::std::wstring, bool perform_event);
::nana::upoint _m_erase_select();
::nana::upoint _m_erase_select(bool perform_event);
::std::wstring _m_make_select_string() const;
static bool _m_resolve_text(const ::std::wstring&, std::vector<std::pair<std::size_t, std::size_t>> & lines);

View File

@@ -96,13 +96,6 @@ namespace nana{ namespace widgets{ namespace skeletons
return std::stoi(idstr_, nullptr, 0);
}
private:
/*
static bool _m_unicode_word_breakable(wchar_t ch) //deprecated
{
return ((0x4E00 <= ch) && (ch <= 0x9FFF));
}
*/
static bool _m_unicode_word_breakable(const wchar_t* ch) noexcept
{
if (*ch)

View File

@@ -1,7 +1,7 @@
/*
* A textbase class implementation
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@@ -301,6 +301,29 @@ namespace skeletons
}
}
//Triggers the text_changed event.
//It is exposed for outter classes. For a outter class(eg. text_editor), a changing text content operation
//may contains multiple textbase operations, therefore, the outter class determines when an event should be triggered.
//
//Addtional, using text_changed() method, it is possible to allow a outter class performing some updating operations
//before triggering text_changed event.
void text_changed()
{
if (!changed_)
{
_m_first_change();
changed_ = true;
}
if (edited_)
{
if (evt_agent_)
evt_agent_->text_changed();
edited_ = false;
}
}
size_type lines() const
{
return text_cont_.size();
@@ -330,7 +353,7 @@ namespace skeletons
_m_at(pos).swap(text);
_m_make_max(pos);
_m_edited();
edited_ = true;
}
void insert(upoint pos, string_type && str)
@@ -351,7 +374,7 @@ namespace skeletons
}
_m_make_max(pos.y);
_m_edited();
edited_ = true;
}
void insertln(size_type pos, string_type&& str)
@@ -362,7 +385,7 @@ namespace skeletons
text_cont_.emplace_back(new string_type(std::move(str)));
_m_make_max(pos);
_m_edited();
edited_ = true;
}
void erase(size_type line, size_type pos, size_type count)
@@ -378,7 +401,7 @@ namespace skeletons
if (attr_max_.line == line)
_m_scan_for_max();
_m_edited();
edited_ = true;
}
}
@@ -398,7 +421,7 @@ namespace skeletons
else if (pos < attr_max_.line)
attr_max_.line -= n;
_m_edited();
edited_ = true;
return true;
}
@@ -426,7 +449,7 @@ namespace skeletons
if(pos < attr_max_.line)
--attr_max_.line;
_m_edited();
edited_ = true;
}
}
@@ -514,23 +537,12 @@ namespace skeletons
changed_ = false;
}
void _m_edited()
{
if(!changed_)
{
_m_first_change();
changed_ = true;
}
if (evt_agent_)
evt_agent_->text_changed();
}
private:
std::deque<std::unique_ptr<string_type>> text_cont_;
textbase_event_agent_interface* evt_agent_{ nullptr };
mutable bool changed_{ false };
mutable bool changed_{ false };
mutable bool edited_{ false };
mutable std::string filename_; //A string for the saved filename.
const string_type nullstr_;

View File

@@ -1,6 +1,6 @@
/*
* A Thread Pool Implementation
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@@ -13,10 +13,14 @@
#ifndef NANA_THREADS_POOL_HPP
#define NANA_THREADS_POOL_HPP
#include <nana/c++defines.hpp>
#include <nana/traits.hpp>
#include <functional>
#include <cstddef>
#ifndef STD_THREAD_NOT_SUPPORTED
# include <thread>
#endif
namespace nana{
/// Some mutex classes for synchronizing.
@@ -58,9 +62,12 @@ namespace threads
pool(const pool&) = delete;
pool& operator=(const pool&) = delete;
public:
pool(); ///< Creates a group of threads.
#ifndef STD_THREAD_NOT_SUPPORTED
pool(unsigned thread_number = std::thread::hardware_concurrency()); ///< Creates a group of threads.
#else
pool(unsigned thread_number = 0);
#endif
pool(pool&&);
pool(std::size_t thread_number); ///< Creates a number of threads specifed by thread_number.
~pool(); ///< waits for the all running tasks till they are finished and skips all the queued tasks.
pool& operator=(pool&&);