// create_child_window window create_child_window(int x, int y, int cx, int cy, window const& parent) { // create impl_type boost::shared_ptr<window::impl_type> pimpl(new window::impl_type()); // create window pimpl->win = khaos::create_child_window(x, y, cx, cy, parent.khaos_window()); // create/set event handler pimpl->win->handler = detail::event_handler(window(pimpl), pimpl); return window(pimpl); }
// handle_event bool handle_event(window const& win, int et, void * ei) { bool result = false; boost::shared_ptr<window::impl_type> pimpl = win.pimpl.lock(); if (et == khaos::resize::value && win.khaos_window()->is_toplevel) { point oldw = khaos::detail::resize_old_width(ei); reposition_layout(win, oldw.x, oldw.y); } if (pimpl->main) result |= pimpl->main(et, ei); BOOST_FOREACH(iris::event_handler const& handler, pimpl->handlers) { result |= handler(et, ei); } return result; }
boost::iterator_range<child_iterator> children_of(window const& win) { khaos::window * w = win.khaos_window(); return boost::iterator_range<child_iterator>(w->children.begin(), w->children.end()); }
// resize_window void resize_window(window const& win, int cx, int cy) { khaos::resize_window(win.khaos_window(), cx, cy); }