Revision 9090,
1.5 KB
checked in by ghudson, 28 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r9089,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | /* |
---|
2 | * Copyright (C) 1992 Adobe Systems Incorporated. All rights reserved. |
---|
3 | * |
---|
4 | * RCSID: $Header: /afs/dev.mit.edu/source/repository/third/transcript/src/printpanel/ppanel.c,v 1.1.1.1 1996-10-07 20:25:54 ghudson Exp $ |
---|
5 | * |
---|
6 | * RCSLog: |
---|
7 | * $Log: not supported by cvs2svn $ |
---|
8 | * Revision 4.0 1992/08/21 16:24:13 snichols |
---|
9 | * Release 4.0 |
---|
10 | * |
---|
11 | * Revision 1.3 1992/07/14 23:06:58 snichols |
---|
12 | * Added copyright. |
---|
13 | * |
---|
14 | * |
---|
15 | */ |
---|
16 | |
---|
17 | #include <X11/Intrinsic.h> |
---|
18 | #include <X11/StringDefs.h> |
---|
19 | #include <Xm/Xm.h> |
---|
20 | #include <Xm/PushB.h> |
---|
21 | #include <stdio.h> |
---|
22 | #include "PrintPanel.h" |
---|
23 | |
---|
24 | extern char *optarg; |
---|
25 | extern int optind; |
---|
26 | |
---|
27 | static void GoAway(w) |
---|
28 | Widget w; |
---|
29 | { |
---|
30 | XCloseDisplay(XtDisplay(w)); |
---|
31 | exit(0); |
---|
32 | } |
---|
33 | |
---|
34 | |
---|
35 | main(argc, argv) |
---|
36 | int argc; |
---|
37 | char **argv; |
---|
38 | { |
---|
39 | Widget toplevel; |
---|
40 | Widget ppanel; |
---|
41 | XtAppContext app; |
---|
42 | Arg args[10]; |
---|
43 | int i; |
---|
44 | int c; |
---|
45 | |
---|
46 | toplevel = XtAppInitialize(&app, "PrintPanelApp", NULL, 0, &argc, |
---|
47 | argv, NULL, NULL, 0); |
---|
48 | i = 0; |
---|
49 | while ((c = getopt(argc, argv, "f:P:d:")) != EOF) { |
---|
50 | switch (c) { |
---|
51 | case 'P': |
---|
52 | case 'd': |
---|
53 | XtSetArg(args[i], XtNprinterName, optarg); i++; |
---|
54 | break; |
---|
55 | case 'f': |
---|
56 | XtSetArg(args[i], XtNfilterName, optarg); i++; |
---|
57 | break; |
---|
58 | default: |
---|
59 | fprintf(stderr, "Unrecognized switch %d\n", c); |
---|
60 | break; |
---|
61 | } |
---|
62 | } |
---|
63 | if (optind > 0) { |
---|
64 | XtSetArg(args[i], XtNinputFileName, argv[optind]); i++; |
---|
65 | } |
---|
66 | ppanel = XtCreateManagedWidget("printpanelwid", printPanelWidgetClass, |
---|
67 | toplevel, args, i); |
---|
68 | |
---|
69 | XtAddCallback(ppanel, XtNcancelCallback, GoAway, NULL); |
---|
70 | |
---|
71 | XtRealizeWidget (toplevel); |
---|
72 | XtAppMainLoop(app); |
---|
73 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.