2026-05-11 23:06:39 +03:00
|
|
|
/*
|
|
|
|
|
* InfiniPaint
|
|
|
|
|
* Copyright (C) 2025-2026 Yousef Khadadeh
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2025-12-24 12:42:27 +03:00
|
|
|
#pragma once
|
|
|
|
|
#include <Helpers/NetworkingObjects/NetObjOrderedList.hpp>
|
2025-12-25 17:18:28 +03:00
|
|
|
#include <include/core/SkCanvas.h>
|
|
|
|
|
#include "../../DrawData.hpp"
|
2025-12-26 19:52:36 +03:00
|
|
|
#include "../../CanvasComponents/CanvasComponentContainer.hpp"
|
2025-12-24 12:42:27 +03:00
|
|
|
|
|
|
|
|
class DrawingProgramLayerListItem;
|
2025-12-26 10:10:19 +03:00
|
|
|
class DrawingProgramLayerManager;
|
2025-12-24 12:42:27 +03:00
|
|
|
|
|
|
|
|
class DrawingProgramLayerFolder {
|
|
|
|
|
public:
|
2025-12-26 19:52:36 +03:00
|
|
|
void draw(SkCanvas* canvas, const DrawData& drawData) const;
|
2025-12-30 21:18:59 +03:00
|
|
|
void set_component_list_callbacks(DrawingProgramLayerManager& layerMan);
|
2025-12-30 19:46:08 +03:00
|
|
|
void get_flattened_component_list(std::vector<CanvasComponentContainer::ObjInfo*>& objList) const;
|
2025-12-30 21:18:59 +03:00
|
|
|
void set_to_erase();
|
2025-12-31 11:59:53 +03:00
|
|
|
NetworkingObjects::NetObjWeakPtr<DrawingProgramLayerListItem> get_initial_editing_layer() const;
|
2025-12-31 16:30:56 +03:00
|
|
|
void scale_up(const WorldScalar& scaleUpAmount);
|
2025-12-25 17:18:28 +03:00
|
|
|
|
2025-12-24 12:42:27 +03:00
|
|
|
NetworkingObjects::NetObjOwnerPtr<NetworkingObjects::NetObjOrderedList<DrawingProgramLayerListItem>> folderList;
|
|
|
|
|
bool isFolderOpen = false;
|
2026-01-01 22:46:02 +03:00
|
|
|
|
|
|
|
|
void load_file(cereal::PortableBinaryInputArchive& a, VersionNumber version, DrawingProgramLayerManager& layerMan);
|
|
|
|
|
void save_file(cereal::PortableBinaryOutputArchive& a) const;
|
2026-01-01 23:28:26 +03:00
|
|
|
|
|
|
|
|
void get_used_resources(std::unordered_set<NetworkingObjects::NetObjID>& resourceSet) const;
|
2026-04-03 14:18:04 +03:00
|
|
|
void erase_invalid_components();
|
2025-12-24 12:42:27 +03:00
|
|
|
};
|