| version 1.2, 2002/07/07 23:57:58 |
version 1.3, 2002/07/09 19:53:36 |
| Line 28 void StartGraphics(void) |
|
| Line 28 void StartGraphics(void) |
|
| char xgdisfile[TMP_LEN]; |
char xgdisfile[TMP_LEN]; |
| |
|
| if (snprintf(xgdisfile, TMP_LEN, "%s/.xgdisplay", getenv("HOME")) ==-1) { |
if (snprintf(xgdisfile, TMP_LEN, "%s/.xgdisplay", getenv("HOME")) ==-1) { |
| fprintf(stderr, "Warning: xgdisfile truncated at %s:%d ('%s')\n", |
fprintf(stderr, "Warning: xgdisfile truncated at %s:%d ('%s')\n", |
| __FILE__, __LINE__, xgdisfile); |
__FILE__, __LINE__, xgdisfile); |
| } |
} |
| #undef TMP_LEN |
#undef TMP_LEN |
| f = fopen(xgdisfile, "r"); |
f = fopen(xgdisfile, "r"); |
| Line 76 void StartGraphics(void) |
|
| Line 76 void StartGraphics(void) |
|
| } |
} |
| |
|
| /* Recreate all the diagnostic windows. */ |
/* Recreate all the diagnostic windows. */ |
| for (i=0; i<numberOfWindows; i++) { |
for (i=0; i<numberOfWindows, |
| |
theWindowArray[i] != NULL, |
| |
theWindowArray[i]->label != NULL; i++) { |
| theWindow = theWindowArray[i]; |
theWindow = theWindowArray[i]; |
| if (snprintf(TclCommand, TclCommand_MAX, |
if (snprintf(TclCommand, TclCommand_MAX, |
| "SetupWindow \"%s\" %s %d %d %c %.3g %.3g %d" |
"SetupWindow \"%s\" %s %d %d %c %.3g %.3g %d" |
| Line 208 void XGStart(void) |
|
| Line 210 void XGStart(void) |
|
| signal(SIGUSR1, (__sighandler_t) C_KillGraphicsProc); |
signal(SIGUSR1, (__sighandler_t) C_KillGraphicsProc); |
| Tk_MainLoop(); |
Tk_MainLoop(); |
| } |
} |
| |
else { // if (theRunWithXFlag == FALSE) |
| if (theRunWithXFlag == FALSE) { |
|
| signal(SIGUSR1, (__sighandler_t) StartGraphics); |
signal(SIGUSR1, (__sighandler_t) StartGraphics); |
| |
|
| while ((theNumberOfSteps==0 || theCurrentStep<=theNumberOfSteps) && |
while (theNumberOfSteps == 0 || theCurrentStep <= theNumberOfSteps) { |
| (theRunWithXFlag == FALSE)) { |
|
| XGMainLoop(); |
XGMainLoop(); |
| if (theDumpPeriod != 0 && theCurrentStep%theDumpPeriod==0) { |
if (theDumpPeriod != 0 && theCurrentStep%theDumpPeriod == 0) { |
| Dump(theDumpFile); |
Dump(theDumpFile); |
| } |
} |
| theCurrentStep++; |
theCurrentStep++; |
| } |
} |
| if (theDumpPeriod != 0 && theCurrentStep%theDumpPeriod==0) |
if (theDumpPeriod != 0 && theCurrentStep%theDumpPeriod == 0) |
| Dump(theDumpFile); |
Dump(theDumpFile); |
| if (theCurrentStep>theNumberOfSteps && (theRunWithXFlag == FALSE)) { |
if (theCurrentStep > theNumberOfSteps) { |
| Quit(); |
Quit(); |
| exit(0); |
exit(0); |
| } |
} |
| Line 301 int C_KillGraphicsProc(void) |
|
| Line 301 int C_KillGraphicsProc(void) |
|
| |
|
| theRunWithXFlag = FALSE; |
theRunWithXFlag = FALSE; |
| |
|
| |
/* XXX: THIS MUST BE REWRITED!!! |
| |
* pixmap_buffer is sometimes not NULL and therefore XFreePixmap() |
| |
* crashes program! |
| |
*/ |
| |
|
| #ifdef DEBUG |
#ifdef DEBUG |
| fprintf(stderr, "Freeing display(%p)\n"); |
fprintf(stderr, "Freeing display(%p)\n"); |
| #endif |
#endif |
| for (i = 0; i < numberOfWindows; i++) { |
for (i = 0; i < numberOfWindows, theWindowArray[i] != NULL; i++) { |
| #ifdef DEBUG |
#ifdef DEBUG |
| fprintf(stderr, "\ttheWindowArray[%02d]('%s')->pixmap_buffer(%p)\n", |
if(theWindowArray[i] != NULL) |
| i, theWindowArray[i], theWindowArray[i]->pixmap_buffer); |
fprintf(stderr, "\ttheWindowArray[%02d]('%s')->pixmap_buffer(%d)\n", |
| |
i, theWindowArray[i], theWindowArray[i]->pixmap_buffer); |
| #endif |
#endif |
| XFreePixmap(theDisplay, theWindowArray[i]->pixmap_buffer); |
/* XXX: REWRITE THIS! */ |
| |
if (theWindowArray[i]->pixmap_buffer == 0) |
| |
XFreePixmap(theDisplay, theWindowArray[i]->pixmap_buffer); |
| theWindowArray[i]->pixmap_buffer = 0; |
theWindowArray[i]->pixmap_buffer = 0; |
| } |
} |
| |
|