Rev 3437 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3437 | Rev 3439 | ||
---|---|---|---|
1 | //Leency & SoUrcerer, LGPL |
1 | //Leency & SoUrcerer, LGPL |
2 | 2 | ||
3 | #define LIST_INFO_H 59 |
3 | #define LIST_INFO_H 59 |
4 | int status_bar_h = 15; |
4 | int status_bar_h = 15; |
5 | 5 | ||
6 | llist mail_list; |
6 | llist mail_list; |
7 | llist letter_view; |
7 | llist letter_view; |
8 | scroll_bar scroll1 = { 17,200,210, LIST_INFO_H-3,18,0,115,15,0,0xCCCccc,0xD2CED0,0x555555,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; |
8 | scroll_bar scroll1 = { 17,200,210, LIST_INFO_H-3,18,0,115,15,0,0xCCCccc,0xD2CED0,0x555555,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; |
9 | scroll_bar scroll2 = { 17,200,210, LIST_INFO_H,18,0,115,15,0,0xCCCccc,0xD2CED0,0x555555,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; |
9 | scroll_bar scroll2 = { 17,200,210, LIST_INFO_H,18,0,115,15,0,0xCCCccc,0xD2CED0,0x555555,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; |
10 | 10 | ||
11 | char from[256]; |
11 | char from[256]; |
12 | char to[256]; |
12 | char to[256]; |
13 | char date[256]; |
13 | char date[256]; |
14 | char subj[256]; |
14 | char subj[256]; |
15 | dword mdata; |
15 | dword mdata; |
16 | 16 | ||
17 | struct letter_attr |
17 | struct letter_attr |
18 | { |
18 | { |
19 | char adress[sizeof(to)]; |
19 | char adress[sizeof(to)]; |
20 | char subject[sizeof(subj)]; |
20 | char subject[sizeof(subj)]; |
21 | byte direction; |
21 | byte direction; |
22 | int size; |
22 | int size; |
23 | void CreateArray(); |
23 | void CreateArray(); |
24 | void SetSizes(); |
24 | void SetSizes(); |
25 | void SetAtrFromCurr(int N); |
25 | void SetAtrFromCurr(int N); |
26 | int GetSize(int N); |
26 | int GetSize(int N); |
27 | char GetDirection(int N); |
27 | char GetDirection(int N); |
28 | dword GetSubject(int N); |
28 | dword GetSubject(int N); |
29 | dword GetAdress(int N); |
29 | dword GetAdress(int N); |
30 | }; |
30 | }; |
31 | letter_attr atr; |
31 | letter_attr atr; |
32 | dword mails_db; |
32 | dword mails_db; |
33 | 33 | ||
34 | char *listbuffer; |
34 | char *listbuffer; |
35 | char *listpointer; |
35 | char *listpointer; |
36 | 36 | ||
37 | char *mailbuffer; |
37 | char *mailbuffer; |
38 | char *mailpointer; |
38 | char *mailpointer; |
39 | 39 | ||
40 | 40 | ||
41 | enum { |
41 | enum { |
42 | GET_MAIL = 20, |
42 | GET_MAIL = 20, |
43 | SEND_MAIL, |
43 | SEND_MAIL, |
44 | DELETE_LETTER, |
44 | DELETE_LETTER, |
45 | SAVE_LETTER, |
45 | SAVE_LETTER, |
46 | STOP_LOADING, |
46 | STOP_LOADING, |
47 | EXIT_MAIL, |
47 | EXIT_MAIL, |
48 | CHANGE_CHARSET, |
48 | CHANGE_CHARSET, |
49 | CLOSE_CHANGE_CHARSET |
49 | CLOSE_CHANGE_CHARSET |
50 | }; |
50 | }; |
51 | 51 | ||
52 | 52 | ||
53 | void MailBoxLoop() |
53 | void MailBoxLoop() |
54 | { |
54 | { |
55 | int key, id; |
55 | int key, id; |
56 | mouse m; |
56 | mouse m; |
57 | int panels_drag = 0; |
57 | int panels_drag = 0; |
58 | char socket_char; |
58 | char socket_char; |
59 | int letter_size; |
59 | int letter_size; |
60 | dword line_col, text_col; |
60 | dword line_col, text_col; |
61 | 61 | ||
62 | mail_list.h = Form.cheight/4; |
62 | mail_list.h = Form.cheight/4; |
63 | mail_list.ClearList(); |
63 | mail_list.ClearList(); |
64 | SetMailBoxStatus( NULL , NULL); |
64 | SetMailBoxStatus( NULL , NULL); |
65 | cur_charset = 0; |
65 | cur_charset = 0; |
66 | 66 | ||
67 | goto _MB_DRAW; |
67 | goto _MB_DRAW; |
68 | 68 | ||
69 | loop() |
69 | loop() |
70 | { |
70 | { |
71 | WaitEventTimeout(2); |
71 | WaitEventTimeout(2); |
72 | switch(EAX & 0xFF) |
72 | switch(EAX & 0xFF) |
73 | { |
73 | { |
74 | case evMouse: |
74 | case evMouse: |
75 | IF (GetProcessSlot(Form.ID)-GetActiveProcess()!=0) break; |
75 | IF (GetProcessSlot(Form.ID)-GetActiveProcess()!=0) break; |
76 | m.get(); |
76 | m.get(); |
77 | 77 | ||
78 | if (!m.lkm) panels_drag=0; |
78 | if (!m.lkm) panels_drag=0; |
79 | if (m.lkm) && (m.y>mail_list.y+mail_list.h-1) && (m.y |
79 | if (m.lkm) && (m.y>mail_list.y+mail_list.h-1) && (m.y |
80 | && (!scroll1.delta2) && (!scroll2.delta2) panels_drag = 1; |
80 | && (!scroll1.delta2) && (!scroll2.delta2) panels_drag = 1; |
81 | if (panels_drag) |
81 | if (panels_drag) |
82 | { |
82 | { |
83 | if (m.y |
83 | if (m.y |
84 | mail_list.h = m.y - mail_list.y-2; |
84 | mail_list.h = m.y - mail_list.y-2; |
85 | DrawMailBox(); |
85 | DrawMailBox(); |
86 | break; |
86 | break; |
87 | } |
87 | } |
88 | 88 | ||
89 | if (!mail_list.count) break; |
89 | if (!mail_list.count) break; |
90 | if (!panels_drag) { scrollbar_v_mouse (#scroll1); scrollbar_v_mouse (#scroll2); } |
90 | if (!panels_drag) { scrollbar_v_mouse (#scroll1); scrollbar_v_mouse (#scroll2); } |
91 | 91 | ||
92 | if (mail_list.first <> scroll1.position) |
92 | if (mail_list.first <> scroll1.position) |
93 | { |
93 | { |
94 | mail_list.first = scroll1.position; |
94 | mail_list.first = scroll1.position; |
95 | DrawMailList(); |
95 | DrawMailList(); |
96 | break; |
96 | break; |
97 | }; |
97 | }; |
98 | if (letter_view.first <> scroll2.position) |
98 | if (letter_view.first <> scroll2.position) |
99 | { |
99 | { |
100 | letter_view.first = scroll2.position; |
100 | letter_view.first = scroll2.position; |
101 | DrawLetter(); |
101 | DrawLetter(); |
102 | break; |
102 | break; |
103 | }; |
103 | }; |
104 | 104 | ||
105 | if (mail_list.y+mail_list.h + 10 > m.y) |
105 | if (mail_list.y+mail_list.h + 10 > m.y) |
106 | { |
106 | { |
107 | if (mail_list.MouseScroll(m.vert)) DrawMailList(); |
107 | if (mail_list.MouseScroll(m.vert)) DrawMailList(); |
108 | } |
108 | } |
109 | else |
109 | else |
110 | { |
110 | { |
111 | if (letter_view.MouseScroll(m.vert)) DrawLetter(); |
111 | if (letter_view.MouseScroll(m.vert)) DrawLetter(); |
112 | } |
112 | } |
113 | 113 | ||
114 | break; |
114 | break; |
115 | case evButton: |
115 | case evButton: |
116 | id = GetButtonID(); |
116 | id = GetButtonID(); |
117 | if (id==1) SaveAndExit(); |
117 | if (id==1) SaveAndExit(); |
118 | if (id==GET_MAIL) aim = SEND_NSTAT; |
118 | if (id==GET_MAIL) aim = SEND_NSTAT; |
119 | if (id==SAVE_LETTER) |
119 | if (id==SAVE_LETTER) |
120 | { |
120 | { |
121 | if (!mailbuffer) break; |
121 | if (!mailbuffer) break; |
122 | WriteFile(strlen(mailbuffer), mailbuffer, "mail.txt"); |
122 | WriteFile(strlen(mailbuffer), mailbuffer, "mail.txt"); |
123 | pause(10); |
123 | pause(10); |
124 | RunProgram("tinypad", "mail.txt"); |
124 | RunProgram("tinypad", "mail.txt"); |
125 | } |
125 | } |
126 | if (id==STOP_LOADING) |
126 | if (id==STOP_LOADING) |
127 | { |
127 | { |
128 | StopLoading(); |
128 | StopLoading(); |
129 | DrawStatusBar(); |
129 | DrawStatusBar(); |
130 | DrawMailList(); |
130 | DrawMailList(); |
131 | } |
131 | } |
132 | if (id==EXIT_MAIL) |
132 | if (id==EXIT_MAIL) |
133 | { |
133 | { |
134 | StopLoading(); |
134 | StopLoading(); |
135 | if (!CloseSocket(socket)) debug("An error occurred during closing of the socket"); |
135 | CloseSocket(socket); |
136 | LoginBoxLoop(); |
136 | LoginBoxLoop(); |
137 | } |
137 | } |
138 | if (id==CHANGE_CHARSET) |
138 | if (id==CHANGE_CHARSET) |
139 | { |
139 | { |
140 | DefineButton(0,0,Form.cwidth,Form.cheight, CLOSE_CHANGE_CHARSET+BT_HIDE+BT_NOFRAME); |
140 | DefineButton(0,0,Form.cwidth,Form.cheight, CLOSE_CHANGE_CHARSET+BT_HIDE+BT_NOFRAME); |
141 | DrawRectangle(Form.cwidth-100, Form.cheight-status_bar_h- 70, 70, 82, sc.work_graph); |
141 | DrawRectangle(Form.cwidth-100, Form.cheight-status_bar_h- 70, 70, 82, sc.work_graph); |
142 | DrawRectangle3D(Form.cwidth-99, Form.cheight-status_bar_h- 69, 68, 80, 0xFFFfff, sc.work); |
142 | DrawRectangle3D(Form.cwidth-99, Form.cheight-status_bar_h- 69, 68, 80, 0xFFFfff, sc.work); |
143 | for (id=0; id<5; id++) |
143 | for (id=0; id<5; id++) |
144 | { |
144 | { |
145 | if (cur_charset==id+1) { line_col=sc.work_button; text_col=sc.work_button_text; } |
145 | if (cur_charset==id+1) { line_col=sc.work_button; text_col=sc.work_button_text; } |
146 | else { line_col=sc.work; text_col=sc.work_text; } |
146 | else { line_col=sc.work; text_col=sc.work_text; } |
147 | DrawBar(Form.cwidth-98, id*16+Form.cheight-status_bar_h- 68, 67, 16, line_col); |
147 | DrawBar(Form.cwidth-98, id*16+Form.cheight-status_bar_h- 68, 67, 16, line_col); |
148 | DrawCaptButton(Form.cwidth-100, id*16+Form.cheight-status_bar_h- 68, 70,16, 10+id+BT_HIDE, |
148 | DrawCaptButton(Form.cwidth-100, id*16+Form.cheight-status_bar_h- 68, 70,16, 10+id+BT_HIDE, |
149 | 0, text_col, charsets[id+1]); |
149 | 0, text_col, charsets[id+1]); |
150 | } |
150 | } |
151 | } |
151 | } |
152 | if (id==CLOSE_CHANGE_CHARSET) goto _MB_DRAW; |
152 | if (id==CLOSE_CHANGE_CHARSET) goto _MB_DRAW; |
153 | 153 | ||
154 | if (id>=30) |
154 | if (id>=30) |
155 | { |
155 | { |
156 | if (aim) break; |
156 | if (aim) break; |
157 | mail_list.current = mail_list.first + id - 30; |
157 | mail_list.current = mail_list.first + id - 30; |
158 | DrawMailList(); |
158 | DrawMailList(); |
159 | aim = SEND_RETR; |
159 | aim = SEND_RETR; |
160 | } |
160 | } |
161 | 161 | ||
162 | break; |
162 | break; |
163 | case evKey: |
163 | case evKey: |
164 | key = GetKey(); |
164 | key = GetKey(); |
165 | 165 | ||
166 | if (key == 177){ //down |
166 | if (key == 177){ //down |
167 | if (aim) break; |
167 | if (aim) break; |
168 | if (mail_list.current >= mail_list.count-1) break; |
168 | if (mail_list.current >= mail_list.count-1) break; |
169 | mail_list.current++ ; |
169 | mail_list.current++ ; |
170 | if (mail_list.current >= mail_list.first + mail_list.visible) mail_list.first++ ; |
170 | if (mail_list.current >= mail_list.first + mail_list.visible) mail_list.first++ ; |
171 | DrawMailList(); |
171 | DrawMailList(); |
172 | aim = SEND_RETR; |
172 | aim = SEND_RETR; |
173 | } |
173 | } |
174 | if (key == 178){ //up |
174 | if (key == 178){ //up |
175 | if (aim) break; |
175 | if (aim) break; |
176 | if (mail_list.current<=0) break; |
176 | if (mail_list.current<=0) break; |
177 | mail_list.current-- ; |
177 | mail_list.current-- ; |
178 | if (mail_list.current < mail_list.first) mail_list.first-- ; |
178 | if (mail_list.current < mail_list.first) mail_list.first-- ; |
179 | DrawMailList(); |
179 | DrawMailList(); |
180 | aim = SEND_RETR; |
180 | aim = SEND_RETR; |
181 | } |
181 | } |
182 | if (key == 180){ //home |
182 | if (key == 180){ //home |
183 | if (aim) break; |
183 | if (aim) break; |
184 | mail_list.first = mail_list.current = 0; |
184 | mail_list.first = mail_list.current = 0; |
185 | DrawMailList(); |
185 | DrawMailList(); |
186 | aim = SEND_RETR; |
186 | aim = SEND_RETR; |
187 | } |
187 | } |
188 | if (key == 181){ //end |
188 | if (key == 181){ //end |
189 | if (aim) break; |
189 | if (aim) break; |
190 | mail_list.first = mail_list.count - mail_list.visible; |
190 | mail_list.first = mail_list.count - mail_list.visible; |
191 | mail_list.current = mail_list.count - 1; |
191 | mail_list.current = mail_list.count - 1; |
192 | DrawMailList(); |
192 | DrawMailList(); |
193 | aim = SEND_RETR; |
193 | aim = SEND_RETR; |
194 | } |
194 | } |
195 | 195 | ||
196 | break; |
196 | break; |
197 | case evReDraw: _MB_DRAW: |
197 | case evReDraw: _MB_DRAW: |
198 | if !(DefineWindow(MAILBOX_HEADER)) break; |
198 | if !(DefineWindow(MAILBOX_HEADER)) break; |
199 | scroll1.bckg_col = scroll2.bckg_col = 0xBBBbbb; |
199 | scroll1.bckg_col = scroll2.bckg_col = 0xBBBbbb; |
200 | scroll1.frnt_col = scroll2.frnt_col = sc.work; |
200 | scroll1.frnt_col = scroll2.frnt_col = sc.work; |
201 | scroll1.line_col = scroll2.line_col = sc.work_graph; |
201 | scroll1.line_col = scroll2.line_col = sc.work_graph; |
202 | DrawToolbar(); |
202 | DrawToolbar(); |
203 | DrawMailBox(); |
203 | DrawMailBox(); |
204 | 204 | ||
205 | break; |
205 | break; |
206 | default: |
206 | default: |
207 | if (aim == SEND_NSTAT) |
207 | if (aim == SEND_NSTAT) |
208 | { |
208 | { |
209 | debug("Counting mail, awaiting answer..."); |
209 | debug("Counting mail, awaiting answer..."); |
210 | request_len = GetRequest("STAT", NULL); |
210 | request_len = GetRequest("STAT", NULL); |
211 | WriteSocket(socket,request_len,#request); |
211 | WriteSocket(socket,request_len,#request); |
212 | if (EAX == 0xffffffff) { debug("Error sending STAT. Retry..."w); break;} |
212 | if (EAX == 0xffffffff) { debug("Error sending STAT. Retry..."w); break;} |
213 | aim = GET_ANSWER_NSTAT; |
213 | aim = GET_ANSWER_NSTAT; |
214 | } |
214 | } |
215 | 215 | ||
216 | if (aim == GET_ANSWER_NSTAT) |
216 | if (aim == GET_ANSWER_NSTAT) |
217 | { |
217 | { |
218 | if (!PollSocket(socket)) break; |
218 | if (!PollSocket(socket)) break; |
219 | socket_char=ReadSocket(socket); |
219 | socket_char=ReadSocket(socket); |
220 | immputc(socket_char); |
220 | immputc(socket_char); |
221 | 221 | ||
222 | if (socket_char=='\n') |
222 | if (socket_char=='\n') |
223 | { |
223 | { |
224 | debug("GOT::"); |
224 | debug("GOT::"); |
225 | debug(#immbuffer); |
225 | debug(#immbuffer); |
226 | if (strstr(#immbuffer,"+OK")) |
226 | if (strstr(#immbuffer,"+OK")) |
227 | { |
227 | { |
228 | mail_list.count = GetMailCount(); |
228 | mail_list.count = GetMailCount(); |
229 | debug("Letters:"); |
229 | debug("Letters:"); |
230 | debug(itoa(mail_list.count)); |
230 | debug(itoa(mail_list.count)); |
231 | listbuffer = free(listbuffer); |
231 | listbuffer = free(listbuffer); |
232 | listbuffer = mem_Alloc(30*mail_list.count); //24* original |
232 | listbuffer = mem_Alloc(30*mail_list.count); //24* original |
233 | listpointer = listbuffer; |
233 | listpointer = listbuffer; |
234 | aim = SEND_NLIST; |
234 | aim = SEND_NLIST; |
235 | debug("Recieving mail list..."); |
235 | debug("Recieving mail list..."); |
236 | immfree(); |
236 | immfree(); |
237 | } |
237 | } |
238 | else |
238 | else |
239 | { |
239 | { |
240 | notify("Sorry, can't recieve your mail"); |
240 | notify("Sorry, can't recieve your mail"); |
241 | immfree(); |
241 | immfree(); |
242 | aim=NULL; //aim = SEND_NLIST; |
242 | aim=NULL; //aim = SEND_NLIST; |
243 | } |
243 | } |
244 | } |
244 | } |
245 | } |
245 | } |
246 | 246 | ||
247 | if (aim == SEND_NLIST) |
247 | if (aim == SEND_NLIST) |
248 | { |
248 | { |
249 | WriteText(5, Form.cheight-11, 0x80, sc.work_text, "Send LIST, awaiting answer..."); |
249 | WriteText(5, Form.cheight-11, 0x80, sc.work_text, "Send LIST, awaiting answer..."); |
250 | request_len = GetRequest("LIST", NULL); |
250 | request_len = GetRequest("LIST", NULL); |
251 | WriteSocket(socket,request_len,#request); |
251 | WriteSocket(socket,request_len,#request); |
252 | if (EAX == 0xffffffff) {debug("Error while sending LIST. Retry..."); break;} |
252 | if (EAX == 0xffffffff) {debug("Error while sending LIST. Retry..."); break;} |
253 | aim = GET_ANSWER_NLIST; |
253 | aim = GET_ANSWER_NLIST; |
254 | } |
254 | } |
255 | 255 | ||
256 | if (aim == GET_ANSWER_NLIST) |
256 | if (aim == GET_ANSWER_NLIST) |
257 | { |
257 | { |
258 | ticks = PollSocket(socket); |
258 | ticks = PollSocket(socket); |
259 | if (!ticks) break; |
259 | if (!ticks) break; |
260 | for (;ticks>0;ticks--) |
260 | for (;ticks>0;ticks--) |
261 | { |
261 | { |
262 | socket_char=ReadSocket(socket); |
262 | socket_char=ReadSocket(socket); |
263 | listputc(socket_char); |
263 | listputc(socket_char); |
264 | 264 | ||
265 | if (socket_char=='.') //this way of checking end of message IS BAD |
265 | if (socket_char=='.') //this way of checking end of message IS BAD |
266 | { |
266 | { |
267 | aim = SEND_RETR; |
267 | aim = SEND_RETR; |
268 | debug("Got mail list"); |
268 | debug("Got mail list"); |
269 | DrawMailBox(); |
269 | DrawMailBox(); |
270 | 270 | ||
271 | atr.CreateArray(); |
271 | atr.CreateArray(); |
272 | atr.SetSizes(); |
272 | atr.SetSizes(); |
273 | } |
273 | } |
274 | } |
274 | } |
275 | } |
275 | } |
276 | if (aim == SEND_RETR) |
276 | if (aim == SEND_RETR) |
277 | { |
277 | { |
278 | from = to = date = subj = cur_charset = NULL; |
278 | from = to = date = subj = cur_charset = NULL; |
279 | letter_view.ClearList(); |
279 | letter_view.ClearList(); |
280 | DrawMailBox(); |
280 | DrawMailBox(); |
281 | debug("Send RETR, awaiting answer..."); |
281 | debug("Send RETR, awaiting answer..."); |
282 | request_len = GetRequest("RETR", itoa(mail_list.current+1)); |
282 | request_len = GetRequest("RETR", itoa(mail_list.current+1)); |
283 | WriteSocket(socket,request_len,#request); |
283 | WriteSocket(socket,request_len,#request); |
284 | if (EAX == 0xffffffff) { notify("Error while trying to get letter from server"); aim=NULL; break;} |
284 | if (EAX == 0xffffffff) { notify("Error while trying to get letter from server"); aim=NULL; break;} |
285 | 285 | ||
286 | mailbuffer = free(mailbuffer); |
286 | mailbuffer = free(mailbuffer); |
287 | letter_size = atr.GetSize(mail_list.current+1) + 1024; |
287 | letter_size = atr.GetSize(mail_list.current+1) + 1024; |
288 | mailbuffer = malloc(letter_size); |
288 | mailbuffer = malloc(letter_size); |
289 | mailpointer = mailbuffer; |
289 | mailpointer = mailbuffer; |
290 | aim = GET_ANSWER_RETR; |
290 | aim = GET_ANSWER_RETR; |
291 | } |
291 | } |
292 | if (aim == GET_ANSWER_RETR) |
292 | if (aim == GET_ANSWER_RETR) |
293 | { |
293 | { |
294 | ticks=PollSocket(socket); |
294 | ticks=PollSocket(socket); |
295 | if (!ticks) break; |
295 | if (!ticks) break; |
296 | 296 | ||
297 | for (;ticks>0;ticks--) |
297 | for (;ticks>0;ticks--) |
298 | { |
298 | { |
299 | socket_char=ReadSocket(socket); |
299 | socket_char=ReadSocket(socket); |
300 | //debugch(socket_char); |
300 | //debugch(socket_char); |
301 | *mailpointer=socket_char; |
301 | *mailpointer=socket_char; |
302 | mailpointer++; |
302 | mailpointer++; |
303 | *mailpointer='\0'; |
303 | *mailpointer='\0'; |
304 | if (!aim) continue; |
304 | if (!aim) continue; |
305 | 305 | ||
306 | if (letter_size + mailbuffer - mailpointer - 2 < 0) |
306 | if (letter_size + mailbuffer - mailpointer - 2 < 0) |
307 | { |
307 | { |
308 | debug("Buffer overflow!!1 Realloc..."w); |
308 | debug("Buffer overflow!!1 Realloc..."w); |
309 | letter_size += 4096; |
309 | letter_size += 4096; |
310 | mailbuffer = realloc(mailbuffer, letter_size); |
310 | mailbuffer = realloc(mailbuffer, letter_size); |
311 | if (!mailbuffer) {debug("Relloc error!"); aim=NULL; break;} |
311 | if (!mailbuffer) {debug("Relloc error!"); aim=NULL; break;} |
312 | } |
312 | } |
313 | 313 | ||
314 | if (letter_size>9000) |
314 | if (letter_size>9000) |
315 | { |
315 | { |
316 | id = mailpointer - mailbuffer * 100 ; |
316 | id = mailpointer - mailbuffer * 100 ; |
317 | id /= letter_size - 1024; |
317 | id /= letter_size - 1024; |
318 | if (id!=cur_st_percent) SetMailBoxStatus( id , NULL); |
318 | if (id!=cur_st_percent) SetMailBoxStatus( id , NULL); |
319 | } |
319 | } |
320 | 320 | ||
321 | ParceMail(); |
321 | ParceMail(); |
322 | } |
322 | } |
323 | } |
323 | } |
324 | 324 | ||
325 | } |
325 | } |
326 | } |
326 | } |
327 | } |
327 | } |
328 | 328 | ||
329 | 329 | ||
330 | void DrawMailBox() |
330 | void DrawMailBox() |
331 | { |
331 | { |
332 | DrawMailList(); |
332 | DrawMailList(); |
333 | DrawLetterInfo(); |
333 | DrawLetterInfo(); |
334 | DrawLetter(); |
334 | DrawLetter(); |
335 | DrawStatusBar(); |
335 | DrawStatusBar(); |
336 | } |
336 | } |
337 | 337 | ||
338 | 338 | ||
339 | void DrawToolbar() |
339 | void DrawToolbar() |
340 | { |
340 | { |
341 | #define BUT_Y 7 |
341 | #define BUT_Y 7 |
342 | #define BUT_H 22 |
342 | #define BUT_H 22 |
343 | #define BUT_W 74 |
343 | #define BUT_W 74 |
344 | #define BUT_SPACE 11 |
344 | #define BUT_SPACE 11 |
345 | int toolbar_w = BUT_Y + BUT_H + BUT_Y + 3; |
345 | int toolbar_w = BUT_Y + BUT_H + BUT_Y + 3; |
346 | mail_list.SetSizes(0, toolbar_w, Form.cwidth - scroll1.size_x - 1, mail_list.h, 60,18); |
346 | mail_list.SetSizes(0, toolbar_w, Form.cwidth - scroll1.size_x - 1, mail_list.h, 60,18); |
347 | 347 | ||
348 | DrawBar(0,0, Form.cwidth,toolbar_w-3, sc.work); |
348 | DrawBar(0,0, Form.cwidth,toolbar_w-3, sc.work); |
349 | DrawCaptButton(10 , BUT_Y, BUT_W, BUT_H, GET_MAIL, sc.work_button, sc.work_button_text,"Get mail"); |
349 | DrawCaptButton(10 , BUT_Y, BUT_W, BUT_H, GET_MAIL, sc.work_button, sc.work_button_text,"Get mail"); |
350 | DrawCaptButton(BUT_W+BUT_SPACE + 10, BUT_Y, BUT_W, BUT_H, SEND_MAIL, sc.work_button, sc.work_button_text,"Send Email"); |
350 | DrawCaptButton(BUT_W+BUT_SPACE + 10, BUT_Y, BUT_W, BUT_H, SEND_MAIL, sc.work_button, sc.work_button_text,"Send Email"); |
351 | DrawCaptButton(BUT_W+BUT_SPACE*2 + 10, BUT_Y, BUT_W, BUT_H, DELETE_LETTER, sc.work_button, sc.work_button_text,"Delete"); |
351 | DrawCaptButton(BUT_W+BUT_SPACE*2 + 10, BUT_Y, BUT_W, BUT_H, DELETE_LETTER, sc.work_button, sc.work_button_text,"Delete"); |
352 | DrawCaptButton(BUT_W+BUT_SPACE*3 + 10, BUT_Y, BUT_W, BUT_H, SAVE_LETTER, sc.work_button, sc.work_button_text,"Save"); |
352 | DrawCaptButton(BUT_W+BUT_SPACE*3 + 10, BUT_Y, BUT_W, BUT_H, SAVE_LETTER, sc.work_button, sc.work_button_text,"Save"); |
353 | DrawCaptButton(Form.cwidth-BUT_W - 10, BUT_Y, BUT_W, BUT_H, EXIT_MAIL, sc.work_button, sc.work_button_text,"< Exit"); |
353 | DrawCaptButton(Form.cwidth-BUT_W - 10, BUT_Y, BUT_W, BUT_H, EXIT_MAIL, sc.work_button, sc.work_button_text,"< Exit"); |
354 | 354 | ||
355 | DrawBar(0, mail_list.y-3, mail_list.w,1, sc.work_graph); |
355 | DrawBar(0, mail_list.y-3, mail_list.w,1, sc.work_graph); |
356 | DrawBar(0, mail_list.y-2, mail_list.w,1, 0xdfdfdf); |
356 | DrawBar(0, mail_list.y-2, mail_list.w,1, 0xdfdfdf); |
357 | DrawBar(0, mail_list.y-1, mail_list.w,1, 0xf0f0f0); |
357 | DrawBar(0, mail_list.y-1, mail_list.w,1, 0xf0f0f0); |
358 | } |
358 | } |
359 | 359 | ||
360 | 360 | ||
361 | void DrawMailList() |
361 | void DrawMailList() |
362 | { |
362 | { |
363 | int i, on_y, on_x, direction; |
363 | int i, on_y, on_x, direction; |
364 | mail_list.visible = mail_list.h / mail_list.line_h; |
364 | mail_list.visible = mail_list.h / mail_list.line_h; |
365 | 365 | ||
366 | for (i=30; i<150; i++) DeleteButton(i); |
366 | for (i=30; i<150; i++) DeleteButton(i); |
367 | for (i=0; (i |
367 | for (i=0; (i |
368 | { |
368 | { |
369 | on_y = i*mail_list.line_h + mail_list.y; |
369 | on_y = i*mail_list.line_h + mail_list.y; |
370 | if (mail_list.current==mail_list.first+i) |
370 | if (mail_list.current==mail_list.first+i) |
371 | { |
371 | { |
372 | DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, 0xEEEeee); |
372 | DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, 0xEEEeee); |
373 | } |
373 | } |
374 | else |
374 | else |
375 | { |
375 | { |
376 | DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, 0xFFFfff); |
376 | DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, 0xFFFfff); |
377 | } |
377 | } |
378 | direction = atr.GetDirection(i+mail_list.first+1); |
378 | direction = atr.GetDirection(i+mail_list.first+1); |
379 | on_x = strlen(itoa(i+mail_list.first+1))*6; |
379 | on_x = strlen(itoa(i+mail_list.first+1))*6; |
380 | _PutImage(on_x + 18, mail_list.line_h-12/2+ on_y, 18,12, sizeof(in_out_mail)/3*direction + #in_out_mail); |
380 | _PutImage(on_x + 18, mail_list.line_h-12/2+ on_y, 18,12, sizeof(in_out_mail)/3*direction + #in_out_mail); |
381 | WriteText(on_x + 42, on_y+5, 0x80, 0, atr.GetSubject(i+mail_list.first+1)); |
381 | WriteText(on_x + 42, on_y+5, 0x80, 0, atr.GetSubject(i+mail_list.first+1)); |
382 | DefineButton(0, on_y, mail_list.w-1, mail_list.line_h, 30+i+BT_HIDE+BT_NOFRAME); |
382 | DefineButton(0, on_y, mail_list.w-1, mail_list.line_h, 30+i+BT_HIDE+BT_NOFRAME); |
383 | DrawBar(0, on_y + mail_list.line_h-1, mail_list.w, 1, 0xCCCccc); |
383 | DrawBar(0, on_y + mail_list.line_h-1, mail_list.w, 1, 0xCCCccc); |
384 | WriteText(10, on_y+5, 0x80, 0, itoa(i+mail_list.first+1)); |
384 | WriteText(10, on_y+5, 0x80, 0, itoa(i+mail_list.first+1)); |
385 | WriteText(mail_list.w - 40, on_y+5, 0x80, 0, ConvertMemSize(atr.GetSize(i+mail_list.first+1))); |
385 | WriteText(mail_list.w - 40, on_y+5, 0x80, 0, ConvertMemSize(atr.GetSize(i+mail_list.first+1))); |
386 | } |
386 | } |
387 | DrawBar(0, i*mail_list.line_h + mail_list.y, mail_list.w, -i*mail_list.line_h+mail_list.h, 0xFFFfff); |
387 | DrawBar(0, i*mail_list.line_h + mail_list.y, mail_list.w, -i*mail_list.line_h+mail_list.h, 0xFFFfff); |
388 | DrawScroller1(); |
388 | DrawScroller1(); |
389 | } |
389 | } |
390 | 390 | ||
391 | void DrawLetterInfo() |
391 | void DrawLetterInfo() |
392 | { |
392 | { |
393 | int lt_y = mail_list.y+mail_list.h; |
393 | int lt_y = mail_list.y+mail_list.h; |
394 | DrawBar(0, lt_y, mail_list.w, 1, sc.work_graph); |
394 | DrawBar(0, lt_y, mail_list.w, 1, sc.work_graph); |
395 | DrawBar(0, lt_y+1, Form.cwidth, 1, LBUMP); |
395 | DrawBar(0, lt_y+1, Form.cwidth, 1, LBUMP); |
396 | DrawBar(0, lt_y+2, Form.cwidth, LIST_INFO_H-4, sc.work); |
396 | DrawBar(0, lt_y+2, Form.cwidth, LIST_INFO_H-4, sc.work); |
397 | WriteText(mail_list.w-30/2, lt_y, 0x80, 0x888888, "= = ="); |
397 | WriteText(mail_list.w-30/2, lt_y, 0x80, 0x888888, "= = ="); |
398 | WriteText(mail_list.w-30/2, lt_y+1, 0x80, 0xEeeeee, "= = ="); |
398 | WriteText(mail_list.w-30/2, lt_y+1, 0x80, 0xEeeeee, "= = ="); |
399 | DrawBar(0, lt_y+LIST_INFO_H-2, mail_list.w, 1, sc.work_graph); //bottom |
399 | DrawBar(0, lt_y+LIST_INFO_H-2, mail_list.w, 1, sc.work_graph); //bottom |
400 | DrawBar(0, lt_y+LIST_INFO_H-1, mail_list.w, 1, 0xdfdfdf); |
400 | DrawBar(0, lt_y+LIST_INFO_H-1, mail_list.w, 1, 0xdfdfdf); |
401 | DrawBar(0, lt_y+LIST_INFO_H , mail_list.w, 1, 0xf0f0f0); |
401 | DrawBar(0, lt_y+LIST_INFO_H , mail_list.w, 1, 0xf0f0f0); |
402 | WriteTextB(10, lt_y+8 , 0x80, sc.work_text, "From:"); |
402 | WriteTextB(10, lt_y+8 , 0x80, sc.work_text, "From:"); |
403 | WriteText (45, lt_y+8 , 0x80, sc.work_text, #from); |
403 | WriteText (45, lt_y+8 , 0x80, sc.work_text, #from); |
404 | WriteTextB(10, lt_y+20, 0x80, sc.work_text, "To:"); |
404 | WriteTextB(10, lt_y+20, 0x80, sc.work_text, "To:"); |
405 | WriteText (45, lt_y+20, 0x80, sc.work_text, #to); |
405 | WriteText (45, lt_y+20, 0x80, sc.work_text, #to); |
406 | WriteTextB(10, lt_y+32, 0x80, sc.work_text, "Date:"); |
406 | WriteTextB(10, lt_y+32, 0x80, sc.work_text, "Date:"); |
407 | WriteText (45, lt_y+32, 0x80, sc.work_text, #date); |
407 | WriteText (45, lt_y+32, 0x80, sc.work_text, #date); |
408 | WriteTextB(10, lt_y+44, 0x80, sc.work_text, "Subject:"); |
408 | WriteTextB(10, lt_y+44, 0x80, sc.work_text, "Subject:"); |
409 | WriteText (66, lt_y+44, 0x80, sc.work_text, #subj); |
409 | WriteText (66, lt_y+44, 0x80, sc.work_text, #subj); |
410 | } |
410 | } |
411 | 411 | ||
412 | void DrawLetter() |
412 | void DrawLetter() |
413 | { |
413 | { |
414 | int i=0; |
414 | int i=0; |
415 | dword cur_line, next_line, line_text; |
415 | dword cur_line, next_line, line_text; |
416 | cur_line = mdata; |
416 | cur_line = mdata; |
417 | 417 | ||
418 | letter_view.SetSizes(0, mail_list.y+mail_list.h+LIST_INFO_H+1, Form.cwidth - scroll2.size_x - 1, |
418 | letter_view.SetSizes(0, mail_list.y+mail_list.h+LIST_INFO_H+1, Form.cwidth - scroll2.size_x - 1, |
419 | Form.cheight - mail_list.y - mail_list.h - LIST_INFO_H - 1 - status_bar_h, 60, 12); |
419 | Form.cheight - mail_list.y - mail_list.h - LIST_INFO_H - 1 - status_bar_h, 60, 12); |
420 | 420 | ||
421 | if (mailbuffer) && (!aim) |
421 | if (mailbuffer) && (!aim) |
422 | { |
422 | { |
423 | for ( ; i < letter_view.first; i++) cur_line = GetNextLine(cur_line); |
423 | for ( ; i < letter_view.first; i++) cur_line = GetNextLine(cur_line); |
424 | 424 | ||
425 | for (i=0; i < letter_view.h / letter_view.line_h; i++) |
425 | for (i=0; i < letter_view.h / letter_view.line_h; i++) |
426 | { |
426 | { |
427 | next_line = GetNextLine(cur_line); |
427 | next_line = GetNextLine(cur_line); |
428 | line_text = CopyBetweenOffsets(cur_line, next_line); |
428 | line_text = CopyBetweenOffsets(cur_line, next_line); |
429 | cur_line = next_line; |
429 | cur_line = next_line; |
430 | if (cur_line >= mailpointer) || (cur_line==1) break; |
430 | if (cur_line >= mailpointer) || (cur_line==1) break; |
431 | DrawBar(letter_view.x, i*letter_view.line_h + letter_view.y, letter_view.w, letter_view.line_h, 0xFFFfff); |
431 | DrawBar(letter_view.x, i*letter_view.line_h + letter_view.y, letter_view.w, letter_view.line_h, 0xFFFfff); |
432 | if (line_text) { WriteText(letter_view.x+5, i*letter_view.line_h+letter_view.y+3, 0x80, 0, line_text); free(line_text);} |
432 | if (line_text) { WriteText(letter_view.x+5, i*letter_view.line_h+letter_view.y+3, 0x80, 0, line_text); free(line_text);} |
433 | } |
433 | } |
434 | } |
434 | } |
435 | DrawBar(letter_view.x, i*letter_view.line_h + letter_view.y, letter_view.w, -i*letter_view.line_h + letter_view.h-1, 0xFFFfff); |
435 | DrawBar(letter_view.x, i*letter_view.line_h + letter_view.y, letter_view.w, -i*letter_view.line_h + letter_view.h-1, 0xFFFfff); |
436 | DrawBar(letter_view.x, letter_view.y + letter_view.h-1, letter_view.w, 1, sc.work_graph); |
436 | DrawBar(letter_view.x, letter_view.y + letter_view.h-1, letter_view.w, 1, sc.work_graph); |
437 | DrawScroller2(); |
437 | DrawScroller2(); |
438 | } |
438 | } |
439 | 439 | ||
440 | void DrawScroller1() |
440 | void DrawScroller1() |
441 | { |
441 | { |
442 | scroll1.max_area = mail_list.count; |
442 | scroll1.max_area = mail_list.count; |
443 | scroll1.cur_area = mail_list.visible; |
443 | scroll1.cur_area = mail_list.visible; |
444 | scroll1.position = mail_list.first; |
444 | scroll1.position = mail_list.first; |
445 | 445 | ||
446 | scroll1.all_redraw=1; |
446 | scroll1.all_redraw=1; |
447 | scroll1.start_x = mail_list.x + mail_list.w; |
447 | scroll1.start_x = mail_list.x + mail_list.w; |
448 | scroll1.start_y = mail_list.y - 3; |
448 | scroll1.start_y = mail_list.y - 3; |
449 | scroll1.size_y = mail_list.h + 4; |
449 | scroll1.size_y = mail_list.h + 4; |
450 | scrollbar_v_draw(#scroll1); |
450 | scrollbar_v_draw(#scroll1); |
451 | } |
451 | } |
452 | 452 | ||
453 | void DrawScroller2() |
453 | void DrawScroller2() |
454 | { |
454 | { |
455 | scroll2.max_area = letter_view.count; |
455 | scroll2.max_area = letter_view.count; |
456 | scroll2.cur_area = letter_view.visible; |
456 | scroll2.cur_area = letter_view.visible; |
457 | scroll2.position = letter_view.first; |
457 | scroll2.position = letter_view.first; |
458 | 458 | ||
459 | scroll2.all_redraw=1; |
459 | scroll2.all_redraw=1; |
460 | scroll2.start_x = letter_view.x + letter_view.w; |
460 | scroll2.start_x = letter_view.x + letter_view.w; |
461 | scroll2.start_y = letter_view.y - 3; |
461 | scroll2.start_y = letter_view.y - 3; |
462 | scroll2.size_y = letter_view.h + 3; |
462 | scroll2.size_y = letter_view.h + 3; |
463 | scrollbar_v_draw(#scroll2); |
463 | scrollbar_v_draw(#scroll2); |
464 | } |
464 | } |
465 | 465 | ||
466 | 466 | ||
467 | 467 | ||
468 | void DrawStatusBar() |
468 | void DrawStatusBar() |
469 | { |
469 | { |
470 | int st_y = Form.cheight -status_bar_h; |
470 | int st_y = Form.cheight -status_bar_h; |
471 | DrawBar(0, st_y, Form.cwidth, status_bar_h, sc.work); |
471 | DrawBar(0, st_y, Form.cwidth, status_bar_h, sc.work); |
472 | if (aim) { |
472 | if (aim) { |
473 | SetMailBoxStatus(cur_st_percent, cur_st_text); |
473 | SetMailBoxStatus(cur_st_percent, cur_st_text); |
474 | DrawCaptButton(240, st_y+1, 36, status_bar_h-3, STOP_LOADING, sc.work_button, sc.work_button_text,"Stop"); |
474 | DrawCaptButton(240, st_y+1, 36, status_bar_h-3, STOP_LOADING, sc.work_button, sc.work_button_text,"Stop"); |
475 | } |
475 | } |
476 | DrawCaptButton(Form.cwidth - 100, st_y+1, 70, status_bar_h-2, CHANGE_CHARSET+BT_HIDE, sc.work, sc.work_text,charsets[cur_charset]); |
476 | DrawCaptButton(Form.cwidth - 100, st_y+1, 70, status_bar_h-2, CHANGE_CHARSET+BT_HIDE, sc.work, sc.work_text,charsets[cur_charset]); |
477 | } |
477 | } |
478 | 478 | ||
479 | 479 | ||
480 | 480 | ||
481 | void SetMailBoxStatus(dword percent1, text1) |
481 | void SetMailBoxStatus(dword percent1, text1) |
482 | { |
482 | { |
483 | DrawProgressBar(3, Form.cheight -status_bar_h + 1, 220, 12, sc.work, 0xC3C3C3, 0x54B1D6, sc.work_text, percent1, text1); |
483 | DrawProgressBar(3, Form.cheight -status_bar_h + 1, 220, 12, sc.work, 0xC3C3C3, 0x54B1D6, sc.work_text, percent1, text1); |
484 | cur_st_percent = percent1; |
484 | cur_st_percent = percent1; |
485 | cur_st_text = text1; |
485 | cur_st_text = text1; |
486 | } |
486 | } |
487 | 487 | ||
488 | 488 | ||
489 | void StopLoading() |
489 | void StopLoading() |
490 | { |
490 | { |
491 | aim = NULL; |
491 | aim = NULL; |
492 | mailbuffer = free(mailbuffer); |
492 | mailbuffer = free(mailbuffer); |
493 | to = from = date = subj = cur_charset = NULL; |
493 | to = from = date = subj = cur_charset = NULL; |
494 | while (PollSocket(socket)) ReadSocket(socket); |
494 | while (PollSocket(socket)) ReadSocket(socket); |
495 | } |
495 | } |
496 | 496 | ||
497 | int GetMailCount(){ |
497 | int GetMailCount(){ |
498 | char tmpbuf4[512]; |
498 | char tmpbuf4[512]; |
499 | strcpyb(#immbuffer, #tmpbuf4, "+OK ", " "); |
499 | strcpyb(#immbuffer, #tmpbuf4, "+OK ", " "); |
500 | return atoi(#tmpbuf4); |
500 | return atoi(#tmpbuf4); |
501 | } |
501 | } |
502 | 502 | ||
503 | 503 | ||
504 | 504 | ||
505 | 505 | ||
506 | 506 | ||
507 | 507 | ||
508 | 508 | ||
509 | 509 | ||
510 | void listputc(char agot_char){ |
510 | void listputc(char agot_char){ |
511 | *listpointer=agot_char; |
511 | *listpointer=agot_char; |
512 | listpointer++; |
512 | listpointer++; |
513 | *listpointer='\0'; |
513 | *listpointer='\0'; |
514 | } |
514 | } |
515 | 515 | ||
516 | int GetLetterSize_(int number){ |
516 | int GetLetterSize_(int number){ |
517 | char serch_num[24]; |
517 | char serch_num[24]; |
518 | char letter_size1[24]; |
518 | char letter_size1[24]; |
519 | strcpy(#serch_num, "\n"); |
519 | strcpy(#serch_num, "\n"); |
520 | strcat(#serch_num, itoa(number)); |
520 | strcat(#serch_num, itoa(number)); |
521 | strcat(#serch_num, " "); |
521 | strcat(#serch_num, " "); |
522 | strcpyb(listbuffer, #letter_size1, #serch_num, "\n"); |
522 | strcpyb(listbuffer, #letter_size1, #serch_num, "\n"); |
523 | return atoi(#letter_size1); |
523 | return atoi(#letter_size1); |
524 | } |
524 | } |
525 | 525 | ||
526 | 526 | ||
527 | 527 | ||
528 | 528 | ||
529 | void letter_attr::CreateArray() |
529 | void letter_attr::CreateArray() |
530 | { |
530 | { |
531 | mails_db = free(mails_db); |
531 | mails_db = free(mails_db); |
532 | mails_db = malloc( mail_list.count * sizeof(atr) ); |
532 | mails_db = malloc( mail_list.count * sizeof(atr) ); |
533 | } |
533 | } |
534 | 534 | ||
535 | void letter_attr::SetSizes() |
535 | void letter_attr::SetSizes() |
536 | { |
536 | { |
537 | int i; |
537 | int i; |
538 | for (i=0; i < mail_list.count; i++) |
538 | for (i=0; i < mail_list.count; i++) |
539 | { |
539 | { |
540 | ESDWORD[sizeof(atr)*i+#mails_db+#atr.size-#atr] = GetLetterSize_(i); |
540 | ESDWORD[sizeof(atr)*i+#mails_db+#atr.size-#atr] = GetLetterSize_(i); |
541 | ESDWORD[sizeof(atr)*i+#mails_db+#atr.subject-#atr] = ' '; |
541 | ESDWORD[sizeof(atr)*i+#mails_db+#atr.subject-#atr] = ' '; |
542 | ESDWORD[sizeof(atr)*i+#mails_db+#atr.subject-#atr+1] = '\0'; |
542 | ESDWORD[sizeof(atr)*i+#mails_db+#atr.subject-#atr+1] = '\0'; |
543 | } |
543 | } |
544 | } |
544 | } |
545 | 545 | ||
546 | void letter_attr::SetAtrFromCurr(int N) |
546 | void letter_attr::SetAtrFromCurr(int N) |
547 | { |
547 | { |
548 | byte mail_direction=0; |
548 | byte mail_direction=0; |
549 | if (strstri(#to, #email_text)) |
549 | if (strstri(#to, #email_text)) |
550 | { |
550 | { |
551 | mail_direction = 1; |
551 | mail_direction = 1; |
552 | strcpy(sizeof(atr)*N+#mails_db+#atr.adress-#atr, #from); |
552 | strcpy(sizeof(atr)*N+#mails_db+#atr.adress-#atr, #from); |
553 | } |
553 | } |
554 | if (strstri(#from, #email_text)) |
554 | if (strstri(#from, #email_text)) |
555 | { |
555 | { |
556 | mail_direction = 2; |
556 | mail_direction = 2; |
557 | strcpy(sizeof(atr)*N+#mails_db+#atr.adress-#atr, #to); |
557 | strcpy(sizeof(atr)*N+#mails_db+#atr.adress-#atr, #to); |
558 | } |
558 | } |
559 | ESBYTE[sizeof(atr)*N+#mails_db+#atr.direction-#atr] = mail_direction; |
559 | ESBYTE[sizeof(atr)*N+#mails_db+#atr.direction-#atr] = mail_direction; |
560 | strcpy(sizeof(atr)*N+#mails_db+#atr.subject-#atr, #subj); |
560 | strcpy(sizeof(atr)*N+#mails_db+#atr.subject-#atr, #subj); |
561 | } |
561 | } |
562 | 562 | ||
563 | int letter_attr::GetSize(int N) { return ESDWORD[sizeof(atr)*N+#mails_db+#atr.size-#atr]; } |
563 | int letter_attr::GetSize(int N) { return ESDWORD[sizeof(atr)*N+#mails_db+#atr.size-#atr]; } |
564 | char letter_attr::GetDirection(int N) { return ESBYTE[sizeof(atr)*N+#mails_db+#atr.direction-#atr]; } |
564 | char letter_attr::GetDirection(int N) { return ESBYTE[sizeof(atr)*N+#mails_db+#atr.direction-#atr]; } |
565 | dword letter_attr::GetSubject(int N) { return sizeof(atr)*N+#mails_db+#atr.subject-#atr; } |
565 | dword letter_attr::GetSubject(int N) { return sizeof(atr)*N+#mails_db+#atr.subject-#atr; } |
566 | dword letter_attr::GetAdress(int N) { return sizeof(atr)*N+#mails_db+#atr.adress-#atr; }>>>150;>>>>=0)>5;>>> |
566 | dword letter_attr::GetAdress(int N) { return sizeof(atr)*N+#mails_db+#atr.adress-#atr; }>>>150;>>>>=0)>5;>>> |
567 | > |
567 | > |