forked from KolibriOS/kolibrios
CMM: general refactoring
git-svn-id: svn://kolibrios.org@7227 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
83b61f94d2
commit
1392a1c519
@ -351,7 +351,7 @@ void EventRunEdit()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//io.write(strlen(io.buffer_data), io.buffer_data, DEFAULT_PREVIEW_PATH); // <--- doesn't work, smth odd, need to check
|
//io.write(strlen(io.buffer_data), io.buffer_data, DEFAULT_PREVIEW_PATH); // <--- doesn't work, smth odd, need to check
|
||||||
WriteFile(strlen(io.buffer_data), io.buffer_data, DEFAULT_PREVIEW_PATH);
|
CreateFile(strlen(io.buffer_data), io.buffer_data, DEFAULT_PREVIEW_PATH);
|
||||||
io.run(DEFAULT_EDITOR, DEFAULT_PREVIEW_PATH);
|
io.run(DEFAULT_EDITOR, DEFAULT_PREVIEW_PATH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,10 @@ char app_name[] = "KingsBounty";
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
if (dir_exists("/kolibrios")==false) {
|
if (dir_exists("/kolibrios")==false)
|
||||||
die(
|
die("'/kolibrios/ folder is not mounted!
|
||||||
"'/kolibrios/ folder is not mounted!\nPlease run APP+ on desktop.\nYou must use ISO distro.'E");
|
Please run APP+ on desktop.
|
||||||
}
|
You must use ISO distro.'E");
|
||||||
|
|
||||||
CreateDir("/tmp0/1/DOS");
|
CreateDir("/tmp0/1/DOS");
|
||||||
CreateDir(sprintf(#param, "/tmp0/1/DOS/%s", #app_name));
|
CreateDir(sprintf(#param, "/tmp0/1/DOS/%s", #app_name));
|
||||||
@ -29,32 +29,7 @@ if (EAX!=0) {
|
|||||||
die("'/tmp0/1/ is not mounted!\nPlease run TMPDISK to add it.'E");
|
die("'/tmp0/1/ is not mounted!\nPlease run TMPDISK to add it.'E");
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteFile(sizeof(file0), #file0, makepath("/tmp0/1/DOS/", FILE_NAME_0));
|
CreateFile(sizeof(file0), #file0, makepath("/tmp0/1/DOS/", FILE_NAME_0));
|
||||||
WriteFile(sizeof(file1), #file1, makepath("/tmp0/1/DOS/", FILE_NAME_1));
|
|
||||||
#ifdef FILE_NAME_2
|
|
||||||
WriteFile(sizeof(file2), #file2, makepath("/tmp0/1/DOS/", FILE_NAME_2));
|
|
||||||
#endif
|
|
||||||
#ifdef FILE_NAME_3
|
|
||||||
WriteFile(sizeof(file3), #file3, makepath("/tmp0/1/DOS/", FILE_NAME_3));
|
|
||||||
#endif
|
|
||||||
#ifdef FILE_NAME_4
|
|
||||||
WriteFile(sizeof(file4), #file4, makepath("/tmp0/1/DOS/", FILE_NAME_4));
|
|
||||||
#endif
|
|
||||||
#ifdef FILE_NAME_5
|
|
||||||
WriteFile(sizeof(file5), #file5, makepath("/tmp0/1/DOS/", FILE_NAME_5));
|
|
||||||
#endif
|
|
||||||
#ifdef FILE_NAME_6
|
|
||||||
WriteFile(sizeof(file6), #file6, makepath("/tmp0/1/DOS/", FILE_NAME_6));
|
|
||||||
#endif
|
|
||||||
#ifdef FILE_NAME_7
|
|
||||||
WriteFile(sizeof(file7), #file7, makepath("/tmp0/1/DOS/", FILE_NAME_7));
|
|
||||||
#endif
|
|
||||||
#ifdef FILE_NAME_8
|
|
||||||
WriteFile(sizeof(file8), #file8, makepath("/tmp0/1/DOS/", FILE_NAME_8));
|
|
||||||
#endif
|
|
||||||
#ifdef FILE_NAME_9
|
|
||||||
WriteFile(sizeof(file9), #file9, makepath("/tmp0/1/DOS/", FILE_NAME_9));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
notify(sprintf(#param, "'%s\nInstalled to /tmp0/1/DOS/\nEnjoy the game!'tO", #app_name));
|
notify(sprintf(#param, "'%s\nInstalled to /tmp0/1/DOS/\nEnjoy the game!'tO", #app_name));
|
||||||
RunProgram("/sys/@open", sprintf(#param, "/tmp0/1/DOS/%s/PLAY.sh", #app_name));
|
RunProgram("/sys/@open", sprintf(#param, "/tmp0/1/DOS/%s/PLAY.sh", #app_name));
|
||||||
|
@ -357,7 +357,7 @@ void ProcessEvent(dword id__)
|
|||||||
case EDIT_SOURCE:
|
case EDIT_SOURCE:
|
||||||
if (!strncmp(#URL,"http:",5))
|
if (!strncmp(#URL,"http:",5))
|
||||||
{
|
{
|
||||||
WriteFile(bufsize, bufpointer, "/tmp0/1/WebView_tmp.htm");
|
CreateFile(bufsize, bufpointer, "/tmp0/1/WebView_tmp.htm");
|
||||||
if (!EAX) RunProgram("/rd/1/tinypad", "/tmp0/1/WebView_tmp.htm");
|
if (!EAX) RunProgram("/rd/1/tinypad", "/tmp0/1/WebView_tmp.htm");
|
||||||
}
|
}
|
||||||
else RunProgram("/rd/1/tinypad", #URL);
|
else RunProgram("/rd/1/tinypad", #URL);
|
||||||
|
@ -99,7 +99,7 @@ void Downloader()
|
|||||||
|
|
||||||
for (i=0; i<strlen(#filepath); i++) if(filepath[i]==':')||(filepath[i]=='?')filepath[i]='-';
|
for (i=0; i<strlen(#filepath); i++) if(filepath[i]==':')||(filepath[i]=='?')filepath[i]='-';
|
||||||
|
|
||||||
if (WriteFile(downloader.data_downloaded_size, downloader.bufpointer, #filepath)==0)
|
if (CreateFile(downloader.data_downloaded_size, downloader.bufpointer, #filepath)==0)
|
||||||
sprintf(#notify_message, "%s%s%s",FILE_SAVED_AS,#filepath,"' -Dt");
|
sprintf(#notify_message, "%s%s%s",FILE_SAVED_AS,#filepath,"' -Dt");
|
||||||
else
|
else
|
||||||
sprintf(#notify_message, "%s%s%s","'Download manager\nError! Can\96t save file as ",#filepath,"' -Et");
|
sprintf(#notify_message, "%s%s%s","'Download manager\nError! Can\96t save file as ",#filepath,"' -Et");
|
||||||
|
@ -159,7 +159,7 @@ void SelectList_DrawLine(dword i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int SaveSlotContents(dword size, off) {
|
int SaveSlotContents(dword size, off) {
|
||||||
EAX = WriteFile(size, off, DEFAULT_SAVE_PATH);
|
EAX = CreateFile(size, off, DEFAULT_SAVE_PATH);
|
||||||
if (!EAX)
|
if (!EAX)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -26,7 +26,7 @@ void gui()
|
|||||||
load_dll(boxlib, #box_lib_init,0);
|
load_dll(boxlib, #box_lib_init,0);
|
||||||
load_dll(Proc_lib, #OpenDialog_init,0);
|
load_dll(Proc_lib, #OpenDialog_init,0);
|
||||||
OpenDialog_init stdcall (#o_dialog);
|
OpenDialog_init stdcall (#o_dialog);
|
||||||
SetEventMask(0x27);
|
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK);
|
||||||
|
|
||||||
loop() switch(WaitEvent())
|
loop() switch(WaitEvent())
|
||||||
{
|
{
|
||||||
|
@ -973,7 +973,7 @@ void NewElement(byte newf)
|
|||||||
case CREATE_FILE:
|
case CREATE_FILE:
|
||||||
if (info_result==5)
|
if (info_result==5)
|
||||||
{
|
{
|
||||||
WriteFile(0, 0, #temp);
|
CreateFile(0, 0, #temp);
|
||||||
if (EAX)
|
if (EAX)
|
||||||
{
|
{
|
||||||
if (EAX==5) notify(NOT_CREATE_FILE);
|
if (EAX==5) notify(NOT_CREATE_FILE);
|
||||||
|
@ -14,7 +14,7 @@ void DrawPathBar()
|
|||||||
void DrawBreadCrumbs()
|
void DrawBreadCrumbs()
|
||||||
collection_int breadCrumb;
|
collection_int breadCrumb;
|
||||||
char PathShow_path[4096];
|
char PathShow_path[4096];
|
||||||
rect btn;
|
block btn;
|
||||||
int i;
|
int i;
|
||||||
unsigned text_line, area_w;
|
unsigned text_line, area_w;
|
||||||
{
|
{
|
||||||
|
@ -39,9 +39,8 @@
|
|||||||
dword mouse_2;
|
dword mouse_2;
|
||||||
char path_to_file[4096];
|
char path_to_file[4096];
|
||||||
char file_name2[4096];
|
char file_name2[4096];
|
||||||
edit_box file_name_ed = {230,55,35,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2),#file_name2,#mouse_2, 1000000000000000b,2,2};
|
edit_box file_name_ed = {230,59,32,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2),#file_name2,#mouse_2, 1000000000000000b,2,2};
|
||||||
edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file),#path_to_file,#mouse_2, 1000000000000000b,2,2};
|
edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file),#path_to_file,#mouse_2, 1000000000000000b,2,2};
|
||||||
frame flags_frame = { 0, NULL, 10, 92, 212, 0x000111, 0xFFFfff, 1, FLAGS, 0, 1, 12, 0x000111, 0xFFFFFF };
|
|
||||||
|
|
||||||
int file_count, dir_count, size_dir;
|
int file_count, dir_count, size_dir;
|
||||||
char folder_info[200];
|
char folder_info[200];
|
||||||
@ -234,7 +233,7 @@ void properties_dialog()
|
|||||||
strcpy(#path_to_file, #path);
|
strcpy(#path_to_file, #path);
|
||||||
path_to_file_ed.size = strlen(#path_to_file);
|
path_to_file_ed.size = strlen(#path_to_file);
|
||||||
|
|
||||||
SetEventMask(0x27);
|
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
||||||
loop() switch(WaitEvent())
|
loop() switch(WaitEvent())
|
||||||
{
|
{
|
||||||
case evButton:
|
case evButton:
|
||||||
@ -325,27 +324,7 @@ void DrawPropertiesWindow()
|
|||||||
{
|
{
|
||||||
dword ext1;
|
dword ext1;
|
||||||
char temp_path[sizeof(file_path)];
|
char temp_path[sizeof(file_path)];
|
||||||
DefineAndDrawWindow(Form.left + 150,150,305,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0);
|
DefineAndDrawWindow(Form.left + 150,150,315,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0);
|
||||||
if ( !asm test path_to_file_ed.flags, 2)
|
|
||||||
{
|
|
||||||
path_to_file_ed.blur_border_color = system.color.work;
|
|
||||||
path_to_file_ed.color = system.color.work;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
path_to_file_ed.blur_border_color = 0x000000;
|
|
||||||
path_to_file_ed.color = 0xffffff;
|
|
||||||
}
|
|
||||||
if ( !asm test path_to_file_ed.flags, 2)
|
|
||||||
{
|
|
||||||
file_name_ed.blur_border_color = system.color.work;
|
|
||||||
file_name_ed.color = system.color.work;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
file_name_ed.blur_border_color = 0x000000;
|
|
||||||
file_name_ed.color = 0xffffff;
|
|
||||||
}
|
|
||||||
GetProcessInfo(#settings_form, SelfInfo);
|
GetProcessInfo(#settings_form, SelfInfo);
|
||||||
|
|
||||||
DrawFlatButton(settings_form.cwidth - 96, settings_form.cheight-34, 10, BTN_CLOSE);
|
DrawFlatButton(settings_form.cwidth - 96, settings_form.cheight-34, 10, BTN_CLOSE);
|
||||||
@ -374,8 +353,8 @@ void DrawPropertiesWindow()
|
|||||||
if (ext1) ext1 += #file_name2;
|
if (ext1) ext1 += #file_name2;
|
||||||
PropertiesDrawIcon(#temp_path, ext1);
|
PropertiesDrawIcon(#temp_path, ext1);
|
||||||
}
|
}
|
||||||
WriteText(file_name_ed.left+4, 20, 0x80, system.color.work_text, PR_T_NAME);
|
WriteText(file_name_ed.left, file_name_ed.top-15, 0x80, system.color.work_text, PR_T_NAME);
|
||||||
edit_box_draw stdcall (#file_name_ed);
|
DrawEditBox(#file_name_ed);
|
||||||
|
|
||||||
if (!itdir) element_size = file_info_general.sizelo;
|
if (!itdir) element_size = file_info_general.sizelo;
|
||||||
else
|
else
|
||||||
@ -393,25 +372,21 @@ void DrawPropertiesWindow()
|
|||||||
sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(element_size, NULL),element_size,SET_BYTE_LANG);
|
sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(element_size, NULL),element_size,SET_BYTE_LANG);
|
||||||
WriteText(120, 99, 0x90, system.color.work_text, #element_size_label);
|
WriteText(120, 99, 0x90, system.color.work_text, #element_size_label);
|
||||||
}
|
}
|
||||||
flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2;
|
DrawFrame(10, 212, -10*2 + settings_form.cwidth - 2, 92, FLAGS);
|
||||||
flags_frame.font_color = system.color.work_text;
|
|
||||||
flags_frame.ext_col = system.color.work_graph;
|
|
||||||
flags_frame.font_backgr_color = system.color.work;
|
|
||||||
frame_draw stdcall (#flags_frame);
|
|
||||||
DrawPropertiesCheckBoxes();
|
DrawPropertiesCheckBoxes();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertiesDrawIcon(dword file_path, extension)
|
void PropertiesDrawIcon(dword file_path, extension)
|
||||||
{
|
{
|
||||||
#define ICON_PADDING 10
|
#define ICON_PADDING 11
|
||||||
DrawBar(20-ICON_PADDING, 30-ICON_PADDING-1, ICON_PADDING*2+16, ICON_PADDING*2+16, system.color.work_light);
|
DrawBar(20-ICON_PADDING, 30-ICON_PADDING-1, ICON_PADDING*2+16, ICON_PADDING*2+16, 0xFFFfff);
|
||||||
DrawIconByExtension(file_path, extension, 20, 30, system.color.work_light);
|
DrawIconByExtension(file_path, extension, 20, 30, system.color.work_light);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawPropertiesCheckBoxes()
|
void DrawPropertiesCheckBoxes()
|
||||||
{
|
{
|
||||||
incn y;
|
incn y;
|
||||||
y.n = flags_frame.start_y;
|
y.n = 212; //212 => attributes_frame.y
|
||||||
CheckBox(24, y.inc(18), 20, PR_T_ONLY_READ, atr_readonly);
|
CheckBox(24, y.inc(18), 20, PR_T_ONLY_READ, atr_readonly);
|
||||||
CheckBox(24, y.inc(24), 21, PR_T_HIDDEN, atr_hidden);
|
CheckBox(24, y.inc(24), 21, PR_T_HIDDEN, atr_hidden);
|
||||||
CheckBox(24, y.inc(24), 22, PR_T_SYSTEM, atr_system);
|
CheckBox(24, y.inc(24), 22, PR_T_SYSTEM, atr_system);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
?define SAVE_PATH_AS_DEFAULT "’¥ªã騩 ¯ãâì"
|
?define SAVE_PATH_AS_DEFAULT "’¥ªã騩 ¯ãâì"
|
||||||
?define SAVE_START_PATH_AS_DEFAULT "‚¢¥¤¥ë© ¯ãâì"
|
?define SAVE_START_PATH_AS_DEFAULT "‚¢¥¤¥ë© ¯ãâì"
|
||||||
?define EDIT_FILE_ASSOCIATIONS "<EFBFBD>¥¤ ªâ¨à®¢ âì áá®æ¨ 樨 ä ©«®¢"
|
?define EDIT_FILE_ASSOCIATIONS "<EFBFBD>¥¤ ªâ¨à®¢ âì áá®æ¨ 樨 ä ©«®¢"
|
||||||
?define START_PATH "‘â àâ®¢ë© ¯ãâì:"
|
?define START_PATH " ‘â àâ®¢ë© ¯ãâì: "
|
||||||
#else
|
#else
|
||||||
?define TITLE_SETT "Settings"
|
?define TITLE_SETT "Settings"
|
||||||
?define SHOW_DEVICE_CLASS "Show device class name"
|
?define SHOW_DEVICE_CLASS "Show device class name"
|
||||||
@ -26,14 +26,15 @@
|
|||||||
?define SAVE_PATH_AS_DEFAULT "‘urrent path"
|
?define SAVE_PATH_AS_DEFAULT "‘urrent path"
|
||||||
?define SAVE_START_PATH_AS_DEFAULT "Typed path"
|
?define SAVE_START_PATH_AS_DEFAULT "Typed path"
|
||||||
?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
|
?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
|
||||||
?define START_PATH "Start path:"
|
?define START_PATH " Start path: "
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int WinX, WinY, WinW, WinH;
|
int WinX, WinY, WinW, WinH;
|
||||||
|
|
||||||
dword set_mouse_dd;
|
dword set_mouse_dd;
|
||||||
char path_start[4096]="\0";
|
char path_start[4096]="\0";
|
||||||
edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098,#path_start,#set_mouse_dd, 100000000000010b,0,0};
|
edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098,
|
||||||
|
#path_start,#set_mouse_dd, 100000000000010b,0,0};
|
||||||
|
|
||||||
void settings_dialog()
|
void settings_dialog()
|
||||||
{
|
{
|
||||||
@ -90,7 +91,8 @@ void settings_dialog()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case evReDraw:
|
case evReDraw:
|
||||||
DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 376, 370+skin_height,0x34,system.color.work,TITLE_SETT,0);
|
DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 380,
|
||||||
|
390+skin_height,0x34,system.color.work,TITLE_SETT,0);
|
||||||
DrawSettingsCheckBoxes();
|
DrawSettingsCheckBoxes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,7 +109,7 @@ void ExitSettings()
|
|||||||
void DrawSettingsCheckBoxes()
|
void DrawSettingsCheckBoxes()
|
||||||
{
|
{
|
||||||
incn y;
|
incn y;
|
||||||
int x=11, but_x;
|
int x=11, frx=26, but_x;
|
||||||
y.n = 0;
|
y.n = 0;
|
||||||
CheckBox(x, y.inc(14), 20, SHOW_DEVICE_CLASS, show_dev_name);
|
CheckBox(x, y.inc(14), 20, SHOW_DEVICE_CLASS, show_dev_name);
|
||||||
CheckBox(x, y.inc(25), 21, SHOW_REAL_NAMES, real_files_names_case);
|
CheckBox(x, y.inc(25), 21, SHOW_REAL_NAMES, real_files_names_case);
|
||||||
@ -117,13 +119,17 @@ void DrawSettingsCheckBoxes()
|
|||||||
CheckBox(x, y.inc(25), 24, USE_TWO_PANELS, two_panels);
|
CheckBox(x, y.inc(25), 24, USE_TWO_PANELS, two_panels);
|
||||||
MoreLessBox(x, y.inc(31), 30, 31, kfont.size.pt, FONT_SIZE_LABEL);
|
MoreLessBox(x, y.inc(31), 30, 31, kfont.size.pt, FONT_SIZE_LABEL);
|
||||||
MoreLessBox(x, y.inc(31), 25, 26, files.item_h, LIST_LINE_HEIGHT);
|
MoreLessBox(x, y.inc(31), 25, 26, files.item_h, LIST_LINE_HEIGHT);
|
||||||
WriteText(6, y.inc(28), 0xD0, system.color.work_text, START_PATH);
|
|
||||||
path_start_ed.top = y.inc(23);
|
DrawFrame(x, y.inc(37), 340, 95, START_PATH);
|
||||||
path_start_ed.left = x;
|
// START_PATH {
|
||||||
|
path_start_ed.top = y.inc(21);
|
||||||
|
path_start_ed.left = frx;
|
||||||
DrawEditBox(#path_start_ed);
|
DrawEditBox(#path_start_ed);
|
||||||
but_x = DrawStandartCaptButton(x-1, y.inc(34), 6, SAVE_PATH_AS_DEFAULT);
|
but_x = DrawStandartCaptButton(frx, y.inc(34), 6, SAVE_PATH_AS_DEFAULT);
|
||||||
DrawStandartCaptButton(x-1+but_x, y.inc(0), 7, SAVE_START_PATH_AS_DEFAULT);
|
DrawStandartCaptButton(frx+but_x, y.inc(0), 7, SAVE_START_PATH_AS_DEFAULT);
|
||||||
DrawStandartCaptButton(x-1, y.inc(38), 5, EDIT_FILE_ASSOCIATIONS);
|
// } START_PATH
|
||||||
|
|
||||||
|
DrawStandartCaptButton(x, y.inc(52), 5, EDIT_FILE_ASSOCIATIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,18 +39,6 @@ pipet aside color view
|
|||||||
#define COLSIZE 18
|
#define COLSIZE 18
|
||||||
#define RIGHT_BAR_W PAL_ITEMS_X_COUNT*COLSIZE
|
#define RIGHT_BAR_W PAL_ITEMS_X_COUNT*COLSIZE
|
||||||
|
|
||||||
struct block {
|
|
||||||
int x,y,w,h;
|
|
||||||
bool hovered();
|
|
||||||
};
|
|
||||||
|
|
||||||
bool block::hovered() {
|
|
||||||
if ((mouse.x>x) && (mouse.y>y)
|
|
||||||
&& (mouse.y<y+h) && (mouse.x<x+w))
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
block canvas = { NULL, NULL, NULL, NULL };
|
block canvas = { NULL, NULL, NULL, NULL };
|
||||||
block wrapper = { PANEL_LEFT_W, TOOLBAR_H, NULL, NULL };
|
block wrapper = { PANEL_LEFT_W, TOOLBAR_H, NULL, NULL };
|
||||||
block right_bar = { NULL, TOOLBAR_H, RIGHT_BAR_W+10, NULL };
|
block right_bar = { NULL, TOOLBAR_H, RIGHT_BAR_W+10, NULL };
|
||||||
@ -728,7 +716,7 @@ void EventSave()
|
|||||||
notify("'Error saving file, incorrect data!' -E");
|
notify("'Error saving file, incorrect data!' -E");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (WriteFile(encoded_size, encoded_data, "/rd/1/saved_image.png") == 0) {
|
if (CreateFile(encoded_size, encoded_data, "/rd/1/saved_image.png") == 0) {
|
||||||
notify("'File saved as /rd/1/saved_image.png' -O");
|
notify("'File saved as /rd/1/saved_image.png' -O");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -15,7 +15,7 @@ enum {
|
|||||||
|
|
||||||
_tabs tabs = { 0,0, WIN_W, WIN_H, PHRASE_TAB};
|
_tabs tabs = { 0,0, WIN_W, WIN_H, PHRASE_TAB};
|
||||||
|
|
||||||
rect preview;
|
block preview = { 0, PANELH, WIN_W, WIN_H - PANELH };
|
||||||
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
@ -50,11 +50,6 @@ void main()
|
|||||||
tabs.draw_button(Form.cwidth-130, PHRASE_TAB, "Phrase");
|
tabs.draw_button(Form.cwidth-130, PHRASE_TAB, "Phrase");
|
||||||
tabs.draw_button(Form.cwidth-60, CHARS_TAB, "Chars");
|
tabs.draw_button(Form.cwidth-60, CHARS_TAB, "Chars");
|
||||||
|
|
||||||
preview.x = tabs.x;
|
|
||||||
preview.y = PANELH;
|
|
||||||
preview.w = Form.cwidth;
|
|
||||||
preview.h = Form.cheight - PANELH;
|
|
||||||
|
|
||||||
if (!kfont.font)
|
if (!kfont.font)
|
||||||
{
|
{
|
||||||
DrawBar(preview.x, preview.y, preview.w, preview.h, 0xFFFfff);
|
DrawBar(preview.x, preview.y, preview.w, preview.h, 0xFFFfff);
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
:f70 write_file_70;
|
:f70 write_file_70;
|
||||||
:int WriteFile(dword data_size, buffer, file_path)
|
:int CreateFile(dword data_size, buffer, file_path)
|
||||||
{
|
{
|
||||||
write_file_70.func = 2;
|
write_file_70.func = 2;
|
||||||
write_file_70.param1 = 0;
|
write_file_70.param1 = 0;
|
||||||
@ -142,7 +142,7 @@
|
|||||||
// WriteInFileThatAlredyExists //
|
// WriteInFileThatAlredyExists //
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
:f70 write_file_offset_70;
|
:f70 write_file_offset_70;
|
||||||
:int WriteFileWithOffset(dword offset, data_size, buffer, file_path)
|
:int WriteFile(dword offset, data_size, buffer, file_path)
|
||||||
{
|
{
|
||||||
write_file_offset_70.func = 3;
|
write_file_offset_70.func = 3;
|
||||||
write_file_offset_70.param1 = offset;
|
write_file_offset_70.param1 = offset;
|
||||||
@ -354,7 +354,7 @@ int error;
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (error = WriteFile(size, cbuf, copyTo)) debugln("Error: CopyFileAtOnce->WriteFile");
|
if (error = CreateFile(size, cbuf, copyTo)) debugln("Error: CopyFileAtOnce->CreateFile");
|
||||||
}
|
}
|
||||||
free(cbuf);
|
free(cbuf);
|
||||||
return error;
|
return error;
|
||||||
@ -364,20 +364,34 @@ int error;
|
|||||||
dword cbuf;
|
dword cbuf;
|
||||||
int error=-1;
|
int error=-1;
|
||||||
dword offpos=0;
|
dword offpos=0;
|
||||||
int block_size=1024*1024*4; //copy by 4 MiBs
|
int block_size=1024*1024*4; //copy by 4 MiB
|
||||||
{
|
{
|
||||||
|
if (GetFreeRAM()>1024*78) {
|
||||||
|
//Set block size 32 MiB
|
||||||
|
block_size <<= 3;
|
||||||
|
}
|
||||||
cbuf = malloc(block_size);
|
cbuf = malloc(block_size);
|
||||||
WriteFile(0, 0, copyTo); //create file
|
if (error = CreateFile(0, 0, copyTo))
|
||||||
|
{
|
||||||
|
debugln("Error: CopyFileByBlocks->CreateFile");
|
||||||
|
size = -1;
|
||||||
|
}
|
||||||
while(offpos < size)
|
while(offpos < size)
|
||||||
{
|
{
|
||||||
error = ReadFile(offpos, block_size, cbuf, copyFrom);
|
error = ReadFile(offpos, block_size, cbuf, copyFrom);
|
||||||
if (error = 6) { //File ended before last byte was readed
|
if (error = 6) { //File ended before last byte was readed
|
||||||
block_size = EBX;
|
block_size = EBX;
|
||||||
error=0;
|
if (block_size+offpos>=size) error=0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (error!=0) break;
|
if (error!=0) {
|
||||||
if (error = WriteFileWithOffset(offpos, block_size, cbuf, copyTo)) break;
|
debugln("Error: CopyFileByBlocks->ReadFile");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (error = WriteFile(offpos, block_size, cbuf, copyTo)) {
|
||||||
|
debugln("Error: CopyFileByBlocks->WriteFile");
|
||||||
|
break;
|
||||||
|
}
|
||||||
offpos += block_size;
|
offpos += block_size;
|
||||||
}
|
}
|
||||||
free(cbuf);
|
free(cbuf);
|
||||||
|
@ -346,6 +346,28 @@ TODO: scroll
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//block with hover
|
||||||
|
struct block {
|
||||||
|
int x,y,w,h;
|
||||||
|
bool hovered();
|
||||||
|
void set_size();
|
||||||
|
};
|
||||||
|
|
||||||
|
:bool block::hovered() {
|
||||||
|
if ((mouse.x>x) && (mouse.y>y)
|
||||||
|
&& (mouse.y<y+h) && (mouse.x<x+w))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
:void block::set_size(dword _x, _y, _w, _h)
|
||||||
|
{
|
||||||
|
x=_x;
|
||||||
|
y=_y;
|
||||||
|
w=_w;
|
||||||
|
h=_h;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,14 +4,16 @@
|
|||||||
unsigned value, min, max;
|
unsigned value, min, max;
|
||||||
unsigned bt_id_more, bt_id_less;
|
unsigned bt_id_more, bt_id_less;
|
||||||
dword text;
|
dword text;
|
||||||
|
int click_delta;
|
||||||
bool click();
|
bool click();
|
||||||
void draw();
|
void draw();
|
||||||
};
|
};
|
||||||
|
|
||||||
:bool more_less_box::click(unsigned id)
|
:bool more_less_box::click(unsigned id)
|
||||||
{
|
{
|
||||||
if (id==bt_id_less) { value = math.max(value-1, min); draw(); return 1; }
|
if (!click_delta) click_delta = 1;
|
||||||
if (id==bt_id_more) { value = math.min(value+1, max); draw(); return 1; }
|
if (id==bt_id_less) { value = math.max(value-click_delta, min); draw(); return 1; }
|
||||||
|
if (id==bt_id_more) { value = math.min(value+click_delta, max); draw(); return 1; }
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -621,20 +621,6 @@ inline fastcall dword GetStartTime()
|
|||||||
CreateThread(#_EventRedrawWindow,#REDRAW_BUFF_EVENT_+4092);
|
CreateThread(#_EventRedrawWindow,#REDRAW_BUFF_EVENT_+4092);
|
||||||
}
|
}
|
||||||
|
|
||||||
:struct rect
|
|
||||||
{
|
|
||||||
dword x,y,w,h;
|
|
||||||
void set_size();
|
|
||||||
};
|
|
||||||
|
|
||||||
:void rect::set_size(dword _x, _y, _w, _h)
|
|
||||||
{
|
|
||||||
x=_x;
|
|
||||||
y=_y;
|
|
||||||
w=_w;
|
|
||||||
h=_h;
|
|
||||||
}
|
|
||||||
|
|
||||||
:struct _screen
|
:struct _screen
|
||||||
{
|
{
|
||||||
dword width,height;
|
dword width,height;
|
||||||
|
@ -33,25 +33,24 @@ struct llist
|
|||||||
int KeyLeft();
|
int KeyLeft();
|
||||||
int KeyRight();
|
int KeyRight();
|
||||||
void CheckDoesValuesOkey();
|
void CheckDoesValuesOkey();
|
||||||
//void debug();
|
void debug();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
:void llist::debug()
|
||||||
void llist::debug()
|
|
||||||
{
|
{
|
||||||
char yi[128];
|
char yi[128];
|
||||||
sprintf(#yi, "%s %d %s %d %s %d %s %d %s %d %s %d", "first:", first, "visible:", visible, "count:", count, "col_max:", column_max, "cur_y:", cur_y, "cur_x:", cur_x);
|
sprintf(#yi, "%s %d %s %d %s %d %s %d %s %d %s %d", "first:", first, "visible:", visible, "count:", count, "col_max:", column_max, "cur_y:", cur_y, "cur_x:", cur_x);
|
||||||
debugln(#yi);
|
debugln(#yi);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
|
||||||
void llist::ClearList()
|
:void llist::ClearList()
|
||||||
{
|
{
|
||||||
count = visible = first = cur_y = cur_x = 0;
|
count = visible = first = cur_y = cur_x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void llist::SetSizes(int xx, yy, ww, hh, item_hh)
|
:void llist::SetSizes(int xx, yy, ww, hh, item_hh)
|
||||||
{
|
{
|
||||||
x = xx;
|
x = xx;
|
||||||
y = yy;
|
y = yy;
|
||||||
@ -64,7 +63,8 @@ void llist::SetSizes(int xx, yy, ww, hh, item_hh)
|
|||||||
CheckDoesValuesOkey();
|
CheckDoesValuesOkey();
|
||||||
}
|
}
|
||||||
|
|
||||||
void llist::SetFont(dword font_ww, font_hh, font_tt)
|
|
||||||
|
:void llist::SetFont(dword font_ww, font_hh, font_tt)
|
||||||
{
|
{
|
||||||
font_w = font_ww;
|
font_w = font_ww;
|
||||||
font_h = font_hh;
|
font_h = font_hh;
|
||||||
@ -72,7 +72,7 @@ void llist::SetFont(dword font_ww, font_hh, font_tt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int llist::MouseScroll(dword scroll_state)
|
:int llist::MouseScroll(dword scroll_state)
|
||||||
{
|
{
|
||||||
if (count<=visible) return 0;
|
if (count<=visible) return 0;
|
||||||
if (scroll_state == 65535)
|
if (scroll_state == 65535)
|
||||||
@ -91,13 +91,13 @@ int llist::MouseScroll(dword scroll_state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int llist::MouseOver(int xx, yy)
|
:int llist::MouseOver(int xx, yy)
|
||||||
{
|
{
|
||||||
if (xx>x) && (xx<x+w) && (yy>y) && (yy<y+h) return 1;
|
if (xx>x) && (xx<x+w) && (yy>y) && (yy<y+h) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::ProcessMouse(int xx, yy)
|
:int llist::ProcessMouse(int xx, yy)
|
||||||
{
|
{
|
||||||
int cur_y_temp, cur_x_temp, ret=0;
|
int cur_y_temp, cur_x_temp, ret=0;
|
||||||
if (MouseOver(xx, yy))
|
if (MouseOver(xx, yy))
|
||||||
@ -121,7 +121,7 @@ int llist::ProcessMouse(int xx, yy)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::ProcessKey(dword key)
|
:int llist::ProcessKey(dword key)
|
||||||
{
|
{
|
||||||
switch(key)
|
switch(key)
|
||||||
{
|
{
|
||||||
@ -140,7 +140,7 @@ int llist::ProcessKey(dword key)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::KeyDown()
|
:int llist::KeyDown()
|
||||||
{
|
{
|
||||||
if (no_selection)
|
if (no_selection)
|
||||||
{
|
{
|
||||||
@ -168,7 +168,7 @@ int llist::KeyDown()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::KeyUp()
|
:int llist::KeyUp()
|
||||||
{
|
{
|
||||||
if (no_selection)
|
if (no_selection)
|
||||||
{
|
{
|
||||||
@ -195,14 +195,14 @@ int llist::KeyUp()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::KeyHome()
|
:int llist::KeyHome()
|
||||||
{
|
{
|
||||||
if (cur_y==0) && (first==0) return 0;
|
if (cur_y==0) && (first==0) return 0;
|
||||||
cur_y = first = 0;
|
cur_y = first = 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::KeyEnd()
|
:int llist::KeyEnd()
|
||||||
{
|
{
|
||||||
if (cur_y==count-1) && (first==count-visible) return 0;
|
if (cur_y==count-1) && (first==count-visible) return 0;
|
||||||
cur_y = count-1;
|
cur_y = count-1;
|
||||||
@ -210,7 +210,7 @@ int llist::KeyEnd()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::KeyPgUp()
|
:int llist::KeyPgUp()
|
||||||
{
|
{
|
||||||
if (count <= visible) return KeyHome();
|
if (count <= visible) return KeyHome();
|
||||||
if (first == 0) return 0;
|
if (first == 0) return 0;
|
||||||
@ -220,7 +220,7 @@ int llist::KeyPgUp()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::KeyPgDown()
|
:int llist::KeyPgDown()
|
||||||
{
|
{
|
||||||
if (count <= visible) return KeyEnd();
|
if (count <= visible) return KeyEnd();
|
||||||
if (first == count - visible) return 0;
|
if (first == count - visible) return 0;
|
||||||
@ -230,7 +230,7 @@ int llist::KeyPgDown()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void llist::CheckDoesValuesOkey()
|
:void llist::CheckDoesValuesOkey()
|
||||||
{
|
{
|
||||||
if (visible + first > count) first = count - visible;
|
if (visible + first > count) first = count - visible;
|
||||||
if (first < 0) first = 0;
|
if (first < 0) first = 0;
|
||||||
@ -239,7 +239,7 @@ void llist::CheckDoesValuesOkey()
|
|||||||
if (cur_x < 0) cur_x = 0;
|
if (cur_x < 0) cur_x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::KeyRight()
|
:int llist::KeyRight()
|
||||||
{
|
{
|
||||||
if (cur_x < column_max)
|
if (cur_x < column_max)
|
||||||
{
|
{
|
||||||
@ -253,7 +253,7 @@ int llist::KeyRight()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int llist::KeyLeft()
|
:int llist::KeyLeft()
|
||||||
{
|
{
|
||||||
if (cur_x > 0)
|
if (cur_x > 0)
|
||||||
{
|
{
|
||||||
@ -268,7 +268,7 @@ int llist::KeyLeft()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void llist_copy(dword dest, src)
|
:void llist_copy(dword dest, src)
|
||||||
{
|
{
|
||||||
EDI = dest;
|
EDI = dest;
|
||||||
ESI = src;
|
ESI = src;
|
||||||
|
@ -155,7 +155,7 @@ struct progress_bar
|
|||||||
struct frame
|
struct frame
|
||||||
{
|
{
|
||||||
dword type;
|
dword type;
|
||||||
word size_x;
|
word size_x; //start_x, size_x => Mario, WTF? Is this so complex to use x/y/w/h ?
|
||||||
word start_x;
|
word start_x;
|
||||||
word size_y;
|
word size_y;
|
||||||
word start_y;
|
word start_y;
|
||||||
@ -168,6 +168,23 @@ struct frame
|
|||||||
dword font_size_y;
|
dword font_size_y;
|
||||||
dword font_color;
|
dword font_color;
|
||||||
dword font_backgr_color;
|
dword font_backgr_color;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
:frame frame123 = { 0, 260, 10, 60, 16, NULL, 0xFFFfff, 1, NULL, 0, 1, 12, 0x000111, 0xCCCccc };
|
||||||
|
:void DrawFrame(dword x,y,w,h,text)
|
||||||
|
{
|
||||||
|
frame123.font_color = system.color.work_text;
|
||||||
|
frame123.ext_col = system.color.work_graph;
|
||||||
|
frame123.int_col = system.color.work_light;
|
||||||
|
frame123.font_backgr_color = system.color.work;
|
||||||
|
|
||||||
|
frame123.start_x = x;
|
||||||
|
frame123.start_y = y;
|
||||||
|
frame123.size_x = w;
|
||||||
|
frame123.size_y = h;
|
||||||
|
frame123.text_pointer = text;
|
||||||
|
frame_draw stdcall (#frame123);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -218,7 +218,7 @@ struct _Image
|
|||||||
notify("'Error saving file, incorrect data!' -E");
|
notify("'Error saving file, incorrect data!' -E");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (WriteFile(encoded_size, encoded_data, _path) == 0) {
|
if (CreateFile(encoded_size, encoded_data, _path) == 0) {
|
||||||
sprintf(#save_success_message, "'File saved as %s' -O", _path);
|
sprintf(#save_success_message, "'File saved as %s' -O", _path);
|
||||||
notify(#save_success_message);
|
notify(#save_success_message);
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
proc_info Form;
|
proc_info Form;
|
||||||
};
|
};
|
||||||
|
|
||||||
void window::create()
|
:void window::create()
|
||||||
{
|
{
|
||||||
word id=0;
|
word id=0;
|
||||||
IF(!caption)caption = "Window";
|
IF(!caption)caption = "Window";
|
||||||
|
@ -155,7 +155,7 @@ void SaveAndExit() {
|
|||||||
chrcat(#write_data, '\n');
|
chrcat(#write_data, '\n');
|
||||||
base64_encode stdcall (#pass_text, #pass_b64, strlen(#pass_text));
|
base64_encode stdcall (#pass_text, #pass_b64, strlen(#pass_text));
|
||||||
strcat(#write_data, #pass_b64);
|
strcat(#write_data, #pass_b64);
|
||||||
WriteFile(strlen(#write_data)+1, #write_data, "/sys/network/mail.dat");
|
CreateFile(strlen(#write_data)+1, #write_data, "/sys/network/mail.dat");
|
||||||
ExitProcess();
|
ExitProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ void MailBoxLoop() {
|
|||||||
if (id==SAVE_LETTER)
|
if (id==SAVE_LETTER)
|
||||||
{
|
{
|
||||||
if (!mailstart) break;
|
if (!mailstart) break;
|
||||||
WriteFile(strlen(mailstart), mailstart, "mail.txt");
|
CreateFile(strlen(mailstart), mailstart, "mail.txt");
|
||||||
pause(10);
|
pause(10);
|
||||||
RunProgram("tinypad", "mail.txt");
|
RunProgram("tinypad", "mail.txt");
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Mouse Configuration Utility ver 1.4
|
// Mouse Configuration Utility ver 1.5
|
||||||
|
|
||||||
#ifndef AUTOBUILD
|
#ifndef AUTOBUILD
|
||||||
#include "lang.h--"
|
#include "lang.h--"
|
||||||
@ -33,11 +33,16 @@
|
|||||||
?define DOUBLE_CLICK_TEXT "Mouse double click delay"
|
?define DOUBLE_CLICK_TEXT "Mouse double click delay"
|
||||||
?define MOUSE_EMULATION "Enable mouse emulation using keyboard NumPad"
|
?define MOUSE_EMULATION "Enable mouse emulation using keyboard NumPad"
|
||||||
?define MADMOUSE "Through screen sides for pointer"
|
?define MADMOUSE "Through screen sides for pointer"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
proc_info Form;
|
proc_info Form;
|
||||||
frame mouse_frame = { 0, 000, 14, 130, 14, 0x000111, 0xFFFfff, 0, 0, 0, 0, 6, 0x000111, 0xCCCccc };
|
|
||||||
char pos_x = 22;
|
#define PD 18 //padding
|
||||||
|
block mouse_frame = { PD, PD, NULL, 130 };
|
||||||
|
|
||||||
|
more_less_box pointer_speed = { PD, PD+142, NULL, 0, 64, 120, 121, POINTER_SPEED };
|
||||||
|
more_less_box acceleration = { PD, PD+172, NULL, 0, 64, 122, 123, ACCELERATION_TEXT };
|
||||||
|
more_less_box double_click_delay = { PD, PD+202, NULL, 0, 999,124, 125, DOUBLE_CLICK_TEXT, 8 };
|
||||||
|
|
||||||
unsigned char panels_img_data[] = FROM "mouse_image.raw";
|
unsigned char panels_img_data[] = FROM "mouse_image.raw";
|
||||||
raw_image panels_img = { 59, 101, #panels_img_data };
|
raw_image panels_img = { 59, 101, #panels_img_data };
|
||||||
@ -45,17 +50,14 @@ raw_image panels_img = { 59, 101, #panels_img_data };
|
|||||||
_ini ini = { "/sys/settings/system.ini", "mouse" };
|
_ini ini = { "/sys/settings/system.ini", "mouse" };
|
||||||
|
|
||||||
struct _mouse_cfg {
|
struct _mouse_cfg {
|
||||||
char pointer_speed,
|
bool emulation;
|
||||||
acceleration,
|
bool madmouse;
|
||||||
emulation,
|
int click_status;
|
||||||
madmouse,
|
|
||||||
button_clicked;
|
|
||||||
word double_click_delay;
|
|
||||||
} mouse_cfg;
|
} mouse_cfg;
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
char id, old_button_clicked;
|
char id;
|
||||||
|
|
||||||
load_dll(libini, #lib_init,1);
|
load_dll(libini, #lib_init,1);
|
||||||
load_dll(boxlib, #box_lib_init,0);
|
load_dll(boxlib, #box_lib_init,0);
|
||||||
@ -68,46 +70,41 @@ void main() {
|
|||||||
{
|
{
|
||||||
case evMouse:
|
case evMouse:
|
||||||
mouse.get();
|
mouse.get();
|
||||||
if (mouse.y <= mouse_frame.start_y) || (mouse.y >= mouse_frame.start_y + mouse_frame.size_y)
|
if (mouse.down) && (mouse_cfg.click_status==0) && (mouse_frame.hovered()) {
|
||||||
|| (mouse.x >= mouse_frame.start_x + mouse_frame.size_x) || (mouse.x <= mouse_frame.start_x) break;
|
if (mouse.key&MOUSE_LEFT) mouse_cfg.click_status = 1;
|
||||||
old_button_clicked = mouse_cfg.button_clicked;
|
if (mouse.key&MOUSE_RIGHT) mouse_cfg.click_status = 2;
|
||||||
if (mouse.lkm) mouse_cfg.button_clicked=1;
|
if (mouse.key&MOUSE_CENTER) mouse_cfg.click_status = 3;
|
||||||
else if (mouse.pkm) mouse_cfg.button_clicked=2;
|
DrawMouseImage();
|
||||||
else if (mouse.mkm) mouse_cfg.button_clicked=3;
|
}
|
||||||
else mouse_cfg.button_clicked=0;
|
if (mouse.up) {
|
||||||
if (mouse_cfg.button_clicked != old_button_clicked) DrawMouseImage();
|
mouse_cfg.click_status=0;
|
||||||
|
DrawMouseImage();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case evButton:
|
case evButton:
|
||||||
id=GetButtonID();
|
id = GetButtonID();
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case 1:
|
case 1:
|
||||||
ExitApp();
|
ExitApp();
|
||||||
break;
|
break;
|
||||||
case 99:
|
|
||||||
mouse_cfg.button_clicked=0;
|
|
||||||
DrawMouseImage();
|
|
||||||
break;
|
|
||||||
case 100:
|
case 100:
|
||||||
if (mouse_cfg.emulation==true) KillProcessByName("mousemul", SINGLE);
|
if (mouse_cfg.emulation==true) KillProcessByName("mousemul", SINGLE);
|
||||||
else RunProgram("/sys/mousemul", 0);
|
else RunProgram("/sys/mousemul", 0);
|
||||||
mouse_cfg.emulation ^= 1;
|
mouse_cfg.emulation ^= 1;
|
||||||
|
DrawControls();
|
||||||
break;
|
break;
|
||||||
case 101:
|
case 101:
|
||||||
if (mouse_cfg.madmouse==true) KillProcessByName("madmouse", SINGLE);
|
if (mouse_cfg.madmouse==true) KillProcessByName("madmouse", SINGLE);
|
||||||
else RunProgram("/sys/madmouse", 0);
|
else RunProgram("/sys/madmouse", 0);
|
||||||
mouse_cfg.madmouse ^= 1;
|
mouse_cfg.madmouse ^= 1;
|
||||||
|
DrawControls();
|
||||||
break;
|
break;
|
||||||
case 120: mouse_cfg.pointer_speed++; break;
|
default:
|
||||||
case 121: if (mouse_cfg.pointer_speed>0) mouse_cfg.pointer_speed--; break;
|
if (pointer_speed.click(id)) ApplyCfg();;
|
||||||
case 122: mouse_cfg.acceleration++; break;
|
if (acceleration.click(id)) ApplyCfg();;
|
||||||
case 123: if (mouse_cfg.acceleration>0) mouse_cfg.acceleration--; break;
|
if (double_click_delay.click(id)) ApplyCfg();;
|
||||||
case 124: mouse_cfg.double_click_delay+=8; break;
|
|
||||||
case 125: if (mouse_cfg.double_click_delay>0) mouse_cfg.double_click_delay-=8; break;
|
|
||||||
}
|
}
|
||||||
DrawControls();
|
|
||||||
ApplyCfg();
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case evKey:
|
case evKey:
|
||||||
@ -120,12 +117,11 @@ void main() {
|
|||||||
DefineAndDrawWindow(430, 150, 424, 310+skin_height,0x34,system.color.work,WINDOW_TITLE,0);
|
DefineAndDrawWindow(430, 150, 424, 310+skin_height,0x34,system.color.work,WINDOW_TITLE,0);
|
||||||
GetProcessInfo(#Form, SelfInfo);
|
GetProcessInfo(#Form, SelfInfo);
|
||||||
if (Form.status_window>2) break;
|
if (Form.status_window>2) break;
|
||||||
SetFrameColors();
|
mouse_frame.w = - mouse_frame.x * 2 + Form.cwidth;
|
||||||
DefineButton(mouse_frame.start_x+2, mouse_frame.start_y+2, mouse_frame.size_x-4,
|
DefineButton(mouse_frame.x, mouse_frame.y, mouse_frame.w,
|
||||||
mouse_frame.size_y-4, 99+BT_NOFRAME, 0xF0F2F3); //needed to handle mouse_up and refresh mouse image
|
mouse_frame.h, 99+BT_NOFRAME, 0xF0F2F3); //needed to handle mouse_up and refresh mouse image
|
||||||
frame_draw stdcall (#mouse_frame);
|
WriteText(mouse_frame.x + 110, mouse_frame.y + 25, 0x90, 0x2C343C, CHECK_MOUSE_1);
|
||||||
WriteText(pos_x + 110, mouse_frame.start_y + 25, 0x90, 0x2C343C, CHECK_MOUSE_1);
|
WriteText(mouse_frame.x + 110, mouse_frame.y + 45, 0x90, 0x2C343C, CHECK_MOUSE_2);
|
||||||
WriteText(pos_x + 110, mouse_frame.start_y + 45, 0x90, 0x2C343C, CHECK_MOUSE_2);
|
|
||||||
DrawMouseImage();
|
DrawMouseImage();
|
||||||
DrawControls();
|
DrawControls();
|
||||||
}
|
}
|
||||||
@ -133,44 +129,37 @@ void main() {
|
|||||||
|
|
||||||
|
|
||||||
void DrawMouseImage() {
|
void DrawMouseImage() {
|
||||||
_PutImage(mouse_frame.start_x+30, mouse_frame.start_y + 15, panels_img.w, panels_img.h,
|
_PutImage(mouse_frame.x+30, mouse_frame.y + 15, panels_img.w, panels_img.h,
|
||||||
mouse_cfg.button_clicked * panels_img.w * panels_img.h * 3 + panels_img.data);
|
mouse_cfg.click_status * panels_img.w * panels_img.h * 3 + panels_img.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawControls() {
|
void DrawControls() {
|
||||||
MoreLessBox(pos_x, mouse_frame.start_y + 142, 120, 121, mouse_cfg.pointer_speed, POINTER_SPEED);
|
pointer_speed.draw();
|
||||||
MoreLessBox(pos_x, mouse_frame.start_y + 172, 122, 123, mouse_cfg.acceleration, ACCELERATION_TEXT);
|
acceleration.draw();
|
||||||
MoreLessBox(pos_x, mouse_frame.start_y + 202, 124, 125, mouse_cfg.double_click_delay, DOUBLE_CLICK_TEXT);
|
double_click_delay.draw();
|
||||||
CheckBox(pos_x, mouse_frame.start_y + 236, 100, MOUSE_EMULATION, mouse_cfg.emulation);
|
CheckBox(mouse_frame.x, mouse_frame.y + 236, 100, MOUSE_EMULATION, mouse_cfg.emulation);
|
||||||
CheckBox(pos_x, mouse_frame.start_y + 262, 101, MADMOUSE, mouse_cfg.madmouse);
|
CheckBox(mouse_frame.x, mouse_frame.y + 262, 101, MADMOUSE, mouse_cfg.madmouse);
|
||||||
}
|
|
||||||
|
|
||||||
void SetFrameColors() {
|
|
||||||
mouse_frame.size_x = - mouse_frame.start_x * 2 + Form.cwidth;
|
|
||||||
mouse_frame.font_color = system.color.work_text;
|
|
||||||
mouse_frame.font_backgr_color = system.color.work;
|
|
||||||
mouse_frame.ext_col = system.color.work_graph;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadCfg() {
|
void LoadCfg() {
|
||||||
mouse_cfg.acceleration = ini.GetInt("acceleration", GetMouseAcceleration());
|
acceleration.value = ini.GetInt("acceleration", GetMouseAcceleration());
|
||||||
mouse_cfg.pointer_speed = ini.GetInt("speed", GetMouseSpeed());
|
pointer_speed.value = ini.GetInt("speed", GetMouseSpeed());
|
||||||
mouse_cfg.double_click_delay = ini.GetInt("double_click_delay", GetMouseDoubleClickDelay());
|
double_click_delay.value = ini.GetInt("double_click_delay", GetMouseDoubleClickDelay());
|
||||||
mouse_cfg.madmouse = CheckProcessExists("MADMOUSE");
|
mouse_cfg.madmouse = CheckProcessExists("MADMOUSE");
|
||||||
mouse_cfg.emulation = CheckProcessExists("MOUSEMUL");
|
mouse_cfg.emulation = CheckProcessExists("MOUSEMUL");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExitApp() {
|
void ExitApp() {
|
||||||
ini.SetInt("acceleration", mouse_cfg.acceleration);
|
ini.SetInt("acceleration", acceleration.value);
|
||||||
ini.SetInt("speed", mouse_cfg.pointer_speed);
|
ini.SetInt("speed", pointer_speed.value);
|
||||||
ini.SetInt("double_click_delay", mouse_cfg.double_click_delay);
|
ini.SetInt("double_click_delay", double_click_delay.value);
|
||||||
ExitProcess();
|
ExitProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplyCfg() {
|
void ApplyCfg() {
|
||||||
SetMouseSpeed(mouse_cfg.pointer_speed);
|
SetMouseSpeed(pointer_speed.value);
|
||||||
SetMouseAcceleration(mouse_cfg.acceleration);
|
SetMouseAcceleration(acceleration.value);
|
||||||
SetMouseDoubleClickDelay(mouse_cfg.double_click_delay);
|
SetMouseDoubleClickDelay(double_click_delay.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
stop:
|
stop:
|
@ -54,10 +54,6 @@
|
|||||||
?define CHANGE_POS "Click on image to change position"
|
?define CHANGE_POS "Click on image to change position"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
frame taskbar_frame = { 0, NULL, 10, NULL, 16, NULL, 0xFFFfff, 1, TASK_FRAME_T, 0, 1, 12, 0x000111, 0xCCCccc };
|
|
||||||
frame docky_frame = { 0, NULL, 10, NULL, NULL, NULL, 0xFFFfff, 1, DOCK_FRAME_T, 0, 1, 12, 0x000111, 0xCCCccc };
|
|
||||||
|
|
||||||
char taskbar_ini_path[] = "/sys/settings/taskbar.ini";
|
char taskbar_ini_path[] = "/sys/settings/taskbar.ini";
|
||||||
_ini taskbar_flags_ini = { #taskbar_ini_path, "Flags" };
|
_ini taskbar_flags_ini = { #taskbar_ini_path, "Flags" };
|
||||||
_ini taskbar_vars_ini = { #taskbar_ini_path, "Variables" };
|
_ini taskbar_vars_ini = { #taskbar_ini_path, "Variables" };
|
||||||
@ -147,10 +143,6 @@ void main()
|
|||||||
DefineAndDrawWindow(130, 150, 465, 398 + skin_height, 0x34, system.color.work, WINDOW_TITLE, 0);
|
DefineAndDrawWindow(130, 150, 465, 398 + skin_height, 0x34, system.color.work, WINDOW_TITLE, 0);
|
||||||
GetProcessInfo(#Form, SelfInfo);
|
GetProcessInfo(#Form, SelfInfo);
|
||||||
if (Form.status_window>2) break;
|
if (Form.status_window>2) break;
|
||||||
taskbar_frame.size_x = docky_frame.size_x = - taskbar_frame.start_x * 2 + Form.cwidth;
|
|
||||||
taskbar_frame.font_color = docky_frame.font_color = system.color.work_text;
|
|
||||||
taskbar_frame.font_backgr_color = docky_frame.font_backgr_color = system.color.work;
|
|
||||||
taskbar_frame.ext_col = docky_frame.ext_col = system.color.work_graph;
|
|
||||||
DrawWindowContent(ALL);
|
DrawWindowContent(ALL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -158,12 +150,15 @@ void main()
|
|||||||
|
|
||||||
void DrawWindowContent(byte panel_type)
|
void DrawWindowContent(byte panel_type)
|
||||||
{
|
{
|
||||||
|
#define PD 10
|
||||||
|
dword frame_y;
|
||||||
word win_center_x = Form.cwidth / 2 + 20;
|
word win_center_x = Form.cwidth / 2 + 20;
|
||||||
incn y;
|
incn y;
|
||||||
|
|
||||||
if (panel_type==ALL) || (panel_type==TASKBAR)
|
if (panel_type==ALL) || (panel_type==TASKBAR)
|
||||||
{
|
{
|
||||||
y.n = taskbar_frame.start_y;
|
frame_y = 15;
|
||||||
|
y.n = frame_y;
|
||||||
DefineButton(22, y.inc(18), panels_img.w-1, 27-1, 100 + BT_HIDE, 0);
|
DefineButton(22, y.inc(18), panels_img.w-1, 27-1, 100 + BT_HIDE, 0);
|
||||||
_PutImage(22, y.n, 37, 27, tbAttachment * 37 * 27 * 3 + panels_img.data);
|
_PutImage(22, y.n, 37, 27, tbAttachment * 37 * 27 * 3 + panels_img.data);
|
||||||
WriteText(68, y.inc(7), 0x90, system.color.work_text, CHANGE_POS);
|
WriteText(68, y.inc(7), 0x90, system.color.work_text, CHANGE_POS);
|
||||||
@ -178,22 +173,17 @@ void DrawWindowContent(byte panel_type)
|
|||||||
MoreLessBox(22, y.inc(28), 120, 121, tbPanelHeight, PANEL_HEIGHT);
|
MoreLessBox(22, y.inc(28), 120, 121, tbPanelHeight, PANEL_HEIGHT);
|
||||||
MoreLessBox(22, y.inc(32), 122, 123, tbSoftenHeight, SOFTEN_HEIGHT);
|
MoreLessBox(22, y.inc(32), 122, 123, tbSoftenHeight, SOFTEN_HEIGHT);
|
||||||
MoreLessBox(22, y.inc(32), 124, 125, tbButtonOffset, BUTTON_OFFSET);
|
MoreLessBox(22, y.inc(32), 124, 125, tbButtonOffset, BUTTON_OFFSET);
|
||||||
taskbar_frame.size_y = y.inc(32) - taskbar_frame.start_y;
|
DrawFrame(PD, frame_y, Form.cwidth-PD-PD, y.inc(32)-frame_y, TASK_FRAME_T);
|
||||||
}
|
}
|
||||||
if (panel_type==ALL) || (panel_type==DOCKY)
|
if (panel_type==ALL) || (panel_type==DOCKY)
|
||||||
{
|
{
|
||||||
docky_frame.start_y = y.inc(20);
|
frame_y = calc(y.inc(20));
|
||||||
DefineButton(22, y.inc(18), panels_img.w-1, 27-1, 200 + BT_HIDE, 0);
|
DefineButton(22, y.inc(18), panels_img.w-1, 27-1, 200 + BT_HIDE, 0);
|
||||||
_PutImage(22, y.n, 37, 27, dkLocation + 1 * 37 * 27 * 3 + panels_img.data);
|
_PutImage(22, y.n, 37, 27, dkLocation + 1 * 37 * 27 * 3 + panels_img.data);
|
||||||
WriteText(68, y.inc(7), 0x90, system.color.work_text, CHANGE_POS);
|
WriteText(68, y.inc(7), 0x90, system.color.work_text, CHANGE_POS);
|
||||||
CheckBox(22, y.inc(35), 201, FSIZE, dkFsize);
|
CheckBox(22, y.inc(35), 201, FSIZE, dkFsize);
|
||||||
CheckBox(win_center_x, y.n, 202, ASHOW, dkAshow);
|
CheckBox(win_center_x, y.n, 202, ASHOW, dkAshow);
|
||||||
docky_frame.size_y = y.inc(30) - docky_frame.start_y;
|
DrawFrame(PD, frame_y, Form.cwidth-PD-PD, Form.cheight-frame_y-PD, DOCK_FRAME_T);
|
||||||
}
|
|
||||||
if (panel_type==ALL)
|
|
||||||
{
|
|
||||||
frame_draw stdcall (#taskbar_frame);
|
|
||||||
frame_draw stdcall (#docky_frame);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ char picked_color_string[11];
|
|||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
int btn;
|
int btn;
|
||||||
SetEventMask(000100111b);
|
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
||||||
SetWindowLayerBehaviour(-1, ZPOS_ALWAYS_TOP);
|
SetWindowLayerBehaviour(-1, ZPOS_ALWAYS_TOP);
|
||||||
loop() switch(WaitEvent())
|
loop() switch(WaitEvent())
|
||||||
{
|
{
|
||||||
|
@ -113,7 +113,7 @@ void main()
|
|||||||
LoadIniConfig();
|
LoadIniConfig();
|
||||||
CheckDefaultForTheFirstStart();
|
CheckDefaultForTheFirstStart();
|
||||||
OpenFolder(#param);
|
OpenFolder(#param);
|
||||||
SetEventMask(0100111b);
|
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
||||||
loop()
|
loop()
|
||||||
{
|
{
|
||||||
WaitEventTimeout(10);
|
WaitEventTimeout(10);
|
||||||
|
@ -57,7 +57,7 @@ void main()
|
|||||||
{
|
{
|
||||||
byte btn;
|
byte btn;
|
||||||
load_dll(boxlib, #box_lib_init,0);
|
load_dll(boxlib, #box_lib_init,0);
|
||||||
SetEventMask(10000000000000000000000001100111b);
|
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
||||||
GetCpuFrequency();
|
GetCpuFrequency();
|
||||||
loop()
|
loop()
|
||||||
{
|
{
|
||||||
|
@ -82,7 +82,7 @@ void main()
|
|||||||
LoadIniSettings();
|
LoadIniSettings();
|
||||||
OpenFile(#param);
|
OpenFile(#param);
|
||||||
list.no_selection = true;
|
list.no_selection = true;
|
||||||
SetEventMask(10000000000000000000000001100111b);
|
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
||||||
loop()
|
loop()
|
||||||
{
|
{
|
||||||
switch(WaitEvent())
|
switch(WaitEvent())
|
||||||
|
Loading…
Reference in New Issue
Block a user