Logo ROOT   6.18/05
Reference Guide
RVirtualCanvasPainter.hxx
Go to the documentation of this file.
1/// \file ROOT/RVirtualCanvasPainter.hxx
2/// \ingroup Gpad ROOT7
3/// \author Axel Naumann <axel@cern.ch>
4/// \date 2017-05-31
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16#ifndef ROOT7_RVirtualCanvasPainter
17#define ROOT7_RVirtualCanvasPainter
18
19#include "ROOT/RPadPainter.hxx"
20
21#include <memory>
22#include <functional>
23
24namespace ROOT {
25namespace Experimental {
26
28
29class RCanvas;
30class RWebWindow;
31
32namespace Internal {
33
34/** \class ROOT::Experimental::Internal::RVirtualCanvasPainter
35 Abstract interface for painting a canvas.
36 */
37
39protected:
40 class Generator {
41 public:
42 /// Abstract interface to create a RVirtualCanvasPainter implementation.
43 virtual std::unique_ptr<RVirtualCanvasPainter> Create(const RCanvas &canv) const = 0;
44 /// Default destructor.
45 virtual ~Generator();
46 };
47
48 /// generator getter
49 static std::unique_ptr<Generator> &GetGenerator();
50
51public:
52 /// Default destructor.
54
55 /// indicate that canvas changed, provides current version of the canvas
56 virtual void CanvasUpdated(uint64_t, bool, CanvasCallback_t) = 0;
57
58 /// return true if canvas modified since last painting
59 virtual bool IsCanvasModified(uint64_t) const = 0;
60
61 /// perform special action when drawing is ready
62 virtual void DoWhenReady(const std::string &, const std::string &, bool, CanvasCallback_t) = 0;
63
64 virtual void NewDisplay(const std::string &where) = 0;
65
66 virtual int NumDisplays() const = 0;
67
68 /// run canvas functionality in caller thread, not needed when main thread is used
69 virtual void Run(double tm = 0.) = 0;
70
71 virtual bool AddPanel(std::shared_ptr<RWebWindow>) { return false; }
72
73 /// Loads the plugin that implements this class.
74 static std::unique_ptr<RVirtualCanvasPainter> Create(const RCanvas &canv);
75};
76} // namespace Internal
77} // namespace Experimental
78} // namespace ROOT
79
80#endif // ROOT7_RVirtualCanvasPainter
typedef void((*Func_t)())
Abstract interface for object painting on the pad/canvas.
Definition: RPadPainter.hxx:37
virtual std::unique_ptr< RVirtualCanvasPainter > Create(const RCanvas &canv) const =0
Abstract interface to create a RVirtualCanvasPainter implementation.
Abstract interface for painting a canvas.
static std::unique_ptr< RVirtualCanvasPainter > Create(const RCanvas &canv)
Loads the plugin that implements this class.
virtual void CanvasUpdated(uint64_t, bool, CanvasCallback_t)=0
indicate that canvas changed, provides current version of the canvas
virtual ~RVirtualCanvasPainter()
Default destructor.
virtual bool AddPanel(std::shared_ptr< RWebWindow >)
static std::unique_ptr< Generator > & GetGenerator()
generator getter
virtual void Run(double tm=0.)=0
run canvas functionality in caller thread, not needed when main thread is used
virtual void DoWhenReady(const std::string &, const std::string &, bool, CanvasCallback_t)=0
perform special action when drawing is ready
virtual bool IsCanvasModified(uint64_t) const =0
return true if canvas modified since last painting
virtual void NewDisplay(const std::string &where)=0
A window's topmost RPad.
Definition: RCanvas.hxx:33
std::function< void(bool)> CanvasCallback_t
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:151
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21