Logo ROOT  
Reference Guide
TGFSContainer.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 19/01/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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 
13  This source is based on Xclass95, a Win95-looking GUI toolkit.
14  Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15 
16  Xclass95 is free software; you can redistribute it and/or
17  modify it under the terms of the GNU Library General Public
18  License as published by the Free Software Foundation; either
19  version 2 of the License, or (at your option) any later version.
20 
21 **************************************************************************/
22 
23 //////////////////////////////////////////////////////////////////////////
24 // //
25 // TGFileIcon, TGFileEntry, TGFSContainer //
26 // //
27 // Utility classes used by the file selection dialog (TGFSDialog). //
28 // //
29 //////////////////////////////////////////////////////////////////////////
30 
31 #include "TGFSContainer.h"
32 #include "TGIcon.h"
33 #include "TGMsgBox.h"
34 #include "TGMimeTypes.h"
35 #include "TRegexp.h"
36 #include "TList.h"
37 #include "TSystem.h"
38 #include "TVirtualX.h"
39 #include "TGDNDManager.h"
40 #include "TRemoteObject.h"
41 #include "TBufferFile.h"
42 #include "TImage.h"
43 #include "snprintf.h"
44 
45 #include <ctime>
46 #include <cstdlib>
47 #include <iostream>
48 
51 
52 class TViewUpdateTimer : public TTimer {
53 
54 private:
55  TGFileContainer *fContainer;
56 
57 public:
58  TViewUpdateTimer(TGFileContainer *t, Long_t ms) : TTimer(ms, kTRUE) { fContainer = t; }
59  Bool_t Notify();
60 };
61 
62 
63 
64 class TGFileIcon : public TGIcon {
65 
66 protected:
67  const TGPicture *fLpic; // icon picture
68 
69  virtual void DoRedraw();
70 
71 public:
72  TGFileIcon(const TGWindow *p, const TGPicture *pic, const TGPicture *lpic,
73  UInt_t options = kChildFrame, Pixel_t back = GetWhitePixel()) :
74  TGIcon(p, pic, 0, 0, options, back) { fLpic = lpic; }
75 };
76 
77 
78 
79 ////////////////////////////////////////////////////////////////////////////////
80 
81 class TGFSFrameElement : public TGFrameElement {
82 public:
83  TGFileContainer *fContainer; // file container
84 
85  Bool_t IsSortable() const { return kTRUE; }
86  Int_t Compare(const TObject *obj) const;
87 };
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 /// Sort frame elements in file selection list view container.
91 
92 Int_t TGFSFrameElement::Compare(const TObject *obj) const
93 {
94  Int_t type1, type2;
95 
96  TGFileItem *f1 = (TGFileItem *) fFrame;
97  TGFileItem *f2 = (TGFileItem *) ((TGFrameElement *) obj)->fFrame;
98 
99  switch (fContainer->fSortType) {
100  default:
101  case kSortByName:
102  //--- this is not exactly what I want...
103  type1 = f1->GetType();
104  type2 = f2->GetType();
105 
106  //--- use posix macros
107  if (R_ISDIR(type1)) type1 = 1;
108  else type1 = 6;
109 
110  if (R_ISDIR(type2)) type2 = 1;
111  else type2 = 6;
112 
113  if (type1 < type2) return -1;
114  if (type1 > type2) return 1;
115  return strcmp(f1->GetItemName()->GetString(),
116  f2->GetItemName()->GetString());
117 
118  case kSortByOwner:
119  if (f1->GetUid() != f2->GetUid()) {
120  if (f1->GetUid() < f2->GetUid())
121  return -1;
122  else
123  return +1;
124  }
125 
126  // else sort by name
127  type1 = f1->GetType();
128  type2 = f2->GetType();
129 
130  //--- use posix macros
131  if (R_ISDIR(type1)) type1 = 1;
132  else type1 = 6;
133 
134  if (R_ISDIR(type2)) type2 = 1;
135  else type2 = 6;
136 
137  if (type1 < type2) return -1;
138  if (type1 > type2) return 1;
139  return strcmp(f1->GetItemName()->GetString(),
140  f2->GetItemName()->GetString());
141 
142  case kSortByGroup:
143  if (f1->GetGid() != f2->GetGid()) {
144  if (f1->GetGid() < f2->GetGid())
145  return -1;
146  else
147  return +1;
148  }
149 
150  // else sort by name
151  type1 = f1->GetType();
152  type2 = f2->GetType();
153 
154  //--- use posix macros
155  if (R_ISDIR(type1)) type1 = 1;
156  else type1 = 6;
157 
158  if (R_ISDIR(type2)) type2 = 1;
159  else type2 = 6;
160 
161  if (type1 < type2) return -1;
162  if (type1 > type2) return 1;
163  return strcmp(f1->GetItemName()->GetString(),
164  f2->GetItemName()->GetString());
165 
166  case kSortByType:
167  //--- this is not exactly what I want...
168 
169  type1 = f1->GetType();
170  type2 = f2->GetType();
171 
172  //--- use posix macros
173 
174  if (R_ISDIR(type1)) type1 = 1;
175  else if (R_ISLNK(type1)) type1 = 2;
176  else if (R_ISSOCK(type1)) type1 = 3;
177  else if (R_ISFIFO(type1)) type1 = 4;
178  else if (R_ISREG(type1) && (type1 & kS_IXUSR)) type1 = 5;
179  else type1 = 6;
180 
181  if (R_ISDIR(type2)) type2 = 1;
182  else if (R_ISLNK(type2)) type2 = 2;
183  else if (R_ISSOCK(type2)) type2 = 3;
184  else if (R_ISFIFO(type2)) type2 = 4;
185  else if (R_ISREG(type2) && (type2 & kS_IXUSR)) type2 = 5;
186  else type2 = 6;
187 
188  if (type1 < type2) return -1;
189  if (type1 > type2) return 1;
190  return strcmp(f1->GetItemName()->GetString(),
191  f2->GetItemName()->GetString());
192 
193  case kSortBySize:
194  if (f1->GetSize() < f2->GetSize()) return -1;
195  if (f1->GetSize() > f2->GetSize()) return 1;
196  return strcmp(f1->GetItemName()->GetString(),
197  f2->GetItemName()->GetString());
198 
199  case kSortByDate:
200  time_t loctimeF1 = (time_t) f1->GetModTime();
201  // coverity[returned_null]
202  struct tm tmF1 = *localtime(&loctimeF1);
203 
204  time_t loctimeF2 = (time_t) f2->GetModTime();
205  // coverity[returned_null]
206  struct tm tmF2 = *localtime(&loctimeF2);
207 
208  if ( tmF1.tm_year != tmF2.tm_year )
209  return (tmF1.tm_year < tmF2.tm_year) ? +1 : -1;
210  else if ( tmF1.tm_mon != tmF2.tm_mon )
211  return (tmF1.tm_mon < tmF2.tm_mon) ? +1 : -1;
212  else if ( tmF1.tm_mday != tmF2.tm_mday )
213  return (tmF1.tm_mday < tmF2.tm_mday) ? +1 : -1;
214  else if ( tmF1.tm_hour != tmF2.tm_hour )
215  return (tmF1.tm_hour < tmF2.tm_hour) ? +1 : -1;
216  else if ( tmF1.tm_min != tmF2.tm_min )
217  return (tmF1.tm_min < tmF2.tm_min) ? +1 : -1;
218  else if ( tmF1.tm_sec != tmF2.tm_sec )
219  return (tmF1.tm_sec < tmF2.tm_sec) ? +1 : -1;
220  else
221  return 0;
222  }
223 }
224 
225 
226 ////////////////////////////////////////////////////////////////////////////////
227 /// Reset the timer.
228 
229 Bool_t TViewUpdateTimer::Notify()
230 {
231  fContainer->HandleTimer(0);
232  Reset();
233  return kFALSE;
234 }
235 
236 
237 ////////////////////////////////////////////////////////////////////////////////
238 /// Draw icon.
239 
240 void TGFileIcon::DoRedraw()
241 {
243  if (fLpic) fLpic->Draw(fId, GetBckgndGC()(), 0, 0);
244 }
245 
246 
247 ////////////////////////////////////////////////////////////////////////////////
248 /// Create a list view item.
249 
251  const TGPicture *bpic, const TGPicture *blpic,
252  const TGPicture *spic, const TGPicture *slpic,
253  TGString *name, Int_t type, Long64_t size, Int_t uid,
254  Int_t gid, Long_t modtime, EListViewMode viewMode,
255  UInt_t options, ULong_t back) :
256  TGLVEntry(p, bpic, spic, name, 0, viewMode, options, back)
257 {
258  FileStat_t buf;
259 
260  buf.fMode = type;
261  buf.fSize = size;
262  buf.fUid = uid;
263  buf.fGid = gid;
264  buf.fMtime = modtime;
265  buf.fIsLink = (blpic != 0); // FIXME: hack...
266 
267  Init(blpic, slpic, buf, viewMode);
268 }
269 
270 ////////////////////////////////////////////////////////////////////////////////
271 /// Create a list view item.
272 
274  const TGPicture *bpic, const TGPicture *blpic,
275  const TGPicture *spic, const TGPicture *slpic,
276  TGString *name, FileStat_t &stat, EListViewMode viewMode,
277  UInt_t options, ULong_t back) :
278  TGLVEntry(p, bpic, spic, name, 0, viewMode, options, back)
279 {
280  Init(blpic, slpic, stat, viewMode);
281 }
282 
283 ////////////////////////////////////////////////////////////////////////////////
284 /// Common initializer for file list view item.
285 
286 void TGFileItem::Init(const TGPicture *blpic, const TGPicture *slpic,
287  FileStat_t &stat, EListViewMode viewMode)
288 {
289  char tmp[256];
290  Long64_t fsize, bsize;
291 
292  fBuf = 0;
293  fDNDData.fData = 0;
294  fDNDData.fDataLength = 0;
295  fDNDData.fDataType = 0;
296  fLcurrent =
297  fBlpic = blpic;
298  fSlpic = slpic;
299 
300  fViewMode = (EListViewMode) -1;
301  SetViewMode(viewMode);
302 
303  fType = stat.fMode;
304  fSize = stat.fSize;
305  fUid = stat.fUid;
306  fGid = stat.fGid;
307  fModTime = stat.fMtime;
308  fIsLink = stat.fIsLink;
309 
310  fSubnames = new TGString* [6];
311 
312  // file type
313  snprintf(tmp, sizeof(tmp), "%c%c%c%c%c%c%c%c%c%c",
314  (fIsLink ?
315  'l' :
316  R_ISREG(fType) ?
317  '-' :
318  (R_ISDIR(fType) ?
319  'd' :
320  (R_ISCHR(fType) ?
321  'c' :
322  (R_ISBLK(fType) ?
323  'b' :
324  (R_ISFIFO(fType) ?
325  'p' :
326  (R_ISSOCK(fType) ?
327  's' : '?' )))))),
328  ((fType & kS_IRUSR) ? 'r' : '-'),
329  ((fType & kS_IWUSR) ? 'w' : '-'),
330  ((fType & kS_ISUID) ? 's' : ((fType & kS_IXUSR) ? 'x' : '-')),
331  ((fType & kS_IRGRP) ? 'r' : '-'),
332  ((fType & kS_IWGRP) ? 'w' : '-'),
333  ((fType & kS_ISGID) ? 's' : ((fType & kS_IXGRP) ? 'x' : '-')),
334  ((fType & kS_IROTH) ? 'r' : '-'),
335  ((fType & kS_IWOTH) ? 'w' : '-'),
336  ((fType & kS_ISVTX) ? 't' : ((fType & kS_IXOTH) ? 'x' : '-')));
337  fSubnames[0] = new TGString(tmp);
338 
339  // file size
340  fsize = bsize = fSize;
341  if (fsize > 1024) {
342  fsize /= 1024;
343  if (fsize > 1024) {
344  // 3.7MB is more informative than just 3MB
345  snprintf(tmp, sizeof(tmp), "%lld.%lldM", fsize/1024, (fsize%1024)/103);
346  } else {
347  snprintf(tmp, sizeof(tmp), "%lld.%lldK", bsize/1024, (bsize%1024)/103);
348  }
349  } else {
350  snprintf(tmp, sizeof(tmp), "%lld", bsize);
351  }
352  fSubnames[1] = new TGString(tmp);
353 
354  {
355  struct UserGroup_t *user_group;
356 
357  user_group = gSystem->GetUserInfo(fUid);
358  if (user_group) {
359  fSubnames[2] = new TGString(user_group->fUser);
360  fSubnames[3] = new TGString(user_group->fGroup);
361  delete user_group;
362  } else {
363  fSubnames[2] = new TGString(TString::Format("%d", fUid));
364  fSubnames[3] = new TGString(TString::Format("%d", fGid));
365  }
366  }
367 
368  struct tm *newtime;
369  time_t loctime = (time_t) fModTime;
370  newtime = localtime(&loctime);
371  if (newtime) {
372  snprintf(tmp, sizeof(tmp), "%d-%02d-%02d %02d:%02d", newtime->tm_year + 1900,
373  newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour,
374  newtime->tm_min);
375  fSubnames[4] = new TGString(tmp);
376  }
377  else
378  fSubnames[4] = new TGString("1901-01-01 00:00");
379 
380  fSubnames[5] = 0;
381 
382  int i;
383  for (i = 0; fSubnames[i] != 0; ++i)
384  ;
385  fCtw = new int[i+1];
386  fCtw[i] = 0;
387  for (i = 0; fSubnames[i] != 0; ++i)
388  fCtw[i] = gVirtualX->TextWidth(fFontStruct, fSubnames[i]->GetString(),
389  fSubnames[i]->GetLength());
390 
391  SetWindowName();
392 }
393 
394 ////////////////////////////////////////////////////////////////////////////////
395 /// Destructor.
396 
398 {
399  delete fBuf;
400 }
401 
402 ////////////////////////////////////////////////////////////////////////////////
403 /// Set container item view mode.
404 
406 {
407  TGLVEntry::SetViewMode(viewMode);
408 
409  if (viewMode == kLVLargeIcons)
410  fLcurrent = fBlpic;
411  else
412  fLcurrent = fSlpic;
413 
414  if (fClient) fClient->NeedRedraw(this);
415 }
416 
417 ////////////////////////////////////////////////////////////////////////////////
418 /// Draw list view container item.
419 
421 {
422  int ix, iy;
423 
425  if (!fLcurrent) return;
426 
427  if (fViewMode == kLVLargeIcons) {
428  ix = (fWidth - fLcurrent->GetWidth()) >> 1;
429  iy = 0;
430  } else {
431  ix = 0;
432  iy = (fHeight - fLcurrent->GetHeight()) >> 1;
433  }
434 
435  fLcurrent->Draw(fId, fNormGC, ix, iy);
436 }
437 
438 ////////////////////////////////////////////////////////////////////////////////
439 /// Handle drag and drop enter
440 
442 {
443  if (!IsDNDTarget()) return kNone;
444  return gVirtualX->InternAtom("application/root", kFALSE);
445 }
446 
447 ////////////////////////////////////////////////////////////////////////////////
448 /// Set drag and drop data
449 
451 {
452  if (fDNDData.fDataLength > 0)
454  fDNDData.fData = calloc(sizeof(unsigned char), data->fDataLength);
455  if (fDNDData.fData)
456  memcpy(fDNDData.fData, data->fData, data->fDataLength);
458  fDNDData.fDataType = data->fDataType;
459 }
460 
461 ////////////////////////////////////////////////////////////////////////////////
462 /// Set drag and drop object
463 
465 {
466  if (fDNDData.fDataLength)
468  fBuf->WriteObject(obj);
469  fDNDData.fData = fBuf->Buffer();
471  fDNDData.fDataType = gVirtualX->InternAtom("application/root", kFALSE);
472 }
473 
474 
475 
476 ////////////////////////////////////////////////////////////////////////////////
477 /// Create a list view container which will hold the contents of
478 /// the current directory.
479 
481  UInt_t options, ULong_t back) :
482  TGLVContainer(p, w, h, options, back)
483 {
485  fFilter = 0;
486  fMtime = 0;
488  fRefresh = new TViewUpdateTimer(this, 1000);
492  fCleanups = new TList;
493 
494  fFolder_s = fClient->GetPicture("folder_s.xpm");
495  fFolder_t = fClient->GetPicture("folder_t.xpm");
496  fApp_s = fClient->GetPicture("app_s.xpm");
497  fApp_t = fClient->GetPicture("app_t.xpm");
498  fDoc_s = fClient->GetPicture("doc_s.xpm");
499  fDoc_t = fClient->GetPicture("doc_t.xpm");
500  fSlink_s = fClient->GetPicture("slink_s.xpm");
501  fSlink_t = fClient->GetPicture("slink_t.xpm");
502 
503  if (!fFolder_s || !fFolder_t ||
504  !fApp_s || !fApp_t ||
505  !fDoc_s || !fDoc_t ||
506  !fSlink_s || !fSlink_t)
507  Error("TGFileContainer", "required pixmap(s) missing\n");
508 
509  SetWindowName();
510 }
511 
512 ////////////////////////////////////////////////////////////////////////////////
513 /// Create a list view container which will hold the contents of
514 /// the current directory.
515 
517  TGLVContainer(p,options, back)
518 {
520  fFilter = 0;
521  fMtime = 0;
523  fRefresh = new TViewUpdateTimer(this, 1000);
527  fCleanups = new TList;
528 
529  fFolder_s = fClient->GetPicture("folder_s.xpm");
530  fFolder_t = fClient->GetPicture("folder_t.xpm");
531  fApp_s = fClient->GetPicture("app_s.xpm");
532  fApp_t = fClient->GetPicture("app_t.xpm");
533  fDoc_s = fClient->GetPicture("doc_s.xpm");
534  fDoc_t = fClient->GetPicture("doc_t.xpm");
535  fSlink_s = fClient->GetPicture("slink_s.xpm");
536  fSlink_t = fClient->GetPicture("slink_t.xpm");
537 
538  if (!fFolder_s || !fFolder_t ||
539  !fApp_s || !fApp_t ||
540  !fDoc_s || !fDoc_t ||
541  !fSlink_s || !fSlink_t)
542  Error("TGFileContainer", "required pixmap(s) missing\n");
543 
544  SetWindowName();
545 }
546 
547 ////////////////////////////////////////////////////////////////////////////////
548 /// Delete list view file container.
549 
551 {
552  if (fRefresh) delete fRefresh;
553  if (fFilter) delete fFilter;
562  if (fCleanups) {
563  TGPicture *pic;
564  TIter nextp(fCleanups);
565  while ((pic = (TGPicture *)nextp())) {
567  }
568  fCleanups->Clear();
569  delete fCleanups;
570  }
571 }
572 
573 ////////////////////////////////////////////////////////////////////////////////
574 /// Add frame to the composite frame.
575 
577 {
578  TGFSFrameElement *nw;
579 
580  nw = new TGFSFrameElement;
581  nw->fFrame = f;
582  nw->fLayout = l ? l : fgDefaultHints;
583  nw->fState = 1;
584  nw->fContainer = this;
585  fList->Add(nw);
586 }
587 
588 ////////////////////////////////////////////////////////////////////////////////
589 /// Refresh container contents. Check every 5 seconds to see if the
590 /// directory modification date has changed.
591 
593 {
594  FileStat_t sbuf;
595 
596  if (gSystem->GetPathInfo(fDirectory, sbuf) == 0)
597  if (fMtime != (ULong_t)sbuf.fMtime) DisplayDirectory();
598 
599  return kTRUE;
600 }
601 
602 ////////////////////////////////////////////////////////////////////////////////
603 /// Set file selection filter.
604 
605 void TGFileContainer::SetFilter(const char *filter)
606 {
607  if (fFilter) delete fFilter;
608  fFilter = new TRegexp(filter, kTRUE);
609 }
610 
611 ////////////////////////////////////////////////////////////////////////////////
612 /// Sort file system list view container according to sortType.
613 
615 {
616  fSortType = sortType;
617 
618  fList->Sort();
619 
620  TGCanvas *canvas = (TGCanvas *) this->GetParent()->GetParent();
621  canvas->Layout();
622 }
623 
624 ////////////////////////////////////////////////////////////////////////////////
625 /// Determine the file picture for the given file type.
626 
628  const TGPicture **lpic, Int_t file_type, Bool_t is_link,
629  const char *name, Bool_t /*small*/)
630 {
631  static TString cached_ext;
632  static const TGPicture *cached_spic = 0;
633  static const TGPicture *cached_lpic = 0;
634  const char *ext = name ? strrchr(name, '.') : 0;
635  *pic = 0;
636  *lpic = 0;
637 
638  if (fCachePictures && ext && cached_spic && cached_lpic && (cached_ext == ext)) {
639  *pic = cached_spic;
640  *lpic = cached_lpic;
641  if (!is_link) return;
642  }
643 
644  if (R_ISREG(file_type)) {
645  TString fname(name);
646  if (is_link && fname.EndsWith(".lnk")) {
647  fname.Remove(fname.Length()-4);
648  }
649  *pic = fClient->GetMimeTypeList()->GetIcon(fname.Data(), kTRUE);
650  *lpic = fClient->GetMimeTypeList()->GetIcon(fname.Data(), kFALSE);
651 
652  if (*pic) {
653  if (!*lpic) *lpic = *pic;
654  if (ext) {
655  cached_ext = ext;
656  cached_spic = *pic;
657  cached_lpic = *lpic;
658  if (!is_link) return;
659  }
660  }
661  } else {
662  *pic = 0;
663  }
664 
665  if (*pic == 0) {
666  *pic = fDoc_t;
667  *lpic = fDoc_s;
668 
669  if (R_ISREG(file_type) && (file_type) & kS_IXUSR) {
670  *pic = fApp_t;
671  *lpic = fApp_s;
672  }
673  if (R_ISDIR(file_type)) {
674  *pic = fFolder_t;
675  *lpic = fFolder_s;
676  }
677  }
678  if (is_link) {
679  TImage *img1, *img2;
680  if (*pic && *lpic) {
681  TString lnk_name;
682  img1 = TImage::Create();
683  if (img1) {
684  img1->SetImage(((const TGPicture *)*pic)->GetPicture(),
685  ((const TGPicture *)*pic)->GetMask());
686  img2 = TImage::Open("slink_t.xpm");
687  if (img2) img1->Merge(img2);
688  lnk_name = ((const TGPicture *)*pic)->GetName();
689  lnk_name.Prepend("lnk_");
690  *pic = fClient->GetPicturePool()->GetPicture(lnk_name.Data(),
691  img1->GetPixmap(), img1->GetMask());
692  fCleanups->Add(((TObject *)*pic));
693  if (img2) delete img2;
694  delete img1;
695  }
696  img1 = TImage::Create();
697  if (img1) {
698  img1->SetImage(((const TGPicture *)*lpic)->GetPicture(),
699  ((const TGPicture *)*lpic)->GetMask());
700  img2 = TImage::Open("slink_s.xpm");
701  if (img2) img1->Merge(img2);
702  lnk_name = ((const TGPicture *)*lpic)->GetName();
703  lnk_name.Prepend("lnk_");
704  *lpic = fClient->GetPicturePool()->GetPicture(lnk_name.Data(),
705  img1->GetPixmap(), img1->GetMask());
706  fCleanups->Add(((TObject *)*lpic));
707  if (img2) delete img2;
708  delete img1;
709  }
710  }
711  else {
712  *pic = fSlink_t;
713  *lpic = fSlink_s;
714  }
715  }
716 
717  cached_lpic = 0;
718  cached_spic = 0;
719  cached_ext = "";
720 }
721 
722 ////////////////////////////////////////////////////////////////////////////////
723 /// Change current directory.
724 
725 void TGFileContainer::ChangeDirectory(const char *path)
726 {
727  TString savdir = gSystem->WorkingDirectory();
728  gSystem->ChangeDirectory(fDirectory.Data()); // so path of ".." will work
729  char *exppath = gSystem->ExpandPathName(path);
730  if (gSystem->ChangeDirectory(exppath)) {
732  gSystem->ChangeDirectory(savdir.Data());
734  }
735  delete[] exppath;
736 }
737 
738 ////////////////////////////////////////////////////////////////////////////////
739 /// Display the contents of the current directory in the container.
740 /// This can be used to refresh the contents of the window.
741 
743 {
744  RemoveAll();
745  CreateFileList();
746 
747  // This automatically calls layout
748  Sort(fSortType);
749 
750  // Make TGExplorerMainFrame display total objects in status bar
752  fTotal, fSelected);
753 
754  MapSubwindows();
755 }
756 
757 ////////////////////////////////////////////////////////////////////////////////
758 /// This function creates the file list from current dir.
759 
761 {
762  TString savdir = gSystem->WorkingDirectory();
763  if (!gSystem->ChangeDirectory(fDirectory.Data())) return;
764 
765  FileStat_t sbuf;
766  if (gSystem->GetPathInfo(".", sbuf) == 0)
767  fMtime = sbuf.fMtime;
768 
769  void *dirp;
770  if ((dirp = gSystem->OpenDirectory(".")) == 0) {
771  gSystem->ChangeDirectory(savdir.Data());
772  return;
773  }
774 
775  const char *name;
776  while ((name = gSystem->GetDirEntry(dirp)) != 0 && fDisplayStat) {
777  if (strcmp(name, ".") && strcmp(name, ".."))
778  AddFile(name);
780  }
781  gSystem->FreeDirectory(dirp);
782 
783  gSystem->ChangeDirectory(savdir.Data());
784 }
785 
786 ////////////////////////////////////////////////////////////////////////////////
787 /// Add file in container.
788 
790  const TGPicture *ilpic)
791 {
792  TString filename;
793  TGFileItem *item = 0;
794  const TGPicture *spic, *slpic;
795  TGPicture *pic, *lpic;
796 
797  FileStat_t sbuf;
798 
799  if (gSystem->GetPathInfo(name, sbuf)) {
800  if (sbuf.fIsLink) {
801  Info("AddFile", "Broken symlink of %s.", name);
802  } else {
803  TString msg;
804  msg.Form("Can't read file attributes of \"%s\": %s.",
805  name, gSystem->GetError());
807  "Error", msg.Data(), kMBIconStop, kMBOk);
808  }
809  return item;
810  }
811 
812  filename = name;
813  if (R_ISDIR(sbuf.fMode) || fFilter == 0 ||
814  (fFilter && filename.Index(*fFilter) != kNPOS)) {
815 
816  if (ipic && ilpic) { // dynamic icons
817  spic = ipic;
818  slpic = ilpic;
819  } else {
820  GetFilePictures(&spic, &slpic, sbuf.fMode, sbuf.fIsLink, name, kTRUE);
821  }
822 
823  pic = (TGPicture*)spic; pic->AddReference();
824  lpic = (TGPicture*)slpic; lpic->AddReference();
825 
826  item = new TGFileItem(this, lpic, slpic, spic, pic,
827  new TGString(gSystem->BaseName(name)),
828  sbuf, fViewMode);
829  AddItem(item);
830  }
831 
832  return item;
833 }
834 
835 ////////////////////////////////////////////////////////////////////////////////
836 /// Add remote file in container.
837 
839  const TGPicture *ilpic)
840 {
841  TString filename;
842  TGFileItem *item = 0;
843  const TGPicture *spic, *slpic;
844  TGPicture *pic, *lpic;
845 
846  FileStat_t sbuf;
847 
848  TRemoteObject *robj = (TRemoteObject *)obj;
849 
850  robj->GetFileStat(&sbuf);
851  filename = robj->GetName();
852 
853  if (R_ISDIR(sbuf.fMode) || fFilter == 0 ||
854  (fFilter && filename.Index(*fFilter) != kNPOS)) {
855 
856  if (ipic && ilpic) { // dynamic icons
857  spic = ipic;
858  slpic = ilpic;
859  } else {
860  GetFilePictures(&spic, &slpic, sbuf.fMode, sbuf.fIsLink, filename, kTRUE);
861  }
862 
863  pic = (TGPicture*)spic; pic->AddReference();
864  lpic = (TGPicture*)slpic; lpic->AddReference();
865 
866  item = new TGFileItem(this, lpic, slpic, spic, pic, new TGString(filename),
867  sbuf, fViewMode);
868  AddItem(item);
869  }
870  return item;
871 }
872 
873 ////////////////////////////////////////////////////////////////////////////////
874 /// stop refresh timer
875 
877 {
878  if (fRefresh) delete fRefresh;
879  fRefresh = 0;
880 }
881 
882 ////////////////////////////////////////////////////////////////////////////////
883 /// start refreshing
884 
886 {
887  fRefresh = new TViewUpdateTimer(this, msec);
889 }
890 
891 ////////////////////////////////////////////////////////////////////////////////
892 /// Save a file container widget as a C++ statement(s) on output stream out.
893 
894 void TGFileContainer::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
895 {
896  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
897 
898  char quote = '"';
899  out << std::endl << " // container frame" << std::endl;
900  out << " TGFileContainer *";
901 
902  if ((fParent->GetParent())->InheritsFrom(TGCanvas::Class())) {
903  out << GetName() << " = new TGFileContainer(" << GetCanvas()->GetName();
904  } else {
905  out << GetName() << " = new TGFileContainer(" << fParent->GetName();
906  out << "," << GetWidth() << "," << GetHeight();
907  }
908 
910  if (GetOptions() == kSunkenFrame) {
911  out <<");" << std::endl;
912  } else {
913  out << "," << GetOptionString() <<");" << std::endl;
914  }
915  } else {
916  out << "," << GetOptionString() << ",ucolor);" << std::endl;
917  }
918  if (option && strstr(option, "keep_names"))
919  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
920  out << " " << GetCanvas()->GetName() << "->SetContainer("
921  << GetName() << ");" << std::endl;
922  out << " " << GetName() << "->DisplayDirectory();" << std::endl;
923  out << " " << GetName() << "->AddFile("<< quote << ".." << quote << ");" << std::endl;
924  out << " " << GetName() << "->StopRefreshTimer();" << std::endl;
925 }
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:128
l
auto * l
Definition: textangle.C:4
EListViewMode
EListViewMode
Definition: TGListView.h:39
TGContainer::fSelected
Int_t fSelected
Definition: TGCanvas.h:59
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:235
TGFileItem::GetModTime
Long_t GetModTime() const
Definition: TGFSContainer.h:92
TSystem::GetPathInfo
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.
Definition: TSystem.cxx:1396
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:250
TGLVEntry::fViewMode
EListViewMode fViewMode
Definition: TGListView.h:70
TGWindow
Definition: TGWindow.h:31
TBufferIO::WriteObject
void WriteObject(const TObject *obj, Bool_t cacheReuse=kTRUE) override
Write object to I/O buffer.
Definition: TBufferIO.cxx:530
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
R_ISSOCK
Bool_t R_ISSOCK(Int_t mode)
Definition: TSystem.h:121
TGFileContainer::fCachePictures
Bool_t fCachePictures
Definition: TGFSContainer.h:142
TGLVEntry::fFontStruct
FontStruct_t fFontStruct
Definition: TGListView.h:77
TGFileContainer::fFilter
TRegexp * fFilter
Definition: TGFSContainer.h:129
snprintf
#define snprintf
Definition: civetweb.c:1540
TGFileContainer
Definition: TGFSContainer.h:123
TDNDData::fDataLength
Int_t fDataLength
Definition: TGDNDManager.h:78
TGFileContainer::fDirectory
TString fDirectory
Definition: TGFSContainer.h:132
kS_ISVTX
@ kS_ISVTX
Definition: TSystem.h:100
TGPicture
Definition: TGPicture.h:36
TGFileItem
Definition: TGFSContainer.h:50
f
#define f(i)
Definition: RSha256.hxx:104
TImage::Merge
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
Definition: TImage.h:172
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGFileContainer::fFolder_t
const TGPicture * fFolder_t
Definition: TGFSContainer.h:134
UserGroup_t::fUser
TString fUser
Definition: TSystem.h:141
TSystem::ChangeDirectory
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition: TSystem.cxx:861
TGFileContainer::DisplayDirectory
virtual void DisplayDirectory()
Display the contents of the current directory in the container.
Definition: TGFSContainer.cxx:742
TGPicture::GetWidth
UInt_t GetWidth() const
Definition: TGPicture.h:63
R_ISLNK
Bool_t R_ISLNK(Int_t mode)
Definition: TSystem.h:119
Compare
Int_t Compare(const void *item1, const void *item2)
Definition: TGListTree.cxx:2146
kNPOS
const Ssiz_t kNPOS
Definition: RtypesCore.h:115
TImage::Create
static TImage * Create()
Create an image.
Definition: TImage.cxx:35
TString::Prepend
TString & Prepend(const char *cs)
Definition: TString.h:661
TGFileContainer::ChangeDirectory
virtual void ChangeDirectory(const char *path)
Change current directory.
Definition: TGFSContainer.cxx:725
TObject::Compare
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
Definition: TObject.cxx:161
TGFileContainer::CreateFileList
void CreateFileList()
This function creates the file list from current dir.
Definition: TGFSContainer.cxx:760
TSystem::BaseName
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:933
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TGFileItem::GetUid
Int_t GetUid() const
Definition: TGFSContainer.h:93
kS_IROTH
@ kS_IROTH
Definition: TSystem.h:110
kLVLargeIcons
@ kLVLargeIcons
Definition: TGListView.h:40
TString::Data
const char * Data() const
Definition: TString.h:369
TSystem::FreeDirectory
virtual void FreeDirectory(void *dirp)
Free a directory.
Definition: TSystem.cxx:844
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TGFileItem::SetDNDData
void SetDNDData(TDNDData *data)
Set drag and drop data.
Definition: TGFSContainer.cxx:450
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGFileContainer::fRefresh
TViewUpdateTimer * fRefresh
Definition: TGFSContainer.h:130
TGLVContainer::fViewMode
EListViewMode fViewMode
Definition: TGListView.h:204
TGFileContainer::AddFile
virtual TGFileItem * AddFile(const char *name, const TGPicture *pic=0, const TGPicture *lpic=0)
Add file in container.
Definition: TGFSContainer.cxx:789
FileStat_t
Definition: TSystem.h:124
TGFrame::fWidth
UInt_t fWidth
Definition: TGFrame.h:112
FileStat_t::fMtime
Long_t fMtime
Definition: TSystem.h:131
TGMsgBox
Definition: TGMsgBox.h:63
TGFileItem::~TGFileItem
virtual ~TGFileItem()
Destructor.
Definition: TGFSContainer.cxx:397
TGFileContainer::TGFSFrameElement
friend class TGFSFrameElement
Definition: TGFSContainer.h:125
TGIcon.h
TObject::Info
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:864
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TGFileItem::fSize
Long64_t fSize
Definition: TGFSContainer.h:60
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TGFileItem::DoRedraw
virtual void DoRedraw()
Draw list view container item.
Definition: TGFSContainer.cxx:420
TGFileContainer::fApp_s
const TGPicture * fApp_s
Definition: TGFSContainer.h:137
UserGroup_t::fGroup
TString fGroup
Definition: TSystem.h:142
kSortByDate
@ kSortByDate
Definition: TGFSContainer.h:32
kS_ISGID
@ kS_ISGID
Definition: TSystem.h:99
R_ISCHR
Bool_t R_ISCHR(Int_t mode)
Definition: TSystem.h:116
TGFileContainer::fDisplayStat
Bool_t fDisplayStat
Definition: TGFSContainer.h:143
TGFileItem::fUid
Int_t fUid
Definition: TGFSContainer.h:57
TGFileItem::fIsLink
Bool_t fIsLink
Definition: TGFSContainer.h:58
kS_IXUSR
@ kS_IXUSR
Definition: TSystem.h:104
TGLVEntry
Definition: TGListView.h:54
Int_t
int Int_t
Definition: RtypesCore.h:45
TBuffer::Buffer
char * Buffer() const
Definition: TBuffer.h:96
TImage
An abstract interface to image processing library.
Definition: TImage.h:29
TString::EndsWith
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2177
TSystem::GetError
virtual const char * GetError()
Return system error string.
Definition: TSystem.cxx:251
kCT_SELCHANGED
@ kCT_SELCHANGED
Definition: WidgetMessageTypes.h:58
TGFileItem::HandleDNDEnter
virtual Atom_t HandleDNDEnter(Atom_t *)
Handle drag and drop enter.
Definition: TGFSContainer.cxx:441
TGPicture::Draw
void Draw(Option_t *="")
Default Draw method for all objects.
Definition: TGPicture.h:57
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TGCanvas::Layout
virtual void Layout()
Create layout for canvas.
Definition: TGCanvas.cxx:2225
TGFSContainer.h
TGMimeTypes.h
TGFileContainer::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame.
Definition: TGFSContainer.cxx:576
TGFileContainer::fDoc_s
const TGPicture * fDoc_s
Definition: TGFSContainer.h:139
TList.h
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:668
TGFileItem::GetSize
Long64_t GetSize() const
Definition: TGFSContainer.h:91
TVirtualX.h
TGFileContainer::GetFilePictures
virtual void GetFilePictures(const TGPicture **pic, const TGPicture **lpic, Int_t file_type, Bool_t is_link, const char *ext, Bool_t small)
Determine the file picture for the given file type.
Definition: TGFSContainer.cxx:627
TGClient::FreePicture
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:309
TString::Format
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:2311
TSystem::GetUserInfo
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition: TSystem.cxx:1597
TGFileItem::fBuf
TBufferFile * fBuf
Definition: TGFSContainer.h:61
TObject::IsSortable
virtual Bool_t IsSortable() const
Definition: TObject.h:131
TImage::Open
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
Definition: TImage.cxx:118
TGDNDManager.h
TGFileContainer::fSlink_s
const TGPicture * fSlink_s
Definition: TGFSContainer.h:141
TString
Basic string class.
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:105
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGFileContainer::TGFileContainer
TGFileContainer(const TGWindow *p=0, UInt_t w=1, UInt_t h=1, UInt_t options=kSunkenFrame, Pixel_t back=GetDefaultFrameBackground())
Create a list view container which will hold the contents of the current directory.
Definition: TGFSContainer.cxx:480
R_ISREG
Bool_t R_ISREG(Int_t mode)
Definition: TSystem.h:118
FileStat_t::fUid
Int_t fUid
Definition: TSystem.h:128
TGFileContainer::~TGFileContainer
virtual ~TGFileContainer()
Delete list view file container.
Definition: TGFSContainer.cxx:550
TGClient::GetPicturePool
TGPicturePool * GetPicturePool() const
Definition: TGClient.h:135
TSystem::AddTimer
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
Definition: TSystem.cxx:472
kS_IWGRP
@ kS_IWGRP
Definition: TSystem.h:107
TRemoteObject.h
bool
TSystem::WorkingDirectory
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:870
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:249
TGCompositeFrame::fList
TList * fList
Definition: TGFrame.h:329
TGFileItem::GetGid
Int_t GetGid() const
Definition: TGFSContainer.h:94
kSortByOwner
@ kSortByOwner
Definition: TGFSContainer.h:33
TImage.h
TGFrame::GetOptionString
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2465
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
TList::Sort
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
Definition: TList.cxx:937
TGFileItem::Init
void Init(const TGPicture *blpic, const TGPicture *slpic, FileStat_t &stat, EListViewMode viewMode)
Common initializer for file list view item.
Definition: TGFSContainer.cxx:286
TGIcon
Definition: TGIcon.h:30
TDNDData::fDataType
Atom_t fDataType
Definition: TGDNDManager.h:75
TGContainer::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGCanvas.h:52
TRefCnt::AddReference
void AddReference()
Definition: TRefCnt.h:40
TGString::GetLength
Int_t GetLength() const
Definition: TGString.h:39
TBuffer::Length
Int_t Length() const
Definition: TBuffer.h:100
TRegexp.h
kNone
const Handle_t kNone
Definition: GuiTypes.h:87
TRemoteObject
The TRemoteObject class provides protocol for browsing ROOT objects from a remote ROOT session.
Definition: TRemoteObject.h:34
TString::Form
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
calloc
#define calloc
Definition: civetweb.c:1537
TTimer
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
kSortByType
@ kSortByType
Definition: TGFSContainer.h:30
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGFileItem::GetType
Int_t GetType() const
Definition: TGFSContainer.h:90
TGPicturePool::GetPicture
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
Definition: TGPicture.cxx:80
TDNDData::fData
void * fData
Definition: TGDNDManager.h:77
TGFileItem::fType
Int_t fType
Definition: TGFSContainer.h:56
TGFileContainer::SetFilter
virtual void SetFilter(const char *filter)
Set file selection filter.
Definition: TGFSContainer.cxx:605
TSystem.h
h
#define h(i)
Definition: RSha256.hxx:106
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:335
FileStat_t::fMode
Int_t fMode
Definition: TSystem.h:127
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1149
FileStat_t::fGid
Int_t fGid
Definition: TSystem.h:129
FileStat_t::fIsLink
Bool_t fIsLink
Definition: TSystem.h:132
FileStat_t::fSize
Long64_t fSize
Definition: TSystem.h:130
TGObject::fId
Handle_t fId
Definition: TGObject.h:36
kSortByName
@ kSortByName
Definition: TGFSContainer.h:29
TString::Remove
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
Atom_t
Handle_t Atom_t
Definition: GuiTypes.h:36
TGFrame::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:630
kS_IWUSR
@ kS_IWUSR
Definition: TSystem.h:103
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGFileItem::SetDNDObject
void SetDNDObject(TObject *obj)
Set drag and drop object.
Definition: TGFSContainer.cxx:464
TImage::GetMask
virtual Pixmap_t GetMask()
Definition: TImage.h:236
Long_t
long Long_t
Definition: RtypesCore.h:54
kS_IXOTH
@ kS_IXOTH
Definition: TSystem.h:112
TGFileContainer::StartRefreshTimer
void StartRefreshTimer(ULong_t msec=1000)
start refreshing
Definition: TGFSContainer.cxx:885
TGLayoutHints
Definition: TGLayout.h:57
TGFrame::SaveUserColor
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2438
TGFileContainer::fCleanups
TList * fCleanups
Definition: TGFSContainer.h:133
kC_CONTAINER
@ kC_CONTAINER
Definition: WidgetMessageTypes.h:55
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:290
TGFileItem::TGFileItem
TGFileItem(const TGWindow *p=0, const TGPicture *bpic=0, const TGPicture *blpic=0, const TGPicture *spic=0, const TGPicture *slpic=0, TGString *name=0, Int_t type=0, Long64_t size=1, Int_t uid=0, Int_t gid=0, Long_t modtime=0, EListViewMode viewMode=kLVList, UInt_t options=kVerticalFrame, Pixel_t back=GetWhitePixel())
Create a list view item.
Definition: TGFSContainer.cxx:250
TGLVEntry::fSubnames
TGString ** fSubnames
Definition: TGListView.h:62
kS_ISUID
@ kS_ISUID
Definition: TSystem.h:98
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TGContainer::GetCanvas
TGCanvas * GetCanvas() const
Definition: TGCanvas.h:109
TGFileItem::fDNDData
TDNDData fDNDData
Definition: TGFSContainer.h:62
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TGLVEntry::SetViewMode
virtual void SetViewMode(EListViewMode viewMode)
Set the view mode for this list item.
Definition: TGListView.cxx:273
TDNDData
Definition: TGDNDManager.h:65
kS_IRGRP
@ kS_IRGRP
Definition: TSystem.h:106
TSystem::ExpandPathName
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition: TSystem.cxx:1272
TGFileContainer::fApp_t
const TGPicture * fApp_t
Definition: TGFSContainer.h:136
TGFileItem::fSlpic
const TGPicture * fSlpic
Definition: TGFSContainer.h:54
TGFileContainer::AddRemoteFile
virtual TGFileItem * AddRemoteFile(TObject *obj, const TGPicture *ipic=0, const TGPicture *ilpic=0)
Add remote file in container.
Definition: TGFSContainer.cxx:838
unsigned int
kMBOk
@ kMBOk
Definition: TGMsgBox.h:44
TGClient::GetMimeTypeList
TGMimeTypes * GetMimeTypeList() const
Definition: TGClient.h:155
TRegexp
Regular expression class.
Definition: TRegexp.h:31
TString::Index
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:639
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TGLVEntry::GetItemName
TGString * GetItemName() const
Definition: TGListView.h:106
TGWindow::GetParent
const TGWindow * GetParent() const
Definition: TGWindow.h:84
f1
TF1 * f1
Definition: legend1.C:11
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:373
kS_IWOTH
@ kS_IWOTH
Definition: TSystem.h:111
TSystem::OpenDirectory
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition: TSystem.cxx:835
TGFileItem::fLcurrent
const TGPicture * fLcurrent
Definition: TGFSContainer.h:55
TGFileContainer::fFolder_s
const TGPicture * fFolder_s
Definition: TGFSContainer.h:135
TGLVContainer
Definition: TGListView.h:196
TGCompositeFrame::fgDefaultHints
static TGLayoutHints * fgDefaultHints
Definition: TGFrame.h:334
TGFileContainer::Sort
virtual void Sort(EFSSortMode sortType)
Sort file system list view container according to sortType.
Definition: TGFSContainer.cxx:614
TGMsgBox.h
kSortByGroup
@ kSortByGroup
Definition: TGFSContainer.h:34
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
TGWindow::GetMainFrame
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:151
R_ISDIR
Bool_t R_ISDIR(Int_t mode)
Definition: TSystem.h:115
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TSystem::GetDirEntry
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition: TSystem.cxx:852
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TBufferFile.h
UserGroup_t
Definition: TSystem.h:138
TImage::GetPixmap
virtual Pixmap_t GetPixmap()
Definition: TImage.h:235
TList::Clear
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:402
name
char name[80]
Definition: TGX11.cxx:110
TTimer::Notify
virtual Bool_t Notify()
Notify when timer times out.
Definition: TTimer.cxx:143
kS_IXGRP
@ kS_IXGRP
Definition: TSystem.h:108
R_ISBLK
Bool_t R_ISBLK(Int_t mode)
Definition: TSystem.h:117
TGFrame::GetWhitePixel
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:694
TGFrameElement
Definition: TGLayout.h:112
TGFileItem::SetViewMode
virtual void SetViewMode(EListViewMode viewMode)
Set container item view mode.
Definition: TGFSContainer.cxx:405
TGString::GetString
const char * GetString() const
Definition: TGString.h:40
TIter
Definition: TCollection.h:233
TGFileItem::fBlpic
const TGPicture * fBlpic
Definition: TGFSContainer.h:53
TGLVEntry::fCtw
Int_t * fCtw
Definition: TGListView.h:65
TGFileContainer::fSortType
EFSSortMode fSortType
Definition: TGFSContainer.h:128
EFSSortMode
EFSSortMode
Definition: TGFSContainer.h:28
TImage::SetImage
virtual void SetImage(const Double_t *, UInt_t, UInt_t, TImagePalette *=0)
Definition: TImage.h:116
TGFileContainer::fDoc_t
const TGPicture * fDoc_t
Definition: TGFSContainer.h:138
kSortBySize
@ kSortBySize
Definition: TGFSContainer.h:31
TGFileContainer::fMtime
ULong_t fMtime
Definition: TGFSContainer.h:131
TGFileContainer::HandleTimer
virtual Bool_t HandleTimer(TTimer *t)
Refresh container contents.
Definition: TGFSContainer.cxx:592
TGeant4Unit::ms
static constexpr double ms
Definition: TGeant4SystemOfUnits.h:163
TGFrame::fHeight
UInt_t fHeight
Definition: TGFrame.h:113
R_ISFIFO
Bool_t R_ISFIFO(Int_t mode)
Definition: TSystem.h:120
TGFrame::fBackground
Pixel_t fBackground
Definition: TGFrame.h:120
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
type
int type
Definition: TGX11.cxx:121
free
#define free
Definition: civetweb.c:1539
Class
void Class()
Definition: Class.C:29
TGFileContainer::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a file container widget as a C++ statement(s) on output stream out.
Definition: TGFSContainer.cxx:894
TGPicturePool::FreePicture
void FreePicture(const TGPicture *pic)
Remove picture from cache if nobody is using it anymore.
Definition: TGPicture.cxx:275
TGCanvas
Definition: TGCanvas.h:202
TGPicture::GetHeight
UInt_t GetHeight() const
Definition: TGPicture.h:64
TGContainer::RemoveAll
virtual void RemoveAll()
Remove all items from the container.
Definition: TGCanvas.cxx:637
TGContainer::fTotal
Int_t fTotal
Definition: TGCanvas.h:58
kMBIconStop
@ kMBIconStop
Definition: TGMsgBox.h:33
TGLVContainer::AddItem
virtual void AddItem(TGLVEntry *item)
Definition: TGListView.h:225
kS_IRUSR
@ kS_IRUSR
Definition: TSystem.h:102
TGString
Definition: TGString.h:30
TGLVEntry::fNormGC
GContext_t fNormGC
Definition: TGListView.h:76
TSystem::ProcessEvents
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:417
TGFileItem::fGid
Int_t fGid
Definition: TGFSContainer.h:57
TGFileContainer::StopRefreshTimer
void StopRefreshTimer()
stop refresh timer
Definition: TGFSContainer.cxx:876
MK_MSG
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Definition: WidgetMessageTypes.h:110
TGWindow::fParent
const TGWindow * fParent
Definition: TGWindow.h:36
TGMimeTypes::GetIcon
const TGPicture * GetIcon(const char *filename, Bool_t small_icon)
Return icon belonging to mime type of filename.
Definition: TGMimeTypes.cxx:203
TGLVEntry::DoRedraw
virtual void DoRedraw()
Redraw list view item.
Definition: TGListView.cxx:316
TList
A doubly linked list.
Definition: TList.h:44
TGFileContainer::fSlink_t
const TGPicture * fSlink_t
Definition: TGFSContainer.h:140
TGFileItem::fModTime
Long_t fModTime
Definition: TGFSContainer.h:59
TRemoteObject::GetFileStat
Bool_t GetFileStat(FileStat_t *sbuf)
Get remote file status.
Definition: TRemoteObject.cxx:194
kChildFrame
@ kChildFrame
Definition: GuiTypes.h:379
int
TGFrame::IsDNDTarget
Bool_t IsDNDTarget() const
Definition: TGFrame.h:298
TGIcon::DoRedraw
virtual void DoRedraw()
Redraw picture.
Definition: TGIcon.cxx:125