Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6652 → Rev 6653

/programs/cmm/drvinst/drvinst.c
1,5 → 1,24
#define MEMSIZE 4096*10
#define MEMSIZE 4096*20
 
//===================================================//
// //
// LIB //
// //
//===================================================//
 
#include "../lib/gui.h"
#include "../lib/list_box.h"
#include "../lib/obj/box_lib.h"
#include "../lib/obj/libio_lib.h"
#include "../lib/obj/libini.h"
#include "../lib/patterns/select_list.h"
 
//===================================================//
// //
// DATA //
// //
//===================================================//
 
proc_info Form;
 
#define WINDOW_TITLE "Driver Installer"
18,32 → 37,59
#define WINDOW_STEP_DRIVER_LIST 2;
char window_step = WINDOW_STEP_INTRO;
 
//===================================================//
// //
// CODE //
// //
//===================================================//
 
void GetIniData()
{
ini_enum_sections stdcall ("/sys/drvinf.ini", #process_sections);
}
 
byte process_sections(dword sec_name, f_name)
{
ini_enum_keys stdcall (f_name, sec_name, #process_keys);
return true;
}
 
byte process_keys(dword key_value, key_name, sec_name, f_name)
{
debugln(key_value);
return true;
}
 
void main()
{
word id;
int id;
load_dll(libio, #libio_init,1);
load_dll(libini, #lib_init,1);
load_dll(boxlib, #box_lib_init,0);
//GetIniData();
SetEventMask(0x27);
loop() switch(WaitEvent())
{
case evMouse:
if (!CheckActiveProcess(Form.ID)) return;
SelectList_ProcessMouse();
break;
 
case evButton:
id=GetButtonID();
if (id==1) ExitProcess();
if (id==BUTTON_ID_ASSEPT_RISK) {
window_step = WINDOW_STEP_DRIVER_LIST;
goto _EV_WINDOW_REDRAW;
}
if (id==BUTTON_ID_ASSEPT_RISK) Event_AsseptRisk();
if (id==BUTTON_ID_README) Event_ShowReadme();
if (id==BUTTON_ID_INSTALL) Event_RunInstall();
break;
case evKey:
GetKeys();
if (select_list.ProcessKey(key_scancode)) SelectList_LineChanged();
break;
case evReDraw:
_EV_WINDOW_REDRAW:
system.color.get();
DefineAndDrawWindow(215, 100, 550, 350, 0x33, system.color.work, WINDOW_TITLE);
GetProcessInfo(#Form, SelfInfo);
if (window_step == WINDOW_STEP_INTRO) draw_intro_window();
if (window_step == WINDOW_STEP_DRIVER_LIST) draw_driver_list_window();
break;
Event_DrawWindow();
}
}
 
64,15 → 110,74
{
int PADDING = 12;
int right_frame_x = Form.cwidth/2 + PADDING + calc(PADDING/2);
incn y;
y.n = PADDING + 3;
//LEFT FRAME
DrawBar(PADDING, PADDING, Form.cwidth/2 - PADDING, Form.cheight - PADDING - PADDING, 0xEEEeee);
select_list.count = 4;
SelectList_Init(PADDING,
PADDING,
Form.cwidth/2 - PADDING - scroll1.size_x,
Form.cheight - PADDING - PADDING,
false);
SelectList_Draw();
//RIGHT FRAME
WriteTextB(right_frame_x, y.n, 0x81, system.color.work_text, "ATI KMS");
WriteText(right_frame_x, y.inc(20), 0x80, MixColors(system.color.work, 0xCCCccc,80), "ver 4.4");
DrawTextViewArea(right_frame_x-2, y.inc(30), Form.cwidth - right_frame_x - PADDING, Form.cheight-100,
WriteTextB(right_frame_x, PADDING+3, 0x81, system.color.work_text, "ATI KMS");
WriteText(right_frame_x, PADDING+23, 0x80, MixColors(system.color.work, system.color.work_text,120), "ver 4.4");
DrawTextViewArea(right_frame_x-2, PADDING+53, Form.cwidth - right_frame_x - PADDING, Form.cheight-100,
T_CAUTION_PARAGRAPH, -1, system.color.work_text);
right_frame_x += DrawStandartCaptButton(right_frame_x, Form.cheight-40, BUTTON_ID_README, T_README);
DrawStandartCaptButton(right_frame_x, Form.cheight-40, BUTTON_ID_INSTALL, T_INSTALL);
}
 
void SelectList_DrawLine(dword i)
{
int yyy, list_last;
 
yyy = i*select_list.item_h+select_list.y;
if (select_list.cur_y-select_list.first==i)
{
DrawBar(select_list.x, yyy, select_list.w, select_list.item_h, system.color.work_button);
WriteText(select_list.x+12,yyy+select_list.text_y,select_list.font_type,system.color.work_button_text, "Hello");
}
else
{
DrawBar(select_list.x,yyy,select_list.w, select_list.item_h, 0xFFFfff);
WriteText(select_list.x+12,yyy+select_list.text_y,select_list.font_type,0, "Hello");
}
}
 
void SelectList_LineChanged()
{
SelectList_Draw();
}
 
//===================================================//
// //
// EVENTS //
// //
//===================================================//
 
void Event_DrawWindow()
{
system.color.get();
DefineAndDrawWindow(215, 100, 600, 400, 0x33, system.color.work, WINDOW_TITLE);
GetProcessInfo(#Form, SelfInfo);
if (window_step == WINDOW_STEP_INTRO) draw_intro_window();
if (window_step == WINDOW_STEP_DRIVER_LIST) draw_driver_list_window();
return;
}
 
void Event_AsseptRisk()
{
window_step = WINDOW_STEP_DRIVER_LIST;
Event_DrawWindow();
}
 
void Event_ShowReadme()
{
return;
}
 
void Event_RunInstall()
{
return;
}