Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a4f609ed9 | ||
|
|
2754b2e3dc
|
||
|
|
4ef7c96916
|
||
|
|
1e6147ae77
|
||
|
|
2ca53ef585
|
||
|
|
6f1eebb4b5
|
No files matched your search
Generated
+27
-27
@@ -290,7 +290,7 @@ version = "1.1.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -301,7 +301,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"anstyle",
|
"anstyle",
|
||||||
"once_cell_polyfill",
|
"once_cell_polyfill",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1805,7 +1805,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"option-ext",
|
"option-ext",
|
||||||
"redox_users 0.5.3",
|
"redox_users 0.5.3",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1938,7 +1938,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-agent"
|
name = "ely-agent"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ely-platform",
|
"ely-platform",
|
||||||
"ely-ui",
|
"ely-ui",
|
||||||
@@ -1947,7 +1947,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-doc"
|
name = "ely-doc"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"csv",
|
"csv",
|
||||||
@@ -1969,7 +1969,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-files"
|
name = "ely-files"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
"dunce",
|
"dunce",
|
||||||
@@ -1986,7 +1986,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-gpui-component"
|
name = "ely-gpui-component"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=2e65b05a6592d8c3166a252261fc01bf6215c3c5#2e65b05a6592d8c3166a252261fc01bf6215c3c5"
|
source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=de961eb164c1c88797ea35f0860aba9d18c95e4f#de961eb164c1c88797ea35f0860aba9d18c95e4f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alacritty_terminal",
|
"alacritty_terminal",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@@ -2032,14 +2032,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-ipc"
|
name = "ely-ipc"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-lok"
|
name = "ely-lok"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.23.1",
|
"base64 0.23.1",
|
||||||
"dunce",
|
"dunce",
|
||||||
@@ -2060,7 +2060,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-mail"
|
name = "ely-mail"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ely-platform",
|
"ely-platform",
|
||||||
"ely-ui",
|
"ely-ui",
|
||||||
@@ -2069,7 +2069,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-mark"
|
name = "ely-mark"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"base64 0.23.1",
|
"base64 0.23.1",
|
||||||
@@ -2094,7 +2094,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-office"
|
name = "ely-office"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"directories",
|
"directories",
|
||||||
@@ -2115,7 +2115,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-pdf"
|
name = "ely-pdf"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dunce",
|
"dunce",
|
||||||
"ely-files",
|
"ely-files",
|
||||||
@@ -2133,7 +2133,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-pdf-engine"
|
name = "ely-pdf-engine"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"ely-ipc",
|
"ely-ipc",
|
||||||
@@ -2150,7 +2150,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-platform"
|
name = "ely-platform"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arboard",
|
"arboard",
|
||||||
@@ -2189,7 +2189,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-show"
|
name = "ely-show"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ely-files",
|
"ely-files",
|
||||||
"ely-gpui-component",
|
"ely-gpui-component",
|
||||||
@@ -2209,7 +2209,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-table"
|
name = "ely-table"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ely-gpui-component",
|
"ely-gpui-component",
|
||||||
"ely-lok",
|
"ely-lok",
|
||||||
@@ -2226,7 +2226,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-tree"
|
name = "ely-tree"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dunce",
|
"dunce",
|
||||||
"ely-files",
|
"ely-files",
|
||||||
@@ -2246,7 +2246,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ely-ui"
|
name = "ely-ui"
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"directories",
|
"directories",
|
||||||
@@ -2405,7 +2405,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4611,7 +4611,7 @@ version = "0.6.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "536bfad37a309d62069485248eeaba1e8d9853aaf951caaeaed0585a95346f08"
|
checksum = "536bfad37a309d62069485248eeaba1e8d9853aaf951caaeaed0585a95346f08"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4776,7 +4776,7 @@ version = "0.50.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
|
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -6539,7 +6539,7 @@ dependencies = [
|
|||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7127,7 +7127,7 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
"psm",
|
"psm",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7478,7 +7478,7 @@ dependencies = [
|
|||||||
"getrandom 0.4.3",
|
"getrandom 0.4.3",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix",
|
"rustix",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7828,7 +7828,7 @@ checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"memoffset",
|
"memoffset",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -8633,7 +8633,7 @@ version = "0.1.11"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
+3
-3
@@ -5,10 +5,10 @@ members = ["apps/*", "crates/*"]
|
|||||||
exclude = ["engines", "reference"]
|
exclude = ["engines", "reference"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.7"
|
version = "0.1.8"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.95"
|
rust-version = "1.95"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "MIT"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
@@ -19,7 +19,7 @@ jiff = "0.2"
|
|||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
directories = "6"
|
directories = "6"
|
||||||
dunce = "1"
|
dunce = "1"
|
||||||
ely-gpui-component = { git = "https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components", rev = "2e65b05a6592d8c3166a252261fc01bf6215c3c5" }
|
ely-gpui-component = { git = "https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components", rev = "de961eb164c1c88797ea35f0860aba9d18c95e4f" }
|
||||||
env_logger = "0.11"
|
env_logger = "0.11"
|
||||||
gpui = { package = "gpui-pre", version = "=0.3.8", default-features = false, features = ["stacker"] }
|
gpui = { package = "gpui-pre", version = "=0.3.8", default-features = false, features = ["stacker"] }
|
||||||
gpui_platform = { package = "gpui-pre-platform", version = "=0.3.8", features = ["font-kit", "wayland", "x11"] }
|
gpui_platform = { package = "gpui-pre-platform", version = "=0.3.8", features = ["font-kit", "wayland", "x11"] }
|
||||||
|
|||||||
@@ -1,661 +1,21 @@
|
|||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
MIT License
|
||||||
Version 3, 19 November 2007
|
|
||||||
|
Copyright (c) 2026 Yang Zhang
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this license document, but changing it is not allowed.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
Preamble
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
The GNU Affero General Public License is a free, copyleft license for
|
furnished to do so, subject to the following conditions:
|
||||||
software and other kinds of works, specifically designed to ensure
|
|
||||||
cooperation with the community in the case of network server software.
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
our General Public Licenses are intended to guarantee your freedom to
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
share and change all versions of a program--to make sure it remains free
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
software for all its users.
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
When we speak of free software, we are referring to freedom, not
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
SOFTWARE.
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
Developers that use our General Public Licenses protect your rights
|
|
||||||
with two steps: (1) assert copyright on the software, and (2) offer
|
|
||||||
you this License which gives you legal permission to copy, distribute
|
|
||||||
and/or modify the software.
|
|
||||||
|
|
||||||
A secondary benefit of defending all users' freedom is that
|
|
||||||
improvements made in alternate versions of the program, if they
|
|
||||||
receive widespread use, become available for other developers to
|
|
||||||
incorporate. Many developers of free software are heartened and
|
|
||||||
encouraged by the resulting cooperation. However, in the case of
|
|
||||||
software used on network servers, this result may fail to come about.
|
|
||||||
The GNU General Public License permits making a modified version and
|
|
||||||
letting the public access it on a server without ever releasing its
|
|
||||||
source code to the public.
|
|
||||||
|
|
||||||
The GNU Affero General Public License is designed specifically to
|
|
||||||
ensure that, in such cases, the modified source code becomes available
|
|
||||||
to the community. It requires the operator of a network server to
|
|
||||||
provide the source code of the modified version running there to the
|
|
||||||
users of that server. Therefore, public use of a modified version, on
|
|
||||||
a publicly accessible server, gives the public access to the source
|
|
||||||
code of the modified version.
|
|
||||||
|
|
||||||
An older license, called the Affero General Public License and
|
|
||||||
published by Affero, was designed to accomplish similar goals. This is
|
|
||||||
a different license, not a version of the Affero GPL, but Affero has
|
|
||||||
released a new version of the Affero GPL which permits relicensing under
|
|
||||||
this license.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, if you modify the
|
|
||||||
Program, your modified version must prominently offer all users
|
|
||||||
interacting with it remotely through a computer network (if your version
|
|
||||||
supports such interaction) an opportunity to receive the Corresponding
|
|
||||||
Source of your version by providing access to the Corresponding Source
|
|
||||||
from a network server at no charge, through some standard or customary
|
|
||||||
means of facilitating copying of software. This Corresponding Source
|
|
||||||
shall include the Corresponding Source for any work covered by version 3
|
|
||||||
of the GNU General Public License that is incorporated pursuant to the
|
|
||||||
following paragraph.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the work with which it is combined will remain governed by version
|
|
||||||
3 of the GNU General Public License.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU Affero General Public License from time to time. Such new versions
|
|
||||||
will be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU Affero General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU Affero General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU Affero General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If your software can interact with users remotely through a computer
|
|
||||||
network, you should also make sure that it provides a way for users to
|
|
||||||
get its source. For example, if your program is a web application, its
|
|
||||||
interface could display a "Source" link that leads users to an archive
|
|
||||||
of the code. There are many ways you could offer source, and different
|
|
||||||
solutions will be better for different programs; see section 13 for the
|
|
||||||
specific requirements.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
@@ -756,7 +756,7 @@ Doc、Table、Show 的 PDF 输出由 LOK 完成,不要求安装 ElyPDF。ElyMa
|
|||||||
|
|
||||||
### 21.1 自有代码默认许可
|
### 21.1 自有代码默认许可
|
||||||
|
|
||||||
本 PRD 对新增应用代码采用 AGPL-3.0-or-later 作为发行默认,便于与 MuPDF 的开源使用路线保持一致。Ely GPUI Components 继续保留现有 MIT/Apache-2.0 许可,不因被应用使用而改写其许可证。[S1]
|
本 PRD 对新增应用代码采用 MIT 作为发行默认(用户 2026-10-19 定,原为 AGPL-3.0-or-later)。MIT 只管 Ely 的自有代码:链接 MuPDF 的 ElyPDF 发行包整体仍须按 MuPDF 的 AGPL 条款提供对应源码。Ely GPUI Components 继续保留现有 MIT/Apache-2.0 许可,不因被应用使用而改写其许可证。[S1]
|
||||||
|
|
||||||
第三方代码保持原许可证。不得把 LibreOffice、Git 或其他依赖的版权声明统一替换成 Ely 的声明。最终发行须按实际链接、进程调用、修改和打包方式审查,进程隔离不作为免除许可义务的依据。
|
第三方代码保持原许可证。不得把 LibreOffice、Git 或其他依赖的版权声明统一替换成 Ely 的声明。最终发行须按实际链接、进程调用、修改和打包方式审查,进程隔离不作为免除许可义务的依据。
|
||||||
|
|
||||||
|
|||||||
@@ -43,4 +43,4 @@ Packages: `packaging/macos/release.sh` writes each app's `.app` and `.dmg`, the
|
|||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
|
|
||||||
AGPL-3.0-or-later (`LICENSE`). Third-party components keep their own licences; see `docs/licenses.md`.
|
MIT (`LICENSE`). Third-party components keep their own licences; see `docs/licenses.md`.
|
||||||
@@ -40,7 +40,7 @@ site/ 官网(Vite 8、pnpm、TypeScript,无框架;等轴 SVG 积木
|
|||||||
|
|
||||||
## 组件映射
|
## 组件映射
|
||||||
|
|
||||||
依赖 `ely-gpui-component`(pin 2e65b05,gpui 为 crates.io 的 `gpui-pre` =0.3.8)。名字取自 `reference/Ely-GPUI-Components/src`。gpui 用法规则见该仓库 `AGENTS.md`。`tests/scripts/agents_md.py` 核对下表每个名字都是组件库公开项。
|
依赖 `ely-gpui-component`(pin de961eb,gpui 为 crates.io 的 `gpui-pre` =0.3.8)。名字取自 `reference/Ely-GPUI-Components/src`。gpui 用法规则见该仓库 `AGENTS.md`。`tests/scripts/agents_md.py` 核对下表每个名字都是组件库公开项。
|
||||||
|
|
||||||
| 需要 | 用 |
|
| 需要 | 用 |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
@@ -80,7 +80,7 @@ site/ 官网(Vite 8、pnpm、TypeScript,无框架;等轴 SVG 积木
|
|||||||
| 幻灯片缩略图条(`documents::PageThumbnailList` 只收图片路径,无隐藏标记、右键菜单与重排) | `apps/ely-show` 的 `slides.rs`,内核按页绘制到内存图 |
|
| 幻灯片缩略图条(`documents::PageThumbnailList` 只收图片路径,无隐藏标记、右键菜单与重排) | `apps/ely-show` 的 `slides.rs`,内核按页绘制到内存图 |
|
||||||
| PDF 页面缩略图(同上,且一次铺全部页,不合 PERF-05) | `apps/ely-pdf` 的 `side.rs`,`uniform_list` 只画可见行,worker 按需渲染 |
|
| PDF 页面缩略图(同上,且一次铺全部页,不合 PERF-05) | `apps/ely-pdf` 的 `side.rs`,`uniform_list` 只画可见行,worker 按需渲染 |
|
||||||
| 演示的参考线:LOK 不把参考线画进图块,也无参考线接口 | 补丁 0027 读写参考线;`apps/ely-show` 的 `guides.rs` 画在画布上,拖动移动,拖出幻灯片即删除 |
|
| 演示的参考线:LOK 不把参考线画进图块,也无参考线接口 | 补丁 0027 读写参考线;`apps/ely-show` 的 `guides.rs` 画在画布上,拖动移动,拖出幻灯片即删除 |
|
||||||
| gpui 文本里不能嵌图片:行内公式无从排版 | 组件库的 `MarkdownRenderer` 把行内公式显示为 TeX 原文(着色),块公式才排版 |
|
| gpui 文本里不能嵌图片:行内公式无从排版 | 组件库 `render/math_text.rs`:以不断行的空格占出公式的宽(整个公式作一个词折行),排好的公式画在其上,按下处读回公式的原文 |
|
||||||
| `A11yChecker` 的 `audit` 与对照表是私有的;Omarchy 色板要照同一套规则 | `ely-ui` 的 `omarchy/palette.rs` 抄了对照表。上游待办:公开 `audit` |
|
| `A11yChecker` 的 `audit` 与对照表是私有的;Omarchy 色板要照同一套规则 | `ely-ui` 的 `omarchy/palette.rs` 抄了对照表。上游待办:公开 `audit` |
|
||||||
| 组件无 role/aria 语义:菜单、列表等控件在 AX 树仍不可见 | 上游已修核心控件(7380afb:Button、TextInput、Tabs、面板行、对话框等);其余上游待办。项目自绘控件已自带 |
|
| 组件无 role/aria 语义:菜单、列表等控件在 AX 树仍不可见 | 上游已修核心控件(7380afb:Button、TextInput、Tabs、面板行、对话框等);其余上游待办。项目自绘控件已自带 |
|
||||||
| gpui 无 aria-disabled API(`AriaProperties` 无 disabled 字段) | 组件 7380afb 起以本地化 aria_description 表达;上游待办:gpui 补 API |
|
| gpui 无 aria-disabled API(`AriaProperties` 无 disabled 字段) | 组件 7380afb 起以本地化 aria_description 表达;上游待办:gpui 补 API |
|
||||||
@@ -123,7 +123,7 @@ scripts/fetch-references.sh 取上游源码到 reference/
|
|||||||
scripts/fetch-tessdata.sh 取 OCR 语言数据到 engines/tessdata(钉提交,核对散列)
|
scripts/fetch-tessdata.sh 取 OCR 语言数据到 engines/tessdata(钉提交,核对散列)
|
||||||
scripts/build-git.sh 构建钉住的 Git 到 engines/git(ElyTree 随包)
|
scripts/build-git.sh 构建钉住的 Git 到 engines/git(ElyTree 随包)
|
||||||
scripts/fetch-git-lfs.sh 取 git-lfs 放进 engines/git(核对散列)
|
scripts/fetch-git-lfs.sh 取 git-lfs 放进 engines/git(核对散列)
|
||||||
scripts/review.sh ID 轮次 路径 审查一条任务(herdr 右侧分栏,codex gpt-6-astra,effort max,fast)
|
scripts/review.sh ID 轮次 路径 审查一条任务(herdr 右侧分栏,codex gpt-6.1-sol,effort xhigh,fast)
|
||||||
scripts/apply-lo-patches.sh engines/lo-src 找出源码已到补丁序列第几个,补上其余(构建脚本调用)
|
scripts/apply-lo-patches.sh engines/lo-src 找出源码已到补丁序列第几个,补上其余(构建脚本调用)
|
||||||
tests/scripts/lo-patches.sh 补丁序列从中途接着打、再打一次为空操作
|
tests/scripts/lo-patches.sh 补丁序列从中途接着打、再打一次为空操作
|
||||||
tests/scripts/media-targets.sh 媒体播放接口在 Linux、Windows 目标可编译(缺目标时 SKIP)
|
tests/scripts/media-targets.sh 媒体播放接口在 Linux、Windows 目标可编译(缺目标时 SKIP)
|
||||||
@@ -213,7 +213,7 @@ cargo run -p ely-doc 启动一个应用(ElyDoc 先 cargo build -p ely
|
|||||||
- 2026-10-05(用户定):ElyAgent 的后端与内置模型的登录配置以 Kigi CLI(https://git.zacharyzhang.com/ZacharyZhang-NY/Kigi-CLI,Rust)为基础,以 Rust 依赖直接嵌入,不用 ACP;沿用其提供商登录(订阅账号或 API 密钥)与模型配置。
|
- 2026-10-05(用户定):ElyAgent 的后端与内置模型的登录配置以 Kigi CLI(https://git.zacharyzhang.com/ZacharyZhang-NY/Kigi-CLI,Rust)为基础,以 Rust 依赖直接嵌入,不用 ACP;沿用其提供商登录(订阅账号或 API 密钥)与模型配置。
|
||||||
- 2026-10-05(用户定):八个应用都不许卡顿:键入、选择、滚动、文档渲染都要即时(GPUI 的 120 FPS 手感),树莓派 3 上也要流畅。输入延迟与帧时间是验收项,要实测;界面线程不等内核、不持 worker 锁做同步请求,空闲不做事。
|
- 2026-10-05(用户定):八个应用都不许卡顿:键入、选择、滚动、文档渲染都要即时(GPUI 的 120 FPS 手感),树莓派 3 上也要流畅。输入延迟与帧时间是验收项,要实测;界面线程不等内核、不持 worker 锁做同步请求,空闲不做事。
|
||||||
- 2026-10-05:LOK 的输入与事件路径(实测后定)。原样:视图的事件监听长轮询 worker(持 worker 锁最多 50 毫秒,worker 读线程也随之阻塞最多 250 毫秒),按键排在锁后,键入锁等待中位 290 毫秒、最长 9 秒;输入队列在界面执行器上逐条跳回界面线程,每键约一帧,连续键入积压到 1 至 2 秒。现在:worker 有新事件即主动推送(`tag::EVENTS`,推送线程在输出锁下取批,批次即发送时状态),客户端读线程把回复与事件分开,事件存入 `client::Feed`,视图以异步方式等它(`Feed::next`,有新批次时唤醒,不占线程、不碰 worker 锁;原先每个打开的文档阻塞一个后台线程最多一秒,文档多于核数时会饿死输入与图块;监听任务归视图所有,视图释放即停);每个视图一条后台通道(`view/lane.rs`),输入优先、图块其次,连续执行,界面线程只收落地结果;文档尺寸与页框只在内核报尺寸变化时在后台读;批次弄脏的已显示图块即刻重绘,不等下一帧;视图的 `Reported` 事件只在内核回报或输入落地时发出,滚动与图块到达不触发应用的观察钩子;编辑与光标移动后应用要读的内核列表(ElyDoc 导航、字数、审阅,ElyTable 工作表与几何、单元格规则、格式面板)经 `ely_lok::read_off` 在后台读,一次一个,结果按发起者核对。实测(macOS,`tests/scripts/lag.sh`):按打字速度键入时输入落地 0 至 1 毫秒,图块 1 至 3 毫秒,按键到新图块 ElyDoc 中位 19 毫秒、ElyTable 3 毫秒;连续快速键入(脚本一次送出近百字)时,各次运行在 3 至 225 毫秒的中位之间摆动:新文档首次键入时内核有一次 150 至 230 毫秒的冷启动(首块图块与拼写等初始化),同一批字排在它之后;原为中位 1 秒、p95 1.9 秒。树莓派 3 未实测(本机无设备)。界面线程不碰 worker:应用对内核的读取、保存与另存为的导出、导出 PDF、比较、邮件合并都经 `Tabs::read_in`(或 `ely_lok::read_off`)在后台执行,回到窗口时按发起的标签与读取时的状态核对;保存导出期间标签状态为“正在保存”,同一标签的后续保存排队到它结束;另存为在写入前按文件身份再查一次目标是否已被别的标签持有;导出期间又有编辑时,“保存后关闭”不关闭,回到关闭询问;关闭标签时的撤销历史也在后台读;邮件合并预览与比较在发起时就保留自己的标签号与工作目录;读取失败不立即重试,等下一次状态变化;载入时一并在后台读版面与撤销历史(`ely_lok::layout`,`LokView::open` 接收版面)。窗口关闭回调先不放行,在后台逐个读标签的撤销历史并关闭(有改动的照常询问),最后一个标签关闭后移除窗口;内核文档的关闭也在后台(2026-10-06 起,原先同步读历史、在界面线程持 worker 锁关闭)。
|
- 2026-10-05:LOK 的输入与事件路径(实测后定)。原样:视图的事件监听长轮询 worker(持 worker 锁最多 50 毫秒,worker 读线程也随之阻塞最多 250 毫秒),按键排在锁后,键入锁等待中位 290 毫秒、最长 9 秒;输入队列在界面执行器上逐条跳回界面线程,每键约一帧,连续键入积压到 1 至 2 秒。现在:worker 有新事件即主动推送(`tag::EVENTS`,推送线程在输出锁下取批,批次即发送时状态),客户端读线程把回复与事件分开,事件存入 `client::Feed`,视图以异步方式等它(`Feed::next`,有新批次时唤醒,不占线程、不碰 worker 锁;原先每个打开的文档阻塞一个后台线程最多一秒,文档多于核数时会饿死输入与图块;监听任务归视图所有,视图释放即停);每个视图一条后台通道(`view/lane.rs`),输入优先、图块其次,连续执行,界面线程只收落地结果;文档尺寸与页框只在内核报尺寸变化时在后台读;批次弄脏的已显示图块即刻重绘,不等下一帧;视图的 `Reported` 事件只在内核回报或输入落地时发出,滚动与图块到达不触发应用的观察钩子;编辑与光标移动后应用要读的内核列表(ElyDoc 导航、字数、审阅,ElyTable 工作表与几何、单元格规则、格式面板)经 `ely_lok::read_off` 在后台读,一次一个,结果按发起者核对。实测(macOS,`tests/scripts/lag.sh`):按打字速度键入时输入落地 0 至 1 毫秒,图块 1 至 3 毫秒,按键到新图块 ElyDoc 中位 19 毫秒、ElyTable 3 毫秒;连续快速键入(脚本一次送出近百字)时,各次运行在 3 至 225 毫秒的中位之间摆动:新文档首次键入时内核有一次 150 至 230 毫秒的冷启动(首块图块与拼写等初始化),同一批字排在它之后;原为中位 1 秒、p95 1.9 秒。树莓派 3 未实测(本机无设备)。界面线程不碰 worker:应用对内核的读取、保存与另存为的导出、导出 PDF、比较、邮件合并都经 `Tabs::read_in`(或 `ely_lok::read_off`)在后台执行,回到窗口时按发起的标签与读取时的状态核对;保存导出期间标签状态为“正在保存”,同一标签的后续保存排队到它结束;另存为在写入前按文件身份再查一次目标是否已被别的标签持有;导出期间又有编辑时,“保存后关闭”不关闭,回到关闭询问;关闭标签时的撤销历史也在后台读;邮件合并预览与比较在发起时就保留自己的标签号与工作目录;读取失败不立即重试,等下一次状态变化;载入时一并在后台读版面与撤销历史(`ely_lok::layout`,`LokView::open` 接收版面)。窗口关闭回调先不放行,在后台逐个读标签的撤销历史并关闭(有改动的照常询问),最后一个标签关闭后移除窗口;内核文档的关闭也在后台(2026-10-06 起,原先同步读历史、在界面线程持 worker 锁关闭)。
|
||||||
- 2026-10-04(用户定):八个应用的内容区一律随系统深浅色:Doc 页面、Table 网格、Show 幻灯片、PDF 页面、邮件正文、Mark 编辑区、Agent 输出。自动颜色随之翻转,文件里写明的颜色照原样;打印与导出 PDF 仍为浅色。各引擎(LOK、MuPDF)接入应用主题,不留引擎默认色。LOK:`ely.xcd` 定义 `COLOR_SCHEME_ELY_DARK` 与 `COLOR_SCHEME_ELY_LIGHT`(文档底色、自动文字色、网格、链接等取 Ely 默认色板;内核自带的深色方案颜色留空、按应用外观取默认值,传方案名不改外观,所以不用它),`LokView` 在主题深浅变化时经有序队列发 `.uno:ChangeTheme`(不算编辑),页面底色深色取 `surface`、浅色取 `paper`;Omarchy 色板与这两套固定色可能略有差别。导出 PDF 实测仍为白底。图块作废时旧图仍显示,新图到达后替换,编辑与主题切换都不闪。
|
- 2026-10-04(用户定),2026-10-18 改(用户定):Doc 页面、Table 单元格、Show 幻灯片、PDF 页面在任何外观下都照文件原色(白底即白底),只有页面四周的界面随深浅色;邮件正文、Mark 编辑区、Agent 输出随系统深浅色。LOK:`ely.xcd` 只有 `COLOR_SCHEME_ELY_LIGHT`(文档底色白、自动文字色黑、网格、链接等);方案按视图记(LOK 下全局改动只作用于当前视图),每个 `LokView` 首帧经有序队列发一次 `.uno:ChangeTheme`(`ely_lok::SCHEME`,不算编辑),ElyShow 放映与输出的副本同样各发一次;旧版写进内核配置的 `COLOR_SCHEME_ELY_DARK` 已删,内核读不到即退回自动方案,首帧的那次改回 Ely 方案。页面底色 `ely_lok::paper()` 为白,同方案的 `DocColor`。MuPDF 照原样画,不反相。图块作废时旧图仍显示,新图到达后替换,编辑不闪。
|
||||||
- 2026-10-01:主题。`Appearance` 为系统、浅色、深色。系统档在有 Omarchy 时跟随 Omarchy(`ThemeSettings::omarchy_sync`)。读 Omarchy 的 `$HOME/.local/state/omarchy/current/theme/colors.toml`(Omarchy 写死此路径,不随 `XDG_STATE_HOME`),目录由 `ELY_OMARCHY_DIR` 可改。读法与回退链照 `reference/omarchy/bin/omarchy-theme-color`:松散引号、`colorN`、`purple`、`selection_background`、`theme_type`、`light.mode`、亮度和 382 比。缺的色相用 Ely 自己的色并警告。色板照组件库 `A11yChecker` 的规则收口:正文、状态色、代码色在各自的表面上 4.5:1,焦点与图表色在页面上 3:1;先拉近前景再拉到纯黑白,最后逐项核对,核对不过的主题整套忽略。切换时 Omarchy 先暂存 `next-theme` 再整体替换 `theme`,用文件监视跟随,不用它的钩子。新主题无 `colors.toml` 时退回 Ely 色板。`ELY_APPEARANCE`、`ELY_OMARCHY_SYNC`、`ELY_REDUCE_MOTION` 是覆盖开关,设置页接入前先用环境变量。
|
- 2026-10-01:主题。`Appearance` 为系统、浅色、深色。系统档在有 Omarchy 时跟随 Omarchy(`ThemeSettings::omarchy_sync`)。读 Omarchy 的 `$HOME/.local/state/omarchy/current/theme/colors.toml`(Omarchy 写死此路径,不随 `XDG_STATE_HOME`),目录由 `ELY_OMARCHY_DIR` 可改。读法与回退链照 `reference/omarchy/bin/omarchy-theme-color`:松散引号、`colorN`、`purple`、`selection_background`、`theme_type`、`light.mode`、亮度和 382 比。缺的色相用 Ely 自己的色并警告。色板照组件库 `A11yChecker` 的规则收口:正文、状态色、代码色在各自的表面上 4.5:1,焦点与图表色在页面上 3:1;先拉近前景再拉到纯黑白,最后逐项核对,核对不过的主题整套忽略。切换时 Omarchy 先暂存 `next-theme` 再整体替换 `theme`,用文件监视跟随,不用它的钩子。新主题无 `colors.toml` 时退回 Ely 色板。`ELY_APPEARANCE`、`ELY_OMARCHY_SYNC`、`ELY_REDUCE_MOTION` 是覆盖开关,设置页接入前先用环境变量。
|
||||||
- 2026-10-05:组件库 8658999(组件库重写历史后的 main,加本项目三个提交):属主不经 `Close` 移除的浮层(一起移除的嵌套浮层同样,回到最外层打开前之处)(对话框动作只清自身状态、异步校验通过后才关)照样把焦点交回打开前之处;原先焦点落在根上,键入无处可去,须先点一下网格。同批带入上游的 ColumnShell、输入法组字时光标重新闪烁、`Icon::from_path`、MIT 许可。旧 pin 2f02c82 已不在 main 上,只能按完整哈希取得。`Select::label` 与 `TextInput::label` 给控件无障碍名称而不绘制;对话框里描述列表旁的控件以此命名,开关用自身的 `label`。7186179 加 `NumberInput::label`(经内部文本框的 `TextInput::set_label`),同批带入上游的 rustfmt 修正。80c46b1:`TemplatePicker` 的列表是一个 Tab 停靠点,上下、Home、End 移动,回车使用,行带列表项语义,搜索提示、全部、使用、无匹配的文案进内建中英目录。7df3045:`SelectableList` 在 AX 树里是列表(`label` 命名),`ListItem` 是列表项(标题为名,带说明、选中、在可选列表中的序号与总数);原先行无角色,不在 AX 树里。af54877:`NumberInput::blank` 显示占位文字而非数字(混合选区),空着回车或失焦不提交,键入后照常。408f2b0:`CommentSidebar` 与 `RelativeTime` 的文案进内建中英目录;属主不处理“解决”时(无 `on_resolve`)不分未解决与已解决,一列显示全部。bcf0378:`CommentSidebar` 的批注列是列表,每条是 Tab 停靠点(列表项语义,名为作者与正文,带选中、序号与总数),回车或空格选中。71bfc93:`init_for_tests`(`test-support` 下)装主题与键位、不要资源,应用单测可渲染 Ely 组件。617a8d6:`FindWidget` 在查询框里按 Esc 即关闭(调 `on_close`)。2ce3368:`ContextMenu` 可定宿主大小。3d08744:`DescriptionList` 的值占满所在列,其中的文本框随之全宽;同批带入上游的图表、分页改动。a6b1bb0:`SignaturePad` 的“在此签名”与“清除”进内建中英目录;同批带入上游 P01 至 P15(各组件的越界与失效状态记日志而不 panic)。490b022:`ChangesList` 分列冲突、已暂存、改动、未跟踪、已忽略(各有其动作:冲突与已忽略只可打开),标题与提示进内建中英目录;同批带入上游 P16 至 P20。7bb53f4(ElyTree 用):`ChangesList` 行数可缺、按区报按下、当前行;`DiffViewer` 外算的段、块按钮、可选的变动行、逐行读给辅助技术;`CommitList`、`FileHistory`、`BlameView`、`ThreeWayMerge` 只画可见行,`CommitList` 近尾加载;`DescriptionList::text`;`SegmentedControl` 各段为单选;`BranchList`、`TagList` 可选中、只画属主处理的行内动作;`marked`、`conflicts`、`resolve` 按标记宽度(`MARKER` 为默认 7),a284c71 起只按 LF 断行;c5799cc:`StashList` 文案进内建中英目录,行可选(`selected`、`on_pick`),只画属主处理的行内动作;7fab072 至 3741d5d:分支、标签、储藏的行分两行(上行名称与行内动作,下行说明与行尾文字),窄时名称与说明先让;行内动作一律显示(原先只在悬停时显示,键盘停在其上时看不见),改动列表同;各 git 行带透明的 1 像素边框,焦点框才画得出(原先 `focus_ring` 无边框宽度,键盘焦点不可见);同批带入上游 P21 至 P29。4f8f3bd:`Changed::lines` 可缺(二进制文件、文件夹不计行数,不显示);37c5187 缩短其注释。19b0b29:`DiffViewer::from_stretches`(别处算好的差异,如 Git 自己的)、`hunk_action`(每块标题上一个按钮)、`selected` 与 `on_line`(改动行可按,带 Shift),`diff::mark_words` 给外来的行标出改动的词,“行内”“并排”“N 行未改动”进内建中英目录;30fea9e:有块按钮时各行同高,底色相接。edd2c12:`ChangesList` 每次按下带分区(`ChangeSection`),行是 Tab 停靠点(列表项语义),`selected` 标出当前文件。2e080b8:`SegmentedControl` 每段是单选按钮(名为其文字,带选中状态),原先不在 AX 树里。e226d79:差异查看器的行模型与配色移入 `git/rows.rs`(文件不超过 500 行);7b807a9 缩短其注释。51d2aea:`CommitList`、`FileHistory`、`BlameView` 只画视口内的行(`uniform_list`,填满所在的框;`CommitList` 收 `Rc` 的提交与 `lanes` 算好的图,`on_end` 在接近末尾时要下一页),各行是 Tab 停靠点(列表项语义,选中状态;Blame 每段首行可按,名为作者、时间与摘要),`FileHistory` 的行数可缺;`CommitInput` 的“提交到”“修改最近提交”进内建中英目录。e6220ad 与 3fc5a46:提交行窄时作者、提交号与时Line truncated
|
- 2026-10-05:组件库 8658999(组件库重写历史后的 main,加本项目三个提交):属主不经 `Close` 移除的浮层(一起移除的嵌套浮层同样,回到最外层打开前之处)(对话框动作只清自身状态、异步校验通过后才关)照样把焦点交回打开前之处;原先焦点落在根上,键入无处可去,须先点一下网格。同批带入上游的 ColumnShell、输入法组字时光标重新闪烁、`Icon::from_path`、MIT 许可。旧 pin 2f02c82 已不在 main 上,只能按完整哈希取得。`Select::label` 与 `TextInput::label` 给控件无障碍名称而不绘制;对话框里描述列表旁的控件以此命名,开关用自身的 `label`。7186179 加 `NumberInput::label`(经内部文本框的 `TextInput::set_label`),同批带入上游的 rustfmt 修正。80c46b1:`TemplatePicker` 的列表是一个 Tab 停靠点,上下、Home、End 移动,回车使用,行带列表项语义,搜索提示、全部、使用、无匹配的文案进内建中英目录。7df3045:`SelectableList` 在 AX 树里是列表(`label` 命名),`ListItem` 是列表项(标题为名,带说明、选中、在可选列表中的序号与总数);原先行无角色,不在 AX 树里。af54877:`NumberInput::blank` 显示占位文字而非数字(混合选区),空着回车或失焦不提交,键入后照常。408f2b0:`CommentSidebar` 与 `RelativeTime` 的文案进内建中英目录;属主不处理“解决”时(无 `on_resolve`)不分未解决与已解决,一列显示全部。bcf0378:`CommentSidebar` 的批注列是列表,每条是 Tab 停靠点(列表项语义,名为作者与正文,带选中、序号与总数),回车或空格选中。71bfc93:`init_for_tests`(`test-support` 下)装主题与键位、不要资源,应用单测可渲染 Ely 组件。617a8d6:`FindWidget` 在查询框里按 Esc 即关闭(调 `on_close`)。2ce3368:`ContextMenu` 可定宿主大小。3d08744:`DescriptionList` 的值占满所在列,其中的文本框随之全宽;同批带入上游的图表、分页改动。a6b1bb0:`SignaturePad` 的“在此签名”与“清除”进内建中英目录;同批带入上游 P01 至 P15(各组件的越界与失效状态记日志而不 panic)。490b022:`ChangesList` 分列冲突、已暂存、改动、未跟踪、已忽略(各有其动作:冲突与已忽略只可打开),标题与提示进内建中英目录;同批带入上游 P16 至 P20。7bb53f4(ElyTree 用):`ChangesList` 行数可缺、按区报按下、当前行;`DiffViewer` 外算的段、块按钮、可选的变动行、逐行读给辅助技术;`CommitList`、`FileHistory`、`BlameView`、`ThreeWayMerge` 只画可见行,`CommitList` 近尾加载;`DescriptionList::text`;`SegmentedControl` 各段为单选;`BranchList`、`TagList` 可选中、只画属主处理的行内动作;`marked`、`conflicts`、`resolve` 按标记宽度(`MARKER` 为默认 7),a284c71 起只按 LF 断行;c5799cc:`StashList` 文案进内建中英目录,行可选(`selected`、`on_pick`),只画属主处理的行内动作;7fab072 至 3741d5d:分支、标签、储藏的行分两行(上行名称与行内动作,下行说明与行尾文字),窄时名称与说明先让;行内动作一律显示(原先只在悬停时显示,键盘停在其上时看不见),改动列表同;各 git 行带透明的 1 像素边框,焦点框才画得出(原先 `focus_ring` 无边框宽度,键盘焦点不可见);同批带入上游 P21 至 P29。4f8f3bd:`Changed::lines` 可缺(二进制文件、文件夹不计行数,不显示);37c5187 缩短其注释。19b0b29:`DiffViewer::from_stretches`(别处算好的差异,如 Git 自己的)、`hunk_action`(每块标题上一个按钮)、`selected` 与 `on_line`(改动行可按,带 Shift),`diff::mark_words` 给外来的行标出改动的词,“行内”“并排”“N 行未改动”进内建中英目录;30fea9e:有块按钮时各行同高,底色相接。edd2c12:`ChangesList` 每次按下带分区(`ChangeSection`),行是 Tab 停靠点(列表项语义),`selected` 标出当前文件。2e080b8:`SegmentedControl` 每段是单选按钮(名为其文字,带选中状态),原先不在 AX 树里。e226d79:差异查看器的行模型与配色移入 `git/rows.rs`(文件不超过 500 行);7b807a9 缩短其注释。51d2aea:`CommitList`、`FileHistory`、`BlameView` 只画视口内的行(`uniform_list`,填满所在的框;`CommitList` 收 `Rc` 的提交与 `lanes` 算好的图,`on_end` 在接近末尾时要下一页),各行是 Tab 停靠点(列表项语义,选中状态;Blame 每段首行可按,名为作者、时间与摘要),`FileHistory` 的行数可缺;`CommitInput` 的“提交到”“修改最近提交”进内建中英目录。e6220ad 与 3fc5a46:提交行窄时作者、提交号与时Line truncated
|
||||||
- 2026-10-05:ElyTable 透视表与图表(C09.4,TABLE-10、11)。补丁 `0019-lok-calc-pivot-tables.patch` 与 `0020-lok-calc-charts.patch`:`.uno:DataPilotExec` 收 `Pivot`(JSON:源区域、行、列、筛选、值字段与函数 sum/count/average/max/min),光标在透视表上即原地修改,否则从源区域在新工作表创建;行、列、筛选里的空名表示内核的数据布局字段(多个值字段横排或竖排的位置),读出与写回都保留,已在表中的行、列、筛选字段保留各自的小计函数,读出的布局原样写回不改表;照内核布局对话框的步骤(`ConvertOrientation`,保留各字段的成员、排序与版式),新表的筛选按钮、钻取、展开收起都关(同对话框初值);放到新工作表时插表与透视表是两步撤销(同桌面版)。刷新 `.uno:RecalcPivotTable` 在内核里本就不进撤销(它改缓存)。`.uno:InsertObjectChart` 收 `Chart`(JSON:类型 column/bar/line/scatter/pie、标题、图例、X/Y 轴标题;`other` 保持原类型),LOK 下不开图表向导、插入为一步撤销、插入后图表选中;给出的区域每段都要解析得了、所指工作表都要存在,否则插入与修改都拒绝、文档不动(内核原会改用示例数据,修改时 `ChartModel::setArguments` 抛出未捕获的异常使 worker 退出);`.uno:ChangeChartData` 也收 `Chart`,区域与外观合成一步撤销(撤销保存整个图表的图示与主标题的副本,堆积等外观以外的设置一并恢复)(列表动作带当前视图号,否则 LOK 拒绝撤销别的视图的动作)。读取:`.uno:Chart`(选中图表的对象名、区域、表头、外观)、`.uno:PivotTable`(光标处透视表的名称、位置、源区域、字段与布局),`.uno:SelectedRange` 加 `data`(选区内数据的绝对区域)。界面在“插入”菜单:数据透视表、刷新数据透视表、图表;对话框在光标处有透视表、或有选中图表时为修改,否则以选中的数据(单格扩到数据区)新建,源与图表区域取 `data`,不含空行。为对话框发起的读取(`Tabs::ask_in`)回来时,发起的工作簿已不是当前标签即丢弃,不为隐藏的工作簿开对话框(ElyTable 全部对话框、合并询问)。没有数据时恢复原光标(`select.data` 会把单格标成区域,回车随之只在格内打转)。公式语法是 Excel A1,区域写 `Sheet1!$A$1:$C$5`。
|
- 2026-10-05:ElyTable 透视表与图表(C09.4,TABLE-10、11)。补丁 `0019-lok-calc-pivot-tables.patch` 与 `0020-lok-calc-charts.patch`:`.uno:DataPilotExec` 收 `Pivot`(JSON:源区域、行、列、筛选、值字段与函数 sum/count/average/max/min),光标在透视表上即原地修改,否则从源区域在新工作表创建;行、列、筛选里的空名表示内核的数据布局字段(多个值字段横排或竖排的位置),读出与写回都保留,已在表中的行、列、筛选字段保留各自的小计函数,读出的布局原样写回不改表;照内核布局对话框的步骤(`ConvertOrientation`,保留各字段的成员、排序与版式),新表的筛选按钮、钻取、展开收起都关(同对话框初值);放到新工作表时插表与透视表是两步撤销(同桌面版)。刷新 `.uno:RecalcPivotTable` 在内核里本就不进撤销(它改缓存)。`.uno:InsertObjectChart` 收 `Chart`(JSON:类型 column/bar/line/scatter/pie、标题、图例、X/Y 轴标题;`other` 保持原类型),LOK 下不开图表向导、插入为一步撤销、插入后图表选中;给出的区域每段都要解析得了、所指工作表都要存在,否则插入与修改都拒绝、文档不动(内核原会改用示例数据,修改时 `ChartModel::setArguments` 抛出未捕获的异常使 worker 退出);`.uno:ChangeChartData` 也收 `Chart`,区域与外观合成一步撤销(撤销保存整个图表的图示与主标题的副本,堆积等外观以外的设置一并恢复)(列表动作带当前视图号,否则 LOK 拒绝撤销别的视图的动作)。读取:`.uno:Chart`(选中图表的对象名、区域、表头、外观)、`.uno:PivotTable`(光标处透视表的名称、位置、源区域、字段与布局),`.uno:SelectedRange` 加 `data`(选区内数据的绝对区域)。界面在“插入”菜单:数据透视表、刷新数据透视表、图表;对话框在光标处有透视表、或有选中图表时为修改,否则以选中的数据(单格扩到数据区)新建,源与图表区域取 `data`,不含空行。为对话框发起的读取(`Tabs::ask_in`)回来时,发起的工作簿已不是当前标签即丢弃,不为隐藏的工作簿开对话框(ElyTable 全部对话框、合并询问)。没有数据时恢复原光标(`select.data` 会把单格标成区域,回车随之只在格内打转)。公式语法是 Excel A1,区域写 `Sheet1!$A$1:$C$5`。
|
||||||
@@ -277,7 +277,7 @@ cargo run -p ely-doc 启动一个应用(ElyDoc 先 cargo build -p ely
|
|||||||
- 2026-10-10:Windows 与 Linux 的构建环境(E-01)。Windows:MSVC(VS 2022,v143);MuPDF 由 `build-mupdf.sh` 以 MSBuild 编上游 `platform/win32` 的 `libmupdf`(静态运行库 /MT,同 Rust 的 `crt-static`;`HAVE_LIBCRYPTO`,`libmupdf.lib` 内含第三方、Tesseract 与 PKCS#7);静态 OpenSSL 取自钉在 2026.07.29 的 vcpkg(`engines/vcpkg`,`openssl:x64-windows-static`);Git 为 Git for Windows 的 MinGit 2.56.0(钉散列,`engines/git/cmd/git.exe`,LFS 在 `ucrt64/libexec/git-core`);`%TEMP%` 下的程序被系统的应用控制拦下,构建与探针都不放那里;cmake 与 ninja 须在 PATH;LibreOffice 的 configure 只认 VS 自带的 CMake(组件 `VC.CMake.Project`)。仓库与 `reference/` 一律 LF(`core.autocrlf false`、`core.eol lf`;`fetch-references.sh` 对每个上游照设)。Linux:WSL 的 Ubuntu 26.04;静态 libcrypto 另需其 pkg-config 列出的库(jitterentropy、zstd、z)。LibreOffice 在 Linux 照 Collabora 的 LOKit 配置构建(无图形后端、cairo RGBA、自带各库)。
|
- 2026-10-10:Windows 与 Linux 的构建环境(E-01)。Windows:MSVC(VS 2022,v143);MuPDF 由 `build-mupdf.sh` 以 MSBuild 编上游 `platform/win32` 的 `libmupdf`(静态运行库 /MT,同 Rust 的 `crt-static`;`HAVE_LIBCRYPTO`,`libmupdf.lib` 内含第三方、Tesseract 与 PKCS#7);静态 OpenSSL 取自钉在 2026.07.29 的 vcpkg(`engines/vcpkg`,`openssl:x64-windows-static`);Git 为 Git for Windows 的 MinGit 2.56.0(钉散列,`engines/git/cmd/git.exe`,LFS 在 `ucrt64/libexec/git-core`);`%TEMP%` 下的程序被系统的应用控制拦下,构建与探针都不放那里;cmake 与 ninja 须在 PATH;LibreOffice 的 configure 只认 VS 自带的 CMake(组件 `VC.CMake.Project`)。仓库与 `reference/` 一律 LF(`core.autocrlf false`、`core.eol lf`;`fetch-references.sh` 对每个上游照设)。Linux:WSL 的 Ubuntu 26.04;静态 libcrypto 另需其 pkg-config 列出的库(jitterentropy、zstd、z)。LibreOffice 在 Linux 照 Collabora 的 LOKit 配置构建(无图形后端、cairo RGBA、自带各库)。
|
||||||
- 2026-10-10:Windows 与 Linux 的内核与 worker(W-01、K-01,用户定:0.1.3 先三端发布)。内核只认合并库(`ffi::KERNEL`:`libmergedlo.dylib`、`libmergedlo.so`、`mergedlo.dll`;`sofficeapp` 在合并构建里是文本占位);Windows 载入时一并搜索该 DLL 所在的 `program/`。查找次序照旧,Windows 与 Linux 的包内位置是应用旁的 `libreoffice/program`,开发构建为 `engines/lo-src/instdir/program`。worker 的主循环:macOS 照旧以 GCD;Linux 以 unipoll,`runLoop` 的轮询回调里每次答一个请求,内核的唤醒回调往同一队列放信号(`worker/unipoll.rs`;回调的数据指针须非空,VCL 见空即不调用);Windows 也以 unipoll:LOK 不另起主线程,worker 的主线程跑 `runLoop`(Windows 的消息循环),请求经只收消息的窗口投到这条线程上执行(`worker/messages.rs`),同 macOS 的 GCD;原先 LOK 自起主线程、worker 在另一线程作答,载入表格即死锁。Windows 的循环不调轮询回调,但须传非空的回调,`isUnipoll` 只看它。补丁 `0043-lok-callbacks-flush-inline-everywhere.patch`:回调队列在各平台都即时冲出(原只 macOS),否则请求里等的命令结果与状态要等下一轮主循环才到。`0042-svx-boost-json-needs-no-library.patch`:svxcore 与 sd 定义 `BOOST_ALL_NO_LIB`,MSVC 不再按 Boost 的自动链接索要 `libboost_json`、`libboost_container`。Linux 的内核以 cairo 画图块(worker 设 `SAL_DISABLESKIA`;构建去掉 `--enable-cairo-rgba`,自带的 cairo 要清掉重建),字节为 BGRA,同 macOS 与 Windows;`getTileMode` 只看 cairo 开关,不可信。worker 启动核对在三端都画一段红字,按 BGRA 找不到红色即拒绝。`scripts/apply-lo-patches.sh` 的临时库设 `core.autocrlf false`(Windows 默认转换使任何前缀都对不上)。Windows 的 LibreOffice 在 Cygwin 下构建(`build-libreoffice.sh` 的 CYGWIN 分支:去掉 Unix 专用开关,加 VS 2022,用 `/opt/lo/bin` 的 make,清掉 Git Bash 带进来的 `MSYSTEM`);构建目录与 Cygwin 排除在 Defender 扫描之外(否则并行 configure 删不掉 `conftest.dir`)。英文词典扩展里的 Lightproof(Python 写的语法检查)在构建后删去:macOS 与 Linux 的内核不带 Python,它本不生效;Windows 必带内置 Python(Cygwin 下 configure 不许去掉),第二次用同一配置启动时初始化它,worker 挂起。worker 以 `SAL_NOLOCK_PROFILE` 运行,`ely.xcd` 关掉 LibreOffice 的文档锁(`Common/Misc/UseLocking`):被强杀的 worker 留下的锁会让下次启动或载入弹出交互而挂起;每个应用只有一个 worker 用自己的配置,冲突由 Ely 自己核对。三端发布(CI-01):`.gitea/workflows/release.yml` 在打标签时于三台运行器上执行 `scripts/ci.sh`:macOS 在 Mac mini 的常驻克隆里借用开发克隆 `~/Documents/GitHub/ElyOfficeSuite` 的引擎(`ELY_SHARE`;2026-10-11 起:从零构建 LibreOffice 超过 act_runner 默认的 3 小时,v0.1.3 的 Mac 任务被杀、无 dmg),Windows 在本机运行器上把 `engines` 与 `reference` 接到开发克隆,Linux 由同一台 Windows 运行器经 WSL 构建(服务器上的 Linux 运行器是一次性容器,建不了内核);各自打包后上传到该标签的发布。Windows 为 NSIS 安装程序,Linux 为 AppImage、deb、rpm 与 Arch 包(引擎构建与打包都经 `packaging/linux/container.sh` 进 Ubuntu 26.04 容器,WSL 里须有 docker;`ELY_SHARE` 的目录一并挂进容器),都由 `packaging/stage.sh` 分装引擎;本提交的源码包只由 Linux 上传(`packaging/source.sh`;macOS 照建供 `release-macos.sh` 核对,不上传,两端并行时不重复;Windows 的检出把符号链接写成文件,不出);重跑时所传文件有任一同名的已在发布里即失败、什么也不传,写明须先删去哪些(重建的字节不同,更新清单的散列会对不上已在的 dmg);更新清单只含 macOS(Windows 与 Linux 的自动安装未做)。
|
- 2026-10-10:Windows 与 Linux 的内核与 worker(W-01、K-01,用户定:0.1.3 先三端发布)。内核只认合并库(`ffi::KERNEL`:`libmergedlo.dylib`、`libmergedlo.so`、`mergedlo.dll`;`sofficeapp` 在合并构建里是文本占位);Windows 载入时一并搜索该 DLL 所在的 `program/`。查找次序照旧,Windows 与 Linux 的包内位置是应用旁的 `libreoffice/program`,开发构建为 `engines/lo-src/instdir/program`。worker 的主循环:macOS 照旧以 GCD;Linux 以 unipoll,`runLoop` 的轮询回调里每次答一个请求,内核的唤醒回调往同一队列放信号(`worker/unipoll.rs`;回调的数据指针须非空,VCL 见空即不调用);Windows 也以 unipoll:LOK 不另起主线程,worker 的主线程跑 `runLoop`(Windows 的消息循环),请求经只收消息的窗口投到这条线程上执行(`worker/messages.rs`),同 macOS 的 GCD;原先 LOK 自起主线程、worker 在另一线程作答,载入表格即死锁。Windows 的循环不调轮询回调,但须传非空的回调,`isUnipoll` 只看它。补丁 `0043-lok-callbacks-flush-inline-everywhere.patch`:回调队列在各平台都即时冲出(原只 macOS),否则请求里等的命令结果与状态要等下一轮主循环才到。`0042-svx-boost-json-needs-no-library.patch`:svxcore 与 sd 定义 `BOOST_ALL_NO_LIB`,MSVC 不再按 Boost 的自动链接索要 `libboost_json`、`libboost_container`。Linux 的内核以 cairo 画图块(worker 设 `SAL_DISABLESKIA`;构建去掉 `--enable-cairo-rgba`,自带的 cairo 要清掉重建),字节为 BGRA,同 macOS 与 Windows;`getTileMode` 只看 cairo 开关,不可信。worker 启动核对在三端都画一段红字,按 BGRA 找不到红色即拒绝。`scripts/apply-lo-patches.sh` 的临时库设 `core.autocrlf false`(Windows 默认转换使任何前缀都对不上)。Windows 的 LibreOffice 在 Cygwin 下构建(`build-libreoffice.sh` 的 CYGWIN 分支:去掉 Unix 专用开关,加 VS 2022,用 `/opt/lo/bin` 的 make,清掉 Git Bash 带进来的 `MSYSTEM`);构建目录与 Cygwin 排除在 Defender 扫描之外(否则并行 configure 删不掉 `conftest.dir`)。英文词典扩展里的 Lightproof(Python 写的语法检查)在构建后删去:macOS 与 Linux 的内核不带 Python,它本不生效;Windows 必带内置 Python(Cygwin 下 configure 不许去掉),第二次用同一配置启动时初始化它,worker 挂起。worker 以 `SAL_NOLOCK_PROFILE` 运行,`ely.xcd` 关掉 LibreOffice 的文档锁(`Common/Misc/UseLocking`):被强杀的 worker 留下的锁会让下次启动或载入弹出交互而挂起;每个应用只有一个 worker 用自己的配置,冲突由 Ely 自己核对。三端发布(CI-01):`.gitea/workflows/release.yml` 在打标签时于三台运行器上执行 `scripts/ci.sh`:macOS 在 Mac mini 的常驻克隆里借用开发克隆 `~/Documents/GitHub/ElyOfficeSuite` 的引擎(`ELY_SHARE`;2026-10-11 起:从零构建 LibreOffice 超过 act_runner 默认的 3 小时,v0.1.3 的 Mac 任务被杀、无 dmg),Windows 在本机运行器上把 `engines` 与 `reference` 接到开发克隆,Linux 由同一台 Windows 运行器经 WSL 构建(服务器上的 Linux 运行器是一次性容器,建不了内核);各自打包后上传到该标签的发布。Windows 为 NSIS 安装程序,Linux 为 AppImage、deb、rpm 与 Arch 包(引擎构建与打包都经 `packaging/linux/container.sh` 进 Ubuntu 26.04 容器,WSL 里须有 docker;`ELY_SHARE` 的目录一并挂进容器),都由 `packaging/stage.sh` 分装引擎;本提交的源码包只由 Linux 上传(`packaging/source.sh`;macOS 照建供 `release-macos.sh` 核对,不上传,两端并行时不重复;Windows 的检出把符号链接写成文件,不出);重跑时所传文件有任一同名的已在发布里即失败、什么也不传,写明须先删去哪些(重建的字节不同,更新清单的散列会对不上已在的 dmg);更新清单只含 macOS(Windows 与 Linux 的自动安装未做)。
|
||||||
- 2026-10-11:gpui 的 Windows 窗口关闭(W-03 冒烟查出)。`gpui-pre-windows` 0.3.8 在窗口关闭时报三条错:系统已销毁窗口(ElyTree 的关窗交给系统)后 Drop 仍对旧句柄 `RevokeDragDrop` 与 `DestroyWindow`(拖放处理器因此不释放,连带窗口状态);销毁时的失活回报排在异步任务里,执行时窗口已移除(“window not found”);退出后后台任务向已销毁的平台窗口投递(`Invalid window handle`)。修复在 `vendor/gpui-pre-windows`:`WM_DESTROY` 时记下已销毁、在句柄仍有效时撤销拖放、去掉失活回调,Drop 见已销毁即不再动句柄;平台窗口已不在时投递失败只记 debug(应用已退出),其余投递失败照报。三个应用关窗与退出的日志无错。
|
- 2026-10-11:gpui 的 Windows 窗口关闭(W-03 冒烟查出)。`gpui-pre-windows` 0.3.8 在窗口关闭时报三条错:系统已销毁窗口(ElyTree 的关窗交给系统)后 Drop 仍对旧句柄 `RevokeDragDrop` 与 `DestroyWindow`(拖放处理器因此不释放,连带窗口状态);销毁时的失活回报排在异步任务里,执行时窗口已移除(“window not found”);退出后后台任务向已销毁的平台窗口投递(`Invalid window handle`)。修复在 `vendor/gpui-pre-windows`:`WM_DESTROY` 时记下已销毁、在句柄仍有效时撤销拖放、去掉失活回调,Drop 见已销毁即不再动句柄;平台窗口已不在时投递失败只记 debug(应用已退出),其余投递失败照报。三个应用关窗与退出的日志无错。
|
||||||
- 2026-10-11(用户报:Windows 启动带黑色命令行窗口、“打开方式”里无图标、点 X 不退出、表格全黑无网格线):四处根因。命令行窗口:应用是控制台子系统;发行构建改为 `windows_subsystem = "windows"`(开发构建照旧有控制台看日志),子进程(两个 worker、Git、`cmd start`)一律经 `ely_ipc::windowless` 以 `CREATE_NO_WINDOW` 启动。图标:exe 里只有 gpui 的清单资源;各应用共用构建脚本 `packaging/windows/icon.rs`,把 `assets/icons/<应用>.ico` 编成资源 1(gpui 的窗口图标也取资源 1)。点 X 不退出:窗口其实弹了“保存更改”询问。`ely.xcd` 深色方案的 `CalcNotesBackground` 与浅色不同,Calc 在配色变化时改写批注样式并记一步撤销(`ScDetectiveFunc::UpdateAllComments`),未动的表格切到深色即算已修改;两套方案的批注底色改为同一值(LibreOffice 默认的浅黄),切换主题不再改文档,三端同此(`sheet.rs` 的 `a_theme_switch_is_no_edit`)。全黑:Win32 的虚拟设备没有 `SetSizeUsingBuffer`(基类默认返回假,断言在发行构建里不在),给客户缓冲区的设备停在 1×1 像素,Calc 图块只画了一个像素,放映图层同空;补丁 `0044-lok-win32-paints-then-copies.patch` 让 Windows 走 macOS 的路:按全尺寸画进设备,再拷进客户缓冲区(`doc_paintTile` 与 `SlideshowLayerRenderer`)。Writer 自设设备尺寸,原本不受影响。`tests/scripts/lo-patches.sh` 的临时库也设 `core.autocrlf false`(原先在 Windows 上恒失败)。
|
- 2026-10-11(用户报:Windows 启动带黑色命令行窗口、“打开方式”里无图标、点 X 不退出、表格全黑无网格线):四处根因。命令行窗口:应用是控制台子系统;发行构建改为 `windows_subsystem = "windows"`(开发构建照旧有控制台看日志),子进程(两个 worker、Git、`cmd start`)一律经 `ely_ipc::windowless` 以 `CREATE_NO_WINDOW` 启动。图标:exe 里只有 gpui 的清单资源;各应用共用构建脚本 `packaging/windows/icon.rs`,把 `assets/icons/<应用>.ico` 编成资源 1(gpui 的窗口图标也取资源 1)。点 X 不退出:窗口其实弹了“保存更改”询问。`ely.xcd` 深色方案的 `CalcNotesBackground` 与浅色不同,Calc 在配色变化时改写批注样式并记一步撤销(`ScDetectiveFunc::UpdateAllComments`),未动的表格切到深色即算已修改;两套方案的批注底色改为同一值(LibreOffice 默认的浅黄),切换主题不再改文档,三端同此(2026-10-18 起只剩浅色方案,`sheet.rs` 的 `the_scheme_is_no_edit`)。全黑:Win32 的虚拟设备没有 `SetSizeUsingBuffer`(基类默认返回假,断言在发行构建里不在),给客户缓冲区的设备停在 1×1 像素,Calc 图块只画了一个像素,放映图层同空;补丁 `0044-lok-win32-paints-then-copies.patch` 让 Windows 走 macOS 的路:按全尺寸画进设备,再拷进客户缓冲区(`doc_paintTile` 与 `SlideshowLayerRenderer`)。Writer 自设设备尺寸,原本不受影响。`tests/scripts/lo-patches.sh` 的临时库也设 `core.autocrlf false`(原先在 Windows 上恒失败)。
|
||||||
- 2026-10-11(用户报:Windows 上标题栏的最小化、最大化、关闭三个按钮都按不动):gpui 回答系统的命中测试(`WM_NCHITTEST`)时按绘制次序取第一个含指针的窗口控制区,标题栏的拖动区先于其中的按钮画出,按钮上一律答“标题栏”,系统把按下当作拖动窗口的开始,点击到不了按钮。修复在 `vendor/gpui-pre`(原样一个提交,其后是修复):按命中测试的次序取最上层的控制区,且只看未被遮挡的部分(同 `is_hovered`,盖在标题栏上的对话框挡住其下的按钮)。实测(发行构建,DPI 感知的探针移动真实指针):自右向左依次答关闭、最大化、最小化、拖动;按下最小化即最小化,最大化即最大化,关闭即退出、worker 随之结束;v0.1.3 的安装版同一探针处处答拖动。该回调只有 Windows 平台调用。
|
- 2026-10-11(用户报:Windows 上标题栏的最小化、最大化、关闭三个按钮都按不动):gpui 回答系统的命中测试(`WM_NCHITTEST`)时按绘制次序取第一个含指针的窗口控制区,标题栏的拖动区先于其中的按钮画出,按钮上一律答“标题栏”,系统把按下当作拖动窗口的开始,点击到不了按钮。修复在 `vendor/gpui-pre`(原样一个提交,其后是修复):按命中测试的次序取最上层的控制区,且只看未被遮挡的部分(同 `is_hovered`,盖在标题栏上的对话框挡住其下的按钮)。实测(发行构建,DPI 感知的探针移动真实指针):自右向左依次答关闭、最大化、最小化、拖动;按下最小化即最小化,最大化即最大化,关闭即退出、worker 随之结束;v0.1.3 的安装版同一探针处处答拖动。该回调只有 Windows 平台调用。
|
||||||
- 2026-10-11:Linux 标题栏按钮(核查 Windows 按钮问题时查出)。macOS 的红绿灯由系统画,不受影响;Linux 为客户端装饰,按钮由组件库画在标题栏的拖动区里,拖动区对任何按下都准备移动窗口,按住按钮时指针动一像素即开始移动窗口,合成器接管指针,松开到不了按钮,点击落空。组件库 3eb4d34:`drag_region` 只在按下未被里面的按钮认领(按钮以 `prevent_default` 认领)时才准备移动;`shell/title_tests.rs` 核对晃动的按下点得动 Linux 的关闭、标题栏空处照样移动窗口(去掉修复时前者失败)。未在真 Linux 桌面上点过。
|
- 2026-10-11:Linux 标题栏按钮(核查 Windows 按钮问题时查出)。macOS 的红绿灯由系统画,不受影响;Linux 为客户端装饰,按钮由组件库画在标题栏的拖动区里,拖动区对任何按下都准备移动窗口,按住按钮时指针动一像素即开始移动窗口,合成器接管指针,松开到不了按钮,点击落空。组件库 3eb4d34:`drag_region` 只在按下未被里面的按钮认领(按钮以 `prevent_default` 认领)时才准备移动;`shell/title_tests.rs` 核对晃动的按下点得动 Linux 的关闭、标题栏空处照样移动窗口(去掉修复时前者失败)。未在真 Linux 桌面上点过。
|
||||||
- 2026-10-11(用户报:ElyTree 改动列表里文件名长时盖住行尾的打开按钮):组件库 bd01470:`ChangesList` 行里的文件名原为不缩的盒子,长名越过行宽压在按钮下;现可缩、以省略号结尾,先于按钮让位;`git/tests/narrow.rs` 核对 260 宽时文件名止于按钮之前(原布局时失败)。
|
- 2026-10-11(用户报:ElyTree 改动列表里文件名长时盖住行尾的打开按钮):组件库 bd01470:`ChangesList` 行里的文件名原为不缩的盒子,长名越过行宽压在按钮下;现可缩、以省略号结尾,先于按钮让位;`git/tests/narrow.rs` 核对 260 宽时文件名止于按钮之前(原布局时失败)。
|
||||||
@@ -318,3 +318,6 @@ cargo run -p ely-doc 启动一个应用(ElyDoc 先 cargo build -p ely
|
|||||||
- 2026-10-16(Gitea #3):Windows 与 Linux 打印(R7.6)。`print_pdf` 改为异步:对话框在应用线程上,读页与出作业在自己的线程上(`print::off`),应用不卡。Windows:系统打印对话框(`PrintDlgEx`,Windows 11 显示为新式对话框),打开前把默认打印机的设置改成文档的纸张与方向(按打印机自己的纸型匹配(纸型须装得下页面,至多大 2 毫米,Linux 的 PWG 名同此);没有即自定义尺寸),设置须连同打印机名(`DEVNAMES`)一起交给对话框,否则对话框改用打印机自己的偏好(实测:Letter 文档印成 A4);所选页码范围照办,份数交驱动;勾“打印到文件”时文档输出为 `FILE:`,由打印子系统问文件名。驱动不支持所设纸张时会换成别的(实测“Microsoft Print to PDF”没有自定义尺寸,1000×600 点的页面换成 A4),所以出作业之前(`StartDoc` 之前)按打印机实际的纸张核对每一页:超出纸张半点以上(纸张尺寸至多舍入到整点,`print::ROUNDING`)、转过来也超出即报错,什么也不印(实测:600×842 点的页面原在 A4 上印出、右缘被裁)。页面由 Windows 自带的 PDF 渲染(`Windows.Data.Pdf`)按打印机分辨率分条画出,按原大从纸张的角上放(扣去不可打印的偏移),只在转过来才放得下时左转 90 度;渲染器的尺寸按 DIP 算、乘显示缩放,每次作业先试画一次量出倍数。`ELY_PRINT_TO` 时不弹对话框,经“Microsoft Print to PDF”写成文件(测试用)。`GlobalFree` 成功时返回空,windows-rs 读成错误码 0 的错误,须当作成功(否则打印报“操作成功完成”)。Linux:经 xdg 桌面门户的 `org.freedesktop.portal.Print`(`PreparePrint` 后带其令牌 `Print`,交出 PDF 的文件描述符),页面设置为文档纸张(标准纸型给 PWG 名,否则自定义毫米尺寸),边距为零,只许输出 PDF(`supported_output_file_formats`,否则对话框可选 PostScript,写出的却是 PDF);门户照原样交出所给的字节,对话框的选择由应用排定(`print/linux/sheets.rs`):GTK 设置里的页码范围(从零起)、奇偶页、倒序、份数与逐份、缩放、每张页数与排列,排到对话框所选纸张与方向上,每页为一个表单对象(带可打印批注的外观;带 NoRotate 的批注在转过的页面上绕其左上角转回、保持正立,同 MuPDF;外观的资源名避开页面已有的;可打印却没有外观的批注即报错,链接与弹出说明本无外观),单页按原大乘缩放从纸张左上角放,超出半点以上而转过来放得下即左转,否则报错;方向照 GTK 的写法(`reverse-portrait`,门户文档的页面设置同此);奇偶页只在 GTK 的文件与 lpr 后端时由 Ely 排(设置里有 `output-uri` 或 `lpr-commandline`),CUPS 后端自己把它交给 CUPS(`cups-page-set`,GTK 3.24.52 实测),Ely 再排一次即丢页;份数、每张页数等 GTK 留给应用,Ely 照排;裁剪框超出媒体框的部分不印(取两者的交);页码范围的开放终点 GTK 写作 -1(`1--1`),倒着的范围即报错;多页按格居中,再交内存文件(`memfd`);直接用 zbus:ashpd 0.13.13 的 `PageSetup`、`Settings` 缺任一字段即解析失败,真门户的回复常不带 `PPDName`。页面尺寸由 lopdf 读(CropBox,否则 MediaBox,继承、`/Rotate` 与页面自己的 `/UserUnit`)。打印不再按平台禁用(原 `print::BUILT` 与“此平台尚未构建”删去)。替身门户的测试核对选页、缩放、倒序与份数后交出的页面与位置,与只许 PDF。ElyPDF 的打印副本(`ely_print_copy`)按打印的规则画:可打印(不隐藏)的批注与表单控件,外观画进页面内容(位置照 MuPDF 自己的 `pdf_annot_transform`,与屏上一致;无外观的先由 MuPDF 生成,MuPDF 原只在显示时放在本地表里、不存入文件),其余批注与表单去掉,只留链接;系统的渲染器按屏幕规则画(不打印的照画,“打印但不显示”的不画,实测 Windows),画进内容后各渲染器都只见要打印的;仍画不出的即报错;`tests/output.rs` 渲染副本核对。真窗口(Windows):ElyDoc 的 Ctrl+P、Ely 的打印对话框、系统对话框、“Microsoft Print to PDF”的另存为,印出的 PDF 为文档的 Letter;系统对话框取消时不打印、不报错(`.work/r76/print.ps1`)。未验证:Linux 真桌面上的门户(只对替身门户核对);实体打印机。
|
- 2026-10-16(Gitea #3):Windows 与 Linux 打印(R7.6)。`print_pdf` 改为异步:对话框在应用线程上,读页与出作业在自己的线程上(`print::off`),应用不卡。Windows:系统打印对话框(`PrintDlgEx`,Windows 11 显示为新式对话框),打开前把默认打印机的设置改成文档的纸张与方向(按打印机自己的纸型匹配(纸型须装得下页面,至多大 2 毫米,Linux 的 PWG 名同此);没有即自定义尺寸),设置须连同打印机名(`DEVNAMES`)一起交给对话框,否则对话框改用打印机自己的偏好(实测:Letter 文档印成 A4);所选页码范围照办,份数交驱动;勾“打印到文件”时文档输出为 `FILE:`,由打印子系统问文件名。驱动不支持所设纸张时会换成别的(实测“Microsoft Print to PDF”没有自定义尺寸,1000×600 点的页面换成 A4),所以出作业之前(`StartDoc` 之前)按打印机实际的纸张核对每一页:超出纸张半点以上(纸张尺寸至多舍入到整点,`print::ROUNDING`)、转过来也超出即报错,什么也不印(实测:600×842 点的页面原在 A4 上印出、右缘被裁)。页面由 Windows 自带的 PDF 渲染(`Windows.Data.Pdf`)按打印机分辨率分条画出,按原大从纸张的角上放(扣去不可打印的偏移),只在转过来才放得下时左转 90 度;渲染器的尺寸按 DIP 算、乘显示缩放,每次作业先试画一次量出倍数。`ELY_PRINT_TO` 时不弹对话框,经“Microsoft Print to PDF”写成文件(测试用)。`GlobalFree` 成功时返回空,windows-rs 读成错误码 0 的错误,须当作成功(否则打印报“操作成功完成”)。Linux:经 xdg 桌面门户的 `org.freedesktop.portal.Print`(`PreparePrint` 后带其令牌 `Print`,交出 PDF 的文件描述符),页面设置为文档纸张(标准纸型给 PWG 名,否则自定义毫米尺寸),边距为零,只许输出 PDF(`supported_output_file_formats`,否则对话框可选 PostScript,写出的却是 PDF);门户照原样交出所给的字节,对话框的选择由应用排定(`print/linux/sheets.rs`):GTK 设置里的页码范围(从零起)、奇偶页、倒序、份数与逐份、缩放、每张页数与排列,排到对话框所选纸张与方向上,每页为一个表单对象(带可打印批注的外观;带 NoRotate 的批注在转过的页面上绕其左上角转回、保持正立,同 MuPDF;外观的资源名避开页面已有的;可打印却没有外观的批注即报错,链接与弹出说明本无外观),单页按原大乘缩放从纸张左上角放,超出半点以上而转过来放得下即左转,否则报错;方向照 GTK 的写法(`reverse-portrait`,门户文档的页面设置同此);奇偶页只在 GTK 的文件与 lpr 后端时由 Ely 排(设置里有 `output-uri` 或 `lpr-commandline`),CUPS 后端自己把它交给 CUPS(`cups-page-set`,GTK 3.24.52 实测),Ely 再排一次即丢页;份数、每张页数等 GTK 留给应用,Ely 照排;裁剪框超出媒体框的部分不印(取两者的交);页码范围的开放终点 GTK 写作 -1(`1--1`),倒着的范围即报错;多页按格居中,再交内存文件(`memfd`);直接用 zbus:ashpd 0.13.13 的 `PageSetup`、`Settings` 缺任一字段即解析失败,真门户的回复常不带 `PPDName`。页面尺寸由 lopdf 读(CropBox,否则 MediaBox,继承、`/Rotate` 与页面自己的 `/UserUnit`)。打印不再按平台禁用(原 `print::BUILT` 与“此平台尚未构建”删去)。替身门户的测试核对选页、缩放、倒序与份数后交出的页面与位置,与只许 PDF。ElyPDF 的打印副本(`ely_print_copy`)按打印的规则画:可打印(不隐藏)的批注与表单控件,外观画进页面内容(位置照 MuPDF 自己的 `pdf_annot_transform`,与屏上一致;无外观的先由 MuPDF 生成,MuPDF 原只在显示时放在本地表里、不存入文件),其余批注与表单去掉,只留链接;系统的渲染器按屏幕规则画(不打印的照画,“打印但不显示”的不画,实测 Windows),画进内容后各渲染器都只见要打印的;仍画不出的即报错;`tests/output.rs` 渲染副本核对。真窗口(Windows):ElyDoc 的 Ctrl+P、Ely 的打印对话框、系统对话框、“Microsoft Print to PDF”的另存为,印出的 PDF 为文档的 Letter;系统对话框取消时不打印、不报错(`.work/r76/print.ps1`)。未验证:Linux 真桌面上的门户(只对替身门户核对);实体打印机。
|
||||||
- 2026-10-16(用户定):Windows 资源管理器的右键“新建”可建 DOCX、XLSX、PPTX 与 Markdown 文件(R7.9)。空白文件在 `packaging/windows/new`(`templates.sh` 以本构建的内核把空文件转存而得,无作者与日期;Markdown 为空文件),随所属的应用装在安装目录(列在 `.ely-installed` 里),`HKCU\…\.<扩展名>\ShellNew` 的 `FileName` 指向它。资源管理器只在扩展名有默认 ProgID 时列出新建项(实测:只有 `ShellNew`、或只在 `OpenWithProgids` 下时都不列);所以只在该类型没有任何程序处理时(HKCR 下无默认值,或默认值所指的类不存在:本机 Windows 11 的 `.md` 指向不存在的 `Markdown Document`)把默认值设为本应用的 ProgID(写在 HKCU,用户自己的 `UserChoice` 不动),已有的从不改动(装着 Office、WPS 时新建菜单用它们自己的项);没有处理程序的这四种类型从此由 Ely 打开。卸载只删仍是本安装写下的 `ShellNew` 与默认值。ProgID 的名称为“<应用> Document”(新建菜单与类型列显示它)。`tests/scripts/types.sh` 核对四种都有新建项,默认值只在判空之后写。
|
- 2026-10-16(用户定):Windows 资源管理器的右键“新建”可建 DOCX、XLSX、PPTX 与 Markdown 文件(R7.9)。空白文件在 `packaging/windows/new`(`templates.sh` 以本构建的内核把空文件转存而得,无作者与日期;Markdown 为空文件),随所属的应用装在安装目录(列在 `.ely-installed` 里),`HKCU\…\.<扩展名>\ShellNew` 的 `FileName` 指向它。资源管理器只在扩展名有默认 ProgID 时列出新建项(实测:只有 `ShellNew`、或只在 `OpenWithProgids` 下时都不列);所以只在该类型没有任何程序处理时(HKCR 下无默认值,或默认值所指的类不存在:本机 Windows 11 的 `.md` 指向不存在的 `Markdown Document`)把默认值设为本应用的 ProgID(写在 HKCU,用户自己的 `UserChoice` 不动),已有的从不改动(装着 Office、WPS 时新建菜单用它们自己的项);没有处理程序的这四种类型从此由 Ely 打开。卸载只删仍是本安装写下的 `ShellNew` 与默认值。ProgID 的名称为“<应用> Document”(新建菜单与类型列显示它)。`tests/scripts/types.sh` 核对四种都有新建项,默认值只在判空之后写。
|
||||||
- 2026-10-16(用户定):ElyMark 打开的块保持原样(R7.5)。组件库 bff7ebc 起,可视模式里按下的块以原文显示在它合上时的框里(同样的边距与透明边框),字号、行高与颜色同合上时:段落、列表、引用等为正文,标题按其级数的字号、1.3 倍行高、加粗(六级为次要色),照原文写出的块(链接定义等)为等宽次要色;不再加深色底板与另一套边距,按下前后不挪位置。代码块、块公式与 front matter 仍有自己的底板(代码与 front matter 为等宽小号,front matter 为次要色,同合上时)。输入框的着色(源码模式同用)给标题与粗体同一字重(原为半粗,压过所设的加粗),六级标题里的字照为次要色(行内代码照为正文色,2e65b05),front matter 照 front matter 读(原读成分隔线加标题,键名变亮变粗)(1ff993d、962964e)。表格单元格照旧。打字机模式的居中另按两端余量判定(原只按块高与视图高,打开前后同高时首块不再居中)。同批带入组件库 cdc5ce8(标题栏拖动区里的控件按下归控件,Windows)。Windows 真窗口核对(`.work/r75`):段落、三级标题、代码块打开前后位置相同。
|
- 2026-10-16(用户定):ElyMark 打开的块保持原样(R7.5)。组件库 bff7ebc 起,可视模式里按下的块以原文显示在它合上时的框里(同样的边距与透明边框),字号、行高与颜色同合上时:段落、列表、引用等为正文,标题按其级数的字号、1.3 倍行高、加粗(六级为次要色),照原文写出的块(链接定义等)为等宽次要色;不再加深色底板与另一套边距,按下前后不挪位置。代码块、块公式与 front matter 仍有自己的底板(代码与 front matter 为等宽小号,front matter 为次要色,同合上时)。输入框的着色(源码模式同用)给标题与粗体同一字重(原为半粗,压过所设的加粗),六级标题里的字照为次要色(行内代码照为正文色,2e65b05),front matter 照 front matter 读(原读成分隔线加标题,键名变亮变粗)(1ff993d、962964e)。表格单元格照旧。打字机模式的居中另按两端余量判定(原只按块高与视图高,打开前后同高时首块不再居中)。同批带入组件库 cdc5ce8(标题栏拖动区里的控件按下归控件,Windows)。Windows 真窗口核对(`.work/r75`):段落、三级标题、代码块打开前后位置相同。
|
||||||
|
- 2026-10-18:Word 公式(R8.2,Gitea #9)。附件 math.docx 的六类公式逐类核对(本机无 Word,以文件所写为准):键盘输入、OMML(内核转为公式对象)、MathType(OLE,显示随带的 WMF 预览)、上下标、图片原本就对;差别在两处根因。其一,运行的 `w:position`(升降)原先只给文字,图片与 OLE 公式所在的运行失去它(25 张图片与一个 ½ 浮在行上):补丁 `0049-writer-inline-objects-move-with-their-run.patch` 把它作为固定升降写到对象的锚字符上(按锚字符自己的字号换算百分比,不扩展到其后的文字),版面让“作为字符”的对象随锚字符的固定升降移动(vertAlign 的自动上下标不动对象,同原样);各导出本就写出锚字符的升降,DOCX 往返仍为 `w:position`。其二,EQ 域原先只认 `\o`、`\s\do` 与注音,其余(如分数 `\f`)整个消失:补丁 `0050-writer-eq-field-parser.patch`(读法)与 `0051-writer-eq-fields-as-formulas.patch`(导入)把 EQ 域转为公式对象:`\f` 分数、`\r` 根式、`\s` 上下标、`\b` 括号、`\l` 列表、`\a` 阵列、`\i` 积分与求和求积;`\x` 与 `\o` 只留内容(无框、无叠印),`\d` 只前移,`\ai`、`\di` 只是行距(不升降),开关不分大小写;每个命令字符保留其运行的上下标(Word 照此画),同一段上下标里字样变了仍是一个上下标;斜体字母写成标识符(StarMath 与 OMML 都画成斜体,DOCX 往返不丢),斜体的数字与符号写成 `ital` 文字,存为 DOCX 后成正体(OMML 无此写法,已知限制);没有底的上下标以空文字为底(空的底在 OMML 里是占位符,重开成 `<?>`);公式取域的字号;读不通的命令以其域代码显示为文字,不消失。只有整个域是 `\s\do N(文字)` 时照原样成为下移的文字,其余都经读法(原先小写的 `\s\do` 读到第一个括号即止,其后丢失)。`client/tests/word.rs` 以 `tests/fixtures/office/word.docx`(由 `.work/r8/gen/eq.py` 生成,不入库)核对公式文本(含开头的空格、大写开关、读不通的域、字样变化的下标、`\ai`、`\di`、小写 `\s\do` 的尾部与嵌套)、DOCX 往返后的斜体、下标与无占位符、锚字符的升降与图块里图片低于文字(去掉版面的升降即失败)。审查三轮:第 3 轮的四处已修并以上述测试核对,未再审查(每条至多三轮)。仍与 Word 不同:编辑区里公式与图片四周有内核的辅助框线(`ShowBoundaries`,视图辅助,不印出);DOCX 另存后重开行距变宽,因内核导出改写文档默认字体与段距,与公式无关。
|
||||||
|
- 2026-10-18:工作表过多时标签条(R8.3,Gitea #8)。组件库 `navigation::Tabs` 横排时可横向滚动(滚轮同样),标签可窄于自然宽度;所选标签在所选或标签条宽度变了时滚入视口,在绘制时以刚排好的宽度判定(原先只在首帧滚一次,其后右栏打开、标签条变窄,所选标签被挤出视口);手动滚动保留到二者之一再变;横排的标签至多与标签条同宽,名字过长以省略号结尾(组件库 e56a343、3a68d1b、7d704d9,同批带入上游列外壳拖动的四个提交)。ElyTable 的标签条随之收缩,添加按钮留在其旁;标签条的状态按工作簿各记一份(元素 id 带标签号),切到另一工作簿时其所选标签照样滚入。`navigation/tests/tabs.rs` 以 30 个标签核对:首帧滚到所选、滚轮回到第一个、新选的滚入、变窄后所选仍在末端(去掉按宽度判定即失败)、长名的所选标签整个在标签条内(去掉宽度上限即失败);ElyTable 的 `tests/strip.rs` 以 `sheets::strip` 画两个各有 30 张表、都选第 30 张的工作簿,滚回开头后来回切换,所选标签每次都在标签条内(两个工作簿共用一个 id 即失败)。Windows 真窗口(`.work/r8/strip3.png`):30 张表、第 30 张为当前,1100 宽时标签条末端为它。
|
||||||
|
- 2026-10-18:ElyMark 公式(R8.4,用户定两项都做)。行内公式照块公式由 RaTeX 排版(原只显示着色的 TeX 原文):gpui 的文本里放不进图片,组件库 `render/math_text.rs` 把每个行内公式换成等宽的不断行空格(U+00A0,按字体量出个数),排好的公式居中画在其上,行高随最高的公式撑开;空格串与词一样整个折到下一行,画在其所在行(折行处的序号 gpui 读作上一行末);按下与右键所在的字节经换算读回公式的原文;排不出的公式照旧显示 TeX 原文,其后以危险色写出 RaTeX 给的原因与位置,记警告(不含公式)。`\(…\)` 读作行内公式,`\[…\]` 读作块公式(ChatGPT 等常写的分隔符;GitHub 不认,Typora 默认不认):解析前逐字节把成对的分隔符换成 `$`(长度不变,位置照旧对得上)。成对只在同一段落、标题或单元格里(跨列表项、CR 空行不成对);不跨代码、公式、HTML 标签、链接地址与引用标签、图片、脚注引用,`<code>`、`<kbd>` 之间(含嵌套;交叉闭合照可视的读法关闭与重开)的文字照原文;`\\(` 不换。公式里与段落里另有的 `$`(含 `\$`)解析时暂写成文本里没有的控制字节,解析后还原,不与换上的 `$` 配对;相邻的两个公式之间暂插一个空格,解析后去掉,仍是两个公式。公式节点的范围是整对分隔符,值是写下的 TeX 原文。独占一段的 `\[…\]` 为块公式(段首可有一至三个空格)。组件库公开 `documents::markdown_tree`,ElyMark 的 HTML、PDF、纯文本导出都经它解析(`markdown_options` 不再公开),纯文本里独占一段的公式照块公式写其 TeX。同时查出(组件库 e095f06):RaTeX 的 SVG 以 pt 定尺寸,usvg 按 px 量墨迹,两者差 4/3,每个公式的画面右侧与下方多出约四分之一的空白(块公式因此偏左)、导出的公式比正文大 4/3;现生成时即把根改为 px。`markdown/tex/tests.rs` 与 `tree/tests.rs` 核对分隔符的各种情形(相邻、`\$`、链接地址、`<code>`、跨块),`math_text.rs` 的窗口测试核对公式排进并读回原文、折到第二行的公式画在第二行首(改回按起点定位即失败)、排不出的公式写出原因(组件库 a20e712、5fba7b3、de961eb),`math/tests.rs` 核对画面与公式同宽(改回 pt 即失败),ElyMark 的 `visual.rs` 核对导出与纯文本。Windows 真窗口(`.work/r8/mark/visual2.png`):`$…$`、`\(…\)` 排在行内,`\[…\]` 居中成块,行内代码与转义的 `\\(` 照原文。
|
||||||
@@ -10,7 +10,7 @@ mod tests;
|
|||||||
|
|
||||||
use std::{io, path::Path};
|
use std::{io, path::Path};
|
||||||
|
|
||||||
use ely_gpui_component::documents::markdown_options;
|
use ely_gpui_component::documents::markdown_tree;
|
||||||
|
|
||||||
pub use files::{Format, Target, write};
|
pub use files::{Format, Target, write};
|
||||||
pub use pictures::{Pictures, picture_file};
|
pub use pictures::{Pictures, picture_file};
|
||||||
@@ -43,8 +43,7 @@ pub fn body(text: &str, beside: Option<&Path>, pictures: &Pictures) -> io::Resul
|
|||||||
|
|
||||||
/// `text`'s body; `placed` keeps what it copied.
|
/// `text`'s body; `placed` keeps what it copied.
|
||||||
fn page_of(text: &str, placed: &mut pictures::Placed) -> io::Result<Page> {
|
fn page_of(text: &str, placed: &mut pictures::Placed) -> io::Result<Page> {
|
||||||
let tree = markdown::to_mdast(text, &markdown_options())
|
let tree = markdown_tree(text);
|
||||||
.map_err(|error| io::Error::other(error.to_string()))?;
|
|
||||||
let mut page = Page::default();
|
let mut page = Page::default();
|
||||||
html::write(&tree, text, placed, &mut page)?;
|
html::write(&tree, text, placed, &mut page)?;
|
||||||
log::info!(
|
log::info!(
|
||||||
|
|||||||
@@ -3,14 +3,13 @@
|
|||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use ely_gpui_component::documents::{
|
use ely_gpui_component::documents::{
|
||||||
MarkdownBlock, MarkdownReader, alert, is_toc, markdown_options,
|
MarkdownBlock, MarkdownReader, alert, is_toc, markdown_tree,
|
||||||
};
|
};
|
||||||
use markdown::mdast::Node;
|
use markdown::mdast::Node;
|
||||||
|
|
||||||
/// `text` as plain text, a blank line between blocks.
|
/// `text` as plain text, a blank line between blocks.
|
||||||
pub fn plain(text: &str) -> io::Result<String> {
|
pub fn plain(text: &str) -> io::Result<String> {
|
||||||
let tree = markdown::to_mdast(text, &markdown_options())
|
let tree = markdown_tree(text);
|
||||||
.map_err(|error| io::Error::other(error.to_string()))?;
|
|
||||||
let reader = MarkdownReader::joined(text, &tree);
|
let reader = MarkdownReader::joined(text, &tree);
|
||||||
let mut blocks = Vec::new();
|
let mut blocks = Vec::new();
|
||||||
// Alerts and `[toc]` live only at the root.
|
// Alerts and `[toc]` live only at the root.
|
||||||
@@ -75,7 +74,15 @@ fn block(reader: &MarkdownReader, node: &Node, blocks: &mut Vec<String>) {
|
|||||||
block(reader, child, blocks);
|
block(reader, child, blocks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Node::Paragraph(_) | Node::Heading(_) => blocks.push(words(reader, node)),
|
Node::Paragraph(_) => {
|
||||||
|
let mut read = Vec::new();
|
||||||
|
reader.block(node, &mut read);
|
||||||
|
match read.as_slice() {
|
||||||
|
[MarkdownBlock::Math(tex)] => blocks.push(tex.clone()),
|
||||||
|
_ => blocks.push(words(reader, node)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Node::Heading(_) => blocks.push(words(reader, node)),
|
||||||
Node::Html(_) => {
|
Node::Html(_) => {
|
||||||
let mut read = Vec::new();
|
let mut read = Vec::new();
|
||||||
reader.block(node, &mut read);
|
reader.block(node, &mut read);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! Exports read the file as the visual mode does (R4.4).
|
//! Exports read the file as the visual mode does (R4.4).
|
||||||
|
|
||||||
use super::{Pictures, page, plain};
|
use super::{Pictures, page, plain};
|
||||||
use crate::output::{Page, html::write, markdown_options, pictures::Placed};
|
use crate::output::{Page, html::write, markdown_tree, pictures::Placed};
|
||||||
|
|
||||||
fn html(text: &str) -> String {
|
fn html(text: &str) -> String {
|
||||||
page(text, None, &Pictures::Inline).html
|
page(text, None, &Pictures::Inline).html
|
||||||
@@ -160,7 +160,7 @@ fn notes_under_deep_marks_write_in_linear_time() {
|
|||||||
"<b>".repeat(count),
|
"<b>".repeat(count),
|
||||||
"x[^n] ".repeat(count)
|
"x[^n] ".repeat(count)
|
||||||
);
|
);
|
||||||
let tree = markdown::to_mdast(&source, &markdown_options()).expect("parsed");
|
let tree = markdown_tree(&source);
|
||||||
let mut placed = Placed::new(None, &Pictures::Inline);
|
let mut placed = Placed::new(None, &Pictures::Inline);
|
||||||
let start = std::time::Instant::now();
|
let start = std::time::Instant::now();
|
||||||
write(&tree, &source, &mut placed, &mut Page::default()).expect("written");
|
write(&tree, &source, &mut placed, &mut Page::default()).expect("written");
|
||||||
@@ -237,3 +237,17 @@ fn a_soft_break_joins_in_exports_as_typora_exports_it() {
|
|||||||
assert!(page.contains("<p>你好 测试<br>end</p>"), "{page}");
|
assert!(page.contains("<p>你好 测试<br>end</p>"), "{page}");
|
||||||
assert_eq!(text("你好\n测试\n"), "你好 测试\n");
|
assert_eq!(text("你好\n测试\n"), "你好 测试\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn tex_delimiters_export_as_formulas() {
|
||||||
|
let source = r"a \(x^2\) b
|
||||||
|
|
||||||
|
\[
|
||||||
|
y+1
|
||||||
|
\]
|
||||||
|
";
|
||||||
|
let page = page(source, None, &Pictures::Inline);
|
||||||
|
assert_eq!(page.html.matches("<svg").count(), 2, "{}", page.html);
|
||||||
|
assert!(page.formulas.is_empty(), "{:?}", page.formulas);
|
||||||
|
assert_eq!(text(source), "a x^2 b\n\ny+1\n");
|
||||||
|
}
|
||||||
@@ -36,7 +36,7 @@ fn fraction(key: &TileKey, size: (f32, f32)) -> [f32; 4] {
|
|||||||
|
|
||||||
impl PdfView {
|
impl PdfView {
|
||||||
/// The pages in view and the tiles each needs.
|
/// The pages in view and the tiles each needs.
|
||||||
pub fn showing(&self, sf: f32, dark: bool) -> Vec<Showing> {
|
pub fn showing(&self, sf: f32) -> Vec<Showing> {
|
||||||
let laid = self.laid_out();
|
let laid = self.laid_out();
|
||||||
let (room_w, room_h) = (f32::from(self.room.size.width), f32::from(self.room.size.height));
|
let (room_w, room_h) = (f32::from(self.room.size.width), f32::from(self.room.size.height));
|
||||||
let (left, top) = (-f32::from(self.scroll.offset().x), -f32::from(self.scroll.offset().y));
|
let (left, top) = (-f32::from(self.scroll.offset().x), -f32::from(self.scroll.offset().y));
|
||||||
@@ -50,7 +50,7 @@ impl PdfView {
|
|||||||
let keys = ys
|
let keys = ys
|
||||||
.flat_map(|ty| xs.clone().map(move |tx| (tx, ty)))
|
.flat_map(|ty| xs.clone().map(move |tx| (tx, ty)))
|
||||||
.map(|(tx, ty)| {
|
.map(|(tx, ty)| {
|
||||||
let key = TileKey { page: place.page, scale, rotate: self.rotate, dark, tx, ty };
|
let key = TileKey { page: place.page, scale, rotate: self.rotate, tx, ty };
|
||||||
(key, [tx * TILE, ty * TILE, TILE.min(dw - tx * TILE), TILE.min(dh - ty * TILE)])
|
(key, [tx * TILE, ty * TILE, TILE.min(dw - tx * TILE), TILE.min(dh - ty * TILE)])
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
@@ -123,7 +123,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_tile_keeps_its_place_as_a_fraction_of_its_page() {
|
fn a_tile_keeps_its_place_as_a_fraction_of_its_page() {
|
||||||
let key = TileKey { page: 0, scale: 2000, rotate: 0, dark: false, tx: 1, ty: 0 };
|
let key = TileKey { page: 0, scale: 2000, rotate: 0, tx: 1, ty: 0 };
|
||||||
// A 612 by 792 page at 2x: 1224 by 1584.
|
// A 612 by 792 page at 2x: 1224 by 1584.
|
||||||
assert_eq!(fraction(&key, (612.0, 792.0)), [512.0 / 1224.0, 0.0, 512.0 / 1224.0, 512.0 / 1584.0]);
|
assert_eq!(fraction(&key, (612.0, 792.0)), [512.0 / 1224.0, 0.0, 512.0 / 1224.0, 512.0 / 1584.0]);
|
||||||
let turned = TileKey { rotate: 90, ..key };
|
let turned = TileKey { rotate: 90, ..key };
|
||||||
|
|||||||
@@ -16,14 +16,13 @@ use crate::view::{PdfView, Reported};
|
|||||||
/// A tile's side in device pixels.
|
/// A tile's side in device pixels.
|
||||||
pub const TILE: i32 = 512;
|
pub const TILE: i32 = 512;
|
||||||
|
|
||||||
/// A page tile at one scale, turn and theme.
|
/// A page tile at one scale and turn.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||||
pub struct TileKey {
|
pub struct TileKey {
|
||||||
pub page: usize,
|
pub page: usize,
|
||||||
/// Device pixels a point, times a thousand.
|
/// Device pixels a point, times a thousand.
|
||||||
pub scale: u32,
|
pub scale: u32,
|
||||||
pub rotate: i32,
|
pub rotate: i32,
|
||||||
pub dark: bool,
|
|
||||||
pub tx: i32,
|
pub tx: i32,
|
||||||
pub ty: i32,
|
pub ty: i32,
|
||||||
}
|
}
|
||||||
@@ -123,17 +122,14 @@ impl PdfView {
|
|||||||
|
|
||||||
/// Pages in view and their tiles; missing ones asked.
|
/// Pages in view and their tiles; missing ones asked.
|
||||||
pub fn page_view(&mut self, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
|
pub fn page_view(&mut self, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
|
||||||
let (sf, dark) = (window.scale_factor(), cx.theme().is_dark());
|
let sf = window.scale_factor();
|
||||||
let (sunken, paper) = {
|
let (sunken, paper) = (cx.theme().colors.sunken, gpui::white());
|
||||||
let colors = &cx.theme().colors;
|
|
||||||
(colors.sunken, if dark { colors.surface } else { colors.paper })
|
|
||||||
};
|
|
||||||
let laid = self.laid_out();
|
let laid = self.laid_out();
|
||||||
if let Some((x, y)) = self.go_to.take() {
|
if let Some((x, y)) = self.go_to.take() {
|
||||||
self.scroll.set_offset(point(px(-x), px(-y)));
|
self.scroll.set_offset(point(px(-x), px(-y)));
|
||||||
}
|
}
|
||||||
let top = -f32::from(self.scroll.offset().y);
|
let top = -f32::from(self.scroll.offset().y);
|
||||||
let showing = self.showing(sf, dark);
|
let showing = self.showing(sf);
|
||||||
// The current page: first showing more than a sliver.
|
// The current page: first showing more than a sliver.
|
||||||
if let Some(first) = showing.iter().map(|s| s.place).find(|p| p.y + p.h > top + GAP * 3.0) {
|
if let Some(first) = showing.iter().map(|s| s.place).find(|p| p.y + p.h > top + GAP * 3.0) {
|
||||||
let paired = showing.iter().any(|s| s.place.page == self.current) && first.page / 2 == self.current / 2;
|
let paired = showing.iter().any(|s| s.place.page == self.current) && first.page / 2 == self.current / 2;
|
||||||
@@ -266,7 +262,7 @@ impl PdfView {
|
|||||||
self.painting = true;
|
self.painting = true;
|
||||||
let (doc, scale, version) = (self.doc, key.scale as f32 / 1000.0, self.version);
|
let (doc, scale, version) = (self.doc, key.scale as f32 / 1000.0, self.version);
|
||||||
self.off(
|
self.off(
|
||||||
move |worker| worker.render(doc, key.page, (scale, key.rotate), rect, key.dark),
|
move |worker| worker.render(doc, key.page, (scale, key.rotate), rect),
|
||||||
move |view, painted, cx| {
|
move |view, painted, cx| {
|
||||||
view.painting = false;
|
view.painting = false;
|
||||||
if view.version != version {
|
if view.version != version {
|
||||||
|
|||||||
+13
-13
@@ -100,11 +100,11 @@ impl PdfView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Asks for the first missing picture in `rows`.
|
/// Asks for the first missing picture in `rows`.
|
||||||
fn ask_thumb(&mut self, rows: Range<usize>, (sf, dark): (f32, bool), cx: &mut Context<Self>) {
|
fn ask_thumb(&mut self, rows: Range<usize>, sf: f32, cx: &mut Context<Self>) {
|
||||||
if self.thumbing {
|
if self.thumbing {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let due = |page: &usize| !self.thumbs.contains_key(&(*page, dark)) || self.thumbs_stale.contains(&(*page, dark));
|
let due = |page: &usize| !self.thumbs.contains_key(page) || self.thumbs_stale.contains(page);
|
||||||
let Some(page) = rows.clone().find(|page| due(page) && !self.thumbs_failed.contains(page)) else {
|
let Some(page) = rows.clone().find(|page| due(page) && !self.thumbs_failed.contains(page)) else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
@@ -114,7 +114,7 @@ impl PdfView {
|
|||||||
let (doc, version) = (self.doc, self.version);
|
let (doc, version) = (self.doc, self.version);
|
||||||
self.thumbing = true;
|
self.thumbing = true;
|
||||||
self.off(
|
self.off(
|
||||||
move |worker| worker.render(doc, page, (scale, 0), tile, dark),
|
move |worker| worker.render(doc, page, (scale, 0), tile),
|
||||||
move |view, painted, cx| {
|
move |view, painted, cx| {
|
||||||
view.thumbing = false;
|
view.thumbing = false;
|
||||||
if view.version != version {
|
if view.version != version {
|
||||||
@@ -128,8 +128,8 @@ impl PdfView {
|
|||||||
});
|
});
|
||||||
match painted.map(|bgra| crate::pages::picture((tile[2] as u32, tile[3] as u32), bgra)) {
|
match painted.map(|bgra| crate::pages::picture((tile[2] as u32, tile[3] as u32), bgra)) {
|
||||||
Ok(Some(image)) => {
|
Ok(Some(image)) => {
|
||||||
view.thumbs_stale.remove(&(page, dark));
|
view.thumbs_stale.remove(&page);
|
||||||
if let Some(old) = view.thumbs.insert((page, dark), image) {
|
if let Some(old) = view.thumbs.insert(page, image) {
|
||||||
view.retired.push(old);
|
view.retired.push(old);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,18 +149,18 @@ impl PdfView {
|
|||||||
|
|
||||||
impl PdfView {
|
impl PdfView {
|
||||||
/// The picture a row draws; an old one until repainted.
|
/// The picture a row draws; an old one until repainted.
|
||||||
pub fn picture(&self, page: usize, dark: bool) -> Option<Arc<RenderImage>> {
|
pub fn picture(&self, page: usize) -> Option<Arc<RenderImage>> {
|
||||||
self.thumbs.get(&(page, dark)).cloned()
|
self.thumbs.get(&page).cloned()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// One row: the page number and its picture.
|
/// One row: the page number and its picture.
|
||||||
fn row(view: &Entity<PdfView>, page: usize, dark: bool, cx: &App) -> gpui::AnyElement {
|
fn row(view: &Entity<PdfView>, page: usize, cx: &App) -> gpui::AnyElement {
|
||||||
let read = view.read(cx);
|
let read = view.read(cx);
|
||||||
let colors = &cx.theme().colors;
|
let colors = &cx.theme().colors;
|
||||||
let (w, h) = read.sizes[page];
|
let (w, h) = read.sizes[page];
|
||||||
let picked = read.picked.contains(&page);
|
let picked = read.picked.contains(&page);
|
||||||
let picture = read.picture(page, dark);
|
let picture = read.picture(page);
|
||||||
let count = read.sizes.len();
|
let count = read.sizes.len();
|
||||||
let label = Viewer::text(cx, "pdf.page.label", &[("n", &(page + 1).to_string())]);
|
let label = Viewer::text(cx, "pdf.page.label", &[("n", &(page + 1).to_string())]);
|
||||||
let (clicked, pressed, dropped) = (view.clone(), view.clone(), view.clone());
|
let (clicked, pressed, dropped) = (view.clone(), view.clone(), view.clone());
|
||||||
@@ -210,7 +210,7 @@ fn row(view: &Entity<PdfView>, page: usize, dark: bool, cx: &App) -> gpui::AnyEl
|
|||||||
.h(px(height))
|
.h(px(height))
|
||||||
.border_1()
|
.border_1()
|
||||||
.border_color(if picked { colors.focus } else { colors.border })
|
.border_color(if picked { colors.focus } else { colors.border })
|
||||||
.bg(if dark { colors.surface } else { colors.paper })
|
.bg(gpui::white())
|
||||||
.when_some(picture, |frame, picture| frame.child(img(picture).size_full())),
|
.when_some(picture, |frame, picture| frame.child(img(picture).size_full())),
|
||||||
)
|
)
|
||||||
.child(div().text_xs().text_color(colors.fg_subtle).child((page + 1).to_string()))
|
.child(div().text_xs().text_color(colors.fg_subtle).child((page + 1).to_string()))
|
||||||
@@ -258,12 +258,12 @@ impl Render for Side {
|
|||||||
Pane::Notes => crate::notelist::list(&view, cx),
|
Pane::Notes => crate::notelist::list(&view, cx),
|
||||||
Pane::Files => crate::attach::list(&view, cx),
|
Pane::Files => crate::attach::list(&view, cx),
|
||||||
Pane::Pages => {
|
Pane::Pages => {
|
||||||
let shown = (window.scale_factor(), cx.theme().is_dark());
|
let sf = window.scale_factor();
|
||||||
let count = view.read(cx).sizes.len();
|
let count = view.read(cx).sizes.len();
|
||||||
let rows = view.clone();
|
let rows = view.clone();
|
||||||
let list = uniform_list("pdf-thumbs", count, move |range, _, cx| {
|
let list = uniform_list("pdf-thumbs", count, move |range, _, cx| {
|
||||||
rows.update(cx, |view, cx| view.ask_thumb(range.clone(), shown, cx));
|
rows.update(cx, |view, cx| view.ask_thumb(range.clone(), sf, cx));
|
||||||
range.map(|page| row(&rows, page, shown.1, cx)).collect()
|
range.map(|page| row(&rows, page, cx)).collect()
|
||||||
})
|
})
|
||||||
.size_full();
|
.size_full();
|
||||||
div()
|
div()
|
||||||
|
|||||||
@@ -188,13 +188,13 @@ fn tiles_beside_the_view_are_neither_asked_nor_kept() {
|
|||||||
|
|
||||||
/// Flags any notify leaving a shown page with nothing drawn.
|
/// Flags any notify leaving a shown page with nothing drawn.
|
||||||
fn never_bare(cx: &mut VisualTestContext, view: &Entity<PdfView>) -> (gpui::Subscription, std::rc::Rc<std::cell::Cell<bool>>) {
|
fn never_bare(cx: &mut VisualTestContext, view: &Entity<PdfView>) -> (gpui::Subscription, std::rc::Rc<std::cell::Cell<bool>>) {
|
||||||
let (sf, dark) = cx.update(|window, app| (window.scale_factor(), ely_gpui_component::theme::ActiveTheme::theme(app).is_dark()));
|
let sf = cx.update(|window, _| window.scale_factor());
|
||||||
let bare = std::rc::Rc::new(std::cell::Cell::new(false));
|
let bare = std::rc::Rc::new(std::cell::Cell::new(false));
|
||||||
let seen = bare.clone();
|
let seen = bare.clone();
|
||||||
let watch = cx.update(|_, app| {
|
let watch = cx.update(|_, app| {
|
||||||
app.observe(view, move |view, app| {
|
app.observe(view, move |view, app| {
|
||||||
let read = view.read(app);
|
let read = view.read(app);
|
||||||
if read.showing(sf, dark).iter().any(|page| read.pieces(page).is_empty()) {
|
if read.showing(sf).iter().any(|page| read.pieces(page).is_empty()) {
|
||||||
seen.set(true);
|
seen.set(true);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -248,10 +248,10 @@ fn a_new_scale_keeps_the_old_tiles_until_new_ones_land() {
|
|||||||
cx.simulate_resize(gpui::size(px(700.), px(800.)));
|
cx.simulate_resize(gpui::size(px(700.), px(800.)));
|
||||||
// The new size lays out before any new tile lands.
|
// The new size lays out before any new tile lands.
|
||||||
cx.run_until_parked();
|
cx.run_until_parked();
|
||||||
let (sf, dark) = cx.update(|window, app| (window.scale_factor(), ely_gpui_component::theme::ActiveTheme::theme(app).is_dark()));
|
let sf = cx.update(|window, _| window.scale_factor());
|
||||||
let now = cx.update(|_, app| {
|
let now = cx.update(|_, app| {
|
||||||
let read = view.read(app);
|
let read = view.read(app);
|
||||||
read.showing(sf, dark).iter().map(|page| read.pieces(page).len()).collect::<Vec<_>>()
|
read.showing(sf).iter().map(|page| read.pieces(page).len()).collect::<Vec<_>>()
|
||||||
});
|
});
|
||||||
assert!(now.iter().all(|count| *count > 0), "drawn right after the resize: {now:?}");
|
assert!(now.iter().all(|count| *count > 0), "drawn right after the resize: {now:?}");
|
||||||
settle(cx, |app| view.read(app).laid_out().scale != scale && repainted(view.read(app)));
|
settle(cx, |app| view.read(app).laid_out().scale != scale && repainted(view.read(app)));
|
||||||
@@ -315,7 +315,7 @@ fn old_tiles_are_painted_and_freed_with_their_tab() {
|
|||||||
let shown = cx.update(|window, app| {
|
let shown = cx.update(|window, app| {
|
||||||
let read = view.read(app);
|
let read = view.read(app);
|
||||||
let room = read.room;
|
let room = read.room;
|
||||||
read.showing(window.scale_factor(), false).iter().map(|s| {
|
read.showing(window.scale_factor()).iter().map(|s| {
|
||||||
let (left, top) = (-f32::from(read.scroll.offset().x), -f32::from(read.scroll.offset().y));
|
let (left, top) = (-f32::from(read.scroll.offset().x), -f32::from(read.scroll.offset().y));
|
||||||
let w = (s.place.x + s.place.w).min(left + f32::from(room.size.width)) - s.place.x.max(left);
|
let w = (s.place.x + s.place.w).min(left + f32::from(room.size.width)) - s.place.x.max(left);
|
||||||
let h = (s.place.y + s.place.h).min(top + f32::from(room.size.height)) - s.place.y.max(top);
|
let h = (s.place.y + s.place.h).min(top + f32::from(room.size.height)) - s.place.y.max(top);
|
||||||
@@ -333,9 +333,8 @@ fn an_edit_keeps_page_pictures_until_they_repaint() {
|
|||||||
let mut cx = TestAppContext::single();
|
let mut cx = TestAppContext::single();
|
||||||
let (viewer, cx) = windowed(&mut cx, dir.path(), &[file(dir.path(), "one.pdf", &[(612.0, 792.0, &["Hello"])])], true);
|
let (viewer, cx) = windowed(&mut cx, dir.path(), &[file(dir.path(), "one.pdf", &[(612.0, 792.0, &["Hello"])])], true);
|
||||||
let view = shown(cx, &viewer);
|
let view = shown(cx, &viewer);
|
||||||
let dark = cx.update(|_, app| ely_gpui_component::theme::ActiveTheme::theme(app).is_dark());
|
settle(cx, |app| view.read(app).picture(0).is_some() && repainted(view.read(app)));
|
||||||
settle(cx, |app| view.read(app).picture(0, dark).is_some() && repainted(view.read(app)));
|
let old = cx.update(|_, app| view.read(app).picture(0).expect("a picture"));
|
||||||
let old = cx.update(|_, app| view.read(app).picture(0, dark).expect("a picture"));
|
|
||||||
// A picture on its way holds back the repaint.
|
// A picture on its way holds back the repaint.
|
||||||
cx.update(|_, app| view.update(app, |view, _| view.thumbing = true));
|
cx.update(|_, app| view.update(app, |view, _| view.thumbing = true));
|
||||||
cx.update(|_, app| view.update(app, |view, cx| view.annotate("adding a note", vec![note()], cx)));
|
cx.update(|_, app| view.update(app, |view, cx| view.annotate("adding a note", vec![note()], cx)));
|
||||||
@@ -349,7 +348,7 @@ fn an_edit_keeps_page_pictures_until_they_repaint() {
|
|||||||
cx.notify()
|
cx.notify()
|
||||||
}));
|
}));
|
||||||
settle(cx, |app| view.read(app).thumbs_stale.is_empty());
|
settle(cx, |app| view.read(app).thumbs_stale.is_empty());
|
||||||
let new = cx.update(|_, app| view.read(app).picture(0, dark).expect("a picture"));
|
let new = cx.update(|_, app| view.read(app).picture(0).expect("a picture"));
|
||||||
assert!(!std::sync::Arc::ptr_eq(&new, &old), "the new picture replaces it");
|
assert!(!std::sync::Arc::ptr_eq(&new, &old), "the new picture replaces it");
|
||||||
super::frames(cx);
|
super::frames(cx);
|
||||||
assert!(cx.update(|window, _| window.has_image_atlas_entry(&new)), "and is drawn");
|
assert!(cx.update(|window, _| window.has_image_atlas_entry(&new)), "and is drawn");
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ fn scanned(dir: &std::path::Path) -> std::path::PathBuf {
|
|||||||
let doc = worker.open(&source).expect("opens").doc;
|
let doc = worker.open(&source).expect("opens").doc;
|
||||||
let s: f32 = 200.0 / 72.0;
|
let s: f32 = 200.0 / 72.0;
|
||||||
let (w, h) = ((612.0 * s).ceil() as i32, (792.0 * s).ceil() as i32);
|
let (w, h) = ((612.0 * s).ceil() as i32, (792.0 * s).ceil() as i32);
|
||||||
let bgra = worker.render(doc, 0, (s, 0), [0, 0, w, h], false).expect("draws").bgra;
|
let bgra = worker.render(doc, 0, (s, 0), [0, 0, w, h]).expect("draws").bgra;
|
||||||
let gray: Vec<u8> = bgra.chunks_exact(4).map(|p| ((u16::from(p[0]) + u16::from(p[1]) + u16::from(p[2])) / 3) as u8).collect();
|
let gray: Vec<u8> = bgra.chunks_exact(4).map(|p| ((u16::from(p[0]) + u16::from(p[1]) + u16::from(p[2])) / 3) as u8).collect();
|
||||||
let path = dir.join("scan.pdf");
|
let path = dir.join("scan.pdf");
|
||||||
std::fs::write(&path, scan((612.0, 792.0), (w as u32, h as u32), &gray)).expect("writes");
|
std::fs::write(&path, scan((612.0, 792.0), (w as u32, h as u32), &gray)).expect("writes");
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! Password prompts, zoomed pairs, jumps across (C11.1).
|
//! Password prompts, zoomed pairs, jumps across (C11.1).
|
||||||
|
|
||||||
use ely_office::{Dialog, Dialogs as _, Tabs as _};
|
use ely_office::{Dialog, Dialogs as _, Opening as _, Tabs as _};
|
||||||
use gpui::{Entity, Modifiers, ScrollDelta, ScrollWheelEvent, TestAppContext, VisualTestContext, point, px};
|
use gpui::{Entity, Modifiers, ScrollDelta, ScrollWheelEvent, TestAppContext, VisualTestContext, point, px};
|
||||||
|
|
||||||
use super::{file, frames, settle, shown, windowed};
|
use super::{file, frames, settle, shown, windowed};
|
||||||
@@ -144,3 +144,21 @@ fn ctrl_and_a_wheel_notch_step_the_zoom_once() {
|
|||||||
frames(cx);
|
frames(cx);
|
||||||
assert_eq!(read(cx).0, Zoom::Scale(crate::keys::stepped(1.0, false)));
|
assert_eq!(read(cx).0, Zoom::Scale(crate::keys::stepped(1.0, false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn a_dark_app_shows_the_page_as_the_file_paints_it() {
|
||||||
|
use ely_gpui_component::theme::{Mode, Theme};
|
||||||
|
let dir = tempfile::tempdir().expect("a temp dir");
|
||||||
|
let mut cx = TestAppContext::single();
|
||||||
|
let (viewer, cx) = windowed(&mut cx, dir.path(), &[], true);
|
||||||
|
cx.update(|_, app| Theme::set_mode_now(Mode::Dark, app));
|
||||||
|
let path = file(dir.path(), "one.pdf", &[(612.0, 792.0, &["alpha"])]);
|
||||||
|
cx.update(|_, app| viewer.update(app, |viewer, cx| viewer.open_file(path, cx)));
|
||||||
|
settle(cx, |app| viewer.read(app).active_view().is_some());
|
||||||
|
let view = shown(cx, &viewer);
|
||||||
|
let corner = |app: &gpui::App| view.read(app).tiles.iter().find(|(key, _)| key.tx == 0 && key.ty == 0).map(|(_, image)| image.clone());
|
||||||
|
settle(cx, |app| corner(app).is_some());
|
||||||
|
let tile = cx.update(|_, app| corner(app)).expect("the first tile");
|
||||||
|
let bytes = tile.as_bytes(0).expect("its pixels");
|
||||||
|
assert_eq!(&bytes[..3], &[255, 255, 255], "the paper stays white");
|
||||||
|
}
|
||||||
@@ -87,11 +87,11 @@ pub struct PdfView {
|
|||||||
pub saved: String,
|
pub saved: String,
|
||||||
/// Saves so far: a read from before one is stale.
|
/// Saves so far: a read from before one is stale.
|
||||||
pub saves: u64,
|
pub saves: u64,
|
||||||
/// Page pictures for the side panel, by page and darkness.
|
/// Page pictures for the side panel, by page.
|
||||||
pub thumbs: HashMap<(usize, bool), Arc<RenderImage>>,
|
pub thumbs: HashMap<usize, Arc<RenderImage>>,
|
||||||
pub thumbs_failed: HashSet<usize>,
|
pub thumbs_failed: HashSet<usize>,
|
||||||
/// Pictures from before an edit; shown until repainted.
|
/// Pictures from before an edit; shown until repainted.
|
||||||
pub thumbs_stale: HashSet<(usize, bool)>,
|
pub thumbs_stale: HashSet<usize>,
|
||||||
/// A picture is on its way from the worker.
|
/// A picture is on its way from the worker.
|
||||||
pub thumbing: bool,
|
pub thumbing: bool,
|
||||||
/// Pages picked in the side panel, and the anchor.
|
/// Pages picked in the side panel, and the anchor.
|
||||||
|
|||||||
@@ -100,12 +100,12 @@ impl Host for Deck {
|
|||||||
view.turn_parts();
|
view.turn_parts();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Pictures follow the kernel's light or dark scheme.
|
// Pictures before the scheme landed are repainted.
|
||||||
let dark = view.read(cx).dark();
|
let lit = view.read(cx).lit();
|
||||||
if let Some(tab) = self.tab_mut(id)
|
if let Some(tab) = self.tab_mut(id)
|
||||||
&& tab.extra.dark != dark
|
&& tab.extra.lit != lit
|
||||||
{
|
{
|
||||||
tab.extra.dark = dark;
|
tab.extra.lit = lit;
|
||||||
self.repaint_all(id, cx);
|
self.repaint_all(id, cx);
|
||||||
}
|
}
|
||||||
self.offer_menu(id, view, cx);
|
self.offer_menu(id, view, cx);
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ pub struct Extra {
|
|||||||
pub painting: bool,
|
pub painting: bool,
|
||||||
/// The parts are masters.
|
/// The parts are masters.
|
||||||
pub masters: bool,
|
pub masters: bool,
|
||||||
/// The scheme the pictures were painted with.
|
/// The pictures were painted with Ely's scheme.
|
||||||
pub dark: Option<bool>,
|
pub lit: bool,
|
||||||
/// The view was fitted to the slide once.
|
/// The view was fitted to the slide once.
|
||||||
pub fitted: bool,
|
pub fitted: bool,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ impl Deck {
|
|||||||
let range = output.pages();
|
let range = output.pages();
|
||||||
let (w, h) = tab.extra.size;
|
let (w, h) = tab.extra.size;
|
||||||
let size = (PICTURE, (f64::from(PICTURE) * h as f64 / w.max(1) as f64).round() as u32);
|
let size = (PICTURE, (f64::from(PICTURE) * h as f64 / w.max(1) as f64).round() as u32);
|
||||||
let (copy, light) = (tab.work.join("output.odp"), ely_lok::scheme(false));
|
let (copy, light) = (tab.work.join("output.odp"), ely_lok::SCHEME);
|
||||||
let (shown, opened) = (folder.display().to_string(), folder.clone());
|
let (shown, opened) = (folder.display().to_string(), folder.clone());
|
||||||
log::info!("show: writes slide pictures");
|
log::info!("show: writes slide pictures");
|
||||||
self.read_in(
|
self.read_in(
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ impl Deck {
|
|||||||
// A show starts from black; effects play on the page.
|
// A show starts from black; effects play on the page.
|
||||||
let behind = match &preview.playing {
|
let behind = match &preview.playing {
|
||||||
Playing::Transition { .. } => gpui::black(),
|
Playing::Transition { .. } => gpui::black(),
|
||||||
Playing::Effects { .. } => ely_lok::paper(cx),
|
Playing::Effects { .. } => ely_lok::paper(),
|
||||||
};
|
};
|
||||||
let content = match &preview.playing {
|
let content = match &preview.playing {
|
||||||
Playing::Effects {
|
Playing::Effects {
|
||||||
@@ -266,7 +266,7 @@ impl Deck {
|
|||||||
} else {
|
} else {
|
||||||
(t / preview.length) as f32
|
(t / preview.length) as f32
|
||||||
};
|
};
|
||||||
let paper = ely_lok::paper(cx);
|
let paper = ely_lok::paper();
|
||||||
// Exits are not read; the old slide shows everything.
|
// Exits are not read; the old slide shows everything.
|
||||||
let from = (from.as_deref())
|
let from = (from.as_deref())
|
||||||
.map(|from| compose::slide(from, |_| true, frame, paper).into_any_element());
|
.map(|from| compose::slide(from, |_| true, frame, paper).into_any_element());
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ impl Render for Presenter {
|
|||||||
let big = stage::fit(show.slide, (room.width * 0.6, room.height * 0.8));
|
let big = stage::fit(show.slide, (room.width * 0.6, room.height * 0.8));
|
||||||
let small = stage::fit(show.slide, (room.width * 0.3, room.height * 0.35));
|
let small = stage::fit(show.slide, (room.width * 0.3, room.height * 0.35));
|
||||||
let next = match show.upcoming() {
|
let next = match show.upcoming() {
|
||||||
Some(part) => stage::still(show, part, small, cx),
|
Some(part) => stage::still(show, part, small),
|
||||||
None => div().w(small.0).h(small.1).into_any_element(),
|
None => div().w(small.0).h(small.1).into_any_element(),
|
||||||
};
|
};
|
||||||
let notes = show.part().map(|part| show.slides[part].notes.clone());
|
let notes = show.part().map(|part| show.slides[part].notes.clone());
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ pub fn stage(show: &Show, (w, h): (Pixels, Pixels), cx: &App) -> AnyElement {
|
|||||||
let Some(stack) = show.stack(part) else {
|
let Some(stack) = show.stack(part) else {
|
||||||
return black((w, h));
|
return black((w, h));
|
||||||
};
|
};
|
||||||
let paper = ely_lok::paper(cx);
|
let paper = ely_lok::paper();
|
||||||
let t = show.entered.elapsed().as_secs_f64();
|
let t = show.entered.elapsed().as_secs_f64();
|
||||||
let slide = &show.slides[part];
|
let slide = &show.slides[part];
|
||||||
let shown = match &show.leaving {
|
let shown = match &show.leaving {
|
||||||
@@ -76,9 +76,9 @@ pub fn stage(show: &Show, (w, h): (Pixels, Pixels), cx: &App) -> AnyElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A slide as it first shows, still.
|
/// A slide as it first shows, still.
|
||||||
pub fn still(show: &Show, part: usize, size: (Pixels, Pixels), cx: &App) -> AnyElement {
|
pub fn still(show: &Show, part: usize, size: (Pixels, Pixels)) -> AnyElement {
|
||||||
match show.stack(part) {
|
match show.stack(part) {
|
||||||
Some(stack) => compose::slide(stack, |visible| visible, size, ely_lok::paper(cx))
|
Some(stack) => compose::slide(stack, |visible| visible, size, ely_lok::paper())
|
||||||
.into_any_element(),
|
.into_any_element(),
|
||||||
None => black(size),
|
None => black(size),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,16 +59,14 @@ pub fn discard(worker: Arc<Mutex<Worker>>, doc: Doc, copy: PathBuf, cx: &App) {
|
|||||||
fn copy(
|
fn copy(
|
||||||
worker: &mut Worker,
|
worker: &mut Worker,
|
||||||
doc: &Doc,
|
doc: &Doc,
|
||||||
(copy, scheme): (&std::path::Path, Option<&'static str>),
|
copy: &std::path::Path,
|
||||||
) -> io::Result<(usize, Doc, Vec<ShowSlide>)> {
|
) -> io::Result<(usize, Doc, Vec<ShowSlide>)> {
|
||||||
let current = doc.sheets(worker)?.current;
|
let current = doc.sheets(worker)?.current;
|
||||||
let url = ely_lok::file_url(copy);
|
let url = ely_lok::file_url(copy);
|
||||||
doc.save_as(worker, &url, "odp")?;
|
doc.save_as(worker, &url, "odp")?;
|
||||||
let shown = worker.load(&url)?;
|
let shown = worker.load(&url)?;
|
||||||
let read = |worker: &mut Worker| -> io::Result<Vec<ShowSlide>> {
|
let read = |worker: &mut Worker| -> io::Result<Vec<ShowSlide>> {
|
||||||
if let Some(scheme) = scheme {
|
worker.run(&shown, "view.theme", &[ely_lok::SCHEME])?;
|
||||||
worker.run(&shown, "view.theme", &[scheme])?;
|
|
||||||
}
|
|
||||||
ely_lok::show::slide_show(&worker.values(&shown, ely_lok::show::SLIDE_SHOW)?)
|
ely_lok::show::slide_show(&worker.values(&shown, ely_lok::show::SLIDE_SHOW)?)
|
||||||
};
|
};
|
||||||
match read(worker) {
|
match read(worker) {
|
||||||
@@ -161,14 +159,13 @@ impl Deck {
|
|||||||
self.show_starting = false;
|
self.show_starting = false;
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
let scheme = tab.view.read(cx).dark().map(ely_lok::scheme);
|
|
||||||
let path = tab.work.join(format!("show-{}.odp", self.shows));
|
let path = tab.work.join(format!("show-{}.odp", self.shows));
|
||||||
self.shows += 1;
|
self.shows += 1;
|
||||||
let into = path.clone();
|
let into = path.clone();
|
||||||
let worker = self.core.worker.clone();
|
let worker = self.core.worker.clone();
|
||||||
self.read_in(
|
self.read_in(
|
||||||
id,
|
id,
|
||||||
move |worker, doc| copy(worker, doc, (&into, scheme)),
|
move |worker, doc| copy(worker, doc, &into),
|
||||||
move |deck, read, _, cx| {
|
move |deck, read, _, cx| {
|
||||||
deck.show_starting = false;
|
deck.show_starting = false;
|
||||||
let (current, doc, slides) = match read {
|
let (current, doc, slides) = match read {
|
||||||
@@ -382,7 +379,7 @@ mod tests {
|
|||||||
let deck = deck.read(app);
|
let deck = deck.read(app);
|
||||||
let tab = deck.active_tab().expect("a tab");
|
let tab = deck.active_tab().expect("a tab");
|
||||||
let mut worker = deck.core.worker.lock().expect("the worker lock");
|
let mut worker = deck.core.worker.lock().expect("the worker lock");
|
||||||
let (_, doc, slides) = super::copy(&mut worker, &tab.doc, (&path, None)).expect("a copy");
|
let (_, doc, slides) = super::copy(&mut worker, &tab.doc, &path).expect("a copy");
|
||||||
super::Starting { tab: tab.id, slides, first: 0, doc, copy: path.clone(), audience: 99, presenter: false }
|
super::Starting { tab: tab.id, slides, first: 0, doc, copy: path.clone(), audience: 99, presenter: false }
|
||||||
});
|
});
|
||||||
update(&mut cx, &deck, |deck, cx| {
|
update(&mut cx, &deck, |deck, cx| {
|
||||||
|
|||||||
@@ -109,18 +109,12 @@ impl Book {
|
|||||||
let Some(tab) = self.active_tab() else {
|
let Some(tab) = self.active_tab() else {
|
||||||
return div().into_any_element();
|
return div().into_any_element();
|
||||||
};
|
};
|
||||||
let Some(choices) = visible(&tab.extra.sheets) else {
|
let Some(tabs) = strip(tab.id, &tab.extra.sheets) else {
|
||||||
return div().into_any_element();
|
return div().into_any_element();
|
||||||
};
|
};
|
||||||
let this = cx.entity();
|
let this = cx.entity();
|
||||||
let picked = this.clone();
|
let picked = this.clone();
|
||||||
let tabs = SheetTabs::new(
|
let tabs = tabs.on_change(move |value, _, cx| {
|
||||||
"table-sheets",
|
|
||||||
choices,
|
|
||||||
tab.extra.sheets.current.to_string(),
|
|
||||||
)
|
|
||||||
.placement(TabPlacement::Bottom)
|
|
||||||
.on_change(move |value, _, cx| {
|
|
||||||
let index: usize = value.parse().expect("sheet tabs are indexes");
|
let index: usize = value.parse().expect("sheet tabs are indexes");
|
||||||
picked.update(cx, |book, cx| book.show_sheet(index, cx));
|
picked.update(cx, |book, cx| book.show_sheet(index, cx));
|
||||||
})
|
})
|
||||||
@@ -310,6 +304,15 @@ impl Book {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Workbook `id`'s sheet tabs; each workbook keeps its own scroll.
|
||||||
|
fn strip(id: u64, sheets: &ely_lok::Sheets) -> Option<SheetTabs> {
|
||||||
|
let choices = visible(sheets)?;
|
||||||
|
Some(
|
||||||
|
SheetTabs::new(("table-sheets", id), choices, sheets.current.to_string())
|
||||||
|
.placement(TabPlacement::Bottom),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
/// Visible sheets as tabs, once the shown one is known.
|
/// Visible sheets as tabs, once the shown one is known.
|
||||||
fn visible(sheets: &ely_lok::Sheets) -> Option<Vec<Choice>> {
|
fn visible(sheets: &ely_lok::Sheets) -> Option<Vec<Choice>> {
|
||||||
let shown = sheets.list.get(sheets.current)?;
|
let shown = sheets.list.get(sheets.current)?;
|
||||||
@@ -327,6 +330,10 @@ fn visible(sheets: &ely_lok::Sheets) -> Option<Vec<Choice>> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
#[path = "tests/strip.rs"]
|
||||||
|
mod strip_tests;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
//! Each workbook's strip shows its own chosen sheet.
|
||||||
|
|
||||||
|
use ely_lok::{Sheet, Sheets};
|
||||||
|
use gpui::{
|
||||||
|
Bounds, Context, IntoElement, Modifiers, ParentElement as _, Pixels, Render, RenderOnce as _,
|
||||||
|
ScrollDelta, ScrollHandle, ScrollWheelEvent, Styled as _, TestAppContext, TouchPhase,
|
||||||
|
VisualTestContext, Window, div, point, px,
|
||||||
|
};
|
||||||
|
|
||||||
|
use super::strip;
|
||||||
|
|
||||||
|
struct Books {
|
||||||
|
book: u64,
|
||||||
|
sheets: Sheets,
|
||||||
|
scroll: Option<ScrollHandle>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Render for Books {
|
||||||
|
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||||
|
let tabs = strip(self.book, &self.sheets)
|
||||||
|
.expect("tabs")
|
||||||
|
.render(window, cx)
|
||||||
|
.into_any_element();
|
||||||
|
let id = gpui::ElementId::from(("table-sheets", self.book));
|
||||||
|
let handle = window.use_keyed_state((id, "scroll"), cx, |_, _| ScrollHandle::new());
|
||||||
|
self.scroll = Some(handle.read(cx).clone());
|
||||||
|
div()
|
||||||
|
.w(px(640.))
|
||||||
|
.child(div().flex().items_center().px_2().child(tabs))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn settle(cx: &mut VisualTestContext) {
|
||||||
|
for _ in 0..5 {
|
||||||
|
cx.run_until_parked();
|
||||||
|
cx.update(|window, _| window.refresh());
|
||||||
|
}
|
||||||
|
cx.run_until_parked();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The strip's viewport and the chosen tab in it.
|
||||||
|
fn place(
|
||||||
|
view: &gpui::Entity<Books>,
|
||||||
|
cx: &mut VisualTestContext,
|
||||||
|
) -> (Bounds<Pixels>, Bounds<Pixels>) {
|
||||||
|
view.read_with(cx, |view, _| {
|
||||||
|
let scroll = view.scroll.as_ref().expect("drawn");
|
||||||
|
let mut chosen = scroll
|
||||||
|
.bounds_for_item(view.sheets.current)
|
||||||
|
.expect("chosen tab");
|
||||||
|
chosen.origin += scroll.offset();
|
||||||
|
(scroll.bounds(), chosen)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn shown(view: &gpui::Entity<Books>, cx: &mut VisualTestContext) -> bool {
|
||||||
|
let (viewport, chosen) = place(view, cx);
|
||||||
|
chosen.left() >= viewport.left() && chosen.right() <= viewport.right()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[gpui::test]
|
||||||
|
fn a_switched_workbook_shows_its_chosen_sheet(cx: &mut TestAppContext) {
|
||||||
|
cx.update(ely_gpui_component::init_for_tests);
|
||||||
|
let sheets = Sheets {
|
||||||
|
current: 29,
|
||||||
|
list: (0..30)
|
||||||
|
.map(|n| Sheet {
|
||||||
|
name: format!("Sheet {n}"),
|
||||||
|
visible: true,
|
||||||
|
})
|
||||||
|
.collect(),
|
||||||
|
};
|
||||||
|
let (view, cx) = cx.add_window_view(|_, _| Books {
|
||||||
|
book: 1,
|
||||||
|
sheets,
|
||||||
|
scroll: None,
|
||||||
|
});
|
||||||
|
settle(cx);
|
||||||
|
assert!(shown(&view, cx), "the first draw shows the chosen sheet");
|
||||||
|
for book in [2, 1, 2] {
|
||||||
|
cx.simulate_event(ScrollWheelEvent {
|
||||||
|
position: point(px(60.), px(16.)),
|
||||||
|
delta: ScrollDelta::Pixels(point(px(0.), px(50_000.))),
|
||||||
|
modifiers: Modifiers::none(),
|
||||||
|
touch_phase: TouchPhase::Moved,
|
||||||
|
});
|
||||||
|
settle(cx);
|
||||||
|
assert!(!shown(&view, cx), "the wheel moves the chosen sheet away");
|
||||||
|
view.update(cx, |view, cx| {
|
||||||
|
view.book = book;
|
||||||
|
cx.notify();
|
||||||
|
});
|
||||||
|
settle(cx);
|
||||||
|
assert!(shown(&view, cx), "workbook {book} shows its chosen sheet");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,6 +29,7 @@ mod sheet;
|
|||||||
pub(crate) mod show;
|
pub(crate) mod show;
|
||||||
mod slides;
|
mod slides;
|
||||||
mod tools;
|
mod tools;
|
||||||
|
mod word;
|
||||||
mod workbook;
|
mod workbook;
|
||||||
|
|
||||||
/// The pinned LibreOffice commit the build must report.
|
/// The pinned LibreOffice commit the build must report.
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ fn brightness(tile: &Tile) -> u32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn the_page_follows_a_dark_theme_and_back() {
|
fn ely_scheme_paints_the_page_white() {
|
||||||
let Some(install) = install() else {
|
let Some(install) = install() else {
|
||||||
eprintln!("SKIP: no pinned LOK build");
|
eprintln!("SKIP: no pinned LOK build");
|
||||||
return;
|
return;
|
||||||
@@ -363,23 +363,11 @@ fn the_page_follows_a_dark_theme_and_back() {
|
|||||||
let doc = worker
|
let doc = worker
|
||||||
.load(&crate::file_url(&source))
|
.load(&crate::file_url(&source))
|
||||||
.expect("the document loads");
|
.expect("the document loads");
|
||||||
let area = (1440, 1440, 3840, 3840);
|
poll_until(&mut worker, &doc, &Events::default(), QUIET, |_| false);
|
||||||
let seen = poll_until(&mut worker, &doc, &Events::default(), QUIET, |_| false);
|
worker.run(&doc, "view.theme", &["COLOR_SCHEME_ELY_LIGHT"]).expect("the scheme");
|
||||||
let light = brightness(&doc.paint_tile(&mut worker, area, (64, 64)).expect("a tile"));
|
let tile = doc.paint_tile(&mut worker, (1440, 1440, 3840, 3840), (64, 64)).expect("a tile");
|
||||||
let paint = |worker: &mut Worker, scheme: &str, seen: &Events| {
|
let shade = brightness(&tile);
|
||||||
worker.run(&doc, "view.theme", &[scheme]).expect("a theme");
|
assert!(shade > 200, "{name}: the page is light, {shade}");
|
||||||
let repainted = poll_until(worker, &doc, seen, SETTLE, |seen| seen.all);
|
|
||||||
assert!(repainted.all, "{name}: {scheme} repaints the view");
|
|
||||||
let tile = doc.paint_tile(worker, area, (64, 64)).expect("a tile");
|
|
||||||
(brightness(&tile), repainted)
|
|
||||||
};
|
|
||||||
let (dark, seen) = paint(&mut worker, "COLOR_SCHEME_ELY_DARK", &seen);
|
|
||||||
let (back, _) = paint(&mut worker, "COLOR_SCHEME_ELY_LIGHT", &seen);
|
|
||||||
eprintln!("THEME {name} light {light} dark {dark} back {back}");
|
|
||||||
assert!(
|
|
||||||
light > 200 && dark < 100 && back > 200,
|
|
||||||
"{name}: {light} {dark} {back}"
|
|
||||||
);
|
|
||||||
worker.close_doc(doc).expect("the document closes");
|
worker.close_doc(doc).expect("the document closes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,18 +182,16 @@ pub(super) fn open_book(text: &str) -> (tempfile::TempDir, Worker, Doc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_theme_switch_is_no_edit() {
|
fn the_scheme_is_no_edit() {
|
||||||
if install().is_none() {
|
if install().is_none() {
|
||||||
eprintln!("SKIP: no pinned LOK build");
|
eprintln!("SKIP: no pinned LOK build");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let (_dir, mut worker, doc) = open_book(FODS);
|
let (_dir, mut worker, doc) = open_book(FODS);
|
||||||
for scheme in ["COLOR_SCHEME_ELY_DARK", "COLOR_SCHEME_ELY_LIGHT"] {
|
worker.run(&doc, "view.theme", &["COLOR_SCHEME_ELY_LIGHT"]).expect("the scheme runs");
|
||||||
worker.run(&doc, "view.theme", &[scheme]).expect("the theme runs");
|
let undo = worker.values(&doc, ".uno:Undo").expect("the undo stack");
|
||||||
let undo = worker.values(&doc, ".uno:Undo").expect("the undo stack");
|
let undo: serde_json::Value = serde_json::from_str(&undo).expect("undo JSON");
|
||||||
let undo: serde_json::Value = serde_json::from_str(&undo).expect("undo JSON");
|
assert_eq!(undo["actions"], "", "the scheme left undo steps");
|
||||||
assert_eq!(undo["actions"], "", "{scheme} left undo steps");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
//! Gitea #9: Word's EQ fields and lowered inline objects.
|
||||||
|
|
||||||
|
use super::input::saved;
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
/// `tests/fixtures/office/word.docx` open in a fresh worker.
|
||||||
|
fn word() -> (tempfile::TempDir, Worker, Doc) {
|
||||||
|
let dir = tempfile::tempdir().expect("a temp dir");
|
||||||
|
let install = install().expect("a pinned LOK build");
|
||||||
|
let mut worker = Worker::spawn(&install, &dir.path().join("profile")).expect("the worker");
|
||||||
|
let fixture = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../tests/fixtures/office/word.docx");
|
||||||
|
let doc = worker.load(&crate::file_url(&fixture)).expect("the document loads");
|
||||||
|
(dir, worker, doc)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The text position of the span around the picture's frame.
|
||||||
|
fn picture_position(fodt: &str) -> String {
|
||||||
|
let named = fodt.find("draw:name=\"red\"").expect("the picture");
|
||||||
|
let frame = fodt[..named].rfind("<draw:frame").expect("the picture's frame");
|
||||||
|
let open = fodt[..frame].rfind("<text:span").expect("a span around the picture");
|
||||||
|
let style = fodt[open..].split('"').nth(1).expect("the span's style");
|
||||||
|
let named = format!("style:name=\"{style}\"");
|
||||||
|
let at = fodt.find(&named).expect("the span's style is written");
|
||||||
|
let props = &fodt[at..at + fodt[at..].find("</style:style>").expect("the style ends")];
|
||||||
|
let position = props.find("style:text-position=\"").expect("the span is raised or lowered");
|
||||||
|
props[position + 21..].split('"').next().expect("a position").to_owned()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn eq_fields_open_as_formulas() {
|
||||||
|
if install().is_none() {
|
||||||
|
eprintln!("SKIP: no pinned LOK build");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let (dir, mut worker, doc) = word();
|
||||||
|
let fodt = saved(&dir, &mut worker, &doc, "word.fodt");
|
||||||
|
assert!(
|
||||||
|
fodt.contains("{{a}_{"10"}} over {{a}_{"3"}}"),
|
||||||
|
"the fraction keeps its italics and subscripts"
|
||||||
|
);
|
||||||
|
assert!(fodt.contains("nroot{"3"}{"x"}"), "the radical");
|
||||||
|
assert!(fodt.contains("sum from{"1"} to{"5"}"), "an uppercase \\SU is a sum");
|
||||||
|
assert!(
|
||||||
|
fodt.contains("matrix{{"a"} # {"b"} ## {"c"} # {"d"}}"),
|
||||||
|
"an uppercase \\CO2 makes two columns"
|
||||||
|
);
|
||||||
|
assert!(fodt.contains("eq \\f(a)</text:span>"), "an unreadable field shows its code");
|
||||||
|
assert!(fodt.contains("eq \\b\\lc\\★(x)"), "an unknown bracket shows its code");
|
||||||
|
let short = formulas(&fodt).into_iter().find(|math| math.contains("# {}}")).expect("the short array");
|
||||||
|
assert!(short.contains(">c<"), "a short last row keeps its operand");
|
||||||
|
assert_eq!(fodt.matches('∑').count(), 2, "\\SU and \\fc\\∑ both draw a sum");
|
||||||
|
assert!(fodt.contains('⌊') && fodt.contains('⌋'), "floor brackets draw");
|
||||||
|
assert!(!fodt.contains("MERGEFORMAT"), "a general switch is no formula text");
|
||||||
|
assert!(fodt.contains("{"m"} over {"n"}<"), "nothing after the fraction");
|
||||||
|
assert_eq!(subscripts(&fodt, ">p<"), 1, "a style change keeps one subscript");
|
||||||
|
assert!(fodt.contains(""u" stack{{"v"}}"), "\\ai only spaces lines");
|
||||||
|
assert!(fodt.contains(""w" stack{{"k"}}"), "\\di only spaces lines");
|
||||||
|
assert!(fodt.contains("_{{"g"}} "+h""), "a lowercase \\s\\do keeps its tail");
|
||||||
|
assert!(fodt.contains("_{{{"r"} over {"s"}}}"), "and its nested fraction");
|
||||||
|
assert!(fodt.contains(">lowered</text:span>"), "a plain \\s\\do stays lowered text");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn eq_formulas_survive_docx() {
|
||||||
|
if install().is_none() {
|
||||||
|
eprintln!("SKIP: no pinned LOK build");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let (dir, mut worker, doc) = word();
|
||||||
|
let docx = dir.path().join("again.docx");
|
||||||
|
doc.save_as(&mut worker, &crate::file_url(&docx), "docx").expect("the DOCX saves");
|
||||||
|
let back = worker.load(&crate::file_url(&docx)).expect("the DOCX reopens");
|
||||||
|
let fodt = saved(&dir, &mut worker, &back, "again.fodt");
|
||||||
|
assert!(
|
||||||
|
fodt.contains("{{a} rsub {"10"}} over {{a} rsub {"3"}}"),
|
||||||
|
"the italic letters stay italic"
|
||||||
|
);
|
||||||
|
assert!(!fodt.contains("mathvariant=\"normal\">a<"), "no upright a");
|
||||||
|
assert_eq!(subscripts(&fodt, ">p<"), 1, "one subscript still");
|
||||||
|
assert!(fodt.contains("{""} rsub {"g"} "+h""), "the tail survives");
|
||||||
|
assert!(!fodt.contains("<?>"), "no placeholder for a missing base");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Subscripts in the formula holding `mark`.
|
||||||
|
fn subscripts(fodt: &str, mark: &str) -> usize {
|
||||||
|
formulas(fodt).into_iter().find(|math| math.contains(mark)).expect("the formula").matches("<msub>").count()
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Each embedded formula's MathML.
|
||||||
|
fn formulas(fodt: &str) -> Vec<&str> {
|
||||||
|
fodt.split("<math xmlns").skip(1).map(|math| &math[..math.find("</math>").expect("closed")]).collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn a_lowered_picture_moves_with_its_run_and_keeps_it() {
|
||||||
|
if install().is_none() {
|
||||||
|
eprintln!("SKIP: no pinned LOK build");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let (dir, mut worker, doc) = word();
|
||||||
|
let fodt = saved(&dir, &mut worker, &doc, "word.fodt");
|
||||||
|
// 11 points down, against the 11 point anchor.
|
||||||
|
assert_eq!(picture_position(&fodt), "-100% 100%");
|
||||||
|
let docx = dir.path().join("again.docx");
|
||||||
|
doc.save_as(&mut worker, &crate::file_url(&docx), "docx").expect("the DOCX saves");
|
||||||
|
let back = worker.load(&crate::file_url(&docx)).expect("the DOCX reopens");
|
||||||
|
let again = saved(&dir, &mut worker, &back, "again.fodt");
|
||||||
|
assert_eq!(picture_position(&again), "-100% 100%", "the position survives DOCX");
|
||||||
|
// The square's red sits below the line's text.
|
||||||
|
let tile = back.paint_tile(&mut worker, (1440, 1440, 3840, 1920), (256, 128)).expect("a tile");
|
||||||
|
let rows = |hit: fn(&[u8]) -> bool| {
|
||||||
|
let mut lit: Vec<usize> = tile.pixels.chunks_exact(4).enumerate().filter(|(_, px)| hit(px)).map(|(at, _)| at / 256).collect();
|
||||||
|
lit.dedup();
|
||||||
|
let first = *lit.first().expect("some pixels");
|
||||||
|
let line = lit.iter().zip(first..).take_while(|(row, want)| **row <= *want).last().expect("a row");
|
||||||
|
(first, *line.0)
|
||||||
|
};
|
||||||
|
let red = rows(|px| px[2] > 200 && px[1] < 60 && px[0] < 60);
|
||||||
|
let ink = rows(|px| px[0] < 80 && px[1] < 80 && px[2] < 80);
|
||||||
|
assert!(red.1 > ink.1 + 4, "the picture hangs below the text: red {red:?}, text {ink:?}");
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ pub use client::{
|
|||||||
#[cfg(feature = "view")]
|
#[cfg(feature = "view")]
|
||||||
pub use view::{
|
pub use view::{
|
||||||
CONTEXT, Copy, Cut, Geom, Layout, LokError, LokView, Paste, Reported, ZOOM_STEPS, notch,
|
CONTEXT, Copy, Cut, Geom, Layout, LokError, LokView, Paste, Reported, ZOOM_STEPS, notch,
|
||||||
Zoomed, init, layout, paper, read_off, scheme,
|
SCHEME, Zoomed, init, layout, paper, read_off,
|
||||||
};
|
};
|
||||||
#[cfg(feature = "view")]
|
#[cfg(feature = "view")]
|
||||||
mod view;
|
mod view;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ mod scroll;
|
|||||||
mod sheet;
|
mod sheet;
|
||||||
pub use input::{CONTEXT, Copy, Cut, Paste, init};
|
pub use input::{CONTEXT, Copy, Cut, Paste, init};
|
||||||
pub use off::read_off;
|
pub use off::read_off;
|
||||||
pub use render::{paper, scheme};
|
pub use render::{SCHEME, paper};
|
||||||
mod turn;
|
mod turn;
|
||||||
pub use turn::notch;
|
pub use turn::notch;
|
||||||
|
|
||||||
@@ -123,8 +123,8 @@ pub struct LokView {
|
|||||||
pointer: gpui::CursorStyle,
|
pointer: gpui::CursorStyle,
|
||||||
selection: Vec<Rect>,
|
selection: Vec<Rect>,
|
||||||
cell: crate::Cell,
|
cell: crate::Cell,
|
||||||
/// Whether the kernel was last told to paint dark.
|
/// Whether the kernel was told Ely's scheme.
|
||||||
dark: Option<bool>,
|
lit: bool,
|
||||||
/// The zoom follows the viewport so a page fits.
|
/// The zoom follows the viewport so a page fits.
|
||||||
fit: bool,
|
fit: bool,
|
||||||
/// Set when the wheel and Up, Down turn parts.
|
/// Set when the wheel and Up, Down turn parts.
|
||||||
@@ -218,7 +218,7 @@ impl LokView {
|
|||||||
pointer: gpui::CursorStyle::Arrow,
|
pointer: gpui::CursorStyle::Arrow,
|
||||||
selection: Vec::new(),
|
selection: Vec::new(),
|
||||||
cell: crate::Cell::default(),
|
cell: crate::Cell::default(),
|
||||||
dark: None,
|
lit: false,
|
||||||
fit: false,
|
fit: false,
|
||||||
turning: None,
|
turning: None,
|
||||||
part: 0,
|
part: 0,
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ use super::LokView;
|
|||||||
use crate::Rect;
|
use crate::Rect;
|
||||||
|
|
||||||
impl LokView {
|
impl LokView {
|
||||||
/// Whether the kernel paints dark; None before the first frame.
|
/// Whether the kernel was told Ely's scheme.
|
||||||
pub fn dark(&self) -> Option<bool> {
|
pub fn lit(&self) -> bool {
|
||||||
self.dark
|
self.lit
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The kernel's state for `uno`, as LOK reports it (LOK-05).
|
/// The kernel's state for `uno`, as LOK reports it (LOK-05).
|
||||||
|
|||||||
@@ -15,33 +15,21 @@ use gpui::{Pixels, RenderImage, point};
|
|||||||
use super::{CONTEXT, LokView, TILE_TWIPS, TWIPS_PER_PIXEL, handles, input};
|
use super::{CONTEXT, LokView, TILE_TWIPS, TWIPS_PER_PIXEL, handles, input};
|
||||||
use crate::Rect;
|
use crate::Rect;
|
||||||
|
|
||||||
/// Ely's kernel color schemes, from `ely.xcd`.
|
/// Ely's kernel color scheme, from `ely.xcd`.
|
||||||
const DARK: &str = "COLOR_SCHEME_ELY_DARK";
|
pub const SCHEME: &str = "COLOR_SCHEME_ELY_LIGHT";
|
||||||
const LIGHT: &str = "COLOR_SCHEME_ELY_LIGHT";
|
|
||||||
|
|
||||||
/// The kernel scheme for a light or dark app.
|
/// A page's colour, the scheme's `DocColor`.
|
||||||
pub fn scheme(dark: bool) -> &'static str {
|
pub fn paper() -> gpui::Hsla {
|
||||||
if dark { DARK } else { LIGHT }
|
gpui::white()
|
||||||
}
|
|
||||||
|
|
||||||
/// A page's colour; the kernel's Ely schemes share it.
|
|
||||||
pub fn paper(cx: &gpui::App) -> gpui::Hsla {
|
|
||||||
let theme = cx.theme();
|
|
||||||
if theme.is_dark() {
|
|
||||||
theme.colors.surface
|
|
||||||
} else {
|
|
||||||
theme.colors.paper
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LokView {
|
impl LokView {
|
||||||
/// Paints with the app's light or dark scheme.
|
/// Content keeps the file's colours in any app theme.
|
||||||
pub(super) fn follow_theme(&mut self, dark: bool) {
|
pub(super) fn paint_light(&mut self) {
|
||||||
if self.dark != Some(dark) {
|
if !self.lit {
|
||||||
self.dark = Some(dark);
|
self.lit = true;
|
||||||
let scheme = scheme(dark);
|
log::info!("lok: paints with {SCHEME}");
|
||||||
log::info!("lok: paints with {scheme}");
|
self.send(input::Input::Theme(SCHEME));
|
||||||
self.send(input::Input::Theme(scheme));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,11 +41,11 @@ impl Render for LokView {
|
|||||||
self.keep_scroll(|view| view.geom.dpi = dpi);
|
self.keep_scroll(|view| view.geom.dpi = dpi);
|
||||||
self.retire_tiles();
|
self.retire_tiles();
|
||||||
}
|
}
|
||||||
self.follow_theme(cx.theme().is_dark());
|
self.paint_light();
|
||||||
let this = cx.entity().clone();
|
let this = cx.entity().clone();
|
||||||
let focus = self.focus.clone();
|
let focus = self.focus.clone();
|
||||||
let colors = &cx.theme().colors;
|
let colors = &cx.theme().colors;
|
||||||
let paper = super::paper(cx);
|
let paper = super::paper();
|
||||||
let (selection_color, caret_color) = (colors.selection, colors.focus);
|
let (selection_color, caret_color) = (colors.selection, colors.focus);
|
||||||
let canvas_color = colors.sunken;
|
let canvas_color = colors.sunken;
|
||||||
let caret_width = cx.theme().caret_width().to_pixels(window.rem_size());
|
let caret_width = cx.theme().caret_width().to_pixels(window.rem_size());
|
||||||
|
|||||||
@@ -24,37 +24,63 @@ fn area() -> Bounds<Pixels> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A user profile whose dark scheme paints the page black.
|
||||||
|
const DARK_PROFILE: &str = r#"<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<item oor:path="/org.openoffice.Office.UI/ColorScheme/ColorSchemes"><node oor:name="TEST_DARK" oor:op="replace"><node oor:name="DocColor"><prop oor:name="Color" oor:op="fuse"><value>0</value></prop></node></node></item>
|
||||||
|
</oor:items>
|
||||||
|
"#;
|
||||||
|
|
||||||
|
/// Shows a view in a window.
|
||||||
|
struct Host(Entity<LokView>);
|
||||||
|
|
||||||
|
impl gpui::Render for Host {
|
||||||
|
fn render(&mut self, _: &mut gpui::Window, _: &mut gpui::Context<Self>) -> impl gpui::IntoElement {
|
||||||
|
self.0.clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn the_view_paints_the_app_theme_and_back() {
|
fn a_dark_app_paints_the_page_white() {
|
||||||
let Some(install) = crate::client::tests::install() else {
|
let Some(install) = crate::client::tests::install() else {
|
||||||
eprintln!("SKIP: no pinned LOK build");
|
eprintln!("SKIP: no pinned LOK build");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
let cx = TestAppContext::single();
|
let mut cx = TestAppContext::single();
|
||||||
let (view, worker) = cx.update(|app| live_view(app, &install));
|
cx.update(|app| {
|
||||||
let doc = cx.update(|app| view.read(app).doc.clone());
|
ely_gpui_component::init_for_tests(app);
|
||||||
let mut shades = Vec::new();
|
ely_gpui_component::theme::Theme::set_mode_now(ely_gpui_component::theme::Mode::Dark, app);
|
||||||
for dark in [true, false] {
|
});
|
||||||
cx.update(|app| view.update(app, |view, _| view.follow_theme(dark)));
|
// A dark profile, as an old Ely left.
|
||||||
assert!(
|
let dir = tempfile::tempdir().expect("a temp dir");
|
||||||
settle(&cx, |app| view.read(app).settled()),
|
let profile = dir.path().join("profile");
|
||||||
"the theme goes out"
|
std::fs::create_dir_all(profile.join("user")).expect("a profile");
|
||||||
);
|
std::fs::write(profile.join("user/registrymodifications.xcu"), DARK_PROFILE).expect("the scheme writes");
|
||||||
|
let source = dir.path().join("note.fodt");
|
||||||
|
std::fs::write(&source, crate::client::tests::FODT).expect("the fixture writes");
|
||||||
|
let mut started = crate::Worker::spawn(&install, &profile).expect("the worker");
|
||||||
|
let doc = started.load(&crate::file_url(&source)).expect("the document loads");
|
||||||
|
let laid = super::super::layout(&mut started, &doc).expect("the layout reads");
|
||||||
|
let worker = Arc::new(Mutex::new(started));
|
||||||
|
let shade = || {
|
||||||
let mut worker = worker.lock().expect("the worker");
|
let mut worker = worker.lock().expect("the worker");
|
||||||
let tile = doc
|
let tile = doc.paint_tile(&mut worker, (1440, 1440, 3840, 3840), (64, 64)).expect("a tile");
|
||||||
.paint_tile(&mut worker, (1440, 1440, 3840, 3840), (64, 64))
|
let sum: u64 = tile.pixels.chunks_exact(4).map(|px| u64::from(px[0]) + u64::from(px[1]) + u64::from(px[2])).sum();
|
||||||
.expect("a tile");
|
sum / (64 * 64 * 3)
|
||||||
let sum: u64 = tile
|
};
|
||||||
.pixels
|
worker.lock().expect("the worker").run(&doc, "view.theme", &["TEST_DARK"]).expect("the dark scheme");
|
||||||
.chunks_exact(4)
|
let dark = shade();
|
||||||
.map(|px| u64::from(px[0]) + u64::from(px[1]) + u64::from(px[2]))
|
assert!(dark < 100, "the kernel starts dark: {dark}");
|
||||||
.sum();
|
let view = cx.update(|app| LokView::open(Arc::clone(&worker), doc.clone(), laid, app));
|
||||||
shades.push(sum / (64 * 64 * 3));
|
let shown = view.clone();
|
||||||
}
|
cx.add_window(move |_, _| Host(shown));
|
||||||
assert!(
|
assert!(
|
||||||
shades[0] < 100 && shades[1] > 200,
|
settle(&cx, |app| view.read(app).lit() && view.read(app).settled()),
|
||||||
"dark then light: {shades:?}"
|
"the scheme goes out"
|
||||||
);
|
);
|
||||||
|
assert_eq!(paper(), gpui::white(), "the page mask is the scheme's white");
|
||||||
|
let light = shade();
|
||||||
|
assert!(light > 240, "the view paints the page white: {light}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ static fz_matrix placed(fz_rect box, float scale, int rotate)
|
|||||||
|
|
||||||
/* Paints device pixels x, y, w, h as BGRA. */
|
/* Paints device pixels x, y, w, h as BGRA. */
|
||||||
int ely_render(fz_context *ctx, fz_document *doc, int number, float scale, int rotate,
|
int ely_render(fz_context *ctx, fz_document *doc, int number, float scale, int rotate,
|
||||||
const int tile[4], int dark, unsigned char *bgra)
|
const int tile[4], unsigned char *bgra)
|
||||||
{
|
{
|
||||||
fz_page *page = NULL;
|
fz_page *page = NULL;
|
||||||
fz_pixmap *pix = NULL;
|
fz_pixmap *pix = NULL;
|
||||||
@@ -242,8 +242,6 @@ int ely_render(fz_context *ctx, fz_document *doc, int number, float scale, int r
|
|||||||
dev = fz_new_draw_device(ctx, fz_identity, pix);
|
dev = fz_new_draw_device(ctx, fz_identity, pix);
|
||||||
fz_run_page(ctx, page, dev, ctm, NULL);
|
fz_run_page(ctx, page, dev, ctm, NULL);
|
||||||
fz_close_device(ctx, dev);
|
fz_close_device(ctx, dev);
|
||||||
if (dark)
|
|
||||||
fz_invert_pixmap_luminance(ctx, pix);
|
|
||||||
int stride = (int)fz_pixmap_stride(ctx, pix);
|
int stride = (int)fz_pixmap_stride(ctx, pix);
|
||||||
unsigned char *rows = fz_pixmap_samples(ctx, pix);
|
unsigned char *rows = fz_pixmap_samples(ctx, pix);
|
||||||
for (int y = 0; y < tile[3]; y++)
|
for (int y = 0; y < tile[3]; y++)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
int ely_fail(fz_context *ctx);
|
int ely_fail(fz_context *ctx);
|
||||||
const char *ely_error(void);
|
const char *ely_error(void);
|
||||||
int ely_render(fz_context *ctx, fz_document *doc, int number, float scale, int rotate, const int tile[4], int dark,
|
int ely_render(fz_context *ctx, fz_document *doc, int number, float scale, int rotate, const int tile[4],
|
||||||
unsigned char *bgra);
|
unsigned char *bgra);
|
||||||
void ely_fail_also(fz_context *ctx, const char *what);
|
void ely_fail_also(fz_context *ctx, const char *what);
|
||||||
pdf_document *ely_pdf_of(fz_context *ctx, fz_document *doc);
|
pdf_document *ely_pdf_of(fz_context *ctx, fz_document *doc);
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ static void preview(fz_context *ctx, pdf_document *pdf, int number, int block, c
|
|||||||
tile[0] = (int)floorf(region.x0 * scale), tile[1] = (int)floorf(region.y0 * scale);
|
tile[0] = (int)floorf(region.x0 * scale), tile[1] = (int)floorf(region.y0 * scale);
|
||||||
tile[2] = (int)ceilf(region.x1 * scale) - tile[0], tile[3] = (int)ceilf(region.y1 * scale) - tile[1];
|
tile[2] = (int)ceilf(region.x1 * scale) - tile[0], tile[3] = (int)ceilf(region.y1 * scale) - tile[1];
|
||||||
*pixels = fz_malloc(ctx, (size_t)tile[2] * tile[3] * 4);
|
*pixels = fz_malloc(ctx, (size_t)tile[2] * tile[3] * 4);
|
||||||
if (ely_render(ctx, copy, number, scale, 0, tile, 0, *pixels) < 0)
|
if (ely_render(ctx, copy, number, scale, 0, tile, *pixels) < 0)
|
||||||
fz_throw(ctx, FZ_ERROR_GENERIC, "%s", ely_error());
|
fz_throw(ctx, FZ_ERROR_GENERIC, "%s", ely_error());
|
||||||
*w = tile[2], *h = tile[3];
|
*w = tile[2], *h = tile[3];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ unsafe extern "C" {
|
|||||||
scale: f32,
|
scale: f32,
|
||||||
rotate: c_int,
|
rotate: c_int,
|
||||||
tile: *const c_int,
|
tile: *const c_int,
|
||||||
dark: c_int,
|
|
||||||
bgra: *mut u8,
|
bgra: *mut u8,
|
||||||
) -> c_int;
|
) -> c_int;
|
||||||
fn ely_text(
|
fn ely_text(
|
||||||
@@ -143,7 +142,6 @@ impl Mupdf {
|
|||||||
number: usize,
|
number: usize,
|
||||||
(scale, rotate): (f32, i32),
|
(scale, rotate): (f32, i32),
|
||||||
tile: [i32; 4],
|
tile: [i32; 4],
|
||||||
dark: bool,
|
|
||||||
) -> io::Result<Vec<u8>> {
|
) -> io::Result<Vec<u8>> {
|
||||||
let (w, h) = (usize::try_from(tile[2]), usize::try_from(tile[3]));
|
let (w, h) = (usize::try_from(tile[2]), usize::try_from(tile[3]));
|
||||||
let (Ok(w), Ok(h)) = (w, h) else {
|
let (Ok(w), Ok(h)) = (w, h) else {
|
||||||
@@ -158,7 +156,6 @@ impl Mupdf {
|
|||||||
scale,
|
scale,
|
||||||
rotate,
|
rotate,
|
||||||
tile.as_ptr(),
|
tile.as_ptr(),
|
||||||
c_int::from(dark),
|
|
||||||
pixels.as_mut_ptr(),
|
pixels.as_mut_ptr(),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -403,8 +403,7 @@ impl Worker {
|
|||||||
for value in &mut tile {
|
for value in &mut tile {
|
||||||
*value = i32::try_from(ask.i64()?).map_err(io::Error::other)?;
|
*value = i32::try_from(ask.i64()?).map_err(io::Error::other)?;
|
||||||
}
|
}
|
||||||
let dark = ask.u64()? != 0;
|
self.drawn(id, page, (scale, rotate), tile)
|
||||||
self.drawn(id, page, (scale, rotate), tile, dark)
|
|
||||||
}
|
}
|
||||||
tag::TEXT => {
|
tag::TEXT => {
|
||||||
let (id, page) = (ask.u64()?, ask.u64()? as usize);
|
let (id, page) = (ask.u64()?, ask.u64()? as usize);
|
||||||
|
|||||||
@@ -101,9 +101,9 @@ impl crate::Worker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A tile, and whether drawing it met damage.
|
/// A tile, and whether drawing it met damage.
|
||||||
pub(crate) fn drawn(&mut self, id: u64, page: usize, view: (f32, i32), tile: [i32; 4], dark: bool) -> io::Result<Vec<u8>> {
|
pub(crate) fn drawn(&mut self, id: u64, page: usize, view: (f32, i32), tile: [i32; 4]) -> io::Result<Vec<u8>> {
|
||||||
unsafe { ely_watch_begin(self.mupdf.ctx) };
|
unsafe { ely_watch_begin(self.mupdf.ctx) };
|
||||||
let pixels = self.mupdf.render(self.doc(id)?, page, view, tile, dark);
|
let pixels = self.mupdf.render(self.doc(id)?, page, view, tile);
|
||||||
let warned = unsafe { ely_watch_end(self.mupdf.ctx) } != 0;
|
let warned = unsafe { ely_watch_end(self.mupdf.ctx) } != 0;
|
||||||
if warned {
|
if warned {
|
||||||
self.note_damage(id)?;
|
self.note_damage(id)?;
|
||||||
|
|||||||
@@ -242,7 +242,6 @@ impl Worker {
|
|||||||
page: usize,
|
page: usize,
|
||||||
(scale, rotate): (f32, i32),
|
(scale, rotate): (f32, i32),
|
||||||
tile: [i32; 4],
|
tile: [i32; 4],
|
||||||
dark: bool,
|
|
||||||
) -> io::Result<Tile> {
|
) -> io::Result<Tile> {
|
||||||
let mut ask = self.on(&doc)?
|
let mut ask = self.on(&doc)?
|
||||||
.u64(page as u64)
|
.u64(page as u64)
|
||||||
@@ -251,7 +250,7 @@ impl Worker {
|
|||||||
for value in tile {
|
for value in tile {
|
||||||
ask = ask.i64(i64::from(value));
|
ask = ask.i64(i64::from(value));
|
||||||
}
|
}
|
||||||
let reply = self.request(tag::RENDER, &ask.u64(u64::from(dark)).bytes())?;
|
let reply = self.request(tag::RENDER, &ask.bytes())?;
|
||||||
let mut reply = Unpack::new(&reply);
|
let mut reply = Unpack::new(&reply);
|
||||||
let (damaged, bgra) = (reply.u64()? != 0, reply.blob()?);
|
let (damaged, bgra) = (reply.u64()? != 0, reply.blob()?);
|
||||||
match bgra.len() == tile[2] as usize * tile[3] as usize * 4 {
|
match bgra.len() == tile[2] as usize * tile[3] as usize * 4 {
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ fn long_clashing_field_names_still_get_a_number() {
|
|||||||
|
|
||||||
/// Red pixels of a page at one pixel a point.
|
/// Red pixels of a page at one pixel a point.
|
||||||
fn red(worker: &mut Worker, doc: Doc, page: usize) -> usize {
|
fn red(worker: &mut Worker, doc: Doc, page: usize) -> usize {
|
||||||
let pixels = worker.render(doc, page, (1.0, 0), [0, 0, 612, 792], false).expect("renders").bgra;
|
let pixels = worker.render(doc, page, (1.0, 0), [0, 0, 612, 792]).expect("renders").bgra;
|
||||||
pixels.chunks_exact(4).filter(|p| p[2] > 180 && p[1] < 80 && p[0] < 80).count()
|
pixels.chunks_exact(4).filter(|p| p[2] > 180 && p[1] < 80 && p[0] < 80).count()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ fn note(page: usize, shape: Shape) -> NewAnnot {
|
|||||||
|
|
||||||
/// Whether page one's pixels `at` hold colour `bgra`.
|
/// Whether page one's pixels `at` hold colour `bgra`.
|
||||||
fn has_color(worker: &mut Worker, doc: Doc, at: [i32; 4], bgra: [u8; 3]) -> bool {
|
fn has_color(worker: &mut Worker, doc: Doc, at: [i32; 4], bgra: [u8; 3]) -> bool {
|
||||||
let pixels = worker.render(doc, 0, (1.0, 0), at, false).expect("draws").bgra;
|
let pixels = worker.render(doc, 0, (1.0, 0), at).expect("draws").bgra;
|
||||||
pixels.chunks_exact(4).any(|p| p[..3].iter().zip(bgra).all(|(a, b)| a.abs_diff(b) < 40))
|
pixels.chunks_exact(4).any(|p| p[..3].iter().zip(bgra).all(|(a, b)| a.abs_diff(b) < 40))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const SCALE: f32 = 200.0 / 72.0;
|
|||||||
/// Page one of `doc`, saved as a gray scan.
|
/// Page one of `doc`, saved as a gray scan.
|
||||||
fn scan_of(worker: &mut Worker, doc: Doc, out: PathBuf) -> PathBuf {
|
fn scan_of(worker: &mut Worker, doc: Doc, out: PathBuf) -> PathBuf {
|
||||||
let (w, h) = ((612.0 * SCALE).ceil() as i32, (792.0 * SCALE).ceil() as i32);
|
let (w, h) = ((612.0 * SCALE).ceil() as i32, (792.0 * SCALE).ceil() as i32);
|
||||||
let bgra = worker.render(doc, 0, (SCALE, 0), [0, 0, w, h], false).expect("draws").bgra;
|
let bgra = worker.render(doc, 0, (SCALE, 0), [0, 0, w, h]).expect("draws").bgra;
|
||||||
let gray: Vec<u8> = bgra.chunks_exact(4).map(|p| ((u16::from(p[0]) + u16::from(p[1]) + u16::from(p[2])) / 3) as u8).collect();
|
let gray: Vec<u8> = bgra.chunks_exact(4).map(|p| ((u16::from(p[0]) + u16::from(p[1]) + u16::from(p[2])) / 3) as u8).collect();
|
||||||
std::fs::write(&out, scan((612.0, 792.0), (w as u32, h as u32), &gray)).expect("writes");
|
std::fs::write(&out, scan((612.0, 792.0), (w as u32, h as u32), &gray)).expect("writes");
|
||||||
out
|
out
|
||||||
@@ -49,12 +49,12 @@ fn a_scan_reads_and_its_text_layer_finds_without_drawing() {
|
|||||||
assert!(read.iter().any(|l| l.contains("Hello world")) && read.iter().any(|l| l.contains("Second line")), "{read:?}");
|
assert!(read.iter().any(|l| l.contains("Hello world")) && read.iter().any(|l| l.contains("Second line")), "{read:?}");
|
||||||
let hello = lines.iter().find(|l| l.text.contains("Hello")).expect("hello");
|
let hello = lines.iter().find(|l| l.text.contains("Hello")).expect("hello");
|
||||||
assert!((hello.rect[0] - 72.0).abs() < 6.0 && (hello.rect[3] - 76.0).abs() < 8.0, "in page points: {:?}", hello.rect);
|
assert!((hello.rect[0] - 72.0).abs() < 6.0 && (hello.rect[3] - 76.0).abs() < 8.0, "in page points: {:?}", hello.rect);
|
||||||
let before = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws").bgra;
|
let before = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws").bgra;
|
||||||
let mark = worker.text_layer(doc, &[(0, lines)], false).expect("lays");
|
let mark = worker.text_layer(doc, &[(0, lines)], false).expect("lays");
|
||||||
doc = worker.now(doc).expect("the state");
|
doc = worker.now(doc).expect("the state");
|
||||||
assert!(words(&mut worker, doc).contains("Hello world"), "searchable now");
|
assert!(words(&mut worker, doc).contains("Hello world"), "searchable now");
|
||||||
assert_eq!(worker.search(doc, 0, "second line").expect("finds").len(), 1);
|
assert_eq!(worker.search(doc, 0, "second line").expect("finds").len(), 1);
|
||||||
assert!(worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws").bgra == before, "nothing drawn");
|
assert!(worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws").bgra == before, "nothing drawn");
|
||||||
worker.undo(doc, false).expect("undoes");
|
worker.undo(doc, false).expect("undoes");
|
||||||
doc = worker.now(doc).expect("the state");
|
doc = worker.now(doc).expect("the state");
|
||||||
assert_eq!(words(&mut worker, doc), "", "one step");
|
assert_eq!(words(&mut worker, doc), "", "one step");
|
||||||
@@ -144,9 +144,9 @@ fn text_added_after_a_layer_still_shows() {
|
|||||||
let line = OcrLine { rect: [72.0, 60.0, 200.0, 78.0], text: "Hello world".into() };
|
let line = OcrLine { rect: [72.0, 60.0, 200.0, 78.0], text: "Hello world".into() };
|
||||||
worker.text_layer(doc, &[(0, vec![line])], false).expect("lays");
|
worker.text_layer(doc, &[(0, vec![line])], false).expect("lays");
|
||||||
doc = worker.now(doc).expect("the state");
|
doc = worker.now(doc).expect("the state");
|
||||||
let before = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws").bgra;
|
let before = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws").bgra;
|
||||||
let writing = Writing { block: None, expected: String::new(), text: "VISIBLE".into(), font: "helvetica".into(), size: 24.0, rgb: 0, bx: [72.0, 600.0, 300.0] };
|
let writing = Writing { block: None, expected: String::new(), text: "VISIBLE".into(), font: "helvetica".into(), size: 24.0, rgb: 0, bx: [72.0, 600.0, 300.0] };
|
||||||
assert!(matches!(worker.put_text(doc, 0, &writing, 0.0).expect("writes"), Wrote::Done(_)));
|
assert!(matches!(worker.put_text(doc, 0, &writing, 0.0).expect("writes"), Wrote::Done(_)));
|
||||||
doc = worker.now(doc).expect("the state");
|
doc = worker.now(doc).expect("the state");
|
||||||
assert!(worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws").bgra != before, "the new text is drawn");
|
assert!(worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws").bgra != before, "the new text is drawn");
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ fn a_print_copy_shows_what_prints_to_any_screen_renderer() {
|
|||||||
// MuPDF draws by screen rules, as Windows' renderer does.
|
// MuPDF draws by screen rules, as Windows' renderer does.
|
||||||
let mut third = self::worker();
|
let mut third = self::worker();
|
||||||
let printed = third.open(&print).expect("opens").doc;
|
let printed = third.open(&print).expect("opens").doc;
|
||||||
let bgra = third.render(printed, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws").bgra;
|
let bgra = third.render(printed, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws").bgra;
|
||||||
let at = |x: usize, y: usize| -> [u8; 3] {
|
let at = |x: usize, y: usize| -> [u8; 3] {
|
||||||
let p = &bgra[((792 - y) * 612 + x) * 4..][..3];
|
let p = &bgra[((792 - y) * 612 + x) * 4..][..3];
|
||||||
[p[2], p[1], p[0]]
|
[p[2], p[1], p[0]]
|
||||||
@@ -219,7 +219,7 @@ fn a_broken_picture_shows_when_drawn_or_checked() {
|
|||||||
std::fs::write(&path, &bytes).expect("writes");
|
std::fs::write(&path, &bytes).expect("writes");
|
||||||
let (mut worker, doc) = opened(&path);
|
let (mut worker, doc) = opened(&path);
|
||||||
assert_eq!(worker.repair_report(doc).expect("asks"), None, "pictures wait to be drawn");
|
assert_eq!(worker.repair_report(doc).expect("asks"), None, "pictures wait to be drawn");
|
||||||
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws");
|
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws");
|
||||||
assert!(tile.damaged, "drawing finds it");
|
assert!(tile.damaged, "drawing finds it");
|
||||||
assert!(worker.repair_report(doc).expect("asks").is_some());
|
assert!(worker.repair_report(doc).expect("asks").is_some());
|
||||||
let (mut other, again) = opened(&path);
|
let (mut other, again) = opened(&path);
|
||||||
@@ -249,7 +249,7 @@ fn an_unembedded_font_is_no_damage() {
|
|||||||
let (mut worker, doc) = opened(&path);
|
let (mut worker, doc) = opened(&path);
|
||||||
// Read unwatched first: its repeat is pending.
|
// Read unwatched first: its repeat is pending.
|
||||||
worker.text(doc, 0).expect("reads");
|
worker.text(doc, 0).expect("reads");
|
||||||
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws");
|
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws");
|
||||||
assert!(!tile.damaged, "a substituted font draws whole");
|
assert!(!tile.damaged, "a substituted font draws whole");
|
||||||
assert_eq!(worker.repair_report(doc).expect("asks"), None);
|
assert_eq!(worker.repair_report(doc).expect("asks"), None);
|
||||||
}
|
}
|
||||||
@@ -262,7 +262,7 @@ fn unreadable_content_still_draws_as_damage() {
|
|||||||
let path = dir.path().join("doc.pdf");
|
let path = dir.path().join("doc.pdf");
|
||||||
std::fs::write(&path, one_page("", "", content, &[])).expect("writes");
|
std::fs::write(&path, one_page("", "", content, &[])).expect("writes");
|
||||||
let (mut worker, doc) = opened(&path);
|
let (mut worker, doc) = opened(&path);
|
||||||
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws");
|
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws");
|
||||||
assert!(tile.damaged, "{content} draws as damage");
|
assert!(tile.damaged, "{content} draws as damage");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -327,7 +327,7 @@ fn a_broken_picture_under_two_filters_fails_exports() {
|
|||||||
let (mut worker, doc) = opened(&path);
|
let (mut worker, doc) = opened(&path);
|
||||||
assert!(worker.export_image(doc, 0, 72.0, &dir.path().join("page.png")).is_err(), "its page read whole");
|
assert!(worker.export_image(doc, 0, 72.0, &dir.path().join("page.png")).is_err(), "its page read whole");
|
||||||
let (mut worker, doc) = opened(&path);
|
let (mut worker, doc) = opened(&path);
|
||||||
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws");
|
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws");
|
||||||
assert!(tile.damaged, "the picture draws as damage");
|
assert!(tile.damaged, "the picture draws as damage");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ fn a_broken_picture_read_before_is_still_damage() {
|
|||||||
for (path, first) in files.iter().flat_map(|p| read.map(|r| (p, r))) {
|
for (path, first) in files.iter().flat_map(|p| read.map(|r| (p, r))) {
|
||||||
let (mut worker, doc) = opened(path);
|
let (mut worker, doc) = opened(path);
|
||||||
first(&mut worker, doc);
|
first(&mut worker, doc);
|
||||||
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792], false).expect("draws");
|
let tile = worker.render(doc, 0, (1.0, 0), [0, 0, 612, 792]).expect("draws");
|
||||||
assert!(tile.damaged, "the picture draws as damage");
|
assert!(tile.damaged, "the picture draws as damage");
|
||||||
assert!(worker.repair_report(doc).expect("asks").is_some());
|
assert!(worker.repair_report(doc).expect("asks").is_some());
|
||||||
let (mut worker, doc) = opened(path);
|
let (mut worker, doc) = opened(path);
|
||||||
|
|||||||
@@ -67,9 +67,9 @@ fn a_picture_under_a_region_loses_those_pixels() {
|
|||||||
let out = dir.path().join("out.pdf");
|
let out = dir.path().join("out.pdf");
|
||||||
worker.redact(doc, &[Region { page: 0, rect: [72.0, 242.0, 122.0, 292.0] }], &out).expect("removes");
|
worker.redact(doc, &[Region { page: 0, rect: [72.0, 242.0, 122.0, 292.0] }], &out).expect("removes");
|
||||||
let (mut other, written) = reopen(&out);
|
let (mut other, written) = reopen(&out);
|
||||||
let left = other.render(written, 0, (1.0, 0), [124, 244, 46, 46], false).expect("draws").bgra;
|
let left = other.render(written, 0, (1.0, 0), [124, 244, 46, 46]).expect("draws").bgra;
|
||||||
assert!(left.chunks_exact(4).any(|p| p[0] > 100 || p[1] > 100 || p[2] > 100), "the right half keeps its colour");
|
assert!(left.chunks_exact(4).any(|p| p[0] > 100 || p[1] > 100 || p[2] > 100), "the right half keeps its colour");
|
||||||
let gone = other.render(written, 0, (1.0, 0), [74, 244, 46, 46], false).expect("draws").bgra;
|
let gone = other.render(written, 0, (1.0, 0), [74, 244, 46, 46]).expect("draws").bgra;
|
||||||
assert!(gone.chunks_exact(4).all(|p| p[0] < 40 && p[1] < 40 && p[2] < 40), "the left half is black");
|
assert!(gone.chunks_exact(4).all(|p| p[0] < 40 && p[1] < 40 && p[2] < 40), "the left half is black");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ fn a_shape_touching_a_region_goes_whole() {
|
|||||||
let report = worker.redact(doc, &[Region { page: 0, rect: [90.0, 45.0, 180.0, 100.0] }], &out).expect("removes");
|
let report = worker.redact(doc, &[Region { page: 0, rect: [90.0, 45.0, 180.0, 100.0] }], &out).expect("removes");
|
||||||
assert_eq!(report.objects, 0);
|
assert_eq!(report.objects, 0);
|
||||||
let (mut other, read) = reopen(&out);
|
let (mut other, read) = reopen(&out);
|
||||||
let right = other.render(read, 0, (1.0, 0), [200, 55, 90, 30], false).expect("draws").bgra;
|
let right = other.render(read, 0, (1.0, 0), [200, 55, 90, 30]).expect("draws").bgra;
|
||||||
assert!(right.chunks_exact(4).all(|p| p[2] < 200 || p[1] > 200), "no red left past the box");
|
assert!(right.chunks_exact(4).all(|p| p[2] < 200 || p[1] > 200), "no red left past the box");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,23 +36,15 @@ fn pages_measure_render_and_read_their_text() {
|
|||||||
);
|
);
|
||||||
// Page one's top left, twice its size: text is dark.
|
// Page one's top left, twice its size: text is dark.
|
||||||
let tile = worker
|
let tile = worker
|
||||||
.render(doc, 0, (2.0, 0), [0, 0, 600, 300], false)
|
.render(doc, 0, (2.0, 0), [0, 0, 600, 300])
|
||||||
.expect("renders").bgra;
|
.expect("renders").bgra;
|
||||||
assert_eq!(tile.len(), 600 * 300 * 4);
|
assert_eq!(tile.len(), 600 * 300 * 4);
|
||||||
let dark = tile.chunks_exact(4).filter(|p| p[0] < 128).count();
|
let dark = tile.chunks_exact(4).filter(|p| p[0] < 128).count();
|
||||||
assert!(dark > 100, "text shows: {dark}");
|
assert!(dark > 100, "text shows: {dark}");
|
||||||
let night = worker
|
|
||||||
.render(doc, 0, (2.0, 0), [0, 0, 600, 300], true)
|
|
||||||
.expect("renders dark").bgra;
|
|
||||||
let light = night.chunks_exact(4).filter(|p| p[0] > 128).count();
|
|
||||||
assert!(
|
|
||||||
light > 100 && night[0] < 64,
|
|
||||||
"dark mode turns paper dark and text light"
|
|
||||||
);
|
|
||||||
// A quarter turn makes the page tall side wide.
|
// A quarter turn makes the page tall side wide.
|
||||||
assert!(
|
assert!(
|
||||||
worker
|
worker
|
||||||
.render(doc, 1, (1.0, 90), [0, 0, 595, 842], false)
|
.render(doc, 1, (1.0, 90), [0, 0, 595, 842])
|
||||||
.is_ok()
|
.is_ok()
|
||||||
);
|
);
|
||||||
let text: String = worker
|
let text: String = worker
|
||||||
@@ -135,7 +127,7 @@ fn a_thousand_pages_show_the_first_in_time() {
|
|||||||
assert_eq!(worker.pages(doc).expect("counts"), 1000);
|
assert_eq!(worker.pages(doc).expect("counts"), 1000);
|
||||||
// What the viewer asks before its first frame.
|
// What the viewer asks before its first frame.
|
||||||
worker.bounds(doc, 0, 100).expect("the first sizes");
|
worker.bounds(doc, 0, 100).expect("the first sizes");
|
||||||
worker.render(doc, 0, (2.0, 0), [0, 0, 512, 512], false).expect("the first tile");
|
worker.render(doc, 0, (2.0, 0), [0, 0, 512, 512]).expect("the first tile");
|
||||||
let took = started.elapsed();
|
let took = started.elapsed();
|
||||||
assert!(took < std::time::Duration::from_secs(3), "PERF-05: {took:?}");
|
assert!(took < std::time::Duration::from_secs(3), "PERF-05: {took:?}");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
随发行说明发布,每个版本一份。支持某格式不等于支持它的全部功能;下表只写已验证的内容、已知限制与保存行为。
|
随发行说明发布,每个版本一份。支持某格式不等于支持它的全部功能;下表只写已验证的内容、已知限制与保存行为。
|
||||||
|
|
||||||
版本:Ely Office 0.1.7(首版六个应用:ElyDoc、ElyTable、ElyShow、ElyPDF、ElyTree、ElyMark)。日期 2026-10-17。
|
版本:Ely Office 0.1.8(首版六个应用:ElyDoc、ElyTable、ElyShow、ElyPDF、ElyTree、ElyMark)。日期 2026-10-19。
|
||||||
内核:LibreOffice 26.2.6.3(8221e31,加 `patches/libreoffice` 0001–0048);MuPDF 1.28.5(8ad45e9,加 `patches/mupdf` 0001–0005);Git 2.56.0(a018953)与 git-lfs 3.8.0。
|
内核:LibreOffice 26.2.6.3(8221e31,加 `patches/libreoffice` 0001–0051);MuPDF 1.28.5(8ad45e9,加 `patches/mupdf` 0001–0005);Git 2.56.0(a018953)与 git-lfs 3.8.0。
|
||||||
验证机:macOS 27.0 arm64。Windows 与 Linux 未验证。本机没有 Microsoft Office:与 Office 的交叉检查未做(待做)。
|
验证机:macOS 27.0 arm64。Windows 与 Linux 未验证。本机没有 Microsoft Office:与 Office 的交叉检查未做(待做)。
|
||||||
|
|
||||||
## 往返验证
|
## 往返验证
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
| 导入或受限 | DOC、RTF 按原格式保存;含宏的文件(docm、dotm、带 Basic 的 ODF/OLE)进风险模式,只能另存副本,宏不运行 |
|
| 导入或受限 | DOC、RTF 按原格式保存;含宏的文件(docm、dotm、带 Basic 的 ODF/OLE)进风险模式,只能另存副本,宏不运行 |
|
||||||
| 输出 | PDF(页码范围、批注、修订标记)、打印 |
|
| 输出 | PDF(页码范围、批注、修订标记)、打印 |
|
||||||
|
|
||||||
已验证:文字与段落格式、样式、页面与分节、页眉页脚、表格、图片锚点与环绕、目录、脚注尾注、书签、交叉引用、题注、公式、批注与回复、修订、查找替换、拼写(英文)、比较、邮件合并。限制:交叉引用只指向书签;公式导出 DOCX 后在 Word 中是否可编辑未验证。
|
已验证:文字与段落格式、样式、页面与分节、页眉页脚、表格、图片锚点与环绕、目录、脚注尾注、书签、交叉引用、题注、公式(含 Word 的 EQ 域,转为公式对象)、批注与回复、修订、查找替换、拼写(英文)、比较、邮件合并。限制:交叉引用只指向书签;公式导出 DOCX 后在 Word 中是否可编辑未验证。
|
||||||
|
|
||||||
## ElyTable
|
## ElyTable
|
||||||
|
|
||||||
@@ -70,7 +70,8 @@
|
|||||||
| --- | --- |
|
| --- | --- |
|
||||||
| 编辑与保存 | MD、Markdown(UTF-8,带不带 BOM;保留换行风格;文本即原文,只写回所改的字) |
|
| 编辑与保存 | MD、Markdown(UTF-8,带不带 BOM;保留换行风格;文本即原文,只写回所改的字) |
|
||||||
| 导入或受限 | UTF-16 与非 UTF-8 拒绝打开并指出字节位置;markdown-rs 不认的语法照原文显示;超过 2 MiB 只以源码打开 |
|
| 导入或受限 | UTF-16 与非 UTF-8 拒绝打开并指出字节位置;markdown-rs 不认的语法照原文显示;超过 2 MiB 只以源码打开 |
|
||||||
| 输出 | 原生重做中(C14.14),此版没有 |
|
| 公式 | `$…$`、`$$…$$` 与 `\(…\)`、`\[…\]`,经 RaTeX 排版(行内与块) |
|
||||||
|
| 输出 | HTML(自包含或带资源文件夹)、PDF、纯文本、富文本复制、打印 |
|
||||||
|
|
||||||
## 第二批
|
## 第二批
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## 自有代码
|
## 自有代码
|
||||||
|
|
||||||
Ely Office 的自有代码以 AGPL-3.0-or-later 发布,全文在仓库根的 `LICENSE`,并随每个应用包放在 `Resources/Licenses/LICENSE`。组件库 Ely-GPUI-Components 保留其 MIT/Apache-2.0。
|
Ely Office 的自有代码以 MIT 发布,全文在仓库根的 `LICENSE`,并随每个应用包放在 `Resources/Licenses/LICENSE`。随包的引擎不随之改许可:ElyPDF 链接的 MuPDF 是 AGPL-3.0,ElyPDF 的发行包整体须按 AGPL 履行(对应源码见上游源码包);ElyDoc、ElyTable、ElyShow 的 LibreOffice 仍为 MPL-2.0 等;ElyTree 带的 Git 仍为 GPL-2.0。组件库 Ely-GPUI-Components 保留其 MIT/Apache-2.0。
|
||||||
|
|
||||||
## 每个发行版附带
|
## 每个发行版附带
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ Ely Office 的自有代码以 AGPL-3.0-or-later 发布,全文在仓库根的 `
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `ElyOffice-<版本>-source.tar.gz` | 自有源码、`Cargo.lock`、`rust-toolchain.toml`、上游补丁(`patches/libreoffice`、`patches/mupdf`)、构建与取上游的脚本(各上游钉在提交,脚本里写明地址与散列)、测试、文档 | `packaging/macos/release.sh` |
|
| `ElyOffice-<版本>-source.tar.gz` | 自有源码、`Cargo.lock`、`rust-toolchain.toml`、上游补丁(`patches/libreoffice`、`patches/mupdf`)、构建与取上游的脚本(各上游钉在提交,脚本里写明地址与散列)、测试、文档 | `packaging/macos/release.sh` |
|
||||||
| `ElyOffice-<版本>-upstream-source.tar.gz` | 实际编译的 MuPDF 源码(钉住的提交加我们的补丁,AGPL)与随包 Git 的源码(v2.56.0,GPLv2) | 同上;`tests/scripts/release-macos.sh` 核对其中是打过补丁的 MuPDF |
|
| `ElyOffice-<版本>-upstream-source.tar.gz` | 实际编译的 MuPDF 源码(钉住的提交加我们的补丁,AGPL)与随包 Git 的源码(v2.56.0,GPLv2) | 同上;`tests/scripts/release-macos.sh` 核对其中是打过补丁的 MuPDF |
|
||||||
| 各应用包 `Resources/Licenses/` | Ely 的 AGPL 全文;`rust-crates.txt`(链进该应用各二进制的全部 crate 与其许可文件,无许可文件的取标准文本并写明作者);所带引擎的许可与通知(见下) | `packaging/licenses.sh`,缺任何一份即打包失败 |
|
| 各应用包 `Resources/Licenses/` | Ely 的 MIT 全文;`rust-crates.txt`(链进该应用各二进制的全部 crate 与其许可文件,无许可文件的取标准文本并写明作者);所带引擎的许可与通知(见下) | `packaging/licenses.sh`,缺任何一份即打包失败 |
|
||||||
|
|
||||||
## 第三方,按应用
|
## 第三方,按应用
|
||||||
|
|
||||||
|
|||||||
@@ -36,25 +36,6 @@
|
|||||||
<oor:component-data oor:package="org.openoffice.Office" oor:name="UI">
|
<oor:component-data oor:package="org.openoffice.Office" oor:name="UI">
|
||||||
<node oor:name="ColorScheme">
|
<node oor:name="ColorScheme">
|
||||||
<node oor:name="ColorSchemes">
|
<node oor:name="ColorSchemes">
|
||||||
<node oor:name="COLOR_SCHEME_ELY_DARK" oor:op="replace">
|
|
||||||
<node oor:name="DocColor"><prop oor:name="Color"><value>2894892</value></prop></node>
|
|
||||||
<node oor:name="AppBackground"><prop oor:name="Color"><value>2434341</value></prop></node>
|
|
||||||
<node oor:name="FontColor"><prop oor:name="Color"><value>15987184</value></prop></node>
|
|
||||||
<node oor:name="DocBoundaries"><prop oor:name="Color"><value>5592405</value></prop></node>
|
|
||||||
<node oor:name="TableBoundaries"><prop oor:name="Color"><value>5592405</value></prop></node>
|
|
||||||
<node oor:name="CalcGrid"><prop oor:name="Color"><value>5592405</value></prop></node>
|
|
||||||
<node oor:name="Links"><prop oor:name="Color"><value>8303091</value></prop></node>
|
|
||||||
<node oor:name="LinksVisited"><prop oor:name="Color"><value>12297192</value></prop></node>
|
|
||||||
<node oor:name="Shadow"><prop oor:name="Color"><value>0</value></prop></node>
|
|
||||||
<node oor:name="WriterFieldShadings"><prop oor:name="Color"><value>4144959</value></prop></node>
|
|
||||||
<node oor:name="WriterIdxShadings"><prop oor:name="Color"><value>4144959</value></prop></node>
|
|
||||||
<node oor:name="CalcNotesBackground"><prop oor:name="Color"><value>16777152</value></prop></node>
|
|
||||||
<node oor:name="CalcPageBreak"><prop oor:name="Color"><value>6052440</value></prop></node>
|
|
||||||
<node oor:name="CalcHiddenColRow"><prop oor:name="Color"><value>6052440</value></prop></node>
|
|
||||||
<node oor:name="CalcCellFocus"><prop oor:name="Color"><value>6922728</value></prop></node>
|
|
||||||
<node oor:name="WriterPageBreaks"><prop oor:name="Color"><value>6052440</value></prop></node>
|
|
||||||
<node oor:name="DrawGrid"><prop oor:name="Color"><value>5592405</value></prop></node>
|
|
||||||
</node>
|
|
||||||
<node oor:name="COLOR_SCHEME_ELY_LIGHT" oor:op="replace">
|
<node oor:name="COLOR_SCHEME_ELY_LIGHT" oor:op="replace">
|
||||||
<node oor:name="DocColor"><prop oor:name="Color"><value>16777215</value></prop></node>
|
<node oor:name="DocColor"><prop oor:name="Color"><value>16777215</value></prop></node>
|
||||||
<node oor:name="AppBackground"><prop oor:name="Color"><value>15987184</value></prop></node>
|
<node oor:name="AppBackground"><prop oor:name="Color"><value>15987184</value></prop></node>
|
||||||
|
|||||||
@@ -18,6 +18,13 @@ row=$(awk -F'\t' -v slug="$slug" '$1 == slug { print $2 "\t" $3 }' "$root/packag
|
|||||||
}
|
}
|
||||||
name=${row%%$'\t'*}
|
name=${row%%$'\t'*}
|
||||||
categories=${row##*$'\t'}
|
categories=${row##*$'\t'}
|
||||||
|
# Ely is MIT; bundled engines keep their licences.
|
||||||
|
case $slug in
|
||||||
|
ely-doc | ely-table | ely-show) license="MIT AND MPL-2.0" ;;
|
||||||
|
ely-pdf) license="MIT AND AGPL-3.0-or-later" ;;
|
||||||
|
ely-tree) license="MIT AND GPL-2.0-only" ;;
|
||||||
|
*) license=MIT ;;
|
||||||
|
esac
|
||||||
# The types it opens, from packaging/types.tsv; none drops the line.
|
# The types it opens, from packaging/types.tsv; none drops the line.
|
||||||
mimes=$(awk -F'\t' -v slug="$slug" '$1 == slug && !seen[$3]++ { printf "%s;", $3 }' "$root/packaging/types.tsv")
|
mimes=$(awk -F'\t' -v slug="$slug" '$1 == slug && !seen[$3]++ { printf "%s;", $3 }' "$root/packaging/types.tsv")
|
||||||
desktop_entry() {
|
desktop_entry() {
|
||||||
@@ -193,7 +200,7 @@ maintainer: ZacharyZhang
|
|||||||
vendor: ZacharyZhang
|
vendor: ZacharyZhang
|
||||||
description: $name, part of Ely Office
|
description: $name, part of Ely Office
|
||||||
homepage: https://git.zacharyzhang.com/ZacharyZhang-NY/ElyOffice
|
homepage: https://git.zacharyzhang.com/ZacharyZhang-NY/ElyOffice
|
||||||
license: AGPL-3.0-or-later
|
license: $license
|
||||||
contents:
|
contents:
|
||||||
- src: $appdir/usr
|
- src: $appdir/usr
|
||||||
dst: /opt/ely-office/$slug
|
dst: /opt/ely-office/$slug
|
||||||
|
|||||||
@@ -0,0 +1,199 @@
|
|||||||
|
Writer: an inline object moves with its run's w:position
|
||||||
|
|
||||||
|
Word lowers or raises an inline picture or OLE object with the
|
||||||
|
w:position of its run; MathType equations rely on it to sit on
|
||||||
|
the baseline (Gitea #9: 25 pictures and an OLE fraction stood
|
||||||
|
above their lines). The import kept w:position as a deferred
|
||||||
|
character property and applied it to text only, so an object's
|
||||||
|
run lost it.
|
||||||
|
|
||||||
|
The import now puts the position on the object's anchor
|
||||||
|
character, as a fixed escapement against that character's own
|
||||||
|
font size, and does not expand it to the text after. Layout
|
||||||
|
moves an as-character object by its anchor character's fixed
|
||||||
|
escapement (vertAlign's automatic values keep objects still,
|
||||||
|
as before). Every export already writes the anchor character's
|
||||||
|
escapement (w:position in DOCX), so the position round-trips.
|
||||||
|
The w:position arithmetic moves into one helper both use.
|
||||||
|
|
||||||
|
--- a/sw/source/core/inc/ascharanchoredobjectposition.hxx
|
||||||
|
+++ b/sw/source/core/inc/ascharanchoredobjectposition.hxx
|
||||||
|
@@ -86,6 +86,9 @@ namespace objectpositioning
|
||||||
|
// method to cast <SwAnchoredObjectPosition::GetAnchorFrame()>
|
||||||
|
const SwTextFrame& GetAnchorTextFrame() const;
|
||||||
|
|
||||||
|
+ // the anchor character's fixed raise
|
||||||
|
+ SwTwips GetRaise() const;
|
||||||
|
+
|
||||||
|
/** determine the relative position to base line for object position
|
||||||
|
|
||||||
|
@param _ObjBoundHeight
|
||||||
|
--- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
|
||||||
|
+++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
|
||||||
|
@@ -29,6 +29,11 @@
|
||||||
|
#include <editeng/ulspitem.hxx>
|
||||||
|
#include <osl/diagnose.h>
|
||||||
|
#include <fmtornt.hxx>
|
||||||
|
+#include <fmtanchr.hxx>
|
||||||
|
+#include <ndtxt.hxx>
|
||||||
|
+#include <hintids.hxx>
|
||||||
|
+#include <editeng/escapementitem.hxx>
|
||||||
|
+#include <editeng/fhgtitem.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
using namespace ::com::sun::star;
|
||||||
|
@@ -60,6 +65,23 @@ SwAsCharAnchoredObjectPosition::SwAsCharAnchoredObjectPosition(
|
||||||
|
SwAsCharAnchoredObjectPosition::~SwAsCharAnchoredObjectPosition()
|
||||||
|
{}
|
||||||
|
|
||||||
|
+/** the anchor character's fixed raise */
|
||||||
|
+SwTwips SwAsCharAnchoredObjectPosition::GetRaise() const
|
||||||
|
+{
|
||||||
|
+ const SwPosition* pAnchor = GetFrameFormat().GetAnchor().GetContentAnchor();
|
||||||
|
+ const SwTextNode* pNode = pAnchor ? pAnchor->GetNode().GetTextNode() : nullptr;
|
||||||
|
+ if (!pNode)
|
||||||
|
+ return 0;
|
||||||
|
+ SfxItemSetFixed<RES_CHRATR_ESCAPEMENT, RES_CHRATR_FONTSIZE> aSet(
|
||||||
|
+ const_cast<SwAttrPool&>(pNode->GetDoc().GetAttrPool()));
|
||||||
|
+ const sal_Int32 nIndex = pAnchor->GetContentIndex();
|
||||||
|
+ pNode->GetParaAttr(aSet, nIndex, nIndex + 1);
|
||||||
|
+ const short nEsc = aSet.Get(RES_CHRATR_ESCAPEMENT).GetEsc();
|
||||||
|
+ if (nEsc == DFLT_ESC_AUTO_SUPER || nEsc == DFLT_ESC_AUTO_SUB)
|
||||||
|
+ return 0;
|
||||||
|
+ return SwTwips(aSet.Get(RES_CHRATR_FONTSIZE).GetHeight()) * nEsc / 100;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/** method to cast <SwAnchoredObjectPosition::GetAnchorFrame()> to needed type */
|
||||||
|
const SwTextFrame& SwAsCharAnchoredObjectPosition::GetAnchorTextFrame() const
|
||||||
|
{
|
||||||
|
@@ -162,7 +184,8 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
|
||||||
|
const SwTwips nObjBoundHeight = ( mnFlags & AsCharFlags::Rotate )
|
||||||
|
? aObjBoundRect.Width()
|
||||||
|
: aObjBoundRect.Height();
|
||||||
|
- const SwTwips nRelPos = GetRelPosToBase( nObjBoundHeight, rVert );
|
||||||
|
+ // it moves with its raised character, as in Word
|
||||||
|
+ const SwTwips nRelPos = GetRelPosToBase( nObjBoundHeight, rVert ) - GetRaise();
|
||||||
|
|
||||||
|
// for initial positioning:
|
||||||
|
// adjust the proposed anchor position by difference between
|
||||||
|
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
|
||||||
|
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
|
||||||
|
@@ -3979,26 +3979,11 @@ void DomainMapper::processDeferredCharacterProperties(
|
||||||
|
{
|
||||||
|
case NS_ooxml::LN_EG_RPrBase_position:
|
||||||
|
{
|
||||||
|
- double nEscapement = 0;
|
||||||
|
- sal_Int8 nProp = 0;
|
||||||
|
- if ( nIntValue )
|
||||||
|
- {
|
||||||
|
- nProp = 100;
|
||||||
|
- double fFontSize = 0;
|
||||||
|
- m_pImpl->GetAnyProperty(PROP_CHAR_HEIGHT, rContext) >>= fFontSize;
|
||||||
|
- if ( fFontSize )
|
||||||
|
- // nIntValue is in half-points, fontsize is in points, escapement is a percentage.
|
||||||
|
- nEscapement = round( nIntValue/2.0 / fFontSize * 100 );
|
||||||
|
- else
|
||||||
|
- nEscapement = nIntValue > 0 ? DFLT_ESC_SUPER : DFLT_ESC_SUB;
|
||||||
|
- }
|
||||||
|
- if ( nEscapement > MAX_ESC_POS )
|
||||||
|
- nEscapement = MAX_ESC_POS;
|
||||||
|
- else if ( nEscapement < -MAX_ESC_POS )
|
||||||
|
- nEscapement = -MAX_ESC_POS;
|
||||||
|
-
|
||||||
|
- rContext->Insert(PROP_CHAR_ESCAPEMENT, uno::Any( sal_Int16(nEscapement) ) );
|
||||||
|
- rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, uno::Any( nProp ) );
|
||||||
|
+ double fFontSize = 0;
|
||||||
|
+ m_pImpl->GetAnyProperty(PROP_CHAR_HEIGHT, rContext) >>= fFontSize;
|
||||||
|
+ const sal_Int16 nEscapement = DomainMapper_Impl::GetPositionEscapement(nIntValue, fFontSize);
|
||||||
|
+ rContext->Insert(PROP_CHAR_ESCAPEMENT, uno::Any( nEscapement ) );
|
||||||
|
+ rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, uno::Any( sal_Int8(nIntValue ? 100 : 0) ) );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
|
||||||
|
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
|
||||||
|
@@ -345,6 +345,7 @@ public:
|
||||||
|
const css::uno::Reference<css::text::XTextRange>& GetStartRange() const { return m_xStartRange; }
|
||||||
|
|
||||||
|
void AppendCommand(std::u16string_view rPart);
|
||||||
|
+ /// Deleted command text has no look.
|
||||||
|
const OUString& GetCommand() const {return m_sCommand[m_bCommandType]; }
|
||||||
|
bool GetCommandIsEmpty(bool bType) const { return m_sCommand[bType].isEmpty(); }
|
||||||
|
void SetCommandType(bool cType) { m_bCommandType = cType; }
|
||||||
|
@@ -839,6 +840,10 @@ public:
|
||||||
|
void MergeAtContentImageRedlineWithNext(const css::uno::Reference<css::text::XTextAppend>& xTextAppend);
|
||||||
|
void appendTextPortion( const OUString& rString, const PropertyMapPtr& pPropertyMap );
|
||||||
|
void appendTextContent(const css::uno::Reference<css::text::XTextContent>&, const css::uno::Sequence<css::beans::PropertyValue>&);
|
||||||
|
+ /// w:position's half-points as an escapement percentage.
|
||||||
|
+ static sal_Int16 GetPositionEscapement(sal_Int32 nHalfPoints, double fFontSize);
|
||||||
|
+ /// Word moves an inline object with its run's w:position.
|
||||||
|
+ void moveWithRun(const css::uno::Reference<css::text::XTextContent>& xContent);
|
||||||
|
void appendOLE( const OUString& rStreamName, const std::shared_ptr<OLEHandler>& pOleHandler );
|
||||||
|
void appendStarMath( const Value& v);
|
||||||
|
void adjustLastPara(sal_Int8 nAlign);
|
||||||
|
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
|
||||||
|
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
|
||||||
|
@@ -135,6 +135,13 @@
|
||||||
|
#include <docufld.hxx>
|
||||||
|
#include <txtfld.hxx>
|
||||||
|
#include <ndtxt.hxx>
|
||||||
|
+#include <doc.hxx>
|
||||||
|
+#include <fmtanchr.hxx>
|
||||||
|
+#include <frmfmt.hxx>
|
||||||
|
+#include <IDocumentContentOperations.hxx>
|
||||||
|
+#include <editeng/escapementitem.hxx>
|
||||||
|
+#include <editeng/fhgtitem.hxx>
|
||||||
|
+#include <hintids.hxx>
|
||||||
|
#include <unicode/errorcode.h>
|
||||||
|
#include <unicode/regex.h>
|
||||||
|
#include <unotextcursor.hxx>
|
||||||
|
@@ -3652,6 +3659,7 @@ void DomainMapper_Impl::appendTextContent(
|
||||||
|
xTextAppendAndConvert->insertTextContentWithProperties( xContent, xPropertyValues, m_aTextAppendStack.top().xInsertPosition );
|
||||||
|
else
|
||||||
|
xTextAppendAndConvert->appendTextContent( xContent, xPropertyValues );
|
||||||
|
+ moveWithRun(xContent);
|
||||||
|
}
|
||||||
|
catch(const lang::IllegalArgumentException&)
|
||||||
|
{
|
||||||
|
@@ -3661,6 +3669,41 @@ void DomainMapper_Impl::appendTextContent(
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+sal_Int16 DomainMapper_Impl::GetPositionEscapement(sal_Int32 nHalfPoints, double fFontSize)
|
||||||
|
+{
|
||||||
|
+ if (!nHalfPoints)
|
||||||
|
+ return 0;
|
||||||
|
+ // half-points against the font size in points, as a percentage
|
||||||
|
+ double fEscapement = fFontSize ? round(nHalfPoints / 2.0 / fFontSize * 100)
|
||||||
|
+ : nHalfPoints > 0 ? DFLT_ESC_SUPER : DFLT_ESC_SUB;
|
||||||
|
+ return sal_Int16(std::clamp<double>(fEscapement, -MAX_ESC_POS, MAX_ESC_POS));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void DomainMapper_Impl::moveWithRun(const uno::Reference<text::XTextContent>& xContent)
|
||||||
|
+{
|
||||||
|
+ auto& rDeferred = m_StreamStateStack.top().deferredCharacterProperties;
|
||||||
|
+ auto it = rDeferred.find(NS_ooxml::LN_EG_RPrBase_position);
|
||||||
|
+ if (it == rDeferred.end())
|
||||||
|
+ return;
|
||||||
|
+ SwXFrame* pFrame = dynamic_cast<SwXFrame*>(xContent.get());
|
||||||
|
+ SwFrameFormat* pFormat = pFrame ? pFrame->GetFrameFormat() : nullptr;
|
||||||
|
+ if (!pFormat || pFormat->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR)
|
||||||
|
+ return;
|
||||||
|
+ // the anchor character carries the raise
|
||||||
|
+ SwPaM aChar(*pFormat->GetAnchor().GetContentAnchor());
|
||||||
|
+ aChar.SetMark();
|
||||||
|
+ aChar.GetPoint()->AdjustContent(1);
|
||||||
|
+ // a percentage of the anchor character's own size
|
||||||
|
+ SfxItemSetFixed<RES_CHRATR_FONTSIZE, RES_CHRATR_FONTSIZE> aSize(aChar.GetDoc().GetAttrPool());
|
||||||
|
+ aChar.GetPointNode().GetTextNode()->GetParaAttr(aSize, aChar.Start()->GetContentIndex(), aChar.End()->GetContentIndex());
|
||||||
|
+ const sal_Int16 nEsc = GetPositionEscapement(it->second.get<sal_Int32>(), aSize.Get(RES_CHRATR_FONTSIZE).GetHeight() / 20.0);
|
||||||
|
+ if (!nEsc)
|
||||||
|
+ return;
|
||||||
|
+ // the run's text after it keeps its own position
|
||||||
|
+ aChar.GetDoc().getIDocumentContentOperations().InsertPoolItem(
|
||||||
|
+ aChar, SvxEscapementItem(nEsc, 100, RES_CHRATR_ESCAPEMENT), SetAttrMode::DONTEXPAND);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void DomainMapper_Impl::appendOLE( const OUString& rStreamName, const std::shared_ptr<OLEHandler>& pOLEHandler )
|
||||||
|
{
|
||||||
|
try
|
||||||
@@ -0,0 +1,454 @@
|
|||||||
|
Writer: read Word EQ field commands as StarMath
|
||||||
|
|
||||||
|
A parser for Word EQ field commands: \f fraction, \r radical,
|
||||||
|
\s super- and subscript, \b brackets, \l list, \a array,
|
||||||
|
\i integral, sum and product; \x and \o keep their content
|
||||||
|
without the box or overlay, \d moves forward only; \ai and
|
||||||
|
\di only space lines. Switches ignore case, as Word reads them.
|
||||||
|
Each command character keeps its vertAlign; one script stays one
|
||||||
|
script across style changes. Italic letters become identifiers,
|
||||||
|
which StarMath and OMML both draw italic. The next patch uses it.
|
||||||
|
|
||||||
|
--- a/sw/Library_sw_writerfilter.mk
|
||||||
|
+++ b/sw/Library_sw_writerfilter.mk
|
||||||
|
@@ -89,6 +89,7 @@ $(eval $(call gb_Library_add_exception_objects,sw_writerfilter,\
|
||||||
|
sw/source/writerfilter/dmapper/DomainMapperTableHandler \
|
||||||
|
sw/source/writerfilter/dmapper/DomainMapperTableManager \
|
||||||
|
sw/source/writerfilter/dmapper/DomainMapper_Impl \
|
||||||
|
+ sw/source/writerfilter/dmapper/EqField \
|
||||||
|
sw/source/writerfilter/dmapper/domainmapperfactory \
|
||||||
|
sw/source/writerfilter/dmapper/FFDataHandler \
|
||||||
|
sw/source/writerfilter/dmapper/FontTable \
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/sw/source/writerfilter/dmapper/EqField.hxx
|
||||||
|
@@ -0,0 +1,30 @@
|
||||||
|
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
+/*
|
||||||
|
+ * This file is part of the LibreOffice project.
|
||||||
|
+ *
|
||||||
|
+ * This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#pragma once
|
||||||
|
+
|
||||||
|
+#include <rtl/ustring.hxx>
|
||||||
|
+
|
||||||
|
+#include <vector>
|
||||||
|
+
|
||||||
|
+namespace writerfilter::dmapper
|
||||||
|
+{
|
||||||
|
+/// How one character of a field command looks.
|
||||||
|
+struct EqLook
|
||||||
|
+{
|
||||||
|
+ bool bItalic = false;
|
||||||
|
+ /// -1 subscript, 0 baseline, 1 superscript.
|
||||||
|
+ sal_Int8 nScript = 0;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+/// A Word EQ field as StarMath; empty if unreadable.
|
||||||
|
+OUString EqToStarMath(std::u16string_view rCommand, const std::vector<EqLook>& rLooks);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/sw/source/writerfilter/dmapper/EqField.cxx
|
||||||
|
@@ -0,0 +1,397 @@
|
||||||
|
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
+/*
|
||||||
|
+ * This file is part of the LibreOffice project.
|
||||||
|
+ *
|
||||||
|
+ * This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include "EqField.hxx"
|
||||||
|
+
|
||||||
|
+#include <rtl/character.hxx>
|
||||||
|
+#include <rtl/ustrbuf.hxx>
|
||||||
|
+#include <sal/log.hxx>
|
||||||
|
+#include <unicode/uchar.h>
|
||||||
|
+
|
||||||
|
+#include <map>
|
||||||
|
+
|
||||||
|
+namespace writerfilter::dmapper
|
||||||
|
+{
|
||||||
|
+namespace
|
||||||
|
+{
|
||||||
|
+/// Word's EQ switches as StarMath.
|
||||||
|
+class EqParser
|
||||||
|
+{
|
||||||
|
+ std::u16string_view m_aCommand;
|
||||||
|
+ const std::vector<EqLook>& m_rLooks;
|
||||||
|
+ size_t m_nPos = 0;
|
||||||
|
+ bool m_bFailed = false;
|
||||||
|
+
|
||||||
|
+public:
|
||||||
|
+ EqParser(std::u16string_view aCommand, const std::vector<EqLook>& rLooks)
|
||||||
|
+ : m_aCommand(aCommand)
|
||||||
|
+ , m_rLooks(rLooks)
|
||||||
|
+ {
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ OUString parse()
|
||||||
|
+ {
|
||||||
|
+ skipSpaces();
|
||||||
|
+ if (rtl::toAsciiLowerCase(at(m_nPos)) != 'e' || rtl::toAsciiLowerCase(at(m_nPos + 1)) != 'q')
|
||||||
|
+ return OUString();
|
||||||
|
+ m_nPos += 2;
|
||||||
|
+ skipSpaces();
|
||||||
|
+ OUString aMath = element(false);
|
||||||
|
+ return m_bFailed ? OUString() : aMath;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+private:
|
||||||
|
+ sal_Unicode at(size_t nPos) const { return nPos < m_aCommand.size() ? m_aCommand[nPos] : 0; }
|
||||||
|
+
|
||||||
|
+ EqLook look(size_t nPos) const { return nPos < m_rLooks.size() ? m_rLooks[nPos] : EqLook(); }
|
||||||
|
+
|
||||||
|
+ void skipSpaces()
|
||||||
|
+ {
|
||||||
|
+ while (at(m_nPos) == ' ')
|
||||||
|
+ ++m_nPos;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ void fail(const char* pWhy)
|
||||||
|
+ {
|
||||||
|
+ SAL_WARN("writerfilter.dmapper", "EQ field: " << pWhy << " at " << m_nPos);
|
||||||
|
+ m_bFailed = true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ static OUString quoted(std::u16string_view aText)
|
||||||
|
+ {
|
||||||
|
+ OUStringBuffer aBuf("\"");
|
||||||
|
+ for (sal_Unicode c : aText)
|
||||||
|
+ {
|
||||||
|
+ if (c == '"')
|
||||||
|
+ aBuf.append('\\');
|
||||||
|
+ aBuf.append(c);
|
||||||
|
+ }
|
||||||
|
+ return aBuf.append('"').makeStringAndClear();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /// Italic letters as identifiers, which OMML keeps italic.
|
||||||
|
+ static void italic(std::vector<OUString>& rRuns, std::u16string_view aText)
|
||||||
|
+ {
|
||||||
|
+ OUStringBuffer aOther;
|
||||||
|
+ auto other = [&]() {
|
||||||
|
+ if (!aOther.isEmpty())
|
||||||
|
+ rRuns.push_back("ital " + quoted(aOther.makeStringAndClear()));
|
||||||
|
+ };
|
||||||
|
+ for (sal_Unicode c : aText)
|
||||||
|
+ {
|
||||||
|
+ if (!u_isalpha(c))
|
||||||
|
+ {
|
||||||
|
+ aOther.append(c);
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ other();
|
||||||
|
+ rRuns.push_back(OUString(c));
|
||||||
|
+ }
|
||||||
|
+ other();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /// A bracket character's StarMath name; empty if unknown.
|
||||||
|
+ static OUString brace(sal_Unicode c, bool bLeft)
|
||||||
|
+ {
|
||||||
|
+ static const std::map<sal_Unicode, OUString> aNames{
|
||||||
|
+ { '(', u"("_ustr }, { ')', u")"_ustr }, { '[', u"["_ustr },
|
||||||
|
+ { ']', u"]"_ustr }, { '{', u"lbrace"_ustr }, { '}', u"rbrace"_ustr },
|
||||||
|
+ { '<', u"langle"_ustr }, { '>', u"rangle"_ustr }, { 0x27E8, u"langle"_ustr },
|
||||||
|
+ { 0x27E9, u"rangle"_ustr }, { 0x230A, u"lfloor"_ustr }, { 0x230B, u"rfloor"_ustr },
|
||||||
|
+ { 0x2308, u"lceil"_ustr }, { 0x2309, u"rceil"_ustr }
|
||||||
|
+ };
|
||||||
|
+ if (c == '|')
|
||||||
|
+ return bLeft ? u"lline"_ustr : u"rline"_ustr;
|
||||||
|
+ if (c == 0x2016)
|
||||||
|
+ return bLeft ? u"ldline"_ustr : u"rdline"_ustr;
|
||||||
|
+ auto it = aNames.find(c);
|
||||||
|
+ return it == aNames.end() ? OUString() : it->second;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /// A big operator character's StarMath name; empty if unknown.
|
||||||
|
+ static OUString bigOperator(sal_Unicode c)
|
||||||
|
+ {
|
||||||
|
+ static const std::map<sal_Unicode, OUString> aNames{
|
||||||
|
+ { 0x2211, u"sum"_ustr }, { 0x220F, u"prod"_ustr }, { 0x2210, u"coprod"_ustr },
|
||||||
|
+ { 0x222B, u"int"_ustr }, { 0x222C, u"iint"_ustr }, { 0x222D, u"iiint"_ustr },
|
||||||
|
+ { 0x222E, u"lint"_ustr }, { 0x222F, u"llint"_ustr }, { 0x2230, u"lllint"_ustr }
|
||||||
|
+ };
|
||||||
|
+ auto it = aNames.find(c);
|
||||||
|
+ return it == aNames.end() ? OUString() : it->second;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /// Puts `aScript` above or below the last atom.
|
||||||
|
+ static void attach(std::vector<OUString>& rAtoms, sal_Int8 nScript, const OUString& aScript)
|
||||||
|
+ {
|
||||||
|
+ // empty text, not a placeholder
|
||||||
|
+ OUString aBase = u"\"\""_ustr;
|
||||||
|
+ if (!rAtoms.empty())
|
||||||
|
+ {
|
||||||
|
+ aBase = "{" + rAtoms.back() + "}";
|
||||||
|
+ rAtoms.pop_back();
|
||||||
|
+ }
|
||||||
|
+ rAtoms.push_back(aBase + (nScript > 0 ? u"^{" : u"_{") + aScript + "}");
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /// Text up to an argument's end, or all.
|
||||||
|
+ OUString element(bool bArgument)
|
||||||
|
+ {
|
||||||
|
+ std::vector<OUString> aAtoms;
|
||||||
|
+ // runs that share one script position
|
||||||
|
+ std::vector<OUString> aGroup;
|
||||||
|
+ OUStringBuffer aText;
|
||||||
|
+ EqLook aLook;
|
||||||
|
+ auto piece = [&]() {
|
||||||
|
+ if (aText.isEmpty())
|
||||||
|
+ return;
|
||||||
|
+ OUString aRun = aText.makeStringAndClear();
|
||||||
|
+ if (aLook.bItalic)
|
||||||
|
+ italic(aGroup, aRun);
|
||||||
|
+ else
|
||||||
|
+ aGroup.push_back(quoted(aRun));
|
||||||
|
+ };
|
||||||
|
+ auto flush = [&]() {
|
||||||
|
+ piece();
|
||||||
|
+ if (aGroup.empty())
|
||||||
|
+ return;
|
||||||
|
+ if (aLook.nScript == 0)
|
||||||
|
+ aAtoms.insert(aAtoms.end(), aGroup.begin(), aGroup.end());
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ OUStringBuffer aScript;
|
||||||
|
+ for (const OUString& rRun : aGroup)
|
||||||
|
+ aScript.append((aScript.isEmpty() ? u"" : u" ") + rRun);
|
||||||
|
+ attach(aAtoms, aLook.nScript, aScript.makeStringAndClear());
|
||||||
|
+ }
|
||||||
|
+ aGroup.clear();
|
||||||
|
+ };
|
||||||
|
+ auto add = [&](sal_Unicode c, EqLook aNew) {
|
||||||
|
+ if (aNew.nScript != aLook.nScript)
|
||||||
|
+ flush();
|
||||||
|
+ else if (aNew.bItalic != aLook.bItalic)
|
||||||
|
+ piece();
|
||||||
|
+ aLook = aNew;
|
||||||
|
+ aText.append(c);
|
||||||
|
+ };
|
||||||
|
+ int nDepth = 0;
|
||||||
|
+ while (m_nPos < m_aCommand.size() && !m_bFailed)
|
||||||
|
+ {
|
||||||
|
+ sal_Unicode c = m_aCommand[m_nPos];
|
||||||
|
+ if (bArgument && nDepth == 0 && (c == ',' || c == ')'))
|
||||||
|
+ break;
|
||||||
|
+ if (c == '\\')
|
||||||
|
+ {
|
||||||
|
+ sal_Unicode cNext = at(m_nPos + 1);
|
||||||
|
+ // general switches such as \* MERGEFORMAT follow the equation
|
||||||
|
+ if (!bArgument && nDepth == 0
|
||||||
|
+ && (cNext == '*' || cNext == '#' || cNext == '@' || cNext == '!'))
|
||||||
|
+ {
|
||||||
|
+ while (!aText.isEmpty() && aText[aText.getLength() - 1] == ' ')
|
||||||
|
+ aText.setLength(aText.getLength() - 1);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ if (rtl::isAsciiAlpha(cNext))
|
||||||
|
+ {
|
||||||
|
+ flush();
|
||||||
|
+ ++m_nPos;
|
||||||
|
+ command(aAtoms);
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ if (cNext != 0)
|
||||||
|
+ {
|
||||||
|
+ add(cNext, look(m_nPos + 1));
|
||||||
|
+ m_nPos += 2;
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if (c == '(')
|
||||||
|
+ ++nDepth;
|
||||||
|
+ else if (c == ')')
|
||||||
|
+ --nDepth;
|
||||||
|
+ add(c, look(m_nPos));
|
||||||
|
+ ++m_nPos;
|
||||||
|
+ }
|
||||||
|
+ flush();
|
||||||
|
+ OUStringBuffer aMath;
|
||||||
|
+ for (const OUString& rAtom : aAtoms)
|
||||||
|
+ aMath.append((aMath.isEmpty() ? u"" : u" ") + rAtom);
|
||||||
|
+ return aMath.makeStringAndClear();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /// `(e, e, ...)`.
|
||||||
|
+ std::vector<OUString> arguments()
|
||||||
|
+ {
|
||||||
|
+ std::vector<OUString> aArgs;
|
||||||
|
+ skipSpaces();
|
||||||
|
+ if (at(m_nPos) != '(')
|
||||||
|
+ {
|
||||||
|
+ fail("no arguments");
|
||||||
|
+ return aArgs;
|
||||||
|
+ }
|
||||||
|
+ ++m_nPos;
|
||||||
|
+ while (!m_bFailed)
|
||||||
|
+ {
|
||||||
|
+ aArgs.push_back(element(true));
|
||||||
|
+ sal_Unicode c = at(m_nPos++);
|
||||||
|
+ if (c == ')')
|
||||||
|
+ break;
|
||||||
|
+ if (c != ',')
|
||||||
|
+ fail("unclosed arguments");
|
||||||
|
+ }
|
||||||
|
+ return aArgs;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /// The switch after `\`, its options and arguments.
|
||||||
|
+ void command(std::vector<OUString>& rAtoms)
|
||||||
|
+ {
|
||||||
|
+ const sal_Unicode cCommand = rtl::toAsciiLowerCase(m_aCommand[m_nPos++]);
|
||||||
|
+ std::map<OUString, OUString> aOptions;
|
||||||
|
+ for (skipSpaces(); at(m_nPos) == '\\' && rtl::isAsciiAlpha(at(m_nPos + 1)); skipSpaces())
|
||||||
|
+ {
|
||||||
|
+ // switches ignore case, as Word reads them
|
||||||
|
+ OUString aName = OUString(m_aCommand.substr(m_nPos + 1, 2)).toAsciiLowerCase();
|
||||||
|
+ m_nPos += 3;
|
||||||
|
+ if (aName == "lc" || aName == "rc" || aName == "bc" || aName == "fc" || aName == "vc")
|
||||||
|
+ {
|
||||||
|
+ if (at(m_nPos) == '\\')
|
||||||
|
+ ++m_nPos;
|
||||||
|
+ aOptions[aName] = OUString(at(m_nPos++));
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ skipSpaces();
|
||||||
|
+ size_t nStart = m_nPos;
|
||||||
|
+ while (rtl::isAsciiDigit(at(m_nPos)))
|
||||||
|
+ ++m_nPos;
|
||||||
|
+ aOptions[aName] = OUString(m_aCommand.substr(nStart, m_nPos - nStart));
|
||||||
|
+ }
|
||||||
|
+ std::vector<OUString> aArgs = arguments();
|
||||||
|
+ if (m_bFailed)
|
||||||
|
+ return;
|
||||||
|
+ auto join = [&](std::u16string_view aBetween) {
|
||||||
|
+ OUStringBuffer aBuf;
|
||||||
|
+ for (size_t i = 0; i < aArgs.size(); ++i)
|
||||||
|
+ aBuf.append((i ? aBetween : u"") + OUString("{" + aArgs[i] + "}"));
|
||||||
|
+ return aBuf.makeStringAndClear();
|
||||||
|
+ };
|
||||||
|
+ switch (cCommand)
|
||||||
|
+ {
|
||||||
|
+ case 'f':
|
||||||
|
+ if (aArgs.size() != 2)
|
||||||
|
+ return fail("a fraction needs two parts");
|
||||||
|
+ rAtoms.push_back("{" + aArgs[0] + "} over {" + aArgs[1] + "}");
|
||||||
|
+ break;
|
||||||
|
+ case 'r':
|
||||||
|
+ if (aArgs.size() == 1)
|
||||||
|
+ rAtoms.push_back("sqrt{" + aArgs[0] + "}");
|
||||||
|
+ else if (aArgs.size() == 2)
|
||||||
|
+ rAtoms.push_back("nroot{" + aArgs[0] + "}{" + aArgs[1] + "}");
|
||||||
|
+ else
|
||||||
|
+ return fail("a radical needs one or two parts");
|
||||||
|
+ break;
|
||||||
|
+ case 's':
|
||||||
|
+ // \ai and \di only add line spacing
|
||||||
|
+ if (aOptions.contains(u"up"_ustr))
|
||||||
|
+ attach(rAtoms, 1, join(u" "));
|
||||||
|
+ else if (aOptions.contains(u"do"_ustr))
|
||||||
|
+ attach(rAtoms, -1, join(u" "));
|
||||||
|
+ else
|
||||||
|
+ rAtoms.push_back("stack{" + join(u" # ") + "}");
|
||||||
|
+ break;
|
||||||
|
+ case 'b':
|
||||||
|
+ {
|
||||||
|
+ static const std::map<sal_Unicode, sal_Unicode> aClosing{
|
||||||
|
+ { '(', ')' }, { '[', ']' }, { '{', '}' }, { '<', '>' }
|
||||||
|
+ };
|
||||||
|
+ auto option = [&](const OUString& rKey) {
|
||||||
|
+ auto it = aOptions.find(rKey);
|
||||||
|
+ return it == aOptions.end() || it->second.isEmpty() ? sal_Unicode(0)
|
||||||
|
+ : it->second[0];
|
||||||
|
+ };
|
||||||
|
+ const sal_Unicode cBoth = option(u"bc"_ustr);
|
||||||
|
+ sal_Unicode cLeft = option(u"lc"_ustr);
|
||||||
|
+ sal_Unicode cRight = option(u"rc"_ustr);
|
||||||
|
+ if (!cLeft)
|
||||||
|
+ cLeft = cBoth ? cBoth : '(';
|
||||||
|
+ if (!cRight)
|
||||||
|
+ {
|
||||||
|
+ auto it = aClosing.find(cBoth);
|
||||||
|
+ cRight = !cBoth ? ')' : it != aClosing.end() ? it->second : cBoth;
|
||||||
|
+ }
|
||||||
|
+ const OUString aLeft = brace(cLeft, true);
|
||||||
|
+ const OUString aRight = brace(cRight, false);
|
||||||
|
+ if (aLeft.isEmpty() || aRight.isEmpty())
|
||||||
|
+ return fail("an unknown bracket");
|
||||||
|
+ rAtoms.push_back("left " + aLeft + " " + join(u" \",\" ") + " right " + aRight);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ case 'l':
|
||||||
|
+ rAtoms.push_back(join(u" \",\" "));
|
||||||
|
+ break;
|
||||||
|
+ case 'a':
|
||||||
|
+ {
|
||||||
|
+ sal_Int32 nColumns = std::max<sal_Int32>(1, aOptions[u"co"_ustr].toInt32());
|
||||||
|
+ OUString aAlign = aOptions.contains(u"al"_ustr) ? u"alignl "_ustr
|
||||||
|
+ : aOptions.contains(u"ar"_ustr) ? u"alignr "_ustr
|
||||||
|
+ : OUString();
|
||||||
|
+ // a short last row is padded, never dropped
|
||||||
|
+ while (aArgs.size() % nColumns)
|
||||||
|
+ aArgs.emplace_back();
|
||||||
|
+ OUStringBuffer aBuf("matrix{");
|
||||||
|
+ for (size_t i = 0; i < aArgs.size(); ++i)
|
||||||
|
+ {
|
||||||
|
+ if (i)
|
||||||
|
+ aBuf.append(i % nColumns ? u" # " : u" ## ");
|
||||||
|
+ aBuf.append(aAlign + "{" + aArgs[i] + "}");
|
||||||
|
+ }
|
||||||
|
+ rAtoms.push_back(aBuf.append("}").makeStringAndClear());
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ case 'i':
|
||||||
|
+ {
|
||||||
|
+ if (aArgs.size() != 3)
|
||||||
|
+ return fail("an integral needs three parts");
|
||||||
|
+ OUString aOperator = aOptions.contains(u"su"_ustr) ? u"sum"_ustr
|
||||||
|
+ : aOptions.contains(u"pr"_ustr) ? u"prod"_ustr
|
||||||
|
+ : u"int"_ustr;
|
||||||
|
+ // a given operator character wins
|
||||||
|
+ for (const OUString& rKey : { u"fc"_ustr, u"vc"_ustr })
|
||||||
|
+ {
|
||||||
|
+ auto it = aOptions.find(rKey);
|
||||||
|
+ if (it == aOptions.end())
|
||||||
|
+ continue;
|
||||||
|
+ aOperator = it->second.isEmpty() ? OUString() : bigOperator(it->second[0]);
|
||||||
|
+ if (aOperator.isEmpty())
|
||||||
|
+ return fail("an unknown operator");
|
||||||
|
+ }
|
||||||
|
+ rAtoms.push_back(aOperator + " from{" + aArgs[0] + "} to{" + aArgs[1] + "} {"
|
||||||
|
+ + aArgs[2] + "}");
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ case 'x':
|
||||||
|
+ case 'o':
|
||||||
|
+ rAtoms.push_back(join(u" "));
|
||||||
|
+ break;
|
||||||
|
+ case 'd':
|
||||||
|
+ if (aOptions.contains(u"fo"_ustr))
|
||||||
|
+ rAtoms.push_back(u"~"_ustr);
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ fail("an unknown switch");
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+};
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+OUString EqToStarMath(std::u16string_view rCommand, const std::vector<EqLook>& rLooks)
|
||||||
|
+{
|
||||||
|
+ return EqParser(rCommand, rLooks).parse();
|
||||||
|
+}
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
Writer: Word EQ fields open as formulas
|
||||||
|
|
||||||
|
DOCX import read only EQ's \o, \s\do and ruby forms; every other
|
||||||
|
EQ field, such as \f(a,b) for a fraction, vanished (Gitea #9).
|
||||||
|
The import now turns an EQ field into a Math object through
|
||||||
|
the parser of the previous patch. Each command character keeps
|
||||||
|
its run's italic and vertAlign, as Word draws them (a with a
|
||||||
|
subscript 10 is a_{10}); the formula takes the field's font
|
||||||
|
size. A command the parser cannot read shows its field code as
|
||||||
|
text, so nothing vanishes and the failure stays visible. Only a
|
||||||
|
whole plain \s\do N(text) field stays lowered text, as before;
|
||||||
|
the old reader dropped anything after its first bracket.
|
||||||
|
|
||||||
|
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
|
||||||
|
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
|
||||||
|
@@ -26,6 +26,7 @@
|
||||||
|
#include <com/sun/star/style/TabStop.hpp>
|
||||||
|
#include <com/sun/star/container/XNameContainer.hpp>
|
||||||
|
#include <com/sun/star/embed/XStorage.hpp>
|
||||||
|
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
|
||||||
|
#include <queue>
|
||||||
|
#include <stack>
|
||||||
|
#include <string_view>
|
||||||
|
@@ -50,6 +51,7 @@
|
||||||
|
#include "ThemeHandler.hxx"
|
||||||
|
#include "GraphicImport.hxx"
|
||||||
|
#include "OLEHandler.hxx"
|
||||||
|
+#include "EqField.hxx"
|
||||||
|
#include "FFDataHandler.hxx"
|
||||||
|
#include "SmartTagHandler.hxx"
|
||||||
|
#include "FormControlHelper.hxx"
|
||||||
|
@@ -303,6 +305,8 @@ class FieldContext : public virtual SvRefBase
|
||||||
|
// 0: Normal, inserted command line
|
||||||
|
// 1: Deleted command line
|
||||||
|
OUString m_sCommand[2];
|
||||||
|
+ /// The look of each inserted command character, for EQ fields.
|
||||||
|
+ std::vector<EqLook> m_aCommandLooks;
|
||||||
|
OUString m_sResult;
|
||||||
|
OUString m_sVariableValue;
|
||||||
|
std::optional<FieldId> m_eFieldId;
|
||||||
|
@@ -346,6 +350,12 @@ public:
|
||||||
|
|
||||||
|
void AppendCommand(std::u16string_view rPart);
|
||||||
|
/// Deleted command text has no look.
|
||||||
|
+ void AppendLooks(sal_Int32 nCount, EqLook aLook)
|
||||||
|
+ {
|
||||||
|
+ if (!m_bCommandType)
|
||||||
|
+ m_aCommandLooks.insert(m_aCommandLooks.end(), nCount, aLook);
|
||||||
|
+ }
|
||||||
|
+ const std::vector<EqLook>& GetCommandLooks() const { return m_aCommandLooks; }
|
||||||
|
const OUString& GetCommand() const {return m_sCommand[m_bCommandType]; }
|
||||||
|
bool GetCommandIsEmpty(bool bType) const { return m_sCommand[bType].isEmpty(); }
|
||||||
|
void SetCommandType(bool cType) { m_bCommandType = cType; }
|
||||||
|
@@ -846,6 +856,9 @@ public:
|
||||||
|
void moveWithRun(const css::uno::Reference<css::text::XTextContent>& xContent);
|
||||||
|
void appendOLE( const OUString& rStreamName, const std::shared_ptr<OLEHandler>& pOleHandler );
|
||||||
|
void appendStarMath( const Value& v);
|
||||||
|
+ void appendFormula(const css::uno::Reference<css::embed::XEmbeddedObject>& xFormula);
|
||||||
|
+ /// A Word EQ field as a formula object.
|
||||||
|
+ void appendEqFormula(const FieldContextPtr& pContext);
|
||||||
|
void adjustLastPara(sal_Int8 nAlign);
|
||||||
|
rtl::Reference<SwXTextSection> appendTextSectionAfter(css::uno::Reference<css::text::XTextRange> const & xBefore);
|
||||||
|
|
||||||
|
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
|
||||||
|
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
|
||||||
|
@@ -92,6 +92,9 @@
|
||||||
|
#include <com/sun/star/document/XImporter.hpp>
|
||||||
|
#include <com/sun/star/document/XFilter.hpp>
|
||||||
|
#include <comphelper/indexedpropertyvalues.hxx>
|
||||||
|
+#include <comphelper/classids.hxx>
|
||||||
|
+#include <comphelper/embeddedobjectcontainer.hxx>
|
||||||
|
+#include <tools/globname.hxx>
|
||||||
|
#include <editeng/flditem.hxx>
|
||||||
|
#include <editeng/unotext.hxx>
|
||||||
|
#include <o3tl/deleter.hxx>
|
||||||
|
@@ -3815,19 +3818,44 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, const std::share
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
+void DomainMapper_Impl::appendEqFormula(const FieldContextPtr& pContext)
|
||||||
|
+{
|
||||||
|
+ // the looks index the untrimmed command
|
||||||
|
+ const OUString aMath = EqToStarMath(pContext->GetCommand(), pContext->GetCommandLooks());
|
||||||
|
+ if (aMath.isEmpty())
|
||||||
|
+ {
|
||||||
|
+ // an unreadable field shows its code, never vanishes
|
||||||
|
+ appendTextPortion(pContext->GetCommand().trim(), pContext->getProperties());
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ comphelper::EmbeddedObjectContainer aContainer;
|
||||||
|
+ OUString aName;
|
||||||
|
+ uno::Reference<embed::XEmbeddedObject> xFormula = aContainer.CreateEmbeddedObject(
|
||||||
|
+ SvGlobalName(SO3_SM_CLASSID).GetByteSequence(), aName, m_aBaseUrl);
|
||||||
|
+ uno::Reference<beans::XPropertySet> xMath(xFormula->getComponent(), uno::UNO_QUERY_THROW);
|
||||||
|
+ xMath->setPropertyValue(u"Formula"_ustr, uno::Any(aMath));
|
||||||
|
+ double fHeight = 0;
|
||||||
|
+ if (GetAnyProperty(PROP_CHAR_HEIGHT, pContext->getProperties()) >>= fHeight)
|
||||||
|
+ xMath->setPropertyValue(u"BaseFontHeight"_ustr, uno::Any(sal_Int16(std::round(fHeight))));
|
||||||
|
+ appendFormula(xFormula);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void DomainMapper_Impl::appendStarMath( const Value& val )
|
||||||
|
{
|
||||||
|
uno::Reference< embed::XEmbeddedObject > formula;
|
||||||
|
val.getAny() >>= formula;
|
||||||
|
- if( !formula.is() )
|
||||||
|
- return;
|
||||||
|
+ if( formula.is() )
|
||||||
|
+ appendFormula(formula);
|
||||||
|
+}
|
||||||
|
|
||||||
|
+void DomainMapper_Impl::appendFormula(const uno::Reference<embed::XEmbeddedObject>& formula)
|
||||||
|
+{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
rtl::Reference<SwXTextEmbeddedObject> xStarMath = m_xTextDocument->createTextEmbeddedObject();
|
||||||
|
|
||||||
|
xStarMath->setPropertyValue(getPropertyName( PROP_EMBEDDED_OBJECT ),
|
||||||
|
- val.getAny());
|
||||||
|
+ uno::Any(formula));
|
||||||
|
// tdf#66405: set zero margins for embedded object
|
||||||
|
xStarMath->setPropertyValue(getPropertyName( PROP_LEFT_MARGIN ),
|
||||||
|
uno::Any(sal_Int32(0)));
|
||||||
|
@@ -6599,11 +6627,20 @@ void DomainMapper_Impl::AppendFieldCommand(OUString const & rPartOfCommand)
|
||||||
|
{
|
||||||
|
// Set command line type: normal or deleted
|
||||||
|
pContext->SetCommandType(m_bTextDeleted);
|
||||||
|
+ PropertyMapPtr pCharContext = GetTopContextOfType(CONTEXT_CHARACTER);
|
||||||
|
if (pContext->GetCommand().isEmpty())
|
||||||
|
{
|
||||||
|
- pContext->getProperties()->InsertProps(GetTopContextOfType(CONTEXT_CHARACTER));
|
||||||
|
+ pContext->getProperties()->InsertProps(pCharContext);
|
||||||
|
}
|
||||||
|
pContext->AppendCommand( rPartOfCommand );
|
||||||
|
+ EqLook aLook;
|
||||||
|
+ awt::FontSlant eSlant = awt::FontSlant_NONE;
|
||||||
|
+ aLook.bItalic = (GetAnyProperty(PROP_CHAR_POSTURE, pCharContext) >>= eSlant)
|
||||||
|
+ && eSlant == awt::FontSlant_ITALIC;
|
||||||
|
+ sal_Int16 nEscapement = 0;
|
||||||
|
+ GetAnyProperty(PROP_CHAR_ESCAPEMENT, pCharContext) >>= nEscapement;
|
||||||
|
+ aLook.nScript = nEscapement > 0 ? 1 : nEscapement < 0 ? -1 : 0;
|
||||||
|
+ pContext->AppendLooks(rPartOfCommand.getLength(), aLook);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -8209,7 +8246,13 @@ void DomainMapper_Impl::CloseFieldCommand()
|
||||||
|
sal_Int32 nSpaceIndex = aCommand.indexOf(' ');
|
||||||
|
if(nSpaceIndex > 0)
|
||||||
|
aCommand = o3tl::trim(aCommand.subView(nSpaceIndex));
|
||||||
|
- if (aCommand.startsWith("\\s"))
|
||||||
|
+ // only a whole plain lowered run stays text
|
||||||
|
+ sal_Int32 nOpen = aCommand.indexOf('(');
|
||||||
|
+ bool bLowered = aCommand.startsWith("\\s\\do") && nOpen > 0
|
||||||
|
+ && aCommand.indexOf(')') == aCommand.getLength() - 1
|
||||||
|
+ && aCommand.indexOf('(', nOpen + 1) < 0
|
||||||
|
+ && aCommand.indexOf('\\', 5) < 0;
|
||||||
|
+ if (bLowered)
|
||||||
|
{
|
||||||
|
aCommand = aCommand.copy(2);
|
||||||
|
if (aCommand.startsWith("\\do"))
|
||||||
|
@@ -8236,6 +8279,8 @@ void DomainMapper_Impl::CloseFieldCommand()
|
||||||
|
{
|
||||||
|
handleRubyEQField(pContext);
|
||||||
|
}
|
||||||
|
+ else
|
||||||
|
+ appendEqFormula(pContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Usage: review.sh <item-id> <round> [path...] — codex max, fast review.
|
# Usage: review.sh <item-id> <round> [path...] — codex xhigh, fast review.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
[ "${HERDR_ENV:-}" = 1 ] || { echo "review.sh: not inside herdr" >&2; exit 2; }
|
[ "${HERDR_ENV:-}" = 1 ] || { echo "review.sh: not inside herdr" >&2; exit 2; }
|
||||||
@@ -37,7 +37,7 @@ pane=$(herdr pane split --current --direction right --cwd "$PWD" --no-focus | jq
|
|||||||
echo "$pane" >"$last"
|
echo "$pane" >"$last"
|
||||||
started=
|
started=
|
||||||
for _ in 1 2 3 4 5; do
|
for _ in 1 2 3 4 5; do
|
||||||
if err=$(herdr agent start "$name" --kind codex --pane "$pane" --timeout 120000 -- --yolo --model gpt-6-astra -c 'model_reasoning_effort="max"' -c 'service_tier="fast"' -c check_for_update_on_startup=false 2>&1); then
|
if err=$(herdr agent start "$name" --kind codex --pane "$pane" --timeout 120000 -- --yolo --model gpt-6.1-sol -c 'model_reasoning_effort="xhigh"' -c 'service_tier="fast"' -c check_for_update_on_startup=false 2>&1); then
|
||||||
started=1
|
started=1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|||||||
+2
-2
@@ -10,7 +10,7 @@ const en = {
|
|||||||
ElyTree: "Stage lines, commit, read the graph. Git without a terminal.",
|
ElyTree: "Stage lines, commit, read the graph. Git without a terminal.",
|
||||||
ElyMark: "Markdown as you read it. Math and diagrams in place.",
|
ElyMark: "Markdown as you read it. Math and diagrams in place.",
|
||||||
offline: "Works with the network off.",
|
offline: "Works with the network off.",
|
||||||
open: "Open source, under the AGPL.",
|
open: "Open source, under the MIT licence.",
|
||||||
local: "Your files stay in your folders.",
|
local: "Your files stay in your folders.",
|
||||||
download: "Download",
|
download: "Download",
|
||||||
platforms: "Out now for macOS, Windows and Linux.",
|
platforms: "Out now for macOS, Windows and Linux.",
|
||||||
@@ -48,7 +48,7 @@ const zh: typeof en = {
|
|||||||
ElyTree: "按行暂存、提交、看提交图。不用终端的 Git。",
|
ElyTree: "按行暂存、提交、看提交图。不用终端的 Git。",
|
||||||
ElyMark: "写的就是看到的 Markdown。公式与图表就地显示。",
|
ElyMark: "写的就是看到的 Markdown。公式与图表就地显示。",
|
||||||
offline: "断网照常工作。",
|
offline: "断网照常工作。",
|
||||||
open: "开源,AGPL 许可。",
|
open: "开源,MIT 许可。",
|
||||||
local: "文件留在你自己的文件夹里。",
|
local: "文件留在你自己的文件夹里。",
|
||||||
download: "下载",
|
download: "下载",
|
||||||
platforms: "macOS、Windows 与 Linux 版已发布。",
|
platforms: "macOS、Windows 与 Linux 版已发布。",
|
||||||
|
|||||||
+10
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
进度真相。自上而下,逐条完成,不跳项。编号前缀是 PRD 章节号,`C00` 是用户指令的前置项。
|
进度真相。自上而下,逐条完成,不跳项。编号前缀是 PRD 章节号,`C00` 是用户指令的前置项。
|
||||||
|
|
||||||
每条完成后:`scripts/review.sh ID 轮次` 在 herdr 开新分栏,codex --yolo(gpt-6-astra,effort max,fast)审查,最多三轮。有问题先修,复审通过才勾选。审查只看缺陷,不收“建议增强”。每轮结论写入 `tasks/reviews/<编号>-r<轮>.md`。
|
每条完成后:`scripts/review.sh ID 轮次` 在 herdr 开新分栏,codex --yolo(gpt-6.1-sol,effort xhigh,fast)审查,最多三轮。有问题先修,复审通过才勾选。审查只看缺陷,不收“建议增强”。每轮结论写入 `tasks/reviews/<编号>-r<轮>.md`。
|
||||||
|
|
||||||
状态:`[ ]` 未做 `[x]` 完成且审查通过 `[~]` 三轮用尽,末轮缺陷已修并有回归测试,未经复审 `[!]` 外部阻塞,写明原因与证据,不算完成。
|
状态:`[ ]` 未做 `[x]` 完成且审查通过 `[~]` 三轮用尽,末轮缺陷已修并有回归测试,未经复审 `[!]` 外部阻塞,写明原因与证据,不算完成。
|
||||||
|
|
||||||
@@ -285,3 +285,12 @@
|
|||||||
- [x] R7.7 发布 0.1.6:版本号,三端建包、签名公证、上传,合集包一并上传,本机装上(v0.1.6 共 46 个文件,出自 a1b8c18:六个公证 dmg 与 ElyOffice dmg、六个安装程序与合集 setup.exe、24 个 Linux 包、一对源码包;`crates.py` 改问 cargo 本机链进的 crate,补 BSD-3-Clause;源码包只由 Linux 上传,重跑遇同名即失败、什么也不传(`ci-upload.sh`);本机六个应用静默装上 0.1.6、冒烟通过 — 第 1 轮:macOS 与 Linux 并行会重复上传源码;第 2 轮:重跑跳过同名会使更新清单与 dmg 散列不符、注释超长;第 3 轮:部分已传的重跑未测、注释超长,修后不再审查)
|
- [x] R7.7 发布 0.1.6:版本号,三端建包、签名公证、上传,合集包一并上传,本机装上(v0.1.6 共 46 个文件,出自 a1b8c18:六个公证 dmg 与 ElyOffice dmg、六个安装程序与合集 setup.exe、24 个 Linux 包、一对源码包;`crates.py` 改问 cargo 本机链进的 crate,补 BSD-3-Clause;源码包只由 Linux 上传,重跑遇同名即失败、什么也不传(`ci-upload.sh`);本机六个应用静默装上 0.1.6、冒烟通过 — 第 1 轮:macOS 与 Linux 并行会重复上传源码;第 2 轮:重跑跳过同名会使更新清单与 dmg 散列不符、注释超长;第 3 轮:部分已传的重跑未测、注释超长,修后不再审查)
|
||||||
- [x] R7.8 答复 #3 至 #6:每条写已修于 0.1.6;#6 的工作区建议另开 [FEATURE REQUEST] 并链过去(#3、#4、#5、#6 各一条答复,#7 为 [FEATURE REQUEST] 工作区与常用文件夹;#3、#5、#6 关闭,#4 开着等报告者的文件 — 第 1 轮:#5 的答复说只有读不出的内容才算损坏,超出 0.1.6 所修,改为只说未嵌入字体的提示不再算损坏;第 2 轮 PASS)
|
- [x] R7.8 答复 #3 至 #6:每条写已修于 0.1.6;#6 的工作区建议另开 [FEATURE REQUEST] 并链过去(#3、#4、#5、#6 各一条答复,#7 为 [FEATURE REQUEST] 工作区与常用文件夹;#3、#5、#6 关闭,#4 开着等报告者的文件 — 第 1 轮:#5 的答复说只有读不出的内容才算损坏,超出 0.1.6 所修,改为只说未嵌入字体的提示不再算损坏;第 2 轮 PASS)
|
||||||
- [x] R7.9 Windows 右键“新建”(用户 2026-10-16 定,发 0.1.7,只发 Windows):资源管理器的新建菜单可建 DOCX、XLSX、PPTX、Markdown 文件,各由所属的应用装上与卸下(`types.sh` 测试另以两个变体核对:去掉判空、去掉 md 的模板各自失败;本机在 0.1.6 上静默装 0.1.7 的 ElyDoc、ElyTable、ElyShow、ElyMark:新建菜单列出四项,无 `.ely-old`,四个模板按新建的方式复制后在所属应用里打开,日志无错误与警告;卸载 ElyMark 后 `.md` 的新建项与默认值都删去、`UserChoice` 未动,重装复原;`windows-installer.sh`、`windows-bundle.sh` 通过。未送审:用户要求从简)
|
- [x] R7.9 Windows 右键“新建”(用户 2026-10-16 定,发 0.1.7,只发 Windows):资源管理器的新建菜单可建 DOCX、XLSX、PPTX、Markdown 文件,各由所属的应用装上与卸下(`types.sh` 测试另以两个变体核对:去掉判空、去掉 md 的模板各自失败;本机在 0.1.6 上静默装 0.1.7 的 ElyDoc、ElyTable、ElyShow、ElyMark:新建菜单列出四项,无 `.ely-old`,四个模板按新建的方式复制后在所属应用里打开,日志无错误与警告;卸载 ElyMark 后 `.md` 的新建项与默认值都删去、`UserChoice` 未动,重装复原;`windows-installer.sh`、`windows-bundle.sh` 通过。未送审:用户要求从简)
|
||||||
|
|
||||||
|
## R8 内容配色、Gitea #8 与 #9、ElyMark 公式(用户 2026-10-18 报;审查改为 gpt-6.1-sol,effort xhigh,fast)
|
||||||
|
|
||||||
|
- [x] R8.1 深色外观下内容照文件原色(§5,用户定,取代 2026-10-04 的“内容区随系统深浅色”):ElyPDF 页面不反相;ElyDoc 页面、ElyTable 单元格照文件的颜色(白底即白底),ElyShow 已是如此(`ely.xcd` 只留浅色方案,每个视图首帧发一次;MuPDF 不再反相;Windows 真窗口深色外观下四个应用都是白纸;测试以深色档案起内核、视图须把页面画白,去掉发送即失败 — 第 1 轮:`theme.sh` 仍要深色网格、测试的内核本就浅色;第 2 轮:两处注释超长;第 3 轮 PASS)
|
||||||
|
- [x] R8.2 Gitea #9 公式不兼容(§7):附件 math.docx 的键盘公式、OMML、MathType(OLE)、EQ 域、上下标、图片公式逐类与 Word 对照,查明各类差异的根因并修;修不了的写明原因与证据(补丁 0049:运行的 `w:position` 随锚字符移动图片与 OLE;0050、0051:EQ 域转为公式对象,读不通的显示域代码;`word.rs` 三项测试;第 3 轮四处修后未再审查)
|
||||||
|
- [x] R8.3 Gitea #8 工作表过多时标签条不滚动(§9):活动工作表变化时标签条滚动,使该标签完整可见;被裁到窗口外的工作表可经标签条到达(组件库 7d704d9:按所选与宽度滚入、长名有上限;ElyTable 标签条按工作簿各记状态;`tabs.rs` 与 `strip.rs` 测试 — 第 1 轮:共用 id、长名越宽;第 2 轮:每工作簿状态无测试;第 3 轮 PASS)
|
||||||
|
- [x] R8.4 ElyMark 公式(§14):行内公式排版(原只显示着色的 TeX 原文);`\(…\)` 读作行内公式,`\[…\]` 读作块公式(组件库 dceca9f、e095f06、a20e712、5fba7b3、de961eb;`tex/tests.rs`、`math_text.rs` 与 ElyMark `visual.rs` 测试 — 第 1 轮:折行处的公式画错行、相邻公式合并、链接地址与 `<code>` 被换、`\$` 被拒、跨块成对、行内错误不显示、注释超长;第 2 轮:段首空格的块公式、嵌套 `<code>`、注释超长;第 3 轮:交叉闭合的标签,修后以测试核对,不再审查)
|
||||||
|
- [ ] R8.5 发布 0.1.8(用户 2026-10-18 定,要快):版本号,打标签由发布流程三端建包、签名公证、上传
|
||||||
|
- [ ] R8.6 答复 #8、#9,写已修于 0.1.8,修好的关闭;`agents.md` 随之
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
- crates/ely-lok/src/view/render.rs:44 — The unconditional light scheme makes the retained macOS regression test contradict R8.1. `tests/scripts/theme.sh:49` still requires the dark-app grid's mean brightness to be below 80. On a Mac with screen-capture permission, the required white grid therefore fails that test. Update the test to require the file's original colors under both application appearances.
|
||||||
|
|
||||||
|
- crates/ely-lok/src/view/tests/theme.rs:47 — The new test does not establish a dark kernel state: it changes GPUI's theme, then opens a fresh LibreOffice profile that already renders light. In the isolated WSL copy, removing the only `self.send(input::Input::Theme(SCHEME))` call still leaves `a_dark_app_paints_the_page_white` passing; see `.work/r81-review/linux-test-lok-theme-mutant.log`. A missing initialization command could leave an existing dark engine/profile dark without this test detecting the regression. Establish and verify a dark kernel state before showing the view, then assert that the view's initialization changes its rendered pixels to white.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
- crates/ely-lok/src/view/tests/theme.rs:54 — The new profile comment contains 11 words, exceeding agents.md rule 5. Running `python tests/scripts/comments.py` fails on this line (see `.work/r81-r2/comments.log`). Shorten the comment to ten words or fewer.
|
||||||
|
|
||||||
|
- tests/scripts/theme.sh:2 — The revised introductory comment contains 11 words, exceeding agents.md rule 5. Running `python tests/scripts/comments.py` also reports this line and exits unsuccessfully. Shorten the comment to ten words or fewer.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:92 — [P1] Trimming the command without trimming its character-format vector shifts every formatting index. Reproduced against the rebuilt Windows worker by prepending one space to the EQ instruction in `word.docx`: the expected italic `a₁₀/a₃` becomes `a1₀/a3`, with the wrong characters italicized and the denominator's subscript lost. The parser already skips leading spaces; pass the original command, or adjust both inputs identically, and add this regression. Evidence: `.work/r82-r1/probe.log` and `regression.log`.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:395 — [P1] Secondary switch names remain case-sensitive, although Word field switches are case-insensitive ([field syntax §2.16.1](https://www.durusau.net/publications/Muscular-WordProcessingML.pdf)). Reproduced: `EQ \I\SU(1,5,x)` imports as an integral, whereas `EQ \i\su(1,5,x)` imports as a sum; `\A\CO2(a,b,c,d)` becomes a four-row column instead of a two-by-two array. This silently changes mathematical meaning. Normalize secondary switch names before interpreting them and test uppercase and mixed-case spellings. Evidence: `.work/r82-r1/probe.log`.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:266 — [P2] Parse failures disappear without the promised diagnostic in the shipped kernel. `fail()` only uses `SAL_WARN`, which this Windows release build compiles out (`ENABLE_SAL_LOG` is empty); the empty result is then discarded at lines 93–94. Reproduced with `EQ \f(a)`: loading and saving both succeed, the field disappears, and worker stderr contains no EQ diagnostic even with `SAL_LOG=+INFO.writerfilter.dmapper`. This violates the error-exposure rule and the R8.2 documentation's logging claim. Propagate failure through an import warning/error observable in release builds and add a failure-path test. Evidence: `.work/r82-r1/regression.log`, `worker.log`, and `review.log`.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:95 — [P2] The new `SAL_INFO` statement logs the complete formula, including document text. With a logging-enabled kernel and `SAL_LOG=+INFO.writerfilter.dmapper` or a corresponding `SAL_LOG_FILE`, opening a field such as `EQ \f(PrivateAmount,PrivateDivisor)` writes both operands into the native diagnostic log. This violates rule 4's prohibition on logging document contents. Remove the formula payload from the diagnostic.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-fields-as-formulas.patch:517 — [P3] This newly added file has 517 lines, exceeding the explicit 500-line file limit. Split the diff into smaller ordered patches while preserving all changes and their application order.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-field-parser.patch:327 — [P1] An incomplete final array row silently loses operands. Reproduced with `EQ \a\co2(a,b,c)`: the generated StarMath has unequal row lengths, the actual MathML contains only `a` and `b`, and saving DOCX writes only those two operands into OMML. The annotation still contains `c`, so checking annotation text alone misses the loss. Pad the final row or reject the conversion visibly; test actual rendered/exported formula content. Evidence: `.work/r82-r2/edge-probe.log`, `array_three`.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-field-parser.patch:340 — [P1] The parser consumes custom operator switches but silently substitutes an integral. Reproduced with `EQ \i\fc\∑(1,5,x)`: the resulting formula is `int from{"1"} to{"5"} {"x"}`, and its MathML operator is `∫`. The specified summation operator has changed mathematical meaning. Honor the supplied symbol or fail parsing so the original field code remains visible; cover both `\fc` and `\vc`. These switches specify the operator character in [ECMA-376 Part 4 §14.10.4.6](https://ecma-international.org/wp-content/uploads/ECMA-376-4_5th_edition_december_2016.zip). Evidence: `.work/r82-r2/edge-probe.log`, `operator_sigma`.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-field-parser.patch:141 — [P1] Unrecognized bracket characters silently become invisible delimiters. Reproduced with `EQ \b\lc\⌊\rc\⌋(x)`: import succeeds as `left none {"x"} right none`; the actual MathML contains only `x`, losing the floor operation. The character options are defined by [ECMA-376 Part 4 §14.10.4.6](https://ecma-international.org/wp-content/uploads/ECMA-376-4_5th_edition_december_2016.zip). Preserve the delimiters or report the command unreadable instead of replacing them with `none`, and add a regression. Evidence: `.work/r82-r2/edge-probe.log`, `floor`.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-field-parser.patch:194 — [P2] General field switches are imported as visible equation text. Reproduced with `EQ \f(a,b) \* MERGEFORMAT`: the fraction acquires the literal suffix ` * MERGEFORMAT` in both StarMath and MathML; `\* CHARFORMAT` behaves likewise. [Microsoft documents these as formatting switches](https://support.microsoft.com/en-au/word/format-field-results), with MERGEFORMAT added by default by the field dialog. Parse general switches separately from equation content and add regressions asserting they do not appear in the formula result. Evidence: `.work/r82-r2/probe.log`, `mergeformat` and `charformat`.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
- patches/libreoffice/0051-writer-eq-fields-as-formulas.patch:149 — [P1] Fields beginning with lowercase `\s\do` still bypass the new parser and silently truncate the expression. `EQ \s\do2(x)+y` imports and saves as just `x`, losing `+y`; `EQ \s\do2(\f(a,b))` becomes the literal incomplete text `\f(a,b`. Uppercase equivalents retain the complete expressions. Route complete EQ expressions through the parser instead of this partial legacy reader, and cover both cases through DOCX save/reopen. Evidence: `.work/r82-r3/probe.log`, `lower_script_tail` and `lower_script_nested`.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-field-parser.patch:191 — [P1] Changing italics within one subscript flushes and attaches another subscript to the already subscripted base. Reproduced with `EQ \f(a10,b)`, where both digits have `w:vertAlign="subscript"`, but only `1` is italic: import creates `(a₁)₀/b` with two nested MathML `msub` elements, and saved DOCX contains nested `m:sSub` objects. Both digits should remain in one subscript. Accumulate a contiguous script across font-style changes before attaching it, preserving the styles inside that script; add a rendered/exported structure regression. Evidence: `.work/r82-r3/probe.log`, `split_script` versus `merged_script`.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-field-parser.patch:312 — [P1] `\ai` and `\di` are treated as aliases for raising and lowering an argument. These are paragraph spacing options in [Microsoft's EQ reference](https://support.microsoft.com/en-us/word/field-codes-eq-equation-field). `EQ x\s\ai4(y)` becomes `x` raised to `y`, while `EQ x\s\di4(y)` becomes `x` subscript `y`; the incorrect mathematical structures persist in DOCX. Handle spacing separately from script positioning, or preserve the field code visibly when unsupported, and test the actual MathML/OMML structure. Evidence: `.work/r82-r3/probe.log`, `script_ai` and `script_di`; `.work/r82-r3/spec.log`, page 194.
|
||||||
|
|
||||||
|
- patches/libreoffice/0050-writer-eq-field-parser.patch:183 — [P2] The generated `ital "text"` representation loses italics when saved as DOCX. Reproduced using the unchanged `tests/fixtures/office/word.docx`: its fraction initially has two italic `a` characters, but exported OMML marks both as `m:nor` without italic formatting, and reopening shows both upright. The new tests only assert formula styling before DOCX saving. Preserve italic formatting through OMML serialization and assert the fixture's formula styles after save/reopen. Evidence: `.work/r82-r3/fixture-roundtrip.log` and `.work/r82-r3/regressions.log`.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
1. `apps/ely-table/src/sheets.rs:118`(组件库 `src/navigation/tabs.rs:294`):所有工作簿共用 `table-sheets`,所选值只有工作表索引,而自动滚动只比较所选值和视口宽度。打开两个各有 30 张表、当前均为第 30 张的工作簿,在第一个工作簿把标签条滚回开头,再切到第二个;状态键不变,新的活动标签仍在视口外,不符合 R8.3 的活动工作表变化时完整可见。探针测得视口为 `[8,604]`,第二个工作簿的活动标签为 `[1446,1494]`。修正方向:把工作簿身份纳入标签条的状态或跟随判定,并覆盖同索引跨工作簿切换的回归测试。证据:`.work/R8.3-r1/final-probes.log`。
|
||||||
|
|
||||||
|
2. `C:/Users/zhang/Documents/Github/Ely-GPUI-Components/src/navigation/tabs.rs:250`(标签项在 `:183` 构建):只允许标签条收缩,没有限制单个标签的宽度,长且不能断行的表名仍可宽于整个视口。640 像素窗口显示 280 像素属性栏时,正文宽 360,扣除添加按钮和边距后标签视口宽 316;使用内嵌 Inter 和 Windows DirectWrite,表名为两位序号加 29 个 `W`,切换到第 30 张表后标签宽 390,自动滚动只能将其左端对齐,右侧仍被裁掉,无法满足完整可见。修正方向:约束标签项和其文字的布局,使单项能容纳于当前视口,并用实际字体覆盖长表名与侧栏缩窄的回归测试。证据:`.work/R8.3-r1/final-probes.log` 的 `native_text_keeps_a_valid_31_character_sheet_name_fully_visible`。
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
1. `apps/ely-table/src/sheets.rs:118`(同文件 `:331` 的测试):跨工作簿状态隔离的修复缺少回归测试。现有 `sheets::tests` 只测 `visible()`;`a_switch_stays_with_its_workbook` 在不渲染标签条的 `Blank` 窗口里只核对内核状态,组件的标签测试也只用一个固定身份。把此处退回共享的 `table-sheets`,这些测试仍无法发现:两个各有 30 张表、当前索引均为 29 的工作簿,第一个手动滚回开头后切到第二个,活动标签落在视口外。独立探针已核对新键通过、旧键复现(视口 `[8,604]`,旧键的活动标签 `[2490,2574]`),但探针不属于项目测试。修正方向:加入实际渲染 `sheet_strip` 的跨工作簿回归测试,覆盖相同当前索引、手动滚动后切换及切回,并断言活动标签完整位于视口内;恢复旧键时须失败。证据:`.work/R8.3-r2/probe-tests.log`、`probe-source.log`、`validation.log`。
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
1. `../Ely-GPUI-Components/src/documents/render/math_text.rs:182`:U+00A0 占位不能保证公式整体换行;当前 GPUI 会在这些字符之间断行,图片却仍从占位起点整张绘制。160px 宽的段落显示 `aaaaaaaaaa $x^2+y^2=r^2$ tail` 时,探针测得同一公式占位从 `(105.6, 0)` 跨到 `(76.8, 26)`,公式越过右边界,下一行留下空位,点击位置也不再对应画面。不符合 R8.4 的行内排版,`agents.md` 的“不断行”说明亦不成立。修正方向:让公式宽度以不可拆分的单元参与换行,并测试公式接近行尾时的排版与命中。证据:`.work/r84-r1-probe-tests.log` 的 `formula_space_is_indivisible`;原有窗口测试未覆盖换行。
|
||||||
|
|
||||||
|
2. `../Ely-GPUI-Components/src/documents/markdown.rs:64`:把两端替换为 `$ ` 和 ` $` 会把相邻公式的边界拼成 `$$`。`\(x\)\(y\)` 实际变成 `$ x $$ y $`,只解析出一个内容为 `x $$ y` 的公式;`$x$\(y\)` 同样合并。可视模式与导出都失去原来的两条公式。修正方向:保留每对分隔符的独立公式节点,避免转换产生新的美元符号连续串,并覆盖两种分隔符相邻的组合。证据:`.work/r84-r1-probe-tests.log` 的 `adjacent_formulas_remain_distinct`、`.work/r84-r1-parser.log`。
|
||||||
|
|
||||||
|
3. `../Ely-GPUI-Components/src/documents/markdown.rs:40`:保护范围没有排除链接和图片的目标地址,整文件扫描会把地址里的转义括号当公式。合法的 `[go](https://e.test/\(x\))` 原本指向 `https://e.test/(x)`,现在变成正文碎片与指向 `https://e.test/$` 的错误链接;`.png)` 则不再是图片。违反 MARK-03,也影响使用同一解析入口的输出。修正方向:只在允许公式的正文范围转换,保留目标地址、标题和定义的语法;增加地址含转义括号的回归测试。证据:`.work/r84-r1-probe-tests.log` 的 `links_and_images_keep_their_addresses`、`.work/r84-r1-parser.log`。
|
||||||
|
|
||||||
|
4. `../Ely-GPUI-Components/src/documents/markdown.rs:62`:只要内容出现 `$` 就拒绝整对分隔符,连合法的 TeX 转义 `\$` 也拒绝。`\(\$5\)` 因此显示为普通文字 `($5)`,没有公式节点,而相同的 `\$5` 可由本项目的 RaTeX 正常排版。不符合 R8.4 的 `\(…\)` 支持。修正方向:按 TeX 的转义语义处理内容,不能用任意美元符号否决整对分隔符;覆盖含 `\$` 的行内与块公式。证据:`.work/r84-r1-probe-tests.log` 的 `escaped_dollar_is_valid_tex` 先确认排版成功,再在公式节点数量上失败。
|
||||||
|
|
||||||
|
5. `../Ely-GPUI-Components/src/documents/markdown.rs:56`:配对状态只在 LF 空行处清除,可以跨两个不同的 Markdown 块配对,且漏掉 CR 换行的空行。两项列表 `- \(a\n- b\)` 原本分别显示 `(a`、`b)`,现在分别显示 `$ a`、`b $`;`\(a\r\rb\)` 也会凭空出现美元符号。转换既未形成公式,又改变了普通文本。修正方向:按实际块边界限定配对范围,并使用 CommonMark 支持的 LF、CRLF、CR 换行规则;覆盖跨列表项和 CR 空行。证据:`.work/r84-r1-probe-tests.log` 的 `unrelated_blocks_do_not_acquire_dollars`、`.work/r84-r1-parser.log`。
|
||||||
|
|
||||||
|
6. `../Ely-GPUI-Components/src/documents/markdown.rs:44`:仅保护 `Html` 节点的标签字节,没有保护 HTML 代码标签的正文。`a <code>\(x\)</code> b` 中的代码内容被转换成公式节点,渲染时会排成公式,失去应展示的代码文字,与 `agents.md` 所称代码、HTML 中不转换不符。修正方向:识别并保留 HTML 代码内容的范围,使解析、可视显示与导出都保持代码语义;增加 `<code>` 内分隔符的回归测试。证据:`.work/r84-r1-probe-tests.log` 的 `html_code_stays_literal`。
|
||||||
|
|
||||||
|
7. `../Ely-GPUI-Components/src/documents/render/math_text.rs:187`:行内排版失败时直接丢弃 `MathError`,只记固定警告,界面保留着色 TeX 而没有错误原因或位置。例如 `$x^2^3$` 的错误本应是 `Double superscript at 3`,此分支不把它交给任何可见元素。违反 §14.2“语法错误显示原文与错误位置”,也违反不吞错的规则;块公式已有可见错误处理。修正方向:保留并展示行内公式的错误及位置,同时保留原文,并增加失败公式的可见错误断言;日志继续不含公式内容。
|
||||||
|
|
||||||
|
8. `../Ely-GPUI-Components/src/documents/tree/mod.rs:321`、`../Ely-GPUI-Components/src/typography/math.rs:196`:两条新增或改写的注释分别为 “Text split at its images; lone `$$` or `\[` math is block.” 和 “`svg`'s drawing under a root viewing `[left, top, w, h]` in px.”,按空白分词均为 12 个词,超过十词上限。修正方向:各缩至十词以内。
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
1. `../Ely-GPUI-Components/src/documents/tree/mod.rs:326`:块公式的判定检查整个段落是否以分隔符开头,漏掉 CommonMark 允许的段首空格。独占一段的 ` \[x\]` 因而读成 `Paragraph` 内的行内公式,而同样内容去掉一个空格即读成 `Math`,违反 R8.4 的块公式要求。修正方向:从公式节点的原文范围识别分隔符,正确处理段首一至三个空格,并补回归测试。实测:`.work/r84-r2-review/component-probes.log` 的 `review_r84_display_math_accepts_prose_indentation` 失败。
|
||||||
|
|
||||||
|
2. `../Ely-GPUI-Components/src/documents/markdown/tex.rs:100`:HTML 代码保护只记一个标签,遇到同名内层标签的关闭即清掉保护,外层仍未关闭。`a <code><code>\(x\)</code> \(y\)</code> b` 中的 `\(y\)` 被转成公式;组件读出的文字由 `a (x) (y) b` 变成 `a (x) y b`,并给 `y` 加上 `Math` 样式。这仍会把代码内容排成公式,违反 MARK-04 与 `agents.md` 的代码保护说明;第 1 轮第 6 项只修好了非嵌套情形。修正方向:按现有 HTML 读者的嵌套与闭合规则维护保护范围,覆盖嵌套的 `code`、`kbd`。实测:`.work/r84-r2-review/component-probes.log` 的 `review_r84_nested_code_stays_literal`、`review_r84_nested_code_keeps_its_text_and_styles` 均失败。
|
||||||
|
|
||||||
|
3. `../Ely-GPUI-Components/src/typography/math.rs:196`、`../Ely-GPUI-Components/src/documents/markdown/tex.rs:244`:注释 “`svg` drawn in a px root viewing `[left, top, w, h]`.” 与 “Restores a text's dollars; drops a parting space at its ends.” 按空白分词均为 11 词,仍超过十词上限;前者是第 1 轮第 8 项未修完的问题,后者为本轮新增。修正方向:各缩至十词以内。证据:`.work/r84-r2-review/rules.log`。
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
FAIL
|
||||||
|
|
||||||
|
1. `../Ely-GPUI-Components/src/documents/markdown/tex.rs:109`:代码保护的新栈只删除同名标签,没有遵循 `Reader::end` 的闭合与重开规则。`a <code><kbd>x</code> \(y\) b` 中,读者在 `</code>` 处同时结束不会重开的 `kbd`,其后的文字已是普通正文;保护栈却仍保留 `kbd`,把正文保护到段末,导致 `\(y\)` 不被识别为公式。实测可视读法为 `a x (y) b`、没有 `Math` 样式,纯文本导出也多出括号;`a <b><kbd>x</b> \(y\) b` 同样失败。违反 R8.4 与 MARK-04/11。修正方向:让保护范围与现有 HTML 读者采用相同的标签闭合、内层清理和重开规则,并覆盖交叉闭合后恢复公式识别的情形。证据:`.work/r84-r3-review/probe-tests.log` 中三个失败探针;第 2 轮的段首缩进与正常嵌套探针均已通过。
|
||||||
Vendored
BIN
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# ElyTable's grid follows the app's dark and light mode.
|
# ElyTable's cells stay white in dark and light mode.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
root=$(cd "$(dirname "$0")/../.." && pwd)
|
root=$(cd "$(dirname "$0")/../.." && pwd)
|
||||||
@@ -46,6 +46,6 @@ check dark "$(shade_of dark)"
|
|||||||
dark=$shade
|
dark=$shade
|
||||||
check light "$(shade_of light)"
|
check light "$(shade_of light)"
|
||||||
light=$shade
|
light=$shade
|
||||||
[ "$dark" -lt 80 ] || fail "the dark grid paints at $dark"
|
[ "$dark" -gt 200 ] || fail "the dark app's grid paints at $dark"
|
||||||
[ "$light" -gt 200 ] || fail "the light grid paints at $light"
|
[ "$light" -gt 200 ] || fail "the light app's grid paints at $light"
|
||||||
echo "ok: theme (dark $dark, light $light)"
|
echo "ok: theme (dark $dark, light $light)"
|
||||||
Reference in new issue
Block a user