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
2014-07-28 01:40:51 -04:00
parent e882217c62
commit 7b6e65b088
247 changed files with 2985 additions and 1618 deletions

View File

@@ -31,6 +31,8 @@ public class Xoa_html_data {
public byte[] Custom_html() {return custom_html;} public Xoa_html_data Custom_html_(byte[] v) {custom_html = v; return this;} private byte[] custom_html;
public byte[] Custom_name() {return custom_name;} public Xoa_html_data Custom_name_(byte[] v) {custom_name = v; return this;} private byte[] custom_name;
public byte[] Custom_head_end() {return custom_head_end;}
public boolean Gallery_packed_exists() {return gallery_packed_exists;} public void Gallery_packed_exists_y_() {gallery_packed_exists = true;} private boolean gallery_packed_exists;
public int Imap_id_next() {return ++imap_id_next;} private int imap_id_next;
public void Custom_head_end_concat(byte[] v) {
if (v == null)
custom_head_end = v;
@@ -46,12 +48,14 @@ public class Xoa_html_data {
} private byte[] custom_html_end;
public void Clear() {
if (ctg_hash != null) ctg_hash.Clear();
gallery_packed_exists = false;
module_mgr.Clear();
lnke_autonumber = 1;
html_restricted = true;
html_content_sub = Bry_.Empty;
search_text = Bry_.Empty;
custom_html_end = custom_head_end = custom_html = custom_name = null;
imap_id_next = 0;
}
public byte[][] Ctgs_to_ary() {return ctg_hash == null ? Bry_.Ary_empty : (byte[][])ctg_hash.XtoAry(byte[].class);}
public void Ctgs_add(Xoa_ttl ttl) {

View File

@@ -18,17 +18,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa; import gplx.*;
import gplx.xowa.files.*;
class Xoh_file_main_alts implements Bry_fmtr_arg {
public Xoh_file_main_alts Ini_(Xoh_file_page opt) {
this.opt = opt;
return this;
} private Xoh_file_page opt; Xof_xfer_itm xfer_itm = new Xof_xfer_itm();
private Xof_xfer_itm orig_itm; private Xoh_file_page opt; private Xof_xfer_itm xfer_itm = new Xof_xfer_itm();
public Xoh_file_main_alts Ctor(Xof_xfer_itm orig_itm, Xoh_file_page opt) {
this.orig_itm = orig_itm; this.opt = opt; return this;
}
public void XferAry(Bry_bfr bfr, int idx) {
Int_2_ref[] size_alts = opt.Size_alts();
int len = size_alts.length;
for (int i = 0; i < len; i++) {
Int_2_ref size = size_alts[i];
if (xfer_itm.Html_w() < size.Val_0()) continue;
xfer_itm.Atrs_by_lnki(Xop_lnki_type.Id_none, size.Val_0(), size.Val_1(), Xop_lnki_tkn.Upright_null, Xof_doc_thumb.Null, Xof_doc_page.Null);
xfer_itm.Init_by_lnki(orig_itm.Lnki_ttl(), orig_itm.Lnki_redirect(), Xop_lnki_type.Id_none, size.Val_0(), size.Val_1(), Xop_lnki_tkn.Upright_null, Xof_doc_thumb.Null, Xof_doc_page.Null);
xfer_itm.Atrs_calc_for_html();
opt.Html_alts().Bld_bfr_many(bfr, xfer_itm.Html_w(), xfer_itm.Html_h(), xfer_itm.Html_view_src(), i == len - 1 ? opt.Html_alt_dlm_last() : opt.Html_alt_dlm_default());
}

View File

@@ -19,7 +19,7 @@ package gplx.xowa; import gplx.*;
import gplx.xowa.html.*;
import gplx.xowa.files.*;
public class Xoh_file_main_wkr implements Bry_fmtr_arg {
Xoh_file_page opt; Xoh_file_main_alts alts = new Xoh_file_main_alts();
private Xof_xfer_itm xfer_itm; private Xoh_file_main_alts alts = new Xoh_file_main_alts(); private Xoh_file_page opt;
byte[] file_size_bry; Xoa_ttl ttl; Xow_wiki wiki;
public void Bld_html(Xow_wiki wiki, Xop_ctx ctx, Bry_bfr bfr, Xoa_ttl ttl, Xoh_file_page opt, Xof_xfer_queue queue) {
this.opt = opt; this.ttl = ttl; this.wiki = wiki;
@@ -47,15 +47,14 @@ public class Xoh_file_main_wkr implements Bry_fmtr_arg {
xfer_itm = Xoh_lnki_file_wtr.Queue_add_manual(queue, xfer_itm);
}
opt.Html_main().Bld_bfr_many(bfr, this);
} byte[] play_btn_icon; Bool_obj_ref queue_add_ref = Bool_obj_ref.n_();
} private byte[] play_btn_icon; private Bool_obj_ref queue_add_ref = Bool_obj_ref.n_();
public void Bld_html(Xow_wiki wiki, Bry_bfr bfr, Xof_xfer_itm xfer_itm, Xoa_ttl ttl, Xoh_file_page opt, byte[] file_size_bry, byte[] play_btn_icon, int elem_id_val) {
this.xfer_itm = xfer_itm;
this.wiki = wiki; this.ttl = ttl; this.opt = opt; this.file_size_bry = file_size_bry; this.play_btn_icon = play_btn_icon; this.elem_id_val = elem_id_val;
opt.Html_main().Bld_bfr_many(bfr, this);
} int elem_id_val;
Xof_xfer_itm xfer_itm;
} private int elem_id_val;
public void XferAry(Bry_bfr bfr, int idx) {
alts.Ini_(opt);
alts.Ctor(xfer_itm, opt);
Xof_ext ext = xfer_itm.Lnki_ext();
if (ext.Id_is_thumbable_img())
opt.Html_main_img().Bld_bfr_many(bfr, xfer_itm.Orig_w(), xfer_itm.Orig_h(), xfer_itm.Html_orig_src(), file_size_bry, ext.Mime_type(), elem_id_val, xfer_itm.Html_w(), xfer_itm.Html_h(), xfer_itm.Html_view_src(), ttl.Full_txt(), wiki.App().Encoder_mgr().Url().Encode(ttl.Page_url()), alts);