Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGHtmlBrowser.cxx
Go to the documentation of this file.
1// @(#)root/guitml:$Id$
2// Author: Bertrand Bellenot 26/09/2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TROOT.h"
13#include "TSystem.h"
14#include "TGMenu.h"
15#include "TGComboBox.h"
16#include "TGButton.h"
17#include "TGTextBuffer.h"
18#include "TGTextEntry.h"
19#include "TGStatusBar.h"
20#include "TGFileDialog.h"
21#include "TFile.h"
22#include "TBrowser.h"
23#include "TGHtml.h"
24#include "TString.h"
25#include "TUrl.h"
26#include "TSocket.h"
27#include "TGHtmlBrowser.h"
28#include "TGText.h"
29#include "TError.h"
30#include "TVirtualX.h"
31#include "HelpText.h"
32#include "TRootHelpDialog.h"
33#include "snprintf.h"
34#ifdef R__SSL
35#include "TSSLSocket.h"
36#endif
37#ifdef WIN32
38#include "TWin32SplashThread.h"
39#endif
40
41#include <cstdlib>
42
43/** \class TGHtmlBrowser
44 \ingroup guihtml
45
46A very simple HTML browser.
47
48*/
49
50
51
61
62static const char *gHtmlFTypes[] = {
63 "HTML files", "*.htm*",
64 "All files", "*",
65 0, 0
66};
67
68const char *HtmlError[] = {
69"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\"> ",
70"<HTML><HEAD><TITLE>RHTML cannot display the webpage</TITLE> ",
71"<META http-equiv=Content-Type content=\"text/html; charset=UTF-8\"></HEAD> ",
72"<BODY> ",
73"<TABLE cellSpacing=0 cellPadding=0 width=730 border=0> ",
74" <TBODY> ",
75" <TR> ",
76" <TD id=infoIconAlign vAlign=top align=left width=60 rowSpan=2> ",
77" <IMG src=\"info.gif\"> ",
78" </TD> ",
79" <TD id=mainTitleAlign vAlign=center align=left width=*> ",
80" <H1 id=mainTitle>RHTML cannot display the webpage</H1></TD></TR> ",
81" <TR> ",
82" <TD class=errorCodeAndDivider id=errorCodeAlign align=right>&nbsp; ",
83" <DIV class=divider></DIV></TD></TR> ",
84" <TR> ",
85" <UL> ",
86" </UL> ",
87" <TD>&nbsp; </TD> ",
88" <TD id=MostLikelyAlign vAlign=top align=left> ",
89" <H3 id=likelyCauses>Most likely causes:</H3> ",
90" <UL> ",
91" <LI id=causeNotConnected>You are not connected to the Internet. ",
92" <LI id=causeSiteProblem>The website is encountering problems. ",
93" <LI id=causeErrorInAddress>There might be a typing error in the address. ",
94" <LI id=causeOtherError> ",
95" </LI></UL></TD></TR> ",
96" <TR> ",
97" <TD id=infoBlockAlign vAlign=top align=right>&nbsp; </TD> ",
98" <TD id=moreInformationAlign vAlign=center align=left> ",
99" <H4> ",
100" <TABLE> ",
101" <TBODY> ",
102" <TR> ",
103" <TD vAlign=top><SPAN id=moreInfoContainer></SPAN><ID ",
104" id=moreInformation>More information</ID> ",
105" </TD></TR></TBODY></TABLE></H4> ",
106" <DIV class=infoBlock id=infoBlockID> ",
107" <P><ID id=errorExpl1>This problem can be caused by a variety of issues, ",
108" including:</ID> ",
109" <UL> ",
110" <LI id=errorExpl2>Internet connectivity has been lost. ",
111" <LI id=errorExpl3>The website is temporarily unavailable. ",
112" <LI id=errorExpl4>The Domain Name Server (DNS) is not reachable. ",
113" <LI id=errorExpl5>The Domain Name Server (DNS) does not have a listing ",
114" for the website's domain. ",
115" <P></P> ",
116" <P></P></DIV></TD></TR></TBODY></TABLE></BODY></HTML> ",
1170
118};
119
120////////////////////////////////////////////////////////////////////////////////
121/// TGHtmlBrowser constructor.
122
124 : TGMainFrame(p, w, h)
125{
127 fNbFavorites = 1000;
128 fMenuBar = new TGMenuBar(this, 35, 50, kHorizontalFrame);
129
130 fMenuFile = new TGPopupMenu(gClient->GetDefaultRoot());
131 fMenuFile->AddEntry(" &Open...\tCtrl+O", kM_FILE_OPEN, 0,
132 gClient->GetPicture("ed_open.png"));
133 fMenuFile->AddEntry(" Save &As...\tCtrl+A", kM_FILE_SAVEAS, 0,
134 gClient->GetPicture("ed_save.png"));
135 fMenuFile->AddEntry(" &Browse...\tCtrl+B", kM_FILE_BROWSE);
137 fMenuFile->AddEntry(" E&xit\tCtrl+Q", kM_FILE_EXIT, 0,
138 gClient->GetPicture("bld_exit.png"));
139 fMenuFile->Associate(this);
140
141 fMenuFavorites = new TGPopupMenu(gClient->GetDefaultRoot());
142 fMenuFavorites->AddEntry("&Add to Favorites", kM_FAVORITES_ADD, 0,
143 gClient->GetPicture("bld_plus.png"));
145 fMenuFavorites->AddEntry("http://root.cern", fNbFavorites++, 0,
146 gClient->GetPicture("htmlfile.gif"));
148
149 fMenuTools = new TGPopupMenu(gClient->GetDefaultRoot());
150 fMenuTools->AddEntry("&Clear History", kM_TOOLS_CLEARHIST, 0,
151 gClient->GetPicture("ed_delete.png"));
152 fMenuTools->Associate(this);
153
154 fMenuHelp = new TGPopupMenu(gClient->GetDefaultRoot());
155 fMenuHelp->AddEntry(" &About...", kM_HELP_ABOUT, 0, gClient->GetPicture("about.xpm"));
156 fMenuHelp->Associate(this);
157
158 fMenuBar->AddPopup("&File", fMenuFile, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
159 fMenuBar->AddPopup("&Favorites", fMenuFavorites, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
160 fMenuBar->AddPopup("&Tools", fMenuTools, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
162
164
165 // vertical frame
167
169
170 fBack = new TGPictureButton(fHorizontalFrame,gClient->GetPicture("GoBack.gif"));
171 fBack->SetStyle(gClient->GetStyle());
172 fBack->SetToolTipText("Go Back");
174 fBack->Connect("Clicked()", "TGHtmlBrowser", this, "Back()");
175
176 fForward = new TGPictureButton(fHorizontalFrame,gClient->GetPicture("GoForward.gif"));
177 fForward->SetStyle(gClient->GetStyle());
178 fForward->SetToolTipText("Go Forward");
180 fForward->Connect("Clicked()", "TGHtmlBrowser", this, "Forward()");
181
182 fReload = new TGPictureButton(fHorizontalFrame,gClient->GetPicture("ReloadPage.gif"));
183 fReload->SetStyle(gClient->GetStyle());
184 fReload->SetToolTipText("Reload Page");
186 fReload->Connect("Clicked()", "TGHtmlBrowser", this, "Reload()");
187
188 fStop = new TGPictureButton(fHorizontalFrame,gClient->GetPicture("StopLoading.gif"));
189 fStop->SetStyle(gClient->GetStyle());
190 fStop->SetToolTipText("Stop Loading");
192 fStop->Connect("Clicked()", "TGHtmlBrowser", this, "Stop()");
193
194 fHome = new TGPictureButton(fHorizontalFrame,gClient->GetPicture("GoHome.gif"));
195 fHome->SetStyle(gClient->GetStyle());
196 fHome->SetToolTipText("Go to ROOT HomePage\n (http://root.cern)");
198 fHome->Connect("Clicked()", "TGHtmlBrowser", this, "Selected(=\"http://root.cern\")");
199
200 // combo box
201 fURLBuf = new TGTextBuffer(256);
206 fURL->Connect("ReturnPressed()", "TGHtmlBrowser", this, "URLChanged()");
207
208 if (filename) {
211 }
212 fComboBox->Select(0);
213 fComboBox->Connect("Selected(char *)", "TGHtmlBrowser", this, "Selected(char *)");
214
216
218
219 // embedded canvas
220 fHtml = new TGHtml(fVerticalFrame, 10, 10, -1);
222
224
225 // status bar
226 fStatusBar = new TGStatusBar(this,100,20);
227 Int_t partsusBar[] = {75,25};
230
231 fHtml->Connect("MouseOver(const char *)", "TGHtmlBrowser", this, "MouseOver(const char *)");
232 fHtml->Connect("MouseDown(const char *)", "TGHtmlBrowser", this, "MouseDown(const char *)");
233
236 MapWindow();
237 Resize(w, h);
238
239 if (filename)
241}
242
243////////////////////////////////////////////////////////////////////////////////
244/// Read (open) remote files.
245
246Ssiz_t ReadSize(const char *url)
247{
248 char buf[4096];
249 TUrl fUrl(url);
250
251 // Give full URL so Apache's virtual hosts solution works.
252 TString msg = "HEAD ";
253 msg += fUrl.GetProtocol();
254 msg += "://";
255 msg += fUrl.GetHost();
256 msg += ":";
257 msg += fUrl.GetPort();
258 msg += "/";
259 msg += fUrl.GetFile();
260 msg += " HTTP/1.0";
261 msg += "\r\n";
262 msg += "User-Agent: ROOT-TWebFile/1.1";
263 msg += "\r\n\r\n";
264
265 TSocket *s;
266 TString uri(url);
267 if (!uri.BeginsWith("http://") && !uri.BeginsWith("https://"))
268 return 0;
269 if (uri.BeginsWith("https://")) {
270#ifdef R__SSL
271 s = new TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
272#else
273 ::Error("ReadSize", "library compiled without SSL, https not supported");
274 return 0;
275#endif
276 }
277 else {
278 s = new TSocket(fUrl.GetHost(), fUrl.GetPort());
279 }
280 if (!s->IsValid()) {
281 delete s;
282 return 0;
283 }
284 if (s->SendRaw(msg.Data(), msg.Length()) == -1) {
285 delete s;
286 return 0;
287 }
288 if (s->RecvRaw(buf, 4096) == -1) {
289 delete s;
290 return 0;
291 }
292 TString reply(buf);
293 Ssiz_t idx = reply.Index("Content-length:", 0, TString::kIgnoreCase);
294 if (idx > 0) {
295 idx += 15;
296 TString slen = reply(idx, reply.Length() - idx);
297 delete s;
298 return (Ssiz_t)atol(slen.Data());
299 }
300 delete s;
301 return 0;
302}
303
304////////////////////////////////////////////////////////////////////////////////
305/// Read (open) remote files.
306
307static char *ReadRemote(const char *url)
308{
309 static char *buf = 0;
310 TUrl fUrl(url);
311
313 if (size <= 0) size = 1024*1024;
314
315 TString msg = "GET ";
316 msg += fUrl.GetProtocol();
317 msg += "://";
318 msg += fUrl.GetHost();
319 msg += ":";
320 msg += fUrl.GetPort();
321 msg += "/";
322 msg += fUrl.GetFile();
323 msg += "\r\n";
324
325 TSocket *s;
326 TString uri(url);
327 if (!uri.BeginsWith("http://") && !uri.BeginsWith("https://"))
328 return 0;
329 if (uri.BeginsWith("https://")) {
330#ifdef R__SSL
331 s = new TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
332#else
333 ::Error("ReadRemote", "library compiled without SSL, https not supported");
334 return 0;
335#endif
336 }
337 else {
338 s = new TSocket(fUrl.GetHost(), fUrl.GetPort());
339 }
340 if (!s->IsValid()) {
341 delete s;
342 return 0;
343 }
344 if (s->SendRaw(msg.Data(), msg.Length()) == -1) {
345 delete s;
346 return 0;
347 }
348 buf = (char *)calloc(size+1, sizeof(char));
349 if (s->RecvRaw(buf, size) == -1) {
350 free(buf);
351 delete s;
352 return 0;
353 }
354 delete s;
355 return buf;
356}
357
358////////////////////////////////////////////////////////////////////////////////
359/// Open (browse) selected URL.
360
361void TGHtmlBrowser::Selected(const char *uri)
362{
363 char *buf = 0;
364 FILE *f;
365
366 if (CheckAnchors(uri))
367 return;
368
370 if (!surl.BeginsWith("http://") && !surl.BeginsWith("https://") &&
371 !surl.BeginsWith("ftp://") && !surl.BeginsWith("file://")) {
372 if (surl.BeginsWith("file:"))
373 surl.ReplaceAll("file:", "file://");
374 else
375 surl.Prepend("file://");
376 }
377 if (surl.EndsWith(".root")) {
378 // in case of root file, just open it and refresh browsers
379 gVirtualX->SetCursor(fHtml->GetId(), gVirtualX->CreateCursor(kWatch));
380 gROOT->ProcessLine(Form("TFile::Open(\"%s\");", surl.Data()));
381 Clicked((char *)surl.Data());
382 gROOT->RefreshBrowsers();
383 gVirtualX->SetCursor(fHtml->GetId(), gVirtualX->CreateCursor(kPointer));
384 return;
385 }
386 gVirtualX->SetCursor(fHtml->GetId(), gVirtualX->CreateCursor(kWatch));
387 TUrl url(surl.Data());
388 if (surl.EndsWith(".pdf", TString::kIgnoreCase)) {
389 // special case: open pdf files with external viewer
390 // works only on Windows for the time being...
391 if (!gVirtualX->InheritsFrom("TGX11")) {
392 TString cmd = TString::Format("explorer %s", surl.Data());
393 gSystem->Exec(cmd.Data());
394 }
395 gVirtualX->SetCursor(fHtml->GetId(), gVirtualX->CreateCursor(kPointer));
396 return;
397 }
398 if (surl.EndsWith(".gif") || surl.EndsWith(".jpg") || surl.EndsWith(".png")) {
399 // special case: single picture
400 fHtml->Clear();
401 char imgHtml[1024];
402 snprintf(imgHtml, 1000, "<IMG src=\"%s\"> ", surl.Data());
404 fHtml->SetBaseUri(url.GetUrl());
405 fURL->SetText(surl.Data());
406 if (!fComboBox->FindEntry(surl.Data()))
408 fHtml->Layout();
409 gVirtualX->SetCursor(fHtml->GetId(), gVirtualX->CreateCursor(kPointer));
410 return;
411 }
412 if (!strcmp(url.GetProtocol(), "http") ||
413 !strcmp(url.GetProtocol(), "https")) {
414 // standard web page
415 buf = ReadRemote(url.GetUrl());
416 if (buf) {
417 fHtml->Clear();
418 fHtml->Layout();
419 fHtml->SetBaseUri(url.GetUrl());
420 fHtml->ParseText(buf);
421 free(buf);
422 fURL->SetText(surl.Data());
423 if (!fComboBox->FindEntry(surl.Data()))
425 }
426 else {
427 fHtml->Clear();
428 fHtml->Layout();
429 fHtml->SetBaseUri("");
430 for (int i=0; HtmlError[i]; i++) {
431 fHtml->ParseText((char *)HtmlError[i]);
432 }
433 }
434 }
435 else {
436 // local file
437 f = fopen(url.GetFile(), "r");
438 if (f) {
439 TString fpath = url.GetUrl();
440 fpath.ReplaceAll(gSystem->BaseName(fpath.Data()), "");
441 fpath.ReplaceAll("file://", "");
442 fHtml->Clear();
443 fHtml->Layout();
444 fHtml->SetBaseUri(fpath.Data());
445 buf = (char *)calloc(4096, sizeof(char));
446 if (buf) {
447 while (fgets(buf, 4096, f)) {
448 fHtml->ParseText(buf);
449 }
450 free(buf);
451 }
452 fclose(f);
453 fURL->SetText(surl.Data());
454 if (!fComboBox->FindEntry(surl.Data()))
456 }
457 else {
458 fHtml->Clear();
459 fHtml->Layout();
460 fHtml->SetBaseUri("");
461 for (int i=0; HtmlError[i]; i++) {
462 fHtml->ParseText((char *)HtmlError[i]);
463 }
464 }
465 }
466 // restore cursor
467 gVirtualX->SetCursor(fHtml->GetId(), gVirtualX->CreateCursor(kPointer));
468 fHtml->Layout();
469 Ssiz_t idx = surl.Last('#');
470 if (idx > 0) {
471 idx +=1; // skip #
472 TString anchor = surl(idx, surl.Length() - idx);
473 fHtml->GotoAnchor(anchor.Data());
474 }
475 SetWindowName(Form("%s - RHTML",surl.Data()));
476}
477
478////////////////////////////////////////////////////////////////////////////////
479/// URL combobox has changed.
480
482{
483 const char *string = fURL->GetText();
484 if (string) {
485 Selected(gSystem->UnixPathName(string));
486 }
487}
488
489////////////////////////////////////////////////////////////////////////////////
490/// Handle "Back" navigation button.
491
493{
494 Int_t index = 0;
495 const char *string = fURL->GetText();
496 TGLBEntry * lbe1 = fComboBox->FindEntry(string);
497 if (lbe1)
498 index = lbe1->EntryId();
499 if (index > 0) {
502 if (entry) {
503 string = entry->GetTitle();
504 if (string)
505 Selected(string);
506 }
507 }
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Check if we just change position in the page (using anchor)
512/// and return kTRUE if any anchor has been found and followed.
513
515{
517
518 if (!fHtml->GetBaseUri())
519 return kFALSE;
521 Ssiz_t idx = surl.Last('#');
522 Ssiz_t idy = actual.Last('#');
523 TString short1(surl.Data());
524 TString short2(actual.Data());
525 if (idx > 0)
526 short1 = surl(0, idx);
527 if (idy > 0)
528 short2 = actual(0, idy);
529
530 if (short1 == short2) {
531 if (idx > 0) {
532 idx +=1; // skip #
533 TString anchor = surl(idx, surl.Length() - idx);
534 fHtml->GotoAnchor(anchor.Data());
535 }
536 else {
538 }
539 fHtml->SetBaseUri(surl.Data());
540 if (!fComboBox->FindEntry(surl.Data()))
542 fURL->SetText(surl.Data());
544 SetWindowName(Form("%s - RHTML",surl.Data()));
545 return kTRUE;
546 }
547 return kFALSE;
548}
549
550////////////////////////////////////////////////////////////////////////////////
551/// Handle "Forward" navigation button.
552
554{
555 Int_t index = 0;
556 const char *string = fURL->GetText();
557 TGLBEntry * lbe1 = fComboBox->FindEntry(string);
558 if (lbe1)
559 index = lbe1->EntryId();
560 if (index < fComboBox->GetNumberOfEntries()) {
563 if (entry) {
564 string = entry->GetTitle();
565 if (string)
566 Selected(string);
567 }
568 }
569}
570
571////////////////////////////////////////////////////////////////////////////////
572/// Handle "Reload" navigation button.
573
575{
576 const char *string = fURL->GetText();
577 if (string)
578 Selected(string);
579}
580
581////////////////////////////////////////////////////////////////////////////////
582/// Handle "Reload" navigation button.
583
585{
586}
587
588////////////////////////////////////////////////////////////////////////////////
589/// Handle "MouseOver" TGHtml signal.
590
592{
594}
595
596////////////////////////////////////////////////////////////////////////////////
597/// Handle "MouseDown" TGHtml signal.
598
600{
601 Selected(url);
602}
603
604////////////////////////////////////////////////////////////////////////////////
605/// Process Events.
606
608{
609 switch (GET_MSG(msg)) {
610 case kC_COMMAND:
611 {
612 switch (GET_SUBMSG(msg)) {
613
614 case kCM_MENU:
615 case kCM_BUTTON:
616
617 switch(parm1) {
618
619 case kM_FILE_EXIT:
620 CloseWindow();
621 break;
622
623 case kM_FILE_OPEN:
624 {
625 static TString dir(".");
627 fi.fFileTypes = gHtmlFTypes;
628 fi.SetIniDir(dir);
629 new TGFileDialog(fClient->GetRoot(), this,
630 kFDOpen, &fi);
631 dir = fi.fIniDir;
632 if (fi.fFilename) {
633 Selected(Form("file://%s",
634 gSystem->UnixPathName(fi.fFilename)));
635 }
636 }
637 break;
638
639 case kM_FILE_SAVEAS:
640 {
641 static TString sdir(".");
643 fi.fFileTypes = gHtmlFTypes;
644 fi.SetIniDir(sdir);
645 new TGFileDialog(fClient->GetRoot(), this,
646 kFDSave, &fi);
647 sdir = fi.fIniDir;
648 if (fi.fFilename) {
650 txt.Save(gSystem->UnixPathName(fi.fFilename));
651 }
652 }
653 break;
654
655 case kM_FAVORITES_ADD:
657 fURL->GetText()), fNbFavorites++, 0,
658 gClient->GetPicture("htmlfile.gif"));
659 break;
660
663 break;
664
665 case kM_FILE_BROWSE:
666 new TBrowser();
667 break;
668
669 case kM_HELP_ABOUT:
670 {
671#ifdef WIN32
673#else
674 char str[32];
675 snprintf(str, 32, "About ROOT %s...", gROOT->GetVersion());
676 TRootHelpDialog *hd = new TRootHelpDialog(this, str,
677 600, 400);
678 hd->SetText(gHelpAbout);
679 hd->Popup();
680#endif
681 }
682 break;
683
684 default:
685 {
686 if (parm1 < 1000) break;
688 if (!entry) break;
689 const char *shortcut = entry->GetName();
690 if (shortcut)
692 }
693 break;
694 }
695 break;
696 }
697 break;
698 }
699 }
700 return kTRUE;
701}
702
@ kWatch
Definition GuiTypes.h:375
@ kPointer
Definition GuiTypes.h:375
@ kVerticalFrame
Definition GuiTypes.h:381
@ kHorizontalFrame
Definition GuiTypes.h:382
R__EXTERN const char gHelpAbout[]
Definition HelpText.h:17
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
int Ssiz_t
String size (currently int)
Definition RtypesCore.h:81
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
#define gClient
Definition TGClient.h:157
@ kFDOpen
@ kFDSave
@ kDeepCleanup
Definition TGFrame.h:42
const char * HtmlError[]
EMyMessageTypes
@ kM_HELP_ABOUT
@ kM_FILE_EXIT
@ kM_FAVORITES_ADD
@ kM_FILE_OPEN
@ kM_TOOLS_CLEARHIST
@ kM_FILE_SAVEAS
@ kM_FILE_BROWSE
Ssiz_t ReadSize(const char *url)
Read (open) remote files.
static const char * gHtmlFTypes[]
static char * ReadRemote(const char *url)
Read (open) remote files.
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
@ kM_HELP_ABOUT
@ kM_FILE_EXIT
@ kM_FILE_OPEN
@ kM_FILE_SAVEAS
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
#define gROOT
Definition TROOT.h:411
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
#define gVirtualX
Definition TVirtualX.h:337
Int_t GET_MSG(Long_t val)
@ kCM_MENU
@ kC_COMMAND
@ kCM_BUTTON
Int_t GET_SUBMSG(Long_t val)
#define free
Definition civetweb.c:1578
#define calloc
Definition civetweb.c:1576
#define snprintf
Definition civetweb.c:1579
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:439
virtual void SetStyle(UInt_t newstyle)
Set the button style (modern or classic).
Definition TGButton.cxx:265
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:223
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
virtual TGLBEntry * GetSelectedEntry() const
Definition TGComboBox.h:115
virtual TGTextEntry * GetTextEntry() const
Definition TGComboBox.h:111
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Definition TGComboBox.h:105
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
virtual Int_t GetNumberOfEntries() const
Definition TGComboBox.h:107
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:318
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1064
This class creates a file selection dialog.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:193
void MapWindow() override
map window
Definition TGFrame.h:206
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:387
void Reload()
Handle "Reload" navigation button.
Bool_t CheckAnchors(const char *)
Check if we just change position in the page (using anchor) and return kTRUE if any anchor has been f...
TGTextBuffer * fURLBuf
void MouseOver(const char *)
Handle "MouseOver" TGHtml signal.
void Back()
Handle "Back" navigation button.
TGVerticalFrame * fVerticalFrame
TGHtmlBrowser(const char *filename=nullptr, const TGWindow *p=nullptr, UInt_t w=900, UInt_t h=600)
TGHtmlBrowser constructor.
TGPopupMenu * fMenuHelp
TGPictureButton * fStop
TGMenuBar * fMenuBar
void Selected(const char *txt)
Open (browse) selected URL.
void MouseDown(const char *)
Handle "MouseDown" TGHtml signal.
TGPictureButton * fHome
TGHorizontalFrame * fHorizontalFrame
void Clicked(char *uri)
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t) override
Process Events.
TGPopupMenu * fMenuFile
TGPictureButton * fBack
TGStatusBar * fStatusBar
TGPopupMenu * fMenuFavorites
TGPictureButton * fForward
void Forward()
Handle "Forward" navigation button.
void Stop()
Handle "Reload" navigation button.
TGPictureButton * fReload
TGTextEntry * fURL
void URLChanged()
URL combobox has changed.
TGComboBox * fComboBox
TGPopupMenu * fMenuTools
The ROOT HTML widget.
Definition TGHtml.h:873
int GotoAnchor(const char *name)
Go to anchor position.
Definition TGHtml.cxx:460
int ParseText(char *text, const char *index=nullptr)
Appends (or insert at the specified position) the given HTML text to the end of any HTML text that ma...
Definition TGHtml.cxx:324
void SetBaseUri(const char *uri)
Sets base URI.
Definition TGHtml.cxx:450
const char * GetBaseUri() const
Definition TGHtml.h:907
void Clear(Option_t *="") override
Erase all HTML from this widget and clear the screen.
Definition TGHtml.cxx:309
const char * GetText() const
Definition TGHtml.h:962
Basic listbox entries.
Definition TGListBox.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:399
virtual void CloseWindow()
Close and delete main frame.
Definition TGFrame.cxx:1762
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1780
The TGMenu.h header contains all different menu classes.
Definition TGMenu.h:282
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=nullptr)
Add popup menu to menu bar.
Definition TGMenu.cxx:414
This class contains all information about a menu entry.
Definition TGMenu.h:57
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
Yield an action as soon as it is clicked.
Definition TGButton.h:228
This class creates a popup menu object.
Definition TGMenu.h:110
virtual TGMenuEntry * GetEntry(Int_t id)
Find entry with specified id.
Definition TGMenu.cxx:1893
virtual void Associate(const TGWindow *w)
Definition TGMenu.h:206
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1056
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu entry.
Definition TGMenu.cxx:986
Provides a StatusBar widget.
Definition TGStatusBar.h:21
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
TGTextBuffer * GetBuffer() const
const char * GetText() const
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
Text string listbox entries.
Definition TGListBox.h:48
A TGText is a multi line text buffer.
Definition TGText.h:57
A composite frame that layout their children in vertical way.
Definition TGFrame.h:376
void Layout() override
layout view
Definition TGView.cxx:344
virtual void ScrollToPosition(TGLongPosition newPos)
Scroll the canvas to pos.
Definition TGView.cxx:451
ROOT GUI Window base class.
Definition TGWindow.h:23
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:865
A TRootHelpDialog is used to display help text (or any text in a dialog window).
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
Definition TSocket.cxx:889
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
Definition TSocket.cxx:611
virtual Bool_t IsValid() const
Definition TSocket.h:130
Basic string class.
Definition TString.h:138
@ kIgnoreCase
Definition TString.h:285
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition TString.h:631
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2384
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition TSystem.cxx:651
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1073
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:944
This class represents a WWW compatible URL.
Definition TUrl.h:33
const char * GetFile() const
Definition TUrl.h:69
const char * GetHost() const
Definition TUrl.h:67
const char * GetProtocol() const
Definition TUrl.h:64
Int_t GetPort() const
Definition TUrl.h:78