59 "HTML files",
"*.htm*",
65 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\"> ",
66 "<HTML><HEAD><TITLE>RHTML cannot display the webpage</TITLE> ",
67 "<META http-equiv=Content-Type content=\"text/html; charset=UTF-8\"></HEAD> ",
69 "<TABLE cellSpacing=0 cellPadding=0 width=730 border=0> ",
72 " <TD id=infoIconAlign vAlign=top align=left width=60 rowSpan=2> ",
73 " <IMG src=\"info.gif\"> ",
75 " <TD id=mainTitleAlign vAlign=center align=left width=*> ",
76 " <H1 id=mainTitle>RHTML cannot display the webpage</H1></TD></TR> ",
78 " <TD class=errorCodeAndDivider id=errorCodeAlign align=right> ",
79 " <DIV class=divider></DIV></TD></TR> ",
84 " <TD id=MostLikelyAlign vAlign=top align=left> ",
85 " <H3 id=likelyCauses>Most likely causes:</H3> ",
87 " <LI id=causeNotConnected>You are not connected to the Internet. ",
88 " <LI id=causeSiteProblem>The website is encountering problems. ",
89 " <LI id=causeErrorInAddress>There might be a typing error in the address. ",
90 " <LI id=causeOtherError> ",
91 " </LI></UL></TD></TR> ",
93 " <TD id=infoBlockAlign vAlign=top align=right> </TD> ",
94 " <TD id=moreInformationAlign vAlign=center align=left> ",
99 " <TD vAlign=top><SPAN id=moreInfoContainer></SPAN><ID ",
100 " id=moreInformation>More information</ID> ",
101 " </TD></TR></TBODY></TABLE></H4> ",
102 " <DIV class=infoBlock id=infoBlockID> ",
103 " <P><ID id=errorExpl1>This problem can be caused by a variety of issues, ",
106 " <LI id=errorExpl2>Internet connectivity has been lost. ",
107 " <LI id=errorExpl3>The website is temporarily unavailable. ",
108 " <LI id=errorExpl4>The Domain Name Server (DNS) is not reachable. ",
109 " <LI id=errorExpl5>The Domain Name Server (DNS) does not have a listing ",
110 " for the website's domain. ",
112 " <P></P></DIV></TD></TR></TBODY></TABLE></BODY></HTML> ",
128 gClient->GetPicture(
"ed_open.png"));
130 gClient->GetPicture(
"ed_save.png"));
134 gClient->GetPicture(
"bld_exit.png"));
139 gClient->GetPicture(
"bld_plus.png"));
142 gClient->GetPicture(
"htmlfile.gif"));
147 gClient->GetPicture(
"ed_delete.png"));
170 fBack->
Connect(
"Clicked()",
"TGHtmlBrowser",
this,
"Back()");
188 fStop->
Connect(
"Clicked()",
"TGHtmlBrowser",
this,
"Stop()");
194 fHome->
Connect(
"Clicked()",
"TGHtmlBrowser",
this,
"Selected(=\"http://root.cern.ch\")");
202 fURL->
Connect(
"ReturnPressed()",
"TGHtmlBrowser",
this,
"URLChanged()");
209 fComboBox->
Connect(
"Selected(char *)",
"TGHtmlBrowser",
this,
"Selected(char *)");
223 Int_t partsusBar[] = {75,25};
227 fHtml->
Connect(
"MouseOver(const char *)",
"TGHtmlBrowser",
this,
"MouseOver(const char *)");
228 fHtml->
Connect(
"MouseDown(const char *)",
"TGHtmlBrowser",
this,
"MouseDown(const char *)");
258 msg +=
"User-Agent: ROOT-TWebFile/1.1";
269 if (
s.RecvRaw(buf, 4096) == -1) {
287 static char *buf = 0;
291 if (size <= 0) size = 1024*1024;
311 buf = (
char *)
calloc(size+1,
sizeof(
char));
312 if (
s.RecvRaw(buf, size) == -1) {
331 if (!surl.BeginsWith(
"http://") && !surl.BeginsWith(
"ftp://") &&
332 !surl.BeginsWith(
"file://")) {
333 if (surl.BeginsWith(
"file:"))
338 if (surl.EndsWith(
".root")) {
341 gROOT->ProcessLine(
Form(
"TFile::Open(\"%s\");", surl.Data()));
343 gROOT->RefreshBrowsers();
348 TUrl url(surl.Data());
359 if (surl.EndsWith(
".gif") || surl.EndsWith(
".jpg") || surl.EndsWith(
".png")) {
363 snprintf(imgHtml, 1000,
"<IMG src=\"%s\"> ", surl.Data());
373 if ((!strcmp(url.GetProtocol(),
"http"))) {
397 f = fopen(url.GetFile(),
"r");
405 buf = (
char *)
calloc(4096,
sizeof(
char));
407 while (fgets(buf, 4096, f)) {
429 Ssiz_t idx = surl.Last(
'#');
432 TString anchor = surl(idx, surl.Length() - idx);
481 Ssiz_t idx = surl.Last(
'#');
486 short1 = surl(0, idx);
488 short2 = actual(0, idy);
490 if (short1 == short2) {
493 TString anchor = surl(idx, surl.Length() - idx);
520 if (index < fComboBox->GetNumberOfEntries()) {
618 gClient->GetPicture(
"htmlfile.gif"));
651 if (parm1 < 1000)
break;
654 const char *shortcut = entry->
GetName();
void Selected(const char *txt)
Open (browse) selected URL.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual TGTextEntry * GetTextEntry() const
TGHtmlBrowser(const char *filename=0, const TGWindow *p=0, UInt_t w=900, UInt_t h=600)
TGHtmlBrowser constructor.
int GotoAnchor(const char *name)
Go to anchor position.
virtual void Layout()
layout view
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
const TGWindow * GetRoot() const
Returns current root (i.e.
This class represents a WWW compatible URL.
TString & ReplaceAll(const TString &s1, const TString &s2)
const char * GetProtocol() const
virtual void Clear(Option_t *="")
Erase all HTML from this widget and clear the screen.
void MouseOver(const char *)
Handle "MouseOver" TGHtml signal.
void MouseDown(const char *)
Handle "MouseDown" TGHtml signal.
virtual const char * GetTitle() const
Returns title of object.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void Forward()
Handle "Forward" navigation button.
TString & Prepend(const char *cs)
R__EXTERN const char gHelpAbout[]
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
const char * GetFile() const
void Stop()
Handle "Reload" navigation button.
void Back()
Handle "Back" navigation button.
const char * GetHost() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
static char * ReadRemote(const char *url)
Read (open) remote files.
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 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t)
Process Events.
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
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 * GetBuffer() const
Using a TBrowser one can browse all ROOT objects.
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...
void URLChanged()
URL combobox has changed.
R__EXTERN TSystem * gSystem
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
virtual void CloseWindow()
Close and delete main frame.
int ParseText(char *text, const char *index=0)
Appends (or insert at the specified position) the given HTML text to the end of any HTML text that ma...
char * Form(const char *fmt,...)
Ssiz_t ReadSize(const char *url)
Read (open) remote files.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Bool_t Save(const char *fn)
Save text buffer to file fn.
char * StrDup(const char *str)
Duplicate the string str.
const char * GetBaseUri() const
const char * GetText() const
TGPopupMenu * fMenuFavorites
virtual UInt_t GetDefaultHeight() const
const char * GetText() const
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
virtual void AddEntry(TGString *s, Int_t id)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
static const char * gHtmlFTypes[]
static constexpr double s
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void ScrollToPosition(TGLongPosition newPos)
Scroll the canvas to pos.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual Int_t GetNumberOfEntries() const
TGPictureButton * fForward
void SetBaseUri(const char *uri)
Sets base URI.
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
void Reload()
Handle "Reload" navigation button.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
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...
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
TGVerticalFrame * fVerticalFrame
TGPictureButton * fReload
virtual TGLBEntry * GetSelectedEntry() const
const char * Data() const
TGHorizontalFrame * fHorizontalFrame