Files
Leeksov 4647310322 GLEGram 12.5 — Initial public release
Based on Swiftgram 12.5 (Telegram iOS 12.5).
All GLEGram features ported and organized in GLEGram/ folder.

Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass,
Font Replacement, Fake Profile, Chat Export, Plugin System, and more.

See CHANGELOG_12.5.md for full details.
2026-04-06 09:48:12 +03:00

79 lines
2.0 KiB
C++

#ifndef DashElement_hpp
#define DashElement_hpp
#include "Lottie/Private/Model/Keyframes/KeyframeGroup.hpp"
#include "Lottie/Private/Parsing/JsonParsing.hpp"
#include "Lottie/Public/Primitives/DashPattern.hpp"
namespace lottie {
enum class DashElementType {
Offset,
Dash,
Gap
};
class DashElement {
public:
DashElement(
DashElementType type_,
KeyframeGroup<Vector1D> const &value_
) :
type(type_),
value(value_) {
}
explicit DashElement(lottiejson11::Json::object const &json) noexcept(false) :
type(DashElementType::Offset),
value(KeyframeGroup<Vector1D>(Vector1D(0.0))) {
auto typeRawValue = getString(json, "n");
if (typeRawValue == "o") {
type = DashElementType::Offset;
} else if (typeRawValue == "d") {
type = DashElementType::Dash;
} else if (typeRawValue == "g") {
type = DashElementType::Gap;
} else {
throw LottieParsingException();
}
value = KeyframeGroup<Vector1D>(getObject(json, "v"));
name = getOptionalString(json, "nm");
}
lottiejson11::Json::object toJson() const {
lottiejson11::Json::object result;
switch (type) {
case DashElementType::Offset:
result.insert(std::make_pair("n", "o"));
break;
case DashElementType::Dash:
result.insert(std::make_pair("n", "d"));
break;
case DashElementType::Gap:
result.insert(std::make_pair("n", "g"));
break;
}
result.insert(std::make_pair("v", value.toJson()));
if (name.has_value()) {
result.insert(std::make_pair("nm", name.value()));
}
return result;
}
public:
DashElementType type;
KeyframeGroup<Vector1D> value;
std::optional<std::string> name;
};
}
#endif /* DashElement_hpp */