22#include "RConfigure.h"
47#include "TApplicationCommandLineOptionsHelp.h"
90 gROOT->EndOfProcessCleanups();
98 fArgc(0), fArgv(nullptr), fAppImp(nullptr), fIsRunning(
kFALSE), fReturnFromRun(
kFALSE),
100 fFiles(nullptr), fIdleTimer(nullptr), fSigHandler(nullptr), fExitOnException(kDontExit),
121 void * ,
Int_t numOptions) :
122 fArgc(0), fArgv(nullptr), fAppImp(nullptr), fIsRunning(
kFALSE), fReturnFromRun(
kFALSE),
124 fFiles(nullptr), fIdleTimer(nullptr), fSigHandler(nullptr), fExitOnException(kDontExit),
148 Error(
"TApplication",
"only one instance of TApplication allowed");
154 ::Fatal(
"TApplication::TApplication",
"ROOT system not initialized");
157 ::Fatal(
"TApplication::TApplication",
"gSystem not initialized");
160 if (!hasRegisterAtExit) {
163 hasRegisterAtExit =
kTRUE;
165 gROOT->SetName(appClassName);
168 if (argc && *argc > 0) {
173 for (
int i = 0; i <
fArgc; i++)
199 gROOT->SetLineHasBeenProcessed();
203 gROOT->SetApplication(
this);
212 for (
int i = 0; i <
fArgc; i++)
263 #if !defined(R__WIN32)
273 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualX",
"x11ttf")))
274 if (
h->LoadPlugin() == -1)
275 Info(
"InitializeGraphics",
"no TTF support");
302 if (!only_web &&
gEnv->
GetValue(
"Canvas.UseScreenFactor", 1)) {
347 static char null[1] = {
"" };
359 for (i = 1; i < *argc; i++) {
360 if (!strcmp(argv[i],
"-?") || !strncmp(argv[i],
"-h", 2) ||
361 !strncmp(argv[i],
"--help", 6)) {
362 fprintf(stderr, kCommandLineOptionsHelp);
364 }
else if (!strncmp(argv[i],
"--version", 9)) {
365 fprintf(stderr,
"ROOT Version: %s\n",
gROOT->GetVersion());
366 fprintf(stderr,
"Built for %s on %s\n",
368 gROOT->GetGitDate());
370 fprintf(stderr,
"From %s@%s\n",
371 gROOT->GetGitBranch(),
372 gROOT->GetGitCommit());
375 }
else if (!strcmp(argv[i],
"-config")) {
376 fprintf(stderr,
"ROOT ./configure options:\n%s\n",
gROOT->GetConfigOptions());
378 }
else if (!strcmp(argv[i],
"-b")) {
381 }
else if (!strcmp(argv[i],
"-n")) {
384 }
else if (!strcmp(argv[i],
"-t")) {
390 }
else if (!strcmp(argv[i],
"-q")) {
393 }
else if (!strcmp(argv[i],
"-l")) {
397 }
else if (!strcmp(argv[i],
"-x")) {
400 }
else if (!strcmp(argv[i],
"-splash")) {
404 }
else if (strncmp(argv[i],
"--web", 5) == 0) {
406 const char *opt = argv[i] + 5;
408 if (strcmp(opt,
"=off") == 0)
409 gROOT->SetWebDisplay(
"off");
411 printf(
"\nWARNING!\n");
412 printf(
"Web mode switch --web is disabled for security reasons.\n");
413 printf(
"See https://root.cern/about/security/#2023-11-26-open-port-for-control-of-web-gui-allows-read-and-write-access-to-file-system for more information.\n");
414 printf(
"For environments controlling the security issues you can enable web display by calling\n");
415 printf(
"gROOT->SetWebDisplay(); in ROOT prompt or in startup scripts\n\n");
418 }
else if (!strcmp(argv[i],
"-e")) {
429 Warning(
"GetOptions",
"-e must be followed by an expression.");
431 }
else if (!strcmp(argv[i],
"--")) {
433 bool warnShown =
false;
439 if (!
dynamic_cast<TNamed*
>(
f)) {
440 Error(
"GetOptions()",
"Inconsistent file entry (not a TObjString)!");
449 if (
file->String().EndsWith(
".root"))
451 if (
file->String().Contains(
'('))
454 if (macro && !warnShown && (warnShown =
true))
455 Warning(
"GetOptions",
"-- is used with several macros. "
456 "The arguments will be passed to the last one.");
468 for (; i < *argc; i++) {
475 Warning(
"GetOptions",
"no macro to pass arguments to was provided. "
476 "Everything after the -- will be ignored.");
477 for (; i < *argc; i++)
480 }
else if (argv[i][0] !=
'-' && argv[i][0] !=
'+') {
483 char *arg = strchr(argv[i],
'(');
484 if (arg) *arg =
'\0';
508 }
else if (!strcmp(
gROOT->GetName(),
"Rint")) {
509 Warning(
"GetOptions",
"only one directory argument can be specified (%s)", dir);
511 }
else if (
size > 0) {
517 Warning(
"GetOptions",
"file %s has size 0, skipping", dir);
524 if (!strcmp(
gROOT->GetName(),
"Rint"))
525 Warning(
"GetOptions",
"file %s not found", dir);
548 if (!strcmp(
gROOT->GetName(),
"Rint"))
549 Warning(
"GetOptions",
"macro %s not found", fname.
Data());
564 for (i = 0; i < *argc; i++) {
565 if (strcmp(argv[i],
"")) {
583 Emit(
"HandleIdleTimer()");
639#elif defined(R__WIN32)
641 TString cWindows(
"start \"\" ");
654 Warning(
"OpenInBrowser",
"The $DISPLAY is not set! Please open (e.g. Ctrl-click) %s\n", url.
Data());
660enum EUrl { kURLforClass, kURLforNameSpace, kURLforStruct };
673 TString url =
"https://root.cern/doc/";
675 TPRegexp re4(R
"(.*/(v\d)-(\d\d)-00-patches)");
676 const char *branchName =
gROOT->GetGitBranch();
677 TObjArray *objarr = re4.MatchS(branchName);
695 if (scopeType == kURLforClass) {
697 }
else if (scopeType == kURLforStruct) {
732 methodArguments.
ReplaceAll(
"ostream",
"std::ostream");
733 methodArguments.
ReplaceAll(
"istream",
"std::istream");
734 methodArguments.
ReplaceAll(
"map",
"std::map");
735 methodArguments.
ReplaceAll(
"vector",
"std::vector");
739 scopeNameRE.Append(scopeName);
740 scopeNameRE.Append(
"::\\b");
742 argFix.Substitute(methodArguments,
"");
743 return methodArguments;
765 scopeNameRE.Append(scopeName);
766 scopeNameRE.Append(
"::\\b");
768 returnFix.Substitute(returnType,
"");
774 returnType.
Prepend(
"virtual ");
784 returnType.
ReplaceAll(
"istream",
"std::istream");
785 returnType.
ReplaceAll(
"ostream",
"std::ostream");
787 returnType.
ReplaceAll(
"vector",
"std::vector");
811 if (!dataMember->
IsEnum()) {
816 md5DataMember.Append(
" ");
818 md5DataMember.Append(scopeName);
819 md5DataMember.Append(
"::");
821 md5DataMember.Append(dataMemberName);
822 md5DataMember.Append(dataMemberName);
824 TString urlForDataMember = UrlGenerator(scopeName, scopeType);
826 urlForDataMember.
Append(
"#a");
827 urlForDataMember.
Append(md5DataMember.MD5());
828 return urlForDataMember;
835 if (scopeEnumeration.
Contains(
"(unnamed)")) {
837 md5EnumClass.
Append(scopeName);
838 md5EnumClass.
Append(
"::@1@1");
842 md5EnumClass.
Append(scopeEnumeration);
846 md5EnumClass.
Append(enumOnlyName);
850 md5Enumerator.Append(scopeName);
851 md5Enumerator.Append(
"::");
852 md5Enumerator.Append(dataMemberName);
853 md5Enumerator.Append(dataMemberName);
855 TString url = UrlGenerator(scopeName, scopeType);
861 url.
Append(md5Enumerator.MD5());
879 TString md5Enumeration(scopeName);
880 md5Enumeration.Append(
"::");
881 md5Enumeration.Append(enumeration);
882 md5Enumeration.Append(enumeration);
884 TString url(UrlGenerator(scopeName, scopeType));
887 url.
Append(md5Enumeration.MD5());
893enum EMethodKind { kURLforMethod, kURLforStructor };
909 EMethodKind methodType, EUrl scopeType)
912 if (methodType == kURLforMethod) {
915 md5Text.
Append((FormatReturnTypeForDoxygen(scopeName, func)));
916 if (scopeType == kURLforNameSpace) {
925 md5Text.
Append(scopeName);
927 md5Text.
Append(methodName);
928 md5Text.
Append(methodName);
930 md5Text.
Append(FormatMethodArgsForDoxygen(scopeName, func));
932 TString url = UrlGenerator(scopeName, scopeType);
957 scopeType = kURLforNameSpace;
958 }
else if (clas->Property() &
kIsStruct) {
959 scopeType = kURLforStruct;
961 scopeType = kURLforClass;
971 if (strippedClass == memberName) {
972 Error(
"OpenReferenceGuideFor",
"Unknown entity \"%s\" - global variables / functions not supported yet!",
973 strippedClass.
Data());
982 Warning(
"OpenReferenceGuideFor",
"\"%s\" does not exist in ROOT!", scopeName.
Data());
988 scopeType = kURLforNameSpace;
990 scopeType = kURLforStruct;
992 scopeType = kURLforClass;
997 int bracket = memberName.
First(
"(");
999 memberName.
Remove(bracket);
1006 EMethodKind methodType;
1008 if (baseClName == memberName) {
1009 methodType = kURLforStructor;
1011 }
else if (memberName[0] ==
'~') {
1012 methodType = kURLforStructor;
1015 methodType = kURLforMethod;
1018 OpenInBrowser(GetUrlForMethod(baseClName, memberName, func, methodType, scopeType));
1025 OpenInBrowser(GetUrlForEnumeration(scopeName, memberName, scopeType));
1033 OpenInBrowser(GetUrlForDataMember(baseClName, memberName, enumerator, scopeType));
1039 Warning(
"Help",
"cannot find \"%s\" as member of %s or its base classes! Check %s\n", memberName.
Data(),
1040 scopeName.
Data(), UrlGenerator(scopeName, scopeType).Data());
1054 if ((strippedCommand ==
".help") || (strippedCommand ==
".?")) {
1056 Printf(
"\n ROOT special commands.");
1057 Printf(
" ==============================================================================");
1058 Printf(
" .L <filename>[flags]: load the given file with optional flags like\n"
1059 " + to compile or ++ to force recompile.\n"
1060 " Type .? TSystem::CompileMacro for a list of all flags.");
1061 Printf(
" .(x|X) <filename>[flags](args) :\n"
1062 " same as .L <filename>[flags] and runs then a function\n"
1063 " with signature: ret_type filename(args).");
1064 Printf(
" .credits : show credits");
1065 Printf(
" .demo : launch GUI demo");
1066 Printf(
" .help Class::Member : open reference guide for that class member (or .?).\n"
1067 " Specifying '::Member' is optional.");
1068 Printf(
" .help edit : show line editing shortcuts (or .?)");
1069 Printf(
" .license : show license");
1070 Printf(
" .ls : list contents of current TDirectory");
1071 Printf(
" .pwd : show current TDirectory, pad and style");
1072 Printf(
" .quit (or .exit) : quit ROOT (long form of .q)");
1073 Printf(
" .R [user@]host[:dir] [-l user] [-d dbg] [script] :\n"
1074 " launch process in a remote host");
1075 Printf(
" .qqq : quit ROOT - mandatory");
1076 Printf(
" .qqqqq : exit process immediately");
1077 Printf(
" .qqqqqqq : abort process");
1078 Printf(
" .which [file] : show path of macro file");
1079 Printf(
" .![OS_command] : execute OS-specific shell command");
1080 Printf(
" .!root -? : print ROOT usage (CLI options)");
1086 Error(
"Help",
"Unknown command!");
1091 strippedCommand.
Remove(0, 3);
1093 strippedCommand.
Remove(0, 5);
1098 if (strippedCommand ==
"edit") {
1099 Printf(
"\n ROOT terminal keyboard shortcuts (GNU-readline style).");
1101 #define FOOTNOTE " *"
1102 Printf(
"* Some of these commands might be intercepted by macOS predefined system shortcuts.");
1107 Printf(
" ==============================================================================");
1108 Printf(
" Arrow_Left : move cursor left [Ctrl+B]");
1109 Printf(
" Arrow_Right : move cursor right [Ctrl+F] [Ctrl+G]");
1111 Printf(
" Fn+Arrow_Left : move cursor to beginning of line [Ctrl+A]");
1113 Printf(
" Home : move cursor to beginning of line [Ctrl+A]");
1116 Printf(
" Fn+Arrow_Right : move cursor to end of line [Ctrl+E]");
1118 Printf(
" End : move cursor to end of line [Ctrl+E]");
1120 Printf(
" Ctrl+Arrow_Left : jump to previous word [Esc,B] [Alt,B]" FOOTNOTE);
1121 Printf(
" Ctrl+Arrow_Right : jump to next word [Esc,F] [Alt,F]" FOOTNOTE);
1123 Printf(
" Backspace : delete previous character [Ctrl+H]");
1124 Printf(
" Del : delete next character [Ctrl+D]");
1125 Printf(
" Esc,Backspace : delete previous word [Ctrl+W] [Esc,Ctrl+H] [Alt+Backspace] [Esc,Del] [Esc,Ctrl+Del]" FOOTNOTE);
1127 Printf(
" Ctrl+U : cut all characters between cursor and start of line");
1128 Printf(
" Ctrl+K : cut all characters between cursor and end of line");
1130 Printf(
" Ctrl+T : transpose characters");
1131 Printf(
" Esc,C : character to upper and jump to next word");
1132 Printf(
" Esc,L : word to lower case and jump to its end");
1133 Printf(
" Esc,U : word to upper case and jump to its end");
1134 Printf(
" Ctrl+Shift+C : copy clipboard content");
1135 Printf(
" Ctrl+Shift+V : paste clipboard content [Ctrl+Y] [Alt+Y]");
1137 Printf(
" Fn+Enter : toggle overwrite mode");
1139 Printf(
" Ins : toggle overwrite mode");
1142 Printf(
" Ctrl+_ : undo last keypress action");
1143 Printf(
" Tab : autocomplete command or print suggestions [Ctrl+I] [Esc,Tab]");
1144 Printf(
" Enter : execute command [Ctrl+J] [Ctrl+M]");
1145 Printf(
" Ctrl+L : clear prompt screen");
1146 Printf(
" Ctrl+D : quit ROOT (if empty line)");
1147 Printf(
" Ctrl+C : send kSigInt interrupt signal");
1148 Printf(
" Ctrl+Z : send kSigStop pause job signal");
1150 Printf(
" Arrow_Down : navigate downwards in command history [Ctrl+N]");
1151 Printf(
" Arrow_Up : navigate upwards in command history [Ctrl+P]");
1152 Printf(
" Ctrl+R ; Ctrl+S : search command in your history by typing a string.\n"
1153 " Use Backspace if you mistyped (but not arrows).\n"
1154 " Press Ctrl+R (Ctrl+S) repeateadly to navigate matches in reverse (forward) order");
1155 Printf(
" Arrow_Right : after Ctrl+R (Ctrl+S), select current match of the history search\n"
1156 " [Ctrl+O] [Enter] [Ctrl+J] [Ctrl+M] [Arrow_Left] [Esc,Esc].\n"
1157 " Use Ctrl+F or Ctrl+G to cancel search and revert original line");
1171 if (
gROOT->IsBatch())
1174 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualPad"))
1175 if (
h->LoadPlugin() == -1)
1179 TString title1 =
"ROOT interface to ";
1183 nativex =
"win32gdk";
1185 title = title1 +
"Win32gdk";
1186#elif defined(R__HAS_COCOA)
1189 title = title1 +
"Quartz";
1193 title = title1 +
"X11";
1198 if (guiBackend ==
"native") {
1199 guiBackend = nativex;
1202 title = title1 + guiBackend;
1205 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualX", guiBackend)) {
1206 if (
h->LoadPlugin() == -1) {
1216 if (guiFactory ==
"native")
1217 guiFactory =
"root";
1219 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TGuiFactory", guiFactory)) {
1220 if (
h->LoadPlugin() == -1) {
1259 if (!ln || strlen(ln) <= 0)
1271 while (
line.Tokenize(tkn, from,
" ")) {
1275 }
else if (tkn ==
"-d") {
1277 }
else if (tkn ==
"-close") {
1280 ::Warning(
"TApplication::ParseRemoteLine",
"unknown option: %s", tkn.
Data());
1288 }
else if (isHostDir) {
1293 }
else if (isScript) {
1323 if (!
line)
return 0;
1325 if (!strncmp(
line,
"-?", 2) || !strncmp(
line,
"-h", 2) ||
1326 !strncmp(
line,
"--help", 6)) {
1327 Info(
"ProcessRemote",
"remote session help:");
1328 Printf(
".R [user@]host[:dir] [-l user] [-d dbg] [[<]script] | [host] -close");
1329 Printf(
"Create a ROOT session on the specified remote host.");
1330 Printf(
"The variable \"dir\" is the remote directory to be used as working dir.");
1331 Printf(
"The username can be specified in two ways, \"-l\" having the priority");
1332 Printf(
"(as in ssh). A \"dbg\" value > 0 gives increasing verbosity.");
1333 Printf(
"The last argument \"script\" allows to specify an alternative script to");
1334 Printf(
"be executed remotely to startup the session, \"roots\" being");
1335 Printf(
"the default. If the script is preceded by a \"<\" the script will be");
1336 Printf(
"sourced, after which \"roots\" is executed. The sourced script can be ");
1337 Printf(
"used to change the PATH and other variables, allowing an alternative");
1338 Printf(
"\"roots\" script to be found.");
1339 Printf(
"To close down a session do \".R host -close\".");
1340 Printf(
"To switch between sessions do \".R host\", to switch to the local");
1341 Printf(
"session do \".R\".");
1342 Printf(
"To list all open sessions do \"gApplication->GetApplications()->Print()\".");
1346 TString hostdir, user, script;
1349 if (hostdir.
Length() <= 0) {
1359 }
else if (rc == 1) {
1370 const char *sc = (script.
Length() > 0) ? script.
Data() :
nullptr;
1381 static int PrintFile(
const char*
filename) {
1388 std::ifstream instr(sFileName);
1406 if (!strncmp(
line,
".R", 2)) {
1408 while (*(
line+
n) ==
' ')
1419 if (!strncasecmp(
line,
".qqqqqqq", 7)) {
1421 }
else if (!strncasecmp(
line,
".qqqqq", 5)) {
1422 Info(
"ProcessLine",
"Bye... (try '.qqqqqqq' if still running)");
1424 }
else if (!strncasecmp(
line,
".exit", 4) || !strncasecmp(
line,
".quit", 2)) {
1429 if (!strncmp(
line,
".?", 2) || !strncmp(
line,
".help", 5)) {
1434 if (!strncmp(
line,
".demo", 5)) {
1435 if (
gROOT->IsBatch()) {
1436 Error(
"ProcessLine",
"Cannot show demos in batch mode!");
1443 if (!strncmp(
line,
".license", 8)) {
1447 if (!strncmp(
line,
".credits", 8)) {
1451 return PrintFile(credits);
1454 if (!strncmp(
line,
".pwd", 4)) {
1464 if (!strncmp(
line,
".ls", 3)) {
1465 const char *opt =
nullptr;
1471 if (!strncmp(
line,
".which", 6)) {
1473 char *s = strtok(fn,
"+(");
1484 if (!strncmp(
line,
".L", 2) || !strncmp(
line,
".U", 2)) {
1485 TString aclicMode, arguments, io;
1490 Warning(
"ProcessLine",
"argument(s) \"%s\" ignored with .%c", arguments.
Data(),
line[1]);
1497 if (posSpace ==
kNPOS)
1514 if (!strncmp(
line,
".X", 2) || !strncmp(
line,
".x", 2)) {
1518 if (!strcmp(
line,
".reset")) {
1520 Printf(
"*** .reset not allowed, please use gROOT->Reset() ***");
1526 gROOT->GetListOfClasses()->Delete();
1551 static const Int_t kBufSize = 1024;
1562 ::Error(
"TApplication::ExecuteFile",
"macro %s not found in path %s", fname.
Data(),
1570 ::std::ifstream macro(exnam, std::ios::in);
1571 if (!macro.good()) {
1572 ::Error(
"TApplication::ExecuteFile",
"%s no such file", exnam);
1579 char currentline[kBufSize];
1580 char dummyline[kBufSize];
1590 bool res = (
bool)macro.getline(currentline, kBufSize);
1591 if (macro.eof())
break;
1596 while (!macro.getline(dummyline, kBufSize) && !macro.eof()) {
1601 while (s && (*s ==
' ' || *s ==
'\t')) s++;
1608 if (strstr(cs,
"#ifndef__CINT__") ||
1609 strstr(cs,
"#if!defined(__CINT__)"))
1611 else if (ifndefc && (strstr(cs,
"#ifdef") || strstr(cs,
"#ifndef") ||
1612 strstr(cs,
"#ifdefined") || strstr(cs,
"#if!defined")))
1614 else if (ifndefc && strstr(cs,
"#endif")) {
1619 }
else if (ifndefc && !ifdef && strstr(cs,
"#else"))
1623 if (!*s || *s ==
'#' || ifndefc || !strncmp(s,
"//", 2))
continue;
1625 if (!comment && (!strncmp(s,
".X", 2) || !strncmp(s,
".x", 2))) {
1631 if (!strncmp(s,
"/*", 2)) comment = 1;
1635 s = strstr(s,
"*/");
1640 while (s && (*s ==
' ' || *s ==
'\t')) s++;
1642 if (!strncmp(s,
"//", 2))
continue;
1643 if (!strncmp(s,
"/*", 2)) {
1649 if (!comment && *s ==
'{') tempfile = 1;
1650 if (!comment)
break;
1659 exname += aclicMode;
1661 exname += arguments;
1666 tempbuf.
Form(
".x %s", exname.
Data());
1668 tempbuf.
Form(
".X%s %s", keep ?
"k" :
" ", exname.
Data());
1749 Emit(
"Terminate(Int_t)", status);
1763 Emit(
"LineProcessed(const char*)",
line);
1771 Emit(
"KeyPressed(Int_t)", key);
1779 Emit(
"ReturnPressed(char*)",
text);
1808 Printf(
"<TApplication::CreateApplication>: "
1809 "created default TApplication");
1810 delete []
a;
delete []
b;
1820 Int_t debug,
const char *script)
1846 ::Error(
"TApplication::Open",
"list of applications undefined - protocol error");
1858 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TApplication",
"remote"))) {
1859 if (
h->LoadPlugin() == 0) {
1862 ::Error(
"TApplication::Open",
"failed to load plugin for TApplicationRemote");
1865 ::Error(
"TApplication::Open",
"failed to find plugin for TApplicationRemote");
1876 gROOT->RefreshBrowsers();
1880 "TApplicationRemote for %s could not be instantiated", url);
1900 gROOT->RefreshBrowsers();
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
static void CallEndOfProcessCleanups()
TApplication * gApplication
R__EXTERN TApplication * gApplication
R__EXTERN TClassTable * gClassTable
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
R__EXTERN ExceptionContext_t * gException
R__EXTERN void Throw(int code)
If an exception context has been set (using the TRY and RETRY macros) jump back to where it was set.
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
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 mode
Option_t Option_t TPoint TPoint const char text
R__EXTERN TGuiFactory * gBatchGuiFactory
R__EXTERN TGuiFactory * gGuiFactory
R__EXTERN TVirtualMutex * gInterpreterMutex
R__EXTERN TVirtualMutex * gROOTMutex
char * Compress(const char *str)
Remove all blanks from the string str.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
char * Strip(const char *str, char c=' ')
Strip leading and trailing c (blanks by default) from a string.
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
char * StrDup(const char *str)
Duplicate the string str.
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD(mutex)
R__EXTERN TVirtualX * gGXBatch
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
EExitOnException ExitOnException(EExitOnException opt=kExit)
Set the exit on exception option.
virtual void KeyPressed(Int_t key)
Emit signal when console keyboard key was pressed.
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 "....
static TList * fgApplications
static void Close(TApplication *app)
Static function used to close a remote application.
virtual void SetEchoMode(Bool_t mode)
Set console echo mode:
virtual void Help(const char *line)
The function lists useful commands (".help") or opens the online reference guide, generated with Doxy...
virtual void LineProcessed(const char *line)
Emit signal when a line has been processed.
void ClearInputFiles()
Clear list containing macro files passed as program arguments.
TApplicationImp * fAppImp
static Longptr_t ExecuteFile(const char *file, Int_t *error=nullptr, Bool_t keep=kFALSE)
Execute a file containing a C++ macro (static method).
void InitializeGraphics(Bool_t only_web=kFALSE)
Initialize the graphics environment.
virtual void LoadGraphicsLibs()
Load shared libs necessary for graphics.
virtual void StopIdleing()
Called when system stops idleing.
virtual void StartIdleing()
Called when system starts idleing.
virtual void Run(Bool_t retrn=kFALSE)
Main application eventloop. Calls system dependent eventloop via gSystem.
virtual ~TApplication()
TApplication dtor.
void OpenReferenceGuideFor(const TString &strippedClass)
It opens the online reference guide, generated with Doxygen, for the chosen scope (class/namespace/st...
virtual void HandleException(Int_t sig)
Handle exceptions (kSigBus, kSigSegmentationViolation, kSigIllegalInstruction and kSigFloatingExcepti...
virtual void MakeBatch()
Switch to batch mode.
static Bool_t fgGraphNeeded
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
void OpenInBrowser(const TString &url)
The function generates and executes a command that loads the Doxygen URL in a browser.
virtual const char * ApplicationName() const
void SetReturnFromRun(Bool_t ret)
virtual Int_t TabCompletionHook(char *buf, int *pLoc, std::ostream &out)
What to do when tab is pressed.
EExitOnException fExitOnException
const char * GetIdleCommand() const
TApplication()
Default ctor. Can be used by classes deriving from TApplication.
virtual Longptr_t ProcessFile(const char *file, Int_t *error=nullptr, Bool_t keep=kFALSE)
Process a file containing a C++ macro.
virtual void ReturnPressed(char *text)
Emit signal when return key was pressed.
static Bool_t fgGraphInit
virtual void RemoveIdleTimer()
Remove idle timer. Normally called via TROOT::Idle(0).
virtual void SetIdleTimer(UInt_t idleTimeInSec, const char *command)
Set the command to be executed after the system has been idle for idleTimeInSec seconds.
static void CreateApplication()
Static function used to create a default application environment.
virtual void GetOptions(Int_t *argc, char **argv)
Get and handle command line options.
static TList * GetApplications()
Static method returning the list of available applications.
std::atomic< bool > fIsRunning
Window system specific application implementation.
static void NeedGraphicsLibs()
Static method.
static Int_t ParseRemoteLine(const char *ln, TString &hostdir, TString &user, Int_t &dbg, TString &script)
Parse the content of a line starting with ".R" (already stripped-off) The format is.
void ls(Option_t *option="") const override
Show available sessions.
virtual void HandleIdleTimer()
Handle idle timeout.
virtual Longptr_t ProcessRemote(const char *line, Int_t *error=nullptr)
Process the content of a line starting with ".R" (already stripped-off) The format is.
TApplication * fAppRemote
Using a TBrowser one can browse all ROOT objects.
void RecursiveRemove(TObject *obj) override
Recursively remove obj from browser.
void Add(TObject *obj, const char *name=nullptr, Int_t check=-1)
Add object with name to browser.
static DictFuncPtr_t GetDict(const char *cname)
Given the class name returns the Dictionary() function of a class (uses hash of name).
TClass instances represent classes, structs and namespaces in the ROOT type system.
TList * GetListOfAllPublicDataMembers(Bool_t load=kTRUE)
Returns a list of all public data members of this class and its base classes.
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
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.
static void InitializeColors()
Initialize colors used by the TCanvas based graphics (via TColor objects).
All ROOT classes may have RTTI (run time type identification) support added.
const char * GetTrueTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
Bool_t IsEnum() const
Return true if data member is an enum.
const char * GetFullTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Global functions class (global functions are obtained from CINT).
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
const char * GetSignature()
Return signature of function.
Long_t ExtraProperty() const
Get property description word. For meaning of bits see EProperty.
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
This ABC is a factory for GUI components.
virtual TApplicationImp * CreateApplicationImp(const char *classname, int *argc, char **argv)
Create a batch version of TApplicationImp.
Bool_t Notify() override
Notify handler.
void ls(Option_t *option="") const override
List this line with its attributes.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
virtual TObjLink * FirstLink() const
Each ROOT class (see TClass) has a linked list of methods.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
void Delete(Option_t *option="") override
Remove all objects from the array AND delete all heap based objects.
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
Collectable string class.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void RecursiveRemove(TObject *obj)
Recursively remove this object from a list.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
@ kInvalidObject
if object ctor succeeded but object should not be used
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
static const char * GetMacroPath()
Get macro search path. Static utility function.
static void ShutDown()
Shut down ROOT.
static const TString & GetTTFFontDir()
Get the fonts directory in the installation. Static utility function.
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
static const TString & GetTutorialDir()
Get the tutorials directory in the installation. Static utility function.
static const TString & GetDocDir()
Get the documentation directory in the installation. Static utility function.
void ToLower()
Change string to lower-case.
TString & Insert(Ssiz_t pos, const char *s)
Int_t Atoi() const
Return integer value of string.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString MD5() const
Return the MD5 digest for this string, in a string representation.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Prepend(const char *cs)
std::istream & ReadFile(std::istream &str)
Replace string with the contents of strm, stopping at an EOF.
TString & Remove(Ssiz_t pos)
TString & Append(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.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void SetScreenFactor(Float_t factor=1)
virtual void NotifyApplicationCreated()
Hook to tell TSystem that the TApplication object has been created.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const
This method split a filename of the form:
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 Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual void Run()
System event loop.
virtual void ExitLoop()
Exit from event loop.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
virtual void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
virtual const char * WorkingDirectory()
Return working directory.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual void SetProgname(const char *name)
Set the application name (from command line, argv[0]) and copy it in gProgName.
virtual const char * GetBuildArch() const
Return the build architecture.
virtual void Abort(int code=0)
Abort the application.
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Handles synchronous and a-synchronous timer events.
void Reset()
Reset the timer.
This class represents a WWW compatible URL.
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
const char * GetFileAndOptions() const
Return the file and its options (the string specified behind the ?).
const char * GetFile() const
const char * GetUser() const
const char * GetHost() const
void SetOptions(const char *opt)
const char * GetProtocol() const
Semi-Abstract base class defining a generic interface to the underlying, low level,...
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT's implicit multi-threading for all objects and methods that provide an internal paralleli...
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...
const char * GetUnqualifiedName(const char *name)
Return the start of the unqualified name include in 'original'.