Rev 8291 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8017 | leency | 1 | |
8016 | leency | 2 | { |
4411 | leency | 3 | collection url; |
8016 | leency | 4 | collection_int xywh; |
5 | int getid; |
||
6 | |||
8320 | leency | 7 | |
8016 | leency | 8 | dword add_pos(); |
8320 | leency | 9 | bool set_size(); |
10 | |||
11 | |||
8016 | leency | 12 | bool next_url(); |
13 | |||
8320 | leency | 14 | |
15 | bool draw(); |
||
16 | }; |
||
4411 | leency | 17 | |
4486 | leency | 18 | |
8320 | leency | 19 | { |
20 | url.drop(); |
||
21 | xywh.drop(); |
||
22 | getid = 0; |
||
23 | } |
||
24 | |||
8017 | leency | 25 | |
8320 | leency | 26 | { |
4411 | leency | 27 | char full_path[URL_SIZE]; |
8016 | leency | 28 | strncpy(#full_path, _path, URL_SIZE); |
29 | get_absolute_url(#full_path, history.current()); |
||
8320 | leency | 30 | |
8016 | leency | 31 | |
32 | xywh.add(_x); |
||
33 | xywh.add(_y); |
||
34 | xywh.add(NULL); |
||
8320 | leency | 35 | xywh.add(NULL); |
36 | return full_path; |
||
8016 | leency | 37 | } |
38 | |||
39 | |||
8320 | leency | 40 | { |
8016 | leency | 41 | char vvv[1000]; |
8320 | leency | 42 | int w, h; |
43 | img_decode stdcall (_buf, _size, 0); |
||
44 | if (EAX) { |
||
45 | EDI = EAX; |
||
46 | w = ESDWORD[EDI+4]; |
||
47 | h = ESDWORD[EDI+8]; |
||
48 | xywh.set(getid*4+2, ESDWORD[EDI+4]); |
||
49 | xywh.set(getid*4+3, ESDWORD[EDI+8]); |
||
50 | sprintf(#vvv, "%s w:%i h:%i", current_url(), w, h); |
||
51 | debugln(#vvv); |
||
52 | } |
||
53 | } |
||
4411 | leency | 54 | |
55 | |||
8016 | leency | 56 | { |
57 | return url.get(getid); |
||
58 | } |
||
59 | |||
60 | |||
61 | { |
||
62 | if (getid < url.count-1) { |
||
63 | getid++; |
||
64 | return 1; |
||
65 | } |
||
66 | return 0; |
||
67 | } |
||
68 | |||
69 | |||
8320 | leency | 70 | { |
8016 | leency | 71 | int i, img_y; |
8320 | leency | 72 | |
8016 | leency | 73 | |
74 | { |
||
75 | img_y = xywh.get(i*4 + 1); |
||
76 | |||
77 | |||
78 | && (cache.has(url.get(i))) draw(_x, _y, _start, i); |
||
8320 | leency | 79 | } |
8016 | leency | 80 | } |
81 | |||
82 | |||
8320 | leency | 83 | { |
8020 | leency | 84 | libimg_image im; |
85 | img_decode stdcall (cache.current_buf, cache.current_size, 0); |
||
8320 | leency | 86 | if (EAX) { |
87 | im.image = EAX; |
||
88 | im.draw(xywh.get(i*4) + _x, xywh.get(i*4+1) - _start + _y, im.w, im.h, 0, 0); |
||
89 | } |
||
90 | } |
||
8020 | leency | 91 | |
92 | |||
8011 | leency | 93 | |
4411 | leency | 94 | |
6803 | leency | 95 | { |
4411 | leency | 96 | dword image; |
97 | dword imgw=0, imgh=0, img_lines_first=0, cur_pic=0; |
||
6803 | leency | 98 | |
4411 | leency | 99 | |
8291 | leency | 100 | //cur_pic = GetImage(#img_path); |
7742 | leency | 101 | |
4411 | leency | 102 | |
103 | { |
||
104 | //cur_pic = GetImage("/sys/network/noimg.png"); |
||
5746 | leency | 105 | return; |
4411 | leency | 106 | } |
107 | |||
108 | |||
4674 | leency | 109 | imgh = DSWORD[pics[cur_pic].image+8]; |
110 | if (imgw > width1) imgw = width1; |
||
111 | |||
4411 | leency | 112 | |
7757 | leency | 113 | |
114 | |||
5718 | leency | 115 | if (top1 |
116 | { |
||
4411 | leency | 117 | img_lines_first=WB1.list.y-top1; |
4414 | leency | 118 | imgh=imgh-img_lines_first; |
4674 | leency | 119 | top1=WB1.list.y; |
4414 | leency | 120 | } |
4411 | leency | 121 | if (top1>WB1.list.y+WB1.list.h-imgh-5) //if image partly visible (at the bottom) |
5718 | leency | 122 | { |
4411 | leency | 123 | imgh=WB1.list.y+WB1.list.h-top1-5; |
4674 | leency | 124 | } |
4411 | leency | 125 | if (imgh<=0) return; |
4674 | leency | 126 | |
4411 | leency | 127 | |
4674 | leency | 128 | DrawBar(left1+imgw - 5, top1, WB1.list.w-imgw, imgh, page_bg); |
7743 | leency | 129 | DrawBar(WB1.list.x, top1+imgh, WB1.list.w, -imgh % WB1.list.item_h + WB1.list.item_h, page_bg); |
130 | if (link) |
||
5718 | leency | 131 | { |
4550 | leency | 132 | UnsafeDefineButton(left1 - 5, top1, imgw, imgh-1, links.count + 400 + BT_HIDE, 0xB5BFC9); |
7970 | leency | 133 | links.AddText(0, imgw, imgh-1, NOLINE, 1); |
134 | WB1.DrawPage(); |
||
7756 | leency | 135 | } |
4550 | leency | 136 | } |
4491 | leency | 137 | |
138 | |||
8011 | leency | 139 | |
140 | |||
8017 | leency | 141 |