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#include "TEnv.h"
18
19#include <iostream>
20
21using namespace ROOT;
22
23////////////////////////////////////////////////////////////////////////////////////////
24/// Default constructor
25
27{
29
30 fWebBrowser = std::make_shared<RBrowser>();
31 fWebBrowser->AddTCanvas();
32}
33
34////////////////////////////////////////////////////////////////////////////////////////
35/// Constructor with width and height parameters
36
38{
40
41 fWidth = width;
43 fWebBrowser = std::make_shared<RBrowser>();
44 fWebBrowser->AddTCanvas();
45}
46
47////////////////////////////////////////////////////////////////////////////////////////
48/// Constructor with x,y, width and height parameters
49
51{
53
54 fX = x;
55 fY = y;
56 fWidth = width;
58 fWebBrowser = std::make_shared<RBrowser>();
59 fWebBrowser->AddTCanvas();
60}
61
62////////////////////////////////////////////////////////////////////////////////////////
63/// Constructor with width and height parameters
64
68
69////////////////////////////////////////////////////////////////////////////////////////
70/// Show warning that RBrowser will be shown
71
73{
74 static bool show_warn = true;
75 if (!show_warn)
76 return;
77
78 TString value = gEnv->GetValue("WebGui.Warning", "yes");
79 if ((value != "yes") && (value != "1"))
80 return;
81
82 show_warn = false;
83
84 std::cout << "\n"
85 "ROOT comes with a web-based browser, which is now being started. \n"
86 "Revert to TBrowser by setting \"Browser.Name: TRootBrowser\" in rootrc file or\n"
87 "by starting \"root --web=off\"\n"
88 "Find more info on https://root.cern/for_developers/root7/#rbrowser\n";
89}
90
91////////////////////////////////////////////////////////////////////////////////////////
92/// Iconify browser
93
97
98////////////////////////////////////////////////////////////////////////////////////////
99/// Refresh browser
100
104
105////////////////////////////////////////////////////////////////////////////////////////
106/// Show browser
107
109{
110 fWebBrowser->Show();
111}
112
113
114////////////////////////////////////////////////////////////////////////////////////////
115/// Browse specified object
116
118{
119 if (obj == gROOT) return;
120
121 if (gROOT->GetListOfFiles()->FindObject(obj))
122 fWebBrowser->SetWorkingPath("ROOT Files");
123}
124
125////////////////////////////////////////////////////////////////////////////////////////
126/// Factory method to create RWebBrowserImp via plugin
127
129{
130 return new RWebBrowserImp(b, title, width, height, opt);
131}
132
133////////////////////////////////////////////////////////////////////////////////////////
134/// Factory method to create RWebBrowserImp via plugin
135
137{
138 return new RWebBrowserImp(b, title, x, y, width, height, opt);
139}
#define b(i)
Definition RSha256.hxx:100
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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:411
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
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:491
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:138
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Namespace for new ROOT classes and functions.