summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlpsv
diff options
context:
space:
mode:
authorStaszek Wawrykiewicz <staw@gust.org.pl>2009-09-30 19:40:25 +0000
committerStaszek Wawrykiewicz <staw@gust.org.pl>2009-09-30 19:40:25 +0000
commit3d3a73217f3dc5f9eda59d6c4a35a86992609693 (patch)
tree14a1c0c6aaae0105dbd0d7e2e6f8f9bb96c716bc /Master/tlpkg/tlpsv
parent0ebb67b0754bebe853fd30c35217dbceccb7aa6e (diff)
ps_view 5.12 update
git-svn-id: svn://tug.org/texlive/trunk@15578 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlpsv')
-rw-r--r--Master/tlpkg/tlpsv/README2
-rwxr-xr-xMaster/tlpkg/tlpsv/gswxlua.exebin1458688 -> 1151488 bytes
-rw-r--r--Master/tlpkg/tlpsv/psv.bat2
-rwxr-xr-xMaster/tlpkg/tlpsv/psv.exebin24064 -> 23040 bytes
-rw-r--r--Master/tlpkg/tlpsv/psv.wx.lua52
-rw-r--r--Master/tlpkg/tlpsv/psv_help_en.htbbin104158 -> 78470 bytes
-rw-r--r--Master/tlpkg/tlpsv/psv_help_pl.htbbin108962 -> 80630 bytes
-rw-r--r--Master/tlpkg/tlpsv/psv_view.ps18
8 files changed, 49 insertions, 25 deletions
diff --git a/Master/tlpkg/tlpsv/README b/Master/tlpkg/tlpsv/README
index 51a65a0ae56..e83145d9215 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.11. It is TeX-Live 2009 release -- it is fully
+version 5.12. 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.
diff --git a/Master/tlpkg/tlpsv/gswxlua.exe b/Master/tlpkg/tlpsv/gswxlua.exe
index 8e23be13549..aa188e40f4b 100755
--- a/Master/tlpkg/tlpsv/gswxlua.exe
+++ b/Master/tlpkg/tlpsv/gswxlua.exe
Binary files differ
diff --git a/Master/tlpkg/tlpsv/psv.bat b/Master/tlpkg/tlpsv/psv.bat
index 49174d470f9..3654a64668a 100644
--- a/Master/tlpkg/tlpsv/psv.bat
+++ b/Master/tlpkg/tlpsv/psv.bat
@@ -1 +1 @@
-@start gswxlua.exe -g ..\tlgs\bin\gsdll32.dll -l psv.wx.lua -p psv_view.ps -sINPUT=%1 %2 \ No newline at end of file
+@start gswxlua.exe -l psv.wx.lua -p psv_view.ps -sINPUT="%1" %2 \ No newline at end of file
diff --git a/Master/tlpkg/tlpsv/psv.exe b/Master/tlpkg/tlpsv/psv.exe
index ca59d810950..34c32c43594 100755
--- a/Master/tlpkg/tlpsv/psv.exe
+++ b/Master/tlpkg/tlpsv/psv.exe
Binary files differ
diff --git a/Master/tlpkg/tlpsv/psv.wx.lua b/Master/tlpkg/tlpsv/psv.wx.lua
index 476d11d5a65..85f857030bd 100644
--- a/Master/tlpkg/tlpsv/psv.wx.lua
+++ b/Master/tlpkg/tlpsv/psv.wx.lua
@@ -3,9 +3,9 @@
-- Authors: P. Strzelczyk, P. Pianowski. Created: 15.06.1993; Lua part 26.10.2007
-- Address: BOP s.c. Gen. T. Bora-Komorowskiego 24, 80-377 Gda\'nsk, Poland
-- bop@bop.com.pl
--- Copyright: (c) 2008 BOP s.c.
+-- Copyright: (c) 2009 BOP s.c.
-- Licence: GPL
--- Current version: 5.11; 06.07.2009
+-- Current version: 5.12; 07.10.2009
--
-- 4.95 -- first working version of Lua engine
-- 4.96 -- mouse interface added (and many other changes)
@@ -26,10 +26,11 @@
-- 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
+-- 5.12 -- changes for Windows Vista and wxWidgets 2.8.10, TL2009 release
------------------------------------------------------------------------------]]
local PS_VIEW_NAME="PS_View"
-local PS_VIEW_VERSION=5.11
+local PS_VIEW_VERSION=5.12
local PS_VIEW_VERSION_STRING -- defined later, after locale loading
local PSV_DftGsPars = {"-dNOPAUSE","-dDELAYBIND","-dNOEPS"}
@@ -565,8 +566,6 @@ function MakeHelpWindow(l,a)
local fname=wx.wxFileName(arg[0]):GetPath(wx.wxPATH_GET_VOLUME)
fname=wx.wxFileName(fname,a)
gsobj.helpctrl:AddBook(fname,false)
--- gsobj.helpctrl=wx.wxHelpController(frame)
--- gsobj.helpctrl:Initialize(a)
elseif l=="S" then
gsobj.helpctrl:DisplayContents()
elseif l=="C" then
@@ -1573,9 +1572,7 @@ function ClosePSV ()
if trans then trans:close() end -- for locale text extraction
if wx.wxIsBusy() then wx.wxEndBusyCursor() end
if gswin.gswindow then gswin.gswindow:Destroy() gswin.gswindow=nil end
- if gsobj.instancechecker then gsobj.instancechecker:Destroy() end
--- if gsobj.helparch then gsobj.helparch:Destroy() end
--- if gsobj.helpctrl then gsobj.helpctrl:Destroy() end
+ if gsobj.instancechecker then gsobj.instancechecker:Destroy(true) end
-- ConfigSavePaths(gsargs)
ConfigSaveFramePosition(frame, "MainWindow")
if console then
@@ -1604,7 +1601,7 @@ function ExitPSV (err_code)
gsobj.ghostscript:Terminate(err_code)
end
if wx.wxIsBusy() then wx.wxEndBusyCursor() end
- if gsobj.instancechecker then gsobj.instancechecker:Destroy() end
+ if gsobj.instancechecker then gsobj.instancechecker:Destroy(true) end
if console then
console:Show() frame:Hide()
console:Connect(wx.wxEVT_CLOSE_WINDOW, function (event)
@@ -1620,7 +1617,7 @@ function ExitPSV_init ()
gsobj.ghostscript:Terminate(gsobj.ghostscript:GetExitCode())
end
if wx.wxIsBusy() then wx.wxEndBusyCursor() end
- if gsobj.instancechecker then gsobj.instancechecker:Destroy() end
+ if gsobj.instancechecker then gsobj.instancechecker:Destroy(true) end
if console then wxapp:SetTopWindow(console) end
if frame then frame:Destroy() end
end
@@ -1732,10 +1729,12 @@ function PSFName(name)
end
function SetPSFile(fdir,fname)
- gsargs.psf_dir, gsargs.psf_name = fdir,fname
- SetPSTitle(fname)
- if gsobj.instancechecker then gsobj.instancechecker:Destroy() end
- gsobj.instancechecker = CreateInstanceChecker()
+ if gsargs.psf_dir ~= fdir or gsargs.psf_name ~= fname then
+ gsargs.psf_dir, gsargs.psf_name = fdir,fname
+ SetPSTitle(fname)
+ if gsobj.instancechecker then gsobj.instancechecker:Destroy(false) end
+ gsobj.instancechecker = CreateInstanceChecker()
+ end
gsobj.instancechecker:IsAnotherInstance()
end
@@ -2028,15 +2027,22 @@ function CreateInstanceChecker()
function checker:CheckTime()
local ok,modtime=self.fname:GetTimes()
if modtime:IsLaterThan(self.time) then
- self.time=modtime return true
+ if self.fname:GetSize():ToULong()<2 then
+ -- signal active instance
+ self:CreateLock()
+ else self.time=modtime end
+ return true
else return false end
end
function checker:CreateLock()
+ self:MakeLock(tostring(wx.wxGetProcessId()))
+ self:SetTime() self.created=true
+ end
+ function checker:MakeLock(cont)
local file=wx.wxFile(self.fname:GetFullPath(),wx.wxFile.write)
if file:IsOpened() then
- file:Write(tostring(wx.wxGetProcessId())) file:Close()
+ file:Write(cont) file:Close()
end
- self:SetTime() self.created=true
end
function checker:UpdateLock()
self.fname:Touch()
@@ -2047,6 +2053,11 @@ function CreateInstanceChecker()
if not self.dname or not self.fname then return false end
if not self.dname:DirExists() then self.dname:Mkdir() end
if self.fname:FileExists() then
+ print_debug("SIZE: ", self.fname:GetSize():ToULong())
+ if self.fname:GetSize():ToULong()<2 then
+ -- unactive instance found (= no active instance)
+ self:CreateLock() return false
+ end
self:UpdateLock() return true
else
self:CreateLock() return false
@@ -2063,7 +2074,7 @@ function CreateInstanceChecker()
end
end
--
- function checker:Destroy()
+ function checker:Destroy(quit)
if not self.dname or not self.fname then return false end
if not self.dname:DirExists() then return false end
if self.created and self.fname:FileExists() then
@@ -2079,7 +2090,7 @@ function CreateInstanceChecker()
if mod:IsEarlierThan(old) then wx.wxRemoveFile(fname:GetFullPath()) end
f,filen=dir:GetNext() fname:SetFullName(filen)
end
- if not dir:HasFiles() then wx.wxRmdir(dir:GetName()) end
+ if quit and not dir:HasFiles() then wx.wxRmdir(dir:GetName()) end
self.dname=nil self.fname=nil self.time=nil
return true
end
@@ -2185,9 +2196,10 @@ function Main()
end
if gsobj.instancechecker:IsAnotherInstance() and not force_open then
print_message(_T("Another instance of PS_View is running -- quiting.\n"))
+ gsobj.instancechecker:MakeLock('0') -- try if instance is dead
gsobj.instancechecker:Destroy()
return true
- elseif force_open then gsobj.instancechecker.created=true end
+ elseif force_open then gsobj.instancechecker:CreateLock() end
ConfigGetPaths(gsargs)
diff --git a/Master/tlpkg/tlpsv/psv_help_en.htb b/Master/tlpkg/tlpsv/psv_help_en.htb
index 2d13490b508..1cb0ce983c9 100644
--- a/Master/tlpkg/tlpsv/psv_help_en.htb
+++ b/Master/tlpkg/tlpsv/psv_help_en.htb
Binary files differ
diff --git a/Master/tlpkg/tlpsv/psv_help_pl.htb b/Master/tlpkg/tlpsv/psv_help_pl.htb
index d64dd101f9e..a8286617fad 100644
--- a/Master/tlpkg/tlpsv/psv_help_pl.htb
+++ b/Master/tlpkg/tlpsv/psv_help_pl.htb
Binary files differ
diff --git a/Master/tlpkg/tlpsv/psv_view.ps b/Master/tlpkg/tlpsv/psv_view.ps
index 9869e09b436..0124ef93a2d 100644
--- a/Master/tlpkg/tlpsv/psv_view.ps
+++ b/Master/tlpkg/tlpsv/psv_view.ps
@@ -2,7 +2,7 @@
%% Authors: P. Pianowski, P. Strzelczyk, B. Jackowski
%% Address: BOP s.c. Gen. T. Bora-Komorowskiego, 80-377 Gda\'nsk, Poland
%% bop@bop.com.pl
-%% Copyright: (c) 2008 BOP s.c.
+%% Copyright: (c) 2009 BOP s.c.
%% Licence: GPL
%% History:
%% Creation date: Friday, January 15th, 1993
@@ -36,11 +36,12 @@
%% 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)
+%% Version: 5.12, 07.10.2009 (changes for Windows Vista and wxWidgets 2.8.10, TL2009 release)
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
userdict /view_dict 300 dict put
view_dict begin
-/PS_VIEW (PSView 5.11) def
+/PS_VIEW (PSView 5.12) def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
userdict begin
@@ -2413,6 +2414,12 @@ dup /infullscreen exch def {
(}{ps}{Save restart file}\n) print flush
} def
+/PRINT_dialog {
+ flush
+ (!PSV_DIALOG: P {}{Print}\n) print flush
+} def
+
+
/SPECIFIED_PAGE_dlgbox {
flush
(!PSV_DLGBOX: I {100,50}{Go to specified page}\n) print flush
@@ -2796,7 +2803,8 @@ MENUCOMMANDS begin
/SAVE_AS_RESTART {SAVE_AS_RESTART_dialog} def
/LOAD_RESTART {rr} def
/LOAD_FROM_RESTART {/CAUSE /LOAD_FROM_RESTART def LOAD_FROM_RESTART_dialog} def
- /PRINT {pr} def
+% /PRINT {pr} def
+ /PRINT {PRINT_dialog} def
/LEAVE {quit} def
/QUIT {q} def
/UNDO {un} def
@@ -3273,6 +3281,10 @@ end % MOUSECOMMANDS
} if
} def
+/PRINTDIALOG {
+ pr
+} def
+
/SAVEDIALOG {
% dup 256 mod /filename_offset XD 256 idiv
% dup 256 mod /filename_filter XD 256 idiv