14 #include "RConfigure.h" 21 #include <sys/types.h> 27 #if defined(R__AIX) || defined(R__SOLARIS) 28 #include <sys/select.h> 39 static GC
gGC =
nullptr;
40 static XFontStruct*
gFont =
nullptr;
80 tv.tv_sec = milliSec / 1000;
81 tv.tv_usec = (milliSec % 1000) * 1000;
83 gettimeofday(&ctv,
nullptr);
84 if((dtv.tv_usec = ctv.tv_usec - ptv.tv_usec) < 0) {
85 dtv.tv_usec += 1000000;
88 dtv.tv_sec = ctv.tv_sec - ptv.tv_sec;
90 if((ctv.tv_usec = tv.tv_usec - dtv.tv_usec) < 0) {
91 ctv.tv_usec += 1000000;
94 ctv.tv_sec = tv.tv_sec - dtv.tv_sec;
96 return ctv.tv_sec >= 0;
106 tv.tv_sec = milliSec / 1000;
107 tv.tv_usec = (milliSec % 1000) * 1000;
109 select(0,
nullptr,
nullptr,
nullptr, &tv);
117 Screen* xscreen = XDefaultScreenOfDisplay(
gDisplay);
118 if(xscreen ==
nullptr) {
122 int depth = PlanesOfScreen(xscreen);
124 XWindowAttributes win_attr;
128 attr.valuemask = XpmVisual | XpmColormap | XpmDepth;
129 attr.visual = win_attr.visual;
130 attr.colormap = win_attr.colormap;
131 attr.depth = win_attr.depth;
133 #ifdef XpmColorKey // Not available in XPM 3.2 and earlier 134 attr.valuemask |= XpmColorKey;
136 attr.color_key = XPM_COLOR;
137 }
else if(depth > 2) {
138 attr.color_key = XPM_GRAY4;
139 }
else if(depth > 1) {
140 attr.color_key = XPM_GRAY;
141 }
else if(depth == 1) {
142 attr.color_key = XPM_MONO;
144 attr.valuemask &= ~XpmColorKey;
147 #endif // defined(XpmColorKey) 149 file.append(getenv(
"GRSISYS"));
150 file.append(
"/libraries/TGRSIint/grsisplash_bw.xpm");
152 int ret = XpmReadFileToPixmap(
gDisplay,
gLogoWindow, const_cast<char*>(file.c_str()), &logo,
nullptr, &attr);
153 XpmFreeAttributes(&attr);
155 if(ret == XpmSuccess || ret == XpmColorError) {
159 std::cout<<
"rootx xpm error: "<<XpmGetErrorString(ret)<<std::endl;
176 snprintf(buf,
sizeof(buf),
"%s/CREDITS", ROOTDOCDIR);
178 snprintf(buf,
sizeof(buf),
"%s/README/CREDITS", getenv(
"ROOTSYS"));
183 FILE* f = fopen(buf,
"r");
189 while(fgets(buf,
sizeof(buf), f) !=
nullptr) {
190 if(strncmp(buf,
"N: ", 3) == 0) {
198 while(fgets(buf,
sizeof(buf), f) !=
nullptr) {
199 if(strncmp(buf,
"N: ", 3) == 0) {
200 int len = strlen(buf);
228 sprintf(version,
"A ROOT based package");
233 static int DrawCreditItem(
const char* creditItem,
const char** members,
int y,
bool draw)
239 int lineSpacing =
gFont->max_bounds.ascent +
gFont->max_bounds.descent;
241 strlcpy(credit, creditItem,
sizeof(credit));
242 for(i = 0; (members !=
nullptr) && (members[i] !=
nullptr); i++) {
244 strlcat(credit,
", ",
sizeof(credit));
246 if(XTextWidth(
gFont, credit, strlen(credit)) + XTextWidth(
gFont, members[i], strlen(members[i])) >
252 strlcpy(credit,
" ",
sizeof(credit));
254 strlcat(credit, members[i],
sizeof(credit));
268 if(
gFont ==
nullptr) {
272 int lineSpacing =
gFont->max_bounds.ascent +
gFont->max_bounds.descent;
277 y += 2 * lineSpacing - 1;
281 y += 2 * lineSpacing - 1;
285 y += 2 * lineSpacing - 1;
295 XSetClipRectangles(
gDisplay,
gGC, 0, 0, crect, 1, Unsorted);
314 int screen = DefaultScreen(
gDisplay);
316 back = WhitePixel(
gDisplay, screen);
317 fore = BlackPixel(
gDisplay, screen);
331 unsigned int bw, depth;
334 Screen* xscreen = XDefaultScreenOfDisplay(
gDisplay);
336 if(xscreen ==
nullptr) {
341 x = (WidthOfScreen(xscreen) -
gWidth) / 2;
342 y = (HeightOfScreen(xscreen) -
gHeight) / 2;
347 unsigned long valmask;
348 XSetWindowAttributes xswa;
349 valmask = CWBackPixmap | CWOverrideRedirect;
351 xswa.override_redirect = True;
355 gFont = XLoadQueryFont(
gDisplay,
"-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1");
356 if(
gFont ==
nullptr) {
357 std::cout<<
"Couldn't find font \"-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1\","<<std::endl
358 <<
"trying \"fixed\". Please fix your system so helvetica can be found, "<<std::endl
359 <<
"this font typically is in the rpm (or pkg equivalent) package "<<std::endl
360 <<
"XFree86-[75,100]dpi-fonts or fonts-xorg-[75,100]dpi."<<std::endl;
362 if(
gFont ==
nullptr) {
363 std::cout<<
"Also couln't find font \"fixed\", your system is terminally misconfigured."<<std::endl;
366 if(
gFont !=
nullptr) {
400 bool stopScroll =
false;
408 gSystem->Sleep(3500);
412 if(XCheckMaskEvent(
gDisplay, ButtonPressMask | ExposureMask, &event) != 0) {
415 if(event.xexpose.count == 0) {
421 if(
gAbout && event.xbutton.button == 3) {
422 stopScroll = !stopScroll;
437 if(
gAbout && !stopScroll) {
463 if(
gFont !=
nullptr) {
static unsigned int gHeight
static unsigned int gCreditsWidth
static void DrawVersion()
static char ** gContributors
static Window gLogoWindow
static XRectangle gCreditsRect
static XFontStruct * gFont
static bool StayUp(int milliSec)
static void DrawROOTCredit()
static void ReadContributors()
static const char * gKeyContributors[]
void PopupLogo(bool about)
static int DrawCredits(bool draw, bool)
static Pixmap gCreditsPixmap
static Pixmap gLogoPixmap
static int DrawCreditItem(const char *creditItem, const char **members, int y, bool draw)
static unsigned int gCreditsHeight
void ScrollCredits(int ypos)
static const char * gLeadDevelopers[]
static void Sleep(int milliSec)
static const char * gConception[]
static Display * gDisplay
static unsigned int gWidth
static struct timeval gPopupTime
static Pixmap GetRootLogo()