14#include "RConfigure.h"
27#if defined(R__AIX) || defined(R__SOLARIS)
28#include <sys/select.h>
39static GC
gGC =
nullptr;
40static XFontStruct*
gFont =
nullptr;
53static std::array<const char*, 2>
gConception = {
"P. C. Bender",
nullptr};
55static std::array<const char*, 3>
gLeadDevelopers = {
"V. Bildstein",
"P. C. Bender",
nullptr};
57static std::array<const char*, 3>
gKeyContributors = {
"R. Dunlop",
"D. Miller",
nullptr};
71 tv.tv_sec = milliSec / 1000;
72 tv.tv_usec = (milliSec % 1000) * 1000;
74 gettimeofday(&ctv,
nullptr);
75 if((dtv.tv_usec = ctv.tv_usec - ptv.tv_usec) < 0) {
76 dtv.tv_usec += 1000000;
79 dtv.tv_sec = ctv.tv_sec - ptv.tv_sec;
81 if((ctv.tv_usec = tv.tv_usec - dtv.tv_usec) < 0) {
82 ctv.tv_usec += 1000000;
85 ctv.tv_sec = tv.tv_sec - dtv.tv_sec;
87 return ctv.tv_sec >= 0;
97 tv.tv_sec = milliSec / 1000;
98 tv.tv_usec = (milliSec % 1000) * 1000;
100 select(0,
nullptr,
nullptr,
nullptr, &tv);
108 Screen* xscreen = XDefaultScreenOfDisplay(
gDisplay);
109 if(xscreen ==
nullptr) {
113 int depth = PlanesOfScreen(xscreen);
115 XWindowAttributes win_attr;
119 attr.valuemask = XpmVisual | XpmColormap | XpmDepth;
120 attr.visual = win_attr.visual;
121 attr.colormap = win_attr.colormap;
122 attr.depth = win_attr.depth;
125 attr.valuemask |= XpmColorKey;
127 attr.color_key = XPM_COLOR;
128 }
else if(depth > 2) {
129 attr.color_key = XPM_GRAY4;
130 }
else if(depth > 1) {
131 attr.color_key = XPM_GRAY;
132 }
else if(depth == 1) {
133 attr.color_key = XPM_MONO;
135 attr.valuemask &= ~XpmColorKey;
140 file.append(getenv(
"GRSISYS"));
141 file.append(
"/libraries/TGRSIint/grsisplash_bw.xpm");
144 XpmFreeAttributes(&attr);
146 if(ret == XpmSuccess || ret == XpmColorError) {
150 std::cout <<
"rootx xpm error: " << XpmGetErrorString(ret) << std::endl;
165 std::array<char, 2048> buf;
167 snprintf(buf.data(), buf.size(),
"%s/CREDITS", ROOTDOCDIR);
169 snprintf(buf.data(), buf.size(),
"%s/README/CREDITS", getenv(
"ROOTSYS"));
174 FILE* f = fopen(buf.data(),
"r");
180 while(fgets(buf.data(), buf.size(), f) !=
nullptr) {
181 if(strncmp(buf.data(),
"N: ", 3) == 0) {
189 while(fgets(buf.data(), buf.size(), f) !=
nullptr) {
190 if(strncmp(buf.data(),
"N: ", 3) == 0) {
191 int len = strlen(buf.data());
208 std::array<char, 80> version;
209 snprintf(version.data(), version.size(),
"Version %s", GRSI_RELEASE);
218 const char* version =
"A ROOT based package";
223static int DrawCreditItem(
const char* creditItem,
const char** members,
int y,
bool draw)
227 std::array<char, 1024> credit;
228 int lineSpacing =
gFont->max_bounds.ascent +
gFont->max_bounds.descent;
230 strlcpy(credit.data(), creditItem, credit.size());
231 for(
int i = 0; (members !=
nullptr) && (members[i] !=
nullptr); i++) {
233 strlcat(credit.data(),
", ", credit.size());
235 if(XTextWidth(
gFont, credit.data(), strlen(credit.data())) + XTextWidth(
gFont, members[i], strlen(members[i])) >
241 strlcpy(credit.data(),
" ", credit.size());
243 strlcat(credit.data(), members[i], credit.size());
257 if(
gFont ==
nullptr) {
261 int lineSpacing =
gFont->max_bounds.ascent +
gFont->max_bounds.descent;
266 y += 2 * lineSpacing - 1;
270 y += 2 * lineSpacing - 1;
274 y += 2 * lineSpacing - 1;
299 int screen = DefaultScreen(
gDisplay);
301 Pixel back = WhitePixel(
gDisplay, screen);
302 Pixel fore = BlackPixel(
gDisplay, screen);
318 unsigned int depth = 0;
321 Screen* xscreen = XDefaultScreenOfDisplay(
gDisplay);
323 if(xscreen ==
nullptr) {
328 x = (WidthOfScreen(xscreen) -
gWidth) / 2;
329 y = (HeightOfScreen(xscreen) -
gHeight) / 2;
334 XSetWindowAttributes xswa;
335 uint64_t valmask = CWBackPixmap | CWOverrideRedirect;
337 xswa.override_redirect = True;
341 gFont = XLoadQueryFont(
gDisplay,
"-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1");
342 if(
gFont ==
nullptr) {
343 std::cout <<
"Couldn't find font \"-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1\"," << std::endl
344 <<
"trying \"fixed\". Please fix your system so helvetica can be found, " << std::endl
345 <<
"this font typically is in the rpm (or pkg equivalent) package " << std::endl
346 <<
"XFree86-[75,100]dpi-fonts or fonts-xorg-[75,100]dpi." << std::endl;
348 if(
gFont ==
nullptr) {
349 std::cout <<
"Also couln't find font \"fixed\", your system is terminally misconfigured." << std::endl;
352 if(
gFont !=
nullptr) {
386 bool stopScroll =
false;
394 gSystem->Sleep(3500);
398 if(XCheckMaskEvent(
gDisplay, ButtonPressMask | ExposureMask, &event) != 0) {
401 if(event.xexpose.count == 0) {
407 if(
gAbout && event.xbutton.button == 3) {
408 stopScroll = !stopScroll;
423 if(
gAbout && !stopScroll) {
449 if(
gFont !=
nullptr) {
void PopupLogo(bool about)
static void DrawROOTCredit()
static std::array< const char *, 3 > gKeyContributors
static int DrawCredits(bool draw, bool)
static Pixmap gCreditsPixmap
static unsigned int gWidth
static unsigned int gCreditsHeight
static bool StayUp(int milliSec)
static Display * gDisplay
static std::array< const char *, 3 > gLeadDevelopers
static void DrawVersion()
static int DrawCreditItem(const char *creditItem, const char **members, int y, bool draw)
static XRectangle gCreditsRect
static unsigned int gCreditsWidth
static struct timeval gPopupTime
static XFontStruct * gFont
static Pixmap gLogoPixmap
static void Sleep(int milliSec)
static char ** gContributors
void ScrollCredits(int ypos)
static Pixmap GetRootLogo()
static Window gLogoWindow
static void ReadContributors()
static std::array< const char *, 2 > gConception
static unsigned int gHeight