Skip to content

Commit 9b5afa5

Browse files
committed
feat: copy code
1 parent 7849d51 commit 9b5afa5

13 files changed

+70050
-13
lines changed

skia_minimal/imgui_w_hooks_1.91.9_wip/hooking.h

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
#pragma once
2+
3+
#ifdef IMGUI_HOOK_ENABLE
4+
#define IMGUI_HOOK_DRAW_LIST_PRE(r) if(!(r)) { return; }
5+
#define IMGUI_HOOK_DRAW_LIST_POST(r) (r);
6+
#define IMGUI_HOOK_DRAW_LIST_SPLITTER
7+
#define IMGUI_HOOK_FONT_PRE(r) if(!(r)) { return retr; }
8+
#define IMGUI_HOOK_GLOBAL_PRE(r) if(!(r)) { return; }
9+
#define IMGUI_HOOK_GLOBAL_PRE_RETR(r) if(!(r)) { return retr; }
10+
#else
11+
#define IMGUI_HOOK_DRAW_LIST_PRE(r)
12+
#define IMGUI_HOOK_DRAW_LIST_POST(r)
13+
#define IMGUI_HOOK_FONT_PRE(r)
14+
#define IMGUI_HOOK_GLOBAL_PRE(r)
15+
#define IMGUI_HOOK_GLOBAL_PRE_RETR(r)
16+
#endif
17+
18+
struct ImGuiWindow;
19+
20+
namespace ImGui {
21+
namespace Hooks {
22+
namespace Global {
23+
void ShouldAddDrawListToDrawData(const ::ImDrawList *draw_list, bool &shouldAdd);
24+
namespace Pre {
25+
bool RenderDimmedBackdgroundBehindWindow(::ImGuiWindow *window,ImU32 col);
26+
bool InputTextCalcTextSize(::ImVec2 &out, ::ImGuiContext* ctx, const char* text_begin, const char* text_end, const char** remaining=nullptr, ImVec2* out_offset=nullptr, bool stop_on_new_line=false);
27+
}
28+
}
29+
namespace ImDrawListSplitter {
30+
void SaveDrawListToSplitter(::ImDrawListSplitter &splitter, const ::ImDrawList *draw_list, int idx);
31+
void RestoreDrawListFromSplitter(::ImDrawListSplitter const &splitter, ::ImDrawList *draw_list, int idx);
32+
int EnsureSlotsCapacity(::ImDrawListSplitter &splitter, int nSlotsTotal);
33+
void ResetSlot(::ImDrawListSplitter &splitter,int i);
34+
void InitSlot(::ImDrawListSplitter &splitter,int i);
35+
void InitSlots(::ImDrawListSplitter &splitter, int nSlotsToInit);
36+
void ClearFreeMemory(::ImDrawListSplitter &splitter);
37+
int MergeInitialValue(::ImDrawListSplitter &splitter,::ImDrawList *drawList);
38+
int MergeUpdate(::ImDrawListSplitter &splitter,int i,int prev);
39+
void MergeReserve(::ImDrawList *drawList,int n);
40+
void MergeOp(::ImDrawListSplitter &splitter,::ImDrawList *drawList,int i);
41+
}
42+
namespace ImFont {
43+
namespace Pre {
44+
bool CalcTextSizeA(const ::ImFont *font, float size, float max_width, float wrap_width, const char* text_begin, const char* text_end, const char** remaining, ImVec2 &retr);
45+
bool RenderChar(const ::ImFont *font, ::ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c);
46+
bool RenderText(const ::ImFont *font, ::ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip);
47+
bool GetCharAdvance(const ::ImFont *font, float &retr, ImWchar c);
48+
}
49+
}
50+
namespace ImDrawList {
51+
namespace Pre {
52+
53+
bool AddDrawCmd(::ImDrawList *draw_list);
54+
bool _PopUnusedDrawCmd(::ImDrawList *draw_list);
55+
bool _ResetForNewFrame(::ImDrawList *draw_list);
56+
57+
bool PushClipRect(::ImDrawList *draw_list,const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect(ImDrawList *draw_list,) to affect logic (ImDrawList *draw_list,hit-testing and widget culling)
58+
bool PushClipRectFullScreen(::ImDrawList *draw_list);
59+
bool PopClipRect(::ImDrawList *draw_list);
60+
bool PushTextureID(::ImDrawList *draw_list,ImTextureID texture_id);
61+
bool PopTextureID(::ImDrawList *draw_list);
62+
63+
bool AddLine(::ImDrawList *draw_list,const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness);
64+
bool AddRect(::ImDrawList *draw_list,const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding, ImDrawFlags flags, float thickness);
65+
bool AddRectFilled(::ImDrawList *draw_list,const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding, ImDrawFlags flags);
66+
bool AddRectFilledMultiColor(::ImDrawList *draw_list,const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left);
67+
bool AddQuad(::ImDrawList *draw_list,const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness);
68+
bool AddQuadFilled(::ImDrawList *draw_list,const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col);
69+
bool AddTriangle(::ImDrawList *draw_list,const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness);
70+
bool AddTriangleFilled(::ImDrawList *draw_list,const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col);
71+
bool AddCircle(::ImDrawList *draw_list,const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness);
72+
bool AddCircleFilled(::ImDrawList *draw_list,const ImVec2& center, float radius, ImU32 col, int num_segments);
73+
bool AddNgon(::ImDrawList *draw_list,const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness);
74+
bool AddNgonFilled(::ImDrawList *draw_list,const ImVec2& center, float radius, ImU32 col, int num_segments);
75+
bool AddEllipse(::ImDrawList *draw_list,const ImVec2& center, const ImVec2& radius, ImU32 col, float rot, int num_segments, float thickness);
76+
bool AddEllipseFilled(::ImDrawList *draw_list,const ImVec2& center, const ImVec2& radius, ImU32 col, float rot, int num_segments);
77+
bool AddBezierCubic(::ImDrawList *draw_list,const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments);
78+
bool AddBezierQuadratic(::ImDrawList *draw_list,const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments);
79+
80+
bool AddPolyline(::ImDrawList *draw_list,const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness);
81+
bool AddConvexPolyFilled(::ImDrawList *draw_list,const ImVec2* points, int num_points, ImU32 col);
82+
bool AddConcavePolyFilled(::ImDrawList *draw_list,const ImVec2* points, int num_points, ImU32 col);
83+
84+
bool AddImage(::ImDrawList *draw_list,ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col);
85+
bool AddImageQuad(::ImDrawList *draw_list,ImTextureID user_texture_id, const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& uv1, const ImVec2& uv2, const ImVec2& uv3, const ImVec2& uv4, ImU32 col);
86+
bool AddImageRounded(::ImDrawList *draw_list,ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawFlags flags);
87+
88+
bool PathClear(::ImDrawList *draw_list);
89+
bool PathLineTo(::ImDrawList *draw_list,const ImVec2& pos);
90+
bool PathLineToMergeDuplicate(::ImDrawList *draw_list,const ImVec2& pos);
91+
bool PathFillConvex(::ImDrawList *draw_list,ImU32 col);
92+
bool PathFillConcave(::ImDrawList *draw_list,ImU32 col);
93+
bool PathStroke(::ImDrawList *draw_list,ImU32 col, ImDrawFlags flags, float thickness);
94+
bool PathArcTo(::ImDrawList *draw_list,const ImVec2& center, float radius, float a_min, float a_max, int num_segments);
95+
bool PathArcToFast(::ImDrawList *draw_list,const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12);
96+
bool PathEllipticalArcTo(::ImDrawList *draw_list,const ImVec2& center, const ImVec2& radius, float rot, float a_min, float a_max, int num_segments);
97+
bool PathBezierCubicCurveTo(::ImDrawList *draw_list,const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments);
98+
bool PathBezierQuadraticCurveTo(::ImDrawList *draw_list,const ImVec2& p2, const ImVec2& p3, int num_segments);
99+
bool PathRect(::ImDrawList *draw_list,const ImVec2& rect_min, const ImVec2& rect_max, float rounding, ImDrawFlags flags);
100+
101+
bool AddCallback(::ImDrawList *draw_list,void *callback, void* userdata, size_t userdata_size);
102+
bool AddDrawCmd(::ImDrawList *draw_list);
103+
104+
bool PrimReserve(::ImDrawList *draw_list,int idx_count, int vtx_count);
105+
bool PrimUnreserve(::ImDrawList *draw_list,int idx_count, int vtx_count);
106+
bool PrimRect(::ImDrawList *draw_list,const ImVec2& a, const ImVec2& b, ImU32 col);
107+
bool PrimRectUV(::ImDrawList *draw_list,const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
108+
bool PrimQuadUV(::ImDrawList *draw_list,const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col);
109+
bool PrimWriteVtx(::ImDrawList *draw_list,const ImVec2& pos, const ImVec2& uv, ImU32 col);
110+
bool PrimWriteIdx(::ImDrawList *draw_list,ImDrawIdx idx);
111+
bool PrimVtx(::ImDrawList *draw_list,const ImVec2& pos, const ImVec2& uv, ImU32 col);
112+
113+
bool _ResetForNewFrame(::ImDrawList *draw_list);
114+
bool _ClearFreeMemory(::ImDrawList *draw_list);
115+
bool CloneOutput(::ImDrawList *draw_list,::ImDrawList *dest);
116+
bool _PopUnusedDrawCmd(::ImDrawList *draw_list);
117+
bool _TryMergeDrawCmds(::ImDrawList *draw_list);
118+
bool _OnChangedClipRect(::ImDrawList *draw_list);
119+
bool _OnChangedTextureID(::ImDrawList *draw_list);
120+
bool _OnChangedVtxOffset(::ImDrawList *draw_list);
121+
}
122+
123+
namespace Post {
124+
void CreateImDrawList(::ImDrawList *draw_list, ImDrawListSharedData* shared_data);
125+
void CloneOutput(const ::ImDrawList *draw_list,::ImDrawList *dest);
126+
void PushClipRect(::ImDrawList *draw_list,const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect = false);
127+
void PopClipRect(::ImDrawList *draw_list);
128+
}
129+
}
130+
}
131+
}

skia_minimal/imgui_w_hooks_1.91.9_wip/imgui.cpp

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)