Subversion Repositories Kolibri OS

Rev

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