From 5e9c271f01ae4cfb63f9a2c27ccda1710189e852 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 20 Jan 2014 23:42:18 +0000 Subject: [PATCH] HTMLv 0.99.64: cursor pointer support for links git-svn-id: svn://kolibrios.org@4497 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/TWB/TWB.c | 3 +- programs/cmm/TWB/links.h | 74 +++++++---------------------------- programs/cmm/TWB/pointer.cur | Bin 0 -> 3262 bytes programs/cmm/browser/HTMLv.c | 5 ++- programs/cmm/lib/cursor.h | 45 +++++++++++++++++++++ 5 files changed, 64 insertions(+), 63 deletions(-) create mode 100644 programs/cmm/TWB/pointer.cur create mode 100644 programs/cmm/lib/cursor.h diff --git a/programs/cmm/TWB/TWB.c b/programs/cmm/TWB/TWB.c index 160cf224f9..455d60533a 100644 --- a/programs/cmm/TWB/TWB.c +++ b/programs/cmm/TWB/TWB.c @@ -1,5 +1,6 @@ #include "..\lib\draw_buf.h" #include "..\lib\list_box.h" +#include "..\lib\cursor.h" #include "..\TWB\links.h" int downloader_id; @@ -595,7 +596,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) { } ELSE li_tab++; if (isTag("dd")) stolbec += 5; if (isTag("blockquote")) blq_text = opened; - if (isTag("pre")) pre_text = opened; + if (isTag("pre")) || (isTag("code")) pre_text = opened; if (isTag("hr")) { if (anchor) || (stroka < -1) diff --git a/programs/cmm/TWB/links.h b/programs/cmm/TWB/links.h index c99cec22a1..16cebaa965 100644 --- a/programs/cmm/TWB/links.h +++ b/programs/cmm/TWB/links.h @@ -1,3 +1,6 @@ +CustomCursor CursorPointer; +dword CursorFile = FROM "../TWB/pointer.cur"; + struct array_link { dword link, text; int x,y,w,h; @@ -51,81 +54,32 @@ void LinksArray::Clear() buflen = #page_links; count = 0; active = -1; + CursorPointer.Restore(); } + void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col) { int i; - if (active>=0) - { - //WriteText(links[active].x,links[active].y, 0x80, link_col_in, links[active].text); - DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in); - active = -1; - } for (i=0; ilinks[i].x) && (my>links[i].y) && (mxZrE5JiVrmYYcFtdtgw({lkAT!Hi0C1s9bafLKF09QatLyIUVoNE2-kw<6~ z7uhvcSZRh~7v9YL-4%I~L^d0drHCA#MbeDFbqc4)b?3$V0;MNS!*g7=>0h6$E)GNc^&hAuEx(y&F7qO zc-YqXQtuH+ac?PX-fqwzg45Qy)5^IX`&u~nd9g(8z*9!{PTaHJzhHZeJU9C$J_B^J B+LizS literal 0 HcmV?d00001 diff --git a/programs/cmm/browser/HTMLv.c b/programs/cmm/browser/HTMLv.c index 48d6799533..1fc4671094 100644 --- a/programs/cmm/browser/HTMLv.c +++ b/programs/cmm/browser/HTMLv.c @@ -25,11 +25,11 @@ #include "img\URLgoto.txt"; #ifdef LANG_RUS - char version[]=" ⮢ 㧥 0.99.63"; + char version[]=" ⮢ 㧥 0.99.64"; ?define IMAGES_CACHE_CLEARED " ⨭ 饭" ?define T_LAST_SLIDE " ᫥ ᫠" #else - char version[]=" Text-based Browser 0.99.63"; + char version[]=" Text-based Browser 0.99.64"; ?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define T_LAST_SLIDE "This slide is the last" #endif @@ -64,6 +64,7 @@ void main() if (!URL) strcpy(#URL, "/sys/index.htm"); strcpy(#editURL, #URL); + CursorPointer.Load(#CursorFile); Form.width=WIN_W; Form.height=WIN_H; SetElementSizes(); diff --git a/programs/cmm/lib/cursor.h b/programs/cmm/lib/cursor.h new file mode 100644 index 0000000000..729d6e2da6 --- /dev/null +++ b/programs/cmm/lib/cursor.h @@ -0,0 +1,45 @@ +// cursor file should be 32x32 in default MS Windows .cur format + +struct CustomCursor +{ + dword CursorPointer; + dword Load(); + dword Set(); + dword Restore(); + void Delete(); +}; + +dword CustomCursor::Load(dword CursorFilePath) +{ + if (CursorPointer) return; + EAX = 37; + EBX = 4; + ECX = CursorFilePath; + EDX = 1; + $int 0x40 + CursorPointer = EAX; // 0 - err, other - handle +} + +dword CustomCursor::Set() +{ + EAX = 37; + EBX = 5; + ECX = CursorPointer; + $int 0x40 +} + +dword CustomCursor::Restore() +{ + EAX = 37; + EBX = 5; + ECX = 0; + $int 0x40 +} + +void CustomCursor::Delete() +{ + EAX = 37; + EBX = 6; + ECX = CursorPointer; + $int 0x40 +}