Compare commits

..
Author SHA1 Message Date
Burer 743fea2f4e system/docpack: rework the window, add online docs
Test PR / Build (es_ES) (pull_request) Failing after 1m40s
Test PR / Build (en_US) (pull_request) Canceled after 1m43s
Test PR / Build (ru_RU) (pull_request) Canceled after 1m42s
Window:
- the documents in two groups, General and Development, and a group
  with the KolibriOS wiki and the FASM manual, opened in WebView
- buttons in the colours of the skin, 24 px high, 12 px apart; the
  window is centred on the screen
- hotkeys L H K C D S N I O W F on the buttons, the same in every
  language; read by scancode, so any layout and case works
- titles and labels for en_US, ru_RU and es_ES

Fixes:
- the text was sent to CEdit once after a fixed 0.2 s and got lost
  when CEdit started slower; retry for up to the 2 s CEdit waits
- an unknown parameter opened the KFar keys; now it shows the
  window, and the parameter takes the hotkey letters
- show @notify when CEdit or WebView cannot be started

Code:
- piano style: the format macro, KOSfuncs constants, the language
  from -dlang, a 512-byte stack
- embed the documents straight from data/ and kernel/trunk/docs;
  the Tupfile only converts sysfuncr.txt to cp866
- drop the stale build_*.bat and makefile
- take Docs/SysFuncs.txt from kernel/trunk/docs directly
- point the docpack links of the Russian guide to the hotkeys

Assisted-by: Claude:claude-opus-5-5
2026-10-05 15:55:57 +03:00
Burer 723a1b4437 system/docpack: move the FASM manual out of kolibri.img, fix keys layout in docs (#739)
Build system / Build (en_US) (push) Successful in 4m9s
Build system / Build (ru_RU) (push) Successful in 4m17s
Build system / Build (es_ES) (push) Successful in 4m26s
Build system / Publish Images (push) Successful in 10m49s
Test PR / Build (en_US) (pull_request) Successful in 2m34s
Test PR / Build (es_ES) (pull_request) Successful in 3m30s
Test PR / Build (ru_RU) (pull_request) Successful in 3m29s
- Move the FASM manual out of DOCPACK to `/kolibrios/develop/fasm/fasm.txt` on ISO, next to the Oberon-07 and TCC docs
- Update the document letters in the Russian `guide.htm`, they were one letter off before
- Default document for an unknown parameter stays KFar keys

| DOCPACK, kpacked, sectors | en_US | ru_RU | es_ES |
|---|---|---|---|
| before | 218 + 150 | 232 + 62 | 218 + 199 |
| after | 95 + 468 | 105 + 466 | 95 + 493 |

Reviewed-on: #739
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
2026-10-04 13:14:51 +00:00
11 changed files with 462 additions and 5935 deletions

No files matched your search

+2 -2
View File
@@ -166,6 +166,7 @@ extra_files = {
{"kolibrios/demos/rpento.lif", "common/demos/rpento.lif"},
{"kolibrios/develop/fpc/", "common/develop/fpc/*"},
{"kolibrios/develop/fpc/examples/", "../programs/develop/fp/examples/src/*"},
{"kolibrios/develop/fasm/fasm.txt", SRC_PROGS .. "/develop/fasm/1.73/fasm.txt"},
{"kolibrios/develop/oberon07/compiler.kex", SRC_PROGS .. "/develop/oberon07/Compiler.kex"},
{"kolibrios/develop/oberon07/LICENSE", SRC_PROGS .. "/develop/oberon07/LICENSE"},
{"kolibrios/develop/oberon07/doc/CC.txt", SRC_PROGS .. "/develop/oberon07/doc/CC.txt"},
@@ -352,7 +353,7 @@ if build_type == "ru_RU" then tup.append_table(extra_files, {
{"Docs/Hot_Keys.txt", build_type .. "/docs/Hot_Keys.txt"},
{"Docs/Install.txt", build_type .. "/docs/Install.txt"},
{"Docs/Credits.txt", build_type .. "/docs/Credits.txt"},
{"Docs/SysFuncs.txt", VAR_PROGS .. "/system/docpack/SysFuncs.txt"},
{"Docs/SysFuncs.txt", "../kernel/trunk/docs/sysfuncs.txt"},
{"HD_Load/9x2klbr/", SRC_PROGS .. "/hd_load/9x2klbr/readme.txt"},
{"HD_Load/mtldr/install.txt", SRC_PROGS .. "/hd_load/mtldr/install_eng.txt"},
{"HD_Load/USB_Boot/readme.txt", SRC_PROGS .. "/hd_load/usb_boot/readme_eng.txt"},
@@ -523,7 +524,6 @@ tup.append_table(img_files, {
{"LIB/RASTERWORKS.OBJ", VAR_PROGS .. "/develop/libraries/fontRasterWorks_unicode/RasterWorks.obj"},
{"LIB/SORT.OBJ", VAR_PROGS .. "/develop/libraries/sorter/sort.obj"},
{"LIB/TINYGL.OBJ", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/tinygl.obj"},
{"LIB/XML.OBJ", VAR_PROGS .. "/develop/libraries/asm-xml/xml.obj"},
{"MEDIA/ANIMAGE", VAR_PROGS .. "/media/animage/animage"},
{"MEDIA/FILLSCR", VAR_PROGS .. "/media/FillScr/fillscr"},
{"MEDIA/KIV", VAR_PROGS .. "/media/kiv/kiv"},
+4 -4
View File
@@ -20,13 +20,13 @@
<a href="hardware_support.htm">Поддержка оборудования</a>
<strong>Разработка</strong>
<a href="/sys/docpack|f">Справочник по системным функциям Колибри</a>
<a href="/sys/docpack|e">Использование отладчика</a>
<a href="/sys/docpack|d">Руководство FASM</a>
<a href="/sys/docpack|s">Справочник по системным функциям Колибри</a>
<a href="/sys/docpack|d">Использование отладчика</a>
<a href="/kolibrios/develop/fasm/fasm.txt">Руководство FASM</a>
<strong>Использование библиотек</strong>
<a href="/sys/docpack|i">Ini</a>
<a href="/sys/docpack|j">Диалог открытия файла OpenDial</a>
<a href="/sys/docpack|o">Диалог открытия файла OpenDial</a>
<strong>Смотрите также</strong>
Вики проекта <a href="http://wiki.kolibrios.org/">wiki.kolibrios.org</a>
@@ -1,25 +0,0 @@
Copyright (c) 2007-2012, Marc Kerbiquet
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of AsmXml 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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.
@@ -1,2 +0,0 @@
if tup.getconfig("NO_FASM") ~= "" then return end
tup.rule("xml.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "xml.obj")
File diff suppressed because it is too large. Load diff
@@ -1,59 +0,0 @@
; SPDX-License-Identifier: GPL-2.0-only
;
; xml.obj - AsmXml parser as a KolibriOS library
; Copyright (C) KolibriOS team 2026
;
; asm-xml.asm and LICENSE.txt are the unmodified AsmXml 1.4 release
; by Marc Kerbiquet (BSD 3-clause), https://tibleiz.net/asm-xml/
format MS COFF
public EXPORTS
section '.flat' code readable align 16
; AsmXml calls malloc/free as cdecl, the heap functions given to lib_init
; are stdcall: the caller pops the argument they have already taken
lib_init:
mov [mem.alloc], eax
mov [mem.free], ebx
mov eax, malloc
mov ebx, free
jmp initialize
malloc:
push dword [esp + 4]
call [mem.alloc]
ret
free:
push dword [esp + 4]
call [mem.free]
ret
align 4
mem.alloc dd ?
mem.free dd ?
align 16
EXPORTS:
dd sz_lib_init, lib_init
dd sz_initializeParser, _initializeParser
dd sz_releaseParser, _releaseParser
dd sz_parse, _parse
dd sz_initializeClassParser, _initializeClassParser
dd sz_releaseClassParser, _releaseClassParser
dd sz_classFromElement, _classFromElement
dd sz_classFromString, _classFromString
dd 0, 0
sz_lib_init db 'lib_init', 0
sz_initializeParser db 'ax_initializeParser', 0
sz_releaseParser db 'ax_releaseParser', 0
sz_parse db 'ax_parse', 0
sz_initializeClassParser db 'ax_initializeClassParser', 0
sz_releaseClassParser db 'ax_releaseClassParser', 0
sz_classFromElement db 'ax_classFromElement', 0
sz_classFromString db 'ax_classFromString', 0
include 'asm-xml.asm'
+4 -20
View File
@@ -1,24 +1,8 @@
if tup.getconfig("NO_FASM") ~= "" or tup.getconfig("BUILD_TYPE") == "" then return end
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())
deps = tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
DOCDIR = "../../../data/" .. tup.getconfig("BUILD_TYPE") .. "/docs/"
if tup.getconfig("TUP_PLATFORM") == "win32"
then env_prefix = "set DOCDIR=$(DOCDIR)&&"; cp_cmd = "copy %f %o"
else env_prefix = "DOCDIR=$(DOCDIR) "; cp_cmd = "cp %f %o"
end
if tup.getconfig("LANG") == "ru_RU"
then tup.append_table(deps,
tup.rule("../../../kernel/trunk/docs/sysfuncr.txt", "iconv -f utf-8 -t cp866 %f > %o", "SysFuncr.txt"))
else tup.append_table(deps,
tup.rule("../../../kernel/trunk/docs/sysfuncs.txt", cp_cmd, "SysFuncs.txt"))
end
tup.append_table(deps,
tup.rule("../../develop/fasm/1.73/fasm.txt", cp_cmd, "Fasm.txt")
)
tup.append_table(deps,
tup.rule("../../../kernel/trunk/docs/stack.txt", cp_cmd, "Stack.txt")
)
tup.rule({"docpack.asm", extra_inputs = deps}, env_prefix .. FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "docpack")
lang = (tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")
deps = (lang == "ru_RU") and tup.rule("../../../kernel/trunk/docs/sysfuncr.txt", "iconv -f utf-8 -t cp866 %f > %o", "SysFuncr.txt") or {}
tup.rule({"docpack.asm", extra_inputs = deps}, FASM .. " -dlang=" .. lang .. " %f %o " .. tup.getconfig("KPACK_CMD"), "docpack")
-6
View File
@@ -1,6 +0,0 @@
@erase lang.inc
@echo lang fix en_US >lang.inc
@fasm -m 32768 docpack.asm docpack
@erase lang.inc
@kpack docpack
@pause
-6
View File
@@ -1,6 +0,0 @@
@erase lang.inc
@echo lang fix ru_RU >lang.inc
@fasm -m 32768 docpack.asm docpack
@erase lang.inc
@kpack docpack
@pause
+452 -200
View File
@@ -1,227 +1,479 @@
; SPDX-License-Identifier: NOASSERTION
;
;---------------------------------------------------------------------
; DocPack - KolibriOS documentation
; Copyright (C) 2006-2026 KolibriOS team
;
; DOCPAK FOR KOLIBRI v1.2
; Written in pure assembly by Ivushkin Andrey aka Willow
; Authors: Ivushkin Andrey aka Willow, Burer
;
;---------------------------------------------------------------------
; DOCPACK window with the documents and the online documentation
; DOCPACK x open the document or the link of the hotkey x
FILE_COUNT=0
DEF_FILE equ 'g'
; ====================================================================
macro embed_docdir_file fn
{
forward
local label,label2,label3
dd label2-label
dd label-label3
label3:
db fn
label:
file '%DOCDIR%' # fn
label2:
FILE_COUNT=FILE_COUNT+1
}
macro embed_local_file fn
{
forward
local label,label2,label3
dd label2-label
dd label-label3
label3:
db fn
label:
file fn
label2:
FILE_COUNT=FILE_COUNT+1
}
include "../../macros.inc"
include "../../KOSfuncs.inc"
include "../../encoding.inc"
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd start ; start of code
dd I_END ; size of image
dd I_END+0x400 ; memory for app
dd I_END+0x400 ; esp
dd my_param , 0x0 ; I_Param , I_Icon
include '../../macros.inc'
include 'lang.inc' ; Language support for locales: ru_RU, en_US.
format meos 01
entry START
stack 512
start:
cmp [my_param],0
je red
cmp [my_param],'a'
jb .par_a
cmp [my_param],'z'
jbe .ok2
.par_a:
mov [my_param],DEF_FILE
.ok2:
movzx ecx,[my_param]
mov [my_param],'*'
.open:
sub ecx,'a'-1
mov edx,embedded
xor esi,esi
.list:
lea edx,[edx+esi+8]
mov esi,[edx-8]
add edx,[edx-4]
test esi,esi
jz .close
loop .list
push edx
; convert number in esi to decimal representation
mov ecx, 10
push -'0'
mov eax, esi
@@:
xor edx, edx
div ecx
push edx
test eax, eax
jnz @b
mov edi, fsize
@@:
pop eax
add al, '0'
stosb
jnz @b
mcall 70,fileinfo
mov ecx,eax
mcall 5,20
pop edx
mcall 60,2
cmp [my_param],'*'
jne still
.close:
mcall -1
; ====================================================================
red:
mov [my_param],'a'
START:
; "DOCPACK x" opens the item of the hotkey x and exits, any letter case
GetCommandLine eax
mov al, [eax]
or al, 'a' - 'A'
mcall 48, 3, sc, sizeof.system_colors
mov edi, letters
mov ecx, ITEMS
repne scasb
jne .window
mcall 12,1
sub edi, letters + 1
mov ecx, edi
call open
jmp exit
BTN_H equ 21
; no item: the window, its keys come as scancodes
.window:
mcall SF_KEYBOARD, SSF_SET_INPUT_MODE, 1
jmp redraw
mov edx,[sc.work]
or edx,0x34000000
mcall 0, <220,141>, <30,FILECOUNT*(BTN_H+3)+37>, , ,title
mov ecx,FILECOUNT
mov ebx,23 shl 16+100
mov esi,[sc.work_button]
mov edi,5 shl 16+BTN_H
mov edx,10
mov eax,8
.btnlp:
push ecx
mcall ,,edi
add edi,(BTN_H+3) shl 16
inc edx
pop ecx
loop .btnlp
mov ecx,FILECOUNT
mov edx,embedded
xor edi,edi
mov ebx,30 shl 16+8
mov eax,4
.list:
lea edx,[edx+edi+8]
mov edi,[edx-8]
pusha
sub ebx,20 shl 16
mov ecx, [sc.work_text]
or ecx, 0x30000000
mcall ,,,my_param,1
inc [my_param]
popa
push ecx
mov esi, [edx-4]
sub esi, 4 ;remove .txt extension
mov ecx, [sc.work_button_text]
or ecx, 0x30000000
mcall
pop ecx
add esi, 4
add edx, esi
add ebx,(BTN_H+3)
loop .list
mcall 12,2
; ====================================================================
still:
mcall 10
cmp eax,1
je red
cmp eax,2
jne .nokey
mcall 2
cmp ah,27 ;Esc
je start.close
cmp ah,'a'
jb still
cmp ah,'a'+FILECOUNT
jae still
jmp .cxax
.nokey:
mcall 17
cmp ah,1
je start.close
sub ah,10-'a'
.cxax:
movzx ecx,ah
jmp start.open
mcall SF_WAIT_EVENT
fileinfo:
dd 7
dd 0
dd param
dd 0 ,0
db '/sys/develop/cedit',0
cmp al, EV_REDRAW
je redraw
cmp al, EV_KEY
je key
cmp al, EV_BUTTON
je button
param db '*'
fsize:
times 10 db '0'
db 0
jmp still
embedded:
; ====================================================================
; Please use only filenames w/o path!
key:
mcall SF_GET_KEY
; -- Start of embedding area ------
cmp ah, KEY_ESC
je exit
embed_docdir_file 'Copying.txt' ;a
embed_docdir_file 'Hot_Keys.txt' ;b
embed_local_file 'Fasm.txt' ;c
embed_docdir_file 'Mtdbg.txt' ;d
; the item of the hotkey, if it is one
mov al, ah
mov edi, scancodes
mov ecx, ITEMS
repne scasb
jne still
sub edi, scancodes + 1
mov ecx, edi
call open
jmp still
; ====================================================================
button:
mcall SF_GET_BUTTON
cmp ah, 1
je exit
; the item of the button
movzx ecx, ah
sub ecx, ITEM_ID
cmp ecx, ITEMS
jae still
call open
jmp still
exit:
mcall SF_TERMINATE_PROCESS
; ====================================================================
; ecx = number of the item: the documents, then the links
open:
cmp ecx, FILECOUNT
jae .link
; find the document: each one is its size, then its text
mov edx, embedded
jecxz .found
.next:
add edx, [edx]
add edx, 4
loop .next
.found:
mov esi, [edx]
add edx, 4
mcall SF_FILE, cedit_run
test eax, eax
js .no_cedit
; then the text by IPC, once CEdit has set its IPC area
mov ecx, eax
mov edi, SEND_TRIES
.send:
mcall SF_SLEEP, SEND_DELAY
mcall SF_IPC, SSF_SEND_MESSAGE
test eax, eax
jz .done
; 1: no IPC area yet, 2: it is locked
cmp eax, 2
ja .done
dec edi
jnz .send
ret
; a link: WebView with its URL
.link:
mov eax, [urls + ecx*4 - FILECOUNT*4]
mov [webview_run.url], eax
mcall SF_FILE, webview_run
test eax, eax
jns .done
mov [notify_run.text], notify_webview
jmp .notify
.no_cedit:
mov [notify_run.text], notify_cedit
.notify:
mcall SF_FILE, notify_run
.done:
ret
; ====================================================================
redraw:
mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
mcall SF_REDRAW, SSF_BEGIN_DRAW
; the window in the centre of the screen
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
mov esi, eax
add esi, WINDOW_H
mcall SF_GET_SCREEN_SIZE
movzx ecx, ax
sub ecx, esi
shr ecx, 1
shl ecx, 16
add ecx, esi
shr eax, 16
sub eax, WINDOW_W
shr eax, 1
shl eax, 16
mov ebx, eax
add ebx, WINDOW_W
mov edx, [sc.work]
or edx, WINDOW_STYLE
mcall SF_CREATE_WINDOW, , , , 0, title
; the frames of the groups with their titles
xor ebp, ebp
.group:
mov ebx, [boxes + ebp*8]
mov ecx, [boxes + ebp*8 + 4]
call group_box
inc ebp
cmp ebp, GROUPS
jb .group
; the buttons of the items with their labels
xor ebp, ebp
.button:
movzx ebx, [place + ebp*4]
movzx edi, [place + ebp*4 + 2]
shl ebx, 16
add ebx, BTN_W - 1
mov ecx, edi
shl ecx, 16
add ecx, BTN_H - 1
mov edx, ebp
add edx, ITEM_ID
mcall SF_DEFINE_BUTTON, , , , [sc.work_light]
and ebx, 0xFFFF0000
add ebx, (GAP shl 16) + TEXT_DY
add ebx, edi
mov ecx, ebp
mov edx, labels
call nth_string
mov ecx, [sc.work_text]
or ecx, FONT
mcall SF_DRAW_TEXT
inc ebp
cmp ebp, ITEMS
jb .button
mcall SF_REDRAW, SSF_END_DRAW
jmp still
; ====================================================================
; group box: a frame, the title over its top line
; ebp = number of the title, ebx = x shl 16 + width, ecx = y shl 16 + height
group_box:
mcall SF_DRAW_RECT, , , [sc.work_graph]
add ebx, (1 shl 16) - 2
add ecx, (1 shl 16) - 2
mcall SF_DRAW_RECT, , , [sc.work]
; a space, then the letters start where the buttons do
shr ecx, 16
sub ecx, 1 + TITLE_DY
and ebx, 0xFFFF0000
add ebx, (GAP - CHAR_W - 1) shl 16
add ebx, ecx
mov ecx, ebp
mov edx, groups
call nth_string
mov ecx, [sc.work_text]
or ecx, FONT + FILL
mcall SF_DRAW_TEXT, , , , , [sc.work]
ret
; edx = string number ecx of the zero separated list at edx
nth_string:
jecxz .done
.next:
inc edx
cmp byte [edx - 1], 0
jnz .next
loop .next
.done:
ret
; ====================================================================
; font: 8x16, the capitals are its rows 2..11
CHAR_W = 8
CAPS_Y = 2
CAPS_H = 10
; layout
GAP = 12
BTN_H = 24
BTN_W = LABEL_CHARS*CHAR_W + GAP*2
ROW = BTN_H + GAP
ROWS = 5
TEXT_DY = (BTN_H - CAPS_H)/2 - CAPS_Y ; the capitals centred in a button
; the frame of a group crosses the capitals of its title
TITLE_DY = CAPS_Y + CAPS_H/2
TITLE_ABOVE = TITLE_DY - CAPS_Y
TITLE_BELOW = CAPS_Y + CAPS_H - TITLE_DY
; two groups of the documents, GAP from the top to the capitals of the titles
GROUP_Y = GAP + TITLE_ABOVE
GROUP_W = 1 + GAP + BTN_W + GAP + 1
GROUP_H = TITLE_BELOW + GAP + ROWS*ROW + 1
COL1 = GAP + 1 + GAP ; x of the buttons
COL2 = COL1 + GROUP_W + GAP
BTN_Y = GROUP_Y + TITLE_BELOW + GAP ; y of the first row
; the group of the links below them, full width
LINKS_Y = GROUP_Y + GROUP_H + GAP + TITLE_ABOVE
LINKS_H = TITLE_BELOW + GAP + BTN_H + GAP + 1
LINK_Y = LINKS_Y + TITLE_BELOW + GAP
; window
CLIENT_W = GAP + GROUP_W + GAP + GROUP_W + GAP
CLIENT_H = LINKS_Y + LINKS_H + GAP
WINDOW_W = CLIENT_W + 9 ; the borders of a skinned window
WINDOW_H = CLIENT_H + 4 ; and the skin height
WINDOW_STYLE = 0x34000000 ; skinned, fixed size, caption, client coordinates
; text
FONT = 0xB0000000 ; zero terminated, 8x16 UTF-8
FILL = 0x40000000 ; draw the background of the text
; items: the documents, then the links
GROUPS = 3
LINKS = 2
ITEMS = FILECOUNT + LINKS
ITEM_ID = 10 ; the button of the item 0
KEY_ESC = 0x01 ; scancode
; CEdit
SEND_TRIES = 20
SEND_DELAY = 10 ; CEdit waits 2 s for the text
DOC_MAX = 524288 ; the size in cedit_param
; ====================================================================
FILE_COUNT = 0
; a document: its size, then its text
macro embed_file path
{
local label, label2
dd label2 - label
label:
file path
label2:
assert label2 - label <= DOC_MAX
FILE_COUNT = FILE_COUNT + 1
}
; a document of data/<language>/docs
macro embed_doc name
{
if lang eq ru_RU
embed_local_file 'SysFuncr.txt' ;e
else ; Default to en_US
embed_local_file 'SysFuncs.txt' ;e
embed_file "../../../data/ru_RU/docs/" # name
else if lang eq es_ES
embed_file "../../../data/es_ES/docs/" # name
else
embed_file "../../../data/en_US/docs/" # name
end if
embed_local_file 'Stack.txt' ;f
embed_docdir_file 'KFAR_Keys.txt' ;g
embed_docdir_file 'INI.txt' ;h
embed_docdir_file 'OpenDial.txt' ;i
embed_docdir_file 'Credits.txt' ;j
; -- End of embedding area -------
}
; ====================================================================
cedit_run:
dd SSF_START_APP
dd 0
dd cedit_param
dd 0, 0
db "/sys/develop/cedit", 0
webview_run:
dd SSF_START_APP
dd 0
.url dd 0
dd 0, 0
db "/sys/network/webview", 0
notify_run:
dd SSF_START_APP
dd 0
.text dd 0
dd 0, 0
db "/sys/@notify", 0
; the links
urls dd url_wiki, url_fasm
assert ($ - urls)/4 = LINKS
url_fasm db "https://flatassembler.net/docs.php?article=manual", 0
; the hotkeys of the items: on the command line and as scancodes,
; so they work in any layout and case
letters db "lhkcdsniowf"
assert $ - letters = ITEMS
scancodes db 0x26, 0x23, 0x25, 0x2E, 0x20, 0x1F, 0x31, 0x17, 0x18, 0x11, 0x21
assert $ - scancodes = ITEMS
; x shl 16 + width, y shl 16 + height of the groups
boxes dd (GAP shl 16) + GROUP_W, (GROUP_Y shl 16) + GROUP_H
dd ((GAP + GROUP_W + GAP) shl 16) + GROUP_W, (GROUP_Y shl 16) + GROUP_H
dd (GAP shl 16) + CLIENT_W - GAP*2, (LINKS_Y shl 16) + LINKS_H
assert ($ - boxes)/8 = GROUPS
; x, y of the buttons of the items
place dw COL1, BTN_Y, COL1, BTN_Y + ROW, COL1, BTN_Y + 2*ROW, COL1, BTN_Y + 3*ROW
dw COL2, BTN_Y, COL2, BTN_Y + ROW, COL2, BTN_Y + 2*ROW, COL2, BTN_Y + 3*ROW
dw COL2, BTN_Y + 4*ROW
dw COL1, LINK_Y, COL2, LINK_Y
assert ($ - place)/4 = ITEMS
; CEdit takes the size of its IPC buffer after "*", the text comes with
; its own size, so one size for all the documents
cedit_param db "*524288", 0
; ====================================================================
; the labels in the order of the embedded files, then the ones of the links
if lang eq ru_RU
LABEL_CHARS = 21 ; the longest label with its "X | "
title db 3, "Документация KolibriOS", 0
groups db " Общее ", 0, " Разработка ", 0, " Онлайн-документация ", 0
url_wiki db "https://wiki.kolibrios.org/wiki/For_developers/ru", 0
notify_cedit cp866 "'DocPack\nНе удалось запустить /sys/develop/cedit' -tE", 0
notify_webview cp866 "'DocPack\nНе удалось запустить /sys/network/webview' -tE", 0
labels db "L | Лицензия", 0, "H | Горячие клавиши", 0, "K | Клавиши KFar", 0, "C | Благодарности", 0
db "D | Отладчик", 0, "S | Системные функции", 0, "N | Сетевые функции", 0
db "I | Файлы INI", 0, "O | Диалог открытия", 0
db "W | Вики KolibriOS", 0, "F | Руководство FASM", 0
else if lang eq es_ES
LABEL_CHARS = 25
title db 3, "Documentación de KolibriOS", 0
groups db " General ", 0, " Desarrollo ", 0, " Documentación en línea ", 0
url_wiki db "https://wiki.kolibrios.org/wiki/For_developers/en", 0
notify_cedit db "'DocPack\nNo se pudo iniciar /sys/develop/cedit' -tE", 0
notify_webview db "'DocPack\nNo se pudo iniciar /sys/network/webview' -tE", 0
labels db "L | Licencia", 0, "H | Atajos de teclado", 0, "K | Teclas de KFar", 0, "C | Créditos", 0
db "D | Depurador", 0, "S | Funciones del sistema", 0, "N | Funciones de red", 0
db "I | Archivos INI", 0, "O | Diálogo de apertura", 0
db "W | Wiki de KolibriOS", 0, "F | Manual de FASM", 0
else
LABEL_CHARS = 21
title db 3, "KolibriOS Documentation", 0
groups db " General ", 0, " Development ", 0, " Online documentation ", 0
url_wiki db "https://wiki.kolibrios.org/wiki/For_developers/en", 0
notify_cedit db "'DocPack\nCould not start /sys/develop/cedit' -tE", 0
notify_webview db "'DocPack\nCould not start /sys/network/webview' -tE", 0
labels db "L | License", 0, "H | Hotkeys", 0, "K | KFar keys", 0, "C | Credits", 0
db "D | Debugger", 0, "S | System functions", 0, "N | Network functions", 0
db "I | INI files", 0, "O | Open dialog", 0
db "W | KolibriOS Wiki", 0, "F | FASM manual", 0
end if
; ====================================================================
; the documents with their hotkeys
embedded:
embed_doc "Copying.txt" ; L
embed_doc "Hot_Keys.txt" ; H
embed_doc "KFAR_Keys.txt" ; K
embed_doc "Credits.txt" ; C
embed_doc "Mtdbg.txt" ; D
if lang eq ru_RU
embed_file "SysFuncr.txt" ; S
else
embed_file "../../../kernel/trunk/docs/sysfuncs.txt" ; S
end if
embed_file "../../../kernel/trunk/docs/stack.txt" ; N
embed_doc "INI.txt" ; I
embed_doc "OpenDial.txt" ; O
dd 0
FILECOUNT = FILE_COUNT
if ~ FILECOUNT>0
error 'No embedded files'
end if
; ====================================================================
my_param db 0
rb 256
I_END:
title db 'Doc Pack',0
sc system_colors
sc system_colors
-17
View File
@@ -1,17 +0,0 @@
#!gmake
# Macro
FASM=/opt/bin/fasm
KPACK=/opt/bin/kpack
LANG=lang.inc
FILE=docpack
SOURCE=${FILE}.asm
OUT=${FILE}.bin
ru:
echo "lang fix ru_RU" > ${LANG}
${FASM} ${SOURCE} ${OUT}
${KPACK} ${OUT}
clean:
rm -f ${LANG} ${OUT}