Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RWebBrowserImp.cxx
Go to the documentation of this file.
1// Author: Sergey Linev <S.Linev@gsi.de>
2// Date: 2021-02-11
3// Warning: This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
4
5/*************************************************************************
6 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12
14
15#include "TROOT.h"
16#include "TSeqCollection.h" // needed in gROOT->GetListOfFiles()->FindObject
17
18#include <iostream>
19
20using namespace ROOT;
21
22////////////////////////////////////////////////////////////////////////////////////////
23/// Default constructor
24
26{
28
29 fWebBrowser = std::make_shared<RBrowser>();
30 fWebBrowser->AddTCanvas();
31}
32
33////////////////////////////////////////////////////////////////////////////////////////
34/// Constructor with width and height parameters
35
37{
39
40 fWidth = width;
42 fWebBrowser = std::make_shared<RBrowser>();
43 fWebBrowser->AddTCanvas();
44}
45
46////////////////////////////////////////////////////////////////////////////////////////
47/// Constructor with x,y, width and height parameters
48
50{
52
53 fX = x;
54 fY = y;
55 fWidth = width;
57 fWebBrowser = std::make_shared<RBrowser>();
58 fWebBrowser->AddTCanvas();
59}
60
61////////////////////////////////////////////////////////////////////////////////////////
62/// Constructor with width and height parameters
63
65{
66}
67
68////////////////////////////////////////////////////////////////////////////////////////
69/// Show warning that RBrowser will be shown
70
72{
73 static bool show_warn = true;
74 if (!show_warn) return;
75 show_warn = false;
76
77 std::cout << "\n"
78 "ROOT comes with a web-based browser, which is now being started. \n"
79 "Revert to TBrowser by setting \"Browser.Name: TRootBrowser\" in rootrc file or\n"
80 "by starting \"root --web=off\"\n"
81 "Find more info on https://root.cern/for_developers/root7/#rbrowser\n";
82}
83
84////////////////////////////////////////////////////////////////////////////////////////
85/// Iconify browser
86
88{
89}
90
91////////////////////////////////////////////////////////////////////////////////////////
92/// Refresh browser
93
95{
96}
97
98////////////////////////////////////////////////////////////////////////////////////////
99/// Show browser
100
102{
103 fWebBrowser->Show();
104}
105
106
107////////////////////////////////////////////////////////////////////////////////////////
108/// Browse specified object
109
111{
112 if (obj == gROOT) return;
113
114 if (gROOT->GetListOfFiles()->FindObject(obj))
115 fWebBrowser->SetWorkingPath("ROOT Files");
116}
117
118////////////////////////////////////////////////////////////////////////////////////////
119/// Factory method to create RWebBrowserImp via plugin
120
122{
123 return new RWebBrowserImp(b, title, width, height, opt);
124}
125
126////////////////////////////////////////////////////////////////////////////////////////
127/// Factory method to create RWebBrowserImp via plugin
128
130{
131 return new RWebBrowserImp(b, title, x, y, width, height, opt);
132}
#define b(i)
Definition RSha256.hxx:100
const char Option_t
Definition RtypesCore.h:66
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
#define gROOT
Definition TROOT.h:406
void ShowWarning()
Show warning that RBrowser will be shown.
Int_t fHeight
window coordinates
void Show() final
Show browser.
virtual ~RWebBrowserImp()
Constructor with width and height parameters.
void Iconify() final
Iconify browser.
std::shared_ptr< RBrowser > fWebBrowser
actual browser used
void Refresh(Bool_t=kFALSE) final
Refresh browser.
static TBrowserImp * NewBrowser(TBrowser *b=nullptr, const char *title="ROOT Browser", UInt_t width=800, UInt_t height=500, Option_t *opt="")
Factory method to create RWebBrowserImp via plugin.
void BrowseObj(TObject *) final
Browse specified object.
RWebBrowserImp(TBrowser *b=nullptr)
Default constructor.
ABC describing GUI independent browser implementation protocol.
Definition TBrowserImp.h:29
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Mother of all ROOT objects.
Definition TObject.h:41
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.