Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGtk4Canvas.h
Go to the documentation of this file.
1// Author: Sergey Linev, GSI 12/08/2026
2
3/*************************************************************************
4 * Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_TGtk4Canvas
12#define ROOT_TGtk4Canvas
13
14#include "TCanvasImp.h"
15
17class Gtk4DrawArea;
18
19namespace ROOT {
20namespace Experimental {
21
22
23class TGtk4Canvas : public TCanvasImp {
24
25protected:
26
29
30 Bool_t fFixedSize = kFALSE; ///<! true when fixed-size canvas is configured
31 UInt_t fClientBits = 0; ///<! latest status bits from client like editor visible or not
32
33 Bool_t PerformUpdate(Bool_t async) override;
35
36 void AssignStatusBits(UInt_t bits);
37
38
39public:
41 ~TGtk4Canvas() override;
42
43 Gtk4DrawArea *GetDrawArea() const { return fDrawArea; }
44
45 Int_t InitWindow() override;
46 void Close() override;
47 void Show() override;
48
50 void GetCanvasGeometry(Int_t wid, UInt_t &w, UInt_t &h) override;
51 void ResizeCanvasWindow(Int_t) override {}
52 void UpdateDisplay(Int_t = 0, Bool_t = kFALSE) override {}
53
54 void ShowMenuBar(Bool_t = kTRUE) override { }
55 void ShowStatusBar(Bool_t = kTRUE) override { }
56 void ShowEditor(Bool_t = kTRUE) override { }
57 void ShowToolBar(Bool_t = kTRUE) override { }
58 void ShowToolTips(Bool_t = kTRUE) override { }
59
60 void ForceUpdate() override;
61
62 void SetWindowPosition(Int_t x, Int_t y) override;
63 void SetWindowSize(UInt_t w, UInt_t h) override;
64 void SetWindowTitle(const char *newTitle) override;
65 void SetCanvasSize(UInt_t w, UInt_t h) override;
66 void SetCursor(ECursor cursor) override;
67 void Iconify() override;
68 void RaiseWindow() override;
69
70 Bool_t HasEditor() const override;
71 Bool_t HasMenuBar() const override;
72 Bool_t HasStatusBar() const override;
73 Bool_t HasToolBar() const override { return kFALSE; }
74 Bool_t HasToolTips() const override;
75
76 static TCanvasImp *NewCanvas(TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height);
77
78 ClassDefOverride(TGtk4Canvas, 0) // Gtk4 implementation for TCanvasImp
79};
80
81} // namespace Experimental
82} // namespace ROOT
83
84#endif
ECursor
Definition GuiTypes.h:373
#define c(i)
Definition RSha256.hxx:101
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:78
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
#define ClassDefOverride(name, id)
Definition Rtypes.h:347
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize wid
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetCursor
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
char name[80]
Definition TGX11.cxx:142
Int_t InitWindow() override
Initialize window for the Gtk4 canvas.
void ShowToolBar(Bool_t=kTRUE) override
Definition TGtk4Canvas.h:57
void Show() override
Show canvas.
void GetCanvasGeometry(Int_t wid, UInt_t &w, UInt_t &h) override
Returns canvas geometry.
void ShowStatusBar(Bool_t=kTRUE) override
Definition TGtk4Canvas.h:55
Bool_t HasStatusBar() const override
Returns kTRUE if web canvas has status bar.
void RaiseWindow() override
Raise browser window.
void ResizeCanvasWindow(Int_t) override
Resize canvas window, redirect to gVirtualX.
Definition TGtk4Canvas.h:51
void AssignStatusBits(UInt_t bits)
Assign clients bits.
TGtk4Canvas(TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height)
Constructor.
Bool_t HasToolTips() const override
Returns kTRUE if tooltips are activated in web canvas.
void Close() override
Close canvas - not implemented.
Bool_t HasEditor() const override
Returns kTRUE if web canvas has graphical editor.
void Iconify() override
Iconify browser window.
void UpdateDisplay(Int_t=0, Bool_t=kFALSE) override
Update canvas display, also optionally sleep to wait until operation finished.
Definition TGtk4Canvas.h:52
static TCanvasImp * NewCanvas(TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height)
Static method to create TGtk4Canvas instance Used by plugin manager to directly create TGtk4Canvas wi...
~TGtk4Canvas() override
Destructor.
UInt_t GetWindowGeometry(Int_t &x, Int_t &y, UInt_t &w, UInt_t &h) override
Returns window geometry including borders and menus.
UInt_t fClientBits
! latest status bits from client like editor visible or not
Definition TGtk4Canvas.h:31
void SetWindowPosition(Int_t x, Int_t y) override
Set window position of web canvas.
Bool_t HasMenuBar() const override
Returns kTRUE if web canvas has menu bar.
void ForceUpdate() override
Increment canvas version and force sending data to client - do not wait for reply.
void SetWindowTitle(const char *newTitle) override
Set window title of web canvas.
void ShowToolTips(Bool_t=kTRUE) override
Definition TGtk4Canvas.h:58
Gtk4CanvasWindow * fCanvasWindow
Definition TGtk4Canvas.h:27
Bool_t HasToolBar() const override
Definition TGtk4Canvas.h:73
TVirtualPadPainter * CreatePadPainter() override
Creates pad painter.
Bool_t fFixedSize
! true when fixed-size canvas is configured
Definition TGtk4Canvas.h:30
void SetCanvasSize(UInt_t w, UInt_t h) override
Set fixed canvas size - not supported yet in gtk.
Gtk4DrawArea * GetDrawArea() const
Definition TGtk4Canvas.h:43
void ShowEditor(Bool_t=kTRUE) override
Definition TGtk4Canvas.h:56
void SetWindowSize(UInt_t w, UInt_t h) override
Set window size of web canvas.
void ShowMenuBar(Bool_t=kTRUE) override
Definition TGtk4Canvas.h:54
Bool_t PerformUpdate(Bool_t async) override
if canvas or any subpad was modified, invoke gtk4 queue_draw() which will trigger redraw area
ABC describing GUI independent main window (with menubar, scrollbars and a drawing area).
Definition TCanvasImp.h:31
The Canvas class.
Definition TCanvas.h:23
To make it possible to use GL for 2D graphic in a TPad/TCanvas.
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17