File: apsconf.template

package info (click to toggle)
jed-extra 2.5.6-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,564 kB
  • sloc: makefile: 75; ruby: 43; sed: 38; sh: 31
file content (378 lines) | stat: -rw-r--r-- 13,812 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
% apsconf.sl -*- mode: slang; mode: fold; -*-
% 
% apsconf.sl is the configurable part of apsmode.
% Here you can modify some global settings as temp directory,
% default printer id, style sheet usage, ...
% some of them are OS specific
% 
% requires apsmode version >=2.2
% 
% 2005-11-21 GM : use path_concat() for Apsmode_tmp_dir
% 2006-06-02 TKO: adapted to apsmode V2.0
% 2006-06-19 TKO: adapted to apsmode V2.2
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% name        : Apsmode_menu
% description : defines, whether a popup menu should be created
%               by apsmode.sl
%               be aware that quickprint settings are only available
%               via menu
%               wmenu will not be supported
%               (0 = no menu, 1 = popup menu)
% value       : path
%
% name        : Apsmode_del_ps_file
% description : delete created ps file after printing/viewing 
%               (0 = keep, 1 = delete)
% value       : 0 or 1
%
% name        : Apsmode_tmp_dir
% description : directory for temporary files and ps file
% value       : path
%
% name        : Apsmode_a2ps_cmd
% description : OS specific command to run a2ps
% value       : a2ps programm call (with path)
%
% name        : Apsmode_default_printer
% description : id of the default printer
%               id = 0 is reserved for QuickPrint, don't use it !
%               the configuration file handles UNIX and Windows
%               printers separately
% value       : aps_max_no_printers > Apsmode_default_printer > 0
%
% name        : Apsmode_tmp_file
% description : name of the ps file, which will be created by a2ps
% value       : *.ps
%
% name        : Apsmode_style_sheet
% description : array containing all jed mode names (as index), for which a
%               jed specific style sheet for a2ps should be used
%               style sheets must be available in jed library path
%               can be created by function <create_a2ps_style_sheet(mode)>
% value       : Apsmode_style_sheet[<jed-mode-name>] = 1;
%

%Apsmode_menu = 1;
%Apsmode_del_ps_file = 1;

%#ifdef UNIX
%Apsmode_tmp_dir = path_concat(getenv("TMPDIR"), ""); % ensure trailing "/"
%if (Apsmode_tmp_dir == "")
%  Apsmode_tmp_dir = "/home/wtb3_tko/tmp/";
%Apsmode_a2ps_cmd = "a2ps";
%Apsmode_default_printer = 5;
%#endif
%
%#ifdef MSWINDOWS
%Apsmode_tmp_dir = "C:\\temp\\";
%Apsmode_a2ps_cmd = "D:\\Programs\\a2ps\\bin\\a2ps.exe";
%Apsmode_default_printer = 1;
%#endif
%
%Apsmode_tmp_file = path_concat(Apsmode_tmp_dir, "print_from_jed.ps");
%
%Apsmode_style_sheet["SLang"] = 1;
%Apsmode_style_sheet["awk"] = 1;

  
%%%%%%%%%%%%%%%%%% Define printers %%%%%%%%%%%%%%%%%%%%%%%%%%% %{{{
% 
% This structure contains the printer settings for apsmode.sl
% Most of the settings are directly copied from a2ps options
% See a2ps documentation for further details.
% These settings have been tested with:
% - UNIX      : a2ps v4.12
% - MSWINDOWS : a2ps v4.13b
% 
% The printer settings have been "divided" for UNIX/Windows. so that only
% the relevant printers will show up under the specific OS.
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% JED<XYZ> variables used as placeholder for print options
% 
% name       : JEDFILENAME
% description: use this variable in footer/header definitions to print
%              the path/name of the buffer to be printed
%              do not use "$f" option of a2ps, because this will print
%              the name of the temporary print file instead of the name of 
%              the buffer
% 
% name       : JEDDATETIME
% description: use this variable in footer/header definitions to print
%              the current date, time of the buffer print formatted
%              as YYYY-MMM-DD, HH:MM:SS
%              this is a replacement for the "%e %*" option of a2ps
%              which seems to not work correctly under MSWINDOWS
%              Correction: with apsmode V1.4 options for Windows are 
%              correctly send to a2ps, so "%e %*" should work
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% name       : setup
% description: printer id
%              local variable
%              will be used as program internal identifier for 
%              the print setup
% value(s)   : integer, incremented by 1
% 
% name       : setupname
% description: that's the name of the printer setup, which will be used as 
%              identifier
%              should not be too long, because it will be used within 
%              the menus
% value(s)   : text
% example    : "code 2x1x1, A4"
% 
% name       : name
% description: physical printer name as known by the OS
% value(s)   : text
% example    : "114_f004"
% 
% name       : description
% description: Your information about the printer setup
% value(s)   : text
% example    : "This is an example description"
% 
% name       : columns
% description: specify the number of columns of virtual pages per physical page
% value(s)   : integer (1...n)
% example    : "2"
% 
% name       : rows
% description: specify the number of rows of virtual pages per physical page
% value(s)   : integer (1...n)
% example    : "2"
% 
% name       : fontsize
% description: defines fontsize in points
%              if other formats than points needs to be supported 
%              by QuickPrint then function <set_qp_fontsize_callback> has to be 
%              modified accordingly
% value(s)   : 8,...,72 points, anything your printer and a2ps supports
% example    : "8points"
% 
% name       : chars
% description: number of characters to be printed on one line
%              format = min:max
%              min - minimum of characters to be printed
%              max - maximum of characters to be printed
% value(s)   : Integer:Integer
% example    : "80:100"
% 
% name       : borders
% description: switches border printing around each page on/off
% value(s)   : on,off
% example    : "on"
% 
% name       : orientation
% description: defines sheet orientation
% value(s)   : portrait,landscape
% example    : "portrait"
% 
% name       : medium
% description: defines print medium (sheet size)
%              if other formats than a3, a4, letter needs to be supported 
%              by QuickPrint then function <set_qp_medium_callback> has to be 
%              modified accordingly
% value(s)   : a4, a3, letter, ..., anything your printer and a2ps supports
% example    : "a4"
% 
% name       : sides
% description: printing on one/both sides of a sheet
% value(s)   : 1,2
% example    : "2"
% 
% name       : truncate
% description: truncate lines, if they are longer than maximum number of 
%              printing characters
%              !!! ATTENTION !!!
%              try on/off values with your a2ps installation
%              there seems to be a bug in different a2ps version 
%              and/or OS version
%              UNIX     , a2ps v4.12  : truncate=on does not truncate
%              MSWINDOWS, a2ps v4.13b : truncate=off does not truncate
% value(s)   : on,off
% example    : "on"
% 
% name       : linenumbers
% description: add linenumbers every x line to your printout
%              helpful for program code
%              switch off with value 0
% value(s)   : 0...n
% example    : "5"
% 
% name       : copies
% description: number of copies to be printed
% value(s)   : 1...n
% example    : "1"
% 
% name       : major
% description: specify whether the virtual pages should be first filled in 
%              rows (direction = rows) or in columns (direction = columns).
% value(s)   : rows,columns
% example    : "columns"
% 
% name       : margin
% description: Specify the size of the margin (num PostScript points, 
%              or 12 points without arguments) to leave in the inside 
%              (i.e. left for the front side page, and right for the back 
%              side).  This is intended to ease the binding.
% value(s)   : 0...n
% example    : "5"
% 
% name       : header
% description: sets the page header
% value(s)   : text
% example    : "Your Page header"
% 
% name       : title_left
% description: Set virtual page left title to text
%              see a2ps documentation for more detailed options
% value(s)   : text and/or a2ps options
% example    : "%e %*"
% 
% name       : title_center
% description: Set virtual page center title to text
%              see a2ps documentation for more detailed options
% value(s)   : text and/or a2ps options
% example    : "$f", "JEDFILENAME"
% 
% name       : title_right
% description: Set virtual page right title to text
%              see a2ps documentation for more detailed options
% value(s)   : text and/or a2ps options
% example    : "%s./%s#"
% 
% name       : footer_left
% description: Set virtual page left footer to text
%              see a2ps documentation for more detailed options
% value(s)   : text and/or a2ps options
% example    : "%e %*"
% 
% name       : footer_center
% description: Set virtual page center footer to text
%              see a2ps documentation for more detailed options
% value(s)   : text and/or a2ps options
% example    : "$f"
% 
% name       : footer_right
% description: Set virtual page right footer to text
%              see a2ps documentation for more detailed options
% value(s)   : text and/or a2ps options
% example    : "%s./%s#"
% 
% name       : color
% description: switches color printing on/off
%              bw - Style is plain: pure black and white, with standard fonts
%              color - Colors are used to highlight the keywords
% value(s)   : bw,color
% example    : "color"
% 
% name       : pretty
% description: switches pretty printing feature of a2ps on/off
% value(s)   : on,off
% example    : "on"
% 
% name       : print_cmd
% description: string containing the OS specific command to send the created
%              postscript file to the physical printer
%              could also be a ghostview command if direct printing 
%              is somehow not supported
% value(s)   : text
% example    : strcat("lpr -P ", Apsmode_Printers[setup].name, " ", Apsmode_tmp_file)
%              strcat("gsview32.exe ", Apsmode_tmp_file);
% 
% name       : view_cmd
% description: string containing the OS specific command to view the created
%              postscript file (ghostview preferred)
% value(s)   : text
% example    : strcat("gv ", Apsmode_tmp_file)
%              strcat("gsview32.exe ", Apsmode_tmp_file);
% 
% name       : copy_of
% description: internal variable, which is needed for QuickPrint settings
%              has to be 0, don't change it
% value(s)   : 0
% example    : "0"
% 

% evaluate apsmode if this is not already done
require("apsmode");

% reset index for printer setting
private variable setup = 0;

#ifdef UNIX

setup++;
Apsmode_Printers[setup].setupname = "code, A4, 6pt, 2x1, duplex";
Apsmode_Printers[setup].name = "lp";
Apsmode_Printers[setup].description = "Default Printer (code, duplex, 2 on 1)";
Apsmode_Printers[setup].columns = "2";
Apsmode_Printers[setup].rows = "1";
Apsmode_Printers[setup].fontsize = "6points";
Apsmode_Printers[setup].chars = "80:100";
Apsmode_Printers[setup].borders = "on";
Apsmode_Printers[setup].orientation = "landscape";
Apsmode_Printers[setup].medium = "A4";
Apsmode_Printers[setup].sides = "2";
Apsmode_Printers[setup].truncate = "on";
Apsmode_Printers[setup].linenumbers = "5";
Apsmode_Printers[setup].copies = "1";
Apsmode_Printers[setup].major = "columns";
Apsmode_Printers[setup].margin = "5";
Apsmode_Printers[setup].header = "";
Apsmode_Printers[setup].title_left = "";
Apsmode_Printers[setup].title_center = "";
Apsmode_Printers[setup].title_right = "";
%Apsmode_Printers[setup].footer_left = "%e %*";
Apsmode_Printers[setup].footer_left = "JEDDATETIME";
%Apsmode_Printers[setup].footer_center = "$f";
Apsmode_Printers[setup].footer_center = "JEDFILENAME";
Apsmode_Printers[setup].footer_right = "%s./%s#";
Apsmode_Printers[setup].color = "bw";
Apsmode_Printers[setup].pretty = "on";
Apsmode_Printers[setup].print_cmd = strcat("lpr -P ", Apsmode_Printers[setup].name, " ", Apsmode_tmp_file);
Apsmode_Printers[setup].view_cmd = strcat("gv ", Apsmode_tmp_file);
Apsmode_Printers[setup].copy_of = 0;

#endif

%%%%%%%%%%%%%%%%%% MS Windows Printers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#ifdef MSWINDOWS

setup++;
Apsmode_Printers[setup].setupname = "code, 2x1x2";
Apsmode_Printers[setup].name = "PrinterWINDOWS";
Apsmode_Printers[setup].description = "MS WINDOWS Printer";
Apsmode_Printers[setup].columns = "2";
Apsmode_Printers[setup].rows = "1";
Apsmode_Printers[setup].fontsize = "8points";
Apsmode_Printers[setup].chars = "80:100";
Apsmode_Printers[setup].borders = "on";
Apsmode_Printers[setup].orientation = "landscape";
Apsmode_Printers[setup].medium = "A4";
Apsmode_Printers[setup].sides = "2";
Apsmode_Printers[setup].truncate = "off";
Apsmode_Printers[setup].linenumbers = "5";
Apsmode_Printers[setup].copies = "1";
Apsmode_Printers[setup].major = "columns";
Apsmode_Printers[setup].margin = "5";
Apsmode_Printers[setup].header = "";
Apsmode_Printers[setup].title_left = "";
Apsmode_Printers[setup].title_center = "";
Apsmode_Printers[setup].title_right = "";
%Apsmode_Printers[setup].footer_left = "%e %*";
%Apsmode_Printers[setup].footer_left = "%e";
Apsmode_Printers[setup].footer_left = "JEDDATETIME";
%Apsmode_Printers[setup].footer_center = "$f";
Apsmode_Printers[setup].footer_center = "JEDFILENAME";
Apsmode_Printers[setup].footer_right = "%s./%s#";
Apsmode_Printers[setup].color = "bw";
Apsmode_Printers[setup].pretty = "on";
Apsmode_Printers[setup].print_cmd = strcat("D:\\Programs\\gstools\\gsview\\gsview32.exe ", Apsmode_tmp_file);
Apsmode_Printers[setup].view_cmd = strcat("D:\\Programs\\gstools\\gsview\\gsview32.exe ", Apsmode_tmp_file);
Apsmode_Printers[setup].copy_of = 0;

#endif