yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
collaboration_panel.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GUI_WIDGETS_COLLABORATION_PANEL_H_
2#define YAZE_APP_GUI_WIDGETS_COLLABORATION_PANEL_H_
3
4#include <map>
5#include <string>
6#include <vector>
7
8#include "absl/status/status.h"
10#include "app/rom.h"
11#include "imgui/imgui.h"
12
13#ifdef YAZE_WITH_JSON
14#include "nlohmann/json.hpp"
15#endif
16
17namespace yaze {
18
19namespace gui {
20
26 std::string sync_id;
27 std::string sender;
28 std::string rom_hash;
29 int64_t timestamp;
30 size_t diff_size;
31 bool applied;
32 std::string error_message;
33};
34
40 std::string snapshot_id;
41 std::string sender;
42 std::string snapshot_type; // "screenshot", "map_state", "tile_data", etc.
43 int64_t timestamp;
44 size_t data_size;
45 std::vector<uint8_t> data; // Base64-decoded image or JSON data
47
48 // For images: decoded texture data
49 void* texture_id = nullptr;
50 int width = 0;
51 int height = 0;
52};
53
59 std::string proposal_id;
60 std::string sender;
61 std::string description;
62 std::string proposal_data; // JSON or formatted text
63 std::string status; // "pending", "approved", "rejected", "applied"
64 int64_t timestamp;
65
66#ifdef YAZE_WITH_JSON
67 nlohmann::json metadata;
68#endif
69};
70
81 public:
84
88 void Initialize(Rom* rom, net::RomVersionManager* version_mgr,
89 net::ProposalApprovalManager* approval_mgr);
90
94 void Render(bool* p_open = nullptr);
95
99 void AddRomSync(const RomSyncEntry& entry);
100
104 void AddSnapshot(const SnapshotEntry& entry);
105
109 void AddProposal(const ProposalEntry& entry);
110
114 void UpdateProposalStatus(const std::string& proposal_id, const std::string& status);
115
119 void Clear();
120
124 ProposalEntry* GetProposal(const std::string& proposal_id);
125
126 private:
127 void RenderRomSyncTab();
128 void RenderSnapshotsTab();
129 void RenderProposalsTab();
131 void RenderApprovalTab();
132
133 void RenderRomSyncEntry(const RomSyncEntry& entry, int index);
134 void RenderSnapshotEntry(const SnapshotEntry& entry, int index);
135 void RenderProposalEntry(const ProposalEntry& entry, int index);
136 void RenderVersionSnapshot(const net::RomSnapshot& snapshot, int index);
138
139 // Integration components
143
144 // Tab selection
146
147 // Data
148 std::vector<RomSyncEntry> rom_syncs_;
149 std::vector<SnapshotEntry> snapshots_;
150 std::vector<ProposalEntry> proposals_;
151
152 // UI state
159
160 // Filters
161 char search_filter_[256];
163
164 // Colors
165 struct {
174
175 // Helper functions
176 std::string FormatTimestamp(int64_t timestamp);
177 std::string FormatFileSize(size_t bytes);
178 const char* GetProposalStatusIcon(const std::string& status);
179 ImVec4 GetProposalStatusColor(const std::string& status);
180};
181
182} // namespace gui
183
184} // namespace yaze
185
186#endif // YAZE_APP_GUI_WIDGETS_COLLABORATION_PANEL_H_
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:71
ImGui panel for collaboration features.
std::string FormatFileSize(size_t bytes)
ProposalEntry * GetProposal(const std::string &proposal_id)
net::RomVersionManager * version_mgr_
void RenderVersionSnapshot(const net::RomSnapshot &snapshot, int index)
void RenderProposalEntry(const ProposalEntry &entry, int index)
std::string FormatTimestamp(int64_t timestamp)
void AddSnapshot(const SnapshotEntry &entry)
void AddProposal(const ProposalEntry &entry)
void UpdateProposalStatus(const std::string &proposal_id, const std::string &status)
const char * GetProposalStatusIcon(const std::string &status)
std::vector< ProposalEntry > proposals_
void RenderSnapshotEntry(const SnapshotEntry &entry, int index)
void AddRomSync(const RomSyncEntry &entry)
void RenderApprovalProposal(const net::ProposalApprovalManager::ApprovalStatus &status, int index)
struct yaze::gui::CollaborationPanel::@0 colors_
ImVec4 GetProposalStatusColor(const std::string &status)
void Render(bool *p_open=nullptr)
std::vector< RomSyncEntry > rom_syncs_
net::ProposalApprovalManager * approval_mgr_
void RenderRomSyncEntry(const RomSyncEntry &entry, int index)
std::vector< SnapshotEntry > snapshots_
void Initialize(Rom *rom, net::RomVersionManager *version_mgr, net::ProposalApprovalManager *approval_mgr)
Manages proposal approval workflow for collaborative sessions.
Manages ROM versioning, snapshots, and rollback capabilities.
Main namespace for the application.
Represents an AI-generated proposal.
Represents a ROM synchronization event.
Represents a shared snapshot (image, map state, etc.)
std::vector< uint8_t > data
Represents a versioned snapshot of ROM state.