move lazy_refresh() from namespace API to API::dev

This commit is contained in:
Jinhao
2016-04-17 17:46:19 +08:00
parent afa253f924
commit 42990b8670
19 changed files with 121 additions and 120 deletions

View File

@@ -88,10 +88,20 @@ namespace API
void set_menubar(window wd, bool attach);
void enable_space_click(window, bool enable);
/// Refreshs a widget surface
/*
* This function will copy the drawer surface into system window after the event process finished.
*/
void lazy_refresh();
}//end namespace dev
widget* get_widget(window);
/// Returns the widget pointer of the specified window.
/*
* @param window_handle A handle to a window owning the widget.
* @return A widget pointer.
*/
widget* get_widget(window window_handle);
namespace detail
{
@@ -258,17 +268,6 @@ namespace API
void window_enabled(window, bool);
bool window_enabled(window);
/** @brief A widget drawer draws the widget surface in answering an event.
*
* This function will tell the drawer to copy the graphics into window after event answering.
* Tells Nana.GUI to copy the buffer of event window to screen after the event is processed.
* This function only works for a drawer_trigger, when a drawer_trigger receives an event,
* after drawing, a drawer_trigger should call lazy_refresh to tell the Nana.GUI to refresh
* the window to the screen after the event process finished.
*/
void lazy_refresh();
/// Refresh the window and display it immediately calling the refresh function of its drawer_trigger.
/*
* The drawer::refresh() will be called. If the currently state is lazy_refrsh, the window is delayed to update the graphics until an event is finished.
@@ -296,6 +295,7 @@ namespace API
/// Sets the keyboard focus for a specified window.
void focus_window(window);
/// Returns a window which has grabbed the mouse input.
window capture_window();
/// Enables a window to grab the mouse input.
@@ -311,7 +311,10 @@ namespace API
*/
void release_capture(window window_handle);
void modal_window(window); ///< Blocks the routine til the specified window is closed.
/// Blocks the execution and other windows' messages until the specified window is closed.
void modal_window(window);
/// Blocks the execution until the specified window is closesd.
void wait_for(window);
color fgcolor(window);

View File

@@ -205,14 +205,14 @@ namespace nana
void resized(graph_reference graph, const ::nana::arg_resized&) override
{
drawer_.draw(graph, metrics_.what);
API::lazy_refresh();
API::dev::lazy_refresh();
}
void mouse_enter(graph_reference graph, const ::nana::arg_mouse& arg) override
{
metrics_.what = drawer_.what(graph, arg.pos);
drawer_.draw(graph, metrics_.what);
API::lazy_refresh();
API::dev::lazy_refresh();
}
void mouse_move(graph_reference graph, const ::nana::arg_mouse& arg) override
@@ -238,7 +238,7 @@ namespace nana
if (redraw)
{
drawer_.draw(graph, metrics_.what);
API::lazy_refresh();
API::dev::lazy_refresh();
}
}
@@ -278,7 +278,7 @@ namespace nana
break;
}
drawer_.draw(graph, metrics_.what);
API::lazy_refresh();
API::dev::lazy_refresh();
}
}
@@ -291,7 +291,7 @@ namespace nana
metrics_.pressed = false;
metrics_.what = drawer_.what(graph, arg.pos);
drawer_.draw(graph, metrics_.what);
API::lazy_refresh();
API::dev::lazy_refresh();
}
void mouse_leave(graph_reference graph, const arg_mouse&) override
@@ -300,7 +300,7 @@ namespace nana
metrics_.what = buttons::none;
drawer_.draw(graph, buttons::none);
API::lazy_refresh();
API::dev::lazy_refresh();
}
void mouse_wheel(graph_reference graph, const arg_wheel& arg) override
@@ -308,7 +308,7 @@ namespace nana
if (make_step(arg.upwards == false, 3))
{
drawer_.draw(graph, metrics_.what);
API::lazy_refresh();
API::dev::lazy_refresh();
}
}
private: