Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/netxs/desktopio/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace netxs::app

namespace netxs::app::shared
{
static const auto version = "v2026.05.28";
static const auto version = "v2026.05.29";
static const auto repository = "https://github.com/directvt/vtm";
static const auto usr_config = "~/.config/vtm/settings.xml"s;
static const auto sys_config = "/etc/vtm/settings.xml"s;
Expand Down
6 changes: 4 additions & 2 deletions src/netxs/desktopio/directvt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,8 @@ namespace netxs::directvt
}
}
// s11n: Receive image metadata.
void receive_img(s11n::xs::img_list& lock)
template<class P = netxs::noop>
void receive_img(s11n::xs::img_list& lock, P proc = {})
{
auto images = cell::images();
auto is_remote = !!s11n::nat[0];
Expand All @@ -2086,12 +2087,13 @@ namespace netxs::directvt
{
if (auto image_ptr = images.map[local_index])
{
proc(local_index);
auto& image = *image_ptr;
if constexpr (debugmode) log("%%New image metadata:", prompt::s11n);
auto layers_updated = image.receive_image_attributes(new_image.global_attributes);
if (layers_updated)
{
translate_layers(images, image, is_remote);
s11n::translate_layers(images, image, is_remote);
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions src/netxs/desktopio/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2638,6 +2638,8 @@ namespace netxs::gui
auto document_area = bitmap.scaled_fragment_area.shift(offset); // Raster inside the document fragment.
netxs::xform_render(canvas, canvas_clip, raster, document_area, xform, fx);
}
// Image Test.
//rect ph;
auto render_layer(auto& canvas, rect placeholder, argb fgc, imagens::image& image, qiew sub_id, imagens::image::bitmap_t& bitmap, imagens::image::gb_attrs_t& gb_attrs, twod image_WH, bool inv)
{
if (bitmap.fragment.type == sprite::undef && image.document.size())
Expand Down Expand Up @@ -2674,6 +2676,20 @@ namespace netxs::gui
auto offset = placeholder.coor + bitmap.xy + fragment_area_coor;
draw_image(canvas, bitmap, offset, fgc, inv, image_xform);
}
// Image Test.
//if (bitmap.fragment.area)
//{
// netxs::onrect(canvas, rect{ ph.coor + dot_22 + ph.size / dot_33, ph.size / dot_33 }, [](auto& p){ p = argb{ tint::purecyan }; });
//}
//else
//{
// auto clr = image.dom[0] && image.document.size() && bitmap.fragment.type == sprite::undef ? tint::puremagenta
// : !image.document.size() ? tint::pureyellow
// : bitmap.fragment.type != sprite::undef ? tint::purered
// : !image.dom[0] ? tint::purewhite
// : tint::bluedk;
// netxs::onrect(canvas, rect{ ph.coor + dot_22 + ph.size / dot_33, ph.size / dot_33 }, [&](auto& p){ p = argb{ clr }; });
//}
}
void render_layers(gui::bits& canvas, rect placeholder, argb fgc, imagens::image& image, qiew sub_id, imagens::image::bitmap_t& bitmap, imagens::image::gb_attrs_t& gb_attrs, twod image_WH, twod wh, bool inv)
{
Expand Down Expand Up @@ -2702,6 +2718,8 @@ namespace netxs::gui
{
if (auto image_cr = c.get_image_cr(); image_cr.x != 0 && image_cr.y != 0)
{
// Image Test.
//ph = placeholder;
auto image_index = c.get_image_index();
auto wh = c.get_image_WH();
auto images = cell::images(); // Lock.
Expand All @@ -2713,6 +2731,11 @@ namespace netxs::gui
auto& image = *image_ptr;
render_layers(canvas, placeholder, fgc, image, image.sub_id, image.bitmap, image.gb_attrs, image_WH, wh, inv);
}
// Image Test.
//else
//{
// netxs::onrect(canvas, rect{ ph.coor + dot_22, ph.size / dot_33 }, [](auto& p){ p = argb{ tint::puremagenta }; });
//}
}
}
void draw_shadows(auto& canvas, rect placeholder, cell const& c)
Expand Down
2 changes: 1 addition & 1 deletion src/netxs/desktopio/intmath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ namespace netxs
#if defined(DEBUG)
= true;
#else
= faux;
= faux; // SSH could crash if true.
#endif

[[maybe_unused]] static auto _k0 = 0; // LCtrl+Wheel.
Expand Down
29 changes: 27 additions & 2 deletions src/netxs/desktopio/terminal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11070,6 +11070,7 @@ namespace netxs::ui

dtvt& owner; // link: Terminal object reference.
flag waits; // link: Owner is waiting for the correct bitmap size.
std::bitset<65536> touched_images; // link: Affected image indexes.

void direct(s11n::xs::bitmap_dtvt lock, view& data)
{
Expand All @@ -11086,7 +11087,17 @@ namespace netxs::ui
}
void handle(s11n::xs::img_list lock)
{
s11n::receive_img(lock);
//todo unify: make the same for GUI (dirty regions)
s11n::receive_img(lock, [&](ui16 updated_image_index){ touched_images.set(updated_image_index); }); // Update in order to forward to FE.
owner.update_touched_images(touched_images); // Update in order to forward to FE.
for (auto& new_image : lock.thing) // Clear the index of touched images.
{
auto remote_index = new_image.index;
if (auto local_index = s11n::nat[remote_index])
{
touched_images.reset(local_index);
}
}
owner.base::enqueue([&](auto& /*boss*/)
{
owner.base::signal(tier::general, e2::data::image::sync);
Expand Down Expand Up @@ -11125,7 +11136,7 @@ namespace netxs::ui
{
s11n::translate_layers(images, image, is_remote);
}
owner.update_image_bits(image_index);
owner.update_image_bits(image_index); // Update in order to forward to FE.
owner.base::enqueue([&, image_index](auto& /*boss*/) // To avoid deadlock under cell::images.
{
owner.base::signal(tier::general, e2::data::image::update, image_index);
Expand Down Expand Up @@ -11482,6 +11493,20 @@ namespace netxs::ui
auto& grid = bitmap_lock.thing.image;
cell::remove_image_bits(grid, removed_image_indexes);
}
// dtvt: Update touched images on canvas.
void update_touched_images(std::bitset<65536> const& touched_images)
{
auto bitmap_lock = stream.bitmap_dtvt.freeze();
auto& grid = bitmap_lock.thing.image;
for (auto& c : grid)
{
auto image_index = c.get_image_index();
if (touched_images[image_index])
{
c.inc_image_stamp(1);
}
}
}
// dtvt: Update image metadata on canvas.
void update_image_bits(ui16 updated_image_index)
{
Expand Down
Loading