File indexing completed on 2025-01-18 10:10:49
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ROOT7_RVirtualCanvasPainter
0010 #define ROOT7_RVirtualCanvasPainter
0011
0012 #include <memory>
0013 #include <functional>
0014 #include <string>
0015
0016 namespace ROOT {
0017
0018 class RWebWindow;
0019
0020 namespace Experimental {
0021
0022 using CanvasCallback_t = std::function<void(bool)>;
0023
0024 class RCanvas;
0025
0026 namespace Internal {
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 class RVirtualCanvasPainter {
0037 protected:
0038 class Generator {
0039 public:
0040
0041 virtual std::unique_ptr<RVirtualCanvasPainter> Create(RCanvas &canv) const = 0;
0042
0043 virtual ~Generator();
0044 };
0045
0046
0047 static std::unique_ptr<Generator> &GetGenerator();
0048
0049 public:
0050
0051 virtual ~RVirtualCanvasPainter();
0052
0053
0054 virtual void CanvasUpdated(uint64_t, bool, CanvasCallback_t) = 0;
0055
0056
0057 virtual bool IsCanvasModified(uint64_t) const = 0;
0058
0059
0060 virtual void DoWhenReady(const std::string &, const std::string &, bool, CanvasCallback_t) = 0;
0061
0062
0063 virtual bool ProduceBatchOutput(const std::string &, int, int) = 0;
0064
0065
0066 virtual std::string ProduceJSON() = 0;
0067
0068 virtual void NewDisplay(const std::string &where) = 0;
0069
0070 virtual int NumDisplays() const = 0;
0071
0072 virtual std::string GetWindowAddr() const = 0;
0073
0074 virtual std::string GetWindowUrl(bool remote) = 0;
0075
0076
0077 virtual void Run(double tm = 0.) = 0;
0078
0079 virtual bool AddPanel(std::shared_ptr<ROOT::RWebWindow>) { return false; }
0080
0081 virtual void SetClearOnClose(const std::shared_ptr<void> &) {}
0082
0083
0084 static std::unique_ptr<RVirtualCanvasPainter> Create(RCanvas &canv);
0085 };
0086 }
0087 }
0088 }
0089
0090 #endif