1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Cfg: Fix 'Addon - Scribunto'

This commit is contained in:
gnosygnu
2016-12-23 09:36:38 -05:00
parent c2b4d8523f
commit b6c8b31186
7 changed files with 24 additions and 63 deletions

View File

@@ -19,18 +19,12 @@ package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx
import gplx.xowa.apps.apis.xowa.xtns.*;
public class Xoapi_xtns implements Gfo_invk {
public void Init_by_kit(Xoae_app app) {
scribunto.Init_by_kit(app);
wikibase.Init_by_app(app);
}
public Xoapi_scribunto Scribunto() {return scribunto;} private final Xoapi_scribunto scribunto = new Xoapi_scribunto();
public Xoapi_wikibase Wikibase() {return wikibase;} private final Xoapi_wikibase wikibase = new Xoapi_wikibase();
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_scribunto)) return scribunto;
else if (ctx.Match(k, Invk_wikibase)) return wikibase;
if (ctx.Match(k, Invk_wikibase)) return wikibase;
else return Gfo_invk_.Rv_unhandled;
}
private static final String
Invk_scribunto = "scribunto"
, Invk_wikibase = "wikibase"
;
private static final String Invk_wikibase = "wikibase";
}

View File

@@ -1,38 +0,0 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.apis.xowa.xtns; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
import gplx.xowa.xtns.scribunto.*; import gplx.xowa.xtns.scribunto.engines.*;
public class Xoapi_scribunto implements Gfo_invk {
private Xoae_app app;
public void Init_by_kit(Xoae_app app) {
this.app = app;
}
public void Engine_(byte v) {
Scrib_xtn_mgr scrib_xtn = (Scrib_xtn_mgr)app.Xtn_mgr().Get_or_fail(Scrib_xtn_mgr.XTN_KEY);
scrib_xtn.Engine_type_(v);
}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_engine_lua_)) Engine_(Scrib_engine_type.Type_lua);
else if (ctx.Match(k, Invk_engine_luaj_)) Engine_(Scrib_engine_type.Type_luaj);
else return Gfo_invk_.Rv_unhandled;
return this;
}
private static final String
Invk_engine_lua_ = "engine_lua_", Invk_engine_luaj_ = "engine_luaj_"
;
}

View File

@@ -29,9 +29,9 @@ public class Xoapi_wikibase implements Gfo_invk, Gfo_evt_mgr_owner {
app.Cfg().Bind_many_app(this, Cfg__core_langs, Cfg__link_wikis, Cfg__sort_langs);
}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Cfg__core_langs)) {core_langs = m.ReadBryAry(k, Byte_ascii.Semic); Gfo_evt_mgr_.Pub_val(this, Evt_core_langs_changed, core_langs);}
else if (ctx.Match(k, Cfg__sort_langs)) {sort_langs = m.ReadBryAry(k, Byte_ascii.Semic); Gfo_evt_mgr_.Pub_val(this, Evt_sort_langs_changed, sort_langs);}
else if (ctx.Match(k, Cfg__link_wikis)) {link_wikis = m.ReadBry(k); Gfo_evt_mgr_.Pub_val(this, Evt_link_wikis_changed, link_wikis);}
if (ctx.Match(k, Cfg__core_langs)) {core_langs = m.ReadBryAry("v", Byte_ascii.Semic); Gfo_evt_mgr_.Pub_val(this, Evt_core_langs_changed, core_langs);}
else if (ctx.Match(k, Cfg__sort_langs)) {sort_langs = m.ReadBryAry("v", Byte_ascii.Semic); Gfo_evt_mgr_.Pub_val(this, Evt_sort_langs_changed, sort_langs);}
else if (ctx.Match(k, Cfg__link_wikis)) {link_wikis = m.ReadBry("v"); Gfo_evt_mgr_.Pub_val(this, Evt_link_wikis_changed, link_wikis);}
else return Gfo_invk_.Rv_unhandled;
return this;
}

View File

@@ -47,6 +47,8 @@ public class Xoa_prog_mgr implements Gfo_invk {
app.Cfg().Bind_many_app(this
, Cfg__web, Cfg__media, Cfg__image, Cfg__svg, Cfg__pdf, Cfg__djvu
, Cfg__gz, Cfg__bz2, Cfg__bz2__stdout_cmd
, Cfg__query_size, Cfg__resize_img, Cfg__convert_svg_to_png, Cfg__convert_djvu_to_tiff
, Cfg__convert_tex_to_dvi, Cfg__convert_dvi_to_png
, Cfg__lua
, Cfg__lilypond, Cfg__abc2ly, Cfg__trim_img, Cfg__midi_to_ogg
);
@@ -87,6 +89,7 @@ public class Xoa_prog_mgr implements Gfo_invk {
else if (String_.Eq(k, Cfg__convert_svg_to_png)) {Init_cmd(m.ReadStr("v"), app_convert_svg_to_png);}
else if (String_.Eq(k, Cfg__convert_djvu_to_tiff)) {Init_cmd(m.ReadStr("v"), app_convert_djvu_to_tiff);}
else if (String_.Eq(k, Cfg__convert_tex_to_dvi)) {Init_cmd(m.ReadStr("v"), app_convert_tex_to_dvi);}
else if (String_.Eq(k, Cfg__convert_dvi_to_png)) {Init_cmd(m.ReadStr("v"), app_convert_dvi_to_png);}
else if (String_.Eq(k, Cfg__lua)) {Init_cmd(m.ReadStr("v"), app_lua);}
else if (String_.Eq(k, Cfg__lilypond)) {Init_cmd(m.ReadStr("v"), app_lilypond);}
else if (String_.Eq(k, Cfg__abc2ly)) {Init_cmd(m.ReadStr("v"), app_abc2ly);}
@@ -127,6 +130,7 @@ public class Xoa_prog_mgr implements Gfo_invk {
, Cfg__convert_svg_to_png = "xowa.wiki.files.apps.convert_svg_to_png"
, Cfg__convert_djvu_to_tiff = "xowa.wiki.files.apps.convert_djvu_to_tiff"
, Cfg__convert_tex_to_dvi = "xowa.wiki.files.apps.convert_tex_to_dvi"
, Cfg__convert_dvi_to_png = "xowa.wiki.files.apps.convert_dvi_to_png"
, Cfg__lua = "xowa.addon.scribunto.lua.cmd"
, Cfg__lilypond = "xowa.addon.score.apps.lilypond"
, Cfg__abc2ly = "xowa.addon.score.apps.abc2ly"