#ifndef ROOT_TGFileBrowser
#define ROOT_TGFileBrowser
#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TBrowserImp
#include "TBrowserImp.h"
#endif
class TGCanvas;
class TGListTree;
class TGListTreeItem;
class TGPicture;
class TGComboBox;
class TContextMenu;
class TRegexp;
class TString;
class TRootBrowser;
class TSystemDirectory;
class TSystemFile;
class TGFileBrowser : public TGMainFrame, public TBrowserImp {
protected:
TRootBrowser *fNewBrowser;
TGHorizontalFrame *fTopFrame;
TGHorizontalFrame *fBotFrame;
TGCanvas *fCanvas;
TGListTree *fListTree;
TGListTreeItem *fListLevel;
TGListTreeItem *fCurrentDir;
TGListTreeItem *fRootDir;
TGComboBox *fDrawOption;
TGComboBox *fFileType;
TContextMenu *fContextMenu;
const TGPicture *fRootIcon;
const TGPicture *fFileIcon;
const TGPicture *fCachedPic;
TString fCachedPicName;
TRegexp *fFilter;
TSystemDirectory *fDir;
TSystemFile *fFile;
Int_t fGroupSize;
Long_t fNKeys, fCnt;
Bool_t fGrouped;
Bool_t fShowHidden;
void CreateBrowser();
public:
TGFileBrowser(const TGWindow *p, TBrowser* b=0, UInt_t w=200, UInt_t h=400);
virtual ~TGFileBrowser();
virtual void Add(TObject *obj, const char *name = 0, Int_t check = -1);
virtual void BrowseObj(TObject *obj);
virtual void RecursiveRemove(TObject *obj);
virtual void Refresh(Bool_t force = kFALSE);
virtual void Show() { MapRaised(); }
Option_t *GetDrawOption() const;
TRootBrowser *GetNewBrowser() const { return fNewBrowser; }
void SetNewBrowser(TRootBrowser* b) { fNewBrowser = b; }
void AddFSDirectory(const char* entry, const char* path=0, Option_t *opt="");
void AddKey(TGListTreeItem *itm, TObject *obj, const char *name = 0);
void AddRemoteFile(TObject *obj);
void ApplyFilter(Int_t id);
void Chdir(TGListTreeItem *item);
void Checked(TObject *obj, Bool_t check);
void CheckRemote(TGListTreeItem *item);
void Clicked(TGListTreeItem *item, Int_t btn, Int_t x, Int_t y);
TString DirName(TGListTreeItem* item);
TString FullPathName(TGListTreeItem* item);
void DoubleClicked(TGListTreeItem *item, Int_t btn);
Long_t XXExecuteDefaultAction(TObject *obj);
char *FormatFileInfo(const char *fname, Long64_t size, Long_t modtime);
void GetFilePictures(const TGPicture **pic, Int_t file_type, Bool_t is_link, const char *name);
void GetObjPicture(const TGPicture **pic, TObject *obj);
void GotoDir(const char *path);
void Selected(char *);
void Update();
ClassDef(TGFileBrowser, 0)
};
#endif