Compare commits

..

250 Commits

Author SHA1 Message Date
ExPikaPaka 1f31b7593f Merge branch 'feature/wx-illustrated-tooltips' into feature/device-tooltips 2026-11-18 08:34:03 +01:00
ExPikaPaka 78dfd585f4 Merge branch 'feature/gizmo-toolbar-tooltips' into feature/wx-illustrated-tooltips 2026-11-18 08:33:58 +01:00
ExPikaPaka f17fdabeec Merge remote-tracking branch 'origin/main' into feature/gizmo-toolbar-tooltips 2026-11-18 08:33:58 +01:00
HanifKoh 4aaef535e6 Skip Arachne Toolpaths When the Voronoi Diagram Cannot Be Repaired (#17600)
* Skip Arachne Toolpaths When the Voronoi Diagram Cannot Be Repaired

When the Voronoi repair fails, the skeletal graph built from the
diagram has edges without twins, and the later stages dereference
them. Leave the graph empty and log an error instead, so that outline
gets no toolpaths rather than crashing the slice.

* Cast the Far Sliver Coordinates to `coord_t` in the Unrepairable Voronoi Test

On macOS int64_t is long long, so a literal of type long matched no Point constructor exactly and the call was ambiguous.
2026-11-18 14:04:54 +08:00
HanifKoh d3992c2288 Bound Out-of-Range filament_map and physical_extruder_map Values (#17476)
* Treat a filament_map Nozzle Outside the Printer as Nozzle 1

A filament_map entry of 0, a negative number or a number above the
nozzle count made Extruder::extruder_id() wrap or run past the end, and
print_machine_envelope then took the std::max over the per-extruder
machine limits out of bounds on a flavour that emits them.

Print::apply now treats an entry outside [1, nozzle count] as nozzle 1,
before the variant expansion and the config snapshot, and logs it once.
After the clamp the slicing engine only sees in-range values. It works
on this print's copy of the config; readers of the plate or project
config are not changed, and in-range maps are left alone.

* Skip a physical_extruder_map Entry Outside the Per-Nozzle Table on Export

The first-filament table built for the start G-code is sized by the
nozzle count, and the export wrote it at the index named by
physical_extruder_map. An entry outside that range corrupted the heap,
and a negative one aborted or hung the export.

The value is a firmware tool number that is also emitted elsewhere, so
it is left as it is; only the write into the table is bounded.

* Treat a filament_map Nozzle Outside the Printer as Nozzle 1 in the CLI

With --filament-map-mode Manual on a multi-nozzle profile, the CLI
indexed the per-nozzle unprintable-filament sets, and shifted the
per-filament printable status, with the raw filament_map value. A value
of 0, a negative number or one above the nozzle count read out of bounds
and crashed before the print was configured.

The checks now use a local copy of the map in which an entry outside
[1, nozzle count] is nozzle 1, the same policy Print::apply applies.
In-range maps are unchanged.
2026-11-18 14:04:32 +08:00
HanifKoh 8ebb0a9a2b Stop Arachne's Outline Simplification From Placing Vertices Metres Away (#17599)
simplify() may move a vertex to the intersection of its neighbouring
lines, guarded by a check that the point stays near them. The check
squared the distance in int64, which overflows when nearly parallel
lines meet more than about 3 m away, so the far point was accepted.
The broken outline gave a Voronoi diagram the repair could not fix,
and SkeletalTrapezoidation then dereferenced an edge without a twin.

Compute the squared distances in double.
2026-11-18 12:58:45 +08:00
Kris Austin 428a8fcc91 Arrange items almost as wide as the bed again (#17416)
* Arrange items almost as wide as the bed again

An arrange spacing lets a rectangular bed grow by the part of the spacing
past every item's brim or tree support, the way printing by object
already grows it. The spacing is kept in full and a part that fits the
bed is not refused for it. The bed does not grow when an item that can
be placed would keep less inflation than the growth, beyond the EPSILON
slack, so a part that fills the bed may sit up to EPSILON past its edge,
within BuildVolume::BedEpsilon. A round bed never grows for a spacing,
since moving its points along each axis would grow it unevenly.

The cap on an item's inflation measures the item as the nester packs it,
inflated with square joins and turned, so it holds for an item turned to
the Y axis or by hand, and it leaves room for the skirt. An item too big
for the bed keeps its full inflation, so it is still refused on a grown
bed, and it no longer sets the bed margin given back to the other items.
Printing by object, this keeps the 5 mm margin for the placed objects
when another one is refused.

The arrange bed keeps EPSILON on each side of the largest item for every
print sequence, since the nester cannot place an item beside one that
fills the bed exactly.

The skirt room reads a percent first layer line width against the
nozzle diameter instead of as millimeters, and accepts a width stored as
a plain number.

update_arrange_items() runs the arrange setup in the order it depends on
for the arrange job and the CLI.

* Arrange items the nester has to turn

With rotations allowed the nester turns an item that does not fit as it
lies, even onto the bed's diagonal, so no item counts as too big. An item
that has to turn is measured at an angle where it fits along the bed's
axes, if there is one, so it keeps its spacing.
2026-11-17 22:07:31 -06:00
Ian Bassi 12c9ee813b Brim filament for features (#17655) 2026-11-17 21:58:49 -03:00
Ian Bassi 8b3de0be86 Sparse infill strategy selector (#17645)
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-11-17 21:16:40 -03:00
Lam Wei Lun 07f38df2a4 Fix top surface printing over inner walls with only one wall on top (#17597)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-11-17 14:39:16 -03:00
Ian Bassi e76b4d676c Split smoothed infill corners no finer than 5 microns (#17630) 2026-11-17 09:54:18 -03:00
Ian Bassi 745207d3e3 Choose the filament each calibration prints with (#17621) 2026-11-17 08:36:13 -03:00
HanifKoh 47c67e1c44 Hide a Plugin Page When the Overflow Tab Swaps It Out (#17626) 2026-11-17 16:45:26 +08:00
Ian Chua 0ab2785f6d feat: keep plugins activated/deactivated based on pre-update state (#17473)
* feat: keep plugins activated/deactivated based on pre-update state

* fix: preserve plugin capability choices across updates

Cloud plugin replacement resets the install-state sidecar, which silently
re-enabled capabilities the user had disabled. Snapshot the installed sidecar
before replacing the package, then write the pre-update capability choices and
activation intent back after the install. Permissions stay cleared so the new
package must request them again, and the reload now waits until that state is
persisted.

Add regression tests for updating both an active and a deactivated cloud
plugin.

* fix: roll back a failed plugin update and keep the old package usable

Download the replacement before unloading or deleting the installed package, so
a download failure leaves the old package and its sidecar untouched. Refuse to
replace a package whose sidecar exists but cannot be read, rather than resetting
the user's capability choices and grants.

Extract the install-from-package step so the updater can reuse it. When the
install fails, restore the previous sidecar (activation intent, capability
choices and grants) that the unload step overwrote, and reload the old package
if it was active. Keep a stale package from another cloud directory until the
new one is committed.

In install_plugin, use one rollback helper for every failure path and give
backups a "__" prefix so an abandoned backup is never discovered as a plugin.

Add regression tests for failed download and failed install.

* fix: prevent a plugin load and an update from racing

Claim a plugin key for the duration of update_cloud_plugin under m_mutex, and
make load_plugin refuse a key that an update owns. An update that starts while
a load is still running now fails with a clear error instead of unloading the
package underneath the loader; the claim is released before the replacement is
reloaded and on every failure path.

Keep the dialog's Update button disabled while the selected plugin is loading,
so the UI cannot start an update the manager would refuse. Add a JavaScript
test for the button state and a C++ test for the load refusal and claim
release.

* fix: clang-tidy

* fix: plugin update safety and simplify state handling

* fix: plugin update rollback and error reporting

* refactor: simplify plugin update state handling and tests

* fix: avoid marking plugins as errored on update conflicts
2026-11-17 16:36:52 +08:00
ExPikaPaka bfe8dac758 Merge branch 'feature/wx-illustrated-tooltips' into feature/device-tooltips 2026-11-17 07:50:00 +01:00
ExPikaPaka 922f3d0a4a Merge branch 'feature/gizmo-toolbar-tooltips' into feature/wx-illustrated-tooltips 2026-11-17 07:49:56 +01:00
ExPikaPaka ed28dc5e8f Merge remote-tracking branch 'origin/main' into feature/gizmo-toolbar-tooltips
# Conflicts:
#	src/slic3r/GUI/Gizmos/GLGizmoCut.cpp
2026-11-17 07:49:56 +01:00
Ian Chua 0aa479f27c fix: overlapping permission dialogs (#17318)
* fix: queue permissions dialogs

* fix: serialize plugin permission dialogs across prompt types

* fix: unit tests

* fix: move audit prompt stuff to PluginAuditManager

* fix: discard pending permission requests when plugin load is cancelled

* fix: simplify audit prompt cancellation and align denial tests with prod

* fix: queued permission prompts lost after plugin load failure
2026-11-17 14:33:17 +08:00
AsTechEvolves 4c714ac95e Show the Orca logo instead of Bambu's camera placeholder for non-Bambu printers (#17524)
* IMPROVEMENT - show the Orca logo instead of Bambu's placeholder before a non-Bambu printer's camera plays in MediaPlayCtrl and wxMediaCtrl3

* IMPROVEMENT - pick the camera placeholder from image files in MediaPlayCtrl: Bambu's as live_stream_bambu.png for Bambu presets, Orca's as live_stream_default.png for the rest, set when the view is shown
2026-11-17 14:30:07 +08:00
Ian Chua 9232613297 fix: nozzle sync table flash and white box (#17607)
* fix: nozzle table height measurement before dialog layout

* fix: white flash when nozzle list table loads
2026-11-17 14:28:08 +08:00
ExPikaPaka 5348c2f0d8 Merge branch 'feature/wx-illustrated-tooltips' into feature/device-tooltips 2026-11-17 07:07:41 +01:00
ExPikaPaka 145cfc8708 Open a Wayland tooltip at its own size, not the previous one's
wxPopupWindow::SetSize() on GTK only requests a size, which the GDK window gets
later, while the xdg_popup takes the size the window has when it maps. A tooltip
placed beside its dialog therefore opened at the size of the tooltip before it,
cut off or with empty space under it. Resize the GDK window before it maps.
2026-11-17 07:07:37 +01:00
ExPikaPaka f4b2568666 Merge branch 'feature/wx-illustrated-tooltips' into feature/device-tooltips 2026-11-17 06:55:57 +01:00
ExPikaPaka f9e02c916b Leave the wx tooltips without pictures when the preference says so
The popup does not ask a tooltip's TipMediaSource while show_tooltip_pictures is
off, so a setting's pictures are not looked up either.
2026-11-17 06:55:33 +01:00
ExPikaPaka 447b17b470 Merge branch 'feature/gizmo-toolbar-tooltips' into feature/wx-illustrated-tooltips
# Conflicts:
#	docs/HLSD/tooltip-illustrations.md
2026-11-17 06:55:33 +01:00
ExPikaPaka 2de51f343f Add a preference to show tooltips without their pictures
"Show pictures in tooltips" (show_tooltip_pictures, on by default) leaves every
illustrated tooltip as its text alone, in the same place and with the same delay.
Nothing is decoded while it is off.
2026-11-17 06:54:21 +01:00
Kiss Lorand 32f6db87e8 Fix validation of legacy bed exclusion areas (#17618) 2026-11-17 10:20:41 +08:00
HanifKoh 5841f9652d Skip Empty Test Result Publishes and Unrelated Labels in Optional Builds (#17602) 2026-11-17 07:44:59 +08:00
Kiss Lorand 9cdaaedad7 Fix Measure geometry after nonuniform scaling (#17549) 2026-11-16 18:35:55 -03:00
Ian Bassi c49e32c1e7 Set feature speeds in mm³/s or % of max volumetric speed (#16299) 2026-11-16 17:55:09 -03:00
HanifKoh 59acdedd06 Keep Heavy Boost and Plugin Headers Out of Widely Included Headers (#17494)
* Keep Heavy Boost and Plugin Headers Out of Widely Included Headers

Several headers that most of the code includes pulled in large libraries they barely use, so hundreds of files compiled them for nothing:

- Point.hpp, Line.hpp, Polygon.hpp and ExPolygon.hpp included all of Boost.Polygon to declare traits. Point and Line now include only the concept headers they need, and the polygon traits move to BoostPolygonTraits.hpp, included by BridgeDetector.cpp, the one file that runs Boost.Polygon algorithms on polygons.
- ProjectTask.hpp included Boost.Thread and the filesystem streams but only uses boost::filesystem::path.
- Utils.hpp included Boost.DateTime for one inline function, which moves to utils.cpp.
- Semver.hpp used boost::format for two version strings; std::to_string prints the same.
- MainFrame.hpp held PluginPages by value, which brought in the web view and plugin headers; it now holds it by unique_ptr.
- Model.hpp included STEP.hpp, and with it OpenCASCADE, for a forward-declarable type and two typedefs.

Files that relied on these headers arriving indirectly now include what they use.

* Include What the Polygon Traits and the End-Time Helper Use

* Drop Two Unneeded Includes and Include the Filesystem Directory Header
2026-11-16 19:30:35 +08:00
Ian Chua 4b161be150 fix: prevent oversized AMS mapping popup on Wayland (#17606) 2026-11-16 18:55:18 +08:00
HanifKoh baeadeb3e1 Build the Windows Installer While the Zip and PDB Archive Are Packed (#17484)
cpack now runs in the background while the portable zip and the PDB archive are packed, and a later step waits for it, prints its log and fails on its exit code. makensis compresses on one core, so the two archive steps no longer add to the job's length.
2026-11-16 18:07:36 +08:00
HanifKoh e0f7f0b7ee Work Around the MSVC 14.52 ARM64 Internal Compiler Error in OCCT (#17601)
The windows-11-vs2026-arm runner image 20261112.217.1 moved from MSVC 14.51 to 14.52, and its cl.exe crashes with C1001 while optimizing OCCT's BRepGraph_LayerTopoSupplement.cxx. clang-cl builds compile OCCT with cl on ARM64, so every Windows arm64 deps build on that image fails.

A second OCCT patch compiles that one file without optimization when the compiler is cl targeting ARM64. Other compilers and architectures see no change.
2026-11-16 15:35:35 +08:00
Ian Chua d6ec712c2e fix: windows plugin update deletion failure (#17462)
* fix: windows plugin update deletion failure

* fix: retry transient Windows plugin deletion failures
2026-11-16 13:54:55 +08:00
HanifKoh 191760b5cb Ship the Linux Preset Caches Before Packing the AppImage (#17485) 2026-11-16 13:49:03 +08:00
HanifKoh cbf282e6b3 Sign Each Windows Binary Once and Keep the Signed NSIS Plugins (#17483) 2026-11-16 13:37:02 +08:00
yw4z ff93256eff LabeledCheckBox class (#15761)
* init

* extend feature set

* update

* fix tidy

* fix tidy

* Update calib_dlg.cpp

* simplify class

* update

* align labels with RadioGroup

* replace ImportCheckBox

* Update LabeledCheckBox.cpp

* apply to more dialog

* add to ai skills

* update

* fix Tooltip only reaches the children on the first call

* fix Label can stay grey after a theme switch

* Update release dialog

* change focus target for all platforms

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
2026-11-16 11:24:56 +08:00
yw4z f5305fa542 Remove the unused NanoSVG deps recipe (#17583) 2026-11-15 19:12:49 -03:00
Kiss Lorand 87fb987668 Fix part deformation in Assembly Parallel operation (#17552) 2026-11-15 15:52:34 -03:00
Noisyfox b4a9565dee Round mixed filament row corners (#17561) 2026-11-15 11:52:27 -03:00
Rodrigo Faselli 0e8e95d516 Fix Crash (access violation) instead of the "empty first layer" (#17565) 2026-11-15 11:51:10 -03:00
Ian Bassi 8b8d573a85 Keep Outer Walls Out of the Resonance Avoidance Range in the Layer Cooling Slowdown (#17534) 2026-11-15 11:29:03 -03:00
Ian Bassi ebfce227c6 Copy the Python runtime only when it changes, and use thin archives with clang-cl (#17511) 2026-11-15 11:07:56 -03:00
Ian Bassi 8a1cef365e Time Layer Cooling With Acceleration, as the Preview Does (#17540) 2026-11-15 10:47:57 -03:00
Antoine 3bfabc9831 Fix Ankermake M5/M5C printing time (#17548)
The Anker file header wrote `;TIME:{print_time_sec}s`. print_time_sec
is only the seconds part of the estimate (0 to 59), so the M5, M5
All-Metal and M5C were told every print takes under a minute. Use
print_time_total_sec, the whole estimate in seconds, and drop the `s`.
2026-11-14 11:15:28 -06:00
Kris Austin 9921437c27 Fail tests whose sections assert nothing (#17420)
tests/CATCH2.md says to run the suites with `--order rand --warn
NoAssertions`. On main that fails in fff_print (8 test cases), libslic3r
(15), sla_print (1) and slic3rutils (4), even when each case runs alone.
ctest never passed the flag, so nothing stopped new ones. Most of these
tests have SECTIONs that only set up state, with the assertions after
them, or generated cases that return early for combinations that don't
apply. Catch2 counts assertions per section, so each of those reads as
an empty test.

Where only a value or a short setup changes, use GENERATE or a table and
generate only the combinations that apply. Elsewhere, end each section
with a call to a local check. ctest now passes `--warn NoAssertions`, so
CI fails a case or section that asserts nothing, and tests/AGENTS.md
says so. ctest also passes the CATCH_EXTRA_ARGS cache variable, which
nothing read before, split like a command line, so setting it now takes
effect.

Three tests only wrote a debug mesh or diagram and asserted nothing.
They now check that the Voronoi diagram of the six points is complete,
that hollowing with hfRemoveInsideTriangles removes at least half of the
roughly 400 mm² of the two spheres that lies deeper than the wall, and
that the half cone is closed. The legacy 3MF scenario checked for a
volume map on every plate of a file that has none, so it now also saves
and loads a project with a plate, and its name says so.
2026-11-14 10:47:42 -06:00
Kris Austin bf1fb93b78 Use WebKit's Shared-Memory Transport on Wayland Outside the Flatpak (#17399)
* Use WebKit's shared-memory transport on Wayland outside the Flatpak

In a Wayland session, the hardware DMABUF path of Ubuntu's WebKitGTK 2.52
on Intel GPUs froze the Preview, Device and Project tabs and left the 3D
view drawn over other pages. On the default path of a build with EGL,
outside the Flatpak, set WEBKIT_DMABUF_RENDERER_FORCE_SHM=1, as Orca
already does for NVIDIA and virtual machines, so compositing stays on.
WebKitGTK 2.42 and 2.43 have the DMABUF renderer but ignore that switch,
so they get WEBKIT_DISABLE_COMPOSITING_MODE=1 instead. The Flatpak's
runtime WebKitGTK works, so it keeps the hardware path.

A Wayland session is detected by wayland_socket_available(), which looks
for the socket the way wl_display_connect(NULL) does. The no-EGL fallback
and the GUI start-up check use it too, so all three agree with GTK.
is_running_in_flatpak() checks only /.flatpak-info, because a host process
started from a Flatpak can inherit FLATPAK_ID; the data-dir migration and
the Troubleshoot dialog now use it. Both helpers live in libslic3r/Utils
and have unit tests.

Fixes #17381

* Note that Debian's WebKitGTK 2.54 on AMD freezes too
2026-11-14 10:46:49 -06:00
Kris Austin 33c07cc74d Fix overlapping text under "Check the reason" on macOS (#17366)
The error panel that "Check the reason" opens in the print, send,
calibration and bind dialogs is a scrolled window with a fixed size.
It starts hidden, and showing it gives it the size it already had.
macOS only sends a size event when the size changes, so the panel
never laid out its rows and drew them all at its top-left corner.
Lay the panel out when it opens.

Fixes #17065
2026-11-14 10:46:32 -06:00
Rodrigo Faselli 6268535d2f Multiline rectilinear infill optimization (#17547) 2026-11-14 11:33:39 -03:00
Damir Galeev 82135af6ff Fix seam dents caused by skipped retraction after outer wall (#16982)
Co-authored-by: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com>
2026-11-14 11:30:49 -03:00
Hanif Koh 87cf1429ca Keep Every Overhang That Joins a Tree Support Cluster on the Same Layer
An overhang cluster stored one overhang per layer, so a second overhang
joining the cluster on a layer it already had was dropped and got no tree
support. Store every overhang of the layer, as BambuStudio does since
adb3fbcfc.
2026-11-14 16:06:46 +08:00
SoftFever b4fdf51179 Allow more than one release publisher (#17546) 2026-11-14 03:26:21 +08:00
yw4z 9a285770d4 Variable layer height: allow painting directly on objects (#17471)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-11-13 16:24:14 -03:00
Rodrigo Faselli 5d69ba055f Round top canvas toolbar corners (#17491) 2026-11-13 15:26:54 -03:00
Joseph Robertson 3936cd5f6a Fix black scene cache and FXAA frames under VirtualGL (#17508) 2026-11-13 15:00:05 -03:00
Ian Bassi 36815b4f03 Stop Feed-Rate-Only Lines From Counting as Extrusion in the Layer Cooling Slowdown (#17535) 2026-11-13 11:09:33 -03:00
HanifKoh 71c9f556f0 Fix the Crash When Editing an Object's Speed on a Printer Without a Matching Variant (#17529)
A process whose print_extruder_variant has no entry for the printer's extruder type and nozzle volume (a Bowden
printer with a "Direct Drive Standard" process, or a bare "Bowden" variant) made Tab::switch_excluder return
before it mapped the page's variant fields. Editing a per-variant option on the Objects tab then read the end of
that empty map in TabPrintModel::on_value_change and crashed with std::bad_alloc.

switch_excluder now falls back to the extruder's first variant through find_variant_index, as slicing does,
and logs it; get_index_for_extruder keeps returning -1 for its other callers. on_value_change checks the map
lookup and otherwise takes the index from the field id.
2026-11-13 16:00:08 +08:00
HanifKoh 2c50d15451 Skip the Final Wipe-Tower Unload on Toolchangers When the Tower Stops Short (#17496)
The short-tower final unload is only needed on single-extruder MMU printers, which have to pull the
last filament out. Without SEMM the final purge only rams, with no retraction or parking, so a
toolchanger whose filament has multitool ramming on printed those lines in mid-air above the tower.
Generate it for SEMM only.
2026-11-13 12:59:41 +08:00
Eric Lin 7c76be2ebc Fix CLI crash when filament presets set no diameter (#16911)
Since #16867 pads filament_colour to the filament count, every CLI run that loads filament presets without a colour recomputes the flush matrix. Standalone filament presets may omit the per-filament keys that block reads. A missing filament_diameter crashed the CLI, and a short filament_is_support failed the size check.

Grow both to the filament count before the recompute. A missing diameter follows the first filament, as get_at() reads it. A missing support flag is off.

get_min_flush_volumes() also read past the end of filament_long_retractions_when_cut and filament_retraction_distances_when_cut when a filament omitted them. Pad both with the first filament's value, so the flush matrix matches the print.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-12 18:45:38 -06:00
yw4z 30da6fd145 Add SLIC3R_OPENVDB option to build without OpenVDB (#17401)
OpenVDB, Blosc and OpenEXR are no longer built or searched for by default. Only SLA hollowing uses them, and SLA printing can't be reached in OrcaSlicer. Configure both the deps and the app with `-DSLIC3R_OPENVDB=ON` to build them again.

Without OpenVDB, `sla::generate_interior()` logs a warning and returns an empty interior, and the hollowed-cube SLA test is skipped. The Flatpak manifest no longer downloads the three source archives.
2026-11-12 18:15:26 -06:00
Damir Galeev 97bf1f4d1d Fix missing seam markers in the preview on overhanging outer walls (#16296)
* Fix missing seam markers in the preview on overhanging outer walls

An outer wall that starts on an overhang is labelled "Overhang wall" in
G-code, like the overhanging part of an inner wall, so the preview's seam
detector never opened a candidate for it.

The G-code generator now writes one comment, OUTER_OVERHANG_WALL, before
such a wall. The detector reads it and treats that wall as an outer wall
for seam detection only, so extrusion roles, legend and colours stay the
same. Markers also appear in G-code opened from a file.

* Share the outer wall check and drop the sloped seam test variant

A loop that starts on an overhang never gets a scarf seam, so the tagged
stream with a sloped start could not be generated. The outer wall check
used by the G-code generator and SeamPlacer moves to is_outer_wall(), and
the generator runs it last, after the cheap conditions.
2026-11-13 02:55:16 +08:00
TheLegendTubaGuy 4b21b29cd2 Add a Reload from Disk Keyboard Shortcut (#17373) 2026-11-12 13:30:35 -03:00
Kris Austin 93941dc34e Add tests that pin the infill rotation template output (#17418) 2026-11-12 11:07:26 -03:00
Ian Bassi db9968b9ee Painted modifiers (#16213) 2026-11-12 10:38:03 -03:00
Noisyfox 47a17ad9a3 Fix Cut gizmo empty-space right clicks and Reset availability (#17200)
* Fix empty-space right clicks entering cut part selection

Return whether a cut part was hit and discard only a newly initialized part selection on a miss. Preserve existing grouping and skip connector updates when nothing was hit.

Validation: RelWithDebInfo build passed. GUI checked right clicks on empty plate and outside plate preserve preview and an enabled, checked Cut to parts option; an empty click preserves existing grouping.

Local clang-tidy is blocked by wx/msw/wrapcctl.h HDITEM errors also reproduced on the unchanged baseline.

* Enable Cut Reset while part selection is active

Treat active part selection as resettable state even when the plane remains centered and there are no connectors. Reuse reset_cut_plane to clear grouping and restore model rendering.

Validation: RelWithDebInfo build passed. GUI verified actual part selection enables Reset; Reset restores the initial preview and Cut to parts; performing Cut to parts then produces Cube_A and Cube_B under one Cube object.

Local clang-tidy remains blocked by baseline wxWidgets HDITEM errors.

* Avoid rebuilding cut parts for empty-space right clicks

Query the selected volumes' existing original-mesh raycasters before initializing part selection. Use world transforms and ignore cut-plane clipping. Fall back to the existing cut-part test if an original raycaster is unavailable, and retain the final hit/miss cleanup.

Validation: existing RelWithDebInfo build and diff check passed. GUI tested a 262144-triangle torus: five outside clicks and five hole clicks added no cut trace records; actual part clicks built selection, existing grouping survived hole clicks, Reset recovered normal cutting, and Cut to parts produced A/B volumes under one object. Full right-drag gestures and macOS/Linux were not tested. Local clang-tidy remains blocked by baseline wxWidgets HDITEM errors.

* Skip empty undo snapshots when resetting only cut grouping

Create the scoped Reset Cut snapshot only when the plane differs from its initial state or connectors will be removed. Part selection is not serialized, so clearing it alone must not add an ineffective undo entry.

Validation: existing RelWithDebInfo build and diff check passed. GUI and trace logs confirmed grouping-only Reset creates no Reset Cut snapshot, a plane Reset remains undoable from 17.5 mm back to 22.5 mm, and connector-only Reset remains undoable. Local clang-tidy remains blocked by baseline wxWidgets HDITEM errors.

* Clarify Cut Reset tooltip includes part assignments

Describe the cutting plane, connector removal, and part-assignment reset in one translatable message. Add a translator comment explaining the assignments.

Validation: git diff --check passed. Full gettext extraction, merging, and compilation passed for all 23 catalogs in an isolated validation workspace.

---------

Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-11-12 14:29:22 +03:00
yw4z 9e554377a0 Draw g-code marker tilted for belt printers (#17427)
* init

* update

* fix tilt for decoupled frames
2026-11-12 13:58:16 +03:00
ExPikaPaka b41f0bd84a Merge branch 'feature/wx-illustrated-tooltips' into feature/device-tooltips 2026-11-12 09:35:19 +01:00
ExPikaPaka cb97e6ce7e Include IllustratedTipPopup.hpp in AccessibilityMac.mm
The macOS accessibility bridge calls illustrated_tooltip_text() but did not include its header, so the macOS build failed with no member named illustrated_tooltip_text.
2026-11-12 09:35:19 +01:00
ExPikaPaka c631144575 Merge branch 'feature/wx-illustrated-tooltips' into feature/device-tooltips 2026-11-12 08:37:04 +01:00
ExPikaPaka 49d92a1fa0 Declare m_wayland_by_rect only on GTK
It is read and written only in GTK code, so clang-cl on Windows rejected it as an unused private field under -Werror.
2026-11-12 08:37:03 +01:00
ExPikaPaka 8cc9204aa3 Merge branch 'feature/wx-illustrated-tooltips' into feature/device-tooltips 2026-11-12 08:26:15 +01:00
ExPikaPaka eddace024e Put a dialog's tooltip beside the dialog on Wayland too
A tooltip is kept inside its window on Wayland, where the screen is
unknown, so in a small dialog (the calibration dialogs) it went under the
control, over the next rows. When a dialog has no room for it inside,
the popup now asks the compositor to place it to the right of the
dialog, or to the left when the right has no room.
2026-11-12 08:19:16 +01:00
ExPikaPaka a2493b1c9f Merge branch 'feature/wx-illustrated-tooltips' into feature/device-tooltips 2026-11-12 07:58:32 +01:00
ExPikaPaka 6574dde677 Include what the multi-device send page tooltips use 2026-11-12 07:58:31 +01:00
ExPikaPaka c0dc3f795c Merge branch 'feature/gizmo-toolbar-tooltips' into feature/wx-illustrated-tooltips 2026-11-12 07:58:21 +01:00
ExPikaPaka d35c690f10 Put a settings tooltip beside the page's controls in a window of its own
In the printer and filament settings windows the page spans the window,
so no column matched and the tooltip went over or under the control,
covering the rows around it. On Wayland it cannot go beside the window
either. It now goes to the right of the page's column of controls,
level with the control, when the window leaves room there.

Also add the includes clang-tidy found missing.
2026-11-12 07:58:21 +01:00
ExPikaPaka 5a62a830d7 Merge remote-tracking branch 'origin/main' into feature/gizmo-toolbar-tooltips 2026-11-12 07:58:20 +01:00
ExPikaPaka b74c292ba9 Show the slider's pictures on the Brim Ears value boxes too, and include what the tooltips use
The value box beside each Brim Ears slider repeated the slider's tooltip
without its pictures, so the same setting looked different depending on
which half of the row the pointer was on.

Also add the includes clang-tidy found missing in the files the tooltips
changed.
2026-11-12 07:58:20 +01:00
ExPikaPaka d80f817b04 Merge branch 'feature/wx-illustrated-tooltips' into feature/device-tooltips 2026-11-12 07:38:12 +01:00
ExPikaPaka 9cfe72a798 Merge branch 'feature/gizmo-toolbar-tooltips' into feature/wx-illustrated-tooltips 2026-11-12 07:38:11 +01:00
HanifKoh 7cb97a82de Ignore Modifiers When Focus Mode Decides Which Plate an Object Is On (#17474)
Focus mode hid an object only when its footprint missed the current plate, and the footprint included its modifiers, negative volumes and support enforcers/blockers. A large modifier reaching over another plate kept the object drawn there. Build the footprint from the model parts only, as plate membership does.
2026-11-12 14:31:12 +08:00
HanifKoh 6352952e38 Leave Object Files and Precompiled Headers Out of the Test Artifacts (#17486)
The unit test archives packed the whole tests build tree, including every CMakeFiles directory: object files and, on Linux and macOS, about 200 MB per precompiled header. ctest needs none of it. Leaving those directories out shrinks the archive each build uploads and each test job downloads and unpacks. Pack and unpack quietly too: tar -v printed one line per file.
2026-11-12 14:30:29 +08:00
HanifKoh f8a2e3d896 Build Windows x64 With cl.exe on the build-windows-msvc Label (#17205)
* Build Windows x64 With cl.exe on the build-windows-msvc Label

CI compiles Windows with clang-cl, so an error only cl.exe reports, such as a
class template's virtual members instantiated with the class where clang
defers, reaches main unseen. The build-windows-msvc label gives a pull
request a cl build of x64 that only compiles: build_orca.yml's Windows
packaging, uploads and deploys belong to the clang build, the one that
ships, and the compiler cache is left out, as the Visual Studio generator
takes no launcher. No push build saves a cl deps cache, so a pull request's
first such build builds the deps too.

* Upload the cl.exe Build's Portable Build, Installer and PDB

Under _msvc names, through the arch suffix build_orca.yml already puts in the
artifact names, so a tester can tell them from the clang build's. The clang
build stays the one tested, checked for throw info, packaged for the Store
and deployed.

* Leave the MSVC Build Out of build-all

build-all stands for the three builds every pull request once got. The MSVC
build is another compiler's, never one a pull request got, and the first one
builds the deps too, so a pull request asking for an Intel Mac DMG with
build-all should not wait on it. pick takes a fourth argument that says
whether build-all covers the build; the three existing lines leave it at the
default.
2026-11-12 14:29:26 +08:00
HanifKoh a4de8cb891 Build the Flatpak, macOS x86_64 and Windows arm64 for Pull Requests on Request (#17202)
* Move the Flatpak Jobs Into a Reusable Workflow

build_flatpak.yml holds the Flatpak build and its two sandbox unit-test jobs, moved verbatim, so a second workflow can call them. Build all calls it for every event it built the Flatpak for before.

* Build the Flatpak, macOS x86_64 and Windows arm64 for Pull Requests on Request

Build all no longer builds them for a pull request: the Flatpak is the slowest
Linux leg, a macOS x86_64 build holds one of the few hosted macOS runners for
an hour, and Windows arm64 doubles the Windows legs. Pushes, the nightly and
dispatches still build everything, and a pull request's macOS arm64 build ships
as its own DMG in place of the universal one.

The new build_optional.yml builds them on a label (build-flatpak,
build-macos-x86_64, build-windows-arm64), from when it is added and on every
later push, and builds the Flatpak and Windows arm64 without a label when the
pull request changes anything outside the sources, tests, profiles,
translations and docs, which is where what breaks only those legs lives. Each
build keeps its own concurrency group, which cancel_closed_pr_builds.yml joins.

The macOS admission script now counts the macOS jobs of both workflows, and
build_check_cache.yml names the workflows in its env instead of deriving one
from the caller. The label bot lets a contributor ask for the Flatpak.

* Run the Windows Build Script Tests Only When a Pull Request Changes Them

The three suites build their own fixtures and read nothing else from the
tree, so on a pull request a short Linux job looks for a change to the scripts
or the suites first, and the Windows builds accept the skipped job. Pushes and
the nightly still run them every time.

* Read WORKFLOW Through a Checked Expansion

Shellcheck's SC2153 takes a bare uppercase reference next to the lowercase variable for a misspelling.

* Let the Pull Request Author Ask for Any Optional Build Through the Bot

GitHub starts no workflow from an event the job's own token causes, so the
label bot mints a GitHub App installation token when the app's secrets exist
and adds the build-* labels with it; without them the build starts with the
next push. The run a label starts is an ordinary pull_request run, so a first
pull request's waits for a maintainer's approval as Build all does.

* Build Everything the Labels Ask for in Every Optional Builds Run

Each label added starts a run of its own, and the pull request's checks show
the newest run only, so a run that built its own label's leg alone left the
others looking skipped. Every run now builds everything the labels and the
changed files ask for; the concurrency group of each build cancels the one an
earlier run of the commit started, so the newest run ends with them all.

* Filter Optional Builds Like Build All and Add a build-all Label

The workflow takes Build all's pull_request paths plus the Flatpak packaging,
so a pull request Build all skips, one that only changes an unrelated
workflow or script, gets no optional build and starts none on a label. The
build-all label asks for every optional build at once.

* Keep the Flatpak on Every Pull Request

flatpak-builder compiles with the GNOME SDK's default flags, which include
-D_GLIBCXX_ASSERTIONS, so the Flatpak's unit tests are the only pull request
check that aborts on an out-of-range vector access where the other legs'
Release builds read garbage and pass. Since August that caught four bugs
that changed only src/, tests/ or resources/, which the infra rule would not
have built, and the leg runs on hosted Linux runners, so gating it freed no
macOS runner. Build all calls build_flatpak.yml on pull requests again; the
optional builds are the macOS x86_64 and Windows arm64 ones, and build-all
means those two.

* Revert "Keep the Flatpak on Every Pull Request"

This reverts commit 998e31a99b.

The Flatpak stays behind the build-flatpak label and the infra rule, as
the maintainers prefer.

* Build the Linux Legs With libstdc++'s Assertions

flatpak-builder compiles with the GNOME SDK's default flags, which include
-D_GLIBCXX_ASSERTIONS, so the Flatpak's unit tests were the only pull
request check that aborts on an out-of-range vector access where the other
legs' Release builds read garbage and pass. Pull requests build the Flatpak
on request only now. SLIC3R_GLIBCXX_ASSERTIONS defines the macro for the
OrcaSlicer build, and the Linux legs turn it on, so every pull request keeps
those checks on a leg that always runs. The checks are libstdc++'s
lightweight subset: no class changes layout, so the prebuilt deps link as
they are.
2026-11-12 14:29:26 +08:00
HanifKoh 2d7b0e1c6d Slice Each Final Configuration Once in the Surface Centering Test (#17481)
The test compared every one of its 216 combinations against a fresh slice of the final settings, but those settings take only 72 distinct values. Keep each fresh slice and reuse it, which cuts the test's slices from 648 to 504 with the same checks.
2026-11-12 14:19:20 +08:00
HanifKoh 18ac48ed96 Skip the Clipper2 Intersection Sort When No Edges Crossed (#17384)
BuildIntersectList() merge-sorts the active edges by their new x to find crossings. Most scanbeams have no crossing, so AdjustCurrXAndCopyToSEL() now reports whether the edges stayed in order and the sort is skipped when they did.
2026-11-12 13:59:49 +08:00
Rodrigo Faselli 0291395132 Place Separate Objects Side by Side in the Assembly View (#17386) 2026-11-11 19:32:58 -03:00
Rodrigo Faselli ec1b800e23 Round the corners of input boxes and dropdowns (#17393)
Co-authored-by: Ian Bassi <12130714+ianalexis@users.noreply.github.com>
2026-11-11 19:32:14 -03:00
Ian Bassi 34de2b49df Copy per-nozzle settings to every tool of a toolchanger, and choose which unsaved changes to keep (#17461)
Co-authored-by: raistlin7447 <kris.austin@gmail.com>
2026-11-11 19:18:28 -03:00
Arthur Porto 32dbacb423 Variable layer height on several objects, and with the prime tower on objects of different heights (#16462)
* Variable layer height on several objects, and with the prime tower on objects of different heights

The variable layer height tool now opens with several objects selected.
Adaptive, Smooth, Reset and manual edits apply to all of them: they share one
profile, the finest layer height any of them asks for at each Z, unless
"Each object separately" is ticked. Every selected object is painted with
its layer heights. With a profile each, up to three objects get a bar of
their own, drawn to one scale, and the bar under the mouse is the one edited.

The prime tower check compares the layers objects are sliced at over the
height they share, rather than the raw profiles, which never matched once the
profile of a lower object ended at its own top. Precise Z height, which fits
the last layers of each object to its own height, is left out of such a
print, with a warning.

* Check the prime tower layers on the sliced objects, and note the new strings for translators

* Include what the new tests use

* Compare the layers as sliced, before the prime tower is generated from them

* Check that precise Z height stays on without a prime tower

* Keep each object's layer height texture on the GPU, and mark only lower tops

The variable layer height tool sent a 1024x1024 texture to the GPU for every
selected object on every frame, and set_config(), run after every edit,
dropped the other objects' textures so that each was generated again.

Each other object now has a texture of its own on the GPU. It is generated
and sent only when its profile, its height or the slicing parameters it shows
change, which set_config() now only asks to check. The object shown sends its
texture only when it is generated, and while the objects share one profile,
those on its layers are drawn with its texture and need none of their own.
The textures of objects no longer selected are freed.

The bars and the layer height curves are built again only when what they
show changes, and each bar is scaled with its own object's layer heights.

A lower object's top is marked only when it is lower than the object shown,
objects ending at the same height share one label, and a label stays on the
canvas and below the one above it.

The comment on precise_z_height_overridden() now says what the override
trades: the tower can join the off-grid layers to the tower layer below, but
a joined layer holds two purges, which makes the tower deeper.

* Fix the precise Z warning, shared profiles across first layers and the bar clicked

- The precise Z override, and its warning, now need an object with precise
  Z height on. Every plate with a prime tower and variable layer height on
  objects of different heights warned about a setting that is off by
  default.
- The objects the override slices again get their slicing parameters back
  at once, since validate() reads them before slicing.
- When the objects share one profile, an object that starts its layers
  elsewhere than the object shown, with a raft of its own say, keeps its
  own. The shared profile starts with the first layer of the object shown,
  and PrintObject::update_layer_height_profile() dropped it on such an
  object, which then printed at the preset layer height.
- Clicking a bar edits its object, even when no frame was drawn since the
  mouse got there.
- Select all is ignored while a profile is painted, and select all plates
  while the tool is open.
- The bars' models are made again, not copied, when their number changes:
  a copy shares the GPU buffers that the original deletes.
- Objects with no height above the bed are left out of the tool, and a
  profile fitted within EPSILON above one of its entries no longer runs
  past it.

* Keep the object top labels below the toolbar row

When the toolbar row ends next to the bar, the label of an object that
ends near the top of the tallest one covered the toolbar's last buttons.
Such a label now starts below the row, with its arrow pointing up to the
line on the bar.

* Fill the layer height texture up to the top of the object

The last layer can end under the top of the object, by up to half a
layer, and no layer wrote the cells there. The top face is drawn with
them, so it showed what the buffer held before: black on the texture of
an object made for the first time, or the colours of another object.
The last layer now fills them, with the shade of its top.

* Draw horizontal faces without the layer stripes

A horizontal face lies at one height, so the stripes cannot show on it,
only the shade they have there. That shade changed whenever a layer
under it moved, and the tops flickered at every stroke. Such a face now
gets the plain colour of its layer height, from the 2nd level of the
texture.

That level is now read at its own level of detail instead of with a
bias. On a horizontal face the texture coordinates do not change, so the
GPU picks the 1st level however large the bias, and read it at the
coordinates of the 2nd: the tops showed black, or the colour of another
height. The 110 shader does so where GL_ARB_shader_texture_lod is
available, and keeps the stripes elsewhere.

* Include ObjectID.hpp where ObjectWithTimestamp is used

clang-tidy (misc-include-cleaner) asks for the header to be included directly.

* Find the horizontal faces with the inverse transpose of the world matrix

The variable layer height shader took the normals to world space with the world matrix itself, which is only right under a uniform scale. With a non-uniform scale it drew sloped faces as flat, and once the object was also rotated it missed real flat ones. The normals now go through the inverse transpose of the world matrix, which render_object_volumes() already built for the view normal matrix.

* Note why the precise Z override keys on has_wipe_tower()

Since #16999 the tower is printed only when slicing finds it is needed, so
the override also applies on plates where no tower is printed in the end.
2026-11-12 02:34:10 +08:00
yw4z 19b0e92dba Don't ship stb_dxt header and CMake targets in release packages (#17452)
Remove the install rules from deps_src/stb_dxt/CMakeLists.txt. The Windows packages and the Flatpak are built from the install output, so they shipped include/stb_dxt/stb_dxt.h and lib/cmake/stb_dxt/stb_dxtTargets.cmake. The Flatpak shipped only the .cmake file, because its cleanup step removes /include. Nothing uses either file. The header is only needed at compile time, and the build still finds it in deps_src.

Also drop the "Install Support" line from deps_src/README_CMAKE_INTERFACES.md, since no library in deps_src has install rules now.
2026-11-11 11:56:45 -06:00
yw4z 351c19354a OCCT: build with precompiled headers and only the toolkits Orca links (#17415)
OCCT now builds only the toolkits libslic3r links, 26 with SLIC3R_CAD and 23 without, instead of whole modules. Every module is off and the list is passed in BUILD_ADDITIONAL_TOOLKITS, and OCCT adds their dependencies itself. The list must match OCCT_LIBS in src/libslic3r/CMakeLists.txt.

OCCT's own precompiled headers are on. clang-cl can break exception copies with a precompiled header (llvm/llvm-project#53486), so clang-cl Ninja builds compile OCCT with cl, as Windows ARM64 already did. With the Visual Studio generator OCCT may stay on clang-cl, so precompiled headers are off there. The .pch files are deleted after install. libslic3r clears INTERFACE_PRECOMPILE_HEADERS on the OCCT targets so OCCT's headers are not merged into its own.

The Windows x64 OCCT DLLs are now built with cl instead of clang-cl. OCCT's build time drops by about 45% on Windows and from 6m28 to 1m58 on Linux.
2026-11-11 11:44:33 -06:00
HanifKoh 478cc90ae7 Write One Nozzle Volume Type per Nozzle From the CLI (#17440)
The CLI now sets one nozzle_volume_type per nozzle, as the GUI does. A command-line value wins, then the project's own types, then the printer's defaults. A short list repeats its first entry and a long one is cut to the nozzle count. The sized list is written to the project config and over the command-line value, so the export has one type per nozzle, and reopening it in the CLI keeps the flush matrix the user set. The flush volume setup reads the sized types instead of indexing a short command-line list past its end.

Adds the cli_nozzle_volume_type test.
2026-11-11 08:56:36 -06:00
HanifKoh d7534d7fb9 Fix the Crash When the Per-Extruder Printable Areas Do Not Overlap (#17439)
When the per-extruder printable areas only touched or did not overlap, get_shared_poly read the first polygon of an empty intersection. That crashed the CLI on the bed shape, and the GUI in scale to fit, fill bed and prime tower placement.

The shared area is now empty in that case. An area with fewer than three points leaves its extruder the whole bed. Placement (get_bed_shape with use_share, PartPlate::get_build_volume(true)) falls back to the whole bed. The prime tower's default position and drag fall back to the plate's shape. Validation now says the extruder printable areas share no common area, instead of reporting the tower as partially outside the printable area.

Profiles whose areas overlap, and profiles without areas, get the same shapes as before.
2026-11-11 08:53:37 -06:00
SoftFever 40f43febbd Register Fill bed instances with the plate they land on (#17480) 2026-11-11 22:32:10 +08:00
Ian Chua 8f879a3700 fix: plugin permission refresh with unsaved edits (#17448)
* fix: plugin permission refresh with unsaved edits

* fix: announce permission edit status only when visible
2026-11-11 20:04:09 +08:00
Ian Chua 021ef5506c fix: skip cached updates for unused vendors (#17449)
* fix: skip cached updates for unused vendors

* refactor: clarify vendor selection helper and comments
2026-11-11 20:03:18 +08:00
ExPikaPaka 890c2827b1 Animate the gizmo pictures that show an action
Straight-line painting strokes, the cut parts turning into their final
pose, flipping on assembly and picking the features of a measurement
are loops instead of stills.
2026-11-11 12:42:52 +01:00
ExPikaPaka 4030bf9e15 Put the settings tooltips beside the sidebar, in the dark palette
A tooltip under a field covered the next rows of the page. It now goes
beside the column the control is in (the sidebar, a side panel), over
the 3D view, or beside a dialog, the way the texture-displacement
panel's tooltips sit beside the panel; below the control remains for
toolbars and full-width pages and when there is no room beside. The
popup is drawn in the dark palette in both themes, the colours the 3D
view's tooltips now use, so all tooltips look the same.
2026-11-11 12:28:51 +01:00
ExPikaPaka cc451372c0 Draw every ImGui tooltip in the colours of the settings tooltips
The illustrated and plain ImGui tooltips took ImGui's default near-black
background, while the tooltips of the settings pages use the dark panel
colour of the input boxes. Both now use the same background, border,
text and caption colours, from one push_tooltip_style().
2026-11-11 12:27:21 +01:00
Lam Wei Lun 97ee8d9197 Cut: keep per-part filament colors after dovetail cut (#17322)
* Cut: keep per-part filament colors after dovetail cut

The dovetail path merged every model part of each half into one volume
built from a raw mesh, dropping per-part extruder and material overrides,
so the cut result fell back to the object-level extruder (T1).

Merge by effective slicing identity (extruder, material, per-part config)
instead, one merged volume per group, copying the representative's config
and material. Connectors and modifiers are never merged or deleted, and
single-group results keep today's single volume named after the object.

Fixes #17187

* Fix missing includes

* Cut: number extra parts and fix null material lookups

Name the extra merged parts Object_2, Object_3, ... as splitting a mesh
into parts does, instead of Object_T<extruder>, which misleads when the
parts differ by material or by a per-part setting, and whose fallback
suffix was not re-checked for uniqueness.

Move the merged mesh into the new volume instead of copying it.

add_cut_volume() dereferenced the source volume's material, but the cut
model has no material table, so cutting a part that has a material id
crashed before the merge could carry that id. Fall back to the material
id alone, and let PrintObject skip a material's region settings when the
material is missing rather than dereferencing null.

* Cut: don't replace the source material while copying it

add_cut_volume() carried the source volume's material with set_material(),
and Model::add_material(id, other) deletes the existing material before
copying from other. The source volume and the target object share the cut
model, so the second copy of the same volume (the "_A" and "_B" halves of
a groove cut) resolved that same material and replaced it with a copy of
itself after deleting it, reading freed memory. A part with a material id
segfaulted the cut before the merge could carry that id.

Copy the material's settings only when the target model has no material
of that id yet; otherwise just set the id and keep the existing one.

* Cut: carry a part's material id and merge by effective settings

The cut model holds no material settings, so add_cut_volume() only needs
the id: copying the material there could only replace the source object's
own entry, which Model::add_material() deletes before copying from it.
Drop the unused duplicate of add_cut_volume() in Model.cpp as well.

Group parts by the settings they slice with rather than by the keys they
set explicitly: a part that restates a value the object already sets now
stays with a part that leaves it implicit, instead of coming back as
Object_2.

* Model: keep a part's material when converting units

ModelObject::convert_units() rebuilt a clone detached from its model and
then called set_material() on it: the source volume's material was read
without a check, and set_material() reached add_material() through the
clone's null model. Any part with a material id crashed the conversion.

Copy the id, pointing the clone at the source model for the call so the
entry is recorded and its settings resolve after the conversion.
set_material() has no callers left, so remove it.

* Model tests: free the converted objects through a model

ModelObject's destructor is private, so the tests cannot delete the
objects convert_units() hands back. Give them to a Model, which owns
model objects and frees them.
2026-11-11 18:36:58 +08:00
ExPikaPaka fab5e30d10 Keep the tooltip text where code still reads it
The illustrated popup removes a control's native tooltip, which left
icon-only buttons without a name for screen readers (Button's
accessible on Windows, the macOS accessibility bridge) and made the
Physical Printer host field dereference a null tooltip on every edit.
Add illustrated_tooltip_text() for the first and check for null in the
second.
2026-11-11 11:21:54 +01:00
ExPikaPaka ecd1ef2794 Move the remaining device tooltips to the illustrated popup
Media files, the file grid, AMS mapping and settings, the camera popup,
sending a print, part skipping, troubleshooting, AMS sync and the upload
dialogs of other printers. Adds pictures for part skipping and AMS sync
modes, and fixes the 3MF files tooltip set on the video button.
2026-11-11 11:09:21 +01:00
Fernando Marino` 163b95f93d Keep the final wipe-tower unload for ramming printers when the tower stops short (#15917)
Keep the final wipe-tower unload for ramming printers when the tower stops short of the object's top

The Type2 final purge was skipped whenever the tower stopped below the object's top layer,
so a ramming printer's last filament was never unloaded. Generate it again when the last
filament rams (single_extruder_multi_material or filament_multitool_ramming), placing it at
the object's top layer so the nozzle doesn't descend into the part, and keep skipping it
otherwise.

Co-authored-by: Fernando Marino <f.marino@rheagroup.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:34:57 +08:00
ExPikaPaka 816b2e9241 Write the tooltip pictures' stills as 256-colour PNGs
Indistinguishable at their size, and less than half the bytes.
2026-11-11 08:45:53 +01:00
ExPikaPaka 1cde56009b Explain the Device tab, the send-print dialogs and the AMS controls
- Send-print dialogs (single and multi-device): each print option row
  says what it does and why it is off, with animations of bed leveling
  and of the traditional vs smooth timelapse; printer, plate and
  storage controls.
- Device tab: print controls, camera bar, temperatures, speed, lamp,
  fans, axis jog, nozzle switch, filament change recovery.
- AMS: load and unload (and why they are disabled), auto refill, slots,
  external spool, RFID, humidity, AMS settings, material settings,
  drying.
- Print options dialog, multi-device pages, flow calibration dialog.

Tooltips that only repeated their icon's name (Pause, Stop, Storage,
Timelapse, ...) now say what the control does.
2026-11-11 08:06:07 +01:00
ExPikaPaka 8dd7b06995 Show wx tooltips with pictures, and connect the settings pages
A tooltip for wx controls with the behaviour of the 3D view's
illustrated tooltips: it waits for the pointer to rest, sits beside the
control instead of under the mouse, never takes focus, hides on any
click, key or wheel, and plays its GIFs from the first frame each time
it opens.

- One shared wxPopupWindow, owned by the control's top-level window,
  shown without activation on MSW and as a grab-less popup on Wayland.
- Hover is followed on the control and the windows inside it, so the
  composite TextInput, ComboBox and SpinInput work; native tooltips on
  them are kept off.
- Every settings field, option label and undo icon goes through it,
  with the text it had. A setting's pictures come from SettingTips;
  for a setting with a list of values, the chosen value's picture, and
  in the open drop-down list each value's picture beside the list.
- A filament override of a printer setting shows that setting's
  pictures.
- The GIF decoder is shared with the 3D view's AnimatedTexture, and
  IllustratedTooltip::Media is the same TipMedia struct.
2026-11-11 07:46:26 +01:00
ExPikaPaka 913e6814a3 Add the API for wx tooltips with pictures
set_illustrated_tooltip() and hover_illustrated_tooltip() give wx
controls the tooltips the 3D view has: they wait for the pointer to
rest, sit beside the control and can carry pictures. SettingTips holds
the pictures for print, filament and printer settings, one file per
group so the three can be filled independently.

The popup itself follows; until then the calls fall back to a plain
wxToolTip.
2026-11-11 07:46:26 +01:00
ExPikaPaka 4360248d03 Wait again for a tooltip when the pointer comes back to the same control
IllustratedTooltip only restarted its wait when the pointer moved to
another control, so leaving one and returning showed its tooltip at
once. A frame on which nothing asked now counts as leaving. The
tooltip's text and captions also keep their own colours whatever the
call site pushed, which the 3D view's light menu needs.
2026-11-11 07:41:27 +01:00
ExPikaPaka 45a65d18db Illustrated tooltips for the main toolbar tools
Add, Add plate, Orient, Arrange, the instance and split tools, Variable
layer height and Assembly view get the same tooltip as the gizmo tools
beside them: under the toolbar, after the pointer rests, with what the
tool does and an animation of it. The title is the tool's existing
tooltip, so its shortcuts and translations stay.
2026-11-11 07:27:04 +01:00
HanifKoh 3c72223aaf Don't Crash or Stay Silent When the OpenGL Context Can't Be Activated (#17441)
* Don't Crash or Stay Silent When the OpenGL Context Can't Be Activated

When the driver refuses to make the OpenGL context current, no ImGui frame ever runs and
OpenGL is never initialized, so ImGui has no current font and the GL functions are never
loaded. A notification that measures its text from an event handler (a validation warning, a
job's progress, the slicing progress bar) then reads the null font and crashes, and once a
slice completes, loading its G-code preview calls the unloaded GL functions and crashes too.

Notifications now skip measuring until a frame has set up the font; they stay Unknown, and
render() already measures them when it draws. The G-code preview is not loaded while OpenGL
cannot be initialized; with OpenGL up, init_opengl() returns at once and nothing changes.

On Windows, a shown canvas whose context cannot be made current is reported once: wx drops the
wglMakeCurrent error in release builds, so the call is repeated to log GetLastError() with the
canvas's pixel format and the display it is on. If OpenGL never came up in the session, the
user gets one error dialog instead of an empty 3D view with no explanation. A GTK canvas can
fail until its surface is mapped, so other platforms only get the crash fixes.

* Name the Display Adapter Instead of Only Suggesting a Driver Upgrade When OpenGL Can't Be Activated

A context that can't be made current has several causes: no OpenGL driver
behind the display the window is on (a disabled adapter, or one running on
the Microsoft Basic Display Adapter), a broken driver, or an overlay. The old
advice to upgrade the driver covered only one of them. The dialog now names
the adapter Windows reports for the window's display and lists the general
checks, and the log line keeps the display device and adapter name.
2026-11-11 14:19:30 +08:00
ExPikaPaka b7ed121b93 Illustrated tooltips for the gizmo toolbar and gizmo panels
Tools on the gizmo toolbar and the controls in every gizmo panel get
tooltips that wait for the pointer to rest, sit beside the toolbar or
panel instead of under the mouse, and can carry a still or a short
animation of what the control does.

- IllustratedTooltip: the timing and picture playback shared by the
  texture displacement panel, the gizmo toolbar and the gizmo panels.
- GLGizmoBase::panel_tooltip() and slider_with_tooltip() for panels.
- Pictures are drawn by scripts/gen_gizmo_tips.py, a small SDF ray
  marcher, so they can be regenerated and extended.
- docs/HLSD/tooltip-illustrations.md describes the design.
2026-11-11 07:16:00 +01:00
DIEHARDave bb81f6b39a Fix: Run slicing pipeline plugins whose manifest reference is missing (#16884)
When a capability named in `slicing_pipeline_plugin` has no entry in the derived `plugins` manifest, the slicing pipeline now finds it by name among the loaded plugins instead of skipping it. The lookup moved into `PluginManager::resolve_capability_ref()`, so the manifest resolver and this fallback use the same rule.

A capability that isn't loaded is still skipped. So is a manifest entry that points at a plugin that isn't installed. No local plugin with the same capability name runs in its place.

Adds a test that slices with an empty manifest and checks that the capability ran.
2026-11-10 22:07:56 -06:00
TheLegendTubaGuy 9696797638 Keep Bambu LAN printers saved before printer agents in the Device tab (#17468)
Builds before 2.5.0 saved local machines without a printer_agent_id, and
DeviceManager hides and drops entries with no agent, so Bambu printers bound
over LAN in 2.4.x vanished after the upgrade. Assign them to the Bambu agent
when the config is loaded. Entries of the other agents stay unassigned: those
were keyed by their address, which equals the stored IP or contains a '.' or
':' that a Bambu serial number never has.
2026-11-10 20:30:37 -06:00
TheLegendTubaGuy 6d33e58347 Fix panning and rotating from the center of mass details box (#17137)
A drag that starts on the center of mass details box, off its close button, now turns or pans the view like a drag over empty space. Its release no longer opens the canvas context menu. A right click off the box now closes it, the same as a left click. A click inside the box always goes to ImGui, including the click that closes a context menu.
2026-11-10 20:22:43 -06:00
ccatlett1984 54f46ca3b0 Fix Snapmaker filament sync: nozzle temperature, invented material types, and a crash on an empty spool colour (#16300)
Fixes five problems in how the Snapmaker agent turns the printer's filament data into AMS trays.

- Read the nozzle temperature from HOTEND_MAX_TEMP instead of FIRST_LAYER_TEMP, which external tag readers never set. Slots with no vendor now get their temperatures too.
- Return the base material type for finish sub types, instead of names like PLA SILK that aren't valid filament types. Fold a fiber loading into the plain fiber, so PA12 with CF10 gives PA12-CF.
- Match the vendor by whole word in either direction, and stop a preset with no color from ranking as black.
- Prefer a preset whose name carries the spool's sub type. When no preset matches the spool's vendor, try Orca's Generic presets before the type-only fallback.
- Fix a crash on a spool with an empty color.

Adds tests in tests/slic3rutils/test_snapmaker_filament_match.cpp.
2026-11-10 20:04:27 -06:00
Kris Austin 91db25f2cf Fix crashes when clicking in the Measure tool (#17383)
The Measure and Assembly tools could crash on a click when the hovered gripper had nothing to select. That happened off the model over an edge's highlight, on a feature that Assembly mode filters out, or on a selection sphere that was just removed. The click dereferenced an empty `std::optional`, which aborts on builds with libstdc++ assertions, like the Flatpak.

The hover id now names only a gripper hit this frame. A click selects a selection sphere that still exists, or the hovered feature and, in point selection, its point. Otherwise it acts like a click on empty space.

The selected planes and circles no longer get pick raycasters, since a click selects from the hovered feature. The selected circles' raycasters pointed at the hovered circle's, which was freed on the next hover. Also fixes the selected circle's ring keeping the thickness from the zoom it was selected at, a missed ray storing `DBL_MAX` as the point in point selection, and a selected feature's volume being recorded from whatever was under the cursor a frame later.

Checked by hand on Windows and on the Linux Flatpak.

Fixes #17367

Co-authored-by: yw4z <28517890+yw4z@users.noreply.github.com>
2026-11-10 20:00:08 -06:00
oliverzein ea80024735 Write the T command before filament start G-code when only the first filament prints (#14763)
On non-Bambu printers, a print that used only the first filament wrote the filament start G-code and pressure advance before `T0`. Every other toolchange writes the T first. Printers that set a temperature on a T command, like Creality printers with a CFS, then overwrote the temperature from the filament start G-code, and the print ran at the CFS temperature.

The single-extruder path now writes the T command first, then the filament start G-code and pressure advance, in the same order as the multi-extruder path. When the T is written, single-extruder multi-material is on and the prime tower is off, an M104 for the filament follows the T, as in the multi-extruder path. A temperature set in the filament start G-code comes after it and still wins. Prints with only one filament configured get no T and are unchanged.

Adds three tests to `test_multifilament.cpp`.

Fixes #14753
Fixes #11542
2026-11-10 19:54:21 -06:00
TheLegendTubaGuy 376fd433f2 Fix the mixed filament ratio pickers and dialog sizing (#16866)
The ratio triangle handle no longer jumps to the opposite side when it is dragged outside the triangle. It now snaps to the nearest point on the outline.

When the dialog grows for a third material or the gradient editor, it now stays inside its display and is never taller than the display, so Cancel and OK stay above the taskbar. A DPI change resizes it the same way.

The 10% minimum for each filament is now drawn as a dashed line on the triangle, the ratio bar and the gradient graph. The gradient grid is now 10x10, so the line falls on a grid line. The two-material ratio bar now spans the full dialog width, below the preview.

Part of #16781.
2026-11-10 19:45:17 -06:00
HanifKoh 6ba9eb49e7 Size the CLI's Filament Index Tables to the Loaded Filaments (#17244)
When `--load-filaments` names more presets than the project has filaments, the CLI now grows the project to the loaded count before the config merge. The new filament slots go in before the printer's slot in `inherits_group`, `different_settings_to_system` and `compatible_machine_expression_group`. Before, the merge read past the end of its index tables, which aborts under libstdc++ assertions, and the new filament overwrote the printer's inheritance, changed settings and compatibility condition.

The project's own filaments keep their per-variant values, also when the loaded count equals the project's variant count.

An empty `--load-filaments` entry past the project's filament count now fails with `CLI_INVALID_PARAMS` and names the slot, since there is no project filament to keep there. `--load-defaultfila` still fills such a slot with the first loaded preset.

Adds the `cli_load_filaments_count` CLI test.
2026-11-10 18:53:30 -06:00
brumbear f9d5a614b0 Fix Flow Dynamics Calibration capability detection (#16055)
Older A1 and A1 mini firmware reports PA support through `support_flow_calibration` but leaves `home_flag` bit 16 clear, so `parse_home_flag` reset `is_support_pa_calibration` and the Flow Dynamics Calibration checkbox was hidden when sending a print. On series N printers, `home_flag` no longer clears the two calibration flags once either one is set. Other printers are unchanged.
2026-11-10 18:49:31 -06:00
Niklas 96d7742974 Trust the per-printer CA file for Bambu LAN connections (#17062)
The HTTPS CA file in the IP and access code dialog had no effect for Bambu Lab printers. For Bambu printers, the CA path is now saved with the printer's local machine entry instead of being read from the selected preset. On connect, Orca builds `<data_dir>/cert` with the bundled `printer.cer` plus the CA of each printer connected in this session, and points the network plug-in there. The file must contain only CA certificates. If it doesn't, Orca logs a warning and keeps the bundled certs. Other printer agents still use `printhost_cafile` from the preset.

A CA chosen before this change is not migrated. Choose it again in the dialog.

Fixes #17061
2026-11-10 18:48:28 -06:00
Eric Lin fabad6114a Fix filament sync showing a slot as another material (#17089)
When no visible filament preset matched the material a printer reported, first_visible_idx_by_type() returned an arbitrary visible preset, so the slot showed a different material. It now returns no match, and the Moonraker, Creality CFS, Qidi and Snapmaker agents fall back to the OrcaFilamentLibrary generic for that material.

The generic name table now maps PLA+, PLA PRO, ABS+ and PETG+ to their family, and adds PLA Matte, PETG HF, PETG-CF, PE-CF, PP-CF and PP-GF. The redundant visible-base check in the Creality CFS fallback is gone.
2026-11-10 18:34:50 -06:00
Kuzuri 7243d15ea2 Measure short objects and the compacted tower clearance by the printed top (#17445)
`is_all_objects_are_short()` and both "No sparse layers" compacted tower clearance checks now measure an object by its top above the bed, with the raft, Z offset and Z shrinkage included. Before, a short object on a raft still counted as short in a by-object print, and the raft was left out of an object's rise above the compacted tower. These checks and the by-object check now read the new `PrintObject::print_z_max()`. Belt printers use the model's own top.
2026-11-10 18:19:17 -06:00
Ian Bassi fb0c9884c9 Show RepRapFirmware G10 temperature changes in the G-code preview (#17464) 2026-11-10 19:03:10 -03:00
SoftFever c872776d24 Select sketch constraints by clicking their badges instead of deleting them (#17459)
* Select sketch constraints by clicking their badges instead of deleting them

* Drop a selected sketch constraint when geometry is picked or the tool changes
2026-11-11 03:19:41 +08:00
SoftFever 2ee47e29fb Show a sketch's constraints and own name as soon as it opens for editing (#17458)
* Show a sketch's constraints in the sidebar as soon as it opens for editing

* Name the sketch being edited in the Design tab's sketch card and banner

* Keep an ampersand in an edited sketch's name on its card and banner
2026-11-11 03:19:25 +08:00
Rodrigo Faselli 3538f239c2 Fix bridges in a different filament not anchored on their neighbours (#17382)
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-11-10 14:52:36 -03:00
HanifKoh af5f6806ac Update the Vendored miniz to 3.1.2 (#17294)
* Update the Vendored miniz to 3.1.2

The 2.1.0 copy reads every .3mf and plugin archive we open. Upstream has
since fixed a central-directory offset overflow when reading the zip header,
an infinite loop in tinfl_decompress on a zero code length, an integer
overflow in the header corruption check, wrong sizes in
mz_zip_reader_extract_to_heap and several uninitialised reads on malformed
deflate streams, none of which 2.1.0 has.

The local modifications are carried over onto the new amalgamation:
m_is_utf8 on mz_zip_archive_file_stat, mz_zip_reader_get_extra and
mz_zip_reader_get_filename_from_extra, mz_zip_reader_extract_to_file_w and
mz_zip_writer_add_file_ex for Windows paths, the PrusaSlicer staged writer
(mz_zip_writer_add_staged_open/data/finish) and the zip64 "version needed"
fields. The max_size form of mz_zip_writer_add_read_buf_callback that
PrusaSlicer had patched in is upstream since 2.2.0 and is taken from there.

Verified on Linux: the application and tests build, and the [3mf], [AMF],
[plugin], [project], [SL1Import] and [TextureImport] libslic3r tests pass
(88 cases, 1908 assertions).

* Pass UTF-8 Paths to miniz on Windows

miniz 3.x converts narrow file names from UTF-8 to wide characters
before opening them, where the vendored 2.1.0 passed them to fopen as
local code page bytes. The call sites that wrapped their paths in
encode_path() therefore handed it code page bytes to decode as UTF-8,
which breaks any non-ASCII path. Pass the UTF-8 strings straight
through; the zip entry names still use the native encoding plus the
Unicode path extra field.

* Record the Local miniz Changes as a Patch

The vendored miniz carries BBS and PrusaResearch changes that README-Prusa
described only in prose, so each upstream bump meant finding them again by
hand. Commit the diff between the upstream 3.1.2 release and the files here,
and have the README list what it carries and how to re-apply it.

* Extract Plug-in Files Through extract_zip_entry_to_file

install_plugin still handed miniz a destination converted to the local
code page, which 3.x decodes as UTF-8, so a non-ASCII install path was
mangled; the open then failed and fell back to
mz_zip_reader_extract_to_file_w. That carried function never worked:
mz_wfopen passed a narrow mode string to _wfopen_s, the stream was
opened in text mode, and the wide path went into the narrow
mz_zip_set_file_times. Use the existing helper, which opens an
extended-length wide path in binary mode, and drop the _w API from
miniz, the patch and the README.
2026-11-10 16:48:19 +08:00
HanifKoh 6bf8892f4c Bump the Bundled uv to 0.13.7 (#17292)
uv 0.11.21 verifies PyPI's TLS certificate against its vendored CA bundle,
which still trusts the emSign ECC Root CA - G3 whose eMudhra intermediates
were compromised (GHSA-hq85-5cpj-mr62). An on-path attacker holding one of
those keys could substitute the packages that plugin dependencies install.
0.13.4 drops that root; 0.13.7 is the current release. Hashes come from the
release's .sha256 assets; the Flatpak manifest fetches the same archives.
2026-11-10 16:48:08 +08:00
HanifKoh 4ab9f7a732 Move to OpenSSL 3.5.9 and libcurl 8.23.0 (#17293)
* Bump libcurl to 8.17.0

7.75.0 is from March 2021 and has 80 published CVEs against it. The ones our
use reaches are the Transfer-Encoding chain memory bomb from any hostile
server (CVE-2022-32206, CVE-2023-23916) and credential leaks on redirects
(CVE-2022-27774, CVE-2022-27776); the rest are closed too.

8.17.0 is the last release that builds against OpenSSL 1.1.1: from 8.18.0 on,
lib/vtls/openssl.c refuses anything older than 3.0.0, so moving further waits
for the OpenSSL 3 switch.

curl's CMake renamed its options along the way: CMAKE_USE_* became
CURL_USE_*, ENABLE_MANUAL became ENABLE_CURL_MANUAL, CURL_STATICLIB became
BUILD_STATIC_LIBS, and ENABLE_VERSIONED_SYMBOLS and USE_RTMP are gone.
libpsl, libidn2, brotli, zstd and WebSockets are now on by default and are
switched off explicitly so the feature set stays HTTP(S) over OpenSSL with
zlib, and no new shared library ends up in the AppImage or the macOS bundle.
The 7.75-specific clang-cl probe workaround is no longer needed.

Verified on Linux by building the dependency in isolation against the bundled
OpenSSL 1.1.1w: curl-config reports FILE FTP FTPS HTTP HTTPS IPFS IPNS and
the OpenSSL backend only, and every libcurl-using source in src/ passes a
syntax check against the new headers.

* Move to OpenSSL 3.5.9 and libcurl 8.23.0

OpenSSL 1.1.1 left public support in September 2023; every fix since,
including this year's DTLS ones that libdatachannel's camera transport
reaches, ships only to paid subscribers. 3.5 is the long-term-support
series, maintained until April 2030. curl follows in the same change because
8.18.0 and later refuse to build against anything older than OpenSSL 3.0, so
the two cannot move separately.

Recipe changes: the tarball comes from the release assets instead of the
tag archive, no-tests shortens the build, the ARM64 /Gs4096 override goes
(1.1.1's VC configs passed /Gs0; 3.x does not set /Gs at all), and the
hand-written CMake config advertises 3.5.9. The deprecated low-level MD5_*
calls still compile: OpenSSL 3 keeps them behind a deprecation warning,
which the build already silences for dependency headers.

Verified on Linux by building OpenSSL, curl, libdatachannel, FFmpeg and
CPython in an isolated dependency tree: libcrypto identifies as 3.5.9,
curl-config reports the OpenSSL backend with HTTP(S)/FTP(S)/FILE only, and
the bundled python3 imports ssl against 3.5.9 and creates a default context.
Every OpenSSL-using source file in src/ passes a syntax check against the new
headers. Windows and macOS are left to CI.

* Compare the Full libcurl Version Number in Http.cpp

The two guards tested LIBCURL_VERSION_MINOR alone, so at 8.x they went
false: the progress callback declared with curl_off_t was registered as
CURLOPT_PROGRESSFUNCTION, which libcurl calls with doubles, and the
TLS backend check compiled out. Compare LIBCURL_VERSION_NUM instead.

* Link SystemConfiguration Into libcurl on macOS

libcurl 8's Curl_macos_init calls SCDynamicStoreCopyProxies when IPv6
is enabled. curl's own CMake package links the framework, but our
FindCURL module builds CURL::libcurl from the static archive alone, so
both macOS builds failed to link.

* Keep OpenSSL's Default Security Level at 1

OpenSSL 3 raises the default from level 1 to 2. Level 2 refuses DHE with
1024-bit parameters on every connection and, when the peer is verified,
1024-bit RSA keys as well, so old self-signed printer certificates and
firmware TLS stacks would stop connecting. Configure with
OPENSSL_TLS_SECURITY_LEVEL=1 to keep the level 1.1.1 shipped with. TLS
1.0 and 1.1 need level 0 in 3.x and stay refused either way.

Also drop no-ssl3-method (the default in 3.x) and CURL_DISABLE_SMB (SMB
is opt-in since curl 8.23), delete the hand-written OpenSSL CMake package
that nothing reads (the build finds OpenSSL in module mode, and 3.x
installs its own lib/cmake/OpenSSL), stop probing the Flatpak runtime
for OpenSSL because the GNOME 50 SDK ships 3.5.9 and would have replaced
the pinned build, and keep a note of the MD5_* callers still to port.

* Build the Pinned OpenSSL and curl in the Flatpak

The Flatpak block stopped probing for OpenSSL so the GNOME SDK's copy
could not stand in for the pinned build, but the find_package(CURL) it
kept resolves the SDK's CURLConfig.cmake, whose find_dependency(OpenSSL)
leaves OPENSSL_FOUND set. Both dep_OpenSSL and dep_CURL were skipped,
and libdatachannel's configure then failed looking for a static
libcrypto under /app. Drop the CURL probe too: the Flatpak's curl has to
link the bundled OpenSSL, so neither of them can come from the SDK.

* Pass the Legacy Progress Callback to CURLOPT_PROGRESSFUNCTION

The pre-7.32 branch registered xfercb, declared with curl_off_t, for an
option libcurl calls with doubles. xfercb_legacy is the matching one
and was unused.
2026-11-10 16:47:55 +08:00
HanifKoh 9199df0811 Fix a Crash at Exit When an Earlier Python Thread Wait Timed Out (#17437)
join_non_daemon_threads() runs the threading exit hooks on a daemon thread and
gives up on it at the deadline. A later call started a new hook thread and
returned 0 without waiting for the old one, so shutdown() could run Py_Finalize
while the old thread was still running the hooks. Python then stops that daemon
thread when it reaches for the GIL; it unwinds through the hook lambda and
releases a Python list without the GIL while finalization's garbage collection
walks it, which crashes the process.

A call now first waits, within its deadline, for a hook thread an earlier call
left running, and counts it as still running if it does not end, so shutdown()
leaves the interpreter unfinalized instead.

This was the intermittent segfault at exit of the "ends idle
concurrent.futures workers" test, which calls the function more than once. The
app calls it once, from shutdown().
2026-11-10 16:02:22 +08:00
HanifKoh 46f7b0e719 Offer the Sliced Objects as a Solid Model While Dragging the Preview (#15818)
* Offer the Sliced Objects as a Solid Model While Dragging

The G-code preview draws every toolpath segment as an instanced box, and its frame cost is
linear in the number of segments drawn. On a plate of large objects that is enough that
dragging the camera or a preview slider cannot keep up, and no amount of per-segment work
changes that; only drawing fewer segments does.

The objects themselves are cheaper: a mesh costs its triangles once, however many layers it
has, and the preview already loads the objects as shells for its translucent ghost. A new
preference, "Only render solid model when dragging" (off by default), draws those shells
opaque in their filament colours instead of the toolpaths while the user drags.

The visible layer range still holds. The shells are cut at the range's top and bottom through
the gouraud shader's z range, and libvgcode keeps a second index buffer holding just the
range's bottom and top layers, filled in the same walk as the full one, which is drawn
afterwards so that it caps the cut with what was really printed there. Switching between the
two sets is a buffer binding, never a rebuild. The prime tower is added to the shells from its
sliced mesh while the preference is on, positioned as the print placed it; it keeps its opaque
colour and so stays out of the translucent ghost. Supports have no mesh and are not shown.

Dragging is the camera, the navigator or either slider being held; a slider reports it from
ImGui's active id, since its dirty flag is raised and consumed inside one frame. A wheel step
holds the solid model for a 150 ms settle time, with the frame that restores the toolpaths
scheduled for when it runs out. The switch is decided at the top of the frame, before the
cached scene is consulted, and a frame that switches redraws the scene. A drag cut short by
focus or capture loss is ended explicitly, and a button release wakes the idle loop, since on
some platforms no idle event follows it until the next input.

With the preference off, nothing is built and the preview is unchanged.

* Release the Reduced Set When Unused and Share the Drag Check With the Scene Cache

The reduced index buffers were only re-uploaded while the preference was on, so
the last set stayed allocated until the next load once it was switched off, and
their size was missing from get_used_gpu_memory(). They are now uploaded on every
rebuild, empty when nothing was built, and counted.

The scene cache and the solid model both asked whether the user was dragging,
with different lists: the cache knew about gizmos and the rectangle selection,
the solid model about the navigator and the sliders. One is_user_interacting()
now answers both.

The tooltip says that negative volumes are not cut out of the solid model, since
load_shells() drops every non-model-part volume, and the preferences handler
keeps the dimming comment with the branch it documents.

* Let the User Choose What the Preview Draws While Dragging

The solid model is one answer to a preview that cannot keep up with a drag; a
reviewer asked for the two that keep the drag view made of toolpaths. The
checkbox is now a combobox, "Simplify preview while dragging", with Off, Solid
model, Skip layers and Outer walls, and a spin, "Draw one layer in every N",
for the toolpath modes. Off is the default, and with it nothing is built.

Skip layers keeps one layer in every N. Outer walls keeps the outer and overhang
perimeters of those layers, so the prime tower and supports, whose segments have
other roles, drop out of it. Both keep the bottom and top layers of the visible
range whole, as the solid model does, so the faces the range cuts open stay what
was printed there.

libvgcode takes the choice as EReducedDetailMode and a stride; the sets are
rebuilt when either changes, and drawing from the reduced one is still a buffer
binding. A mode change reaches the loaded preview at once, as the checkbox did.

* Add a Shell-Only Drag Mode That Keeps What Can Be Seen From Outside

A third mode of the drag preference: the reduced set keeps every role but the sparse
infill, internal solid infill, internal bridge infill and gap fill, which lie under the
skins or between the walls, on every layer. Walls, top and bottom surfaces, bridges,
supports and the prime tower are drawn whole, so from outside the print looks as it does
at rest, and the two end layers of the visible range stay whole as in every mode.

The roles come from the slicer, so the classification is exact wherever the slicer's is.
What a role cannot tell apart is the inside of the prime tower or of a support from its
outside; both are kept whole. A profile with no top or bottom shell layers exposes infill,
which this mode hides.

* Keep Only the Solid Model and Shell Modes While Dragging

The skip-layers and outer-walls modes drew one layer in every N, and every visual
complaint on the review came from the gaps that leaves at close range. The shell mode
draws every layer and looks the same from outside, and the solid model is the one mode
whose cost does not depend on the toolpaths, so the two of them cover what the stride
modes were for. The layer stride goes with them; a saved preference naming a removed
mode falls back to off.

* Hide Infill in the Shell Drag Mode Only Where the Profile Covers It

A profile with no top or bottom shell layers, or no walls, leaves the infill on the surface,
so hiding it changed the picture. The viewer now reads the print's default region settings
when it loads a print and leaves the infill in place for such a print; per-object overrides
are not consulted.

* Keep the Ghost and Cap the Cut of the Solid Model While Dragging

In the solid model mode the translucent ghost disappeared for the length of every drag, since the scene drew either it or the solid; it is now drawn in every mode, so the part above the cut stays in view.

The cut itself was open: a sparse layer on the cut showed, between its lines, whatever lay below inside the hollow shell, the first layer or the bed, which moved with the camera and read as a flickering shadow; and a face of the model in the cut layer's own plane fought that layer's toolpaths pixel by pixel. The solid now runs from the top of the range's bottom layer to the bottom of its top layer, and a stencil pass caps each cut plane, body by body, with a quad in the body's colour darkened where the cut has opened it: back faces less front faces, counted with the depth test off, which leaves a closed body at zero.

* Leave the Preview Untouched While Dragging With the Mode Off

The reduced flag was raised on every drag whatever the mode. libvgcode still drew the full set with the mode off, but the canvas reads the flag: it redrew the scene on the first and last frame of each drag, scheduled an extra frame after every wheel burst, and ended a drag that lost focus or capture. The flag is now raised only when a mode is set.

The realistic view's shadow-caster pass draws whichever set is bound, and the static shadow map's key did not say which, so a map built during a drag stayed thinned after release; the key now includes it.

* Tidy the Drag Mode: Cheaper Caps and No Leftovers

The solid model's cap quads are built once per frame and recoloured per body instead of being rebuilt for each, and the stencil count draws each body directly: going through the collection's render built the full preset config and sorted every volume once per body, per frame. A one-line settings wrapper is inlined, the function that added or removed the tower with the mode is folded into its one caller, the two libvgcode getters nobody calls are removed, and the wheel's settle time is set where the wheel is handled. The Shell only tooltip names internal bridges, which the mode hides.

* Cut the Solid Model at the Toolpaths' Heights on a Printer With a Z Offset

The cut heights took the printer's z offset out of the layer heights, which the G-code processor has already taken it out of, so on a printer with a z offset the solid was cut one offset away from the layers drawn as toolpaths: a gap under the top one and an overlap with the bottom one, and the caps sat off the solid's cut plane. The layer heights are in the shells' frame as they are.

* Test That AppConfig Keeps Only the Preview Drag Modes It Knows

A missing mode becomes off, the three modes survive, and a value from an earlier revision or an empty one falls back to off.

* Hold the Navigator's Drag for as Long as the Button Is Held

The navigator reports a drag only on a frame the mouse moved in, and the flag is written by the overlay, after the frame has chosen which toolpath set to draw. A still frame in the middle of a drag dropped the flag, so the next one drew the full set, and a release with no motion left the reduced set on screen until the next mouse event. The flag now holds while the button does, and the drag check reads the button itself.

* Keep the Toolpaths While Dragging a Print Whose Layers Do Not Rise

The solid model is cut at the heights of the layer range's two ends, one range for the whole plate. Printed object by object, the layer heights start over with each object, so those two heights do not bound the range: an earlier object was cut at a later one's height, and a range across two objects could come out empty. Such a print keeps its toolpaths while dragging, as a plate with no shells does.

* Cut the Solid Model Past a Layer With No Extrusion

A layer with no extrusion has a height of zero, and the solid model read its cut heights from the layers at the ends of the range as they were: with such a layer under the top of the range the whole solid was cut away. The nearest layer below with a height stands in for it.

* Keep the Toolpaths While Dragging a Preview Cut by the Section View

The section view cuts the toolpaths open to show their inside. The solid model was drawn with no clipping plane, so while dragging it covered the section whole and the section came back on release. A preview with a section active now keeps its toolpaths while dragging, as a print made object by object does; the shell mode draws through the same plane as the full set and is unaffected.

* Keep the Supports While Dragging in the Solid Model Mode

The solid model stands in for the sliced objects, which are the only shells the preview loads: a support has no mesh, so the moment a drag started everything under an overhang vanished and the object sat on nothing until release. The reduced set now keeps the support roles whole on every layer, as the shell mode does, and the supports draw as toolpaths beside the solid.

* Draw the Layers Down to the Nearest Infill Whole at Each End of the Range

The reduced set kept the two end layers of the visible range whole, and the solid model was cut right under the top one, as though every layer carried every role. Infill combination prints the sparse infill of a few layers in one and leaves the others walls alone, and a support layer with no object layer at its height gets a layer of its own, so a cut under such a layer capped the print where at rest the infill of the layer below shows through: a flat disc inside the walls while dragging, the infill grid on release. Each end of the range now runs to the nearest layer with sparse infill, at most eight layers deep, in both modes, and the solid is cut at the edges of those bands. The layer table is the whole plate's, so another object's solid infill on a layer does not end the band while sparse infill is within reach; a print with none in reach falls back to the nearest layer with any infill, else keeps the end layer alone. The layer table records which layers have infill when the toolpaths are loaded, and the bands are covered by tests.

* Colour the Solid Model as the View Colours the Toolpaths

The solid model and its caps wore the filament colours whatever the view, so a drag in the Line type view turned an orange-walled, red-filled print into a block of its filament colour. The solid stands in for the toolpaths, so it now takes their colours: in a view that colours by something other than the filament, the body the outer wall's, each cap the infill's of the layer it is cut under, sparse before solid, and the prime tower its own role's, each sampled from the first vertex of the role through the viewer. The filament views keep every body its own colour. The colours are resolved when a drag starts and when the view type or the end bands change.

* Close the End Bands Object by Object

The end bands of the reduced set stopped at the nearest layer with sparse infill anywhere on the plate. Two objects rarely combine their infill on the same layers, so where one object still had sparse infill on a layer the other's walls-only layer closed the band, and that object was capped right under it: a flat disc inside the cone's walls while the funnel beside it printed its last infill. The G-code labels its moves with their object, so the wrapper that feeds libvgcode now tallies walls and infill per object and layer and hands the viewer the layers whose infill closes every object printed on them; the bands stop at those. Sparse infill closes an object on a layer. Solid infill closes it only where the object has no sparse infill left in the direction the band looks from, its top shells as seen from above and its bottom shells as seen from below, since a layer whose sparse infill was combined into another still carries the solid infill under its skins and is open; an object with no sparse infill anywhere is closed by any infill. A range from the print's first layer has no bottom band, as nothing is cut under that layer. A preview built from the print, or one whose G-code labels no object, carries no such list and keeps the judgement by the roles of the whole layer.

The G-code processor read the object only from the "start printing object" line that Bambu printers add; every printer writes "printing object <name> id:<n> copy <m>", so it reads that too, and takes the id after the last "id:" so that a colon in the name does not mislead it. The printable-area check that groups extrusions by that id now sees the objects of such a print one by one, as it does for a Bambu print, instead of as one.

* Colour the Solid Model From the Grade Most of the Role Was Printed At

The solid model took each colour from the first vertex of the role in the
sampled layer. The first vertex of an outer wall is the start of its
extrusion, still on the acceleration ramp, so under Actual speed and Actual
flow the whole solid showed the slowest grade of the legend, and under Fan
speed the body colour jumped between drags with whichever layer happened to
be the top cut.

Viewer::find_extrusion_vertex() now takes a layer interval and, in a view
that grades the toolpaths by a value, returns the extrusion of the role at
the length-weighted median of that value over up to eight layers spread
across the interval; in any other view the first extrusion found, as
before. The body and the prime tower are sampled over the layers the solid
stands for, each cap in its own cut layer.

* Count Each Cap of the Solid Model Against Its Own Cut

With the bottom slider above the first layer the solid model is cut at both
ends, and the one stencil count that both caps were drawn through counted
the body with both cuts applied. An open tube counts a view ray through
both openings as closed, so the top cap had a hole through which the
infill toolpaths showed, and a ray in through a wall and out through the
bottom opening as open, so from a low angle the top cap's quad, which
spans the bounding box, was drawn in the air beside the body.

Each cap now gets its own count, with the body cut at that cap alone and
whole at its other end, which is odd exactly where the cap plane lies
inside the body from any viewpoint. The second body pass per volume only
runs when the bottom is cut.

* Let the Solid Model Cast and Take the Realistic View's Shadows

The realistic view's shadow map was built from the toolpath segments
alone, and while dragging in the solid model mode those are only the end
bands and the supports, so the solid threw no shadow at all. Its own pass
also forced the shadow intensity to zero, so it took none either.

In that mode the shells, cut at the solid's heights, are now drawn
depth-only into the same map through the flat clip shader, and the solid
samples the map back with the light the canvas passed on, so a body
shades the plate, its neighbours and the end-band toolpaths as the
toolpaths it stands in for would, and takes their shadows in turn. The
map's key also carries the drag mode, so a map built with the solid is not
kept for the shell mode.

* Keep the Reduced Set Up While a Navigator Click Turns the Camera

A click on a face or a corner of the 3D navigator makes it turn the camera
over the forty frames that follow, with no button held. Each of those
frames was drawn with the full toolpaths, since nothing counted as a drag,
and on a weak GPU the turn took seconds.

The overlay reports each of those frames as a change that is not a drag,
so the canvas holds a flag for as long as that lasts and counts it as
interacting; the frame after the last one is requested so that the full
toolpaths come back on their own.

* Let the Cut Faces of the Solid Model Cast Their Shadow

The solid model was drawn into the shadow map as the shells cut at the
same heights, open where it is cut, on the ground that from the light an
open body's far wall closes its outline. It does, but not its depth: a
ray through the opening passes the end band's sparse infill lines and
reaches the far wall, so on a flank below the light's side the solid
carried the lattice of those lines, where the toolpaths it stands in for
are in one uniform shadow under the opaque layers above.

The shells now cast through a shader of their own: a back face that a
ray reached through a cut is drawn at the depth of that cut, the nearest
of the cut planes on the way back toward the light, and a front face
keeps its own depth. A ray reaches a back face through a lit wall as
well, and the cut's depth would then shadow that wall, so the front
faces are drawn on their own first, into a depth texture of the
viewer's, for the shader to tell the two apart. The shadow map has no
stencil, so the camera pass's cap count could not be reused here.

* Hold the Solid Model's Body Colour While a Slider Drag Moves the Span

A slider drag shows the solid model like a camera drag does, and the
body took a fresh sample at every step, from eight layers spread over
the span of the moment. Where the walls' speed or fan differs from layer
to layer, each step fell on another mix of layers and the length-weighted
median flipped with it, so the body jumped between the grades of the
legend for as long as the slider moved.

The body and the tower are now sampled once, as the drag begins, and
held until it ends; the next drag samples them afresh over the span it
finds. Each cap still follows its own layer, as the toolpaths of that
layer would.

* Colour Each Body of the Solid Model From Its Own Toolpaths

The solid model took one body colour for every object on the plate,
sampled from all the walls of the layers it stands for, so an object
printed at its own speeds wore the grade of the others while its
toolpaths showed another.

The viewer's sampler now takes a rectangle of the XY plane and counts
only the extrusions that end inside it, and each shell volume samples
its body and caps within its own footprint; the tower likewise, from its
own role. Objects that overlap in XY share their samples, which is as
close as the toolpaths come to naming their object.

* Dim and Grey the Solid Model With the Layers It Stands For

With "Dim lower layers" on, the toolpaths around the inspected layers
are drawn at the preference's brightness, and with it off they go dark
grey while the moves slider is short of the top layer's end. The solid
model, which stands in for exactly those layers, was drawn at full
brightness either way.

The layers the solid stands for are never the ones a slider thumb
lights, so its bodies, caps and tower now take the same brightness or
grey the toolpath shader gives the rest of the print, decided by the
rule that shader is given.

* Cut the Solid Model by the Section View

While the section view was on, a drag kept the full toolpaths, since the
solid model would have covered what the view cuts them open to show.
That held even where the plane cut nothing, so with the view on the drag
mode gave nothing at all.

The solid now takes the section plane as the toolpaths do: the bodies
are clipped by it, the two height caps are drawn on its kept side, and
the section face gets a cap of its own, counted on the body cut by that
plane alone and drawn between the two heights, in the body's colour
darkened like the others. What the plane cuts away casts no shadow.

* Keep the Travels Between the End Layers of the Solid Model

With Travel shown in the legend, the solid model kept the travels only on the
layers at the ends of the range, so they vanished on every drag. They are kept
on every layer now, as the supports are. The rule moves into Utils so the
cases can be tested.

* Drag Belt Printer Previews With the Toolpaths Instead of the Solid Model

The solid model is cut by horizontal planes at the end layers' heights, but a
belt printer's layers are planes tilted at the belt angle, with heights in the
G-code's frame, so the cuts missed the body. On belt printers a drag keeps the
toolpaths, as it does for a print whose layer heights start over per object.

* Cast the Solid Model's Cut Faces Into the Shadow Map

A band cut at both ends let the light in through the top cut and out through
the bottom one past every wall, so only the top band's infill lines cast and
the bed showed their grid. The cut faces are now counted and drawn into the
shadow map as the visible pass draws them: in a depth and stencil target of
the viewer's, since the map has no stencil, then copied into the map. This
replaces the back-face depth rewrite of the cut caster shader, and both
passes build the caps through one helper.

* Describe the Solid Model's Cut-Face Shadows, Travels, Belt Fallback and Section Cut

* Keep Parts Above the Visible Range Out of the Solid Model's Cut-Face Shadow

The light's frustum ends at the highest visible layer, so its near plane
cut through parts above the range (a bunny's ears) during the cut-face
stencil count: only their far faces were counted, the count read them as
open and the bottom cap cast an ear-shaped shadow on the bed. Clamp depth
during the count so every face is counted.

* Say in the Drag Option That Belt Printers Keep Their Toolpaths

The solid model handles the section view, and belt printers fall back to
the toolpaths; the description said the opposite of both.

---------

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-11-10 08:23:08 +08:00
Robert J Audas 320f1bb7fc Preserve top support interfaces with synchronized layer gaps (#13939)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-11-09 18:20:07 -03:00
Kuzuri 868686b307 Snapmaker U1: rod clearance from Snapmaker's CAD (#17276)
* Snapmaker U1: keep the clearance settings once on fdm_U1

* Snapmaker U1: set the rod clearance from Snapmaker's CAD

Height to rod 26: Snapmaker's CAD puts the rod bottom 27.05 mm above the
nozzle tip, confirmed by a caliper (27.0) and a printed fin gauge
(27.2 to 27.4); 1 mm is kept in hand for bed mesh, squish and
machine-to-machine spread. Distance to rod 41.2 from the same CAD.
2026-11-09 18:14:34 -03:00
Robert J Audas 17431f363a Fix bottom support interfaces when synchronized gaps round down (#13912)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-09 17:33:29 -03:00
Noisyfox af931e65fc Fix plate offsets in the preview tool position readout (#17172)
Fix preview tool position coordinates on additional plates
2026-11-09 21:28:40 +03:00
yw4z 57071c5991 Update setup_connection.gif (#17421) 2026-11-09 20:44:18 +03:00
Ian Bassi b1d8c5da60 Section view: percent depth, wheel on the panel, start at 50% and Follow camera (#17338) 2026-11-09 13:37:37 -03:00
Kris Austin e2db7e5ef1 Fix Upload and Print not starting on the Ender-3 V3 KE (#17365)
Since 2.5.0 the CrealityPrint host starts a print with a /mnt/UDISK path
on every model outside the K1 family. The Ender-3 V3 KE (F005) keeps its
gcodes under /usr/data like the K1, so the firmware ignores the start
command and the uploaded file never prints. The Ender-3 V3 series (F001),
Ender-3 V3 Plus (F002), CR-10 SE (F003) and Ender-5 Max (F004) also keep
their gcodes under /usr/data and get the same wrong path.

The K2 SE (F016) keeps its gcodes under /usr/data too, unlike the other
K2 models. OrcaSlicer sent its CFS start commands with a /mnt/UDISK path,
so the printer ignored them.

Add those models to the /usr/data list, and rename the list since it
isn't only K1-family models anymore. Every other model still uses
/mnt/UDISK.

Fixes #17363
Fixes #8735
Fixes #17078
Fixes #17364
2026-11-09 08:54:21 -06:00
TheLegendTubaGuy b4bd9c8492 Remove null checks before delete (#17375)
Deleting a null pointer already does nothing. Enable clang-tidy's readability-delete-null-pointer so new null checks around delete are caught on changed lines, drop the one in DragCanvas's destructor, and remove ParamsPanel::delete_subwindows(), whose only caller is inside #if 0.

The --fix help and summary message in the clang-tidy scripts are reworded to "apply clang-tidy's fixes", since this check has its own fix.

Closes #7847
2026-11-09 07:55:35 -06:00
Damir Galeev 80bfb59837 Fix false "Multi-part object detected" question; rotate imported layout as a whole (#17096)
Turn imported layout as one piece and keep objects in place when centering

Preferred orientation turned every imported object around its own part
origins and then centered it in X, Y and Z without moving its instance.
Objects sank by half their height before the multi-part check, which then
asked about objects standing on the bed, AMF objects shifted by the
offset of their mesh from the file origin, and multi-part objects fell
apart at non-zero angles.

Model::rotate_and_center_objects() turns the file's content as one piece,
around the placed layout's center, or around the file origin for objects
without instances, and centers every placed object with its instances
compensating the shift, so nothing moves and origin_translation keeps
recording only uncompensated centering. Unplaced objects are centered in
XY only, as before minus Z, until they are placed.

Fixes #17084
2026-11-09 20:20:18 +08:00
Lam Wei Lun 2b2bf3f5e2 Report the first layer time in the estimated-first-layer-time comment (#17328)
The comment was written from TimeMachine::prepare_time, which only
accumulates the blocks inside the start G-code's ;TYPE:Custom region, so
it reported the start G-code duration. With a start G-code that just
calls a PRINT_START macro that is close to zero.

The comment is a port of PrusaSlicer 2.6's identical one, which prints
the first layer time, and OrcaSlicer already writes the first layer time
into the .3mf plate metadata as first_layer_time, so G-code and .3mf
disagreed.

Write TimeMachine::first_layer_time instead, for both the normal and the
silent mode line and for every vendor. prepare_time is unchanged: the
preview still shows it as "Prepare time" and the Bambu-only
"; model printing time: ..." line still subtracts it.

The new test slices a cube with a slow start-G-code move and checks that
the comment carries the first layer time, which fails without the change.
2026-11-09 16:04:31 +08:00
Kuzuri d0ca537ebe By object: check each object's top above the bed, raft included (#17235)
The by-object ordering, the too-tall check and the rod check now measure an object by its top above the bed, raft and Z shrinkage included. Before, a raised object was never moved to print last, and a raft could lift objects into the rod without a warning. Belt printers keep the model's own top, as the printable-height check does.
2026-11-08 17:39:32 -06:00
Ian Bassi f55615d748 Add Quarter Cubic non-crossing multiline strategy (#17343) 2026-11-08 18:16:29 -03:00
HanifKoh e23af6d7b0 Unite Tree Support Base Areas in Groups (#17250)
* Unite Tree Support Base Areas in Groups

Uniting thousands of overlapping branch circles in one Clipper call is slow. union_overlapping_ex() sorts them by their left edge, unites them in groups of 16 and merges the groups pairwise. The result differs from a single union only by rounding.

* Describe the Grouped Union's Slivers by Width
2026-11-08 15:01:52 +08:00
Kris Austin b7cc20fd1a Keep the "wait for response" label up to date automatically (#17370)
Keep the wait for response label up to date with Waiting on Author
2026-11-07 22:22:00 -06:00
HanifKoh d8807e03db Merge Each Tree Support Overhang Once per Layer (#17248)
draw_circles() merges each overhang into each roof list once per layer instead of once per node. Adds a test that the top interface covers the whole overhang.
2026-11-07 19:12:00 -06:00
Eldenroot 0f15db8b83 Fix objects printing in the wrong place when identical objects share sliced layers (#17183)
`is_print_object_the_same` now also compares `center_offset()`. Two objects with the same transform can have different offsets, because the offset comes from each object's first instance. Before, the object that took over the other's layers printed shifted.
2026-11-07 19:09:08 -06:00
Arthur Porto 7906d7e02a Check the prime tower requirements only when a tower is printed (#16999)
A plate whose parts use one filament, with only the support on another, was refused for prime tower rules before slicing even when no part needed support and no tower would be printed.

- The layering checks run before slicing only when a tower is certain: the parts use more than one filament, custom G-code changes the tool, or wrapping detection or a smooth timelapse forces one. Otherwise they run in _make_wipe_tower() once the tool changes are known, and only if a tower is generated.
- The "No sparse layers" check before slicing still refuses objects next to the tower. Objects away from it are judged after slicing against the real tower height, and the drag preview draws the height limit plane only on objects the check before slicing refuses.
- The fake tower is reset at each slicing, and the conflict check only uses it when a tower is generated. It was read uninitialized on plates with no tool change.

Fixes #16936
2026-11-07 15:24:04 -06:00
Arthur Porto 6d312b0441 Do not share slices between objects whose height ranges differ (#17279)
Copies of an object with the same mesh, transform and settings reuse one set of sliced layers. The check ignored height range modifiers, so when only one copy had a range, that range was either dropped from the copy or applied to both.

The check now compares the ranges and their settings too, so objects whose ranges differ slice on their own.
2026-11-07 15:20:26 -06:00
HanifKoh 33da2fabfd Speed Up the Tree Support Bottom Contact Search (#17249)
The bottom contact search in draw_circles() rebuilt the top and bottom surfaces of every object layer under each support layer, once per base area. The surfaces are now collected once per object, and a layer whose bounding box misses the base area is skipped. The search also stops at the gap and interface height below the layer, since a contact lower than that changes neither.
2026-11-07 14:35:54 -06:00
Lam Wei Lun 7f124c1b0a Pin expat to 2.10.0 and restore its entity-amplification guard (#17290)
A crafted AMF could freeze Orca on Windows and macOS. The bundled expat 2.5.0 was built without XML_DTD, so its entity-amplification guard was compiled out. Expat 2.10.0 is now built from the release tarball with the guard on. Linux uses the system library only if it is already 2.10.0. Files that rely on unbounded entity expansion now fail to import instead of exhausting memory. The vendored 2.5.0 and 2.2.0 copies are removed, and the old expat.lib in existing Windows deps folders is overwritten. Deps need a rebuild on every platform.
2026-11-07 14:24:08 -06:00
HanifKoh 561b84455a Drop the Tree Support Profiler's Per-Call Timers (#17253)
Tree support no longer times each get_collision(), get_avoidance() and MST line intersection call. Every call read the clock through Boost's slow local_time(), and the worker threads all wrote the same timer state, so the numbers were not reliable. The STAGE_projection_onto_ex stage, which nothing wrote to, is removed too. The per-stage timers stay.
2026-11-07 14:09:56 -06:00
yw4z 9005b64e13 Profile folder fixes / improvements (#17348)
* vivedino xplorer

* prusa

* Delete error_hull_show

* vzbot match model name case

* chuanying match model name case

* flashforge adventurer 5m pro match model name case

* correct name of magicmaker hotend model

* Update BenFab 450_cover.png

* belt cover

* goofoo

* Update IdeaFormer IR3 V2_cover.png

* babybelt

* felix printers

* elegoo neptune 4

* Update CoLiDo DIY 4.0 V2_cover.png

* bump

* use lower case extension on all stl files

* update

* update goofoo

* update felix models

* update

* Update chuanying_x1_buildplate_model.stl

* remove duplicate keys from SeeMeCNC

* fix missing or wrong assets

* fix more assets
2026-11-07 17:35:00 +03:00
Rodrigo Faselli 4a01d5dda3 Outline options (#17319) 2026-11-07 11:32:51 -03:00
Kris Austin da77fc3ee1 Bump the version to 2.6.0-dev (#17340) 2026-11-07 08:07:41 -06:00
Kiss Lorand c01ac8ff44 Validate excluded bed area (#17209) 2026-11-06 22:39:38 -03:00
Grant Harkness bac7112046 Keep the Moonraker print host's port across sessions (#17257)
A print host with a port connected once, then failed in every later session. The agent announced the bare IP, that overwrote the saved address, and the next launch went to port 80. The announce now keeps host:port. For Moonraker, Qidi, Snapmaker and CrealityPrint, connect() also takes the port from the dev_id when the saved dev_ip has none, which repairs records saved by 2.5.0.
2026-11-06 17:37:26 -06:00
HanifKoh 5250597380 Skip the Tree Support Wall Shrink Test When Walls Are Set (#17252)
The shrink test only decides whether to add one wall, so its result is thrown away when tree_support_wall_count is 1 or more.
2026-11-06 16:50:03 -06:00
HanifKoh d4e57d8606 Use Index Arrays in the Minimum Spanning Tree (#17251)
prim() kept its working state in hash maps keyed by pointer and looked them up for every remaining vertex on every step. It now uses arrays indexed by vertex, with the same tie-break, so the tree and its edge order are unchanged.
2026-11-06 16:44:11 -06:00
Ian Bassi 9612260bb5 Fix multiline infill paths that start mid-line and end on themselves (#17341) 2026-11-06 17:53:29 -03:00
Rodrigo Faselli 051723ca24 Fix stale focus-mode plate thumbnails (#17320) 2026-11-06 17:11:50 -03:00
Kris Austin e2c2641acf Give the plugin Permissions tab its own Processes translation (#17339) 2026-11-07 02:47:11 +08:00
Ian Bassi 4cfdccfe45 Fix adaptive and TPMS infill paths that start mid-line and end on themselves (#17334) 2026-11-06 15:11:58 -03:00
Kris Austin 8b9e977458 Refresh the translation catalogs for 2.5.0 (#17336)
* Regenerate the translation template and catalogs for 2.5.0

* Restore and fill translations for the strings added since 2026-11-03

* correct Chinese translations

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-11-07 01:55:20 +08:00
SoftFever 10c9df3578 Complete Simplified and Traditional Chinese translations (#17333) 2026-11-07 01:16:42 +08:00
SoftFever b11009123c Update translation catalogs and fix run_gettext warnings (#17332)
* update locales

* Stop marking the plugin permissions example URL for translation
2026-11-07 01:04:20 +08:00
Felix14_v2 c43c560bbe Update OrcaSlicer_ru.po (#17225)
* Update OrcaSlicer_ru.po

* Oops

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po

* Update OrcaSlicer_ru.po
2026-11-07 00:08:49 +08:00
TheLegendTubaGuy b46bf81396 Fix Flashforge Creator 5 process list, default processes and Pro chamber heating (#17323)
* Fix Creator 5 0.32mm process nozzle and Flashforge default processes

The 0.32mm Standard @FF C5 0.8 nozzle process listed the Creator 5 and
Creator 5 Pro 0.6 nozzle printers, so it showed up for the 0.6 nozzle and
was missing for the 0.8 nozzle. It now lists the 0.8 nozzle printers, like
the other 0.8 nozzle processes.

23 Flashforge printers named a default process they cannot use: Creator 5
and 5 Pro 0.4, 0.6 and 0.8, AD5X, Guider4, Guider4 Pro, and Adventurer 3
Series 0.6, whose default process doesn't exist. Each now names its own
process at the usual layer height for its nozzle: 0.12mm for 0.25, 0.20mm
for 0.4, 0.30mm for 0.6 and 0.40mm for 0.8.

Fixes #17306

* Let Creator 5 Pro heat the chamber when chamber control is on

The Creator 5 Pro start G-code had M191 S0. Orca skips its own M191 when
the start G-code already sets the chamber temperature, so the chamber
never heated, even with chamber control on. The line is removed from all
four nozzles. Orca now writes M191 with the highest chamber temperature of
the filaments that turn chamber control on, and M141 S0 at the end.

The 0.8 nozzle had support_chamber_temp_control off, unlike the other
nozzles, which hid the chamber control setting. Fourteen C5P filaments,
ABS and ASA among them, turn it on, so it is now on for the 0.8 nozzle too.

Fixes #14353
2026-11-07 00:07:39 +08:00
RecyclingRudi 6b0d50bf7c Add Recycling Fabrik and EverLoop filament profiles (#17188)
* Add Recycling Fabrik and EverLoop filament profiles

Add six filament profiles for Recycling Fabrik (Braunschweig, Germany)
and its premium sub-brand EverLoop to OrcaFilamentLibrary:

- Recycling Fabrik rPLA, rPETG, rABS
- EverLoop rPLA Premium, rPLA Premium Matte, rPETG Premium

Values are the manufacturer's own print settings; temperature ranges
and densities follow the manufacturer's technical datasheets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Reindex OrcaFilamentLibrary after merging main

main bumped OrcaFilamentLibrary to 02.04.00.25 as well, and the textual
merge of the index left it invalid JSON. Took main's index, re-ran
update-index to add the twelve new profiles and bumped the version to
02.04.00.26. No profile values changed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
2026-11-07 00:02:42 +08:00
Thalis Antunes ca9204927e Sovol SV08: point the 0.4 and 0.8 nozzle printers at process profiles that exist (#17106)
"Sovol SV08 0.4 nozzle" named "0.20mm Standard @Sovol SV08" and "Sovol SV08
0.8 nozzle" named "0.20mm Standard @Sovol SV08 0.8 nozzle" as their
default_print_profile. Neither process exists in the Sovol bundle; the
processes shipped for these printers are "0.20mm Standard @Sovol SV08 0.4
nozzle" and "0.40mm Standard @Sovol SV08 0.8 nozzle". When the name is not
found, PresetCollection::select_preset_by_name falls back to the first visible
process preset, so selecting one of these printers does not land on its own
process.

Bump the Sovol bundle version to 02.04.00.10.
2026-11-07 00:01:08 +08:00
Ian Chua 932b492252 feat: Add plugin permission management to the Plugins dialog (#17285)
* feat: permissions tab in plugin dialog ui draft

* feat: allow full access, make threading a boolean

* fix: clang-tidy

* feat: save changes button

* fix: clang-tidy

* fix: only allow permission editing when plugin not loaded

* fix: plugin permission drafts, target validation, and sidecar synchronization

* fix: minor html/css changes

* fix: Make plugin permission edits immediate and thread-safe

* refactor: rehaul UI

* fix: add don't show again to request permission dialog

* fix: permission request dialog ui

* fix: clean up plugin permission dialog and mutation APIs

* fix: retry Windows plugin permission file replacement

* test: extract and cover plugin permission validators

* fix: show clear denial for worker plugin file operations

* fix: clang-tidy

* docs: clarify plugin filesystem permissions and clean up declaration

* fix: handle the 3 states of install state read

* fix: match equivalent paths for exact filesystem grants

* fix: preserve unreadable plugin state and allow socket grant editing

* Recover plugins whose install-state file cannot be parsed

---------

Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-11-07 00:00:18 +08:00
Kris Austin d76276778c Bump the Orca Filament Library version to 02.04.00.25 (#17331)
#17029 added the PrintaLot PETG profiles without a version bump, so the bundle changed but its version did not. This fails the version check on the 2.5.0 branch.
2026-11-06 09:36:30 -06:00
Kris Austin b5c4ccd9c5 Fill every filament slot when a project has fewer filaments than tools (#17330)
Opening a project with fewer filaments than the printer has tools tops
up filament_presets and the flush matrix, but leaves filament_colour
and the other per-filament arrays at the project's count. Slicing then
fails the flush matrix check, and an overwriting filament sync reads
past the end of those arrays.

load_current_presets() used to fill the arrays on every load. Since
#15385 it compares against filament_presets, which the top-up has
already raised, so it no longer runs. Grow the arrays where the project
is loaded.
2026-11-06 09:23:38 -06:00
Lim Jooyoung 6aaee84c1f Remove settings OrcaSlicer ignores from the Prusa process profiles (#17231)
67 Prusa process profiles write keys that PrintConfigDef does not define,
so the loader drops them and they never reach a slice:

- inital_layer_height (64 files), a misspelling of initial_layer_print_height
- tree_support_bramch_diameter_angle (65 files), a misspelling of
  tree_support_branch_diameter_angle
- tree_support_branch_diameter_double_wall (17 files), an option OrcaSlicer
  removed in 2.3.0

The loader already drops these keys, so removing them changes no setting.
Each misspelled value in a selectable preset also equals the value the
correctly spelled key resolves to, so renaming them would only repeat values.
Bump the Prusa bundle version to 02.04.00.18.
2026-11-06 23:19:01 +08:00
Eric McCann 0edd6693a6 Prusa XL: "detraction_speed" does not exist (#17259)
Fix Prusa XL deretraction speed profile keys

Use the recognized deretraction_speed key so XL presets apply their specified 25 mm/s and 15 mm/s speeds instead of inheriting 30 mm/s.

Co-authored-by: Codex <codex@openai.com>
2026-11-06 23:16:16 +08:00
Thalis Antunes 1f7e195d88 Sovol SV08 MAX: add 0.2 and 1.0 nozzle variants (#17108)
The SV08 MAX ships with 0.2, 0.4, 0.6, 0.8 and 1.0 mm nozzles and uses the
same extruder as the Sovol Zero, but the bundle only had 0.4, 0.6 and 0.8.

Machines copy the MAX 0.4 and 0.8 printers; layer-height range and
retraction come from the Sovol Zero 0.2 and 1.0 printers. The 0.2 process
applies to the MAX 0.4 process the same changes Sovol made between its SV08
0.4 and SV08 0.2 processes. The 1.0 process takes line widths, layer heights
and extrusion speeds from the Sovol Zero 1.0 process and keeps the MAX 0.8
accelerations, overhang speeds and shells. The eight SV08 MAX filaments list
the two new variants, and the model advertises all five nozzles.

Bump the Sovol bundle version to 02.04.00.10.
2026-11-06 23:14:03 +08:00
sirjassam 7374b734d3 Add PrintaLot PETG profiles for Bambu Lab printers (#17029)
* Add PrintaLot PETG profiles for Bambu Lab printers

* Remove redundant PETG defaults after independent review

* Declare PrintaLot PETG's own values on its base

The type, 255 °C and the 17 mm³/s limit are PrintaLot's values, not the
library's PETG defaults, so they should not change if fdm_filament_pet
does. filament_type is also part of the filament_id.

* Drop PrintaLot PETG values Bambu Lab printers never read

- The multitool ramming values: only the Type 2 prime tower reads them,
  and Bambu Lab printers always use Type 1.
- volumetric_speed_coefficients: only read with adaptive volumetric
  speed, which is off.
- filament_retract_length_nc outside the H2C: only the H2C's
  change-filament G-code reads it.
- retraction_distances_when_ec where long retraction on extruder change
  is off.
- filament_preheat_temperature_delta outside the H2C: only used on
  printers with several nozzles per extruder.
- filament_flush_temp_fast 0 and filament_extruder_variant
  "Direct Drive Standard": both are the defaults.

* Move values shared by the PrintaLot PETG presets to the base

The 17 mm³/s limit and slow_down_min_speed are the same in every preset
except the 0.2 nozzles (1 mm³/s) and the A2L 0.2 nozzle (40 mm/s), and
most presets write the same placeholder filament start and end G-code.
Presets with other values keep their own.

* bump OrcaFilamentLibrary.json

---------

Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-11-06 23:12:55 +08:00
Lam Wei Lun 719fdcf4dd By object: keep rotated copies of an object in their list order (#17286)
* By object: order rotated copies of an object by their list position

Copies of one object that differ in rotation get one PrintObject each, and
print.objects() lists those groups by transformation. sequential_print_
clearance_valid() keyed the instances by their object's index, which all
copies share, so std::stable_sort kept the transformation grouping and every
second copy on a rotated plate printed out of place.

Key each instance by its position in the model's object and instance lists
instead. No key repeats, so the sort no longer depends on being stable, and
arrange_order is then the list order the G-code export and the sequence
labels already print in.

Fixes #17260.

* Keep the sequential printed-copy tests in step with the list order

The new by-object test rotated a cube centred on its corner, which moved the
footprint by half the cube and closed the 12 mm grid gap under the 2 mm
clearance distance, so validation rejected the plate. Centre the mesh on the
object origin so the rotation turns the footprint in place.

Sequential clearance warned the copy that print.objects() listed first, which
for a plate of rotated copies was the rotated one. Copies now print in object
list order, so print validation warns the first copy in the list; expect that
copy from the preview as well, and drop the now incorrect header comment.
2026-11-06 21:30:38 +08:00
GNUGiminot 2ec1a0732f Plugin audit: keep non-Latin path names intact in the keyword check (#16925)
* Keep non-Latin path names intact in the plugin audit keyword check

is_denied_path_keyword() lowercased every path component with
std::tolower(), which follows the C locale. With a single-byte locale,
which the UI language sets on Windows (Russian_Russia.1251), that
rewrites bytes of UTF-8 sequences: "Новая папка" is no longer valid
UTF-8, and has_denied_config_extension() then throws "boost::filesystem
::path codecvt to wstring: partial" while turning it back into a path.
The exception left the CPython audit hook, so the plugin call never
returned, and the app crashed later in PyFrame_GetCode.

The keyword check now uses the file's ascii_lower(), which lowercases
A-Z only; the keywords are ASCII, so matching stays case-insensitive.
ascii_lower() itself no longer goes through a locale-aware
boost::algorithm::to_lower(), so the network permission keys get the
same guarantee. The audit hook also no longer lets any C++ exception
reach the interpreter: a check that fails denies the event, like an
unanswered prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Address review: narrower try in audit_hook, shorter comments, a test for the catch

- Wrap only audit_plugin_event() in the try, so release_frames() is called
  once after the event is decided.
- Shorten the ascii_lower() comment and drop the one that repeated it.
- Use only the .1251 locale in the non-Latin path test.
- Test that a permission prompt that throws denies the event, which
  reaches the new catch on every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: GNUGiminot <215263196+GNUGiminot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
2026-11-06 20:35:44 +08:00
Lam Wei Lun d2ade00ad8 Speed Dial: fix side effects of single-click launch (#17301)
* Speed Dial: fix side effects of single-click launch

Follow-up to the single-click launch behaviour:
- hovering a row or favourite previews it in the footer, so its description
  and wiki link stay readable without running it
- the click that dismisses the pin menu only closes the menu instead of also
  running the row under the cursor
- a double-click on "Go to tab..." no longer jumps to the tab that renders
  under the cursor

* Speed Dial: keep the hover preview on the row the pointer rests on

mouseenter also fires when rows move under a stationary pointer, so typing
a search or pressing the arrow keys moved the footer onto whatever row
scrolled beneath it while Enter still ran the highlighted one. Listen to
mousemove instead: only the pointer's own motion previews a row.

Moving from a row to the footer crosses the rows below it, and each of
them replaced the preview, so the Wiki link belonged to the last row
crossed. Commit the preview only after the pointer rests (150 ms) and
drop a pending one when it leaves the list, so the footer keeps the row
the pointer came from.

* Speed Dial: restart the hover preview timer on pointer movement

The 150 ms settle timer ran from the moment the pointer entered a row, so a row that took longer than that to cross was previewed on the way down to the footer; the wiki link then described a crossed row instead of the row the pointer came from.

Restart the wait on every move of 6 px or more and cap it at 1 s, so a crossed row is never committed while a pointer that never rests still previews the row it stays on. Moves under 6 px are hand jitter and keep the running timer, so a shake still previews. The timing is pinned by a node-vm regression test with faked timers.

---------

Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
2026-11-06 20:10:29 +08:00
HanifKoh 606b50f187 Restore the Custom Camera Source in the Device Tab (#17326)
* Restore the Custom Camera Source in the Device Tab

The printer-agent refactor reused the Device tab's WebView for the
generic snapshot stream and dropped the "Custom camera source" row from
the Camera Setting popup along with the code that showed the user's URL
in that WebView. The two app-config keys were then read nowhere, so
anyone who had a custom camera configured lost it on upgrade.

Bring the row back and show the stored URL when the source is enabled,
with the title-bar switch button toggling between it and the printer's
own stream. The agent-driven snapshot path leaves the WebView alone while
a custom source is enabled, a URL without a scheme gets http://, and the
Enable/Disable labels are translatable separately.

* Offer the Custom Camera Source Only Alongside the Bambu Native Stream

The custom view hides the Device tab's media control and play bar, which
every agent camera mode plays through (snapshot mode via the very WebView
the custom source takes over), and the 2.4.2 feature was only ever used
against the Bambu native stream. Gate the row and the stored URL on camera
mode none, which is that stream, so the custom source never contends with
an agent's own playback. Stop the native stream when the custom view takes
over, reapply the switch icon on rescale and theme change, trim and
normalise the URL in one shared helper, and reword the hint to say a URL
is expected.

* Keep the Custom Camera View in Step With the Agent's Camera Mode

Selecting a printer whose agent streams through the shared WebView
leaves the stored custom source unsupported, so reapply the view
whenever the stored state and the applied one differ, on every camera
tick and on the no-printer reset. Read the config flag before asking
the agent for its mode, so users without a custom source pay one config
lookup per tick. Stop the printer stream for the view switch without the
failure bookkeeping, which could open the LAN dialog mid-connect. Write
the trimmed URL back into the field and store it only when enabling.

* Load the Custom Camera Page Only While It Is On Screen

Let the show helper own the WebView page: it stops the native stream,
then loads the URL when the custom view comes up and a blank page when
it goes away, so a hidden view pulls no stream and the load never races
the stop. Track the applied state in a member and evaluate the stored
state once per tick. A view-switch stop leaves no retry count or
back-off behind, the URL field is read-only while the source is
enabled, and the gating comment says what mode none actually is.

* Pass the Custom Camera URL Through Once Per Tick

Read the stored URL once per camera tick and hand it to the sync, apply
and show helpers, so a toggle can no longer show a blank page when the
URL is empty and the camera-state branches no longer start with an empty
if. Disable the URL field while the source is enabled, which greys it
out, instead of a read-only state with no visual cue. The gating comment
now gives the real reason: the custom view hides the media control and
play bar that every agent mode plays through, and the feature was only
ever used against the Bambu native stream.

* Offer the Custom Camera Source With the Bambu Printer Agent Only

Printer agents are not for general use in 2.5.0, so gate the row on the
active printer agent being the Bambu one instead of on its camera mode.
The interaction with the other agents' camera modes gets a proper design
after the release.

* Note That the Custom Camera Source Is a Temporary Bambu-Only Patch

Say at the gate and in the header that the feature is a patch for the
Bambu printer agent and is to be deprecated or extended to the other
agents once printer agents are fully implemented.
2026-11-06 20:05:25 +08:00
Sergei cb80a0db84 Fix/wipetower klipper m400 stalls (#17246)
* WipeTower2: on Klipper, sync motion only before temperature commands

Follow-up to #15133. On Klipper, flush_planner_queue() emitted M400 at
every toolchange boundary, stalling the toolhead over the tower. Keep the
sync only before M104/M109/M591, and drop the sync line left behind when
GCode.cpp strips the interface-temperature M109.

End the deretraction placeholder with a newline: without the M400 that
used to follow it, the next tower move was glued to the placeholder line,
skipped post_process_wipe_tower_moves and kept tower-local Y.

Creator 5 Pro, 247 toolchanges: 1235 M400 -> 247 (~30 min saved).

* Update src/libslic3r/GCode.cpp

Good point, done. The strip now uses flush_planner_queue_command() and follows whatever the tower writes.

Co-authored-by: Kris Austin <kris.austin@gmail.com>

* tests: move the wipe tower slice and shared checks into one helper

* WipeTower2: keep the sync at the end of the unload on Klipper

[change_filament_gcode] and Tn are macros on Klipper; their non-motion
parts run when parsed, so without the sync a filament-change macro could
run while the unload and ramming moves are still queued.

Creator 5 Pro, 247 toolchanges: 494 M400 instead of 1235 (247 in this PR
before). The other boundary flushes, which stalled the toolhead over the
tower, stay removed.

* tests: check the unload sync before each change_filament_gcode

* WipeTower2: don't sync the cooldown after the interface wipe

The reset to the base temperature after the interface wipe isn't
timing-critical, but its M400 stopped the head over the tower before the
tower perimeter. Test print, Creator 5 Pro, 247 toolchanges: 3:22 with
the sync, 3:17 without it.

* tests: check only the interface cooldown for a missing sync

* WipeTower2: skip the cooldown sync on Klipper only

---------

Co-authored-by: Kris Austin <kris.austin@gmail.com>
Co-authored-by: GhZserG <ghzserg@zmod.link>
2026-11-06 18:58:00 +08:00
SoftFever 73e64d3bc5 Sign Windows release and nightly builds in CI (#17305)
* Sign Windows release and nightly builds in CI

* Replace the README's SignPath signing policy with a signed-builds note
2026-11-06 13:33:40 +08:00
Ian Bassi c78272f583 Keep realistic view on while painting seams, supports and fuzzy skin (#17317) 2026-11-05 20:10:22 -03:00
Kris Austin 73766ddd42 Ask for before and after screenshots in the PR template (#17303)
CONTRIBUTING.md already asks for them on GUI changes, but the template
only asked for relevant screenshots. Use the same wording, link to the
table of what each kind of PR needs, and link the How to Contribute
wiki page.
2026-11-06 01:37:13 +08:00
Lam Wei Lun a620d804ef By layer: keep As object list copies in their list order (#17232)
By layer: order As object list copies by their list position

sort_object_instances_by_model_order() keyed every instance on its object's
index when it initialized the order, so all copies of an object tied.
print.objects() does not list the copies in list order either: copies with a
different rotation live in separate PrintObjects, ordered by transformation,
so the ties were broken by that grouping and the copies printed as 2, 4, 6,
1, 3, 5. std::sort reordering the ties made it worse from 17 instances up.

Number the instances by their position in the model's object and instance
lists instead. No order key repeats, so a plain sort is enough; the renumber
after it compacts this print's instances to 1..n. The other intra-layer orders
and the by-object path are unaffected.

The new test rotates every second copy, which fails on every platform before
this change, MSVC included.
2026-11-05 21:40:41 +08:00
SoftFever 637d7a9ce6 Enable vendor profile updates by default, except in stealth mode (#17289)
* always enable OTA

* Stop vendor profile update checks in stealth mode

* Keep vendor profile updates off in dev builds
2026-11-05 18:46:13 +08:00
Lam Wei Lun f96bbe8db1 Speed Dial Minor QOLs (#17291)
Single click to launch actions. Close button removed to prevent cluttering
2026-11-05 18:09:59 +08:00
yw4z b2978d1c73 Fix: Prevent deselecting object and closing widget while clicking to toolbar background / divider (#15548)
* init

* simplify code

* simplify comments

* update

* update
2026-11-05 14:19:17 +08:00
HanifKoh 70c12f5cba Warn When an Object Overrides Settings Spiral Vase Mode Needs (#17240)
Enabling spiral vase mode in the GUI resets sparse infill, wall loops and
top shell layers in the global config only. An object, part or height range
that overrides them keeps its own values, and its layers with infill or more
than one wall are printed without spiralizing, with no hint as to why.

Print::validate now warns once per such object, naming it and the first
conflicting setting so the notification jumps to it.
2026-11-05 13:45:43 +08:00
Lam Wei Lun 61e1841f9d fix: let the 3D navigator keep the mouse for the whole drag (#17284)
The navigator is drawn into ImGuizmo's NoInputs "gizmo" window, so ImGui
never owns the press (mouse_avail_to_imgui is false) and WantCaptureMouse
only reflects what the previous frame requested. ViewManipulate asked for
capture only on frames with a non-zero MouseDelta, so the still frame that
follows the press dropped it.

The next motion event then reached the canvas, which latched it as a camera
drag. With an object behind the navigator that drag is refused at
GLCanvas3D::on_mouse (the m_hover_volume_idxs gate of the rotate branch),
so nothing marked the scene dirty, no frame rendered, and the navigator never
rotated. The armed isClicking survived to the release frame and snapped the
view to the pressed panel instead.

Request capture for as long as the press is held, so the navigator owns the
whole gesture.

Fixes #17282
2026-11-05 13:32:32 +08:00
Lam Wei Lun bd3e9aeb96 fix: stop the Speed Dial dismissing itself on the first open (#17245)
* fix: stop the Speed Dial dismissing itself on the first open

Opening the dial with Space and not touching anything closed it again a
moment later, on GNOME and KDE, X11 and Wayland, and only on the first open.

The dial hides on wxEVT_ACTIVATE(false), but wxGTK does not deliver that
event to the window that lost the focus: gtk_frame_focus_out_callback sends
it to g_activeFrame, the toplevel that was activated last (wx
src/gtk/toplevel.cpp:192-205). A deactivation that belongs to another
window, or the same one arriving while the dial is still taking the focus,
therefore read as "the user dismissed the dial". The first open is the only
one that maps the window, moves it, resizes it to its content and grabs
focus into a web view that has never held it, so it is the only open
exposed to that ordering.

Validate the dismissal instead of trusting the event: arm a 150 ms one-shot,
cancelled by any activation, and hide only if the dial is still shown and
its window is no longer active. On GTK ask the window with
gtk_window_is_active(), because wxTopLevelWindow::IsActive() resolves
through wx focus tracking, which does not follow the focus that WebKit's
native widget takes. Also skip the pre-map focus grab on the first open: at
that point wxGTK has not mapped the window yet, so the grab cannot land.

speed_dial_should_hide() is a free function, so the rule is covered by
tests/slic3rutils/test_speed_dial_dismiss.cpp without a GUI.

* docs(wxwidgets-skill): document the validated Speed Dial deactivation

Section 10 described the dial's old handler, which hid on every
wxEVT_ACTIVATE(false). The skill is the review ground truth, so it has to
match the code: the deactivation is now validated after a settle interval
against the window's real active state, because wxGTK sends that event to
the last activated toplevel whatever window lost the focus.

* Ignore Page Changes of Inner Books in the Main Tab Handler

The main frame's tab-panel handler receives the page-changed event of
any book inside a page, because wxBookCtrlEvent propagates and the
Calibration page's Tabbook has no handler of its own. It then treated
the inner page switch as a main tab change: it reset the selected tab,
toggled the undo/redo buttons and called SetFocus() on the current page.

On wxGTK, SetFocus() on a child of a visible but inactive top-level
window presents that window. While the Calibration page is built in the
background after start-up, this re-activated the main window and the
Speed Dial, which hides when it loses the focus, closed by itself a
moment after its first open on Linux.

Only act on events whose object is the main tab panel.

* Include wx/timer.h Where the Speed Dial Binds Its Timer

* Describe the Real Cause of the Speed Dial's First-Open Close

The deferred, re-checked hide absorbs a focus bounce shorter than its
delay. It did not stop the first-open close, which was the main frame
activating itself from its tab handler; say so in the comments, the
test and the skill reference instead of describing a misdelivered
deactivation.

---------

Co-authored-by: Hanif Koh <hanifkoh@outlook.com>
2026-11-05 11:34:33 +08:00
Rodrigo Faselli 834c6987e0 Hide lightning angles if there is no infill (#17277) 2026-11-04 21:34:00 -03:00
HanifKoh 1a61ffd32e Keep a Filament Slot Past the Colour Arrays From Staying Frozen (#17262)
PlaterPresetComboBox::update() froze the combo and returned without
thawing it when the slot had no colour icon, which happens on a tool
changer whenever filament_presets is topped up to the tool count while
the colour arrays keep the project's shorter length. The leaked freeze
count left the combo unpainted for the rest of the session.

The slot now shows a blank swatch and still fills its list, and
update_ams_color() grows the colour arrays to the slot before writing,
as sync_colour_config() already does.
2026-11-04 13:59:04 -06:00
HanifKoh dd0079ec64 Start the Orca Cloud Sync Cursor at Zero (#17263)
Fixes #17256

On a machine with no saved `sync_state`, the first `sync/pull` sent whatever was in memory as `?cursor=`. The server answered 400, nothing was downloaded, and the account's presets never arrived because only a 410 clears the cursor.

`SyncState::last_sync_timestamp` now starts at zero, so a session with no saved state pulls everything. `SyncPullResponse::next_cursor` had the same problem on a 304, where a stray value would have been saved to `sync_state` and sent on every later pull, so it and the other scalars in `ProfileUpsert` and `SyncPushResult` start at zero too.
2026-11-04 13:57:23 -06:00
SoftFever 79985162e4 Keep issue dedupe agents in the foreground so runs finish 2026-11-05 01:31:46 +08:00
SoftFever 8add55f17b Allow the issue dedupe agents to use the GitHub helper scripts 2026-11-05 01:11:12 +08:00
SoftFever 91b0c36c54 Let backfill-dispatched issue dedupe runs start 2026-11-05 00:32:51 +08:00
SoftFever 6114c7b496 Fix the duplicate backfill workflow and run it in paced batches of open issues 2026-11-05 00:23:52 +08:00
SoftFever b2d254921c Update issue dedupe to upstream's current workflow on Claude Haiku 5.5 (#17264) 2026-11-05 00:10:14 +08:00
Lam Wei Lun 6839c9d344 Invalidate filament grouping when the AMS material inventory changes (#17195)
Print::m_extruder_filament_info feeds filament grouping, but it was a plain
member with no change detection and no invalidation entry point. Changing only
the device-side AMS material inventory, such as a spool colour, therefore left
a finished slice valid: Print::apply() reported UNCHANGED, the grouping steps
stayed done, and export re-emitted the previous G-code with a stale
filament_map.

Compare the inventory in Print::apply() and invalidate the grouping steps when
it changed:

- set_extruder_filament_info() now only stashes the payload, so apply() can
  compare it against the installed one and act on the change under the state
  lock.
- The comparison projects both payloads exactly as grouping does: colour, type,
  tray name, support flag and filament id per tray. Volatile AMS keys such as
  remaining amount, temperatures and filament_changed therefore do not count.
- A changed inventory invalidates psWipeTower and psSkirtBrim, matching what
  extruder_ams_count already does, and escalates to APPLY_STATUS_INVALIDATED
  only when a step was actually taken back.
- A payload carrying no tray configs at all is treated as "not known yet"
  rather than "no filaments", so an AMS reconnect does not invalidate a
  finished slice, while clearing the last spool still does.
- The Plater hands the inventory to apply() before applying, so the change
  rides the same pass.

Adds comparator tests for the inventory projection and an integration test that
drives process() and apply() over a two-extruder auto-match print.
2026-11-04 21:45:25 +08:00
Kris Austin 0b1d825142 Fix the freeze before the Creality send dialog opens on a printer without a CFS (#17177)
Fixes #17128

Clicking Print on a Creality printer asked it for its CFS slots on the UI thread, with the 10 s command timeout. A K1C without a CFS never answers that query, so OrcaSlicer froze for 10 s on every click.

The send dialog now opens right away and reads the printer on a background thread. Upload works at once, and Upload and Print turns on when the read ends. The slot query waits 5 s, or the full 10 s once the printer reports `"cfsConnect": 1`, and stops as soon as it reports `"cfsConnect": 0`. When there is no filament mapping, the dialog says whether the printer reports no CFS, lists no slots, or can't be reached.
2026-11-04 07:40:11 -06:00
anjis 3bda653448 Fix Type 1 wipe tower filament statistics for non-Bambu printers (#17199) 2026-11-04 09:31:08 -03:00
Ian Bassi d607d7f4ad Fix gap infill printing with the outer wall filament with classic walls (#17229) 2026-11-04 09:30:34 -03:00
Ian Bassi 2873db9e06 Draw the Spiral Inset icon as a square spiral that follows the outline 2026-11-04 08:56:28 -03:00
Ian Bassi 9afa96e92f Fill internal solid Spiral Inset with Arachne walls
Internal solid infill fell back to fixed width loops so that Arachne's open
walls would not be printed after an outward spiral, which ends at the edge
and travelled back to the centre for them. Fixed width loops leave strips
up to two lines wide in the middle of an island and wedges where it
branches: on calicat.3mf they need 218 mm of gap fill against 53 mm with
Arachne, and with gap fill off for internal solid those gaps stay empty.

Keep Arachne for every solid surface and print each open wall at the centre
end of the nearest spiral instead: before an outward spiral, which starts
there, and after an inward one, which ends there.
2026-11-04 08:56:28 -03:00
Ian Bassi 88c4c1e915 Print gap fill after the lines next to it in fills that keep their order
insert_gap_fill() put each piece of gap fill wherever it added the least
travel, which could be before the extrusions bordering it: the centre gap
of a Spiral Inset printed before the spiral that starts there, and gaps
where spirals meet printed before the later spiral. Each piece now only
goes after the last extrusion of its fill that passes within half its
widest width and a line spacing of it.
2026-11-04 08:56:28 -03:00
Gazi Faysal Jubayer 99fada6aab Travel back from a lift at the lifted height, then descend (#16933)
* Travel back from a lift at the lifted height, then descend

After a tool change on the Bambu Lab prime tower, the nozzle is lifted
at the tower and then travels to the next object. That travel is forced
to set the layer Z, which sent it down the final branch of
travel_to_xyz(): it cancelled the lift and emitted one combined XYZ move,
so the nozzle sank over the print and left color streaks. When the
nozzle is lifted and the target is lower, move in XY first and descend
at the target, as the branch already does after a filament change.

Fixes #14968

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep a lifted nozzle up over every travel that descends to the print

A multi-point avoid-crossing or exclusion-volume travel now stays at the
lifted height and descends only at its last point. The split descent also
covers printers with an axis remap, takes its Z move from the target
position, and is skipped when X and Y do not change. The test parses with
GCodeReader and runs with arc fitting both off and on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check exclusion volumes from the height a lifted nozzle travels at

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Merge the lifted and multi-point travel branches into one loop

The 2-point travel, the lifted detour and the avoid-crossing detour now
share one loop; a detour only moves to the layer height at its first point
when the nozzle is not staying lifted. A new test lifts at each layer change
of a concave part with avoid crossing walls on, so lifted detours of more
than two points are checked for a nozzle that comes down before the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep an exclusion-volume detour lifted when its lift is still pending

A retraction leaves its lift pending until the first leg of the travel.
The interpolated-Z detour only checked for a lift already made, so it
lifted on the first leg and then lowered at each later waypoint. A lift
the first leg will make now skips the interpolation, so the detour stays
lifted and descends at its last point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Kris Austin <kris.austin@gmail.com>
2026-11-04 08:27:10 -03:00
HanifKoh 23f82fa631 Count the Fake Printer's Close Frame When It Arrives (#17210)
The fake printer counted a close frame when its read completed, which
Beast does only after sending the reply and tearing the socket down. The
agent's stop returns on the reply, and the test then releases the printer,
which closes the socket. When that close beat the teardown, the read
failed with another error, the frame went uncounted, and the test waited
out its 10 s for nothing.

The control callback sees the close frame before the reply goes out, so
counting there leaves no window, and the wait helper is no longer needed.
2026-11-04 19:23:04 +08:00
HanifKoh 7e3d5d4d04 Ignore a Print Sequence Count That Does Not Match Its Values (#17243)
* Ignore a Print Sequence Count That Does Not Match Its Values

get_other_layers_print_sequence split other_layers_print_sequence into
other_layers_print_sequence_nums groups and read the layer range from the
first two entries of each, checking the layout with an assert that Release
builds compile out. A count raised without its values, as a command line
override does on a project storing the default placeholder, read past a
one-element vector. A count that does not divide the values, or groups too
short for a range and one extruder, now give no custom sequence, as the
default pair does.

* Log the Ignored Print Sequence and Test the Two-Group Case

A pair that is ignored now says so in the log, since the removed assert was
the only sign of it. The test covers two groups that divide the values but
have no extruder, and names the negative-count case.
2026-11-04 19:09:57 +08:00
Lam Wei Lun 78134d24c6 Keep the Speed Dial anchored to the main window (#17242)
fix: keep the Speed Dial anchored to the main window

The dial is a long-lived hidden window. Its origin was computed once, at
construction (DPIAware's CenterOnParent and create_webview's), and never
again, so moving or resizing the main frame - or dragging it to another
display - left the dial at the centre of the frame's original rect. Wayland
only looked correct because the compositor places the window there.

Re-derive the origin from the parent's current screen rect on every open,
again once the window is mapped (GTK drops a position requested before the
map), and on a DPI change. The origin comes from the fixed 540x282 box
rather than the current client height, so the content-driven resize does
not move the window while the user types. On GTK, clear the dialog's
default CENTER_ON_PARENT hint so the window manager stops overriding the
computed coordinates.

The geometry is a free function, so the centring and the work-area clamp
are testable without a GUI.
2026-11-04 17:14:04 +08:00
Ian Chua 9281032fdc feat: add plater notifications for orcacloud plugin updates (#17168) 2026-11-04 14:41:23 +08:00
HanifKoh 1c9f6f9318 Join Precise-Z Sliver Layers to the Prime Tower Layer Below (#17204)
* Join Precise-Z Sliver Layers to the Prime Tower Layer Below

Precise Z height ends each object at its exact top, so another object's
layers can print a few microns above these. Each sliver became its own
wipe tower layer, and a tool change on it was sized for that height: a
0.0009 mm layer asked for a 230 mm ramming band, which grew the tower
past the bed ("Prime tower is partially outside the printable area").
Once sized correctly, G-code export lost step with the tower and threw
"append_tcr was asked to do a toolchange it didn't expect".

A tower layer thinner than half the printer's minimum layer height now
joins the tower layer below: ToolOrdering records the tower layer each
layer prints on and whether it finishes it, the tower plans the joined
tool changes on that layer's z and height, and the G-code neither
advances the tower on a joined layer nor finishes the layer before it.

* Finish a Joined Prime Tower Layer on Its Last Tool Change

The joined layer always finished the tower layer, so a joined layer that
changed no tools asked for a result after the layer below had taken them
all and threw "Wipe tower generation failed". The layer that finishes is
now the last of the group that changes tools, or the last one when none
does, matching how a single layer merges its finish into a tool change.

A joined layer also reset the Type 1 tower's first print, so smooth
timelapse replayed the tower layer's wall and threw the same error.

Layers are now joined below the printer's minimum layer height instead of
half of it: precise Z height can move a layer off by up to a layer height,
and the 0.04-0.08 mm layers left on their own still grew the tower off the
bed.

* Print Joined Prime Tower Purges at the Tower Layer's Z

A joined layer printed its purges at its own nozzle height, up to just
under the minimum layer height above the tower layer, so the beads were
not pressed onto it. The emitter now descends to the tower layer's z for
a joined layer, travelling over the tower first and climbing back after,
the way it already does for a tower compacted below the objects.

Layers sliced at exactly the minimum layer height sum to gaps a hair
under it and were joined to the layer below; an EPSILON margin keeps
them apart.

* Travel Over the Prime Tower Before a Joined Layer Descends

With no change_filament_gcode and no nozzle change, the Type 1 emitter
descended to the joined tower layer's z while the head was still over the
part, then travelled to the tower at that z. It now travels over the tower
first. The tests check that every descent below the object layer happens
over the tower.
2026-11-04 13:14:01 +08:00
HanifKoh 5191a5efeb Place Organic Tree Support Tips in a Fixed Order (#17198)
Overhang layers place organic tree tips in parallel. Each thread appended
its tips straight into the shared per-layer lists under a mutex, and a tip
was dropped when a nearby one was already there. Thread timing therefore
decided the tip order and which of two close tips survived, so the same
project could give different support from one slice to the next and on
machines with different core counts.

Each overhang layer now collects its tips and roofs in its own buffer. The
buffers are committed in overhang layer order once the parallel pass ends,
which gives the single-threaded result on any thread count.
2026-11-04 13:12:04 +08:00
HanifKoh aee4dfc705 Keep Flatpak Runtimes on a Volume in CI (#17207)
Updating a runtime renames its old deployment. On some hosted runners that
rename fails with "Invalid cross-device link" because the deployment sits in
an image layer of the container's overlay filesystem. Moving /var/lib/flatpak
to an anonymous volume keeps the rename off overlay.
2026-11-04 12:40:11 +08:00
Kuzuri 05a92cd0cf By object: only the part of an object above the rod can collide with it (#15544)
The by-object "too tall" check used each object's whole footprint to decide whether the rod can hit it. An object that reaches above extruder_clearance_height_to_rod now uses only the Y range of its geometry above the rod. That range is widened by how far the rod reaches past half the radius (extruder_clearance_dist_to_rod) and kept inside the footprint. It is used for both the print order and the too-tall check.

Objects below the rod keep the footprint, so on profiles with the lid below the rod they still get the rod height when they share a Y band with a later object. Objects with a draft shield or a skirt tall enough to reach the rod also keep the footprint. The mesh walk accounts for a raft.

Tests cover fins facing away, facing each other and one of each (print order), raised objects, a draft shield and a tall skirt, the A1 mini Distance to rod, two boxes closer than Distance to rod, a raft, the lid below the rod with and without a raft, and a rotated instance.

Most stock profiles leave Distance to rod at the default 40, which can be less than the printer's real reach. Until those values are measured, a narrow top closer to a neighbor than the real reach can still pass.
2026-11-03 21:34:08 -06:00
Brandon Wees 08f69da5ae fix: open macOS deep links when OrcaSlicer is not already running (#16769) 2026-11-04 10:29:14 +08:00
TheLegendTubaGuy a30aa7ba8d Connect the selected printer agent to a printer saved under the Orca agent (#17141)
A printer saved while its preset used the default Orca agent stayed tagged "orca" after the preset moved to another agent such as Moonraker. select_machine() reused that entry as is, but the new agent's machine list can't see it, so the printer never connected and filament sync did nothing.

select_machine() now re-inserts such an entry for the active agent, which retags it and replaces the placeholder access code with the preset's API key. Entries saved under any other agent are left alone, so a code entered for that agent is kept.

Fixes #17004
2026-11-03 19:18:39 -06:00
akaitsukiakari 70bc685101 Fix crash when syncing filaments after a plate is deleted (#17042)
The sync dialog is reused between syncs, and its plate index is left over from the last one. If that plate no longer exists, because it was deleted or a project with fewer plates was loaded, the next sync read the thumbnail of a null plate and crashed. reinit_dialog() now falls back to the current plate when the index is out of range.
2026-11-03 19:16:35 -06:00
Valerii Bokhan 0b041740b1 Fix Wipe Inward retraction splitting and sandwich wall offsets (#17160) 2026-11-03 21:41:16 -03:00
TheLegendTubaGuy 41351efc34 Ignore BN_DBLCLK in toggle-button widgets on Windows (#17194)
CheckBox, SwitchButton and RadioBox are owner-drawn wxBitmapToggleButtons.
On a double click wxAnyButton turns the second click into a normal click,
but the button still sends BN_DBLCLK as well and wxToggleButton toggles on
both, so a quick double click toggled three times and looked like a lost
click. RadioBox callers select on mouse down, so there the extra toggle
cleared the value while the button still drew as selected.
2026-11-03 18:26:43 -06:00
Ian Bassi 670db4b772 Faster and better outline (#17111)
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
2026-11-03 21:26:16 -03:00
Kuzuri 8cdc68a6a0 Sequential print: keep copies of one object in their list order (#17217)
The by-object ordering from #14987 broke ties in its ready queue by object_index, which every copy of an object shares. std::sort isn't stable, so on a plate with enough copies it could shuffle them. The copies then printed out of list order, and validation warned that one was printed later than its place in the list to avoid a collision, even though nothing had been held back.

Ties now use each instance's place in the object list, the same order the fallback uses. The test validates 200 copies on a grid and checks there's no reorder warning and the copies keep their list order.
2026-11-03 15:23:16 -06:00
mosfet80 8d423e0e6d Update gst-plugins-good to 1.26.11 in the Flatpak manifest (#16516)
Build the Flatpak's jpeg and gtk plugins from gst-plugins-good 1.26.11, so they match the GStreamer 1.26.11 core in the GNOME 50 runtime. They were built from 1.22.8.
2026-11-03 15:20:15 -06:00
Alexandre Folle de Menezes 26a3937771 Standardize the spelling of "RepRapFirmware" (#17174)
Standardize the spelling of "RepRap Firmware"
2026-11-03 16:23:12 +03:00
HanifKoh 1898de34d1 Stop Re-Parenting the Settings Dialog on Windows (#17161)
Popup() called Reparent() on the first open, which is a plain SetParent:
the dialog kept its popup style but became a real child of the main
window. The Windows taskbar peek then drew it over the main window even
after it was closed and hidden.

The dialog already has the main window as its owner from creation, so
the call is not needed.
2026-11-03 18:25:33 +08:00
Lam Wei Lun 195fbe5ee9 Fix oversized "DEV" text in the mode switch on Retina macOS (#17197)
Fix oversized DEV text in the mode switch on Retina macOS

ModeSwitchButton::doRender() scaled the DEV font by mac_max_scaling_factor()
on macOS, but the paint DC there already works in logical points. On a 2x
Retina display the 12pt font was drawn at 24pt inside the FromDIP(48, 18)
switch, so it overflowed the track and got clipped.

Only the MSW path needs the scaled font: it draws through a wxGCDC over a
scale-1 memory DC, whose text is sized for 96 DPI. Keep that compensation
there and draw with the default font on macOS and GTK, which is also what
the rest of the panel uses. The MSW baseline offset is unchanged.

Fixes #17180
2026-11-03 16:17:53 +08:00
SoftFever 55e760a483 Split .py plugin dependencies only at the commas between items (#17196) 2026-11-03 16:07:56 +08:00
Damir Galeev fa5f7e3db4 Keep original body names when importing STEP, AMF and 3MF geometry (#17050)
* Keep original body names when importing STEP, AMF and 3MF geometry

STEP, AMF and 3MF bodies keep the names stored in the file. The three formats share one geometry import path with matching dialogs, per-format Preferences and cleanup of unsupported characters. AMF body groups load as one object, nested groups are flattened, and a CAD 3MF is imported as geometry.

* Use the app's widgets in the geometry import dialogs

Check boxes, radio buttons and the name replacement field in the STEP,
AMF/3MF and name cleanup dialogs now use the app's own controls instead
of the native ones; the name cleanup preview uses the dialogs' label font.

* Address review: AMF layout, Open Project cancel, part visibility

- AMF: the import dialog offers "Separate objects (as before)" first and
  uses it by default, so files from PrusaSlicer and Slic3r, which keep a
  whole plate in one constellation, load as separate objects again. The
  assembly modes are opt-in.
- File > Open Project with a CAD 3MF replaces the project only after the
  import dialogs were answered and the file was read with geometry to load.
  A Cancel or an empty file keeps the current project, its unsaved state,
  notifications and preview state; close_with_confirm() can hand back its
  closing steps for this.
- The object list no longer changes the model while it checks whether a
  single-object import hides its parts: ModelObject::hides_imported_parts()
  is used by the list, Split to parts and its menu check, and the painting
  gizmos' list update shows or hides the parts when painting changes.
  Removing the part rows keeps the object a container for its instances.
- Progress: staged reading takes the first part of the bar and never goes
  back within a file; the load loop takes the rest.
- A constellation id equal to an object id is logged as a warning.
- set_import_volume_order() is defined next to sort_objects().

* Address review: part rename on drag, Multi-part check for unplaced AMF

- Dragging a part of an imported object cancels a name editor that is
  still open before the part rows are rebuilt. On GTK the editor opened by
  pressing the selected row outlived the deleted row and wrote its name
  into another part.
- The Multi-part check reads zero for objects the file does not place, as
  min_z() did in Release builds, instead of their mesh height: the meshes
  are already centered by then, so different heights asked the question
  where main does not.
- Non-printable AMF groups skip the Multi-part question only in the
  assembly modes; Separate objects asks as before.
- The first AMF load mode is "Load as separate objects".

---------

Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-11-03 14:14:17 +08:00
yw4z e2acd9ec06 Speed up startup by skipping repeated refreshes and building the UV editor on first use (#16930)
Startup to the main window is about 280 ms faster with 24 filaments and about 170 ms faster with 4 (Windows, Bambu H2S, median of 4 runs).

- Filament lists are refreshed once per config change instead of once for each of `filament_colour`, `filament_type` and `filament_is_support`.
- The UV editor pane is built the first time it is shown, through `Lazy<T>`, and keeps its saved dock position when it was not built in a session.
- The SLA import dialog is built on first use, through `Lazy<T>`.
- The sidebar and main window are no longer frozen while the window is hidden.
- The filament combos are not filled before the main window is shown. The printer tab fills them once while presets load.
- The object settings refresh is skipped until the main window is shown, when no object can be selected yet.
2026-11-02 18:12:53 -06:00
Kiss Lorand 896557bce5 Fix spiral vase slicing with height ranges (#17154) 2026-11-02 17:25:07 -03:00
yw4z e8ebe3451a Fix: Object list Name column not refitted when the vertical scrollbar toggles on Windows (#17169)
* init

* revert changes for linux
2026-11-02 20:07:52 +03:00
Lam Wei Lun a5210459ee FIX: Show the connected AMS type in the AMS settings dialog (#17159)
The supported AMS firmwares were stored in an unordered_map, so the AMS
type combo listed them in an unspecified order and then selected the
current firmware by treating its id as a combo row. With an AMS Lite
(id 0) the dialog showed "AMS/AMS 2 Pro/AMS HT", and choosing a type
sent the row index as the firmware id, so it could request the opposite
firmware.

Store the firmwares in a std::map, so iteration is ordered by firmware
id and the id stays a valid combo row index.

Fixes #17125
2026-11-02 23:19:33 +08:00
Ian Chua fcab66ca9e fix: revert native device tab flag (#17162) 2026-11-02 22:09:49 +08:00
yw4z d9f6b69506 Preferences dialog: re organize items with Behaviour and Files tab (#17156)
init
2026-11-02 12:24:59 +03:00
HanifKoh 5fb129f1f3 Read a Retyped Option From the Preset Cache as a JSON Profile Would (#17047)
A vendor's installed preset cache survives an app upgrade, and the
dictionary records the type every option was written as. When a build
reads a cache written by a build that typed an option differently, the
reader dropped the option and the preset fell back to the collection
default, which is not what the vendor's JSON says. enable_arc_fitting
became an enum in 2.5.0-beta, so every vendor whose bundle was not bumped
between the alpha and the beta now loads with arc fitting off from the
alpha's cache, and the alpha reads the beta's cache the same way.

Read such a value by the writer's type and hand its text to
set_deserialize through a scratch config, so handle_legacy and the
bool/enum substitution run on it exactly as for a JSON profile and a
failed parse leaves nothing behind. A text this build cannot place is
still dropped, reported once per key per file.
2026-11-02 17:20:33 +08:00
HanifKoh 06bccd5570 Close the Settings and Object Searches on Esc (#17118)
On Linux, Esc in the settings search reached the printer or filament
settings dialog, which closed while the search popup kept its input grab.
On Wayland this froze the whole UI; on X11 the popup stayed on screen and
swallowed the next click. Esc in the object list search did nothing.

Both search popups now handle Esc themselves: it closes the search and
goes no further. In the settings search, focus returns to the search
button, so the dialog stays open and a second Esc closes it.
2026-11-02 15:16:17 +08:00
fa1k3 5fd0edf5cc Apply the Z shrinkage compensation to height ranges (#16491)
The height ranges are uncompensated print heights. The layer height profile
clipped them against the compensated object height, and the region ranges
were compared with the compensated slices and volume boxes without scaling,
so the range's layer height and its settings ended up at different heights.

The region ranges are now scaled by the Z compensation (not on belt printers,
whose slices are taken in the rotated frame), and the cached regions are only
reused while their ranges are unchanged.

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-11-02 14:59:49 +08:00
Joseph Robertson 3ac1b0078d Belt printer: lay the brim as high above the belt as the part's outer wall (#16757)
On a belt the brim and the part's outer wall didn't land at the same
height above the belt, so no single endstop or Y offset setting worked
for both (#16705). Brim lines sat at a fixed 0.75 layer height above
the belt. The outer wall where it rests on the belt sits half a layer
up, because the layer is sliced at mid-height, plus half its width
times tan(tilt), because it is inset half a width from the slice edge.
At 45 degrees with 0.32 mm layers and a 0.4 mm wall that is 0.24
against 0.36 mm. Brim lines now sit at the clearance of the outer wall
that rests on the belt in their own band's layer, with XY contour
compensation included. Each line's bead is built from its spacing and
clearance, so it fills its cell however small the clearance gets.
Flow::with_cross_section(), used before, delivers only a quarter of the
area once it falls back to a round bead.

The first-layer test measured from the nozzle, so a wall resting on
the belt never counted as first layer and printed at full speed with
the fan on, and the raised brim would have dropped out too. It now
measures from the belt under the edge of the bead. Travels use the
width of the path they lead to. Brim lines are as wide as the bands
are far apart, not as a bead, so they always count as resting on the
belt.

Speed, flow ratio and acceleration are chosen once per path, and a
wall loop runs from the belt up the part, so the whole loop took
whatever its seam point got. Belt paths are now cut where they cross
the edge of the first-layer band or a step of the slow_down_layers
ramp. Each piece is judged by the heights of all its points. Small-area
flow compensation keeps using the original line lengths.

Non-belt printers are unaffected.


Claude-Session: https://claude.ai/code/session_01Ux9BwdWCA7N8UG7ftaNkWg

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 14:37:17 +08:00
fa1k3 a837652833 Apply the Z shrinkage compensation once to the belt height (#16490)
On a belt printer the slicing height comes from the box of the mesh under
trafo_centered(), which already carries the shrinkage compensation, and
SlicingParameters::create_from_config() scaled it by the Z compensation again.
With a Z shrinkage above 100 % the top of the part was not sliced.

The belt build height check now also compares the compensated height when the
object is too tall, so an object that only fits after the compensation is no
longer refused.

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-11-02 14:34:32 +08:00
HanifKoh 6c96e41162 Keep the Scarf Ramp at Its Exact Length Past a Vertex on a Straight Line (#17030)
A scarf ramp that would end less than half a step before the next loop
vertex was extended to that vertex, so that no flat stub follows the ramp.
Arachne places the wall's vertices a little differently on every layer, and
arc fitting moves them further, so the ramp grew by a different amount on
neighbouring layers: the scarf end, which the preview draws as the seam,
stepped sideways by up to half a step from one layer to the next.

Where the vertex lies within an eighth of a common line width of the
straight line from the exact ramp end to the vertex after it, measured in
3D so a Z contour is kept, the flat path now skips that vertex instead. The
ramp keeps its exact length and ends at the same place on every layer, and
the first flat segment is still at least as long as the one that followed
the vertex. At a corner, or when the vertex ends the path, the ramp is
extended as before.
2026-11-02 12:42:52 +08:00
Eldenroot b3819e7c9e FIX: Disable "Scale to build volume" context menu item for volumes (#16353)
* Menu: disable "Scale to build volume" when it cannot apply

The enable condition Plater::can_scale_to_print_volume() already existed (used by the native command) but the context menu item ignored it, so the item was always enabled. Wire it in, so the item is greyed out for cut objects, for an empty selection and for bed shapes other than rectangle/circle. Matches BambuStudio.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7uDtamzhNGT6PFwmVdRJ8

* Menu: add "Scale to build volume" to the multi-selection context menu

The item was only offered when a single object was selected. Add it to the
context menu shown for several selected objects as well; it uses the same
enable condition, so it is greyed out when it cannot apply.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYra1zfuVBUu8unsTTXHVN

* Menu: show "Scale to build volume" in the single-object context menu

create_object_menu() is not called (see MenuFactory::init), so the single-object
menu is built by create_extra_object_menu() and the item that lives in
create_common_object_menu() never reached it; only the SLA menu used it.
Add the item after "Drop" in the extra object menu.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYra1zfuVBUu8unsTTXHVN

* Scale to build volume: disable it for a selection of parts, where it has no effect

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYra1zfuVBUu8unsTTXHVN

* Disable menu item for context menu

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: yw4z <ywsyildiz@gmail.com>
2026-11-02 03:33:24 +03:00
Eldenroot b044fbacfa Clone dialog: the Fill button tooltip says instances, not copies (#17152)
The button fills the bed with instances of the object, like the "Fill bed with
instances" menu item, which already has translations. The copy method it used
to describe no longer exists.


Claude-Session: https://claude.ai/code/session_01QnfT3xX6vcDahKMAM9kgzT

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 03:02:15 +03:00
Kiss Lorand 2a8abac43d Fix false spiral vase material error for height range overrides (#17143) 2026-11-01 19:00:14 -03:00
Rodrigo Faselli 533d4c3e9e Print bridges at bridge speed when slowing down for curled perimeters (#17144)
With slowdown_for_curled_perimeters on, the fully unsupported entry of the overhang speed table was overhang_4_4_speed for every role. Since #14735 samples the inside of a line, the unsupported middle of an anchored bridge strand got that speed. Bridge infill now uses bridge_speed there, like the branch without curled slowdown. Other roles keep their old speeds.
2026-11-01 14:23:32 -06:00
Noisyfox b3f8d0af15 Fix Mesh Boolean crash on meshes with unreferenced vertices (#17080)
Mesh boolean crashed in the CGAL volume check when a mesh had vertices that no triangle used. The conversion to CGAL now removes those vertices and renumbers the rest. The conversion used by UV unwrapping still keeps the original vertex numbering.
2026-11-01 14:20:34 -06:00
Kiss Lorand 49770913a5 Fix printable tooltip on rows without a printable checkbox (#17076) 2026-11-01 16:18:20 -03:00
1149 changed files with 80549 additions and 52713 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
# clang-tidy configuration, enforced by the clang-tidy CI job on the lines a pull
# request changes (scripts/clang_tidy_diff.py). Two things are reported.
# request changes (scripts/clang_tidy_diff.py). Three things are reported.
# Missing includes: a file should include the header for every symbol it uses, not
# rely on the precompiled header or another header's includes. Run with --fix to
# add them.
@@ -7,9 +7,10 @@
# they reach every file that includes the header, and a using-declaration also
# makes the header look like the one to include for that name. Qualify the name
# in the header, and put the using in the source files that want it.
# A null check around delete: deleting a null pointer already does nothing.
# Every check listed here gates pull requests, so enable a new one only once the
# code it flags on touched lines is reasonable to fix in passing.
Checks: '-*,misc-include-cleaner,google-global-names-in-headers'
Checks: '-*,misc-include-cleaner,google-global-names-in-headers,readability-delete-null-pointer'
WarningsAsErrors: '*'
CheckOptions:
# Missing includes only. Builds without the precompiled header break on these.
+12 -23
View File
@@ -1,5 +1,5 @@
---
allowed-tools: Bash(gh issue view:*), Bash(gh search:*), Bash(gh issue list:*), Bash(gh api:*), Bash(gh issue comment:*)
allowed-tools: Bash(./scripts/gh.sh:*), Bash(./scripts/comment-on-duplicates.sh:*)
description: Find duplicate GitHub issues
---
@@ -11,28 +11,17 @@ To do this, follow these steps precisely:
2. Use an agent to view a Github issue, and ask the agent to return a summary of the issue
3. Then, launch 5 parallel agents to search Github for duplicates of this issue, using diverse keywords and search approaches, using the summary from #1
4. Next, feed the results from #1 and #2 into another agent, so that it can filter out false positives, that are likely not actually duplicates of the original issue. If there are no duplicates remaining, do not proceed.
5. Finally, comment back on the issue with a list of up to three duplicate issues (or zero, if there are no likely duplicates)
5. Finally, use the comment script to post duplicates:
```
./scripts/comment-on-duplicates.sh --potential-duplicates <dup1> <dup2> <dup3>
```
Notes (be sure to tell this to your agents, too):
- Use `gh` to interact with Github, rather than web fetch
- Do not use other tools, beyond `gh` (eg. don't use other MCP servers, file edit, etc.)
- Make a todo list first
- For your comment, follow the following format precisely (assuming for this example that you found 3 suspected duplicates):
---
Found 3 possible duplicate issues:
1. <link to issue>
2. <link to issue>
3. <link to issue>
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 OrcaSlicer bot
---
- Use `./scripts/gh.sh` to interact with Github, rather than web fetch or raw `gh`. Examples:
- `./scripts/gh.sh issue view 123` — view an issue
- `./scripts/gh.sh issue view 123 --comments` — view only the comments (prints nothing when there are none)
- `./scripts/gh.sh issue list --state open --limit 20` — list issues
- `./scripts/gh.sh search issues "query" --limit 10` — search for issues
- Run each script call as a plain command like the examples, with no `cd`, environment variables, pipes, redirects or `;`/`&&` chains: anything else is refused
- Do not use other tools, beyond `./scripts/gh.sh` and the comment script (eg. don't use other MCP servers, file edit, etc.)
+8 -6
View File
@@ -56,11 +56,12 @@ the source is what runs — the references mark such facts **[source]**. Orca-si
## Golden rules
1. **Interactive controls are Orca widgets** (`Button` + `SetStyle(...)`, `::CheckBox`, `::ComboBox`,
`::TextInput`, `SpinInput`, `SwitchButton`, `RadioGroup`, `TabCtrl`); the bottom row of every dialog is
`DialogButtons`. Never `wxButton`, `wxSpinCtrl`, `wxCheckBox`, `wxChoice` or a single-line `wxTextCtrl`
in new code; multi-line text is a raw `wxTextCtrl`. Inside `Slic3r::GUI` write `::CheckBox` etc. —
`Field.hpp` has classes with the same names. → `orca-widgets.md`
1. **Interactive controls are Orca widgets** (`Button` + `SetStyle(...)`, `::CheckBox`, `LabeledCheckBox`,
`::ComboBox`, `::TextInput`, `SpinInput`, `SwitchButton`, `RadioGroup`, `TabCtrl`); the bottom row of every
dialog is `DialogButtons`. Never `wxButton`, `wxSpinCtrl`, `wxCheckBox`, `wxChoice` or a single-line
`wxTextCtrl` in new code; multi-line text is a raw `wxTextCtrl`. When the label is on the right side of the
check box and belongs to it, use a `LabeledCheckBox`, not a `::CheckBox` paired with a label by hand. Inside
`Slic3r::GUI` write `::CheckBox` etc. — `Field.hpp` has classes with the same names. → `orca-widgets.md`
2. **DPI.** Layout pixel values go through `FromDIP(n)` (or `n * em_unit()`); `wxBitmap` constructor
sizes, image-list sizes and GL viewports are physical and are not `FromDIP`'d (icon heights passed to
`create_scaled_bitmap`/`ScalableBitmap`/`Button` are DIP). Top-level windows are `DPIDialog`/
@@ -171,7 +172,8 @@ if (dlg.ShowModal() == wxID_OK) { /* read results */ }
| Orca widget (`src/slic3r/GUI/Widgets/`) | Instead of | Must know |
|---|---|---|
| `Button` | `wxButton` | ctor `(parent, text, icon_name, style, iconSize, id)` — id is last; style with `SetStyle(ButtonStyle::…, ButtonType::…)`; emits `wxEVT_BUTTON`; not a `wxButton` (no dialog default/escape emulation) |
| `::CheckBox` | `wxCheckBox` | no label parameter — pair with a `wxStaticText`/`Label`; emits `wxEVT_TOGGLEBUTTON` (never `wxEVT_CHECKBOX`), and a handler bound on it must `Skip()` or the bitmap is not refreshed |
| `::CheckBox` | `wxCheckBox` without a label | no label parameter — when the label is on the right side of the check box and belongs to it, use `LabeledCheckBox`; emits `wxEVT_TOGGLEBUTTON` (never `wxEVT_CHECKBOX`), and a handler bound on it must `Skip()` or the bitmap is not refreshed |
| `LabeledCheckBox` | `wxCheckBox` with a label, a `::CheckBox` hand-paired with its own label on the right side | ctor `(parent, label, id)`; a click on the check or the label sends `wxEVT_CHECKBOX` **and** `wxEVT_TOGGLEBUTTON` from the control — bind one; `SetValue` silent; label, font, `Wrap(width)`/`AutoWrap()` and `Enable()` go through the control, not its children |
| `::ComboBox` (+ `DropDown`) | `wxComboBox`/`wxChoice` | `wxCB_READONLY` for choices; `SelectAndNotify(n)` fires the event; ignores the ctor id; `void*` client data only |
| `::TextInput` | single-line `wxTextCtrl` | text via `GetTextCtrl()`; bind `wxEVT_TEXT_ENTER`/`wxEVT_KILL_FOCUS` on the widget, never on a parent |
| `SpinInput` | `wxSpinCtrl` | non-negative integers only (`-` cannot be typed); commits on Enter, kill-focus and arrow steps with `wxEVT_SPINCTRL`, a plain `wxCommandEvent` — bind a `wxCommandEvent&` handler and read `GetValue()` |
@@ -73,6 +73,7 @@ Contents: [Rules](#rules) · [Native vs generic](#native-vs-generic-and-silent-a
constructor, so bind on the combo (or `SetId()` after construction if an id filter is unavoidable).
→ [Orca widgets](#orca-replacement-widgets-event-contracts)
26. `::CheckBox`/`SwitchButton` emit `wxEVT_TOGGLEBUTTON`, and a handler bound on the widget itself must `Skip()`;
`LabeledCheckBox` sends `wxEVT_CHECKBOX` and `wxEVT_TOGGLEBUTTON` from itself — bind one;
`RadioGroup::SetSelection` always emits; `SpinInput`'s `wxEVT_SPINCTRL` is a plain `wxCommandEvent`.
→ [Orca widgets](#orca-replacement-widgets-event-contracts)
27. Expect Orca's colours on every generic data view and `RenderText` on MSW: `ObjectList` installs a
@@ -300,8 +301,8 @@ Contract:
- `wxRadioBox::SetSelection(n)` needs a valid `n`, never `wxNOT_FOUND` (`interface/wx/radiobox.h:292-295`), and
sends no event.
OrcaSlicer: interactive check boxes are `::CheckBox`/`SwitchButton`, radio rows are `::RadioGroup`; their event
contracts differ from these ([below](#checkbox-and-switchbutton)).
OrcaSlicer: interactive check boxes are `::CheckBox`/`LabeledCheckBox`/`SwitchButton`, radio rows are
`::RadioGroup`; their event contracts differ from these ([below](#checkbox-and-switchbutton)).
Pitfalls:
- **Rule:** Put `wxRB_GROUP` on the first button of *every* group.
@@ -751,6 +752,7 @@ Bind column means an ancestor bound by event type; binding an ancestor by the wi
| `::ComboBox` | `wxComboBox`/`wxChoice` | `wxEVT_COMBOBOX` (int = index, string = text); DROPDOWN/CLOSEUP | COMBOBOX: combo's auto-generated id (the ctor `id` is ignored) and object; DROPDOWN/CLOSEUP: id 0, no object | `SetSelection`/`SetValue` → `wxEVT_TEXT` when the text ctrl is shown or `CB_NO_TEXT`; `SelectAndNotify` → `wxEVT_COMBOBOX` | COMBOBOX on the combo (or an ancestor); DROPDOWN/CLOSEUP on the combo without id |
| `::SpinInput` | `wxSpinCtrl` | `wxEVT_SPINCTRL` (a `wxCommandEvent`); `EVT_SPINCTRL_TEXT` per parsable keystroke; inner `wxEVT_TEXT` | SPINCTRL / SPINCTRL_TEXT: spinner id/object | `SetValue(int)` → `EVT_SPINCTRL_TEXT` + `wxEVT_TEXT`, no `wxEVT_SPINCTRL` | SPINCTRL on the spinner or an ancestor, handler takes `wxCommandEvent&` |
| `::CheckBox`, `SwitchButton` | `wxCheckBox` | `wxEVT_TOGGLEBUTTON` | native | `SetValue` silent | on the widget (with `Skip()`) or an ancestor; never `wxEVT_CHECKBOX` |
| `LabeledCheckBox` | `wxCheckBox` with its own label on the right side | `wxEVT_CHECKBOX`, then `wxEVT_TOGGLEBUTTON` | control id/object | `SetValue` silent | on the control or an ancestor, **one** of the two |
| `::RadioGroup` | `wxRadioBox` | `wxEVT_COMMAND_RADIOBOX_SELECTED` | group id, no object | **every** `SetSelection` emits | on the group or an ancestor |
| `::TabCtrl` | tab bar | `wxEVT_TAB_SEL_CHANGING` then `wxEVT_TAB_SEL_CHANGED` (plain `wxCommandEvent`) | tab ctrl id/object; CHANGING carries the old index | `SelectItem(i)` emits both when `i` changes | on the ctrl or an ancestor; cannot veto |
| `Button` | `wxButton` | `wxEVT_BUTTON` | button id/object | — | on the button or an ancestor |
@@ -815,9 +817,10 @@ two arrow `Button`s with key-repeat; `SetValue/GetValue/SetRange/SetStep`.
### CheckBox and SwitchButton
`::CheckBox` (ctor `CheckBox(parent, id = wxID_ANY)`, no label — pair it with a `wxStaticText`/`Label`, as
`CloneDialog` does) and `SwitchButton` are `wxBitmapToggleButton`s. They emit `wxEVT_TOGGLEBUTTON`, never
`wxEVT_CHECKBOX`; `SetValue` sends nothing. The half state is drawn only (`SetHalfChecked`/`IsHalfChecked`); any click
`::CheckBox` (ctor `CheckBox(parent, id = wxID_ANY)`, no label — when the label is on the right side of the check
box and belongs to it, use `LabeledCheckBox`, `references/orca-widgets.md §LabeledCheckBox`) and `SwitchButton` are
`wxBitmapToggleButton`s. They emit `wxEVT_TOGGLEBUTTON`, never `wxEVT_CHECKBOX`; `SetValue` sends nothing. The half
state is drawn only (`SetHalfChecked`/`IsHalfChecked`); any click
clears it via the widget's own `wxEVT_TOGGLEBUTTON` handler (bound in the constructor), which also swaps the on/off
bitmap. Handlers bound later on the same widget run first, so they must `Skip()`, or the bitmap keeps showing the old
state and the half state is never cleared (`PreferencesDialog::create_item_bambu_cloud` marks this with "let
@@ -941,6 +941,10 @@ The per-widget table (event types, ids and event objects, which setters emit, wh
constructor (clears the half state, refreshes the bitmap, Skips); `TextInput`'s handlers on the inner control run
`OnEdit` and the re-dispatch. A user handler bound on the widget (or on `GetTextCtrl()`) for those events must
`Skip()`. Capture-lost handling: `references/mouse-keyboard-focus.md`.
- **`LabeledCheckBox` re-emits.** It consumes its inner check's `wxEVT_TOGGLEBUTTON` and sends `wxEVT_CHECKBOX`, then
`wxEVT_TOGGLEBUTTON`, from itself (own id and object), for label clicks too. It has no handler of its own for the
two, so a handler bound on it needs no `Skip()` — but one bound to both runs twice
(`references/orca-widgets.md §LabeledCheckBox`).
- **`EVT_ENABLE_CHANGED`** (`StateHandler.hpp`, a `wxCommandEvent` with id 0) comes from the `Enable` overrides of
`Button`, `SpinInput`, `RadioGroup` and the other `StateHandler` widgets. `StateHandler` Skips it, so it
propagates to ancestors like any command event.
@@ -12,7 +12,8 @@ Contents: [Rules](#rules) · [Why the library exists](#why-the-library-exists)
[Namespaces](#namespaces-and-the-checkbox-clash) · [Catalog](#catalog) · [Event semantics](#event-semantics) ·
[Custom vs raw](#custom-vs-raw) · [Shared lifecycle rules](#shared-lifecycle-rules) · [Button](#button) ·
[DialogButtons](#dialogbuttons) · [Label and HyperLink](#label-and-hyperlink) · [CheckBox](#checkbox-and-radiobox) ·
[SwitchButton family](#switchbutton-family) · [RadioGroup](#radiogroup) · [TextInput](#textinput) ·
[LabeledCheckBox](#labeledcheckbox) · [SwitchButton family](#switchbutton-family) · [RadioGroup](#radiogroup) ·
[TextInput](#textinput) ·
[ComboBox and DropDown](#combobox-and-dropdown) · [SpinInput](#spininput-and-tempinput) · [Tab systems](#tab-systems) ·
[StaticBox, LabeledStaticBox, StaticLine](#staticbox-labeledstaticbox-staticline) · [ProgressBar](#progressbar) ·
[ScrolledWindow](#scrolledwindow) · [PopupWindow](#popupwindow) ·
@@ -21,9 +22,9 @@ Contents: [Rules](#rules) · [Why the library exists](#why-the-library-exists)
## Rules
1. Interactive controls in new or modified UI are Orca widgets (`Button`, `::CheckBox`, `::ComboBox`, `::TextInput`,
`SpinInput`, `SwitchButton`, `RadioGroup`, `TabCtrl`); never `wxButton`, `wxSpinCtrl`, `wxCheckBox`, `wxChoice` or
a single-line `wxTextCtrl` in new code. → §Custom vs raw
1. Interactive controls in new or modified UI are Orca widgets (`Button`, `::CheckBox`, `LabeledCheckBox`,
`::ComboBox`, `::TextInput`, `SpinInput`, `SwitchButton`, `RadioGroup`, `TabCtrl`); never `wxButton`, `wxSpinCtrl`,
`wxCheckBox`, `wxChoice` or a single-line `wxTextCtrl` in new code. → §Custom vs raw
2. Every dialog's bottom button row is `DialogButtons`. → §DialogButtons
3. Inside `namespace Slic3r::GUI` write `::CheckBox`, `::TextInput`, `::ComboBox` (also in `dynamic_cast` and
forward declarations, which go at global scope). → §Namespaces
@@ -38,7 +39,8 @@ Contents: [Rules](#rules) · [Why the library exists](#why-the-library-exists)
7. Know which setters emit: `RadioGroup::SetSelection`, `MultiSwitchButton::SetSelection`, `TabCtrl::SelectItem`,
`Notebook::SetSelection`, an editable `ComboBox::SetSelection` (as `wxEVT_TEXT`) and `SpinInput::SetValue` (as
`wxEVT_TEXT` + `EVT_SPINCTRL_TEXT`) do. → §Event semantics
8. `::CheckBox` and `SwitchButton` emit `wxEVT_TOGGLEBUTTON`, never `wxEVT_CHECKBOX`. → §CheckBox and RadioBox
8. `::CheckBox` and `SwitchButton` emit `wxEVT_TOGGLEBUTTON`, never `wxEVT_CHECKBOX`; `LabeledCheckBox` sends both
from itself. → §CheckBox and RadioBox, §LabeledCheckBox
9. Set a container's background colour before creating widgets in it. → §Shared lifecycle rules
10. Enable/disable custom widgets individually; disabling an ancestor leaves them painted enabled (`::CheckBox`, a native button, greys with it). → §Shared lifecycle
rules
@@ -61,6 +63,9 @@ Contents: [Rules](#rules) · [Why the library exists](#why-the-library-exists)
→ §StaticBox, LabeledStaticBox, StaticLine
21. Links are `HyperLink`, or a `Label` given `LB_HYPERLINK` through `SetWindowStyleFlag` (the constructor ignores it).
→ §Label and HyperLink
22. When the label is on the right side of the check box and belongs to it, use a `LabeledCheckBox`, not a
`::CheckBox` paired with a label by hand. Bind **one** of its two events; change its label, font and wrap through
the control; read its enabled state through a `LabeledCheckBox*`. → §LabeledCheckBox
## Why the library exists
@@ -134,6 +139,7 @@ class, which is not a `wxWindow`. `TextCtrl` also names the MSW `wxTextCtrl` sub
| `Label` | `wxStaticText` | `wxStaticText` | `Label(parent, text = "", style = 0, size)` (font `Body_14`), `Label(parent, font, text, style, size)` | `LB_AUTO_WRAP`, `LB_PROPAGATE_MOUSE_EVENT`, `LB_HYPERLINK` (via `SetWindowStyleFlag`); hosts the font table. §Label |
| `HyperLink` (`Slic3r::GUI`) | `wxHyperlinkCtrl` | `wxStaticText` | `HyperLink(parent, label = "", url = "", style = 0)` | opens `url` with `wxLaunchDefaultBrowser` on left-down. §Label |
| `::CheckBox` | `wxCheckBox` | `wxBitmapToggleButton` | `CheckBox(parent, id = wxID_ANY)` — **no label** | emits `wxEVT_TOGGLEBUTTON`; `SetHalfChecked`; `Rescale()`. §CheckBox |
| `LabeledCheckBox` | `wxCheckBox` with a label, a `::CheckBox` paired with its own label on the right side | `wxPanel` | `LabeledCheckBox(parent, label = "", id = wxID_ANY)` | clickable label with focus frame; emits `wxEVT_CHECKBOX` **and** `wxEVT_TOGGLEBUTTON`; `Wrap(width)`/`AutoWrap()`; `GetLabelCtrl()`; `Rescale()`. §LabeledCheckBox |
| `SwitchButton` | on/off `wxCheckBox`, `wxToggleButton` | `wxBitmapToggleButton` | `SwitchButton(parent = nullptr, id = wxID_ANY)` | `SetLabels(on, off)`; track/thumb/text `StateColor`s; emits `wxEVT_TOGGLEBUTTON`. §SwitchButton family |
| `MultiSwitchButton` | segmented `wxRadioBox` | `StaticBox` | `MultiSwitchButton(parent, id, pos, size, style)` | emits `wxCUSTOMEVT_MULTISWITCH_SELECTION`, also from `SetSelection`. §SwitchButton family |
| `RadioGroup` | `wxRadioBox`, `wxRadioButton` rows | `wxPanel` | `RadioGroup(parent, std::vector<wxString> labels, wxHORIZONTAL/wxVERTICAL, row_col_limit = -1)` | emits `wxEVT_RADIOBOX` from **every** `SetSelection`. §RadioGroup |
@@ -164,6 +170,7 @@ Field classes (`Field.cpp`) build their editors from these widgets (`TextCtrl`
|---|---|---|---|---|
| `Button` | `wxEVT_BUTTON` (on release inside, Space/Enter) | button id / button | `SetValue(bool)` (Checked look) silent | on the button (Rule 6) |
| `::CheckBox`, `SwitchButton` | `wxEVT_TOGGLEBUTTON` | native id / widget | `SetValue`, `SetHalfChecked` silent (`interface/wx/tglbtn.h:98`) | on the widget; never `wxEVT_CHECKBOX` |
| `LabeledCheckBox` | `wxEVT_CHECKBOX`, then `wxEVT_TOGGLEBUTTON` (int = new value), also from a label click | control id / control | `SetValue`, `SetHalfChecked` silent | on the control, **one** of the two; no `Skip()` needed for the bitmap |
| `::ComboBox` | `wxEVT_COMBOBOX` (int = index, string = text) from popup pick, arrow keys (read-only combo), `SelectAndNotify`; `wxEVT_COMBOBOX_DROPDOWN`/`_CLOSEUP` | COMBOBOX: combo's auto id / combo; DROPDOWN/CLOSEUP: **id 0, no object** | `SetSelection`, `SetValue` silent for COMBOBOX; editable or `CB_NO_TEXT`: they send `wxEVT_TEXT` | on the combo |
| `::TextInput` | inner `wxEVT_TEXT` (propagates); `wxEVT_TEXT_ENTER`, `wxEVT_KILL_FOCUS` re-sent to the wrapper only | TEXT: **inner** id/object; ENTER/KILL_FOCUS: wrapper id, inner object | `GetTextCtrl()->SetValue` sends `wxEVT_TEXT`; `ChangeValue` silent | TEXT: wrapper, inner, or ancestor by type; ENTER/KILL_FOCUS: wrapper or inner |
| `SpinInput` | `wxEVT_SPINCTRL` (a plain `wxCommandEvent`, no int) on commit; `EVT_SPINCTRL_TEXT` (int + string) per parseable keystroke; inner `wxEVT_TEXT` | spinner id / spinner | `SetValue` sends `EVT_SPINCTRL_TEXT` + `wxEVT_TEXT`, no `wxEVT_SPINCTRL` | on the spinner; handler takes `wxCommandEvent&` |
@@ -221,7 +228,9 @@ No Orca replacement exists — use raw wx (`references/controls-dataview.md`) fo
**Background snapshot.** `StaticBox::Create`, `Label`, `SwitchButton` (through `StaticBox::GetParentBackgroundColor`:
a parent `StaticBox`'s default fill — the midpoint for a gradient — else `parent->GetBackgroundColour()`), and
`::CheckBox`, `RadioGroup` (`parent->GetBackgroundColour()`) copy the parent's background colour at construction;
`::CheckBox`, `RadioGroup` (`parent->GetBackgroundColour()`) copy the parent's background colour at construction, and
so does `LabeledCheckBox` (`GetParentBackground` in `LabeledCheckBox.cpp`: the parent's colour, or under a scrolled
window the colour of that window's child on the parent chain);
wx itself never inherits a background colour ([source] `src/common/wincmn.cpp:1543-1552`).
- **Rule:** Set the container's background before creating widgets in it.
```cpp
@@ -242,7 +251,8 @@ its disabled bitmap (`src/msw/window.cpp:576-593`, `src/msw/anybutton.cpp:846-87
button image draws a greyed copy of the current bitmap while `!IsEnabled()` (`src/gtk/image_gtk.cpp:37-42`), though
the disabled bitmap itself needs `IsThisEnabled()` false (`src/gtk/anybutton.cpp:140-146`); macOS sends
`setEnabled:NO` (`src/osx/cocoa/window.mm:3784-3791`) and AppKit dims the image (`NSButtonCell`
`imageDimsWhenDisabled`, default YES).
`imageDimsWhenDisabled`, default YES). A `LabeledCheckBox` is half of each: its inner check greys with the parent, its
label keeps the enabled colour, which only `LabeledCheckBox::Enable` changes.
- **Rule:** Enable/disable each custom widget directly (`RadioGroup::Enable` does this for its own buttons).
```cpp
m_options_panel->Enable(on); // Wrong: widgets keep the enabled look
@@ -251,8 +261,8 @@ the disabled bitmap itself needs `IsThisEnabled()` false (`src/gtk/anybutton.cpp
```
**DPI.** Widgets size themselves from `FromDIP` values and cached bitmaps; after a DPI change the owning
`DPIDialog::on_dpi_changed` must call `Rescale()` on each (`Button`, `::CheckBox`, `::TextInput`, `::ComboBox`
(also rescales its `DropDown`), `SpinInput`, `SwitchButton`, `MultiSwitchButton`, `TabCtrl`, `StaticLine`,
`DPIDialog::on_dpi_changed` must call `Rescale()` on each (`Button`, `::CheckBox`, `LabeledCheckBox`, `::TextInput`,
`::ComboBox` (also rescales its `DropDown`), `SpinInput`, `SwitchButton`, `MultiSwitchButton`, `TabCtrl`, `StaticLine`,
`ModeSwitchButton`). Exceptions: `RadioGroup`, `Label`, `HyperLink` and `LabeledStaticBox` (its scale is fixed in
`Create()`) have no `Rescale()`; `ProgressBar::Rescale()` is empty; `DialogButtons` rescales itself. Pass sizes through
`FromDIP` (`references/dpi-bitmaps-fonts.md`).
@@ -276,7 +286,8 @@ it re-reads colours, e.g. `SwitchButton`), and keep `UpdateDlgDarkUI(this)` as t
a label, font, icon, style or DPI changes, and the bitmap toggles (`::CheckBox`, `SwitchButton`) size themselves
to their bitmap in `Rescale()`.
Nothing re-lays out the parent: call `Layout()` on the container after changing a widget's content at runtime
(`references/sizers-layout.md`).
(`references/sizers-layout.md`). `LabeledCheckBox` is the exception: its setters re-fit it and send the parent a size
event (§LabeledCheckBox).
**Mouse capture.** `Button`, `DropDown`, `SpinInput`'s arrows, `ModeSwitchButton`, `MyScrollbar`, `StepCtrl` and the
device-page `SideButton`, `ImageSwitchButton` and `AxisCtrlButton` capture the mouse while pressed; a capture leak
@@ -461,8 +472,10 @@ Pitfalls:
## CheckBox and RadioBox
`::CheckBox` (`Widgets/CheckBox.cpp`) is a `wxBitmapToggleButton` (`wxBORDER_NONE`) showing 18 px SVGs
`check_{on,half,off}`, `…_disabled`, `…_focused`. It has **no label**: pair it with a `wxStaticText`/`Label`
(as `CloneDialog::CloneDialog` does). `GetValue()` is a 2-state `bool`.
`check_{on,half,off}`, `…_disabled`, `…_focused`. It has **no label**: when the label is on the right side of the
check box and belongs to it, use a `LabeledCheckBox` (§LabeledCheckBox); pair a bare `::CheckBox` with a
`wxStaticText`/`Label` only where the label sits elsewhere, such as on the left side in the label column of a form
row (as `CloneDialog::CloneDialog` does). `GetValue()` is a 2-state `bool`.
- Emits `wxEVT_TOGGLEBUTTON` on click (native). `SetValue` emits nothing (`interface/wx/tglbtn.h:98`).
- `SetHalfChecked(true)` is a drawn-only third state (`IsHalfChecked()` exists for the inspector only); the widget's own toggle handler
clears it on any click. `SetValue` does **not** clear it — call `SetHalfChecked(false)` before showing a definite
@@ -488,6 +501,94 @@ Pitfalls:
cb->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& e) { e.Skip(); apply(); }); // Right
```
## LabeledCheckBox
`LabeledCheckBox` (`Widgets/LabeledCheckBox.cpp`, global namespace) is the check box with its own label on the
right side: a `wxPanel` holding a `::CheckBox` and, to its right, a `StaticBox` frame around a `Label`. The label
must belong to the check box, that is, name the option the box switches. Other text that only shares the row (a
value, a unit, a link, the label of the next control) is not its label, however close it sits, and stays a separate
window. The control has no other label position: a label on the left side or in a separate column stays a
`::CheckBox` paired with a label (§CheckBox and RadioBox). Constructor
`LabeledCheckBox(parent, label = "", id = wxID_ANY)`; font `Body_14`, label colour `#363636` (dark-mapped at
construction). An empty label hides the frame and leaves the bare check.
- **Value.** `SetValue(bool)`, `GetValue()`/`IsChecked()`, `SetHalfChecked(bool = true)`. The half state is
`::CheckBox`'s: drawn only, cleared by any user toggle, not by `SetValue`. No setter emits.
- **Events.** A user toggle — a click on the check, Space on the focused check, a left click on the label or its
frame — sends `wxEVT_CHECKBOX` and then `wxEVT_TOGGLEBUTTON` from the control (`LabeledCheckBox::OnToggled`): the
control's current id (so `SetId()` after construction works), the control as event object, `IsChecked()`/`GetInt()`
= the new value. A double click on the label toggles twice (its second click arrives as `wxEVT_LEFT_DCLICK`). The
inner check's own `wxEVT_TOGGLEBUTTON` is consumed, so an ancestor bound by type gets one event of each type per
toggle. The control has no handler of its own for the two events: a handler bound on it needs no `Skip()` to keep
the bitmap right; `Skip()` only lets ancestors see the event. For a label click both events are sent from inside
the label's `wxEVT_LEFT_DOWN` handler, so a handler that opens a modal dialog defers it with `CallAfter`
(`references/windows-dialogs.md` rule 19).
- **Focus.** The inner check holds the keyboard focus; frame and label never take it, and a label click moves the
focus to the check. `HasFocus()` reports the check's focus. The frame's border is the focus indicator
(`LabeledCheckBox::ShowFocus`): `#009688` when focused, the background colour otherwise.
- **Hover.** While the pointer is on the label or its frame, the check shows its hover bitmap
(`LabeledCheckBox::ShowHover`).
- **Enable.** `Enable(bool)` disables the inner check and greys the label (`#6B6A6A`, dark-mapped); the panel itself
stays enabled. `IsEnabled()` is a non-virtual shadow that returns the check's state. A disabled control ignores
label clicks.
- **Setters go through the control.** `SetLabel`, `SetFont`, `Wrap`, `AutoWrap` and `Rescale` update the label,
re-fit the control (`Fit()`) and send the parent a size event (`LabeledCheckBox::Relayout`), so a sizer-managed
parent lays out again; a top-level window is not re-fitted. `SetForegroundColour` sets the enabled label colour,
`SetBackgroundColour` reaches check, frame and label, and a tooltip set on the control is copied to all three
(`DoSetToolTip`). `GetLabelCtrl()` returns the inner `Label`.
- **Wrapping** is `Label::Wrap` on the stored text. `Wrap(width)` wraps the text to `width` px minus the check and
the padding, so the whole control fits `width`; `width <= 0` unwraps. `AutoWrap(true)` re-wraps to the width the
control is given on every `wxEVT_SIZE`, so it needs a sizer item that gives it a width (`wxEXPAND` in a vertical
sizer, or a proportion) inside a container whose width comes from elsewhere: until the first layout the control
reports its unwrapped width. Each of the two calls cancels the other mode. With a wrapped label the check stays
centred on the first text line.
- **Metrics.** The padding around the text is `FromDIP(wxSize(5, 2))`, the padding of `RadioGroup`'s label buttons
(`RadioGroup::Create`), and both icons are 18 px: a `LabeledCheckBox` and a `RadioGroup` added with the same left
border line up icon under icon and text under text. Unlike `RadioGroup`, which puts `FromDIP(4)` above and below
each row, the control adds no outer margin; row spacing is the sizer's.
- **DPI.** `Rescale()` rescales the check and re-fits; call it from `on_dpi_changed`.
- **[source] Bitmap states on MSW.** Setting the normal bitmap of a bitmap button (`SetBitmapLabel`) deletes the
button's image data, so the bitmaps set for the other states are gone and their getters (`GetBitmapCurrent()`, …)
return a null bitmap until they are set again (`src/msw/anybutton.cpp:770-783`, `:785-796`); a null normal bitmap
then removes the image without a refresh (`:797-812`). wxGTK keeps one bitmap per state
(`src/gtk/anybutton.cpp:198-201`, `:391`). `LabeledCheckBox::ShowHover` shows the hover art by copying the check's
hover bitmap into its normal state, and therefore lets `::CheckBox` set all its bitmaps again first.
Pitfalls:
- **Rule:** When the label is on the right side of the check box and belongs to it, use one `LabeledCheckBox`;
don't pair a `::CheckBox` with a `wxStaticText`/`Label` and forward the label's clicks by hand.
**Why:** the hand-made pair needs its own sizer, label styling, click and double-click forwarding, disabled
colour and tooltip on both windows, and still shows no focus frame on the label.
```cpp
auto* cb = new ::CheckBox(this); // Wrong: two windows wired by hand
auto* lbl = new wxStaticText(this, wxID_ANY, _L("Don't show again"));
lbl->Bind(wxEVT_LEFT_DOWN, [cb](wxMouseEvent&) { cb->SetValue(!cb->GetValue()); /* + send the event */ });
auto* cb = new LabeledCheckBox(this, _L("Don't show again")); // Right
```
- **Rule:** Bind **one** of the two events.
**Why:** both are sent for every toggle, so that a handler written for a `wxCheckBox` (`wxEVT_CHECKBOX`) or for a
`::CheckBox` (`wxEVT_TOGGLEBUTTON`) keeps working when the control replaces either; a handler bound to both runs
twice.
```cpp
cb->Bind(wxEVT_CHECKBOX, h); cb->Bind(wxEVT_TOGGLEBUTTON, h); // Wrong: h runs twice
cb->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent& e) { apply(e.IsChecked()); e.Skip(); }); // Right
```
- **Rule:** Change the label, font and wrap through the control, not through `GetLabelCtrl()`.
**Why:** only the control's own setters re-wrap, re-fit and notify the parent.
```cpp
cb->GetLabelCtrl()->SetLabel(text); // Wrong: the control keeps its old size and wrap
cb->SetLabel(text); // Right
```
- **Rule:** Read the enabled state through a `LabeledCheckBox*`.
**Why:** `Enable()` is virtual and works through any pointer, but `IsEnabled()` is not: through a `wxWindow*` it
reports the panel, which stays enabled (`src/common/wincmn.cpp:1142-1145`). The rule of §Shared lifecycle rules
holds too: disabling an ancestor greys the inner check but not the label — call the control's `Enable()`.
```cpp
wxWindow* w = cb; cb->Enable(false);
if (w->IsEnabled()) { /* Wrong: still true */ }
if (cb->IsEnabled()) { /* Right: false */ }
```
## SwitchButton family
All in `Widgets/SwitchButton.hpp/.cpp`:
@@ -739,6 +739,12 @@ plain window.
static `GetParentBackgroundColor(wxWindow*)`. Protected members: `radius`, `border_width`,
`top_margin`, `border_style`, `state_handler`, `border_color`, `background_color`,
`background_color2`, `badge`.
- **Input corner radius:** the boxed inputs (`TextInput` and so `ComboBox`, `SpinInput`, `TempInput`)
share `StaticBox::InputCornerRadius` (DIP). Their constructor sets the protected `input_corner_radius`
flag, and `Create()` and `Rescale()` call `apply_input_corner_radius()`, which re-applies
`FromDIP(InputCornerRadius)` at the current DPI. `SetCornerRadius()` clears the flag, so an explicit
radius (`0` for square cells in tables and grids) survives a DPI change. A new boxed input follows
the same three steps.
- **`SetBackgroundColor` ≠ wx `SetBackgroundColour`.** The former sets the `StateColor` fill that
`doRender` paints; the latter is the wx window colour that the erase pass uses outside the
rounded rect. They are different things on purpose.
@@ -579,13 +579,15 @@ paths, when `/proc/driver/nvidia/version` exists and the linked WebKitGTK honour
`WebView::SupportsForceSharedMemory()`), it sets `WEBKIT_DMABUF_RENDERER_FORCE_SHM=1` and
`WEBKIT_FORCE_DMABUF_RENDERER=1` (non-replacing): the proprietary driver cannot back WebKit's hardware
DMABUF renderer. On a hypervisor guest (`/proc/cpuinfo` `hypervisor` flag) and WebKitGTK >= 2.44 it sets
`WEBKIT_DMABUF_RENDERER_FORCE_SHM=1` alone, since virtual GPUs cannot back the hardware path either. On the default path it forces `GDK_BACKEND=x11` when wx lacks EGL and `WAYLAND_DISPLAY`
is set, and sets `WEBKIT_DISABLE_COMPOSITING_MODE=1` (non-replacing) inside that branch when the linked
WebKitGTK is older than 2.42: a forced X11 backend in a Wayland session is the only default-path case
that runs through XWayland, which `DISPLAY` and `WAYLAND_DISPLAY` alone do not tell you (a native
Wayland app inherits both). It calls `XInitThreads()`
only when `DISPLAY` is set. With neither variable set, the GUI refuses to start ("Neither DISPLAY nor
WAYLAND_DISPLAY set"). The details and the WebKit rules (c12912e0df) are in
`WEBKIT_DMABUF_RENDERER_FORCE_SHM=1` alone, since virtual GPUs cannot back the hardware path either. In a
Wayland session outside the Flatpak it also keeps the system WebKitGTK off its hardware DMABUF path. On
the default path it forces `GDK_BACKEND=x11` when wx lacks EGL and a Wayland socket is available
(`wayland_socket_available()`), and sets `WEBKIT_DISABLE_COMPOSITING_MODE=1` (non-replacing) inside that
branch when the linked WebKitGTK is older than 2.42: a forced X11 backend in a Wayland session is the
only default-path case that runs through XWayland, which `DISPLAY` and `WAYLAND_DISPLAY` alone do not
tell you (a native Wayland app inherits both). It calls `XInitThreads()` only when `DISPLAY` is set.
With no `DISPLAY` and no Wayland socket (`wayland_socket_available()`), the GUI refuses to start
("Neither DISPLAY nor a Wayland socket found"). The details and the WebKit rules (c12912e0df) are in
`references/webview-gl-aui-media.md` §WebKitGTK on Linux sessions.
**wx's own detectors**, for reference:
@@ -81,6 +81,11 @@ Contents: [Rules](#rules) · [1. Choosing the window kind](#1-choosing-the-windo
tooltip of a widget in that popup, or in a popup opened from it, is on screen: the tooltip has taken the
keyboard while the user is still on the popup. `PopupWindow::topWindowActiavate` does it for every Orca popup;
a popup outside `PopupWindow` with such a hook must do it itself. (§9)
31. When a dialog that hides on deactivation closes by itself, find the code that activated another window
instead of hardening the hook: on wxGTK, `SetFocus()` on a child of a visible, inactive toplevel presents
that toplevel. A handler bound on a book control acts only on events whose object is that book, because a
page-changed event from a book inside a page propagates up to it. A deferred, re-checked hide tolerates only
a focus bounce shorter than its delay. (§10)
## 1. Choosing the window kind
@@ -827,8 +832,9 @@ created with `wxBORDER_NONE | wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT | wxF
- `wxFRAME_NO_TASKBAR` gives no taskbar entry on MSW/GTK, on GTK only when the WM supports
`_NET_WM_STATE_SKIP_TASKBAR` (`interface/wx/frame.h:97-103`).
- `wxFRAME_FLOAT_ON_PARENT` requires a non-null parent (`interface/wx/frame.h:104-106`).
- Its `wxEVT_ACTIVATE` handler hides on deactivation and `Skip()`s. On activation it focuses the web view, because
modeless focus is granted asynchronously and a focus request made right after `Show()` is dropped.
- Its `wxEVT_ACTIVATE` handler focuses the web view on activation, because modeless focus is granted
asynchronously and a focus request made right after `Show()` is dropped. It hides on deactivation after a
short settle delay and a re-check of `gtk_window_is_active()` (Pitfalls below), and it `Skip()`s.
- On Linux `focus_webview` grabs focus on the WebKit native widget (`gtk_widget_grab_focus` on
`GetNativeBackend()`). `browser()->SetFocus()` focuses only the container.
- Display-only web content can stay in a transient popup (`MarkdownTip`).
@@ -847,13 +853,39 @@ created with `wxBORDER_NONE | wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT | wxF
wxBORDER_NONE | wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT | wxFRAME_SHAPED)
{
Bind(wxEVT_ACTIVATE, [this](wxActivateEvent& e) {
if (e.GetActive() && IsShown()) focus_webview(browser(), m_page_ready);
else if (!e.GetActive() && IsShown()) Hide();
if (!IsShown()) { e.Skip(); return; }
if (e.GetActive()) { m_hide_timer.Stop(); focus_webview(browser(), m_page_ready); }
else schedule_hide(); // validated, see the next rule
e.Skip();
});
}
```
Cite: f142716e51, a86202b45b (`SpeedDialPopup.cpp` replaced by `SpeedDialDialog.{hpp,cpp}`; `GUI_App.cpp`).
- **Rule:** When a dialog that hides on deactivation closes by itself, find the code that activated another
window; do not harden the dismissal hook. A handler bound on a book control checks that `e.GetEventObject()`
is that book before acting.
**Why:** On wxGTK, `wxWindow::SetFocus()` on a child of a visible but inactive toplevel calls
`gtk_window_present` on that toplevel (`src/gtk/window.cpp:5157-5162`), so an unexpected `SetFocus()` anywhere
in the main frame takes the keyboard from a modeless dialog that hides on deactivation. The Speed Dial closed
by itself a moment after the first Space on Linux (GNOME and KDE, X11 and Wayland): the idle builder
constructed the Calibration page, whose `Tabbook::InsertPage` emitted `wxEVT_BOOKCTRL_PAGE_CHANGED`; the event
propagated, as every `wxNotifyEvent` does, to the main frame's `m_tabpanel` handler
(`wxEVT_NOTEBOOK_PAGE_CHANGED` is the same type, `include/wx/bookctrl.h:434`), which treated it as a main tab
change and ended with `panel->SetFocus()`. Found with a 10 ms focus poller and a backtrace on
`gtk_window_present`. MSW and macOS `SetFocus()` do not activate the toplevel, so the bug was Linux-only. The
dial's deferred, re-checked hide (`kHideSettleMs`, `gtk_window_is_active()`, since `wxTopLevelWindowGTK::IsActive()`
answers from `g_activeFrame`, which the deactivation has already cleared) absorbs only a focus bounce shorter
than the delay; it did not stop this.
```cpp
// Wrong: the main book's handler acts on every page-changed event that reaches it
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, [this](wxBookCtrlEvent& e) { /* ... */ panel->SetFocus(); });
// Right: only the book's own events
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, [this](wxBookCtrlEvent& e) {
if (e.GetEventObject() != m_tabpanel) { e.Skip(); return; }
/* ... */
});
```
Cite: #17245 (`MainFrame::init_tabpanel`; `SpeedDialWebDialog::on_hide_timer`).
- **Rule:** When restoring the main frame after hiding a popup or overlay frame, call `Show()` only if
`!IsShown()`, and `Raise()` unconditionally (top-level `Show`/`Raise` are owned by
`references/windows-dialogs.md`).
@@ -636,7 +636,9 @@ single-line `wxST_ELLIPSIZE_END` labels; other modes are generic (`src/msw/statt
- the label needs a real width: a ctor size `wxSize(FromDIP(w), -1)`, min = max width, or `wxEXPAND` in a
vertical sizer whose container width is fixed;
- `Label::split_lines(dc, width, text, out, max_count)` exposes the same wrapper for owner-drawn text.
Orca's wrapping is preferred over `wxST_WRAP` for CJK text.
Orca's wrapping is preferred over `wxST_WRAP` for CJK text. A check box label wraps through
`LabeledCheckBox::Wrap(width)`/`AutoWrap()`, which also re-fit the control (`references/orca-widgets.md
§LabeledCheckBox`).
**Pitfalls**
- **Rule:** Re-wrapping after `SetLabel` must defeat the wrap cache.
@@ -61,8 +61,9 @@ available; GTK2/WebKit1 is an opt-out configuration the GUI does not support.
11. A web host that re-themes in place handles `EVT_WEBVIEW_RECREATED` without `Skip()`; one that
needs a reload lets it through. §[Orca wrapper](#orca-webview-wrapper-widgetswebview)
12. Keep `WebViewWebKit`'s destructor removing the `"wx"` handler. §[Orca wrapper](#orca-webview-wrapper-widgetswebview)
13. Do not widen `WEBKIT_DISABLE_COMPOSITING_MODE` beyond the no-EGL default path where Orca forces
`GDK_BACKEND=x11`, for WebKitGTK older than 2.42, and never
13. Do not widen `WEBKIT_DISABLE_COMPOSITING_MODE` beyond its default-path cases (the no-EGL forced
`GDK_BACKEND=x11` on WebKitGTK older than 2.42, and Wayland outside the Flatpak on WebKitGTK 2.42
and 2.43, which ignore FORCE_SHM), and never
make a page's progress depend only on a C++→JS callback. §[WebKitGTK on Linux](#webkitgtk-on-linux-sessions)
14. GL attribute lists: legacy `int[]` lists end with `0` and spell out `WX_GL_RGBA` and
`WX_GL_DOUBLEBUFFER`; `wxGLAttributes`/`wxGLContextAttrs` end with `EndList()`; MSAA is requested
@@ -580,8 +581,21 @@ sets the DMABUF workarounds and then branches on `GDK_BACKEND`:
Virtual GPUs (VirtualBox VMSVGA, VMware, QEMU) cannot back the hardware DMABUF path either, and
FORCE_SHM alone was confirmed to fix web views in VirtualBox; the `WEBKIT_FORCE_DMABUF_RENDERER` pair
is not needed without the Debian `isNVIDIA()` patch. The flag is x86-only, so ARM guests are not covered.
- **System WebKitGTK on Wayland**, same position, in a build with EGL and not on the `GDK_BACKEND=x11`
opt-in: when GTK will connect to Wayland and the app is not in the Flatpak, it sets
`WEBKIT_DMABUF_RENDERER_FORCE_SHM=1` non-replacing on WebKitGTK >= 2.44, and
`WEBKIT_DISABLE_COMPOSITING_MODE=1` on 2.42 and 2.43, which have the DMABUF renderer but ignore
FORCE_SHM. Ubuntu's WebKitGTK 2.52 on Intel GPUs and Debian's 2.54 on AMD froze the window on the
hardware path and left the 3D view drawn over other pages; affected builds can't be told apart, so
every system WebKitGTK avoids that path and only the Flatpak's runtime WebKitGTK keeps it. Both
helpers named here are in `libslic3r/Utils.hpp`. `wayland_socket_available()` follows
`wl_display_connect(NULL)`, the connection GTK tries before X11: `WAYLAND_SOCKET` when set (it must
name an open fd), otherwise the `WAYLAND_DISPLAY` socket (`wayland-0` when unset) under
`XDG_RUNTIME_DIR` unless the name is absolute. `XDG_SESSION_TYPE` is not used because an X11 client
can inherit it, and `is_running_in_flatpak()` checks only `/.flatpak-info` because a host process
started from a Flatpak can inherit `FLATPAK_ID`.
- **Default path** (`GDK_BACKEND` unset or not starting with `x11`): if wx lacks EGL (`!wxHAS_EGL`) and
`WAYLAND_DISPLAY` is set, it forces `GDK_BACKEND=x11`, and in that same branch it sets
`wayland_socket_available()`, it forces `GDK_BACKEND=x11`, and in that same branch it sets
`WEBKIT_DISABLE_COMPOSITING_MODE=1` non-replacing when the linked WebKitGTK predates 2.42
(`WebView::NeedsCompositingWorkaround()`). That forced X11 backend in a Wayland session is the only
default-path case that really runs through XWayland; `DISPLAY` and `WAYLAND_DISPLAY` alone do not
@@ -601,9 +615,10 @@ Runtime backend detection elsewhere uses Orca's `is_running_on_wayland()` / `is_
(see `references/platforms.md`), not these environment variables.
**Pitfall.**
- **Rule:** On NVIDIA and hypervisor guests reach for `WEBKIT_DMABUF_RENDERER_FORCE_SHM` before
`WEBKIT_DISABLE_COMPOSITING_MODE`. **Why:** the proprietary driver and virtual GPUs cannot back WebKit's
hardware DMABUF renderer, leaving web views blank or slow; FORCE_SHM keeps accelerated compositing and only
- **Rule:** On NVIDIA, hypervisor guests and the system WebKitGTK on Wayland reach for
`WEBKIT_DMABUF_RENDERER_FORCE_SHM` before `WEBKIT_DISABLE_COMPOSITING_MODE`. **Why:** the proprietary
driver and virtual GPUs cannot back WebKit's hardware DMABUF renderer, leaving web views blank or slow,
and the system WebKitGTK on Wayland can freeze on it; FORCE_SHM keeps accelerated compositing and only
skips the hardware path, while disabling compositing drops it. Threaded scrolling is a separate,
release-dependent default (off in 2.44/2.45, on from 2.46). `WEBKIT_DISABLE_DMABUF_RENDERER` is not a
substitute — it is read first, leaves the transport set empty (no compositing from 2.44 on, where the
@@ -618,19 +633,21 @@ Runtime backend detection elsewhere uses Orca's `is_running_on_wayland()` / `is_
// Wrong: kills compositing and threaded scrolling (and can crash on modern WebKit)
::setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "1", false);
// Right: keep compositing, skip only the hardware DMABUF path
if (::access("/proc/driver/nvidia/version", F_OK) == 0 && WebView::SupportsForceSharedMemory()) {
::setenv("WEBKIT_DMABUF_RENDERER_FORCE_SHM", "1", /*replace*/ false);
::setenv("WEBKIT_FORCE_DMABUF_RENDERER", "1", /*replace*/ false);
if (WebView::SupportsForceSharedMemory()) {
if (nvidia || is_hypervisor_guest() || system_webkit_on_wayland)
::setenv("WEBKIT_DMABUF_RENDERER_FORCE_SHM", "1", /*replace*/ false);
if (nvidia)
::setenv("WEBKIT_FORCE_DMABUF_RENDERER", "1", /*replace*/ false);
}
```
Cite: WebKit 2.52.6 `Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp`
(`rendererBufferTransportMode()`), Debian `disable-nvidia-dmabuf.patch`, WebKit bug 262607.
- **Rule:** Set `WEBKIT_DISABLE_COMPOSITING_MODE` only on the default path, in the branch where wx
lacks EGL and Orca forces `GDK_BACKEND=x11`, non-replacing (`setenv(..., false)`, so a value the user
already exported wins), before GTK
initialises; never unconditionally, and only for the WebKitGTK releases that need it (older than
2.42, `WebView::NeedsCompositingWorkaround()`). Keep JS-side fallbacks so a page never
waits forever for a C++→JS call.
- **Rule:** Set `WEBKIT_DISABLE_COMPOSITING_MODE` only on the default path, non-replacing
(`setenv(..., false)`, so a value the user already exported wins), before GTK initialises: in the
branch where wx lacks EGL and Orca forces `GDK_BACKEND=x11`, for WebKitGTK older than 2.42
(`WebView::NeedsCompositingWorkaround()`), and as the fallback for the system WebKitGTK on Wayland
on 2.42 and 2.43, which have the DMABUF renderer but ignore FORCE_SHM. Never set it unconditionally.
Keep JS-side fallbacks so a page never waits forever for a C++→JS call.
**Why:** WebKit2GTK accelerated compositing could fail silently under XWayland before 2.42, leaving
web views blank (Setup Wizard stuck on "Loading..."); the variable also turns off threaded scrolling,
so applying it on a newer WebKit needlessly drops both GPU compositing and async scrolling (the
+4 -2
View File
@@ -1,6 +1,7 @@
# Description
<!--
> Please read How to Contribute: https://www.orcaslicer.com/wiki/developer_reference/how_to_contribute
> Please provide a summary of the changes made in this PR. Include details such as:
> * What issue does this PR address or fix?
> * What new features or enhancements does this PR introduce?
@@ -10,8 +11,9 @@
# Screenshots/Recordings/Graphs
<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
> UI changes need before and after screenshots, on each platform you tested.
> See what each kind of PR needs: https://github.com/OrcaSlicer/OrcaSlicer/blob/main/CONTRIBUTING.md#what-each-kind-of-pr-needs
> For other changes, please attach images that can help explain them.
-->
## Tests
@@ -4,10 +4,20 @@ description: Triggers duplicate detection for old issues that don't have duplica
on:
workflow_dispatch:
inputs:
days_back:
description: 'How many days back to look for old issues'
min_issue_number:
description: 'Lowest issue number to process'
required: false
default: '90'
default: '1'
type: string
max_issue_number:
description: 'Only process issues below this number (empty for no upper bound); the previous run logs the value to continue from'
required: false
default: ''
type: string
limit:
description: 'Maximum number of dedupe runs to start, one every 30 seconds'
required: false
default: '100'
type: string
dry_run:
description: 'Dry run mode (true to only log what would be done)'
@@ -21,7 +31,8 @@ on:
jobs:
backfill-duplicate-comments:
runs-on: ubuntu-latest
timeout-minutes: 30
# Dispatches are spaced 30 seconds apart, so a large limit runs for hours
timeout-minutes: 360
permissions:
contents: read
issues: read
@@ -40,5 +51,7 @@ jobs:
run: bun run scripts/backfill-duplicate-comments.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DAYS_BACK: ${{ inputs.days_back }}
MIN_ISSUE_NUMBER: ${{ inputs.min_issue_number }}
MAX_ISSUE_NUMBER: ${{ inputs.max_issue_number }}
LIMIT: ${{ inputs.limit }}
DRY_RUN: ${{ inputs.dry_run }}
+63 -261
View File
@@ -27,12 +27,14 @@ on:
- 'scripts/test_prune_cached_presets.ps1'
- 'scripts/flatpak/**'
- 'scripts/msix/**'
- 'scripts/sign_windows.ps1'
- 'tests/**'
pull_request:
branches:
- main
- release/*
# build_optional.yml keeps the same list, plus scripts/flatpak/**.
paths:
- 'deps/**'
- 'deps_src/**'
@@ -51,8 +53,8 @@ on:
- 'scripts/build_preset_cache.*'
- 'scripts/prune_cached_presets.ps1'
- 'scripts/test_prune_cached_presets.ps1'
- 'scripts/flatpak/**'
- 'scripts/msix/**'
- 'scripts/sign_windows.ps1'
- 'tests/**'
@@ -76,9 +78,40 @@ concurrency:
jobs:
# build_win.bat ships a test suite. Run it before the Windows builds.
# build_win.bat and two of the scripts it runs ship test suites. They run
# before the Windows builds, on a pull request only when it changes one of
# the scripts or the suites: the suites build their own fixtures and read
# nothing else from the tree. Pushes and the nightly always run them.
build_script_changes:
name: Look for build script changes
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-24.04
outputs:
changed: ${{ steps.changes.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
lfs: 'false'
# The merge commit plus its first parent, the base it is diffed against.
fetch-depth: 2
sparse-checkout: .github/workflows
- name: Look for changed files
id: changes
run: |
if git diff --quiet HEAD^1 HEAD -- build_win.bat .github/workflows/build_all.yml \
scripts/check_exception_throw_info.ps1 scripts/prune_cached_presets.ps1 \
scripts/test_build_win.ps1 scripts/test_check_exception_throw_info.ps1 scripts/test_prune_cached_presets.ps1; then
echo "No build script changes."
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
check_build_script:
name: Windows build script tests
needs: build_script_changes
# Runs unless the lookup ran and found nothing: skipped off pull requests,
# and failed lookups run the suites rather than skip them.
if: ${{ !cancelled() && (needs.build_script_changes.result != 'success' || needs.build_script_changes.outputs.changed == 'true') }}
runs-on: windows-latest
steps:
- name: Checkout
@@ -123,13 +156,23 @@ jobs:
strategy:
fail-fast: false
# SELF_HOSTED skips arm64 (the self-hosted Windows server is x64-only).
# So does a pull request; build_optional.yml builds arm64 on the
# build-windows-arm64 label or a change outside the sources.
matrix:
include: ${{ fromJSON(vars.SELF_HOSTED
&& '[{"arch":"x64","os":"orca-win-server","compiler":"clang"}]'
|| '[{"arch":"x64","os":"windows-latest","compiler":"clang"},{"arch":"arm64","os":"windows-11-vs2026-arm","compiler":"clang"}]') }}
|| (github.event_name == 'pull_request'
&& '[{"arch":"x64","os":"windows-latest","compiler":"clang"}]'
|| '[{"arch":"x64","os":"windows-latest","compiler":"clang"},{"arch":"arm64","os":"windows-11-vs2026-arm","compiler":"clang"}]')) }}
needs: check_build_script
# id-token lets release builds sign through Google Cloud Workload Identity Federation (see
# "Configure code signing" in build_orca.yml); the rest is what the build already used.
permissions:
actions: write
contents: write
id-token: write
# Don't run scheduled builds on forks:
if: ${{ !cancelled() && needs.check_build_script.result == 'success' && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
if: ${{ !cancelled() && contains(fromJSON('["success", "skipped"]'), needs.check_build_script.result) && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ matrix.os }}
@@ -141,10 +184,11 @@ jobs:
build_macos_arch:
strategy:
fail-fast: false
# Hosted macOS runners are scarce, so a pull request builds arm64 only and
# ships it as its own DMG; build_optional.yml builds x86_64 on the
# build-macos-x86_64 label. Pushes build both and combine them below.
matrix:
arch:
- arm64
- x86_64
arch: ${{ fromJSON(github.event_name == 'pull_request' && '["arm64"]' || '["arm64", "x86_64"]') }}
# Don't run scheduled builds on forks:
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
uses: ./.github/workflows/build_check_cache.yml
@@ -157,7 +201,7 @@ jobs:
build_macos_universal:
name: Build macOS Universal
needs: build_macos_arch
if: ${{ !cancelled() && needs.build_macos_arch.result == 'success' && !inputs.build-deps-only && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
if: ${{ !cancelled() && needs.build_macos_arch.result == 'success' && !inputs.build-deps-only && github.event_name != 'pull_request' && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
uses: ./.github/workflows/build_orca.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-15' }}
@@ -181,10 +225,11 @@ jobs:
with:
os: ubuntu-24.04-arm
artifact: ${{ github.sha }}-tests-linux-aarch64
# The explicit result, as the script tests ahead of the build may be skipped.
unit_tests_windows_x64:
name: Windows x64
needs: build_windows
if: ${{ !cancelled() && success() }}
if: ${{ !cancelled() && needs.build_windows.result == 'success' }}
uses: ./.github/workflows/unit_tests.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-win-server' || 'windows-latest' }}
@@ -192,7 +237,7 @@ jobs:
unit_tests_windows_arm64:
name: Windows arm64
needs: build_windows
if: ${{ !cancelled() && success() && !vars.SELF_HOSTED }}
if: ${{ !cancelled() && needs.build_windows.result == 'success' && !vars.SELF_HOSTED && github.event_name != 'pull_request' }}
uses: ./.github/workflows/unit_tests.yml
with:
os: windows-11-vs2026-arm
@@ -235,7 +280,7 @@ jobs:
./validator-bin/OrcaSlicer_profile_validator -p "${{ github.workspace }}/resources/profiles" -s -l 2
publish_test_results:
name: Publish Test Results
needs: [unit_tests_linux_x86_64, unit_tests_linux_aarch64, unit_tests_windows_x64, unit_tests_windows_arm64, unit_tests_macos_arm64, unit_tests_flatpak_x86_64, unit_tests_flatpak_aarch64]
needs: [unit_tests_linux_x86_64, unit_tests_linux_aarch64, unit_tests_windows_x64, unit_tests_windows_arm64, unit_tests_macos_arm64, flatpak]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
@@ -246,7 +291,9 @@ jobs:
path: test-results
# Best-effort: a read-only token (e.g. fork PRs) can't write the check, so
# don't let a publish failure fail the run. The test jobs gate correctness.
# Skipped when every build failed: there is nothing to publish.
- name: Publish Test Results
if: ${{ hashFiles('test-results/**/*.xml') != '' }}
continue-on-error: true
uses: EnricoMi/publish-unit-test-result-action@v2
with:
@@ -257,255 +304,10 @@ jobs:
with:
name: test-results-*
failOnError: false
# Pull requests build it on the build-flatpak label, from build_optional.yml.
flatpak:
name: "Flatpak"
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
volumes:
- /usr/local/lib/android:/usr/local/lib/android
- /usr/share/dotnet:/usr/share/dotnet
- /opt/ghc:/opt/ghc1
- /usr/local/share/boost:/usr/local/share/boost1
- /opt/hostedtoolcache:/opt/hostedtoolcache1
strategy:
fail-fast: false
matrix:
variant:
- arch: x86_64
runner: ubuntu-24.04
- arch: aarch64
runner: ubuntu-24.04-arm
name: Flatpak
# Don't run scheduled builds on forks; skip entirely on self-hosted runners
if: ${{ !cancelled() && !vars.SELF_HOSTED && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
runs-on: ${{ matrix.variant.runner }}
env:
date:
ver:
ver_pure:
steps:
- name: "Remove unneeded stuff to free disk space"
run:
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" /opt/hostedtoolcache1/*
- uses: actions/checkout@v7
- name: Get the version and date
run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR-${{ github.event.number }}"
git_commit_hash="${{ github.event.pull_request.head.sha }}"
else
ver=V$ver_pure
git_commit_hash="${{ github.sha }}"
fi
echo "ver=$ver" >> $GITHUB_ENV
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
shell: bash
- name: Compute the flatpak-builder cache key
id: fp_cache_key
run: echo "key=flatpak-builder-${{ matrix.variant.arch }}-${{ hashFiles('deps/**', 'scripts/flatpak/com.orcaslicer.OrcaSlicer.yml', 'scripts/flatpak/make_deps_tar.sh') }}" >> "$GITHUB_OUTPUT"
shell: bash
# Manage flatpak-builder cache externally so PRs restore but never upload.
# The compiler cache under it is keyed per run below, so it is left out.
- name: Restore flatpak-builder cache
if: github.event_name == 'pull_request'
uses: actions/cache/restore@v6
with:
path: |
.flatpak-builder/*
!.flatpak-builder/ccache
key: ${{ steps.fp_cache_key.outputs.key }}
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
- name: Save/restore flatpak-builder cache
if: github.event_name != 'pull_request'
uses: actions/cache@v6
with:
path: |
.flatpak-builder/*
!.flatpak-builder/ccache
key: ${{ steps.fp_cache_key.outputs.key }}
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
# Compiler cache for the OrcaSlicer module, as in build_orca.yml. Pull
# requests only restore it; every other run (main, release branches, the
# nightly, a dispatch) saves it. orca_deps stays on the state cache above.
- name: Name the compiler cache leg
run: |
leg="Flatpak-${{ matrix.variant.arch }}"
echo "CCACHE_LEG=$leg" >> "$GITHUB_ENV"
echo "CCACHE_ENTRY=ccache-$leg-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_ENV"
shell: bash
- name: Restore compiler cache
id: ccache_restore
uses: actions/cache/restore@v6
with:
path: .flatpak-builder/ccache
key: ${{ env.CCACHE_ENTRY }}
restore-keys: ccache-${{ env.CCACHE_LEG }}-
- name: Disable debug info for faster CI builds
run: |
sed -i '/^build-options:/a\ no-debuginfo: true\n strip: true' \
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
shell: bash
# flatpak-builder reuses a module from its cache when the definition and
# sources are unchanged, so a re-run of the same commit would skip the
# OrcaSlicer module and ship no test asset. A per-run value in that module's
# env keeps it rebuilding; orca_deps stays cached, and the compiler cache
# still serves the rebuild. run-tests on the same module builds the test
# binaries.
- name: Inject commit hash, run-tests and cache buster into Flatpak manifest
env:
flatpak_builder_cache_buster: ${{ github.run_id }}-${{ github.run_attempt }}
run: |
sed -i "/name: OrcaSlicer/{n;s|buildsystem: simple|buildsystem: simple\n run-tests: true\n build-options:\n env:\n flatpak_builder_cache_buster: \"$flatpak_builder_cache_buster\"\n git_commit_hash: \"$git_commit_hash\"|}" \
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
shell: bash
# flatpak-builder's --ccache only wraps cc and gcc, and the manifest builds
# with clang, so CMake's launcher runs ccache instead; --ccache is still what
# mounts the cache directory into the sandbox. The settings go into that
# directory's own config file, which the sandbox reads too.
- name: Enable compiler cache
run: |
printf ' %s\n' \
'CMAKE_C_COMPILER_LAUNCHER: ccache' \
'CMAKE_CXX_COMPILER_LAUNCHER: ccache' > "$RUNNER_TEMP/ccache-env.yml"
sed -i "/^ git_commit_hash: /r $RUNNER_TEMP/ccache-env.yml" \
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
grep -q '^ CMAKE_CXX_COMPILER_LAUNCHER: ccache$' scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
mkdir -p .flatpak-builder/ccache
export CCACHE_DIR=$PWD/.flatpak-builder/ccache
ccache --set-config=max_size=3G
# The compiler is reinstalled every run, so its mtime means nothing.
ccache --set-config=compiler_check=content
# Headers a fresh checkout has just written, the few files that use
# __DATE__ or __TIME__, and the precompiled header, whose macros ccache
# cannot see.
ccache --set-config=sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
# Hash the includes the compiler reports instead of preprocessing every
# miss before compiling it.
ccache --set-config=depend_mode=true
# The restored directory carries the previous run's counters.
ccache -z
shell: bash
- name: Check the manifest keeps orca_deps cacheable
run: ./scripts/flatpak/check_manifest_cacheable.sh
shell: bash
- name: Pack deps/ for the Flatpak manifest
run: ./scripts/flatpak/make_deps_tar.sh
shell: bash
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
with:
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
manifest-path: scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
# cache only turns on flatpak-builder --ccache; the caching itself is above.
cache: true
restore-cache: false
save-cache: false
arch: ${{ matrix.variant.arch }}
upload-artifact: false
keep-build-dirs: true
# The build has just touched everything it can use, so an object untouched
# for a week is dead, usually orphaned by a flag change.
- name: Compiler cache statistics
if: always()
run: |
export CCACHE_DIR=$PWD/.flatpak-builder/ccache
ccache --evict-older-than 7d
ccache -s -v || ccache -s
shell: bash
# Save the new entry first, then drop the older ones for this leg on this
# ref, so a failed save leaves the previous entry in place. A cancelled or
# failed build saves too, since what it compiled is still valid; a restore
# that did not finish does not, since the directory may be a truncated copy.
- name: Save compiler cache
id: ccache_save
if: ${{ always() && steps.ccache_restore.outcome == 'success' && github.event_name != 'pull_request' }}
uses: actions/cache/save@v6
with:
path: .flatpak-builder/ccache
key: ${{ env.CCACHE_ENTRY }}
- name: Drop older compiler cache entries
if: ${{ always() && steps.ccache_save.outcome == 'success' }}
# The container has no gh, so this is the list and delete over the REST API.
# Older means a lower run id, so two runs finishing close together keep
# the newer entry whichever of them cleans up last.
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
api="$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches"
# The save step reports success even when its tar failed, so keep
# the older entries unless the new one is listed.
if ! curl -sSf -H "Authorization: Bearer $GH_TOKEN" \
"$api?ref=$GITHUB_REF&key=$CCACHE_ENTRY" \
| jq -e --arg entry "$CCACHE_ENTRY" 'any(.actions_caches[]; .key == $entry)' > /dev/null; then
echo "$CCACHE_ENTRY was not saved; keeping the older entries."
exit 0
fi
curl -sSf -H "Authorization: Bearer $GH_TOKEN" \
"$api?ref=$GITHUB_REF&key=ccache-$CCACHE_LEG-&per_page=100" \
| jq -r --arg prefix "ccache-$CCACHE_LEG-" --argjson run "$GITHUB_RUN_ID" \
'.actions_caches[] | select((.key | ltrimstr($prefix) | split("-")[0] | tonumber?) < $run) | .id' \
| while read -r id; do
curl -sSf -X DELETE -H "Authorization: Bearer $GH_TOKEN" "$api/$id"
done
shell: bash
- name: Upload artifacts Flatpak
uses: actions/upload-artifact@v7
with:
name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak'
- name: Deploy Flatpak to nightly release
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main'
uses: ./.github/actions/deploy-nightly
with:
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
asset_name: OrcaSlicer-Linux-flatpak_nightly_${{ matrix.variant.arch }}.flatpak
# The asset is /app (the exes link it at runtime) plus the build tree
# slimmed to what ctest needs.
- name: Package flatpak test asset
shell: bash
run: |
d=$(ls -d .flatpak-builder/build/OrcaSlicer-* | tail -1)
find "$d/build_flatpak" -mindepth 1 -maxdepth 1 ! -name tests -exec rm -rf {} +
# Strip debug info (the SDK builds with -g, only the app gets stripped);
# the bounds checks are compiled in, so a stripped exe still catches them.
find "$d/build_flatpak/tests" -type f -perm -u+x -exec strip --strip-unneeded {} + 2>/dev/null || true
# At runtime the tests read tests/ (TEST_DATA_DIR), scripts/, and under
# resources/ the shipped profiles (PROFILES_DIR), the printers/ maps, and
# the icon SVGs (NativeCommands icon names are checked against them).
find "$d" -mindepth 1 -maxdepth 1 -type d \
! -name tests ! -name build_flatpak ! -name scripts ! -name resources -exec rm -rf {} +
find "$d/resources" -mindepth 1 -maxdepth 1 ! -name profiles ! -name printers ! -name images -exec rm -rf {} +
# Only the SVGs are read; the png/ico/icns/gif assets are ~35MB of dead weight.
find "$d/resources/images" -mindepth 1 -maxdepth 1 ! -name '*.svg' -exec rm -rf {} + 2>/dev/null || true
tar -cf flatpak-test-asset.tar flatpak_app "$d"
- name: Upload flatpak test asset
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}-flatpak-tests-${{ matrix.variant.arch }}
path: flatpak-test-asset.tar
retention-days: 1
# keep-build-dirs would otherwise land in the flatpak-builder cache saved post-job.
- name: Drop the kept build dirs before the flatpak-builder cache saves
if: always()
shell: bash
run: rm -rf .flatpak-builder/build
unit_tests_flatpak_x86_64:
name: Flatpak x86_64
needs: flatpak
if: ${{ !cancelled() && success() }}
uses: ./.github/workflows/unit_tests_flatpak.yml
with:
os: ubuntu-24.04
artifact: ${{ github.sha }}-flatpak-tests-x86_64
unit_tests_flatpak_aarch64:
name: Flatpak aarch64
needs: flatpak
if: ${{ !cancelled() && success() }}
uses: ./.github/workflows/unit_tests_flatpak.yml
with:
os: ubuntu-24.04-arm
artifact: ${{ github.sha }}-flatpak-tests-aarch64
if: ${{ !cancelled() && !vars.SELF_HOSTED && github.event_name != 'pull_request' && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
uses: ./.github/workflows/build_flatpak.yml
secrets: inherit
+5 -2
View File
@@ -20,10 +20,13 @@ on:
required: false
type: boolean
# Read by scripts/ci_deps_cache.sh.
# Read by scripts/ci_deps_cache.sh and scripts/ci_macos_admission.py.
env:
REPO: ${{ github.repository }}
WORKFLOW_REF: ${{ github.workflow_ref }}
# The workflow whose push and nightly builds save the deps caches.
WORKFLOW: build_all.yml
# Every workflow with macOS builds, the first of them the one above.
MACOS_WORKFLOWS: build_all.yml build_optional.yml
BASE_REF: ${{ github.base_ref }}
jobs:
+261
View File
@@ -0,0 +1,261 @@
# The Flatpak build and its unit tests, for build_all.yml and for a pull request
# that asks for it (build_optional.yml).
name: Build Flatpak
on:
workflow_call:
jobs:
flatpak:
name: Build Flatpak
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
volumes:
- /usr/local/lib/android:/usr/local/lib/android
- /usr/share/dotnet:/usr/share/dotnet
- /opt/ghc:/opt/ghc1
- /usr/local/share/boost:/usr/local/share/boost1
- /opt/hostedtoolcache:/opt/hostedtoolcache1
# Updating a runtime renames its old deployment, which fails with
# "Invalid cross-device link" on hosts whose Docker overlay cannot
# rename directories from an image layer. A volume is not overlay.
- /var/lib/flatpak
strategy:
fail-fast: false
matrix:
variant:
- arch: x86_64
runner: ubuntu-24.04
- arch: aarch64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.variant.runner }}
env:
date:
ver:
ver_pure:
steps:
- name: "Remove unneeded stuff to free disk space"
run:
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" /opt/hostedtoolcache1/*
- uses: actions/checkout@v7
- name: Get the version and date
run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR-${{ github.event.number }}"
git_commit_hash="${{ github.event.pull_request.head.sha }}"
else
ver=V$ver_pure
git_commit_hash="${{ github.sha }}"
fi
echo "ver=$ver" >> $GITHUB_ENV
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
shell: bash
- name: Compute the flatpak-builder cache key
id: fp_cache_key
run: echo "key=flatpak-builder-${{ matrix.variant.arch }}-${{ hashFiles('deps/**', 'scripts/flatpak/com.orcaslicer.OrcaSlicer.yml', 'scripts/flatpak/make_deps_tar.sh') }}" >> "$GITHUB_OUTPUT"
shell: bash
# Manage flatpak-builder cache externally so PRs restore but never upload.
# The compiler cache under it is keyed per run below, so it is left out.
- name: Restore flatpak-builder cache
if: github.event_name == 'pull_request'
uses: actions/cache/restore@v6
with:
path: |
.flatpak-builder/*
!.flatpak-builder/ccache
key: ${{ steps.fp_cache_key.outputs.key }}
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
- name: Save/restore flatpak-builder cache
if: github.event_name != 'pull_request'
uses: actions/cache@v6
with:
path: |
.flatpak-builder/*
!.flatpak-builder/ccache
key: ${{ steps.fp_cache_key.outputs.key }}
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
# Compiler cache for the OrcaSlicer module, as in build_orca.yml. Pull
# requests only restore it; every other run (main, release branches, the
# nightly, a dispatch) saves it. orca_deps stays on the state cache above.
- name: Name the compiler cache leg
run: |
leg="Flatpak-${{ matrix.variant.arch }}"
echo "CCACHE_LEG=$leg" >> "$GITHUB_ENV"
echo "CCACHE_ENTRY=ccache-$leg-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_ENV"
shell: bash
- name: Restore compiler cache
id: ccache_restore
uses: actions/cache/restore@v6
with:
path: .flatpak-builder/ccache
key: ${{ env.CCACHE_ENTRY }}
restore-keys: ccache-${{ env.CCACHE_LEG }}-
- name: Disable debug info for faster CI builds
run: |
sed -i '/^build-options:/a\ no-debuginfo: true\n strip: true' \
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
shell: bash
# flatpak-builder reuses a module from its cache when the definition and
# sources are unchanged, so a re-run of the same commit would skip the
# OrcaSlicer module and ship no test asset. A per-run value in that module's
# env keeps it rebuilding; orca_deps stays cached, and the compiler cache
# still serves the rebuild. run-tests on the same module builds the test
# binaries.
- name: Inject commit hash, run-tests and cache buster into Flatpak manifest
env:
flatpak_builder_cache_buster: ${{ github.run_id }}-${{ github.run_attempt }}
run: |
sed -i "/name: OrcaSlicer/{n;s|buildsystem: simple|buildsystem: simple\n run-tests: true\n build-options:\n env:\n flatpak_builder_cache_buster: \"$flatpak_builder_cache_buster\"\n git_commit_hash: \"$git_commit_hash\"|}" \
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
shell: bash
# flatpak-builder's --ccache only wraps cc and gcc, and the manifest builds
# with clang, so CMake's launcher runs ccache instead; --ccache is still what
# mounts the cache directory into the sandbox. The settings go into that
# directory's own config file, which the sandbox reads too.
- name: Enable compiler cache
run: |
printf ' %s\n' \
'CMAKE_C_COMPILER_LAUNCHER: ccache' \
'CMAKE_CXX_COMPILER_LAUNCHER: ccache' > "$RUNNER_TEMP/ccache-env.yml"
sed -i "/^ git_commit_hash: /r $RUNNER_TEMP/ccache-env.yml" \
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
grep -q '^ CMAKE_CXX_COMPILER_LAUNCHER: ccache$' scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
mkdir -p .flatpak-builder/ccache
export CCACHE_DIR=$PWD/.flatpak-builder/ccache
ccache --set-config=max_size=3G
# The compiler is reinstalled every run, so its mtime means nothing.
ccache --set-config=compiler_check=content
# Headers a fresh checkout has just written, the few files that use
# __DATE__ or __TIME__, and the precompiled header, whose macros ccache
# cannot see.
ccache --set-config=sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
# Hash the includes the compiler reports instead of preprocessing every
# miss before compiling it.
ccache --set-config=depend_mode=true
# The restored directory carries the previous run's counters.
ccache -z
shell: bash
- name: Check the manifest keeps orca_deps cacheable
run: ./scripts/flatpak/check_manifest_cacheable.sh
shell: bash
- name: Pack deps/ for the Flatpak manifest
run: ./scripts/flatpak/make_deps_tar.sh
shell: bash
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
with:
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
manifest-path: scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
# cache only turns on flatpak-builder --ccache; the caching itself is above.
cache: true
restore-cache: false
save-cache: false
arch: ${{ matrix.variant.arch }}
upload-artifact: false
keep-build-dirs: true
# The build has just touched everything it can use, so an object untouched
# for a week is dead, usually orphaned by a flag change.
- name: Compiler cache statistics
if: always()
run: |
export CCACHE_DIR=$PWD/.flatpak-builder/ccache
ccache --evict-older-than 7d
ccache -s -v || ccache -s
shell: bash
# Save the new entry first, then drop the older ones for this leg on this
# ref, so a failed save leaves the previous entry in place. A cancelled or
# failed build saves too, since what it compiled is still valid; a restore
# that did not finish does not, since the directory may be a truncated copy.
- name: Save compiler cache
id: ccache_save
if: ${{ always() && steps.ccache_restore.outcome == 'success' && github.event_name != 'pull_request' }}
uses: actions/cache/save@v6
with:
path: .flatpak-builder/ccache
key: ${{ env.CCACHE_ENTRY }}
- name: Drop older compiler cache entries
if: ${{ always() && steps.ccache_save.outcome == 'success' }}
# The container has no gh, so this is the list and delete over the REST API.
# Older means a lower run id, so two runs finishing close together keep
# the newer entry whichever of them cleans up last.
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
api="$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches"
# The save step reports success even when its tar failed, so keep
# the older entries unless the new one is listed.
if ! curl -sSf -H "Authorization: Bearer $GH_TOKEN" \
"$api?ref=$GITHUB_REF&key=$CCACHE_ENTRY" \
| jq -e --arg entry "$CCACHE_ENTRY" 'any(.actions_caches[]; .key == $entry)' > /dev/null; then
echo "$CCACHE_ENTRY was not saved; keeping the older entries."
exit 0
fi
curl -sSf -H "Authorization: Bearer $GH_TOKEN" \
"$api?ref=$GITHUB_REF&key=ccache-$CCACHE_LEG-&per_page=100" \
| jq -r --arg prefix "ccache-$CCACHE_LEG-" --argjson run "$GITHUB_RUN_ID" \
'.actions_caches[] | select((.key | ltrimstr($prefix) | split("-")[0] | tonumber?) < $run) | .id' \
| while read -r id; do
curl -sSf -X DELETE -H "Authorization: Bearer $GH_TOKEN" "$api/$id"
done
shell: bash
- name: Upload artifacts Flatpak
uses: actions/upload-artifact@v7
with:
name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak'
- name: Deploy Flatpak to nightly release
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main'
uses: ./.github/actions/deploy-nightly
with:
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
asset_name: OrcaSlicer-Linux-flatpak_nightly_${{ matrix.variant.arch }}.flatpak
# The asset is /app (the exes link it at runtime) plus the build tree
# slimmed to what ctest needs.
- name: Package flatpak test asset
shell: bash
run: |
d=$(ls -d .flatpak-builder/build/OrcaSlicer-* | tail -1)
find "$d/build_flatpak" -mindepth 1 -maxdepth 1 ! -name tests -exec rm -rf {} +
# Strip debug info (the SDK builds with -g, only the app gets stripped);
# the bounds checks are compiled in, so a stripped exe still catches them.
find "$d/build_flatpak/tests" -type f -perm -u+x -exec strip --strip-unneeded {} + 2>/dev/null || true
# At runtime the tests read tests/ (TEST_DATA_DIR), scripts/, and under
# resources/ the shipped profiles (PROFILES_DIR), the printers/ maps, and
# the icon SVGs (NativeCommands icon names are checked against them).
find "$d" -mindepth 1 -maxdepth 1 -type d \
! -name tests ! -name build_flatpak ! -name scripts ! -name resources -exec rm -rf {} +
find "$d/resources" -mindepth 1 -maxdepth 1 ! -name profiles ! -name printers ! -name images -exec rm -rf {} +
# Only the SVGs are read; the png/ico/icns/gif assets are ~35MB of dead weight.
find "$d/resources/images" -mindepth 1 -maxdepth 1 ! -name '*.svg' -exec rm -rf {} + 2>/dev/null || true
tar -cf flatpak-test-asset.tar flatpak_app "$d"
- name: Upload flatpak test asset
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}-flatpak-tests-${{ matrix.variant.arch }}
path: flatpak-test-asset.tar
retention-days: 1
# keep-build-dirs would otherwise land in the flatpak-builder cache saved post-job.
- name: Drop the kept build dirs before the flatpak-builder cache saves
if: always()
shell: bash
run: rm -rf .flatpak-builder/build
unit_tests_flatpak_x86_64:
name: Flatpak x86_64
needs: flatpak
if: ${{ !cancelled() && success() }}
uses: ./.github/workflows/unit_tests_flatpak.yml
with:
os: ubuntu-24.04
artifact: ${{ github.sha }}-flatpak-tests-x86_64
unit_tests_flatpak_aarch64:
name: Flatpak aarch64
needs: flatpak
if: ${{ !cancelled() && success() }}
uses: ./.github/workflows/unit_tests_flatpak.yml
with:
os: ubuntu-24.04-arm
artifact: ${{ github.sha }}-flatpak-tests-aarch64
+222
View File
@@ -0,0 +1,222 @@
# The builds a pull request gets only when asked for. build_all.yml leaves them
# out of pull requests and builds them on every push to main: the Flatpak is
# the slowest Linux leg, a macOS x86_64 build holds one of the few hosted macOS
# runners for an hour, and Windows arm64 doubles the Windows legs.
#
# A label asks for one, from the moment it is added and on every later push to
# the pull request: build-flatpak, build-macos-x86_64, build-windows-arm64,
# build-windows-msvc. build-all asks for the first three, the builds every pull
# request once got; the MSVC build is another compiler's, never a build a pull
# request got, and the first one builds the deps too, so it stays label-only.
# Removing and adding a label again rebuilds the same commit.
#
# A pull request that changes anything but sources, tests, profiles,
# translations and docs builds the Flatpak and Windows arm64 without a label:
# what breaks only those legs lives in deps/, cmake/, the build scripts and the
# workflows, and a list of those places would go stale, so the safe places are
# listed instead. The macOS and the cl.exe builds never start on their own:
# what breaks only cl comes from source changes, which no path rule can see.
#
# Each build-* or macos-priority label added starts a run of its own, and the
# pull request's checks show the newest run only, so every run builds
# everything the labels and the changed files ask for; any other label builds
# nothing. Each build keeps its own concurrency group: a build entering its
# group cancels the one already in it, so when two runs start together the
# last to enter wins, not necessarily the newest run. A push cancels the
# builds of the commit it replaces. cancel_closed_pr_builds.yml joins the
# groups by name, so update that file with any change here.
name: Optional builds
on:
pull_request:
branches:
- main
- release/*
# Build all's pull_request paths, plus the Flatpak packaging: a pull request
# that Build all skips has nothing for these builds to check either, and
# the filter applies to labeled too. Keep the two lists in step.
paths:
- 'deps/**'
- 'deps_src/**'
- 'cmake/**'
- 'src/**'
- '**/CMakeLists.txt'
- 'version.inc'
- ".github/workflows/build_*.yml"
- ".github/workflows/unit_tests*.yml"
- 'build_linux.sh'
- 'build_win.bat'
- 'scripts/test_build_win.ps1'
- 'scripts/check_exception_throw_info.ps1'
- 'scripts/test_check_exception_throw_info.ps1'
- 'build_release_macos.sh'
- 'scripts/build_preset_cache.*'
- 'scripts/prune_cached_presets.ps1'
- 'scripts/test_prune_cached_presets.ps1'
- 'scripts/flatpak/**'
- 'scripts/msix/**'
- 'tests/**'
# labeled, so adding a label starts the build it asks for.
types: [opened, reopened, synchronize, labeled]
jobs:
select:
name: Select builds
# A label that asks for no build must not restart the builds in progress.
# macos-priority restarts them, to move the macOS build to its own line.
if: ${{ github.event.action != 'labeled' || startsWith(github.event.label.name, 'build-') || github.event.label.name == 'macos-priority' }}
runs-on: ubuntu-24.04
outputs:
flatpak: ${{ steps.select.outputs.flatpak }}
macos-x86_64: ${{ steps.select.outputs.macos-x86_64 }}
windows-arm64: ${{ steps.select.outputs.windows-arm64 }}
windows-msvc: ${{ steps.select.outputs.windows-msvc }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
lfs: 'false'
# The merge commit plus its first parent, the base it is diffed against.
fetch-depth: 2
sparse-checkout: .github/workflows
- name: Select the builds the labels and the changed files ask for
id: select
env:
LABELS: ${{ join(github.event.pull_request.labels.*.name, ' ') }}
run: |
has_label() { [[ " $LABELS " == *" $1 "* ]]; }
infra=false
changed=$(git diff --name-only HEAD^1 HEAD \
| grep -vE '^(src|tests|resources|localization|docs)/' | grep -vE '\.md$' || true)
if [ -n "$changed" ]; then
echo "This pull request changes files outside the sources, tests, profiles, translations and docs:"
echo "$changed" | head -20
infra=true
fi
# pick <output> <label> <on an infra change> [<part of build-all>]
pick() {
local build=$1 label=$2 auto=$3 all=${4:-true} on=false
if has_label "$label" || { [ "$all" = true ] && has_label build-all; } \
|| { [ "$auto" = true ] && [ "$infra" = true ]; }; then
on=true
fi
echo "$build=$on" >> "$GITHUB_OUTPUT"
echo "$build: $on"
}
pick flatpak build-flatpak true
pick macos-x86_64 build-macos-x86_64 false
pick windows-arm64 build-windows-arm64 true
pick windows-msvc build-windows-msvc false false
flatpak:
name: Flatpak
needs: select
# Skipped on self-hosted runners, as in build_all.yml.
if: ${{ needs.select.outputs.flatpak == 'true' && !vars.SELF_HOSTED }}
concurrency:
group: build-optional-flatpak-${{ github.event.pull_request.number }}
cancel-in-progress: true
uses: ./.github/workflows/build_flatpak.yml
secrets: inherit
# Named like build_all.yml's job, so scripts/ci_macos_admission.py and
# scripts/ci_deps_cache.sh find its jobs, and the pull request waits in the
# macOS line like any other.
build_macos_arch:
needs: select
if: ${{ needs.select.outputs.macos-x86_64 == 'true' }}
strategy:
matrix:
arch:
- x86_64
concurrency:
group: build-optional-macos-${{ matrix.arch }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-15' }}
arch: ${{ matrix.arch }}
secrets: inherit
# build_all.yml has already run the build script's test suite for this
# commit, before its Windows x64 build. Skipped on self-hosted runners, as
# there (the self-hosted Windows server is x64-only).
build_windows_arm64:
name: Build Windows arm64
needs: select
if: ${{ needs.select.outputs.windows-arm64 == 'true' && !vars.SELF_HOSTED }}
concurrency:
group: build-optional-windows-arm64-${{ github.event.pull_request.number }}
cancel-in-progress: true
uses: ./.github/workflows/build_check_cache.yml
with:
os: windows-11-vs2026-arm
arch: arm64
compiler: clang
secrets: inherit
unit_tests_windows_arm64:
name: Windows arm64
needs: build_windows_arm64
if: ${{ !cancelled() && success() }}
# The build's group, free once the build finished, so a newer build of this
# pull request cancels these tests too.
concurrency:
group: build-optional-windows-arm64-${{ github.event.pull_request.number }}
cancel-in-progress: true
uses: ./.github/workflows/unit_tests.yml
with:
os: windows-11-vs2026-arm
artifact: ${{ github.sha }}-tests-windows-arm64
test-dir: build-arm64/tests
# A cl.exe build of x64, for what clang-cl, the compiler that ships, does
# not catch. Its portable build, installer and PDB upload under _msvc names;
# nothing deploys. No push build saves a cl deps cache, so the first build
# on a pull request builds the deps too; later builds on the same pull
# request restore them.
build_windows_msvc:
name: Build Windows x64 MSVC
needs: select
if: ${{ needs.select.outputs.windows-msvc == 'true' && !vars.SELF_HOSTED }}
concurrency:
group: build-optional-windows-msvc-${{ github.event.pull_request.number }}
cancel-in-progress: true
uses: ./.github/workflows/build_check_cache.yml
with:
os: windows-latest
arch: x64
compiler: msvc
secrets: inherit
publish_test_results:
name: Publish Test Results
needs: [flatpak, unit_tests_windows_arm64]
# Concurrency cancels the builds of a superseded run, not the run, so
# !cancelled() alone would still publish for it.
if: ${{ !cancelled() && (contains(fromJSON('["success", "failure"]'), needs.flatpak.result) || contains(fromJSON('["success", "failure"]'), needs.unit_tests_windows_arm64.result)) }}
runs-on: ubuntu-latest
steps:
- name: Download Test Results
uses: actions/download-artifact@v8
with:
pattern: test-results-*
path: test-results
# Best-effort, as in build_all.yml: a read-only token (e.g. fork PRs)
# can't write the check. The test jobs gate correctness.
# A build that failed runs no tests; publishing nothing would post an
# empty result.
- name: Publish Test Results
if: ${{ hashFiles('test-results/**/*.xml') != '' }}
continue-on-error: true
uses: EnricoMi/publish-unit-test-result-action@v2
with:
# Its own check, next to the one build_all.yml publishes for the
# same commit.
check_name: Optional Test Results
files: "test-results/**/*.xml"
- name: Delete Test Results
if: success()
uses: geekyeggo/delete-artifact@v6
with:
name: test-results-*
failOnError: false
+205 -40
View File
@@ -35,6 +35,8 @@ jobs:
ORCA_UPDATER_SIG_KEY: ${{ secrets.ORCA_UPDATER_SIG_KEY }}
NSIS_VERSION: '3.13'
NSIS_SHA256: BA63DFFC4410EE89193E1CB5A41989991BD77C61068DA17E3156D136B7B0B3D8
JSIGN_VERSION: '7.6'
JSIGN_SHA256: 6CF58AA080E7FF82656F320CFF8D4A3BFF30408DF8766806DCBA3740DD839FA5
steps:
- name: Checkout
@@ -60,8 +62,10 @@ jobs:
# restore it and discard what they compiled. Objects are keyed on the
# preprocessed source, the compiler and the flags, so a leg only ever
# hits its own entries. A failed install costs the caching, not the build.
# cl under the Visual Studio generator takes no launcher, so that build
# runs without one.
- name: Name the compiler cache leg
if: ${{ !inputs.macos-combine-only }}
if: ${{ !inputs.macos-combine-only && !(runner.os == 'Windows' && inputs.compiler != 'clang') }}
shell: bash
run: |
leg="${{ runner.os }}-${{ inputs.arch || 'amd64' }}${{ runner.os == 'Windows' && format('-{0}', inputs.compiler) || '' }}"
@@ -74,7 +78,7 @@ jobs:
# spells it differently on Windows.
- name: Compiler cache
id: ccache
if: ${{ !inputs.macos-combine-only }}
if: ${{ !inputs.macos-combine-only && !(runner.os == 'Windows' && inputs.compiler != 'clang') }}
continue-on-error: true
uses: hendrikmuhs/ccache-action@v1.2.24
with:
@@ -197,7 +201,8 @@ jobs:
- name: Pack unit tests mac
if: runner.os == 'macOS' && !inputs.macos-combine-only && inputs.arch == 'arm64'
working-directory: ${{ github.workspace }}
run: tar -cvf build_tests.tar build/arm64/tests
# CMakeFiles holds only object files and precompiled headers, which ctest never reads.
run: tar -cf build_tests.tar --exclude='*/CMakeFiles' build/arm64/tests
- name: Upload Test Artifact mac
if: runner.os == 'macOS' && !inputs.macos-combine-only && inputs.arch == 'arm64'
@@ -217,14 +222,38 @@ jobs:
# installed into it here; the source tree keeps its JSONs for later jobs.
run: ./scripts/build_preset_cache.sh -b build/${{ inputs.arch }} build/${{ inputs.arch }}/OrcaSlicer/OrcaSlicer.app/Contents/Resources/profiles
# A pull request builds no universal app (build_all.yml), so each arch it
# builds ships as its own DMG; every other run packs the bundle for the
# universal job below.
- name: Create DMG ${{ inputs.arch }} without notary
if: runner.os == 'macOS' && !inputs.macos-combine-only && github.event_name == 'pull_request'
working-directory: ${{ github.workspace }}
run: |
# Load the `retry` and `create_dmg` helpers.
source ${{ github.workspace }}/scripts/retry.sh
source ${{ github.workspace }}/scripts/create_dmg.sh
dmg_dir=${{ github.workspace }}/build/${{ inputs.arch }}/OrcaSlicer_dmg
mkdir -p "$dmg_dir"
rm -rf "$dmg_dir"/*
cp -R ${{ github.workspace }}/build/${{ inputs.arch }}/OrcaSlicer/OrcaSlicer.app "$dmg_dir/"
ln -sfn /Applications "$dmg_dir/Applications"
create_dmg "OrcaSlicer" "$dmg_dir" OrcaSlicer_Mac_${{ inputs.arch }}_${{ env.ver }}.dmg
- name: Upload DMG ${{ inputs.arch }}
if: runner.os == 'macOS' && !inputs.macos-combine-only && github.event_name == 'pull_request'
uses: actions/upload-artifact@v7
with:
name: OrcaSlicer_Mac_${{ inputs.arch }}_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_${{ inputs.arch }}_${{ env.ver }}.dmg
- name: Pack macOS app bundle ${{ inputs.arch }}
if: runner.os == 'macOS' && !inputs.macos-combine-only
if: runner.os == 'macOS' && !inputs.macos-combine-only && github.event_name != 'pull_request'
working-directory: ${{ github.workspace }}
run: |
tar -czvf OrcaSlicer_Mac_bundle_${{ inputs.arch }}_${{ github.sha }}.tar.gz -C build/${{ inputs.arch }} OrcaSlicer
- name: Upload macOS app bundle ${{ inputs.arch }}
if: runner.os == 'macOS' && !inputs.macos-combine-only
if: runner.os == 'macOS' && !inputs.macos-combine-only && github.event_name != 'pull_request'
uses: actions/upload-artifact@v7
with:
name: OrcaSlicer_Mac_bundle_${{ inputs.arch }}_${{ github.sha }}
@@ -423,11 +452,14 @@ jobs:
run: |
if ("${{ inputs.arch }}" -eq "arm64") {
"BUILD_DIR=build-arm64" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
"ARCH_SUFFIX=_arm64" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
$suffix = "_arm64"
} else {
"BUILD_DIR=build" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
"ARCH_SUFFIX=_x64" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
$suffix = "_x64"
}
# The clang build ships under the plain names; a cl build's artifacts say so.
if ("${{ inputs.compiler }}" -ne "clang") { $suffix += "_msvc" }
"ARCH_SUFFIX=$suffix" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
- name: setup MSVC
if: runner.os == 'Windows'
@@ -473,6 +505,41 @@ jobs:
path: ${{ runner.temp }}/nsis
key: nsis-${{ env.NSIS_VERSION }}
# Windows release builds are Authenticode-signed with the company's key in Google Cloud KMS
# (README, Code Signing Policy): pushes, schedules and manual runs of main and release/* in
# this repository, once the WINDOWS_SIGN_* variables are set. The Workload Identity provider
# accepts tokens from nothing else. This runs before the build so that CMake wires signing
# into the NSIS installer.
- name: Configure code signing
id: codesign
if: runner.os == 'Windows' && github.repository == 'OrcaSlicer/OrcaSlicer' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && github.event_name != 'pull_request' && vars.WINDOWS_SIGN_KMS_KEY != ''
shell: pwsh
env:
CERT_CHAIN: ${{ vars.WINDOWS_SIGN_CERT_CHAIN }}
KMS_KEY: ${{ vars.WINDOWS_SIGN_KMS_KEY }}
run: |
$jar = Join-Path $env:RUNNER_TEMP "jsign-$env:JSIGN_VERSION.jar"
curl.exe -fsSL --retry 5 --retry-all-errors --retry-delay 15 -o $jar "https://github.com/ebourg/jsign/releases/download/$env:JSIGN_VERSION/jsign-$env:JSIGN_VERSION.jar"
if ($LASTEXITCODE -ne 0) { throw "Jsign $env:JSIGN_VERSION download failed." }
if ((Get-FileHash $jar -Algorithm SHA256).Hash -ne $env:JSIGN_SHA256) {
throw "Jsign $env:JSIGN_VERSION does not match its pinned SHA256."
}
$cert = Join-Path $env:RUNNER_TEMP 'codesign-chain.pem'
Set-Content -LiteralPath $cert -Value $env:CERT_CHAIN
"ORCA_SIGN_JSIGN=$jar" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
"ORCA_SIGN_CERTFILE=$cert" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
"ORCA_SIGN_KMS_KEY=$env:KMS_KEY" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
# Names the certificate in the signed NSIS plugin cache key, so a new certificate re-signs them.
"cert-id=$((Get-FileHash -LiteralPath $cert -Algorithm SHA256).Hash.Substring(0, 16))" |
Out-File -Append -FilePath $env:GITHUB_OUTPUT -Encoding utf8
- name: Set up Java for code signing
if: steps.codesign.outcome == 'success'
uses: actions/setup-java@v6
with:
distribution: microsoft
java-version: '21'
- name: Build slicer Win
if: runner.os == 'Windows'
working-directory: ${{ github.workspace }}
@@ -481,6 +548,7 @@ jobs:
# cache-path is the install directory inside the deps build directory.
$deps = (Split-Path "${{ github.workspace }}/${{ inputs.cache-path }}").Replace('\', '/')
# -l compiles with Visual Studio's clang-cl and -x builds with Ninja; --msvc --msbuild is cl under the Visual Studio generator.
# The clang build is the one that ships: a cl build packs and uploads under _msvc names, and only the clang build is tested, checked and deployed.
$flags = if ("${{ inputs.compiler }}" -eq "clang") { "-l", "-x" } else { "--msvc", "--msbuild" }
.\build_win.bat -s --tests -i --arch ${{ inputs.arch }} --build-dir $env:BUILD_DIR --deps-dir $deps @flags
shell: pwsh
@@ -492,14 +560,60 @@ jobs:
# the checkout cpack re-installs from when it builds the NSIS installer.
run: scripts\build_preset_cache.bat --prune-source "%BUILD_DIR%" "resources\profiles" "%BUILD_DIR%\OrcaSlicer\resources\profiles"
# Taken after the build because the token lasts an hour, which covers signing, the installer
# build and the checks.
- name: Authenticate to Google Cloud for code signing
id: codesign_auth
if: steps.codesign.outcome == 'success'
uses: google-github-actions/auth@v3
with:
workload_identity_provider: ${{ vars.WINDOWS_SIGN_WIF_PROVIDER }}
service_account: ${{ vars.WINDOWS_SIGN_SERVICE_ACCOUNT }}
token_format: access_token
create_credentials_file: false
# The NSIS plugins change only with the NSIS version, so they are signed once per certificate and
# kept; the signing below skips files that are already signed.
- name: Restore signed NSIS plugins
id: nsis-plugins
if: steps.codesign.outcome == 'success' && !vars.SELF_HOSTED
uses: actions/cache/restore@v6
with:
path: ${{ runner.temp }}/nsis/Plugins
key: nsis-plugins-signed-${{ env.NSIS_VERSION }}-${{ steps.codesign.outputs.cert-id }}
# Signs what the portable zip, the artifact and the MSIX package ship, the profile validator,
# and the NSIS plugins the installer carries. cpack installs the app again for the installer;
# ORCA_SIGN_REUSE lets its signing hook copy these signed files instead of signing them again.
- name: Sign Windows binaries
if: steps.codesign.outcome == 'success'
shell: pwsh
env:
ORCA_SIGN_TOKEN: ${{ steps.codesign_auth.outputs.access_token }}
ORCA_SIGN_REUSE: ${{ runner.temp }}/signed-files.json
run: |
$paths = @("$env:BUILD_DIR/OrcaSlicer")
foreach ($extra in 'build/src/Release/OrcaSlicer_profile_validator.exe', "$env:RUNNER_TEMP/nsis/Plugins") {
if (Test-Path $extra) { $paths += $extra }
}
./scripts/sign_windows.ps1 -Path $paths
- name: Save signed NSIS plugins
if: steps.codesign.outcome == 'success' && !vars.SELF_HOSTED && steps.nsis-plugins.outputs.cache-hit != 'true'
uses: actions/cache/save@v6
with:
path: ${{ runner.temp }}/nsis/Plugins
key: nsis-plugins-signed-${{ env.NSIS_VERSION }}-${{ steps.codesign.outputs.cert-id }}
- name: Pack unit tests Win
if: runner.os == 'Windows'
if: runner.os == 'Windows' && inputs.compiler == 'clang'
working-directory: ${{ github.workspace }}
shell: pwsh
run: tar -cvf build_tests.tar ${{ env.BUILD_DIR }}/tests
# CMakeFiles holds only object files and precompiled headers, which ctest never reads.
run: tar -cf build_tests.tar --exclude='*/CMakeFiles' ${{ env.BUILD_DIR }}/tests
- name: Upload Test Artifact Win
if: runner.os == 'Windows'
if: runner.os == 'Windows' && inputs.compiler == 'clang'
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}-tests-windows-${{ inputs.arch }}
@@ -510,11 +624,28 @@ jobs:
# NSIS is x86-only; it runs (and the installer it emits runs) under ARM64's
# x86 emulation, packaging the native arm64 payload from build-arm64.
- name: Create installer Win
# makensis compresses on one core and its signing hook waits on the network, so the installer
# builds in the background while the portable zip and the PDB archive are made; "Finish
# installer Win" waits for it. cpack installs its own copy of the app from the build tree, and
# the others only read build/OrcaSlicer and the PDBs.
- name: Start installer Win
id: start_installer
if: runner.os == 'Windows' && !vars.SELF_HOSTED
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }}
# Read by scripts/sign_windows.ps1 when CMake wired signing into the installer.
env:
ORCA_SIGN_TOKEN: ${{ steps.codesign_auth.outputs.access_token }}
ORCA_SIGN_REUSE: ${{ runner.temp }}/signed-files.json
shell: pwsh
run: |
cpack -G NSIS
$exit = Join-Path $env:RUNNER_TEMP 'cpack.exit'
$log = Join-Path $env:RUNNER_TEMP 'cpack.log'
# A hidden window of its own, writing its output to a file, holds none of this step's pipes,
# so the step ends without waiting for cpack. The exit code is written under another name
# and renamed, so the wait never reads half of it.
$cpack = Start-Process pwsh -WindowStyle Hidden -PassThru -ArgumentList '-NoProfile', '-Command',
"cpack -G NSIS *> '$log'; Set-Content '$exit.tmp' `$LASTEXITCODE; Move-Item '$exit.tmp' '$exit'"
Set-Content (Join-Path $env:RUNNER_TEMP 'cpack.pid') $cpack.Id
- name: Pack app
if: runner.os == 'Windows'
@@ -528,6 +659,49 @@ jobs:
shell: cmd
run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb'
# Also after a failed pack step, so cpack's log is still shown.
- name: Finish installer Win
if: ${{ !cancelled() && steps.start_installer.outcome == 'success' }}
working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }}
timeout-minutes: 30
shell: pwsh
run: |
$exit = Join-Path $env:RUNNER_TEMP 'cpack.exit'
$cpackId = Get-Content (Join-Path $env:RUNNER_TEMP 'cpack.pid')
while (-not (Test-Path $exit)) {
if (-not (Get-Process -Id $cpackId -ErrorAction SilentlyContinue) -and -not (Test-Path $exit)) {
throw 'cpack stopped without leaving an exit code.'
}
Start-Sleep -Seconds 5
}
Get-Content (Join-Path $env:RUNNER_TEMP 'cpack.log')
if ((Get-Content $exit) -ne '0') {
# makensis writes its errors, and the signing hook's output, only to this log.
Get-Content _CPack_Packages/*/NSIS/NSISOutput.log -Tail 80
exit 1
}
# Checks the shipped files, the installer, the payload inside it (7-Zip unpacks NSIS
# installers) and the uninstaller a silent install writes.
- name: Verify Windows signatures
if: steps.codesign.outcome == 'success'
timeout-minutes: 20
shell: pwsh
run: |
$paths = @("$env:BUILD_DIR/OrcaSlicer")
$validator = 'build/src/Release/OrcaSlicer_profile_validator.exe'
if (Test-Path $validator) { $paths += $validator }
$installer = Get-ChildItem "$env:BUILD_DIR/OrcaSlicer_Windows_Installer_*.exe" | Select-Object -First 1
if ($installer) {
$payload = Join-Path $env:RUNNER_TEMP 'installer-payload'
& 'C:/Program Files/7-Zip/7z.exe' x -y "-o$payload" $installer.FullName | Out-Null
if ($LASTEXITCODE -ne 0) { throw "7-Zip could not unpack $($installer.Name)." }
$installed = Join-Path $env:RUNNER_TEMP 'installer-test'
Start-Process -Wait -FilePath $installer.FullName -ArgumentList '/S', "/D=$installed"
$paths += $installer.FullName, $payload, (Join-Path $installed 'Uninstall.exe')
}
./scripts/sign_windows.ps1 -Verify -Path $paths
- name: Upload artifacts Win zip
if: runner.os == 'Windows'
uses: actions/upload-artifact@v7
@@ -546,11 +720,11 @@ jobs:
if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED
uses: actions/upload-artifact@v7
with:
name: PDB
name: PDB${{ inputs.compiler != 'clang' && '_msvc' || '' }}
path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z
- name: Upload OrcaSlicer_profile_validator Win
if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED
if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED && inputs.compiler == 'clang'
uses: actions/upload-artifact@v7
with:
name: OrcaSlicer_profile_validator_Windows_${{ env.ver }}
@@ -564,7 +738,7 @@ jobs:
run: scripts\check_exception_throw_info.ps1 -BuildDir $env:BUILD_DIR
- name: Deploy Windows release portable
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && !vars.SELF_HOSTED
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && !vars.SELF_HOSTED && inputs.compiler == 'clang'
uses: ./.github/actions/deploy-nightly
with:
asset_path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }}_portable.zip
@@ -572,7 +746,7 @@ jobs:
content_type: application/x-zip-compressed
- name: Deploy Windows release installer
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && !vars.SELF_HOSTED
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && !vars.SELF_HOSTED && inputs.compiler == 'clang'
uses: ./.github/actions/deploy-nightly
with:
asset_path: ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer_Windows_Installer_${{ env.ver }}${{ env.ARCH_SUFFIX }}.exe
@@ -580,7 +754,7 @@ jobs:
content_type: application/x-msdownload
- name: Deploy Windows OrcaSlicer_profile_validator release
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED
if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' && runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED && inputs.compiler == 'clang'
uses: ./.github/actions/deploy-nightly
with:
asset_path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe
@@ -588,7 +762,7 @@ jobs:
content_type: application/x-msdownload
- name: Build MSIX Store package Win
if: runner.os == 'Windows' && !vars.SELF_HOSTED
if: runner.os == 'Windows' && !vars.SELF_HOSTED && inputs.compiler == 'clang'
working-directory: ${{ github.workspace }}
shell: pwsh
run: |
@@ -601,7 +775,7 @@ jobs:
-PublisherDisplayName "${{ vars.ORCA_MSIX_PUBLISHER_DISPLAY_NAME || 'OrcaSlicer' }}"
- name: Upload artifacts Win MSIX
if: runner.os == 'Windows' && !vars.SELF_HOSTED
if: runner.os == 'Windows' && !vars.SELF_HOSTED && inputs.compiler == 'clang'
uses: actions/upload-artifact@v7
with:
name: OrcaSlicer_Windows_MSIX_${{ env.ver }}${{ env.ARCH_SUFFIX }}
@@ -617,15 +791,23 @@ jobs:
- name: Build slicer and tests
if: runner.os == 'Linux'
shell: bash
env:
# libstdc++'s checks, so the unit tests abort on an out-of-range
# access here too. The Flatpak gets them from its SDK's default
# flags and was the only leg catching those on pull requests, which
# build it only on request.
ORCA_EXTRA_BUILD_ARGS: -DSLIC3R_GLIBCXX_ASSERTIONS=ON
run: |
# Build + tar the unit tests (-t) on both Linux legs so each arch
# (x86_64 + aarch64) gets tested by its own unit_tests_linux_* job.
./build_linux.sh -istrlL
# -P ships the system preset caches into the package before the AppImage is packed from it.
./build_linux.sh -istrlLP
./scripts/check_appimage_libs.sh ./build/package ./build/package/bin/orca-slicer
appimage=./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}${{ env.arch_suffix }}_${{ env.ver }}.AppImage
mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage "$appimage"
chmod +x "$appimage"
tar -cvf build_tests.tar build/tests
# CMakeFiles holds only object files and precompiled headers, which ctest never reads.
tar -cf build_tests.tar --exclude='*/CMakeFiles' build/tests
# Use tar because upload-artifacts won't always preserve directory structure
# and doesn't preserve file permissions
@@ -639,23 +821,6 @@ jobs:
retention-days: 5
if-no-files-found: error
- name: Build system preset cache (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
# Both were packed from resources/ before the caches existed, so the
# AppImage is unpacked first and the caches shipped into it and into
# the package tree; the source tree keeps its JSONs for later steps.
appimage=$(find build -maxdepth 1 -name "OrcaSlicer_Linux_AppImage*.AppImage" | head -1)
chmod +x "$appimage"
"$appimage" --appimage-extract
./scripts/build_preset_cache.sh -b build build/package/resources/profiles squashfs-root/resources/profiles
# The runtime extracts every directory as 0700, and appimagetool (continuous
# build 333 onwards) refuses to pack a tree other users cannot read.
chmod -R a+rX squashfs-root
appimagetool=$(find build -name "appimagetool.AppImage" | head -1)
ARCH=$(uname -m) "$appimagetool" --appimage-extract-and-run squashfs-root "$appimage"
rm -rf squashfs-root
# Ship the freshly-built validator so slice_check_linux (build_all.yml)
# can slice-sweep the shipped profiles with this PR's engine. Taken from
# the aarch64 leg so the sweep also exercises the arm build; x86_64 on
@@ -704,8 +869,8 @@ jobs:
path: './build/src/Release/OrcaSlicer_profile_validator'
# generate_system_cache is what scripts/build_preset_cache.sh bakes the
# <vendor>.opc caches with; it was already built by the "Build system
# preset cache (Linux)" step above. The .opc format is 64-bit
# <vendor>.opc caches with; build_linux.sh -P already built it to ship the
# caches in the package. The .opc format is 64-bit
# little-endian native, i.e. identical across every platform Orca ships,
# so only the Linux binary is published.
- name: Upload generate_system_cache Ubuntu
@@ -19,3 +19,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: echo "Joined concurrency group build-all-pull_request-${{ github.event.pull_request.number }}."
cancel_optional:
# The same for the builds of build_optional.yml, which keep a group each.
strategy:
matrix:
build:
- flatpak
- macos-x86_64
- windows-arm64
- windows-msvc
concurrency:
group: build-optional-${{ matrix.build }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- run: echo "Joined concurrency group build-optional-${{ matrix.build }}-${{ github.event.pull_request.number }}."
+23 -9
View File
@@ -23,22 +23,35 @@ jobs:
uses: actions/checkout@v7
- name: Run Claude Code slash command
uses: anthropics/claude-code-base-action@beta
uses: anthropics/claude-code-action@v1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLAUDE_CODE_SCRIPT_CAPS: '{"comment-on-duplicates.sh":1}'
# The action stops at Claude's first result, so a turn that ends while a background agent
# still works would drop the rest of the dedupe; keep agents in the foreground.
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS: "1"
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Issues are opened by users without write access; the job's permissions and the
# allowed-tools list in .claude/commands/dedupe.md keep what Claude can do narrow.
allowed_non_write_users: "*"
# The backfill workflow dispatches this one with GITHUB_TOKEN, so those runs come from github-actions[bot]
allowed_bots: "github-actions"
prompt: "/dedupe ${{ github.repository }}/issues/${{ github.event.issue.number || inputs.issue_number }}"
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
model: "claude-sonnet-4-5-20250929"
claude_env: |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The allowed-tools in .claude/commands/dedupe.md cover only the command's own turn, not the
# agents it starts, so the same two scripts are allowed for the whole session here.
claude_args: '--model claude-haiku-5-5 --allowedTools "Bash(./scripts/gh.sh:*),Bash(./scripts/comment-on-duplicates.sh:*)" --disallowedTools "WebFetch,WebSearch,Write,Edit,MultiEdit,NotebookEdit"'
- name: Log duplicate comment event to Statsig
if: always()
env:
STATSIG_API_KEY: ${{ secrets.STATSIG_API_KEY }}
ISSUE_NUMBER: ${{ github.event.issue.number || inputs.issue_number }}
REPO: ${{ github.repository }}
TRIGGERED_BY: ${{ github.event_name }}
WORKFLOW_RUN_ID: ${{ github.run_id }}
run: |
ISSUE_NUMBER=${{ github.event.issue.number || inputs.issue_number }}
REPO=${{ github.repository }}
if [ -z "$STATSIG_API_KEY" ]; then
echo "STATSIG_API_KEY not found, skipping Statsig logging"
exit 0
@@ -48,7 +61,8 @@ jobs:
EVENT_PAYLOAD=$(jq -n \
--arg issue_number "$ISSUE_NUMBER" \
--arg repo "$REPO" \
--arg triggered_by "${{ github.event_name }}" \
--arg triggered_by "$TRIGGERED_BY" \
--arg workflow_run_id "$WORKFLOW_RUN_ID" \
'{
events: [{
eventName: "github_duplicate_comment_added",
@@ -57,7 +71,7 @@ jobs:
repository: $repo,
issue_number: ($issue_number | tonumber),
triggered_by: $triggered_by,
workflow_run_id: "${{ github.run_id }}"
workflow_run_id: $workflow_run_id
},
time: (now | floor | tostring)
}]
+1 -1
View File
@@ -158,7 +158,7 @@ jobs:
sudo apt-get install -y --no-install-recommends \
libopengl0 libgl1 libegl1 libwebkit2gtk-4.1-0
- uses: actions/setup-python@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
+62 -2
View File
@@ -47,7 +47,13 @@ jobs:
'build',
'test',
'dependencies',
'documentation'
'documentation',
// optional builds (build_optional.yml)
'build-flatpak',
'build-macos-x86_64',
'build-windows-arm64',
'build-windows-msvc',
'build-all'
];
const pr = context.payload.pull_request;
// First-time contributors also get a link to the contributing guide
@@ -80,6 +86,8 @@ jobs:
body:
`${greeting} manage the labels for this PR by \`/bot add-label\` and \`/bot remove-label\`.\n\n` +
`Allowed labels are:\n${labelsList}\n\n` +
`The \`build-\` labels start the builds a PR does not get by default: the Flatpak, ` +
`the Intel Mac app, Windows arm64 and a Windows build with MSVC's compiler. A maintainer may first have to approve the run.\n\n` +
`Examples:\n${examplesText}`
});
} catch (error) {
@@ -192,10 +200,34 @@ jobs:
pull-requests: write
issues: write
runs-on: ubuntu-latest
# GitHub starts no workflow from an event the job's own token causes, so a
# build-* label added with it would not start the build it asks for. An
# installation token of a GitHub App does, and the run it starts still waits
# for a maintainer's approval when the pull request's runs need one. The app
# needs issues and pull requests write access to this repository. Without
# the secrets, labels are still applied and the build starts with the pull
# request's next push.
env:
LABEL_BOT_APP_ID: ${{ secrets.LABEL_BOT_APP_ID }}
steps:
- name: Mint a token that starts workflows
id: token
if: ${{ env.LABEL_BOT_APP_ID != '' }}
# An app that is not installed here, or a rotated key, costs the early
# start, not the labels.
continue-on-error: true
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.LABEL_BOT_APP_ID }}
private-key: ${{ secrets.LABEL_BOT_APP_PRIVATE_KEY }}
permission-issues: write
permission-pull-requests: write
- name: Apply label command from PR author
uses: actions/github-script@v9
env:
STARTS_WORKFLOWS: ${{ steps.token.outcome == 'success' }}
with:
github-token: ${{ steps.token.outputs.token || github.token }}
script: |
function isPermissionDenied(error) {
return error && error.status === 403 && /Resource not accessible by integration/i.test(error.message || '');
@@ -217,7 +249,13 @@ jobs:
'build',
'test',
'dependencies',
'documentation'
'documentation',
// optional builds (build_optional.yml)
'build-flatpak',
'build-macos-x86_64',
'build-windows-arm64',
'build-windows-msvc',
'build-all'
];
const issue = context.payload.issue;
@@ -314,6 +352,28 @@ jobs:
}
core.info(`Added labels: ${uniqueRequestedLabels.join(', ')}`);
const buildLabels = uniqueRequestedLabels.filter((label) => label.startsWith('build-'));
if (buildLabels.length) {
const buildText = buildLabels.map((label) => `\`${label}\``).join(', ');
const when = process.env.STARTS_WORKFLOWS === 'true'
? 'starts now under "Optional builds" in the Checks tab; a maintainer may first have to approve the workflow run'
: 'starts with the next push to this PR, under "Optional builds" in the Checks tab';
try {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: `@${commenter} the build for ${buildText} ${when}.`
});
} catch (error) {
if (isPermissionDenied(error)) {
core.warning('Cannot post the build label reply because token cannot write comments.');
} else {
throw error;
}
}
}
}
if (action === 'remove' && uniqueRequestedLabels.length) {
+10 -8
View File
@@ -6,9 +6,10 @@ name: Publish to draft release
# It also writes an ordered download table into the draft's release notes.
#
# Trigger: Actions tab -> "Publish to draft release" -> Run workflow.
# Locked to a single person: the first step aborts unless the actor matches the
# `RELEASE_PUBLISHER` repo variable (set to "SoftFever"). To allow someone else,
# change that variable: gh variable set RELEASE_PUBLISHER --body "<login>".
# Locked to named publishers: the first step aborts unless the actor is one of the
# logins in the `RELEASE_PUBLISHER` repo variable, a comma-separated list. To
# change who may publish, set that variable:
# gh variable set RELEASE_PUBLISHER --body "<login>,<login>"
on:
workflow_dispatch:
@@ -35,16 +36,17 @@ jobs:
RUN_ID: ${{ inputs.run_id }}
TAG: ${{ inputs.tag }}
steps:
- name: Restrict to the release publisher
- name: Restrict to the release publishers
env:
PUBLISHER: ${{ vars.RELEASE_PUBLISHER }}
PUBLISHERS: ${{ vars.RELEASE_PUBLISHER }}
run: |
if [ -z "$PUBLISHER" ]; then
if [ -z "$PUBLISHERS" ]; then
echo "::error::RELEASE_PUBLISHER repo variable is not set."
exit 1
fi
if [ "${{ github.actor }}" != "$PUBLISHER" ]; then
echo "::error::Only @$PUBLISHER may run this workflow (you are @${{ github.actor }})."
# Pad the space-separated list so only whole logins match.
if [[ " ${PUBLISHERS//,/ } " != *" ${{ github.actor }} "* ]]; then
echo "::error::Only $PUBLISHERS may run this workflow (you are @${{ github.actor }})."
exit 1
fi
echo "Authorized: @${{ github.actor }}"
+1 -1
View File
@@ -63,7 +63,7 @@ jobs:
timeout-minutes: 20
shell: bash
run: |
tar -xvf build_tests.tar
tar -xf build_tests.tar
# Every platform builds with a multi-config generator (build_linux.sh uses Ninja
# Multi-Config), so ctest needs the config: without it, plain add_test() tests
# lose their labels and report "Not Run".
@@ -0,0 +1,28 @@
name: Wait for response label
on:
schedule:
- cron: "7-57/10 * * * *"
workflow_dispatch:
permissions:
contents: read
pull-requests: write
checks: read # read when each commit was pushed
concurrency:
group: wait-for-response-label
jobs:
label:
if: github.repository == 'OrcaSlicer/OrcaSlicer'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: raistlin7447/waiting-on-author@3686b1acc23f3904ffbacef48bec68d48acfc5fb # v1.0.0
with:
provider: claude
claude-code-oauth-token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
label: wait for response
command-prefix: /bot
dry-run: false
+77 -34
View File
@@ -110,7 +110,8 @@ endif()
option(SLIC3R_STATIC "Compile OrcaSlicer with static libraries (Boost, TBB)" ${SLIC3R_STATIC_INITIAL})
option(SLIC3R_GUI "Compile OrcaSlicer with GUI components (OpenGL, wxWidgets)" 1)
option(SLIC3R_CAD "Compile OrcaSlicer with the parametric Design/CAD tab (needs OCCT ModelingAlgorithms)" 1)
option(SLIC3R_OPENVDB "Compile OrcaSlicer with OpenVDB (used only by SLA hollowing)" 0)
option(SLIC3R_CAD "Compile OrcaSlicer with the parametric Design/CAD tab (needs OCCT's TKFillet, TKOffset and TKBool)" 1)
option(SLIC3R_FHS "Assume OrcaSlicer is to be installed in a FHS directory structure" 0)
option(SLIC3R_PROFILE "Compile OrcaSlicer with an invasive Shiny profiler" 0)
option(SLIC3R_PCH "Use precompiled headers" 1)
@@ -120,6 +121,7 @@ option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
option(SLIC3R_RELATIVE_DEBUG_PATHS "Record a relative compilation directory in debug info (clang-cl)" 0)
option(SLIC3R_ASAN "Enable ASan on Clang and GCC" 0)
option(SLIC3R_GLIBCXX_ASSERTIONS "Enable libstdc++'s lightweight checks (_GLIBCXX_ASSERTIONS)" 0)
# Python stubgen module
option(ORCA_BUILD_PYTHON_STUBGEN_MODULE "Build importable Python module for pybind11-stubgen" ON)
@@ -132,13 +134,13 @@ set(ORCA_BUNDLED_UV_EXECUTABLE "" CACHE FILEPATH "Path to a uv executable to bun
# curl -sL https://github.com/astral-sh/uv/releases/download/<ver>/uv-<triple>.tar.gz.sha256
# The Flatpak copy in scripts/flatpak/com.orcaslicer.OrcaSlicer.yml pins the
# same version and hashes and must be bumped with them.
set(ORCA_UV_VERSION "0.11.21")
set(ORCA_UV_SHA256_aarch64-apple-darwin "1f921d491ba5ffeea774eb04d6681ecee379101341cbb1500394993b541bf3f4")
set(ORCA_UV_SHA256_x86_64-apple-darwin "f3c8e5708a84b920c18b691214d54d2b0da6b984789caae95d47c95120cb7765")
set(ORCA_UV_SHA256_aarch64-unknown-linux-gnu "88e800834007cc5efd4675f166eb2a51e7e3ad19876d85fa8805a6fb5c922397")
set(ORCA_UV_SHA256_x86_64-unknown-linux-gnu "8c88519b0ef0af9801fcdee419bbb12116bd9e6b18e162ae093c932d8b264050")
set(ORCA_UV_SHA256_aarch64-pc-windows-msvc "74e443f8004022dde57a1bd0d10c097830f9ea8feb4ec927db52cd5d805c2f48")
set(ORCA_UV_SHA256_x86_64-pc-windows-msvc "ace861f360c6de2babedc1607d0f454b6b09a820dbc8182dc15af927e4df9589")
set(ORCA_UV_VERSION "0.13.7")
set(ORCA_UV_SHA256_aarch64-apple-darwin "81b811b57e4624df7ed3aac148e0359100d9962f3d9dce00aec533dc2e086731")
set(ORCA_UV_SHA256_x86_64-apple-darwin "20c47e4c1f630b8abaff8c291fa9b9aa300fef92c4fbff95adf198b55287cda7")
set(ORCA_UV_SHA256_aarch64-unknown-linux-gnu "71279f8d3c67241e807b9d8db872d1bf541579fb9f08b7d1eb1682196d1e57dc")
set(ORCA_UV_SHA256_x86_64-unknown-linux-gnu "c5221ff41b7892bfc223543883600125f6a47fe845093e0f5bdff4f359196d83")
set(ORCA_UV_SHA256_aarch64-pc-windows-msvc "505d9e65e7692bac3ddf98c66754aa26c5050c409c184af30a881a0a72cc85e3")
set(ORCA_UV_SHA256_x86_64-pc-windows-msvc "0cdc5b38fe5a8168ed6a25814f5ba43c21d313dd3187314fccb37b7cec46e021")
# Version-scoped cache dir so a version bump invalidates the cached binary.
set(ORCA_UV_DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/.uv/${ORCA_UV_VERSION}")
@@ -371,6 +373,11 @@ if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
# clang-cl can interpret SYSTEM header paths if -imsvc is used
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-imsvc")
# Thin archives reference the objects instead of copying them; only lld-link reads them.
if (NOT CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_AR MATCHES "llvm-lib" AND CMAKE_LINKER MATCHES "lld-link")
string(APPEND CMAKE_STATIC_LINKER_FLAGS " /llvmlibthin")
endif ()
else ()
set(IS_CLANG_CL FALSE)
endif ()
@@ -660,6 +667,14 @@ if ((NOT MSVC OR IS_CLANG_CL) AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
endif()
if (SLIC3R_GLIBCXX_ASSERTIONS)
# libstdc++'s lightweight checks: operator[] past the end, front() or
# back() on an empty container and the like abort with a message instead
# of reading out of range. No class changes layout, so prebuilt deps link
# as they are. A no-op with libc++ and the MSVC STL.
add_compile_definitions(_GLIBCXX_ASSERTIONS)
endif ()
if (SLIC3R_ASAN)
# ASAN should be available on MSVC starting with Visual Studio 2019 16.9
# https://devblogs.microsoft.com/cppblog/address-sanitizer-for-msvc-now-generally-available/
@@ -876,6 +891,12 @@ if (NOT WIN32)
else()
target_link_libraries(libcurl INTERFACE crypt32)
endif()
if (APPLE)
# libcurl's macOS start-up calls SCDynamicStoreCopyProxies. curl's own
# CMake package links the framework, but our FindCURL module builds
# CURL::libcurl from the static archive alone.
target_link_libraries(libcurl INTERFACE "-framework SystemConfiguration")
endif()
if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL)
if (NOT APPLE)
@@ -896,21 +917,11 @@ endif()
## OPTIONAL packages
# Find expat or use bundled version
# Always use the system libexpat on Linux.
find_package(EXPAT)
if (NOT EXPAT_FOUND)
add_library(expat STATIC
${LIBDIR}/expat/xmlparse.c
${LIBDIR}/expat/xmlrole.c
${LIBDIR}/expat/xmltok.c
)
set(EXPAT_FOUND 1)
set(EXPAT_INCLUDE_DIRS ${LIBDIR}/expat/)
set(EXPAT_LIBRARIES expat)
endif ()
# Linux links the system libexpat when it is the pinned version; every other case
# builds that version in the deps project, so all platforms link the same parser.
# Requiring 2.10.0 rather than the 2.4.0 security floor keeps distro packages that
# are missing later fixes from slipping in.
find_package(EXPAT 2.10.0 REQUIRED)
find_package(PNG REQUIRED)
@@ -1055,19 +1066,24 @@ target_compile_definitions(pybind11_embed INTERFACE PYBIND11_SIMPLE_GIL_MANAGEME
add_library(pybind11::embed ALIAS pybind11_embed)
if(SLIC3R_STATIC)
set(OPENVDB_USE_STATIC_LIBS ON)
set(USE_BLOSC TRUE)
endif ()
if (SLIC3R_OPENVDB)
if(SLIC3R_STATIC)
set(OPENVDB_USE_STATIC_LIBS ON)
set(USE_BLOSC TRUE)
endif ()
find_package(OpenVDB 5.0 COMPONENTS openvdb)
if(OpenVDB_FOUND)
slic3r_remap_configs(IlmBase::Half RelWithDebInfo Release)
slic3r_remap_configs(Blosc::blosc RelWithDebInfo Release)
find_package(OpenVDB 5.0 COMPONENTS openvdb)
if(OpenVDB_FOUND)
slic3r_remap_configs(IlmBase::Half RelWithDebInfo Release)
slic3r_remap_configs(Blosc::blosc RelWithDebInfo Release)
else ()
message(FATAL_ERROR "OpenVDB could not be found with the bundled find module. "
"You can try to specify the find module location of your "
"OpenVDB installation with the OPENVDB_FIND_MODULE_PATH cache variable, "
"or configure with -DSLIC3R_OPENVDB=OFF to build without SLA hollowing.")
endif ()
else ()
message(FATAL_ERROR "OpenVDB could not be found with the bundled find module. "
"You can try to specify the find module location of your "
"OpenVDB installation with the OPENVDB_FIND_MODULE_PATH cache variable.")
message(STATUS "SLIC3R_OPENVDB is OFF: building without OpenVDB (SLA hollowing disabled).")
endif ()
find_path(SPNAV_INCLUDE_DIR spnav.h)
@@ -1389,6 +1405,33 @@ set(CPACK_PACKAGE_EXECUTABLES "orca-slicer;OrcaSlicer")
set(CPACK_CREATE_DESKTOP_LINKS "orca-slicer")
set (CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt) # must also include in install command
# CI release builds Authenticode-sign the installer as makensis builds it: the payload before it is
# compressed, the uninstaller the installer writes, and the installer itself. Only a configure run
# with ORCA_SIGN_KMS_KEY in its environment (build_orca.yml) wires this in; scripts/sign_windows.ps1
# lists what signing needs. The commands go into an included file because CPack writes
# CPACK_NSIS_* values into CPackConfig.cmake unescaped. !include needs a native path, with its
# backslashes doubled for CPackConfig.cmake. PowerShell 7 is preferred: Windows PowerShell started
# under a PowerShell 7 session (CI runs cpack from one) inherits its module path and cannot load
# Get-AuthenticodeSignature.
if (WIN32 AND DEFINED ENV{ORCA_SIGN_KMS_KEY})
find_program(ORCA_SIGN_PWSH pwsh)
if (ORCA_SIGN_PWSH)
set(_orca_sign_shell pwsh)
else ()
set(_orca_sign_shell powershell)
endif ()
set(ORCA_SIGN_COMMAND "${_orca_sign_shell} -NoProfile -ExecutionPolicy Bypass -File \"${CMAKE_SOURCE_DIR}/scripts/sign_windows.ps1\" -Path")
string(CONFIGURE [=[
!system '@ORCA_SIGN_COMMAND@ "${INST_DIR}"' = 0
!uninstfinalize '@ORCA_SIGN_COMMAND@ "%1"' = 0
!finalize '@ORCA_SIGN_COMMAND@ "%1"' = 0
]=] _orca_sign_nsh @ONLY)
file(WRITE "${CMAKE_BINARY_DIR}/sign_windows.nsh" "${_orca_sign_nsh}")
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/sign_windows.nsh" _orca_sign_nsh_path)
string(REPLACE "\\" "\\\\" _orca_sign_nsh_path "${_orca_sign_nsh_path}")
set(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS "!include \\\"${_orca_sign_nsh_path}\\\"")
endif ()
set(CPACK_WIX_UPGRADE_GUID "058245e8-20e0-4a95-9ab7-1acfe17ad511")
set(CPACK_GENERATOR NSIS)
include(CPack)
+1
View File
@@ -82,6 +82,7 @@ If you are an AI agent working for a contributor, please follow these steps:
## After you open the PR
- **Add labels.** A bot will comment with instructions. Reply with the labels from the table above, for example `/bot add-label bug-fix, UI/UX`.
- **Need a Flatpak, Intel Mac or Windows arm64 build to test?** PR builds leave those out. `/bot add-label build-flatpak`, `build-macos-x86_64` or `build-windows-arm64` asks for one; for a first PR a maintainer approves the run first. `build-windows-msvc` builds the PR with MSVC's own compiler (CI builds Windows with clang-cl), with its artifacts named `_x64_msvc`; add it when you change headers or templates. `build-all` asks for the first three. A PR that changes anything outside `src/`, `tests/`, `resources/`, `localization/` and `docs/` gets the Flatpak and Windows arm64 builds without a label. See [How to Download Pull Requests Artifacts](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts#builds-on-request).
- **Leave "Allow edits by maintainers" turned on**, so a reviewer can push small fixes directly.
- **Mark the PR ready for review when it's finished.** Draft PRs are not merged.
- **Push new commits to the same PR.** Please don't open a new PR for the same change.
+1 -11
View File
@@ -87,7 +87,7 @@ The [wiki](https://www.orcaslicer.com/wiki) aims to provide a detailed explanati
📥 **[Download the Latest Stable Release](https://github.com/OrcaSlicer/OrcaSlicer/releases/latest)**
Visit our GitHub Releases page for the latest stable version of OrcaSlicer, recommended for most users.
Windows release binaries are code signed; see our [Code signing policy](#code-signing-policy).
Windows and macOS release and nightly builds are code signed.
## Nightly Builds
@@ -245,16 +245,6 @@ OrcaSlicer began in that same spirit, drawing from BambuStudio, PrusaSlicer, and
The OrcaSlicer logo was designed by community member [Justin Levine](https://github.com/jal-co).
# Code Signing Policy
Free code signing provided by [SignPath.io](https://about.signpath.io), certificate by [SignPath Foundation](https://signpath.org).
Windows release binaries are built by GitHub Actions from this repository and signed through the SignPath Foundation program. Every signing request is manually approved.
**Team roles:** [SoftFever](https://github.com/SoftFever) is the committer, reviewer and approver for all signed releases.
**Privacy policy:** See the [OrcaSlicer privacy policy](https://www.orcaslicer.com/privacy-policy/).
# License
- **OrcaSlicer** is licensed under the GNU Affero General Public License, version 3.
+13 -5
View File
@@ -8,7 +8,7 @@ SCRIPT_PATH=$(dirname "$(readlink -f "${0}")")
pushd "${SCRIPT_PATH}" > /dev/null
function usage() {
echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-F][-g][-h][-i][-j N][-J N][-p][-r][-s][-t][-u][-l][-L] [-- CMAKE_ARGS...]"
echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-F][-g][-h][-i][-j N][-J N][-p][-P][-r][-s][-t][-u][-l][-L] [-- CMAKE_ARGS...]"
echo " -1: limit builds to one core (where possible)"
echo " -j N: limit builds to N cores (where possible)"
echo " -J N: build up to N dependencies at a time, each still using -j jobs (default: 1)"
@@ -23,6 +23,7 @@ function usage() {
echo " -h: prints this help text"
echo " -i: build the Orca Slicer AppImage (optional)"
echo " -p: disable precompiled headers (on by default): more ccache hits after header changes, slower misses"
echo " -P: ship the system preset caches in the package and AppImage, deleting the preset JSONs they replace (CI packaging)"
echo " -r: skip RAM and disk checks (low RAM compiling)"
echo " -s: build the Orca Slicer (optional)"
echo " -t: build tests (optional), requires -s flag"
@@ -47,7 +48,7 @@ unset name
BUILD_DIR=build
BUILD_CONFIG=Release
FORWARDED_ARGS=()
while getopts ":1j:J:bcCdDeFghiprstulL" opt ; do
while getopts ":1j:J:bcCdDeFghipPrstulL" opt ; do
case ${opt} in
1 )
export CMAKE_BUILD_PARALLEL_LEVEL=1
@@ -104,6 +105,10 @@ while getopts ":1j:J:bcCdDeFghiprstulL" opt ; do
SLIC3R_PRECOMPILED_HEADERS="OFF"
FORWARDED_ARGS+=("-p")
;;
P )
SHIP_PRESET_CACHES="1"
FORWARDED_ARGS+=("-P")
;;
r )
SKIP_RAM_CHECK="1"
FORWARDED_ARGS+=("-r")
@@ -648,11 +653,14 @@ if [[ -n "${BUILD_IMAGE}" || -n "${BUILD_ORCA}" ]] ; then
pushd $BUILD_DIR > /dev/null
build_linux_image="./src/build_linux_image.sh"
if [[ -e ${build_linux_image} ]] ; then
extra_script_args=""
extra_script_args=()
if [[ -n "${BUILD_IMAGE}" ]] ; then
extra_script_args="-i"
extra_script_args+=("-i")
fi
print_and_run ${build_linux_image} ${extra_script_args} -R "${BUILD_CONFIG}"
if [[ -n "${SHIP_PRESET_CACHES}" ]] ; then
extra_script_args+=("-c")
fi
print_and_run ${build_linux_image} "${extra_script_args[@]}" -R "${BUILD_CONFIG}"
echo "done"
fi
+32
View File
@@ -0,0 +1,32 @@
# cmake -DSOURCE=<dir> -DDESTINATION=<dir> -DSTAMP=<file> -P StagePythonRuntime.cmake
# Copies only when SOURCE's files or their times changed since the copy STAMP records.
foreach (_var SOURCE DESTINATION STAMP)
if (NOT DEFINED ${_var})
message(FATAL_ERROR "StagePythonRuntime.cmake: ${_var} is not set")
endif ()
endforeach ()
file(GLOB_RECURSE _files LIST_DIRECTORIES false RELATIVE "${SOURCE}" "${SOURCE}/*")
list(SORT _files)
set(_signature "${SOURCE}\n")
foreach (_file IN LISTS _files)
file(TIMESTAMP "${SOURCE}/${_file}" _time "%Y%m%d%H%M%S" UTC)
string(APPEND _signature "${_file} ${_time}\n")
endforeach ()
string(SHA256 _signature "${_signature}")
if (IS_DIRECTORY "${DESTINATION}" AND EXISTS "${STAMP}")
file(READ "${STAMP}" _copied)
if (_copied STREQUAL _signature)
return()
endif ()
endif ()
file(REMOVE "${STAMP}")
file(REMOVE_RECURSE "${DESTINATION}")
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${SOURCE}" "${DESTINATION}"
RESULT_VARIABLE _result)
if (NOT _result EQUAL 0)
message(FATAL_ERROR "Copying ${SOURCE} to ${DESTINATION} failed")
endif ()
file(WRITE "${STAMP}" "${_signature}")
+30 -15
View File
@@ -63,7 +63,8 @@ endif ()
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/DL_CACHE CACHE PATH "Path for downloaded source packages.")
set(FLATPAK FALSE CACHE BOOL "Toggles various build settings for flatpak, like /usr/local in DESTDIR or not building wxwidgets")
option(SLIC3R_CAD "Build the SolveSpace solver and OCCT ModelingAlgorithms module the parametric Design/CAD tab needs. Must match the main project's SLIC3R_CAD." ON)
option(SLIC3R_OPENVDB "Build OpenVDB with Blosc and OpenEXR; only SLA hollowing uses them. Must match the main project's SLIC3R_OPENVDB." OFF)
option(SLIC3R_CAD "Build the SolveSpace solver and the OCCT toolkits (TKFillet, TKOffset, TKBool) the parametric Design/CAD tab needs. Must match the main project's SLIC3R_CAD." ON)
if ("${DESTDIR}" STREQUAL "" OR "${DESTDIR}" STREQUAL "${AUTOGENERATED_DESTDIR}")
if (LINUX AND (NOT DEFINED USE_OLD_DESTDIR_PREV OR USE_OLD_DESTDIR_PREV) AND EXISTS "${CMAKE_BINARY_DIR}/destdir/usr/local" AND NOT EXISTS "${CMAKE_BINARY_DIR}/OrcaSlicer_dep/usr/local")
@@ -348,11 +349,13 @@ if(FLATPAK)
# also, yes, this reduces CI by not needing to vendor certain deps
find_package(ZLIB)
find_package(PNG)
find_package(EXPAT)
find_package(CURL)
find_package(JPEG)
find_package(OpenSSL 1.1...<3.2)
find_package(CURL)
# Not OpenSSL or CURL: the manifest stages the pinned tarballs, and the
# Flatpak must run the same OpenSSL build, with the same default security
# level, as the other platforms, with a curl linked against it. The GNOME
# SDK ships both, and its CURLConfig.cmake finds OpenSSL as a dependency
# (find_dependency leaves OPENSSL_FOUND set here), so probing either one
# skips dep_OpenSSL and dep_CURL and builds against the SDK's copies.
endif()
set(ZLIB_PKG "")
@@ -366,10 +369,19 @@ if (NOT PNG_FOUND)
set(PNG_PKG dep_PNG)
endif ()
set(EXPAT_PKG "")
find_package(EXPAT)
if (NOT EXPAT_FOUND)
if (WIN32 OR APPLE)
# A system lookup here can resolve an old SDK libexpat without the
# entity-amplification guard, so always build the pinned copy.
include(EXPAT/EXPAT.cmake)
set(EXPAT_PKG dep_EXPAT)
else ()
# Anything older than the pinned version is built by the EXPAT dep, so every
# platform links the same parser.
find_package(EXPAT 2.10.0)
if (NOT EXPAT_FOUND)
include(EXPAT/EXPAT.cmake)
set(EXPAT_PKG dep_EXPAT)
endif ()
endif ()
# The order of includes respects the dependencies between libraries
@@ -388,9 +400,14 @@ endif ()
include(TBB/TBB.cmake)
include(Blosc/Blosc.cmake)
include(OpenEXR/OpenEXR.cmake)
include(OpenVDB/OpenVDB.cmake)
# OpenVDB (and Blosc/OpenEXR, which only OpenVDB needs) is used solely by SLA hollowing.
set(OPENVDB_PKG "")
if (SLIC3R_OPENVDB)
include(Blosc/Blosc.cmake)
include(OpenEXR/OpenEXR.cmake)
include(OpenVDB/OpenVDB.cmake)
set(OPENVDB_PKG dep_OpenVDB)
endif ()
include(GMP/GMP.cmake)
include(MPFR/MPFR.cmake)
@@ -402,10 +419,8 @@ include(libnoise/libnoise.cmake)
include(Draco/Draco.cmake)
# I *think* 1.1 is used for *just* md5 hashing?
# 3.1 has everything in the right place, but the md5 funcs used are deprecated
# a grep across the repo shows it is used for other things
# TODO: update openssl and everything that uses <openssl/md5.h>
# TODO: utils.cpp, Format/bbs_3mf.cpp and GUI/Printer/PrinterFileSystem.cpp
# still use the MD5_* functions that 3.0 deprecated; port them to EVP.
set(OPENSSL_PKG "")
if(NOT OPENSSL_FOUND)
include(OpenSSL/OpenSSL.cmake)
@@ -468,7 +483,7 @@ set(_dep_list
dep_Cereal
dep_Draco
dep_NLopt
dep_OpenVDB
${OPENVDB_PKG}
${SLVS_PKG}
dep_OpenCV
dep_Eigen
+22 -34
View File
@@ -1,8 +1,7 @@
set(_curl_platform_flags
-DENABLE_IPV6:BOOL=ON
-DENABLE_VERSIONED_SYMBOLS:BOOL=ON
-DENABLE_THREADED_RESOLVER:BOOL=ON
-DENABLE_MANUAL:BOOL=OFF
-DENABLE_CURL_MANUAL:BOOL=OFF
-DCURL_DISABLE_LDAP:BOOL=ON
-DCURL_DISABLE_LDAPS:BOOL=ON
-DCURL_DISABLE_RTSP:BOOL=ON
@@ -10,30 +9,37 @@ set(_curl_platform_flags
-DCURL_DISABLE_TELNET:BOOL=ON
-DCURL_DISABLE_POP3:BOOL=ON
-DCURL_DISABLE_IMAP:BOOL=ON
-DCURL_DISABLE_SMB:BOOL=ON
-DCURL_DISABLE_SMTP:BOOL=ON
-DCURL_DISABLE_GOPHER:BOOL=ON
-DCURL_DISABLE_TFTP:BOOL=ON
-DCURL_DISABLE_MQTT:BOOL=ON
#-DHTTP_ONLY=ON
-DCURL_DISABLE_WEBSOCKETS:BOOL=ON
-DCMAKE_USE_GSSAPI:BOOL=OFF
-DCMAKE_USE_LIBSSH2:BOOL=OFF
-DUSE_RTMP:BOOL=OFF
# Optional libraries curl 8 enables or probes for by default. Keep the set
# of features the same as before: OpenSSL and zlib only, so no new shared
# library sneaks into the AppImage or the macOS bundle.
-DCURL_USE_GSSAPI:BOOL=OFF
-DCURL_USE_LIBSSH2:BOOL=OFF
-DCURL_USE_LIBSSH:BOOL=OFF
-DCURL_USE_LIBPSL:BOOL=OFF
-DUSE_LIBIDN2:BOOL=OFF
-DUSE_NGHTTP2:BOOL=OFF
-DUSE_MBEDTLS:BOOL=OFF
-DCURL_USE_MBEDTLS:BOOL=OFF
-DCURL_ZLIB:STRING=ON
-DCURL_BROTLI:STRING=OFF
-DCURL_ZSTD:STRING=OFF
)
if (WIN32)
#set(_curl_platform_flags ${_curl_platform_flags} -DCMAKE_USE_SCHANNEL=ON)
set(_curl_platform_flags ${_curl_platform_flags} -DCMAKE_USE_OPENSSL=ON -DCURL_CA_PATH:STRING=none)
#set(_curl_platform_flags ${_curl_platform_flags} -DCURL_USE_SCHANNEL=ON)
set(_curl_platform_flags ${_curl_platform_flags} -DCURL_USE_OPENSSL=ON -DCURL_CA_PATH:STRING=none)
elseif (APPLE)
set(_curl_platform_flags
${_curl_platform_flags}
#-DCMAKE_USE_SECTRANSP:BOOL=ON
-DCMAKE_USE_OPENSSL:BOOL=ON
#-DCURL_USE_SECTRANSP:BOOL=ON
-DCURL_USE_OPENSSL:BOOL=ON
-DCURL_CA_PATH:STRING=none
)
@@ -42,7 +48,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
${_curl_platform_flags}
-DCMAKE_USE_OPENSSL:BOOL=ON
-DCURL_USE_OPENSSL:BOOL=ON
-DCURL_CA_PATH:STRING=none
-DCURL_CA_BUNDLE:STRING=none
@@ -56,33 +62,15 @@ else()
set(_curl_static ON)
endif()
# curl 7.75's configure probes and code rely on C laxness cl allows but clang
# errors on (implicit function declarations, int* vs u_long* in ioctlsocket),
# which flips probe results and misconfigures nonblock.c into the AmigaOS
# IoctlSocket branch. Relax both diagnostics so the probes behave like cl, and
# pin the camel-case probes off since they only "pass" by implicit declaration.
set(_curl_c_flags_line "")
set(_curl_probe_overrides "")
if (MSVC AND CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(_curl_c_flags_line "-DCMAKE_C_FLAGS:STRING=-Wno-implicit-function-declaration -Wno-incompatible-pointer-types")
set(_curl_probe_overrides -DHAVE_IOCTLSOCKET_CAMEL=0 -DHAVE_IOCTLSOCKET_CAMEL_FIONBIO=0)
endif ()
orcaslicer_add_cmake_project(CURL
# GIT_REPOSITORY https://github.com/curl/curl.git
# GIT_TAG curl-7_75_0
URL https://github.com/curl/curl/archive/refs/tags/curl-7_75_0.zip
URL_HASH SHA256=a63ae025bb0a14f119e73250f2c923f4bf89aa93b8d4fafa4a9f5353a96a765a
URL https://github.com/curl/curl/archive/refs/tags/curl-8_23_0.zip
URL_HASH SHA256=4f443969ea4ea6ccb5ac984488683bb92384bc4df0affa3938ce77f20b30d853
DEPENDS ${ZLIB_PKG}
# PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
# ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/curl-mods.patch
CMAKE_ARGS
-DBUILD_TESTING:BOOL=OFF
-DBUILD_CURL_EXE:BOOL=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCURL_STATICLIB=${_curl_static}
"${_curl_c_flags_line}"
${_curl_probe_overrides}
-DBUILD_STATIC_LIBS:BOOL=${_curl_static}
${_curl_platform_flags}
)
+35 -1
View File
@@ -1,7 +1,41 @@
# Pinned release: expat's entity-amplification guard is a security boundary, so
# the parser must not come from a distro or SDK copy that may predate it.
# XML_DTD and XML_GE are passed explicitly: 2.4.0 gated the guard behind XML_DTD
# and 2.6.0 behind XML_GE, so neither may be left to the default.
orcaslicer_add_cmake_project(EXPAT
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/expat
URL https://github.com/libexpat/libexpat/releases/download/R_2_10_0/expat-2.10.0.tar.gz
URL_HASH SHA256=5466a341f9c692ef7a958a6881311be597f8e1ce345984cf78414f54793dea4c
CMAKE_ARGS
-DBUILD_SHARED_LIBS=OFF
-DEXPAT_SHARED_LIBS=OFF
-DEXPAT_DTD=ON
-DEXPAT_GE=ON
-DEXPAT_BUILD_TOOLS=OFF
-DEXPAT_BUILD_EXAMPLES=OFF
-DEXPAT_BUILD_TESTS=OFF
-DEXPAT_BUILD_DOCS=OFF
-DEXPAT_BUILD_FUZZERS=OFF
-DEXPAT_BUILD_PKGCONFIG=OFF
-DEXPAT_ENABLE_INSTALL=ON
)
if (MSVC)
add_debug_dep(dep_EXPAT)
# A deps prefix built before this pin still has lib/expat.lib from the
# bundled 2.5.0, and FindEXPAT matches that name before libexpatMD.lib, so
# overwrite it with the pinned build. This also covers a cached EXPAT_LIBRARY.
set(_expat_legacy_libs
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${DESTDIR}/lib/libexpatMD.lib ${DESTDIR}/lib/expat.lib
)
if (DEP_DEBUG)
list(APPEND _expat_legacy_libs
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${DESTDIR}/lib/libexpatdMD.lib ${DESTDIR}/lib/expatd.lib
)
endif ()
ExternalProject_Add_Step(dep_EXPAT copy_legacy_lib
DEPENDEES install
${_expat_legacy_libs}
)
endif ()
-130
View File
@@ -1,130 +0,0 @@
cmake_minimum_required(VERSION 3.0)
project(EXPAT)
include(${CMAKE_CURRENT_LIST_DIR}/ConfigureChecks.cmake)
macro(expat_shy_set var default cache type desc)
# Macro expat_shy_set came into life because:
# - Expat was previously using an inconsistent mix of CMake's native set()
# and option() to define public build time options.
# - option() is more friendly than set() with regard to configuring an
# external project that is pulled in by means of add_subdirectory() --
# see comments in issue #597 -- so we wanted to get away from set().
# - option() auto-converts non-bool values to bool when writing to the CMake
# cache, so we needed something that supports non-bool better and hence
# wanted to get away from plain option(), too.
#
# As a result, this function serves as a hybrid between CMake's regular set()
# and option(): from set() it takes support for non-bool types and the function
# name and signature whereas from option() (with policy CMP0077 mode NEW) it
# takes being shy when a value has previously been defined for that variable.
#
# So that resolves all need for set(.. FORCE) when pulling in Expat by means of
# add_subdirectory().
#
if(NOT ${cache} STREQUAL "CACHE")
message(SEND_ERROR "Macro usage is: expat_shy_set(var default CACHE type desc)")
endif()
if(DEFINED ${var})
# NOTE: The idea is to (ideally) only add to the cache if
# there is no cache entry, yet. "if(DEFINED CACHE{var})"
# requires CMake >=3.14.
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.14" AND NOT DEFINED "CACHE{${var}}")
set("${var}" "${${var}}" CACHE "${type}" "${desc}")
endif()
else()
set("${var}" "${default}" CACHE "${type}" "${desc}")
endif()
endmacro()
if(NOT WIN32)
expat_shy_set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]")
expat_shy_set(EXPAT_WITH_SYS_GETRANDOM "AUTO" CACHE STRING "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]")
endif()
macro(evaluate_detection_results use_ref have_ref thing_lower thing_title)
if(${use_ref} AND NOT (${use_ref} STREQUAL "AUTO") AND NOT ${have_ref})
message(SEND_ERROR
"Use of ${thing_lower} was enforced by ${use_ref}=ON but it could not be found.")
elseif(NOT ${use_ref} AND ${have_ref})
message("${thing_title} was found but it will not be used due to ${use_ref}=OFF.")
set(${have_ref} 0)
endif()
endmacro()
if(NOT WIN32)
evaluate_detection_results(EXPAT_WITH_GETRANDOM HAVE_GETRANDOM "function getrandom" "Function getrandom")
evaluate_detection_results(EXPAT_WITH_SYS_GETRANDOM HAVE_SYSCALL_GETRANDOM "syscall SYS_getrandom" "Syscall SYS_getrandom")
endif()
configure_file(expat_configure.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_configure.h")
if (BUILD_SHARED_LIBS AND MSVC)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
add_library(expat
xmlparse.c
xmlrole.c
xmltok.c
)
target_include_directories(expat PRIVATE ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
include(GNUInstallDirs)
install(
FILES
${PROJECT_SOURCE_DIR}/expat.h
${PROJECT_SOURCE_DIR}/expat_config.h
${PROJECT_SOURCE_DIR}/expat_external.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}
)
add_library(EXPAT INTERFACE)
target_link_libraries(EXPAT INTERFACE expat)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
VERSION 1.95
COMPATIBILITY AnyNewerVersion
)
install(TARGETS expat EXPAT
EXPORT ${PROJECT_NAME}Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
export(EXPORT ${PROJECT_NAME}Targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake"
NAMESPACE ${PROJECT_NAME}:: )
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
install(EXPORT ${PROJECT_NAME}Targets
FILE
"${PROJECT_NAME}Targets.cmake"
NAMESPACE
${PROJECT_NAME}::
DESTINATION
${ConfigPackageLocation}
)
configure_file(config.cmake.in ${PROJECT_NAME}Config.cmake @ONLY)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION
${ConfigPackageLocation}
)
-21
View File
@@ -1,21 +0,0 @@
Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
Copyright (c) 2001-2022 Expat maintainers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-69
View File
@@ -1,69 +0,0 @@
include(CheckCCompilerFlag)
include(CheckCSourceCompiles)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CheckSymbolExists)
include(TestBigEndian)
check_include_file("dlfcn.h" HAVE_DLFCN_H)
check_include_file("fcntl.h" HAVE_FCNTL_H)
check_include_file("inttypes.h" HAVE_INTTYPES_H)
check_include_file("memory.h" HAVE_MEMORY_H)
check_include_file("stdint.h" HAVE_STDINT_H)
check_include_file("stdlib.h" HAVE_STDLIB_H)
check_include_file("strings.h" HAVE_STRINGS_H)
check_include_file("string.h" HAVE_STRING_H)
check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
check_include_file("unistd.h" HAVE_UNISTD_H)
check_symbol_exists("getpagesize" "unistd.h" HAVE_GETPAGESIZE)
check_symbol_exists("mmap" "sys/mman.h" HAVE_MMAP)
check_symbol_exists("getrandom" "sys/random.h" HAVE_GETRANDOM)
if(EXPAT_WITH_LIBBSD)
set(CMAKE_REQUIRED_LIBRARIES "${LIB_BSD}")
set(_bsd "bsd/")
else()
set(_bsd "")
endif()
check_symbol_exists("arc4random_buf" "${_bsd}stdlib.h" HAVE_ARC4RANDOM_BUF)
if(NOT HAVE_ARC4RANDOM_BUF)
check_symbol_exists("arc4random" "${_bsd}stdlib.h" HAVE_ARC4RANDOM)
endif()
set(CMAKE_REQUIRED_LIBRARIES)
#/* Define to 1 if you have the ANSI C header files. */
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
test_big_endian(WORDS_BIGENDIAN)
#/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
if(WORDS_BIGENDIAN)
set(BYTEORDER 4321)
else(WORDS_BIGENDIAN)
set(BYTEORDER 1234)
endif(WORDS_BIGENDIAN)
if(HAVE_SYS_TYPES_H)
check_symbol_exists("off_t" "sys/types.h" OFF_T)
check_symbol_exists("size_t" "sys/types.h" SIZE_T)
else(HAVE_SYS_TYPES_H)
set(OFF_T "long")
set(SIZE_T "unsigned")
endif(HAVE_SYS_TYPES_H)
check_c_source_compiles("
#include <stdlib.h> /* for NULL */
#include <unistd.h> /* for syscall */
#include <sys/syscall.h> /* for SYS_getrandom */
int main() {
syscall(SYS_getrandom, NULL, 0, 0);
return 0;
}"
HAVE_SYSCALL_GETRANDOM)
check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING)
check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY)
check_library_exists(m cos "" _EXPAT_LIBM_FOUND)
-274
View File
@@ -1,274 +0,0 @@
Expat, Release 2.5.0, only picked the lib related files into Bambu Studio, built as static library
The original README:
---------------------------------------------------------------------
[![Run Linux Travis CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat)
[![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions)
[![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/)
[![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases)
# Expat, Release 2.5.0
This is Expat, a C library for parsing XML, started by
[James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997.
Expat is a stream-oriented XML parser. This means that you register
handlers with the parser before starting the parse. These handlers
are called when the parser discovers the associated structures in the
document being parsed. A start tag is an example of the kind of
structures for which you may register handlers.
Expat supports the following compilers:
- GNU GCC >=4.5
- LLVM Clang >=3.5
- Microsoft Visual Studio >=15.0/2017 (rolling `${today} minus 5 years`)
Windows users can use the
[`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases),
which includes both pre-compiled libraries and executables, and source code for
developers.
Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html).
You may copy, distribute, and modify it under the terms of the License
contained in the file
[`COPYING`](https://github.com/libexpat/libexpat/blob/master/expat/COPYING)
distributed with this package.
This license is the same as the MIT/X Consortium license.
## Using libexpat in your CMake-Based Project
There are two ways of using libexpat with CMake:
### a) Module Mode
This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html).
Notice the *uppercase* `EXPAT` in the following example:
```cmake
cmake_minimum_required(VERSION 3.0) # or 3.10, see below
project(hello VERSION 1.0.0)
find_package(EXPAT 2.2.8 MODULE REQUIRED)
add_executable(hello
hello.c
)
# a) for CMake >=3.10 (see CMake's FindEXPAT docs)
target_link_libraries(hello PUBLIC EXPAT::EXPAT)
# b) for CMake >=3.0
target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS})
target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES})
```
### b) Config Mode
This approach requires files from…
- libexpat >=2.2.8 where packaging uses the CMake build system
or
- libexpat >=2.3.0 where packaging uses the GNU Autotools build system
on Linux
or
- libexpat >=2.4.0 where packaging uses the GNU Autotools build system
on macOS or MinGW.
Notice the *lowercase* `expat` in the following example:
```cmake
cmake_minimum_required(VERSION 3.0)
project(hello VERSION 1.0.0)
find_package(expat 2.2.8 CONFIG REQUIRED char dtd ns)
add_executable(hello
hello.c
)
target_link_libraries(hello PUBLIC expat::expat)
```
## Building from a Git Clone
If you are building Expat from a check-out from the
[Git repository](https://github.com/libexpat/libexpat/),
you need to run a script that generates the configure script using the
GNU autoconf and libtool tools. To do this, you need to have
autoconf 2.58 or newer. Run the script like this:
```console
./buildconf.sh
```
Once this has been done, follow the same instructions as for building
from a source distribution.
## Building from a Source Distribution
### a) Building with the configure script (i.e. GNU Autotools)
To build Expat from a source distribution, you first run the
configuration shell script in the top level distribution directory:
```console
./configure
```
There are many options which you may provide to configure (which you
can discover by running configure with the `--help` option). But the
one of most interest is the one that sets the installation directory.
By default, the configure script will set things up to install
libexpat into `/usr/local/lib`, `expat.h` into `/usr/local/include`, and
`xmlwf` into `/usr/local/bin`. If, for example, you'd prefer to install
into `/home/me/mystuff/lib`, `/home/me/mystuff/include`, and
`/home/me/mystuff/bin`, you can tell `configure` about that with:
```console
./configure --prefix=/home/me/mystuff
```
Another interesting option is to enable 64-bit integer support for
line and column numbers and the over-all byte index:
```console
./configure CPPFLAGS=-DXML_LARGE_SIZE
```
However, such a modification would be a breaking change to the ABI
and is therefore not recommended for general use &mdash; e.g. as part of
a Linux distribution &mdash; but rather for builds with special requirements.
After running the configure script, the `make` command will build
things and `make install` will install things into their proper
location. Have a look at the `Makefile` to learn about additional
`make` options. Note that you need to have write permission into
the directories into which things will be installed.
If you are interested in building Expat to provide document
information in UTF-16 encoding rather than the default UTF-8, follow
these instructions (after having run `make distclean`).
Please note that we configure with `--without-xmlwf` as xmlwf does not
support this mode of compilation (yet):
1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
<br/>
`find -name Makefile.am -exec sed
-e 's,libexpat\.la,libexpatw.la,'
-e 's,libexpat_la,libexpatw_la,'
-i {} +`
1. Run `automake` to re-write `Makefile.in` files:<br/>
`automake`
1. For UTF-16 output as unsigned short (and version/error strings as char),
run:<br/>
`./configure CPPFLAGS=-DXML_UNICODE --without-xmlwf`<br/>
For UTF-16 output as `wchar_t` (incl. version/error strings), run:<br/>
`./configure CFLAGS="-g -O2 -fshort-wchar" CPPFLAGS=-DXML_UNICODE_WCHAR_T
--without-xmlwf`
<br/>Note: The latter requires libc compiled with `-fshort-wchar`, as well.
1. Run `make` (which excludes xmlwf).
1. Run `make install` (again, excludes xmlwf).
Using `DESTDIR` is supported. It works as follows:
```console
make install DESTDIR=/path/to/image
```
overrides the in-makefile set `DESTDIR`, because variable-setting priority is
1. commandline
1. in-makefile
1. environment
Note: This only applies to the Expat library itself, building UTF-16 versions
of xmlwf and the tests is currently not supported.
When using Expat with a project using autoconf for configuration, you
can use the probing macro in `conftools/expat.m4` to determine how to
include Expat. See the comments at the top of that file for more
information.
A reference manual is available in the file `doc/reference.html` in this
distribution.
### b) Building with CMake
The CMake build system is still *experimental* and may replace the primary
build system based on GNU Autotools at some point when it is ready.
#### Available Options
For an idea of the available (non-advanced) options for building with CMake:
```console
# rm -f CMakeCache.txt ; cmake -D_EXPAT_HELP=ON -LH . | grep -B1 ':.*=' | sed 's,^--$,,'
// Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...
CMAKE_BUILD_TYPE:STRING=
// Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
// Path to a program.
DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man
// Build man page for xmlwf
EXPAT_BUILD_DOCS:BOOL=ON
// Build the examples for expat library
EXPAT_BUILD_EXAMPLES:BOOL=ON
// Build fuzzers for the expat library
EXPAT_BUILD_FUZZERS:BOOL=OFF
// Build pkg-config file
EXPAT_BUILD_PKGCONFIG:BOOL=ON
// Build the tests for expat library
EXPAT_BUILD_TESTS:BOOL=ON
// Build the xmlwf tool for expat library
EXPAT_BUILD_TOOLS:BOOL=ON
// Character type to use (char|ushort|wchar_t) [default=char]
EXPAT_CHAR_TYPE:STRING=char
// Install expat files in cmake install target
EXPAT_ENABLE_INSTALL:BOOL=ON
// Use /MT flag (static CRT) when compiling in MSVC
EXPAT_MSVC_STATIC_CRT:BOOL=OFF
// Build fuzzers via ossfuzz for the expat library
EXPAT_OSSFUZZ_BUILD:BOOL=OFF
// Build a shared expat library
EXPAT_SHARED_LIBS:BOOL=ON
// Treat all compiler warnings as errors
EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF
// Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]
EXPAT_WITH_GETRANDOM:STRING=AUTO
// Utilize libbsd (for arc4random_buf)
EXPAT_WITH_LIBBSD:BOOL=OFF
// Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]
EXPAT_WITH_SYS_GETRANDOM:STRING=AUTO
```
-123
View File
@@ -1,123 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1999-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2007 Karl Waclawek <karl@waclawek.net>
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define ASCII_A 0x41
#define ASCII_B 0x42
#define ASCII_C 0x43
#define ASCII_D 0x44
#define ASCII_E 0x45
#define ASCII_F 0x46
#define ASCII_G 0x47
#define ASCII_H 0x48
#define ASCII_I 0x49
#define ASCII_J 0x4A
#define ASCII_K 0x4B
#define ASCII_L 0x4C
#define ASCII_M 0x4D
#define ASCII_N 0x4E
#define ASCII_O 0x4F
#define ASCII_P 0x50
#define ASCII_Q 0x51
#define ASCII_R 0x52
#define ASCII_S 0x53
#define ASCII_T 0x54
#define ASCII_U 0x55
#define ASCII_V 0x56
#define ASCII_W 0x57
#define ASCII_X 0x58
#define ASCII_Y 0x59
#define ASCII_Z 0x5A
#define ASCII_a 0x61
#define ASCII_b 0x62
#define ASCII_c 0x63
#define ASCII_d 0x64
#define ASCII_e 0x65
#define ASCII_f 0x66
#define ASCII_g 0x67
#define ASCII_h 0x68
#define ASCII_i 0x69
#define ASCII_j 0x6A
#define ASCII_k 0x6B
#define ASCII_l 0x6C
#define ASCII_m 0x6D
#define ASCII_n 0x6E
#define ASCII_o 0x6F
#define ASCII_p 0x70
#define ASCII_q 0x71
#define ASCII_r 0x72
#define ASCII_s 0x73
#define ASCII_t 0x74
#define ASCII_u 0x75
#define ASCII_v 0x76
#define ASCII_w 0x77
#define ASCII_x 0x78
#define ASCII_y 0x79
#define ASCII_z 0x7A
#define ASCII_0 0x30
#define ASCII_1 0x31
#define ASCII_2 0x32
#define ASCII_3 0x33
#define ASCII_4 0x34
#define ASCII_5 0x35
#define ASCII_6 0x36
#define ASCII_7 0x37
#define ASCII_8 0x38
#define ASCII_9 0x39
#define ASCII_TAB 0x09
#define ASCII_SPACE 0x20
#define ASCII_EXCL 0x21
#define ASCII_QUOT 0x22
#define ASCII_AMP 0x26
#define ASCII_APOS 0x27
#define ASCII_MINUS 0x2D
#define ASCII_PERIOD 0x2E
#define ASCII_COLON 0x3A
#define ASCII_SEMI 0x3B
#define ASCII_LT 0x3C
#define ASCII_EQUALS 0x3D
#define ASCII_GT 0x3E
#define ASCII_LSQB 0x5B
#define ASCII_RSQB 0x5D
#define ASCII_UNDERSCORE 0x5F
#define ASCII_LPAREN 0x28
#define ASCII_RPAREN 0x29
#define ASCII_FF 0x0C
#define ASCII_SLASH 0x2F
#define ASCII_HASH 0x23
#define ASCII_PIPE 0x7C
#define ASCII_COMMA 0x2C
-66
View File
@@ -1,66 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
-4
View File
@@ -1,4 +0,0 @@
include(${CMAKE_CURRENT_LIST_DIR}/EXPATTargets.cmake)
set(EXPAT_LIBRARIES EXPAT::expat)
set(EXPAT_INCLUDE_DIRS ${_IMPORT_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
-1064
View File
File diff suppressed because it is too large Load Diff
-49
View File
@@ -1,49 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
Copyright (c) 2005 Karl Waclawek <karl@waclawek.net>
Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef EXPATCONFIG_H
#define EXPATCONFIG_H
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#else
#endif
#include "expat_configure.h"
#include <memory.h>
#include <string.h>
#endif /* ndef EXPATCONFIG_H */
-120
View File
@@ -1,120 +0,0 @@
/* expat_config.h.cmake. Based upon generated expat_config.h.in. */
#ifndef EXPAT_CONFIG_H
#define EXPAT_CONFIG_H 1
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
#cmakedefine BYTEORDER @BYTEORDER@
/* Define to 1 if you have the `arc4random' function. */
#cmakedefine HAVE_ARC4RANDOM
/* Define to 1 if you have the `arc4random_buf' function. */
#cmakedefine HAVE_ARC4RANDOM_BUF
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H
/* Define to 1 if you have the `getpagesize' function. */
#cmakedefine HAVE_GETPAGESIZE
/* Define to 1 if you have the `getrandom' function. */
#cmakedefine HAVE_GETRANDOM
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H
/* Define to 1 if you have the `bsd' library (-lbsd). */
#cmakedefine HAVE_LIBBSD
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H
/* Define to 1 if you have a working `mmap' system call. */
#cmakedefine HAVE_MMAP
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H
/* Define to 1 if you have `syscall' and `SYS_getrandom'. */
#cmakedefine HAVE_SYSCALL_GETRANDOM
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H
/* Name of package */
#define PACKAGE "@PACKAGE_NAME@"
/* Define to the address where bug reports for this package should be sent. */
#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
/* Define to the full name of this package. */
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
/* Define to the full name and version of this package. */
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
/* Define to the one symbol short name of this package. */
#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine STDC_HEADERS
/* whether byteorder is bigendian */
#cmakedefine WORDS_BIGENDIAN
/* Define to allow retrieving the byte offsets for attribute names and values.
*/
#cmakedefine XML_ATTR_INFO
/* Define to specify how much context to retain around the current parse
point. */
#cmakedefine XML_CONTEXT_BYTES @XML_CONTEXT_BYTES@
#if ! defined(_WIN32)
/* Define to include code reading entropy from `/dev/urandom'. */
#cmakedefine XML_DEV_URANDOM
#endif
/* Define to make parameter entity parsing functionality available. */
#cmakedefine XML_DTD
/* Define to make XML Namespaces functionality available. */
#cmakedefine XML_NS
/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */
#ifdef _MSC_VER
# define __func__ __FUNCTION__
#endif
/* Define to `long' if <sys/types.h> does not define. */
#cmakedefine off_t @OFF_T@
/* Define to `unsigned' if <sys/types.h> does not define. */
#cmakedefine size_t @SIZE_T@
#endif // ndef EXPAT_CONFIG_H
-165
View File
@@ -1,165 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
Copyright (c) 2016-2019 Sebastian Pipping <sebastian@pipping.org>
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef Expat_External_INCLUDED
#define Expat_External_INCLUDED 1
/* External API definitions */
/* Expat tries very hard to make the API boundary very specifically
defined. There are two macros defined to control this boundary;
each of these can be defined before including this header to
achieve some different behavior, but doing so it not recommended or
tested frequently.
XMLCALL - The calling convention to use for all calls across the
"library boundary." This will default to cdecl, and
try really hard to tell the compiler that's what we
want.
XMLIMPORT - Whatever magic is needed to note that a function is
to be imported from a dynamically loaded library
(.dll, .so, or .sl, depending on your platform).
The XMLCALL macro was added in Expat 1.95.7. The only one which is
expected to be directly useful in client code is XMLCALL.
Note that on at least some Unix versions, the Expat library must be
compiled with the cdecl calling convention as the default since
system headers may assume the cdecl convention.
*/
#ifndef XMLCALL
# if defined(_MSC_VER)
# define XMLCALL __cdecl
# elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)
# define XMLCALL __attribute__((cdecl))
# else
/* For any platform which uses this definition and supports more than
one calling convention, we need to extend this definition to
declare the convention used on that platform, if it's possible to
do so.
If this is the case for your platform, please file a bug report
with information on how to identify your platform via the C
pre-processor and how to specify the same calling convention as the
platform's malloc() implementation.
*/
# define XMLCALL
# endif
#endif /* not defined XMLCALL */
#if ! defined(XML_STATIC) && ! defined(XMLIMPORT)
# ifndef XML_BUILDING_EXPAT
/* using Expat from an application */
# if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__)
//# define XMLIMPORT __declspec(dllimport)
# endif
# endif
#endif /* not defined XML_STATIC */
#ifndef XML_ENABLE_VISIBILITY
# define XML_ENABLE_VISIBILITY 0
#endif
#if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
# define XMLIMPORT __attribute__((visibility("default")))
#endif
/* If we didn't define it above, define it away: */
#ifndef XMLIMPORT
# define XMLIMPORT
#endif
#if defined(__GNUC__) \
&& (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
# define XML_ATTR_MALLOC __attribute__((__malloc__))
#else
# define XML_ATTR_MALLOC
#endif
#if defined(__GNUC__) \
&& ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
#else
# define XML_ATTR_ALLOC_SIZE(x)
#endif
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
#ifdef __cplusplus
extern "C" {
#endif
#ifdef XML_UNICODE_WCHAR_T
# ifndef XML_UNICODE
# define XML_UNICODE
# endif
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
# endif
#endif
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
# ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
# else
typedef unsigned short XML_Char;
typedef char XML_LChar;
# endif /* XML_UNICODE_WCHAR_T */
#else /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE */
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
typedef long long XML_Index;
typedef unsigned long long XML_Size;
#else
typedef long XML_Index;
typedef unsigned long XML_Size;
#endif /* XML_LARGE_SIZE */
#ifdef __cplusplus
}
#endif
#endif /* not Expat_External_INCLUDED */
-67
View File
@@ -1,67 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
-165
View File
@@ -1,165 +0,0 @@
/* internal.h
Internal definitions used by Expat. This is not needed to compile
client code.
The following calling convention macros are defined for frequently
called functions:
FASTCALL - Used for those internal functions that have a simple
body and a low number of arguments and local variables.
PTRCALL - Used for functions called though function pointers.
PTRFASTCALL - Like PTRCALL, but for low number of arguments.
inline - Used for selected internal functions for which inlining
may improve performance on some platforms.
Note: Use of these macros is based on judgement, not hard rules,
and therefore subject to change.
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if defined(__GNUC__) && defined(__i386__) && ! defined(__MINGW32__)
/* We'll use this version by default only where we know it helps.
regparm() generates warnings on Solaris boxes. See SF bug #692878.
Instability reported with egcs on a RedHat Linux 7.3.
Let's comment out:
#define FASTCALL __attribute__((stdcall, regparm(3)))
and let's try this:
*/
# define FASTCALL __attribute__((regparm(3)))
# define PTRFASTCALL __attribute__((regparm(3)))
#endif
/* Using __fastcall seems to have an unexpected negative effect under
MS VC++, especially for function pointers, so we won't use it for
now on that platform. It may be reconsidered for a future release
if it can be made more effective.
Likely reason: __fastcall on Windows is like stdcall, therefore
the compiler cannot perform stack optimizations for call clusters.
*/
/* Make sure all of these are defined if they aren't already. */
#ifndef FASTCALL
# define FASTCALL
#endif
#ifndef PTRCALL
# define PTRCALL
#endif
#ifndef PTRFASTCALL
# define PTRFASTCALL
#endif
#ifndef XML_MIN_SIZE
# if ! defined(__cplusplus) && ! defined(inline)
# ifdef __GNUC__
# define inline __inline
# endif /* __GNUC__ */
# endif
#endif /* XML_MIN_SIZE */
#ifdef __cplusplus
# define inline inline
#else
# ifndef inline
# define inline
# endif
#endif
#include <limits.h> // ULONG_MAX
#if defined(_WIN32) \
&& (! defined(__USE_MINGW_ANSI_STDIO) \
|| (1 - __USE_MINGW_ANSI_STDIO - 1 == 0))
# define EXPAT_FMT_ULL(midpart) "%" midpart "I64u"
# if defined(_WIN64) // Note: modifiers "td" and "zu" do not work for MinGW
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "I64d"
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "I64u"
# else
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d"
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
# endif
#else
# define EXPAT_FMT_ULL(midpart) "%" midpart "llu"
# if ! defined(ULONG_MAX)
# error Compiler did not define ULONG_MAX for us
# elif ULONG_MAX == 18446744073709551615u // 2^64-1
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "ld"
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "lu"
# else
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d"
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
# endif
#endif
#ifndef UNUSED_P
# define UNUSED_P(p) (void)p
#endif
/* NOTE BEGIN If you ever patch these defaults to greater values
for non-attack XML payload in your environment,
please file a bug report with libexpat. Thank you!
*/
#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT \
100.0f
#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT \
8388608 // 8 MiB, 2^23
/* NOTE END */
#include "expat.h" // so we can use type XML_Parser below
#ifdef __cplusplus
extern "C" {
#endif
void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
const char **fromLimRef);
#if defined(XML_DTD)
unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
const char *unsignedCharToPrintable(unsigned char c);
#endif
#ifdef __cplusplus
}
#endif
-66
View File
@@ -1,66 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-136
View File
@@ -1,136 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
static const unsigned namingBitmap[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x04000000,
0x87FFFFFE, 0x07FFFFFE, 0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFE00F, 0xFC31FFFF, 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, 0xFFFF0003, 0xFFFFFFFF,
0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, 0x00000000, 0x07FFFFFE,
0x000007FE, 0xFFFE0000, 0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, 0xFFF99FE0, 0x03C5FDFF,
0xB0000000, 0x00030003, 0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, 0xFFF99FE0, 0x23CDFDFF,
0xB0000000, 0x00000003, 0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, 0xFFFDDFE0, 0x03EFFDFF,
0x40000000, 0x00000003, 0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFE, 0x000D7FFF,
0x0000003F, 0x00000000, 0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, 0x0007DAED, 0x50000000,
0x82315001, 0x002C62AB, 0x40000000, 0xF580C900, 0x00000007, 0x02010800,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0x03FFFFFF, 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, 0x00000000, 0x00004C40,
0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000000,
0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, 0x001FFFFF, 0xFFFFFFFE,
0xFFFFFFFF, 0x07FFFFFF, 0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000000F,
0x00000000, 0x00000000, 0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, 0x00FFFFFF, 0x00000000,
0xFFFF0000, 0xFFFFFFFF, 0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, 0xFFFFD7C0, 0xFFFFFFFB,
0x547F7FFF, 0x000FFFFD, 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, 0x00000000, 0xFFFE0000,
0x027FFFFF, 0xFFFFFFFE, 0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, 0xFFFFFFFF, 0x7CFFFFFF,
0xFFEF7FFF, 0x03FF3DFF, 0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, 0xFFF987E4, 0xD36DFDFF,
0x5E003987, 0x001FFFC0, 0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, 0xD63DC7EC, 0xC3BFC718,
0x00803DC7, 0x0000FF80, 0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, 0xFFFDDFEC, 0xC3FFFDFF,
0x00803DCF, 0x0000FFC3, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, 0xFEF02596, 0x3BFF6CAE,
0x03FF3F5F, 0x00000000, 0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, 0x661FFFFF, 0xFFFFFFFE,
0xFFFFFFFF, 0x77FFFFFF,
};
static const unsigned char nmstrtPages[] = {
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x09, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x00, 0x14, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
static const unsigned char namePages[] = {
0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, 0x00, 0x1F, 0x20, 0x21,
0x22, 0x23, 0x24, 0x25, 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x26, 0x14, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
-393
View File
@@ -1,393 +0,0 @@
/* ==========================================================================
* siphash.h - SipHash-2-4 in a single header file
* --------------------------------------------------------------------------
* Derived by William Ahern from the reference implementation[1] published[2]
* by Jean-Philippe Aumasson and Daniel J. Berstein.
* Minimal changes by Sebastian Pipping and Victor Stinner on top, see below.
* Licensed under the CC0 Public Domain Dedication license.
*
* 1. https://www.131002.net/siphash/siphash24.c
* 2. https://www.131002.net/siphash/
* --------------------------------------------------------------------------
* HISTORY:
*
* 2020-10-03 (Sebastian Pipping)
* - Drop support for Visual Studio 9.0/2008 and earlier
*
* 2019-08-03 (Sebastian Pipping)
* - Mark part of sip24_valid as to be excluded from clang-format
* - Re-format code using clang-format 9
*
* 2018-07-08 (Anton Maklakov)
* - Add "fall through" markers for GCC's -Wimplicit-fallthrough
*
* 2017-11-03 (Sebastian Pipping)
* - Hide sip_tobin and sip_binof unless SIPHASH_TOBIN macro is defined
*
* 2017-07-25 (Vadim Zeitlin)
* - Fix use of SIPHASH_MAIN macro
*
* 2017-07-05 (Sebastian Pipping)
* - Use _SIP_ULL macro to not require a C++11 compiler if compiled as C++
* - Add const qualifiers at two places
* - Ensure <=80 characters line length (assuming tab width 4)
*
* 2017-06-23 (Victor Stinner)
* - Address Win64 compile warnings
*
* 2017-06-18 (Sebastian Pipping)
* - Clarify license note in the header
* - Address C89 issues:
* - Stop using inline keyword (and let compiler decide)
* - Replace _Bool by int
* - Turn macro siphash24 into a function
* - Address invalid conversion (void pointer) by explicit cast
* - Address lack of stdint.h for Visual Studio 2003 to 2008
* - Always expose sip24_valid (for self-tests)
*
* 2012-11-04 - Born. (William Ahern)
* --------------------------------------------------------------------------
* USAGE:
*
* SipHash-2-4 takes as input two 64-bit words as the key, some number of
* message bytes, and outputs a 64-bit word as the message digest. This
* implementation employs two data structures: a struct sipkey for
* representing the key, and a struct siphash for representing the hash
* state.
*
* For converting a 16-byte unsigned char array to a key, use either the
* macro sip_keyof or the routine sip_tokey. The former instantiates a
* compound literal key, while the latter requires a key object as a
* parameter.
*
* unsigned char secret[16];
* arc4random_buf(secret, sizeof secret);
* struct sipkey *key = sip_keyof(secret);
*
* For hashing a message, use either the convenience macro siphash24 or the
* routines sip24_init, sip24_update, and sip24_final.
*
* struct siphash state;
* void *msg;
* size_t len;
* uint64_t hash;
*
* sip24_init(&state, key);
* sip24_update(&state, msg, len);
* hash = sip24_final(&state);
*
* or
*
* hash = siphash24(msg, len, key);
*
* To convert the 64-bit hash value to a canonical 8-byte little-endian
* binary representation, use either the macro sip_binof or the routine
* sip_tobin. The former instantiates and returns a compound literal array,
* while the latter requires an array object as a parameter.
* --------------------------------------------------------------------------
* NOTES:
*
* o Neither sip_keyof, sip_binof, nor siphash24 will work with compilers
* lacking compound literal support. Instead, you must use the lower-level
* interfaces which take as parameters the temporary state objects.
*
* o Uppercase macros may evaluate parameters more than once. Lowercase
* macros should not exhibit any such side effects.
* ==========================================================================
*/
#ifndef SIPHASH_H
#define SIPHASH_H
#include <stddef.h> /* size_t */
#include <stdint.h> /* uint64_t uint32_t uint8_t */
/*
* Workaround to not require a C++11 compiler for using ULL suffix
* if this code is included and compiled as C++; related GCC warning is:
* warning: use of C++11 long long integer constant [-Wlong-long]
*/
#define _SIP_ULL(high, low) ((((uint64_t)high) << 32) | (low))
#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
#define SIP_U32TO8_LE(p, v) \
(p)[0] = (uint8_t)((v) >> 0); \
(p)[1] = (uint8_t)((v) >> 8); \
(p)[2] = (uint8_t)((v) >> 16); \
(p)[3] = (uint8_t)((v) >> 24);
#define SIP_U64TO8_LE(p, v) \
SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >> 0)); \
SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32));
#define SIP_U8TO64_LE(p) \
(((uint64_t)((p)[0]) << 0) | ((uint64_t)((p)[1]) << 8) \
| ((uint64_t)((p)[2]) << 16) | ((uint64_t)((p)[3]) << 24) \
| ((uint64_t)((p)[4]) << 32) | ((uint64_t)((p)[5]) << 40) \
| ((uint64_t)((p)[6]) << 48) | ((uint64_t)((p)[7]) << 56))
#define SIPHASH_INITIALIZER \
{ 0, 0, 0, 0, {0}, 0, 0 }
struct siphash {
uint64_t v0, v1, v2, v3;
unsigned char buf[8], *p;
uint64_t c;
}; /* struct siphash */
#define SIP_KEYLEN 16
struct sipkey {
uint64_t k[2];
}; /* struct sipkey */
#define sip_keyof(k) sip_tokey(&(struct sipkey){{0}}, (k))
static struct sipkey *
sip_tokey(struct sipkey *key, const void *src) {
key->k[0] = SIP_U8TO64_LE((const unsigned char *)src);
key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8);
return key;
} /* sip_tokey() */
#ifdef SIPHASH_TOBIN
# define sip_binof(v) sip_tobin((unsigned char[8]){0}, (v))
static void *
sip_tobin(void *dst, uint64_t u64) {
SIP_U64TO8_LE((unsigned char *)dst, u64);
return dst;
} /* sip_tobin() */
#endif /* SIPHASH_TOBIN */
static void
sip_round(struct siphash *H, const int rounds) {
int i;
for (i = 0; i < rounds; i++) {
H->v0 += H->v1;
H->v1 = SIP_ROTL(H->v1, 13);
H->v1 ^= H->v0;
H->v0 = SIP_ROTL(H->v0, 32);
H->v2 += H->v3;
H->v3 = SIP_ROTL(H->v3, 16);
H->v3 ^= H->v2;
H->v0 += H->v3;
H->v3 = SIP_ROTL(H->v3, 21);
H->v3 ^= H->v0;
H->v2 += H->v1;
H->v1 = SIP_ROTL(H->v1, 17);
H->v1 ^= H->v2;
H->v2 = SIP_ROTL(H->v2, 32);
}
} /* sip_round() */
static struct siphash *
sip24_init(struct siphash *H, const struct sipkey *key) {
H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
H->p = H->buf;
H->c = 0;
return H;
} /* sip24_init() */
#define sip_endof(a) (&(a)[sizeof(a) / sizeof *(a)])
static struct siphash *
sip24_update(struct siphash *H, const void *src, size_t len) {
const unsigned char *p = (const unsigned char *)src, *pe = p + len;
uint64_t m;
do {
while (p < pe && H->p < sip_endof(H->buf))
*H->p++ = *p++;
if (H->p < sip_endof(H->buf))
break;
m = SIP_U8TO64_LE(H->buf);
H->v3 ^= m;
sip_round(H, 2);
H->v0 ^= m;
H->p = H->buf;
H->c += 8;
} while (p < pe);
return H;
} /* sip24_update() */
static uint64_t
sip24_final(struct siphash *H) {
const char left = (char)(H->p - H->buf);
uint64_t b = (H->c + left) << 56;
switch (left) {
case 7:
b |= (uint64_t)H->buf[6] << 48;
/* fall through */
case 6:
b |= (uint64_t)H->buf[5] << 40;
/* fall through */
case 5:
b |= (uint64_t)H->buf[4] << 32;
/* fall through */
case 4:
b |= (uint64_t)H->buf[3] << 24;
/* fall through */
case 3:
b |= (uint64_t)H->buf[2] << 16;
/* fall through */
case 2:
b |= (uint64_t)H->buf[1] << 8;
/* fall through */
case 1:
b |= (uint64_t)H->buf[0] << 0;
/* fall through */
case 0:
break;
}
H->v3 ^= b;
sip_round(H, 2);
H->v0 ^= b;
H->v2 ^= 0xff;
sip_round(H, 4);
return H->v0 ^ H->v1 ^ H->v2 ^ H->v3;
} /* sip24_final() */
static uint64_t
siphash24(const void *src, size_t len, const struct sipkey *key) {
struct siphash state = SIPHASH_INITIALIZER;
return sip24_final(sip24_update(sip24_init(&state, key), src, len));
} /* siphash24() */
/*
* SipHash-2-4 output with
* k = 00 01 02 ...
* and
* in = (empty string)
* in = 00 (1 byte)
* in = 00 01 (2 bytes)
* in = 00 01 02 (3 bytes)
* ...
* in = 00 01 02 ... 3e (63 bytes)
*/
static int
sip24_valid(void) {
/* clang-format off */
static const unsigned char vectors[64][8] = {
{ 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, },
{ 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, },
{ 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, },
{ 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, },
{ 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, },
{ 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, },
{ 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, },
{ 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, },
{ 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, },
{ 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, },
{ 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, },
{ 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, },
{ 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, },
{ 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, },
{ 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, },
{ 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, },
{ 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, },
{ 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, },
{ 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, },
{ 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, },
{ 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, },
{ 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, },
{ 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, },
{ 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, },
{ 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, },
{ 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, },
{ 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, },
{ 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, },
{ 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, },
{ 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, },
{ 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, },
{ 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, },
{ 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, },
{ 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, },
{ 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, },
{ 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, },
{ 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, },
{ 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, },
{ 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, },
{ 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, },
{ 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, },
{ 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, },
{ 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, },
{ 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, },
{ 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, },
{ 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, },
{ 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, },
{ 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, },
{ 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, },
{ 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, },
{ 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, },
{ 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, },
{ 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, },
{ 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, },
{ 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, },
{ 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, },
{ 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, },
{ 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, },
{ 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, },
{ 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, },
{ 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, },
{ 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, },
{ 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, },
{ 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, }
};
/* clang-format on */
unsigned char in[64];
struct sipkey k;
size_t i;
sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011"
"\012\013\014\015\016\017");
for (i = 0; i < sizeof in; ++i) {
in[i] = (unsigned char)i;
if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i]))
return 0;
}
return 1;
} /* sip24_valid() */
#ifdef SIPHASH_MAIN
# include <stdio.h>
int
main(void) {
const int ok = sip24_valid();
if (ok)
puts("OK");
else
puts("FAIL");
return ! ok;
} /* main() */
#endif /* SIPHASH_MAIN */
#endif /* SIPHASH_H */
-66
View File
@@ -1,66 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,
-8400
View File
File diff suppressed because it is too large Load Diff
-1251
View File
File diff suppressed because it is too large Load Diff
-142
View File
@@ -1,142 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2002 Karl Waclawek <karl@waclawek.net>
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef XmlRole_INCLUDED
#define XmlRole_INCLUDED 1
#ifdef __VMS
/* 0 1 2 3 0 1 2 3
1234567890123456789012345678901 1234567890123456789012345678901 */
# define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt
#endif
#include "xmltok.h"
#ifdef __cplusplus
extern "C" {
#endif
enum {
XML_ROLE_ERROR = -1,
XML_ROLE_NONE = 0,
XML_ROLE_XML_DECL,
XML_ROLE_INSTANCE_START,
XML_ROLE_DOCTYPE_NONE,
XML_ROLE_DOCTYPE_NAME,
XML_ROLE_DOCTYPE_SYSTEM_ID,
XML_ROLE_DOCTYPE_PUBLIC_ID,
XML_ROLE_DOCTYPE_INTERNAL_SUBSET,
XML_ROLE_DOCTYPE_CLOSE,
XML_ROLE_GENERAL_ENTITY_NAME,
XML_ROLE_PARAM_ENTITY_NAME,
XML_ROLE_ENTITY_NONE,
XML_ROLE_ENTITY_VALUE,
XML_ROLE_ENTITY_SYSTEM_ID,
XML_ROLE_ENTITY_PUBLIC_ID,
XML_ROLE_ENTITY_COMPLETE,
XML_ROLE_ENTITY_NOTATION_NAME,
XML_ROLE_NOTATION_NONE,
XML_ROLE_NOTATION_NAME,
XML_ROLE_NOTATION_SYSTEM_ID,
XML_ROLE_NOTATION_NO_SYSTEM_ID,
XML_ROLE_NOTATION_PUBLIC_ID,
XML_ROLE_ATTRIBUTE_NAME,
XML_ROLE_ATTRIBUTE_TYPE_CDATA,
XML_ROLE_ATTRIBUTE_TYPE_ID,
XML_ROLE_ATTRIBUTE_TYPE_IDREF,
XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
XML_ROLE_ATTRIBUTE_ENUM_VALUE,
XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
XML_ROLE_ATTLIST_NONE,
XML_ROLE_ATTLIST_ELEMENT_NAME,
XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
XML_ROLE_FIXED_ATTRIBUTE_VALUE,
XML_ROLE_ELEMENT_NONE,
XML_ROLE_ELEMENT_NAME,
XML_ROLE_CONTENT_ANY,
XML_ROLE_CONTENT_EMPTY,
XML_ROLE_CONTENT_PCDATA,
XML_ROLE_GROUP_OPEN,
XML_ROLE_GROUP_CLOSE,
XML_ROLE_GROUP_CLOSE_REP,
XML_ROLE_GROUP_CLOSE_OPT,
XML_ROLE_GROUP_CLOSE_PLUS,
XML_ROLE_GROUP_CHOICE,
XML_ROLE_GROUP_SEQUENCE,
XML_ROLE_CONTENT_ELEMENT,
XML_ROLE_CONTENT_ELEMENT_REP,
XML_ROLE_CONTENT_ELEMENT_OPT,
XML_ROLE_CONTENT_ELEMENT_PLUS,
XML_ROLE_PI,
XML_ROLE_COMMENT,
#ifdef XML_DTD
XML_ROLE_TEXT_DECL,
XML_ROLE_IGNORE_SECT,
XML_ROLE_INNER_PARAM_ENTITY_REF,
#endif /* XML_DTD */
XML_ROLE_PARAM_ENTITY_REF
};
typedef struct prolog_state {
int(PTRCALL *handler)(struct prolog_state *state, int tok, const char *ptr,
const char *end, const ENCODING *enc);
unsigned level;
int role_none;
#ifdef XML_DTD
unsigned includeLevel;
int documentEntity;
int inEntityValue;
#endif /* XML_DTD */
} PROLOG_STATE;
void XmlPrologStateInit(PROLOG_STATE *);
#ifdef XML_DTD
void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
#endif /* XML_DTD */
#define XmlTokenRole(state, tok, ptr, end, enc) \
(((state)->handler)(state, tok, ptr, end, enc))
#ifdef __cplusplus
}
#endif
#endif /* not XmlRole_INCLUDED */
-1673
View File
File diff suppressed because it is too large Load Diff
-319
View File
@@ -1,319 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2002-2005 Karl Waclawek <karl@waclawek.net>
Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org>
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef XmlTok_INCLUDED
#define XmlTok_INCLUDED 1
#ifdef __cplusplus
extern "C" {
#endif
/* The following token may be returned by XmlContentTok */
#define XML_TOK_TRAILING_RSQB \
-5 /* ] or ]] at the end of the scan; might be \
start of illegal ]]> sequence */
/* The following tokens may be returned by both XmlPrologTok and
XmlContentTok.
*/
#define XML_TOK_NONE -4 /* The string to be scanned is empty */
#define XML_TOK_TRAILING_CR \
-3 /* A CR at the end of the scan; \
might be part of CRLF sequence */
#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
#define XML_TOK_PARTIAL -1 /* only part of a token */
#define XML_TOK_INVALID 0
/* The following tokens are returned by XmlContentTok; some are also
returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok.
*/
#define XML_TOK_START_TAG_WITH_ATTS 1
#define XML_TOK_START_TAG_NO_ATTS 2
#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
#define XML_TOK_END_TAG 5
#define XML_TOK_DATA_CHARS 6
#define XML_TOK_DATA_NEWLINE 7
#define XML_TOK_CDATA_SECT_OPEN 8
#define XML_TOK_ENTITY_REF 9
#define XML_TOK_CHAR_REF 10 /* numeric character reference */
/* The following tokens may be returned by both XmlPrologTok and
XmlContentTok.
*/
#define XML_TOK_PI 11 /* processing instruction */
#define XML_TOK_XML_DECL 12 /* XML decl or text decl */
#define XML_TOK_COMMENT 13
#define XML_TOK_BOM 14 /* Byte order mark */
/* The following tokens are returned only by XmlPrologTok */
#define XML_TOK_PROLOG_S 15
#define XML_TOK_DECL_OPEN 16 /* <!foo */
#define XML_TOK_DECL_CLOSE 17 /* > */
#define XML_TOK_NAME 18
#define XML_TOK_NMTOKEN 19
#define XML_TOK_POUND_NAME 20 /* #name */
#define XML_TOK_OR 21 /* | */
#define XML_TOK_PERCENT 22
#define XML_TOK_OPEN_PAREN 23
#define XML_TOK_CLOSE_PAREN 24
#define XML_TOK_OPEN_BRACKET 25
#define XML_TOK_CLOSE_BRACKET 26
#define XML_TOK_LITERAL 27
#define XML_TOK_PARAM_ENTITY_REF 28
#define XML_TOK_INSTANCE_START 29
/* The following occur only in element type declarations */
#define XML_TOK_NAME_QUESTION 30 /* name? */
#define XML_TOK_NAME_ASTERISK 31 /* name* */
#define XML_TOK_NAME_PLUS 32 /* name+ */
#define XML_TOK_COND_SECT_OPEN 33 /* <![ */
#define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
#define XML_TOK_COMMA 38
/* The following token is returned only by XmlAttributeValueTok */
#define XML_TOK_ATTRIBUTE_VALUE_S 39
/* The following token is returned only by XmlCdataSectionTok */
#define XML_TOK_CDATA_SECT_CLOSE 40
/* With namespace processing this is returned by XmlPrologTok for a
name with a colon.
*/
#define XML_TOK_PREFIXED_NAME 41
#ifdef XML_DTD
# define XML_TOK_IGNORE_SECT 42
#endif /* XML_DTD */
#ifdef XML_DTD
# define XML_N_STATES 4
#else /* not XML_DTD */
# define XML_N_STATES 3
#endif /* not XML_DTD */
#define XML_PROLOG_STATE 0
#define XML_CONTENT_STATE 1
#define XML_CDATA_SECTION_STATE 2
#ifdef XML_DTD
# define XML_IGNORE_SECTION_STATE 3
#endif /* XML_DTD */
#define XML_N_LITERAL_TYPES 2
#define XML_ATTRIBUTE_VALUE_LITERAL 0
#define XML_ENTITY_VALUE_LITERAL 1
/* The size of the buffer passed to XmlUtf8Encode must be at least this. */
#define XML_UTF8_ENCODE_MAX 4
/* The size of the buffer passed to XmlUtf16Encode must be at least this. */
#define XML_UTF16_ENCODE_MAX 2
typedef struct position {
/* first line and first column are 0 not 1 */
XML_Size lineNumber;
XML_Size columnNumber;
} POSITION;
typedef struct {
const char *name;
const char *valuePtr;
const char *valueEnd;
char normalized;
} ATTRIBUTE;
struct encoding;
typedef struct encoding ENCODING;
typedef int(PTRCALL *SCANNER)(const ENCODING *, const char *, const char *,
const char **);
enum XML_Convert_Result {
XML_CONVERT_COMPLETED = 0,
XML_CONVERT_INPUT_INCOMPLETE = 1,
XML_CONVERT_OUTPUT_EXHAUSTED
= 2 /* and therefore potentially input remaining as well */
};
struct encoding {
SCANNER scanners[XML_N_STATES];
SCANNER literalScanners[XML_N_LITERAL_TYPES];
int(PTRCALL *nameMatchesAscii)(const ENCODING *, const char *, const char *,
const char *);
int(PTRFASTCALL *nameLength)(const ENCODING *, const char *);
const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *);
int(PTRCALL *getAtts)(const ENCODING *enc, const char *ptr, int attsMax,
ATTRIBUTE *atts);
int(PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
int(PTRCALL *predefinedEntityName)(const ENCODING *, const char *,
const char *);
void(PTRCALL *updatePosition)(const ENCODING *, const char *ptr,
const char *end, POSITION *);
int(PTRCALL *isPublicId)(const ENCODING *enc, const char *ptr,
const char *end, const char **badPtr);
enum XML_Convert_Result(PTRCALL *utf8Convert)(const ENCODING *enc,
const char **fromP,
const char *fromLim, char **toP,
const char *toLim);
enum XML_Convert_Result(PTRCALL *utf16Convert)(const ENCODING *enc,
const char **fromP,
const char *fromLim,
unsigned short **toP,
const unsigned short *toLim);
int minBytesPerChar;
char isUtf8;
char isUtf16;
};
/* Scan the string starting at ptr until the end of the next complete
token, but do not scan past eptr. Return an integer giving the
type of token.
Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
Return XML_TOK_PARTIAL when the string does not contain a complete
token; nextTokPtr will not be set.
Return XML_TOK_INVALID when the string does not start a valid
token; nextTokPtr will be set to point to the character which made
the token invalid.
Otherwise the string starts with a valid token; nextTokPtr will be
set to point to the character following the end of that token.
Each data character counts as a single token, but adjacent data
characters may be returned together. Similarly for characters in
the prolog outside literals, comments and processing instructions.
*/
#define XmlTok(enc, state, ptr, end, nextTokPtr) \
(((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
#define XmlContentTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
#ifdef XML_DTD
# define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
#endif /* XML_DTD */
/* This is used for performing a 2nd-level tokenization on the content
of a literal that has already been returned by XmlTok.
*/
#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
(((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
(((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
#define XmlNameLength(enc, ptr) (((enc)->nameLength)(enc, ptr))
#define XmlSkipS(enc, ptr) (((enc)->skipS)(enc, ptr))
#define XmlGetAttributes(enc, ptr, attsMax, atts) \
(((enc)->getAtts)(enc, ptr, attsMax, atts))
#define XmlCharRefNumber(enc, ptr) (((enc)->charRefNumber)(enc, ptr))
#define XmlPredefinedEntityName(enc, ptr, end) \
(((enc)->predefinedEntityName)(enc, ptr, end))
#define XmlUpdatePosition(enc, ptr, end, pos) \
(((enc)->updatePosition)(enc, ptr, end, pos))
#define XmlIsPublicId(enc, ptr, end, badPtr) \
(((enc)->isPublicId)(enc, ptr, end, badPtr))
#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
(((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
(((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
typedef struct {
ENCODING initEnc;
const ENCODING **encPtr;
} INIT_ENCODING;
int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc,
const char *ptr, const char *end, const char **badPtr,
const char **versionPtr, const char **versionEndPtr,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr, int *standalonePtr);
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
const ENCODING *XmlGetUtf8InternalEncoding(void);
const ENCODING *XmlGetUtf16InternalEncoding(void);
int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
int XmlSizeOfUnknownEncoding(void);
typedef int(XMLCALL *CONVERTER)(void *userData, const char *p);
ENCODING *XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert,
void *userData);
int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc,
const char *ptr, const char *end, const char **badPtr,
const char **versionPtr, const char **versionEndPtr,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr, int *standalonePtr);
int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
const ENCODING *XmlGetUtf8InternalEncodingNS(void);
const ENCODING *XmlGetUtf16InternalEncodingNS(void);
ENCODING *XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert,
void *userData);
#ifdef __cplusplus
}
#endif
#endif /* not XmlTok_INCLUDED */
-74
View File
@@ -1,74 +0,0 @@
/*
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2017-2019 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
enum {
BT_NONXML, /* e.g. noncharacter-FFFF */
BT_MALFORM, /* illegal, with regard to encoding */
BT_LT, /* less than = "<" */
BT_AMP, /* ampersand = "&" */
BT_RSQB, /* right square bracket = "[" */
BT_LEAD2, /* lead byte of a 2-byte UTF-8 character */
BT_LEAD3, /* lead byte of a 3-byte UTF-8 character */
BT_LEAD4, /* lead byte of a 4-byte UTF-8 character */
BT_TRAIL, /* trailing unit, e.g. second 16-bit unit of a 4-byte char. */
BT_CR, /* carriage return = "\r" */
BT_LF, /* line feed = "\n" */
BT_GT, /* greater than = ">" */
BT_QUOT, /* quotation character = "\"" */
BT_APOS, /* apostrophe = "'" */
BT_EQUALS, /* equal sign = "=" */
BT_QUEST, /* question mark = "?" */
BT_EXCL, /* exclamation mark = "!" */
BT_SOL, /* solidus, slash = "/" */
BT_SEMI, /* semicolon = ";" */
BT_NUM, /* number sign = "#" */
BT_LSQB, /* left square bracket = "[" */
BT_S, /* white space, e.g. "\t", " "[, "\r"] */
BT_NMSTRT, /* non-hex name start letter = "G".."Z" + "g".."z" + "_" */
BT_COLON, /* colon = ":" */
BT_HEX, /* hex letter = "A".."F" + "a".."f" */
BT_DIGIT, /* digit = "0".."9" */
BT_NAME, /* dot and middle dot = "." + chr(0xb7) */
BT_MINUS, /* minus = "-" */
BT_OTHER, /* known not to be a name or name start character */
BT_NONASCII, /* might be a name or name start character */
BT_PERCNT, /* percent sign = "%" */
BT_LPAR, /* left parenthesis = "(" */
BT_RPAR, /* right parenthesis = "(" */
BT_AST, /* asterisk = "*" */
BT_PLUS, /* plus sign = "+" */
BT_COMMA, /* comma = "," */
BT_VERBAR /* vertical bar = "|" */
};
#include <stddef.h>
-1819
View File
File diff suppressed because it is too large Load Diff
-122
View File
@@ -1,122 +0,0 @@
/* This file is included!
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
| __// \| |_) | (_| | |_
\___/_/\_\ .__/ \__,_|\__|
|_| XML parser
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
Licensed under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef XML_TOK_NS_C
const ENCODING *
NS(XmlGetUtf8InternalEncoding)(void) {
return &ns(internal_utf8_encoding).enc;
}
const ENCODING *
NS(XmlGetUtf16InternalEncoding)(void) {
# if BYTEORDER == 1234
return &ns(internal_little2_encoding).enc;
# elif BYTEORDER == 4321
return &ns(internal_big2_encoding).enc;
# else
const short n = 1;
return (*(const char *)&n ? &ns(internal_little2_encoding).enc
: &ns(internal_big2_encoding).enc);
# endif
}
static const ENCODING *const NS(encodings)[] = {
&ns(latin1_encoding).enc, &ns(ascii_encoding).enc,
&ns(utf8_encoding).enc, &ns(big2_encoding).enc,
&ns(big2_encoding).enc, &ns(little2_encoding).enc,
&ns(utf8_encoding).enc /* NO_ENC */
};
static int PTRCALL
NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr) {
return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE,
ptr, end, nextTokPtr);
}
static int PTRCALL
NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr) {
return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE,
ptr, end, nextTokPtr);
}
int
NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
const char *name) {
int i = getEncodingIndex(name);
if (i == UNKNOWN_ENC)
return 0;
SET_INIT_ENC_INDEX(p, i);
p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
p->initEnc.updatePosition = initUpdatePosition;
p->encPtr = encPtr;
*encPtr = &(p->initEnc);
return 1;
}
static const ENCODING *
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
# define ENCODING_MAX 128
char buf[ENCODING_MAX] = "";
char *p = buf;
int i;
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
if (ptr != end)
return 0;
*p = 0;
if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
return enc;
i = getEncodingIndex(buf);
if (i == UNKNOWN_ENC)
return 0;
return NS(encodings)[i];
}
int
NS(XmlParseXmlDecl)(int isGeneralTextEntity, const ENCODING *enc,
const char *ptr, const char *end, const char **badPtr,
const char **versionPtr, const char **versionEndPtr,
const char **encodingName, const ENCODING **encoding,
int *standalone) {
return doParseXmlDecl(NS(findEncoding), isGeneralTextEntity, enc, ptr, end,
badPtr, versionPtr, versionEndPtr, encodingName,
encoding, standalone);
}
#endif /* XML_TOK_NS_C */
-10
View File
@@ -1,10 +0,0 @@
# In PrusaSlicer 2.6.0 we switched from https://github.com/memononen/nanosvg to its fork https://github.com/fltk/nanosvg
# because this last implements the new function nsvgRasterizeXY() which we now use in GLTexture::load_from_svg()
# for rasterizing svg files from their original size to a squared power of two texture on Windows systems using
# AMD Radeon graphics cards
orcaslicer_add_cmake_project(NanoSVG
DEPENDS dep_Boost
URL https://github.com/SoftFever/nanosvg/archive/863f6aa97ef62028126fa2c19bd4350394c2e15e.zip
URL_HASH SHA256=8d9c1624ad6518dd6dfa31e4f8dc7da9ec243d88bae595c7a037450617fec851
)
@@ -0,0 +1,25 @@
diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx
index 44e59b0..8833fed 100644
--- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx
+++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx
@@ -21,6 +21,12 @@
#include <Standard_ProgramError.hxx>
#include <TCollection_AsciiString.hxx>
+// MSVC 14.52 for ARM64 crashes with an internal compiler error (C1001) while
+// optimizing this file, so it is compiled without optimization there.
+#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
+ #pragma optimize("", off)
+#endif
+
IMPLEMENT_STANDARD_RTTIEXT(BRepGraph_LayerTopoSupplement, BRepGraph_Layer)
namespace
@@ -384,3 +390,7 @@ void BRepGraph_LayerTopoSupplement::removeOwner(const BRepGraph_NodeId theOwner)
myOwnerToUids.UnBind(theOwner);
touch();
}
+
+#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
+ #pragma optimize("", on)
+#endif
+48 -18
View File
@@ -1,8 +1,16 @@
# clang-cl cannot emit some OCCT sources for ARM64 (llvm/llvm-project#62081).
# cl and clang-cl share an ABI.
# clang-cl cannot emit some OCCT sources for ARM64 (llvm/llvm-project#62081), and with OCCT's
# precompiled headers it can break exception copies (llvm/llvm-project#53486). cl and clang-cl
# share an ABI, so clang-cl builds compile OCCT with cl. The Visual Studio generator picks the
# compiler by toolset, so there OCCT may stay on clang-cl; keep precompiled headers off there.
set(_occt_compiler_args "")
if ("${DEPS_ARCH}" STREQUAL "arm64" AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(_occt_compiler_args -DCMAKE_C_COMPILER:STRING=cl -DCMAKE_CXX_COMPILER:STRING=cl)
set(_occt_pch ON)
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if ("${DEPS_ARCH}" STREQUAL "arm64" OR NOT CMAKE_GENERATOR MATCHES "Visual Studio")
set(_occt_compiler_args -DCMAKE_C_COMPILER:STRING=cl -DCMAKE_CXX_COMPILER:STRING=cl)
endif ()
if (CMAKE_GENERATOR MATCHES "Visual Studio")
set(_occt_pch OFF)
endif ()
endif ()
if(WIN32)
@@ -11,19 +19,27 @@ else()
set(library_build_type "Static")
endif()
# SLIC3R_CAD (declared in deps/CMakeLists.txt) builds OCCT's ModelingAlgorithms module
# (fillet/offset/loft), whose only consumer is the parametric Design/CAD tab. With it OFF
# the deps prefix matches upstream exactly.
# Only the toolkits libslic3r links are built, rather than whole modules. OCCT's module
# flags are all-or-nothing: the DataExchange module alone also builds the IGES, VRML, OBJ,
# STL and PLY readers and the XML/binary document formats, none of which Orca uses. With
# every module OFF, OCCT builds BUILD_ADDITIONAL_TOOLKITS plus their dependencies.
#
# With it ON OCCT also builds TKFillet (used via BRepFilletAPI), TKOffset (used via
# BRepOffsetAPI), and TKFeat, TKHelix, TKXMesh and TKExpress, which nothing here references
# but which the module flag builds anyway, since module flags are all-or-nothing. The
# module's other toolkits are built either way, because DataExchange (the STEP path)
# depends on them.
# This list must match OCCT_LIBS in src/libslic3r/CMakeLists.txt. A toolkit missing here
# fails the app configure or link; one left here after libslic3r stops using it only costs
# build time.
#
# On macOS/Linux OCCT links statically, so an unreferenced toolkit costs build time and no
# shipped bytes. Windows ships only the DLLs libslic3r links, so the tab adds the TKFillet,
# TKOffset and TKBool DLLs. See docs/HLSD/design-tab.md.
# SLIC3R_CAD (declared in deps/CMakeLists.txt) adds TKFillet (BRepFilletAPI), TKOffset
# (BRepOffsetAPI) and TKBool, which they need. Their only consumer is the parametric
# Design/CAD tab. On Windows OCCT builds shared and only the linked toolkits ship, so the
# tab adds those three DLLs. See docs/HLSD/design-tab.md.
set(_occt_toolkits
TKDESTEP TKDE TKXCAF TKXSBase TKVCAF TKCAF TKLCAF TKCDF TKV3d TKService TKMesh TKBO
TKPrim TKHLR TKShHealing TKTopAlgo TKGeomAlgo TKBRep TKGeomBase TKG3d TKG2d TKMath TKernel)
if (SLIC3R_CAD)
list(APPEND _occt_toolkits TKFillet TKOffset TKBool)
endif ()
# OCCT reads BUILD_ADDITIONAL_TOOLKITS as a space-separated string.
string(REPLACE ";" " " _occt_toolkits "${_occt_toolkits}")
if (IN_GIT_REPO)
set(OCCT_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT)
@@ -34,7 +50,11 @@ orcaslicer_add_cmake_project(OCCT
URL_HASH SHA256=7c033d917ee8f040c0512d289dcc5f02c148889d5bac17c3e25639accb44f0da
# Makes BRepMesh triangulate cone faces whose seam pcurve is slightly tilted
# (Open-Cascade-SAS/OCCT#572); remove the patch once an OCCT release includes the fix.
PATCH_COMMAND git apply ${OCCT_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-BRepMesh-seam-pcurve-at-edge-parameter.patch
# 0002 compiles one file without optimization under cl for ARM64, where MSVC 14.52 crashes
# on it with an internal compiler error; remove it once the runner image ships a fixed MSVC.
PATCH_COMMAND git apply ${OCCT_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix
${CMAKE_CURRENT_LIST_DIR}/0001-BRepMesh-seam-pcurve-at-edge-parameter.patch
${CMAKE_CURRENT_LIST_DIR}/0002-BRepGraph-MSVC-ARM64-ICE-workaround.patch
#DEPENDS dep_Boost
CMAKE_ARGS
-DCMAKE_CXX_STANDARD=17
@@ -52,12 +72,22 @@ orcaslicer_add_cmake_project(OCCT
-DUSE_FFMPEG=OFF
-DUSE_VTK=OFF
-DBUILD_DOC_Overview=OFF
-DBUILD_USE_PCH=${_occt_pch}
-DBUILD_MODULE_ApplicationFramework=OFF
#-DBUILD_MODULE_DataExchange=OFF
-DBUILD_MODULE_DataExchange=OFF
-DBUILD_MODULE_Draw=OFF
-DBUILD_MODULE_FoundationClasses=OFF
-DBUILD_MODULE_ModelingAlgorithms=${SLIC3R_CAD}
-DBUILD_MODULE_ModelingAlgorithms=OFF
-DBUILD_MODULE_ModelingData=OFF
-DBUILD_MODULE_Visualization=OFF
"-DBUILD_ADDITIONAL_TOOLKITS=${_occt_toolkits}"
${_occt_compiler_args}
)
# The precompiled headers (~2.2 GB with cl) are only needed while OCCT compiles; none are installed.
if (_occt_pch)
ExternalProject_Add_Step(dep_OCCT remove_pch
DEPENDEES install
COMMENT "Removing OCCT's precompiled headers"
COMMAND ${CMAKE_COMMAND} -DDIR=<BINARY_DIR> -P ${CMAKE_CURRENT_LIST_DIR}/remove_pch.cmake)
endif ()
+5
View File
@@ -0,0 +1,5 @@
# Deletes the precompiled headers OCCT leaves in its build tree (see OCCT.cmake).
file(GLOB_RECURSE _pch "${DIR}/*.pch" "${DIR}/*.gch")
if (_pch)
file(REMOVE ${_pch})
endif ()
+19 -30
View File
@@ -17,6 +17,7 @@ else()
endif()
set(_openssl_dir ${DESTDIR})
set(_openssl_extra_cflags "")
if(WIN32)
set(_openssl_msvc_env CC=cl CXX=cl RC=rc CL=/FS)
@@ -25,21 +26,14 @@ if(WIN32)
# spaces, e.g. exported by CLion, silently produces no .obj files and the
# lib step fails with LNK1181). Pin the upstream toolchain.
# Keep rc.exe resolved from the MSVC developer environment as well. The
# absolute Windows SDK path contains spaces and OpenSSL 1.1.1 writes it to
# the generated nmake file without quoting, which skips .res generation.
# absolute Windows SDK path contains spaces and OpenSSL writes it to the
# generated nmake file without quoting, which skips .res generation.
# /FS serializes access to OpenSSL's shared generated PDB when cl is
# driven through nmake from a Ninja configure step.
set(_conf_cmd ${CMAKE_COMMAND} -E env ${_openssl_msvc_env} perl Configure )
set(_cross_comp_prefix_line "")
if("${DEPS_ARCH}" STREQUAL "arm64")
# OpenSSL's VC configs pass /Gs0, which puts a __chkstk probe in every
# function. MSVC 14.51 and 14.52 (VS 2026) for ARM64 emit that call
# before the prologue saves LR, so the function returns into itself;
# in tls_parse_all_extensions that breaks every TLS handshake. 14.44
# (VS 2022) is unaffected. Restore cl's default threshold: Configure
# appends /Gs4096 after /Gs0, and the later option wins.
set(_openssl_extra_cflags /Gs4096)
endif()
# 1.1.1's VC configs passed /Gs0, which needed a /Gs4096 override on ARM64
# (MSVC 14.51/14.52 mis-emit the __chkstk probe). 3.x no longer sets /Gs.
set(_make_cmd ${CMAKE_COMMAND} -E env ${_openssl_msvc_env} nmake)
set(_install_cmd ${CMAKE_COMMAND} -E env ${_openssl_msvc_env} nmake install_sw )
else()
@@ -56,10 +50,10 @@ else()
else()
# A static library that is embedded into a shared object must not export
# its symbols. On Linux the running process also loads the system OpenSSL
# 3.x (WebKitGTK/gnutls pull in libcrypto.so.3), and CPython's _ssl and
# (WebKitGTK/gnutls pull in libcrypto.so.3), and CPython's _ssl and
# _hashlib are dlopened (RTLD_LOCAL) DSOs that each embed this OpenSSL.
# With default visibility their unversioned OpenSSL references are
# preempted by that global 3.x copy, mixing the 1.1.1 and 3.x ABIs and
# preempted by that global copy, mixing two OpenSSL builds and
# corrupting the heap (ssl.create_default_context() aborts). Hidden
# visibility makes each embedded copy self-contained. Linux-only: macOS
# binds dylibs with a two-level namespace (no interposition) and ships no
@@ -85,28 +79,30 @@ endif()
ExternalProject_Add(dep_OpenSSL
#EXCLUDE_FROM_ALL ON
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1w.tar.gz"
URL_HASH SHA256=2130E8C2FB3B79D1086186F78E59E8BC8D1A6AEDF17AB3907F4CB9AE20918C41
# URL "https://github.com/openssl/openssl/archive/refs/tags/openssl-3.1.2.tar.gz"
# URL_HASH SHA256=8c776993154652d0bb393f506d850b811517c8bd8d24b1008aef57fbe55d3f31
# 3.5 is the long-term-support series (supported until April 2030).
URL "https://github.com/openssl/openssl/releases/download/openssl-3.5.9/openssl-3.5.9.tar.gz"
URL_HASH SHA256=603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL
CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
"--openssldir=${_openssl_dir}"
"--prefix=${DESTDIR}"
# OpenSSL's linux-x86_64 target sets multilib=64, so it installs to
# <prefix>/lib64 while every other dep uses <prefix>/lib. CPython's
# --with-openssl only ever emits -L<dir>/lib, so it misses the bundled
# static libs and silently links the system OpenSSL instead -- which,
# against 1.1.1w headers, leaves _ssl.so with an undefined
# SSL_get_peer_certificate (removed in OpenSSL 3.x). Pin libdir so the
# prefix stays single-layout.
# --with-openssl only ever emits -L<dir>/lib, so it would miss the
# bundled static libs and silently link the system OpenSSL instead.
# Pin libdir so the prefix stays single-layout.
"--libdir=lib"
${_cross_comp_prefix_line}
${_openssl_extra_cflags}
# 3.x raises the default security level from 1 to 2. Keep 1, the level
# 1.1.1 shipped with: it still accepts the 1024-bit RSA and DH that old
# self-signed printer certificates and firmware TLS stacks use. TLS
# 1.0 and 1.1 need level 0 in 3.x and stay refused at either level.
-DOPENSSL_TLS_SECURITY_LEVEL=1
no-shared
no-asm
no-ssl3-method
no-dynamic-engine
no-tests
BUILD_IN_SOURCE ON
BUILD_COMMAND ${_make_cmd}
INSTALL_COMMAND ${_install_cmd}
@@ -118,13 +114,6 @@ if (CMAKE_GENERATOR MATCHES "Visual Studio")
set_target_properties(dep_OpenSSL PROPERTIES VS_PLATFORM_TOOLSET "$(DefaultPlatformToolset)")
endif ()
ExternalProject_Add_Step(dep_OpenSSL install_cmake_files
DEPENDEES install
COMMAND ${CMAKE_COMMAND} -E copy_directory openssl "${DESTDIR}${CMAKE_INSTALL_LIBDIR}/cmake/openssl"
WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}"
)
if (NOT WIN32)
# OpenSSL's object rules do not depend on the configured flags or paths, so
# reconfiguring it (a new compiler flag, a different --openssldir) relinks
-67
View File
@@ -1,67 +0,0 @@
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
# but only if the requested major version is the same as the current one.
# The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "1.1.1k")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
if("1.1.1k" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
else()
set(CVF_VERSION_MAJOR "1.1.1k")
endif()
if(PACKAGE_FIND_VERSION_RANGE)
# both endpoints of the range must have the expected major version
math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
set(PACKAGE_VERSION_COMPATIBLE FALSE)
elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
else()
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
endif()
# if the installed project requested no architecture check, don't perform the check
if("FALSE")
return()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
math(EXPR installedBits "8 * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
-3
View File
@@ -1,3 +0,0 @@
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
include("${CMAKE_CURRENT_LIST_DIR}/openssl-targets.cmake")
-29
View File
@@ -1,29 +0,0 @@
#----------------------------------------------------------------
# Generated CMake target import file for configuration "Debug".
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "OpenSSL::SSL" for configuration "Debug"
set_property(TARGET OpenSSL::SSL APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(OpenSSL::SSL PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/libssl.lib"
)
list(APPEND _IMPORT_CHECK_TARGETS OpenSSL::SSL )
list(APPEND _IMPORT_CHECK_FILES_FOR_OpenSSL::SSL "${_IMPORT_PREFIX}/lib/libssl.lib" )
# Import target "OpenSSL::Crypto" for configuration "Debug"
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(OpenSSL::Crypto PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/libcrypto.lib"
)
list(APPEND _IMPORT_CHECK_TARGETS OpenSSL::Crypto )
list(APPEND _IMPORT_CHECK_FILES_FOR_OpenSSL::Crypto "${_IMPORT_PREFIX}/lib/libcrypto.lib" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
-29
View File
@@ -1,29 +0,0 @@
#----------------------------------------------------------------
# Generated CMake target import file for configuration "Release".
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "OpenSSL::SSL" for configuration "Release"
set_property(TARGET OpenSSL::SSL APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(OpenSSL::SSL PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libssl.lib"
)
list(APPEND _IMPORT_CHECK_TARGETS OpenSSL::SSL )
list(APPEND _IMPORT_CHECK_FILES_FOR_OpenSSL::SSL "${_IMPORT_PREFIX}/lib/libssl.lib" )
# Import target "OpenSSL::Crypto" for configuration "Debug"
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(OpenSSL::Crypto PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libcrypto.lib"
)
list(APPEND _IMPORT_CHECK_TARGETS OpenSSL::Crypto )
list(APPEND _IMPORT_CHECK_FILES_FOR_OpenSSL::Crypto "${_IMPORT_PREFIX}/lib/libcrypto.lib" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
@@ -1,29 +0,0 @@
#----------------------------------------------------------------
# Generated CMake target import file for configuration "RelWithDebInfo".
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "OpenSSL::SSL" for configuration "RelWithDebInfo"
set_property(TARGET OpenSSL::SSL APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO)
set_target_properties(OpenSSL::SSL PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELWITHDEBINFO "CXX"
IMPORTED_LOCATION_RELWITHDEBINFO "${_IMPORT_PREFIX}/lib/libssl.lib"
)
list(APPEND _IMPORT_CHECK_TARGETS OpenSSL::SSL )
list(APPEND _IMPORT_CHECK_FILES_FOR_OpenSSL::SSL "${_IMPORT_PREFIX}/lib/libssl.lib" )
# Import target "OpenSSL::Crypto" for configuration "RelWithDebInfo"
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO)
set_target_properties(OpenSSL::Crypto PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELWITHDEBINFO "CXX"
IMPORTED_LOCATION_RELWITHDEBINFO "${_IMPORT_PREFIX}/lib/libcrypto.lib"
)
list(APPEND _IMPORT_CHECK_TARGETS OpenSSL::Crypto )
list(APPEND _IMPORT_CHECK_FILES_FOR_OpenSSL::Crypto "${_IMPORT_PREFIX}/lib/libcrypto.lib" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
-104
View File
@@ -1,104 +0,0 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
message(FATAL_ERROR "CMake >= 2.6.0 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.6...3.18)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_targetsDefined)
set(_targetsNotDefined)
set(_expectedTargets)
foreach(_expectedTarget OpenSSL::SSL OpenSSL::Crypto)
list(APPEND _expectedTargets ${_expectedTarget})
if(NOT TARGET ${_expectedTarget})
list(APPEND _targetsNotDefined ${_expectedTarget})
endif()
if(TARGET ${_expectedTarget})
list(APPEND _targetsDefined ${_expectedTarget})
endif()
endforeach()
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
unset(_targetsDefined)
unset(_targetsNotDefined)
unset(_expectedTargets)
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT "${_targetsDefined}" STREQUAL "")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
endif()
unset(_targetsDefined)
unset(_targetsNotDefined)
unset(_expectedTargets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target OpenSSL::SSL
add_library(OpenSSL::SSL STATIC IMPORTED)
set_target_properties(OpenSSL::SSL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)
add_library(OpenSSL::Crypto STATIC IMPORTED)
set_target_properties(OpenSSL::Crypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
endif()
# Load information for each installed configuration.
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(GLOB CONFIG_FILES "${_DIR}/openssl-targets-*.cmake")
foreach(f ${CONFIG_FILES})
include(${f})
endforeach()
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(target ${_IMPORT_CHECK_TARGETS} )
foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
if(NOT EXISTS "${file}" )
message(FATAL_ERROR "The imported target \"${target}\" references the file
\"${file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
unset(_IMPORT_CHECK_FILES_FOR_${target})
endforeach()
unset(_IMPORT_CHECK_TARGETS)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
+13
View File
@@ -21,6 +21,18 @@ else ()
set(_wx_edge "-DwxUSE_WEBVIEW_EDGE=OFF")
endif ()
# wxUSE_EXPAT=sys makes wxxml compile against the expat installed in the deps
# prefix. That library is static, and upstream expat headers declare its API
# __declspec(dllimport) unless XML_STATIC is defined, which wx never does.
if (WIN32)
set(_wx_expat_static
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} -DXML_STATIC"
"-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} -DXML_STATIC"
)
else ()
set(_wx_expat_static "")
endif ()
# With a precompiled header, clang-cl can omit an exception type's copy constructor from its throw info,
# so copies of the exception share and double-free their data: https://github.com/llvm/llvm-project/issues/53486
if (MSVC AND CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -63,6 +75,7 @@ orcaslicer_add_cmake_project(
-DwxUSE_LIBTIFF=OFF
-DwxUSE_LIBWEBP=builtin
-DwxUSE_EXPAT=sys
${_wx_expat_static}
-DwxUSE_NANOSVG=OFF
)
-1
View File
@@ -16,7 +16,6 @@ add_subdirectory(stb_dxt) # Header-only STB DXT compression library
add_subdirectory(Shiny)
add_subdirectory(admesh)
add_subdirectory(clipper2)
add_subdirectory(expat)
add_subdirectory(glu-libtess)
add_subdirectory(hidapi)
add_subdirectory(hints) # Hints library with utility executable
+1 -2
View File
@@ -67,8 +67,7 @@ target_link_libraries(my_app
2. **Proper Include Paths**: Automatically sets up include directories
3. **Namespace Aliases**: Provides namespaced aliases (e.g., `spline::spline`) for clarity
4. **Position Independent Code**: Static libraries are built with `-fPIC` for compatibility
5. **Install Support**: Libraries can be installed and used by external projects
6. **Build/Install Interface**: Separates build-time and install-time include paths
5. **Build/Install Interface**: Separates build-time and install-time include paths
## Example Integration
@@ -242,7 +242,7 @@ namespace Clipper2Lib {
inline void UpdateEdgeIntoAEL(Active *e);
void IntersectEdges(Active &e1, Active &e2, const Point64& pt);
inline void DeleteFromAEL(Active &e);
inline void AdjustCurrXAndCopyToSEL(const int64_t top_y);
inline bool AdjustCurrXAndCopyToSEL(const int64_t top_y);
void DoIntersections(const int64_t top_y);
void AddNewIntersectNode(Active &e1, Active &e2, const int64_t top_y);
bool BuildIntersectList(const int64_t top_y);
@@ -9,6 +9,7 @@
#include "clipper2/clipper.engine.h"
#include "clipper2/clipper.h"
#include <limits>
#include <stdexcept>
#include <new>
#include <oneapi/tbb/scalable_allocator.h>
@@ -2136,10 +2137,12 @@ namespace Clipper2Lib {
}
inline void ClipperBase::AdjustCurrXAndCopyToSEL(const int64_t top_y)
inline bool ClipperBase::AdjustCurrXAndCopyToSEL(const int64_t top_y)
{
Active* e = actives_;
sel_ = e;
bool sorted = true;
int64_t prev_x = std::numeric_limits<int64_t>::min();
while (e)
{
e->prev_in_sel = e->prev_in_ael;
@@ -2148,8 +2151,11 @@ namespace Clipper2Lib {
// it is safe to ignore 'joined' edges here because
// if necessary they will be split in IntersectEdges()
e->curr_x = TopX(*e, top_y);
sorted = sorted && e->curr_x >= prev_x;
prev_x = e->curr_x;
e = e->next_in_ael;
}
return sorted;
}
bool ClipperBase::ExecuteInternal(ClipType ct, FillRule fillrule, bool use_polytrees)
@@ -2419,7 +2425,9 @@ namespace Clipper2Lib {
//Calculate edge positions at the top of the current scanbeam, and from this
//we will determine the intersections required to reach these new positions.
AdjustCurrXAndCopyToSEL(top_y);
// Orca: edges still in order have not crossed, which holds for most scanbeams, and the
// merge sort below would only confirm that in log2(n) passes over every edge.
if (AdjustCurrXAndCopyToSEL(top_y)) return false;
//Find all edge intersections in the current scanbeam using a stable merge
//sort that ensures only adjacent edges are intersecting. Intersect info is
//stored in FIntersectList ready to be processed in ProcessIntersectList.
-37
View File
@@ -1,37 +0,0 @@
cmake_minimum_required(VERSION 3.13)
project(expat)
add_library(expat STATIC
xmlparse.c
xmlrole.c
xmltok.c
)
target_include_directories(expat SYSTEM
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_sources(expat PRIVATE
ascii.h
asciitab.h
expat.h
expat_config.h
expat_external.h
iasciitab.h
internal.h
latin1tab.h
nametab.h
utf8tab.h
xmlrole.h
xmltok.h
xmltok_impl.h
)
if(WIN32)
target_compile_definitions(expat PRIVATE COMPILED_FROM_DSP XML_STATIC)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
target_compile_options(expat PRIVATE -Wno-unused-parameter)
endif()
-21
View File
@@ -1,21 +0,0 @@
Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
Copyright (c) 2001-2016 Expat maintainers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-146
View File
@@ -1,146 +0,0 @@
Expat, Release 2.2.0, stripped and modified for inclusion into Slic3r.
Only the library sources needed for static linking were left.
The original README follows:
---------------------------------------------------------------------
Expat, Release 2.2.0
This is Expat, a C library for parsing XML, written by James Clark.
Expat is a stream-oriented XML parser. This means that you register
handlers with the parser before starting the parse. These handlers
are called when the parser discovers the associated structures in the
document being parsed. A start tag is an example of the kind of
structures for which you may register handlers.
Windows users should use the expat_win32bin package, which includes
both precompiled libraries and executables, and source code for
developers.
Expat is free software. You may copy, distribute, and modify it under
the terms of the License contained in the file COPYING distributed
with this package. This license is the same as the MIT/X Consortium
license.
Versions of Expat that have an odd minor version (the middle number in
the release above), are development releases and should be considered
as beta software. Releases with even minor version numbers are
intended to be production grade software.
If you are building Expat from a check-out from the CVS repository,
you need to run a script that generates the configure script using the
GNU autoconf and libtool tools. To do this, you need to have
autoconf 2.58 or newer. Run the script like this:
./buildconf.sh
Once this has been done, follow the same instructions as for building
from a source distribution.
To build Expat from a source distribution, you first run the
configuration shell script in the top level distribution directory:
./configure
There are many options which you may provide to configure (which you
can discover by running configure with the --help option). But the
one of most interest is the one that sets the installation directory.
By default, the configure script will set things up to install
libexpat into /usr/local/lib, expat.h into /usr/local/include, and
xmlwf into /usr/local/bin. If, for example, you'd prefer to install
into /home/me/mystuff/lib, /home/me/mystuff/include, and
/home/me/mystuff/bin, you can tell configure about that with:
./configure --prefix=/home/me/mystuff
Another interesting option is to enable 64-bit integer support for
line and column numbers and the over-all byte index:
./configure CPPFLAGS=-DXML_LARGE_SIZE
However, such a modification would be a breaking change to the ABI
and is therefore not recommended for general use - e.g. as part of
a Linux distribution - but rather for builds with special requirements.
After running the configure script, the "make" command will build
things and "make install" will install things into their proper
location. Have a look at the "Makefile" to learn about additional
"make" options. Note that you need to have write permission into
the directories into which things will be installed.
If you are interested in building Expat to provide document
information in UTF-16 encoding rather than the default UTF-8, follow
these instructions (after having run "make distclean"):
1. For UTF-16 output as unsigned short (and version/error
strings as char), run:
./configure CPPFLAGS=-DXML_UNICODE
For UTF-16 output as wchar_t (incl. version/error strings),
run:
./configure CFLAGS="-g -O2 -fshort-wchar" \
CPPFLAGS=-DXML_UNICODE_WCHAR_T
2. Edit the MakeFile, changing:
LIBRARY = libexpat.la
to:
LIBRARY = libexpatw.la
(Note the additional "w" in the library name.)
3. Run "make buildlib" (which builds the library only).
Or, to save step 2, run "make buildlib LIBRARY=libexpatw.la".
4. Run "make installlib" (which installs the library only).
Or, if step 2 was omitted, run "make installlib LIBRARY=libexpatw.la".
Using DESTDIR or INSTALL_ROOT is enabled, with INSTALL_ROOT being the default
value for DESTDIR, and the rest of the make file using only DESTDIR.
It works as follows:
$ make install DESTDIR=/path/to/image
overrides the in-makefile set DESTDIR, while both
$ INSTALL_ROOT=/path/to/image make install
$ make install INSTALL_ROOT=/path/to/image
use DESTDIR=$(INSTALL_ROOT), even if DESTDIR eventually is defined in the
environment, because variable-setting priority is
1) commandline
2) in-makefile
3) environment
Note: This only applies to the Expat library itself, building UTF-16 versions
of xmlwf and the tests is currently not supported.
Note for Solaris users: The "ar" command is usually located in
"/usr/ccs/bin", which is not in the default PATH. You will need to
add this to your path for the "make" command, and probably also switch
to GNU make (the "make" found in /usr/ccs/bin does not seem to work
properly -- apparently it does not understand .PHONY directives). If
you're using ksh or bash, use this command to build:
PATH=/usr/ccs/bin:$PATH make
When using Expat with a project using autoconf for configuration, you
can use the probing macro in conftools/expat.m4 to determine how to
include Expat. See the comments at the top of that file for more
information.
A reference manual is available in the file doc/reference.html in this
distribution.
The homepage for this project is http://www.libexpat.org/. There
are links there to connect you to the bug reports page. If you need
to report a bug when you don't have access to a browser, you may also
send a bug report by email to expat-bugs@mail.libexpat.org.
Discussion related to the direction of future expat development takes
place on expat-discuss@mail.libexpat.org. Archives of this list and
other Expat-related lists may be found at:
http://mail.libexpat.org/mailman/listinfo/
-92
View File
@@ -1,92 +0,0 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#define ASCII_A 0x41
#define ASCII_B 0x42
#define ASCII_C 0x43
#define ASCII_D 0x44
#define ASCII_E 0x45
#define ASCII_F 0x46
#define ASCII_G 0x47
#define ASCII_H 0x48
#define ASCII_I 0x49
#define ASCII_J 0x4A
#define ASCII_K 0x4B
#define ASCII_L 0x4C
#define ASCII_M 0x4D
#define ASCII_N 0x4E
#define ASCII_O 0x4F
#define ASCII_P 0x50
#define ASCII_Q 0x51
#define ASCII_R 0x52
#define ASCII_S 0x53
#define ASCII_T 0x54
#define ASCII_U 0x55
#define ASCII_V 0x56
#define ASCII_W 0x57
#define ASCII_X 0x58
#define ASCII_Y 0x59
#define ASCII_Z 0x5A
#define ASCII_a 0x61
#define ASCII_b 0x62
#define ASCII_c 0x63
#define ASCII_d 0x64
#define ASCII_e 0x65
#define ASCII_f 0x66
#define ASCII_g 0x67
#define ASCII_h 0x68
#define ASCII_i 0x69
#define ASCII_j 0x6A
#define ASCII_k 0x6B
#define ASCII_l 0x6C
#define ASCII_m 0x6D
#define ASCII_n 0x6E
#define ASCII_o 0x6F
#define ASCII_p 0x70
#define ASCII_q 0x71
#define ASCII_r 0x72
#define ASCII_s 0x73
#define ASCII_t 0x74
#define ASCII_u 0x75
#define ASCII_v 0x76
#define ASCII_w 0x77
#define ASCII_x 0x78
#define ASCII_y 0x79
#define ASCII_z 0x7A
#define ASCII_0 0x30
#define ASCII_1 0x31
#define ASCII_2 0x32
#define ASCII_3 0x33
#define ASCII_4 0x34
#define ASCII_5 0x35
#define ASCII_6 0x36
#define ASCII_7 0x37
#define ASCII_8 0x38
#define ASCII_9 0x39
#define ASCII_TAB 0x09
#define ASCII_SPACE 0x20
#define ASCII_EXCL 0x21
#define ASCII_QUOT 0x22
#define ASCII_AMP 0x26
#define ASCII_APOS 0x27
#define ASCII_MINUS 0x2D
#define ASCII_PERIOD 0x2E
#define ASCII_COLON 0x3A
#define ASCII_SEMI 0x3B
#define ASCII_LT 0x3C
#define ASCII_EQUALS 0x3D
#define ASCII_GT 0x3E
#define ASCII_LSQB 0x5B
#define ASCII_RSQB 0x5D
#define ASCII_UNDERSCORE 0x5F
#define ASCII_LPAREN 0x28
#define ASCII_RPAREN 0x29
#define ASCII_FF 0x0C
#define ASCII_SLASH 0x2F
#define ASCII_HASH 0x23
#define ASCII_PIPE 0x7C
#define ASCII_COMMA 0x2C
-36
View File
@@ -1,36 +0,0 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
File diff suppressed because it is too large Load Diff
-33
View File
@@ -1,33 +0,0 @@
/*================================================================
** Copyright 2000, Clark Cooper
** All rights reserved.
**
** This is free software. You are permitted to copy, distribute, or modify
** it under the terms of the MIT/X license (contained in the COPYING file
** with this distribution.)
*/
#ifndef EXPATCONFIG_H
#define EXPATCONFIG_H
#include <memory.h>
#include <string.h>
#define XML_NS 1
#define XML_DTD 1
#define XML_CONTEXT_BYTES 1024
/* we will assume all Windows platforms are little endian */
#define BYTEORDER 1234
/* Windows has memmove() available. */
#define HAVE_MEMMOVE
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#else
#endif
#endif /* ifndef EXPATCONFIG_H */
-129
View File
@@ -1,129 +0,0 @@
/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#ifndef Expat_External_INCLUDED
#define Expat_External_INCLUDED 1
/* External API definitions */
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
#define XML_USE_MSC_EXTENSIONS 1
#endif
/* Expat tries very hard to make the API boundary very specifically
defined. There are two macros defined to control this boundary;
each of these can be defined before including this header to
achieve some different behavior, but doing so it not recommended or
tested frequently.
XMLCALL - The calling convention to use for all calls across the
"library boundary." This will default to cdecl, and
try really hard to tell the compiler that's what we
want.
XMLIMPORT - Whatever magic is needed to note that a function is
to be imported from a dynamically loaded library
(.dll, .so, or .sl, depending on your platform).
The XMLCALL macro was added in Expat 1.95.7. The only one which is
expected to be directly useful in client code is XMLCALL.
Note that on at least some Unix versions, the Expat library must be
compiled with the cdecl calling convention as the default since
system headers may assume the cdecl convention.
*/
#ifndef XMLCALL
#if defined(_MSC_VER)
#define XMLCALL __cdecl
#elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
#define XMLCALL __attribute__((cdecl))
#else
/* For any platform which uses this definition and supports more than
one calling convention, we need to extend this definition to
declare the convention used on that platform, if it's possible to
do so.
If this is the case for your platform, please file a bug report
with information on how to identify your platform via the C
pre-processor and how to specify the same calling convention as the
platform's malloc() implementation.
*/
#define XMLCALL
#endif
#endif /* not defined XMLCALL */
#if !defined(XML_STATIC) && !defined(XMLIMPORT)
#ifndef XML_BUILDING_EXPAT
/* using Expat from an application */
#ifdef XML_USE_MSC_EXTENSIONS
// #define XMLIMPORT __declspec(dllimport)
#endif
#endif
#endif /* not defined XML_STATIC */
#if !defined(XMLIMPORT) && defined(__GNUC__) && (__GNUC__ >= 4)
#define XMLIMPORT __attribute__ ((visibility ("default")))
#endif
/* If we didn't define it above, define it away: */
#ifndef XMLIMPORT
#define XMLIMPORT
#endif
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
#define XML_ATTR_MALLOC __attribute__((__malloc__))
#else
#define XML_ATTR_MALLOC
#endif
#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
#define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
#else
#define XML_ATTR_ALLOC_SIZE(x)
#endif
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
#ifdef __cplusplus
extern "C" {
#endif
#ifdef XML_UNICODE_WCHAR_T
#define XML_UNICODE
#endif
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
#ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
#else
typedef unsigned short XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE_WCHAR_T */
#else /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE */
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
typedef __int64 XML_Index;
typedef unsigned __int64 XML_Size;
#else
typedef long long XML_Index;
typedef unsigned long long XML_Size;
#endif
#else
typedef long XML_Index;
typedef unsigned long XML_Size;
#endif /* XML_LARGE_SIZE */
#ifdef __cplusplus
}
#endif
#endif /* not Expat_External_INCLUDED */
-37
View File
@@ -1,37 +0,0 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
-95
View File
@@ -1,95 +0,0 @@
/* internal.h
Internal definitions used by Expat. This is not needed to compile
client code.
The following calling convention macros are defined for frequently
called functions:
FASTCALL - Used for those internal functions that have a simple
body and a low number of arguments and local variables.
PTRCALL - Used for functions called though function pointers.
PTRFASTCALL - Like PTRCALL, but for low number of arguments.
inline - Used for selected internal functions for which inlining
may improve performance on some platforms.
Note: Use of these macros is based on judgement, not hard rules,
and therefore subject to change.
*/
#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__)
/* We'll use this version by default only where we know it helps.
regparm() generates warnings on Solaris boxes. See SF bug #692878.
Instability reported with egcs on a RedHat Linux 7.3.
Let's comment out:
#define FASTCALL __attribute__((stdcall, regparm(3)))
and let's try this:
*/
#define FASTCALL __attribute__((regparm(3)))
#define PTRFASTCALL __attribute__((regparm(3)))
#endif
/* Using __fastcall seems to have an unexpected negative effect under
MS VC++, especially for function pointers, so we won't use it for
now on that platform. It may be reconsidered for a future release
if it can be made more effective.
Likely reason: __fastcall on Windows is like stdcall, therefore
the compiler cannot perform stack optimizations for call clusters.
*/
/* Make sure all of these are defined if they aren't already. */
#ifndef FASTCALL
#define FASTCALL
#endif
#ifndef PTRCALL
#define PTRCALL
#endif
#ifndef PTRFASTCALL
#define PTRFASTCALL
#endif
#ifndef XML_MIN_SIZE
#if !defined(__cplusplus) && !defined(inline)
#ifdef __GNUC__
#define inline __inline
#endif /* __GNUC__ */
#endif
#endif /* XML_MIN_SIZE */
#ifdef __cplusplus
#define inline inline
#else
#ifndef inline
#define inline
#endif
#endif
#ifndef UNUSED_P
# ifdef __GNUC__
# define UNUSED_P(p) UNUSED_ ## p __attribute__((__unused__))
# else
# define UNUSED_P(p) UNUSED_ ## p
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
void
align_limit_to_full_utf8_characters(const char * from, const char ** fromLimRef);
#ifdef __cplusplus
}
#endif
-36
View File
@@ -1,36 +0,0 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
-150
View File
@@ -1,150 +0,0 @@
static const unsigned namingBitmap[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE,
0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF,
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF,
0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000,
0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003,
0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003,
0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001,
0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003,
0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003,
0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003,
0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000,
0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF,
0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB,
0x40000000, 0xF580C900, 0x00000007, 0x02010800,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF,
0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
0x00000000, 0x00004C40, 0x00000000, 0x00000000,
0x00000007, 0x00000000, 0x00000000, 0x00000000,
0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF,
0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF,
0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF,
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003,
0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF,
0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF,
0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF,
0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0,
0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3,
0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80,
0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3,
0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000,
0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000,
0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF,
0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF,
};
static const unsigned char nmstrtPages[] = {
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00,
0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static const unsigned char namePages[] = {
0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00,
0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-37
View File
@@ -1,37 +0,0 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-114
View File
@@ -1,114 +0,0 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#ifndef XmlRole_INCLUDED
#define XmlRole_INCLUDED 1
#ifdef __VMS
/* 0 1 2 3 0 1 2 3
1234567890123456789012345678901 1234567890123456789012345678901 */
#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt
#endif
#include "xmltok.h"
#ifdef __cplusplus
extern "C" {
#endif
enum {
XML_ROLE_ERROR = -1,
XML_ROLE_NONE = 0,
XML_ROLE_XML_DECL,
XML_ROLE_INSTANCE_START,
XML_ROLE_DOCTYPE_NONE,
XML_ROLE_DOCTYPE_NAME,
XML_ROLE_DOCTYPE_SYSTEM_ID,
XML_ROLE_DOCTYPE_PUBLIC_ID,
XML_ROLE_DOCTYPE_INTERNAL_SUBSET,
XML_ROLE_DOCTYPE_CLOSE,
XML_ROLE_GENERAL_ENTITY_NAME,
XML_ROLE_PARAM_ENTITY_NAME,
XML_ROLE_ENTITY_NONE,
XML_ROLE_ENTITY_VALUE,
XML_ROLE_ENTITY_SYSTEM_ID,
XML_ROLE_ENTITY_PUBLIC_ID,
XML_ROLE_ENTITY_COMPLETE,
XML_ROLE_ENTITY_NOTATION_NAME,
XML_ROLE_NOTATION_NONE,
XML_ROLE_NOTATION_NAME,
XML_ROLE_NOTATION_SYSTEM_ID,
XML_ROLE_NOTATION_NO_SYSTEM_ID,
XML_ROLE_NOTATION_PUBLIC_ID,
XML_ROLE_ATTRIBUTE_NAME,
XML_ROLE_ATTRIBUTE_TYPE_CDATA,
XML_ROLE_ATTRIBUTE_TYPE_ID,
XML_ROLE_ATTRIBUTE_TYPE_IDREF,
XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
XML_ROLE_ATTRIBUTE_ENUM_VALUE,
XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
XML_ROLE_ATTLIST_NONE,
XML_ROLE_ATTLIST_ELEMENT_NAME,
XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
XML_ROLE_FIXED_ATTRIBUTE_VALUE,
XML_ROLE_ELEMENT_NONE,
XML_ROLE_ELEMENT_NAME,
XML_ROLE_CONTENT_ANY,
XML_ROLE_CONTENT_EMPTY,
XML_ROLE_CONTENT_PCDATA,
XML_ROLE_GROUP_OPEN,
XML_ROLE_GROUP_CLOSE,
XML_ROLE_GROUP_CLOSE_REP,
XML_ROLE_GROUP_CLOSE_OPT,
XML_ROLE_GROUP_CLOSE_PLUS,
XML_ROLE_GROUP_CHOICE,
XML_ROLE_GROUP_SEQUENCE,
XML_ROLE_CONTENT_ELEMENT,
XML_ROLE_CONTENT_ELEMENT_REP,
XML_ROLE_CONTENT_ELEMENT_OPT,
XML_ROLE_CONTENT_ELEMENT_PLUS,
XML_ROLE_PI,
XML_ROLE_COMMENT,
#ifdef XML_DTD
XML_ROLE_TEXT_DECL,
XML_ROLE_IGNORE_SECT,
XML_ROLE_INNER_PARAM_ENTITY_REF,
#endif /* XML_DTD */
XML_ROLE_PARAM_ENTITY_REF
};
typedef struct prolog_state {
int (PTRCALL *handler) (struct prolog_state *state,
int tok,
const char *ptr,
const char *end,
const ENCODING *enc);
unsigned level;
int role_none;
#ifdef XML_DTD
unsigned includeLevel;
int documentEntity;
int inEntityValue;
#endif /* XML_DTD */
} PROLOG_STATE;
void XmlPrologStateInit(PROLOG_STATE *);
#ifdef XML_DTD
void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
#endif /* XML_DTD */
#define XmlTokenRole(state, tok, ptr, end, enc) \
(((state)->handler)(state, tok, ptr, end, enc))
#ifdef __cplusplus
}
#endif
#endif /* not XmlRole_INCLUDED */
File diff suppressed because it is too large Load Diff
-322
View File
@@ -1,322 +0,0 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#ifndef XmlTok_INCLUDED
#define XmlTok_INCLUDED 1
#ifdef __cplusplus
extern "C" {
#endif
/* The following token may be returned by XmlContentTok */
#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be
start of illegal ]]> sequence */
/* The following tokens may be returned by both XmlPrologTok and
XmlContentTok.
*/
#define XML_TOK_NONE -4 /* The string to be scanned is empty */
#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan;
might be part of CRLF sequence */
#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
#define XML_TOK_PARTIAL -1 /* only part of a token */
#define XML_TOK_INVALID 0
/* The following tokens are returned by XmlContentTok; some are also
returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok.
*/
#define XML_TOK_START_TAG_WITH_ATTS 1
#define XML_TOK_START_TAG_NO_ATTS 2
#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
#define XML_TOK_END_TAG 5
#define XML_TOK_DATA_CHARS 6
#define XML_TOK_DATA_NEWLINE 7
#define XML_TOK_CDATA_SECT_OPEN 8
#define XML_TOK_ENTITY_REF 9
#define XML_TOK_CHAR_REF 10 /* numeric character reference */
/* The following tokens may be returned by both XmlPrologTok and
XmlContentTok.
*/
#define XML_TOK_PI 11 /* processing instruction */
#define XML_TOK_XML_DECL 12 /* XML decl or text decl */
#define XML_TOK_COMMENT 13
#define XML_TOK_BOM 14 /* Byte order mark */
/* The following tokens are returned only by XmlPrologTok */
#define XML_TOK_PROLOG_S 15
#define XML_TOK_DECL_OPEN 16 /* <!foo */
#define XML_TOK_DECL_CLOSE 17 /* > */
#define XML_TOK_NAME 18
#define XML_TOK_NMTOKEN 19
#define XML_TOK_POUND_NAME 20 /* #name */
#define XML_TOK_OR 21 /* | */
#define XML_TOK_PERCENT 22
#define XML_TOK_OPEN_PAREN 23
#define XML_TOK_CLOSE_PAREN 24
#define XML_TOK_OPEN_BRACKET 25
#define XML_TOK_CLOSE_BRACKET 26
#define XML_TOK_LITERAL 27
#define XML_TOK_PARAM_ENTITY_REF 28
#define XML_TOK_INSTANCE_START 29
/* The following occur only in element type declarations */
#define XML_TOK_NAME_QUESTION 30 /* name? */
#define XML_TOK_NAME_ASTERISK 31 /* name* */
#define XML_TOK_NAME_PLUS 32 /* name+ */
#define XML_TOK_COND_SECT_OPEN 33 /* <![ */
#define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
#define XML_TOK_COMMA 38
/* The following token is returned only by XmlAttributeValueTok */
#define XML_TOK_ATTRIBUTE_VALUE_S 39
/* The following token is returned only by XmlCdataSectionTok */
#define XML_TOK_CDATA_SECT_CLOSE 40
/* With namespace processing this is returned by XmlPrologTok for a
name with a colon.
*/
#define XML_TOK_PREFIXED_NAME 41
#ifdef XML_DTD
#define XML_TOK_IGNORE_SECT 42
#endif /* XML_DTD */
#ifdef XML_DTD
#define XML_N_STATES 4
#else /* not XML_DTD */
#define XML_N_STATES 3
#endif /* not XML_DTD */
#define XML_PROLOG_STATE 0
#define XML_CONTENT_STATE 1
#define XML_CDATA_SECTION_STATE 2
#ifdef XML_DTD
#define XML_IGNORE_SECTION_STATE 3
#endif /* XML_DTD */
#define XML_N_LITERAL_TYPES 2
#define XML_ATTRIBUTE_VALUE_LITERAL 0
#define XML_ENTITY_VALUE_LITERAL 1
/* The size of the buffer passed to XmlUtf8Encode must be at least this. */
#define XML_UTF8_ENCODE_MAX 4
/* The size of the buffer passed to XmlUtf16Encode must be at least this. */
#define XML_UTF16_ENCODE_MAX 2
typedef struct position {
/* first line and first column are 0 not 1 */
XML_Size lineNumber;
XML_Size columnNumber;
} POSITION;
typedef struct {
const char *name;
const char *valuePtr;
const char *valueEnd;
char normalized;
} ATTRIBUTE;
struct encoding;
typedef struct encoding ENCODING;
typedef int (PTRCALL *SCANNER)(const ENCODING *,
const char *,
const char *,
const char **);
enum XML_Convert_Result {
XML_CONVERT_COMPLETED = 0,
XML_CONVERT_INPUT_INCOMPLETE = 1,
XML_CONVERT_OUTPUT_EXHAUSTED = 2 /* and therefore potentially input remaining as well */
};
struct encoding {
SCANNER scanners[XML_N_STATES];
SCANNER literalScanners[XML_N_LITERAL_TYPES];
int (PTRCALL *sameName)(const ENCODING *,
const char *,
const char *);
int (PTRCALL *nameMatchesAscii)(const ENCODING *,
const char *,
const char *,
const char *);
int (PTRFASTCALL *nameLength)(const ENCODING *, const char *);
const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *);
int (PTRCALL *getAtts)(const ENCODING *enc,
const char *ptr,
int attsMax,
ATTRIBUTE *atts);
int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
int (PTRCALL *predefinedEntityName)(const ENCODING *,
const char *,
const char *);
void (PTRCALL *updatePosition)(const ENCODING *,
const char *ptr,
const char *end,
POSITION *);
int (PTRCALL *isPublicId)(const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr);
enum XML_Convert_Result (PTRCALL *utf8Convert)(const ENCODING *enc,
const char **fromP,
const char *fromLim,
char **toP,
const char *toLim);
enum XML_Convert_Result (PTRCALL *utf16Convert)(const ENCODING *enc,
const char **fromP,
const char *fromLim,
unsigned short **toP,
const unsigned short *toLim);
int minBytesPerChar;
char isUtf8;
char isUtf16;
};
/* Scan the string starting at ptr until the end of the next complete
token, but do not scan past eptr. Return an integer giving the
type of token.
Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
Return XML_TOK_PARTIAL when the string does not contain a complete
token; nextTokPtr will not be set.
Return XML_TOK_INVALID when the string does not start a valid
token; nextTokPtr will be set to point to the character which made
the token invalid.
Otherwise the string starts with a valid token; nextTokPtr will be
set to point to the character following the end of that token.
Each data character counts as a single token, but adjacent data
characters may be returned together. Similarly for characters in
the prolog outside literals, comments and processing instructions.
*/
#define XmlTok(enc, state, ptr, end, nextTokPtr) \
(((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
#define XmlContentTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
#ifdef XML_DTD
#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
#endif /* XML_DTD */
/* This is used for performing a 2nd-level tokenization on the content
of a literal that has already been returned by XmlTok.
*/
#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
(((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2))
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
(((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
#define XmlNameLength(enc, ptr) \
(((enc)->nameLength)(enc, ptr))
#define XmlSkipS(enc, ptr) \
(((enc)->skipS)(enc, ptr))
#define XmlGetAttributes(enc, ptr, attsMax, atts) \
(((enc)->getAtts)(enc, ptr, attsMax, atts))
#define XmlCharRefNumber(enc, ptr) \
(((enc)->charRefNumber)(enc, ptr))
#define XmlPredefinedEntityName(enc, ptr, end) \
(((enc)->predefinedEntityName)(enc, ptr, end))
#define XmlUpdatePosition(enc, ptr, end, pos) \
(((enc)->updatePosition)(enc, ptr, end, pos))
#define XmlIsPublicId(enc, ptr, end, badPtr) \
(((enc)->isPublicId)(enc, ptr, end, badPtr))
#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
(((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
(((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
typedef struct {
ENCODING initEnc;
const ENCODING **encPtr;
} INIT_ENCODING;
int XmlParseXmlDecl(int isGeneralTextEntity,
const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr,
const char **versionPtr,
const char **versionEndPtr,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr,
int *standalonePtr);
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
const ENCODING *XmlGetUtf8InternalEncoding(void);
const ENCODING *XmlGetUtf16InternalEncoding(void);
int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
int XmlSizeOfUnknownEncoding(void);
typedef int (XMLCALL *CONVERTER) (void *userData, const char *p);
ENCODING *
XmlInitUnknownEncoding(void *mem,
int *table,
CONVERTER convert,
void *userData);
int XmlParseXmlDeclNS(int isGeneralTextEntity,
const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr,
const char **versionPtr,
const char **versionEndPtr,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr,
int *standalonePtr);
int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
const ENCODING *XmlGetUtf8InternalEncodingNS(void);
const ENCODING *XmlGetUtf16InternalEncodingNS(void);
ENCODING *
XmlInitUnknownEncodingNS(void *mem,
int *table,
CONVERTER convert,
void *userData);
#ifdef __cplusplus
}
#endif
#endif /* not XmlTok_INCLUDED */
-46
View File
@@ -1,46 +0,0 @@
/*
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
enum {
BT_NONXML,
BT_MALFORM,
BT_LT,
BT_AMP,
BT_RSQB,
BT_LEAD2,
BT_LEAD3,
BT_LEAD4,
BT_TRAIL,
BT_CR,
BT_LF,
BT_GT,
BT_QUOT,
BT_APOS,
BT_EQUALS,
BT_QUEST,
BT_EXCL,
BT_SOL,
BT_SEMI,
BT_NUM,
BT_LSQB,
BT_S,
BT_NMSTRT,
BT_COLON,
BT_HEX,
BT_DIGIT,
BT_NAME,
BT_MINUS,
BT_OTHER, /* known not to be a name or name start character */
BT_NONASCII, /* might be a name or name start character */
BT_PERCNT,
BT_LPAR,
BT_RPAR,
BT_AST,
BT_PLUS,
BT_COMMA,
BT_VERBAR
};
#include <stddef.h>
File diff suppressed because it is too large Load Diff
-115
View File
@@ -1,115 +0,0 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* This file is included! */
#ifdef XML_TOK_NS_C
const ENCODING *
NS(XmlGetUtf8InternalEncoding)(void)
{
return &ns(internal_utf8_encoding).enc;
}
const ENCODING *
NS(XmlGetUtf16InternalEncoding)(void)
{
#if BYTEORDER == 1234
return &ns(internal_little2_encoding).enc;
#elif BYTEORDER == 4321
return &ns(internal_big2_encoding).enc;
#else
const short n = 1;
return (*(const char *)&n
? &ns(internal_little2_encoding).enc
: &ns(internal_big2_encoding).enc);
#endif
}
static const ENCODING * const NS(encodings)[] = {
&ns(latin1_encoding).enc,
&ns(ascii_encoding).enc,
&ns(utf8_encoding).enc,
&ns(big2_encoding).enc,
&ns(big2_encoding).enc,
&ns(little2_encoding).enc,
&ns(utf8_encoding).enc /* NO_ENC */
};
static int PTRCALL
NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
return initScan(NS(encodings), (const INIT_ENCODING *)enc,
XML_PROLOG_STATE, ptr, end, nextTokPtr);
}
static int PTRCALL
NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
return initScan(NS(encodings), (const INIT_ENCODING *)enc,
XML_CONTENT_STATE, ptr, end, nextTokPtr);
}
int
NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
const char *name)
{
int i = getEncodingIndex(name);
if (i == UNKNOWN_ENC)
return 0;
SET_INIT_ENC_INDEX(p, i);
p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
p->initEnc.updatePosition = initUpdatePosition;
p->encPtr = encPtr;
*encPtr = &(p->initEnc);
return 1;
}
static const ENCODING *
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
{
#define ENCODING_MAX 128
char buf[ENCODING_MAX];
char *p = buf;
int i;
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
if (ptr != end)
return 0;
*p = 0;
if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
return enc;
i = getEncodingIndex(buf);
if (i == UNKNOWN_ENC)
return 0;
return NS(encodings)[i];
}
int
NS(XmlParseXmlDecl)(int isGeneralTextEntity,
const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr,
const char **versionPtr,
const char **versionEndPtr,
const char **encodingName,
const ENCODING **encoding,
int *standalone)
{
return doParseXmlDecl(NS(findEncoding),
isGeneralTextEntity,
enc,
ptr,
end,
badPtr,
versionPtr,
versionEndPtr,
encodingName,
encoding,
standalone);
}
#endif /* XML_TOK_NS_C */
+13
View File
@@ -3073,6 +3073,19 @@ namespace IMGUIZMO_NAMESPACE
}
isInside = gContext.mbMouseOver && ImRect(position, position + size).Contains(io.MousePos);
// The navigator is drawn into the NoInputs "gizmo" window, so ImGui never owns the press
// (mouse_avail_to_imgui is false) and WantCaptureMouse only reflects what the previous frame asked
// for. Hold the capture for the whole gesture, otherwise a still frame drops it and the next motion
// event reaches the canvas, which adopts it as a camera drag.
if ((isClicking || isDraging) && io.MouseDown[0])
{
#if IMGUI_VERSION_NUM >= 18723
ImGui::SetNextFrameWantCaptureMouse(true);
#else
ImGui::CaptureMouseFromApp();
#endif
}
if (io.MouseDown[0] && (fabsf(io.MouseDelta[0]) || fabsf(io.MouseDelta[1])) && isClicking)
{
isClicking = false;
@@ -0,0 +1,545 @@
--- a/miniz.h
+++ b/miniz.h
@@ -1117,6 +1117,9 @@
/* MZ_TRUE if the file is not encrypted, a patch file, and if it uses a compression method we support. */
mz_bool m_is_supported;
+ // BBS
+ mz_bool m_is_utf8;
+
/* Filename. If string ends in '/' it's a subdirectory entry. */
/* Guaranteed to be zero terminated, may be truncated to fit. */
char m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE];
@@ -1327,6 +1330,8 @@
/* Retrieves the filename of an archive file entry. */
/* Returns the number of bytes written to pFilename, or if filename_buf_size is 0 this function returns the number of bytes needed to fully store the filename. */
MINIZ_EXPORT mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size);
+ // BBS
+ MINIZ_EXPORT mz_uint mz_zip_reader_get_extra(mz_zip_archive *pZip, mz_uint file_index, char *pExtra, mz_uint extra_buf_size);
/* Attempts to locates a file in the archive's central directory. */
/* Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH */
@@ -1334,6 +1339,9 @@
MINIZ_EXPORT int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags);
MINIZ_EXPORT mz_bool mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *file_index);
+ /* Retrieves the filename of an archive file entry from EXTRA ID. */
+ MINIZ_EXPORT mz_uint mz_zip_reader_get_filename_from_extra(mz_zip_archive *pZip, mz_uint file_index, char *buffer, mz_uint extra_buf_size);
+
/* Returns detailed information about an archive file entry. */
MINIZ_EXPORT mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat);
@@ -1450,6 +1458,62 @@
mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, const char *user_extra_data_local, mz_uint user_extra_data_local_len,
const char *user_extra_data_central, mz_uint user_extra_data_central_len);
+ /* PrusaSlicer: streaming writer that does not need the entry size up front (derived from mz_zip_writer_add_read_buf_callback). */
+#define MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE (sizeof(mz_uint16) * 2 + sizeof(mz_uint64) * 3)
+
+typedef struct
+{
+ mz_zip_archive* m_pZip;
+ mz_uint64 m_cur_archive_file_ofs;
+ mz_uint64 m_comp_size;
+} mz_zip_writer_add_state;
+
+typedef struct mz_zip_writer_staged_context
+{
+ mz_zip_archive *pZip;
+
+ mz_uint16 gen_flags;
+ mz_uint uncomp_crc32;
+ mz_uint16 method;
+ mz_uint16 dos_time;
+ mz_uint16 dos_date;
+ mz_uint16 ext_attributes;
+ mz_uint64 local_dir_header_ofs;
+ mz_uint64 cur_archive_file_ofs;
+ size_t archive_name_size;
+ mz_uint64 uncomp_size;
+ mz_uint64 comp_size;
+ mz_uint64 max_size;
+ mz_uint8 *pExtra_data;
+ mz_uint32 extra_size;
+ mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE];
+
+ /*
+ * Compressor context
+ */
+ mz_zip_writer_add_state add_state;
+ tdefl_compressor *pCompressor;
+ mz_uint64 file_ofs;
+
+ /*
+ * The following data is passed to the "finish" stage, the referenced pointers must still be valid!
+ */
+ const char* pArchive_name;
+ const void* pComment;
+ mz_uint16 comment_size;
+ const char* user_extra_data_central;
+ mz_uint user_extra_data_central_len;
+} mz_zip_writer_staged_context;
+
+/* Adds a file to an archive piecewise. Minimum size of the raw data is 4 bytes. */
+/* Don't call mz_zip_writer_add_staged_finish() if mz_zip_writer_add_staged_open() or mz_zip_writer_add_staged_data() fails. */
+mz_bool mz_zip_writer_add_staged_open(mz_zip_archive* pZip, mz_zip_writer_staged_context* pContext, const char* pArchive_name,
+ mz_uint64 max_size, const MZ_TIME_T* pFile_time, const void* pComment, mz_uint16 comment_size, mz_uint level_and_flags,
+ const char* user_extra_data, mz_uint user_extra_data_len, const char* user_extra_data_central, mz_uint user_extra_data_central_len);
+mz_bool mz_zip_writer_add_staged_data(mz_zip_writer_staged_context* pContext, const char* pRead_buf, size_t n);
+mz_bool mz_zip_writer_add_staged_finish(mz_zip_writer_staged_context* pContext);
+
+
/* Adds the contents of a file to an archive. This function also records the disk file's modified time into the archive. */
/* File data is supplied via a read callback function. User mz_zip_writer_add_(c)file to add a file directly.*/
MINIZ_EXPORT mz_bool mz_zip_writer_add_read_buf_callback(mz_zip_archive *pZip, const char *pArchive_name, mz_file_read_func read_callback, void *callback_opaque, mz_uint64 max_size,
@@ -1460,6 +1524,9 @@
/* Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. */
/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */
MINIZ_EXPORT mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags);
+ // BBS: support storage path with unicode path extra
+ MINIZ_EXPORT mz_bool mz_zip_writer_add_file_ex(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
+ const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len);
/* Like mz_zip_writer_add_file(), except the file data is read from the specified FILE stream. */
MINIZ_EXPORT mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 max_size,
--- a/miniz.c
+++ b/miniz.c
@@ -4350,6 +4350,8 @@
pStat->m_is_directory = mz_zip_reader_is_file_a_directory(pZip, file_index);
pStat->m_is_encrypted = mz_zip_reader_is_file_encrypted(pZip, file_index);
pStat->m_is_supported = mz_zip_reader_is_file_supported(pZip, file_index);
+ // BBS
+ pStat->m_is_utf8 = pStat->m_bit_flag & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;
/* See if we need to read any zip64 extended information fields. */
/* Confusingly, these zip64 fields can be present even on non-zip64 archives (Debian zip on a huge files from stdin piped to stdout creates them). */
@@ -6110,13 +6112,6 @@
return mz_zip_writer_add_mem_ex(pZip, pArchive_name, pBuf, buf_size, NULL, 0, level_and_flags, 0, 0);
}
- typedef struct
- {
- mz_zip_archive *m_pZip;
- mz_uint64 m_cur_archive_file_ofs;
- mz_uint64 m_comp_size;
- } mz_zip_writer_add_state;
-
static mz_bool mz_zip_writer_add_put_buf_callback(const void *pBuf, int len, void *pUser)
{
mz_zip_writer_add_state *pState = (mz_zip_writer_add_state *)pUser;
@@ -6129,7 +6124,6 @@
}
#define MZ_ZIP64_MAX_LOCAL_EXTRA_FIELD_SIZE (sizeof(mz_uint16) * 2 + sizeof(mz_uint64) * 2)
-#define MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE (sizeof(mz_uint16) * 2 + sizeof(mz_uint64) * 3)
static mz_uint32 mz_zip_writer_create_zip64_extra_data(mz_uint8 *pBuf, mz_uint64 *pUncomp_size, mz_uint64 *pComp_size, mz_uint64 *pLocal_header_ofs)
{
mz_uint8 *pDst = pBuf;
@@ -6168,16 +6162,17 @@
static mz_bool mz_zip_writer_create_local_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst, mz_uint16 filename_size, mz_uint16 extra_size, mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date)
{
(void)pZip;
+ mz_bool is_zip64_needed = uncomp_size >= MZ_UINT32_MAX || comp_size >= MZ_UINT32_MAX;
memset(pDst, 0, MZ_ZIP_LOCAL_DIR_HEADER_SIZE);
MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_SIG_OFS, MZ_ZIP_LOCAL_DIR_HEADER_SIG);
- MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, method ? 20 : 0);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, is_zip64_needed ? 0x002D : (method ? 0x0014 : 0x0000));
MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_BIT_FLAG_OFS, bit_flags);
MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_METHOD_OFS, method);
MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_TIME_OFS, dos_time);
MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_DATE_OFS, dos_date);
MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_CRC32_OFS, uncomp_crc32);
- MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
- MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
+ MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, is_zip64_needed ? MZ_UINT32_MAX : comp_size);
+ MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, is_zip64_needed ? MZ_UINT32_MAX : uncomp_size);
MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILENAME_LEN_OFS, filename_size);
MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_EXTRA_LEN_OFS, extra_size);
return MZ_TRUE;
@@ -6190,9 +6185,11 @@
mz_uint64 local_header_ofs, mz_uint32 ext_attributes)
{
(void)pZip;
+ mz_bool is_zip64_needed = uncomp_size >= MZ_UINT32_MAX || comp_size >= MZ_UINT32_MAX;
memset(pDst, 0, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE);
MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_SIG_OFS, MZ_ZIP_CENTRAL_DIR_HEADER_SIG);
- MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0);
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_MADE_BY_OFS, is_zip64_needed ? 0x002D : (method ? 0x0014 : 0x0000));
+ MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, is_zip64_needed ? 0x002D : (method ? 0x0014 : 0x0000));
MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_BIT_FLAG_OFS, bit_flags);
MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_METHOD_OFS, method);
MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_TIME_OFS, dos_time);
@@ -6956,8 +6953,302 @@
user_extra_data, user_extra_data_len, user_extra_data_central, user_extra_data_central_len);
}
+static mz_uint32 mz_zip_writer_preallocate_extra_data(mz_uint8 *pBuf, mz_uint32 extra_data_size)
+{
+ mz_uint8 *pDst = pBuf;
+ MZ_WRITE_LE16(pDst + 0, 0x9999);
+ MZ_WRITE_LE16(pDst + 2, extra_data_size);
+ memset(pDst + 4, 0, extra_data_size);
+ return 2 * sizeof(mz_uint16) + extra_data_size;
+}
+
+mz_bool mz_zip_writer_add_staged_open(mz_zip_archive* pZip, mz_zip_writer_staged_context* pContext, const char* pArchive_name, mz_uint64 max_size, const MZ_TIME_T* pFile_time, const void* pComment, mz_uint16 comment_size, mz_uint level_and_flags,
+ const char* user_extra_data, mz_uint user_extra_data_len, const char* user_extra_data_central, mz_uint user_extra_data_central_len)
+{
+ mz_uint level, num_alignment_padding_bytes;
+ mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE];
+ mz_zip_internal_state* pState;
+
+ memset(pContext, 0, sizeof(mz_zip_writer_staged_context));
+ pContext->pZip = pZip;
+ pContext->gen_flags = MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;
+ pContext->uncomp_crc32 = MZ_CRC32_INIT;
+ pContext->method = MZ_DEFLATED;
+ pContext->cur_archive_file_ofs = pZip->m_archive_size;
+ pContext->max_size = max_size;
+ pContext->pArchive_name = pArchive_name;
+ pContext->pComment = pComment;
+ pContext->comment_size = comment_size;
+ pContext->user_extra_data_central = user_extra_data_central;
+ pContext->user_extra_data_central_len = user_extra_data_central_len;
+
+ if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
+ pContext->gen_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;
+
+ if ((int)level_and_flags < 0)
+ level_and_flags = MZ_DEFAULT_LEVEL;
+ level = level_and_flags & 0xF;
+
+ /* Sanity checks */
+ if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level == 0) || (level > MZ_UBER_COMPRESSION) || (max_size < 4))
+ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
+
+ pState = pZip->m_pState;
+
+ /* We could support this, but why? */
+ if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)
+ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
+
+ if (!mz_zip_writer_validate_archive_name(pArchive_name))
+ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME);
+
+ if (pState->m_zip64)
+ {
+ if (pZip->m_total_files == MZ_UINT32_MAX)
+ return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
+ }
+ else
+ {
+ if (pZip->m_total_files == MZ_UINT16_MAX)
+ {
+ pState->m_zip64 = MZ_TRUE;
+ /*return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); */
+ }
+ }
+
+ pContext->archive_name_size = strlen(pArchive_name);
+ if (pContext->archive_name_size > MZ_UINT16_MAX)
+ return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME);
+
+ num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip);
+
+ /* miniz doesn't support central dirs >= MZ_UINT32_MAX bytes yet */
+ if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + pContext->archive_name_size + MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE + comment_size) >= MZ_UINT32_MAX)
+ return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);
+
+ if (!pState->m_zip64)
+ {
+ /* Bail early if the archive would obviously become too large */
+ if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + pContext->archive_name_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE
+ + pContext->archive_name_size + comment_size + user_extra_data_len + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + 1024
+ + MZ_ZIP_DATA_DESCRIPTER_SIZE32 + user_extra_data_central_len) > 0xFFFFFFFF)
+ {
+ pState->m_zip64 = MZ_TRUE;
+ /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
+ }
+ }
+
+#ifndef MINIZ_NO_TIME
+ if (pFile_time)
+ {
+ mz_zip_time_t_to_dos_time(*pFile_time, &pContext->dos_time, &pContext->dos_date);
+ }
+ else
+ {
+ MZ_TIME_T cur_time;
+ time(&cur_time);
+ mz_zip_time_t_to_dos_time(cur_time, &pContext->dos_time, &pContext->dos_date);
+ }
+#endif
+
+ if (!mz_zip_writer_write_zeros(pZip, pContext->cur_archive_file_ofs, num_alignment_padding_bytes))
+ {
+ return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
+ }
+
+ pContext->cur_archive_file_ofs += num_alignment_padding_bytes;
+ pContext->local_dir_header_ofs = pContext->cur_archive_file_ofs;
+
+ if (pZip->m_file_offset_alignment)
+ {
+ MZ_ASSERT((pContext->cur_archive_file_ofs & (pZip->m_file_offset_alignment - 1)) == 0);
+ }
+
+ if (!pState->m_zip64 && (pContext->local_dir_header_ofs >= MZ_UINT32_MAX)) {
+ pState->m_zip64 = MZ_TRUE;
+ /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
+ }
+
+ MZ_CLEAR_OBJ(local_dir_header);
+ if (max_size > MZ_UINT32_MAX)
+ {
+ pContext->pExtra_data = pContext->extra_data;
+ pContext->extra_size = mz_zip_writer_preallocate_extra_data(pContext->extra_data, 2 * sizeof(mz_uint64));
+ }
+
+ if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)pContext->archive_name_size, (mz_uint16)(pContext->extra_size + user_extra_data_len), 0, 0, 0, pContext->method, pContext->gen_flags, pContext->dos_time, pContext->dos_date))
+ return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
+
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, pContext->cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
+ return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
+
+ pContext->cur_archive_file_ofs += sizeof(local_dir_header);
+
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, pContext->cur_archive_file_ofs, pArchive_name, pContext->archive_name_size) != pContext->archive_name_size)
+ {
+ return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
+ }
+
+ pContext->cur_archive_file_ofs += pContext->archive_name_size;
+
+ if (pState->m_zip64 || max_size >= MZ_UINT32_MAX) {
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, pContext->cur_archive_file_ofs, pContext->extra_data, pContext->extra_size) != pContext->extra_size)
+ return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
+
+ pContext->cur_archive_file_ofs += pContext->extra_size;
+ }
+
+ if (user_extra_data_len > 0)
+ {
+ if (pZip->m_pWrite(pZip->m_pIO_opaque, pContext->cur_archive_file_ofs, user_extra_data, user_extra_data_len) != user_extra_data_len)
+ return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
+
+ pContext->cur_archive_file_ofs += user_extra_data_len;
+ }
+
+ assert(max_size);
+ assert(level);
+
+ pContext->pCompressor = (tdefl_compressor*)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor));
+ if (!pContext->pCompressor)
+ {
+ return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
+ }
+
+ pContext->add_state.m_pZip = pZip;
+ pContext->add_state.m_cur_archive_file_ofs = pContext->cur_archive_file_ofs;
+ pContext->add_state.m_comp_size = 0;
+
+ if (tdefl_init(pContext->pCompressor, mz_zip_writer_add_put_buf_callback, &pContext->add_state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY)
+ {
+ pZip->m_pFree(pZip->m_pAlloc_opaque, pContext->pCompressor);
+ return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
+ }
+
+ return MZ_TRUE;
+}
+
+mz_bool mz_zip_writer_add_staged_data(mz_zip_writer_staged_context *pContext, const char *pRead_buf, size_t n)
+{
+ tdefl_flush flush = TDEFL_NO_FLUSH;
+
+ if (pContext->file_ofs + n > pContext->max_size)
+ {
+ mz_zip_set_error(pContext->pZip, MZ_ZIP_FILE_READ_FAILED);
+ pContext->pZip->m_pFree(pContext->pZip->m_pAlloc_opaque, pContext->pCompressor);
+ pContext->pCompressor = NULL;
+ return MZ_FALSE;
+ }
+
+ pContext->file_ofs += n;
+ pContext->uncomp_crc32 = (mz_uint32)mz_crc32(pContext->uncomp_crc32, (const mz_uint8 *)pRead_buf, n);
+
+ if (pContext->pZip->m_pNeeds_keepalive != NULL && pContext->pZip->m_pNeeds_keepalive(pContext->pZip->m_pIO_opaque))
+ flush = TDEFL_FULL_FLUSH;
+
+ {
+ tdefl_status status = tdefl_compress_buffer(pContext->pCompressor, pRead_buf, n, (n == 0) ? TDEFL_FINISH : flush);
+ if (status == TDEFL_STATUS_DONE || status == TDEFL_STATUS_OKAY)
+ return MZ_TRUE;
+ }
+
+ mz_zip_set_error(pContext->pZip, MZ_ZIP_COMPRESSION_FAILED);
+ pContext->pZip->m_pFree(pContext->pZip->m_pAlloc_opaque, pContext->pCompressor);
+ pContext->pCompressor = NULL;
+ return MZ_FALSE;
+}
+
+mz_bool mz_zip_writer_add_staged_finish(mz_zip_writer_staged_context *pContext)
+{
+ if (! mz_zip_writer_add_staged_data(pContext, NULL, 0) ||
+ // Either never opened, or already finished.
+ ! pContext->pCompressor)
+ return MZ_FALSE;
+
+ pContext->pZip->m_pFree(pContext->pZip->m_pAlloc_opaque, pContext->pCompressor);
+ pContext->pCompressor = NULL;
+
+ // Rewrite preallocated phony custom block in local dir header by ZIP64 extension. Also, other values are adjusted in the header.
+ if (pContext->file_ofs >= MZ_UINT32_MAX || pContext->add_state.m_comp_size >= MZ_UINT32_MAX) {
+ mz_uint64 local_dir_header_ofs = pContext->local_dir_header_ofs;
+ pContext->pExtra_data = pContext->extra_data;
+ pContext->extra_size = mz_zip_writer_create_zip64_extra_data(pContext->extra_data, &pContext->uncomp_size, &pContext->comp_size, (pContext->local_dir_header_ofs >= MZ_UINT32_MAX) ? &pContext->local_dir_header_ofs : NULL);
+
+ mz_uint8 min_version[2] = {0x2D, 0x00};
+ mz_uint8 comp_uncomp_size[4] = {0xFF, 0xFF, 0xFF, 0xFF};
+ if (pContext->pZip->m_pWrite(pContext->pZip->m_pIO_opaque, local_dir_header_ofs + MZ_ZIP_LDH_VERSION_NEEDED_OFS, min_version, sizeof(min_version)) != sizeof(min_version))
+ return mz_zip_set_error(pContext->pZip, MZ_ZIP_FILE_WRITE_FAILED);
+ if (pContext->pZip->m_pWrite(pContext->pZip->m_pIO_opaque, local_dir_header_ofs + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, comp_uncomp_size, sizeof(comp_uncomp_size)) != sizeof(comp_uncomp_size))
+ return mz_zip_set_error(pContext->pZip, MZ_ZIP_FILE_WRITE_FAILED);
+ if (pContext->pZip->m_pWrite(pContext->pZip->m_pIO_opaque, local_dir_header_ofs + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, comp_uncomp_size, sizeof(comp_uncomp_size)) != sizeof(comp_uncomp_size))
+ return mz_zip_set_error(pContext->pZip, MZ_ZIP_FILE_WRITE_FAILED);
+ if (pContext->pZip->m_pWrite(pContext->pZip->m_pIO_opaque, local_dir_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + pContext->archive_name_size, pContext->extra_data, pContext->extra_size) != pContext->extra_size)
+ return mz_zip_set_error(pContext->pZip, MZ_ZIP_FILE_WRITE_FAILED);
+ }
+
+ pContext->uncomp_size = pContext->file_ofs;
+ pContext->comp_size = pContext->add_state.m_comp_size;
+ pContext->cur_archive_file_ofs = pContext->add_state.m_cur_archive_file_ofs;
+
+ // Clean pContext->pExtra_data, pContext->extra_data and pContext->extra_size after calling mz_zip_writer_add_staged_open
+ pContext->pExtra_data = NULL;
+ pContext->extra_size = 0;
+ memset(pContext->extra_data, 0, sizeof(mz_uint8) * MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE);
+
+ {
+ mz_uint8 local_dir_footer[MZ_ZIP_DATA_DESCRIPTER_SIZE64];
+ mz_uint32 local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE32;
+
+ MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID);
+ MZ_WRITE_LE32(local_dir_footer + 4, pContext->uncomp_crc32);
+ if (pContext->uncomp_size < MZ_UINT32_MAX && pContext->comp_size < MZ_UINT32_MAX)
+ {
+ if (pContext->comp_size > MZ_UINT32_MAX)
+ return mz_zip_set_error(pContext->pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
+
+ MZ_WRITE_LE32(local_dir_footer + 8, pContext->comp_size);
+ MZ_WRITE_LE32(local_dir_footer + 12, pContext->uncomp_size);
+ }
+ else
+ {
+ MZ_WRITE_LE64(local_dir_footer + 8, pContext->comp_size);
+ MZ_WRITE_LE64(local_dir_footer + 16, pContext->uncomp_size);
+ local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE64;
+ }
+
+ if (pContext->pZip->m_pWrite(pContext->pZip->m_pIO_opaque, pContext->cur_archive_file_ofs, local_dir_footer, local_dir_footer_size) != local_dir_footer_size)
+ return MZ_FALSE;
+
+ pContext->cur_archive_file_ofs += local_dir_footer_size;
+ }
+
+ if (pContext->file_ofs >= MZ_UINT32_MAX || pContext->add_state.m_comp_size >= MZ_UINT32_MAX)
+ {
+ pContext->pExtra_data = pContext->extra_data;
+ pContext->extra_size = mz_zip_writer_create_zip64_extra_data(pContext->extra_data, (pContext->uncomp_size >= MZ_UINT32_MAX) ? &pContext->uncomp_size : NULL,
+ (pContext->comp_size >= MZ_UINT32_MAX) ? &pContext->comp_size : NULL, (pContext->local_dir_header_ofs >= MZ_UINT32_MAX) ? &pContext->local_dir_header_ofs : NULL);
+ }
+
+ if (!mz_zip_writer_add_to_central_dir(pContext->pZip, pContext->pArchive_name, (mz_uint16)pContext->archive_name_size, pContext->pExtra_data, (mz_uint16)pContext->extra_size, pContext->pComment, pContext->comment_size,
+ pContext->uncomp_size, pContext->comp_size, pContext->uncomp_crc32, pContext->method, pContext->gen_flags, pContext->dos_time, pContext->dos_date, pContext->local_dir_header_ofs, pContext->ext_attributes,
+ pContext->user_extra_data_central, pContext->user_extra_data_central_len))
+ return MZ_FALSE;
+
+ pContext->pZip->m_total_files++;
+ pContext->pZip->m_archive_size = pContext->cur_archive_file_ofs;
+
+ return MZ_TRUE;
+}
+
mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags)
{
+ return mz_zip_writer_add_file_ex(pZip, pArchive_name, pSrc_filename, pComment, comment_size, level_and_flags, NULL, 0, NULL, 0);
+ }
+
+ // BBS: support storage path with unicode path extra
+ mz_bool mz_zip_writer_add_file_ex(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
+ const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len)
+ {
MZ_FILE *pSrc_file = NULL;
mz_uint64 uncomp_size = 0;
MZ_TIME_T file_modified_time;
@@ -6980,7 +7271,7 @@
uncomp_size = MZ_FTELL64(pSrc_file);
MZ_FSEEK64(pSrc_file, 0, SEEK_SET);
- status = mz_zip_writer_add_cfile(pZip, pArchive_name, pSrc_file, uncomp_size, pFile_time, pComment, comment_size, level_and_flags, NULL, 0, NULL, 0);
+ status = mz_zip_writer_add_cfile(pZip, pArchive_name, pSrc_file, uncomp_size, pFile_time, pComment, comment_size, level_and_flags, user_extra_data, user_extra_data_len, user_extra_data_central, user_extra_data_central_len);
MZ_FCLOSE(pSrc_file);
@@ -7919,4 +8210,61 @@
}
#endif
+mz_uint mz_zip_reader_get_extra(mz_zip_archive* pZip, mz_uint file_index, char* pExtra, mz_uint extra_buf_size)
+{
+ mz_uint nf;
+ mz_uint ne;
+ const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
+ if (!p)
+ {
+ if (extra_buf_size)
+ pExtra[0] = '\0';
+ mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
+ return 0;
+ }
+ nf = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
+ ne = MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS);
+ if (extra_buf_size)
+ {
+ ne = MZ_MIN(ne, extra_buf_size - 1);
+ memcpy(pExtra, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + nf, ne);
+ pExtra[ne] = '\0';
+ }
+ return ne + 1;
+}
+
+mz_uint mz_zip_reader_get_filename_from_extra(mz_zip_archive* pZip, mz_uint file_index, char* buffer, mz_uint extra_buf_size)
+{
+ if (extra_buf_size == 0)
+ return 0;
+ mz_uint nf;
+ mz_uint ne;
+ const mz_uint8* p = mz_zip_get_cdh(pZip, file_index);
+ if (!p)
+ {
+ if (extra_buf_size)
+ buffer[0] = '\0';
+ mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
+ return 0;
+ }
+ nf = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
+ ne = MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS);
+
+ int copy = 0;
+ char const* p_nf = p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + nf;
+ char const* e = p_nf + ne + 1;
+ while (p_nf + 4 < e) {
+ mz_uint16 len = ((mz_uint16)p_nf[2]) | ((mz_uint16)p_nf[3] << 8);
+ if (p_nf[0] == '\x75' && p_nf[1] == '\x70' && len >= 5 && p_nf + 4 + len < e && p_nf[4] == '\x01') {
+ mz_uint length = MZ_MIN(len - 5, extra_buf_size - 1);
+ memcpy(buffer, p_nf + 9, length);
+ return length;
+ }
+ else {
+ p_nf += 4 + len;
+ }
+ }
+ return 0;
+}
+
#endif /*#ifndef MINIZ_NO_ARCHIVE_APIS*/
+98 -2
View File
@@ -1,5 +1,101 @@
## Changelog
### 3.1.2
- Fix central directory offset overflow when reading zip file header
- Add tdefl_write_image_to_png_file_in_memory_ex parameter validation
- Add fuzz targets for ZIP validation, writing, and compression APIs
- Support cmake 4
- Guard against code_len==0 infinite loop in tinfl_decompress
### 3.1.1
- Declare function wrappers as inline static to fix warnings
### 3.1.0
- Fix warnings: Ensure correct integer promotion when adding
- Fix Unicode paths on MinGW32
- Prevent min/max conflicts between windows.h and std namespace
- Update miniz_tdef.c to enable compiling in forced-C++ mode
- Fix missing large file support warning on 64-bit Linux
- Bump cmake minimum version
- Add some catch2 tests including CI
- Remove parameter check in `tinfl_decompress` that breaks `tinfl_decompress_mem_to_heap`
- Don't redefine `WIN32_LEAN_AND_MEAN` if already defined
- Fix OSS-Fuzz build
- Do not redefine `TDEFL_LESS_MEMORY` if already defined
- Fix unused arg warnings when building with `MINIZ_NO_TIME`
- Support Zip archives not starting at zero offset
- Fix offset detection for MZ_ZIP_TYPE_USER
- Avoid fdreopen if possible
- cmake: new option BUILD_NO_STDIO to enable MINIZ_NO_STDIO
- Add fuzzer for mz_zip_add_mem_to_archive_file_in_place function
- Replace defines with function wrappers etc. as much as possible
### 3.0.2
- Fix buffer overrun in mz_utf8z_to_widechar on Windows
### 3.0.1
- Fix compilation error with MINIZ_USE_UNALIGNED_LOADS_AND_STORES=1
### 3.0.0
- Reduce memory usage for inflate. This changes `struct tinfl_decompressor_tag` and therefore requires a major version bump (breaks ABI compatibility)
- Add padding to structures so it continues to work if features differ. This also changes some structures
- Use _ftelli64, _fseeki64 and stat with MinGW32 and OpenWatcom
- Fix varios warnings with OpenWatcom compiler
- Avoid using unaligned memory access in UBSan builds
- Set MINIZ_LITTLE_ENDIAN only if not set
- Add MINIZ_NO_DEFLATE_APIS and MINIZ_NO_INFLATE_APIS
- Fix use of uninitialized memory in tinfl_decompress_mem_to_callback()
- Use wfopen on windows
- Use _wstat64 instead _stat64 on windows
- Use level_and_flags after MZ_DEFAULT_COMPRESSION has been handled
- Improve endianess detection
- Don't use unaligned stores and loads per default
- Fix function declaration if MINIZ_NO_STDIO is used
- Fix MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8 not being set
- Remove total files check (its 32-bit uint)
- tinfl_decompress: avoid NULL ptr arithmetic UB
- miniz_zip: fix mz_zip_reader_extract_to_heap to read correct sizes
- Eliminate 64-bit operations on 32-bit machines
- Disable treating warnings as error with MSVC
- Disable building shared lib via CMake by default
- Fixed alignment problems on MacOS
- Fixed get error string for MZ_ZIP_TOTAL_ERRORS
- Write correct FLEVEL 2-bit value in zlib header
- miniz.pc.in: fix include path not containing the "miniz" suffix
- Fix compatibility with FreeBSD
- pkg-config tweaks
- Fix integer overflow in header corruption check
- Fix some warnings
- tdefl_compress_normal: Avoid NULL ptr arithmetic UB
- replace use of stdint.h types with mz_ variants
### 2.2.0
- Fix examples with amalgamation
- Modified cmake script to support shared library mode and find_package
- Fix for misleading doc comment on `mz_zip_reader_init_cfile` function
- Add include location tolerance and stop forcing `_GNU_SOURCE`
- Fix: mz_zip_reader_locate_file_v2 returns an mz_bool
- Fix large file system checks
- Add #elif to enable an external mz_crc32() to be linked in
- Write with dynamic size (size of file/data to be added not known before adding)
- Added uncompress2 for zlib compatibility
- Add support for building as a Meson subproject
- Added OSSFuzz support; Integrate with CIFuzz
- Add pkg-config file
- Fixed use-of-uninitialized value msan error when copying dist bytes with no output bytes written.
- mz_zip_validate_file(): fix memory leak on errors
- Fixed MSAN use-of-uninitialized in tinfl_decompress when invalid dist is decoded. In this instance dist was 31 which s_dist_base translates as 0
- Add flag to set (compressed) size in local file header
- avoid use of uninitialized value in tdefl_record_literal
### 2.1.0
- More instances of memcpy instead of cast and use memcpy per default
@@ -82,7 +178,7 @@ The inflator now has a new failure status TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRE
- The inflator coroutine func. is subtle and complex so I'm being cautious about this release. I would greatly appreciate any help with testing or any feedback.
I feel good about these changes, and they've been through several hours of automated testing, but they will probably not fix anything for the majority of prev. users so I'm
going to mark this release as beta for a few weeks and continue testing it at work/home on various things.
- The inflator in raw (non-zlib) mode is now usable on gzip or similiar data streams that have a bunch of bytes following the raw deflate data (problem discovered by rustyzip author williamw520).
- The inflator in raw (non-zlib) mode is now usable on gzip or similar data streams that have a bunch of bytes following the raw deflate data (problem discovered by rustyzip author williamw520).
This version should *never* read beyond the last byte of the raw deflate data independent of how many bytes you pass into the input buffer. This issue was caused by the various Huffman bitbuffer lookahead optimizations, and
would not be an issue if the caller knew and enforced the precise size of the raw compressed data *or* if the compressed data was in zlib format (i.e. always followed by the byte aligned zlib adler32).
So in other words, you can now call the inflator on deflate streams that are followed by arbitrary amounts of data and it's guaranteed that decompression will stop exactly on the last byte.
@@ -103,7 +199,7 @@ Merged over a few very minor bug fixes that I fixed in the zip64 branch. This is
Interim bugfix release while I work on the next major release with zip64 and streaming compression/decompression support. Fixed the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug (thanks kahmyong.moon@hp.com), which could cause the locate files func to not find files when this flag was specified. Also fixed a bug in mz_zip_reader_extract_to_mem_no_alloc() with user provided read buffers (thanks kymoon). I also merged lots of compiler fixes from various github repo branches and Google Code issue reports. I finally added cmake support (only tested under for Linux so far), compiled and tested with clang v3.3 and gcc 4.6 (under Linux), added defl_write_image_to_png_file_in_memory_ex() (supports Y flipping for OpenGL use, real-time compression), added a new PNG example (example6.c - Mandelbrot), and I added 64-bit file I/O support (stat64(), etc.) for glibc.
- Critical fix for the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug (thanks kahmyong.moon@hp.com) which could cause locate files to not find files. This bug
would only have occured in earlier versions if you explicitly used this flag, OR if you used mz_zip_extract_archive_file_to_heap() or mz_zip_add_mem_to_archive_file_in_place()
would only have occurred in earlier versions if you explicitly used this flag, OR if you used mz_zip_extract_archive_file_to_heap() or mz_zip_add_mem_to_archive_file_in_place()
(which used this flag). If you can't switch to v1.15 but want to fix this bug, just remove the uses of this flag from both helper funcs (and of course don't use the flag).
- Bugfix in mz_zip_reader_extract_to_mem_no_alloc() from kymoon when pUser_read_buf is not NULL and compressed size is > uncompressed size
- Fixing mz_zip_reader_extract_*() funcs so they don't try to extract compressed data from directory entries, to account for weird zipfiles which contain zero-size compressed data on dir entries.
+36 -1
View File
@@ -1,4 +1,39 @@
This library is based on miniz 2.1.0 - amalgamated version.
This library is based on miniz 3.1.2 - amalgamated version
(https://github.com/richgel999/miniz/releases/download/3.1.2/miniz-3.1.2.zip).
----------------------------------------------------------------
Local changes
Every change to the upstream miniz.c and miniz.h is recorded in
0001-OrcaSlicer-local-changes.patch, which turns the two upstream files into
the two files in this directory. Keep the patch and the sources in step: when
one of them changes, regenerate the other.
To move to a new upstream release, unpack its miniz.c and miniz.h over the
files here and apply the patch from this directory:
patch -p1 < 0001-OrcaSlicer-local-changes.patch
Resolve any rejects by hand, then regenerate the patch against the pristine
files (diff -u, paths a/ and b/) so the next bump starts from a clean apply.
What the patch carries:
- mz_zip_archive_file_stat.m_is_utf8, set from the UTF-8 general purpose bit
while reading the central directory (BBS).
- mz_zip_reader_get_extra(), which returns an entry's central directory extra
field (BBS), and mz_zip_reader_get_filename_from_extra(), which reads the
Unicode Path extra field (0x7075) out of it (OrcaSlicer).
- mz_zip_writer_add_file_ex(), which adds a file with local and central extra
fields; mz_zip_writer_add_file() now calls it (BBS).
- The staged writer, mz_zip_writer_add_staged_open()/_data()/_finish() and
mz_zip_writer_staged_context, described below (PrusaResearch). The
mz_zip_writer_add_state struct and MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE move
from miniz.c to miniz.h so the context can embed them.
- Local and central directory headers write version-needed 45 (4.5) and
0xFFFFFFFF sizes when an entry needs zip64, and the central header's
version-made-by follows version-needed.
----------------------------------------------------------------
+6631 -6422
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More