Compare commits
5 Commits
webview-3.
...
main
Author | SHA1 | Date | |
---|---|---|---|
0c4d4cbf9d | |||
ae90da403c | |||
4550e15838 | |||
cc867a0bb8 | |||
16a0ef9543 |
@@ -428,7 +428,7 @@ tup.append_table(img_files, {
|
||||
{"KPACK", VAR_PROGS .. "/other/kpack/trunk/kpack"},
|
||||
{"LAUNCHER", VAR_PROGS .. "/system/launcher/trunk/launcher"},
|
||||
{"LOADDRV", VAR_PROGS .. "/system/loaddrv/loaddrv"},
|
||||
{"MAGNIFY", VAR_PROGS .. "/demos/magnify/trunk/magnify"},
|
||||
{"MAGNIFY", VAR_PROGS .. "/system/magnify/magnify"},
|
||||
{"MGB", VAR_PROGS .. "/testing/mgb/trunk/mgb"},
|
||||
{"MOUSEMUL", VAR_PROGS .. "/system/mousemul/trunk/mousemul"},
|
||||
{"MADMOUSE", VAR_PROGS .. "/other/madmouse/madmouse"},
|
||||
|
@@ -284,7 +284,7 @@ MEM_AMOUNT = OS_BASE + 0x000FE8C
|
||||
SYS_SHUTDOWN = OS_BASE + 0x000FF00
|
||||
|
||||
|
||||
TMP_STACK_TOP = 0x008CC00
|
||||
TMP_STACK_TOP = 0x0096F00
|
||||
|
||||
sys_proc = OS_BASE + 0x008E000
|
||||
|
||||
|
@@ -175,7 +175,7 @@ iglobal
|
||||
dd sys_socket ; 75-reserved for new stack
|
||||
dd sys_protocols ; 76-reserved for new stack
|
||||
dd sys_posix ; posix support
|
||||
dd undefined_syscall ; 78-free
|
||||
dd syscall_qrcode ; 78-QR code
|
||||
dd undefined_syscall ; 79-free
|
||||
dd sys_fileSystemUnicode ; 80-File system interface for different encodings
|
||||
|
||||
|
@@ -4430,6 +4430,8 @@ sys_apm:
|
||||
ret
|
||||
; -----------------------------------------
|
||||
|
||||
include 'qrcode.inc'
|
||||
|
||||
align 4
|
||||
undefined_syscall: ; Undefined system call
|
||||
mov [esp + SYSCALL_STACK.eax], -1
|
||||
|
2153
kernel/trunk/qrcode.inc
Normal file
2153
kernel/trunk/qrcode.inc
Normal file
File diff suppressed because it is too large
Load Diff
@@ -85,6 +85,7 @@ struct TWebBrowser {
|
||||
void tag_table();
|
||||
void tag_td();
|
||||
void tag_tr();
|
||||
void reset_font_style();
|
||||
};
|
||||
|
||||
#include "TWB\render.h"
|
||||
@@ -94,16 +95,16 @@ void TWebBrowser::SetPageDefaults()
|
||||
{
|
||||
t_html = t_body = link = false;
|
||||
style.reset();
|
||||
reset_font_style();
|
||||
link_color_default = 0x0000FF;
|
||||
link_color_active = 0xFF0000;
|
||||
style.cur_line_h = list.item_h;
|
||||
links.clear();
|
||||
anchors.clear();
|
||||
img_url.drop();
|
||||
text_colors.drop();
|
||||
text_colors.add(0);
|
||||
if (secondrun) {
|
||||
canvas.Init(list.x, list.y, list.w, math.max(list.visible, list.count));
|
||||
canvas.Init(list.x, list.y, list.w, math.max(list.visible, list.count)+200);
|
||||
canvas.Fill(0, bg_colors.get(0));
|
||||
}
|
||||
bg_colors.drop();
|
||||
@@ -114,7 +115,6 @@ void TWebBrowser::SetPageDefaults()
|
||||
draw_w = list.w - BODY_MARGIN - BODY_MARGIN;
|
||||
linebuf = 0;
|
||||
redirect = '\0';
|
||||
list.SetFont(8, 14, 10011000b);
|
||||
tag_table_reset();
|
||||
is_html = true;
|
||||
if (!strstri(bufpointer, "<body")) {
|
||||
|
@@ -49,14 +49,14 @@ void TWebBrowser::RenderLine(dword _line)
|
||||
pc = text_colors.get_last();
|
||||
if (link) && (pc == text_colors.get(0)) pc = link_color_default;
|
||||
|
||||
canvas.WriteText(draw_x, draw_y, list.font_type, pc, _line, NULL);
|
||||
if (style.b) canvas.WriteText(draw_x+1, draw_y, list.font_type, pc, _line, NULL);
|
||||
canvas.WriteText(draw_x, draw_y+1, list.font_type, pc, _line, NULL);
|
||||
if (style.b) canvas.WriteText(draw_x+1, draw_y+1, list.font_type, pc, _line, NULL);
|
||||
if (style.s) canvas.DrawBar(draw_x, list.item_h / 2 - zoom + draw_y, pw, zoom, pc);
|
||||
if (style.u) canvas.DrawBar(draw_x, list.item_h - zoom - zoom + draw_y, pw, zoom, pc);
|
||||
if (style.u) canvas.DrawBar(draw_x, draw_y + list.font_h, pw, zoom, pc);
|
||||
if (link) {
|
||||
if (ESBYTE[_line]==' ') && (ESBYTE[_line+1]==NULL) {} else {
|
||||
canvas.DrawBar(draw_x, draw_y + list.item_h - calc(zoom*2)-1, pw, zoom, link_color_default);
|
||||
links.add_text(draw_x, draw_y + list.y, pw, list.item_h - calc(zoom*2)-1, zoom);
|
||||
canvas.DrawBar(draw_x, draw_y + list.font_h, pw, zoom, link_color_default);
|
||||
links.add_text(draw_x, draw_y + list.y, pw, list.font_h, zoom);
|
||||
}
|
||||
}
|
||||
_SKIP_DRAW:
|
||||
|
@@ -208,9 +208,20 @@ void TWebBrowser::tag_li()
|
||||
void TWebBrowser::tag_hr()
|
||||
{
|
||||
dword hrcol = 0x00777777;
|
||||
if (tag.get_value_of("color")) hrcol = GetColor(tag.value);
|
||||
dword hr_width = draw_w-BODY_MARGIN-BODY_MARGIN;
|
||||
dword hr_size = 1;
|
||||
if (tag.get_value_of("color")) {
|
||||
hrcol = GetColor(tag.value);
|
||||
}
|
||||
if (tag.get_value_of("width")) && (!strchr(tag.value, '%')) {
|
||||
hr_width = math.min(hr_width, tag.get_number_of("width"));
|
||||
}
|
||||
if (tag.get_number_of("size")) {
|
||||
hr_size = math.min(500, tag.number);
|
||||
}
|
||||
if (draw_x != left_gap) NewLine();
|
||||
if (secondrun) canvas.DrawBar(5+left_gap, style.cur_line_h / 2 + draw_y - 1, draw_w-10, 1, hrcol);
|
||||
if (secondrun) canvas.DrawBar(left_gap, style.cur_line_h / 2 + draw_y - 1, hr_width, hr_size, hrcol);
|
||||
draw_y += hr_size - 3;
|
||||
draw_x++;
|
||||
NewLine();
|
||||
return;
|
||||
@@ -235,6 +246,12 @@ void TWebBrowser::tag_q()
|
||||
chrncat(#linebuf, '\"', sizeof(TWebBrowser.linebuf));
|
||||
}
|
||||
|
||||
void TWebBrowser::reset_font_style()
|
||||
{
|
||||
list.SetFont(BASIC_CHAR_W, 14, 10011000b);
|
||||
style.cur_line_h = list.item_h = list.font_h + 5;
|
||||
}
|
||||
|
||||
void TWebBrowser::tag_h1234_caption()
|
||||
{
|
||||
if (ESBYTE[#tag.name+1]=='4') {
|
||||
@@ -250,19 +267,18 @@ void TWebBrowser::tag_h1234_caption()
|
||||
NewLine();
|
||||
}
|
||||
if (tag.is("h1")) {
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+14, 10011001b);
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+13, 10011001b);
|
||||
style.b = true;
|
||||
} else if (tag.is("h2")) {
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+14, 10011001b);
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+13, 10011001b);
|
||||
} else {
|
||||
list.SetFont(6*2, 9+7, 10001001b);
|
||||
list.SetFont(6*2, 9+8, 10001001b);
|
||||
}
|
||||
style.cur_line_h = list.item_h = list.font_h + 2;
|
||||
style.cur_line_h = list.item_h = list.font_h + 3;
|
||||
} else {
|
||||
if (tag.is("h1")) style.b = false;
|
||||
NewLine();
|
||||
list.SetFont(BASIC_CHAR_W, 14, 10011000b);
|
||||
style.cur_line_h = list.item_h = BASIC_LINE_H;
|
||||
reset_font_style();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,7 +292,7 @@ void TWebBrowser::tag_kosicon()
|
||||
if (shared_i18) && (tag.get_number_of("n")) {
|
||||
if (tag.number < maxicon) {
|
||||
if (draw_x + 18 > canvas.bufw) NewLine();
|
||||
canvas.DrawImage(draw_x, draw_y-2, 18, 18, 18*18*4*tag.number+shared_i18);
|
||||
canvas.DrawImage(draw_x, draw_y-1, 18, 18, 18*18*4*tag.number+shared_i18);
|
||||
draw_x += 22;
|
||||
}
|
||||
}
|
||||
|
@@ -112,4 +112,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
|
||||
|
||||
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
|
||||
|
||||
char version[]="WebView 3.9";
|
||||
char version[]="WebView 3.91";
|
@@ -1,7 +1,7 @@
|
||||
#ifdef LANG_RUS
|
||||
#define HISTORY_HEADER "<html><title><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></title><body><b><3E><><EFBFBD><EFBFBD>饭<EFBFBD><E9A5AD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD></b><br>"
|
||||
#define HISTORY_HEADER "<html><title><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></title><body bgcolor=#fff><h3><3E><><EFBFBD><EFBFBD>饭<EFBFBD><E9A5AD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD></h3><br>"
|
||||
#else
|
||||
#define HISTORY_HEADER "<html><title>History</title><body><b>Visited pages</b><br>"
|
||||
#define HISTORY_HEADER "<html><title>History</title><body bgcolor=#fff><h3>Visited pages</h3><br>"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ ShowHistory()
|
||||
|
||||
for (i=0; i<history.items.count-1; i++) //if (cache.type.get(i) == PAGE)
|
||||
{
|
||||
strcat(history_pointer, "<a href='");
|
||||
strcat(history_pointer, "<kosicon n=3><a href='");
|
||||
strcat(history_pointer, history.items.get(i));
|
||||
strcat(history_pointer, "'>");
|
||||
strcat(history_pointer, history.items.get(i));
|
||||
|
@@ -1,18 +1,18 @@
|
||||
<html><head><title>New tab</title></head>
|
||||
<body bgcolor=#fff>
|
||||
|
||||
<table><tr><td width=20><td width=210><pre>
|
||||
___________________
|
||||
<table><tr><td width=20><td width=220><pre>
|
||||
_____________________
|
||||
|# : : #|
|
||||
| : WebView : |
|
||||
| : TextBased : |
|
||||
| : Browser : |
|
||||
| : for : |
|
||||
| : KolibriOS : |
|
||||
| : : |
|
||||
| :_____________: |
|
||||
| ___________ |
|
||||
| :_______________: |
|
||||
| ____________ |
|
||||
| | __ | |
|
||||
| || | | |
|
||||
\____||__|_______|__|<font color=#DDD>lc</font>
|
||||
\_____||__|________|__|<font color=#DDD>lc</font>
|
||||
|
||||
<font bg=#F8F15B> web <font bg=#FF5A7E color=#fff> 1.0 <font bg=#47D018> compatable
|
||||
<font bg=#3CE7FF> </font></font></font></font>
|
||||
|
@@ -1,18 +1,18 @@
|
||||
<html><head><title><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></title></head>
|
||||
<body bgcolor=#fff>
|
||||
|
||||
<table><tr><td width=20><td width=210><pre>
|
||||
___________________
|
||||
<table><tr><td width=20><td width=220><pre>
|
||||
_____________________
|
||||
|# : : #|
|
||||
| : WebView : |
|
||||
| : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮢<EFBFBD><EFBFBD> : |
|
||||
| : <EFBFBD><EFBFBD><EFBFBD>㧥<EFBFBD> : |
|
||||
| : for : |
|
||||
| : KolibriOS : |
|
||||
| : : |
|
||||
| :_____________: |
|
||||
| ___________ |
|
||||
| :_______________: |
|
||||
| ____________ |
|
||||
| | __ | |
|
||||
| || | | |
|
||||
\____||__|_______|__|<font color=#DDD>lc</font>
|
||||
\_____||__|________|__|<font color=#DDD>lc</font>
|
||||
|
||||
<font bg=#F8F15B> web <font bg=#FF5A7E color=#fff> 1.0 <font bg=#47D018> compatable
|
||||
<font bg=#3CE7FF> </font></font></font></font>
|
||||
|
@@ -5,12 +5,19 @@
|
||||
<title>Тест Acid 0.1</title>
|
||||
</head>
|
||||
<body bgcolor="#000000" link="#0066FF" text="#FFFFFF">
|
||||
<h1 align=center>Это тестовая страница для проверки WebViewer</h1>
|
||||
<br />
|
||||
<p>WebViewer является текстовым браузером и поддерживает все популярные кодировки (cp1251, koi-8, cp866, unicode)
|
||||
и некоторые теги. Поддержка таблииц (<table>), CSS, Javascript'a и Контактика пока не реализована :)
|
||||
<h1 align=center>Тест Acid 0.1</h1>
|
||||
<br>
|
||||
<b>Это тестовая страница для проверки текстового браузера <s>HTML Viewer</s> WebView</b>
|
||||
|
||||
<p>Из кодировок поддерживаются: CP866(DOS), CP1251(Windows), CP1252(Latin legacy), KOI8, и конечно UTF8. CSS и Javascript пока не реализованы (ахахаха). Поддержка тега <table> крайне базовая, поддержки вложенных таблиц нет.
|
||||
</p>
|
||||
<br />
|
||||
|
||||
<h3>История</h3>
|
||||
|
||||
Ранее программа называлась <b >HTMLv (HTML Viewer)</b> и изначально задумывалась как <q>Центр справки и поддержки</q>. Чтобы не изобретать велосипед и одновременно исполнить мечту многих, форматом просматриваемых страниц был выбран html.
|
||||
Первоначальный автор Veliant, затем разработка была подхвачена дизайнером Leency. Это была моя вторая программа после файлового менеджера Eolite.<br>
|
||||
|
||||
<span> <br />
|
||||
|
||||
<b>
|
||||
<font color="#FF0000">K</font>
|
||||
@@ -33,7 +40,8 @@
|
||||
</b>
|
||||
<br>
|
||||
|
||||
<p>
|
||||
<table>
|
||||
<td>
|
||||
<bg bgcolor=#333>
|
||||
Небольшой список:<ol>
|
||||
<li><q>Этот текст в кавычках</q></li>
|
||||
@@ -46,17 +54,14 @@
|
||||
</p>
|
||||
<br>
|
||||
|
||||
<pre>
|
||||
"Осень уже пришла!"-
|
||||
Шепнул мне на ухо ветер,
|
||||
Подкравшись к подушке моей.
|
||||
|
||||
Басе
|
||||
</pre>
|
||||
<!-- комментарий: этого текста здесь <нет> -->
|
||||
|
||||
<br>
|
||||
|
||||
<img alt="нет картинки, просто alt">
|
||||
|
||||
<img src = http://wiby.org/about/wibyplex.gif>
|
||||
|
||||
<a href="http://kolibrios.org/i/logo.png"><img id="2.1.4" src="http://kolibrios.org/i/logo.png" alt="logo"><br>Открыть</a><br>
|
||||
|
||||
<br>
|
||||
@@ -65,10 +70,25 @@
|
||||
<a href='/sys/index.htm'>Незакрытый тег а - index.htm<br>
|
||||
<a href="/sys/calc">/sys/calc</a><br>
|
||||
<a href="#2.1.4">#2.1.4</a><br>
|
||||
<a href="http://bash.im">http://bash.im</a><br>
|
||||
<a href="http://kolibrios.org">http://kolibrios.org</a><br>
|
||||
<a href="mailto:leency@mail.ru">Mail to Leency</a><br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<h1><a href=#>Link H1</a> <u>Underline H1</u></h1>
|
||||
<h2><a href=#>Link H2</a> <u>Underline H2</u></h2>
|
||||
<h3><a href=#>Link H3</a> <u>Underline H2</u></h3>
|
||||
<a href=#>Link</a> <u>Underline</u>
|
||||
|
||||
<td>
|
||||
|
||||
<pre>
|
||||
"Осень уже пришла!"-
|
||||
Шепнул мне на ухо ветер,
|
||||
Подкравшись к подушке моей.
|
||||
|
||||
Басе
|
||||
|
||||
</pre><br>
|
||||
|
||||
В этом тексте есть переход на следующую строку, но браузер
|
||||
его должен проигнорировать. Еще много пробелов. А тут есть
|
||||
@@ -80,8 +100,19 @@
|
||||
корпус на территории НТУ «ХПИ»
|
||||
</p>
|
||||
|
||||
<pre><font color="#000">
|
||||
<font bg=#FFED00 style="background-color:#FFED00"> Заметки </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> Речка на Жукова </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> Heroes 3 </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> Рисостерон, куринабол </font>
|
||||
<font bg=#FFFBCE style="background-color:#FFFBCE"> </font>
|
||||
</font></pre>
|
||||
|
||||
</table>
|
||||
|
||||
<hr color="#758999">
|
||||
<center>Zhitomyr 2008-2015</center>
|
||||
<center>Zhytomyr 2008-2025</center>
|
||||
|
||||
|
||||
</body>
|
||||
|
@@ -1,7 +0,0 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR")
|
||||
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||
add_include(tup.getvariantdir())
|
||||
|
||||
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
|
||||
tup.rule({"magnify.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "magnify")
|
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en_US >lang.inc
|
||||
@fasm magnify.asm magnify
|
||||
@kpack magnify
|
||||
@erase lang.inc
|
||||
@pause
|
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru_RU >lang.inc
|
||||
@fasm magnify.asm magnify
|
||||
@kpack magnify
|
||||
@erase lang.inc
|
||||
@pause
|
@@ -1,156 +0,0 @@
|
||||
;---------------------------------------------------------------------
|
||||
; MAGNIFY SCREEN v1.0
|
||||
;
|
||||
; Version for KolibriOS 2005-2011
|
||||
;
|
||||
; Version for Menuet to 2005
|
||||
;---------------------------------------------------------------------
|
||||
; last update: 08/18/2011
|
||||
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
||||
; changes: Checking for "rolled up" window
|
||||
;---------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 1 ; header version
|
||||
dd START ; program start
|
||||
dd I_END ; program image size
|
||||
dd 0x1000 ; required amount of memory
|
||||
dd 0x1000 ; esp
|
||||
dd 0, 0 ; no parameters, no path
|
||||
;---------------------------------------------------------------------
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
include '..\..\..\macros.inc'
|
||||
delay equ 20
|
||||
|
||||
magnify_width = 40
|
||||
magnify_height = 30
|
||||
;---------------------------------------------------------------------
|
||||
START: ; start of execution
|
||||
redraw:
|
||||
call draw_window
|
||||
still:
|
||||
call draw_magnify
|
||||
wtevent:
|
||||
mcall 23,delay ; wait here for event with timeout
|
||||
dec eax
|
||||
js still
|
||||
jz redraw
|
||||
dec eax
|
||||
jnz button
|
||||
; key in buffer
|
||||
mov al, 2
|
||||
mcall
|
||||
jmp wtevent
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
; we have only one button, close
|
||||
or eax, -1
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
;---------------------------------------------------------------------
|
||||
draw_window:
|
||||
mcall 12,1
|
||||
|
||||
mov al, 48 ; function 48 : graphics parameters
|
||||
mov bl, 4 ; subfunction 4 : get skin height
|
||||
mcall
|
||||
; DRAW WINDOW
|
||||
mov ebx, 100*65536 + 8*magnify_width + 8
|
||||
lea ecx, [eax + 100*65536 + 8*magnify_height + 3]
|
||||
mov edx, 0x34000000 ; color of work area RRGGBB
|
||||
mov edi, labelt ; header
|
||||
xor eax, eax ; function 0 : define and draw window
|
||||
mcall
|
||||
|
||||
mcall 12,2
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_magnify:
|
||||
mcall 9,procinfo,-1
|
||||
mov eax,[procinfo+70] ;status of window
|
||||
test eax,100b
|
||||
jne .end
|
||||
|
||||
mcall 14 ; get screen size
|
||||
movzx ecx, ax
|
||||
inc ecx
|
||||
mov [size_y], ecx
|
||||
shr eax, 16
|
||||
inc eax
|
||||
mov [size_x], eax
|
||||
|
||||
xor ebx, ebx
|
||||
mcall 37 ; get mouse coordinates
|
||||
mov ecx, eax
|
||||
shr ecx, 16 ; ecx = x
|
||||
movzx edx, ax ; edx = y
|
||||
inc ecx
|
||||
mov [m_xe], ecx
|
||||
inc edx
|
||||
mov [m_ye], edx
|
||||
sub ecx, magnify_width
|
||||
sub edx, magnify_height
|
||||
mov [m_x], ecx
|
||||
mov [m_y], edx
|
||||
.loop_y:
|
||||
.loop_x:
|
||||
xor eax, eax ; assume black color for invalid pixels
|
||||
test ecx, ecx
|
||||
js .nopix
|
||||
cmp ecx, [size_x]
|
||||
jge .nopix
|
||||
test edx, edx
|
||||
js .nopix
|
||||
cmp edx, [size_y]
|
||||
jge .nopix
|
||||
mov ebx, edx
|
||||
imul ebx, [size_x]
|
||||
add ebx, ecx
|
||||
mcall 35 ; read pixel
|
||||
.nopix:
|
||||
push ecx edx
|
||||
sub ecx, [m_x]
|
||||
sub edx, [m_y]
|
||||
mov ebx, ecx
|
||||
shl ebx, 3+16
|
||||
mov bl, 8
|
||||
mov ecx, edx
|
||||
shl ecx, 3+16
|
||||
mov cl, 8
|
||||
mov edx, eax
|
||||
mcall 13
|
||||
pop edx ecx
|
||||
inc ecx
|
||||
cmp ecx, [m_xe]
|
||||
jnz .loop_x
|
||||
mov ecx, [m_x]
|
||||
inc edx
|
||||
cmp edx, [m_ye]
|
||||
jnz .loop_y
|
||||
.end:
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; DATA AREA
|
||||
;---------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
labelt:
|
||||
db 'Magnifier - <20><>࠭<EFBFBD><E0A0AD><EFBFBD> <20>㯠', 0
|
||||
else ; Default to en_US
|
||||
labelt:
|
||||
db 'Magnifier', 0
|
||||
end if
|
||||
|
||||
I_END:
|
||||
align 4
|
||||
m_x dd ?
|
||||
m_y dd ?
|
||||
m_xe dd ?
|
||||
m_ye dd ?
|
||||
size_x dd ?
|
||||
size_y dd ?
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
218
programs/other/qrclipboard/qrclipboard.asm
Normal file
218
programs/other/qrclipboard/qrclipboard.asm
Normal file
@@ -0,0 +1,218 @@
|
||||
; QR code generator from clipbboard
|
||||
;
|
||||
; This program uses code from someone else's program, so the notice below
|
||||
; is kept for compliance purposes.
|
||||
|
||||
|
||||
;*****************************************************************************
|
||||
; Read the data from the clipboard
|
||||
; Copyright (c) 2013, Marat Zakiyanov aka Mario79, aka Mario
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
; * Redistributions of source code must retain the above copyright
|
||||
; notice, this list of conditions and the following disclaimer.
|
||||
; * Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
; * Neither the name of the <organization> nor the
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;******************************************************************************
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd START
|
||||
dd IM_END
|
||||
dd I_END
|
||||
dd stacktop
|
||||
dd 0x0
|
||||
dd 0x0
|
||||
;---------------------------------------------------------------------
|
||||
include 'macros.inc'
|
||||
|
||||
START:
|
||||
mcall 68,11
|
||||
red:
|
||||
call draw_window
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
cmp eax,1
|
||||
je red
|
||||
cmp eax,2
|
||||
je key
|
||||
cmp eax,3
|
||||
je button
|
||||
|
||||
jmp still
|
||||
|
||||
key:
|
||||
mcall 2
|
||||
jmp still
|
||||
|
||||
button:
|
||||
mcall 17
|
||||
cmp ah,2
|
||||
je .read_button
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
|
||||
.read_button:
|
||||
call draw_clipboard
|
||||
jmp still
|
||||
|
||||
draw_window:
|
||||
mcall 12,1
|
||||
xor esi,esi
|
||||
mcall 0,<0,600>,<0,400>,0x13FFFFFF,,title
|
||||
mcall 8,<20,150>,<40,20>,2,0xCCCCCC
|
||||
mcall 4,<25,47>,0x90000000,read_button_text
|
||||
mcall 12,2
|
||||
ret
|
||||
|
||||
draw_clipboard:
|
||||
mcall 54,0
|
||||
cmp eax,-1
|
||||
je exit
|
||||
|
||||
test eax,eax
|
||||
jz exit
|
||||
|
||||
mov [slots_number],eax
|
||||
dec eax
|
||||
mov [current_slot],eax
|
||||
|
||||
mov [text_coordinates],dword 10 shl 16+70
|
||||
start:
|
||||
xor eax,eax
|
||||
mov [current_slot_data],eax
|
||||
mcall 54,1,[current_slot]
|
||||
|
||||
cmp eax,-1
|
||||
je .no_relevant_data
|
||||
|
||||
cmp eax,1
|
||||
jne @f
|
||||
|
||||
.no_relevant_data:
|
||||
mov edx,no_relevant_data_text
|
||||
mov esi,no_relevant_data_text.end-no_relevant_data_text
|
||||
jmp print
|
||||
.no_relevant_data_1:
|
||||
mov edx,no_relevant_data_text_1
|
||||
mov esi,no_relevant_data_text_1.end-no_relevant_data_text_1
|
||||
jmp print
|
||||
.no_relevant_data_2:
|
||||
mov edx,no_relevant_data_text_2
|
||||
mov esi,no_relevant_data_text_2.end-no_relevant_data_text_2
|
||||
jmp print
|
||||
@@:
|
||||
mov [current_slot_data],eax
|
||||
mov eax,[current_slot_data]
|
||||
mov esi,[eax]
|
||||
sub esi,12
|
||||
add eax,4
|
||||
cmp [eax],dword 2
|
||||
jge .no_relevant_data_1
|
||||
add eax,4
|
||||
;cmp [eax],dword 1 ; cp866
|
||||
;je .no_relevant_data_2 ;
|
||||
|
||||
|
||||
;push 0
|
||||
cmp [eax], dword 0
|
||||
jne @f
|
||||
; push 26
|
||||
jmp skip2
|
||||
@@:
|
||||
cmp [eax], dword 2
|
||||
jne @f
|
||||
;push 22
|
||||
jmp skip2
|
||||
@@:
|
||||
|
||||
|
||||
skip2:
|
||||
|
||||
add eax,4
|
||||
mov edx, matrix
|
||||
mov ebx, eax
|
||||
mov ecx, esi
|
||||
mov eax, 78
|
||||
int 0x40
|
||||
|
||||
mov ebx, matrix
|
||||
mov ecx, eax
|
||||
shl ecx, 16
|
||||
add ecx, eax
|
||||
mov eax, 7
|
||||
mov edx, 40
|
||||
shl edx, 16
|
||||
add edx, 80
|
||||
int 0x40
|
||||
doneQR:
|
||||
print:
|
||||
mov ecx,[current_slot_data]
|
||||
test ecx,ecx
|
||||
jz @f
|
||||
@@:
|
||||
add [text_coordinates],dword 15
|
||||
dec dword [current_slot]
|
||||
dec dword [slots_number]
|
||||
exit:
|
||||
ret
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
title:
|
||||
db 'Make QR code from the clipboard ',0
|
||||
read_button_text:
|
||||
db 'Make QR code ',0
|
||||
no_relevant_data_text:
|
||||
db '<NO RELEVANT DATA>',0
|
||||
.end:
|
||||
no_relevant_data_text_1:
|
||||
db '<NO TEXT>',0
|
||||
.end:
|
||||
no_relevant_data_text_2:
|
||||
db '<NO 866>',0
|
||||
.end:
|
||||
;---------------------------------------------------------------------
|
||||
IM_END:
|
||||
slots_number:
|
||||
rd 1
|
||||
text_coordinates:
|
||||
rd 1
|
||||
current_slot:
|
||||
rd 1
|
||||
current_slot_data:
|
||||
rd 1
|
||||
|
||||
;----------------------
|
||||
|
||||
matrix DD 31330 * 3 DUP (?)
|
||||
|
||||
;--------------------------------------
|
||||
rb 5555
|
||||
stacktop:
|
||||
rb 4
|
||||
;---------------------------------------------------------------------
|
||||
I_END:
|
||||
;---------------------------------------------------------------------
|
4
programs/system/magnify/Tupfile.lua
Normal file
4
programs/system/magnify/Tupfile.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
|
||||
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||
tup.rule("magnify.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o" .. tup.getconfig("KPACK_CMD"), "%B")
|
229
programs/system/magnify/magnify.asm
Normal file
229
programs/system/magnify/magnify.asm
Normal file
@@ -0,0 +1,229 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
;
|
||||
; Magnify - Screen Magnifier
|
||||
; Copyright (C) 2005 MenuetOS
|
||||
; Copyright (C) 2005-2025 KolibriOS team
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd START
|
||||
dd I_END
|
||||
dd MEM
|
||||
dd STACKTOP
|
||||
dd 0, 0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
include '../../macros.inc'
|
||||
include "../../KOSfuncs.inc"
|
||||
include "../../encoding.inc"
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
START:
|
||||
mcall SF_SET_EVENTS_MASK, EVM_REDRAW or EVM_BUTTON or EVM_MOUSE
|
||||
|
||||
mcall SF_SYS_MISC, SSF_HEAP_INIT
|
||||
|
||||
; initializing MAG_H * MAG_W rect of pixels from screen
|
||||
mcall SF_SYS_MISC, SSF_MEM_ALLOC, MAG_H * MAG_W * 3
|
||||
mov [screen_rect], eax
|
||||
|
||||
call logic_read_screen
|
||||
|
||||
still:
|
||||
mcall SF_WAIT_EVENT_TIMEOUT, DELAY
|
||||
|
||||
cmp eax, EV_REDRAW
|
||||
je redraw
|
||||
|
||||
cmp eax, EV_BUTTON
|
||||
je button
|
||||
|
||||
cmp eax, EV_MOUSE
|
||||
je mouse
|
||||
|
||||
jmp redraw
|
||||
|
||||
redraw:
|
||||
call draw_window
|
||||
call draw_magnify
|
||||
|
||||
jmp still
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
; we have only one button, close
|
||||
or eax, SF_TERMINATE_PROCESS
|
||||
mcall
|
||||
|
||||
mouse:
|
||||
mcall SF_MOUSE_GET, SSF_BUTTON
|
||||
|
||||
test ax, 0x0001
|
||||
jnz still
|
||||
|
||||
call logic_read_screen
|
||||
call draw_magnify
|
||||
|
||||
jmp still
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||
|
||||
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||
|
||||
mov ecx, eax
|
||||
add ecx, WIN.Y shl 16 + WIN.H
|
||||
|
||||
mcall SF_CREATE_WINDOW, <WIN.X, WIN.W>, , 0x34181818, , labelt
|
||||
|
||||
mcall SF_REDRAW, SSF_END_DRAW
|
||||
|
||||
ret
|
||||
|
||||
|
||||
; MAG_H * MAG_W pixels grid
|
||||
draw_magnify:
|
||||
|
||||
mcall SF_THREAD_INFO, procinfo, -1
|
||||
mov al, byte [procinfo.wnd_state]
|
||||
test al, 0x04
|
||||
jne .du_loop_end
|
||||
|
||||
mov eax, SF_DRAW_RECT
|
||||
mov ebx, MAG_S - 1
|
||||
mov ecx, MAG_S - 1
|
||||
mov esi, [screen_rect]
|
||||
mov edi, MAG_W * MAG_H
|
||||
|
||||
.du_loop_rect:
|
||||
mcall , , , dword [esi]
|
||||
add ebx, MAG_S shl 16
|
||||
cmp ebx, MAG_S * MAG_W shl 16
|
||||
jle .du_loop_rect_row
|
||||
mov ebx, MAG_S - 1
|
||||
add ecx, MAG_S shl 16
|
||||
|
||||
.du_loop_rect_row:
|
||||
add esi, 3
|
||||
dec edi
|
||||
jne .du_loop_rect
|
||||
|
||||
.du_loop_end:
|
||||
ret
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; LOGIC AREA
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
; read array of pixels from screen by mouse coords
|
||||
logic_read_screen:
|
||||
|
||||
mcall SF_MOUSE_GET, SSF_SCREEN_POSITION
|
||||
mov edx, eax
|
||||
|
||||
; clamping mouse coords to stay within the screen
|
||||
mcall SF_GET_SCREEN_SIZE
|
||||
mov ebx, eax
|
||||
call logic_clamp_pixels
|
||||
|
||||
sub edx, (MAG_W / 2) shl 16 + (MAG_H / 2)
|
||||
mcall SF_GET_IMAGE, [screen_rect], <MAG_W, MAG_H>,
|
||||
|
||||
ret
|
||||
|
||||
|
||||
; clamping mouse coords to stay within the screen
|
||||
logic_clamp_pixels:
|
||||
|
||||
mov eax, edx
|
||||
shr eax, 16
|
||||
mov cx, ax
|
||||
mov ax, dx
|
||||
|
||||
push ax
|
||||
push cx
|
||||
mov ax, bx
|
||||
mov di, ax
|
||||
mov eax, ebx
|
||||
shr eax, 16
|
||||
mov si, ax
|
||||
|
||||
pop cx
|
||||
pop ax
|
||||
|
||||
.check_min_x:
|
||||
cmp cx, MAG_W / 2
|
||||
jge .check_min_y
|
||||
mov cx, MAG_W / 2
|
||||
.check_min_y:
|
||||
cmp ax, MAG_H / 2
|
||||
jge .check_max_x
|
||||
mov ax, MAG_H / 2
|
||||
.check_max_x:
|
||||
mov dx, si
|
||||
sub dx, MAG_W / 2 - 1
|
||||
cmp cx, dx
|
||||
jle .check_max_y
|
||||
mov cx, dx
|
||||
.check_max_y:
|
||||
mov dx, di
|
||||
sub dx, MAG_H / 2 - 1
|
||||
cmp ax, dx
|
||||
jle .combine_coords
|
||||
mov ax, dx
|
||||
|
||||
.combine_coords:
|
||||
mov dx, cx
|
||||
shl edx, 16
|
||||
or dx, ax
|
||||
|
||||
ret
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; DATA AREA
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
DELAY = 5
|
||||
|
||||
MAG_W = 40
|
||||
MAG_H = 30
|
||||
MAG_S = 8
|
||||
|
||||
WIN RECT 100, 100, MAG_W * MAG_S + 8, MAG_H * MAG_S + 3
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
if lang eq ru_RU
|
||||
labelt cp866 'Magnify - Экранная лупа', 0
|
||||
else if lang eq es_ES
|
||||
labelt db 'Magnify - Lupa de Pantalla', 0
|
||||
else
|
||||
labelt db 'Magnify - Screen Magnifier', 0
|
||||
endf
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
screen_rect dd 0x00000000
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
I_END:
|
||||
rb 512
|
||||
align 512
|
||||
|
||||
STACKTOP:
|
||||
procinfo process_information
|
||||
MEM:
|
Reference in New Issue
Block a user