diff --git a/programs/cmm/TWB/links.h b/programs/cmm/TWB/links.h
index b44b43563d..8ac01f958b 100644
--- a/programs/cmm/TWB/links.h
+++ b/programs/cmm/TWB/links.h
@@ -84,7 +84,7 @@ bool LinksArray::HoverAndProceed(dword mx, my)
return false;
}
if (mouse.pkm) && (mouse.up) {
- // EventShowLinkMenu(mouse.x, mouse.y);
+ EventShowLinkMenu(mouse.x, mouse.y);
return false;
}
if (active==i) return false;
diff --git a/programs/cmm/app_plus/app_plus.c b/programs/cmm/app_plus/app_plus.c
index e6d6512ab9..40ff4fc0ea 100644
--- a/programs/cmm/app_plus/app_plus.c
+++ b/programs/cmm/app_plus/app_plus.c
@@ -22,9 +22,11 @@ dword scr = FROM "scr.raw_8bit";
dword scr_pal[] = {0xFFFFFF,0xBBDDFF,0x4166B5,0xE0E4E6,0xAFBEDD,0xC4D4E8,0x52ACDD,0x000000,
0xE9DAB2,0xC99811,0xFDF9D4,0xF8B93C,0xFDEEBE,0xFBEBA6,0xDFAF4F,0xF3D57C};
+#define BTN_MANUAL_SEARCH 10
+
#define APP_PLUS_INI_PATH "/kolibrios/settings/app_plus.ini"
-#define APP_PLUS_INI_NOT_EXISTS "'APP+\n/kolibrios/settings/app_plus.ini is not exists.\nProgram terminated.' -tE"
+#define APP_PLUS_INI_NOT_EXISTS "'APP+\n/kolibrios/settings/app_plus.ini does not exists.\nProgram terminated.' -tE"
#define WINDOW_TITLE_TEXT "Error"
#define CONTENT_HEADER_TEXT "/KOLIBRIOS/ IS NOT MOUNTED"
@@ -49,9 +51,8 @@ void CheckKosMounted()
}
}
-void RunAutosearch()
+void WaitAutosearch()
{
- if (!CheckProcessExists("SEARCHAP")) io.run("/sys/SEARCHAP",0);
while (CheckProcessExists("SEARCHAP")) pause(2);
}
@@ -60,25 +61,24 @@ void main()
word id;
CheckKosMounted();
- RunAutosearch();
+ WaitAutosearch();
CheckKosMounted();
o_dialog.type = 2;
load_dll(Proc_lib, #OpenDialog_init,0);
OpenDialog_init stdcall (#o_dialog);
+ active_button_id = BTN_MANUAL_SEARCH;
loop() switch(WaitEvent())
{
case evButton:
id=GetButtonID();
if (id==1) ExitProcess();
- if (id==10)
- {
- OpenDialog_start stdcall (#o_dialog);
- if (o_dialog.status) SetAdditionalSystemDirectory("kolibrios", #openfile_path+1);
- pause(3);
- CheckKosMounted();
- }
+ if (id==BTN_MANUAL_SEARCH) EventManualSearch();
+ break;
+ case evKey:
+ GetKeys();
+ if (key_scancode == SCAN_CODE_ENTER) EventManualSearch();
break;
case evReDraw:
@@ -102,7 +102,15 @@ void draw_window()
PutPaletteImage(#scr,144,171,Form.cwidth-180,y.n,8,#scr_pal);
DrawRectangle(Form.cwidth-180-1,y.n-1, 144+1,171+1, system.color.work_graph);
- DrawCaptButton(x,Form.cheight-66,300,30,10,system.color.work_button,system.color.work_button_text,MANUALLY_BUTTON_TEXT);
+ DrawStandartCaptButton(x, Form.cheight-66, BTN_MANUAL_SEARCH, MANUALLY_BUTTON_TEXT);
+}
+
+void EventManualSearch()
+{
+ OpenDialog_start stdcall (#o_dialog);
+ if (o_dialog.status) SetAdditionalSystemDirectory("kolibrios", #openfile_path+1);
+ pause(3);
+ CheckKosMounted();
}
diff --git a/programs/cmm/app_plus/scr.png b/programs/cmm/app_plus/scr.png
index 71c1e18c33..d9c95ae29d 100644
Binary files a/programs/cmm/app_plus/scr.png and b/programs/cmm/app_plus/scr.png differ
diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c
index 6452936b87..67cefa8e3f 100644
--- a/programs/cmm/browser/WebView.c
+++ b/programs/cmm/browser/WebView.c
@@ -15,6 +15,7 @@
#include "..\lib\collection.h"
#include "..\lib\menu.h"
#include "..\lib\random.h"
+#include "..\lib\clipboard.h"
//*.obj libraries
#include "..\lib\obj\box_lib.h"
@@ -30,7 +31,7 @@
char homepage[] = FROM "html\\homepage.htm""\0";
#ifdef LANG_RUS
-char version[]="Текстовый браузер 1.71";
+char version[]="Текстовый браузер 1.72";
?define IMAGES_CACHE_CLEARED "Кэш картинок очищен"
?define T_LAST_SLIDE "Это последний слайд"
char loading[] = "Загрузка страницы...
";
@@ -40,10 +41,11 @@ char rmb_menu[] =
"Посмотреть исходник
Редактировать исходник
История
-Очистить кэш картинок
Менеджер загрузок";
+char link_menu[] =
+"Копировать ссылку";
#else
-char version[]="Text-based Browser 1.71";
+char version[]="Text-based Browser 1.72";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...
";
@@ -53,13 +55,11 @@ char rmb_menu[] =
"View source
Edit source
History
-Free image cache
Download Manager";
+char link_menu[] =
+"Copy link";
#endif
-char link_menu[] =
-"Copy link
-Download link";
#define URL_SERVICE_HISTORY "WebView://history"
#define URL_SERVICE_HOME "WebView://home"
@@ -96,10 +96,9 @@ enum {
VIEW_SOURCE=1100,
EDIT_SOURCE,
VIEW_HISTORY,
- FREE_IMG_CACHE,
+ //FREE_IMG_CACHE,
DOWNLOAD_MANAGER,
- COPY_LINK=1200,
- DOWNLOAD_LINK
+ COPY_LINK=1200
};
#include "..\TWB\TWB.c"
@@ -130,7 +129,6 @@ void main()
loop() switch(WaitEvent())
{
case evMouse:
- if (!CheckActiveProcess(Form.ID)) break;
edit_box_mouse stdcall (#address_box);
mouse.get();
if (WB1.list.MouseOver(mouse.x, mouse.y))
@@ -361,11 +359,11 @@ void ProcessEvent(dword id__)
}
else RunProgram("/rd/1/tinypad", #URL);
return;
- case FREE_IMG_CACHE:
- ImgCache.Free();
- notify(IMAGES_CACHE_CLEARED);
- WB1.DrawPage();
- return;
+ // case FREE_IMG_CACHE:
+ // ImgCache.Free();
+ // notify(IMAGES_CACHE_CLEARED);
+ // WB1.DrawPage();
+ // return;
case VIEW_HISTORY:
strcpy(#URL, URL_SERVICE_HISTORY);
OpenPage();
@@ -376,10 +374,13 @@ void ProcessEvent(dword id__)
CreateThread(#Downloader,#downloader_stak+4092);
}
return;
+ case COPY_LINK:
+ Clipboard__CopyText(PageLinks.GetURL(PageLinks.active));
+ notify("'URL copied to clipboard'O");
+ return;
}
}
-
void StopLoading()
{
if (http_transfer)
diff --git a/programs/cmm/clipview/clipview.c b/programs/cmm/clipview/clipview.c
index dae851986a..3cc3a9933c 100644
--- a/programs/cmm/clipview/clipview.c
+++ b/programs/cmm/clipview/clipview.c
@@ -41,9 +41,6 @@ enum {
proc_info Form;
-Clipboard clipboard;
-
-
//===================================================//
// //
// CODE //
@@ -53,7 +50,7 @@ Clipboard clipboard;
void main()
{
int id;
- SetEventMask(0x27);
+ SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
load_dll(boxlib, #box_lib_init,0);
loop()
{
@@ -61,12 +58,11 @@ void main()
switch(EAX & 0xFF)
{
case evMouse:
- if (!CheckActiveProcess(Form.ID)) break;
SelectList_ProcessMouse();
break;
case evButton:
- id=GetButtonID();
+ id = GetButtonID();
if (id==1) ExitProcess();
if (id==BT_DELETE_LAST_SLOT) EventDeleteLastSlot();
if (id==BT_DELETE_ALL_SLOTS) EventDeleteAllSlots();
@@ -98,7 +94,7 @@ void main()
break;
default:
- if (clipboard.GetSlotCount() > select_list.count) ClipViewSelectListDraw();
+ if (Clipboard__GetSlotCount() > select_list.count) ClipViewSelectListDraw();
break;
}
}
@@ -119,6 +115,16 @@ void DrawWindowContent()
SelectList_DrawBorder();
}
+dword slot_data;
+struct clipboard_data
+{
+ dword size;
+ dword type;
+ dword encoding;
+ dword content;
+ dword content_offset;
+} cdata;
+
void SelectList_DrawLine(dword i)
{
int yyy, length, slot_data_type_number;
@@ -126,21 +132,28 @@ void SelectList_DrawLine(dword i)
dword size_kb;
dword text_color = 0;
- clipboard.GetSlotData(select_list.first + i);
+ slot_data = Clipboard__GetSlotData(select_list.first + i);
+ cdata.size = ESDWORD[slot_data];
+ cdata.type = ESDWORD[slot_data+4];
+ if (cdata.type==SLOT_DATA_TYPE_TEXT) || (cdata.type==SLOT_DATA_TYPE_TEXT_BLOCK)
+ cdata.content_offset = 12;
+ else
+ cdata.content_offset = 8;
+ cdata.content = slot_data + cdata.content_offset;
+
yyy = i*select_list.item_h+select_list.y;
WriteText(select_list.x+12, yyy+select_list.text_y, select_list.font_type, text_color, itoa(select_list.first + i));
- //WriteText(select_list.x+44, yyy+select_list.text_y, select_list.font_type, text_color, itoa(clipboard.slot_data.size));
- size_kb = ConvertSizeToKb(clipboard.slot_data.size);
+ size_kb = ConvertSizeToKb(cdata.size);
WriteText(select_list.x+44, yyy+select_list.text_y, select_list.font_type, text_color, size_kb);
- slot_data_type_number = clipboard.slot_data.type;
+ slot_data_type_number = cdata.type;
WriteText(select_list.x+140, yyy+select_list.text_y, select_list.font_type, text_color, data_type[slot_data_type_number]);
WriteText(select_list.x+select_list.w - 88, yyy+select_list.text_y, select_list.font_type, 0x006597, T_VIEW_OPTIONS);
DefineButton(select_list.x+select_list.w - 95, yyy, 50, select_list.item_h, 100+i+BT_HIDE, NULL);
DefineButton(select_list.x+select_list.w - 95 + 51, yyy, 40, select_list.item_h, 300+i+BT_HIDE, NULL);
length = select_list.w-236 - 95 / select_list.font_w - 2;
- if (clipboard.slot_data.size-8 < length) length = clipboard.slot_data.size-8;
- memmov(#line_text, clipboard.slot_data.content, length);
+ if (cdata.size - cdata.content_offset < length) length = cdata.size - cdata.content_offset;
+ memmov(#line_text, cdata.content, length);
replace_char(#line_text, 0, 31, length); // 31 is a dot
WriteText(select_list.x+236, yyy+select_list.text_y, select_list.font_type, text_color, #line_text);
}
@@ -155,9 +168,8 @@ replace_char(dword in_str, char from_char, to_char, int length) {
ESBYTE[in_str+length]=0;
}
-int SaveSlotContents(int slot_id) {
- clipboard.GetSlotData(slot_id);
- EAX = WriteFile(clipboard.slot_data.size, clipboard.slot_data.content, DEFAULT_SAVE_PATH);
+int SaveSlotContents(dword size, off) {
+ EAX = WriteFile(size, off, DEFAULT_SAVE_PATH);
if (!EAX)
{
return true;
@@ -169,7 +181,7 @@ int SaveSlotContents(int slot_id) {
}
void ClipViewSelectListDraw() {
- select_list.count = clipboard.GetSlotCount();
+ select_list.count = Clipboard__GetSlotCount();
SelectList_Draw();
}
@@ -188,27 +200,33 @@ void EventDeleteLastSlot()
int i;
for (i=0; i