Merge remote-tracking branch 'cnjinhao/hotfix-1.3' into geometric_scheme

This commit is contained in:
qPCR4vir
2016-04-08 20:20:03 +02:00
10 changed files with 182 additions and 82 deletions

View File

@@ -1,7 +1,7 @@
/*
* Platform Specification Implementation
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@@ -25,6 +25,7 @@
#include <windows.h>
#include <map>
#include <memory>
#include <functional>
namespace nana
{
@@ -63,9 +64,15 @@ namespace detail
bool forced;
};
struct arg_affinity_execute
{
const std::function<void()> * function_ptr;
};
enum
{
tray = 0x501,
async_activate,
async_set_focus,
map_thread_root_buffer,
@@ -74,6 +81,10 @@ namespace detail
operate_caret, //wParam: 1=Destroy, 2=SetPos
remote_thread_set_window_pos,
remote_thread_set_window_text,
//Execute a function in a thread with is associated with a specified native window
affinity_execute,
user,
};
};

View File

@@ -1,7 +1,7 @@
/*
* Forward Declaration of Internal Scope Guard
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@@ -26,6 +26,18 @@ namespace nana
internal_scope_guard();
~internal_scope_guard();
};
class internal_revert_guard
{
internal_revert_guard(const internal_revert_guard&) = delete;
internal_revert_guard(internal_revert_guard&&) = delete;
internal_revert_guard& operator=(const internal_revert_guard&) = delete;
internal_revert_guard& operator=(internal_revert_guard&&) = delete;
public:
internal_revert_guard();
~internal_revert_guard();
};
}
#endif

View File

@@ -1,7 +1,7 @@
/*
* Platform Implementation
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@@ -36,6 +36,9 @@ namespace detail
using native_string_type = ::nana::detail::native_string_type;
//Execute a function in a thread which is associated with the specified native window.
static void affinity_execute(native_window_type, const std::function<void()>&);
static nana::size primary_monitor_size();
static rectangle screen_area_from_point(const point&);
static window_result create_window(native_window_type, bool nested, const rectangle&, const appearance&);

View File

@@ -60,6 +60,8 @@ namespace API
//@brief: The interfaces defined in namespace dev are used for developing the nana.gui
namespace dev
{
void affinity_execute(window window_handle, const std::function<void()>&);
bool set_events(window, const std::shared_ptr<general_events>&);
template<typename Scheme>

View File

@@ -97,13 +97,6 @@ namespace nana{ namespace pat{
typedef int inner_bool::* operator_bool_t;
/*
template<typename U>
struct member_enabled //deprecated
: public std::enable_if<(!std::is_base_of<cloneable, typename std::remove_reference<U>::type>::value) && std::is_base_of<base_t, typename std::remove_reference<U>::type>::value, int>
{};
*/
template<typename U>
using member_enabled = std::enable_if<(!std::is_base_of<cloneable, typename std::remove_reference<U>::type>::value) && std::is_base_of<base_t, typename std::remove_reference<U>::type>::value, int>;
public: