Changeset a72ed95 in git


Ignore:
Timestamp:
06/03/15 10:22:31 (5 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
c11ceba
Parents:
2f0b258
Message:
  • .gitignore,Makefile.am,debian/survex.install,doc/,lib/,src/: Aven's

support for reading colours and font sizes for printouts from
print.ini has never worked - the contents of the ini files are
ignored due to a bug which has been there since the code was added
in 2005 - but nobody has ever complained. So just strip out that
code entirely - we should support setting the colours and font sizes,
but a GUI interface for setting them would be better.

Files:
5 deleted
34 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r2f0b258 ra72ed95  
    3030doc/manual.pdf
    3131doc/manual.txt
    32 doc/print.ini.5
    3332doc/sorterr.1
    3433doc/survex.7
  • ChangeLog

    r2f0b258 ra72ed95  
     1Fri Mar 06 10:15:16 GMT 2015  Olly Betts <olly@survex.com>
     2
     3        * .gitignore,Makefile.am,debian/survex.install,doc/,lib/,src/: Aven's
     4          support for reading colours and font sizes for printouts from
     5          print.ini has never worked - the contents of the ini files are
     6          ignored due to a bug which has been there since the code was added
     7          in 2005 - but nobody has ever complained.  So just strip out that
     8          code entirely - we should support setting the colours and font sizes,
     9          but a GUI interface for setting them would be better.
     10
    111Fri Mar 06 07:00:35 GMT 2015  Olly Betts <olly@survex.com>
    212
  • Makefile.am

    r2f0b258 ra72ed95  
    1313extra_bin = lib/*.msg\
    1414 lib/unifont.pixelfont
    15 extra_txt = lib/*.svx lib/print.ini
     15extra_txt = lib/*.svx
    1616extra_files = $(extra_bin) $(extra_txt)
    1717
  • debian/survex.install

    r2f0b258 ra72ed95  
    11debian/tmp/usr/share/survex/icons
    2 debian/tmp/usr/share/survex/print.ini
    32debian/tmp/usr/share/survex/bcra3.svx
    43debian/tmp/usr/share/survex/bcra5.svx
     
    1918debian/tmp/usr/share/man/man1/extend.1
    2019debian/tmp/usr/share/man/man1/sorterr.1
    21 debian/tmp/usr/share/man/man5/print.ini.5
    2220debian/tmp/usr/share/man/man7/survex.7
    2321debian/tmp/usr/share/doc/survex
  • doc/Makefile.am

    r2f0b258 ra72ed95  
    55other_mans = cad3d.1 cavern.1 diffpos.1 extend.1 sorterr.1 3dtopos.1 \
    66 aven.1 \
    7  print.ini.5 svxedit.1
     7 svxedit.1
    88
    99manual_sources = manual.sgml cad3d.sgml cavern.sgml\
    1010 diffpos.sgml extend.sgml sorterr.sgml 3dtopos.sgml aven.sgml\
    11  print.ini.sgml svxedit.sgml
     11 svxedit.sgml
    1212
    1313manual_alt = manual.txt manual.pdf
     
    2222 man_3dtopos.sgml man_aven.sgml man_cad3d.sgml man_cavern.sgml\
    2323 man_diffpos.sgml man_extend.sgml man_sorterr.sgml\
    24  man_print.ini.sgml man_svxedit.sgml news2html.pl\
     24 man_svxedit.sgml news2html.pl\
    2525 version.ent
    2626
     
    6868        $(DOCBOOK_TO_MAN) $(srcdir)/man_svxedit.sgml > svxedit.tmp
    6969        mv svxedit.tmp svxedit.1
    70 
    71 print.ini.5: $(srcdir)/print.ini.sgml $(srcdir)/man_print.ini.sgml $(srcdir)/survex.ent
    72         $(DOCBOOK_TO_MAN) $(srcdir)/man_print.ini.sgml > print.ini.tmp
    73         mv print.ini.tmp print.ini.5
    7470
    7571install-data-local: manual
  • doc/TODO.htm

    r2f0b258 ra72ed95  
    142142<i>nsgmls man_aven.sgml | sgmlspl /usr/lib/perl5/sgmlspl-specs/docbook2man-spec.pl</i>).  Issues are: double space between sentences is lost;
    143143double blank lines appear in output.
    144 
    145 <li>Make sure there's documentation for all the various settings in print.ini
    146 (colours aren't documented at present)
    147144
    148145<li>Document dump3d
  • doc/manual.sgml

    r2f0b258 ra72ed95  
    581581</Sect3>
    582582
    583 <Sect3><Title>Configuring the Printer Drivers</Title>
    584 
    585 <Para>
    586 Printing is now built into aven.
    587 The print.ini configuration file still exists, but is only
    588 useful if you want to configure the colours used if you
    589 have a colour printer.
    590 </Para>
    591 
    592 <refentry id="print.ini">
    593 &man.print.ini;
    594 </refentry>
    595 
    596 </Sect3>
    597 
    598583</Sect2>
    599584
  • doc/survex.7.in

    r2f0b258 ra72ed95  
    44.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
    55.\" other parameters are allowed: see man(7), man(1)
    6 .TH SURVEX 7 "2012-01-03" "@PRETTYPACKAGE@ @VERSION@"
     6.TH SURVEX 7 "2015-03-06" "@PRETTYPACKAGE@ @VERSION@"
    77.\" Please adjust this date whenever revising the manpage.
    88.\"
     
    5050\fBdiffpos\fP\fB(1)\fP,
    5151\fBextend\fP\fB(1)\fP,
    52 \fBsorterr\fP\fB(1)\fP,
    53 \fBprint.ini\fP\fB(5)\fP.
     52\fBsorterr\fP\fB(1)\fP.
    5453.SH AUTHOR
    5554This manual page was written by Wookey <wookey@survex.com> and
  • doc/survex.ent

    r2f0b258 ra72ed95  
    2525<!entity man.sorterr SYSTEM "sorterr.sgml">
    2626<!entity man.svxedit SYSTEM "svxedit.sgml">
    27 <!entity man.print.ini SYSTEM "print.ini.sgml">
  • lib/Makefile.am

    r2f0b258 ra72ed95  
    3232MAINTAINERCLEANFILES = $(msg_files) unifont.pixelfont preload_font.h
    3333
    34 dist_pkgdata_DATA = print.ini bcra3.svx bcra5.svx $(msg_files) unifont.pixelfont
     34dist_pkgdata_DATA = bcra3.svx bcra5.svx $(msg_files) unifont.pixelfont
    3535
    3636appsdir = $(datadir)/applications
  • lib/bg.po

    r2f0b258 ra72ed95  
    29152915msgstr ""
    29162916
    2917 #: ../src/avenprcore.cc:125
    2918 #: n:82
    2919 #, c-format
    2920 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2921 msgstr ""
    2922 
    2923 #: ../src/avenprcore.cc:120
    2924 #: n:85
    2925 #, c-format
    2926 msgid "Parameter “%s” missing in printer configuration file"
    2927 msgstr ""
    2928 
    29292917#. TRANSLATORS: --help output for dump3d --rewind option
    29302918#: ../src/dump3d.c:51
  • lib/ca.po

    r2f0b258 ra72ed95  
    29142914msgstr "ROOT ja no s’utilitza"
    29152915
    2916 #: ../src/avenprcore.cc:125
    2917 #: n:82
    2918 #, c-format
    2919 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2920 msgstr "Paràmetres “%s” tenen un valor incorrecte “%s” al fitxer de configuració de l’impresora"
    2921 
    2922 #: ../src/avenprcore.cc:120
    2923 #: n:85
    2924 #, c-format
    2925 msgid "Parameter “%s” missing in printer configuration file"
    2926 msgstr "Paràmetres “%s” manquen al fitxer de configuració de l’impresora"
    2927 
    29282916#. TRANSLATORS: --help output for dump3d --rewind option
    29292917#: ../src/dump3d.c:51
  • lib/de.po

    r2f0b258 ra72ed95  
    29132913msgstr "ROOT ist veraltet"
    29142914
    2915 #: ../src/avenprcore.cc:125
    2916 #: n:82
    2917 #, c-format
    2918 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2919 msgstr "Parameter »%s« hat den ungültigen Wert »%s« in der Druckerkonfigurationsdatei"
    2920 
    2921 #: ../src/avenprcore.cc:120
    2922 #: n:85
    2923 #, c-format
    2924 msgid "Parameter “%s” missing in printer configuration file"
    2925 msgstr "Parameter »%s« fehlt in der Druckerkonfigurationsdatei"
    2926 
    29272915#. TRANSLATORS: --help output for dump3d --rewind option
    29282916#: ../src/dump3d.c:51
  • lib/de_CH.po

    r2f0b258 ra72ed95  
    29132913msgstr "ROOT ist veraltet"
    29142914
    2915 #: ../src/avenprcore.cc:125
    2916 #: n:82
    2917 #, c-format
    2918 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2919 msgstr "Parameter «%s» hat den ungültigen Wert «%s» in der Druckerkonfigurationsdatei"
    2920 
    2921 #: ../src/avenprcore.cc:120
    2922 #: n:85
    2923 #, c-format
    2924 msgid "Parameter “%s” missing in printer configuration file"
    2925 msgstr "Parameter «%s» fehlt in der Druckerkonfigurationsdatei"
    2926 
    29272915#. TRANSLATORS: --help output for dump3d --rewind option
    29282916#: ../src/dump3d.c:51
  • lib/deadmessages.txt

    r2f0b258 ra72ed95  
    866866sk "Hotovo."
    867867zh_CN "完成。"
     868
     869msgid ""Parameter “%s” has invalid value “%s” in printer configuration file""
     870ca "Paràmetres “%s” tenen un valor incorrecte “%s” al fitxer de configuració de l’impresora"
     871de "Parameter »%s« hat den ungültigen Wert »%s« in der Druckerkonfigurationsdatei"
     872de_CH "Parameter «%s» hat den ungültigen Wert «%s» in der Druckerkonfigurationsdatei"
     873en_US "Parameter “%s” has invalid value “%s” in printer configuration file"
     874es "Parámetros “%s” tienen un valor incorrecto “%s” en el archivo de configuración de la impresora"
     875fr "Le paramètre “%s” a une valeur incorrecte “%s” dans le fichier de configuration de l’imprimante"
     876id "Parameter “%s” nilai tidak valid “%s” dalam berkas konfigurasi printer"
     877it "Parametro “%s” ha un valore “%s” non valido nel file di configurazione della stampante"
     878pt "Parâmetro “%s” tem valor inválido “%s” em arquivo de configuração de impressora"
     879pt_BR "Parâmetro “%s” tem valor inválido “%s” em arquivo de configuração de impressora"
     880ro "Parametrul “%s” are valoarea incorecta “%s” in fişierul de configurare a imprimantei"
     881ru "Параметр “%s” имеет недопустимое значение “%s” в файле конфигурации принтера"
     882sk "Parameter “%s” v konfiguračnom súbore tlačiarne má nesprávnu hodnotu “%s”"
     883
     884msgid ""Parameter “%s” missing in printer configuration file""
     885ca "Paràmetres “%s” manquen al fitxer de configuració de l’impresora"
     886de "Parameter »%s« fehlt in der Druckerkonfigurationsdatei"
     887de_CH "Parameter «%s» fehlt in der Druckerkonfigurationsdatei"
     888en_US "Parameter “%s” missing in printer configuration file"
     889es "Parámetros “%s” faltan en el archivo de configuración de la impresora"
     890fr "Paramètres “%s” manquant dans le fichier de configuration de l’imprimante"
     891hu "“%s” paraméter hiányzik a nyomtató beállítási fáljból"
     892id "Parameter “%s” hilang dalam berkas konfigurasi printer"
     893it "Il parametro “%s” manca nel file di configurazione della stampante"
     894pt "Falta parâmetro “%s” em arquivo de configuração de impressora"
     895pt_BR "Falta parâmetro “%s” em arquivo de configuração de impressora"
     896ro "Parametrul “%s” lipseste din fişierul de configurare a imprimantei"
     897ru "Параметр “%s” отсутствует в файле конфигурации принтера"
     898sk "Parameter “%s” v konfiguračnom súbore tlačiarne chýba"
  • lib/el.po

    r2f0b258 ra72ed95  
    29092909msgstr ""
    29102910
    2911 #: ../src/avenprcore.cc:125
    2912 #: n:82
    2913 #, c-format
    2914 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2915 msgstr ""
    2916 
    2917 #: ../src/avenprcore.cc:120
    2918 #: n:85
    2919 #, c-format
    2920 msgid "Parameter “%s” missing in printer configuration file"
    2921 msgstr ""
    2922 
    29232911#. TRANSLATORS: --help output for dump3d --rewind option
    29242912#: ../src/dump3d.c:51
  • lib/en_US.po

    r2f0b258 ra72ed95  
    29092909msgstr "ROOT is deprecated"
    29102910
    2911 #: ../src/avenprcore.cc:125
    2912 #: n:82
    2913 #, c-format
    2914 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2915 msgstr "Parameter “%s” has invalid value “%s” in printer configuration file"
    2916 
    2917 #: ../src/avenprcore.cc:120
    2918 #: n:85
    2919 #, c-format
    2920 msgid "Parameter “%s” missing in printer configuration file"
    2921 msgstr "Parameter “%s” missing in printer configuration file"
    2922 
    29232911#. TRANSLATORS: --help output for dump3d --rewind option
    29242912#: ../src/dump3d.c:51
  • lib/es.po

    r2f0b258 ra72ed95  
    29142914msgstr "ROOT ya no se usa"
    29152915
    2916 #: ../src/avenprcore.cc:125
    2917 #: n:82
    2918 #, c-format
    2919 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2920 msgstr "Parámetros “%s” tienen un valor incorrecto “%s” en el archivo de configuración de la impresora"
    2921 
    2922 #: ../src/avenprcore.cc:120
    2923 #: n:85
    2924 #, c-format
    2925 msgid "Parameter “%s” missing in printer configuration file"
    2926 msgstr "Parámetros “%s” faltan en el archivo de configuración de la impresora"
    2927 
    29282916#. TRANSLATORS: --help output for dump3d --rewind option
    29292917#: ../src/dump3d.c:51
  • lib/fr.po

    r2f0b258 ra72ed95  
    29132913msgstr "ROOT n’est plus utilisé"
    29142914
    2915 #: ../src/avenprcore.cc:125
    2916 #: n:82
    2917 #, c-format
    2918 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2919 msgstr "Le paramètre “%s” a une valeur incorrecte “%s” dans le fichier de configuration de l’imprimante"
    2920 
    2921 #: ../src/avenprcore.cc:120
    2922 #: n:85
    2923 #, c-format
    2924 msgid "Parameter “%s” missing in printer configuration file"
    2925 msgstr "Paramètres “%s” manquant dans le fichier de configuration de l’imprimante"
    2926 
    29272915#. TRANSLATORS: --help output for dump3d --rewind option
    29282916#: ../src/dump3d.c:51
  • lib/hu.po

    r2f0b258 ra72ed95  
    29112911msgstr ""
    29122912
    2913 #: ../src/avenprcore.cc:125
    2914 #: n:82
    2915 #, c-format
    2916 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2917 msgstr ""
    2918 
    2919 #: ../src/avenprcore.cc:120
    2920 #: n:85
    2921 #, c-format
    2922 msgid "Parameter “%s” missing in printer configuration file"
    2923 msgstr "“%s” paraméter hiányzik a nyomtató beállítási fáljból"
    2924 
    29252913#. TRANSLATORS: --help output for dump3d --rewind option
    29262914#: ../src/dump3d.c:51
  • lib/id.po

    r2f0b258 ra72ed95  
    29112911msgstr "ROOT sudah ditinggalkan"
    29122912
    2913 #: ../src/avenprcore.cc:125
    2914 #: n:82
    2915 #, c-format
    2916 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2917 msgstr "Parameter “%s” nilai tidak valid “%s” dalam berkas konfigurasi printer"
    2918 
    2919 #: ../src/avenprcore.cc:120
    2920 #: n:85
    2921 #, c-format
    2922 msgid "Parameter “%s” missing in printer configuration file"
    2923 msgstr "Parameter “%s” hilang dalam berkas konfigurasi printer"
    2924 
    29252913#. TRANSLATORS: --help output for dump3d --rewind option
    29262914#: ../src/dump3d.c:51
  • lib/it.po

    r2f0b258 ra72ed95  
    29132913msgstr "ROOT é sconsigliato"
    29142914
    2915 #: ../src/avenprcore.cc:125
    2916 #: n:82
    2917 #, c-format
    2918 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2919 msgstr "Parametro “%s” ha un valore “%s” non valido nel file di configurazione della stampante"
    2920 
    2921 #: ../src/avenprcore.cc:120
    2922 #: n:85
    2923 #, c-format
    2924 msgid "Parameter “%s” missing in printer configuration file"
    2925 msgstr "Il parametro “%s” manca nel file di configurazione della stampante"
    2926 
    29272915#. TRANSLATORS: --help output for dump3d --rewind option
    29282916#: ../src/dump3d.c:51
  • lib/pl.po

    r2f0b258 ra72ed95  
    29102910msgstr ""
    29112911
    2912 #: ../src/avenprcore.cc:125
    2913 #: n:82
    2914 #, c-format
    2915 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2916 msgstr ""
    2917 
    2918 #: ../src/avenprcore.cc:120
    2919 #: n:85
    2920 #, c-format
    2921 msgid "Parameter “%s” missing in printer configuration file"
    2922 msgstr ""
    2923 
    29242912#. TRANSLATORS: --help output for dump3d --rewind option
    29252913#: ../src/dump3d.c:51
  • lib/pt.po

    r2f0b258 ra72ed95  
    29162916msgstr "ROOT descontinuado"
    29172917
    2918 #: ../src/avenprcore.cc:125
    2919 #: n:82
    2920 #, c-format
    2921 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2922 msgstr "Parâmetro “%s” tem valor inválido “%s” em arquivo de configuração de impressora"
    2923 
    2924 #: ../src/avenprcore.cc:120
    2925 #: n:85
    2926 #, c-format
    2927 msgid "Parameter “%s” missing in printer configuration file"
    2928 msgstr "Falta parâmetro “%s” em arquivo de configuração de impressora"
    2929 
    29302918#. TRANSLATORS: --help output for dump3d --rewind option
    29312919#: ../src/dump3d.c:51
  • lib/pt_BR.po

    r2f0b258 ra72ed95  
    29182918msgstr "ROOT descontinuado"
    29192919
    2920 #: ../src/avenprcore.cc:125
    2921 #: n:82
    2922 #, c-format
    2923 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2924 msgstr "Parâmetro “%s” tem valor inválido “%s” em arquivo de configuração de impressora"
    2925 
    2926 #: ../src/avenprcore.cc:120
    2927 #: n:85
    2928 #, c-format
    2929 msgid "Parameter “%s” missing in printer configuration file"
    2930 msgstr "Falta parâmetro “%s” em arquivo de configuração de impressora"
    2931 
    29322920#. TRANSLATORS: --help output for dump3d --rewind option
    29332921#: ../src/dump3d.c:51
  • lib/ro.po

    r2f0b258 ra72ed95  
    29152915msgstr "ROOT nu se recomanda"
    29162916
    2917 #: ../src/avenprcore.cc:125
    2918 #: n:82
    2919 #, c-format
    2920 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2921 msgstr "Parametrul “%s” are valoarea incorecta “%s” in fişierul de configurare a imprimantei"
    2922 
    2923 #: ../src/avenprcore.cc:120
    2924 #: n:85
    2925 #, c-format
    2926 msgid "Parameter “%s” missing in printer configuration file"
    2927 msgstr "Parametrul “%s” lipseste din fişierul de configurare a imprimantei"
    2928 
    29292917#. TRANSLATORS: --help output for dump3d --rewind option
    29302918#: ../src/dump3d.c:51
  • lib/ru.po

    r2f0b258 ra72ed95  
    29102910msgstr ""
    29112911
    2912 #: ../src/avenprcore.cc:125
    2913 #: n:82
    2914 #, c-format
    2915 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2916 msgstr "Параметр “%s” имеет недопустимое значение “%s” в файле конфигурации принтера"
    2917 
    2918 #: ../src/avenprcore.cc:120
    2919 #: n:85
    2920 #, c-format
    2921 msgid "Parameter “%s” missing in printer configuration file"
    2922 msgstr "Параметр “%s” отсутствует в файле конфигурации принтера"
    2923 
    29242912#. TRANSLATORS: --help output for dump3d --rewind option
    29252913#: ../src/dump3d.c:51
  • lib/sk.po

    r2f0b258 ra72ed95  
    29152915msgstr "ROOT bol zamietnutý"
    29162916
    2917 #: ../src/avenprcore.cc:125
    2918 #: n:82
    2919 #, c-format
    2920 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2921 msgstr "Parameter “%s” v konfiguračnom súbore tlačiarne má nesprávnu hodnotu “%s”"
    2922 
    2923 #: ../src/avenprcore.cc:120
    2924 #: n:85
    2925 #, c-format
    2926 msgid "Parameter “%s” missing in printer configuration file"
    2927 msgstr "Parameter “%s” v konfiguračnom súbore tlačiarne chýba"
    2928 
    29292917#. TRANSLATORS: --help output for dump3d --rewind option
    29302918#: ../src/dump3d.c:51
  • lib/survex.pot

    r2f0b258 ra72ed95  
    29112911msgstr ""
    29122912
    2913 #: ../src/avenprcore.cc:125
    2914 #: n:82
    2915 #, c-format
    2916 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2917 msgstr ""
    2918 
    2919 #: ../src/avenprcore.cc:120
    2920 #: n:85
    2921 #, c-format
    2922 msgid "Parameter “%s” missing in printer configuration file"
    2923 msgstr ""
    2924 
    29252913#. TRANSLATORS: --help output for dump3d --rewind option
    29262914#: ../src/dump3d.c:51
  • lib/zh_CN.po

    r2f0b258 ra72ed95  
    29092909msgstr ""
    29102910
    2911 #: ../src/avenprcore.cc:125
    2912 #: n:82
    2913 #, c-format
    2914 msgid "Parameter “%s” has invalid value “%s” in printer configuration file"
    2915 msgstr ""
    2916 
    2917 #: ../src/avenprcore.cc:120
    2918 #: n:85
    2919 #, c-format
    2920 msgid "Parameter “%s” missing in printer configuration file"
    2921 msgstr ""
    2922 
    29232911#. TRANSLATORS: --help output for dump3d --rewind option
    29242912#: ../src/dump3d.c:51
  • src/Makefile.am

    r2f0b258 ra72ed95  
    22
    33noinst_HEADERS = cavern.h commands.h cmdline.h date.h datain.h debug.h\
    4  filelist.h filename.h getopt.h hash.h img.c img.h img_hosted.h ini.h kml.h\
     4 filelist.h filename.h getopt.h hash.h img.c img.h img_hosted.h kml.h\
    55 labelinfo.h listpos.h matrix.h message.h namecmp.h namecompare.h netartic.h\
    66 netbits.h netskel.h network.h osalloc.h\
     
    4646 rotatemask.xbm rotate.xbm vrotatemask.xbm vrotate.xbm \
    4747 rotatezoom.xbm rotatezoommask.xbm \
    48  avenprcore.cc printwx.cc ini.c hash.c \
     48 avenprcore.cc printwx.cc hash.c \
    4949 buttontaghandler.cc
    5050
  • src/avenprcore.cc

    r2f0b258 ra72ed95  
    11/* avenprcore.cc
    22 * Printer independent parts of Survex printer drivers
    3  * Copyright (C) 1993-2002,2004,2005,2006,2010,2011,2012,2013,2014 Olly Betts
     3 * Copyright (C) 1993-2002,2004,2005,2006,2010,2011,2012,2013,2014,2015 Olly Betts
    44 * Copyright (C) 2004 Philip Underwood
    55 *
     
    1919 */
    2020
    21 /* FIXME provide more explanation when reporting errors in print.ini */
    22 
    2321#ifdef HAVE_CONFIG_H
    2422# include <config.h>
     
    114112
    115113    pages = pagesX * pagesY;
    116 }
    117 
    118 static void setting_missing(const char *v)
    119 {
    120    fatalerror(/*Parameter “%s” missing in printer configuration file*/85, v);
    121 }
    122 
    123 static void setting_bad_value(const char *v, const char *p)
    124 {
    125    fatalerror(/*Parameter “%s” has invalid value “%s” in printer configuration file*/82,
    126               v, p);
    127 }
    128 
    129 int
    130 as_int(const char *v, char *p, int min_val, int max_val)
    131 {
    132    long val;
    133    char *pEnd;
    134    if (!p) setting_missing(v);
    135    val = strtol(p, &pEnd, 10);
    136    if (pEnd == p || val < (long)min_val || val > (long)max_val)
    137       setting_bad_value(v, p);
    138    osfree(p);
    139    return (int)val;
    140 }
    141 
    142 /* Converts '0'-'9' to 0-9, 'A'-'F' to 10-15 and 'a'-'f' to 10-15.
    143  * Undefined on other values */
    144 #define CHAR2HEX(C) (((C)+((C)>64?9:0))&15)
    145 
    146 unsigned long
    147 as_colour(const char *v, char *p)
    148 {
    149    unsigned long val = 0xffffffff;
    150    if (!p) setting_missing(v);
    151    switch (tolower(*p)) {
    152       case '#': {
    153          char *q = p + 1;
    154          while (isxdigit((unsigned char)*q)) q++;
    155          if (q - p == 4) {
    156             val = CHAR2HEX(p[1]) * 0x110000;
    157             val |= CHAR2HEX(p[2]) * 0x1100;
    158             val |= CHAR2HEX(p[3]) * 0x11;
    159          } else if (q - p == 7) {
    160             val = ((CHAR2HEX(p[1]) << 4) | CHAR2HEX(p[2])) << 16;
    161             val |= ((CHAR2HEX(p[3]) << 4) | CHAR2HEX(p[4])) << 8;
    162             val |= (CHAR2HEX(p[5]) << 4) | CHAR2HEX(p[6]);
    163          }
    164          break;
    165       }
    166       case 'a':
    167          if (strcasecmp(p, "aqua") == 0) val = 0x00fffful;
    168          break;
    169       case 'b':
    170          if (strcasecmp(p, "black") == 0) val = 0x000000ul;
    171          else if (strcasecmp(p, "blue") == 0) val = 0x0000fful;
    172          break;
    173       case 'f':
    174          if (strcasecmp(p, "fuchsia") == 0) val = 0xff00fful;
    175          break;
    176       case 'g':
    177          if (strcasecmp(p, "gray") == 0) val = 0x808080ul;
    178          else if (strcasecmp(p, "green") == 0) val = 0x008000ul;
    179          break;
    180       case 'l':
    181          if (strcasecmp(p, "lime") == 0) val = 0x00ff00ul;
    182          break;
    183       case 'm':
    184          if (strcasecmp(p, "maroon") == 0) val = 0x800000ul;
    185          break;
    186       case 'n':
    187          if (strcasecmp(p, "navy") == 0) val = 0x000080ul;
    188          break;
    189       case 'o':
    190          if (strcasecmp(p, "olive") == 0) val = 0x808000ul;
    191          break;
    192       case 'p':
    193          if (strcasecmp(p, "purple") == 0) val = 0x800080ul;
    194          break;
    195       case 'r':
    196          if (strcasecmp(p, "red") == 0) val = 0xff0000ul;
    197          break;
    198       case 's':
    199          if (strcasecmp(p, "silver") == 0) val = 0xc0c0c0ul;
    200          break;
    201       case 't':
    202          if (strcasecmp(p, "teal") == 0) val = 0x008080ul;
    203          break;
    204       case 'w':
    205          if (strcasecmp(p, "white") == 0) val = 0xfffffful;
    206          break;
    207       case 'y':
    208          if (strcasecmp(p, "yellow") == 0) val = 0xffff00ul;
    209          break;
    210    }
    211    if (val == 0xffffffff) setting_bad_value(v, p);
    212    osfree(p);
    213    return val;
    214114}
    215115
  • src/avenprcore.h

    r2f0b258 ra72ed95  
    8484void drawticks(border clip, int tick_size, int x, int y);
    8585
    86 int as_int(const char *v, char *p, int min_val, int max_val);
    87 unsigned long as_colour(const char *v, char *p);
    88 
    8986#if 0
    9087class MainFrm;
  • src/printwx.cc

    r2f0b258 ra72ed95  
    4646#include "filelist.h"
    4747#include "filename.h"
    48 #include "ini.h"
    4948#include "message.h"
    5049#include "useful.h"
     
    210209    void PlotLR(const vector<XSect> & centreline);
    211210    void PlotUD(const vector<XSect> & centreline);
    212     char * Init(FILE **fh_list, bool fCalibrate);
     211    void Init();
    213212  public:
    214213    svxPrintout(MainFrm *mainfrm, layout *l, wxPageSetupDialogData *data, const wxString & title);
     
    15361535void
    15371536svxPrintout::OnBeginPrinting() {
    1538     FILE *fh_list[4];
    1539 
    1540     FILE **pfh = fh_list;
    1541     FILE *fh;
    1542     const char *pth_cfg;
    1543     char *print_ini;
    1544 
    1545     /* ini files searched in this order:
    1546      * ~/.survex/print.ini [unix only]
    1547      * /etc/survex/print.ini [unix only]
    1548      * <support file directory>/myprint.ini [not unix]
    1549      * <support file directory>/print.ini [must exist]
    1550      */
    1551 
    1552 #ifdef __UNIX__
    1553     pth_cfg = getenv("HOME");
    1554     if (pth_cfg) {
    1555         fh = fopenWithPthAndExt(pth_cfg, ".survex/print."EXT_INI, NULL,
    1556                 "rb", NULL);
    1557         if (fh) *pfh++ = fh;
    1558     }
    1559     pth_cfg = msg_cfgpth();
    1560     fh = fopenWithPthAndExt(NULL, "/etc/survex/print."EXT_INI, NULL, "rb",
    1561             NULL);
    1562     if (fh) *pfh++ = fh;
    1563 #else
    1564     pth_cfg = msg_cfgpth();
    1565     print_ini = add_ext("myprint", EXT_INI);
    1566     fh = fopenWithPthAndExt(pth_cfg, print_ini, NULL, "rb", NULL);
    1567     if (fh) *pfh++ = fh;
    1568 #endif
    1569     print_ini = add_ext("print", EXT_INI);
    1570     fh = fopenWithPthAndExt(pth_cfg, print_ini, NULL, "rb", NULL);
    1571     if (!fh) fatalerror(/*Couldn’t open file “%s”*/24, print_ini);
    1572     *pfh++ = fh;
    1573     *pfh = NULL;
    1574     Init(pfh, false);
    1575     for (pfh = fh_list; *pfh; pfh++) (void)fclose(*pfh);
     1537    Init();
    15761538    Pre();
    15771539    m_layout->footer = wmsg(/*Survey “%s”   Page %d (of %d)   Processed on %s*/167);
     
    19841946}
    19851947
    1986 static wxColour
    1987 to_rgb(const char *var, char *val)
    1988 {
    1989    unsigned long rgb;
    1990    if (!val) return *wxBLACK;
    1991    rgb = as_colour(var, val);
    1992    return wxColour((rgb & 0xff0000) >> 16, (rgb & 0xff00) >> 8, rgb & 0xff);
    1993 }
    1994 
    19951948/* Initialise printer routines */
    1996 char *
    1997 svxPrintout::Init(FILE **fh_list, bool fCalibrate)
    1998 {
    1999    static const char *vars[] = {
    2000       "font_size_labels",
    2001       "colour_text",
    2002       "colour_labels",
    2003       "colour_frame",
    2004       "colour_legs",
    2005       "colour_crosses",
    2006       "colour_surface_legs",
    2007       NULL
    2008    };
    2009    char **vals;
    2010 
    2011    (void)fCalibrate; /* suppress unused argument warning */
    2012 
    2013    vals = ini_read(fh_list, "aven", vars);
     1949void
     1950svxPrintout::Init()
     1951{
    20141952   fontsize_labels = 10;
    2015    if (vals[0]) fontsize_labels = as_int(vars[0], vals[0], 1, INT_MAX);
    20161953   fontsize = 10;
    20171954
    20181955   colour_text = colour_labels = colour_frame = colour_leg = colour_cross = colour_surface_leg = *wxBLACK;
    2019    if (vals[1]) colour_text = to_rgb(vars[1], vals[1]);
    2020    if (vals[2]) colour_labels = to_rgb(vars[2], vals[2]);
    2021    if (vals[3]) colour_frame = to_rgb(vars[3], vals[3]);
    2022    if (vals[4]) colour_leg = to_rgb(vars[4], vals[4]);
    2023    if (vals[5]) colour_cross = to_rgb(vars[5], vals[5]);
    2024    if (vals[6]) colour_surface_leg = to_rgb(vars[6], vals[6]);
    20251956   m_layout->scX = 1;
    20261957   m_layout->scY = 1;
    2027    return NULL;
    2028 }
     1958}
Note: See TracChangeset for help on using the changeset viewer.