"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "mpdist-3.7.1/mptool/base.c" of archive mpdist-3.7.1.tar.gz:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1
2 /*
3 * $Header: /cvsroot/mpdist/mpdist/mptool/base.c,v 1.1.1.1 2002/04/12 16:47:25 richbastard Exp $
4 *
5 * Copyright (c) 1987-2002 Rich Burridge, Sun Microsystems Inc.
6 * All rights reserved.
7 *
8 * This software is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Library General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * This software is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
16 * License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this software; if not, write to the Free Software Foundation,
20 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22
23 #include "mptool.h"
24 #include "interface.h"
25
26 char *filenames; /* List of file(s) to print. */
27
28 static void get_main_vals(void);
29
30
31 void
32 Base (void)
33 {
34 filenames = NULL;
35 }
36
37
38 void
39 do_print_files (void)
40 {
41 char *names = get_str_value(F_MAIN, "filename");
42
43 do_print_cmd(names);
44 }
45
46
47 void
48 do_reset_options (void)
49 {
50 set_excl_value(F_MAIN, "file_type_mail");
51 if (int_opt_val(O_ARTICLE)) {
52 set_excl_value(F_MAIN, "file_type_news");
53 } else if (int_opt_val(O_PRINT_PS)) {
54 set_excl_value(F_MAIN, "file_type_post");
55 } else if (int_opt_val(O_TEXTDOC)) {
56 set_excl_value(F_MAIN, "file_type_text");
57 }
58
59 set_excl_value(F_MAIN, "output_port");
60 if (int_opt_val(O_LANDSCAPE)) {
61 set_excl_value(F_MAIN, "output_land");
62 } else if (!EQUAL(ptype, PRO_NORMAL)) {
63 set_excl_value(F_MAIN, "output_perorg");
64 }
65
66 set_excl_value(F_MAIN, "filofax");
67
68 if (EQUAL(ptype, PRO_FRANKLIN)) {
69 set_excl_value(F_MAIN, "franklin");
70 } else if (EQUAL(ptype, PRO_PRO_PLAN)) {
71 set_excl_value(F_MAIN, "proplan");
72 } else if (EQUAL(ptype, PRO_TIME_MANAGER)) {
73 set_excl_value(F_MAIN, "time_manager");
74 } else if (EQUAL(ptype, PRO_TS_INTL)) {
75 set_excl_value(F_MAIN, "time_system__intl_");
76 } else if (EQUAL(ptype, PRO_TS_PARTNER)) {
77 set_excl_value(F_MAIN, "time_system__partner_");
78 }
79
80 if (paper_size == P_A4) {
81 set_excl_value(F_MAIN, "paper_size_a4");
82 } else if (paper_size == P_US) {
83 set_excl_value(F_MAIN, "paper_size_us");
84 }
85
86 set_str_value(F_MAIN, "subject", str_opt_val(O_GSUBJECT));
87 set_int_value(F_MAIN, "copies", int_opt_val(O_COPIES));
88 set_str_value(F_MAIN, "filename", filenames);
89
90 if (int_opt_val(O_DUPLEX)) {
91 set_excl_value(F_MAIN, "no_sides_single");
92 } else {
93 set_excl_value(F_MAIN, "no_sides_double");
94 }
95 }
96
97
98 void
99 do_save_defaults(void)
100 {
101 get_main_vals();
102 write_resources();
103 }
104
105
106 void
107 do_show_file(void)
108 {
109 if (file_widget == NULL) {
110 file_widget = create_file_widget();
111 }
112
113 gtk_widget_show(file_widget);
114 }
115
116
117 static void
118 get_main_vals(void)
119 {
120 set_int_opt_val(O_ARTICLE, get_bool_value(F_MAIN, "file_type_news"));
121 set_int_opt_val(O_PRINT_PS, get_bool_value(F_MAIN, "file_type_post"));
122 set_int_opt_val(O_TEXTDOC, get_bool_value(F_MAIN, "file_type_text"));
123 set_str_opt_val(O_GSUBJECT, get_str_value(F_MAIN, "subject"));
124 set_int_opt_val(O_COPIES, get_int_value(F_MAIN, "copies"));
125 set_int_opt_val(O_DUPLEX, get_bool_value(F_MAIN, "no_sides_double"));
126 set_int_opt_val(O_LANDSCAPE, get_bool_value(F_MAIN, "output_land"));
127
128 if (int_opt_val(O_LANDSCAPE)) {
129 ptype = PRO_LANDSCAPE;
130 } else {
131 ptype = PRO_NORMAL;
132 }
133
134 if (get_bool_value(F_MAIN, "output_perorg")) {
135 if (get_bool_value(F_MAIN, "filofax")) {
136 ptype = PRO_FILOFAX;
137 } else if (get_bool_value(F_MAIN, "franklin")) {
138 ptype = PRO_FRANKLIN;
139 } else if (get_bool_value(F_MAIN, "proplan")) {
140 ptype = PRO_PRO_PLAN;
141 } else if (get_bool_value(F_MAIN, "time_manager")) {
142 ptype = PRO_TIME_MANAGER;
143 } else if (get_bool_value(F_MAIN, "time_system__intl_")) {
144 ptype = PRO_TS_INTL;
145 } else if (get_bool_value(F_MAIN, "time_system__partner_")) {
146 ptype = PRO_TS_PARTNER;
147 }
148 }
149
150 if (get_bool_value(F_MAIN, "paper_size_a4")) {
151 paper_size = P_A4;
152 } else if (get_bool_value(F_MAIN, "paper_size_us")) {
153 paper_size = P_US;
154 } else {
155 paper_size = P_NONE;
156 }
157 }