diff --git a/150_gfui/src/gplx/gfui/kits/core/Swt_kit.java b/150_gfui/src/gplx/gfui/kits/core/Swt_kit.java
index c620498e9..fd119f348 100644
--- a/150_gfui/src/gplx/gfui/kits/core/Swt_kit.java
+++ b/150_gfui/src/gplx/gfui/kits/core/Swt_kit.java
@@ -225,7 +225,13 @@ public class Swt_kit implements Gfui_kit {
rv.Owner_(owner);
return rv;
}
- public Gfui_dlg_file New_dlg_file(byte type, String msg) {return new Swt_dlg_file(type, shell).Init_msg_(msg);}
+ public Gfui_dlg_file New_dlg_file(byte type, String msg) {return New_dlg_file(type, msg, null);}
+ public Gfui_dlg_file New_dlg_file(byte type, String msg, String exts) {
+ Gfui_dlg_file rv = new Swt_dlg_file(type, shell);
+ if (exts != null) rv.Init_exts_(exts);
+ rv.Init_msg_(msg);
+ return rv;
+ }
public Gfui_dlg_dir New_dlg_dir(String msg) {return new Swt_dlg_dir(shell).Init_msg_(msg);}
public Gfui_dlg_msg New_dlg_msg(String msg) {return new Swt_dlg_msg(shell).Init_msg_(msg);}
public ImageAdp New_img_load(Io_url url) {
@@ -270,7 +276,7 @@ public class Swt_kit implements Gfui_kit {
Cfg_set(type, Swt_kit.Cfg_Html_BrowserType, Cfg_Html_BrowserType_parse(val));
}
}
- else if (String_.Eq(k, Invk_ask_file)) return this.New_dlg_file(Gfui_kit_.File_dlg_type_open, m.Args_getAt(0).Val_to_str_or_empty()).Ask();
+ else if (String_.Eq(k, Invk_ask_file)) return this.New_dlg_file(Gfui_kit_.File_dlg_type_open, m.Args_getAt(0).Val_to_str_or_empty(), m.Args_getAt(1).Val_to_str_or_empty()).Ask();
else if (String_.Eq(k, "ask_dir")) return this.New_dlg_dir(m.Args_getAt(0).Val_to_str_or_empty()).Ask();
else if (String_.Eq(k, Invk_shell_close)) shell.close();
return this;
diff --git a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/dbs/Xoctg_catlink_loader.java b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/dbs/Xoctg_catlink_loader.java
index 6b55eced7..3d80d5934 100644
--- a/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/dbs/Xoctg_catlink_loader.java
+++ b/400_xowa/src/gplx/xowa/addons/wikis/ctgs/htmls/catpages/dbs/Xoctg_catlink_loader.java
@@ -175,12 +175,12 @@ class Xoctg_catlink_loader {
int nl_pos = Bry_find_.Find_fwd(tmp_sortkey, Byte_ascii.Nl);
if (nl_pos != Bry_find_.Not_found)
tmp_sortkey = Bry_.Mid(tmp_sortkey, 0, nl_pos);
+
if (version == 4) {
if (Bry_.Len_gt_0(url_sortkey)) {
// make sortkey_val
sortkey_val_bfr.Add_byte(Byte_ascii.Ltr_x).Add_byte_apos();
gplx.core.encoders.Hex_utl_.Encode_bfr(sortkey_val_bfr, collation_mgr.Get_sortkey(tmp_sortkey));
- Tfds.Write(version, tmp_sortkey, sortkey_val_bfr.To_str());
sortkey_val_bfr.Add_byte_apos();
}
else
diff --git a/400_xowa/src/gplx/xowa/addons/wikis/directorys/specials/items/bldrs/Xow_db_mkr.java b/400_xowa/src/gplx/xowa/addons/wikis/directorys/specials/items/bldrs/Xow_db_mkr.java
index 4bcf8ad0c..3c16482aa 100644
--- a/400_xowa/src/gplx/xowa/addons/wikis/directorys/specials/items/bldrs/Xow_db_mkr.java
+++ b/400_xowa/src/gplx/xowa/addons/wikis/directorys/specials/items/bldrs/Xow_db_mkr.java
@@ -41,6 +41,9 @@ public class Xow_db_mkr {
, new Xowd_text_tbl(core_conn, Bool_.N, data.Text_zip_tid())
);
+ // upgrade tbl: page for categories; NOTE: should change page_tbl to do this automatically
+ core_conn.Meta_fld_append(Xowd_page_tbl.TBL_NAME, Dbmeta_fld_itm.new_int(Xowd_page_tbl.FLD__page_cat_db_id).Default_(-1));
+
// create tbls: cat; may want to do "if (props.Layout_text().Tid_is_all_or_few())" // create in advance else will fail for v2; import wiki -> wiki loads and tries to load categories; v2 category processes and builds tbl; DATE:2015-03-22
core_db.Tbls__add(Bool_.Y
, new Xowd_cat_core_tbl(core_conn, Bool_.N)
diff --git a/400_xowa/src/gplx/xowa/addons/wikis/directorys/specials/items/bldrs/Xow_wiki_upgrade_.java b/400_xowa/src/gplx/xowa/addons/wikis/directorys/specials/items/bldrs/Xow_wiki_upgrade_.java
index 3041fe7a4..a9d6365ec 100644
--- a/400_xowa/src/gplx/xowa/addons/wikis/directorys/specials/items/bldrs/Xow_wiki_upgrade_.java
+++ b/400_xowa/src/gplx/xowa/addons/wikis/directorys/specials/items/bldrs/Xow_wiki_upgrade_.java
@@ -19,12 +19,14 @@ package gplx.xowa.addons.wikis.directorys.specials.items.bldrs; import gplx.*; i
import gplx.dbs.*; import gplx.dbs.cfgs.*;
import gplx.xowa.wikis.data.*; import gplx.xowa.wikis.data.tbls.*; import gplx.xowa.addons.wikis.ctgs.dbs.*;
import gplx.xowa.addons.wikis.directorys.dbs.*;
-class Xow_wiki_upgrade_ {
+public class Xow_wiki_upgrade_ {
// correlates loosely to App_.Version; however, should only change when new cases are added to this class
private static final int
Upgrade_version__v00 = 515
, Upgrade_version__v01 = 516
- , Upgrade_version__cur = 516 // must match latest version
+ ;
+ public static final int
+ Upgrade_version__cur = 516 // must match latest version
;
public static void Upgrade_wiki(Xoae_app app, byte[] domain, Io_url dir_url) {
// get conn
@@ -70,7 +72,7 @@ class Xow_wiki_upgrade_ {
Gfo_usr_dlg_.Instance.Warn_many("", "", "xo.personal:page.page_cat_db_id upgrade failed; err=~{0}", Err_.Message_gplx_log(e));
}
- // check for page_ids < 1
+ // BGN:check for page_ids < 1
// select from page_tbl for page_id < 1
Xow_db_mgr db_mgr = new Xow_db_mgr(dir_url, String_.new_u8(domain));
db_mgr.Init_by_load(core_db_url);
@@ -94,6 +96,7 @@ class Xow_wiki_upgrade_ {
}
db_mgr.Db__core().Tbl__cfg().Upsert_int(Xowd_cfg_key_.Grp__db, Xowd_cfg_key_.Key__wiki__page__id_next, next_id + page_ids_len);
}
+ // END:check for page_ids < 1
cfg_tbl.Upsert_int(Xowd_cfg_key_.Key__wiki__upgrade__version, Upgrade_version__v01);
}
diff --git a/400_xowa/src/gplx/xowa/wikis/data/Xowd_cfg_tbl_.java b/400_xowa/src/gplx/xowa/wikis/data/Xowd_cfg_tbl_.java
index 0f0951024..aa179c91b 100644
--- a/400_xowa/src/gplx/xowa/wikis/data/Xowd_cfg_tbl_.java
+++ b/400_xowa/src/gplx/xowa/wikis/data/Xowd_cfg_tbl_.java
@@ -38,9 +38,10 @@ public class Xowd_cfg_tbl_ {
}
public static void Insert__create(Xowe_wiki wiki) {Insert__create(wiki.Data__core_mgr().Db__core().Tbl__cfg(), wiki.Domain_str(), wiki.Domain_str(), wiki.Props().Main_page());}
public static void Insert__create(Db_cfg_tbl cfg_tbl, String domain, String name, byte[] main_page) {
- cfg_tbl.Insert_str(Xowd_cfg_key_.Grp__empty , Xowd_cfg_key_.Key__wiki__core__domain , domain);
- cfg_tbl.Insert_str(Xowd_cfg_key_.Grp__empty , Xowd_cfg_key_.Key__wiki__core__name , name);
- cfg_tbl.Insert_bry(Xowd_cfg_key_.Grp__wiki_init, Xowd_cfg_key_.Key__init__main_page , main_page);
- cfg_tbl.Insert_str(Xowd_cfg_key_.Grp__wiki_init, Xowd_cfg_key_.Key__init__modified_latest, Datetime_now.Get().XtoStr_fmt(DateAdp_.Fmt_iso8561_date_time));
+ cfg_tbl.Insert_str(Xowd_cfg_key_.Grp__empty , Xowd_cfg_key_.Key__wiki__core__domain , domain);
+ cfg_tbl.Insert_str(Xowd_cfg_key_.Grp__empty , Xowd_cfg_key_.Key__wiki__core__name , name);
+ cfg_tbl.Insert_int(Xowd_cfg_key_.Grp__empty , Xowd_cfg_key_.Key__wiki__upgrade__version , gplx.xowa.addons.wikis.directorys.specials.items.bldrs.Xow_wiki_upgrade_.Upgrade_version__cur);
+ cfg_tbl.Insert_bry(Xowd_cfg_key_.Grp__wiki_init, Xowd_cfg_key_.Key__init__main_page , main_page);
+ cfg_tbl.Insert_str(Xowd_cfg_key_.Grp__wiki_init, Xowd_cfg_key_.Key__init__modified_latest , Datetime_now.Get().XtoStr_fmt(DateAdp_.Fmt_iso8561_date_time));
}
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_Defines.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwDefines.java
similarity index 97%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_Defines.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwDefines.java
index 61965a459..6d4e5551c 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_Defines.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwDefines.java
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
-public class Xomw_Defines {
+public class XomwDefines {
// /**
// * @defgroup Constants MediaWiki constants
// */
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker.java
similarity index 96%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker.java
index e63db036c..7f2cf9baf 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker.java
@@ -28,11 +28,11 @@ import gplx.xowa.mediawiki.includes.utls.*;
* P7: titleFormatter->getPrefixedText
* P7: $html = HtmlArmor::getHtml($text);
*/
-public class Xomw_linker {
+public class XomwLinker {
// private Xomw_parser_env env;
private final Bry_bfr tmp = Bry_bfr_.New(), tmp_2 = Bry_bfr_.New();
private final Linker_rel_splitter splitter = new Linker_rel_splitter();
- private final Xomw_html_utl html_utl = new Xomw_html_utl();
+ private final XomwHtml html_utl = new XomwHtml();
private byte[] wg_title = null;
private final Btrie_rv trv = new Btrie_rv();
private final byte[][] split_trail_rv = new byte[2][];
@@ -51,7 +51,7 @@ public class Xomw_linker {
, Img_class__thumbimage = Bry_.new_a7("thumbimage")
;
private final Xomw_link_renderer link_renderer;
- public Xomw_linker(Xomw_link_renderer link_renderer) {
+ public XomwLinker(Xomw_link_renderer link_renderer) {
this.link_renderer = link_renderer;
}
public void Init_by_wiki(Xomw_parser_env env, Btrie_slim_mgr trie) {
@@ -127,7 +127,7 @@ public class Xomw_linker {
// 'https': Force a full URL with https:// as the scheme.
// 'stubThreshold' => (int): Stub threshold to use when determining link classes.
// @return String HTML attribute
- public void Link(Bry_bfr bfr, Xomw_Title target, byte[] html, Xomw_atr_mgr custom_attribs, Xomw_qry_mgr query, Xomw_opt_mgr options) {
+ public void Link(Bry_bfr bfr, XomwTitle target, byte[] html, Xomw_atr_mgr custom_attribs, Xomw_qry_mgr query, Xomw_opt_mgr options) {
// XO.MW.UNSUPPORTED:MW has different renderers -- presumably for forcing "https:" and others; XO only has one
//if (options != null) {
// // Custom options, create new LinkRenderer
@@ -193,7 +193,7 @@ public class Xomw_linker {
* @return String
*/
// XO.MW:SYNC:1.29; DATE:2017-02-08
- public void makeSelfLinkObj(Bry_bfr bfr, Xomw_Title nt, byte[] html, byte[] query, byte[] trail, byte[] prefix) {
+ public void makeSelfLinkObj(Bry_bfr bfr, XomwTitle nt, byte[] html, byte[] query, byte[] trail, byte[] prefix) {
// MW.HOOK:SelfLinkBegin
if (html == Bry_.Empty) {
html = tmp.Add_bry_escape_html(nt.getPrefixedText()).To_bry_and_clear();
@@ -239,7 +239,7 @@ public class Xomw_linker {
// * @param LinkTarget $target
// * @return LinkTarget
// */
- public static Xomw_Title normaliseSpecialPage(Xomw_Title target) {
+ public static XomwTitle normaliseSpecialPage(XomwTitle target) {
// if (target.Ns().Id_is_special() && !target.Is_external()) {
// list($name, $subpage) = SpecialPageFactory::resolveAlias($target->getDBkey());
// if (!$name) {
@@ -334,7 +334,7 @@ public class Xomw_linker {
// @since 1.20
// @return String HTML for an image, with links, wrappers, etc.
// XO.MW:SYNC:1.29; DATE:2017-02-08
- public void makeImageLink(Bry_bfr bfr, Xomw_parser_ctx pctx, Xomw_parser parser, Xomw_Title title, Xomw_File file, Xomw_params_frame frameParams, Xomw_params_handler handlerParams, Object time, byte[] query, int widthOption) {
+ public void makeImageLink(Bry_bfr bfr, Xomw_parser_ctx pctx, Xomw_parser parser, XomwTitle title, XomwFile file, Xomw_params_frame frameParams, Xomw_params_handler handlerParams, Object time, byte[] query, int widthOption) {
Xomw_parser_env env = parser.Env();
// XO.MW.HOOK:ImageBeforeProduceHTML
@@ -433,7 +433,7 @@ public class Xomw_linker {
}
}
- Xomw_MediaTransformOutput thumb = null;
+ XomwMediaTransformOutput thumb = null;
if (file != null && Php_utl_.isset(handlerParams.width)) {
// Create a resized image, without the additional thumbnail features
thumb = file.transform(handlerParams);
@@ -538,7 +538,7 @@ public class Xomw_linker {
* @return String
*/
// XO.MW:SYNC:1.29; DATE:2017-02-08
- private void makeThumbLink2(Bry_bfr bfr, Xomw_parser_ctx pctx, Xomw_Title title, Xomw_File file, Xomw_params_frame frameParams, Xomw_params_handler handlerParams, Object time, byte[] query) {
+ private void makeThumbLink2(Bry_bfr bfr, Xomw_parser_ctx pctx, XomwTitle title, XomwFile file, Xomw_params_frame frameParams, Xomw_params_handler handlerParams, Object time, byte[] query) {
boolean exists = file != null && file.exists();
int page = handlerParams.page;
@@ -559,7 +559,7 @@ public class Xomw_linker {
// Reduce width for upright images when parameter 'upright' is used
handlerParams.width = Php_utl_.isset(frameParams.upright) ? 130 : 180;
}
- Xomw_MediaTransformOutput thumb = null;
+ XomwMediaTransformOutput thumb = null;
boolean noscale = false;
boolean manualthumb = false;
@@ -584,7 +584,7 @@ public class Xomw_linker {
else if (Php_utl_.isset(frameParams.framed)) {
// Use image dimensions, don't scale
// thumb = $file->getUnscaledThumb(handlerParams);
- thumb = new Xomw_ThumbnailImage(file, file.getUrl(), file.getUrl(), file.getWidth(), file.getHeight());
+ thumb = new XomwThumbnailImage(file, file.getUrl(), file.getUrl(), file.getWidth(), file.getHeight());
noscale = true;
}
else {
@@ -1372,7 +1372,7 @@ public class Xomw_linker {
* @return String
*/
// XO.MW:SYNC:1.29; DATE:2017-02-08
- public void normalizeSubpageLink(Xomw_linker__normalize_subpage_link rv, Xomw_Title context_title, byte[] target, byte[] text) {
+ public void normalizeSubpageLink(XomwLinker_NormalizeSubpageLink rv, XomwTitle context_title, byte[] target, byte[] text) {
// Valid link forms:
// Foobar -- normal
// :Foobar -- override special treatment of prefix (images, language links)
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker__normalize_subpage_link.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker_NormalizeSubpageLink.java
similarity index 86%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker__normalize_subpage_link.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker_NormalizeSubpageLink.java
index b221a6dc0..aed3823d7 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker__normalize_subpage_link.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker_NormalizeSubpageLink.java
@@ -16,10 +16,10 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
-public class Xomw_linker__normalize_subpage_link {
+public class XomwLinker_NormalizeSubpageLink {
public byte[] link;
public byte[] text;
- public Xomw_linker__normalize_subpage_link Init(byte[] link, byte[] text) {
+ public XomwLinker_NormalizeSubpageLink Init(byte[] link, byte[] text) {
this.link = link;
this.text = text;
return this;
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker__normalize_subpage_link__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker_NormalizeSubpageLinkTest.java
similarity index 77%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker__normalize_subpage_link__tst.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker_NormalizeSubpageLinkTest.java
index 6eee0323d..a82b59d4f 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker__normalize_subpage_link__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker_NormalizeSubpageLinkTest.java
@@ -17,8 +17,8 @@ along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
import org.junit.*; import gplx.core.tests.*;
-public class Xomw_linker__normalize_subpage_link__tst {
- private final Xomw_linker__normalize_subpage_link__fxt fxt = new Xomw_linker__normalize_subpage_link__fxt();
+public class XomwLinker_NormalizeSubpageLinkTest {
+ private final XomwLinker_NormalizeSubpageLinkFxt fxt = new XomwLinker_NormalizeSubpageLinkFxt();
@Test public void None() {fxt.Test__normalize_subpage_link("A/B/C" , "Z" , "" , "Z" , "");}
@Test public void Hash() {fxt.Test__normalize_subpage_link("A/B/C" , "/Y#Z" , "" , "A/B/C/Y#Z" , "/Y#Z");}
@Test public void Slash__basic() {fxt.Test__normalize_subpage_link("A/B/C" , "/Z" , "" , "A/B/C/Z" , "/Z");}
@@ -27,11 +27,11 @@ public class Xomw_linker__normalize_subpage_link__tst {
@Test public void Dot2__many() {fxt.Test__normalize_subpage_link("A/B/C" , "../../Z" , "z1" , "A/Z" , "z1");}
@Test public void Dot2__trailing() {fxt.Test__normalize_subpage_link("A/B/C" , "../../Z/" , "" , "A/Z" , "Z");}
}
-class Xomw_linker__normalize_subpage_link__fxt {
- private final Xomw_linker mgr = new Xomw_linker(new gplx.xowa.mediawiki.includes.linkers.Xomw_link_renderer(new Xomw_sanitizer()));
- private final Xomw_linker__normalize_subpage_link normalize_subpage_link = new Xomw_linker__normalize_subpage_link();
+class XomwLinker_NormalizeSubpageLinkFxt {
+ private final XomwLinker mgr = new XomwLinker(new gplx.xowa.mediawiki.includes.linkers.Xomw_link_renderer(new XomwSanitizer()));
+ private final XomwLinker_NormalizeSubpageLink normalize_subpage_link = new XomwLinker_NormalizeSubpageLink();
public void Test__normalize_subpage_link(String page_title_str, String link, String text, String expd_link, String expd_text) {
- mgr.normalizeSubpageLink(normalize_subpage_link, Xomw_Title.newFromText(Bry_.new_u8(page_title_str)), Bry_.new_u8(link), Bry_.new_u8(text));
+ mgr.normalizeSubpageLink(normalize_subpage_link, XomwTitle.newFromText(Bry_.new_u8(page_title_str)), Bry_.new_u8(link), Bry_.new_u8(text));
Gftest.Eq__str(expd_link, String_.new_u8(normalize_subpage_link.link));
Gftest.Eq__str(expd_text, String_.new_u8(normalize_subpage_link.text));
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker__split_trail__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker_SplitTrailTest.java
similarity index 81%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker__split_trail__tst.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker_SplitTrailTest.java
index f767717ab..57e9f051f 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_linker__split_trail__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwLinker_SplitTrailTest.java
@@ -17,15 +17,15 @@ along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
import org.junit.*; import gplx.core.tests.*; import gplx.core.btries.*; import gplx.xowa.mediawiki.includes.parsers.*;
-public class Xomw_linker__split_trail__tst {
- private final Xomw_linker__split_trail__fxt fxt = new Xomw_linker__split_trail__fxt();
+public class XomwLinker_SplitTrailTest {
+ private final XomwLinker_SplitTrailFxt fxt = new XomwLinker_SplitTrailFxt();
@Test public void Basic() {fxt.Test__split_trail("abc def" , "abc" , " def");}
@Test public void None() {fxt.Test__split_trail(" abc" , null , " abc");}
}
-class Xomw_linker__split_trail__fxt {
- private final Xomw_linker linker = new Xomw_linker(new gplx.xowa.mediawiki.includes.linkers.Xomw_link_renderer(new Xomw_sanitizer()));
+class XomwLinker_SplitTrailFxt {
+ private final XomwLinker linker = new XomwLinker(new gplx.xowa.mediawiki.includes.linkers.Xomw_link_renderer(new XomwSanitizer()));
private final Btrie_slim_mgr trie = Btrie_slim_mgr.cs();
- public Xomw_linker__split_trail__fxt() {
+ public XomwLinker_SplitTrailFxt() {
String[] ary = new String[] {"a", "b", "c", "d", "e", "f"};
for (String itm : ary)
trie.Add_str_str(itm, itm);
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWord.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWord.java
similarity index 76%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWord.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWord.java
index d3c5915a6..9c7caee12 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWord.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWord.java
@@ -16,18 +16,18 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
-public class Xomw_MagicWord {
+public class XomwMagicWord {
public boolean case_match;
public byte[] name;
- public Xomw_MagicWordSynonym[] synonyms;
- public Xomw_MagicWord(byte[] name, boolean case_match, byte[][] synonyms_ary) {
+ public XomwMagicWordSynonym[] synonyms;
+ public XomwMagicWord(byte[] name, boolean case_match, byte[][] synonyms_ary) {
this.name = name;
this.case_match = case_match;
int synonyms_len = synonyms_ary.length;
- this.synonyms = new Xomw_MagicWordSynonym[synonyms_len];
+ this.synonyms = new XomwMagicWordSynonym[synonyms_len];
for (int i = 0; i < synonyms_len; i++) {
- synonyms[i] = new Xomw_MagicWordSynonym(name, case_match, synonyms_ary[i]);
+ synonyms[i] = new XomwMagicWordSynonym(name, case_match, synonyms_ary[i]);
}
}
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordArray.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordArray.java
similarity index 90%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordArray.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordArray.java
index 73d10c756..781597a0b 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordArray.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordArray.java
@@ -17,11 +17,11 @@ along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
import gplx.core.btries.*; import gplx.core.primitives.*;
-public class Xomw_MagicWordArray {
+public class XomwMagicWordArray {
private Btrie_slim_mgr fwd_trie;
private Btrie_bwd_mgr bwd_trie;
private final Btrie_rv trv = new Btrie_rv();
-// private final Xomw_MagicWordMgr magic_word_mgr;
+// private final XomwMagicWordMgr magic_word_mgr;
public final byte[][] names;
// /** @var array */
@@ -31,31 +31,31 @@ public class Xomw_MagicWordArray {
// private regex;
- public Xomw_MagicWordArray(Xomw_MagicWordMgr magic_word_mgr, byte[][] names) {
+ public XomwMagicWordArray(XomwMagicWordMgr magic_word_mgr, byte[][] names) {
// this.magic_word_mgr = magic_word_mgr;
this.names = names;
// ASSUME: all magic words in a group have the same case sensitivity
for (byte[] name : names) {
- Xomw_MagicWord word = magic_word_mgr.Get(name);
+ XomwMagicWord word = magic_word_mgr.Get(name);
if (word == null) continue;
- Xomw_MagicWordSynonym[] synonyms = word.synonyms;
+ XomwMagicWordSynonym[] synonyms = word.synonyms;
int synonyms_len = synonyms.length;
for (int i = 0; i < synonyms_len; i++) {
- Xomw_MagicWordSynonym synonym = synonyms[i];
+ XomwMagicWordSynonym synonym = synonyms[i];
switch (synonym.arg1_tid) {
- case Xomw_MagicWordSynonym.Arg1__nil:
- case Xomw_MagicWordSynonym.Arg1__end:
+ case XomwMagicWordSynonym.Arg1__nil:
+ case XomwMagicWordSynonym.Arg1__end:
if (fwd_trie == null) fwd_trie = word.case_match ? Btrie_slim_mgr.cs() : Btrie_slim_mgr.ci_u8();
fwd_trie.Add_obj(synonym.text_wo_arg1, synonym);
break;
- case Xomw_MagicWordSynonym.Arg1__bgn:
+ case XomwMagicWordSynonym.Arg1__bgn:
if (bwd_trie == null) bwd_trie = Btrie_bwd_mgr.c__(word.case_match);
bwd_trie.Add(synonym.text_wo_arg1, synonym);
break;
// ignore if mid / mix
- case Xomw_MagicWordSynonym.Arg1__mid:
- case Xomw_MagicWordSynonym.Arg1__mix:
+ case XomwMagicWordSynonym.Arg1__mid:
+ case XomwMagicWordSynonym.Arg1__mix:
Gfo_usr_dlg_.Instance.Warn_many("", "", "MagicWordArray: unsupported arg_1_tid: tid=~{0}", synonym.arg1_tid);
continue;
}
@@ -253,13 +253,13 @@ public class Xomw_MagicWordArray {
if (fwd_trie != null) {
Object o = fwd_trie.Match_at(trv, src, 0, src_end);
if (o != null) {
- Xomw_MagicWordSynonym syn = ((Xomw_MagicWordSynonym)o);
+ XomwMagicWordSynonym syn = ((XomwMagicWordSynonym)o);
name = syn.magic_name;
val_bgn = trv.Pos();
val_end = src_end;
// if "nil", then must be full match; EX: "thumbx" does not match "thumb"
- if (syn.arg1_tid == Xomw_MagicWordSynonym.Arg1__nil
+ if (syn.arg1_tid == XomwMagicWordSynonym.Arg1__nil
&& syn.text_wo_arg1.length != src_end) {
rv[0] = rv[1] = null;
return;
@@ -271,7 +271,7 @@ public class Xomw_MagicWordArray {
if (bwd_trie != null) {
Object o = bwd_trie.Match_at(trv, src, src_end - 1, -1);
if (o != null) {
- Xomw_MagicWordSynonym syn = ((Xomw_MagicWordSynonym)o);
+ XomwMagicWordSynonym syn = ((XomwMagicWordSynonym)o);
name = syn.magic_name;
val_bgn = 0;
val_end = src_end - syn.text_wo_arg1.length;
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordArray__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordArrayTest.java
similarity index 85%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordArray__tst.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordArrayTest.java
index 429b2f6d8..38da5a4e9 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordArray__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordArrayTest.java
@@ -17,8 +17,8 @@ along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
import org.junit.*; import gplx.core.tests.*;
-public class Xomw_MagicWordArray__tst {
- private final Xomw_MagicWordArray__fxt fxt = new Xomw_MagicWordArray__fxt();
+public class XomwMagicWordArrayTest {
+ private final XomwMagicWordArrayFxt fxt = new XomwMagicWordArrayFxt();
@Test public void Nil() {
fxt.Init__word(Bool_.Y, "img_nil", "nil");
fxt.Init__ary("img_nil");
@@ -46,14 +46,14 @@ public class Xomw_MagicWordArray__tst {
fxt.Test__matchVariableStartToEnd("123px", "img_width", "123");
}
}
-class Xomw_MagicWordArray__fxt {
- private final Xomw_MagicWordMgr magic_word_mgr = new Xomw_MagicWordMgr();
- private Xomw_MagicWordArray magic_word_ary;
+class XomwMagicWordArrayFxt {
+ private final XomwMagicWordMgr magic_word_mgr = new XomwMagicWordMgr();
+ private XomwMagicWordArray magic_word_ary;
public void Init__word(boolean cs, String word, String... synonyms) {
magic_word_mgr.Add(Bry_.new_u8(word), cs, Bry_.Ary(synonyms));
}
public void Init__ary(String... words) {
- magic_word_ary = new Xomw_MagicWordArray(magic_word_mgr, Bry_.Ary(words));
+ magic_word_ary = new XomwMagicWordArray(magic_word_mgr, Bry_.Ary(words));
}
public void Test__matchVariableStartToEnd(String src, String expd_name, String expd_val) {
byte[][] rv = new byte[2][];
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordMgr.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordMgr.java
similarity index 83%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordMgr.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordMgr.java
index f17ee4fba..3bd486a31 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordMgr.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordMgr.java
@@ -16,13 +16,13 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
-public class Xomw_MagicWordMgr {
+public class XomwMagicWordMgr {
private final Hash_adp_bry hash = Hash_adp_bry.cs();
public void Add(byte[] name, boolean cs, byte[]... synonyms) {
- Xomw_MagicWord mw = new Xomw_MagicWord(name, cs, synonyms);
+ XomwMagicWord mw = new XomwMagicWord(name, cs, synonyms);
hash.Add(name, mw);
}
- public Xomw_MagicWord Get(byte[] name) {
- return (Xomw_MagicWord)hash.Get_by(name);
+ public XomwMagicWord Get(byte[] name) {
+ return (XomwMagicWord)hash.Get_by(name);
}
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordSynonym.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordSynonym.java
similarity index 92%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordSynonym.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordSynonym.java
index d47ab9810..94e2670cf 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MagicWordSynonym.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMagicWordSynonym.java
@@ -16,13 +16,13 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
-public class Xomw_MagicWordSynonym {
+public class XomwMagicWordSynonym {
public final byte[] magic_name;
public final boolean case_match;
public final byte[] text;
public final byte[] text_wo_arg1;
public final byte arg1_tid;
- public Xomw_MagicWordSynonym(byte[] magic_name, boolean case_match, byte[] text) {
+ public XomwMagicWordSynonym(byte[] magic_name, boolean case_match, byte[] text) {
this.magic_name = magic_name;
this.case_match = case_match;
this.text = text;
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MediaWikiServices.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMediaWikiServices.java
similarity index 95%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MediaWikiServices.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMediaWikiServices.java
index 3a5659fa1..8bf312911 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_MediaWikiServices.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMediaWikiServices.java
@@ -30,11 +30,11 @@ import gplx.xowa.mediawiki.includes.title.*;
* @see docs/injection.txt for an overview of using dependency injection in the
* MediaWiki code super.
*/
-public class Xomw_MediaWikiServices {
+public class XomwMediaWikiServices {
/**
* @var MediaWikiServices|null
*/
- private static Xomw_MediaWikiServices instance = null;
+ private static XomwMediaWikiServices instance = null;
/**
* Returns the global default instance of the top level service locator.
@@ -50,7 +50,7 @@ public class Xomw_MediaWikiServices {
*
* @return MediaWikiServices
*/
- public static Xomw_MediaWikiServices getInstance() {
+ public static XomwMediaWikiServices getInstance() {
if (instance == null) {
// NOTE: constructing GlobalVarConfig here is not particularly pretty,
// but some information from the global scope has to be injected here,
@@ -58,7 +58,7 @@ public class Xomw_MediaWikiServices {
// configuration from.
// $bootstrapConfig = new GlobalVarConfig();
// self::$instance = self::newInstance($bootstrapConfig, 'load');
- instance = new Xomw_MediaWikiServices();
+ instance = new XomwMediaWikiServices();
}
return instance;
@@ -577,11 +577,11 @@ public class Xomw_MediaWikiServices {
* @since 1.28
* @return TitleParser
*/
- public Xomw_MediaWikiTitleCodec getTitleParser() {
+ public XomwMediaWikiTitleCodec getTitleParser() {
// return $this->getService( 'TitleParser' );
return titleParser;
}
- private Xomw_MediaWikiTitleCodec titleParser = new Xomw_MediaWikiTitleCodec();
+ private XomwMediaWikiTitleCodec titleParser = new XomwMediaWikiTitleCodec();
// /**
// * @since 1.28
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_Message.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMessage.java
similarity index 96%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_Message.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMessage.java
index 6cfb1e2fc..4c3b78b16 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_Message.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMessage.java
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
-public class Xomw_Message {
+public class XomwMessage {
public byte[] text() {return null;}
public byte[] escaped() {return null;}
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_message_mgr.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMessageMgr.java
similarity index 87%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_message_mgr.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMessageMgr.java
index 07905c09a..600c7b272 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_message_mgr.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwMessageMgr.java
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
-public class Xomw_message_mgr {
+public class XomwMessageMgr {
private final Hash_adp hash = Hash_adp_.New();
- public Xomw_Message Get_by_str(String key) {return (Xomw_Message)hash.Get_by(key);}
+ public XomwMessage Get_by_str(String key) {return (XomwMessage)hash.Get_by(key);}
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_sanitizer.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwSanitizer.java
similarity index 96%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_sanitizer.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwSanitizer.java
index 0ad0f6359..f55e2ba78 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_sanitizer.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwSanitizer.java
@@ -19,7 +19,7 @@ package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import
import gplx.core.brys.*; import gplx.core.btries.*; import gplx.core.encoders.*; import gplx.core.primitives.*; import gplx.langs.htmls.entitys.*;
import gplx.xowa.parsers.htmls.*;
import gplx.langs.htmls.*; import gplx.xowa.mediawiki.includes.htmls.*; import gplx.xowa.mediawiki.includes.parsers.*; import gplx.xowa.mediawiki.includes.utls.*;
-public class Xomw_sanitizer {
+public class XomwSanitizer {
private final Mwh_doc_wkr__atr_bldr atr_bldr = new Mwh_doc_wkr__atr_bldr();
private final Mwh_atr_parser atr_parser = new Mwh_atr_parser();
private final Xomw_regex_escape_invalid regex_clean_url = new Xomw_regex_escape_invalid();
@@ -33,7 +33,7 @@ public class Xomw_sanitizer {
private static Xomw_regex_url_char regex_url_char;
private static Btrie_slim_mgr invalid_idn_trie;
- public Xomw_sanitizer() {
+ public XomwSanitizer() {
this.normalize_cbk = new Xomw_regex_url_char_cbk__normalize(this);
this.decode_cbk = new Xomw_regex_url_char_cbk__decode(this);
if (regex_url_char == null) {
@@ -702,8 +702,8 @@ interface Xomw_regex_url_char_cbk {
boolean When_amp(Bry_bfr bfr);
}
class Xomw_regex_url_char_cbk__normalize implements Xomw_regex_url_char_cbk {
- private final Xomw_sanitizer sanitizer;
- public Xomw_regex_url_char_cbk__normalize(Xomw_sanitizer sanitizer) {
+ private final XomwSanitizer sanitizer;
+ public Xomw_regex_url_char_cbk__normalize(XomwSanitizer sanitizer) {
this.sanitizer = sanitizer;
}
public boolean When_ent(Bry_bfr bfr, byte[] name) { // XO.MW:normalizeEntity
@@ -712,7 +712,7 @@ class Xomw_regex_url_char_cbk__normalize implements Xomw_regex_url_char_cbk {
// > & "). If the entity is a MediaWiki-specific alias, returns
// the HTML equivalent. Otherwise, returns HTML-escaped text of
// pseudo-entity source (eg &foo;)
- Object o = Xomw_sanitizer.html_entities.Get_by_bry(name);
+ Object o = XomwSanitizer.html_entities.Get_by_bry(name);
if (o == null) {
bfr.Add_str_a7("&").Add(name).Add_byte_semic();
return false;
@@ -747,15 +747,15 @@ class Xomw_regex_url_char_cbk__normalize implements Xomw_regex_url_char_cbk {
}
}
class Xomw_regex_url_char_cbk__decode implements Xomw_regex_url_char_cbk {
- private final Xomw_sanitizer sanitizer;
- public Xomw_regex_url_char_cbk__decode(Xomw_sanitizer sanitizer) {
+ private final XomwSanitizer sanitizer;
+ public Xomw_regex_url_char_cbk__decode(XomwSanitizer sanitizer) {
this.sanitizer = sanitizer;
}
public boolean When_ent(Bry_bfr bfr, byte[] name) {// XO.MW:decodeEntity
// If the named entity is defined in the HTML 4.0/XHTML 1.0 DTD,
// return the UTF-8 encoding of that character. Otherwise, returns
// pseudo-entity source (eg "&foo;")
- Object o = Xomw_sanitizer.html_entities.Get_by_bry(name);
+ Object o = XomwSanitizer.html_entities.Get_by_bry(name);
if (o == null) {
bfr.Add_byte(Byte_ascii.Amp).Add(name).Add_byte_semic();
}
@@ -799,7 +799,7 @@ class Xomw_regex_url_char {
public Xomw_regex_url_char() {
// assert static structs
if (Normalize__dec == null) {
- synchronized (Xomw_sanitizer.class) {
+ synchronized (XomwSanitizer.class) {
Normalize__dec = Bool_ary_bldr.New_u8().Set_rng(Byte_ascii.Num_0, Byte_ascii.Num_9).To_ary();
Normalize__hex = Bool_ary_bldr.New_u8()
.Set_rng(Byte_ascii.Num_0, Byte_ascii.Num_9)
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_sanitizer__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwSanitizerTest.java
similarity index 96%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_sanitizer__tst.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwSanitizerTest.java
index f26cc0177..b24141f80 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_sanitizer__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwSanitizerTest.java
@@ -17,8 +17,8 @@ along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
import org.junit.*; import gplx.core.tests.*; import gplx.core.btries.*; import gplx.xowa.mediawiki.includes.htmls.*;
-public class Xomw_sanitizer__tst {
- private final Xomw_sanitizer__fxt fxt = new Xomw_sanitizer__fxt();
+public class XomwSanitizerTest {
+ private final XomwSanitizerFxt fxt = new XomwSanitizerFxt();
@Test public void Normalize__text() {fxt.Test__normalize_char_references("abc" , "abc");}
@Test public void Normalize__dec() {fxt.Test__normalize_char_references("" , "");}
@Test public void Normalize__dec__invalid() {fxt.Test__normalize_char_references(" " , " ");}
@@ -124,8 +124,8 @@ public class Xomw_sanitizer__tst {
fxt.Test__merge_attributes(src_atrs.Clear().Add_many(cls, " v1 v2 "), trg_atrs.Clear().Add_many(cls, " v3 v4 "), expd_atrs.Clear().Add_many(cls, "v1 v2 v3 v4"));
}
}
-class Xomw_sanitizer__fxt {
- private final Xomw_sanitizer sanitizer = new Xomw_sanitizer();
+class XomwSanitizerFxt {
+ private final XomwSanitizer sanitizer = new XomwSanitizer();
private final Bry_bfr tmp = Bry_bfr_.New();
public void Test__normalize_char_references(String src_str, String expd) {
byte[] src_bry = Bry_.new_u8(src_str);
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_Title.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwTitle.java
similarity index 96%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_Title.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwTitle.java
index 4767e8089..94e03c822 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_Title.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwTitle.java
@@ -26,7 +26,7 @@ import gplx.xowa.mediawiki.includes.title.*;
* @note Consider using a TitleValue Object instead. TitleValue is more lightweight
* and does not rely on global state or the database.
*/
-public class Xomw_Title {
+public class XomwTitle {
// /** @var HashBagOStuff */
// static private $titleCache = null;
//
@@ -131,7 +131,7 @@ public class Xomw_Title {
* following default, NS_MAIN is hardcoded in several places. See bug 696.
* Zero except in {{transclusion}} tags.
*/
- public int mDefaultNamespace = Xomw_Defines.NS_MAIN;
+ public int mDefaultNamespace = XomwDefines.NS_MAIN;
// /** @var int The page length, 0 for special pages */
// protected $mLength = -1;
@@ -253,8 +253,8 @@ public class Xomw_Title {
* @throws InvalidArgumentException
* @return Title|null Title or null on an error.
*/
- public static Xomw_Title newFromText(byte[] text) {return newFromText(text, Xomw_Defines.NS_MAIN);}
- public static Xomw_Title newFromText(byte[] text, int defaultNamespace) {
+ public static XomwTitle newFromText(byte[] text) {return newFromText(text, XomwDefines.NS_MAIN);}
+ public static XomwTitle newFromText(byte[] text, int defaultNamespace) {
// DWIM: Integers can be passed in here when page titles are used as array keys.
// XO.MW.SKIP:STRONGCAST
// if ($text != null && !is_string($text) && !is_int($text)) {
@@ -265,7 +265,7 @@ public class Xomw_Title {
}
try {
- return Xomw_Title.newFromTextThrow(text, defaultNamespace);
+ return XomwTitle.newFromTextThrow(text, defaultNamespace);
} catch (MalformedTitleException ex) {
Err_.Noop(ex);
return null;
@@ -286,7 +286,7 @@ public class Xomw_Title {
* @throws MalformedTitleException If the title is invalid
* @return Title
*/
- public static Xomw_Title newFromTextThrow(byte[] text, int defaultNamespace) {
+ public static XomwTitle newFromTextThrow(byte[] text, int defaultNamespace) {
// if (is_object($text)) {
// throw new MWException('$text must be a String, given an Object');
// }
@@ -309,7 +309,7 @@ public class Xomw_Title {
// $filteredText = Sanitizer::decodeCharReferencesAndNormalize($text);
byte[] filteredText = text;
- Xomw_Title t = new Xomw_Title();
+ XomwTitle t = new XomwTitle();
t.mDbkeyform = Php_str_.strtr(filteredText, Byte_ascii.Space, Byte_ascii.Underline);
t.mDefaultNamespace = defaultNamespace;
@@ -1399,7 +1399,7 @@ public class Xomw_Title {
* @param String $fragment
* @return Title
*/
- public Xomw_Title createFragmentTarget(byte[] fragment) {
+ public XomwTitle createFragmentTarget(byte[] fragment) {
return null;
// return self::makeTitle(
// this.getNamespace(),
@@ -1705,6 +1705,7 @@ public class Xomw_Title {
*
* @return String String of the URL.
*/
+ public byte[] getLocalURL(byte[] query) {return getLocalURL(query, null);}
public byte[] getLocalURL(byte[] query, byte[] query2) {
byte[] url = null;
// global wgArticlePath, wgScript, wgServer, wgRequest;
@@ -3366,9 +3367,9 @@ public class Xomw_Title {
// @todo: get rid of secureAndSplit, refactor parsing code.
// @note: getTitleParser() returns a TitleParser implementation which does not have a
// splitTitleString method, but the only implementation (MediaWikiTitleCodec) does
- Xomw_MediaWikiTitleCodec titleCodec = Xomw_MediaWikiServices.getInstance().getTitleParser();
+ XomwMediaWikiTitleCodec titleCodec = XomwMediaWikiServices.getInstance().getTitleParser();
// MalformedTitleException can be thrown here
- Xomw_MediaWikiTitleCodec_Parts parts = titleCodec.splitTitleString(dbkey, this.getDefaultNamespace());
+ XomwMediaWikiTitleCodecParts parts = titleCodec.splitTitleString(dbkey, this.getDefaultNamespace());
// Fill fields
// this.setFragment('#' . parts.fragment);
@@ -3382,7 +3383,7 @@ public class Xomw_Title {
this.mTextform = Php_str_.strtr(this.mDbkeyform, Byte_ascii.Underline, Byte_ascii.Space);
// We already know that some pages won't be in the database!
- if (this.isExternal() || this.mNamespace == Xomw_Defines.NS_SPECIAL) {
+ if (this.isExternal() || this.mNamespace == XomwDefines.NS_SPECIAL) {
this.mArticleID = 0;
}
@@ -4227,7 +4228,7 @@ public class Xomw_Title {
* @param Title $title
* @return boolean
*/
- public boolean equals(Xomw_Title title) {
+ public boolean equals(XomwTitle title) {
// Note: == is necessary for proper matching of number-like titles.
return Bry_.Eq(this.getInterwiki(), title.getInterwiki())
&& this.getNamespace() == title.getNamespace()
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_xml.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwXml.java
similarity index 95%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_xml.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwXml.java
index bbc09b7b0..6b279375b 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/Xomw_xml.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/XomwXml.java
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*;
-public class Xomw_xml {
+public class XomwXml {
// Format an XML element with given attributes and, optionally, text content.
// Element and attribute names are assumed to be ready for literal inclusion.
// Strings are assumed to not contain XML-illegal characters; special
@@ -55,7 +55,7 @@ public class Xomw_xml {
bfr.Add_byte_space();
bfr.Add((byte[])attribs.Get_at(i));
bfr.Add_byte_eq().Add_byte_quote();
- Xomw_sanitizer.Encode_attribute(bfr, (byte[])attribs.Get_at(i + 1));
+ XomwSanitizer.Encode_attribute(bfr, (byte[])attribs.Get_at(i + 1));
bfr.Add_byte_quote();
}
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/Xomw_FileRepo.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/XomwFileRepo.java
similarity index 96%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/Xomw_FileRepo.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/XomwFileRepo.java
index e0d6af8fa..a0e9ead1c 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/Xomw_FileRepo.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/XomwFileRepo.java
@@ -21,7 +21,7 @@ import gplx.xowa.mediawiki.includes.utls.*;
/* TODO.XO:
* getZoneUrl
*/
-public class Xomw_FileRepo {
+public class XomwFileRepo {
// static final DELETE_SOURCE = 1;
// static final OVERWRITE = 2;
// static final OVERWRITE_SAME = 4;
@@ -119,7 +119,7 @@ public class Xomw_FileRepo {
// /** @var array callable|boolean Override these in the super class */
// protected oldFileFactoryKey = false;
- public Xomw_FileRepo(byte[] url, byte[] thumbUrl) {
+ public XomwFileRepo(byte[] url, byte[] thumbUrl) {
this.url = url;
this.thumbUrl = thumbUrl;
}
@@ -620,7 +620,7 @@ public class Xomw_FileRepo {
* @param Title title
* @return String
*/
- public byte[] getNameFromTitle(byte[] title) {
+ public byte[] getNameFromTitle(XomwTitle title) {
// global wgContLang;
// if (this.initialCapital != MWNamespace::isCapitalized(NS_FILE)) {
// name = title.getUserCaseDBKey();
@@ -632,7 +632,7 @@ public class Xomw_FileRepo {
// }
//
// return name;
- return title;
+ return title.getDBkey();
}
//
// /**
@@ -1346,7 +1346,7 @@ public class Xomw_FileRepo {
* @param String file Virtual URL (or storage path) of file to check
* @return boolean
*/
- public boolean fileExists(Xomw_File file) {
+ public boolean fileExists(XomwFile file) {
// result = this.fileExistsBatch(file);
//
// return result[0];
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_File.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFile.java
similarity index 94%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_File.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFile.java
index 171489863..e8a18dc00 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_File.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFile.java
@@ -19,7 +19,7 @@ package gplx.xowa.mediawiki.includes.filerepo.file; import gplx.*; import gplx.x
import gplx.xowa.mediawiki.includes.media.*;
import gplx.xowa.mediawiki.includes.utls.*;
import gplx.xowa.mediawiki.includes.parsers.*; import gplx.xowa.mediawiki.includes.parsers.lnkis.*;
-public class Xomw_File {
+public class XomwFile {
/* TODO.XO:
* P8: normalizeExtension
* P8: normalizeTitle
@@ -69,10 +69,10 @@ public class Xomw_File {
*/
/** @var FileRepo|LocalRepo|ForeignAPIRepo|boolean */
- public Xomw_FileRepo repo;
+ public XomwFileRepo repo;
/** @var Title|String|boolean */
- private byte[] title;
+ private XomwTitle title;
// /** @var String Text of last error */
// protected lastError;
@@ -87,7 +87,7 @@ public class Xomw_File {
// protected fsFile;
/** @var MediaHandler */
- private Xomw_MediaHandler handler = null;
+ private XomwMediaHandler handler = null;
/** @var String The URL corresponding to one of the four basic zones */
public byte[] url;
@@ -268,11 +268,11 @@ public class Xomw_File {
// return strcmp(a.getName(), b.getName());
// }
- public Xomw_File(Xomw_parser_env env, byte[] title, Xomw_FileRepo repo) {
+ public XomwFile(Xomw_parser_env env, XomwTitle title, XomwFileRepo repo) {
this.env = env;
this.title = title;
-// call normalizeTitle
- this.name = title;
+// change title.getDBKey to normalizeTitle
+ this.name = title.getDBkey();
this.repo = repo;
}
/**
@@ -309,7 +309,7 @@ public class Xomw_File {
*
* @return Title
*/
- public byte[] getTitle() {
+ public XomwTitle getTitle() {
return this.title;
}
@@ -335,7 +335,7 @@ public class Xomw_File {
if (!Php_utl_.isset(this.url)) {
// this.assertRepoDefined();
byte[] ext = this.getExtension();
- this.url = Bry_.Add(this.repo.getZoneUrl(Xomw_FileRepo.Zone__public, ext), Byte_ascii.Slash_bry, this.getUrlRel());
+ this.url = Bry_.Add(this.repo.getZoneUrl(XomwFileRepo.Zone__public, ext), Byte_ascii.Slash_bry, this.getUrlRel());
}
return this.url;
@@ -403,7 +403,7 @@ public class Xomw_File {
public byte[] getPath() {
if (this.path == null) {
// this.assertRepoDefined();
- this.path = Bry_.Add(this.repo.getZonePath(Xomw_FileRepo.Zone__public), Byte_ascii.Slash_bry, this.getRel());
+ this.path = Bry_.Add(this.repo.getZonePath(XomwFileRepo.Zone__public), Byte_ascii.Slash_bry, this.getRel());
}
return this.path;
@@ -751,7 +751,7 @@ public class Xomw_File {
* @return boolean
*/
public boolean mustRender() {
- Xomw_MediaHandler handler = this.getHandler();
+ XomwMediaHandler handler = this.getHandler();
return handler.mustRender(this);
}
@@ -948,7 +948,7 @@ public class Xomw_File {
* @return String|null
*/
public byte[] generateThumbName(byte[] name, Xomw_params_handler handlerParams) {
- Xomw_MediaHandler handler = this.getHandler();
+ XomwMediaHandler handler = this.getHandler();
if (handler == null) {
return null;
}
@@ -1030,11 +1030,11 @@ public class Xomw_File {
* @param int flags A bitfield, may contain self::RENDER_NOW to force rendering
* @return ThumbnailImage|MediaTransformOutput|boolean False on failure
*/
- public Xomw_MediaTransformOutput transform(Xomw_params_handler handlerParams) {return transform(handlerParams, 0);}
- public Xomw_MediaTransformOutput transform(Xomw_params_handler handlerParams, int flags) {
+ public XomwMediaTransformOutput transform(Xomw_params_handler handlerParams) {return transform(handlerParams, 0);}
+ public XomwMediaTransformOutput transform(Xomw_params_handler handlerParams, int flags) {
// global wgThumbnailEpoch;
- Xomw_MediaTransformOutput thumb = null;
+ XomwMediaTransformOutput thumb = null;
do {
if (!this.canRender()) {
// thumb = this.iconThumb();
@@ -1118,12 +1118,12 @@ public class Xomw_File {
* @param int flags
* @return boolean|MediaTransformOutput
*/
- public Xomw_MediaTransformOutput generateAndSaveThumb(Object tmpFile, Xomw_params_handler transformParams, int flags) {
+ public XomwMediaTransformOutput generateAndSaveThumb(Object tmpFile, Xomw_params_handler transformParams, int flags) {
// global wgIgnoreImageErrors;
//
// stats = RequestContext::getMain().getStats();
- Xomw_MediaHandler handler = this.getHandler();
+ XomwMediaHandler handler = this.getHandler();
Xomw_params_handler normalisedParams = transformParams;
handler.normaliseParams(this, normalisedParams);
@@ -1142,7 +1142,7 @@ public class Xomw_File {
// starttime = microtime(true);
//
// Actually render the thumbnail...
- Xomw_MediaTransformOutput thumb = handler.doTransform(this, tmpThumbPath, thumbUrl, transformParams);
+ XomwMediaTransformOutput thumb = handler.doTransform(this, tmpThumbPath, thumbUrl, transformParams);
// tmpFile.bind(thumb); // keep alive with thumb
//
// statTiming = microtime(true) - starttime;
@@ -1366,7 +1366,7 @@ public class Xomw_File {
* @return MediaHandler|boolean Registered MediaHandler for file's MIME type
* or false if none found
*/
- public Xomw_MediaHandler getHandler() {
+ public XomwMediaHandler getHandler() {
if (this.handler == null) {
this.handler = env.MediaHandlerFactory().getHandler(this.getMimeType());
}
@@ -1618,7 +1618,7 @@ public class Xomw_File {
public byte[] getThumbPath(byte[] suffix) {
// this.assertRepoDefined();
- return Bry_.Add(this.repo.getZonePath(Xomw_FileRepo.Zone__thumb), Byte_ascii.Slash_bry, this.getThumbRel(suffix));
+ return Bry_.Add(this.repo.getZonePath(XomwFileRepo.Zone__thumb), Byte_ascii.Slash_bry, this.getThumbRel(suffix));
}
// /**
@@ -1698,7 +1698,7 @@ public class Xomw_File {
* @return String Path
*/
private byte[] getThumbUrl(byte[] suffix) {
- return this.getZoneUrl(Xomw_FileRepo.Zone__thumb, suffix);
+ return this.getZoneUrl(XomwFileRepo.Zone__thumb, suffix);
}
// /**
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_file_finder.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFileFinder.java
similarity index 92%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_file_finder.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFileFinder.java
index 2dc91f7c1..d55c9b7bb 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_file_finder.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFileFinder.java
@@ -16,6 +16,6 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes.filerepo.file; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*; import gplx.xowa.mediawiki.includes.filerepo.*;
-public interface Xomw_file_finder {
- Xomw_File Find_file(Xomw_Title ttl);
+public interface XomwFileFinder {
+ XomwFile Find_file(XomwTitle ttl);
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_file_finder__mock.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFileFinderMock.java
similarity index 74%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_file_finder__mock.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFileFinderMock.java
index c241a38b5..13daf9c7f 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_file_finder__mock.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFileFinderMock.java
@@ -17,17 +17,17 @@ along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes.filerepo.file; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*; import gplx.xowa.mediawiki.includes.filerepo.*;
import gplx.xowa.mediawiki.includes.parsers.*;
-public class Xomw_file_finder__mock implements Xomw_file_finder {
+public class XomwFileFinderMock implements XomwFileFinder {
private final Xomw_parser_env env;
- public Xomw_file_finder__mock(Xomw_parser_env env) {this.env = env;}
+ public XomwFileFinderMock(Xomw_parser_env env) {this.env = env;}
private final Hash_adp_bry hash = Hash_adp_bry.cs();
public void Clear() {hash.Clear();}
- public Xomw_File Find_file(Xomw_Title ttl) {
- return (Xomw_File)hash.Get_by(ttl.getPrefixedDBkey());
+ public XomwFile Find_file(XomwTitle ttl) {
+ return (XomwFile)hash.Get_by(ttl.getPrefixedDBkey());
}
- public void Add(String title, Xomw_FileRepo repo, int w, int h, byte[] mime) {
+ public void Add(String title, XomwFileRepo repo, int w, int h, byte[] mime) {
byte[] title_bry = Bry_.new_u8(title);
- Xomw_LocalFile file = new Xomw_LocalFile(env, title_bry, repo, w, h, mime);
+ XomwLocalFile file = new XomwLocalFile(env, XomwTitle.newFromText(title_bry), repo, w, h, mime);
hash.Add_if_dupe_use_nth(title_bry, file);
}
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_file_finder__noop.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFileFinderNoop.java
similarity index 87%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_file_finder__noop.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFileFinderNoop.java
index c2975f521..8ff40fcfc 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_file_finder__noop.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwFileFinderNoop.java
@@ -16,6 +16,6 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes.filerepo.file; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*; import gplx.xowa.mediawiki.includes.filerepo.*;
-public class Xomw_file_finder__noop implements Xomw_file_finder {
- public Xomw_File Find_file(Xomw_Title ttl) {return null;}
+public class XomwFileFinderNoop implements XomwFileFinder {
+ public XomwFile Find_file(XomwTitle ttl) {return null;}
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_LocalFile.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwLocalFile.java
similarity index 96%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_LocalFile.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwLocalFile.java
index 006232edf..cfc05d460 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/Xomw_LocalFile.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/filerepo/file/XomwLocalFile.java
@@ -17,7 +17,7 @@ along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes.filerepo.file; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*; import gplx.xowa.mediawiki.includes.filerepo.*;
import gplx.xowa.mediawiki.includes.parsers.*;
-public class Xomw_LocalFile extends Xomw_File {// static final VERSION = 10; // cache version
+public class XomwLocalFile extends XomwFile {// static final VERSION = 10; // cache version
//
// static final CACHE_FIELD_MAX_LEN = 1000;
//
@@ -188,7 +188,7 @@ public class Xomw_LocalFile extends Xomw_File {// static final VERSION = 10; //
// ];
// }
- public Xomw_LocalFile(Xomw_parser_env env, byte[] title, Xomw_FileRepo repo, int w, int h, byte[] mime) {super(env, title, repo);
+ public XomwLocalFile(Xomw_parser_env env, XomwTitle title, XomwFileRepo repo, int w, int h, byte[] mime) {super(env, title, repo);
this.width = w;
this.height = h;
this.mime = mime;
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/Xomw_html_utl.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/XomwHtml.java
similarity index 96%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/Xomw_html_utl.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/XomwHtml.java
index a62670701..556e6f62c 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/Xomw_html_utl.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/XomwHtml.java
@@ -18,7 +18,7 @@ along with this program. If not, see .
package gplx.xowa.mediawiki.includes.htmls; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*;
import gplx.core.btries.*;
import gplx.xowa.mediawiki.includes.utls.*;
-public class Xomw_html_utl {
+public class XomwHtml {
private final Bry_bfr tmp = Bry_bfr_.New();
private final Btrie_rv trv = new Btrie_rv();
public void Raw_element(Bry_bfr bfr, byte[] element, Xomw_atr_mgr attribs, byte[] contents) {
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/Xomw_html_utl__expand_attributes__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/Xomw_html_utl__expand_attributes__tst.java
index 420ed14e7..e51cc8cea 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/Xomw_html_utl__expand_attributes__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/htmls/Xomw_html_utl__expand_attributes__tst.java
@@ -22,7 +22,7 @@ public class Xomw_html_utl__expand_attributes__tst {
@Test public void Basic() {fxt.Test__expand_attributes(" a=\"b\"", "a", "b");}
}
class Xomw_html_utl__expand_attributes__fxt {
- private final Xomw_html_utl utl = new Xomw_html_utl();
+ private final XomwHtml utl = new XomwHtml();
private final Bry_bfr bfr = Bry_bfr_.New();
public void Test__expand_attributes(String expd, String... kvs) {
Xomw_atr_mgr atrs = new Xomw_atr_mgr();
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/linkers/Xomw_link_renderer.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/linkers/Xomw_link_renderer.java
index 97440ffbe..f544de680 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/linkers/Xomw_link_renderer.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/linkers/Xomw_link_renderer.java
@@ -26,15 +26,15 @@ import gplx.xowa.mediawiki.includes.htmls.*;
*/
public class Xomw_link_renderer {
private boolean expand_urls = false;
- private final Xomw_html_utl html_utl = new Xomw_html_utl();
+ private final XomwHtml html_utl = new XomwHtml();
private final Xomw_atr_mgr attribs = new Xomw_atr_mgr();
private final List_adp tmp_merge_deleted = List_adp_.New();
- private final Xomw_sanitizer sanitizer;
- public Xomw_link_renderer(Xomw_sanitizer sanitizer) {
+ private final XomwSanitizer sanitizer;
+ public Xomw_link_renderer(XomwSanitizer sanitizer) {
this.sanitizer = sanitizer;
}
// XO.MW:SYNC:1.29; DATE:2017-01-31
- public void Make_link(Bry_bfr bfr, Xomw_Title target, byte[] text, byte[] classes, Xomw_atr_mgr extra_atrs, Xomw_qry_mgr query) {
+ public void Make_link(Bry_bfr bfr, XomwTitle target, byte[] text, byte[] classes, Xomw_atr_mgr extra_atrs, Xomw_qry_mgr query) {
if (target.isKnown()) {
this.Make_known_link(bfr, target, text, extra_atrs, query);
} else {
@@ -45,7 +45,7 @@ public class Xomw_link_renderer {
// If you have already looked up the proper CSS classes using LinkRenderer::getLinkClasses()
// or some other method, use this to avoid looking it up again.
// XO.MW:SYNC:1.29; DATE:2017-01-31
- public void Make_preloaded_link(Bry_bfr bfr, Xomw_Title target, byte[] text, byte[] classes, Xomw_atr_mgr extra_atrs, Xomw_qry_mgr query) {
+ public void Make_preloaded_link(Bry_bfr bfr, XomwTitle target, byte[] text, byte[] classes, Xomw_atr_mgr extra_atrs, Xomw_qry_mgr query) {
// XO.MW.HOOK: $this->runBeginHook --> 'HtmlPageLinkRendererBegin', 'LinkBegin'
target = Normalize_target(target);
@@ -69,7 +69,7 @@ public class Xomw_link_renderer {
}
// XO.MW:SYNC:1.29; DATE:2017-01-31
- public void Make_known_link(Bry_bfr bfr, Xomw_Title target, byte[] text, Xomw_atr_mgr extra_atrs, Xomw_qry_mgr query) {
+ public void Make_known_link(Bry_bfr bfr, XomwTitle target, byte[] text, Xomw_atr_mgr extra_atrs, Xomw_qry_mgr query) {
byte[] classes = Bry_.Empty;
if (target.isExternal()) {
classes = Bry__classes__extiw;
@@ -82,7 +82,7 @@ public class Xomw_link_renderer {
Make_preloaded_link(bfr, target, text, classes, extra_atrs, query);
}
// XO.MW:SYNC:1.29; DATE:2017-01-31
- public void Make_broken_link(Bry_bfr bfr, Xomw_Title target, byte[] text, Xomw_atr_mgr extra_atrs, Xomw_qry_mgr query) {
+ public void Make_broken_link(Bry_bfr bfr, XomwTitle target, byte[] text, Xomw_atr_mgr extra_atrs, Xomw_qry_mgr query) {
// XO.MW.HOOK: Run legacy hook
// We don't want to include fragments for broken links, because they
@@ -92,7 +92,7 @@ public class Xomw_link_renderer {
}
target = Normalize_target(target);
- if (query.action == null && target.getNamespace() != Xomw_Defines.NS_SPECIAL) {
+ if (query.action == null && target.getNamespace() != XomwDefines.NS_SPECIAL) {
query.action = Bry_.new_a7("edit");
query.redlink = 1;
}
@@ -118,7 +118,7 @@ public class Xomw_link_renderer {
Build_a_element(bfr, target, text, attribs, false);
}
// XO.MW:SYNC:1.29; DATE:2017-01-31
- private void Build_a_element(Bry_bfr bfr, Xomw_Title target, byte[] text, Xomw_atr_mgr attribs, boolean is_known) {
+ private void Build_a_element(Bry_bfr bfr, XomwTitle target, byte[] text, Xomw_atr_mgr attribs, boolean is_known) {
// XO.MW.HOOK:HtmlPageLinkRendererEnd
byte[] html = text;
@@ -129,7 +129,7 @@ public class Xomw_link_renderer {
html_utl.Raw_element(bfr, Gfh_tag_.Bry__a, attribs, html);
}
// XO.MW:SYNC:1.29; DATE:2017-01-31
- private byte[] Get_link_text(Xomw_Title target) {
+ private byte[] Get_link_text(XomwTitle target) {
byte[] prefixed_text = target.getPrefixedText();
// If the target is just a fragment, with no title, we return the fragment
// text. Otherwise, we return the title text itself.
@@ -138,7 +138,7 @@ public class Xomw_link_renderer {
}
return prefixed_text;
}
- private byte[] Get_link_url(Xomw_Title target, Xomw_qry_mgr query) {
+ private byte[] Get_link_url(XomwTitle target, Xomw_qry_mgr query) {
// TODO: Use a LinkTargetResolver service instead of Title
// if ($this->forceArticlePath) {
@@ -156,8 +156,8 @@ public class Xomw_link_renderer {
return url;
}
// XO.MW:SYNC:1.29; DATE:2017-01-31
- private Xomw_Title Normalize_target(Xomw_Title target) {
- return Xomw_linker.normaliseSpecialPage(target);
+ private XomwTitle Normalize_target(XomwTitle target) {
+ return XomwLinker.normaliseSpecialPage(target);
}
// XO.MW:SYNC:1.29; DATE:2017-02-01
private void Merge_attribs(Xomw_atr_mgr src, Xomw_atr_mgr trg) {
@@ -188,7 +188,7 @@ public class Xomw_link_renderer {
tmp_merge_deleted.Clear();
}
}
- public byte[] Get_link_classes(Xomw_Title target) {
+ public byte[] Get_link_classes(XomwTitle target) {
// Make sure the target is in the cache
// $id = $this->linkCache->addLinkObj($target);
// if ($id == 0) {
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_ImageHandler.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwImageHandler.java
similarity index 92%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_ImageHandler.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwImageHandler.java
index e2feb570d..5ecee725b 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_ImageHandler.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwImageHandler.java
@@ -22,15 +22,15 @@ import gplx.xowa.mediawiki.includes.utls.*;
* validateThumbParams
*/
// MEMORY:only one instance per wiki
-public abstract class Xomw_ImageHandler extends Xomw_MediaHandler { private final Xomw_param_map paramMap = new Xomw_param_map();
- public Xomw_ImageHandler(byte[] key) {super(key);
+public abstract class XomwImageHandler extends XomwMediaHandler { private final Xomw_param_map paramMap = new Xomw_param_map();
+ public XomwImageHandler(byte[] key) {super(key);
paramMap.Add(Xomw_param_itm.Mw__img_width, Xomw_param_map.Type__handler, Xomw_param_itm.Name_bry__width);
}
/**
* @param File file
* @return boolean
*/
- @Override public boolean canRender(Xomw_File file) {
+ @Override public boolean canRender(XomwFile file) {
return (Php_utl_.istrue(file.getWidth()) && Php_utl_.istrue(file.getHeight()));
}
@@ -95,7 +95,7 @@ public abstract class Xomw_ImageHandler extends Xomw_MediaHandler { private fina
* @param array paramsVar
* @return boolean
*/
- @Override public boolean normaliseParams(Xomw_File image, Xomw_params_handler handlerParams) {
+ @Override public boolean normaliseParams(XomwFile image, Xomw_params_handler handlerParams) {
byte[] mimeType = image.getMimeType();
if (!Php_utl_.isset(handlerParams.width)) {
@@ -145,7 +145,7 @@ public abstract class Xomw_ImageHandler extends Xomw_MediaHandler { private fina
// Because thumbs are only referred to by width, the height always needs
// to be scaled by the width to keep the thumbnail sizes consistent,
// even if it was set inside the if block above
- handlerParams.physicalHeight = Xomw_File.scaleHeight(srcWidth, srcHeight,
+ handlerParams.physicalHeight = XomwFile.scaleHeight(srcWidth, srcHeight,
handlerParams.physicalWidth);
// Set the height if it was not validated in the if block higher up
@@ -189,7 +189,7 @@ public abstract class Xomw_ImageHandler extends Xomw_MediaHandler { private fina
return false;
}
- height = Xomw_File.scaleHeight(srcWidth, srcHeight, width);
+ height = XomwFile.scaleHeight(srcWidth, srcHeight, width);
if (height == 0) {
// Force height to be at least 1 pixel
height = 1;
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_ImageHandler__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwImageHandlerTest.java
similarity index 79%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_ImageHandler__tst.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwImageHandlerTest.java
index 52948a7cc..9f7149a47 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_ImageHandler__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwImageHandlerTest.java
@@ -20,8 +20,8 @@ import org.junit.*; import gplx.core.tests.*;
import gplx.xowa.mediawiki.includes.utls.*;
import gplx.xowa.mediawiki.includes.parsers.*; import gplx.xowa.mediawiki.includes.parsers.lnkis.*;
import gplx.xowa.mediawiki.includes.filerepo.*; import gplx.xowa.mediawiki.includes.filerepo.file.*;
-public class Xomw_ImageHandler__tst {
- private final Xomw_ImageHandler__fxt fxt = new Xomw_ImageHandler__fxt();
+public class XomwImageHandlerTest {
+ private final XomwImageHandler_fxt fxt = new XomwImageHandler_fxt();
@Before public void init() {
fxt.Init__file("A.png", 400, 200);
}
@@ -30,13 +30,13 @@ public class Xomw_ImageHandler__tst {
fxt.Test__normaliseParams(fxt.Make__handlerParams(200), fxt.Make__handlerParams(200, 100, 200, 100));
}
}
-class Xomw_ImageHandler__fxt {
- private final Xomw_ImageHandler handler;
- private final Xomw_FileRepo repo = new Xomw_FileRepo(Bry_.new_a7("/orig"), Bry_.new_a7("/thumb"));
+class XomwImageHandler_fxt {
+ private final XomwImageHandler handler;
+ private final XomwFileRepo repo = new XomwFileRepo(Bry_.new_a7("/orig"), Bry_.new_a7("/thumb"));
private final Xomw_parser_env env = new Xomw_parser_env();
- private Xomw_File file;
- public Xomw_ImageHandler__fxt() {
- handler = new Xomw_TransformationalImageHandler(Bry_.new_a7("test_handler"));
+ private XomwFile file;
+ public XomwImageHandler_fxt() {
+ handler = new XomwTransformationalImageHandler(Bry_.new_a7("test_handler"));
}
public Xomw_params_handler Make__handlerParams(int w) {return Make__handlerParams(w, Php_utl_.Null_int, Php_utl_.Null_int, Php_utl_.Null_int);}
public Xomw_params_handler Make__handlerParams(int w, int h, int phys_w, int phys_h) {
@@ -48,7 +48,7 @@ class Xomw_ImageHandler__fxt {
return rv;
}
public void Init__file(String title, int w, int h) {
- this.file = new Xomw_LocalFile(env, Bry_.new_u8(title), repo, w, h, Xomw_MediaHandlerFactory.Mime__image__png);
+ this.file = new XomwLocalFile(env, XomwTitle.newFromText(Bry_.new_u8(title)), repo, w, h, XomwMediaHandlerFactory.Mime__image__png);
}
public void Test__normaliseParams(Xomw_params_handler prms, Xomw_params_handler expd) {
// exec
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_MediaHandler.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwMediaHandler.java
similarity index 94%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_MediaHandler.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwMediaHandler.java
index 9a277f575..f132ca185 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_MediaHandler.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwMediaHandler.java
@@ -18,9 +18,9 @@ along with this program. If not, see .
package gplx.xowa.mediawiki.includes.media; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*;
import gplx.xowa.mediawiki.includes.filerepo.file.*;
import gplx.xowa.mediawiki.includes.parsers.lnkis.*;
-public abstract class Xomw_MediaHandler {
+public abstract class XomwMediaHandler {
public byte[] Key() {return key;} private byte[] key;
- public Xomw_MediaHandler(byte[] key) {
+ public XomwMediaHandler(byte[] key) {
this.key = key;
}
@@ -83,7 +83,7 @@ public abstract class Xomw_MediaHandler {
* @param File $image
* @param array $paramsVar
*/
- public abstract boolean normaliseParams(Xomw_File image, Xomw_params_handler handlerParams);
+ public abstract boolean normaliseParams(XomwFile image, Xomw_params_handler handlerParams);
// /**
// * Get an image size array like that returned by getimagesize(), or false if it
@@ -258,7 +258,7 @@ public abstract class Xomw_MediaHandler {
* @param array $paramsVar Arbitrary set of parameters validated by $this->validateParam()
* @return MediaTransformOutput
*/
- public Xomw_MediaTransformOutput getTransform(Xomw_File image, byte[] dstPath, byte[] dstUrl, Xomw_params_handler handlerParams) {
+ public XomwMediaTransformOutput getTransform(XomwFile image, byte[] dstPath, byte[] dstUrl, Xomw_params_handler handlerParams) {
return this.doTransform(image, dstPath, dstUrl, handlerParams, TRANSFORM_LATER);
}
@@ -274,8 +274,8 @@ public abstract class Xomw_MediaHandler {
* @param int $flags A bitfield, may contain self::TRANSFORM_LATER
* @return MediaTransformOutput
*/
- public Xomw_MediaTransformOutput doTransform(Xomw_File image, byte[] dstPath, byte[] dstUrl, Xomw_params_handler handlerParams) {return doTransform(image, dstPath, dstUrl, handlerParams, 0);}
- public abstract Xomw_MediaTransformOutput doTransform(Xomw_File image, byte[] dstPath, byte[] dstUrl, Xomw_params_handler handlerParams, int flags);
+ public XomwMediaTransformOutput doTransform(XomwFile image, byte[] dstPath, byte[] dstUrl, Xomw_params_handler handlerParams) {return doTransform(image, dstPath, dstUrl, handlerParams, 0);}
+ public abstract XomwMediaTransformOutput doTransform(XomwFile image, byte[] dstPath, byte[] dstUrl, Xomw_params_handler handlerParams, int flags);
// /**
// * Get the thumbnail extension and MIME type for a given source MIME type
@@ -317,7 +317,7 @@ public abstract class Xomw_MediaHandler {
* @param File $file
* @return boolean
*/
- @gplx.Virtual public boolean canRender(Xomw_File file) {
+ @gplx.Virtual public boolean canRender(XomwFile file) {
return true;
}
@@ -328,7 +328,7 @@ public abstract class Xomw_MediaHandler {
* @param File $file
* @return boolean
*/
- public boolean mustRender(Xomw_File file) {
+ public boolean mustRender(XomwFile file) {
return false;
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_MediaHandlerFactory.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwMediaHandlerFactory.java
similarity index 88%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_MediaHandlerFactory.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwMediaHandlerFactory.java
index acf7537cd..cce78510c 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_MediaHandlerFactory.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwMediaHandlerFactory.java
@@ -18,14 +18,14 @@ along with this program. If not, see .
package gplx.xowa.mediawiki.includes.media; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*;
// XO.MW:MW has registry and instance cache; XO only has instance
// XO.MW:SYNC:1.29; DATE:2017-02-05
-public class Xomw_MediaHandlerFactory {
+public class XomwMediaHandlerFactory {
private final Hash_adp_bry handlers = Hash_adp_bry.cs();
// XO.MW:SYNC:1.29; DATE:2017-02-05
- public Xomw_MediaHandlerFactory() {
+ public XomwMediaHandlerFactory() {
// Default, MediaWiki core media handlers
// 'image/jpeg' => JpegHandler::class,
- handlers.Add(Mime__image__png, new Xomw_TransformationalImageHandler(Mime__image__png)); // PngHandler
+ handlers.Add(Mime__image__png, new XomwTransformationalImageHandler(Mime__image__png)); // PngHandler
// 'image/gif' => GIFHandler::class,
// 'image/tiff' => TiffHandler::class,
// 'image/webp' => WebPHandler::class,
@@ -41,8 +41,8 @@ public class Xomw_MediaHandlerFactory {
}
// XO.MW:SYNC:1.29; DATE:2017-02-05
- public Xomw_MediaHandler getHandler(byte[] type) {
- return (Xomw_MediaHandler)handlers.Get_by(type);
+ public XomwMediaHandler getHandler(byte[] type) {
+ return (XomwMediaHandler)handlers.Get_by(type);
}
public static byte[]
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_MediaTransformOutput.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwMediaTransformOutput.java
similarity index 93%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_MediaTransformOutput.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwMediaTransformOutput.java
index 870850895..8e8519825 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_MediaTransformOutput.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwMediaTransformOutput.java
@@ -20,8 +20,8 @@ import gplx.langs.htmls.*;
import gplx.xowa.mediawiki.includes.utls.*;
import gplx.xowa.mediawiki.includes.parsers.lnkis.*;
import gplx.xowa.mediawiki.includes.filerepo.file.*;
-public abstract class Xomw_MediaTransformOutput {
- public Xomw_MediaTransformOutput(Xomw_File file, byte[] url, byte[] path, int width, int height) {
+public abstract class XomwMediaTransformOutput {
+ public XomwMediaTransformOutput(XomwFile file, byte[] url, byte[] path, int width, int height) {
this.file = file;
this.url = url;
this.width = width;
@@ -33,7 +33,7 @@ public abstract class Xomw_MediaTransformOutput {
// public $responsiveUrls = [];
/** @var File */
- private final Xomw_File file;
+ private final XomwFile file;
/** @var int Image width */
protected final int width;
@@ -242,6 +242,7 @@ public abstract class Xomw_MediaTransformOutput {
* @return array
*/
public void getDescLinkAttribs(List_adp attribs, byte[] title, List_adp prms) {
+ byte[] query = Bry_.Empty;
// if ( is_array( prms ) ) {
// $query = prms;
// } else {
@@ -260,7 +261,7 @@ public abstract class Xomw_MediaTransformOutput {
attribs.Clear();
// 'href' => $this->file->getTitle()->getLocalURL( $query ),
- attribs.Add_many(Gfh_atr_.Bry__href, this.file.getTitle());
+ attribs.Add_many(Gfh_atr_.Bry__href, this.file.getTitle().getLocalURL(query));
attribs.Add_many(Gfh_atr_.Bry__class, Bry__class__image);
if (title != null) {
attribs.Add_many(Gfh_atr_.Bry__title, title);
@@ -271,7 +272,7 @@ public abstract class Xomw_MediaTransformOutput {
// XO.MW:SYNC:1.29; DATE:2017-02-03
protected void Link_wrap(Bry_bfr bfr, List_adp link_attribs, byte[] contents) {
if (link_attribs != null) {
- Xomw_xml.Tags(bfr, Gfh_tag_.Bry__a, link_attribs, contents);
+ XomwXml.Tags(bfr, Gfh_tag_.Bry__a, link_attribs, contents);
}
else {
bfr.Add(contents);
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_ThumbnailImage.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwThumbnailImage.java
similarity index 92%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_ThumbnailImage.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwThumbnailImage.java
index 02938e6ec..684a5f1ef 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_ThumbnailImage.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwThumbnailImage.java
@@ -21,8 +21,8 @@ import gplx.xowa.mediawiki.includes.utls.*;
import gplx.xowa.mediawiki.includes.parsers.lnkis.*;
import gplx.xowa.mediawiki.includes.filerepo.file.*;
// Media transform output for images
-public class Xomw_ThumbnailImage extends Xomw_MediaTransformOutput { private final List_adp attribs = List_adp_.New(), link_attribs = List_adp_.New();
- public Xomw_ThumbnailImage(Xomw_File file, byte[] url, byte[] path, int w, int h) {super(file, url, path, w, h);
+public class XomwThumbnailImage extends XomwMediaTransformOutput { private final List_adp attribs = List_adp_.New(), link_attribs = List_adp_.New();
+ public XomwThumbnailImage(XomwFile file, byte[] url, byte[] path, int w, int h) {super(file, url, path, w, h);
}
/**
* Get a thumbnail Object from a file and parameters.
@@ -36,7 +36,7 @@ public class Xomw_ThumbnailImage extends Xomw_MediaTransformOutput { private fin
* @param String|boolean path Filesystem path to the thumb
* @param array parameters Associative array of parameters
*/
- public Xomw_ThumbnailImage(Xomw_File file, byte[] url, byte[] path, Xomw_params_handler parameters) {super(file, url, path, parameters.width, parameters.height);
+ public XomwThumbnailImage(XomwFile file, byte[] url, byte[] path, Xomw_params_handler parameters) {super(file, url, path, parameters.width, parameters.height);
// defaults = [
// 'page' => false,
// 'lang' => false
@@ -207,7 +207,7 @@ public class Xomw_ThumbnailImage extends Xomw_MediaTransformOutput { private fin
// }
// XO.MW.HOOK:ThumbnailBeforeProduceHTML
- Xomw_xml.Element(tmp, Gfh_tag_.Bry__img, attribs, Bry_.Empty, Bool_.Y);
+ XomwXml.Element(tmp, Gfh_tag_.Bry__img, attribs, Bry_.Empty, Bool_.Y);
Link_wrap(bfr, link_attribs_is_null ? null : link_attribs, tmp.To_bry_and_clear());
}
private static final byte[] Bry__vertical_align = Bry_.new_a7("vertical-align: ");
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_TransformationalImageHandler.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwTransformationalImageHandler.java
similarity index 94%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_TransformationalImageHandler.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwTransformationalImageHandler.java
index eeb13aaef..1bec13666 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/Xomw_TransformationalImageHandler.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/media/XomwTransformationalImageHandler.java
@@ -18,7 +18,7 @@ along with this program. If not, see .
package gplx.xowa.mediawiki.includes.media; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*;
import gplx.xowa.mediawiki.includes.filerepo.file.*;
import gplx.xowa.mediawiki.includes.parsers.lnkis.*;
-public class Xomw_TransformationalImageHandler extends Xomw_ImageHandler { public Xomw_TransformationalImageHandler(byte[] key) {super(key);
+public class XomwTransformationalImageHandler extends XomwImageHandler { public XomwTransformationalImageHandler(byte[] key) {super(key);
}
/**
@@ -28,7 +28,7 @@ public class Xomw_TransformationalImageHandler extends Xomw_ImageHandler { publi
* 'physicalWidth' and 'physicalHeight' indicate the thumbnail dimensions.
* @return boolean
*/
- @Override public boolean normaliseParams(Xomw_File image, Xomw_params_handler prms) {
+ @Override public boolean normaliseParams(XomwFile image, Xomw_params_handler prms) {
if (!super.normaliseParams(image, prms)) {
return false;
}
@@ -90,7 +90,7 @@ public class Xomw_TransformationalImageHandler extends Xomw_ImageHandler { publi
* @param int flags
* @return MediaTransformError|ThumbnailImage|TransformParameterError
*/
- @Override public Xomw_MediaTransformOutput doTransform(Xomw_File image, byte[] dstPath, byte[] dstUrl, Xomw_params_handler prms, int flags) {
+ @Override public XomwMediaTransformOutput doTransform(XomwFile image, byte[] dstPath, byte[] dstUrl, Xomw_params_handler prms, int flags) {
// if (!this.normaliseParams(image, paramsVar)) {
// return new TransformParameterError(paramsVar);
// }
@@ -172,8 +172,8 @@ public class Xomw_TransformationalImageHandler extends Xomw_ImageHandler { publi
// if (isset(paramsVar['page']) && paramsVar['page']) {
// newParams['page'] = paramsVar['page'];
// }
-// return new Xomw_ThumbnailImage(image, dstUrl, null, newParams);
- return new Xomw_ThumbnailImage(image, dstUrl, null, prms);
+// return new XomwThumbnailImage(image, dstUrl, null, newParams);
+ return new XomwThumbnailImage(image, dstUrl, null, prms);
// }
//
// // Try to make a target path for the thumbnail
@@ -318,12 +318,12 @@ public class Xomw_TransformationalImageHandler extends Xomw_ImageHandler { publi
*
* @todo FIXME: No rotation support
*/
- private Xomw_ThumbnailImage getClientScalingThumbnailImage(Xomw_File image, Xomw_params_scalar scalerParams) {
+ private XomwThumbnailImage getClientScalingThumbnailImage(XomwFile image, Xomw_params_scalar scalerParams) {
Xomw_params_handler prms = new Xomw_params_handler();
prms.width = scalerParams.clientWidth;
prms.height = scalerParams.clientHeight;
- return new Xomw_ThumbnailImage(image, image.getUrl(), null, prms);
+ return new XomwThumbnailImage(image, image.getUrl(), null, prms);
}
// /**
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_link_holders.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_link_holders.java
index 95372422f..dfe19a47b 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_link_holders.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_link_holders.java
@@ -36,7 +36,7 @@ public class Xomw_link_holders {
link_id = 0;
}
- public void Make_holder(Bry_bfr bfr, Xomw_Title nt, byte[] text, byte[][] query, byte[] trail, byte[] prefix) {
+ public void Make_holder(Bry_bfr bfr, XomwTitle nt, byte[] text, byte[][] query, byte[] trail, byte[] prefix) {
if (nt == null) {
// Fail gracefully
bfr.Add_str_a7("").Add(prefix).Add(text).Add(trail);
@@ -62,7 +62,7 @@ public class Xomw_link_holders {
}
}
}
- public void Test__add(Xomw_Title ttl, byte[] capt) {
+ public void Test__add(XomwTitle ttl, byte[] capt) {
int key = link_id++;
Xomw_link_holder_item item = new Xomw_link_holder_item(ttl, capt, Bry_.Ary_empty);
internals.Add(key, item);
@@ -239,12 +239,12 @@ class Xomw_link_holder_list {
public Xomw_link_holder_item Get_by(int key) {return ary[key];}
}
class Xomw_link_holder_item {
- public Xomw_link_holder_item(Xomw_Title title, byte[] text, byte[][] query) {
+ public Xomw_link_holder_item(XomwTitle title, byte[] text, byte[][] query) {
this.title = title;
this.text = text;
this.query = query;
}
- public Xomw_Title Title() {return title;} private final Xomw_Title title;
+ public XomwTitle Title() {return title;} private final XomwTitle title;
public byte[] Text() {return text;} private final byte[] text;
public byte[] Pdbk() {return title.getPrefixedDBkey();}
public byte[][] Query() {return query;} private final byte[][] query;
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_link_holders__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_link_holders__tst.java
index 93c407de8..1a3c1a174 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_link_holders__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_link_holders__tst.java
@@ -26,13 +26,13 @@ public class Xomw_link_holders__tst {
}
}
class Xomw_link_holders__fxt {
- private final Xomw_link_holders holders = new Xomw_link_holders(new Xomw_link_renderer(new Xomw_sanitizer()), Bry_bfr_.New());
+ private final Xomw_link_holders holders = new Xomw_link_holders(new Xomw_link_renderer(new XomwSanitizer()), Bry_bfr_.New());
private final Xomw_parser_bfr pbfr = new Xomw_parser_bfr();
private boolean apos = true;
public Xomw_link_holders__fxt() {
}
public void Init__add(String ttl, String capt) {
- holders.Test__add(Xomw_Title.newFromText(Bry_.new_u8(ttl)), Bry_.new_u8(capt));
+ holders.Test__add(XomwTitle.newFromText(Bry_.new_u8(ttl)), Bry_.new_u8(capt));
}
public void Test__replace(String src, String expd) {
if (apos) expd = gplx.langs.htmls.Gfh_utl.Replace_apos(expd);
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser.java
index 9ce5f8bc2..6a0b49c2e 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser.java
@@ -46,8 +46,8 @@ public class Xomw_parser {
public Xomw_parser_env Env() {return env;} private final Xomw_parser_env env = new Xomw_parser_env();
public Xomw_parser_options Options() {return options;} private final Xomw_parser_options options = new Xomw_parser_options();
public Xomw_strip_state Strip_state() {return strip_state;} private final Xomw_strip_state strip_state = new Xomw_strip_state();
- public Xomw_sanitizer Sanitizer() {return sanitizer;} private final Xomw_sanitizer sanitizer = new Xomw_sanitizer();
- public Xomw_linker Linker() {return linker;} private final Xomw_linker linker;
+ public XomwSanitizer Sanitizer() {return sanitizer;} private final XomwSanitizer sanitizer = new XomwSanitizer();
+ public XomwLinker Linker() {return linker;} private final XomwLinker linker;
public Bry_bfr Tmp() {return tmp;} private final Bry_bfr tmp = Bry_bfr_.New();
public Xomw_quote_wkr Quote_wkr() {return quote_wkr;} private final Xomw_quote_wkr quote_wkr;
public Xomw_lnki_wkr Lnki_wkr() {return lnki_wkr;} private final Xomw_lnki_wkr lnki_wkr;
@@ -64,7 +64,7 @@ public class Xomw_parser {
}
this.link_renderer = new Xomw_link_renderer(sanitizer);
- this.linker = new Xomw_linker(link_renderer);
+ this.linker = new XomwLinker(link_renderer);
this.protocols_trie = Xomw_parser.Protocols__dflt();
this.holders = new Xomw_link_holders(link_renderer, tmp);
this.table_wkr = new Xomw_table_wkr(this);
@@ -81,7 +81,7 @@ public class Xomw_parser {
doubleunder_wkr.Init_by_wiki(doubleunder_data, wiki.Lang());
magiclinks_wkr.Init_by_wiki();
}
- public void Init_by_page(Xomw_Title ttl) {
+ public void Init_by_page(XomwTitle ttl) {
pctx.Init_by_page(ttl);
}
public void Internal_parse(Xomw_parser_bfr pbfr, byte[] text) {
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser__tst.java
index a959cda13..e4bc164ad 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser__tst.java
@@ -66,7 +66,7 @@ class Xomw_parser__fxt {
Xoae_app app = Xoa_app_fxt.Make__app__edit();
Xowe_wiki wiki = Xoa_app_fxt.Make__wiki__edit(app);
mgr.Init_by_wiki(wiki);
- mgr.Init_by_page(Xomw_Title.newFromText(Bry_.new_a7("Page_1")));
+ mgr.Init_by_page(XomwTitle.newFromText(Bry_.new_a7("Page_1")));
}
public void Test__parse(String src_str, String expd) {
byte[] src_bry = Bry_.new_u8(src_str);
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser_ctx.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser_ctx.java
index d9a442330..dc69d6c0c 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser_ctx.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser_ctx.java
@@ -18,13 +18,13 @@ along with this program. If not, see .
package gplx.xowa.mediawiki.includes.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*;
import gplx.xowa.mediawiki.includes.parsers.lnkis.*;
public class Xomw_parser_ctx {
- public Xomw_Title Page_title() {return page_title;} private Xomw_Title page_title;
+ public XomwTitle Page_title() {return page_title;} private XomwTitle page_title;
public Xomw_image_params Lnki_wkr__make_image__img_params = new Xomw_image_params();
public byte[][] Lnki_wkr__make_image__match_magic_word = new byte[2][];
public int[] Lnki_wkr__make_image__img_size = new int[2];
public Xomw_params_mto Linker__makeImageLink__prms = new Xomw_params_mto();
- public void Init_by_page(Xomw_Title page_title) {
+ public void Init_by_page(XomwTitle page_title) {
this.page_title = page_title;
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser_env.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser_env.java
index 3c6ca2db3..97bf1aa4d 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser_env.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/Xomw_parser_env.java
@@ -25,10 +25,10 @@ public class Xomw_parser_env {
public double Global__wgThumbUpright = .75d;
public int[] Global__wgThumbLimits = new int[] {120, 150, 180, 200, 250, 300};
- public Xomw_MagicWordMgr Magic_word_mgr() {return magic_word_mgr;} private final Xomw_MagicWordMgr magic_word_mgr = new Xomw_MagicWordMgr();
- public Xomw_message_mgr Message_mgr() {return message_mgr;} private final Xomw_message_mgr message_mgr = new Xomw_message_mgr();
- public Xomw_file_finder File_finder() {return file_finder;} private Xomw_file_finder file_finder = new Xomw_file_finder__noop();
- public Xomw_MediaHandlerFactory MediaHandlerFactory() {return mediaHandlerFactory;} private final Xomw_MediaHandlerFactory mediaHandlerFactory = new Xomw_MediaHandlerFactory();
+ public XomwMagicWordMgr Magic_word_mgr() {return magic_word_mgr;} private final XomwMagicWordMgr magic_word_mgr = new XomwMagicWordMgr();
+ public XomwMessageMgr Message_mgr() {return message_mgr;} private final XomwMessageMgr message_mgr = new XomwMessageMgr();
+ public XomwFileFinder File_finder() {return file_finder;} private XomwFileFinder file_finder = new XomwFileFinderNoop();
+ public XomwMediaHandlerFactory MediaHandlerFactory() {return mediaHandlerFactory;} private final XomwMediaHandlerFactory mediaHandlerFactory = new XomwMediaHandlerFactory();
- public Xomw_parser_env File_finder_(Xomw_file_finder v) {file_finder = v; return this;}
+ public Xomw_parser_env File_finder_(XomwFileFinder v) {file_finder = v; return this;}
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkes/Xomw_lnke_wkr.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkes/Xomw_lnke_wkr.java
index 5d1011f84..a51297c14 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkes/Xomw_lnke_wkr.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkes/Xomw_lnke_wkr.java
@@ -28,8 +28,8 @@ public class Xomw_lnke_wkr {// THREAD.UNSAFE: caching for repeated calls
private Btrie_slim_mgr protocol_trie; private final Btrie_rv trv = new Btrie_rv();
private int autonumber;
private final Xomw_parser parser;
- private final Xomw_linker linker;
- private final Xomw_sanitizer sanitizer;
+ private final XomwLinker linker;
+ private final XomwSanitizer sanitizer;
private final Xomw_atr_mgr attribs = new Xomw_atr_mgr();
private Xomw_regex_url regex_url;
private Xomw_regex_space regex_space;
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_image_params.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_image_params.java
index 8a12a66a6..a3bd6ff78 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_image_params.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_image_params.java
@@ -18,5 +18,5 @@ along with this program. If not, see .
package gplx.xowa.mediawiki.includes.parsers.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*; import gplx.xowa.mediawiki.includes.parsers.*;
public class Xomw_image_params {
public Xomw_param_map paramMap = null;
- public Xomw_MagicWordArray mwArray = null;
+ public XomwMagicWordArray mwArray = null;
}
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_lnki_wkr.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_lnki_wkr.java
index 343f8195b..7523df281 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_lnki_wkr.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_lnki_wkr.java
@@ -38,15 +38,15 @@ import gplx.xowa.parsers.uniqs.*;
*/
public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
private final Xomw_link_holders holders;
- private final Xomw_linker linker;
+ private final XomwLinker linker;
private final Xomw_link_renderer link_renderer;
// private final Btrie_slim_mgr protocols_trie;
private final Xomw_quote_wkr quote_wkr;
private final Xomw_strip_state strip_state;
private Xomw_parser_env env;
private Xow_wiki wiki;
- private Xomw_Title mPageTitle;
-// private final Xomw_linker__normalize_subpage_link normalize_subpage_link = new Xomw_linker__normalize_subpage_link();
+ private XomwTitle mPageTitle;
+// private final XomwLinker_NormalizeSubpageLink normalize_subpage_link = new XomwLinker_NormalizeSubpageLink();
private final Bry_bfr tmp;
private final Xomw_parser parser;
private final Xomw_atr_mgr extra_atrs = new Xomw_atr_mgr();
@@ -254,7 +254,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
link = Bry_.Mid(link, 1);
}
// $nt = is_string( $unstrip ) ? Title::newFromText( $unstrip ) : null;
- Xomw_Title nt = Xomw_Title.newFromText(link);
+ XomwTitle nt = XomwTitle.newFromText(link);
// Make subpage if necessary
// boolean useSubpages = nt.Ns().Subpages_enabled();
@@ -262,7 +262,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
// Maybe_do_subpage_link(normalize_subpage_link, orig_link, text);
// link = normalize_subpage_link.link;
// text = normalize_subpage_link.text;
-// nt = Xomw_Title.newFromText(link);
+// nt = XomwTitle.newFromText(link);
// }
// IGNORE: handled in rewrite above
// else {
@@ -271,7 +271,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
byte[] unstrip = strip_state.Unstrip_nowiki(link);
if (!Bry_.Eq(unstrip, link))
- nt = Xomw_Title.newFromText(unstrip);
+ nt = XomwTitle.newFromText(unstrip);
if (nt == null) {
bfr.Add_mid(src, prv, lnki_bgn + 2); // $s .= $prefix . '[[' . $line;
prv = cur = lnki_bgn + 2;
@@ -282,7 +282,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
int ns = nt.getNamespace();
if (might_be_img) { // if this is actually an invalid link
- if (ns == Xomw_Defines.NS_FILE && no_force) { // but might be an image
+ if (ns == XomwDefines.NS_FILE && no_force) { // but might be an image
boolean found = false;
// while (true) {
// // look at the next 'line' to see if we can close it there
@@ -357,7 +357,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
// continue;
// }
//
- if (ns == Xomw_Defines.NS_FILE) {
+ if (ns == XomwDefines.NS_FILE) {
// boolean is_good_image = !wfIsBadImage(nt->getDBkey(), this->mTitle)
boolean is_good_image = true;
if (is_good_image) {
@@ -383,7 +383,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
continue;
}
}
- else if (ns == Xomw_Defines.NS_CATEGORY) {
+ else if (ns == XomwDefines.NS_CATEGORY) {
bfr.Trim_end_ws(); // s = rtrim(s . "\n"); // T2087
if (was_blank) {
@@ -407,7 +407,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
// Self-link checking. For some languages, variants of the title are checked in
// LinkHolderArray::doVariants() to allow batching the existence checks necessary
// for linking to a different variant.
- if (ns != Xomw_Defines.NS_SPECIAL && nt.equals(mPageTitle) && !nt.hasFragment()) {
+ if (ns != XomwDefines.NS_SPECIAL && nt.equals(mPageTitle) && !nt.hasFragment()) {
bfr.Add(prefix);
linker.makeSelfLinkObj(bfr, nt, text, Bry_.Empty, trail, Bry_.Empty);
continue;
@@ -415,7 +415,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
// NS_MEDIA is a pseudo-namespace for linking directly to a file
// @todo FIXME: Should do batch file existence checks, see comment below
- if (ns == Xomw_Defines.NS_MEDIA) {
+ if (ns == XomwDefines.NS_MEDIA) {
// Give extensions a chance to select the file revision for us
// options = [];
// desc_query = false;
@@ -444,7 +444,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
}
}
}
- public void makeImage(Xomw_parser_ctx pctx, Bry_bfr bfr, Xomw_Title title, byte[] options_at_link, Xomw_link_holders holders) {
+ public void makeImage(Xomw_parser_ctx pctx, Bry_bfr bfr, XomwTitle title, byte[] options_at_link, Xomw_link_holders holders) {
// Check if the options text is of the form "options|alt text"
// Options are:
// * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang
@@ -481,15 +481,15 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
// Fetch and register the file (file title may be different via hooks)
// list($file, $title) = $this->fetchFileAndTitle($title, $options);
- Xomw_File file = fetchFileAndTitle(title, null);
+ XomwFile file = fetchFileAndTitle(title, null);
// Get parameter map
- Xomw_MediaHandler handler = file == null ? null : file.getHandler();
+ XomwMediaHandler handler = file == null ? null : file.getHandler();
Xomw_image_params tmp_img_params = pctx.Lnki_wkr__make_image__img_params;
this.getImageParams(tmp_img_params, handler);
Xomw_param_map paramMap = tmp_img_params.paramMap;
- Xomw_MagicWordArray mwArray = tmp_img_params.mwArray;
+ XomwMagicWordArray mwArray = tmp_img_params.mwArray;
// XO.MW.UNSUPPORTED.TrackingCategory: if (!$file) $this->addTrackingCategory('broken-file-category');
@@ -697,7 +697,7 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
private static Xomw_param_list[] internalParamNames;
private static Xomw_param_map internalParamMap;
- private void getImageParams(Xomw_image_params rv, Xomw_MediaHandler handler) {
+ private void getImageParams(Xomw_image_params rv, XomwMediaHandler handler) {
byte[] handlerClass = handler == null ? Bry_.Empty : handler.Key();
rv.paramMap = (Xomw_param_map)mImageParams.Get_by(handlerClass);
// NOTE: lazy-init; code below can be inefficent
@@ -732,12 +732,12 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
}
this.mImageParams.Add(handlerClass, paramMap);
rv.paramMap = paramMap;
- Xomw_MagicWordArray mw_array = new Xomw_MagicWordArray(env.Magic_word_mgr(), paramMap.Keys());
+ XomwMagicWordArray mw_array = new XomwMagicWordArray(env.Magic_word_mgr(), paramMap.Keys());
this.mImageParamsMagicArray.Add(handlerClass, mw_array);
rv.mwArray = mw_array;
}
else {
- rv.mwArray = (Xomw_MagicWordArray)mImageParamsMagicArray.Get_by(handlerClass);
+ rv.mwArray = (XomwMagicWordArray)mImageParamsMagicArray.Get_by(handlerClass);
}
}
// Parsed a width param of imagelink like 300px or 200x300px
@@ -777,8 +777,8 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
* @param array $options Array of options to RepoGroup::findFile
* @return array ( File or false, Title of file )
*/
- public Xomw_File fetchFileAndTitle(Xomw_Title title, Hash_adp options) {
- Xomw_File file = fetchFileNoRegister(title, options);
+ public XomwFile fetchFileAndTitle(XomwTitle title, Hash_adp options) {
+ XomwFile file = fetchFileNoRegister(title, options);
//$time = $file ? $file->getTimestamp() : false;
//$sha1 = $file ? $file->getSha1() : false;
@@ -801,8 +801,8 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
* @param array $options Array of options to RepoGroup::findFile
* @return File|boolean
*/
- private Xomw_File fetchFileNoRegister(Xomw_Title title, Hash_adp options) {
- Xomw_File file = null;
+ private XomwFile fetchFileNoRegister(XomwTitle title, Hash_adp options) {
+ XomwFile file = null;
// if ( isset( $options['broken'] ) ) {
// file = false; // broken thumbnail forced by hook
// } elseif ( isset( $options['sha1'] ) ) { // get by (sha1,timestamp)
@@ -812,13 +812,13 @@ public class Xomw_lnki_wkr {// THREAD.UNSAFE: caching for repeated calls
// }
return file;
}
- public void Maybe_do_subpage_link(Xomw_linker__normalize_subpage_link rv, byte[] target, byte[] text) {
+ public void Maybe_do_subpage_link(XomwLinker_NormalizeSubpageLink rv, byte[] target, byte[] text) {
linker.normalizeSubpageLink(rv, mPageTitle, target, text);
}
public void Replace_link_holders(Xomw_parser_ctx pctx, Xomw_parser_bfr pbfr) {
holders.Replace(pctx, pbfr);
}
- public void Make_known_link_holder(Bry_bfr bfr, Xomw_Title nt, byte[] text, byte[] trail, byte[] prefix) {
+ public void Make_known_link_holder(Bry_bfr bfr, XomwTitle nt, byte[] text, byte[] trail, byte[] prefix) {
byte[][] split_trail = linker.splitTrail(trail);
byte[] inside = split_trail[0];
trail = split_trail[1];
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_lnki_wkr__file__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_lnki_wkr__file__tst.java
index 56758034b..20946b41c 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_lnki_wkr__file__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/lnkis/Xomw_lnki_wkr__file__tst.java
@@ -26,13 +26,13 @@ public class Xomw_lnki_wkr__file__tst {
fxt.Init__file("A.png", 300, 200);
}
@Test public void Plain() {
- fxt.Test__to_html("[[File:A.png]]", "
");
+ fxt.Test__to_html("[[File:A.png]]", "
");
}
@Test public void Thumb() {
- fxt.Test__to_html("[[File:A.png|thumb]]", "
");
+ fxt.Test__to_html("[[File:A.png|thumb]]", "");
}
@Test public void Size() {
- fxt.Test__to_html("[[File:A.png|123x456px]]", "
");
+ fxt.Test__to_html("[[File:A.png|123x456px]]", "
");
}
@Test public void fitBoxWidth() {
// COMMENT:"Height is the relative smaller dimension, so scale width accordingly"
@@ -68,8 +68,8 @@ class Xomw_lnki_wkr__fxt {
private final Xomw_lnki_wkr wkr;
private final Xomw_parser_ctx pctx;
private final Xomw_parser_bfr pbfr = new Xomw_parser_bfr();
- private final Xomw_file_finder__mock file_finder;
- private final Xomw_FileRepo repo = new Xomw_FileRepo(Bry_.new_a7("/orig"), Bry_.new_a7("/thumb"));
+ private final XomwFileFinderMock file_finder;
+ private final XomwFileRepo repo = new XomwFileRepo(Bry_.new_a7("/orig"), Bry_.new_a7("/thumb"));
private boolean apos = true;
public Xomw_lnki_wkr__fxt() {
Xoae_app app = Xoa_app_fxt.Make__app__edit();
@@ -78,7 +78,7 @@ class Xomw_lnki_wkr__fxt {
wkr = parser.Lnki_wkr();
// env
- file_finder = new Xomw_file_finder__mock(parser.Env());
+ file_finder = new XomwFileFinderMock(parser.Env());
parser.Env().File_finder_(file_finder);
parser.Env().Magic_word_mgr().Add(Bry_.new_u8("img_thumbnail"), Bool_.Y, Bry_.Ary("thumb"));
parser.Env().Magic_word_mgr().Add(Bry_.new_u8("img_width"), Bool_.Y, Bry_.Ary("$1px"));
@@ -86,13 +86,13 @@ class Xomw_lnki_wkr__fxt {
// ctx
pctx = new Xomw_parser_ctx();
- pctx.Init_by_page(Xomw_Title.newFromText(Bry_.new_a7("Page_1")));
+ pctx.Init_by_page(XomwTitle.newFromText(Bry_.new_a7("Page_1")));
}
public void Clear() {
wkr.Clear_state();
}
public void Init__file(String title, int w, int h) {
- file_finder.Add(title, repo, w, h, Xomw_MediaHandlerFactory.Mime__image__png);
+ file_finder.Add(title, repo, w, h, XomwMediaHandlerFactory.Mime__image__png);
}
public void Test__parse(String src_str, String expd) {
byte[] src_bry = Bry_.new_u8(src_str);
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/magiclinks/Xomw_magiclinks_wkr.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/magiclinks/Xomw_magiclinks_wkr.java
index 8f57106cc..1ce7dd6e2 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/magiclinks/Xomw_magiclinks_wkr.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/magiclinks/Xomw_magiclinks_wkr.java
@@ -29,13 +29,13 @@ public class Xomw_magiclinks_wkr {
private final Xomw_parser parser;
private final Xomw_regex_boundary regex_boundary;
private final Xomw_regex_url regex_url;
- private final Xomw_sanitizer sanitizer;
- private final Xomw_linker linker;
+ private final XomwSanitizer sanitizer;
+ private final XomwLinker linker;
private final Xomw_atr_mgr atrs = new Xomw_atr_mgr();
private byte[] page_title;
private static final byte Regex__anch = 1, Regex__elem = 2, Regex__free = 3;
- public Xomw_magiclinks_wkr(Xomw_parser parser, Xomw_sanitizer sanitizer, Xomw_linker linker, Xomw_regex_boundary regex_boundary, Xomw_regex_url regex_url) {
+ public Xomw_magiclinks_wkr(Xomw_parser parser, XomwSanitizer sanitizer, XomwLinker linker, Xomw_regex_boundary regex_boundary, Xomw_regex_url regex_url) {
this.parser = parser;
this.sanitizer = sanitizer;
this.linker = linker;
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/magiclinks/Xomw_magiclinks_wkr__tst.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/magiclinks/Xomw_magiclinks_wkr__tst.java
index f574f5e37..2f0029587 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/magiclinks/Xomw_magiclinks_wkr__tst.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/magiclinks/Xomw_magiclinks_wkr__tst.java
@@ -72,7 +72,7 @@ class Xomw_magiclinks_wkr__fxt {
private final Xomw_parser_bfr pbfr = new Xomw_parser_bfr();
public Xomw_magiclinks_wkr__fxt() {
Xomw_regex_space regex_space = new Xomw_regex_space();
- pctx.Init_by_page(Xomw_Title.newFromText(Bry_.new_a7("Page_1")));
+ pctx.Init_by_page(XomwTitle.newFromText(Bry_.new_a7("Page_1")));
Xomw_parser parser = new Xomw_parser();
this.wkr = new Xomw_magiclinks_wkr(parser, parser.Sanitizer(), parser.Linker(), new Xomw_regex_boundary(regex_space), new Xomw_regex_url(regex_space));
wkr.Init_by_wiki();
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/tables/Xomw_table_wkr.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/tables/Xomw_table_wkr.java
index 8373b4a59..bb75b80bf 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/tables/Xomw_table_wkr.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/parsers/tables/Xomw_table_wkr.java
@@ -22,7 +22,7 @@ import gplx.xowa.mediawiki.includes.libs.*; import gplx.xowa.parsers.uniqs.*;
public class Xomw_table_wkr implements gplx.core.brys.Bry_split_wkr {// THREAD.UNSAFE: caching for repeated calls
private final Bry_bfr tmp;
private Bry_bfr bfr;
- private final Xomw_sanitizer sanitizer; private final Xomw_strip_state strip_state;
+ private final XomwSanitizer sanitizer; private final Xomw_strip_state strip_state;
private final List_adp
td_history = List_adp_.New() // Is currently a td tag open?
, last_tag_history = List_adp_.New() // Save history of last lag activated (td, th or caption)
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/Xomw_MediaWikiTitleCodec.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/XomwMediaWikiTitleCodec.java
similarity index 95%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/Xomw_MediaWikiTitleCodec.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/XomwMediaWikiTitleCodec.java
index cbaad1e8c..664c8dbc2 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/Xomw_MediaWikiTitleCodec.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/XomwMediaWikiTitleCodec.java
@@ -17,7 +17,7 @@ along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes.title; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*;
import gplx.xowa.mediawiki.includes.utls.*;
-public class Xomw_MediaWikiTitleCodec {
+public class XomwMediaWikiTitleCodec {
// /**
// * @var Language
// */
@@ -231,11 +231,11 @@ public class Xomw_MediaWikiTitleCodec {
* @return array A map with the fields 'interwiki', 'fragment', 'namespace',
* 'user_case_dbkey', and 'dbkey'.
*/
- public Xomw_MediaWikiTitleCodec_Parts splitTitleString(byte[] text, int defaultNamespace) {
+ public XomwMediaWikiTitleCodecParts splitTitleString(byte[] text, int defaultNamespace) {
byte[] dbkey = Php_str_.str_replace(Byte_ascii.Space, Byte_ascii.Underline, text);
// Initialisation
- Xomw_MediaWikiTitleCodec_Parts parts = new Xomw_MediaWikiTitleCodec_Parts(dbkey, defaultNamespace);
+ XomwMediaWikiTitleCodecParts parts = new XomwMediaWikiTitleCodecParts(dbkey, defaultNamespace);
// Strip Unicode bidi override characters.
// Sometimes they slip into cut-n-pasted page titles, where the
@@ -274,7 +274,7 @@ public class Xomw_MediaWikiTitleCodec {
// Namespace or interwiki prefix
if (Bry_.Has_at_bgn(dbkey, Bry_.new_a7("File:"))) {
- parts.ns = Xomw_Defines.NS_FILE;
+ parts.ns = XomwDefines.NS_FILE;
dbkey = Bry_.Mid(dbkey, 5);
}
// $prefixRegexp = "/^(.+?)_*:_*(.*)$/S";
diff --git a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/Xomw_MediaWikiTitleCodec_Parts.java b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/XomwMediaWikiTitleCodecParts.java
similarity index 89%
rename from gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/Xomw_MediaWikiTitleCodec_Parts.java
rename to gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/XomwMediaWikiTitleCodecParts.java
index f8e32feae..da0d71f61 100644
--- a/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/Xomw_MediaWikiTitleCodec_Parts.java
+++ b/gplx.xowa.mediawiki/src/gplx/xowa/mediawiki/includes/title/XomwMediaWikiTitleCodecParts.java
@@ -16,14 +16,14 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package gplx.xowa.mediawiki.includes.title; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.includes.*;
-public class Xomw_MediaWikiTitleCodec_Parts {
+public class XomwMediaWikiTitleCodecParts {
public byte[] interwiki;
public boolean local_interwiki;
public byte[] fragment = Bry_.Empty;
public int ns;
public byte[] dbkey;
public byte[] user_case_dbkey;
- public Xomw_MediaWikiTitleCodec_Parts(byte[] dbkey, int defaultNamespace) {
+ public XomwMediaWikiTitleCodecParts(byte[] dbkey, int defaultNamespace) {
this.interwiki = Bry_.Empty;
this.local_interwiki = false;
this.fragment = Bry_.Empty;