Home » Personal collection » Acorn ADFS disks » Greaseweazled » adfs_RiscOs_Apps_2.adf » !PrinterIx/Library

!PrinterIx/Library

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Greaseweazled » adfs_RiscOs_Apps_2.adf
Filename: !PrinterIx/Library
Read OK:
File size: 22ED bytes
Load address: FFFFFB41
Exec address: C759F619
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM >Library V.1.12 for Integrex printer driver
   20REM Purpose: printer-specific parts of the printer application
   30REM Authors: A.Thompson, NReeves, DSeal, NRaine
   40REM *****************************************************
   50REM initialise the Integrex printer driver specific parts
   60REM *****************************************************
   70:
   80DEFPROCPrinter_initialise
   90LOCAL P%
  100IF VersionNumber$ <> "1.12" THEN PROCmoan("Incompatible !RunImage and Library")
  110PrinterClass$="PrinterIx"
  120FullPrinterClass$="Integrex"
  130OutputType%=&FF4
  140PrData_expected% = 1
  150printer_data_size% = FNp_field(0)
  160REM define class dependent icons in main window
  170main_line%=2
  180printer_data_list% = 0:P%=0
  190PROCPrinter_read_config_file
  200REM now convert to circular list
  210P%!list_pointer_field%=printer_data_list%
  220ENDPROC
  230:
  240REM *****************
  250REM set initial state
  260REM *****************
  270DEFPROCPrinter_set_initial_state
  280LOCAL D%
  290REM set default state
  300D%=printer_data_list%
  310WHILE D%!list_pointer_field%<>printer_data_list% AND D%!printer_number_field%<>printer_config%
  320 D%=D%!list_pointer_field%
  330ENDWHILE
  340IF D%!printer_number_field%=printer_config% THEN printer_data_list%=D%
  350PROCPrinter_set_description
  360PROCPrinter_set_module_data
  370ENDPROC
  380:
  390DEFPROCPrinter_CloseFiles
  400ENDPROC
  410:
  420REM ********
  430REM shutdown
  440REM ********
  450DEFPROCPrinter_terminate
  460ENDPROC
  470:
  480REM **************************************
  490REM the printer-specific template loading
  500REM **************************************
  510DEFPROCPrinter_load_templates
  520PROCset_icon_state(main%, main_line%, line_new% << 21, 1<<21)
  530ENDPROC
  540:
  550REM ***********************************
  560REM the printer-specific event handler
  570REM ***********************************
  580DEFFNPrinter_process_event(action%, E%)
  590LOCAL res%
  600res%=FALSE
  610CASE action% OF
  620 WHEN 17,18:
  630  CASE E%!16 OF
  640   WHEN &502:
  650    IF E%!32 = main% AND E%!36 >= -1 THEN PROChelpreply("Printer setup.|MClick SELECT or ADJUST to alter the settings.",E%!8,E%!4):res% = TRUE
  660  ENDCASE
  670 WHEN 6
  680  IF E%!12=main% THEN
  690   CASE TRUE OF
  700    WHEN (E%!8 AND %101)<>0:
  710     CASE E%!16 OF
  720      WHEN main_description%:
  730       IF E%!8 AND 1 THEN
  740        res% = printer_data_list%
  750        REPEAT printer_data_list% = printer_data_list%!list_pointer_field%
  760        UNTIL printer_data_list%!list_pointer_field% = res%
  770       ELSE
  780        printer_data_list% = printer_data_list%!list_pointer_field%
  790       ENDIF
  800       PROCPrinter_set_description
  810       PROCPrinter_set_module_data
  820       printer_new% = printer_data_list%!printer_number_field%
  830       res%=TRUE
  840      WHEN main_line%
  850       !q%=main%
  860       q%!4=main_line%
  870       SYS "Wimp_GetIconState",,q%
  880       line_new% = (q%!24 >> 21) AND 1
  890     ENDCASE
  900   ENDCASE
  910  ENDIF
  920ENDCASE
  930=res%
  940:
  950REM *****************************************************************
  960REM read the configuration file with all the individual printer info
  970REM *****************************************************************
  980DEFPROCPrinter_read_config_file
  990LOCAL H%,ptr%
 1000DIM defaults% printer_data_size%
 1010FOR H%=0 TO printer_data_size%-4 STEP 4:defaults%!H%=0:NEXT
 1020printer_data% = defaults%
 1030H%=OPENIN"<PDriver$dir>.PrData"
 1040IF H%=0 ERROR 100,"Can't read printer data file"
 1050REPEAT
 1060 ptr% = PTR#H%
 1070 PROCPrinter_process_line(H%)
 1080UNTIL EOF#H%
 1090CLOSE#H%
 1100ENDPROC
 1110:
 1120REM *********************************************
 1130REM process one line from the configuration file
 1140REM *********************************************
 1150DEFPROCPrinter_process_line(H%)
 1160LOCAL I%,J%,tag$
 1170$buf%=GET$#H%
 1180I%=0
 1190WHILE FNtagchar(buf%?I%): I% += 1:ENDWHILE
 1200IF buf%?I% = ASC":" THEN
 1210 REM got a tag
 1220 tag$=FNlowercase(LEFT$($buf%,I%))
 1230 I% += 1
 1240 WHILE buf%?I%=ASC" ": I% += 1:ENDWHILE
 1250 CASE tag$ OF
 1260  WHEN "version"
 1270   PrData_version% = FNread
 1280  WHEN "printer_name"
 1290   REM build a name
 1300   DIM description% LEN$buf% -I% +1
 1310   $description% = RIGHT$($buf%,LEN$buf%-I%)
 1320   REM now add a block to our list of printer data blocks
 1330   DIM printer_data% printer_data_size%
 1340   FOR I%=0 TO printer_data_size%-4 STEP 4
 1350     printer_data%!I% = defaults%!I%
 1360   NEXT
 1370   printer_data%!description_field% = description%
 1380   IF P%=0 THEN
 1390    printer_data_list% = printer_data%
 1400   ELSE
 1410    P%!list_pointer_field% = printer_data%
 1420   ENDIF
 1430   P% = printer_data%
 1440  WHEN "pxres","pyres","features","pxres_halftone","pyres_halftone","printer_number"
 1450   REM note that all tags are the same as their respective field names
 1460   printer_data%!EVAL(tag$+"_field%") = FNread
 1470  WHEN "page_width","page_height","page_bottom","page_top","page_left","page_right"
 1480     page_desc%(page_number%,EVAL(tag$+"_field%")) = FNread
 1490     page_ptrs%(page_number%,EVAL(tag$+"_field%")) = ptr%+I%
 1500  WHEN "page_number"
 1510     page_number% = FNread
 1520  WHEN "server","page_name","file","page_selection"
 1530   REM read a string
 1540   J% = I%
 1550   WHILE buf%?J%>=ASC" " AND buf%?J%<>ASC";"
 1560    J% += 1
 1570   ENDWHILE
 1580   REM from I% to J% is the string
 1590   CASE tag$ OF
 1600   WHEN "server"
 1610    server_ptr% = ptr% + I%
 1620    server_config$ = MID$($buf%, I%+1, J%-I%)
 1630   WHEN "file"
 1640    file_ptr% = ptr% + I%
 1650    file_config$ = MID$($buf%, I%+1, J%-I%)
 1660    $file_name%=file_config$
 1670    SYS "XOS_CLI","set PrinterType$5 "+file_config$
 1680   WHEN "page_name"
 1690    page_names$(page_number%)=MID$($buf%, I%+1, J%-I%)
 1700    page_ptrs%(page_number%,page_name_field%) = ptr%+I%
 1710   WHEN "page_selection"
 1720    page_selection$(page_number%)=MID$($buf%, I%+1, J%-I%)
 1730   ENDCASE
 1740  WHEN "start_page_number"
 1750   page_number_config% = FNread
 1760   page_number_ptr% = ptr% + I%
 1770  WHEN "printer"
 1780   printer_config% = FNread
 1790   printer_new% = printer_config%
 1800   printer_ptr% = ptr% + I%
 1810  WHEN "location"
 1820   location_config% = FNread
 1830   location_ptr% = ptr% + I%
 1840  WHEN "baud"
 1850   baud_config% = FNread
 1860   baud_ptr% = ptr% + I%
 1870  WHEN "data"
 1880   data_config% = FNread
 1890   data_ptr% = ptr% + I%
 1900  WHEN "xon"
 1910   XON_config% = FNread
 1920   XON_new% = XON_config%
 1930   XON_ptr% = ptr% + I%
 1940  WHEN "line"
 1950   line_config% = FNread
 1960   line_new% = line_config%
 1970   line_ptr% = ptr% + I%
 1980 ENDCASE
 1990ENDIF
 2000ENDPROC
 2010:
 2020DEFFNread=FNread_integer_expression(RIGHT$($buf%,LEN$buf%-I%))
 2030:
 2040REM ***************************************
 2050REM convert a string to an integer
 2060REM ***************************************
 2070DEFFNread_integer_expression(S$)
 2080LOCAL R%, T%, E$, P%
 2090E$=""
 2100REM get rid of any comment
 2110WHILE LEFT$(S$,1) <> ";" AND LENS$ <> 0
 2120 E$ += LEFT$(S$,1)
 2130 S$ = RIGHT$(S$,LENS$-1)
 2140ENDWHILE
 2150SYS"XOS_EvaluateExpression",E$,buf%,256 TO ,T%,R%;P%
 2160IF T% <> 0 OR (P% AND 1) ERROR 100, "Integer value needed for "+tag$
 2170=R%
 2180:
 2190REM ***************************************
 2200REM allow only alphanumerics in tag fields
 2210REM ***************************************
 2220DEFFNtagchar(C%)
 2230IF (C% >= ASC"A" AND C% <= ASC"Z") THEN =TRUE
 2240IF (C% >= ASC"a" AND C% <= ASC"z") THEN =TRUE
 2250=  (C% >= ASC"0" AND C% <= ASC"9") OR C% = ASC"_"
 2260:
 2270REM *********************************************************************
 2280REM set the printer driver module's state to reflect the current settings
 2290REM *********************************************************************
 2300DEFPROCPrinter_set_module_data
 2310LOCAL A%,B%,C%,D%,E%,F%
 2320A%=defaults%!pxres_field%
 2330B%=defaults%!pyres_field%
 2340C%=defaults%!features_field%
 2350D%=defaults%!pxres_halftone_field%
 2360E%=defaults%!pyres_halftone_field%
 2370F%=defaults%!printer_number_field%
 2380SYS "PDriver_SetInfo",,A%,B%,C%,,D%,E%,F%
 2390msg%!0=20
 2400msg%!12=0
 2410msg%!16=Message_SetPrinter%
 2420SYS "Wimp_SendMessage", 18, msg%, 0
 2430ENDPROC
 2440:
 2450REM ***************************************
 2460REM set the description field in our window
 2470REM ***************************************
 2480DEFPROCPrinter_set_description
 2490LOCAL S%, S$
 2500FOR S% = 0 TO printer_data_size%-4 STEP 4
 2510defaults%!S% = printer_data_list%!S%
 2520NEXT
 2530PROCPrinter_set_icon(main_description%,$(defaults%!description_field%))
 2540SYS "XOS_CLI","SET Printer$"+" """+$(defaults%!description_field%)+""""
 2550ENDPROC
 2560:
 2570DEF PROCPrinter_change_page_size
 2580OSCLI("Set PDriver$Ixextra """+page_selection$(page_number%)+"""")
 2590ENDPROC
 2600:
 2610DEFPROCPrinter_set_icon(I%,S$)
 2620LOCAL S%
 2630S%=FNiconaddr(main%,I%)
 2640$S% = S$
 2650PROCzero_terminate(S%)
 2660PROCset_icon_state(main%,I%,0,0): REM force redraw
 2670ENDPROC
 2680:
 2690DEF PROCPrinter_AmendConfig
 2700IF line_config% <> line_new% THEN
 2710 PTR#out_file%=line_ptr%
 2720 BPUT#out_file%,STR$line_new%;
 2730 line_config% = line_new%
 2740ENDIF
 2750ENDPROC
 2760:
 2770DEF PROCPrinter_Ignore
 2780ENDPROC
 2790:
 2800DEF PROCPrinter_XonXoff(flag%)
 2810IF flag% THEN
 2820 *fx 2,2
 2830ELSE
 2840 *fx 2,0
 2850ENDIF
 2860ENDPROC
 2870:
 2880DEF PROCPrinter_Location(loc%)
 2890REM The current printer location setting doesn't affect this printer driver
 2900ENDPROC
 2910:
 2920DEF PROCPrinter_Header
 2930line_print%=line_new%
 2940`ext%=EXT#in_file%
 2950ENDPROC
 2960:
 2970DEF PROCPrinter_Footer
 2980ENDPROC
 2990:
 3000DEF FNPrinter_Send(len%)
 3010PROCEscOn
 3020LOCAL L%,C%
 3030L%=`ext% - PTR#in_file%
 3040IF line_print% AND Ftype%<>OutputType% THEN
 3050 WHILE len%>1 AND L%>0
 3060  C%=BGET#in_file%: L%-=1
 3070  IF C%=10 BPUT#out_file%,13:len%-=1
 3080  BPUT#out_file%,C%:len%-=1
 3090  IF C%=13 BPUT#out_file%,10:len%-=1
 3100 ENDWHILE
 3110ELSE
 3120 IF len%>=L% len%=L%
 3130 SYS "OS_GBPB", 4, in_file%, buf%, len%: L%-=len%
 3140 SYS "OS_GBPB", 2, out_file%, buf%, len%
 3150ENDIF
 3160PROCEscOff
 3170=(L%<=0)
 3180>*FX 229,1

1� >Library V.1.12 for Integrex printer driver
@� Purpose: printer-specific parts of the printer application
1� Authors: A.Thompson, NReeves, DSeal, NRaine
(;� *****************************************************
2;� initialise the Integrex printer driver specific parts
<;� *****************************************************
F:
P��Printer_initialise
Z� P%
dL� VersionNumber$ <> "1.12" � �moan("Incompatible !RunImage and Library")
nPrinterClass$="PrinterIx"
x FullPrinterClass$="Integrex"
�OutputType%=&FF4
�PrData_expected% = 1
�$printer_data_size% = �p_field(0)
�1� define class dependent icons in main window
�main_line%=2
�printer_data_list% = 0:P%=0
��Printer_read_config_file
�"� now convert to circular list
�-P%!list_pointer_field%=printer_data_list%
��
�:
�� *****************
�� set initial state
� *****************
��Printer_set_initial_state
� D%
"� set default state
,D%=printer_data_list%
6]ȕ D%!list_pointer_field%<>printer_data_list% � D%!printer_number_field%<>printer_config%
@ D%=D%!list_pointer_field%
J�
TF� D%!printer_number_field%=printer_config% � printer_data_list%=D%
^�Printer_set_description
h�Printer_set_module_data
r�
|:
���Printer_CloseFiles
��
�:
�� ********
�� shutdown
�� ********
���Printer_terminate
��
�:
�,� **************************************
�+� the printer-specific template loading
�,� **************************************
���Printer_load_templates
>�set_icon_state(main%, main_line%, line_new% << 21, 1<<21)
�
:
&)� ***********************************
0(� the printer-specific event handler
:)� ***********************************
D(ݤPrinter_process_event(action%, E%)
N
� res%
X
res%=�
bȎ action% �
l
 � 17,18:
v  Ȏ E%!16 �
�   � &502:
��    � E%!32 = main% � E%!36 >= -1 � �helpreply("Printer setup.|MClick SELECT or ADJUST to alter the settings.",E%!8,E%!4):res% = �
�  �
� � 6
�  � E%!12=main% �
�
   Ȏ � �
�    � (E%!8 � %101)<>0:
�     Ȏ E%!16 �
�      � main_description%:
�       � E%!8 � 1 �
�%        res% = printer_data_list%
�I        � printer_data_list% = printer_data_list%!list_pointer_field%
�;        � printer_data_list%!list_pointer_field% = res%
       �
G        printer_data_list% = printer_data_list%!list_pointer_field%
       �
 #       �Printer_set_description
*#       �Printer_set_module_data
4B       printer_new% = printer_data_list%!printer_number_field%
>       res%=�
H      � main_line%
R       !q%=main%
\       q%!4=main_line%
f%       ș "Wimp_GetIconState",,q%
p(       line_new% = (q%!24 >> 21) � 1
z
     �
�   �
�  �
��
�	=res%
�:
�G� *****************************************************************
�F� read the configuration file with all the individual printer info
�G� *****************************************************************
���Printer_read_config_file
�
� H%,ptr%
�"� defaults% printer_data_size%
�6� H%=0 � printer_data_size%-4 � 4:defaults%!H%=0:�
�printer_data% = defaults%
H%=�"<PDriver$dir>.PrData"
/� H%=0 � 100,"Can't read printer data file"
�
$ ptr% = �#H%
. �Printer_process_line(H%)
8
� �#H%
B�#H%
L�
V:
`3� *********************************************
j2� process one line from the configuration file
t3� *********************************************
~��Printer_process_line(H%)
�� I%,J%,tag$
�$buf%=�#H%
�I%=0
�#ȕ �tagchar(buf%?I%): I% += 1:�
�� buf%?I% = �":" �
� � got a tag
�  tag$=�lowercase(�$buf%,I%))
� I% += 1
� ȕ buf%?I%=�" ": I% += 1:�
� Ȏ tag$ �
�  � "version"
�   PrData_version% = �read
  � "printer_name"

   � build a name
#   � description% �$buf% -I% +1
(   $description% = �$buf%,�$buf%-I%)
(;   � now add a block to our list of printer data blocks
2)   � printer_data% printer_data_size%
<(   � I%=0 � printer_data_size%-4 � 4
F(     printer_data%!I% = defaults%!I%
P   �
Z6   printer_data%!description_field% = description%
d   � P%=0 �
n*    printer_data_list% = printer_data%
x   �
�.    P%!list_pointer_field% = printer_data%
�   �
�   P% = printer_data%
�U  � "pxres","pyres","features","pxres_halftone","pyres_halftone","printer_number"
�H   � note that all tags are the same as their respective field names
�.   printer_data%!�(tag$+"_field%") = �read
�T  � "page_width","page_height","page_bottom","page_top","page_left","page_right"
�;     page_desc%(page_number%,�(tag$+"_field%")) = �read
�=     page_ptrs%(page_number%,�(tag$+"_field%")) = ptr%+I%
�  � "page_number"
�     page_number% = �read
�4  � "server","page_name","file","page_selection"
�   � read a string
   J% = I%
'   ȕ buf%?J%>=�" " � buf%?J%<>�";"
    J% += 1
"   �
,$   � from I% to J% is the string
6   Ȏ tag$ �
@   � "server"
J    server_ptr% = ptr% + I%
T-    server_config$ = �$buf%, I%+1, J%-I%)
^   � "file"
h    file_ptr% = ptr% + I%
r+    file_config$ = �$buf%, I%+1, J%-I%)
|     $file_name%=file_config$
�6    ș "XOS_CLI","set PrinterType$5 "+file_config$
�   � "page_name"
�6    page_names$(page_number%)=�$buf%, I%+1, J%-I%)
�;    page_ptrs%(page_number%,page_name_field%) = ptr%+I%
�   � "page_selection"
�:    page_selection$(page_number%)=�$buf%, I%+1, J%-I%)
�   �
�  � "start_page_number"
�"   page_number_config% = �read
�#   page_number_ptr% = ptr% + I%
�  � "printer"
�   printer_config% = �read
�%   printer_new% = printer_config%
   printer_ptr% = ptr% + I%
  � "location"
   location_config% = �read
&    location_ptr% = ptr% + I%
0  � "baud"
:   baud_config% = �read
D   baud_ptr% = ptr% + I%
N  � "data"
X   data_config% = �read
b   data_ptr% = ptr% + I%
l
  � "xon"
v   XON_config% = �read
�   XON_new% = XON_config%
�   XON_ptr% = ptr% + I%
�  � "line"
�   line_config% = �read
�   line_new% = line_config%
�   line_ptr% = ptr% + I%
� �
��
��
�:
�6ݤread=�read_integer_expression(�$buf%,�$buf%-I%))
�:
�-� ***************************************
$� convert a string to an integer
-� ***************************************
!ݤread_integer_expression(S$)
 � R%, T%, E$, P%
*	E$=""
4� get rid of any comment
>ȕ �S$,1) <> ";" � �S$ <> 0
H E$ += �S$,1)
R S$ = �S$,�S$-1)
\�
f6ș"XOS_EvaluateExpression",E$,buf%,256 � ,T%,R%;P%
p@� T% <> 0 � (P% � 1) � 100, "Integer value needed for "+tag$
z=R%
�:
�-� ***************************************
�,� allow only alphanumerics in tag fields
�-� ***************************************
�ݤtagchar(C%)
�$� (C% >= �"A" � C% <= �"Z") � =�
�$� (C% >= �"a" � C% <= �"z") � =�
�,=  (C% >= �"0" � C% <= �"9") � C% = �"_"
�:
�K� *********************************************************************
�K� set the printer driver module's state to reflect the current settings
�K� *********************************************************************
���Printer_set_module_data
	� A%,B%,C%,D%,E%,F%
	A%=defaults%!pxres_field%
	B%=defaults%!pyres_field%
	$ C%=defaults%!features_field%
	.&D%=defaults%!pxres_halftone_field%
	8&E%=defaults%!pyres_halftone_field%
	B&F%=defaults%!printer_number_field%
	L,ș "PDriver_SetInfo",,A%,B%,C%,,D%,E%,F%
	V
msg%!0=20
	`
msg%!12=0
	jmsg%!16=Message_SetPrinter%
	t&ș "Wimp_SendMessage", 18, msg%, 0
	~�
	�:
	�-� ***************************************
	�-� set the description field in our window
	�-� ***************************************
	���Printer_set_description
	�� S%, S$
	�'� S% = 0 � printer_data_size%-4 � 4
	�(defaults%!S% = printer_data_list%!S%
	��
	�H�Printer_set_icon(main_description%,$(defaults%!description_field%))
	�Jș "XOS_CLI","SET Printer$"+" """+$(defaults%!description_field%)+""""
	��
:

� �Printer_change_page_size
B�("Set PDriver$Ixextra """+page_selection$(page_number%)+"""")
�
(:
2��Printer_set_icon(I%,S$)
<� S%
FS%=�iconaddr(main%,I%)
P$S% = S$
Z�zero_terminate(S%)
d1�set_icon_state(main%,I%,0,0): � force redraw
n�
x:
�� �Printer_AmendConfig
�!� line_config% <> line_new% �
� �#out_file%=line_ptr%
� �#out_file%,�line_new%;
� line_config% = line_new%
��
��
�:
�� �Printer_Ignore
��
�:
�� �Printer_XonXoff(flag%)
�
� flag% �
 *fx 2,2
�
 *fx 2,0
"�
,�
6:
@� �Printer_Location(loc%)
JM� The current printer location setting doesn't affect this printer driver
T�
^:
h� �Printer_Header
rline_print%=line_new%
|`ext%=�#in_file%
��
�:
�� �Printer_Footer
��
�:
�� �Printer_Send(len%)
�
�EscOn
�� L%,C%
�L%=`ext% - �#in_file%
�)� line_print% � Ftype%<>OutputType% �
� ȕ len%>1 � L%>0
�  C%=�#in_file%: L%-=1
�$  � C%=10 �#out_file%,13:len%-=1
  �#out_file%,C%:len%-=1
$  � C%=13 �#out_file%,10:len%-=1
 �
&�
0 � len%>=L% len%=L%
:4 ș "OS_GBPB", 4, in_file%, buf%, len%: L%-=len%
D+ ș "OS_GBPB", 2, out_file%, buf%, len%
N�
X�EscOff
b=(L%<=0)
l>*FX 229,1
�
00000000  0d 00 0a 31 f4 20 3e 4c  69 62 72 61 72 79 20 56  |...1. >Library V|
00000010  2e 31 2e 31 32 20 66 6f  72 20 49 6e 74 65 67 72  |.1.12 for Integr|
00000020  65 78 20 70 72 69 6e 74  65 72 20 64 72 69 76 65  |ex printer drive|
00000030  72 0d 00 14 40 f4 20 50  75 72 70 6f 73 65 3a 20  |r...@. Purpose: |
00000040  70 72 69 6e 74 65 72 2d  73 70 65 63 69 66 69 63  |printer-specific|
00000050  20 70 61 72 74 73 20 6f  66 20 74 68 65 20 70 72  | parts of the pr|
00000060  69 6e 74 65 72 20 61 70  70 6c 69 63 61 74 69 6f  |inter applicatio|
00000070  6e 0d 00 1e 31 f4 20 41  75 74 68 6f 72 73 3a 20  |n...1. Authors: |
00000080  41 2e 54 68 6f 6d 70 73  6f 6e 2c 20 4e 52 65 65  |A.Thompson, NRee|
00000090  76 65 73 2c 20 44 53 65  61 6c 2c 20 4e 52 61 69  |ves, DSeal, NRai|
000000a0  6e 65 0d 00 28 3b f4 20  2a 2a 2a 2a 2a 2a 2a 2a  |ne..(;. ********|
000000b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000000d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 0d 00 32  |*************..2|
000000e0  3b f4 20 69 6e 69 74 69  61 6c 69 73 65 20 74 68  |;. initialise th|
000000f0  65 20 49 6e 74 65 67 72  65 78 20 70 72 69 6e 74  |e Integrex print|
00000100  65 72 20 64 72 69 76 65  72 20 73 70 65 63 69 66  |er driver specif|
00000110  69 63 20 70 61 72 74 73  0d 00 3c 3b f4 20 2a 2a  |ic parts..<;. **|
00000120  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000150  2a 2a 2a 0d 00 46 05 3a  0d 00 50 18 dd f2 50 72  |***..F.:..P...Pr|
00000160  69 6e 74 65 72 5f 69 6e  69 74 69 61 6c 69 73 65  |inter_initialise|
00000170  0d 00 5a 08 ea 20 50 25  0d 00 64 4c e7 20 56 65  |..Z.. P%..dL. Ve|
00000180  72 73 69 6f 6e 4e 75 6d  62 65 72 24 20 3c 3e 20  |rsionNumber$ <> |
00000190  22 31 2e 31 32 22 20 8c  20 f2 6d 6f 61 6e 28 22  |"1.12" . .moan("|
000001a0  49 6e 63 6f 6d 70 61 74  69 62 6c 65 20 21 52 75  |Incompatible !Ru|
000001b0  6e 49 6d 61 67 65 20 61  6e 64 20 4c 69 62 72 61  |nImage and Libra|
000001c0  72 79 22 29 0d 00 6e 1d  50 72 69 6e 74 65 72 43  |ry")..n.PrinterC|
000001d0  6c 61 73 73 24 3d 22 50  72 69 6e 74 65 72 49 78  |lass$="PrinterIx|
000001e0  22 0d 00 78 20 46 75 6c  6c 50 72 69 6e 74 65 72  |"..x FullPrinter|
000001f0  43 6c 61 73 73 24 3d 22  49 6e 74 65 67 72 65 78  |Class$="Integrex|
00000200  22 0d 00 82 14 4f 75 74  70 75 74 54 79 70 65 25  |"....OutputType%|
00000210  3d 26 46 46 34 0d 00 8c  18 50 72 44 61 74 61 5f  |=&FF4....PrData_|
00000220  65 78 70 65 63 74 65 64  25 20 3d 20 31 0d 00 96  |expected% = 1...|
00000230  24 70 72 69 6e 74 65 72  5f 64 61 74 61 5f 73 69  |$printer_data_si|
00000240  7a 65 25 20 3d 20 a4 70  5f 66 69 65 6c 64 28 30  |ze% = .p_field(0|
00000250  29 0d 00 a0 31 f4 20 64  65 66 69 6e 65 20 63 6c  |)...1. define cl|
00000260  61 73 73 20 64 65 70 65  6e 64 65 6e 74 20 69 63  |ass dependent ic|
00000270  6f 6e 73 20 69 6e 20 6d  61 69 6e 20 77 69 6e 64  |ons in main wind|
00000280  6f 77 0d 00 aa 10 6d 61  69 6e 5f 6c 69 6e 65 25  |ow....main_line%|
00000290  3d 32 0d 00 b4 1f 70 72  69 6e 74 65 72 5f 64 61  |=2....printer_da|
000002a0  74 61 5f 6c 69 73 74 25  20 3d 20 30 3a 50 25 3d  |ta_list% = 0:P%=|
000002b0  30 0d 00 be 1d f2 50 72  69 6e 74 65 72 5f 72 65  |0.....Printer_re|
000002c0  61 64 5f 63 6f 6e 66 69  67 5f 66 69 6c 65 0d 00  |ad_config_file..|
000002d0  c8 22 f4 20 6e 6f 77 20  63 6f 6e 76 65 72 74 20  |.". now convert |
000002e0  74 6f 20 63 69 72 63 75  6c 61 72 20 6c 69 73 74  |to circular list|
000002f0  0d 00 d2 2d 50 25 21 6c  69 73 74 5f 70 6f 69 6e  |...-P%!list_poin|
00000300  74 65 72 5f 66 69 65 6c  64 25 3d 70 72 69 6e 74  |ter_field%=print|
00000310  65 72 5f 64 61 74 61 5f  6c 69 73 74 25 0d 00 dc  |er_data_list%...|
00000320  05 e1 0d 00 e6 05 3a 0d  00 f0 17 f4 20 2a 2a 2a  |......:..... ***|
00000330  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 0d 00  |**************..|
00000340  fa 17 f4 20 73 65 74 20  69 6e 69 74 69 61 6c 20  |... set initial |
00000350  73 74 61 74 65 0d 01 04  17 f4 20 2a 2a 2a 2a 2a  |state..... *****|
00000360  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 0d 01 0e 1f  |************....|
00000370  dd f2 50 72 69 6e 74 65  72 5f 73 65 74 5f 69 6e  |..Printer_set_in|
00000380  69 74 69 61 6c 5f 73 74  61 74 65 0d 01 18 08 ea  |itial_state.....|
00000390  20 44 25 0d 01 22 17 f4  20 73 65 74 20 64 65 66  | D%..".. set def|
000003a0  61 75 6c 74 20 73 74 61  74 65 0d 01 2c 19 44 25  |ault state..,.D%|
000003b0  3d 70 72 69 6e 74 65 72  5f 64 61 74 61 5f 6c 69  |=printer_data_li|
000003c0  73 74 25 0d 01 36 5d c8  95 20 44 25 21 6c 69 73  |st%..6].. D%!lis|
000003d0  74 5f 70 6f 69 6e 74 65  72 5f 66 69 65 6c 64 25  |t_pointer_field%|
000003e0  3c 3e 70 72 69 6e 74 65  72 5f 64 61 74 61 5f 6c  |<>printer_data_l|
000003f0  69 73 74 25 20 80 20 44  25 21 70 72 69 6e 74 65  |ist% . D%!printe|
00000400  72 5f 6e 75 6d 62 65 72  5f 66 69 65 6c 64 25 3c  |r_number_field%<|
00000410  3e 70 72 69 6e 74 65 72  5f 63 6f 6e 66 69 67 25  |>printer_config%|
00000420  0d 01 40 1e 20 44 25 3d  44 25 21 6c 69 73 74 5f  |..@. D%=D%!list_|
00000430  70 6f 69 6e 74 65 72 5f  66 69 65 6c 64 25 0d 01  |pointer_field%..|
00000440  4a 05 ce 0d 01 54 46 e7  20 44 25 21 70 72 69 6e  |J....TF. D%!prin|
00000450  74 65 72 5f 6e 75 6d 62  65 72 5f 66 69 65 6c 64  |ter_number_field|
00000460  25 3d 70 72 69 6e 74 65  72 5f 63 6f 6e 66 69 67  |%=printer_config|
00000470  25 20 8c 20 70 72 69 6e  74 65 72 5f 64 61 74 61  |% . printer_data|
00000480  5f 6c 69 73 74 25 3d 44  25 0d 01 5e 1c f2 50 72  |_list%=D%..^..Pr|
00000490  69 6e 74 65 72 5f 73 65  74 5f 64 65 73 63 72 69  |inter_set_descri|
000004a0  70 74 69 6f 6e 0d 01 68  1c f2 50 72 69 6e 74 65  |ption..h..Printe|
000004b0  72 5f 73 65 74 5f 6d 6f  64 75 6c 65 5f 64 61 74  |r_set_module_dat|
000004c0  61 0d 01 72 05 e1 0d 01  7c 05 3a 0d 01 86 18 dd  |a..r....|.:.....|
000004d0  f2 50 72 69 6e 74 65 72  5f 43 6c 6f 73 65 46 69  |.Printer_CloseFi|
000004e0  6c 65 73 0d 01 90 05 e1  0d 01 9a 05 3a 0d 01 a4  |les.........:...|
000004f0  0e f4 20 2a 2a 2a 2a 2a  2a 2a 2a 0d 01 ae 0e f4  |.. ********.....|
00000500  20 73 68 75 74 64 6f 77  6e 0d 01 b8 0e f4 20 2a  | shutdown..... *|
00000510  2a 2a 2a 2a 2a 2a 2a 0d  01 c2 17 dd f2 50 72 69  |*******......Pri|
00000520  6e 74 65 72 5f 74 65 72  6d 69 6e 61 74 65 0d 01  |nter_terminate..|
00000530  cc 05 e1 0d 01 d6 05 3a  0d 01 e0 2c f4 20 2a 2a  |.......:...,. **|
00000540  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000560  2a 2a 2a 2a 0d 01 ea 2b  f4 20 74 68 65 20 70 72  |****...+. the pr|
00000570  69 6e 74 65 72 2d 73 70  65 63 69 66 69 63 20 74  |inter-specific t|
00000580  65 6d 70 6c 61 74 65 20  6c 6f 61 64 69 6e 67 0d  |emplate loading.|
00000590  01 f4 2c f4 20 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..,. ***********|
000005a0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
000005b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 01 fe 1c dd  |***********.....|
000005c0  f2 50 72 69 6e 74 65 72  5f 6c 6f 61 64 5f 74 65  |.Printer_load_te|
000005d0  6d 70 6c 61 74 65 73 0d  02 08 3e f2 73 65 74 5f  |mplates...>.set_|
000005e0  69 63 6f 6e 5f 73 74 61  74 65 28 6d 61 69 6e 25  |icon_state(main%|
000005f0  2c 20 6d 61 69 6e 5f 6c  69 6e 65 25 2c 20 6c 69  |, main_line%, li|
00000600  6e 65 5f 6e 65 77 25 20  3c 3c 20 32 31 2c 20 31  |ne_new% << 21, 1|
00000610  3c 3c 32 31 29 0d 02 12  05 e1 0d 02 1c 05 3a 0d  |<<21).........:.|
00000620  02 26 29 f4 20 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.&). ***********|
00000630  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000640  2a 2a 2a 2a 2a 2a 2a 2a  0d 02 30 28 f4 20 74 68  |********..0(. th|
00000650  65 20 70 72 69 6e 74 65  72 2d 73 70 65 63 69 66  |e printer-specif|
00000660  69 63 20 65 76 65 6e 74  20 68 61 6e 64 6c 65 72  |ic event handler|
00000670  0d 02 3a 29 f4 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..:). **********|
00000680  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000690  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 02 44 28 dd a4 50  |*********..D(..P|
000006a0  72 69 6e 74 65 72 5f 70  72 6f 63 65 73 73 5f 65  |rinter_process_e|
000006b0  76 65 6e 74 28 61 63 74  69 6f 6e 25 2c 20 45 25  |vent(action%, E%|
000006c0  29 0d 02 4e 0a ea 20 72  65 73 25 0d 02 58 0a 72  |)..N.. res%..X.r|
000006d0  65 73 25 3d a3 0d 02 62  10 c8 8e 20 61 63 74 69  |es%=...b... acti|
000006e0  6f 6e 25 20 ca 0d 02 6c  0d 20 c9 20 31 37 2c 31  |on% ...l. . 17,1|
000006f0  38 3a 0d 02 76 10 20 20  c8 8e 20 45 25 21 31 36  |8:..v.  .. E%!16|
00000700  20 ca 0d 02 80 0e 20 20  20 c9 20 26 35 30 32 3a  | .....   . &502:|
00000710  0d 02 8a 86 20 20 20 20  e7 20 45 25 21 33 32 20  |....    . E%!32 |
00000720  3d 20 6d 61 69 6e 25 20  80 20 45 25 21 33 36 20  |= main% . E%!36 |
00000730  3e 3d 20 2d 31 20 8c 20  f2 68 65 6c 70 72 65 70  |>= -1 . .helprep|
00000740  6c 79 28 22 50 72 69 6e  74 65 72 20 73 65 74 75  |ly("Printer setu|
00000750  70 2e 7c 4d 43 6c 69 63  6b 20 53 45 4c 45 43 54  |p.|MClick SELECT|
00000760  20 6f 72 20 41 44 4a 55  53 54 20 74 6f 20 61 6c  | or ADJUST to al|
00000770  74 65 72 20 74 68 65 20  73 65 74 74 69 6e 67 73  |ter the settings|
00000780  2e 22 2c 45 25 21 38 2c  45 25 21 34 29 3a 72 65  |.",E%!8,E%!4):re|
00000790  73 25 20 3d 20 b9 0d 02  94 07 20 20 cb 0d 02 9e  |s% = .....  ....|
000007a0  08 20 c9 20 36 0d 02 a8  15 20 20 e7 20 45 25 21  |. . 6....  . E%!|
000007b0  31 32 3d 6d 61 69 6e 25  20 8c 0d 02 b2 0d 20 20  |12=main% .....  |
000007c0  20 c8 8e 20 b9 20 ca 0d  02 bc 1b 20 20 20 20 c9  | .. . .....    .|
000007d0  20 28 45 25 21 38 20 80  20 25 31 30 31 29 3c 3e  | (E%!8 . %101)<>|
000007e0  30 3a 0d 02 c6 13 20 20  20 20 20 c8 8e 20 45 25  |0:....     .. E%|
000007f0  21 31 36 20 ca 0d 02 d0  1e 20 20 20 20 20 20 c9  |!16 .....      .|
00000800  20 6d 61 69 6e 5f 64 65  73 63 72 69 70 74 69 6f  | main_descriptio|
00000810  6e 25 3a 0d 02 da 17 20  20 20 20 20 20 20 e7 20  |n%:....       . |
00000820  45 25 21 38 20 80 20 31  20 8c 0d 02 e4 25 20 20  |E%!8 . 1 ....%  |
00000830  20 20 20 20 20 20 72 65  73 25 20 3d 20 70 72 69  |      res% = pri|
00000840  6e 74 65 72 5f 64 61 74  61 5f 6c 69 73 74 25 0d  |nter_data_list%.|
00000850  02 ee 49 20 20 20 20 20  20 20 20 f5 20 70 72 69  |..I        . pri|
00000860  6e 74 65 72 5f 64 61 74  61 5f 6c 69 73 74 25 20  |nter_data_list% |
00000870  3d 20 70 72 69 6e 74 65  72 5f 64 61 74 61 5f 6c  |= printer_data_l|
00000880  69 73 74 25 21 6c 69 73  74 5f 70 6f 69 6e 74 65  |ist%!list_pointe|
00000890  72 5f 66 69 65 6c 64 25  0d 02 f8 3b 20 20 20 20  |r_field%...;    |
000008a0  20 20 20 20 fd 20 70 72  69 6e 74 65 72 5f 64 61  |    . printer_da|
000008b0  74 61 5f 6c 69 73 74 25  21 6c 69 73 74 5f 70 6f  |ta_list%!list_po|
000008c0  69 6e 74 65 72 5f 66 69  65 6c 64 25 20 3d 20 72  |inter_field% = r|
000008d0  65 73 25 0d 03 02 0c 20  20 20 20 20 20 20 cc 0d  |es%....       ..|
000008e0  03 0c 47 20 20 20 20 20  20 20 20 70 72 69 6e 74  |..G        print|
000008f0  65 72 5f 64 61 74 61 5f  6c 69 73 74 25 20 3d 20  |er_data_list% = |
00000900  70 72 69 6e 74 65 72 5f  64 61 74 61 5f 6c 69 73  |printer_data_lis|
00000910  74 25 21 6c 69 73 74 5f  70 6f 69 6e 74 65 72 5f  |t%!list_pointer_|
00000920  66 69 65 6c 64 25 0d 03  16 0c 20 20 20 20 20 20  |field%....      |
00000930  20 cd 0d 03 20 23 20 20  20 20 20 20 20 f2 50 72  | ... #       .Pr|
00000940  69 6e 74 65 72 5f 73 65  74 5f 64 65 73 63 72 69  |inter_set_descri|
00000950  70 74 69 6f 6e 0d 03 2a  23 20 20 20 20 20 20 20  |ption..*#       |
00000960  f2 50 72 69 6e 74 65 72  5f 73 65 74 5f 6d 6f 64  |.Printer_set_mod|
00000970  75 6c 65 5f 64 61 74 61  0d 03 34 42 20 20 20 20  |ule_data..4B    |
00000980  20 20 20 70 72 69 6e 74  65 72 5f 6e 65 77 25 20  |   printer_new% |
00000990  3d 20 70 72 69 6e 74 65  72 5f 64 61 74 61 5f 6c  |= printer_data_l|
000009a0  69 73 74 25 21 70 72 69  6e 74 65 72 5f 6e 75 6d  |ist%!printer_num|
000009b0  62 65 72 5f 66 69 65 6c  64 25 0d 03 3e 11 20 20  |ber_field%..>.  |
000009c0  20 20 20 20 20 72 65 73  25 3d b9 0d 03 48 16 20  |     res%=...H. |
000009d0  20 20 20 20 20 c9 20 6d  61 69 6e 5f 6c 69 6e 65  |     . main_line|
000009e0  25 0d 03 52 14 20 20 20  20 20 20 20 21 71 25 3d  |%..R.       !q%=|
000009f0  6d 61 69 6e 25 0d 03 5c  1a 20 20 20 20 20 20 20  |main%..\.       |
00000a00  71 25 21 34 3d 6d 61 69  6e 5f 6c 69 6e 65 25 0d  |q%!4=main_line%.|
00000a10  03 66 25 20 20 20 20 20  20 20 c8 99 20 22 57 69  |.f%       .. "Wi|
00000a20  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00000a30  2c 2c 71 25 0d 03 70 28  20 20 20 20 20 20 20 6c  |,,q%..p(       l|
00000a40  69 6e 65 5f 6e 65 77 25  20 3d 20 28 71 25 21 32  |ine_new% = (q%!2|
00000a50  34 20 3e 3e 20 32 31 29  20 80 20 31 0d 03 7a 0a  |4 >> 21) . 1..z.|
00000a60  20 20 20 20 20 cb 0d 03  84 08 20 20 20 cb 0d 03  |     .....   ...|
00000a70  8e 07 20 20 cd 0d 03 98  05 cb 0d 03 a2 09 3d 72  |..  ..........=r|
00000a80  65 73 25 0d 03 ac 05 3a  0d 03 b6 47 f4 20 2a 2a  |es%....:...G. **|
00000a90  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000ac0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 0d  |***************.|
00000ad0  03 c0 46 f4 20 72 65 61  64 20 74 68 65 20 63 6f  |..F. read the co|
00000ae0  6e 66 69 67 75 72 61 74  69 6f 6e 20 66 69 6c 65  |nfiguration file|
00000af0  20 77 69 74 68 20 61 6c  6c 20 74 68 65 20 69 6e  | with all the in|
00000b00  64 69 76 69 64 75 61 6c  20 70 72 69 6e 74 65 72  |dividual printer|
00000b10  20 69 6e 66 6f 0d 03 ca  47 f4 20 2a 2a 2a 2a 2a  | info...G. *****|
00000b20  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000b50  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 0d 03 d4 1e  |************....|
00000b60  dd f2 50 72 69 6e 74 65  72 5f 72 65 61 64 5f 63  |..Printer_read_c|
00000b70  6f 6e 66 69 67 5f 66 69  6c 65 0d 03 de 0d ea 20  |onfig_file..... |
00000b80  48 25 2c 70 74 72 25 0d  03 e8 22 de 20 64 65 66  |H%,ptr%...". def|
00000b90  61 75 6c 74 73 25 20 70  72 69 6e 74 65 72 5f 64  |aults% printer_d|
00000ba0  61 74 61 5f 73 69 7a 65  25 0d 03 f2 36 e3 20 48  |ata_size%...6. H|
00000bb0  25 3d 30 20 b8 20 70 72  69 6e 74 65 72 5f 64 61  |%=0 . printer_da|
00000bc0  74 61 5f 73 69 7a 65 25  2d 34 20 88 20 34 3a 64  |ta_size%-4 . 4:d|
00000bd0  65 66 61 75 6c 74 73 25  21 48 25 3d 30 3a ed 0d  |efaults%!H%=0:..|
00000be0  03 fc 1d 70 72 69 6e 74  65 72 5f 64 61 74 61 25  |...printer_data%|
00000bf0  20 3d 20 64 65 66 61 75  6c 74 73 25 0d 04 06 1e  | = defaults%....|
00000c00  48 25 3d 8e 22 3c 50 44  72 69 76 65 72 24 64 69  |H%=."<PDriver$di|
00000c10  72 3e 2e 50 72 44 61 74  61 22 0d 04 10 2f e7 20  |r>.PrData".../. |
00000c20  48 25 3d 30 20 85 20 31  30 30 2c 22 43 61 6e 27  |H%=0 . 100,"Can'|
00000c30  74 20 72 65 61 64 20 70  72 69 6e 74 65 72 20 64  |t read printer d|
00000c40  61 74 61 20 66 69 6c 65  22 0d 04 1a 05 f5 0d 04  |ata file".......|
00000c50  24 10 20 70 74 72 25 20  3d 20 8f 23 48 25 0d 04  |$. ptr% = .#H%..|
00000c60  2e 1e 20 f2 50 72 69 6e  74 65 72 5f 70 72 6f 63  |.. .Printer_proc|
00000c70  65 73 73 5f 6c 69 6e 65  28 48 25 29 0d 04 38 0a  |ess_line(H%)..8.|
00000c80  fd 20 c5 23 48 25 0d 04  42 08 d9 23 48 25 0d 04  |. .#H%..B..#H%..|
00000c90  4c 05 e1 0d 04 56 05 3a  0d 04 60 33 f4 20 2a 2a  |L....V.:..`3. **|
00000ca0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000cc0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 04 6a 32 f4  |***********..j2.|
00000cd0  20 70 72 6f 63 65 73 73  20 6f 6e 65 20 6c 69 6e  | process one lin|
00000ce0  65 20 66 72 6f 6d 20 74  68 65 20 63 6f 6e 66 69  |e from the confi|
00000cf0  67 75 72 61 74 69 6f 6e  20 66 69 6c 65 0d 04 74  |guration file..t|
00000d00  33 f4 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |3. *************|
00000d10  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000d30  0d 04 7e 1e dd f2 50 72  69 6e 74 65 72 5f 70 72  |..~...Printer_pr|
00000d40  6f 63 65 73 73 5f 6c 69  6e 65 28 48 25 29 0d 04  |ocess_line(H%)..|
00000d50  88 10 ea 20 49 25 2c 4a  25 2c 74 61 67 24 0d 04  |... I%,J%,tag$..|
00000d60  92 0e 24 62 75 66 25 3d  be 23 48 25 0d 04 9c 08  |..$buf%=.#H%....|
00000d70  49 25 3d 30 0d 04 a6 23  c8 95 20 a4 74 61 67 63  |I%=0...#.. .tagc|
00000d80  68 61 72 28 62 75 66 25  3f 49 25 29 3a 20 49 25  |har(buf%?I%): I%|
00000d90  20 2b 3d 20 31 3a ce 0d  04 b0 16 e7 20 62 75 66  | += 1:...... buf|
00000da0  25 3f 49 25 20 3d 20 97  22 3a 22 20 8c 0d 04 ba  |%?I% = .":" ....|
00000db0  10 20 f4 20 67 6f 74 20  61 20 74 61 67 0d 04 c4  |. . got a tag...|
00000dc0  20 20 74 61 67 24 3d a4  6c 6f 77 65 72 63 61 73  |  tag$=.lowercas|
00000dd0  65 28 c0 24 62 75 66 25  2c 49 25 29 29 0d 04 ce  |e(.$buf%,I%))...|
00000de0  0c 20 49 25 20 2b 3d 20  31 0d 04 d8 1f 20 c8 95  |. I% += 1.... ..|
00000df0  20 62 75 66 25 3f 49 25  3d 97 22 20 22 3a 20 49  | buf%?I%=." ": I|
00000e00  25 20 2b 3d 20 31 3a ce  0d 04 e2 0e 20 c8 8e 20  |% += 1:..... .. |
00000e10  74 61 67 24 20 ca 0d 04  ec 11 20 20 c9 20 22 76  |tag$ .....  . "v|
00000e20  65 72 73 69 6f 6e 22 0d  04 f6 1e 20 20 20 50 72  |ersion"....   Pr|
00000e30  44 61 74 61 5f 76 65 72  73 69 6f 6e 25 20 3d 20  |Data_version% = |
00000e40  a4 72 65 61 64 0d 05 00  16 20 20 c9 20 22 70 72  |.read....  . "pr|
00000e50  69 6e 74 65 72 5f 6e 61  6d 65 22 0d 05 0a 15 20  |inter_name".... |
00000e60  20 20 f4 20 62 75 69 6c  64 20 61 20 6e 61 6d 65  |  . build a name|
00000e70  0d 05 14 23 20 20 20 de  20 64 65 73 63 72 69 70  |...#   . descrip|
00000e80  74 69 6f 6e 25 20 a9 24  62 75 66 25 20 2d 49 25  |tion% .$buf% -I%|
00000e90  20 2b 31 0d 05 1e 28 20  20 20 24 64 65 73 63 72  | +1...(   $descr|
00000ea0  69 70 74 69 6f 6e 25 20  3d 20 c2 24 62 75 66 25  |iption% = .$buf%|
00000eb0  2c a9 24 62 75 66 25 2d  49 25 29 0d 05 28 3b 20  |,.$buf%-I%)..(; |
00000ec0  20 20 f4 20 6e 6f 77 20  61 64 64 20 61 20 62 6c  |  . now add a bl|
00000ed0  6f 63 6b 20 74 6f 20 6f  75 72 20 6c 69 73 74 20  |ock to our list |
00000ee0  6f 66 20 70 72 69 6e 74  65 72 20 64 61 74 61 20  |of printer data |
00000ef0  62 6c 6f 63 6b 73 0d 05  32 29 20 20 20 de 20 70  |blocks..2)   . p|
00000f00  72 69 6e 74 65 72 5f 64  61 74 61 25 20 70 72 69  |rinter_data% pri|
00000f10  6e 74 65 72 5f 64 61 74  61 5f 73 69 7a 65 25 0d  |nter_data_size%.|
00000f20  05 3c 28 20 20 20 e3 20  49 25 3d 30 20 b8 20 70  |.<(   . I%=0 . p|
00000f30  72 69 6e 74 65 72 5f 64  61 74 61 5f 73 69 7a 65  |rinter_data_size|
00000f40  25 2d 34 20 88 20 34 0d  05 46 28 20 20 20 20 20  |%-4 . 4..F(     |
00000f50  70 72 69 6e 74 65 72 5f  64 61 74 61 25 21 49 25  |printer_data%!I%|
00000f60  20 3d 20 64 65 66 61 75  6c 74 73 25 21 49 25 0d  | = defaults%!I%.|
00000f70  05 50 08 20 20 20 ed 0d  05 5a 36 20 20 20 70 72  |.P.   ...Z6   pr|
00000f80  69 6e 74 65 72 5f 64 61  74 61 25 21 64 65 73 63  |inter_data%!desc|
00000f90  72 69 70 74 69 6f 6e 5f  66 69 65 6c 64 25 20 3d  |ription_field% =|
00000fa0  20 64 65 73 63 72 69 70  74 69 6f 6e 25 0d 05 64  | description%..d|
00000fb0  0f 20 20 20 e7 20 50 25  3d 30 20 8c 0d 05 6e 2a  |.   . P%=0 ...n*|
00000fc0  20 20 20 20 70 72 69 6e  74 65 72 5f 64 61 74 61  |    printer_data|
00000fd0  5f 6c 69 73 74 25 20 3d  20 70 72 69 6e 74 65 72  |_list% = printer|
00000fe0  5f 64 61 74 61 25 0d 05  78 08 20 20 20 cc 0d 05  |_data%..x.   ...|
00000ff0  82 2e 20 20 20 20 50 25  21 6c 69 73 74 5f 70 6f  |..    P%!list_po|
00001000  69 6e 74 65 72 5f 66 69  65 6c 64 25 20 3d 20 70  |inter_field% = p|
00001010  72 69 6e 74 65 72 5f 64  61 74 61 25 0d 05 8c 08  |rinter_data%....|
00001020  20 20 20 cd 0d 05 96 19  20 20 20 50 25 20 3d 20  |   .....   P% = |
00001030  70 72 69 6e 74 65 72 5f  64 61 74 61 25 0d 05 a0  |printer_data%...|
00001040  55 20 20 c9 20 22 70 78  72 65 73 22 2c 22 70 79  |U  . "pxres","py|
00001050  72 65 73 22 2c 22 66 65  61 74 75 72 65 73 22 2c  |res","features",|
00001060  22 70 78 72 65 73 5f 68  61 6c 66 74 6f 6e 65 22  |"pxres_halftone"|
00001070  2c 22 70 79 72 65 73 5f  68 61 6c 66 74 6f 6e 65  |,"pyres_halftone|
00001080  22 2c 22 70 72 69 6e 74  65 72 5f 6e 75 6d 62 65  |","printer_numbe|
00001090  72 22 0d 05 aa 48 20 20  20 f4 20 6e 6f 74 65 20  |r"...H   . note |
000010a0  74 68 61 74 20 61 6c 6c  20 74 61 67 73 20 61 72  |that all tags ar|
000010b0  65 20 74 68 65 20 73 61  6d 65 20 61 73 20 74 68  |e the same as th|
000010c0  65 69 72 20 72 65 73 70  65 63 74 69 76 65 20 66  |eir respective f|
000010d0  69 65 6c 64 20 6e 61 6d  65 73 0d 05 b4 2e 20 20  |ield names....  |
000010e0  20 70 72 69 6e 74 65 72  5f 64 61 74 61 25 21 a0  | printer_data%!.|
000010f0  28 74 61 67 24 2b 22 5f  66 69 65 6c 64 25 22 29  |(tag$+"_field%")|
00001100  20 3d 20 a4 72 65 61 64  0d 05 be 54 20 20 c9 20  | = .read...T  . |
00001110  22 70 61 67 65 5f 77 69  64 74 68 22 2c 22 70 61  |"page_width","pa|
00001120  67 65 5f 68 65 69 67 68  74 22 2c 22 70 61 67 65  |ge_height","page|
00001130  5f 62 6f 74 74 6f 6d 22  2c 22 70 61 67 65 5f 74  |_bottom","page_t|
00001140  6f 70 22 2c 22 70 61 67  65 5f 6c 65 66 74 22 2c  |op","page_left",|
00001150  22 70 61 67 65 5f 72 69  67 68 74 22 0d 05 c8 3b  |"page_right"...;|
00001160  20 20 20 20 20 70 61 67  65 5f 64 65 73 63 25 28  |     page_desc%(|
00001170  70 61 67 65 5f 6e 75 6d  62 65 72 25 2c a0 28 74  |page_number%,.(t|
00001180  61 67 24 2b 22 5f 66 69  65 6c 64 25 22 29 29 20  |ag$+"_field%")) |
00001190  3d 20 a4 72 65 61 64 0d  05 d2 3d 20 20 20 20 20  |= .read...=     |
000011a0  70 61 67 65 5f 70 74 72  73 25 28 70 61 67 65 5f  |page_ptrs%(page_|
000011b0  6e 75 6d 62 65 72 25 2c  a0 28 74 61 67 24 2b 22  |number%,.(tag$+"|
000011c0  5f 66 69 65 6c 64 25 22  29 29 20 3d 20 70 74 72  |_field%")) = ptr|
000011d0  25 2b 49 25 0d 05 dc 15  20 20 c9 20 22 70 61 67  |%+I%....  . "pag|
000011e0  65 5f 6e 75 6d 62 65 72  22 0d 05 e6 1d 20 20 20  |e_number"....   |
000011f0  20 20 70 61 67 65 5f 6e  75 6d 62 65 72 25 20 3d  |  page_number% =|
00001200  20 a4 72 65 61 64 0d 05  f0 34 20 20 c9 20 22 73  | .read...4  . "s|
00001210  65 72 76 65 72 22 2c 22  70 61 67 65 5f 6e 61 6d  |erver","page_nam|
00001220  65 22 2c 22 66 69 6c 65  22 2c 22 70 61 67 65 5f  |e","file","page_|
00001230  73 65 6c 65 63 74 69 6f  6e 22 0d 05 fa 16 20 20  |selection"....  |
00001240  20 f4 20 72 65 61 64 20  61 20 73 74 72 69 6e 67  | . read a string|
00001250  0d 06 04 0e 20 20 20 4a  25 20 3d 20 49 25 0d 06  |....   J% = I%..|
00001260  0e 27 20 20 20 c8 95 20  62 75 66 25 3f 4a 25 3e  |.'   .. buf%?J%>|
00001270  3d 97 22 20 22 20 80 20  62 75 66 25 3f 4a 25 3c  |=." " . buf%?J%<|
00001280  3e 97 22 3b 22 0d 06 18  0f 20 20 20 20 4a 25 20  |>.";"....    J% |
00001290  2b 3d 20 31 0d 06 22 08  20 20 20 ce 0d 06 2c 24  |+= 1..".   ...,$|
000012a0  20 20 20 f4 20 66 72 6f  6d 20 49 25 20 74 6f 20  |   . from I% to |
000012b0  4a 25 20 69 73 20 74 68  65 20 73 74 72 69 6e 67  |J% is the string|
000012c0  0d 06 36 10 20 20 20 c8  8e 20 74 61 67 24 20 ca  |..6.   .. tag$ .|
000012d0  0d 06 40 11 20 20 20 c9  20 22 73 65 72 76 65 72  |..@.   . "server|
000012e0  22 0d 06 4a 1f 20 20 20  20 73 65 72 76 65 72 5f  |"..J.    server_|
000012f0  70 74 72 25 20 3d 20 70  74 72 25 20 2b 20 49 25  |ptr% = ptr% + I%|
00001300  0d 06 54 2d 20 20 20 20  73 65 72 76 65 72 5f 63  |..T-    server_c|
00001310  6f 6e 66 69 67 24 20 3d  20 c1 24 62 75 66 25 2c  |onfig$ = .$buf%,|
00001320  20 49 25 2b 31 2c 20 4a  25 2d 49 25 29 0d 06 5e  | I%+1, J%-I%)..^|
00001330  0f 20 20 20 c9 20 22 66  69 6c 65 22 0d 06 68 1d  |.   . "file"..h.|
00001340  20 20 20 20 66 69 6c 65  5f 70 74 72 25 20 3d 20  |    file_ptr% = |
00001350  70 74 72 25 20 2b 20 49  25 0d 06 72 2b 20 20 20  |ptr% + I%..r+   |
00001360  20 66 69 6c 65 5f 63 6f  6e 66 69 67 24 20 3d 20  | file_config$ = |
00001370  c1 24 62 75 66 25 2c 20  49 25 2b 31 2c 20 4a 25  |.$buf%, I%+1, J%|
00001380  2d 49 25 29 0d 06 7c 20  20 20 20 20 24 66 69 6c  |-I%)..|     $fil|
00001390  65 5f 6e 61 6d 65 25 3d  66 69 6c 65 5f 63 6f 6e  |e_name%=file_con|
000013a0  66 69 67 24 0d 06 86 36  20 20 20 20 c8 99 20 22  |fig$...6    .. "|
000013b0  58 4f 53 5f 43 4c 49 22  2c 22 73 65 74 20 50 72  |XOS_CLI","set Pr|
000013c0  69 6e 74 65 72 54 79 70  65 24 35 20 22 2b 66 69  |interType$5 "+fi|
000013d0  6c 65 5f 63 6f 6e 66 69  67 24 0d 06 90 14 20 20  |le_config$....  |
000013e0  20 c9 20 22 70 61 67 65  5f 6e 61 6d 65 22 0d 06  | . "page_name"..|
000013f0  9a 36 20 20 20 20 70 61  67 65 5f 6e 61 6d 65 73  |.6    page_names|
00001400  24 28 70 61 67 65 5f 6e  75 6d 62 65 72 25 29 3d  |$(page_number%)=|
00001410  c1 24 62 75 66 25 2c 20  49 25 2b 31 2c 20 4a 25  |.$buf%, I%+1, J%|
00001420  2d 49 25 29 0d 06 a4 3b  20 20 20 20 70 61 67 65  |-I%)...;    page|
00001430  5f 70 74 72 73 25 28 70  61 67 65 5f 6e 75 6d 62  |_ptrs%(page_numb|
00001440  65 72 25 2c 70 61 67 65  5f 6e 61 6d 65 5f 66 69  |er%,page_name_fi|
00001450  65 6c 64 25 29 20 3d 20  70 74 72 25 2b 49 25 0d  |eld%) = ptr%+I%.|
00001460  06 ae 19 20 20 20 c9 20  22 70 61 67 65 5f 73 65  |...   . "page_se|
00001470  6c 65 63 74 69 6f 6e 22  0d 06 b8 3a 20 20 20 20  |lection"...:    |
00001480  70 61 67 65 5f 73 65 6c  65 63 74 69 6f 6e 24 28  |page_selection$(|
00001490  70 61 67 65 5f 6e 75 6d  62 65 72 25 29 3d c1 24  |page_number%)=.$|
000014a0  62 75 66 25 2c 20 49 25  2b 31 2c 20 4a 25 2d 49  |buf%, I%+1, J%-I|
000014b0  25 29 0d 06 c2 08 20 20  20 cb 0d 06 cc 1b 20 20  |%)....   .....  |
000014c0  c9 20 22 73 74 61 72 74  5f 70 61 67 65 5f 6e 75  |. "start_page_nu|
000014d0  6d 62 65 72 22 0d 06 d6  22 20 20 20 70 61 67 65  |mber"..."   page|
000014e0  5f 6e 75 6d 62 65 72 5f  63 6f 6e 66 69 67 25 20  |_number_config% |
000014f0  3d 20 a4 72 65 61 64 0d  06 e0 23 20 20 20 70 61  |= .read...#   pa|
00001500  67 65 5f 6e 75 6d 62 65  72 5f 70 74 72 25 20 3d  |ge_number_ptr% =|
00001510  20 70 74 72 25 20 2b 20  49 25 0d 06 ea 11 20 20  | ptr% + I%....  |
00001520  c9 20 22 70 72 69 6e 74  65 72 22 0d 06 f4 1e 20  |. "printer".... |
00001530  20 20 70 72 69 6e 74 65  72 5f 63 6f 6e 66 69 67  |  printer_config|
00001540  25 20 3d 20 a4 72 65 61  64 0d 06 fe 25 20 20 20  |% = .read...%   |
00001550  70 72 69 6e 74 65 72 5f  6e 65 77 25 20 3d 20 70  |printer_new% = p|
00001560  72 69 6e 74 65 72 5f 63  6f 6e 66 69 67 25 0d 07  |rinter_config%..|
00001570  08 1f 20 20 20 70 72 69  6e 74 65 72 5f 70 74 72  |..   printer_ptr|
00001580  25 20 3d 20 70 74 72 25  20 2b 20 49 25 0d 07 12  |% = ptr% + I%...|
00001590  12 20 20 c9 20 22 6c 6f  63 61 74 69 6f 6e 22 0d  |.  . "location".|
000015a0  07 1c 1f 20 20 20 6c 6f  63 61 74 69 6f 6e 5f 63  |...   location_c|
000015b0  6f 6e 66 69 67 25 20 3d  20 a4 72 65 61 64 0d 07  |onfig% = .read..|
000015c0  26 20 20 20 20 6c 6f 63  61 74 69 6f 6e 5f 70 74  |&    location_pt|
000015d0  72 25 20 3d 20 70 74 72  25 20 2b 20 49 25 0d 07  |r% = ptr% + I%..|
000015e0  30 0e 20 20 c9 20 22 62  61 75 64 22 0d 07 3a 1b  |0.  . "baud"..:.|
000015f0  20 20 20 62 61 75 64 5f  63 6f 6e 66 69 67 25 20  |   baud_config% |
00001600  3d 20 a4 72 65 61 64 0d  07 44 1c 20 20 20 62 61  |= .read..D.   ba|
00001610  75 64 5f 70 74 72 25 20  3d 20 70 74 72 25 20 2b  |ud_ptr% = ptr% +|
00001620  20 49 25 0d 07 4e 0e 20  20 c9 20 22 64 61 74 61  | I%..N.  . "data|
00001630  22 0d 07 58 1b 20 20 20  64 61 74 61 5f 63 6f 6e  |"..X.   data_con|
00001640  66 69 67 25 20 3d 20 a4  72 65 61 64 0d 07 62 1c  |fig% = .read..b.|
00001650  20 20 20 64 61 74 61 5f  70 74 72 25 20 3d 20 70  |   data_ptr% = p|
00001660  74 72 25 20 2b 20 49 25  0d 07 6c 0d 20 20 c9 20  |tr% + I%..l.  . |
00001670  22 78 6f 6e 22 0d 07 76  1a 20 20 20 58 4f 4e 5f  |"xon"..v.   XON_|
00001680  63 6f 6e 66 69 67 25 20  3d 20 a4 72 65 61 64 0d  |config% = .read.|
00001690  07 80 1d 20 20 20 58 4f  4e 5f 6e 65 77 25 20 3d  |...   XON_new% =|
000016a0  20 58 4f 4e 5f 63 6f 6e  66 69 67 25 0d 07 8a 1b  | XON_config%....|
000016b0  20 20 20 58 4f 4e 5f 70  74 72 25 20 3d 20 70 74  |   XON_ptr% = pt|
000016c0  72 25 20 2b 20 49 25 0d  07 94 0e 20 20 c9 20 22  |r% + I%....  . "|
000016d0  6c 69 6e 65 22 0d 07 9e  1b 20 20 20 6c 69 6e 65  |line"....   line|
000016e0  5f 63 6f 6e 66 69 67 25  20 3d 20 a4 72 65 61 64  |_config% = .read|
000016f0  0d 07 a8 1f 20 20 20 6c  69 6e 65 5f 6e 65 77 25  |....   line_new%|
00001700  20 3d 20 6c 69 6e 65 5f  63 6f 6e 66 69 67 25 0d  | = line_config%.|
00001710  07 b2 1c 20 20 20 6c 69  6e 65 5f 70 74 72 25 20  |...   line_ptr% |
00001720  3d 20 70 74 72 25 20 2b  20 49 25 0d 07 bc 06 20  |= ptr% + I%.... |
00001730  cb 0d 07 c6 05 cd 0d 07  d0 05 e1 0d 07 da 05 3a  |...............:|
00001740  0d 07 e4 36 dd a4 72 65  61 64 3d a4 72 65 61 64  |...6..read=.read|
00001750  5f 69 6e 74 65 67 65 72  5f 65 78 70 72 65 73 73  |_integer_express|
00001760  69 6f 6e 28 c2 24 62 75  66 25 2c a9 24 62 75 66  |ion(.$buf%,.$buf|
00001770  25 2d 49 25 29 29 0d 07  ee 05 3a 0d 07 f8 2d f4  |%-I%))....:...-.|
00001780  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
00001790  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
000017a0  2a 2a 2a 2a 2a 2a 2a 2a  0d 08 02 24 f4 20 63 6f  |********...$. co|
000017b0  6e 76 65 72 74 20 61 20  73 74 72 69 6e 67 20 74  |nvert a string t|
000017c0  6f 20 61 6e 20 69 6e 74  65 67 65 72 0d 08 0c 2d  |o an integer...-|
000017d0  f4 20 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |. **************|
000017e0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
000017f0  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 08 16 21 dd a4 72  |*********...!..r|
00001800  65 61 64 5f 69 6e 74 65  67 65 72 5f 65 78 70 72  |ead_integer_expr|
00001810  65 73 73 69 6f 6e 28 53  24 29 0d 08 20 14 ea 20  |ession(S$).. .. |
00001820  52 25 2c 20 54 25 2c 20  45 24 2c 20 50 25 0d 08  |R%, T%, E$, P%..|
00001830  2a 09 45 24 3d 22 22 0d  08 34 1c f4 20 67 65 74  |*.E$=""..4.. get|
00001840  20 72 69 64 20 6f 66 20  61 6e 79 20 63 6f 6d 6d  | rid of any comm|
00001850  65 6e 74 0d 08 3e 1f c8  95 20 c0 53 24 2c 31 29  |ent..>... .S$,1)|
00001860  20 3c 3e 20 22 3b 22 20  80 20 a9 53 24 20 3c 3e  | <> ";" . .S$ <>|
00001870  20 30 0d 08 48 11 20 45  24 20 2b 3d 20 c0 53 24  | 0..H. E$ += .S$|
00001880  2c 31 29 0d 08 52 14 20  53 24 20 3d 20 c2 53 24  |,1)..R. S$ = .S$|
00001890  2c a9 53 24 2d 31 29 0d  08 5c 05 ce 0d 08 66 36  |,.S$-1)..\....f6|
000018a0  c8 99 22 58 4f 53 5f 45  76 61 6c 75 61 74 65 45  |.."XOS_EvaluateE|
000018b0  78 70 72 65 73 73 69 6f  6e 22 2c 45 24 2c 62 75  |xpression",E$,bu|
000018c0  66 25 2c 32 35 36 20 b8  20 2c 54 25 2c 52 25 3b  |f%,256 . ,T%,R%;|
000018d0  50 25 0d 08 70 40 e7 20  54 25 20 3c 3e 20 30 20  |P%..p@. T% <> 0 |
000018e0  84 20 28 50 25 20 80 20  31 29 20 85 20 31 30 30  |. (P% . 1) . 100|
000018f0  2c 20 22 49 6e 74 65 67  65 72 20 76 61 6c 75 65  |, "Integer value|
00001900  20 6e 65 65 64 65 64 20  66 6f 72 20 22 2b 74 61  | needed for "+ta|
00001910  67 24 0d 08 7a 07 3d 52  25 0d 08 84 05 3a 0d 08  |g$..z.=R%....:..|
00001920  8e 2d f4 20 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.-. ************|
00001930  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00001940  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 08 98 2c f4  |***********...,.|
00001950  20 61 6c 6c 6f 77 20 6f  6e 6c 79 20 61 6c 70 68  | allow only alph|
00001960  61 6e 75 6d 65 72 69 63  73 20 69 6e 20 74 61 67  |anumerics in tag|
00001970  20 66 69 65 6c 64 73 0d  08 a2 2d f4 20 2a 2a 2a  | fields...-. ***|
00001980  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000019a0  2a 2a 2a 2a 0d 08 ac 11  dd a4 74 61 67 63 68 61  |****......tagcha|
000019b0  72 28 43 25 29 0d 08 b6  24 e7 20 28 43 25 20 3e  |r(C%)...$. (C% >|
000019c0  3d 20 97 22 41 22 20 80  20 43 25 20 3c 3d 20 97  |= ."A" . C% <= .|
000019d0  22 5a 22 29 20 8c 20 3d  b9 0d 08 c0 24 e7 20 28  |"Z") . =....$. (|
000019e0  43 25 20 3e 3d 20 97 22  61 22 20 80 20 43 25 20  |C% >= ."a" . C% |
000019f0  3c 3d 20 97 22 7a 22 29  20 8c 20 3d b9 0d 08 ca  |<= ."z") . =....|
00001a00  2c 3d 20 20 28 43 25 20  3e 3d 20 97 22 30 22 20  |,=  (C% >= ."0" |
00001a10  80 20 43 25 20 3c 3d 20  97 22 39 22 29 20 84 20  |. C% <= ."9") . |
00001a20  43 25 20 3d 20 97 22 5f  22 0d 08 d4 05 3a 0d 08  |C% = ."_"....:..|
00001a30  de 4b f4 20 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.K. ************|
00001a40  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00001a70  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 08 e8 4b f4 20 73  |*********...K. s|
00001a80  65 74 20 74 68 65 20 70  72 69 6e 74 65 72 20 64  |et the printer d|
00001a90  72 69 76 65 72 20 6d 6f  64 75 6c 65 27 73 20 73  |river module's s|
00001aa0  74 61 74 65 20 74 6f 20  72 65 66 6c 65 63 74 20  |tate to reflect |
00001ab0  74 68 65 20 63 75 72 72  65 6e 74 20 73 65 74 74  |the current sett|
00001ac0  69 6e 67 73 0d 08 f2 4b  f4 20 2a 2a 2a 2a 2a 2a  |ings...K. ******|
00001ad0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00001b00  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 0d  |***************.|
00001b10  08 fc 1d dd f2 50 72 69  6e 74 65 72 5f 73 65 74  |.....Printer_set|
00001b20  5f 6d 6f 64 75 6c 65 5f  64 61 74 61 0d 09 06 17  |_module_data....|
00001b30  ea 20 41 25 2c 42 25 2c  43 25 2c 44 25 2c 45 25  |. A%,B%,C%,D%,E%|
00001b40  2c 46 25 0d 09 10 1d 41  25 3d 64 65 66 61 75 6c  |,F%....A%=defaul|
00001b50  74 73 25 21 70 78 72 65  73 5f 66 69 65 6c 64 25  |ts%!pxres_field%|
00001b60  0d 09 1a 1d 42 25 3d 64  65 66 61 75 6c 74 73 25  |....B%=defaults%|
00001b70  21 70 79 72 65 73 5f 66  69 65 6c 64 25 0d 09 24  |!pyres_field%..$|
00001b80  20 43 25 3d 64 65 66 61  75 6c 74 73 25 21 66 65  | C%=defaults%!fe|
00001b90  61 74 75 72 65 73 5f 66  69 65 6c 64 25 0d 09 2e  |atures_field%...|
00001ba0  26 44 25 3d 64 65 66 61  75 6c 74 73 25 21 70 78  |&D%=defaults%!px|
00001bb0  72 65 73 5f 68 61 6c 66  74 6f 6e 65 5f 66 69 65  |res_halftone_fie|
00001bc0  6c 64 25 0d 09 38 26 45  25 3d 64 65 66 61 75 6c  |ld%..8&E%=defaul|
00001bd0  74 73 25 21 70 79 72 65  73 5f 68 61 6c 66 74 6f  |ts%!pyres_halfto|
00001be0  6e 65 5f 66 69 65 6c 64  25 0d 09 42 26 46 25 3d  |ne_field%..B&F%=|
00001bf0  64 65 66 61 75 6c 74 73  25 21 70 72 69 6e 74 65  |defaults%!printe|
00001c00  72 5f 6e 75 6d 62 65 72  5f 66 69 65 6c 64 25 0d  |r_number_field%.|
00001c10  09 4c 2c c8 99 20 22 50  44 72 69 76 65 72 5f 53  |.L,.. "PDriver_S|
00001c20  65 74 49 6e 66 6f 22 2c  2c 41 25 2c 42 25 2c 43  |etInfo",,A%,B%,C|
00001c30  25 2c 2c 44 25 2c 45 25  2c 46 25 0d 09 56 0d 6d  |%,,D%,E%,F%..V.m|
00001c40  73 67 25 21 30 3d 32 30  0d 09 60 0d 6d 73 67 25  |sg%!0=20..`.msg%|
00001c50  21 31 32 3d 30 0d 09 6a  1f 6d 73 67 25 21 31 36  |!12=0..j.msg%!16|
00001c60  3d 4d 65 73 73 61 67 65  5f 53 65 74 50 72 69 6e  |=Message_SetPrin|
00001c70  74 65 72 25 0d 09 74 26  c8 99 20 22 57 69 6d 70  |ter%..t&.. "Wimp|
00001c80  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 2c 20 31  |_SendMessage", 1|
00001c90  38 2c 20 6d 73 67 25 2c  20 30 0d 09 7e 05 e1 0d  |8, msg%, 0..~...|
00001ca0  09 88 05 3a 0d 09 92 2d  f4 20 2a 2a 2a 2a 2a 2a  |...:...-. ******|
00001cb0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00001cd0  2a 0d 09 9c 2d f4 20 73  65 74 20 74 68 65 20 64  |*...-. set the d|
00001ce0  65 73 63 72 69 70 74 69  6f 6e 20 66 69 65 6c 64  |escription field|
00001cf0  20 69 6e 20 6f 75 72 20  77 69 6e 64 6f 77 0d 09  | in our window..|
00001d00  a6 2d f4 20 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.-. ************|
00001d10  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00001d20  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 09 b0 1d dd  |***********.....|
00001d30  f2 50 72 69 6e 74 65 72  5f 73 65 74 5f 64 65 73  |.Printer_set_des|
00001d40  63 72 69 70 74 69 6f 6e  0d 09 ba 0c ea 20 53 25  |cription..... S%|
00001d50  2c 20 53 24 0d 09 c4 27  e3 20 53 25 20 3d 20 30  |, S$...'. S% = 0|
00001d60  20 b8 20 70 72 69 6e 74  65 72 5f 64 61 74 61 5f  | . printer_data_|
00001d70  73 69 7a 65 25 2d 34 20  88 20 34 0d 09 ce 28 64  |size%-4 . 4...(d|
00001d80  65 66 61 75 6c 74 73 25  21 53 25 20 3d 20 70 72  |efaults%!S% = pr|
00001d90  69 6e 74 65 72 5f 64 61  74 61 5f 6c 69 73 74 25  |inter_data_list%|
00001da0  21 53 25 0d 09 d8 05 ed  0d 09 e2 48 f2 50 72 69  |!S%........H.Pri|
00001db0  6e 74 65 72 5f 73 65 74  5f 69 63 6f 6e 28 6d 61  |nter_set_icon(ma|
00001dc0  69 6e 5f 64 65 73 63 72  69 70 74 69 6f 6e 25 2c  |in_description%,|
00001dd0  24 28 64 65 66 61 75 6c  74 73 25 21 64 65 73 63  |$(defaults%!desc|
00001de0  72 69 70 74 69 6f 6e 5f  66 69 65 6c 64 25 29 29  |ription_field%))|
00001df0  0d 09 ec 4a c8 99 20 22  58 4f 53 5f 43 4c 49 22  |...J.. "XOS_CLI"|
00001e00  2c 22 53 45 54 20 50 72  69 6e 74 65 72 24 22 2b  |,"SET Printer$"+|
00001e10  22 20 22 22 22 2b 24 28  64 65 66 61 75 6c 74 73  |" """+$(defaults|
00001e20  25 21 64 65 73 63 72 69  70 74 69 6f 6e 5f 66 69  |%!description_fi|
00001e30  65 6c 64 25 29 2b 22 22  22 22 0d 09 f6 05 e1 0d  |eld%)+""""......|
00001e40  0a 00 05 3a 0d 0a 0a 1f  dd 20 f2 50 72 69 6e 74  |...:..... .Print|
00001e50  65 72 5f 63 68 61 6e 67  65 5f 70 61 67 65 5f 73  |er_change_page_s|
00001e60  69 7a 65 0d 0a 14 42 ff  28 22 53 65 74 20 50 44  |ize...B.("Set PD|
00001e70  72 69 76 65 72 24 49 78  65 78 74 72 61 20 22 22  |river$Ixextra ""|
00001e80  22 2b 70 61 67 65 5f 73  65 6c 65 63 74 69 6f 6e  |"+page_selection|
00001e90  24 28 70 61 67 65 5f 6e  75 6d 62 65 72 25 29 2b  |$(page_number%)+|
00001ea0  22 22 22 22 29 0d 0a 1e  05 e1 0d 0a 28 05 3a 0d  |"""").......(.:.|
00001eb0  0a 32 1d dd f2 50 72 69  6e 74 65 72 5f 73 65 74  |.2...Printer_set|
00001ec0  5f 69 63 6f 6e 28 49 25  2c 53 24 29 0d 0a 3c 08  |_icon(I%,S$)..<.|
00001ed0  ea 20 53 25 0d 0a 46 1a  53 25 3d a4 69 63 6f 6e  |. S%..F.S%=.icon|
00001ee0  61 64 64 72 28 6d 61 69  6e 25 2c 49 25 29 0d 0a  |addr(main%,I%)..|
00001ef0  50 0c 24 53 25 20 3d 20  53 24 0d 0a 5a 17 f2 7a  |P.$S% = S$..Z..z|
00001f00  65 72 6f 5f 74 65 72 6d  69 6e 61 74 65 28 53 25  |ero_terminate(S%|
00001f10  29 0d 0a 64 31 f2 73 65  74 5f 69 63 6f 6e 5f 73  |)..d1.set_icon_s|
00001f20  74 61 74 65 28 6d 61 69  6e 25 2c 49 25 2c 30 2c  |tate(main%,I%,0,|
00001f30  30 29 3a 20 f4 20 66 6f  72 63 65 20 72 65 64 72  |0): . force redr|
00001f40  61 77 0d 0a 6e 05 e1 0d  0a 78 05 3a 0d 0a 82 1a  |aw..n....x.:....|
00001f50  dd 20 f2 50 72 69 6e 74  65 72 5f 41 6d 65 6e 64  |. .Printer_Amend|
00001f60  43 6f 6e 66 69 67 0d 0a  8c 21 e7 20 6c 69 6e 65  |Config...!. line|
00001f70  5f 63 6f 6e 66 69 67 25  20 3c 3e 20 6c 69 6e 65  |_config% <> line|
00001f80  5f 6e 65 77 25 20 8c 0d  0a 96 1a 20 cf 23 6f 75  |_new% ..... .#ou|
00001f90  74 5f 66 69 6c 65 25 3d  6c 69 6e 65 5f 70 74 72  |t_file%=line_ptr|
00001fa0  25 0d 0a a0 1c 20 d5 23  6f 75 74 5f 66 69 6c 65  |%.... .#out_file|
00001fb0  25 2c c3 6c 69 6e 65 5f  6e 65 77 25 3b 0d 0a aa  |%,.line_new%;...|
00001fc0  1d 20 6c 69 6e 65 5f 63  6f 6e 66 69 67 25 20 3d  |. line_config% =|
00001fd0  20 6c 69 6e 65 5f 6e 65  77 25 0d 0a b4 05 cd 0d  | line_new%......|
00001fe0  0a be 05 e1 0d 0a c8 05  3a 0d 0a d2 15 dd 20 f2  |........:..... .|
00001ff0  50 72 69 6e 74 65 72 5f  49 67 6e 6f 72 65 0d 0a  |Printer_Ignore..|
00002000  dc 05 e1 0d 0a e6 05 3a  0d 0a f0 1d dd 20 f2 50  |.......:..... .P|
00002010  72 69 6e 74 65 72 5f 58  6f 6e 58 6f 66 66 28 66  |rinter_XonXoff(f|
00002020  6c 61 67 25 29 0d 0a fa  0d e7 20 66 6c 61 67 25  |lag%)..... flag%|
00002030  20 8c 0d 0b 04 0c 20 2a  66 78 20 32 2c 32 0d 0b  | ..... *fx 2,2..|
00002040  0e 05 cc 0d 0b 18 0c 20  2a 66 78 20 32 2c 30 0d  |....... *fx 2,0.|
00002050  0b 22 05 cd 0d 0b 2c 05  e1 0d 0b 36 05 3a 0d 0b  |."....,....6.:..|
00002060  40 1d dd 20 f2 50 72 69  6e 74 65 72 5f 4c 6f 63  |@.. .Printer_Loc|
00002070  61 74 69 6f 6e 28 6c 6f  63 25 29 0d 0b 4a 4d f4  |ation(loc%)..JM.|
00002080  20 54 68 65 20 63 75 72  72 65 6e 74 20 70 72 69  | The current pri|
00002090  6e 74 65 72 20 6c 6f 63  61 74 69 6f 6e 20 73 65  |nter location se|
000020a0  74 74 69 6e 67 20 64 6f  65 73 6e 27 74 20 61 66  |tting doesn't af|
000020b0  66 65 63 74 20 74 68 69  73 20 70 72 69 6e 74 65  |fect this printe|
000020c0  72 20 64 72 69 76 65 72  0d 0b 54 05 e1 0d 0b 5e  |r driver..T....^|
000020d0  05 3a 0d 0b 68 15 dd 20  f2 50 72 69 6e 74 65 72  |.:..h.. .Printer|
000020e0  5f 48 65 61 64 65 72 0d  0b 72 19 6c 69 6e 65 5f  |_Header..r.line_|
000020f0  70 72 69 6e 74 25 3d 6c  69 6e 65 5f 6e 65 77 25  |print%=line_new%|
00002100  0d 0b 7c 14 60 65 78 74  25 3d a2 23 69 6e 5f 66  |..|.`ext%=.#in_f|
00002110  69 6c 65 25 0d 0b 86 05  e1 0d 0b 90 05 3a 0d 0b  |ile%.........:..|
00002120  9a 15 dd 20 f2 50 72 69  6e 74 65 72 5f 46 6f 6f  |... .Printer_Foo|
00002130  74 65 72 0d 0b a4 05 e1  0d 0b ae 05 3a 0d 0b b8  |ter.........:...|
00002140  19 dd 20 a4 50 72 69 6e  74 65 72 5f 53 65 6e 64  |.. .Printer_Send|
00002150  28 6c 65 6e 25 29 0d 0b  c2 0a f2 45 73 63 4f 6e  |(len%).....EscOn|
00002160  0d 0b cc 0b ea 20 4c 25  2c 43 25 0d 0b d6 19 4c  |..... L%,C%....L|
00002170  25 3d 60 65 78 74 25 20  2d 20 8f 23 69 6e 5f 66  |%=`ext% - .#in_f|
00002180  69 6c 65 25 0d 0b e0 29  e7 20 6c 69 6e 65 5f 70  |ile%...). line_p|
00002190  72 69 6e 74 25 20 80 20  46 74 79 70 65 25 3c 3e  |rint% . Ftype%<>|
000021a0  4f 75 74 70 75 74 54 79  70 65 25 20 8c 0d 0b ea  |OutputType% ....|
000021b0  15 20 c8 95 20 6c 65 6e  25 3e 31 20 80 20 4c 25  |. .. len%>1 . L%|
000021c0  3e 30 0d 0b f4 1a 20 20  43 25 3d 9a 23 69 6e 5f  |>0....  C%=.#in_|
000021d0  66 69 6c 65 25 3a 20 4c  25 2d 3d 31 0d 0b fe 24  |file%: L%-=1...$|
000021e0  20 20 e7 20 43 25 3d 31  30 20 d5 23 6f 75 74 5f  |  . C%=10 .#out_|
000021f0  66 69 6c 65 25 2c 31 33  3a 6c 65 6e 25 2d 3d 31  |file%,13:len%-=1|
00002200  0d 0c 08 1c 20 20 d5 23  6f 75 74 5f 66 69 6c 65  |....  .#out_file|
00002210  25 2c 43 25 3a 6c 65 6e  25 2d 3d 31 0d 0c 12 24  |%,C%:len%-=1...$|
00002220  20 20 e7 20 43 25 3d 31  33 20 d5 23 6f 75 74 5f  |  . C%=13 .#out_|
00002230  66 69 6c 65 25 2c 31 30  3a 6c 65 6e 25 2d 3d 31  |file%,10:len%-=1|
00002240  0d 0c 1c 06 20 ce 0d 0c  26 05 cc 0d 0c 30 17 20  |.... ...&....0. |
00002250  e7 20 6c 65 6e 25 3e 3d  4c 25 20 6c 65 6e 25 3d  |. len%>=L% len%=|
00002260  4c 25 0d 0c 3a 34 20 c8  99 20 22 4f 53 5f 47 42  |L%..:4 .. "OS_GB|
00002270  50 42 22 2c 20 34 2c 20  69 6e 5f 66 69 6c 65 25  |PB", 4, in_file%|
00002280  2c 20 62 75 66 25 2c 20  6c 65 6e 25 3a 20 4c 25  |, buf%, len%: L%|
00002290  2d 3d 6c 65 6e 25 0d 0c  44 2b 20 c8 99 20 22 4f  |-=len%..D+ .. "O|
000022a0  53 5f 47 42 50 42 22 2c  20 32 2c 20 6f 75 74 5f  |S_GBPB", 2, out_|
000022b0  66 69 6c 65 25 2c 20 62  75 66 25 2c 20 6c 65 6e  |file%, buf%, len|
000022c0  25 0d 0c 4e 05 cd 0d 0c  58 0b f2 45 73 63 4f 66  |%..N....X..EscOf|
000022d0  66 0d 0c 62 0c 3d 28 4c  25 3c 3d 30 29 0d 0c 6c  |f..b.=(L%<=0)..l|
000022e0  0e 3e 2a 46 58 20 32 32  39 2c 31 0d ff           |.>*FX 229,1..|
000022ed
!PrinterIx/Library.m0
!PrinterIx/Library.m1
!PrinterIx/Library.m2
!PrinterIx/Library.m4
!PrinterIx/Library.m5