53#include "RConfigure.h"
133 dropt_entry->SetToolTipText(
"Object Draw Option", 300);
136 lb->Resize(
lb->GetWidth(), 120);
186 "TGFileBrowser",
this,
"DoubleClicked(TGListTreeItem *, Int_t)");
188 "TGFileBrowser",
this,
"Clicked(TGListTreeItem *, Int_t, Int_t, Int_t)");
190 this,
"Checked(TObject*, Bool_t)");
209 "ApplyFilter(Int_t)");
211 this,
"ApplyFilter(Int_t = -1)");
241 "TGFileBrowser",
this,
"Selected(char*)");
244 "TGFileBrowser",
this,
"PadModified()");
365 const char *filter = it->second.c_str();
397 if (
tobj && (
tobj->InheritsFrom(
"TRemoteObject") ||
398 tobj->InheritsFrom(
"TApplicationRemote"))) {
501 "SetRootDir" :
"Add");
510 if (
gROOT->GetListOfFiles() && !
gROOT->GetListOfFiles()->IsEmpty())
572 if(
sname.EndsWith(
".root")) {
607 item->SetUserData(0);
609 itm =
itm->GetNextSibling();
633 if (!prev) prev =
curr;
650 Long_t id = 0, flags = 0, modtime = 0;
675 if ((res == 0) && (flags & 2)) {
691 flags =
id =
size = modtime = 0;
704 itm =
itm->GetNextSibling();
715 itm =
itm->GetNextSibling();
736 if ((opt == 0) || (!opt[0])) {
741 if (
strstr(opt,
"SetRootDir")) {
745 else if (
strstr(opt,
"Add")) {
757 if (
infos.Contains(
"Removable"))
759 else if (
infos.Contains(
"Local"))
761 else if (
infos.Contains(
"CD"))
763 else if (
infos.Contains(
"Network"))
781 if (
itm == 0)
return;
828 if ((
id > 1) && (
id < 5))
830 else if ((
id < 0) || (
id > 4)) {
833 const char *
text =
lbe->GetTitle();
906 if (
topobj &&
topobj->InheritsFrom(
"TApplicationRemote")) {
946 filter = it->second.c_str();
956 filter.
Prepend(
"Showing only \'");
998 Long_t id = 0, flags = 0, modtime = 0;
1011 const char *
clname = ((
TKey *)obj)->GetClassName();
1062 if (
selected->InheritsFrom(
"TLeaf"))
1064 if (
selected->InheritsFrom(
"TBranch"))
1066 if (
selected->InheritsFrom(
"TTree")) {
1092 while ((parent=
itm->GetParent())) {
1101 while (
dirname.Contains(
".lnk")) {
1157 for (i = 0; i <
nchars; i++) {
1158 if (buffer[i] & 128)
1160 if (buffer[i] ==
'\0')
1191 img1->GetPixmap(),
img1->GetMask());
1239 const char *
clname = ((
TKey *)obj)->GetClassName();
1275 TString::Format(
"((TApplicationServer *)gApplication)->BrowseFile(\"%s\");",
1283 if ((
act[0] !=
'!') && (
strcmp(
pitem->GetText(),
"ROOT Files"))) {
1289 if ((
ext.EndsWith(
".root")) && (
strcmp(
pitem->GetText(),
"ROOT Files"))) {
1298 if (
gClient->GetMimeTypeList()->GetAction(obj->
IsA()->GetName(),
action)) {
1303 if (
act.Contains(
"%s"))
act.ReplaceAll(
"%s", obj->
GetName());
1306 if (
act[0] ==
'!') {
1333 flags =
id =
size = modtime = 0;
1379 itm->SetUserData(0);
1395 modtime =
sbuf.fMtime;
1397 if (
sbuf.fIsLink &&
pname.EndsWith(
".lnk"))
1418 if (
size && modtime) {
1437 if (
fname.EndsWith(
".root")) {
1462 else if (
fname.EndsWith(
".png")) {
1479 if (
embed->InheritsFrom(
"TGTextEditor")) {
1483 else if (
embed->InheritsFrom(
"TGTextEdit")) {
1523 if (
act[0] ==
'!') {
1534 if (
act.Contains(
".x") ||
act.Contains(
".X")) {
1566 time_t
loctime = (time_t) modtime;
1623 if (obj->
IsA()->InheritsFrom(
"TGeoVolume")) {
1634 im->Scale(
im->GetWidth()/4,
im->GetHeight()/4);
1635 *
pic =
gClient->GetPicturePool()->GetPicture(iconname,
im->GetPixmap(),
1638 gClient->GetMimeTypeList()->AddType(
"[thumbnail]", iconname, iconname, iconname,
"->Browse()");
1662 if (item == 0)
return;
1685 if (
id == 0x5346414f ||
id == 0x6969 ||
id == 0x65735546 ||
id == 0xff534d42 ||
id == 0x517b)
1691 if (first ==
drive->GetName()) {
1693 if (
infos.Contains(
"Network"))
1699 for (
Int_t i = 0; i <
tokens->GetEntriesFast(); ++i) {
1701 if (
token.Length() == 2 &&
token.EndsWith(
":")) {
1744 for (i=0;i<
tabRight->GetNumberOfTabs();++i) {
1752 if (
embed &&
embed->InheritsFrom(
"TRootCanvas")) {
1778 "Enter filter expression:\n(empty string \"\" or \"*\" to remove filter)",
1782 if ((filter[0] == 0) && (filter[1] == 0)) {
1786 else if (((filter[0] == 0) && (filter[1] == 1)) || !
strcmp(filter,
"*")) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
static Bool_t IsObjectEditable(TClass *cl)
Helper function checking if a class has a graphic properties editor.
static const TGPicture * MakeLinkPic(const TGPicture *pic)
Create a symlink (shortcut on Windows) icon by merging the picture passed as argument and the slink_t...
static const char * FormatToolTip(TObject *obj, Int_t maxlen=0)
Format the tooltip information, based on the object passed in argument.
static Bool_t IsTextFile(const char *candidate)
Returns true if given a text file Uses the specification given on p86 of the Camel book.
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 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 del
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char text
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
char * StrDup(const char *str)
Duplicate the string str.
Bool_t R_ISREG(Int_t mode)
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
virtual Longptr_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=nullptr)
Process a single command line, either a C++ statement or an interpreter command starting with a "....
TApplication * GetAppRemote() const
virtual const char * ApplicationName() const
Each class (see TClass) has a linked list of its base class(es).
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
ABC describing GUI independent browser implementation protocol.
TBrowser * fBrowser
TBrowser associated with this implementation.
Using a TBrowser one can browse all ROOT objects.
void SetDrawOption(Option_t *option="") override
Set drawing option for object.
TClass instances represent classes, structs and namespaces in the ROOT type system.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Helper class used to change the cursor in a method and restore the original one when going out of the...
TCursorSwitcher(TGWindow *w1, TGWindow *w2)
Describe directory structure in memory.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
void FreePicture(const TGPicture *pic)
Free picture resource.
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
virtual TGLBEntry * GetSelectedEntry() const
virtual TGTextEntry * GetTextEntry() const
virtual void AddEntry(TGString *s, Int_t id)
virtual TGListBox * GetListBox() const
The base class for composite widgets (menu bars, list boxes, etc.).
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
virtual TList * GetList() const
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
virtual void ClearViewPort()
Clear view port and redraw full content.
System file browser, used as TRootBrowser plug-in.
TGListTreeItem * fRootDir
Root (list tree) directory.
Int_t fGroupSize
total number of items when icon box switched to "global view" mode
Bool_t CheckFiltered(TGListTreeItem *item, Bool_t but=kFALSE)
Check if there is a filter active on the children of the list tree item.
TString DirName(TGListTreeItem *item)
returns the directory path
TSystemFile * fFile
Actual (selected) system file.
TGHorizontalFrame * fBotFrame
Bottom horizontal frame.
void GetObjPicture(const TGPicture **pic, TObject *obj)
Retrieve icons associated with class "name".
TGListTree * fListTree
Main list tree.
void AddKey(TGListTreeItem *itm, TObject *obj, const char *name=nullptr)
display content of ROOT file
TGFileBrowser(const TGWindow *p, TBrowser *b=nullptr, UInt_t w=200, UInt_t h=400)
TGFileBrowser constructor.
void CreateBrowser()
Create the actual file browser.
Bool_t fShowHidden
kTRUE to display hidden files
Bool_t fDblClick
kTRUE if user double-clicked on a list tree item
TGListTreeItem * fCurrentDir
Current (list tree) directory.
Bool_t CheckSorted(TGListTreeItem *item, Bool_t but=kFALSE)
Check if the list tree item children are alphabetically sorted.
void Clicked(TGListTreeItem *item, Int_t btn, Int_t x, Int_t y)
Process mouse clicks in TGListTree.
void DoubleClicked(TGListTreeItem *item, Int_t btn)
Process double clicks in TGListTree.
void BrowseObj(TObject *obj) override
Browse object.
void ApplyFilter(Int_t id)
Apply filter selected in combo box to the file tree view.
TGPictureButton * fFilterButton
"Filter" button
void PadModified()
Slot used to switch to the tab containing the current pad/canvas (gPad) used e.g.
void GotoDir(const char *path)
Go to the directory "path" and open all the parent list tree items.
void RecursiveRemove(TObject *obj) override
Recursively remove object.
void ToggleSort()
Toggle the sort mode and set the "sort button" state accordingly.
TGListTreeItem * fListLevel
Current list tree level.
void AddRemoteFile(TObject *obj)
Add remote file in list tree.
TString fFilterStr
Filter expression string.
TRegexp * fFilter
Regular expression used to filter files.
void GetFilePictures(const TGPicture **pic, Int_t file_type, Bool_t is_link, const char *name)
Determine the file picture for the given file type.
TSystemDirectory * fDir
Actual (selected) system directory.
Long_t fCnt
Counters for keys inside a Root file.
void Add(TObject *obj, const char *name=nullptr, Int_t check=-1) override
Add items to the browser.
sLTI_t fSortedItems
List of sorted list-tree items.
~TGFileBrowser() override
Destructor.
const TGPicture * fCachedPic
Cached picture.
void RequestFilter()
Open a dialog box asking for a string to be used as filter (regexp), and add an entry in the map of f...
TGComboBox * fFileType
File type combobox.
TGCanvas * fCanvas
Canvas for the list tree.
TContextMenu * fContextMenu
pointer to context menu
TRootBrowser * fNewBrowser
Pointer back to the Browser.
char * FormatFileInfo(const char *fname, Long64_t size, Long_t modtime)
Format file information to be displayed in the tooltip.
TString FullPathName(TGListTreeItem *item)
returns an absolute path
TGPictureButton * fSortButton
"Sort" button
TGComboBox * fDrawOption
Draw options combobox.
void Checked(TObject *obj, Bool_t check)
Emits signal when double clicking on icon.
const TGPicture * fFileIcon
System files icon.
Option_t * GetDrawOption() const override
returns drawing option
TGPictureButton * fRefreshButton
"Refresh" button
void CheckRemote(TGListTreeItem *item)
Check if the current list tree item points to a remote object.
void Update()
Update content of the list tree.
const TGPicture * fRootIcon
Root files icon.
void Selected(char *)
A ROOT File has been selected in TGHtmlBrowser.
void AddFSDirectory(const char *entry, const char *path=nullptr, Option_t *opt="")
Add file system directory in the list tree.
void Refresh(Bool_t force=kFALSE) override
Refresh content of the list tree.
TString fCachedPicName
Cached picture name.
mFiltered_t fFilteredItems
List of filtered list-tree items.
Long_t XXExecuteDefaultAction(TObject *obj)
Execute default action for selected object (action is specified in the $HOME/.root....
void Chdir(TGListTreeItem *item)
Make object associated with item the current directory.
TGHorizontalFrame * fTopFrame
Top horizontal frame.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapWindow() override
map window
A composite frame that layout their children in horizontal way.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
A listbox is a box, possibly with scrollbar, containing entries.
TGListTreeItem * GetFirstChild() const
void Rename(const char *new_name)
virtual const char * GetText() const =0
TGListTreeItem * GetParent() const
virtual void SetTipText(const char *)
void SetDNDSource(Bool_t onoff)
virtual void SetPictures(const TGPicture *, const TGPicture *)
virtual void * GetUserData() const =0
virtual void SetUserData(void *, Bool_t=kFALSE)
A list tree is a widget that can contain a number of items arranged in a tree structure.
TGListTreeItem * FindItemByObj(TGListTreeItem *item, void *ptr)
Find item with fUserData == ptr.
void ClearHighlighted()
Un highlight items.
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
Int_t DeleteChildren(TGListTreeItem *item)
Delete children of item from list.
void CheckItem(TGListTreeItem *item, Bool_t check=kTRUE)
Set check button state for the node 'item'.
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
TGListTreeItem * GetSelected() const
Int_t RecursiveDeleteItem(TGListTreeItem *item, void *userData)
Delete item with fUserData == ptr.
Int_t DeleteItem(TGListTreeItem *item)
Delete item from list tree.
void SetSelected(TGListTreeItem *item)
TGListTreeItem * GetFirstItem() const
TGListTreeItem * FindChildByName(TGListTreeItem *item, const char *name)
Find child of item by name.
Int_t SortChildren(TGListTreeItem *item)
Sort children of item.
void AdjustPosition(TGListTreeItem *item)
Move content to position of item.
void HighlightItem(TGListTreeItem *item)
Highlight item.
TGListTreeItem * FindChildByData(TGListTreeItem *item, void *userData)
Find child of item by userData.
void SetToolTipItem(TGListTreeItem *item, const char *string)
Set tooltip text for this item.
void GetPathnameFromItem(TGListTreeItem *item, char *path, Int_t depth=0)
Get pathname from item.
Defines top level windows that interact with the system Window Manager.
TGClient * fClient
Connection to display server.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Pixmap_t GetPicture() const
A tab widget contains a set of composite frames each with a little tab with a name (like a set of fol...
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
A TGTextEntry is a one line text input widget.
Text string listbox entries.
ROOT GUI Window base class.
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
An abstract interface to image processing library.
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
static TImage * Create()
Create an image.
Utility class for browsing TMapFile objects.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Collectable string class.
Mother of all ROOT objects.
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
virtual const char * GetName() const
Returns name of object.
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
virtual const char * GetIconName() const
Returns mime type name of object.
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetTitle() const
Returns title of object.
virtual TClass * IsA() const
virtual void Draw(Option_t *option="")
Default Draw method for all 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.
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
Regular expression class.
The TRemoteObject class provides protocol for browsing ROOT objects from a remote ROOT session.
This class creates a ROOT object browser, constituted by three main tabs.
void SetActBrowser(TBrowserImp *b)
virtual void Checked(TObject *obj, Bool_t check)
Emits signal when double clicking on icon.
TGTab * GetTabRight() const
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Prepend(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Describes an Operating System directory for the browser.
virtual TList * GetListOfFiles() const
Returns a TList of TSystemFile objects representing the contents of the directory.
A TSystemFile describes an operating system file.
virtual Bool_t IsDirectory(const char *dir=nullptr) const
Check if object is a directory.
virtual int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree)
Get info about a file system: fs type, block size, number of blocks, number of free blocks.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual TList * GetVolumes(Option_t *) const
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual const char * WorkingDirectory()
Return working directory.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
Abstract base class used by ROOT graphics editor.
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
R__ALWAYS_INLINE bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.