From 5eca07d318d43832522e3482a000ab933c25a420 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 16 May 2011 11:00:00 +0200 Subject: beta 2011.05.16 11:00 --- scripts/context/lua/mtx-epub.lua | 26 +++++++++++++++++++++++--- tex/context/base/java-imp-fld.mkiv | 24 ++++++++++++++++++++++++ tex/context/base/scrn-but.mkvi | 15 +++++++++++++-- tex/context/base/spac-ver.lua | 10 ++++++---- tex/context/base/status-files.pdf | Bin 23585 -> 23548 bytes tex/context/base/status-lua.pdf | Bin 154368 -> 154363 bytes tex/context/base/task-ini.lua | 2 +- 7 files changed, 67 insertions(+), 10 deletions(-) diff --git a/scripts/context/lua/mtx-epub.lua b/scripts/context/lua/mtx-epub.lua index 15282ddab..70ee7828c 100644 --- a/scripts/context/lua/mtx-epub.lua +++ b/scripts/context/lua/mtx-epub.lua @@ -6,6 +6,18 @@ if not modules then modules = { } end modules ['mtx-epub'] = { license = "see context related readme files" } +-- The epub specification is far from beautiful. Especially the id related +-- part is messy and devices/programs react differently on them (so an id is not +-- really an id but has some special property). Then there is this ncx suffix +-- thing. Somehow it give the impression of a reversed engineered application +-- format so it will probably take a few cycles to let it become a real +-- clean standard. Thanks to Adam Reviczky for helping to figure out all these +-- puzzling details. + +-- This is preliminary code. At some point we will deal with images as well but +-- first we need a decent strategy to export them. More information will be +-- available on the wiki. + local format = string.format local concat = table.concat @@ -63,6 +75,14 @@ local package = [[ ]] +-- We need to figure out what is permitted; numbers only seem to give +-- problems is some applications as do names with dashes. + +local function dumbid(filename) + -- return (string.gsub(os.uuid(),"%-%","")) -- to be tested + return file.nameonly(filename) +end + local mimetypes = { xhtml = "application/xhtml+xml", css = "text/css", @@ -70,9 +90,9 @@ local mimetypes = { } local idmakers = { - ncx = function(filename) return "ncx" end, - css = function(filename) return "stylesheet" end, - default = function(filename) return file.nameonly(filename) end, + ncx = function(filename) return "ncx" end, + -- css = function(filename) return "stylesheet" end, + default = function(filename) return dubmid(filename) end, } -- specification = { diff --git a/tex/context/base/java-imp-fld.mkiv b/tex/context/base/java-imp-fld.mkiv index 9eb7d7ed5..a0909f594 100644 --- a/tex/context/base/java-imp-fld.mkiv +++ b/tex/context/base/java-imp-fld.mkiv @@ -419,6 +419,30 @@ function Pause_Walk_Field(FieldSet) { } } +function Start_Pause_Walk_Field(FieldSet, Delay) { + var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; + if (fieldset) { + if (fieldset.running) { + if (fieldset.paused) { + Do_Start_Auto_Walk_Field(FieldSet) ; + fieldset.paused = false ; + } else { + Do_Stop_Auto_Walk_Field(FieldSet) ; + fieldset.paused = true ; + } + } else { + fieldset.number = 0 ; + if (Delay) { + fieldset.delay = Delay ; + } + Reset_Fields(FieldSet) ; + Do_Start_Auto_Walk_Field(FieldSet) ; + fieldset.running = true ; + fieldset.paused = false ; + } + } +} + function Stop_Walk_Field(FieldSet) { var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; if (fieldset) { diff --git a/tex/context/base/scrn-but.mkvi b/tex/context/base/scrn-but.mkvi index 338f3090b..e1dedd605 100644 --- a/tex/context/base/scrn-but.mkvi +++ b/tex/context/base/scrn-but.mkvi @@ -416,6 +416,8 @@ \newdimen\scrn_menu_offset_left \newdimen\scrn_menu_offset_right +\newconditional\scrn_menu_zerodimensions + \def\scrn_menu_set_used {\doassigncheckedframeoffset\scrn_menu_offset_left {\interactionmenuparameter\c!leftoffset }% \doassigncheckedframeoffset\scrn_menu_offset_right {\interactionmenuparameter\c!rightoffset }% @@ -435,8 +437,13 @@ \scrn_menu_final_height\namedinteractionmenuparameter\askedinteractionmenulocation\c!maxheight} \def\scrn_menu_apply_final - {\wd\scrn_menu_box\scrn_menu_final_width - \ht\scrn_menu_box\scrn_menu_final_height + {\ifconditional\scrn_menu_zerodimensions + \wd\scrn_menu_box\zeropoint + \ht\scrn_menu_box\zeropoint + \else + \wd\scrn_menu_box\scrn_menu_final_width + \ht\scrn_menu_box\scrn_menu_final_height + \fi \dp\scrn_menu_box\zeropoint} \def\scrn_menu_apply_used @@ -793,6 +800,7 @@ {\hbox to \leftedgewidth \bgroup \hsize\leftedgewidth %\csname\??tk\v!leftedge\c!left\endcsname + \settrue\scrn_menu_zerodimensions \scrn_menu_insert\v!left %\csname\??tk\v!leftedge\c!right\endcsname \egroup @@ -802,6 +810,7 @@ {\hbox to \rightedgewidth \bgroup \hsize\rightedgewidth %\csname\??tk\v!rightedge\c!left\endcsname + \settrue\scrn_menu_zerodimensions \scrn_menu_insert\v!right %\csname\??tk\v!rightedge\c!right\endcsname \egroup @@ -811,6 +820,7 @@ {\vbox to \topheight \bgroup \vsize\topheight %\csname\??tk\v!top\c!before\endcsname + \settrue\scrn_menu_zerodimensions \scrn_menu_insert\v!top %\csname\??tk\v!top\c!after\endcsname \kern\zeropoint @@ -821,6 +831,7 @@ {\vbox to \bottomheight \bgroup \vsize\bottomheight %\csname\??tk\v!bottom\c!before\endcsname + \settrue\scrn_menu_zerodimensions \scrn_menu_insert\v!bottom %\csname\??tk\v!bottom\c!after\endcsname \kern\zeropoint diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua index 842dfe64a..83ee6e492 100644 --- a/tex/context/base/spac-ver.lua +++ b/tex/context/base/spac-ver.lua @@ -80,6 +80,7 @@ local nodepool = nodes.pool local new_penalty = nodepool.penalty local new_kern = nodepool.kern local new_rule = nodepool.rule +local new_gluespec = nodepool.gluespec local nodecodes = nodes.nodecodes local skipcodes = nodes.skipcodes @@ -914,7 +915,7 @@ local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also elseif id ~= glue_code then flush("something else") current = current.next - elseif subtype == userskip_code then -- todo, other subtypes, like math + elseif subtype == userskip_code then local sc = has_attribute(current,a_skipcategory) -- has no default, no unset (yet) local so = has_attribute(current,a_skiporder ) or 1 -- has 1 default, no unset (yet) local sp = has_attribute(current,a_skippenalty ) -- has no default, no unset (yet) @@ -931,7 +932,7 @@ local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also elseif not sc then -- if not sc then if glue_data then if trace then trace_done("flush",glue_data) end - head, current = nodes.before(head,current,glue_data) + head = insert_node_before(head,current,glue_data) if trace then trace_natural("natural",current) end current = current.next else @@ -944,8 +945,9 @@ local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also if cs.writable and ps.stretch_order == 0 and ps.shrink_order == 0 and cs.stretch_order == 0 and cs.shrink_order == 0 then local pw, pp, pm = ps.width, ps.stretch, ps.shrink local cw, cp, cm = cs.width, cs.stretch, cs.shrink - ps = writable_spec(previous) -- no writable needed here - ps.width, ps.stretch, ps.shrink = pw + cw, pp + cp, pm + cm +--~ ps = writable_spec(previous) -- no writable needed here +--~ ps.width, ps.stretch, ps.shrink = pw + cw, pp + cp, pm + cm +previous.spec = new_gluespec(pw + cw, pp + cp, pm + cm) -- else topskip can disappear if trace then trace_natural("removed",current) end head, current = remove_node(head, current, true) -- current = previous diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index f825d0ace..7509af18a 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 06d6da7d0..a4ad5c8da 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/task-ini.lua b/tex/context/base/task-ini.lua index 435c85286..c1c22e8cc 100644 --- a/tex/context/base/task-ini.lua +++ b/tex/context/base/task-ini.lua @@ -73,7 +73,7 @@ appendaction("math", "builders", "builders.kernel.mlist_to_hlist") appendaction("finalizers", "lists", "nodes.handlers.graphicvadjust") -- todo appendaction("finalizers", "fonts", "builders.paragraphs.solutions.splitters.optimize") -- experimental --- rather new +-- still experimental appendaction("mvlbuilders", "normalizers", "nodes.handlers.migrate") -- appendaction("mvlbuilders", "normalizers", "builders.vspacing.pagehandler") -- last ! -- cgit v1.2.3