Skip to content

[asimage] move TVirtualX and X11 specific methods to extra library - #23732

Draft
linev wants to merge 12 commits into
root-project:masterfrom
linev:image_lessx
Draft

linev wants to merge 12 commits into
root-project:masterfrom
linev:image_lessx

Conversation

@linev

@linev linev commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

This is final step to prepare TASImage and TCanvas classes to be free from gVirtualX in ROOT7

Currently there are several methods which require X11 and gVirtualX in TASImage
Copy such methods to extra library with TASUtils class.
Link libGui with this library.
All respective TASImage methods mark as deprecated for removal in ROOT7.

While TPadPainter need to use functionality from TASUtils class - create special library for
TPadPainter. This was planned from very beginning, but realized only now!
Thus one removes major gVirtualX-dependend code from Gpad library.
Provide special "native" plugin to create instance of TPadPainter.
Classical TRootCanvas returns instance of TPadPainter as well - so in most of the cases plugin not necessary.

Macro galaxy_image.C shows user case when plugin is required.
In this macro ASImage palette editor is shown, which uses TPad without canvas implementation.

Work in progress ...

@linev linev self-assigned this Oct 16, 2026
@linev
linev requested a review from bellenot as a code owner October 16, 2026 08:59
@linev
linev requested a review from silverweed as a code owner October 16, 2026 08:59
@linev linev added the in:GUI label Oct 16, 2026
@linev
linev marked this pull request as draft October 16, 2026 08:59
@linev
linev force-pushed the image_lessx branch 2 times, most recently from ad50a5d to 5c8e9cb Compare October 16, 2026 15:03
linev added 12 commits October 16, 2026 17:14
Used by TASPaletteEditor to display gradient palette
One then can use directly TASImage::Paint to paint created palette
This let avoid direct usage of special methods
Let return selected ASVisual as return value of TASImage::InitVisual(). Use batch for first time in Mirror method
It will be place for special TASImage methods which require
X11 and gVirtualX functionality.

In ROOT7 old deprecated methods will be removed from TASImage itself.
These are TASImage methods which require gVirtualX and X11, therefore they are extracted
Main reason that it uses ASImage and TVirtualX and is main source of
gVirtualX dependency in Gpad. Plus new ASImageUtils library now implement
extra X11-related and gVirtualX-related methods which need to be used by pad painter.

Register plugin "native" for pad painter - as it was forseen from the very beginning.

TRootCanvas now links to new library and returns instance of TPadPainter.
These methods were introduced recently and replaced by
special TASUtils methods. Only there X11 and gVirtualX should be used
Fill TASImage context with gVirtualX pixmap data
Replace correspondent TASImage::SetImage() functionality
Used to generate different icons.
Adjust methods where pic->SetImage(pixmap, mask) was used.
Use std::unique_ptr<TImage> in all touched methods to ensure ownership
Functionality provided in TASUtils and TGWindow classes
Method will be removed in ROOT7
It should replace TASImage::PaintImage(),
but without selection of paint region.
Therefore only full image can be painted
Also use unique_ptr to avoid memory leaks
@github-actions

Copy link
Copy Markdown

Test Results

    15 files      15 suites   2d 15h 0m 49s ⏱️
 3 866 tests  3 861 ✅ 0 💤  5 ❌
53 245 runs  53 200 ✅ 0 💤 45 ❌

For more details on these failures, see this check.

Results for commit 17383a6.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant