Polyphase Game Engine
Loading...
Searching...
No Matches
GitWorkspaceWindow.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include "GitTypes.h"
6#include <string>
7#include <vector>
8#include <cstdint>
9
10class GitWorkspaceWindow
11{
12public:
13 void Open();
14 void Close();
15 bool IsOpen() const;
16 void Draw();
17
18private:
19 bool mIsOpen = false;
20
21 // Selection state shared across sub-views
22 int32_t mSelectedCommitIndex = -1;
23 std::string mSelectedCommitOid;
24 std::string mSelectedFilePath;
25 int32_t mActiveSidebarSection = 0; // 0=FileStatus, 1=History, 2=Branches, 3=Tags, 4=Remotes
26 char mHistoryFilterText[256] = {0};
27 bool mShowAllBranches = false;
28 int32_t mHistoryPageCount = 100;
29
30 // Sub-view draw methods (all inline in the .cpp)
31 void DrawToolbar();
32 void DrawSidebar(float width, float height);
33 void DrawMainArea(float width, float height);
34 void DrawHistoryView(float width, float height);
35 void DrawStatusView(float width, float height);
36 void DrawDiffInspector(float width, float height);
37 void DrawCommitComposer(float width, float height);
38 void DrawOutputLog(float width, float height);
39
40 // Commit composer state
41 char mCommitSummary[256] = {0};
42 char mCommitBody[4096] = {0};
43 bool mAmendCommit = false;
44
45 // Output log
46 struct LogEntry { std::string mText; int32_t mLevel; }; // 0=info, 1=warn, 2=error
47 std::vector<LogEntry> mLogEntries;
48 bool mLogAutoScroll = true;
49
50 // Cached diff for display
51 GitFileDiff mCurrentDiff;
52 bool mDiffDirty = true;
53
54 // Checkout choice popup state
55 bool mCheckoutChoiceOpen = false;
56 std::string mCheckoutChoiceOid;
57 std::vector<std::string> mCheckoutChoiceBranches;
58 int32_t mCheckoutChoiceSelected = 0;
59
60 void DrawCheckoutChoicePopup();
61};
62
63GitWorkspaceWindow* GetGitWorkspaceWindow();
64
65#endif