diff options
author | Staszek Wawrykiewicz <staw@gust.org.pl> | 2009-07-06 17:30:42 +0000 |
---|---|---|
committer | Staszek Wawrykiewicz <staw@gust.org.pl> | 2009-07-06 17:30:42 +0000 |
commit | 678a72f4e0eacf1b939d7ca0d954378122d579de (patch) | |
tree | 5e3e4a2b5bcc46501fc7eb3a45fa3bad3b57ea1a /Master/tlpkg/tlpsv | |
parent | d8ae0710347d4e4dd75fe7710af9fc36fa8a6695 (diff) |
ps_view 5.11
git-svn-id: svn://tug.org/texlive/trunk@14154 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlpsv')
-rw-r--r-- | Master/tlpkg/tlpsv/README | 5 | ||||
-rw-r--r-- | Master/tlpkg/tlpsv/cs/LC_MESSAGES/psv.mo | bin | 0 -> 15295 bytes | |||
-rw-r--r-- | Master/tlpkg/tlpsv/de/LC_MESSAGES/psv.mo | bin | 15820 -> 15861 bytes | |||
-rw-r--r-- | Master/tlpkg/tlpsv/en/LC_MESSAGES/psv.mo | bin | 14950 -> 14988 bytes | |||
-rw-r--r-- | Master/tlpkg/tlpsv/nl/LC_MESSAGES/psv.mo | bin | 15016 -> 15059 bytes | |||
-rw-r--r-- | Master/tlpkg/tlpsv/pl/LC_MESSAGES/psv.mo | bin | 15696 -> 15735 bytes | |||
-rw-r--r-- | Master/tlpkg/tlpsv/psv.wx.lua | 95 | ||||
-rw-r--r-- | Master/tlpkg/tlpsv/psv_help_en.htb | bin | 78470 -> 104158 bytes | |||
-rw-r--r-- | Master/tlpkg/tlpsv/psv_help_pl.htb | bin | 80630 -> 108962 bytes | |||
-rw-r--r-- | Master/tlpkg/tlpsv/psv_view.ps | 52 |
10 files changed, 99 insertions, 53 deletions
diff --git a/Master/tlpkg/tlpsv/README b/Master/tlpkg/tlpsv/README index fbf9478a4b3..51a65a0ae56 100644 --- a/Master/tlpkg/tlpsv/README +++ b/Master/tlpkg/tlpsv/README @@ -1,7 +1,7 @@ PS_View README This is PS_View (a previewing utility for Ghostscript interpreter) -version 5.09. It is initial TeX-Live release -- it is fully +version 5.11. It is TeX-Live 2009 release -- it is fully functional and needs through testing. It can be used as a basic PostScript viewer, but it still probably has bugs. @@ -26,6 +26,7 @@ Package consists of: psv.xpm -- icon for Xwindow psv_about*.ps -- about info files psv_help*.htb -- help files + psv_usage*.pdf -- usage help files pl/, de/, en/, nl/ -- locale messages @@ -72,7 +73,7 @@ Some paths are discovered automatically: Contact: BOP s.c., ul. T. Bora-Komorowskiego 24, 80-377 Gda\'nsk, Poland bop@bop.com.pl -Copyright 1993-2008 P. Strzelczyk, P. Pianowski, B. Jackowski +Copyright 1993-2009 P. Strzelczyk, P. Pianowski, B. Jackowski This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/Master/tlpkg/tlpsv/cs/LC_MESSAGES/psv.mo b/Master/tlpkg/tlpsv/cs/LC_MESSAGES/psv.mo Binary files differnew file mode 100644 index 00000000000..39518bfc059 --- /dev/null +++ b/Master/tlpkg/tlpsv/cs/LC_MESSAGES/psv.mo diff --git a/Master/tlpkg/tlpsv/de/LC_MESSAGES/psv.mo b/Master/tlpkg/tlpsv/de/LC_MESSAGES/psv.mo Binary files differindex 6a6f5a7734c..45a613d6cdb 100644 --- a/Master/tlpkg/tlpsv/de/LC_MESSAGES/psv.mo +++ b/Master/tlpkg/tlpsv/de/LC_MESSAGES/psv.mo diff --git a/Master/tlpkg/tlpsv/en/LC_MESSAGES/psv.mo b/Master/tlpkg/tlpsv/en/LC_MESSAGES/psv.mo Binary files differindex 071b922fe53..70f72e65136 100644 --- a/Master/tlpkg/tlpsv/en/LC_MESSAGES/psv.mo +++ b/Master/tlpkg/tlpsv/en/LC_MESSAGES/psv.mo diff --git a/Master/tlpkg/tlpsv/nl/LC_MESSAGES/psv.mo b/Master/tlpkg/tlpsv/nl/LC_MESSAGES/psv.mo Binary files differindex dd2c97467f8..2550a877589 100644 --- a/Master/tlpkg/tlpsv/nl/LC_MESSAGES/psv.mo +++ b/Master/tlpkg/tlpsv/nl/LC_MESSAGES/psv.mo diff --git a/Master/tlpkg/tlpsv/pl/LC_MESSAGES/psv.mo b/Master/tlpkg/tlpsv/pl/LC_MESSAGES/psv.mo Binary files differindex 4518f24f98f..b0ea85b86f8 100644 --- a/Master/tlpkg/tlpsv/pl/LC_MESSAGES/psv.mo +++ b/Master/tlpkg/tlpsv/pl/LC_MESSAGES/psv.mo diff --git a/Master/tlpkg/tlpsv/psv.wx.lua b/Master/tlpkg/tlpsv/psv.wx.lua index 6c4f470b537..476d11d5a65 100644 --- a/Master/tlpkg/tlpsv/psv.wx.lua +++ b/Master/tlpkg/tlpsv/psv.wx.lua @@ -5,7 +5,7 @@ -- bop@bop.com.pl -- Copyright: (c) 2008 BOP s.c. -- Licence: GPL --- Current version: 5.09; 02.07.2008 +-- Current version: 5.11; 06.07.2009 -- -- 4.95 -- first working version of Lua engine -- 4.96 -- mouse interface added (and many other changes) @@ -24,12 +24,14 @@ -- 5.07 -- post BachoTeX release -- 5.08 -- full-screen mode -- 5.09 -- LaTeX/HTML help added +-- 5.10 -- bug in DSC reading corrected +-- 5.11 -- some changes to compatibility with GS 8.64, and builtin inits ------------------------------------------------------------------------------]] local PS_VIEW_NAME="PS_View" -local PS_VIEW_VERSION=5.09 +local PS_VIEW_VERSION=5.11 local PS_VIEW_VERSION_STRING -- defined later, after locale loading -local PSV_GsPars = {"-dNOPAUSE","-dDELAYBIND","-dNOEPS"} +local PSV_DftGsPars = {"-dNOPAUSE","-dDELAYBIND","-dNOEPS"} local frame, console = nil, nil @@ -70,13 +72,12 @@ local gsargs = { psvlib= "", -- path to PS_View files (from config file or discovered from -- paths in progs or path to this program -- arg[0]) progs = {}, -- PostScript program to run during init (added at the end of args) - dftpars = PSV_GsPars, -- default GS arguments (can be overriden by config file, - -- added ath the begin of args) + cmd_pars = {}, -- default GS arguments (can be overriden by config file, + -- added at the begin of args) psf_dir = "", -- directory with the curently opened file psf_name = "", -- name of the curently opened file } local psvpars = { - cmd_pars = "", language = "", } local gsstat = { @@ -398,24 +399,24 @@ local Mouse = { Cnone=0, Czoom=1, Cpane=2, Cmeasure=3, Cscroll=4, bx=0, by=0, ex=0, ey=0, scroln=0, CMD=0, mod=0, timer=0,} local Dobject = { n=0, id={}, -Oline=1, Orect=2, Ocros=3, } -Dobject.pens={ [-1] = wx.wxTRANSPARENT_PEN, [0] = -wx.wxBLACK_PEN, wx.wxPen("BLUE",1,wx.wxSOLID), -wx.wxGREEN_PEN, wx.wxCYAN_PEN, -wx.wxRED_PEN, wx.wxPen("MAGENTA",1,wx.wxSOLID), -wx.wxPen("YELLOW",1,wx.wxSOLID), wx.wxWHITE_PEN, -wx.wxPen("BLACK",3,wx.wxSOLID), wx.wxPen("BLUE",3,wx.wxSOLID), -wx.wxPen("GREEN",3,wx.wxSOLID), wx.wxPen("CYAN",3,wx.wxSOLID), -wx.wxPen("RED",3,wx.wxSOLID), wx.wxPen("MAGENTA",3,wx.wxSOLID), -wx.wxPen("YELLOW",3,wx.wxSOLID), wx.wxPen("WHITE",3,wx.wxSOLID), -} -Dobject.brushess={ [-1] = wx.wxTRANSPARENT_BRUSH, [0] = -wxBLACK_BRUSH, wx.wxBLUE_BRUSH, -wxGREEN_BRUSH, wxCYAN_BRUSH, -wxRED_BRUSH, wx.wxBrush("MAGENTA",wx.wxSOLID), -wx.wxBrush("YELLOW",wx.wxSOLID), wxWHITE_BRUSH, -wxGREY_BRUSH -} + Oline=1, Orect=2, Ocros=3, } + Dobject.pens={ [-1] = wx.wxTRANSPARENT_PEN, [0] = + wx.wxBLACK_PEN, wx.wxPen("BLUE",1,wx.wxSOLID), + wx.wxGREEN_PEN, wx.wxCYAN_PEN, + wx.wxRED_PEN, wx.wxPen("MAGENTA",1,wx.wxSOLID), + wx.wxPen("YELLOW",1,wx.wxSOLID), wx.wxWHITE_PEN, + wx.wxPen("BLACK",3,wx.wxSOLID), wx.wxPen("BLUE",3,wx.wxSOLID), + wx.wxPen("GREEN",3,wx.wxSOLID), wx.wxPen("CYAN",3,wx.wxSOLID), + wx.wxPen("RED",3,wx.wxSOLID), wx.wxPen("MAGENTA",3,wx.wxSOLID), + wx.wxPen("YELLOW",3,wx.wxSOLID), wx.wxPen("WHITE",3,wx.wxSOLID), + } + Dobject.brushess={ [-1] = wx.wxTRANSPARENT_BRUSH, [0] = + wxBLACK_BRUSH, wx.wxBLUE_BRUSH, + wxGREEN_BRUSH, wxCYAN_BRUSH, + wxRED_BRUSH, wx.wxBrush("MAGENTA",wx.wxSOLID), + wx.wxBrush("YELLOW",wx.wxSOLID), wxWHITE_BRUSH, + wxGREY_BRUSH + } local v_quiet,v_normal,v_verbose=2,6,10 @@ -615,7 +616,7 @@ function SendLocaleEvent(f,a) SendEventCommand ("LOCALE","(%s) (%s) -1",a,a) end elseif f=="I" then - SendEventCommand ("LOCALE","(%s) (%s) 0", gsobj.locale:GetLocale(), + SendEventCommand ("LOCALE","(%s) (%s) 0", gsobj.locale:GetLocale(), string.sub(gsobj.locale:GetName(),1,2)) elseif f=="S" then local lang=gsobj.locale.FindLanguageInfo(a) @@ -689,14 +690,14 @@ function ReadDSCcomments(fname) psb,pse = pstr:find("%%",pse,true) if psb then if pstr:sub(psb-1,pse):match("[\n\r]%%[%%D!]") then - pseb,psee = pstr:find("[\n\r]+",pse) + pseb,psee = pstr:find("[\n\r]+",pse) if pseb then pse=psee SendDSCComment(pstr:sub(psb,pseb-1),pp+psb,pp+pse) elseif pn==psend then pse=pstr:len() SendDSCComment(pstr:sub(psb,pse),pp+psb,pp+pse) - elseif psb+1024<pn then + elseif psb+1024<pstr:len() then pse=psb+255 SendDSCComment(pstr:sub(psb,pse),pp+psb,pp+pse) else @@ -1031,11 +1032,11 @@ end function DestroyOverlay() if gsstat.inoverlay then - gsstat.inoverlay=false + gsstat.inoverlay=false if gsstat.drawoverlay then gsobj.image=gsobj.overlay gswin.gswindow:SetGsImage(gsobj.image) - gsstat.drawoverlay=false + gsstat.drawoverlay=false end gsobj.overlay=nil if gsobj.bbmp then gsobj.obmp:delete() gsobj.obmp=nil end @@ -1081,7 +1082,7 @@ function OnPaintExtra(event) -- draw objects end dc:delete() -end +end function AddDrawObject(id,dim,pen) if Dobject.n==0 then CreateDrawObjects() end @@ -1138,7 +1139,7 @@ function MakeResizeEvent(f,s,x,y) elseif s=="F" then frame:ShowFullScreen(false) end elseif f=="S" then end -end +end function MouseButtonEvent(event) local mod=wx.wxMOD_NONE @@ -1920,10 +1921,20 @@ function FixGSPaths(gsargs) if gsargs.dllloc~="" then fname:Assign(gsargs.dllloc) fname:RemoveDir(fname:GetDirCount()-1) fname:AppendDir("lib") - fname:SetName("gs_init") fname:SetExt("ps") + fname:SetName("gs_il2_e") fname:SetExt("ps") if fname:FileExists() then gslib = PSFName(fname:GetFullPath()) end + fname:Assign(gsargs.dllloc) + fname:RemoveDir(fname:GetDirCount()-1) + fname:AppendDir("Resource") fname:AppendDir("Init") + fname:SetName("gs_init") fname:SetExt("ps") + if fname:FileExists() then + if gslib=="" then gslib = PSFName(fname:GetFullPath()) + else gslib = gslib .. sep .. PSFName(fname:GetFullPath()) end + end end end + if gslib=="" then gslib="%rom%lib/" .. sep .. "%rom%Resource/Init" end + if psvlib=="" then for i,v in ipairs(gsargs.progs) do @@ -1940,7 +1951,7 @@ function FixGSPaths(gsargs) for i,v in ipairs(gsargs.libs) do if libstr~="" then libstr=libstr..sep..v else libstr=v end end - if libstr=="" and libloc~="" then libstr=gslibloc end + if libstr=="" and libloc~="" then libstr=libloc end if gslib~="" and not libstr:find(gslib,1,true) then if libstr~="" then libstr=gslib..sep..libstr else libstr=gslib end @@ -1954,7 +1965,8 @@ function FixGSPaths(gsargs) gsargs.libloc, gsargs.gslib, gsargs.psvlib = libstr, gslib, psvlib -- add default parameters at begining - for i,v in ipairs(gsargs.dftpars) do table.insert(gsargs.args,i,v) end + if #gsargs.cmd_pars==0 then gsargs.cmd_pars = PSV_DftGsPars end + for i,v in ipairs(gsargs.cmd_pars) do table.insert(gsargs.args,i,v) end -- and PS programs at the end for i,v in ipairs(gsargs.progs) do table.insert(gsargs.args,v) end end @@ -1984,26 +1996,27 @@ function PrepareLocale() return wx.wxGetTranslation(str) end PS_VIEW_VERSION_STRING=string.format(_T("%s, version %g"), PS_VIEW_NAME, PS_VIEW_VERSION) - print("!!!!" .. psvpars.language.. "!".. lang .. PS_VIEW_VERSION_STRING .. "\n") end function CreateInstanceChecker() local checker={} function checker:Create() + local tname="." .. PS_VIEW_NAME + if wx.__WXMSW__ then tname="psview" end -- for Vista (?) -- wx.wxFileName.GetTempDir() -- not implemented in wxLua -- os.tmpname() -- gives bad result under MSW local fname=wx.wxFileName() - fname:AssignTempFileName("." .. PS_VIEW_NAME) + fname:AssignTempFileName(tname) if fname:IsOk() then wx.wxRemoveFile(fname:GetFullPath()) else return false end fname:AssignDir(fname:GetPath(wx.wxPATH_GET_VOLUME)) - fname:AppendDir("." .. PS_VIEW_NAME) + fname:AppendDir(tname) if not fname:DirExists() then if not fname:Mkdir() then return false end end self.dname=wx.wxFileName(fname) - fname:SetName("." .. PS_VIEW_NAME .. MakeNameHash()) fname:SetExt("lock") + fname:SetName(tname .. MakeNameHash()) fname:SetExt("lock") self.fname=wx.wxFileName(fname) self.created=false self.time=nil end @@ -2087,7 +2100,9 @@ function ConfigGetParameters() gsobj.config:SetPath("/PSV_Parameters") local _, _cmd = gsobj.config:Read("cmdpars", "") local _, _lang = gsobj.config:Read("language", "") - if psvpars.cmd_pars=="" and _cmd then psvpars.cmd_pars = _cmd end + if #gsargs.cmd_pars==0 and _cmd then + for i in string.gmatch(_cmd,"%S+") do table.insert(gsargs.cmd_pars,i) end + end if psvpars.language=="" and _lang then psvpars.language = _lang end end @@ -2173,7 +2188,7 @@ function Main() gsobj.instancechecker:Destroy() return true elseif force_open then gsobj.instancechecker.created=true end - + ConfigGetPaths(gsargs) diff --git a/Master/tlpkg/tlpsv/psv_help_en.htb b/Master/tlpkg/tlpsv/psv_help_en.htb Binary files differindex 1cb0ce983c9..2d13490b508 100644 --- a/Master/tlpkg/tlpsv/psv_help_en.htb +++ b/Master/tlpkg/tlpsv/psv_help_en.htb diff --git a/Master/tlpkg/tlpsv/psv_help_pl.htb b/Master/tlpkg/tlpsv/psv_help_pl.htb Binary files differindex a8286617fad..d64dd101f9e 100644 --- a/Master/tlpkg/tlpsv/psv_help_pl.htb +++ b/Master/tlpkg/tlpsv/psv_help_pl.htb diff --git a/Master/tlpkg/tlpsv/psv_view.ps b/Master/tlpkg/tlpsv/psv_view.ps index 0bbeabe0040..9869e09b436 100644 --- a/Master/tlpkg/tlpsv/psv_view.ps +++ b/Master/tlpkg/tlpsv/psv_view.ps @@ -34,11 +34,13 @@ %% Version: 5.07, 05.05.2008 (post BachoTeX release) %% Version: 5.08, 14.05.2008 (full-screen mode) %% Version: 5.09, 02.07.2008 (LaTeX/HTML help added -- more formatting needed) +%% Version: 5.10, 35.07.2008 (bug in DSC reading corrected) +%% Version: 5.11, 06.02.2009 (some changes to compatibility with GS 8.64, and builtin inits) %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% userdict /view_dict 300 dict put view_dict begin -/PS_VIEW (PSView 5.09) def +/PS_VIEW (PSView 5.11) def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% userdict begin @@ -84,6 +86,12 @@ userdict begin } if } def + /ori_dotsetpagedevice /.setpagedevice load def + /.setpagedevice { + % patch for ignore .setpagedevice in pdfshowpage_finish + dup /PageSpotColors known {pop}{ori_dotsetpagedevice} ifelse + } def + end % userdict statusdict begin @@ -189,6 +197,7 @@ end % statusdict pdfdict /pdfopen undef /pdfopen { % redefined to allow UseCIEcolors toggle in PDF + % (removed color space redefinition) pdfopenfile begin pdfopencache currentdict end @@ -288,6 +297,13 @@ DELAYBIND {.bindnow /bind /.bind load .bind def} if {pop pop true} {pop false} ifelse} def /read_DSC { + % in_document {(D)} {( )} ifelse + % in_prolog {(B)} {( )} ifelse concat_strings + % in_setup {(S)} {( )} ifelse concat_strings + % in_page {(P)} {( )} ifelse concat_strings + % in_inclusion val_str cvs concat_strings + % ( ) concat_strings + % DSC_line concat_strings = in_page { (%%BeginDocument) match {b_inclusion} if (%%EndDocument) match {e_inclusion} if @@ -2471,6 +2487,18 @@ dup /infullscreen exch def { (!PSV_DLGBOX: S {}\n) print flush } def +/CONF_CMDL_dlgbox { + flush + (!PSV_DLGBOX: I {100,60}{Configure comandline parameters (for Ghostscript)}\n) print flush + (!PSV_DLGBOX: T {C}{CIETEXT}{15,5,70,8}{Command line parameters}\n) print flush + (!PSV_DLGBOX: E {N) print + shift psv_normal_print_rounded + (}{CMDLINE_EDIT}{20,20,60,11}{}\n) print flush + (!PSV_DLGBOX: B {O}{OK}{25,45,35,12}{Save}\n) print flush + (!PSV_DLGBOX: B {C}{CANCEL}{80,45,35,12}{Cancel}\n) print flush + (!PSV_DLGBOX: S {}\n) print flush +} def + /CONF_GRAPICS_dlgbox { flush (!PSV_DLGBOX: I {140,60}{Configure graphics parameters}\n) print flush @@ -2493,11 +2521,12 @@ dup /infullscreen exch def { (!PSV_DLGBOX: T {R}{ALPHATEXT}{5,13,30,8}{Language}\n) print flush (!PSV_DLGBOX: L {N) print llanguage () eq {(0) print} if - llanguage (de) eq {(1) print} if - llanguage (en) eq {(2) print} if - llanguage (nl) eq {(3) print} if - llanguage (pl) eq {(4) print} if - (|System default|German \(de\)|English \(en\)|Dutch \(nl\)|Polish \(pl\)|) print + llanguage (cs) eq {(1) print} if + llanguage (de) eq {(2) print} if + llanguage (en) eq {(3) print} if + llanguage (nl) eq {(4) print} if + llanguage (pl) eq {(5) print} if + (|System default|Czech \(cs\)|German \(de\)|English \(en\)|Dutch \(nl\)|Polish \(pl\)|) print (}{LANGUAGELIST}{40,5,65,20}\n) print flush (!PSV_DLGBOX: T {C}{ALPHATEXT}{2,25,136,10}{Language will be changed after PS_View reset}\n) print flush (!PSV_DLGBOX: B {O}{OK}{25,35,35,12}{OK}\n) print flush @@ -3337,11 +3366,12 @@ end % MOUSECOMMANDS } def /LANGUAGELIST { - dup (10000) eq {/llanguage () def} if - dup (01000) eq {/llanguage (de) def} if - dup (00100) eq {/llanguage (en) def} if - dup (00010) eq {/llanguage (nl) def} if - (00001) eq {/llanguage (pl) def} if + dup (100000) eq {/llanguage () def} if + dup (010000) eq {/llanguage (cs) def} if + dup (001000) eq {/llanguage (de) def} if + dup (000100) eq {/llanguage (en) def} if + dup (000010) eq {/llanguage (nl) def} if + (000001) eq {/llanguage (pl) def} if (!PSV_CONFIG: S {PSV_Parameters}{language}{) print llanguage print (}\n) print flush } def |