Commit d33baebc authored by Didier Raboud's avatar Didier Raboud

Imported Upstream version 3.0.2-20060712

parent 0364fddc
File mode changed from 100755 to 100644
/COPYING/3.1/Tue Jan 28 23:01:10 2003//Tfoomatic-3_0-branch
/ChangeLog/3.99.2.48/Tue May 23 22:46:40 2006//Tfoomatic-3_0-branch
/Foomatic-Devel-Ideas.txt/3.2/Tue Apr 22 23:19:52 2003//Tfoomatic-3_0-branch
/Makefile.in/3.16.2.4/Wed Apr 19 23:48:43 2006//Tfoomatic-3_0-branch
/README/3.26.2.8/Wed Apr 19 23:48:43 2006//Tfoomatic-3_0-branch
/README.build-foomatic-filters-ppds/3.3.2.1/Sun Mar 28 23:04:51 2004//Tfoomatic-3_0-branch
/TODO/3.1/Fri Nov 29 01:31:37 2002//Tfoomatic-3_0-branch
/USAGE/3.14.2.5/Wed Apr 19 23:48:43 2006//Tfoomatic-3_0-branch
/acinclude.m4/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/configure.ac/1.1.2.3/Mon May 22 13:56:26 2006//Tfoomatic-3_0-branch
/extract_pjl/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/foomatic-addpjloptions.8.in/3.2/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/foomatic-addpjloptions.in/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/foomatic-cleanupdrivers.in/3.0.2.4/Tue Jan 17 15:37:27 2006//Tfoomatic-3_0-branch
/foomatic-combo-xml.1.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/foomatic-combo-xml.c/3.3.2.2/Tue Aug 23 21:50:09 2005//Tfoomatic-3_0-branch
/foomatic-compiledb.1.in/3.1/Thu Nov 28 02:42:26 2002//Tfoomatic-3_0-branch
/foomatic-compiledb.in/3.6.2.2/Sun Oct 23 01:03:45 2005//Tfoomatic-3_0-branch
/foomatic-configure.1.in/3.1/Thu Nov 28 02:42:26 2002//Tfoomatic-3_0-branch
/foomatic-configure.in/3.18.2.11/Sat Apr 22 18:40:43 2006//Tfoomatic-3_0-branch
/foomatic-filters-ppds-README/3.1/Sun Feb 23 07:14:18 2003//Tfoomatic-3_0-branch
/foomatic-filters-ppds-install/3.1/Sun Feb 23 07:14:18 2003//Tfoomatic-3_0-branch
/foomatic-fix-xml.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/foomatic-getpjloptions.8.in/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/foomatic-getpjloptions.in/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/foomatic-kitload.8.in/3.0.2.1/Sun Mar 28 23:04:51 2004//Tfoomatic-3_0-branch
/foomatic-kitload.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/foomatic-nonumericalids.in/3.1/Thu Mar 27 21:01:58 2003//Tfoomatic-3_0-branch
/foomatic-perl-data.1.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/foomatic-perl-data.c/3.14.2.4/Sun Oct 23 00:43:39 2005//Tfoomatic-3_0-branch
/foomatic-ppd-options.1.in/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/foomatic-ppd-options.in/3.2/Wed Nov 19 03:41:29 2003//Tfoomatic-3_0-branch
/foomatic-ppdfile.1.in/3.2/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/foomatic-ppdfile.in/3.4.2.7/Mon May 22 11:49:27 2006//Tfoomatic-3_0-branch
/foomatic-preferred-driver.8.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/foomatic-preferred-driver.in/3.3.2.1/Sun Mar 28 23:04:51 2004//Tfoomatic-3_0-branch
/foomatic-printermap-to-gimp-print-xml.in/1.1.2.2/Sun Mar 28 23:04:51 2004//Tfoomatic-3_0-branch
/foomatic-printjob.1.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/foomatic-printjob.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/foomatic-replaceoldprinterids.in/3.2/Fri Apr 25 23:49:37 2003//Tfoomatic-3_0-branch
/gsPrint/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/gsQuit/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/gsTest/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
/install-sh/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/makeDefaults.in/3.3.2.2/Wed Apr 19 23:48:43 2006//Tfoomatic-3_0-branch
/makeMan.in/3.1/Thu Jun 26 13:28:24 2003//Tfoomatic-3_0-branch
/make_configure/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/mkinstalldirs/3.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
D/debian////
D/foomatic-templates////
D/lib////
foomatic-db-engine
/var/lib/cvs
Tfoomatic-3_0-branch
2006-07-11 Till Kamppeter <till.kamppeter@gmx.net>
* lib/Foomatic/DB.pm: Fixed bug in the decoding of UI strings in
the PPDs, only hex-encoded characters were decoded correctly
(Thanks to Florian Festi from Red Hat for this patch).
2006-07-10 Till Kamppeter <till.kamppeter@gmx.net>
* foomatic-extract-text.in: Generate .po files from the UI strings
in the currently installed Foomatic database (Thanks to Florian
Festi from Red Hat for this script).
* lib/Foomatic/DB.pm: When reading PPD files extract the UI strings
always in UTF-8, taking into account the encoding of the PPD file
(Thanks to Florian Festi from Red Hat for this patch).
* *: Way to many files were marked executable. Fixed.
2006-06-27 Till Kamppeter <till.kamppeter@gmx.net>
* lib/Foomatic/DB.pm: get_javascript2() can now also build the
script based on pre-read printer data. This avoids duplicate
reading of the Foomatic database and allows adding of extra
printers which are not in the Foomatic XML database (for example
new user-supplied entries).
2006-05-23 Till Kamppeter <till.kamppeter@gmx.net>
* lib/Foomatic/DB.pm: Eliminated a warning.
......
File mode changed from 100755 to 100644
# Makefile to install foomatic-db-engine
# $Revision: 3.16.2.4 $
# $Revision$
# PREFIX defaults to /usr/local for manually installed progs, so that they
# are not messed up on a system upgrade.
......@@ -148,7 +148,8 @@ AC_OUTPUT_FILES:=Makefile makeDefaults makeMan \
foomatic-cleanupdrivers foomatic-getpjloptions \
foomatic-addpjloptions foomatic-compiledb foomatic-fix-xml \
foomatic-nonumericalids foomatic-replaceoldprinterids \
foomatic-ppd-options foomatic-printermap-to-gimp-print-xml
foomatic-ppd-options foomatic-printermap-to-gimp-print-xml \
foomatic-extract-text
# User programs and helper programs
BINFILES:=foomatic-printjob foomatic-configure \
......@@ -162,7 +163,7 @@ SBINFILES:=foomatic-kitload \
foomatic-preferred-driver foomatic-fix-xml \
foomatic-nonumericalids foomatic-replaceoldprinterids \
foomatic-printermap-to-gimp-print-xml \
foomatic-cleanupdrivers
foomatic-cleanupdrivers foomatic-extract-text
# Foomatic XML templates
TEMPLATES:=pjl_enum_choice.xml pjl_enum_option.xml pjl_num_option.xml
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
TODO 100755 → 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
dnl aclocal.m4 generated automatically by aclocal 1.4-p4
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
dnl AC_PATH_DIR(VARIABLE, DIR-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AC_PATH_DIR,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word/])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
?:/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a dos path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
ac_dummy="ifelse([$4], , $PATH, [$4])"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -d $ac_dir/$ac_word; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
done
IFS="$ac_save_ifs"
dnl If no 3rd arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$3], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])
dnl AC_PATH_DIRS(VARIABLE, DIRSS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
dnl [, PATH]])
AC_DEFUN(AC_PATH_DIRS,
[for ac_dir in $2
do
AC_PATH_DIR($1, [$]ac_dir, , $4)
test -n "[$]$1" && break
done
ifelse([$3], , , [test -n "[$]$1" || $1="$3"
])])
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_include([acinclude.m4])
This diff is collapsed.
......@@ -298,6 +298,7 @@ foomatic-getpjloptions foomatic-addpjloptions
foomatic-compiledb foomatic-fix-xml
foomatic-nonumericalids foomatic-replaceoldprinterids
foomatic-ppd-options foomatic-printermap-to-gimp-print-xml
foomatic-extract-text
)
dnl Finished
......
/README.Debian/1.1.2.1/Sat Dec 4 18:15:35 2004//Tfoomatic-3_0-branch
/TODO/3.0.2.1/Sat Dec 4 18:14:26 2004//Tfoomatic-3_0-branch
/changelog/3.0.2.1/Sat Dec 4 18:14:26 2004//Tfoomatic-3_0-branch
/compat/1.1.2.1/Sat Dec 4 18:15:35 2004//Tfoomatic-3_0-branch
/control/3.0.2.1/Sat Dec 4 18:14:26 2004//Tfoomatic-3_0-branch
/copyright/3.0.2.1/Sat Dec 4 18:14:26 2004//Tfoomatic-3_0-branch
/dirs/1.1.2.1/Sat Dec 4 18:15:35 2004//Tfoomatic-3_0-branch
/docs/1.1.2.1/Sat Dec 4 18:15:35 2004//Tfoomatic-3_0-branch
/foomatic-bin.README.Debian/1.1.2.1/Sat Dec 4 18:15:35 2004//Tfoomatic-3_0-branch
/foomatic-bin.dirs/1.1.2.1/Sat Dec 4 18:15:35 2004//Tfoomatic-3_0-branch
/presubj/1.1.2.1/Sat Dec 4 18:15:35 2004//Tfoomatic-3_0-branch
/rules/3.0.2.1/Sat Dec 4 18:14:26 2004//Tfoomatic-3_0-branch
D
foomatic-db-engine/debian
Tfoomatic-3_0-branch
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -1851,5 +1851,5 @@ main(int argc, /* I - Number of command-line arguments */
}
/*
* End of "$Id: foomatic-combo-xml.c,v 3.3.2.2 2005/08/23 21:50:09 till Exp $".
* End of "$Id$".
*/
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
#!@PERL@ -w # -*- perl -*-
use Foomatic::Defaults;
use Foomatic::DB;
use strict;
sub write_po{
my ($out, $messages) = @_;
foreach (sort(keys %$messages)) {
if ($_ eq '') {
next;
}
my $translation = $messages->{$_};
print $out "msgid \"$_\"\nmsgstr \"$translation\"\n\n";
}
}
sub write_message_files {
my ($messages) = @_;
foreach (keys %$messages) {
print "LANGUAGE: $_\n";
open my $out, ">:encoding(utf-8)", "$_.po" or die;
write_po($out, $messages->{$_});
}
}
sub extract_ppd_old{
my $file = $_[0];
my %messages;
if ($file =~ /ppd\.gz$/) {
open(FILE, "zcat $file |") or die "Can't open file: $file";
} else {
open(FILE, $file);
}
while (<FILE>){
if ( /\*(\w+) (\w+)\/([^:]+): \"([^\"]*)\"/ ) {
print $_, "'$1' '$2' '$3' '$4'\n\n"
}
#print
}
close FILE;
}
sub extract_from_db{
my $messages = $_[0];
my $db = Foomatic::DB->new();
my @files = $db->_get_xml_filelist("source/opt");
foreach my $file (@files){
if ( $file =~ /[Mm]odel|^18$|^57$/ ) {
next;
}
my $xml = $db->_get_object_xml("source/opt/$file");
while ($xml =~ /\<[^\<\/]*longname\>.*?\<en\>(.*?)\<\/en\>/sg) {
my $message = Foomatic::DB::unhtmlify($1); # xml unquoting
$messages->{$message} = '';
}
}
}
sub extract_ppd{
my ($db, $messages) = @_;
my $args = $db->{"dat"}{"args_byname"};
for my $option (keys %$args){
$messages->{$args->{$option}{"comment"}} = "";
#foreach (keys %{$args->{$option}}) {
# print $_, "\n";
#}
if ($args->{$option}{"type"} eq "bool"){
$messages->{$args->{$option}{"comment_true"}} = '';
$messages->{$args->{$option}{"comment_false"}} = '';
} elsif ($args->{$option}{"type"} eq "enum") {
for my $val (@{$args->{$option}{"vals"}}){
$messages->{$val->{"comment"}} = '';
}
}
}
return;
# old code:
$a = $db->{"dat"}{"args_byname"}{"MediaType"}{"vals"}[0];
print "$a\n\n";
if (0){
foreach my $val (@$a){
print "$val\n";
}
return;
}
foreach my $name (keys %$a) {
print "$name:\n";
print $a->{$name}, "\n\n";
if ($name != "compiled-at"){
foreach (keys %{$db->{"dat"}{$name}}) {
print $_, "\n";
}
print "\n";
}
}
}
sub get_translated_messages{
my ($ppd_en, $ppd_lang, $translation) = @_;
my $args_en = $ppd_en->{"dat"}{"args_byname"};
my $args_lang = $ppd_lang->{"dat"}{"args_byname"};
for my $option (keys %$args_en){
$translation->{$args_en->{$option}{"comment"}} =
$args_lang->{$option}{"comment"};
if ($args_en->{$option}{"type"} eq "bool"){
$translation->{$args_en->{$option}{"comment_true"}} =
$args_lang->{$option}{"comment_true"};
$translation->{$args_en->{$option}{"comment_false"}} =
$args_lang->{$option}{"comment_false"};
} elsif ($args_en->{$option}{"type"} eq "enum") {
for my $val (@{$args_en->{$option}{"vals"}}){
my $value = $val->{"value"};
for my $val_lang (@{$args_lang->{$option}{"vals"}}){
if ($val_lang->{"value"} eq $value) {
$translation->{$val->{"comment"}} =
$val_lang->{"comment"};
};
}
}
}
}
}
sub extract_ppds{
my ($path, $messages) = @_;
my $ppds = { };
my %language_names = ('English' => 'en',
'French' => 'fr',
'German' => 'de',
'Italian' => 'it',
'Japanese' => 'jp',
'Portugse' => 'pt',
'Portuguese' => 'pt',
'Spanish' => 'es');
# read ppds
open(PPDS, "find $path -name \*.ppd\*|");
while (<PPDS>){
print substr($_, 0, -1), "\n";
my $db = Foomatic::DB->new();
$db->getdatfromppd(substr($_, 0, -1));
my $makemodel = $db->{'dat'}{'makemodel'};
$ppds->{$makemodel} = [] unless exists $ppds->{$makemodel};
push @{$ppds->{$makemodel}}, $db;
}
foreach my $makemodel (keys %$ppds) {
my $en_ppd;
foreach my $ppd (@{$ppds->{$makemodel}}) {
if ($ppd->{'dat'}{'language'} eq 'English') {
$en_ppd = $ppd;
last;
}
}
foreach my $ppd (@{$ppds->{$makemodel}}) {
my $lang = $ppd->{'dat'}{'language'};
if (exists $language_names{$lang}) {
$lang = $language_names{$lang};
}
$messages->{$lang} = {} unless exists $messages->{$lang};
if ($lang ne 'en') {
get_translated_messages($en_ppd, $ppd, $messages->{$lang});
} else {
extract_ppd($ppd, $messages->{$lang});
}
}
}
}
sub main{
my $messages = { };
$messages->{'en'} = { };
extract_from_db($messages->{'en'});
extract_ppds("$libdir/db/source/PPD/", $messages);
write_message_files($messages);
}
main();
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
/pjl_enum_choice.xml/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/pjl_enum_option.xml/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/pjl_num_option.xml/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/pjl_string_option.xml/1.1/Wed Nov 19 03:23:50 2003//Tfoomatic-3_0-branch
D
foomatic-db-engine/foomatic-templates
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
/Makefile.PL/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
D/Foomatic////
foomatic-db-engine/lib
Tfoomatic-3_0-branch
/DB.pm/3.56.2.26/Tue May 23 22:46:40 2006//Tfoomatic-3_0-branch
/PPD.pm/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
/UIElem.pm/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch
D
foomatic-db-engine/lib/Foomatic
Tfoomatic-3_0-branch
package Foomatic::DB;
use Exporter;
use Encode;
@ISA = qw(Exporter);
@EXPORT_OK = qw(normalizename comment_filter
......@@ -15,7 +16,7 @@ use Data::Dumper;
use POSIX; # for rounding integers
use strict;
my $ver = '$Revision: 3.56.2.26 $ ';
my $ver = '$Revision$ ';
# constructor for Foomatic::DB
sub new {
......@@ -637,6 +638,28 @@ sub ppdfromvartoperl ($) {
# the main PPD structure
my @datablob;
$dat->{"encoding"} = "ascii";
# search for LanguageEncoding
for (my $i = 0; $i < @{$ppd}; $i ++) {
$_ = $ppd->[$i];
if (m!^\*LanguageEncoding:\s*(\S+)\s*$!) {
# "*LanguageEncoding: <encoding>"
$dat->{'encoding'} = $1;
if ($dat->{'encoding'} eq 'MacStandard') {
$dat->{'encoding'} = 'MacCentralEurRoman';
} elsif ($dat->{'encoding'} eq 'JIS83-RKSJ') {
$dat->{'encoding'} = 'shiftjis';
}
last;
}
}
# decode PPD
my $encoding = $dat->{"encoding"};
for (my $i = 0; $i < @{$ppd}; $i ++) {
$ppd->[$i] = decode($encoding, $ppd->[$i]);
}
# Parse the PPD file
for (my $i = 0; $i < @{$ppd}; $i ++) {
$_ = $ppd->[$i];
......@@ -675,6 +698,9 @@ sub ppdfromvartoperl ($) {
$dat->{'model'} = $2;
$dat->{'model'} =~ s/\s+Foomatic.*$//i;
}
} elsif (m!^\*LanguageVersion:\s*(\S+)\s*$!) {
# "*LanguageVersion: <language>"
$dat->{'language'} = $1;
} elsif (m!^\*FoomaticIDs:\s*(\S+)\s+(\S+)\s*$!) {
# "*FoomaticIDs: <printer ID> <driver ID>"
my $id = $1;
......@@ -779,7 +805,8 @@ sub ppdfromvartoperl ($) {
$currentgroup .= "/";
}
$currentgroup .= $group;
push(@currentgrouptrans, $grouptrans);
push(@currentgrouptrans,
unhexify($grouptrans, $dat->{"encoding"}));
} elsif (m!^\*Close(Sub|)Group:\s*([^/]+)$!) {
# "*Close[Sub]Group: <group>"
my $group = $2;
......@@ -811,7 +838,8 @@ sub ppdfromvartoperl ($) {
# a hidden option
undef $dat->{'args_byname'}{$argname}{'hidden'};
# Store the values
$dat->{'args_byname'}{$argname}{'comment'} = $translation;
$dat->{'args_byname'}{$argname}{'comment'} =
unhexify($translation, $dat->{"encoding"});
$dat->{'args_byname'}{$argname}{'group'} = $currentgroup;
@{$dat->{'args_byname'}{$argname}{'grouptrans'}} =
@currentgrouptrans;
......@@ -1014,6 +1042,7 @@ sub ppdfromvartoperl ($) {
} else {
$setting = $settingtrans;
}
$translation = unhexify($translation, $dat->{"encoding"});
# Make sure that the argument is in the data structure
checkarg ($dat, $currentargument);
# This option has a non-Foomatic keyword, so this is not
......@@ -1148,12 +1177,13 @@ sub ppdfromvartoperl ($) {
}
$line =~ m!^([^\"]*)\"!;
$code .= $1;
$code = unhexify($code, $dat->{"encoding"});
if ($item eq 'Begin') {
$dat->{'jclbegin'} = unhexify($code);
$dat->{'jclbegin'} = $code;
} elsif ($item eq 'ToPSInterpreter') {
$dat->{'jcltointerpreter'} = unhexify($code);
$dat->{'jcltointerpreter'} = $code;
} elsif ($item eq 'End') {
$dat->{'jclend'} = unhexify($code);
$dat->{'jclend'} = $code;
}
} elsif (m!^\*\% COMDATA \#(.*)$!) {
# If we have an old Foomatic 2.0.x PPD file, collect its Perl
......@@ -1554,29 +1584,31 @@ sub unhtmlify {
sub unhexify {
# Replace hex notation for unprintable characters in PPD files
# by the actual characters ex: "<0A>" --> chr(hex("0A"))
my ($input) = @_;
my ($input, $encoding) = @_;
my $output = "";
my $hexmode = 0;
my $firstdigit = "";
my $hexstring = "";
my $encoded = "";
for (my $i = 0; $i < length($input); $i ++) {
my $c = substr($input, $i, 1);
if ($hexmode) {
if ($c eq ">") {
# End of hex string
$encoded = '';
for (my $i=0; $i < length($hexstring); $i+=2) {
$encoded .= chr(hex(substr($hexstring, $i, 2)));
}
$output .= decode($encoding, $encoded);
$hexmode = 0;
} elsif ($c =~ /^[0-9a-fA-F]$/) {
# Hexadecimal digit, two of them give a character
if ($firstdigit ne "") {
$output .= chr(hex("$firstdigit$c"));
$firstdigit = "";
} else {
$firstdigit = $c;
}
$hexstring .= $c;
}
} else {
if ($c eq "<") {
# Beginning of hex string
$hexmode = 1;
$hexstring = "";
} else {
# Normal character
$output .= $c;
......@@ -4724,19 +4756,34 @@ sub get_printer_from_make_model {
sub get_javascript2 {
my ($this) = @_;
my ($this, $models) = @_;
my @swit;
my $mak;
my $else = "";
for $mak ($this->get_makes()) {
my @makes;
my %modelhash;
if ($models) {
%modelhash = %{$models};
@makes = keys %modelhash;
} else {
@makes = ($this->get_makes());
}
for $mak (@makes) {
push (@swit,
" $else if (make == \"$mak\") {\n");
my $ct = 0;
my @makemodels;
if ($models) {
@makemodels = @{$modelhash{$mak}};
} else {
@makemodels = ($this->get_models_by_make($mak));
}
my $mod;
for $mod (sort {normalizename($a) cmp normalizename($b) }
$this->get_models_by_make($mak)) {
@makemodels) {
my $p;
$p = $this->get_printer_from_make_model($mak, $mod);
......@@ -4744,6 +4791,15 @@ sub get_javascript2 {
push (@swit,
" o[i++]=new Option(\"$mod\", \"$p\");\n");
$ct++;
} else {
my $oid = "$mak-$mod";
$oid =~ s/ /_/g;
$oid =~ s/\+/plus/g;
$oid =~ s/__+/_/g;
$oid =~ s/_$//;
push (@swit,
" o[i++]=new Option(\"$mod\", \"$oid\");\n");
$ct++;
}
}
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -4,7 +4,7 @@
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 3.1 2003/11/19 03:23:50 till Exp $
# $Id$
errstatus=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!