* The ripout window creation routine. */
| 569 | * The ripout window creation routine. |
| 570 | */ |
| 571 | static Widget |
| 572 | create_ripout_widget(Widget parent) |
| 573 | { |
| 574 | Widget imageport; |
| 575 | Arg args[16]; |
| 576 | Cardinal num_args; |
| 577 | |
| 578 | static int rip_width, rip_height; |
| 579 | |
| 580 | if (!rip_image) { |
| 581 | XpmAttributes attributes; |
| 582 | int errorcode; |
| 583 | |
| 584 | attributes.valuemask = XpmCloseness; |
| 585 | attributes.closeness = 65535; /* Try anything */ |
| 586 | errorcode = XpmReadFileToImage(XtDisplay(parent), |
| 587 | appResources.tombstone, |
| 588 | &rip_image, 0, &attributes); |
| 589 | if (errorcode != XpmSuccess) { |
| 590 | char buf[BUFSZ]; |
| 591 | |
| 592 | Sprintf(buf, "Failed to load %s: %s", appResources.tombstone, |
| 593 | XpmGetErrorString(errorcode)); |
| 594 | X11_raw_print(buf); |
| 595 | return (Widget) 0; |
| 596 | } |
| 597 | rip_width = rip_image->width; |
| 598 | rip_height = rip_image->height; |
| 599 | } |
| 600 | |
| 601 | num_args = 0; |
| 602 | XtSetArg(args[num_args], XtNwidth, rip_width); |
| 603 | num_args++; |
| 604 | XtSetArg(args[num_args], XtNheight, rip_height); |
| 605 | num_args++; |
| 606 | XtSetArg(args[num_args], XtNtranslations, |
| 607 | XtParseTranslationTable(rip_translations)); |
| 608 | num_args++; |
| 609 | |
| 610 | imageport = XtCreateManagedWidget("rip", windowWidgetClass, parent, args, |
| 611 | num_args); |
| 612 | |
| 613 | XtAddCallback(imageport, XtNexposeCallback, rip_exposed, (XtPointer) 0); |
| 614 | |
| 615 | return imageport; |
| 616 | } |
| 617 | |
| 618 | #endif /* GRAPHIC_TOMBSTONE */ |
| 619 |
no test coverage detected