Merge branch 'feature-draw-through' into develop

This commit is contained in:
cnjinhao
2015-02-02 19:17:44 +08:00
10 changed files with 101 additions and 10 deletions

View File

@@ -354,6 +354,11 @@ namespace API
return (restrict::window_manager.available(reinterpret_cast<restrict::core_window_t*>(wd)) == false);
}
bool is_window(window wd)
{
return restrict::window_manager.available(reinterpret_cast<restrict::core_window_t*>(wd));
}
void enable_dropfiles(window wd, bool enb)
{
internal_scope_guard lock;
@@ -569,6 +574,27 @@ namespace API
return false;
}
void draw_through(window wd, std::function<void()> draw_fn)
{
auto iwd = reinterpret_cast<restrict::core_window_t*>(wd);
internal_scope_guard lock;
if (!restrict::bedrock.wd_manager.available(iwd))
throw std::invalid_argument("draw_through: invalid window parameter");
if (::nana::category::flags::root != iwd->other.category)
throw std::invalid_argument("draw_through: the window is not a root widget");
iwd->other.attribute.root->draw_through.swap(draw_fn);
}
void map_through_widgets(window wd, native_drawable_type drawable)
{
auto iwd = reinterpret_cast<::nana::detail::basic_window*>(wd);
internal_scope_guard lock;
if (restrict::bedrock.wd_manager.available(iwd) && iwd->is_draw_through() )
restrict::bedrock.map_through_widgets(iwd, drawable);
}
nana::size window_size(window wd)
{
nana::rectangle r;