Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
RVirtualCanvasPainter.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_RVirtualCanvasPainter
10#define ROOT7_RVirtualCanvasPainter
11
12#include <cstdint>
13#include <memory>
14#include <functional>
15#include <string>
16
17namespace ROOT {
18
19class RWebWindow;
20
21namespace Experimental {
22
23using CanvasCallback_t = std::function<void(bool)>;
24
25class RCanvas;
26
27namespace Internal {
28
29/** \class ROOT::Experimental::Internal::RVirtualCanvasPainter
30\ingroup GpadROOT7
31\brief Abstract interface for painting a canvas.
32\author Axel Naumann <axel@cern.ch>
33\date 2017-05-31
34\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
35*/
36
38protected:
39 class Generator {
40 public:
41 /// Abstract interface to create a RVirtualCanvasPainter implementation.
42 virtual std::unique_ptr<RVirtualCanvasPainter> Create(RCanvas &canv) const = 0;
43 /// Default destructor.
44 virtual ~Generator();
45 };
46
47 /// generator getter
48 static std::unique_ptr<Generator> &GetGenerator();
49
50public:
51 /// Default destructor.
53
54 /// indicate that canvas changed, provides current version of the canvas
55 virtual void CanvasUpdated(uint64_t, bool, CanvasCallback_t) = 0;
56
57 /// return true if canvas modified since last painting
58 virtual bool IsCanvasModified(uint64_t) const = 0;
59
60 /// perform special action when drawing is ready
61 virtual void DoWhenReady(const std::string &, const std::string &, bool, CanvasCallback_t) = 0;
62
63 /// produce file output in batch mode like png, jpeg, svg or pdf
64 virtual bool ProduceBatchOutput(const std::string &, int, int) = 0;
65
66 /// produce canvas JSON
67 virtual std::string ProduceJSON() = 0;
68
69 virtual void NewDisplay(const std::string &where) = 0;
70
71 virtual int NumDisplays() const = 0;
72
73 virtual std::string GetWindowAddr() const = 0;
74
75 virtual std::string GetWindowUrl(bool remote) = 0;
76
77 /// run canvas functionality in caller thread, not needed when main thread is used
78 virtual void Run(double tm = 0.) = 0;
79
80 virtual bool AddPanel(std::shared_ptr<ROOT::RWebWindow>) { return false; }
81
82 virtual void SetClearOnClose(const std::shared_ptr<void> &) {}
83
84 /// Loads the plugin that implements this class.
85 static std::unique_ptr<RVirtualCanvasPainter> Create(RCanvas &canv);
86};
87} // namespace Internal
88} // namespace Experimental
89} // namespace ROOT
90
91#endif // ROOT7_RVirtualCanvasPainter
virtual std::unique_ptr< RVirtualCanvasPainter > Create(RCanvas &canv) const =0
Abstract interface to create a RVirtualCanvasPainter implementation.
virtual void CanvasUpdated(uint64_t, bool, CanvasCallback_t)=0
indicate that canvas changed, provides current version of the canvas
virtual bool AddPanel(std::shared_ptr< ROOT::RWebWindow >)
virtual void Run(double tm=0.)=0
run canvas functionality in caller thread, not needed when main thread is used
virtual bool ProduceBatchOutput(const std::string &, int, int)=0
produce file output in batch mode like png, jpeg, svg or pdf
virtual std::string GetWindowUrl(bool remote)=0
virtual void DoWhenReady(const std::string &, const std::string &, bool, CanvasCallback_t)=0
perform special action when drawing is ready
static std::unique_ptr< Generator > & GetGenerator()
generator getter
virtual ~RVirtualCanvasPainter()
Default destructor.
virtual std::string ProduceJSON()=0
produce canvas JSON
virtual bool IsCanvasModified(uint64_t) const =0
return true if canvas modified since last painting
virtual void SetClearOnClose(const std::shared_ptr< void > &)
virtual void NewDisplay(const std::string &where)=0
static std::unique_ptr< RVirtualCanvasPainter > Create(RCanvas &canv)
Loads the plugin that implements this class.
virtual std::string GetWindowAddr() const =0
A window's topmost RPad.
Definition RCanvas.hxx:47
std::function< void(bool)> CanvasCallback_t
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...