Subversion Repositories Kolibri OS

Rev

Rev 7660 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7660 leency 1
#define MEMSIZE 1024*160
4113 leency 2
 
7660 leency 3
#include "../lib/io.h"
4
#include "../lib/gui.h"
5
#include "../lib/copyf.h"
7661 leency 6
 
7660 leency 7
#include "../lib/obj/libini.h"
7661 leency 8
#include "../lib/obj/libio.h"
9
#include "../lib/obj/libimg.h"
10
 
7660 leency 11
#include "../lib/patterns/restart_process.h"
7654 leency 12
 
7661 leency 13
#ifndef AUTOBUILD
14
#include "lang.h--"
15
#endif
16
 
7660 leency 17
char logo[] = "
18
лллл   лллл лллллллллл лллл   лллл ллллллллллл
19
 лллл   лл   ллл         ллл ллл   лл  ллл  лл
20
 ллллл  лл   ллл          ллллл    лл  ллл  лл
21
 лл ллл лл   ллллллл       ллл         ллл
22
 лл  ллллл   ллл          ллллл        ллл
23
 лл   лллл   ллл         ллл ллл       ллл
24
лллл   ллл  лллллллллл лллл   лллл    ллллл
25
";
5548 leency 26
 
7661 leency 27
#ifdef LANG_RUS
28
#define T_INTRO "ЎЏрЎЁуЉтЅ ­ЎЂЎЅ ЂЈЇу Ћь­ЎЅ ЎфЎрЌЋЅ­ЈЅ ŠЎЋЈЁрЈ, ЊЎтЎрЎЅ р ­ьшЅ ЁыЋЎ ЄЎстуЏ­Ў тЎЋьЊЎ Ђ KolibriNext.";
29
#define T_INSTALL "“ст ­ЎЂЈть"
30
#define T_COMPLETE "“ст ­ЎЂЊ  Ї ЂЅршЅ­ "
31
#define T_EXIT "‚ыхЎЄ"
32
#else
33
#define T_INTRO "Try a new visual design of KolibriOS, which previously was available only in KolibriNext.";
34
#define T_INSTALL "Install"
35
#define T_COMPLETE "Install complete"
36
#define T_EXIT "Exit"
37
#endif
7660 leency 38
 
39
#define B_INSTALL 10
40
 
7661 leency 41
bool install_complete = false;
42
 
4113 leency 43
void main()
44
{
7660 leency 45
	word btn;
46
	load_dll(libini, #lib_init,1);
7661 leency 47
	load_dll(libio, #libio_init,1);
48
	load_dll(libimg, #libimg_init,1);
7660 leency 49
	loop() switch(WaitEventTimeout(300) & 0xFF)
50
	{
51
		case evButton:
52
			btn = GetButtonID();
53
			if (btn == 1) ExitProcess();
54
			if (btn == B_INSTALL) EventInstall();
55
			break;
56
 
57
		case evKey:
58
			GetKeys();
59
			if (key_scancode == SCAN_CODE_ESC) ExitProcess();
7661 leency 60
			if (key_scancode == SCAN_CODE_ENTER) {
61
				if (install_complete) ExitProcess();
62
				else EventInstall();
63
			}
7660 leency 64
			break;
65
 
66
		case evReDraw:
67
			draw_window();
68
			break;
69
 
70
		default:
71
			DrawLogo();
72
			DrawLogo();
73
	}
74
}
75
 
76
#define WINW 400
77
#define WINH 300
78
void draw_window()
79
{
80
	system.color.get();
81
	DefineAndDrawWindow(screen.width-WINW/2,screen.height-WINH/2,
82
		WINW+9,WINH+skin_height,0x34,system.color.work,"KolibriN10",0);
83
	DrawLogo();
7661 leency 84
	if (install_complete) DrawInstallComplete(); else DrawIntro();
85
}
7660 leency 86
 
7661 leency 87
void DrawIntro()
88
{
7660 leency 89
	DrawTextViewArea(30, 140, WINW-60, WINH-80,
7661 leency 90
		T_INTRO, -1, system.color.work_text);
7660 leency 91
	DrawCaptButton(WINW-110/2, WINH-70, 110, 28, B_INSTALL,
7661 leency 92
		0x0092D8, 0xFFFfff, T_INSTALL);
7660 leency 93
}
94
 
7661 leency 95
void DrawInstallComplete()
96
{
97
	DrawIcon32(WINW-32/2, 140, system.color.work, 49);
98
	WriteTextCenter(0,185, WINW, system.color.work_text, T_COMPLETE);
99
	DrawCaptButton(WINW-110/2, WINH-70, 110, 28, CLOSE_BTN,
100
		0x0092D8, 0xFFFfff, T_EXIT);
101
}
102
 
7660 leency 103
void DrawLogo()
104
{
105
	#define LX -46*6+WINW/2
106
	#define LY 25
7661 leency 107
	WriteTextLines(LX-2, LY, 0x80, 0xF497C0, #logo, 9);
7660 leency 108
	WriteTextLines(LX+3, LY, 0x80, 0x7ED1E3, #logo, 9);
109
 
110
	pause(1);
111
 
112
	WriteTextLines(LX+1, LY, 0x80, 0xEC008C, #logo, 9);
113
	WriteTextLines(LX,   LY, 0x80, 0xEC008C, #logo, 9);
114
}
115
 
116
void EventInstall()
117
{
7654 leency 118
	//#include "..\lib\added_sysdir.c";
7422 leency 119
	//SetAdditionalSystemDirectory("kolibrios", abspath("install/kolibrios")+1);
7654 leency 120
	ini_set_int stdcall ("/sys/settings/taskbar.ini", "Flags", "Attachment", 0);
7660 leency 121
	copyf("/kolibrios/KolibriNext/settings", "/sys/settings");
5651 pavelyakov 122
 
7654 leency 123
	RestartProcessByName("/sys/@icon", MULTIPLE);
124
	RestartProcessByName("/sys/@taskbar", SINGLE);
125
	RestartProcessByName("/sys/@docky", SINGLE);
7422 leency 126
 
7654 leency 127
	RunProgram("/sys/media/kiv", "\\S__/kolibrios/res/Wallpapers/Free yourself.jpg");
7661 leency 128
 
129
	install_complete = true;
130
	draw_window();
4113 leency 131
}
132
 
7660 leency 133
void Operation_Draw_Progress(dword filename) { debug("copying: "); debugln(filename); }