[project @ 2006-02-07 16:32:47 by adrianl]

Added function to bring window to front

svn path=/import/netsurf/; revision=2062
This commit is contained in:
Adrian Lees 2006-02-07 16:32:47 +00:00
parent 57c86c8c0e
commit bdbe7e8e51
2 changed files with 30 additions and 0 deletions

View File

@ -849,3 +849,32 @@ bool ro_gui_wimp_check_window_furniture(wimp_w w, wimp_window_flags mask) {
}
return state.flags & mask;
}
/**
* Open/move a window to the front of the window stack.
*/
bool ro_gui_open_window_at_front(wimp_w w) {
wimp_window_state state;
os_error *error;
state.w = w;
error = xwimp_get_window_state(&state);
if (error) {
LOG(("xwimp_get_window_state: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
return false;
}
state.next = wimp_TOP;
error = xwimp_open_window((wimp_open*)&state);
if (error) {
LOG(("xwimp_open_window: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
return false;
}
return true;
}

View File

@ -59,5 +59,6 @@ void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, os_colour user_colour
void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask,
wimp_window_flags xor_mask);
bool ro_gui_wimp_check_window_furniture(wimp_w w, wimp_window_flags mask);
bool ro_gui_open_window_at_front(wimp_w w);
#endif