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

This commit is contained in:
qPCR4vir
2016-03-18 22:25:43 +01:00
66 changed files with 280 additions and 107 deletions

View File

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

View File

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

View File

@@ -312,7 +312,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);
@@ -344,7 +344,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;
}
@@ -357,9 +357,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;
@@ -399,7 +399,7 @@ namespace detail
if (wd->flags.destroying)
return;
if(wd->other.category == category::root_tag::value)
if(category::flags::root == wd->other.category)
{
auto &brock = bedrock::instance();
arg_unload arg;
@@ -464,7 +464,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);
@@ -484,7 +484,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);
}
}
@@ -504,9 +504,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;
@@ -703,7 +703,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);
@@ -714,13 +714,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)
@@ -850,6 +850,9 @@ namespace detail
{
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)
{
@@ -1379,7 +1382,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;
@@ -1459,7 +1462,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);
@@ -1565,7 +1568,7 @@ namespace detail
wd->drawer.detached();
wd->widget_notifier->destroy();
if(wd->other.category == category::frame_tag::value)
if(category::flags::frame == wd->other.category)
{
//The frame widget does not have an owner, and close their element windows without activating owner.
//close the frame container window, it's a native window.
@@ -1616,7 +1619,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)

View File

@@ -15,6 +15,7 @@
#include <cmath>
#include <map>
#include <deque>
#include <nana/push_ignore_diagnostic>
#include <nana/deploy.hpp>
#include <nana/gui/place.hpp>
#include <nana/gui/programming_interface.hpp>
@@ -2851,3 +2852,5 @@ namespace nana
}
//end class place
}//end namespace nana
#include <nana/pop_ignore_diagnostic>