OmaPhoto 1.0.0: the Linux port of Compositor
Release / deb (push) Canceled after 0s
Release / rpm (push) Canceled after 0s
Release / arch (push) Canceled after 0s
Release / publish (push) Canceled after 0s

A layered image editor for Linux and Omarchy, ported from Compositor
(github.com/robbietilton/Compositor), whose Swift source is its
specification. It reads and writes Compositor's .comp projects.

Packages for Ubuntu, Fedora and Arch come from the release workflow;
scripts/install/ holds one install script per distribution family,
and flake.nix serves NixOS.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
雷电芽衣andClaude committed 2026-09-26 00:44:52 -04:00
commit c864304695
564 files changed
+100804

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
#pragma once
#include "Document/EditorSession+Model.h"
#include <QString>
#include <QUuid>
#include <optional>
#include <vector>
// Snapshots share image data; layer edits copy no pixels.
class DocumentHistory {
public:
struct Snapshot {
std::optional<CanvasDocument> document;
std::optional<QUuid> activeLayerID;
QUuid revision;
};
const int entryLimit;
const qint64 retainedByteLimit;
explicit DocumentHistory(int entryLimit = 100, qint64 retainedByteLimit = 256LL * 1024 * 1024);
bool canUndo() const { return m_depth == 0 && !m_past.empty(); }
bool canRedo() const { return m_depth == 0 && !m_future.empty(); }
QString undoName() const { return m_past.empty() ? QString() : m_past.back().name; }
QString redoName() const { return m_future.empty() ? QString() : m_future.back().name; }
bool isModified() const { return m_revision != m_savedRevision; }
int undoCount() const { return int(m_past.size()); }
void markSaved() { m_savedRevision = m_revision; }
void reset();
// Takes the steps a staged copy of this history recorded.
void adopt(DocumentHistory &&staged) noexcept;
void begin(const QString &name, const std::optional<CanvasDocument> &document, std::optional<QUuid> selection);
void end(const std::optional<CanvasDocument> &document, std::optional<QUuid> selection);
std::optional<Snapshot> undo();
std::optional<Snapshot> redo();
qint64 retainedBytes(const std::optional<CanvasDocument> &current) const;
private:
struct Entry {
QString name;
Snapshot before;
Snapshot after;
};
void trim(const std::optional<CanvasDocument> &current);
std::vector<Entry> m_past;
std::vector<Entry> m_future;
QUuid m_revision = QUuid::createUuid();
QUuid m_savedRevision = m_revision;
std::optional<Snapshot> m_pending;
QString m_pendingName = QStringLiteral("Edit");
int m_depth = 0;
};