1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-01-25 20:56:50 -05:00
parent 1b0042ef8a
commit efaf9dcd00
447 changed files with 10258 additions and 3016 deletions

View File

@@ -27,7 +27,7 @@ public class Xoaf_download_mgr implements GfoInvkAble {
enabled = v;
File_download_enable(app, v);
return this;
} private boolean enabled;
} private boolean enabled = true; // default to true; DATE:2015-01-05
public Xof_download_wkr Download_wkr() {return download_wkr;} public Xoaf_download_mgr Download_wkr_(Xof_download_wkr v) {download_wkr = v; return this;} private Xof_download_wkr download_wkr;
public Xof_img_wkr_api_size_base Api_size_wkr() {return api_size_wkr;} public Xoaf_download_mgr Api_size_wkr_(Xof_img_wkr_api_size_base v) {api_size_wkr = v; return this;} private Xof_img_wkr_api_size_base api_size_wkr = new Xof_img_wkr_api_size_base_wmf();
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {

View File

@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa; import gplx.*;
import gplx.xowa.xtns.math.*;
import gplx.xowa.files.fsdb.caches.*;
import gplx.dbs.*; import gplx.xowa2.files.commons.*;
public class Xof_file_mgr implements GfoInvkAble {
public void Init_app(Xoa_app app, Gfo_usr_dlg usr_dlg) {
this.app = app;

View File

@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa; import gplx.*;
import gplx.core.btries.*;
public class Xof_repo_itm implements GfoInvkAble {
public Xof_repo_itm(Xoa_repo_mgr mgr, byte[] key) {this.mgr = mgr; this.key = key;} private Xoa_repo_mgr mgr;
public byte[] Key() {return key;} private byte[] key;
public Xof_repo_itm(Xoa_repo_mgr mgr, byte[] key) {this.mgr = mgr; this.key = key;} private final Xoa_repo_mgr mgr;
public byte[] Key() {return key;} private final byte[] key;
public boolean Wmf_fsys() {return wmf_fsys;} public Xof_repo_itm Wmf_fsys_(boolean v) {wmf_fsys = v; return this;} private boolean wmf_fsys;
public boolean Wmf_api() {return wmf_api;} public Xof_repo_itm Wmf_api_(boolean v) {wmf_api = v; return this;} private boolean wmf_api;
public boolean Tarball() {return tarball;} public Xof_repo_itm Tarball_(boolean v) {tarball = v; return this;} private boolean tarball;
@@ -87,16 +87,7 @@ public class Xof_repo_itm implements GfoInvkAble {
}
byte[] rv = tmp_bfr.Xto_bry_and_clear();
return rv;
} private Bry_bfr tmp_bfr = Bry_bfr.reset_(300); Btrie_slim_mgr trie = trie_make();
private static Btrie_slim_mgr trie_make() {
Btrie_slim_mgr rv = Btrie_slim_mgr.cs_();
byte[] invalid = Op_sys.Wnt.Fsys_invalid_chars();
byte[] underline = new byte[] {Byte_ascii.Underline};
int len = invalid.length;
for (int i = 0; i < len; i++)
rv.Add_obj(new byte[] {invalid[i]}, underline);
return rv;
}
} private final Bry_bfr tmp_bfr = Bry_bfr.reset_(300);
public byte[] Gen_name_trg(byte[] bry, byte[] md5, Xof_ext ext) {
byte[] rv = Gen_name_src(bry);
byte[] ext_bry = ext.Ext();
@@ -123,7 +114,17 @@ public class Xof_repo_itm implements GfoInvkAble {
} private static final String Invk_owner = "owner", Invk_fsys_ = "fsys_", Invk_ext_rules_ = "ext_rules_", Invk_primary_ = "primary_", Invk_wmf_api_ = "wmf_api_", Invk_tarball_ = "tarball_";
public Xof_repo_itm Ext_rules_(byte[] ext_rules_key) {ext_rules = mgr.App().File_mgr().Ext_rules().Get_or_new(ext_rules_key); return this;}
public static final int Thumb_default_null = -1;
public static final byte Mode_orig = 0, Mode_thumb = 1, Mode_nil = Byte_.MaxValue_127;
public static final byte Repo_remote = 0, Repo_local = 1, Repo_unknown = 126, Repo_null = Byte_.MaxValue_127;
public static final byte Mode_orig = 0, Mode_thumb = 1, Mode_nil = Byte_.Max_value_127;
public static final byte Repo_remote = 0, Repo_local = 1, Repo_unknown = 126, Repo_null = Byte_.Max_value_127;
public static final int Dir_depth_null = -1, Dir_depth_wmf = 2, Dir_depth_xowa = 4;
private static final Btrie_slim_mgr trie = trie_make();
private static Btrie_slim_mgr trie_make() {
Btrie_slim_mgr rv = Btrie_slim_mgr.cs_();
byte[] invalid = Op_sys.Wnt.Fsys_invalid_chars();
byte[] underline = new byte[] {Byte_ascii.Underline};
int len = invalid.length;
for (int i = 0; i < len; i++)
rv.Add_obj(new byte[] {invalid[i]}, underline);
return rv;
}
}

View File

@@ -50,7 +50,7 @@ class Xofo_lnki_parser_fxt {
}
class Xofo_lnki_chkr implements Tst_chkr {
public Class<?> TypeOf() {return Xofo_lnki.class;}
public Xofo_lnki_chkr Lnki_type_(byte v) {lnki_type = v; return this;} private byte lnki_type = Byte_.MaxValue_127;
public Xofo_lnki_chkr Lnki_type_(byte v) {lnki_type = v; return this;} private byte lnki_type = Byte_.Max_value_127;
public Xofo_lnki_chkr Lnki_w_(int v) {lnki_w = v; return this;} private int lnki_w = -1;
public Xofo_lnki_chkr Lnki_h_(int v) {lnki_h = v; return this;} private int lnki_h = -1;
public Xofo_lnki_chkr Lnki_upright_(double v) {lnki_upright = v; return this;} double lnki_upright = -1;
@@ -58,7 +58,7 @@ class Xofo_lnki_chkr implements Tst_chkr {
public int Chk(Tst_mgr mgr, String path, Object actl_obj) {
Xofo_lnki actl = (Xofo_lnki)actl_obj;
int rv = 0;
rv += mgr.Tst_val(lnki_type == Byte_.MaxValue_127, path, "lnki_type", lnki_type, actl.Lnki_type());
rv += mgr.Tst_val(lnki_type == Byte_.Max_value_127, path, "lnki_type", lnki_type, actl.Lnki_type());
rv += mgr.Tst_val(lnki_w == -1, path, "lnki_w", lnki_w, actl.Lnki_w());
rv += mgr.Tst_val(lnki_h == -1, path, "lnki_h", lnki_h, actl.Lnki_h());
rv += mgr.Tst_val(lnki_upright == -1, path, "lnki_upright", lnki_upright, actl.Lnki_upright());

View File

@@ -22,7 +22,7 @@ public class Xofw_file_finder_rslt {
public int Repo_idx() {return repo_idx;} private int repo_idx;
public byte[] Repo_wiki_key() {return repo_wiki_key;} private byte[] repo_wiki_key;
public void Init(byte[] ttl) {
this.ttl = ttl; redirect = Xop_redirect_mgr.Redirect_null_bry; repo_wiki_key = null; repo_idx = Byte_.MaxValue_127;
this.ttl = ttl; redirect = Xop_redirect_mgr.Redirect_null_bry; repo_wiki_key = null; repo_idx = Byte_.Max_value_127;
}
public void Done(int repo_idx, byte[] repo_wiki_key, byte[] redirect) {
this.repo_idx = repo_idx; this.repo_wiki_key = repo_wiki_key; this.redirect = redirect;