Subversion Repositories Kolibri OS

Rev

Rev 4417 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4417 Rev 4509
Line 1... Line 1...
1
//Leency & SoUrcerer, LGPL
1
//Leency & SoUrcerer, LGPL
Line 2... Line 2...
2
 
2
 
3
//libraries
3
//libraries
4
#define MEMSIZE 0xA0000
4
#define MEMSIZE 0x100000
5
#include "../lib/kolibri.h"
5
#include "../lib/kolibri.h"
6
#include "../lib/strings.h"
6
#include "../lib/strings.h"
7
#include "../lib/mem.h"
7
#include "../lib/mem.h"
8
#include "../lib/dll.h"
8
#include "../lib/dll.h"
9
#include "../lib/encoding.h"
9
#include "../lib/encoding.h"
10
#include "../lib/figures.h"
10
#include "../lib/figures.h"
11
#include "../lib/file_system.h"
11
#include "../lib/file_system.h"
12
#include "../lib/list_box.h"
12
#include "../lib/list_box.h"
-
 
13
#include "../lib/socket_new.h"
-
 
14
#include "../lib/draw_buf.h"
13
#include "../lib/socket_new.h"
15
#include "../lib/cursor.h"
14
//*.obj libraries
16
//*.obj libraries
15
#include "../lib/lib.obj/box_lib.h"
17
#include "../lib/lib.obj/box_lib.h"
16
#include "../lib/lib.obj/network.h"
18
#include "../lib/lib.obj/network.h"
17
#include "../lib/lib.obj/libio_lib.h"
19
#include "../lib/lib.obj/libio_lib.h"
Line 75... Line 77...
75
char immbuffer[BUFFERSIZE];
77
char immbuffer[BUFFERSIZE];
Line 76... Line 78...
76
 
78
 
77
llist mail_list;
79
llist mail_list;
Line -... Line 80...
-
 
80
llist letter_view;
-
 
81
 
-
 
82
char version[]=" WebView 0.1";
78
llist letter_view;
83
#include "..\TWB\TWB.c"
79
 
84
 
80
#include "settings.c"
85
#include "settings.c"
81
#include "login.c"
86
#include "login.c"
82
#include "letter_attr.c"
87
#include "letter_attr.c"
Line 83... Line -...
83
#include "mail_box.c"
-
 
84
#include "parselist.c"
-
 
85
 
-
 
86
 
-
 
87
 
-
 
88
/* TWB integration */
-
 
89
char version[]=" WebView 0.1";
88
#include "mail_box.c"
90
#include "../TWB/TWB.c"
-
 
91
 
89
#include "parselist.c"
-
 
90
 
92
void main()
91
void main() {
93
{
92
	mem_Init();
94
	mem_Init();
93
	CursorPointer.Load(#CursorFile);
95
	if (load_dll2(boxlib, #box_lib_init,0)!=0)	        notify("Error while loading library /rd/1/lib/box_lib.obj");
94
	if (load_dll2(boxlib, #box_lib_init,0)!=0)	        notify("Error while loading library - box_lib.obj");
96
	if (load_dll2(network_lib, #network_lib_init,0)!=0)	notify("Error while loading library /rd/1/lib/network.obj");
-
 
-
 
95
	if (load_dll2(network_lib, #network_lib_init,0)!=0)	notify("Error while loading library - network.obj");
-
 
96
	if (load_dll2(netcode_lib, #base64_encode,0)!=0)	notify("Error while loading library - netcode.obj");
97
	if (load_dll2(netcode_lib, #base64_encode,0)!=0)	notify("Error while loading library /rd/1/lib/netcode.obj");
97
	if (load_dll2(iconv_lib, #iconv_open,0)!=0)	      { notify("Error while loading library - iconv.obj"); use_iconv=2; }
98
	if (load_dll2(iconv_lib, #iconv_open,0)!=0)	      { notify("Error while loading library /rd/1/lib/iconv.obj"); use_iconv=2; }
98
	if (load_dll2(libio, #libio_init,1)!=0)             notify("Error while loading library - libio.obj");
99
 
99
	if (load_dll2(libimg, #libimg_init,1)!=0)           notify("Error while loading library - libimg.obj");
100
	OpenMailDat();
100
	OpenMailDat();
Line 101... Line 101...
101
	SetEventMask(0x27);
101
	SetEventMask(0x27);
102
	LoginBoxLoop();
-
 
103
}
102
	LoginBoxLoop();
104
 
103
}
105
 
104
 
106
int DefineWindow(dword wtitle)
105
 
107
{
106
int DefineWindow(dword wtitle) {
Line 114... Line 113...
114
	if (Form.height < WIN_MIN_H) MoveSize(OLD,OLD,OLD,WIN_MIN_H);
113
	if (Form.height < WIN_MIN_H) MoveSize(OLD,OLD,OLD,WIN_MIN_H);
115
	return 1;
114
	return 1;
116
}
115
}
Line 117... Line 116...
117
 
116
 
118
 
-
 
119
void OpenMailDat()
117
 
120
{
118
void OpenMailDat() {
121
	char read_data[512], pass_b64[256];
119
	char read_data[512], pass_b64[256];
122
	ReadFile(0, 512, #read_data, "/sys/network/mail.dat");
120
	ReadFile(0, 512, #read_data, "/sys/network/mail.dat");
123
	if (!read_data)
121
	if (!read_data)
Line 134... Line 132...
134
	}
132
	}
135
	pass_box.size = pass_box.pos = strlen(#pass_text);
133
	pass_box.size = pass_box.pos = strlen(#pass_text);
136
	login_box.size = login_box.pos = strlen(#email_text);
134
	login_box.size = login_box.pos = strlen(#email_text);
137
}
135
}
Line 138... Line 136...
138
 
136
 
139
void SaveAndExit()
-
 
140
{
137
void SaveAndExit() {
141
	char write_data[512], pass_b64[256];
138
	char write_data[512], pass_b64[256];
142
	Close(socketnum);
139
	Close(socketnum);
143
	strcpy(#write_data, #email_text);
140
	strcpy(#write_data, #email_text);
144
	chrcat(#write_data, '\n');
141
	chrcat(#write_data, '\n');
Line 147... Line 144...
147
	WriteFile(strlen(#write_data)+1, #write_data, "/sys/network/mail.dat");
144
	WriteFile(strlen(#write_data)+1, #write_data, "/sys/network/mail.dat");
148
	ExitProcess();
145
	ExitProcess();
149
}
146
}
Line 150... Line 147...
150
 
147
 
151
 
-
 
152
int GetRequest(dword command, text)
148
 
153
{
149
int GetRequest(dword command, text) {
154
	strcpy(#request, command);
150
	strcpy(#request, command);
155
	if (text)
151
	if (text)
156
	{
152
	{
157
		chrcat(#request, ' ');
153
		chrcat(#request, ' ');
158
		strcat(#request, text);
154
		strcat(#request, text);
159
	}
155
	}
160
	strcat(#request, "\n");
156
	strcat(#request, "\n");
Line 161... Line 157...
161
	return strlen(#request);
157
	return strlen(#request);
162
}
-
 
163
 
158
}
164
void StopConnect(dword message)
159
 
165
{
160
void StopConnect(dword message) {
166
	if (message) notify(message);
161
	if (message) notify(message);