Merge branch 'hotfix-1.3' into develop
This commit is contained in:
@@ -207,10 +207,10 @@ namespace nana
|
||||
{
|
||||
switch(categ)
|
||||
{
|
||||
case category::root_tag::value:
|
||||
case category::flags::root:
|
||||
attribute.root = new attr_root_tag;
|
||||
break;
|
||||
case category::frame_tag::value:
|
||||
case category::flags::frame:
|
||||
attribute.frame = new attr_frame_tag;
|
||||
break;
|
||||
default:
|
||||
@@ -222,10 +222,10 @@ namespace nana
|
||||
{
|
||||
switch(category)
|
||||
{
|
||||
case category::root_tag::value:
|
||||
case category::flags::root:
|
||||
delete attribute.root;
|
||||
break;
|
||||
case category::frame_tag::value:
|
||||
case category::flags::frame:
|
||||
delete attribute.frame;
|
||||
break;
|
||||
default: break;
|
||||
@@ -236,7 +236,7 @@ namespace nana
|
||||
//basic_window
|
||||
//@brief: constructor for the root window
|
||||
basic_window::basic_window(basic_window* owner, std::unique_ptr<widget_notifier_interface>&& wdg_notifier, category::root_tag**)
|
||||
: widget_notifier(std::move(wdg_notifier)), other(category::root_tag::value)
|
||||
: widget_notifier(std::move(wdg_notifier)), other(category::flags::root)
|
||||
{
|
||||
drawer.bind(this);
|
||||
_m_init_pos_and_size(nullptr, rectangle());
|
||||
@@ -256,7 +256,7 @@ namespace nana
|
||||
//@brief: bind a native window and baisc_window
|
||||
void basic_window::bind_native_window(native_window_type wd, unsigned width, unsigned height, unsigned extra_width, unsigned extra_height, nana::paint::graphics& graphics)
|
||||
{
|
||||
if(category::root_tag::value == this->other.category)
|
||||
if(category::flags::root == this->other.category)
|
||||
{
|
||||
this->root = wd;
|
||||
dimension.width = width;
|
||||
@@ -270,7 +270,7 @@ namespace nana
|
||||
|
||||
void basic_window::frame_window(native_window_type wd)
|
||||
{
|
||||
if(category::frame_tag::value == this->other.category)
|
||||
if(category::flags::frame == this->other.category)
|
||||
other.attribute.frame->container = wd;
|
||||
}
|
||||
|
||||
@@ -357,12 +357,12 @@ namespace nana
|
||||
|
||||
void basic_window::_m_initialize(basic_window* agrparent)
|
||||
{
|
||||
if(other.category == category::root_tag::value)
|
||||
if(category::flags::root == other.category)
|
||||
{
|
||||
if(agrparent && (nana::system::this_thread_id() != agrparent->thread_id))
|
||||
agrparent = nullptr;
|
||||
|
||||
while(agrparent && (agrparent->other.category != category::root_tag::value))
|
||||
while(agrparent && (category::flags::root != agrparent->other.category))
|
||||
agrparent = agrparent->parent;
|
||||
|
||||
owner = agrparent;
|
||||
|
||||
@@ -36,6 +36,18 @@ namespace nana
|
||||
detail::bedrock::instance().wd_manager().internal_lock().unlock();
|
||||
}
|
||||
//end class internal_scope_guard
|
||||
|
||||
//class internal_revert_guard
|
||||
internal_revert_guard::internal_revert_guard()
|
||||
{
|
||||
detail::bedrock::instance().wd_manager().internal_lock().revert();
|
||||
}
|
||||
|
||||
internal_revert_guard::~internal_revert_guard()
|
||||
{
|
||||
detail::bedrock::instance().wd_manager().internal_lock().forward();
|
||||
}
|
||||
//end class internal_revert_guard
|
||||
|
||||
//class event_arg
|
||||
void event_arg::stop_propagation() const
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace detail
|
||||
return impl_->estore;
|
||||
}
|
||||
|
||||
void bedrock::map_through_widgets(core_window_t* wd, native_drawable_type drawable)
|
||||
void bedrock::map_through_widgets(core_window_t*, native_drawable_type)
|
||||
{
|
||||
//No implementation for Linux
|
||||
}
|
||||
@@ -250,9 +250,13 @@ namespace detail
|
||||
|
||||
_m_emit_core(evt_code, wd, false, arg);
|
||||
|
||||
if(ask_update)
|
||||
wd_manager().do_lazy_refresh(wd, false);
|
||||
else
|
||||
//A child of wd may not be drawn if it was out of wd's range before wd resized,
|
||||
//so refresh all children of wd when a resized occurs.
|
||||
if(ask_update || (event_code::resized == evt_code))
|
||||
{
|
||||
wd_manager().do_lazy_refresh(wd, false, (event_code::resized == evt_code));
|
||||
}
|
||||
else if(wd_manager().available(wd))
|
||||
wd->other.upd_state = core_window_t::update_state::none;
|
||||
|
||||
if(thrd) thrd->event_window = prev_wd;
|
||||
@@ -358,7 +362,7 @@ namespace detail
|
||||
}
|
||||
}
|
||||
|
||||
void window_proc_for_packet(Display * display, nana::detail::msg_packet_tag& msg)
|
||||
void window_proc_for_packet(Display * /*display*/, nana::detail::msg_packet_tag& msg)
|
||||
{
|
||||
static auto& brock = detail::bedrock::instance();
|
||||
|
||||
@@ -477,7 +481,7 @@ namespace detail
|
||||
return wchar_t(keysym);
|
||||
}
|
||||
|
||||
void window_proc_for_xevent(Display* display, XEvent& xevent)
|
||||
void window_proc_for_xevent(Display* /*display*/, XEvent& xevent)
|
||||
{
|
||||
typedef detail::bedrock::core_window_t core_window_t;
|
||||
|
||||
@@ -486,7 +490,8 @@ namespace detail
|
||||
static core_window_t* last_mouse_down_window;
|
||||
|
||||
auto native_window = reinterpret_cast<native_window_type>(event_window(xevent));
|
||||
auto root_runtime = brock.wd_manager().root_runtime(native_window);
|
||||
auto & wd_manager = brock.wd_manager();
|
||||
auto root_runtime = wd_manager.root_runtime(native_window);
|
||||
|
||||
if(root_runtime)
|
||||
{
|
||||
@@ -506,7 +511,7 @@ namespace detail
|
||||
if(pressed_wd_space)
|
||||
break;
|
||||
|
||||
msgwnd = brock.wd_manager().find_window(native_window, xevent.xcrossing.x, xevent.xcrossing.y);
|
||||
msgwnd = wd_manager.find_window(native_window, xevent.xcrossing.x, xevent.xcrossing.y);
|
||||
if(msgwnd)
|
||||
{
|
||||
if (mouse_action::pressed != msgwnd->flags.action)
|
||||
@@ -520,7 +525,7 @@ namespace detail
|
||||
arg.evt_code = event_code::mouse_move;
|
||||
brock.emit(event_code::mouse_move, msgwnd, arg, true, &context);
|
||||
|
||||
if (!brock.wd_manager().available(hovered_wd))
|
||||
if (!wd_manager.available(hovered_wd))
|
||||
hovered_wd = nullptr;
|
||||
}
|
||||
break;
|
||||
@@ -544,7 +549,7 @@ namespace detail
|
||||
if(msgwnd->dimension.width != static_cast<unsigned>(xevent.xconfigure.width) || msgwnd->dimension.height != static_cast<unsigned>(xevent.xconfigure.height))
|
||||
{
|
||||
auto & cf = xevent.xconfigure;
|
||||
brock.wd_manager().size(msgwnd, nana::size{static_cast<unsigned>(cf.width), static_cast<unsigned>(cf.height)}, true, true);
|
||||
wd_manager.size(msgwnd, nana::size{static_cast<unsigned>(cf.width), static_cast<unsigned>(cf.height)}, true, true);
|
||||
}
|
||||
|
||||
if(msgwnd->pos_native.x != xevent.xconfigure.x || msgwnd->pos_native.y != xevent.xconfigure.y)
|
||||
@@ -562,7 +567,7 @@ namespace detail
|
||||
if(xevent.xbutton.button == Button4 || xevent.xbutton.button == Button5)
|
||||
break;
|
||||
|
||||
msgwnd = brock.wd_manager().find_window(native_window, xevent.xbutton.x, xevent.xbutton.y);
|
||||
msgwnd = wd_manager.find_window(native_window, xevent.xbutton.x, xevent.xbutton.y);
|
||||
if(nullptr == msgwnd) break;
|
||||
|
||||
if ((msgwnd == msgwnd->root_widget->other.attribute.root->menubar) && brock.get_menu(msgwnd->root, true))
|
||||
@@ -584,7 +589,7 @@ namespace detail
|
||||
context.event_window = new_focus;
|
||||
auto kill_focus = brock.wd_manager().set_focus(new_focus, false, arg_focus::reason::mouse_press);
|
||||
if (kill_focus != new_focus)
|
||||
brock.wd_manager().do_lazy_refresh(kill_focus, false);
|
||||
wd_manager.do_lazy_refresh(kill_focus, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,7 +603,7 @@ namespace detail
|
||||
arg.evt_code = dbl_click ? event_code::dbl_click : event_code::mouse_down;
|
||||
if(brock.emit(arg.evt_code, msgwnd, arg, true, &context))
|
||||
{
|
||||
if (brock.wd_manager().available(msgwnd))
|
||||
if (wd_manager.available(msgwnd))
|
||||
{
|
||||
pressed_wd = msgwnd;
|
||||
//If a root window is created during the mouse_down event, Nana.GUI will ignore the mouse_up event.
|
||||
@@ -606,8 +611,9 @@ namespace detail
|
||||
{
|
||||
//call the drawer mouse up event for restoring the surface graphics
|
||||
msgwnd->flags.action = mouse_action::normal;
|
||||
|
||||
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -638,7 +644,7 @@ namespace detail
|
||||
}
|
||||
else
|
||||
{
|
||||
msgwnd = brock.wd_manager().find_window(native_window, xevent.xbutton.x, xevent.xbutton.y);
|
||||
msgwnd = wd_manager.find_window(native_window, xevent.xbutton.x, xevent.xbutton.y);
|
||||
if(nullptr == msgwnd)
|
||||
break;
|
||||
|
||||
@@ -669,7 +675,7 @@ namespace detail
|
||||
}
|
||||
|
||||
//Do mouse_up, this handle may be closed by click handler.
|
||||
if(brock.wd_manager().available(msgwnd) && msgwnd->flags.enabled)
|
||||
if(wd_manager.available(msgwnd) && msgwnd->flags.enabled)
|
||||
{
|
||||
if(hit)
|
||||
msgwnd->flags.action = mouse_action::over;
|
||||
@@ -683,7 +689,7 @@ namespace detail
|
||||
if(click_arg.window_handle)
|
||||
evt_ptr->click.emit(click_arg, reinterpret_cast<window>(msgwnd));
|
||||
|
||||
if (brock.wd_manager().available(msgwnd))
|
||||
if (wd_manager.available(msgwnd))
|
||||
{
|
||||
arg.evt_code = event_code::mouse_up;
|
||||
evt_ptr->mouse_up.emit(arg, reinterpret_cast<window>(msgwnd));
|
||||
@@ -692,29 +698,27 @@ namespace detail
|
||||
else if(click_arg.window_handle)
|
||||
msgwnd->together.events_ptr->click.emit(click_arg, reinterpret_cast<window>(msgwnd));
|
||||
|
||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
}
|
||||
pressed_wd = nullptr;
|
||||
}
|
||||
break;
|
||||
case DestroyNotify:
|
||||
if(wd_manager.available(msgwnd))
|
||||
{
|
||||
auto & spec = nana::detail::platform_spec::instance();
|
||||
if(brock.wd_manager().available(msgwnd))
|
||||
//The msgwnd may be destroyed if the window is destroyed by calling native interface of close_window().
|
||||
if (msgwnd->root == brock.get_menu())
|
||||
{
|
||||
//The msgwnd may be destroyed if the window is destroyed by calling native interface of close_window().
|
||||
if (msgwnd->root == brock.get_menu())
|
||||
{
|
||||
brock.erase_menu(false);
|
||||
brock.delay_restore(3); //Restores if delay_restore not decleared
|
||||
}
|
||||
|
||||
spec.remove(native_window);
|
||||
brock.wd_manager().destroy(msgwnd);
|
||||
|
||||
brock.manage_form_loader(msgwnd, false);
|
||||
brock.wd_manager().destroy_handle(msgwnd);
|
||||
brock.erase_menu(false);
|
||||
brock.delay_restore(3); //Restores if delay_restore not decleared
|
||||
}
|
||||
|
||||
auto & spec = ::nana::detail::platform_spec::instance();
|
||||
spec.remove(native_window);
|
||||
wd_manager.destroy(msgwnd);
|
||||
|
||||
brock.manage_form_loader(msgwnd, false);
|
||||
wd_manager.destroy_handle(msgwnd);
|
||||
}
|
||||
break;
|
||||
case MotionNotify:
|
||||
@@ -732,8 +736,8 @@ namespace detail
|
||||
if(pressed_wd_space)
|
||||
break;
|
||||
|
||||
msgwnd = brock.wd_manager().find_window(native_window, xevent.xmotion.x, xevent.xmotion.y);
|
||||
if (brock.wd_manager().available(hovered_wd) && (msgwnd != hovered_wd))
|
||||
msgwnd = wd_manager.find_window(native_window, xevent.xmotion.x, xevent.xmotion.y);
|
||||
if (wd_manager.available(hovered_wd) && (msgwnd != hovered_wd))
|
||||
{
|
||||
brock.event_msleave(hovered_wd);
|
||||
hovered_wd->flags.action = mouse_action::normal;
|
||||
@@ -741,14 +745,14 @@ namespace detail
|
||||
|
||||
//if msgwnd is neither a captured window nor a child of captured window,
|
||||
//redirect the msgwnd to the captured window.
|
||||
auto cap_wd = brock.wd_manager().capture_redirect(msgwnd);
|
||||
auto cap_wd = wd_manager.capture_redirect(msgwnd);
|
||||
if(cap_wd)
|
||||
msgwnd = cap_wd;
|
||||
}
|
||||
else if(msgwnd)
|
||||
{
|
||||
bool prev_captured_inside;
|
||||
if(brock.wd_manager().capture_window_entered(xevent.xmotion.x, xevent.xmotion.y, prev_captured_inside))
|
||||
if(wd_manager.capture_window_entered(xevent.xmotion.x, xevent.xmotion.y, prev_captured_inside))
|
||||
{
|
||||
event_code evt_code;
|
||||
if(prev_captured_inside)
|
||||
@@ -787,7 +791,7 @@ namespace detail
|
||||
arg.evt_code = event_code::mouse_move;
|
||||
brock.emit(event_code::mouse_move, msgwnd, arg, true, &context);
|
||||
}
|
||||
if (!brock.wd_manager().available(hovered_wd))
|
||||
if (!wd_manager.available(hovered_wd))
|
||||
hovered_wd = nullptr;
|
||||
break;
|
||||
case MapNotify:
|
||||
@@ -852,7 +856,6 @@ namespace detail
|
||||
|
||||
keybuf[len] = 0;
|
||||
wchar_t os_code = 0;
|
||||
auto & wd_manager = brock.wd_manager();
|
||||
switch(status)
|
||||
{
|
||||
case XLookupKeySym:
|
||||
@@ -934,7 +937,7 @@ namespace detail
|
||||
|
||||
brock.emit(event_code::key_press, msgwnd, arg, true, &context);
|
||||
|
||||
if(brock.wd_manager().available(msgwnd) && (msgwnd->root_widget->other.attribute.root->menubar == msgwnd))
|
||||
if(wd_manager.available(msgwnd) && (msgwnd->root_widget->other.attribute.root->menubar == msgwnd))
|
||||
{
|
||||
int cmd = (menu_wd && (keyboard::escape == static_cast<wchar_t>(arg.key)) ? 1 : 0 );
|
||||
brock.delay_restore(cmd);
|
||||
@@ -1041,7 +1044,7 @@ namespace detail
|
||||
arg.window_handle = reinterpret_cast<window>(msgwnd);
|
||||
|
||||
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
}
|
||||
pressed_wd_space = nullptr;
|
||||
}
|
||||
@@ -1072,7 +1075,7 @@ namespace detail
|
||||
{
|
||||
bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus);
|
||||
if (set_focus)
|
||||
brock.wd_manager().set_focus(msgwnd, false, arg_focus::reason::general);
|
||||
wd_manager.set_focus(msgwnd, false, arg_focus::reason::general);
|
||||
|
||||
arg_keyboard arg;
|
||||
arg.evt_code = event_code::key_release;
|
||||
@@ -1111,7 +1114,7 @@ namespace detail
|
||||
}
|
||||
}
|
||||
|
||||
root_runtime = brock.wd_manager().root_runtime(native_window);
|
||||
root_runtime = wd_manager.root_runtime(native_window);
|
||||
if(root_runtime)
|
||||
{
|
||||
context.event_window = pre_event_window;
|
||||
@@ -1126,14 +1129,14 @@ namespace detail
|
||||
}
|
||||
|
||||
auto thread_id = ::nana::system::this_thread_id();
|
||||
brock.wd_manager().call_safe_place(thread_id);
|
||||
wd_manager.call_safe_place(thread_id);
|
||||
|
||||
if(msgwnd)
|
||||
brock.wd_manager().remove_trash_handle(thread_id);
|
||||
wd_manager.remove_trash_handle(thread_id);
|
||||
}
|
||||
}
|
||||
|
||||
void bedrock::pump_event(window modal_window, bool is_modal)
|
||||
void bedrock::pump_event(window modal_window, bool /*is_modal*/)
|
||||
{
|
||||
thread_context * context = open_thread_context();
|
||||
if(0 == context->window_count)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/**
|
||||
* A Bedrock Implementation
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
|
||||
@@ -7,7 +7,8 @@
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* @file: nana/gui/detail/win32/bedrock.cpp
|
||||
* @file nana/gui/detail/win32/bedrock.cpp
|
||||
* @brief A Bedrock Implementation
|
||||
* @contributors: Ariel Vina-Rodriguez
|
||||
*/
|
||||
|
||||
@@ -25,6 +26,8 @@
|
||||
#include <nana/gui/detail/element_store.hpp>
|
||||
#include <nana/gui/detail/color_schemes.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#ifndef WM_MOUSEWHEEL
|
||||
#define WM_MOUSEWHEEL 0x020A
|
||||
#endif
|
||||
@@ -232,6 +235,7 @@ namespace detail
|
||||
if(wd_manager().number_of_core_window())
|
||||
{
|
||||
std::string msg = "Nana.GUI detects a memory leaks in window_manager, " + std::to_string(wd_manager().number_of_core_window()) + " window(s) are not uninstalled.";
|
||||
std::cerr << msg; /// \todo add list of cations of open windows and if aut testin GUI do auto Ok after 2 sec.
|
||||
::MessageBoxA(0, msg.c_str(), ("Nana C++ Library"), MB_OK);
|
||||
}
|
||||
|
||||
@@ -239,8 +243,8 @@ namespace detail
|
||||
delete pi_data_;
|
||||
}
|
||||
|
||||
//inc_window
|
||||
//@brief: increament the number of windows
|
||||
|
||||
/// @brief increament the number of windows in the thread id
|
||||
int bedrock::inc_window(unsigned tid)
|
||||
{
|
||||
//impl refers to the object of private_impl, the object is created when bedrock is creating.
|
||||
@@ -453,6 +457,7 @@ namespace detail
|
||||
{
|
||||
(msgbox(modal_window, "An exception during message pumping!").icon(msgbox::icon_information)
|
||||
<<"An uncaptured non-std exception during message pumping!"
|
||||
<< "\n in form: " << API::window_caption(modal_window)
|
||||
).show();
|
||||
internal_scope_guard lock;
|
||||
_m_except_handler();
|
||||
@@ -650,6 +655,14 @@ namespace detail
|
||||
case nana::detail::messages::tray:
|
||||
notifications_window_proc(wd, wParam, lParam);
|
||||
return true;
|
||||
case nana::detail::messages::affinity_execute:
|
||||
if (wParam)
|
||||
{
|
||||
auto arg = reinterpret_cast<detail::messages::arg_affinity_execute*>(wParam);
|
||||
if (arg->function_ptr)
|
||||
(*arg->function_ptr)();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -772,7 +785,9 @@ namespace detail
|
||||
static restrict::TRACKMOUSEEVENT track = {sizeof track, 0x00000002};
|
||||
|
||||
auto native_window = reinterpret_cast<native_window_type>(root_window);
|
||||
auto* root_runtime = brock.wd_manager().root_runtime(native_window);
|
||||
|
||||
auto & wd_manager = brock.wd_manager();
|
||||
auto* root_runtime = wd_manager.root_runtime(native_window);
|
||||
|
||||
if(root_runtime)
|
||||
{
|
||||
@@ -817,7 +832,7 @@ namespace detail
|
||||
bool take_over = false;
|
||||
auto mmi = reinterpret_cast<MINMAXINFO*>(lParam);
|
||||
|
||||
if(msgwnd->min_track_size.width && msgwnd->min_track_size.height)
|
||||
if(!msgwnd->min_track_size.empty())
|
||||
{
|
||||
mmi->ptMinTrackSize.x = static_cast<LONG>(msgwnd->min_track_size.width + msgwnd->extra_width);
|
||||
mmi->ptMinTrackSize.y = static_cast<LONG>(msgwnd->min_track_size.height + msgwnd->extra_height);
|
||||
@@ -878,14 +893,14 @@ namespace detail
|
||||
break;
|
||||
|
||||
pressed_wd = nullptr;
|
||||
msgwnd = brock.wd_manager().find_window(native_window, pmdec.mouse.x, pmdec.mouse.y);
|
||||
msgwnd = wd_manager.find_window(native_window, pmdec.mouse.x, pmdec.mouse.y);
|
||||
if(msgwnd && msgwnd->flags.enabled)
|
||||
{
|
||||
if (msgwnd->flags.take_active && !msgwnd->flags.ignore_mouse_focus)
|
||||
{
|
||||
auto killed = brock.wd_manager().set_focus(msgwnd, false, arg_focus::reason::mouse_press);
|
||||
if (killed != msgwnd)
|
||||
brock.wd_manager().do_lazy_refresh(killed, false);
|
||||
wd_manager.do_lazy_refresh(killed, false);
|
||||
}
|
||||
|
||||
arg_mouse arg;
|
||||
@@ -903,7 +918,7 @@ namespace detail
|
||||
if (pressed_wd_space)
|
||||
break;
|
||||
|
||||
msgwnd = brock.wd_manager().find_window(native_window, pmdec.mouse.x, pmdec.mouse.y);
|
||||
msgwnd = wd_manager.find_window(native_window, pmdec.mouse.x, pmdec.mouse.y);
|
||||
if ((nullptr == msgwnd) || (pressed_wd && (msgwnd != pressed_wd)))
|
||||
break;
|
||||
|
||||
@@ -924,7 +939,7 @@ namespace detail
|
||||
{
|
||||
auto kill_focus = brock.wd_manager().set_focus(new_focus, false, arg_focus::reason::mouse_press);
|
||||
if (kill_focus != new_focus)
|
||||
brock.wd_manager().do_lazy_refresh(kill_focus, false);
|
||||
wd_manager.do_lazy_refresh(kill_focus, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -941,14 +956,14 @@ namespace detail
|
||||
auto pos = native_interface::cursor_position();
|
||||
auto rootwd = native_interface::find_window(pos.x, pos.y);
|
||||
native_interface::calc_window_point(rootwd, pos);
|
||||
if(msgwnd != brock.wd_manager().find_window(rootwd, pos.x, pos.y))
|
||||
if(msgwnd != wd_manager.find_window(rootwd, pos.x, pos.y))
|
||||
{
|
||||
//call the drawer mouse up event for restoring the surface graphics
|
||||
msgwnd->flags.action = mouse_action::normal;
|
||||
|
||||
arg.evt_code = event_code::mouse_up;
|
||||
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -964,7 +979,7 @@ namespace detail
|
||||
if (pressed_wd_space)
|
||||
break;
|
||||
|
||||
msgwnd = brock.wd_manager().find_window(native_window, pmdec.mouse.x, pmdec.mouse.y);
|
||||
msgwnd = wd_manager.find_window(native_window, pmdec.mouse.x, pmdec.mouse.y);
|
||||
if(nullptr == msgwnd)
|
||||
break;
|
||||
|
||||
@@ -993,7 +1008,7 @@ namespace detail
|
||||
}
|
||||
|
||||
//Do mouse_up, this handle may be closed by click handler.
|
||||
if(brock.wd_manager().available(msgwnd) && msgwnd->flags.enabled)
|
||||
if(wd_manager.available(msgwnd) && msgwnd->flags.enabled)
|
||||
{
|
||||
arg.evt_code = event_code::mouse_up;
|
||||
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||
@@ -1001,7 +1016,7 @@ namespace detail
|
||||
if (click_arg.window_handle)
|
||||
retain->click.emit(click_arg, reinterpret_cast<window>(msgwnd));
|
||||
|
||||
if (brock.wd_manager().available(msgwnd))
|
||||
if (wd_manager.available(msgwnd))
|
||||
{
|
||||
arg.evt_code = event_code::mouse_up;
|
||||
retain->mouse_up.emit(arg, reinterpret_cast<window>(msgwnd));
|
||||
@@ -1010,7 +1025,7 @@ namespace detail
|
||||
else if (click_arg.window_handle)
|
||||
retain->click.emit(click_arg, reinterpret_cast<window>(msgwnd));
|
||||
|
||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
}
|
||||
pressed_wd = nullptr;
|
||||
break;
|
||||
@@ -1019,8 +1034,8 @@ namespace detail
|
||||
if (pressed_wd_space)
|
||||
break;
|
||||
|
||||
msgwnd = brock.wd_manager().find_window(native_window, pmdec.mouse.x, pmdec.mouse.y);
|
||||
if (brock.wd_manager().available(hovered_wd) && (msgwnd != hovered_wd))
|
||||
msgwnd = wd_manager.find_window(native_window, pmdec.mouse.x, pmdec.mouse.y);
|
||||
if (wd_manager.available(hovered_wd) && (msgwnd != hovered_wd))
|
||||
{
|
||||
brock.event_msleave(hovered_wd);
|
||||
hovered_wd->flags.action = mouse_action::normal;
|
||||
@@ -1028,7 +1043,7 @@ namespace detail
|
||||
|
||||
//if msgwnd is neither captured window nor the child of captured window,
|
||||
//redirect the msgwnd to the captured window.
|
||||
auto wd = brock.wd_manager().capture_redirect(msgwnd);
|
||||
auto wd = wd_manager.capture_redirect(msgwnd);
|
||||
if(wd)
|
||||
msgwnd = wd;
|
||||
}
|
||||
@@ -1036,7 +1051,7 @@ namespace detail
|
||||
else if(msgwnd)
|
||||
{
|
||||
bool prev_captured_inside;
|
||||
if(brock.wd_manager().capture_window_entered(pmdec.mouse.x, pmdec.mouse.y, prev_captured_inside))
|
||||
if(wd_manager.capture_window_entered(pmdec.mouse.x, pmdec.mouse.y, prev_captured_inside))
|
||||
{
|
||||
event_code evt_code;
|
||||
if(prev_captured_inside)
|
||||
@@ -1084,7 +1099,7 @@ namespace detail
|
||||
track.hwndTrack = native_window;
|
||||
restrict::track_mouse_event(&track);
|
||||
}
|
||||
if (!brock.wd_manager().available(hovered_wd))
|
||||
if (!wd_manager.available(hovered_wd))
|
||||
hovered_wd = nullptr;
|
||||
break;
|
||||
case WM_MOUSELEAVE:
|
||||
@@ -1100,7 +1115,7 @@ namespace detail
|
||||
if (pointer_wd == root_window)
|
||||
{
|
||||
::ScreenToClient(pointer_wd, &scr_pos);
|
||||
auto scrolled_wd = brock.wd_manager().find_window(reinterpret_cast<native_window_type>(pointer_wd), scr_pos.x, scr_pos.y);
|
||||
auto scrolled_wd = wd_manager.find_window(reinterpret_cast<native_window_type>(pointer_wd), scr_pos.x, scr_pos.y);
|
||||
|
||||
def_window_proc = true;
|
||||
auto evt_wd = scrolled_wd;
|
||||
@@ -1110,7 +1125,7 @@ namespace detail
|
||||
{
|
||||
def_window_proc = false;
|
||||
nana::point mspos{ scr_pos.x, scr_pos.y };
|
||||
brock.wd_manager().calc_window_point(evt_wd, mspos);
|
||||
wd_manager.calc_window_point(evt_wd, mspos);
|
||||
|
||||
arg_wheel arg;
|
||||
arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical);
|
||||
@@ -1124,14 +1139,14 @@ namespace detail
|
||||
if (scrolled_wd && (nullptr == evt_wd))
|
||||
{
|
||||
nana::point mspos{ scr_pos.x, scr_pos.y };
|
||||
brock.wd_manager().calc_window_point(scrolled_wd, mspos);
|
||||
wd_manager.calc_window_point(scrolled_wd, mspos);
|
||||
|
||||
arg_wheel arg;
|
||||
arg.which = (WM_MOUSEHWHEEL == message ? arg_wheel::wheel::horizontal : arg_wheel::wheel::vertical);
|
||||
assign_arg(arg, scrolled_wd, pmdec);
|
||||
|
||||
draw_invoker(&drawer::mouse_wheel, scrolled_wd, arg, &context);
|
||||
brock.wd_manager().do_lazy_refresh(scrolled_wd, false);
|
||||
wd_manager.do_lazy_refresh(scrolled_wd, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1149,7 +1164,7 @@ namespace detail
|
||||
POINT pos;
|
||||
::DragQueryPoint(drop, &pos);
|
||||
|
||||
msgwnd = brock.wd_manager().find_window(native_window, pos.x, pos.y);
|
||||
msgwnd = wd_manager.find_window(native_window, pos.x, pos.y);
|
||||
if(msgwnd)
|
||||
{
|
||||
arg_dropfiles dropfiles;
|
||||
@@ -1180,11 +1195,11 @@ namespace detail
|
||||
dropfiles.pos.x = pos.x;
|
||||
dropfiles.pos.y = pos.y;
|
||||
|
||||
brock.wd_manager().calc_window_point(msgwnd, dropfiles.pos);
|
||||
wd_manager.calc_window_point(msgwnd, dropfiles.pos);
|
||||
dropfiles.window_handle = reinterpret_cast<window>(msgwnd);
|
||||
|
||||
msgwnd->together.events_ptr->mouse_dropfiles.emit(dropfiles, reinterpret_cast<window>(msgwnd));
|
||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1272,7 +1287,7 @@ namespace detail
|
||||
break;
|
||||
case WM_SIZE:
|
||||
if(wParam != SIZE_MINIMIZED)
|
||||
brock.wd_manager().size(msgwnd, size(pmdec.size.width, pmdec.size.height), true, true);
|
||||
wd_manager.size(msgwnd, size(pmdec.size.width, pmdec.size.height), true, true);
|
||||
break;
|
||||
case WM_MOVE:
|
||||
brock.event_move(msgwnd, (int)(short) LOWORD(lParam), (int)(short) HIWORD(lParam));
|
||||
@@ -1298,7 +1313,7 @@ namespace detail
|
||||
case WM_SYSCHAR:
|
||||
def_window_proc = true;
|
||||
brock.shortkey_occurred(true);
|
||||
msgwnd = brock.wd_manager().find_shortkey(native_window, static_cast<unsigned long>(wParam));
|
||||
msgwnd = wd_manager.find_shortkey(native_window, static_cast<unsigned long>(wParam));
|
||||
if(msgwnd)
|
||||
{
|
||||
arg_keyboard arg;
|
||||
@@ -1345,7 +1360,7 @@ namespace detail
|
||||
|
||||
bool set_focus = (brock.focus() != msgwnd) && (!msgwnd->root_widget->flags.ignore_menubar_focus);
|
||||
if (set_focus)
|
||||
brock.wd_manager().set_focus(msgwnd, false, arg_focus::reason::general);
|
||||
wd_manager.set_focus(msgwnd, false, arg_focus::reason::general);
|
||||
|
||||
arg_keyboard arg;
|
||||
arg.evt_code = event_code::key_release;
|
||||
@@ -1375,9 +1390,7 @@ namespace detail
|
||||
|
||||
if(msgwnd)
|
||||
{
|
||||
auto & wd_manager = brock.wd_manager();
|
||||
|
||||
if ((VK_TAB == wParam) && (!msgwnd->visible || (false == (msgwnd->flags.tab & tab_type::eating)))) //Tab
|
||||
if((VK_TAB == wParam) && (!msgwnd->visible || (false == (msgwnd->flags.tab & tab_type::eating)))) //Tab
|
||||
{
|
||||
bool is_forward = (::GetKeyState(VK_SHIFT) >= 0);
|
||||
|
||||
@@ -1498,7 +1511,7 @@ namespace detail
|
||||
arg.window_handle = reinterpret_cast<window>(msgwnd);
|
||||
|
||||
draw_invoker(&drawer::mouse_up, msgwnd, arg, &context);
|
||||
brock.wd_manager().do_lazy_refresh(msgwnd, false);
|
||||
wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
}
|
||||
pressed_wd_space = nullptr;
|
||||
}
|
||||
@@ -1544,12 +1557,12 @@ namespace detail
|
||||
brock.erase_menu(false);
|
||||
brock.delay_restore(3); //Restores if delay_restore not decleared
|
||||
}
|
||||
brock.wd_manager().destroy(msgwnd);
|
||||
wd_manager.destroy(msgwnd);
|
||||
nana::detail::platform_spec::instance().release_window_icon(msgwnd->root);
|
||||
break;
|
||||
case WM_NCDESTROY:
|
||||
brock.manage_form_loader(msgwnd, false);
|
||||
brock.wd_manager().destroy_handle(msgwnd);
|
||||
wd_manager.destroy_handle(msgwnd);
|
||||
|
||||
if(--context.window_count <= 0)
|
||||
{
|
||||
@@ -1561,7 +1574,7 @@ namespace detail
|
||||
def_window_proc = true;
|
||||
}
|
||||
|
||||
root_runtime = brock.wd_manager().root_runtime(native_window);
|
||||
root_runtime = wd_manager.root_runtime(native_window);
|
||||
if(root_runtime)
|
||||
{
|
||||
root_runtime->condition.pressed = pressed_wd;
|
||||
|
||||
@@ -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
|
||||
@@ -13,6 +13,9 @@
|
||||
#include <nana/detail/platform_spec_selector.hpp>
|
||||
#include <nana/gui/detail/native_window_interface.hpp>
|
||||
#include <nana/gui/screen.hpp>
|
||||
#include <nana/gui/detail/bedrock.hpp>
|
||||
#include <nana/gui/detail/window_manager.hpp>
|
||||
|
||||
#if defined(NANA_WINDOWS)
|
||||
#if defined(STD_THREAD_NOT_SUPPORTED)
|
||||
#include <nana/std_mutex.hpp>
|
||||
@@ -23,8 +26,6 @@
|
||||
#include "../../paint/detail/image_ico.hpp"
|
||||
#elif defined(NANA_X11)
|
||||
#include <nana/system/platform.hpp>
|
||||
#include <nana/gui/detail/bedrock.hpp>
|
||||
#include <nana/gui/detail/window_manager.hpp>
|
||||
#endif
|
||||
|
||||
namespace nana{
|
||||
@@ -131,9 +132,13 @@ namespace nana{
|
||||
}
|
||||
}
|
||||
if (async)
|
||||
{
|
||||
::ShowWindowAsync(wd, cmd);
|
||||
else
|
||||
::ShowWindow(wd, cmd);
|
||||
return;
|
||||
}
|
||||
|
||||
internal_revert_guard revert;
|
||||
::ShowWindow(wd, cmd);
|
||||
}
|
||||
#elif defined(NANA_X11)
|
||||
namespace restrict
|
||||
@@ -143,6 +148,33 @@ namespace nana{
|
||||
#endif
|
||||
|
||||
//struct native_interface
|
||||
void native_interface::affinity_execute(native_window_type native_handle, const std::function<void()>& fn)
|
||||
{
|
||||
if (!fn)
|
||||
return;
|
||||
|
||||
#if defined(NANA_WINDOWS)
|
||||
auto mswin = reinterpret_cast<HWND>(native_handle);
|
||||
if (::IsWindow(mswin))
|
||||
{
|
||||
if (::GetCurrentThreadId() != ::GetWindowThreadProcessId(mswin, nullptr))
|
||||
{
|
||||
detail::messages::arg_affinity_execute arg;
|
||||
arg.function_ptr = &fn;
|
||||
|
||||
internal_revert_guard revert;
|
||||
::SendMessage(mswin, detail::messages::affinity_execute, reinterpret_cast<WPARAM>(&arg), 0);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fn();
|
||||
#else
|
||||
fn();
|
||||
#endif
|
||||
}
|
||||
|
||||
nana::size native_interface::primary_monitor_size()
|
||||
{
|
||||
#if defined(NANA_WINDOWS)
|
||||
@@ -173,6 +205,8 @@ namespace nana{
|
||||
mi.rcWork.right - mi.rcWork.left, mi.rcWork.bottom - mi.rcWork.top);
|
||||
}
|
||||
}
|
||||
#else
|
||||
static_cast<void>(pos); //eliminate unused parameter compiler warning.
|
||||
#endif
|
||||
return rectangle{ primary_monitor_size() };
|
||||
}
|
||||
@@ -547,6 +581,8 @@ namespace nana{
|
||||
activate_window(reinterpret_cast<native_window_type>(
|
||||
::GetWindow(reinterpret_cast<HWND>(wd), GW_OWNER)
|
||||
));
|
||||
#else
|
||||
static_cast<void>(wd); //eliminate unused parameter compiler warning.
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -565,6 +601,8 @@ namespace nana{
|
||||
else
|
||||
::PostMessage(native_wd, nana::detail::messages::async_activate, 0, 0);
|
||||
}
|
||||
#else
|
||||
static_cast<void>(wd); //eliminate unused parameter compiler warning.
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -640,6 +678,7 @@ namespace nana{
|
||||
|
||||
::XFlush(disp);
|
||||
}
|
||||
static_cast<void>(active); //eliminate unused parameter compiler warning.
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -715,6 +754,7 @@ namespace nana{
|
||||
#if defined(NANA_WINDOWS)
|
||||
::InvalidateRect(reinterpret_cast<HWND>(wd), nullptr, true);
|
||||
#elif defined(NANA_X11)
|
||||
static_cast<void>(wd); //eliminate unused parameter compiler warning.
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -963,6 +1003,7 @@ namespace nana{
|
||||
::SetWindowPos(native_wd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
|
||||
::AttachThreadInput(::GetCurrentThreadId(), fg_tid, FALSE);
|
||||
#else
|
||||
static_cast<void>(activated); //eliminate unused parameter compiler warning.
|
||||
set_window_z_order(wd, nullptr, z_order_action::top);
|
||||
#endif
|
||||
}
|
||||
@@ -1110,11 +1151,18 @@ namespace nana{
|
||||
|
||||
auto native_interface::window_caption(native_window_type wd) -> native_string_type
|
||||
{
|
||||
native_string_type str;
|
||||
|
||||
#if defined(NANA_WINDOWS)
|
||||
auto & lock = bedrock::instance().wd_manager().internal_lock();
|
||||
bool is_current_thread = (::GetCurrentThreadId() == ::GetWindowThreadProcessId(reinterpret_cast<HWND>(wd), nullptr));
|
||||
|
||||
if (!is_current_thread)
|
||||
lock.revert();
|
||||
|
||||
int length = ::GetWindowTextLength(reinterpret_cast<HWND>(wd));
|
||||
if(length > 0)
|
||||
{
|
||||
native_string_type str;
|
||||
//One for NULL terminator which GetWindowText will write.
|
||||
str.resize(length+1);
|
||||
|
||||
@@ -1122,9 +1170,11 @@ namespace nana{
|
||||
|
||||
//Remove the null terminator writtien by GetWindowText
|
||||
str.resize(length);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
if (!is_current_thread)
|
||||
lock.forward();
|
||||
|
||||
#elif defined(NANA_X11)
|
||||
nana::detail::platform_scope_guard psg;
|
||||
::XTextProperty txtpro;
|
||||
@@ -1136,14 +1186,13 @@ namespace nana{
|
||||
{
|
||||
if(size > 1)
|
||||
{
|
||||
std::string text = *strlist;
|
||||
str = *strlist;
|
||||
::XFreeStringList(strlist);
|
||||
return text;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return native_string_type();
|
||||
return str;
|
||||
}
|
||||
|
||||
void native_interface::capture_window(native_window_type wd, bool cap)
|
||||
@@ -1305,7 +1354,10 @@ namespace nana{
|
||||
if(::GetCurrentThreadId() != ::GetWindowThreadProcessId(reinterpret_cast<HWND>(wd), nullptr))
|
||||
::PostMessage(reinterpret_cast<HWND>(wd), nana::detail::messages::async_set_focus, 0, 0);
|
||||
else
|
||||
{
|
||||
internal_revert_guard revert;
|
||||
::SetFocus(reinterpret_cast<HWND>(wd));
|
||||
}
|
||||
}
|
||||
#elif defined(NANA_X11)
|
||||
nana::detail::platform_scope_guard lock;
|
||||
@@ -1414,6 +1466,11 @@ namespace nana{
|
||||
if(static_cast<unsigned>(y) > sz.height + ext_height)
|
||||
sz.height = static_cast<unsigned>(y);
|
||||
}
|
||||
#else
|
||||
//eliminate unused parameter compiler warning.
|
||||
static_cast<void>(ext_width);
|
||||
static_cast<void>(ext_height);
|
||||
static_cast<void>(true_for_max);
|
||||
#endif
|
||||
return sz;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace nana
|
||||
//get the root graphics
|
||||
auto& graph = *(wd->root_graph);
|
||||
|
||||
if (wd->other.category != category::lite_widget_tag::value)
|
||||
if (category::flags::lite_widget != wd->other.category)
|
||||
graph.bitblt(vr, wd->drawer.graphics, nana::point(vr.x - wd->pos_root.x, vr.y - wd->pos_root.y));
|
||||
|
||||
_m_paste_children(wd, is_child_refreshed, have_refreshed, vr, graph, nana::point());
|
||||
@@ -66,7 +66,7 @@ namespace nana
|
||||
nana::point p_src;
|
||||
for (auto & el : blocks)
|
||||
{
|
||||
if (el.window->other.category == category::frame_tag::value)
|
||||
if (category::flags::frame == el.window->other.category)
|
||||
{
|
||||
native_window_type container = el.window->other.attribute.frame->container;
|
||||
native_interface::refresh_window(container);
|
||||
@@ -95,9 +95,9 @@ namespace nana
|
||||
}
|
||||
|
||||
//read_visual_rectangle
|
||||
//@brief: Reads the visual rectangle of a window, the visual rectangle's reference frame is to root widget,
|
||||
// the visual rectangle is a rectangular block that a window should be displayed on screen.
|
||||
// The result is a rectangle that is a visible area for its ancesters.
|
||||
///@brief Reads the visual rectangle of a window, the visual rectangle's reference frame is to root widget,
|
||||
/// the visual rectangle is a rectangular block that a window should be displayed on screen.
|
||||
/// The result is a rectangle that is a visible area for its ancesters.
|
||||
bool window_layout::read_visual_rectangle(core_window_t* wd, nana::rectangle& visual)
|
||||
{
|
||||
if (! wd->displayed()) return false;
|
||||
@@ -158,7 +158,7 @@ namespace nana
|
||||
|
||||
bool window_layout::enable_effects_bground(core_window_t * wd, bool enabled)
|
||||
{
|
||||
if (wd->other.category != category::widget_tag::value)
|
||||
if (category::flags::widget != wd->other.category)
|
||||
return false;
|
||||
|
||||
if (false == enabled)
|
||||
@@ -199,11 +199,11 @@ namespace nana
|
||||
nana::point rpos{ wd->pos_root };
|
||||
auto & glass_buffer = wd->other.glass_buffer;
|
||||
|
||||
if (wd->parent->other.category == category::lite_widget_tag::value)
|
||||
if (category::flags::lite_widget == wd->parent->other.category)
|
||||
{
|
||||
std::vector<core_window_t*> layers;
|
||||
core_window_t * beg = wd->parent;
|
||||
while (beg && (beg->other.category == category::lite_widget_tag::value))
|
||||
while (beg && (category::flags::lite_widget == beg->other.category))
|
||||
{
|
||||
layers.push_back(beg);
|
||||
beg = beg->parent;
|
||||
@@ -229,7 +229,7 @@ namespace nana
|
||||
nana::rectangle ovlp;
|
||||
if (child->visible && overlap(r, rectangle(child->pos_owner, child->dimension), ovlp))
|
||||
{
|
||||
if (child->other.category != category::lite_widget_tag::value)
|
||||
if (category::flags::lite_widget != child->other.category)
|
||||
glass_buffer.bitblt(nana::rectangle(ovlp.x - pre->pos_owner.x, ovlp.y - pre->pos_owner.y, ovlp.width, ovlp.height), child->drawer.graphics, nana::point(ovlp.x - child->pos_owner.x, ovlp.y - child->pos_owner.y));
|
||||
ovlp.x += pre->pos_root.x;
|
||||
ovlp.y += pre->pos_root.y;
|
||||
@@ -250,7 +250,7 @@ namespace nana
|
||||
nana::rectangle ovlp;
|
||||
if (child->visible && overlap(r_of_wd, rectangle{ child->pos_owner, child->dimension }, ovlp))
|
||||
{
|
||||
if (child->other.category != category::lite_widget_tag::value)
|
||||
if (category::flags::lite_widget != child->other.category)
|
||||
glass_buffer.bitblt(nana::rectangle{ ovlp.x - wd->pos_owner.x, ovlp.y - wd->pos_owner.y, ovlp.width, ovlp.height }, child->drawer.graphics, nana::point(ovlp.x - child->pos_owner.x, ovlp.y - child->pos_owner.y));
|
||||
|
||||
ovlp.x += wd->pos_root.x;
|
||||
@@ -285,7 +285,7 @@ namespace nana
|
||||
if (overlap(nana::rectangle{ child->pos_root, child->dimension }, parent_rect, rect))
|
||||
{
|
||||
bool have_child_refreshed = false;
|
||||
if (child->other.category != category::lite_widget_tag::value)
|
||||
if (category::flags::lite_widget != child->other.category)
|
||||
{
|
||||
if (is_child_refreshed && (false == child->flags.refreshing))
|
||||
{
|
||||
@@ -357,7 +357,7 @@ namespace nana
|
||||
|
||||
//_m_notify_glasses
|
||||
//@brief: Notify the glass windows that are overlapped with the specified vis_rect
|
||||
void window_layout::_m_notify_glasses(core_window_t* const sigwd, const nana::rectangle& r_visual)
|
||||
void window_layout::_m_notify_glasses(core_window_t* const sigwd, const nana::rectangle& /*r_visual*/)
|
||||
{
|
||||
typedef category::flags cat_flags;
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ namespace detail
|
||||
wd->bind_native_window(result.native_handle, result.width, result.height, result.extra_width, result.extra_height, value->root_graph);
|
||||
impl_->wd_register.insert(wd, wd->thread_id);
|
||||
|
||||
if (owner && owner->other.category == category::frame_tag::value)
|
||||
if (owner && (category::flags::frame == owner->other.category))
|
||||
insert_frame(owner, wd);
|
||||
|
||||
bedrock::inc_window(wd->thread_id);
|
||||
@@ -343,7 +343,7 @@ namespace detail
|
||||
{
|
||||
//Thread-Safe Required!
|
||||
std::lock_guard<decltype(mutex_)> lock(mutex_);
|
||||
if(frame->other.category == category::frame_tag::value)
|
||||
if(category::flags::frame == frame->other.category)
|
||||
frame->other.attribute.frame->attach.push_back(wd);
|
||||
return true;
|
||||
}
|
||||
@@ -356,9 +356,9 @@ namespace detail
|
||||
{
|
||||
//Thread-Safe Required!
|
||||
std::lock_guard<decltype(mutex_)> lock(mutex_);
|
||||
if(frame->other.category == category::frame_tag::value)
|
||||
if(category::flags::frame == frame->other.category)
|
||||
{
|
||||
if (impl_->wd_register.available(wd) && wd->other.category == category::root_tag::value && wd->root != frame->root)
|
||||
if (impl_->wd_register.available(wd) && (category::flags::root == wd->other.category) && wd->root != frame->root)
|
||||
{
|
||||
frame->other.attribute.frame->attach.push_back(wd->root);
|
||||
return true;
|
||||
@@ -461,7 +461,7 @@ namespace detail
|
||||
std::lock_guard<decltype(mutex_)> lock(mutex_);
|
||||
if (impl_->wd_register.available(wd) == false) return;
|
||||
|
||||
if((wd->other.category == category::root_tag::value) || (wd->other.category != category::frame_tag::value))
|
||||
if((category::flags::root == wd->other.category) || (category::flags::frame != wd->other.category))
|
||||
{
|
||||
impl_->misc_register.erase(wd->root);
|
||||
impl_->wd_register.remove(wd);
|
||||
@@ -481,7 +481,7 @@ namespace detail
|
||||
std::lock_guard<decltype(mutex_)> lock(mutex_);
|
||||
if (impl_->wd_register.available(wd))
|
||||
{
|
||||
if(wd->other.category == category::root_tag::value)
|
||||
if(category::flags::root == wd->other.category)
|
||||
native_interface::window_icon(wd->root, small_icon, big_icon);
|
||||
}
|
||||
}
|
||||
@@ -501,9 +501,9 @@ namespace detail
|
||||
native_window_type nv = nullptr;
|
||||
switch(wd->other.category)
|
||||
{
|
||||
case category::root_tag::value:
|
||||
case category::flags::root:
|
||||
nv = wd->root; break;
|
||||
case category::frame_tag::value:
|
||||
case category::flags::frame:
|
||||
nv = wd->other.attribute.frame->container; break;
|
||||
default: //category::widget_tag, category::lite_widget_tag
|
||||
break;
|
||||
@@ -700,7 +700,7 @@ namespace detail
|
||||
|
||||
wd->dimension = sz;
|
||||
|
||||
if(category::lite_widget_tag::value != wd->other.category)
|
||||
if(category::flags::lite_widget != wd->other.category)
|
||||
{
|
||||
bool graph_state = wd->drawer.graphics.empty();
|
||||
wd->drawer.graphics.make(sz);
|
||||
@@ -711,13 +711,13 @@ namespace detail
|
||||
if(graph_state != wd->drawer.graphics.empty())
|
||||
wd->drawer.typeface_changed();
|
||||
|
||||
if(category::root_tag::value == wd->other.category)
|
||||
if(category::flags::root == wd->other.category)
|
||||
{
|
||||
wd->root_graph->make(sz);
|
||||
if(false == passive)
|
||||
native_interface::window_size(wd->root, sz + nana::size(wd->extra_width, wd->extra_height));
|
||||
}
|
||||
else if(category::frame_tag::value == wd->other.category)
|
||||
else if(category::flags::frame == wd->other.category)
|
||||
{
|
||||
native_interface::window_size(wd->other.attribute.frame->container, sz);
|
||||
for(auto natwd : wd->other.attribute.frame->attach)
|
||||
@@ -828,7 +828,7 @@ namespace detail
|
||||
//do_lazy_refresh
|
||||
//@brief: defined a behavior of flush the screen
|
||||
//@return: it returns true if the wnd is available
|
||||
bool window_manager::do_lazy_refresh(core_window_t* wd, bool force_copy_to_screen)
|
||||
bool window_manager::do_lazy_refresh(core_window_t* wd, bool force_copy_to_screen, bool refresh_tree)
|
||||
{
|
||||
//Thread-Safe Required!
|
||||
std::lock_guard<decltype(mutex_)> lock(mutex_);
|
||||
@@ -843,8 +843,11 @@ namespace detail
|
||||
{
|
||||
if ((wd->other.upd_state == core_window_t::update_state::refresh) || force_copy_to_screen)
|
||||
{
|
||||
window_layer::paint(wd, false, false);
|
||||
window_layer::paint(wd, false, refresh_tree);
|
||||
this->map(wd, force_copy_to_screen);
|
||||
|
||||
wd->drawer.graphics.save_as_file("d:\\button.bmp");
|
||||
wd->root_graph->save_as_file("d:\\button_root.bmp");
|
||||
}
|
||||
else if (effects::edge_nimbus::none != wd->effect.edge_nimbus)
|
||||
{
|
||||
@@ -852,7 +855,7 @@ namespace detail
|
||||
}
|
||||
}
|
||||
else
|
||||
window_layer::paint(wd, true, false); //only refreshing if it has an invisible parent
|
||||
window_layer::paint(wd, true, refresh_tree); //only refreshing if it has an invisible parent
|
||||
}
|
||||
wd->other.upd_state = core_window_t::update_state::none;
|
||||
return true;
|
||||
@@ -1362,7 +1365,7 @@ namespace detail
|
||||
root_attr->menubar = nullptr;
|
||||
}
|
||||
|
||||
if (wd->other.category == category::root_tag::value)
|
||||
if (wd->other.category == category::flags::root)
|
||||
{
|
||||
root_runtime(wd->root)->shortkeys.clear();
|
||||
wd->other.attribute.root->focus = nullptr;
|
||||
@@ -1442,7 +1445,7 @@ namespace detail
|
||||
}
|
||||
}
|
||||
|
||||
if (wd->other.category == category::frame_tag::value)
|
||||
if (category::flags::frame == wd->other.category)
|
||||
{
|
||||
//remove the frame handle from the WM frames manager.
|
||||
utl::erase(root_attr->frames, wd);
|
||||
@@ -1599,7 +1602,7 @@ namespace detail
|
||||
for(auto i = wd->children.rbegin(); i != wd->children.rend(); ++i)
|
||||
{
|
||||
core_window_t* child = *i;
|
||||
if((child->other.category != category::root_tag::value) && _m_effective(child, pos))
|
||||
if((child->other.category != category::flags::root) && _m_effective(child, pos))
|
||||
{
|
||||
child = _m_find(child, pos);
|
||||
if(child)
|
||||
|
||||
Reference in New Issue
Block a user