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

'v3.6.3.1'

This commit is contained in:
gnosygnu
2016-06-19 23:58:10 -04:00
parent 96636f3161
commit d4e8590345
1960 changed files with 20790 additions and 9272 deletions

View File

@@ -17,22 +17,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.fmtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import gplx.core.brys.fmtrs.*;
public class Xoa_fmtr_itm implements GfoInvkAble {
public class Xoa_fmtr_itm implements Gfo_invk {
public Xoa_fmtr_itm(Xoae_app app) {this.app = app;} private Xoae_app app;
public String Src() {return src;} public Xoa_fmtr_itm Src_(String v) {this.src = v; return this;} private String src;
public byte[] Fmt() {return fmt;} public Xoa_fmtr_itm Fmt_(byte[] v) {this.fmt = v; return this;} private byte[] fmt;
public Object Sorter() {
GfoInvkAble src_invk = (GfoInvkAble)app.Gfs_mgr().Run_str(src);
return GfoInvkAble_.InvkCmd(src_invk, Invk_sorter);
Gfo_invk src_invk = (Gfo_invk)app.Gfs_mgr().Run_str(src);
return Gfo_invk_.Invk_by_key(src_invk, Invk_sorter);
}
public String Run() {
GfoInvkAble src_invk = (GfoInvkAble)app.Gfs_mgr().Run_str(src);
int len = Int_.cast(GfoInvkAble_.InvkCmd(src_invk, Invk_len));
Bry_bfr bfr = Bry_bfr.new_();
Gfo_invk src_invk = (Gfo_invk)app.Gfs_mgr().Run_str(src);
int len = Int_.cast(Gfo_invk_.Invk_by_key(src_invk, Invk_len));
Bry_bfr bfr = Bry_bfr_.New();
Bfmtr_eval_invk eval_mgr = new Bfmtr_eval_invk(app);
Bry_fmtr fmtr = Bry_fmtr.new_bry_(fmt).Eval_mgr_(eval_mgr);
for (int i = 0; i < len; i++) {
GfoInvkAble itm_invk = (GfoInvkAble)GfoInvkAble_.InvkCmd_val(src_invk, Invk_get_at, i);
Gfo_invk itm_invk = (Gfo_invk)Gfo_invk_.Invk_by_val(src_invk, Invk_get_at, i);
eval_mgr.Invk_(itm_invk);
fmtr.Bld_bfr(bfr, Bry_.Ary_empty);
}
@@ -45,19 +45,19 @@ public class Xoa_fmtr_itm implements GfoInvkAble {
else if (ctx.Match(k, Invk_fmt_)) fmt = m.ReadBry("v");
else if (ctx.Match(k, Invk_sorter)) return this.Sorter();
else if (ctx.Match(k, Invk_run)) return Run();
else return GfoInvkAble_.Rv_unhandled;
else return Gfo_invk_.Rv_unhandled;
return this;
}
private static final String Invk_src = "src", Invk_src_ = "src_", Invk_fmt = "fmt", Invk_fmt_ = "fmt_"
private static final String Invk_src = "src", Invk_src_ = "src_", Invk_fmt = "fmt", Invk_fmt_ = "fmt_"
, Invk_run = "run"
;
public static final String Invk_get_at = "get_at", Invk_len = "len"
public static final String Invk_get_at = "get_at", Invk_len = "len"
, Invk_sorter = "sorter"
;
}
class Bfmtr_eval_invk implements Bry_fmtr_eval_mgr {
public Bfmtr_eval_invk(Xoae_app app) {this.app = app;} private Xoae_app app;
public Bfmtr_eval_invk Invk_(GfoInvkAble invk) {this.invk = invk; return this;} private GfoInvkAble invk;
public Bfmtr_eval_invk Invk_(Gfo_invk invk) {this.invk = invk; return this;} private Gfo_invk invk;
public boolean Enabled() {return enabled;} public void Enabled_(boolean v) {enabled = v;} private boolean enabled = true;
public byte[] Eval(byte[] cmd) {
Object rslt = app.Gfs_mgr().Run_str_for(invk, String_.new_u8(cmd));

View File

@@ -17,10 +17,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.fmtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
import gplx.core.ios.*;
public class Xoa_fmtr_mgr implements GfoInvkAble {
public class Xoa_fmtr_mgr implements Gfo_invk {
public Xoa_fmtr_mgr(Xoae_app app) {this.app = app;} private Xoae_app app;
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_new_grp)) return new Xoa_fmtr_itm(app);
else return GfoInvkAble_.Rv_unhandled;
} private static final String Invk_new_grp = "new_grp";
else return Gfo_invk_.Rv_unhandled;
} private static final String Invk_new_grp = "new_grp";
}

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.apps.fmtrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
public class Xoa_fmtr_sort_mgr implements GfoInvkAble {
public class Xoa_fmtr_sort_mgr implements Gfo_invk {
private Ordered_hash itms = Ordered_hash_.New();
private Xoa_fmtr_sort_wkr wkr = new Xoa_fmtr_sort_wkr();
private Gfo_sort_able sort_able;
@@ -37,7 +37,7 @@ public class Xoa_fmtr_sort_mgr implements GfoInvkAble {
if (ctx.Match(k, Invk_clear)) this.Clear();
else if (ctx.Match(k, Invk_add_many)) this.Add_many(m.ReadStrAry("k", "|"));
else if (ctx.Match(k, Invk_exec)) this.Exec();
else return GfoInvkAble_.Rv_unhandled;
else return Gfo_invk_.Rv_unhandled;
return this;
}
public static final String Invk_clear = "clear", Invk_add_many = "add_many", Invk_exec = "exec";
@@ -50,13 +50,13 @@ class Xoa_fmtr_sort_itm {
class Xoa_fmtr_sort_wkr implements gplx.core.lists.ComparerAble {
public Xoa_fmtr_sort_itm[] Itms() {return itms;} public void Itms_(Xoa_fmtr_sort_itm[] v) {itms = v; itms_len = v.length;} private Xoa_fmtr_sort_itm[] itms; private int itms_len;
public int compare(Object lhsObj, Object rhsObj) {
GfoInvkAble lhs_invk = (GfoInvkAble)lhsObj;
GfoInvkAble rhs_invk = (GfoInvkAble)rhsObj;
Gfo_invk lhs_invk = (Gfo_invk)lhsObj;
Gfo_invk rhs_invk = (Gfo_invk)rhsObj;
for (int i = 0; i < itms_len; i++) {
Xoa_fmtr_sort_itm itm = itms[i];
String itm_key = itm.Key();
Object lhs_val = GfoInvkAble_.InvkCmd(lhs_invk, itm_key);
Object rhs_val = GfoInvkAble_.InvkCmd(rhs_invk, itm_key);
Object lhs_val = Gfo_invk_.Invk_by_key(lhs_invk, itm_key);
Object rhs_val = Gfo_invk_.Invk_by_key(rhs_invk, itm_key);
int compare = CompareAble_.Compare_obj(lhs_val, rhs_val) * itm.Comp_mult();
if (compare != CompareAble_.Same)
return compare;