main.c revision 350952b9
1/* $XConsortium: main.c,v 1.22 94/04/17 20:45:30 rws Exp $ */ 2/* 3 4Copyright (c) 1991 X Consortium 5 6Permission is hereby granted, free of charge, to any person obtaining 7a copy of this software and associated documentation files (the 8"Software"), to deal in the Software without restriction, including 9without limitation the rights to use, copy, modify, merge, publish, 10distribute, sublicense, and/or sell copies of the Software, and to 11permit persons to whom the Software is furnished to do so, subject to 12the following conditions: 13 14The above copyright notice and this permission notice shall be included 15in all copies or substantial portions of the Software. 16 17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR 21OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 22ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23OTHER DEALINGS IN THE SOFTWARE. 24 25Except as contained in this notice, the name of the X Consortium shall 26not be used in advertising or otherwise to promote the sale, use or 27other dealings in this Software without prior written authorization 28from the X Consortium. 29 30*/ 31/* $XFree86: xc/programs/xgc/main.c,v 1.6tsi Exp $ */ 32 33/* xgc 34** 35** main.c 36** 37** Contains the bare minimum necessary to oversee the whole operation. 38*/ 39 40#include <X11/Intrinsic.h> 41#include <X11/StringDefs.h> 42#include <X11/Xaw/Form.h> 43#include <X11/Xaw/Command.h> 44#include <X11/Xaw/AsciiText.h> 45#include <X11/Shell.h> 46#include <stdio.h> 47#include <stdlib.h> 48 49#include "xgc.h" 50#define DEFINE_TILE 51#include "tile" 52 53static void fill_up_commandform(Widget); 54static void quit(void); 55static void quitAction(Widget, XEvent *, String *, Cardinal *); 56static void clear_test_window(void); 57static void clear_result_window(void); 58static void set_foreground_and_background(void); 59 60/* The three columns in the XgcData arrays are: 61** name: the name of the toggle button 62** text: the corresponding text in the xgc syntax 63** code: the integer that the text corresponds to, for sending stuff 64** to X calls, etc. 65*/ 66 67static XgcData FunctionData[NUM_FUNCTIONS] = { 68 {"clear", "clear", GXclear}, 69 {"and", "and", GXand}, 70 {"andReverse", "andReverse", GXandReverse}, 71 {"copy", "copy", GXcopy}, 72 {"andInverted", "andInverted", GXandInverted}, 73 {"noop", "noop", GXnoop}, 74 {"xor", "xor", GXxor}, 75 {"or", "or", GXor}, 76 {"nor", "nor", GXnor}, 77 {"equiv", "equiv", GXequiv}, 78 {"invert", "invert", GXinvert}, 79 {"orReverse", "orReverse", GXorReverse}, 80 {"copyInverted", "copyInverted", GXcopyInverted}, 81 {"orInverted", "orInverted", GXorInverted}, 82 {"nand", "nand", GXnand}, 83 {"set", "set", GXset} 84}; 85 86/* The two rows in the XgcStuff structure are: 87** name of label, xgc syntax text, # of toggles, # of columns of toggles 88** (0 columns means 1 row, as many columns as necessary) 89** appropriate XgcData 90*/ 91 92XgcStuff FunctionStuff = { 93 {"Function","function",NUM_FUNCTIONS,4}, 94 FunctionData 95}; 96 97static XgcData TestData[NUM_TESTS] = { 98 {"Copy Area", "CopyArea", CopyArea}, 99 {"Copy Plane", "CopyPlane", CopyPlane}, 100 {"Points", "PolyPoint", PolyPoint}, 101 {"Lines", "PolyLine", PolyLine}, 102 {"Segments", "PolySegment", PolySegment}, 103 {"Rectangles", "PolyRectangle", PolyRectangle}, 104 {"Arcs", "PolyArc", PolyArc}, 105 {"(Filled Polygons)", "FillPolygon", FillPolygon}, 106 {"Filled Rectangles", "PolyFillRect", PolyFillRect}, 107 {"Filled Arcs", "PolyFillArc", PolyFillArc}, 108 {"Put Image", "PutImage", PutImage}, 109 {"(Get Image)", "GetImage", GetImage}, 110 {"Text 8", "PolyText8", PolyText8}, 111 {"Image Text 8", "ImageText8", ImageText8}, 112 {"Text 16", "PolyText16", PolyText16}, 113 {"Image Text 16", "ImageText16", ImageText16} 114}; 115 116XgcStuff TestStuff = { 117 {"Test","test",NUM_TESTS,2}, 118 TestData 119}; 120 121static XgcData LinestyleData[NUM_LINESTYLES] = { 122 {"Solid", "Solid", LineSolid}, 123 {"OnOffDash", "OnOffDash", LineOnOffDash}, 124 {"DoubleDash", "DoubleDash", LineDoubleDash} 125}; 126 127XgcStuff LinestyleStuff = { 128 {"LineStyle","linestyle",NUM_LINESTYLES,0}, 129 LinestyleData 130}; 131 132static XgcData CapstyleData[NUM_CAPSTYLES] = { 133 {"NotLast", "NotLast", CapNotLast}, 134 {"Butt", "Butt", CapButt}, 135 {"Round", "Round", CapRound}, 136 {"Projecting", "Projecting", CapProjecting} 137}; 138 139XgcStuff CapstyleStuff = { 140 {"CapStyle","capstyle",NUM_CAPSTYLES,2}, 141 CapstyleData 142}; 143 144static XgcData JoinstyleData[NUM_JOINSTYLES] = { 145 {"Miter", "Miter", JoinMiter}, 146 {"Round", "Round", JoinRound}, 147 {"Bevel", "Bevel", JoinBevel} 148}; 149 150XgcStuff JoinstyleStuff = { 151 {"JoinStyle","joinstyle",NUM_JOINSTYLES,0}, 152 JoinstyleData 153}; 154 155static XgcData FillstyleData[NUM_FILLSTYLES] = { 156 {"Solid", "Solid", FillSolid}, 157 {"Tiled", "Tiled", FillTiled}, 158 {"Stippled", "Stippled", FillStippled}, 159 {"OpaqueStippled", "OpaqueStippled", FillOpaqueStippled} 160}; 161 162XgcStuff FillstyleStuff = { 163 {"FillStyle","fillstyle",NUM_FILLSTYLES,2}, 164 FillstyleData 165}; 166 167static XgcData FillruleData[NUM_FILLRULES] = { 168 {"EvenOdd", "EvenOdd", EvenOddRule}, 169 {"Winding", "Winding", WindingRule} 170}; 171 172XgcStuff FillruleStuff = { 173 {"FillRule","fillrule",NUM_FILLRULES,0}, 174 FillruleData 175}; 176 177static XgcData ArcmodeData[NUM_ARCMODES] = { 178 {"Chord", "Chord", ArcChord}, 179 {"PieSlice", "PieSlice", ArcPieSlice} 180}; 181 182XgcStuff ArcmodeStuff = { 183 {"ArcMode","arcmode",NUM_ARCMODES,0}, 184 ArcmodeData 185}; 186 187/* Pointers to all the Xgcstuffs so we can run them through a loop */ 188 189static XgcStuff *Everything[8] = { 190 &FunctionStuff, 191 &LinestyleStuff, 192 &CapstyleStuff, 193 &JoinstyleStuff, 194 &FillstyleStuff, 195 &FillruleStuff, 196 &ArcmodeStuff, 197 &TestStuff 198}; 199 200#ifdef notdef 201int fildes[2]; /* for pipe */ 202FILE *outend; 203#endif 204 205XStuff X; /* GC stuff plus some global variables */ 206Boolean recording = FALSE; /* Whether we're recording into a file */ 207XtAppContext appcontext; /* To make Xt happy */ 208static Atom wm_delete_window; 209static XtActionsRec actions[] = { 210 {"quit", quitAction} 211}; 212 213static Widget bigdaddy; /* the top level widget */ 214 Widget topform; /* form surrounding the whole thing */ 215 Widget GCform; /* form in which you choose the GC */ 216static Widget Testform; /* form in which you choose the test */ 217 Widget testchoiceform; /* form inside that */ 218 ChoiceDesc *testchoicedesc; /* record of what widgets are in the 219 test choice form */ 220static Widget commandform; /* form with run, quit, clear, etc. */ 221 Widget test; /* where the test is run */ 222 Widget result; /* where the results are displayed */ 223static Widget runbutton; /* command for running */ 224static Widget clearbutton; /* command for clearing the test window */ 225 Widget recordbutton; /* start/stop recording */ 226static Widget playbackbutton; /* playback from file */ 227static Widget keyinputbutton; /* start reading from keyboard */ 228static Widget GCchoices[NUMCHOICES]; /* all the forms that contain stuff 229 for changing GC's*/ 230 ChoiceDesc *GCdescs[NUMCHOICES]; /* record of the widgets inside 231 the choice widgets */ 232 Widget planemaskchoice; /* form for choosing the plane mask */ 233 Widget dashlistchoice; /* form for choosing the dash list */ 234static Widget linewidthchoice; /* form for choosing line width */ 235 Widget linewidthtext; /* text widget within that */ 236static Widget fontchoice; /* form for choosing the font */ 237 Widget fonttext; /* text widget within that */ 238static Widget foregroundchoice; /* form for choosing foreground */ 239 Widget foregroundtext; /* text widget within that */ 240static Widget backgroundchoice; /* form for choosing background */ 241 Widget backgroundtext; /* text widget within that */ 242static Widget percentchoice; /* form for choosing percentage of test */ 243 244/* main(argc.argv) 245** --------------- 246** Initializes the toolkit, initializes data, puts up the widgets, 247** starts the event loop. 248*/ 249 250int 251main(int argc, char *argv[]) 252{ 253 static Arg shellargs[] = { 254 {XtNinput, (XtArgVal) True} 255 }; 256 257 static Arg testformargs[] = { 258 {XtNfromVert, (XtArgVal) NULL} /* put it under GCform */ 259 }; 260 261 static Arg commandformargs[] = { 262 {XtNfromVert, (XtArgVal) NULL}, /* put it under GCform */ 263 {XtNfromHoriz, (XtArgVal) NULL} /* and to the right of Testform */ 264 }; 265 266 static Arg testargs[] = { 267 {XtNheight, (XtArgVal) 400}, 268 {XtNwidth, (XtArgVal) 400}, 269 {XtNfromHoriz, (XtArgVal) NULL} /* put it to the right of GCform */ 270 }; 271 272 static Arg resultargs[] = { 273 {XtNheight, (XtArgVal) 50}, 274 {XtNwidth, (XtArgVal) 400}, 275 {XtNfromHoriz, (XtArgVal) NULL}, /* put it to the right of GCform */ 276 {XtNfromVert, (XtArgVal) NULL} /* and under test */ 277 }; 278 279 static Arg gcchoiceargs[] = { 280 {XtNfromVert, (XtArgVal) NULL}, /* put it under the one above it */ 281 {XtNfromHoriz, (XtArgVal) NULL}, /* and next to that one */ 282 {XtNborderWidth, (XtArgVal) 0} /* no ugly borders */ 283 }; 284 285 static Arg testchoiceargs[] = { 286 {XtNborderWidth, (XtArgVal) 0} 287 }; 288 289 int i; /* counter */ 290 291 /* Open the pipe */ 292 293#ifdef notdef 294 pipe(fildes); 295 outend = fdopen(fildes[0],"r"); 296#endif 297 298 /* Initialize toolkit stuff */ 299 300 XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); 301 302 bigdaddy = XtAppInitialize(&appcontext, "Xgc", (XrmOptionDescList) NULL, 303 (Cardinal) 0, &argc, argv, (String *) NULL, 304 shellargs, XtNumber(shellargs)); 305 X.dpy = XtDisplay(bigdaddy); 306 XtAppAddActions(appcontext, actions, XtNumber(actions)); 307 XtOverrideTranslations 308 (bigdaddy, XtParseTranslationTable("<Message>WM_PROTOCOLS: quit()")); 309 310 /* Initialize GC stuff */ 311 312 X.scr = DefaultScreenOfDisplay(X.dpy); 313 X.gc = XCreateGC(X.dpy,RootWindowOfScreen(X.scr),0,(XGCValues *) NULL); 314 X.miscgc = XCreateGC(X.dpy,RootWindowOfScreen(X.scr),0,(XGCValues *) NULL); 315 316 /* Find out what the foreground & background are, and update the GC 317 ** accordingly */ 318 319 set_foreground_and_background(); 320 321 topform = XtCreateManagedWidget("topform",formWidgetClass,bigdaddy, 322 NULL,0); 323 324 GCform = XtCreateManagedWidget("GCform",formWidgetClass,topform, 325 NULL,0); 326 327 /* create all the GCchoices forms */ 328 329 for (i=0;i<NUMCHOICES;++i) { 330 if (i==0) /* on top */ 331 gcchoiceargs[0].value = (XtArgVal) NULL; 332 else /* under the last one */ 333 gcchoiceargs[0].value = (XtArgVal) GCchoices[i-1]; 334 335 GCchoices[i] = XtCreateManagedWidget(Everything[i]->choice.text, 336 formWidgetClass,GCform, 337 gcchoiceargs,XtNumber(gcchoiceargs)); 338 339 /* now fill up that form */ 340 GCdescs[i] = create_choice(GCchoices[i],Everything[i]); 341 } 342 343 /* put the planemask choice under the bottom GC choice */ 344 gcchoiceargs[0].value = (XtArgVal) GCchoices[NUMCHOICES-1]; 345 planemaskchoice = XtCreateManagedWidget("planemask",formWidgetClass,GCform, 346 gcchoiceargs,XtNumber(gcchoiceargs)); 347 /* fill it up */ 348 create_planemask_choice(planemaskchoice); 349 350 /* put the dashlist choice under the planemask choice */ 351 gcchoiceargs[0].value = (XtArgVal) planemaskchoice; 352 dashlistchoice = XtCreateManagedWidget("dashlist",formWidgetClass,GCform, 353 gcchoiceargs,XtNumber(gcchoiceargs)); 354 /* fill it up */ 355 create_dashlist_choice(dashlistchoice); 356 357 /* put the linewidth choice under the dashlist choice */ 358 gcchoiceargs[0].value = (XtArgVal) dashlistchoice; 359 linewidthchoice = XtCreateManagedWidget("linewidth",formWidgetClass,GCform, 360 gcchoiceargs,XtNumber(gcchoiceargs)); 361 /* fill it up */ 362 linewidthtext = create_text_choice(linewidthchoice,TLineWidth,2,30); 363 364 /* put the font choice under the linewidth choice */ 365 gcchoiceargs[0].value = (XtArgVal) linewidthchoice; 366 fontchoice = XtCreateManagedWidget("font",formWidgetClass,GCform, 367 gcchoiceargs,XtNumber(gcchoiceargs)); 368 /* fill it up */ 369 fonttext = create_text_choice(fontchoice,TFont,80,300); 370 371 gcchoiceargs[0].value = (XtArgVal) fontchoice; 372 foregroundchoice = XtCreateManagedWidget("foreground",formWidgetClass,GCform, 373 gcchoiceargs,XtNumber(gcchoiceargs)); 374 foregroundtext = create_text_choice(foregroundchoice,TForeground,9,50); 375 /* FIXME 9 characters may not be the proper choice; really it 376 * should understand a more proper pixel specification... */ 377 378 gcchoiceargs[1].value = (XtArgVal) foregroundchoice; 379 backgroundchoice = XtCreateManagedWidget("background",formWidgetClass,GCform, 380 gcchoiceargs,XtNumber(gcchoiceargs)); 381 backgroundtext = create_text_choice(backgroundchoice,TBackground,9,50); 382 383 gcchoiceargs[1].value = (XtArgVal) NULL; 384 gcchoiceargs[0].value = (XtArgVal) foregroundchoice; 385 percentchoice = XtCreateManagedWidget("testpercent",formWidgetClass,GCform, 386 gcchoiceargs,XtNumber(gcchoiceargs)); 387 X.percent = 1.0; 388 create_testfrac_choice(percentchoice); 389 390 /* make all the labels inside the choices line up nicely */ 391 line_up_labels(GCdescs,(int) XtNumber(GCdescs)); 392 393 /* put the test form under the GC form */ 394 testformargs[0].value = (XtArgVal) GCform; 395 Testform = XtCreateManagedWidget("Testform",formWidgetClass,topform, 396 testformargs,XtNumber(testformargs)); 397 398 testchoiceform = XtCreateManagedWidget("testchoiceform",formWidgetClass, 399 Testform,testchoiceargs,XtNumber(testchoiceargs)); 400 testchoicedesc = create_choice(testchoiceform,Everything[CTest]); 401 402 commandformargs[0].value = (XtArgVal) GCform; 403 commandformargs[1].value = (XtArgVal) Testform; 404 commandform = XtCreateManagedWidget("commandform",formWidgetClass,topform, 405 commandformargs,XtNumber(commandformargs)); 406 407 /* Put the appropriate command buttons in the command form */ 408 409 fill_up_commandform(commandform); 410 411 testargs[2].value = (XtArgVal) GCform; /* to the right of */ 412 test = XtCreateManagedWidget("test",widgetClass,topform, 413 testargs,XtNumber(testargs)); 414 415 resultargs[2].value = (XtArgVal) GCform; /* to the right of */ 416 resultargs[3].value = (XtArgVal) test; /* under */ 417 result = XtCreateManagedWidget("result",asciiTextWidgetClass,topform, 418 resultargs,XtNumber(resultargs)); 419 420 /* Now realize all the widgets */ 421 422 XtRealizeWidget(bigdaddy); 423 424 /* Now do things we couldn't do until we had a window available */ 425 426 X.win = XtWindow(test); 427 X.tile = XCreatePixmap(X.dpy,X.win,tile_width,tile_height, 428 DefaultDepthOfScreen(X.scr)); 429 430 X.tile = XCreatePixmapFromBitmapData(X.dpy,X.win, 431 (char *)tile_bits,tile_width, 432 tile_height,Black,White, 433 DefaultDepthOfScreen(X.scr)); 434 X.stipple = XCreateBitmapFromData(X.dpy,X.win,(char *)tile_bits,tile_width, 435 tile_height); 436 437 XSetStipple(X.dpy,X.gc,X.stipple); 438 XSetStipple(X.dpy,X.miscgc,X.stipple); 439 440 GC_change_foreground(X.foreground,TRUE); 441 GC_change_background(X.background,TRUE); 442 443 wm_delete_window = XInternAtom(X.dpy, "WM_DELETE_WINDOW", False); 444 (void) XSetWMProtocols(X.dpy, XtWindow(bigdaddy), &wm_delete_window, 1); 445 446 /* Act like the user picked the first choice in each group */ 447 448 choose_defaults(GCdescs,(int)XtNumber(GCdescs)); 449 choose_defaults(&testchoicedesc,1); 450 451 /* Loop forever, dealing with events */ 452 453 XtAppMainLoop(appcontext); 454 455 return 0; 456} 457 458/* fill_up_commandform(w) 459** ---------------------- 460** Put the appropriate command buttons in the command form (w). 461*/ 462 463static void 464fill_up_commandform(Widget w) 465{ 466 static XtCallbackRec runcallbacklist[] = { 467 {(XtCallbackProc) run_test, NULL}, 468 {NULL, NULL} 469 }; 470 471 static XtCallbackRec quitcallbacklist[] = { 472 {(XtCallbackProc) quit, NULL}, 473 {NULL, NULL} 474 }; 475 476 static XtCallbackRec clearcallbacklist[] = { 477 {(XtCallbackProc) clear_test_window, NULL}, 478 {(XtCallbackProc) clear_result_window, NULL}, 479 {NULL, NULL} 480 }; 481 482 static XtCallbackRec playbackcallbacklist[] = { 483 {(XtCallbackProc) start_playback, NULL}, 484 {NULL, NULL} 485 }; 486 487 static XtCallbackRec keyinputcallbacklist[] = { 488 {(XtCallbackProc) read_from_keyboard, NULL}, 489 {NULL, NULL} 490 }; 491 492 static XtCallbackRec recordcallbacklist[] = { 493 {(XtCallbackProc) toggle_recordbutton, NULL}, 494 {NULL, NULL} 495 }; 496 497 static Arg runargs[] = { 498 {XtNcallback, (XtArgVal) NULL} 499 }; 500 501 static Arg clearargs[] = { 502 {XtNcallback, (XtArgVal) NULL}, 503 {XtNfromVert, (XtArgVal) NULL}, /* put it under runbutton */ 504 {XtNvertDistance,(XtArgVal) 10} 505 }; 506 507 static Arg recordargs[] = { 508 {XtNcallback, (XtArgVal) NULL}, 509 {XtNfromVert, (XtArgVal) NULL}, /* put it under clearbutton */ 510 {XtNvertDistance,(XtArgVal) 10}, 511 {XtNresizable, (XtArgVal) True} /* so we can change the name */ 512 }; 513 514 static Arg playbackargs[] = { 515 {XtNcallback, (XtArgVal) NULL}, 516 {XtNfromVert, (XtArgVal) NULL} /* put it under recordbutton */ 517 }; 518 519 static Arg keyinputargs[] = { 520 {XtNcallback, (XtArgVal) NULL}, 521 {XtNfromVert, (XtArgVal) NULL} /* put it under playbackbutton */ 522 }; 523 524 static Arg quitargs[] = { 525 {XtNcallback, (XtArgVal) NULL}, 526 {XtNfromVert, (XtArgVal) NULL}, /* put it under keyinputbutton */ 527 {XtNvertDistance,(XtArgVal) 10} 528 }; 529 530 runargs[0].value = (XtArgVal) runcallbacklist; 531 runbutton = XtCreateManagedWidget("Run",commandWidgetClass, 532 w,runargs,XtNumber(runargs)); 533 534 clearargs[0].value = (XtArgVal) clearcallbacklist; 535 clearargs[1].value = (XtArgVal) runbutton; /* under */ 536 clearbutton = XtCreateManagedWidget("Clear window",commandWidgetClass, 537 w,clearargs,XtNumber(clearargs)); 538 539 recordargs[0].value = (XtArgVal) recordcallbacklist; 540 recordargs[1].value = (XtArgVal) clearbutton; /* under */ 541 recordbutton = XtCreateManagedWidget("Record",commandWidgetClass, 542 w,recordargs,XtNumber(recordargs)); 543 544 playbackargs[0].value = (XtArgVal) playbackcallbacklist; 545 playbackargs[1].value = (XtArgVal) recordbutton; /* under */ 546 playbackbutton = XtCreateManagedWidget("Playback",commandWidgetClass, 547 w,playbackargs,XtNumber(playbackargs)); 548 549 keyinputargs[0].value = (XtArgVal) keyinputcallbacklist; 550 keyinputargs[1].value = (XtArgVal) playbackbutton; 551 keyinputbutton = XtCreateManagedWidget("Read Input",commandWidgetClass, 552 w,keyinputargs,XtNumber(keyinputargs)); 553 554 quitargs[0].value = (XtArgVal) quitcallbacklist; 555 quitargs[1].value = (XtArgVal) keyinputbutton; /* under */ 556 (void) XtCreateManagedWidget("Quit",commandWidgetClass, 557 w,quitargs,XtNumber(quitargs)); 558 559} 560/* quit() 561** ------ 562** Leave the program nicely. 563*/ 564 565static void 566quit(void) 567{ 568 close_file_if_recording(); 569 exit(0); 570} 571 572static void quitAction(Widget w, XEvent *e, String *p, Cardinal *n) 573{ 574 if (e->type == ClientMessage && e->xclient.data.l[0] != wm_delete_window) 575 XBell(XtDisplay(w), 0); 576 else 577 quit(); 578} 579 580/* clear_test_window() 581** ------------------- 582** Clear the test window. 583*/ 584 585static void 586clear_test_window(void) 587{ 588 XClearWindow(X.dpy,XtWindow(test)); 589} 590 591/* clear_result_window() 592** --------------------- 593** Clear the result window. 594*/ 595 596static void 597clear_result_window(void) 598{ 599 set_text(result, ""); 600} 601 602/* set_foreground_and_background() 603** ------------------------------- 604** Finds the user-specified foreground and background by querying 605** the resource manager, and sets state accordingly. Also specifies 606** the initial font for text tests. 607*/ 608 609static void 610set_foreground_and_background(void) 611{ 612 X.gcv.foreground = X.foreground = 0; 613 X.gcv.background = X.background = 0xffffffff; 614 615 X.fontname = "6x10"; 616 GC_change_font(X.fontname,FALSE); 617} 618