mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.1'
This commit is contained in:
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
|
||||
import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.guis.cmds.*;
|
||||
public class Xoapi_root implements GfoInvkAble {
|
||||
public class Xoapi_root implements Gfo_invk {
|
||||
private Xoae_app app;
|
||||
public Xoapi_root(Xoae_app app) {
|
||||
app_api.Ctor_by_app(app);
|
||||
@@ -50,6 +50,7 @@ public class Xoapi_root implements GfoInvkAble {
|
||||
public Xoapi_usr Usr() {return usr_api;} private final Xoapi_usr usr_api = new Xoapi_usr();
|
||||
public Xoapi_special Special() {return special_api;} private final Xoapi_special special_api = new Xoapi_special();
|
||||
public Xoapi_xtns Xtns() {return xtns_api;} private final Xoapi_xtns xtns_api = new Xoapi_xtns();
|
||||
public Xoapi_wiki Wiki() {return wiki;} private final Xoapi_wiki wiki = new Xoapi_wiki();
|
||||
public Xoapi_app_wikis Wikis() {return app_wikis;} private final Xoapi_app_wikis app_wikis = new Xoapi_app_wikis();
|
||||
public String Test_str() {return test_str;} public void Test_str_(String v) {test_str = v;} private String test_str; // TEST
|
||||
private void Exec(String key) {
|
||||
@@ -69,6 +70,7 @@ public class Xoapi_root implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_special)) return special_api;
|
||||
else if (ctx.Match(k, Invk_xtns)) return xtns_api;
|
||||
else if (ctx.Match(k, Invk_exec)) Exec(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_wiki)) return wiki;
|
||||
else if (ctx.Match(k, Invk_wikis)) return app_wikis;
|
||||
else if (ctx.Match(k, Invk_test_str)) return test_str;
|
||||
else if (ctx.Match(k, Invk_test_str_)) test_str = m.ReadStr("v");
|
||||
@@ -79,6 +81,6 @@ public class Xoapi_root implements GfoInvkAble {
|
||||
, Invk_app = "app", Invk_addon = "addon"
|
||||
, Invk_bldr = "bldr", Invk_nav = "nav", Invk_gui = "gui", Invk_html = "html", Invk_net = "net", Invk_usr = "usr", Invk_special = "special", Invk_xtns = "xtns"
|
||||
, Invk_test_str = "test_str", Invk_test_str_ = "test_str_"
|
||||
, Invk_wikis = "wikis"
|
||||
, Invk_wiki = "wiki", Invk_wikis = "wikis"
|
||||
;
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.apps.apis.xowa.addons.*;
|
||||
public class Xoapi_addon implements GfoInvkAble {
|
||||
public class Xoapi_addon implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoa_app app) {}
|
||||
public Xoapi_search_addon Search() {return search;} private final Xoapi_search_addon search = new Xoapi_search_addon();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk__search)) return search;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk__search = "search";
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
import gplx.xowa.apps.apis.xowa.apps.*; import gplx.xowa.apps.apis.xowa.envs.*; import gplx.xowa.apps.apis.xowa.startups.*;
|
||||
public class Xoapi_app implements GfoInvkAble {
|
||||
public class Xoapi_app implements Gfo_invk {
|
||||
private Xog_win_itm win;
|
||||
public void Ctor_by_app(Xoae_app app) {
|
||||
fsys.Ctor_by_app(app);
|
||||
@@ -35,7 +35,7 @@ public class Xoapi_app implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_fsys)) return fsys;
|
||||
else if (ctx.Match(k, Invk_startup)) return startup;
|
||||
else if (ctx.Match(k, Invk_env)) return env;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_exit = "exit", Invk_startup = "startup", Invk_env = "env", Invk_fsys = "fsys";
|
||||
|
||||
@@ -17,13 +17,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.apps.apis.xowa.wikis.*;
|
||||
public class Xoapi_app_wiki implements GfoInvkAble {
|
||||
public Xoapi_wiki_lang Lang() {return lang;} private final Xoapi_wiki_lang lang = new Xoapi_wiki_lang();
|
||||
public void Subscribe(GfoEvObj sub) {lang.Subscribe(sub);}
|
||||
public class Xoapi_app_wiki implements Gfo_invk {
|
||||
public Xoapi_wiki_lang Lang() {return lang;} private final Xoapi_wiki_lang lang = new Xoapi_wiki_lang();
|
||||
public Xoapi_hdump Hdump() {return hdump;} private final Xoapi_hdump hdump = new Xoapi_hdump();
|
||||
public void Subscribe(Gfo_evt_itm sub) {lang.Subscribe(sub);}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_lang)) return lang;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
if (ctx.Match(k, Invk_lang)) return lang;
|
||||
else if (ctx.Match(k, Invk_hdump)) return hdump;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_lang = "lang";
|
||||
public static final Xoapi_app_wiki Dflt = new Xoapi_app_wiki();
|
||||
private static final String Invk_lang = "lang", Invk_hdump = "hdump";
|
||||
public static final Xoapi_app_wiki Dflt = new Xoapi_app_wiki();
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ 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; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
public class Xoapi_app_wikis implements GfoInvkAble {
|
||||
private final Ordered_hash hash = Ordered_hash_.New_bry();
|
||||
public class Xoapi_app_wikis implements Gfo_invk {
|
||||
private final Ordered_hash hash = Ordered_hash_.New_bry();
|
||||
public Xoapi_app_wiki Get(byte[] domain) {
|
||||
Xoapi_app_wiki rv = (Xoapi_app_wiki)hash.Get_by(domain);
|
||||
if (rv == null) {
|
||||
@@ -28,7 +28,7 @@ public class Xoapi_app_wikis implements GfoInvkAble {
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_get)) return Get(m.ReadBry("v"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_get = "get";
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.apps.apis.xowa.bldrs.*;
|
||||
public class Xoapi_bldr implements GfoInvkAble {
|
||||
public class Xoapi_bldr implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoa_app app) {wiki.Ctor_by_app(app);}
|
||||
public Xoapi_bldr_wiki Wiki() {return wiki;} private final Xoapi_bldr_wiki wiki = new Xoapi_bldr_wiki();
|
||||
public Xoapi_bldr_wiki Wiki() {return wiki;} private final Xoapi_bldr_wiki wiki = new Xoapi_bldr_wiki();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_wiki)) return wiki;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_wiki = "wiki";
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
public class Xoapi_gui implements GfoInvkAble {
|
||||
public class Xoapi_gui implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
browser.Init_by_kit(app);
|
||||
font.Init_by_kit(app);
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.apps.apis.xowa.html.*;
|
||||
public class Xoapi_html implements GfoInvkAble {
|
||||
public class Xoapi_html implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoae_app app) {
|
||||
page.Ctor_by_app(app);
|
||||
}
|
||||
@@ -25,16 +25,16 @@ public class Xoapi_html implements GfoInvkAble {
|
||||
tidy.Init_by_kit(app);
|
||||
modules.Init_by_kit(app);
|
||||
}
|
||||
public Xoapi_tidy Tidy() {return tidy;} private final Xoapi_tidy tidy = new Xoapi_tidy();
|
||||
public Xoapi_modules Modules() {return modules;} private final Xoapi_modules modules = new Xoapi_modules();
|
||||
public Xoapi_skins Skins() {return skins;} private final Xoapi_skins skins = new Xoapi_skins();
|
||||
public Xoapi_page Page() {return page;} private final Xoapi_page page = new Xoapi_page();
|
||||
public Xoapi_tidy Tidy() {return tidy;} private final Xoapi_tidy tidy = new Xoapi_tidy();
|
||||
public Xoapi_modules Modules() {return modules;} private final Xoapi_modules modules = new Xoapi_modules();
|
||||
public Xoapi_skins Skins() {return skins;} private final Xoapi_skins skins = new Xoapi_skins();
|
||||
public Xoapi_page Page() {return page;} private final Xoapi_page page = new Xoapi_page();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_tidy)) return tidy;
|
||||
else if (ctx.Match(k, Invk_modules)) return modules;
|
||||
else if (ctx.Match(k, Invk_skins)) return skins;
|
||||
else if (ctx.Match(k, Invk_page)) return page;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_tidy = "tidy", Invk_modules = "modules", Invk_skins = "skins", Invk_page = "page";
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
import gplx.xowa.apps.apis.xowa.navs.*;
|
||||
public class Xoapi_nav implements GfoInvkAble {
|
||||
public class Xoapi_nav implements Gfo_invk {
|
||||
private Xog_win_itm win;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
win = app.Gui_mgr().Browser_win();
|
||||
wiki.Init_by_kit(app);
|
||||
}
|
||||
public Xoapi_wiki Wiki() {return wiki;} private Xoapi_wiki wiki = new Xoapi_wiki();
|
||||
public Xoapi_nav_wiki Wiki() {return wiki;} private Xoapi_nav_wiki wiki = new Xoapi_nav_wiki();
|
||||
public void Goto(String page) {win.Page__navigate_by_url_bar(page);}
|
||||
public void Go_bwd() {win.Page__navigate_by_history(Bool_.N);}
|
||||
public void Go_fwd() {win.Page__navigate_by_history(Bool_.Y);}
|
||||
@@ -33,7 +33,7 @@ public class Xoapi_nav implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_go_fwd)) this.Go_fwd();
|
||||
else if (ctx.Match(k, Invk_goto)) this.Goto(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk_wiki)) return wiki;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_go_bwd = "go_bwd", Invk_go_fwd = "go_fwd", Invk_goto = "goto", Invk_wiki = "wiki";
|
||||
|
||||
@@ -16,23 +16,23 @@ 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; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
public class Xoapi_net implements GfoInvkAble, GfoEvObj {
|
||||
public Xoapi_net() {this.ev_mgr = GfoEvMgr.new_(this);}
|
||||
public GfoEvMgr EvMgr() {return ev_mgr;} private GfoEvMgr ev_mgr;
|
||||
public class Xoapi_net implements Gfo_invk, Gfo_evt_itm {
|
||||
public Xoapi_net() {this.ev_mgr = new Gfo_evt_mgr(this);}
|
||||
public Gfo_evt_mgr Evt_mgr() {return ev_mgr;} private Gfo_evt_mgr ev_mgr;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
}
|
||||
public boolean Enabled() {return enabled;} private boolean enabled = true;
|
||||
public void Enabled_(boolean v) {
|
||||
this.enabled = v;
|
||||
gplx.core.ios.IoEngine_system.Web_access_enabled = v;
|
||||
GfoEvMgr_.PubVal(this, gplx.xowa.guis.menus.dom.Xog_mnu_evt_mgr.Evt_selected_changed, v);
|
||||
Gfo_evt_mgr_.Pub_val(this, gplx.xowa.guis.menus.dom.Xog_mnu_evt_mgr.Evt_selected_changed, v);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_enabled)) return this.Enabled();
|
||||
else if (ctx.Match(k, Invk_enabled_n_)) this.Enabled_(Bool_.N);
|
||||
else if (ctx.Match(k, Invk_enabled_y_)) this.Enabled_(Bool_.Y);
|
||||
else if (ctx.Match(k, Invk_enabled_x_)) this.Enabled_(this.Enabled());
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.apps.apis.xowa.specials.*;
|
||||
public class Xoapi_special implements GfoInvkAble {
|
||||
public class Xoapi_special implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoae_app app) {
|
||||
}
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
@@ -25,7 +25,7 @@ public class Xoapi_special implements GfoInvkAble {
|
||||
public Xoapi_search Search() {return search;} private Xoapi_search search = new Xoapi_search();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_search)) return search;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_search = "search";
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.apps.apis.xowa.usrs.*;
|
||||
public class Xoapi_usr implements GfoInvkAble {
|
||||
public class Xoapi_usr implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoae_app app) {
|
||||
bookmarks.Ctor_by_app(app);
|
||||
history.Ctor_by_app(app);
|
||||
@@ -30,16 +30,16 @@ public class Xoapi_usr implements GfoInvkAble {
|
||||
bookmarks.Init_by_kit(app);
|
||||
history.Init_by_kit(app);
|
||||
}
|
||||
public Xoapi_bookmarks Bookmarks() {return bookmarks;} private final Xoapi_bookmarks bookmarks = new Xoapi_bookmarks();
|
||||
public Xoapi_history History() {return history;} private final Xoapi_history history = new Xoapi_history();
|
||||
public Xoapi_logs Logs() {return logs;} private final Xoapi_logs logs = new Xoapi_logs();
|
||||
public Xoapi_cache Cache() {return cache;} private final Xoapi_cache cache = new Xoapi_cache();
|
||||
public Xoapi_bookmarks Bookmarks() {return bookmarks;} private final Xoapi_bookmarks bookmarks = new Xoapi_bookmarks();
|
||||
public Xoapi_history History() {return history;} private final Xoapi_history history = new Xoapi_history();
|
||||
public Xoapi_logs Logs() {return logs;} private final Xoapi_logs logs = new Xoapi_logs();
|
||||
public Xoapi_cache Cache() {return cache;} private final Xoapi_cache cache = new Xoapi_cache();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_bookmarks)) return bookmarks;
|
||||
else if (ctx.Match(k, Invk_history)) return history;
|
||||
else if (ctx.Match(k, Invk_logs)) return logs;
|
||||
else if (ctx.Match(k, Invk_cache)) return cache;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_bookmarks = "bookmarks", Invk_history = "history", Invk_logs = "logs", Invk_cache = "cache";
|
||||
}
|
||||
|
||||
27
400_xowa/src/gplx/xowa/apps/apis/xowa/Xoapi_wiki.java
Normal file
27
400_xowa/src/gplx/xowa/apps/apis/xowa/Xoapi_wiki.java
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
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; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.apps.apis.xowa.wikis.*;
|
||||
public class Xoapi_wiki implements Gfo_invk {
|
||||
public Xoapi_hdump Hdump() {return hdump;} private final Xoapi_hdump hdump = new Xoapi_hdump();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_hdump)) return hdump;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_hdump = "hdump";
|
||||
}
|
||||
@@ -17,16 +17,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
import gplx.xowa.apps.apis.xowa.xtns.*;
|
||||
public class Xoapi_xtns implements GfoInvkAble {
|
||||
public class Xoapi_xtns implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
scribunto.Init_by_kit(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 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;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String
|
||||
Invk_scribunto = "scribunto"
|
||||
|
||||
@@ -18,21 +18,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.apps.apis.xowa.addons; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.domains.crts.*;
|
||||
import gplx.xowa.apps.apis.xowa.addons.searchs.*;
|
||||
public class Xoapi_search_addon implements GfoInvkAble {
|
||||
public class Xoapi_search_addon implements Gfo_invk {
|
||||
public Xoapi_search_addon() {}
|
||||
public Xoapi_url_bar Url_bar() {return url_bar;} private final Xoapi_url_bar url_bar = new Xoapi_url_bar();
|
||||
@gplx.Internal protected Xoapi_search_box Search_box() {return search_box;} private final Xoapi_search_box search_box = new Xoapi_search_box();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk__url_bar)) return url_bar;
|
||||
else if (ctx.Match(k, Invk__search_box)) return search_box;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String
|
||||
Invk__url_bar = "url_bar"
|
||||
, Invk__search_box = "search_box"
|
||||
;
|
||||
}
|
||||
class Xoapi_search_box implements GfoInvkAble {
|
||||
class Xoapi_search_box implements Gfo_invk {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ 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.addons.searchs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.addons.*;
|
||||
import gplx.xowa.addons.apps.searchs.searchers.*; import gplx.xowa.addons.apps.searchs.searchers.crts.*;
|
||||
public class Xoapi_url_bar implements GfoInvkAble, GfoEvMgrOwner {
|
||||
import gplx.xowa.addons.wikis.searchs.searchers.*; import gplx.xowa.addons.wikis.searchs.searchers.crts.*;
|
||||
public class Xoapi_url_bar implements Gfo_invk, Gfo_evt_mgr_owner {
|
||||
public Xoapi_url_bar() {
|
||||
this.evMgr = GfoEvMgr.new_(this);
|
||||
this.evt_mgr = new Gfo_evt_mgr(this);
|
||||
}
|
||||
public GfoEvMgr EvMgr() {return evMgr;} private final GfoEvMgr evMgr;
|
||||
public Gfo_evt_mgr Evt_mgr() {return evt_mgr;} private final Gfo_evt_mgr evt_mgr;
|
||||
public boolean Enabled() {return enabled;} private boolean enabled = true;
|
||||
public int Search_mode() {return search_mode;} private int search_mode = Xoapi_search_mode_.Tid__title_word;
|
||||
public int Max_results() {return max_results;} private int max_results = 10;
|
||||
@@ -38,7 +38,7 @@ public class Xoapi_url_bar implements GfoInvkAble, GfoEvMgrOwner {
|
||||
ns_ids = Int_.Ary_parse(s, ",");
|
||||
}
|
||||
ns_mgr.Add_by_int_ids(ns_ids);
|
||||
GfoEvMgr_.Pub(this, Evt__ns_ids_changed);
|
||||
Gfo_evt_mgr_.Pub(this, Evt__ns_ids_changed);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk__enabled)) return Yn.To_str(enabled);
|
||||
@@ -54,10 +54,10 @@ public class Xoapi_url_bar implements GfoInvkAble, GfoEvMgrOwner {
|
||||
else if (ctx.Match(k, Invk__symbols)) return String_.new_u8(syms.To_bry());
|
||||
else if (ctx.Match(k, Invk__symbols_)) syms.Parse(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk__visible_rows)) return Int_.To_str(visible_rows);
|
||||
else if (ctx.Match(k, Invk__visible_rows_)) {visible_rows = m.ReadInt("v"); GfoEvMgr_.PubVal(this, Evt__visible_rows_changed, visible_rows);}
|
||||
else if (ctx.Match(k, Invk__visible_rows_)) {visible_rows = m.ReadInt("v"); Gfo_evt_mgr_.Pub_val(this, Evt__visible_rows_changed, visible_rows);}
|
||||
else if (ctx.Match(k, Invk__jump_len)) return Int_.To_str(jump_len);
|
||||
else if (ctx.Match(k, Invk__jump_len_)) {jump_len = m.ReadInt("v"); GfoEvMgr_.PubVal(this, Evt__jump_len_changed, jump_len);}
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else if (ctx.Match(k, Invk__jump_len_)) {jump_len = m.ReadInt("v"); Gfo_evt_mgr_.Pub_val(this, Evt__jump_len_changed, jump_len);}
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.apps; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.core.envs.*;
|
||||
public class Xoapi_fsys implements GfoInvkAble {
|
||||
public class Xoapi_fsys implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoae_app app) {
|
||||
this.plat_jar = Env_.AppUrl();
|
||||
this.root_dir = app.Fsys_mgr().Root_dir();
|
||||
@@ -27,7 +27,7 @@ public class Xoapi_fsys implements GfoInvkAble {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_plat_jar)) return plat_jar;
|
||||
else if (ctx.Match(k, Invk_plat_url)) return Plat_url(m.ReadStr("v"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_plat_jar = "plat_jar", Invk_plat_url = "plat_url";
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.xowa.apps.apis.xowa.bldrs; import gplx.*; import gplx.xowa.*; impor
|
||||
import gplx.xowa.apps.apis.xowa.bldrs.filters.*;
|
||||
import gplx.xowa.apps.apis.xowa.bldrs.imports.*;
|
||||
import gplx.xowa.apps.apis.xowa.bldrs.runners.*;
|
||||
public class Xoapi_bldr_wiki implements GfoInvkAble {
|
||||
public class Xoapi_bldr_wiki implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoa_app app) {
|
||||
filter.Ctor_by_app(app);
|
||||
runner.Ctor_by_app(app);
|
||||
@@ -31,7 +31,7 @@ public class Xoapi_bldr_wiki implements GfoInvkAble {
|
||||
if (ctx.Match(k, Invk_filter)) return filter;
|
||||
else if (ctx.Match(k, Invk_import)) return import_api;
|
||||
else if (ctx.Match(k, Invk_runner)) return runner;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_filter = "filter", Invk_import = "import", Invk_runner = "runner";
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.bldrs.filters; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*;
|
||||
import gplx.xowa.apps.apis.xowa.bldrs.filters.dansguardians.*;
|
||||
public class Xoapi_filter implements GfoInvkAble {
|
||||
public class Xoapi_filter implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoa_app app) {dansguardian.Ctor_by_app(app);}
|
||||
public Xoapi_dansguardian Dansguardian() {return dansguardian;} private final Xoapi_dansguardian dansguardian = new Xoapi_dansguardian();
|
||||
public Xoapi_dansguardian Dansguardian() {return dansguardian;} private final Xoapi_dansguardian dansguardian = new Xoapi_dansguardian();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_dansguardian)) return dansguardian;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_dansguardian = "dansguardian";
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.bldrs.filters.dansguardians; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*; import gplx.xowa.apps.apis.xowa.bldrs.filters.*;
|
||||
import gplx.core.ios.*; import gplx.xowa.bldrs.filters.dansguardians.*;
|
||||
public class Xoapi_dansguardian implements GfoInvkAble {
|
||||
public class Xoapi_dansguardian implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoa_app app) {
|
||||
root_dir = app.Fsys_mgr().Bin_xowa_dir().GenSubDir_nest("cfg", "bldr", "filter");
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class Xoapi_dansguardian implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_target_tid_)) target_tid = m.ReadInt("v");
|
||||
else if (ctx.Match(k, Invk_log_enabled)) return Yn.To_str(log_enabled);
|
||||
else if (ctx.Match(k, Invk_log_enabled_)) log_enabled = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -16,7 +16,7 @@ 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.bldrs.filters.titles; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*; import gplx.xowa.apps.apis.xowa.bldrs.filters.*;
|
||||
public class Xoapi_title implements GfoInvkAble {
|
||||
public class Xoapi_title implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
// wordlist_dir = app.Fsys_mgr().Bin_xtns_dir().GenSubDir_nest("xowa", "DansGuardian");
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class Xoapi_title implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_score_pass_)) score_pass = m.ReadInt("v");
|
||||
else if (ctx.Match(k, Invk_log_enabled)) return Yn.To_str(enabled);
|
||||
else if (ctx.Match(k, Invk_log_enabled_)) log_enabled = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -16,9 +16,10 @@ 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.bldrs.imports; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*;
|
||||
import gplx.core.ios.*; import gplx.xowa.wikis.data.*; import gplx.xowa.apps.apis.xowa.bldrs.imports.page_ranks.*;
|
||||
public class Xoapi_import implements GfoInvkAble {
|
||||
public Xoapi_page_rank Page_rank() {return page_rank;} private final Xoapi_page_rank page_rank = new Xoapi_page_rank();
|
||||
import gplx.core.ios.*; import gplx.core.ios.streams.*;
|
||||
import gplx.xowa.wikis.data.*; import gplx.xowa.apps.apis.xowa.bldrs.imports.page_ranks.*;
|
||||
public class Xoapi_import implements Gfo_invk {
|
||||
public Xoapi_page_rank Page_rank() {return page_rank;} private final Xoapi_page_rank page_rank = new Xoapi_page_rank();
|
||||
public long Layout_all_max() {return layout_all_max;} private long layout_all_max = 0; // disable by default; may set to 200 MB in future
|
||||
public long Layout_text_max() {return layout_text_max;} private long layout_text_max = Io_size_.To_long_by_int_mb(1500); // 1.5 GB
|
||||
public long Layout_html_max() {return layout_html_max;} private long layout_html_max = Io_size_.To_long_by_int_mb(1500); // 1.5 GB
|
||||
@@ -34,18 +35,21 @@ public class Xoapi_import implements GfoInvkAble {
|
||||
public boolean Hzip_mode_is_b256() {return hzip_mode_is_b256;} private boolean hzip_mode_is_b256 = Bool_.Y;
|
||||
public String User_name() {return user_name;} private String user_name = "anonymous";
|
||||
public Xowd_core_db_props New_props(String domain_str, long dump_file_size) {
|
||||
Xowd_db_layout layout_text, layout_html, layout_file;
|
||||
Xow_db_layout layout_text, layout_html, layout_file;
|
||||
if (dump_file_size < layout_all_max)
|
||||
layout_text = layout_html = layout_file = Xowd_db_layout.Itm_all;
|
||||
layout_text = layout_html = layout_file = Xow_db_layout.Itm_all;
|
||||
else {
|
||||
layout_text = dump_file_size < layout_text_max ? Xowd_db_layout.Itm_few : Xowd_db_layout.Itm_lot;
|
||||
layout_html = dump_file_size < layout_html_max ? Xowd_db_layout.Itm_few : Xowd_db_layout.Itm_lot;
|
||||
layout_file = dump_file_size < layout_file_max ? Xowd_db_layout.Itm_few : Xowd_db_layout.Itm_lot;
|
||||
layout_text = dump_file_size < layout_text_max ? Xow_db_layout.Itm_few : Xow_db_layout.Itm_lot;
|
||||
layout_html = dump_file_size < layout_html_max ? Xow_db_layout.Itm_few : Xow_db_layout.Itm_lot;
|
||||
layout_file = dump_file_size < layout_file_max ? Xow_db_layout.Itm_few : Xow_db_layout.Itm_lot;
|
||||
}
|
||||
return new Xowd_core_db_props(2, layout_text, layout_html, layout_file, zip_tid_text, zip_tid_html, hzip_enabled, hzip_mode_is_b256);
|
||||
}
|
||||
public byte[] New_ns_file_map(long dump_file_size) {
|
||||
return dump_file_size < layout_text_max ? Bry_.Empty : Ns_file_map__each;
|
||||
return dump_file_size < layout_text_max
|
||||
? gplx.xowa.bldrs.cmds.Xob_ns_file_itm_parser.Ns_file_map__few
|
||||
: gplx.xowa.bldrs.cmds.Xob_ns_file_itm_parser.Ns_file_map__each; // DB.FEW: DATE:2016-06-07
|
||||
// return dump_file_size < layout_text_max ? Bry_.Empty : Ns_file_map__each;
|
||||
}
|
||||
public void Zip_tid_text_raw_() {zip_tid_text = Io_stream_.Tid_raw;} // TEST:
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
@@ -79,10 +83,10 @@ public class Xoapi_import implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_user_name)) return user_name;
|
||||
else if (ctx.Match(k, Invk_user_name_)) user_name = m.ReadStr("v");
|
||||
else if (ctx.Match(k, Invk_page_rank)) return page_rank;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static Keyval[] Options_zip_tid__list = Keyval_.Ary(Keyval_.new_("raw", "text"), Keyval_.new_("gzip"), Keyval_.new_("bzip2"));
|
||||
private static final Keyval[] Options_zip_tid__list = Keyval_.Ary(Keyval_.new_("raw", "text"), Keyval_.new_("gzip"), Keyval_.new_("bzip2"));
|
||||
private static final String
|
||||
Invk_layout_all_max = "layout_all_max" , Invk_layout_all_max_ = "layout_all_max_"
|
||||
, Invk_layout_text_max = "layout_text_max" , Invk_layout_text_max_ = "layout_text_max_"
|
||||
@@ -100,5 +104,5 @@ public class Xoapi_import implements GfoInvkAble {
|
||||
, Invk_hzip_mode_is_b256 = "hzip_mode_is_b256" , Invk_hzip_mode_is_b256_ = "hzip_mode_is_b256_"
|
||||
, Invk_page_rank = "page_rank"
|
||||
;
|
||||
public static final byte[] Ns_file_map__each = Bry_.new_a7("<each>");
|
||||
public static final byte[] Ns_file_map__each = Bry_.new_a7("<each>");
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ 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.bldrs.imports.page_ranks; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*; import gplx.xowa.apps.apis.xowa.bldrs.imports.*;
|
||||
public class Xoapi_page_rank implements GfoInvkAble {
|
||||
public class Xoapi_page_rank implements Gfo_invk {
|
||||
public int Iteration_max() {return iteration_max;} private int iteration_max = 0;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_iteration_max)) return Int_.To_str(iteration_max);
|
||||
else if (ctx.Match(k, Invk_iteration_max_)) iteration_max = m.ReadInt("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -16,7 +16,7 @@ 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.bldrs.runners; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.bldrs.*;
|
||||
public class Xoapi_runner implements GfoInvkAble {
|
||||
public class Xoapi_runner implements Gfo_invk {
|
||||
// private Xoa_app app;
|
||||
public void Ctor_by_app(Xoa_app app) {}//this.app = app;}
|
||||
private void Exec(GfoMsg msg) {
|
||||
@@ -36,7 +36,7 @@ public class Xoapi_runner implements GfoInvkAble {
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_exec)) Exec(m);
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_exec = "exec";
|
||||
|
||||
@@ -16,13 +16,13 @@ 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.envs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
public class Xoapi_env implements GfoInvkAble {
|
||||
public class Xoapi_env implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {}
|
||||
public String Version_previous() {return version_previous;} private String version_previous = "";
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_version_previous)) return version_previous;
|
||||
else if (ctx.Match(k, Invk_version_previous_)) version_previous = m.ReadStr("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_version_previous = "version_previous", Invk_version_previous_ = "version_previous_";
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.gui; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.apps.apis.xowa.gui.browsers.*;
|
||||
public class Xoapi_browser implements GfoInvkAble {
|
||||
public class Xoapi_browser implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
url.Init_by_kit(app);
|
||||
search.Init_by_kit(app);
|
||||
@@ -45,7 +45,7 @@ public class Xoapi_browser implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_prog)) return prog;
|
||||
else if (ctx.Match(k, Invk_info)) return info;
|
||||
else if (ctx.Match(k, Invk_prog_log)) return prog_log;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String
|
||||
Invk_url = "url", Invk_search = "search", Invk_tabs = "tabs", Invk_html = "html"
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.gui; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.apps.cfgs.gui.*; import gplx.xowa.htmls.*;
|
||||
public class Xoapi_font implements GfoInvkAble {
|
||||
public class Xoapi_font implements Gfo_invk {
|
||||
private Xoae_app app;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
this.app = app;
|
||||
@@ -46,7 +46,7 @@ public class Xoapi_font implements GfoInvkAble {
|
||||
if (ctx.Match(k, Invk_increase)) this.Increase();
|
||||
else if (ctx.Match(k, Invk_decrease)) this.Decrease();
|
||||
else if (ctx.Match(k, Invk_reset)) this.Reset();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.gui; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.apps.apis.xowa.gui.pages.*;
|
||||
public class Xoapi_page implements GfoInvkAble {
|
||||
public class Xoapi_page implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
view.Init_by_kit(app);
|
||||
selection.Init_by_kit(app);
|
||||
@@ -30,7 +30,7 @@ public class Xoapi_page implements GfoInvkAble {
|
||||
if (ctx.Match(k, Invk_view)) return view;
|
||||
else if (ctx.Match(k, Invk_selection)) return selection;
|
||||
else if (ctx.Match(k, Invk_edit)) return edit;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_view = "view", Invk_selection = "selection", Invk_edit = "edit";
|
||||
}
|
||||
|
||||
@@ -16,8 +16,9 @@ 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.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*; import gplx.xowa.wikis.pages.*; import gplx.xowa.guis.*; import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_find implements GfoInvkAble {
|
||||
import gplx.gfui.*; import gplx.gfui.controls.standards.*;
|
||||
import gplx.xowa.wikis.pages.*; import gplx.xowa.guis.*; import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_find implements Gfo_invk {
|
||||
private Xog_find_box find_box;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
find_box = new Xog_find_box(app);
|
||||
@@ -32,7 +33,7 @@ public class Xoapi_find implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_case_toggle)) find_box.Case_toggle();
|
||||
else if (ctx.Match(k, Invk_wrap_toggle)) find_box.Wrap_toggle();
|
||||
else if (ctx.Match(k, Invk_hide)) find_box.Hide();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_show = "show", Invk_show_by_paste = "show_by_paste", Invk_hide = "hide", Invk_exec = "exec", Invk_type = "type"
|
||||
|
||||
@@ -16,13 +16,14 @@ 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.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*; import gplx.xowa.wikis.pages.*; import gplx.xowa.guis.*; import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_html_box implements GfoInvkAble, GfoEvMgrOwner {
|
||||
import gplx.gfui.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.standards.*;
|
||||
import gplx.xowa.wikis.pages.*; import gplx.xowa.guis.*; import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_html_box implements Gfo_invk, Gfo_evt_mgr_owner {
|
||||
private Xog_win_itm win;
|
||||
public Xoapi_html_box() {
|
||||
evMgr = GfoEvMgr.new_(this);
|
||||
evt_mgr = new Gfo_evt_mgr(this);
|
||||
}
|
||||
public GfoEvMgr EvMgr() {return evMgr;} private GfoEvMgr evMgr;
|
||||
public Gfo_evt_mgr Evt_mgr() {return evt_mgr;} private Gfo_evt_mgr evt_mgr;
|
||||
public void Init_by_kit(Xoae_app app) {this.win = app.Gui_mgr().Browser_win();}
|
||||
public byte Load_tid() {return load_tid;} private byte load_tid;
|
||||
public void Focus() {
|
||||
@@ -41,9 +42,9 @@ public class Xoapi_html_box implements GfoInvkAble, GfoEvMgrOwner {
|
||||
if (ctx.Match(k, Invk_focus)) this.Focus();
|
||||
else if (ctx.Match(k, Invk_selection_focus_toggle)) this.Selection_focus();
|
||||
else if (ctx.Match(k, Invk_load_tid)) return Gxw_html_load_tid_.Xto_key(load_tid);
|
||||
else if (ctx.Match(k, Invk_load_tid_)) {load_tid = Gxw_html_load_tid_.Xto_tid(m.ReadStr("v")); GfoEvMgr_.PubVal(this, Evt_load_tid_changed, load_tid);}
|
||||
else if (ctx.Match(k, Invk_load_tid_)) {load_tid = Gxw_html_load_tid_.Xto_tid(m.ReadStr("v")); Gfo_evt_mgr_.Pub_val(this, Evt_load_tid_changed, load_tid);}
|
||||
else if (ctx.Match(k, Invk_load_tid_list)) return Gxw_html_load_tid_.Options__list;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_focus = "focus", Invk_selection_focus_toggle = "selection_focus_toggle"
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*; import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_info implements Gfo_usr_dlg__gui__opt, GfoInvkAble {
|
||||
public class Xoapi_info implements Gfo_usr_dlg__gui__opt, Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {this.app = app;} private Xoae_app app;
|
||||
private Xog_win_itm Win() {return app.Gui_mgr().Browser_win();}
|
||||
public void Focus() {this.Win().Info_box().Focus();}
|
||||
@@ -36,7 +36,7 @@ public class Xoapi_info implements Gfo_usr_dlg__gui__opt, GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_warn_enabled_)) warn_enabled = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Invk_note_enabled)) return Yn.To_str(note_enabled);
|
||||
else if (ctx.Match(k, Invk_note_enabled_)) note_enabled = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_focus = "focus", Invk_clear = "clear", Invk_launch = "launch"
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*; import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_prog implements GfoInvkAble {
|
||||
public class Xoapi_prog implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {this.app = app;} private Xoae_app app;
|
||||
private Xog_win_itm Win() {return app.Gui_mgr().Browser_win();}
|
||||
public boolean Show_short_url() {return show_short_url;} private boolean show_short_url;
|
||||
@@ -27,7 +27,7 @@ public class Xoapi_prog implements GfoInvkAble {
|
||||
if (ctx.Match(k, Invk_focus)) this.Focus();
|
||||
else if (ctx.Match(k, Invk_show_short_url)) return Yn.To_str(show_short_url);
|
||||
else if (ctx.Match(k, Invk_show_short_url_)) show_short_url = m.ReadBool("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_focus = "focus", Invk_show_short_url = "show_short_url", Invk_show_short_url_ = "show_short_url_";
|
||||
|
||||
@@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*; import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_prog_log implements GfoInvkAble {
|
||||
public class Xoapi_prog_log implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {this.app = app;} private Xoae_app app;
|
||||
public void Show() {app.Gui_mgr().Show_prog();}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_show)) this.Show();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_show = "show";
|
||||
|
||||
@@ -16,8 +16,8 @@ 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.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*; import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_search implements GfoInvkAble {
|
||||
import gplx.gfui.*; import gplx.gfui.controls.standards.*; import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_search implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {this.app = app;} private Xoae_app app;
|
||||
private GfuiTextBox Search_box() {return app.Gui_mgr().Browser_win().Search_box();}
|
||||
private Xog_win_itm Win() {return app.Gui_mgr().Browser_win();}
|
||||
@@ -26,7 +26,7 @@ public class Xoapi_search implements GfoInvkAble {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_focus)) this.Focus();
|
||||
else if (ctx.Match(k, Invk_exec)) this.Exec();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_focus = "focus";
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_tabs implements GfoInvkAble {
|
||||
public class Xoapi_tabs implements Gfo_invk {
|
||||
private Xog_tab_mgr tab_mgr;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
this.tab_mgr = app.Gui_mgr().Browser_win().Tab_mgr();
|
||||
@@ -70,7 +70,7 @@ public class Xoapi_tabs implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_select_by_idx_7)) this.Select_by_idx(7);
|
||||
else if (ctx.Match(k, Invk_select_by_idx_8)) this.Select_by_idx(8);
|
||||
else if (ctx.Match(k, Invk_select_by_idx_9)) this.Select_by_idx(9);
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -16,8 +16,9 @@ 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.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*; import gplx.xowa.guis.views.*; import gplx.core.envs.*;
|
||||
public class Xoapi_url implements GfoInvkAble {
|
||||
import gplx.gfui.*; import gplx.gfui.envs.*; import gplx.gfui.controls.standards.*;
|
||||
import gplx.xowa.guis.views.*; import gplx.core.envs.*;
|
||||
public class Xoapi_url implements Gfo_invk {
|
||||
private Xoae_app app;
|
||||
private Xoapi_url_searcher url_searcher;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
@@ -74,7 +75,7 @@ public class Xoapi_url implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_exec_new_tab_by_paste)) this.Exec_new_tab_by_paste();
|
||||
else if (ctx.Match(k, Invk_restore)) this.Restore();
|
||||
else if (ctx.Match(k, Invk_type)) this.Type();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_focus = "focus", Invk_exec_by_paste = "exec_by_paste", Invk_exec_new_tab_by_paste = "exec_new_tab_by_paste", Invk_restore = "restore", Invk_type = "type";
|
||||
|
||||
@@ -16,24 +16,24 @@ 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.gui.browsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*;
|
||||
import gplx.xowa.addons.apps.searchs.*; import gplx.xowa.addons.apps.searchs.searchers.*; import gplx.xowa.addons.apps.searchs.searchers.cbks.*;
|
||||
import gplx.gfui.*; import gplx.gfui.controls.standards.*;
|
||||
import gplx.xowa.addons.wikis.searchs.*; import gplx.xowa.addons.wikis.searchs.searchers.*; import gplx.xowa.addons.wikis.searchs.searchers.cbks.*;
|
||||
import gplx.xowa.apps.apis.xowa.addons.searchs.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
class Xoapi_url_searcher implements GfoEvObj {
|
||||
class Xoapi_url_searcher implements Gfo_evt_itm {
|
||||
private final Xoae_app app;
|
||||
private final Xoapi_url_bar url_bar_api; private Srch_search_addon addon;
|
||||
private final GfuiComboBox url_bar;
|
||||
public Xoapi_url_searcher(Xoae_app app) { // called by Init_by_kit
|
||||
this.app = app;
|
||||
this.evMgr = GfoEvMgr.new_(this);
|
||||
this.evt_mgr = new Gfo_evt_mgr(this);
|
||||
this.url_bar = app.Gui_mgr().Browser_win().Url_box();
|
||||
this.url_bar_api = app.Api_root().Addon().Search().Url_bar();
|
||||
GfoEvMgr_.SubSame_many(url_bar_api, this, Xoapi_url_bar.Evt__jump_len_changed, Xoapi_url_bar.Evt__visible_rows_changed, Xoapi_url_bar.Evt__ns_ids_changed);
|
||||
Gfo_evt_mgr_.Sub_same_many(url_bar_api, this, Xoapi_url_bar.Evt__jump_len_changed, Xoapi_url_bar.Evt__visible_rows_changed, Xoapi_url_bar.Evt__ns_ids_changed);
|
||||
url_bar.Items__jump_len_(url_bar_api.Jump_len());
|
||||
url_bar.Items__visible_rows_(url_bar_api.Visible_rows());
|
||||
}
|
||||
public GfoEvMgr EvMgr() {return evMgr;} private final GfoEvMgr evMgr;
|
||||
public Gfo_evt_mgr Evt_mgr() {return evt_mgr;} private final Gfo_evt_mgr evt_mgr;
|
||||
public void Search() {
|
||||
if (!url_bar_api.Enabled()) return;
|
||||
Xog_tab_itm active_tab = app.Gui_mgr().Browser_win().Tab_mgr().Active_tab(); if (active_tab == null) return;
|
||||
|
||||
@@ -16,8 +16,9 @@ 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.gui.pages; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.kits.core.*;
|
||||
import gplx.xowa.guis.*; import gplx.xowa.guis.views.*; import gplx.xowa.wikis.pages.*;
|
||||
public class Xoapi_edit implements GfoInvkAble {
|
||||
public class Xoapi_edit implements Gfo_invk {
|
||||
private Xog_win_itm win;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
win = app.Gui_mgr().Browser_win();
|
||||
@@ -25,7 +26,7 @@ public class Xoapi_edit implements GfoInvkAble {
|
||||
private boolean Active_tab_is_null() {return win.Tab_mgr().Active_tab_is_null();}
|
||||
private boolean Active_tab_is_edit() {return !win.Tab_mgr().Active_tab_is_null() && win.Tab_mgr().Active_tab().View_mode() == Xopg_page_.Tid_edit;}
|
||||
public void Copy() {if (Active_tab_is_null()) return; win.Kit().Clipboard().Copy(win.Active_html_itm().Html_selected_get_text_or_href());}
|
||||
public void Select_all() {if (Active_tab_is_null()) return; GfoInvkAble_.InvkCmd(win.Win_box().Kit().Clipboard(), gplx.gfui.Gfui_clipboard_.Invk_select_all);}
|
||||
public void Select_all() {if (Active_tab_is_null()) return; Gfo_invk_.Invk_by_key(win.Win_box().Kit().Clipboard(), Gfui_clipboard_.Invk_select_all);}
|
||||
public void Save() {if (!Active_tab_is_edit()) return; Xog_tab_itm_edit_mgr.Save(win.Active_tab(), false);}
|
||||
public void Save_draft() {if (!Active_tab_is_edit()) return; Xog_tab_itm_edit_mgr.Save(win.Active_tab(), true);}
|
||||
public void Preview() {if (!Active_tab_is_edit()) return; Xog_tab_itm_edit_mgr.Preview(win.Active_tab());}
|
||||
@@ -44,7 +45,7 @@ public class Xoapi_edit implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_dbg_tmpl)) this.Dbg_tmpl();
|
||||
else if (ctx.Match(k, Invk_dbg_html)) this.Dbg_html();
|
||||
else if (ctx.Match(k, Invk_exec)) this.Exec();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -16,8 +16,8 @@ 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.gui.pages; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*; import gplx.xowa.guis.*; import gplx.xowa.guis.views.*; import gplx.core.envs.*;
|
||||
public class Xoapi_selection implements GfoInvkAble {
|
||||
import gplx.gfui.*; import gplx.gfui.kits.core.*; import gplx.xowa.guis.*; import gplx.xowa.guis.views.*; import gplx.core.envs.*;
|
||||
public class Xoapi_selection implements Gfo_invk {
|
||||
private Xoae_app app; private Xog_win_itm win;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
this.app = app;
|
||||
@@ -25,7 +25,7 @@ public class Xoapi_selection implements GfoInvkAble {
|
||||
}
|
||||
private boolean Active_tab_is_null() {return win.Tab_mgr().Active_tab_is_null();}
|
||||
public void Copy() {if (Active_tab_is_null()) return; win.Kit().Clipboard().Copy(win.Active_html_itm().Html_selected_get_text_or_href());}
|
||||
public void Select_all() {if (Active_tab_is_null()) return; GfoInvkAble_.InvkCmd(win.Win_box().Kit().Clipboard(), gplx.gfui.Gfui_clipboard_.Invk_select_all);}
|
||||
public void Select_all() {if (Active_tab_is_null()) return; Gfo_invk_.Invk_by_key(win.Win_box().Kit().Clipboard(), Gfui_clipboard_.Invk_select_all);}
|
||||
public void Save_file_as() {
|
||||
if (this.Active_tab_is_null()) return;
|
||||
Xog_html_itm html_itm = win.Tab_mgr().Active_tab().Html_itm();
|
||||
@@ -43,7 +43,7 @@ public class Xoapi_selection implements GfoInvkAble {
|
||||
if (ctx.Match(k, Invk_copy)) this.Copy();
|
||||
else if (ctx.Match(k, Invk_select_all)) this.Select_all();
|
||||
else if (ctx.Match(k, Invk_save_file_as)) this.Save_file_as();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -16,8 +16,8 @@ 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.gui.pages; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.gui.*;
|
||||
import gplx.gfui.*; import gplx.xowa.guis.*; import gplx.xowa.guis.views.*; import gplx.xowa.wikis.pages.*;
|
||||
public class Xoapi_view implements GfoInvkAble {
|
||||
import gplx.gfui.*; import gplx.gfui.kits.core.*; import gplx.xowa.guis.*; import gplx.xowa.guis.views.*; import gplx.xowa.wikis.pages.*;
|
||||
public class Xoapi_view implements Gfo_invk {
|
||||
private Xoae_app app; private Xog_win_itm win;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
this.app = app; this.win = app.Gui_mgr().Browser_win();
|
||||
@@ -50,7 +50,7 @@ public class Xoapi_view implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_refresh)) this.Refresh();
|
||||
else if (ctx.Match(k, Invk_print)) this.Print();
|
||||
else if (ctx.Match(k, Invk_save_as)) this.Save_as();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.html; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.apps.apis.xowa.html.modules.*;
|
||||
public class Xoapi_modules implements GfoInvkAble {
|
||||
public class Xoapi_modules implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
popups.Init_by_app(app);
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public class Xoapi_modules implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_navframe)) return navframe;
|
||||
else if (ctx.Match(k, Invk_toc)) return toc;
|
||||
else if (ctx.Match(k, Invk_popups)) return popups;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_collapsible = "collapsible", Invk_navframe = "navframe", Invk_toc = "toc", Invk_popups = "popups";
|
||||
}
|
||||
|
||||
@@ -16,18 +16,14 @@ 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.html; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.core.btries.*;
|
||||
public class Xoapi_page implements GfoInvkAble {
|
||||
public class Xoapi_page implements Gfo_invk {
|
||||
public void Ctor_by_app(Xoae_app app) {
|
||||
toggle_mgr.Ctor_by_app(app);
|
||||
}
|
||||
public boolean View_html_generates_hdump() {return view_html_generates_hdump;} private boolean view_html_generates_hdump = false;
|
||||
public Xoapi_toggle_mgr Toggle_mgr() {return toggle_mgr;} private final Xoapi_toggle_mgr toggle_mgr = new Xoapi_toggle_mgr();
|
||||
public Xoapi_toggle_mgr Toggle_mgr() {return toggle_mgr;} private final Xoapi_toggle_mgr toggle_mgr = new Xoapi_toggle_mgr();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_toggles)) return toggle_mgr;
|
||||
else if (ctx.Match(k, Invk_view_html_generates_hdump_)) view_html_generates_hdump = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
return this;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_toggles = "toggles", Invk_view_html_generates_hdump_ = "view_html_generates_hdump_";
|
||||
private static final String Invk_toggles = "toggles";
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.html; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.apps.apis.xowa.html.skins.*;
|
||||
public class Xoapi_skins implements GfoInvkAble {
|
||||
private Hash_adp hash = Hash_adp_.new_();
|
||||
public class Xoapi_skins implements Gfo_invk {
|
||||
private Hash_adp hash = Hash_adp_.New();
|
||||
public Xoapi_skins() {
|
||||
server.Sidebar_home_enabled_(true);
|
||||
hash.Add("desktop", desktop);
|
||||
@@ -26,7 +26,7 @@ public class Xoapi_skins implements GfoInvkAble {
|
||||
}
|
||||
public Xoapi_skin_app_base Desktop() {return desktop;} private Xoapi_skin_app_base desktop = new Xoapi_skin_app_base();
|
||||
public Xoapi_skin_app_base Server () {return server ;} private Xoapi_skin_app_base server = new Xoapi_skin_app_base();
|
||||
private GfoInvkAble Get(String key) {return (GfoInvkAble)hash.Get_by(key);}
|
||||
private Gfo_invk Get(String key) {return (Gfo_invk)hash.Get_by(key);}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_get)) return Get(m.ReadStr("v"));
|
||||
return this;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.html; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.htmls.core.htmls.tidy.*;
|
||||
public class Xoapi_tidy implements GfoInvkAble {
|
||||
public class Xoapi_tidy implements Gfo_invk {
|
||||
private Xoae_app app;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
this.app = app;
|
||||
@@ -33,7 +33,7 @@ public class Xoapi_tidy implements GfoInvkAble {
|
||||
if (ctx.Match(k, Invk_toggle)) this.Toggle();
|
||||
else if (ctx.Match(k, Invk_engine_tidy_)) Engine_(Xoh_tidy_wkr_.Tid_tidy);
|
||||
else if (ctx.Match(k, Invk_engine_jtidy_)) Engine_(Xoh_tidy_wkr_.Tid_jtidy);
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_toggle = "toggle", Invk_engine_tidy_ = "engine_tidy_", Invk_engine_jtidy_ = "engine_jtidy_";
|
||||
|
||||
@@ -17,13 +17,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.html; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.core.brys.fmtrs.*;
|
||||
public class Xoapi_toggle_itm implements GfoInvkAble {
|
||||
private final Xoae_app app; // NOTE: needed to get "img_dir" below
|
||||
public class Xoapi_toggle_itm implements Gfo_invk {
|
||||
private final Xoae_app app; // NOTE: needed to get "img_dir" below
|
||||
private byte[] img_title_val_y, img_title_val_n;
|
||||
public Xoapi_toggle_itm(Xoae_app app, byte[] key_bry) {
|
||||
this.app = app; this.key_bry = key_bry;
|
||||
}
|
||||
public byte[] Key_bry() {return key_bry;} private final byte[] key_bry;
|
||||
public byte[] Key_bry() {return key_bry;} private final byte[] key_bry;
|
||||
public byte[] Heading_bry() {return heading_bry;} private byte[] heading_bry;
|
||||
public byte[] Icon_src() {return icon_src;} private byte[] icon_src = Bry_.Empty;
|
||||
public byte[] Icon_title() {return icon_title;} private byte[] icon_title = Bry_.Empty;
|
||||
@@ -69,7 +69,7 @@ public class Xoapi_toggle_itm implements GfoInvkAble {
|
||||
icon_title = img_title_val_n;
|
||||
elem_display = Img_display_n;
|
||||
}
|
||||
Bry_fmtr fmtr = Bry_fmtr.new_(); Bry_bfr bfr = Bry_bfr.new_(8);
|
||||
Bry_fmtr fmtr = Bry_fmtr.new_(); Bry_bfr bfr = Bry_bfr_.New_w_size(8);
|
||||
html_toggle_btn
|
||||
= fmtr.Fmt_("<a href='javascript:xowa_toggle_visible(\"~{key}\");' style='text-decoration: none !important;'>~{heading}<img id='~{key}-toggle-icon' src='~{src}' title='~{title}' /></a>")
|
||||
.Keys_("key", "src", "title", "heading").Bld_bry_many(bfr, key_bry, icon_src, icon_title, heading_bry)
|
||||
@@ -82,12 +82,12 @@ public class Xoapi_toggle_itm implements GfoInvkAble {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_visible)) return Yn.To_str(visible);
|
||||
else if (ctx.Match(k, Invk_visible_)) this.visible = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_visible = "visible", Invk_visible_ = "visible_";
|
||||
private static byte[] Img_src_y, Img_src_n; // assume these are the same for all itms
|
||||
private static final byte[]
|
||||
private static final byte[]
|
||||
Img_title_msg_y = Bry_.new_a7("hide"), Img_title_msg_n = Bry_.new_a7("show")
|
||||
, Img_display_y = Bry_.new_a7("display:;"), Img_display_n = Bry_.new_a7("display:none;")
|
||||
;
|
||||
|
||||
@@ -17,9 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.html; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.apps.cfgs.*;
|
||||
public class Xoapi_toggle_mgr implements GfoInvkAble {
|
||||
public class Xoapi_toggle_mgr implements Gfo_invk {
|
||||
private Xoae_app app;
|
||||
private final Ordered_hash hash = Ordered_hash_.New_bry();
|
||||
private final Ordered_hash hash = Ordered_hash_.New_bry();
|
||||
public void Ctor_by_app(Xoae_app app) {this.app = app;}
|
||||
public Xoapi_toggle_itm Get_or_new(String key_str) {
|
||||
byte[] key_bry = Bry_.new_u8(key_str);
|
||||
@@ -46,7 +46,7 @@ public class Xoapi_toggle_mgr implements GfoInvkAble {
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_get)) return this.Get_or_new(m.ReadStr("key"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_get = "get";
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ 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.html.modules; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.html.*;
|
||||
public class Xoapi_collapsible implements GfoInvkAble {
|
||||
public class Xoapi_collapsible implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
}
|
||||
public boolean Collapsed() {return collapsed;} private boolean collapsed;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_collapsed)) return Yn.To_str(collapsed);
|
||||
else if (ctx.Match(k, Invk_collapsed_)) collapsed = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -16,14 +16,14 @@ 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.html.modules; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.html.*;
|
||||
public class Xoapi_navframe implements GfoInvkAble {
|
||||
public class Xoapi_navframe implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
}
|
||||
public boolean Collapsed() {return collapsed;} private boolean collapsed;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_collapsed)) return Yn.To_str(collapsed);
|
||||
else if (ctx.Match(k, Invk_collapsed_)) collapsed = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.html.modules; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.html.*;
|
||||
import gplx.xowa.htmls.modules.popups.*;
|
||||
public class Xoapi_popups implements GfoInvkAble, GfoEvMgrOwner {
|
||||
public class Xoapi_popups implements Gfo_invk, Gfo_evt_mgr_owner {
|
||||
private Xoae_app app;
|
||||
public Xoapi_popups() {
|
||||
evMgr = GfoEvMgr.new_(this);
|
||||
evt_mgr = new Gfo_evt_mgr(this);
|
||||
}
|
||||
public GfoEvMgr EvMgr() {return evMgr;} private GfoEvMgr evMgr;
|
||||
public Gfo_evt_mgr Evt_mgr() {return evt_mgr;} private Gfo_evt_mgr evt_mgr;
|
||||
public void Init_by_app(Xoae_app app) {this.app = app;}
|
||||
public boolean Enabled() {return enabled;} public void Enabled_(boolean v) {enabled = v;} private boolean enabled = true;
|
||||
public int Show_init_word_count() {return show_init_word_count;} private int show_init_word_count = Dflt_show_init_word_count;
|
||||
@@ -83,51 +83,51 @@ public class Xoapi_popups implements GfoInvkAble, GfoEvMgrOwner {
|
||||
else if (ctx.Match(k, Invk_win_bind_focus_blur)) return Yn.To_str(win_bind_focus_blur);
|
||||
else if (ctx.Match(k, Invk_win_bind_focus_blur_)) win_bind_focus_blur = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Invk_xnde_ignore_ids)) return String_.new_u8(xnde_ignore_ids);
|
||||
else if (ctx.Match(k, Invk_xnde_ignore_ids_)) {xnde_ignore_ids = m.ReadBry("v"); GfoEvMgr_.PubVal(this, Evt_xnde_ignore_ids_changed, xnde_ignore_ids);}
|
||||
else if (ctx.Match(k, Invk_xnde_ignore_ids_)) {xnde_ignore_ids = m.ReadBry("v"); Gfo_evt_mgr_.Pub_val(this, Evt_xnde_ignore_ids_changed, xnde_ignore_ids);}
|
||||
else if (ctx.Match(k, Invk_scan_len)) return scan_len;
|
||||
else if (ctx.Match(k, Invk_scan_len_)) {scan_len = Set_int_gt_0(m, scan_len, Evt_scan_len_changed);}
|
||||
else if (ctx.Match(k, Invk_scan_max)) return scan_max;
|
||||
else if (ctx.Match(k, Invk_scan_max_)) {scan_max = Set_int_gt_0(m, scan_max, Evt_scan_max_changed);}
|
||||
else if (ctx.Match(k, Invk_read_til_stop_fwd)) return read_til_stop_fwd;
|
||||
else if (ctx.Match(k, Invk_read_til_stop_fwd_)) {read_til_stop_fwd = m.ReadInt("v"); GfoEvMgr_.PubVal(this, Evt_read_til_stop_fwd_changed, read_til_stop_fwd);}
|
||||
else if (ctx.Match(k, Invk_read_til_stop_fwd_)) {read_til_stop_fwd = m.ReadInt("v"); Gfo_evt_mgr_.Pub_val(this, Evt_read_til_stop_fwd_changed, read_til_stop_fwd);}
|
||||
else if (ctx.Match(k, Invk_read_til_stop_bwd)) return read_til_stop_bwd;
|
||||
else if (ctx.Match(k, Invk_read_til_stop_bwd_)) {read_til_stop_bwd = m.ReadInt("v"); GfoEvMgr_.PubVal(this, Evt_read_til_stop_bwd_changed, read_til_stop_bwd);}
|
||||
else if (ctx.Match(k, Invk_read_til_stop_bwd_)) {read_til_stop_bwd = m.ReadInt("v"); Gfo_evt_mgr_.Pub_val(this, Evt_read_til_stop_bwd_changed, read_til_stop_bwd);}
|
||||
else if (ctx.Match(k, Invk_stop_if_hdr_after)) return stop_if_hdr_after;
|
||||
else if (ctx.Match(k, Invk_stop_if_hdr_after_)) {stop_if_hdr_after = m.ReadInt("v"); GfoEvMgr_.PubVal(this, Evt_stop_if_hdr_after_changed, stop_if_hdr_after);}
|
||||
else if (ctx.Match(k, Invk_stop_if_hdr_after_)) {stop_if_hdr_after = m.ReadInt("v"); Gfo_evt_mgr_.Pub_val(this, Evt_stop_if_hdr_after_changed, stop_if_hdr_after);}
|
||||
else if (ctx.Match(k, Invk_ns_allowed)) return String_.new_u8(ns_allowed);
|
||||
else if (ctx.Match(k, Invk_ns_allowed_)) {ns_allowed = m.ReadBry("v"); GfoEvMgr_.PubVal(this, Evt_ns_allowed_changed, ns_allowed);}
|
||||
else if (ctx.Match(k, Invk_ns_allowed_)) {ns_allowed = m.ReadBry("v"); Gfo_evt_mgr_.Pub_val(this, Evt_ns_allowed_changed, ns_allowed);}
|
||||
else if (ctx.Match(k, Invk_tmpl_tkn_max)) return tmpl_tkn_max;
|
||||
else if (ctx.Match(k, Invk_tmpl_tkn_max_)) {tmpl_tkn_max = m.ReadInt("v"); GfoEvMgr_.PubVal(this, Evt_tmpl_tkn_max_changed, tmpl_tkn_max);}
|
||||
else if (ctx.Match(k, Invk_tmpl_tkn_max_)) {tmpl_tkn_max = m.ReadInt("v"); Gfo_evt_mgr_.Pub_val(this, Evt_tmpl_tkn_max_changed, tmpl_tkn_max);}
|
||||
else if (ctx.Match(k, Invk_tmpl_keeplist)) return String_.new_u8(tmpl_keeplist);
|
||||
else if (ctx.Match(k, Invk_tmpl_keeplist_)) {tmpl_keeplist = m.ReadBry("v"); GfoEvMgr_.PubVal(this, Evt_tmpl_keeplist_changed, tmpl_keeplist);}
|
||||
else if (ctx.Match(k, Invk_tmpl_keeplist_)) {tmpl_keeplist = m.ReadBry("v"); Gfo_evt_mgr_.Pub_val(this, Evt_tmpl_keeplist_changed, tmpl_keeplist);}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_popup)) return String_.new_u8(html_fmtr_popup);
|
||||
else if (ctx.Match(k, Invk_html_fmtr_popup_)) {html_fmtr_popup = m.ReadBry("v"); GfoEvMgr_.PubVal(this, Evt_html_fmtr_popup_changed, html_fmtr_popup);}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_popup_)) {html_fmtr_popup = m.ReadBry("v"); Gfo_evt_mgr_.Pub_val(this, Evt_html_fmtr_popup_changed, html_fmtr_popup);}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_popup_dflt)) return String_.new_u8(html_fmtr_popup_dflt);
|
||||
else if (ctx.Match(k, Invk_html_fmtr_popup_dflt_)) {html_fmtr_popup_dflt = m.ReadBry("v");}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_viewed)) return String_.new_u8(html_fmtr_viewed);
|
||||
else if (ctx.Match(k, Invk_html_fmtr_viewed_)) {html_fmtr_viewed = m.ReadBry("v"); GfoEvMgr_.PubVal(this, Evt_html_fmtr_viewed_changed, html_fmtr_viewed);}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_viewed_)) {html_fmtr_viewed = m.ReadBry("v"); Gfo_evt_mgr_.Pub_val(this, Evt_html_fmtr_viewed_changed, html_fmtr_viewed);}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_viewed_dflt)) return String_.new_u8(html_fmtr_viewed_dflt);
|
||||
else if (ctx.Match(k, Invk_html_fmtr_viewed_dflt_)) {html_fmtr_viewed_dflt = m.ReadBry("v");}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_wiki)) return String_.new_u8(html_fmtr_wiki);
|
||||
else if (ctx.Match(k, Invk_html_fmtr_wiki_)) {html_fmtr_wiki = m.ReadBry("v"); GfoEvMgr_.PubVal(this, Evt_html_fmtr_wiki_changed, html_fmtr_wiki);}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_wiki_)) {html_fmtr_wiki = m.ReadBry("v"); Gfo_evt_mgr_.Pub_val(this, Evt_html_fmtr_wiki_changed, html_fmtr_wiki);}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_wiki_dflt)) return String_.new_u8(html_fmtr_wiki_dflt);
|
||||
else if (ctx.Match(k, Invk_html_fmtr_wiki_dflt_)) {html_fmtr_wiki_dflt = m.ReadBry("v");}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_next_sect)) return String_.new_u8(html_fmtr_next_sect);
|
||||
else if (ctx.Match(k, Invk_html_fmtr_next_sect_)) {html_fmtr_next_sect = m.ReadBry("v"); GfoEvMgr_.PubVal(this, Evt_html_fmtr_next_sect_changed, html_fmtr_next_sect);}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_next_sect_)) {html_fmtr_next_sect = m.ReadBry("v"); Gfo_evt_mgr_.Pub_val(this, Evt_html_fmtr_next_sect_changed, html_fmtr_next_sect);}
|
||||
else if (ctx.Match(k, Invk_html_fmtr_next_sect_dflt)) return String_.new_u8(html_fmtr_next_sect_dflt);
|
||||
else if (ctx.Match(k, Invk_html_fmtr_next_sect_dflt_)) {html_fmtr_next_sect_dflt = m.ReadBry("v");}
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private int Set_int_gt_0(GfoMsg m, int cur_val, String evt) {
|
||||
int tmp = m.ReadInt("v");
|
||||
if (tmp < 1) return cur_val;
|
||||
GfoEvMgr_.PubVal(this, evt, tmp);
|
||||
Gfo_evt_mgr_.Pub_val(this, evt, tmp);
|
||||
return tmp;
|
||||
}
|
||||
private int Set_int(GfoMsg m, int cur_val, String evt) {
|
||||
int tmp = m.ReadInt("v");
|
||||
GfoEvMgr_.PubVal(this, evt, tmp);
|
||||
Gfo_evt_mgr_.Pub_val(this, evt, tmp);
|
||||
return tmp;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -16,14 +16,14 @@ 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.html.modules; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.html.*;
|
||||
public class Xoapi_toc implements GfoInvkAble {
|
||||
public class Xoapi_toc implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
}
|
||||
public boolean Collapsed() {return collapsed;} private boolean collapsed = false;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_collapsed)) return Yn.To_str(collapsed);
|
||||
else if (ctx.Match(k, Invk_collapsed_)) collapsed = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -16,7 +16,7 @@ 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.html.skins; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.html.*;
|
||||
public class Xoapi_skin_app_base implements GfoInvkAble {
|
||||
public class Xoapi_skin_app_base implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
}
|
||||
public boolean Sidebar_home_enabled() {return sidebar_home_enabled;} public void Sidebar_home_enabled_(boolean v) {sidebar_home_enabled = v;} private boolean sidebar_home_enabled;
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.apps.apis.xowa.navs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
import gplx.xowa.htmls.hrefs.*;
|
||||
public class Xoapi_wiki implements GfoInvkAble {
|
||||
public class Xoapi_nav_wiki implements Gfo_invk {
|
||||
private Xog_win_itm win;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
win = app.Gui_mgr().Browser_win();
|
||||
@@ -33,7 +33,7 @@ public class Xoapi_wiki implements GfoInvkAble {
|
||||
if (ctx.Match(k, Invk_main_page)) this.Main_page();
|
||||
else if (ctx.Match(k, Invk_random)) this.Random();
|
||||
else if (ctx.Match(k, Invk_sandbox)) this.Sandbox();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_main_page = "main_page", Invk_random = "random", Invk_sandbox = "sandbox";
|
||||
@@ -17,21 +17,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.specials; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.wikis.domains.*; import gplx.xowa.wikis.domains.crts.*;
|
||||
public class Xoapi_search implements GfoInvkAble, GfoEvMgrOwner {
|
||||
public class Xoapi_search implements Gfo_invk, Gfo_evt_mgr_owner {
|
||||
private final Xow_domain_crt_kv_itm_mgr multi_wikis_mgr = new Xow_domain_crt_kv_itm_mgr(); private byte[] multi_wikis_bry = Dflt_multi_wikis_bry;
|
||||
private final Xow_domain_crt_kv_itm_mgr multi_sorts_mgr = new Xow_domain_crt_kv_itm_mgr(); private byte[] multi_sorts_bry = Dflt_multi_sorts_bry;
|
||||
public Xoapi_search() {
|
||||
this.evMgr = GfoEvMgr.new_(this);
|
||||
this.evt_mgr = new Gfo_evt_mgr(this);
|
||||
multi_wikis_mgr.Parse_as_itms(multi_wikis_bry);
|
||||
multi_sorts_mgr.Parse_as_arys(multi_sorts_bry);
|
||||
}
|
||||
public GfoEvMgr EvMgr() {return evMgr;} private GfoEvMgr evMgr;
|
||||
public Gfo_evt_mgr Evt_mgr() {return evt_mgr;} private Gfo_evt_mgr evt_mgr;
|
||||
public int Results_per_page() {return results_per_page;} private int results_per_page = 100;
|
||||
public boolean Async_db() {return async_db;} private boolean async_db = true;
|
||||
public void Multi_wikis_bry_(byte[] v) {
|
||||
if (!multi_wikis_mgr.Parse_as_itms(v)) return;
|
||||
this.multi_wikis_bry = v;
|
||||
GfoEvMgr_.PubVal(this, Evt_multi_wikis_changed, v);
|
||||
Gfo_evt_mgr_.Pub_val(this, Evt_multi_wikis_changed, v);
|
||||
}
|
||||
public Xow_domain_crt_itm Multi_wikis_crt(Xow_domain_itm cur_domain) {
|
||||
return multi_wikis_mgr.Find_itm(cur_domain, cur_domain);
|
||||
@@ -39,7 +39,7 @@ public class Xoapi_search implements GfoInvkAble, GfoEvMgrOwner {
|
||||
public void Multi_sorts_bry_(byte[] v) {
|
||||
if (!multi_sorts_mgr.Parse_as_arys(v)) return;
|
||||
this.multi_sorts_bry = v;
|
||||
GfoEvMgr_.PubVal(this, Evt_multi_sorts_changed, v);
|
||||
Gfo_evt_mgr_.Pub_val(this, Evt_multi_sorts_changed, v);
|
||||
}
|
||||
public Xow_domain_crt_itm[] Multi_sorts_crt(Xow_domain_itm cur_domain) {
|
||||
return multi_sorts_mgr.Find_ary(cur_domain, cur_domain);
|
||||
@@ -53,7 +53,7 @@ public class Xoapi_search implements GfoInvkAble, GfoEvMgrOwner {
|
||||
else if (ctx.Match(k, Invk_multi_wikis_)) Multi_wikis_bry_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_multi_sorts)) return String_.new_u8(multi_sorts_bry);
|
||||
else if (ctx.Match(k, Invk_multi_sorts_)) Multi_sorts_bry_(m.ReadBry("v"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -17,13 +17,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.startups; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.apps.apis.xowa.startups.tabs.*;
|
||||
public class Xoapi_startups implements GfoInvkAble {
|
||||
public class Xoapi_startups implements Gfo_invk {
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
}
|
||||
public Xoapi_startup_tabs Tabs() {return tabs;} private Xoapi_startup_tabs tabs = new Xoapi_startup_tabs();
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_tabs)) return tabs;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_tabs = "tabs";
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.startups.tabs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.startups.*;
|
||||
import gplx.xowa.specials.*;
|
||||
public class Xoapi_startup_tabs implements GfoInvkAble {
|
||||
public class Xoapi_startup_tabs implements Gfo_invk {
|
||||
public String Custom() {return custom;} private String custom;
|
||||
public boolean Custom_is_expr() {return custom_is_expr;} private boolean custom_is_expr;
|
||||
public String Previous() {return previous;} private String previous;
|
||||
@@ -33,7 +33,7 @@ public class Xoapi_startup_tabs implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_custom_)) custom = m.ReadStr("v");
|
||||
else if (ctx.Match(k, Invk_custom_is_expr)) return Yn.To_str(custom_is_expr);
|
||||
else if (ctx.Match(k, Invk_custom_is_expr_)) custom_is_expr = m.ReadYn("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
@@ -43,11 +43,11 @@ public class Xoapi_startup_tabs implements GfoInvkAble {
|
||||
, Invk_custom_is_expr = "custom_is_expr", Invk_custom_is_expr_ = "custom_is_expr_"
|
||||
;
|
||||
public String[] Calc_startup_strs(Xoae_app app) {
|
||||
List_adp rv = List_adp_.new_();
|
||||
List_adp rv = List_adp_.New();
|
||||
String xowa_home = gplx.xowa.users.Xouc_pages_mgr.Page_xowa;
|
||||
if (manual == null) {
|
||||
switch (type) {
|
||||
case Xoapi_startup_tabs_tid_.Tid_blank: rv.Add(Xows_special_meta_.Itm__default_tab.Ttl_str()); break;
|
||||
case Xoapi_startup_tabs_tid_.Tid_blank: rv.Add(Xow_special_meta_.Itm__default_tab.Ttl_str()); break;
|
||||
case Xoapi_startup_tabs_tid_.Tid_xowa: rv.Add(xowa_home); break;
|
||||
case Xoapi_startup_tabs_tid_.Tid_custom: Add_ary(rv, custom); break;
|
||||
case Xoapi_startup_tabs_tid_.Tid_previous: Add_ary(rv, previous); break;
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.xowa.apps.apis.xowa.usrs; import gplx.*; import gplx.xowa.*; import
|
||||
import gplx.xowa.guis.history.*; import gplx.xowa.guis.views.*;
|
||||
import gplx.xowa.users.bmks.*;
|
||||
import gplx.xowa.wikis.*;
|
||||
public class Xoapi_bookmarks implements GfoInvkAble {
|
||||
public class Xoapi_bookmarks implements Gfo_invk {
|
||||
private Xoae_app app; private Xog_win_itm win;
|
||||
public void Ctor_by_app(Xoae_app app) {this.app = app;}
|
||||
public void Init_by_kit(Xoae_app app) {this.win = app.Gui_mgr().Browser_win();}
|
||||
@@ -49,7 +49,7 @@ public class Xoapi_bookmarks implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_delete_confirm_)) delete_confirm = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Invk_add)) return this.Add(m.ReadStrOr("v", null));
|
||||
else if (ctx.Match(k, Invk_show)) this.Show();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.usrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.core.ios.*; import gplx.xowa.files.caches.*;
|
||||
public class Xoapi_cache implements GfoInvkAble {
|
||||
public class Xoapi_cache implements Gfo_invk {
|
||||
private Xou_cache_mgr cache_mgr;
|
||||
public void Init_by_app(Xoa_app app) {this.cache_mgr = app.User().User_db_mgr().Cache_mgr();}
|
||||
private String Info() {
|
||||
cache_mgr.Page_bgn();
|
||||
Bry_bfr bfr = Bry_bfr.new_(255);
|
||||
Bry_bfr bfr = Bry_bfr_.New_w_size(255);
|
||||
Keyval[] ary = cache_mgr.Info();
|
||||
int len = ary.length;
|
||||
for (int i = 0; i < len; ++i) {
|
||||
@@ -39,7 +39,7 @@ public class Xoapi_cache implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_info)) return Info();
|
||||
else if (ctx.Match(k, Invk_reduce_to_min)) cache_mgr.Reduce(cache_mgr.Fsys_size_min());
|
||||
else if (ctx.Match(k, Invk_reduce_to_zero)) cache_mgr.Reduce(0);
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.usrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_history implements GfoInvkAble {
|
||||
public class Xoapi_history implements Gfo_invk {
|
||||
private Xoae_app app; private Xog_win_itm win;
|
||||
public void Ctor_by_app(Xoae_app app) {this.app = app;}
|
||||
public void Init_by_kit(Xoae_app app) {this.win = app.Gui_mgr().Browser_win();}
|
||||
@@ -30,7 +30,7 @@ public class Xoapi_history implements GfoInvkAble {
|
||||
else if (ctx.Match(k, Invk_enabled_)) Enabled_(m.ReadYn("v"));
|
||||
else if (ctx.Match(k, Invk_goto_recent)) this.Goto_recent();
|
||||
else if (ctx.Match(k, Invk_show)) this.Show();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_enabled = "enabled", Invk_enabled_ = "enabled_", Invk_goto_recent = "goto_recent", Invk_show = "show";
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.usrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_logs implements GfoInvkAble {
|
||||
public class Xoapi_logs implements Gfo_invk {
|
||||
private Xoae_app app;
|
||||
public void Ctor_by_app(Xoae_app app) {this.app = app;}
|
||||
public void Init_by_kit(Xoae_app app) {}
|
||||
@@ -30,7 +30,7 @@ public class Xoapi_logs implements GfoInvkAble {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_enabled)) return Yn.To_str(this.Enabled());
|
||||
else if (ctx.Match(k, Invk_enabled_)) Enabled_(m.ReadYn("v"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_enabled = "enabled", Invk_enabled_ = "enabled_";
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
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.wikis; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
public class Hdump_html_mode {
|
||||
public Hdump_html_mode(int tid, String key, String gui) {
|
||||
this.tid = (byte)tid; this.key = key; this.gui = gui;
|
||||
}
|
||||
public byte Tid() {return tid;} private final byte tid;
|
||||
public String Key() {return key;} private final String key;
|
||||
public String Gui() {return gui;} private final String gui;
|
||||
public Keyval Opt() {return Keyval_.new_(key, gui);}
|
||||
public boolean Tid_is_hdump_save() {return tid == Hdump_save.tid;}
|
||||
|
||||
public static final Hdump_html_mode
|
||||
Shown = new Hdump_html_mode(0, "shown" , "Shown")
|
||||
, Hdump_save = new Hdump_html_mode(1, "hdump_save" , "Saved for HTML DB")
|
||||
, Hdump_load = new Hdump_html_mode(2, "hdump_load" , "Loaded by HTML DB")
|
||||
;
|
||||
public static Hdump_html_mode Parse(String v) {
|
||||
if (String_.Eq(v, Shown.key)) return Shown;
|
||||
else if (String_.Eq(v, Hdump_save.key)) return Hdump_save;
|
||||
else if (String_.Eq(v, Hdump_load.key)) return Hdump_load;
|
||||
else throw Err_.new_unhandled(v);
|
||||
}
|
||||
public static Keyval[] Opt_list() {return new Keyval[] {Shown.Opt(), Hdump_save.Opt()};}
|
||||
}
|
||||
34
400_xowa/src/gplx/xowa/apps/apis/xowa/wikis/Xoapi_hdump.java
Normal file
34
400_xowa/src/gplx/xowa/apps/apis/xowa/wikis/Xoapi_hdump.java
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
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.wikis; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
public class Xoapi_hdump implements Gfo_invk {
|
||||
public boolean Read_preferred() {return read_preferred;} private boolean read_preferred = true;
|
||||
public Hdump_html_mode Html_mode() {return html_mode;} private Hdump_html_mode html_mode = Hdump_html_mode.Shown;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk__read_preferred)) return Yn.To_str(read_preferred);
|
||||
else if (ctx.Match(k, Invk__read_preferred_)) read_preferred = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Invk__html_mode)) return html_mode.Key();
|
||||
else if (ctx.Match(k, Invk__html_mode_)) html_mode = Hdump_html_mode.Parse(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, Invk__html_mode_list)) return Hdump_html_mode.Opt_list();
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
Invk__read_preferred = "read_preferred" , Invk__read_preferred_ = "read_preferred_"
|
||||
, Invk__html_mode = "html_mode" , Invk__html_mode_ = "html_mode_", Invk__html_mode_list = "html_mode_list"
|
||||
;
|
||||
}
|
||||
@@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.wikis; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.apps.apis.xowa.wikis.langs.*;
|
||||
public class Xoapi_wiki_lang implements GfoInvkAble {
|
||||
public Xoap_lang_variants Variants() {return variants;} private final Xoap_lang_variants variants = new Xoap_lang_variants();
|
||||
public void Subscribe(GfoEvObj sub) {variants.Subscribe(sub);}
|
||||
public class Xoapi_wiki_lang implements Gfo_invk {
|
||||
public Xoap_lang_variants Variants() {return variants;} private final Xoap_lang_variants variants = new Xoap_lang_variants();
|
||||
public void Subscribe(Gfo_evt_itm sub) {variants.Subscribe(sub);}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_variants)) return variants;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
private static final String Invk_variants = "variants";
|
||||
}
|
||||
|
||||
@@ -16,24 +16,24 @@ 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.wikis.langs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*; import gplx.xowa.apps.apis.xowa.wikis.*;
|
||||
public class Xoap_lang_variants implements GfoInvkAble, GfoEvMgrOwner {
|
||||
public class Xoap_lang_variants implements Gfo_invk, Gfo_evt_mgr_owner {
|
||||
public Xoap_lang_variants() {
|
||||
this.ev_mgr = GfoEvMgr.new_(this);
|
||||
this.ev_mgr = new Gfo_evt_mgr(this);
|
||||
}
|
||||
public GfoEvMgr EvMgr() {return ev_mgr;} private final GfoEvMgr ev_mgr;
|
||||
public Gfo_evt_mgr Evt_mgr() {return ev_mgr;} private final Gfo_evt_mgr ev_mgr;
|
||||
public byte[] Current() {return current;} private byte[] current;
|
||||
public void Current_(byte[] v) {
|
||||
this.current = v;
|
||||
GfoEvMgr_.PubVal(this, Evt_current_changed, v);
|
||||
Gfo_evt_mgr_.Pub_val(this, Evt_current_changed, v);
|
||||
}
|
||||
public void Subscribe(GfoEvObj sub) {
|
||||
GfoEvMgr_.SubSame(this, Evt_current_changed, sub);
|
||||
if (current != null) GfoInvkAble_.InvkCmd_val(sub, Evt_current_changed, current);
|
||||
public void Subscribe(Gfo_evt_itm sub) {
|
||||
Gfo_evt_mgr_.Sub_same(this, Evt_current_changed, sub);
|
||||
if (current != null) Gfo_invk_.Invk_by_val(sub, Evt_current_changed, current);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_current)) return String_.new_u8(current);
|
||||
else if (ctx.Match(k, Invk_current_)) Current_(m.ReadBry("v"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_current = "current", Invk_current_ = "current_";
|
||||
|
||||
@@ -17,7 +17,7 @@ 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 GfoInvkAble {
|
||||
public class Xoapi_scribunto implements Gfo_invk {
|
||||
private Xoae_app app;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
this.app = app;
|
||||
@@ -29,7 +29,7 @@ public class Xoapi_scribunto implements GfoInvkAble {
|
||||
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 GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
@@ -17,22 +17,22 @@ 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.wdatas.*;
|
||||
public class Xoapi_wikibase implements GfoInvkAble, GfoEvMgrOwner {
|
||||
public class Xoapi_wikibase implements Gfo_invk, Gfo_evt_mgr_owner {
|
||||
public Xoapi_wikibase() {
|
||||
evMgr = GfoEvMgr.new_(this);
|
||||
evt_mgr = new Gfo_evt_mgr(this);
|
||||
}
|
||||
public GfoEvMgr EvMgr() {return evMgr;} private GfoEvMgr evMgr;
|
||||
public Gfo_evt_mgr Evt_mgr() {return evt_mgr;} private Gfo_evt_mgr evt_mgr;
|
||||
public byte[][] Core_langs() {return core_langs;} private byte[][] core_langs = Bry_.Ary("en");
|
||||
public byte[][] Sort_langs() {return sort_langs;} private byte[][] sort_langs = Bry_.Ary("en", "de", "es", "fr", "it", "nl", "pl", "ru", "sv");
|
||||
public byte[] Link_wikis() {return link_wikis;} private byte[] link_wikis = Bry_.new_a7("enwiki");
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_core_langs)) return Bry_.Add_w_dlm(Byte_ascii.Semic, core_langs);
|
||||
else if (ctx.Match(k, Invk_core_langs_)) {core_langs = m.ReadBryAry(k, Byte_ascii.Semic); GfoEvMgr_.PubVal(this, Evt_core_langs_changed, core_langs);}
|
||||
else if (ctx.Match(k, Invk_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, Invk_sort_langs)) return Bry_.Add_w_dlm(Byte_ascii.Semic, sort_langs);
|
||||
else if (ctx.Match(k, Invk_sort_langs_)) {sort_langs = m.ReadBryAry(k, Byte_ascii.Semic); GfoEvMgr_.PubVal(this, Evt_sort_langs_changed, sort_langs);}
|
||||
else if (ctx.Match(k, Invk_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, Invk_link_wikis)) return String_.new_u8(link_wikis);
|
||||
else if (ctx.Match(k, Invk_link_wikis_)) {link_wikis = m.ReadBry(k); GfoEvMgr_.PubVal(this, Evt_link_wikis_changed, link_wikis);}
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else if (ctx.Match(k, Invk_link_wikis_)) {link_wikis = m.ReadBry(k); Gfo_evt_mgr_.Pub_val(this, Evt_link_wikis_changed, link_wikis);}
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
|
||||
Reference in New Issue
Block a user