Merge branch 'hotfix-1.3' into develop

This commit is contained in:
Jinhao
2016-04-18 15:16:03 +08:00
116 changed files with 2343 additions and 1004 deletions

View File

@@ -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)