diff --git a/src/netxs/apps.hpp b/src/netxs/apps.hpp index ff9ff46a90..2cffd78247 100644 --- a/src/netxs/apps.hpp +++ b/src/netxs/apps.hpp @@ -125,7 +125,7 @@ namespace netxs::app::shared boss.LISTEN(tier::release, e2::form::upon::vtree::attached, parent) { auto title = ansi::add("Empty Instance \nid: ", parent->id); - boss.RISEUP(tier::preview, e2::form::prop::ui::header, title); + boss.base::template riseup(e2::form::prop::ui::header, title); }; }); auto object = window->attach(ui::mock::ctor()) @@ -285,7 +285,7 @@ namespace netxs::app::shared //boss.LISTEN(tier::release, hids::events::mouse::button::dblclick::left, gear) //{ // auto outer = e2::config::plugins::sizer::outer.param(); - // boss.RISEUP(tier::request, e2::config::plugins::sizer::outer, outer); + // boss.base::template riseup(e2::config::plugins::sizer::outer, outer); // auto actual_rect = rect{ dot_00, boss.base::size() } + outer; // if (actual_rect.hittest(gear.coord)) // { @@ -320,14 +320,14 @@ namespace netxs::app::shared if (cmd.starts_with("@")) { static auto title_map = std::unordered_map{}; - boss.RISEUP(tier::request, e2::form::prop::ui::header, title, ()); + auto title = boss.base::template riseup(e2::form::prop::ui::header); title += std::to_string(++title_map[title]); - boss.RISEUP(tier::preview, e2::form::prop::ui::header, title); + boss.base::template riseup(e2::form::prop::ui::header, title); } - boss.RISEUP(tier::release, e2::config::plugins::sizer::outer, outer, (dent{ 2, 2, 1, 1 })); - boss.RISEUP(tier::release, e2::config::plugins::sizer::inner, inner, (dent{ -4,-4,-2,-2 })); - boss.RISEUP(tier::release, e2::config::plugins::align, faux); - boss.RISEUP(tier::preview, e2::form::prop::zorder, zpos::backmost); + boss.base::template riseup(e2::config::plugins::sizer::outer, dent{ 2, 2, 1, 1 }); + boss.base::template riseup(e2::config::plugins::sizer::inner, dent{ -4,-4,-2,-2 }); + boss.base::template riseup(e2::config::plugins::align, faux); + boss.base::template riseup(e2::form::prop::zorder, zpos::backmost); parent.LISTEN(tier::release, hids::events::mouse::button::click::right, gear) { auto area = boss.base::area() + dent{ 2, 2, 1, 1 }; @@ -369,7 +369,7 @@ namespace netxs::app::shared }; boss.LISTEN(tier::preview, e2::config::plugins::sizer::alive, state) { - boss.RISEUP(tier::release, e2::config::plugins::sizer::alive, state); + boss.base::template riseup(e2::config::plugins::sizer::alive, state); }; boss.LISTEN(tier::anycast, e2::form::proceed::quit::any, fast) { @@ -425,7 +425,7 @@ namespace netxs::app::shared auto& term_inst = *inst; boss.LISTEN(tier::preview, e2::config::plugins::sizer::alive, state) { - boss.RISEUP(tier::release, e2::config::plugins::sizer::alive, state); + boss.base::template riseup(e2::config::plugins::sizer::alive, state); }; boss.LISTEN(tier::anycast, e2::form::proceed::quit::any, fast) { @@ -470,7 +470,7 @@ namespace netxs::app::shared if (order) pro::focus::pass(t, d); else pro::focus::pass(d, t); boss.roll(); - boss.back()->RISEUP(tier::preview, e2::form::prop::ui::footer, footer, ()); + boss.back()->base::template riseup(e2::form::prop::ui::footer); boss.back()->reflow(); boss.back()->deface(); order = !order; @@ -482,7 +482,7 @@ namespace netxs::app::shared if (--count == 0) if (auto parent = boss.parent()) { - parent->RISEUP(tier::release, e2::form::proceed::quit::one, fast); + parent->base::template riseup(e2::form::proceed::quit::one, fast); } }; }); @@ -522,15 +522,15 @@ namespace netxs::app::shared { boss.LISTEN(tier::anycast, e2::form::proceed::quit::any, fast) { - boss.RISEUP(tier::release, e2::form::proceed::quit::one, fast); + boss.base::template riseup(e2::form::proceed::quit::one, fast); }; boss.LISTEN(tier::anycast, e2::form::upon::started, window_ptr2) { - boss.RISEUP(tier::request, e2::form::prop::window::instance, window_ptr, ()); + auto window_ptr = boss.base::template riseup(e2::form::prop::window::instance); //todo too hacky if (auto form_ptr = std::dynamic_pointer_cast(window_ptr)) { - form_ptr->plugins().live = faux; + form_ptr->template plugins().live = faux; } }; }); @@ -549,7 +549,7 @@ namespace netxs::app::shared boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear) { auto backup = boss.This(); - boss.RISEUP(tier::release, e2::form::proceed::quit::one, true); + boss.base::template riseup(e2::form::proceed::quit::one, true); gear.dismiss(true); }; }}, diff --git a/src/netxs/apps/calc.hpp b/src/netxs/apps/calc.hpp index c9686014ab..adfab4f001 100644 --- a/src/netxs/apps/calc.hpp +++ b/src/netxs/apps/calc.hpp @@ -342,13 +342,13 @@ namespace netxs::app::calc //boss.keybd.accept(true); boss.LISTEN(tier::anycast, e2::form::proceed::quit::any, fast) { - boss.RISEUP(tier::release, e2::form::proceed::quit::one, fast); + boss.base::template riseup(e2::form::proceed::quit::one, fast); }; boss.LISTEN(tier::release, e2::form::upon::vtree::attached, parent) { static auto i = 0; i++; auto title = ansi::jet(bias::right).add("Spreadsheet\n ~/Untitled ", i, ".ods"); - boss.RISEUP(tier::preview, e2::form::prop::ui::header, title); + boss.base::template riseup(e2::form::prop::ui::header, title); }; }); auto object = window->attach(ui::fork::ctor(axis::Y)) diff --git a/src/netxs/apps/desk.hpp b/src/netxs/apps/desk.hpp index 7aa4b52a82..2767632d39 100644 --- a/src/netxs/apps/desk.hpp +++ b/src/netxs/apps/desk.hpp @@ -88,7 +88,7 @@ namespace netxs::app::desk auto data_src_shadow = ptr::shadow(data_src); auto check_id = [](auto& boss, auto gear_id) { - boss.RISEUP(tier::request, events::ui::id, owner_id, ()); + auto owner_id = boss.base::template riseup(events::ui::id); auto disabled = gear_id && gear_id != owner_id; boss.SIGNAL(tier::release, e2::form::state::disabled, disabled); auto& notes = boss.template plugins(); @@ -124,7 +124,7 @@ namespace netxs::app::desk auto& window = *data_src; if (gear.meta(hids::anyAlt)) // Pull window. { - window.RISEUP(tier::preview, e2::form::layout::expose, area, ()); + window.base::template riseup(e2::form::layout::expose); gear.owner.SIGNAL(tier::request, e2::form::prop::viewport, viewport, ()); window.SIGNAL(tier::preview, e2::form::layout::appear, viewport.center()); // Pull window. if (window.hidden) // Restore if minimized. @@ -154,7 +154,7 @@ namespace netxs::app::desk } else // Expose and set group focus. { - window.RISEUP(tier::preview, e2::form::layout::expose, area, ()); + window.base::template riseup(e2::form::layout::expose); if (window.hidden) // Restore if minimized. { window.SIGNAL(tier::release, e2::form::size::minimize, gear); @@ -169,7 +169,7 @@ namespace netxs::app::desk } else // Set unique focus. { - window.RISEUP(tier::preview, e2::form::layout::expose, area, ()); + window.base::template riseup(e2::form::layout::expose); if (window.hidden) // Restore if minimized. { window.SIGNAL(tier::release, e2::form::size::minimize, gear); @@ -210,7 +210,7 @@ namespace netxs::app::desk item_area->LISTEN(tier::release, e2::form::state::mouse, hover, -) { if (disabled) return; - //boss.RISEUP(tier::request, events::ui::toggle, unfolded, ()); + //auto unfolded = boss.base::template riseup(events::ui::toggle); //auto hidden = !unfolded || !hover; //auto folded = item_area_inst.base::size().x <= boss.base::size().x * 2; //auto hidden = folded || !hover; @@ -261,11 +261,11 @@ namespace netxs::app::desk { boss.LISTEN(tier::release, e2::form::upon::vtree::attached, parent) { - boss.RISEUP(tier::request, e2::data::changed, current_default, ()); + auto current_default = boss.base::template riseup(e2::data::changed); boss.SIGNAL(tier::anycast, events::ui::selected, current_default); //todo combine anycasts (update on user disconnect) - boss.RISEUP(tier::request, events::ui::toggle, state, ()); - boss.SIGNAL(tier::anycast, events::ui::recalc, state); + auto state = boss.base::template riseup(events::ui::toggle); + boss.base::template riseup(events::ui::recalc, state); }; }); @@ -273,7 +273,7 @@ namespace netxs::app::desk " LeftClick to start the application instance \n" " RightClick to set it as default \n" " LeftDrag to move desktop viewport "}; - data_src->RISEUP(tier::request, desk::events::menu, conf_list_ptr, ()); + auto conf_list_ptr = data_src->base::template riseup(desk::events::menu); if (!conf_list_ptr || !apps_map_ptr) return apps; auto& conf_list = *conf_list_ptr; auto& apps_map = *apps_map_ptr; @@ -338,7 +338,7 @@ namespace netxs::app::desk gear.slot.coor = viewport.coor + offset + viewport.size * 1 / 32 + dot_11; gear.slot.size = viewport.size * 3 / 4; gear.slot_forced = faux; - boss.RISEUP(tier::request, e2::form::proceed::createby, gear); + boss.base::template riseup(e2::form::proceed::createby, gear); gear.dismiss(true); }; }); @@ -369,7 +369,7 @@ namespace netxs::app::desk { if (!state) { - boss.RISEUP(tier::preview, e2::form::upon::scroll::to_top::v, info, ()); + boss.base::template riseup(e2::form::upon::scroll::to_top::v); } }; }); @@ -447,7 +447,7 @@ namespace netxs::app::desk boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear, -, (infospec)) { infospec.gearid = gear.id; - gear.owner.RISEUP(tier::request, desk::events::exec, infospec); + gear.owner.base::template riseup(desk::events::exec, infospec); gear.dismiss(true); }; }); @@ -610,7 +610,7 @@ namespace netxs::app::desk { usrcfg.win = {}; usrcfg.hid = gear.id; - boss.RISEUP(tier::release, scripting::events::invoke, usrcfg); + boss.base::template riseup(scripting::events::invoke, usrcfg); oneshot->reset(); }; }; @@ -641,7 +641,7 @@ namespace netxs::app::desk }; boss.LISTEN(tier::release, hids::events::mouse::button::click::any, gear) { - boss.RISEUP(tier::preview, events::ui::toggle, !active); + boss.base::template riseup(events::ui::toggle, !active); }; boss.LISTEN(tier::release, e2::form::state::mouse, state) { @@ -654,7 +654,7 @@ namespace netxs::app::desk // Only when mouse leaving. auto toggle = [&](auto state) { - boss.RISEUP(tier::preview, events::ui::toggle, state); + boss.base::template riseup(events::ui::toggle, state); return faux; // One shot call. }; timer.actify(faux, skin::globals().menu_timeout, toggle); @@ -720,7 +720,7 @@ namespace netxs::app::desk { boss.LISTEN(tier::anycast, e2::form::upon::started, parent_ptr) { - boss.RISEUP(tier::request, e2::config::creator, world_ptr, ()); + auto world_ptr = boss.base::template riseup(e2::config::creator); if (world_ptr) { auto apps = boss.attach_element(desk::events::apps, world_ptr, apps_template); @@ -749,7 +749,7 @@ namespace netxs::app::desk boss.base::hidden = userlist_hidden; boss.LISTEN(tier::anycast, e2::form::upon::started, parent_ptr, -, (branch_template)) { - boss.RISEUP(tier::request, e2::config::creator, world_ptr, ()); + auto world_ptr = boss.base::template riseup(e2::config::creator); if (world_ptr) { auto users = boss.attach_element(desk::events::usrs, world_ptr, branch_template); @@ -782,7 +782,7 @@ namespace netxs::app::desk { if (state) { - boss.RISEUP(tier::preview, events::ui::toggle, state); + boss.base::template riseup(events::ui::toggle, state); } }; }); diff --git a/src/netxs/apps/shop.hpp b/src/netxs/apps/shop.hpp index 6a66d2838e..1d5a882a35 100644 --- a/src/netxs/apps/shop.hpp +++ b/src/netxs/apps/shop.hpp @@ -203,7 +203,7 @@ namespace netxs::app::shop //boss.keybd.accept(true); boss.LISTEN(tier::anycast, e2::form::proceed::quit::any, fast) { - boss.RISEUP(tier::release, e2::form::proceed::quit::one, fast); + boss.base::template riseup(e2::form::proceed::quit::one, fast); }; }); auto object = window->attach(ui::fork::ctor(axis::Y)) diff --git a/src/netxs/apps/term.hpp b/src/netxs/apps/term.hpp index 9fee541e7f..84f5f5b6c7 100644 --- a/src/netxs/apps/term.hpp +++ b/src/netxs/apps/term.hpp @@ -346,7 +346,7 @@ namespace netxs::app::terminal { _submit(boss, item, [](auto& boss, auto& /*item*/, auto& gear) { - boss.RISEUP(tier::preview, e2::form::size::enlarge::fullscreen, gear); + boss.base::template riseup(e2::form::size::enlarge::fullscreen, gear); }); } static void TerminalRestart(ui::item& boss, menu::item& item) @@ -876,13 +876,13 @@ namespace netxs::app::terminal // 0 -- maximize (toggle) if (new_size == dot_00) // Toggle fullscreen terminal (only if it is focused by someone). { - boss.RISEUP(tier::request, e2::form::state::keybd::enlist, gates, ()); + auto gates = boss.base::template riseup(e2::form::state::keybd::enlist); if (gates.size()) if (auto gate_ptr = boss.bell::getref(gates.back())) { gate_ptr->SIGNAL(tier::release, e2::form::proceed::onbehalf, [&](auto& gear) { - boss.RISEUP(tier::preview, e2::form::size::enlarge::fullscreen, gear); + boss.base::template riseup(e2::form::size::enlarge::fullscreen, gear); }); } } @@ -894,7 +894,7 @@ namespace netxs::app::terminal boss.base::locked = faux; // Unlock resizing. boss.base::resize(new_size); boss.base::locked = true; // Lock resizing until reflow is complete. - boss.RISEUP(tier::preview, e2::form::layout::swarp, warp); + boss.base::template riseup(e2::form::layout::swarp, warp); } }; boss.LISTEN(tier::release, e2::area, new_area) @@ -1006,7 +1006,7 @@ namespace netxs::app::terminal { if (std::exchange(state, *visible || winsz->y != 1) != state) { - boss.RISEUP(tier::preview, e2::form::prop::ui::cache, state); + boss.base::riseup(e2::form::prop::ui::cache, state); } }); boss.LISTEN(tier::release, e2::form::state::visible, menu_visible, -, (visible, check_state)) diff --git a/src/netxs/apps/test.hpp b/src/netxs/apps/test.hpp index 9ea0445298..38ec67d33e 100644 --- a/src/netxs/apps/test.hpp +++ b/src/netxs/apps/test.hpp @@ -608,7 +608,7 @@ namespace netxs::app::test //boss.keybd.accept(true); boss.LISTEN(tier::anycast, e2::form::proceed::quit::any, fast) { - boss.RISEUP(tier::release, e2::form::proceed::quit::one, fast); + boss.base::template riseup(e2::form::proceed::quit::one, fast); }; }); auto object0 = window->attach(ui::fork::ctor(axis::Y)) diff --git a/src/netxs/apps/text.hpp b/src/netxs/apps/text.hpp index 63937d2516..4233faee95 100644 --- a/src/netxs/apps/text.hpp +++ b/src/netxs/apps/text.hpp @@ -91,13 +91,13 @@ displaying the requested definition in a popup window or temporary buffer. Some //boss.keybd.accept(true); boss.LISTEN(tier::anycast, e2::form::proceed::quit::any, fast) { - boss.RISEUP(tier::release, e2::form::proceed::quit::one, fast); + boss.base::template riseup(e2::form::proceed::quit::one, fast); }; boss.LISTEN(tier::release, e2::form::upon::vtree::attached, parent) { static auto i = 0; i++; auto title = ansi::jet(bias::center).add("Text Editor\n ~/Untitled ", i, ".txt"); - boss.RISEUP(tier::preview, e2::form::prop::ui::header, title); + boss.base::template riseup(e2::form::prop::ui::header, title); }; }); auto object = window->attach(ui::fork::ctor(axis::Y)) diff --git a/src/netxs/apps/tile.hpp b/src/netxs/apps/tile.hpp index 4981690c8a..1e07b7e3c9 100644 --- a/src/netxs/apps/tile.hpp +++ b/src/netxs/apps/tile.hpp @@ -154,7 +154,7 @@ namespace netxs::app::tile { parent->LISTEN(tier::anycast, app::tile::events::ui::any, gear, boss.relyon) { - boss.RISEUP(tier::request, e2::form::state::keybd::find, gear_test, (gear.id, 0)); + auto gear_test = boss.base::template riseup(e2::form::state::keybd::find, { gear.id, 0 }); if (gear_test.second) { if (auto parent = boss.parent()) @@ -163,36 +163,36 @@ namespace netxs::app::tile switch (deed) { case app::tile::events::ui::create.id: - boss.RISEUP(tier::request, e2::form::proceed::createby, gear); + boss.base::template riseup(e2::form::proceed::createby, gear); break; case app::tile::events::ui::close.id: - boss.RISEUP(tier::preview, e2::form::proceed::quit::one, true); + boss.base::template riseup(e2::form::proceed::quit::one, true); break; case app::tile::events::ui::toggle.id: if (boss.base::kind() == base::client) // Only apps can be maximized. if (gear.countdown > 0) { gear.countdown--; // The only one can be maximized if several are selected. - boss.RISEUP(tier::preview, e2::form::size::enlarge::maximize, gear); + boss.base::template riseup(e2::form::size::enlarge::maximize, gear); } break; case app::tile::events::ui::swap.id: if (gear.countdown > 0) { - boss.RISEUP(tier::release, app::tile::events::ui::swap, gear); + boss.base::template riseup(app::tile::events::ui::swap, gear); } break; case app::tile::events::ui::rotate.id: - boss.RISEUP(tier::release, app::tile::events::ui::rotate, gear); + boss.base::template riseup(app::tile::events::ui::rotate, gear); break; case app::tile::events::ui::equalize.id: - boss.RISEUP(tier::release, app::tile::events::ui::equalize, gear); + boss.base::template riseup(app::tile::events::ui::equalize, gear); break; case app::tile::events::ui::split::vt.id: - boss.RISEUP(tier::release, app::tile::events::ui::split::vt, gear); + boss.base::template riseup(app::tile::events::ui::split::vt, gear); break; case app::tile::events::ui::split::hz.id: - boss.RISEUP(tier::release, app::tile::events::ui::split::hz, gear); + boss.base::template riseup(app::tile::events::ui::split::hz, gear); break; } } @@ -204,19 +204,19 @@ namespace netxs::app::tile { boss.LISTEN(tier::release, hids::events::mouse::button::dblclick::left, gear) { - boss.RISEUP(tier::preview, e2::form::size::enlarge::maximize, gear); + boss.base::template riseup(e2::form::size::enlarge::maximize, gear); gear.dismiss(); }; //boss.LISTEN(tier::release, hids::events::mouse::button::click::leftright, gear) //{ // auto backup = boss.This(); - // boss.RISEUP(tier::release, e2::form::proceed::quit::one, true); + // boss.base::template riseup(e2::form::proceed::quit::one, true); // gear.dismiss(); //}; //boss.LISTEN(tier::release, hids::events::mouse::button::click::middle, gear) //{ // auto backup = boss.This(); - // boss.RISEUP(tier::release, e2::form::proceed::quit::one, true); + // boss.base::template riseup(e2::form::proceed::quit::one, true); // gear.dismiss(); //}; }; @@ -261,7 +261,7 @@ namespace netxs::app::tile if (what.header.empty()) what.header = menuid; // Find creator. - master.RISEUP(tier::request, e2::config::creator, world_ptr, ()); + auto world_ptr = master.base::template riseup(e2::config::creator); // Take coor and detach from the tiling wm. gear.coord -= applet.base::coor(); // Rebase mouse coor. @@ -279,7 +279,7 @@ namespace netxs::app::tile auto gear_id_list = pro::focus::get(parent_ptr); // Expropriate all foci. world_ptr->SIGNAL(tier::request, vtm::events::handoff, what); // Attach to the world. pro::focus::set(what.applet, gear_id_list, pro::focus::solo::off, pro::focus::flip::off, true); // Refocus. - master.RISEUP(tier::release, e2::form::proceed::quit::one, true); // Destroy placeholder. + master.base::template riseup(e2::form::proceed::quit::one, true); // Destroy placeholder. } // Redirect this mouse event to the new world's window. @@ -288,7 +288,7 @@ namespace netxs::app::tile }; boss.LISTEN(tier::anycast, e2::form::upon::started, root) { - boss.RISEUP(tier::release, events::enlist, boss.This()); + boss.base::template riseup(events::enlist, boss.This()); }; boss.LISTEN(tier::release, hids::events::mouse::button::click::right, gear) { @@ -363,7 +363,7 @@ namespace netxs::app::tile //todo implement keydb support boss.LISTEN(tier::release, hids::events::mouse::button::click::right, gear) { - boss.RISEUP(tier::release, e2::form::size::minimize, gear); + boss.base::template riseup(e2::form::size::minimize, gear); gear.dismiss(); }; }) @@ -388,7 +388,7 @@ namespace netxs::app::tile { boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear) { - boss.RISEUP(tier::request, e2::form::proceed::createby, gear); + boss.base::template riseup(e2::form::proceed::createby, gear); gear.nodbl = true; }; }}, @@ -397,7 +397,7 @@ namespace netxs::app::tile { boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear) { - boss.RISEUP(tier::release, app::tile::events::ui::split::hz, gear); + boss.base::template riseup(app::tile::events::ui::split::hz, gear); gear.nodbl = true; }; }}, @@ -406,7 +406,7 @@ namespace netxs::app::tile { boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear) { - boss.RISEUP(tier::release, app::tile::events::ui::split::vt, gear); + boss.base::template riseup(app::tile::events::ui::split::vt, gear); gear.nodbl = true; }; }}, @@ -416,7 +416,7 @@ namespace netxs::app::tile boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear) { auto backup = boss.This(); - boss.RISEUP(tier::release, e2::form::proceed::quit::one, true); + boss.base::template riseup(e2::form::proceed::quit::one, true); gear.nodbl = true; }; }}, @@ -444,7 +444,7 @@ namespace netxs::app::tile mouse_subs(boss); boss.LISTEN(tier::release, hids::events::mouse::button::click::right, gear) { - boss.RISEUP(tier::request, e2::form::proceed::createby, gear); + boss.base::template riseup(e2::form::proceed::createby, gear); gear.dismiss(); }; }) @@ -598,7 +598,7 @@ namespace netxs::app::tile { if (boss.count() > 2 || oneoff) // It is a root or is already maximized. See build_inst::slot::_2's e2::form::proceed::attach for details. { - boss.RISEUP(tier::release, e2::form::proceed::attach, e2::form::proceed::attach.param()); + boss.base::template riseup(e2::form::proceed::attach, e2::form::proceed::attach.param()); } else { @@ -621,7 +621,7 @@ namespace netxs::app::tile oneoff.reset(); }; auto just_copy = fullscreen_item; - boss.RISEUP(tier::release, e2::form::proceed::attach, fullscreen_item); + boss.base::template riseup(e2::form::proceed::attach, fullscreen_item); pro::focus::set(just_copy, gear_id_list, pro::focus::solo::off, pro::focus::flip::off); // Handover all foci. boss.base::reflow(); } @@ -681,7 +681,7 @@ namespace netxs::app::tile parent->SIGNAL(tier::request, e2::form::proceed::swap, item_ptr, (boss.This())); // sptr must be of the same type as the event argument. Casting kills all intermediaries when return. if (item_ptr != boss.This()) // Parallel slot is not empty or both slots are empty (item_ptr == null). { - parent->RISEUP(tier::release, e2::form::proceed::swap, item_ptr); + parent->base::riseup(e2::form::proceed::swap, item_ptr); } } boss.deface(); @@ -694,10 +694,10 @@ namespace netxs::app::tile if (boss.count() != 1) return; // Create new apps at the empty slots only. auto& gate = gear.owner; gate.SIGNAL(tier::request, e2::data::changed, current_default, ()); - gate.RISEUP(tier::request, vtm::events::apptype, config, ({ .menuid = current_default })); + auto config = gate.base::riseup(vtm::events::apptype, { .menuid = current_default }); if (config.kindid == netxs::app::site::id) return; // Deny any view regions inside the tiling manager. - gate.RISEUP(tier::request, vtm::events::newapp, config); + gate.base::riseup(vtm::events::newapp, config); auto app = app_window(config); auto gear_id_list = pro::focus::get(boss.back()); boss.attach(app); @@ -816,7 +816,7 @@ namespace netxs::app::tile { auto& gate = gear.owner; gate.SIGNAL(tier::request, e2::data::changed, menuid, ()); - gate.RISEUP(tier::request, desk::events::menu, conf_list_ptr, ()); + auto conf_list_ptr = gate.base::riseup(desk::events::menu); auto& conf_list = *conf_list_ptr; auto& config = conf_list[menuid]; if (config.type == app::tile::id) // Reset the currently selected application to the previous one. @@ -929,7 +929,7 @@ namespace netxs::app::tile { boss.LISTEN(tier::anycast, e2::form::proceed::quit::any, fast) { - boss.RISEUP(tier::release, e2::form::proceed::quit::one, fast); + boss.base::template riseup(e2::form::proceed::quit::one, fast); }; }); menu_data->active(window_clr) @@ -983,7 +983,7 @@ namespace netxs::app::tile { if (boss.count() > 2 && deed != app::tile::events::ui::toggle.id) // Restore the window before any action if maximized. { - boss.RISEUP(tier::release, e2::form::proceed::attach, e2::form::proceed::attach.param()); + boss.base::template riseup(e2::form::proceed::attach, e2::form::proceed::attach.param()); } if (deed == app::tile::events::ui::swap.id) @@ -994,7 +994,7 @@ namespace netxs::app::tile item_ptr->SIGNAL(tier::request, e2::form::state::keybd::find, gear_test, (gear.id, 0)); if (gear_test.second) { - item_ptr->RISEUP(tier::release, events::backup, empty_slot_list); + item_ptr->base::riseup(events::backup, empty_slot_list); } }); boss.SIGNAL(tier::general, e2::form::proceed::functor, proc); @@ -1027,7 +1027,7 @@ namespace netxs::app::tile if (app_slot) { s->attach(app_slot); - app_slot->RISEUP(tier::release, events::enlist, app_slot); + app_slot->base::riseup(events::enlist, app_slot); } std::swap(emp_slot, emp_next); std::swap(app_slot, app_next); @@ -1037,7 +1037,7 @@ namespace netxs::app::tile if (app_slot) { s->attach(app_slot); - app_slot->RISEUP(tier::release, events::enlist, app_slot); + app_slot->base::riseup(events::enlist, app_slot); } gear.countdown = 0; // Interrupt swapping. } diff --git a/src/netxs/desktopio/application.hpp b/src/netxs/desktopio/application.hpp index 1e1f066ef1..4db1ce61d6 100644 --- a/src/netxs/desktopio/application.hpp +++ b/src/netxs/desktopio/application.hpp @@ -33,7 +33,7 @@ namespace netxs::app::shared { boss.LISTEN(tier::anycast, e2::form::proceed::quit::any, fast) { - boss.RISEUP(tier::release, e2::form::proceed::quit::one, fast); + boss.base::template riseup(e2::form::proceed::quit::one, fast); // Apple clang requires template keyword. }; }; const auto closing_by_gesture = [](auto& boss) @@ -41,13 +41,13 @@ namespace netxs::app::shared boss.LISTEN(tier::release, hids::events::mouse::button::click::leftright, gear) { auto backup = boss.This(); - boss.RISEUP(tier::release, e2::form::proceed::quit::one, true); + boss.base::template riseup(e2::form::proceed::quit::one, true); gear.dismiss(); }; boss.LISTEN(tier::release, hids::events::mouse::button::click::middle, gear) { auto backup = boss.This(); - boss.RISEUP(tier::release, e2::form::proceed::quit::one, true); + boss.base::template riseup(e2::form::proceed::quit::one, true); gear.dismiss(); }; }; @@ -87,8 +87,8 @@ namespace netxs::app::shared }; const auto set_title = [](base& boss, input::hids& gear, bias alignment = bias::left) { - boss.RISEUP(tier::request, e2::form::prop::ui::header, old_title, ()); - gear.owner.RISEUP(tier::request, hids::events::clipbrd, gear); + auto old_title = boss.base::riseup(e2::form::prop::ui::header); + gear.owner.base::riseup(hids::events::clipbrd, gear); auto& data = gear.board::cargo; if (data.utf8.empty()) { @@ -99,10 +99,11 @@ namespace netxs::app::shared if (utf::is_plain(data.utf8) || alignment != bias::left) // Reset aligning to the center if text is plain. { auto align = ansi::jet(alignment); - boss.RISEUP(tier::preview, e2::form::prop::ui::header, align); + boss.base::riseup(e2::form::prop::ui::header, align); } // Copy clipboard data to title. - boss.RISEUP(tier::preview, e2::form::prop::ui::header, title, (data.utf8)); + auto title = data.utf8; + boss.base::riseup(e2::form::prop::ui::header, title); if (old_title.size()) // Copy old title to clipboard. { gear.set_clipboard(dot_00, old_title, mime::ansitext); @@ -266,7 +267,7 @@ namespace netxs::app::shared { boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear) { - boss.RISEUP(tier::release, e2::form::size::minimize, gear); + boss.base::template riseup(e2::form::size::minimize, gear); gear.dismiss(); }; }}, @@ -275,7 +276,7 @@ namespace netxs::app::shared { boss.LISTEN(tier::release, hids::events::mouse::button::click::left, gear) { - boss.RISEUP(tier::preview, e2::form::size::enlarge::maximize, gear); + boss.base::template riseup(e2::form::size::enlarge::maximize, gear); gear.dismiss(); }; }}, @@ -422,7 +423,7 @@ namespace netxs::app::shared boss.LISTEN(tier::release, e2::form::upon::vtree::attached, parent) { auto title = "error"s; - boss.RISEUP(tier::preview, e2::form::prop::ui::header, title); + boss.base::template riseup(e2::form::prop::ui::header, title); }; }); auto msg = ui::post::ctor() diff --git a/src/netxs/desktopio/baseui.hpp b/src/netxs/desktopio/baseui.hpp index fa66097baf..aeed2b886d 100644 --- a/src/netxs/desktopio/baseui.hpp +++ b/src/netxs/desktopio/baseui.hpp @@ -837,14 +837,14 @@ namespace netxs::ui // Usage example: // base::raw_riseup(e2::form::prop::ui::header, txt); template - void raw_riseup(hint event_id, T&& param, bool forced = faux) + void raw_riseup(hint event_id, T& param, bool forced = faux) { if (forced) { bell::template signal(event_id, param); base::toboss([&](auto& boss) { - boss.base::template raw_riseup(event_id, std::forward(param), forced); + boss.base::template raw_riseup(event_id, param, forced); }); } else @@ -853,7 +853,7 @@ namespace netxs::ui { base::toboss([&](auto& boss) { - boss.base::template raw_riseup(event_id, std::forward(param), forced); + boss.base::template raw_riseup(event_id, param, forced); }); } } @@ -862,9 +862,10 @@ namespace netxs::ui // Usage example: // base::riseup(e2::form::prop::ui::header, txt); template - void riseup(Event, Event::type&& param = {}, bool forced = faux) + auto riseup(Event, Event::type&& param = {}, bool forced = faux) { - raw_riseup(Event::id, std::move(param), forced); + raw_riseup(Event::id, param, forced); + return param; } template void riseup(Event, Event::type& param, bool forced = faux) diff --git a/src/netxs/desktopio/console.hpp b/src/netxs/desktopio/console.hpp index da86ca2cd6..12749d18a6 100644 --- a/src/netxs/desktopio/console.hpp +++ b/src/netxs/desktopio/console.hpp @@ -1261,7 +1261,7 @@ namespace netxs::ui LISTEN(tier::preview, e2::form::proceed::create, dest_region, tokens) { dest_region.coor += base::coor(); - this->RISEUP(tier::release, e2::form::proceed::create, dest_region); + this->base::riseup(e2::form::proceed::create, dest_region); }; LISTEN(tier::release, e2::form::proceed::onbehalf, proc, tokens) { @@ -1331,7 +1331,7 @@ namespace netxs::ui //todo revise if (props.title.length()) { - this->RISEUP(tier::preview, e2::form::prop::ui::header, props.title); + this->base::riseup(e2::form::prop::ui::header, props.title); } }; LISTEN(tier::request, e2::form::prop::ui::footer, f, tokens) diff --git a/src/netxs/desktopio/controls.hpp b/src/netxs/desktopio/controls.hpp index ec8e0090a0..59f15365d3 100644 --- a/src/netxs/desktopio/controls.hpp +++ b/src/netxs/desktopio/controls.hpp @@ -1159,7 +1159,7 @@ namespace netxs::ui { auto backup = boss.This(); log(prompt::gate, "No mouse clicking events"); - boss.RISEUP(tier::release, e2::form::proceed::quit::one, true); + boss.base::template riseup(e2::form::proceed::quit::one, true); ping.reset(); memo.clear(); } @@ -1256,7 +1256,7 @@ namespace netxs::ui { auto fire = [&](auto id) { - item_ptr->RISEUP(tier::preview, hids::events::keybd::focus::set, seed, ({ .id = id, .solo = (si32)s, .flip = (bool)f, .skip = skip })); + auto seed = item_ptr->base::riseup(hids::events::keybd::focus::set, { .id = id, .solo = (si32)s, .flip = (bool)f, .skip = skip }); //if constexpr (debugmode) log(prompt::foci, "Focus set gear:", seed.id, " item:", item_ptr->id); }; if constexpr (std::is_same_v>) fire(gear_id); @@ -1267,7 +1267,7 @@ namespace netxs::ui { auto fire = [&](auto id) { - item_ptr->RISEUP(tier::preview, hids::events::keybd::focus::off, seed, ({ .id = id })); + auto seed = item_ptr->base::riseup(hids::events::keybd::focus::off, { .id = id }); //if constexpr (debugmode) log(prompt::foci, "Focus off gear:", seed.id, " item:", item_ptr->id); }; if constexpr (std::is_same_v>) fire(gear_id); @@ -1275,23 +1275,23 @@ namespace netxs::ui } static auto off(sptr item_ptr) { - item_ptr->RISEUP(tier::request, e2::form::state::keybd::enlist, gear_id_list, ()); + auto gear_id_list = item_ptr->base::riseup(e2::form::state::keybd::enlist); pro::focus::off(item_ptr, gear_id_list); //if constexpr (debugmode) log(prompt::foci, "Full defocus item:", item_ptr->id); return gear_id_list; } static auto get(sptr item_ptr, bool remove_default = faux) { - item_ptr->RISEUP(tier::request, e2::form::state::keybd::enlist, gear_id_list, ()); + auto gear_id_list = item_ptr->base::riseup(e2::form::state::keybd::enlist); for (auto next_id : gear_id_list) { - item_ptr->RISEUP(tier::preview, hids::events::keybd::focus::get, seed, ({ .id = next_id })); + auto seed = item_ptr->base::riseup(hids::events::keybd::focus::get, { .id = next_id }); //if constexpr (debugmode) log(prompt::foci, "Focus get gear:", seed.id, " item:", item_ptr->id); } if (remove_default) if (auto parent = item_ptr->parent()) { - parent->RISEUP(tier::preview, hids::events::keybd::focus::dry, seed, ({ .item = item_ptr })); + auto seed = parent->base::riseup(hids::events::keybd::focus::dry, { .item = item_ptr }); } return gear_id_list; } @@ -1299,14 +1299,14 @@ namespace netxs::ui { if (auto parent = src_ptr->parent()) { - parent->RISEUP(tier::release, hids::events::keybd::focus::hop, seed, ({ .what = src_ptr, .item = dst_ptr })); + auto seed = parent->base::riseup(hids::events::keybd::focus::hop, { .what = src_ptr, .item = dst_ptr }); auto gear_id_list = pro::focus::off(src_ptr); pro::focus::set(dst_ptr, gear_id_list, pro::focus::solo::off, pro::focus::flip::off); } } static auto test(base& item, input::hids& gear) { - item.RISEUP(tier::request, e2::form::state::keybd::find, gear_test, (gear.id, 0)); + auto gear_test = item.base::riseup(e2::form::state::keybd::find, { gear.id, 0 }); return gear_test.second; } @@ -1445,7 +1445,7 @@ namespace netxs::ui if (auto parent_ptr = boss.parent()) { seed.item = boss.This(); - parent_ptr->RISEUP(tier::preview, hids::events::keybd::focus::cut, seed); + parent_ptr->base::riseup(hids::events::keybd::focus::cut, seed); } return; } @@ -1516,7 +1516,7 @@ namespace netxs::ui if (auto parent = boss.parent()) { seed.item = boss.This(); - parent->RISEUP(tier::preview, hids::events::keybd::focus::set, seed); + parent->base::riseup(hids::events::keybd::focus::set, seed); } }; boss.LISTEN(tier::preview, hids::events::keybd::focus::off, seed, memo) @@ -1529,7 +1529,7 @@ namespace netxs::ui { auto temp = seed.item; seed.item = boss.This(); - parent_ptr->RISEUP(tier::preview, hids::events::keybd::focus::cut, seed); + parent_ptr->base::riseup(hids::events::keybd::focus::cut, seed); seed.item = temp; } } @@ -4297,7 +4297,7 @@ namespace netxs::ui { if (_move_grip(new_val)) { - RISEUP(Tier, Event{}, cur_val); + base::riseup(Event{}, cur_val); } } void giveup(hids& gear) @@ -4331,7 +4331,7 @@ namespace netxs::ui LISTEN(tier::request, e2::form::canvas, canvas) { canvas = coreface; }; cur_val = -1; - RISEUP(Tier, Event{}, cur_val); + base::riseup(Event{}, cur_val); base::limits(twod{ utf::length(caption) + (pad + 2) * 2, 10 }); diff --git a/src/netxs/desktopio/events.hpp b/src/netxs/desktopio/events.hpp index e1e6abdf23..4408084133 100644 --- a/src/netxs/desktopio/events.hpp +++ b/src/netxs/desktopio/events.hpp @@ -411,17 +411,6 @@ namespace netxs::events #define SIGNAL_X(...) ARG_EVAL_XS(GET_END2_XS(__VA_ARGS__, SIGNAL_N, SIGNAL_S)) #define SIGNAL(...) SIGNAL_X(__VA_ARGS__)(__VA_ARGS__) - #define RISEUP_S(level, event, var ) base::template riseup(event, var) - #define RISEUP_N(level, event, var, inits) base::_saveme(); auto var = event.param ARG_EVAL_XS(inits); static_cast(bell::_revive())->template riseup(event, var) // Multi-statement macro. Use with caution. - #define RISEUP_X(...) ARG_EVAL_XS(GET_END2_XS(__VA_ARGS__, RISEUP_N, RISEUP_S)) - #define RISEUP(...) RISEUP_X(__VA_ARGS__)(__VA_ARGS__) - - //todo deprecated? - //#define LISTEN_AND_RUN_T(level, event, token, param, arg) bell::template submit2( arg, token ) = [&](typename decltype( event )::type && param) - //#define LISTEN_AND_RUN( level, event, param, arg) bell::template submit2( arg ) = [&](typename decltype( event )::type && param) - //#define SIGNAL_GLOBAL( event, param ) bell::template signal_global(decltype( event )::id, static_cast(param)) - //#define LISTEN_GLOBAL( event, param, token ) bell::template submit_global( event, token -0 ) = [&] (typename decltype( event )::type&& param) - #define EVENTPACK( name, base ) using _group_type = name; \ static constexpr auto _counter_base = __COUNTER__; \ public: static constexpr auto any = netxs::events::type_clue<_group_type, decltype(base)::type, decltype(base)::id> diff --git a/src/netxs/desktopio/gui.hpp b/src/netxs/desktopio/gui.hpp index 23d70b9522..d1491d7de0 100644 --- a/src/netxs/desktopio/gui.hpp +++ b/src/netxs/desktopio/gui.hpp @@ -1727,24 +1727,24 @@ namespace netxs::gui void handle(s11n::xs::header_request lock) { auto& item = lock.thing; - owner.RISEUP(tier::request, e2::form::prop::ui::header, header_utf8, ()); + auto header_utf8 = owner.base::riseup(e2::form::prop::ui::header); s11n::header.send(intio, item.window_id, header_utf8); } void handle(s11n::xs::footer_request lock) { auto& item = lock.thing; - owner.RISEUP(tier::request, e2::form::prop::ui::footer, footer_utf8, ()); + auto footer_utf8 = owner.base::riseup(e2::form::prop::ui::footer); s11n::footer.send(intio, item.window_id, footer_utf8); } void handle(s11n::xs::header lock) { auto& item = lock.thing; - owner.RISEUP(tier::preview, e2::form::prop::ui::header, item.utf8); + owner.base::riseup(e2::form::prop::ui::header, item.utf8); } void handle(s11n::xs::footer lock) { auto& item = lock.thing; - owner.RISEUP(tier::preview, e2::form::prop::ui::footer, item.utf8); + owner.base::riseup(e2::form::prop::ui::footer, item.utf8); } void handle(s11n::xs::clipdata lock) { @@ -1796,7 +1796,7 @@ namespace netxs::gui owner.window_post_command(ipc::expose_win); //owner.bell::enqueue(owner.This(), [&](auto& /*boss*/) //{ - // owner.RISEUP(tier::preview, e2::form::layout::expose, area, ()); + // owner.base::riseup(e2::form::layout::expose); //}); } void handle(s11n::xs::focus_cut lock) @@ -1879,7 +1879,7 @@ namespace netxs::gui //todo revise //owner.bell::enqueue(owner.This(), [&](auto& /*boss*/) //{ - // owner.RISEUP(tier::release, e2::form::global::sysstart, 1); + // owner.base::riseup(e2::form::global::sysstart, 1); //}); } void handle(s11n::xs::cwd /*lock*/) @@ -1887,7 +1887,7 @@ namespace netxs::gui //todo revise //owner.bell::enqueue(owner.This(), [&, path = lock.thing.path](auto& /*boss*/) //{ - // owner.RISEUP(tier::preview, e2::form::prop::cwd, path); + // owner.base::riseup(e2::form::prop::cwd, path); //}); } struct diff --git a/src/netxs/desktopio/terminal.hpp b/src/netxs/desktopio/terminal.hpp index f4550e7c16..5e25da52b5 100644 --- a/src/netxs/desktopio/terminal.hpp +++ b/src/netxs/desktopio/terminal.hpp @@ -331,23 +331,23 @@ namespace netxs::ui auto s = std::bitset<8>{ (ui32)gear.m_sav.buttons }; if (m[hids::buttons::right] && !s[hids::buttons::right]) { - owner.RISEUP(tier::request, e2::form::state::keybd::find, gear_test, (gear.id, 0)); + auto gear_test = owner.base::riseup(e2::form::state::keybd::find, { gear.id, 0 }); if (gear_test.second == 0) { pro::focus::set(owner.This(), gear.id, pro::focus::solo::off, pro::focus::flip::off); } - owner.RISEUP(tier::preview, e2::form::layout::expose, area, ()); + owner.base::riseup(e2::form::layout::expose); } else if ((m[hids::buttons::left ] && !s[hids::buttons::left ]) || (m[hids::buttons::middle] && !s[hids::buttons::middle])) { - owner.RISEUP(tier::request, e2::form::state::keybd::find, gear_test, (gear.id, 0)); + auto gear_test = owner.base::riseup(e2::form::state::keybd::find, { gear.id, 0 }); if (gear_test.second == 0) { pro::focus::set(owner.This(), gear.id, gear.meta(hids::anyCtrl) ? pro::focus::solo::off : pro::focus::solo::on, pro::focus::flip::on); } - owner.RISEUP(tier::preview, e2::form::layout::expose, area, ()); + owner.base::riseup(e2::form::layout::expose); } } void enable(mode m) @@ -440,7 +440,7 @@ namespace netxs::ui auto& utf8 = props[property]; if (property == ansi::osc_title) { - owner.RISEUP(tier::request, e2::form::prop::ui::header, utf8); + owner.base::riseup(e2::form::prop::ui::header, utf8); } return utf8; } @@ -453,14 +453,14 @@ namespace netxs::ui { props[ansi::osc_label] = txt; auto& utf8 = (props[ansi::osc_title] = txt); - owner.RISEUP(tier::preview, e2::form::prop::ui::header, utf8); + owner.base::riseup(e2::form::prop::ui::header, utf8); } else { auto& utf8 = (props[property] = txt); if (property == ansi::osc_title) { - owner.RISEUP(tier::preview, e2::form::prop::ui::header, utf8); + owner.base::riseup(e2::form::prop::ui::header, utf8); } } } @@ -6605,7 +6605,7 @@ namespace netxs::ui auto path = text{ data.substr(delimpos) }; bell::enqueue(This(), [&, path](auto& /*boss*/) mutable { - this->RISEUP(tier::preview, e2::form::prop::cwd, path); //todo VS2019 requires `this` + this->base::riseup(e2::form::prop::cwd, path); //todo VS2019 requires `this` }); } } @@ -6623,7 +6623,7 @@ namespace netxs::ui clipdata.form = mime::disabled; clipdata.size = target->panel; clipdata.hash = datetime::now(); - RISEUP(tier::request, e2::form::state::keybd::enlist, gates, ()); // Take all foci. + auto gates = base::riseup(e2::form::state::keybd::enlist); // Take all foci. for (auto gate_id : gates) // Signal them to set the clipboard data. { if (auto gear_ptr = bell::getref(gate_id)) @@ -7033,7 +7033,7 @@ namespace netxs::ui { auto coor = base::coor(); auto info = e2::form::upon::scroll::bystep::v.param({ .vector = delta }); - RISEUP(tier::preview, e2::form::upon::scroll::bystep::v, info); + base::riseup(e2::form::upon::scroll::bystep::v, info); return base::coor() - coor; } // term: Is the selection allowed. @@ -7095,7 +7095,7 @@ namespace netxs::ui } auto get_clipboard_text(hids& gear) { - gear.owner.RISEUP(tier::request, hids::events::clipbrd, gear); + gear.owner.base::riseup(hids::events::clipbrd, gear); auto& data = gear.board::cargo; if (data.utf8.size()) { @@ -7175,7 +7175,7 @@ namespace netxs::ui } void selection_pickup(hids& gear) { - RISEUP(tier::request, e2::form::state::keybd::find, gear_test, (gear.id, 0)); + auto gear_test = base::riseup(e2::form::state::keybd::find, { gear.id, 0 }); if (!gear_test.second) // Set exclusive focus on right click. { pro::focus::set(This(), gear.id, pro::focus::solo::on, pro::focus::flip::off); @@ -7369,7 +7369,7 @@ namespace netxs::ui } else { - gear.owner.RISEUP(tier::request, hids::events::clipbrd, gear); + gear.owner.base::riseup(hids::events::clipbrd, gear); auto& data = gear.board::cargo; if (data.utf8.size()) { @@ -7536,7 +7536,7 @@ namespace netxs::ui } } }; - this->RISEUP(tier::release, e2::form::global::sysstart, 0); + this->base::riseup(e2::form::global::sysstart, 0); }; auto renew = [&] { @@ -7560,7 +7560,7 @@ namespace netxs::ui } void start() { - RISEUP(tier::release, e2::form::upon::started, This()); + base::riseup(e2::form::upon::started, This()); } void start(eccc cfg, os::fdrw fds = {}) { @@ -7594,20 +7594,20 @@ namespace netxs::ui bell::enqueue(This(), [&, backup = This()](auto& /*boss*/) mutable { ipccon.payoff(io_log); // Wait child process. - this->RISEUP(tier::release, e2::form::proceed::quit::one, forced); //todo VS2019 requires `this` + this->base::riseup(e2::form::proceed::quit::one, forced); //todo VS2019 requires `this` }); } } else // Child process exited with non-zero code and term waits keypress. { onerun.reset(); - this->RISEUP(tier::release, e2::form::proceed::quit::one, forced); //todo VS2019 requires `this` + this->base::riseup(e2::form::proceed::quit::one, forced); //todo VS2019 requires `this` } } // term: Resize terminal window. void window_resize(twod winsz) { - RISEUP(tier::preview, e2::form::prop::window::size, winsz); + base::riseup(e2::form::prop::window::size, winsz); } // term: Custom data output (ConSrv callback). template @@ -7768,24 +7768,31 @@ namespace netxs::ui { case keybd::type::keypress: //todo configurable Ctrl+Ins, Shift+Ins etc. - if (gear.handled) return; // Don't pass registered keyboard shortcuts. + if (gear.handled) break; // Don't pass registered keyboard shortcuts. if (io_log) log(prompt::key, ansi::hi(input::key::map::data(gear.keycode).name), gear.pressed ? " pressed" : " released"); if (target == &normal && gear.pressed && gear.meta(hids::anyShift) && gear.meta(hids::anyCtrl)) { - if (gear.keycode == input::key::LeftArrow && gear.meta(hids::anyAlt)){ base::riseup(e2::form::upon::scroll::bypage::x, { .vector = dot_10 }); gear.set_handled(); return; } - else if (gear.keycode == input::key::RightArrow && gear.meta(hids::anyAlt)){ base::riseup(e2::form::upon::scroll::bypage::x, { .vector = -dot_10 }); gear.set_handled(); return; } - else if (gear.keycode == input::key::LeftArrow ){ base::riseup(e2::form::upon::scroll::bystep::x, { .vector = { 1, 0 }}); gear.set_handled(); return; } - else if (gear.keycode == input::key::RightArrow ){ base::riseup(e2::form::upon::scroll::bystep::x, { .vector = {-1, 0 }}); gear.set_handled(); return; } - else if (gear.keycode == input::key::UpArrow ){ base::riseup(e2::form::upon::scroll::bystep::y, { .vector = { 0, 1 }}); gear.set_handled(); return; } - else if (gear.keycode == input::key::DownArrow ){ base::riseup(e2::form::upon::scroll::bystep::y, { .vector = { 0,-1 }}); gear.set_handled(); return; } - else if (gear.keycode == input::key::Home ){ base::riseup(e2::form::upon::scroll::to_top::y); gear.set_handled(); return; } - else if (gear.keycode == input::key::End ){ base::riseup(e2::form::upon::scroll::to_end::y); gear.set_handled(); return; } - else if (gear.keycode == input::key::PageUp ){ base::riseup(e2::form::upon::scroll::bypage::y, { .vector = dot_01 }); gear.set_handled(); return; } - else if (gear.keycode == input::key::PageDown ){ base::riseup(e2::form::upon::scroll::bypage::y, { .vector = -dot_01 }); gear.set_handled(); return; } + auto found = true; + if (gear.keycode == input::key::LeftArrow && gear.meta(hids::anyAlt)) base::riseup(e2::form::upon::scroll::bypage::x, { .vector = dot_10 }); + else if (gear.keycode == input::key::RightArrow && gear.meta(hids::anyAlt)) base::riseup(e2::form::upon::scroll::bypage::x, { .vector = -dot_10 }); + else if (gear.keycode == input::key::LeftArrow ) base::riseup(e2::form::upon::scroll::bystep::x, { .vector = { 1, 0 }}); + else if (gear.keycode == input::key::RightArrow ) base::riseup(e2::form::upon::scroll::bystep::x, { .vector = {-1, 0 }}); + else if (gear.keycode == input::key::UpArrow ) base::riseup(e2::form::upon::scroll::bystep::y, { .vector = { 0, 1 }}); + else if (gear.keycode == input::key::DownArrow ) base::riseup(e2::form::upon::scroll::bystep::y, { .vector = { 0,-1 }}); + else if (gear.keycode == input::key::Home ) base::riseup(e2::form::upon::scroll::to_top::y); + else if (gear.keycode == input::key::End ) base::riseup(e2::form::upon::scroll::to_end::y); + else if (gear.keycode == input::key::PageUp ) base::riseup(e2::form::upon::scroll::bypage::y, { .vector = dot_01 }); + else if (gear.keycode == input::key::PageDown ) base::riseup(e2::form::upon::scroll::bypage::y, { .vector = -dot_01 }); + else found = faux; + if (found) + { + gear.set_handled(); + break; + } } if (config.resetonkey && gear.doinput()) { - this->RISEUP(tier::release, e2::form::animate::reset, 0); // Reset scroll animation. + this->base::riseup(e2::form::animate::reset, 0); // Reset scroll animation. unsync = true; follow[axis::X] = true; follow[axis::Y] = true; @@ -7835,7 +7842,7 @@ namespace netxs::ui auto& console = *target; if (status.update(console)) { - this->RISEUP(tier::preview, e2::form::prop::ui::footer, status.data); + this->base::riseup(e2::form::prop::ui::footer, status.data); } auto clip = parent_canvas.clip(); @@ -7978,7 +7985,7 @@ namespace netxs::ui { auto& gear = *gear_ptr; if (gear.captured(owner.id)) gear.setfree(true); - parent_ptr->RISEUP(tier::preview, e2::form::size::enlarge::fullscreen, gear); + parent_ptr->base::riseup(e2::form::size::enlarge::fullscreen, gear); } }); } @@ -7992,7 +7999,7 @@ namespace netxs::ui { auto& gear = *gear_ptr; if (gear.captured(owner.id)) gear.setfree(true); - parent_ptr->RISEUP(tier::preview, e2::form::size::enlarge::maximize, gear); + parent_ptr->base::riseup(e2::form::size::enlarge::maximize, gear); } }); } @@ -8004,7 +8011,7 @@ namespace netxs::ui if (auto gear_ptr = owner.bell::getref(k.gear_id)) if (auto parent_ptr = owner.base::parent()) { - parent_ptr->RISEUP(tier::preview, hids::events::keybd::focus::cut, seed, ({ .id = k.gear_id, .item = owner.This() })); + auto seed = parent_ptr->base::riseup(hids::events::keybd::focus::cut, { .id = k.gear_id, .item = owner.This() }); } }); } @@ -8016,7 +8023,7 @@ namespace netxs::ui if (auto gear_ptr = owner.bell::getref(k.gear_id)) if (auto parent_ptr = owner.base::parent()) { - parent_ptr->RISEUP(tier::preview, hids::events::keybd::focus::set, seed, ({ .id = k.gear_id, .solo = k.solo, .item = owner.This() })); + auto seed = parent_ptr->base::riseup(hids::events::keybd::focus::set, { .id = k.gear_id, .solo = k.solo, .item = owner.This() }); } }); } @@ -8073,7 +8080,7 @@ namespace netxs::ui if (auto gear_ptr = owner.bell::getref(m.gear_id)) { auto& gear = *gear_ptr; - owner.RISEUP(tier::release, e2::form::size::minimize, gear); + owner.base::riseup(e2::form::size::minimize, gear); } }); } @@ -8081,7 +8088,7 @@ namespace netxs::ui { owner.bell::enqueue(owner.This(), [&](auto& /*boss*/) { - owner.RISEUP(tier::preview, e2::form::layout::expose, area, ()); + owner.base::riseup(e2::form::layout::expose); }); } void handle(s11n::xs::clipdata lock) @@ -8103,7 +8110,7 @@ namespace netxs::ui if (auto gear_ptr = owner.bell::getref(c.gear_id)) { auto& gear = *gear_ptr; - gear.owner.RISEUP(tier::request, hids::events::clipbrd, gear); + gear.owner.base::riseup(hids::events::clipbrd, gear); auto& data = gear.board::cargo; if (data.hash != c.hash) { @@ -8120,7 +8127,7 @@ namespace netxs::ui auto& h = lock.thing; owner.bell::enqueue(owner.This(), [&, /*id = h.window_id,*/ header = h.utf8](auto& /*boss*/) mutable { - owner.RISEUP(tier::preview, e2::form::prop::ui::header, header); + owner.base::riseup(e2::form::prop::ui::header, header); }); } void handle(s11n::xs::footer lock) @@ -8128,7 +8135,7 @@ namespace netxs::ui auto& f = lock.thing; owner.bell::enqueue(owner.This(), [&, /*id = f.window_id,*/ footer = f.utf8](auto& /*boss*/) mutable { - owner.RISEUP(tier::preview, e2::form::prop::ui::footer, footer); + owner.base::riseup(e2::form::prop::ui::footer, footer); }); } void handle(s11n::xs::header_request lock) @@ -8137,7 +8144,7 @@ namespace netxs::ui owner.trysync(owner.active, [&] { //todo use window_id - owner.RISEUP(tier::request, e2::form::prop::ui::header, header, ()); + auto header = owner.base::riseup(e2::form::prop::ui::header); s11n::header.send(owner, c.window_id, header); }); } @@ -8147,7 +8154,7 @@ namespace netxs::ui owner.trysync(owner.active, [&] { //todo use window_id - owner.RISEUP(tier::request, e2::form::prop::ui::footer, footer, ()); + auto footer = owner.base::riseup(e2::form::prop::ui::footer); s11n::footer.send(owner, c.window_id, footer); }); } @@ -8157,7 +8164,7 @@ namespace netxs::ui owner.bell::enqueue(owner.This(), [&, /*id = w.window_id,*/ warp = w.warpdata](auto& /*boss*/) { //todo use window_id - owner.RISEUP(tier::preview, e2::form::layout::swarp, warp); + owner.base::riseup(e2::form::layout::swarp, warp); }); } void handle(s11n::xs::fps lock) @@ -8188,14 +8195,14 @@ namespace netxs::ui { owner.bell::enqueue(owner.This(), [&](auto& /*boss*/) { - owner.RISEUP(tier::release, e2::form::global::sysstart, 1); + owner.base::riseup(e2::form::global::sysstart, 1); }); } void handle(s11n::xs::cwd lock) { owner.bell::enqueue(owner.This(), [&, path = lock.thing.path](auto& /*boss*/) { - owner.RISEUP(tier::preview, e2::form::prop::cwd, path); + owner.base::riseup(e2::form::prop::cwd, path); }); } evnt(dtvt& owner) @@ -8300,7 +8307,7 @@ namespace netxs::ui bell::enqueue(This(), [&, backup = This()](auto& /*boss*/) mutable { ipccon.payoff(); - this->RISEUP(tier::release, e2::form::proceed::quit::one, true); // MSVC2019 + this->base::riseup(e2::form::proceed::quit::one, true); // MSVC2019 }); } // dtvt: Splash screen if there is no next frame. diff --git a/src/vtm.hpp b/src/vtm.hpp index f1d5d7c7f7..15e8b3bca8 100644 --- a/src/vtm.hpp +++ b/src/vtm.hpp @@ -132,10 +132,10 @@ namespace netxs::app::vtm auto newhead = std::move(what.header); auto newfoot = std::move(what.footer); - boss.RISEUP(tier::request, e2::form::prop::ui::header, what.header); - boss.RISEUP(tier::request, e2::form::prop::ui::footer, what.footer); - boss.RISEUP(tier::preview, e2::form::prop::ui::header, newhead); - boss.RISEUP(tier::preview, e2::form::prop::ui::footer, newfoot); + boss.base::riseup(e2::form::prop::ui::header, what.header); + boss.base::riseup(e2::form::prop::ui::footer, what.footer); + boss.base::riseup(e2::form::prop::ui::header, newhead); + boss.base::riseup(e2::form::prop::ui::footer, newfoot); boss.LISTEN(tier::anycast, e2::form::proceed::quit::one, fast, memo) { @@ -185,10 +185,10 @@ namespace netxs::app::vtm memo.clear(); auto prev_header = std::move(what.header); auto prev_footer = std::move(what.footer); - boss.RISEUP(tier::request, e2::form::prop::ui::header, what.header); - boss.RISEUP(tier::request, e2::form::prop::ui::footer, what.footer); - boss.RISEUP(tier::preview, e2::form::prop::ui::header, prev_header); - boss.RISEUP(tier::preview, e2::form::prop::ui::footer, prev_footer); + boss.base::riseup(e2::form::prop::ui::header, what.header); + boss.base::riseup(e2::form::prop::ui::footer, what.footer); + boss.base::riseup(e2::form::prop::ui::header, prev_header); + boss.base::riseup(e2::form::prop::ui::footer, prev_footer); auto window_ptr = what.applet; auto gear_id_list = pro::focus::get(window_ptr, true); // Expropriate all foci. window_ptr->base::detach(); @@ -257,11 +257,11 @@ namespace netxs::app::vtm }; boss.LISTEN(tier::preview, hids::events::mouse::button::click::left, gear, memo) { - boss.RISEUP(tier::preview, e2::form::layout::expose, area, ()); + boss.base::template riseup(e2::form::layout::expose); }; boss.LISTEN(tier::preview, hids::events::mouse::button::click::right, gear, memo) { - boss.RISEUP(tier::preview, e2::form::layout::expose, area, ()); + boss.base::template riseup(e2::form::layout::expose); }; boss.LISTEN(tier::preview, e2::form::layout::appear, newpos, memo) { @@ -273,7 +273,7 @@ namespace netxs::app::vtm //}; boss.LISTEN(tier::preview, e2::form::upon::changed, delta, memo) { - boss.RISEUP(tier::preview, e2::form::layout::bubble, area, ()); + boss.base::template riseup(e2::form::layout::bubble); }; boss.LISTEN(tier::preview, hids::events::mouse::button::down::any, gear, memo) { @@ -506,7 +506,7 @@ namespace netxs::app::vtm gear.slot = data.slot; gear.slot.coor += boss.base::coor(); gear.slot_forced = true; - boss.RISEUP(tier::request, e2::form::proceed::createby, gear); + boss.base::riseup(e2::form::proceed::createby, gear); } slots.erase(gear.id); if (slots.empty()) cache = {}; @@ -703,11 +703,11 @@ namespace netxs::app::vtm auto object = vtm::events::d_n_d::ask.param(); if (auto old_object = boss.bell::getref(under)) { - old_object->RISEUP(tier::release, vtm::events::d_n_d::abort, object); + old_object->base::riseup(vtm::events::d_n_d::abort, object); } if (auto new_object = boss.bell::getref(new_under)) { - new_object->RISEUP(tier::release, vtm::events::d_n_d::ask, object); + new_object->base::riseup(vtm::events::d_n_d::ask, object); } boss.SIGNAL(tier::anycast, e2::form::prop::lucidity, object ? 0x80 : 0xFF); // Make it semi-transparent on success and opaque otherwise. @@ -770,7 +770,7 @@ namespace netxs::app::vtm else if (gear.chord(input::key::F10)) { auto window_ptr = e2::form::layout::go::item.param(); - this->RISEUP(tier::request, e2::form::layout::go::item, window_ptr); // Take current window. + this->base::riseup(e2::form::layout::go::item, window_ptr); // Take current window. if (!window_ptr) { this->SIGNAL(tier::general, e2::shutdown, msg, (utf::concat(prompt::gate, "Server shutdown"))); @@ -787,7 +787,7 @@ namespace netxs::app::vtm align.unbind(); } auto window_ptr = e2::form::layout::go::item.param(); - this->RISEUP(tier::request, e2::form::layout::go::item, window_ptr); // Take current window. + this->base::riseup(e2::form::layout::go::item, window_ptr); // Take current window. if (window_ptr) window_ptr->SIGNAL(tier::release, e2::form::layout::unselect, gear); auto current = window_ptr; @@ -797,8 +797,8 @@ namespace netxs::app::vtm { window_ptr.reset(); owner_id = id_t{}; - if (down) this->RISEUP(tier::request, e2::form::layout::go::prev, window_ptr); // Take prev window. - else this->RISEUP(tier::request, e2::form::layout::go::next, window_ptr); // Take next window. + if (down) this->base::riseup(e2::form::layout::go::prev, window_ptr); // Take prev window. + else this->base::riseup(e2::form::layout::go::next, window_ptr); // Take next window. if (window_ptr) window_ptr->SIGNAL(tier::request, e2::form::state::maximized, owner_id); maximized = owner_id == gear.owner.id; if (!owner_id || maximized) break; @@ -1055,12 +1055,12 @@ namespace netxs::app::vtm window.LISTEN(tier::preview, e2::form::layout::expose, area, -) { area = expose(window.id); - if (area) window.RISEUP(tier::release, e2::form::layout::expose, area); + if (area) window.base::riseup(e2::form::layout::expose, area); }; window.LISTEN(tier::preview, e2::form::layout::bubble, area, -) { area = bubble(window.id); - if (area) window.RISEUP(tier::release, e2::form::layout::bubble, area); + if (area) window.base::riseup(e2::form::layout::bubble, area); }; items.push_back(ptr::shared(window_ptr)); } @@ -1304,7 +1304,7 @@ namespace netxs::app::vtm else // Hide if visible and refocus. { boss.hidden = true; - boss.RISEUP(tier::request, e2::form::state::keybd::find, gear_test, (gear.id, 0)); + auto gear_test = boss.base::template riseup(e2::form::state::keybd::find, { gear.id, 0 }); if (auto parent = boss.parent()) if (gear_test.second) // If it is focused pass the focus to the next desktop window. { @@ -1344,7 +1344,7 @@ namespace netxs::app::vtm }; boss.LISTEN(tier::release, hids::events::mouse::button::dblclick::left, gear) { - boss.RISEUP(tier::preview, e2::form::size::enlarge::maximize, gear); + boss.base::template riseup(e2::form::size::enlarge::maximize, gear); gear.dismiss(); }; boss.LISTEN(tier::request, e2::form::prop::window::instance, window_ptr) @@ -1414,8 +1414,8 @@ namespace netxs::app::vtm auto what = what_copy; what.applet = window_ptr; pro::focus::set(window_ptr, gear.id, pro::focus::solo::on, pro::focus::flip::off, true); // Refocus. - window_ptr->RISEUP(tier::request, e2::form::prop::ui::header, what.header); - window_ptr->RISEUP(tier::request, e2::form::prop::ui::footer, what.footer); + window_ptr->base::template riseup(e2::form::prop::ui::header, what.header); + window_ptr->base::template riseup(e2::form::prop::ui::footer, what.footer); gear.owner.SIGNAL(tier::release, vtm::events::gate::fullscreen, what); }; boss.LISTEN(tier::release, e2::form::size::restore, item_ptr) @@ -1433,7 +1433,7 @@ namespace netxs::app::vtm }; boss.LISTEN(tier::preview, e2::form::size::enlarge::maximize, gear) { - boss.RISEUP(tier::request, e2::form::prop::zorder, order, ()); + auto order = boss.base::template riseup(e2::form::prop::zorder); gear.owner.SIGNAL(tier::request, e2::form::prop::viewport, viewport, ()); auto recalc = [](auto& boss, auto viewport) { @@ -2216,7 +2216,7 @@ namespace netxs::app::vtm if (items.size()) // Pass focus to the top most object. { auto last_ptr = items.back(); - item_ptr->RISEUP(tier::request, e2::form::state::keybd::enlist, gear_id_list, ()); + auto gear_id_list = item_ptr->base::riseup(e2::form::state::keybd::enlist); for (auto gear_id : gear_id_list) { if (auto gear_ptr = bell::getref(gear_id))