rodecomp/Source/UI/Layout/SnapMgr.h
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

51 lines
1.5 KiB
C++

#ifndef RAGNAROK_SOURCE_UI_LAYOUT_SNAPMGR_H
#define RAGNAROK_SOURCE_UI_LAYOUT_SNAPMGR_H
#include <list>
class SnapObject;
class UIWindow;
struct WindowSnapping;
class CSnapMgr {
public:
CSnapMgr();
virtual ~CSnapMgr();
void SetRoot(UIWindow* window);
void Add(UIWindow* window);
void Remove(UIWindow* window);
void Clear();
bool IsRoot(const UIWindow* window) const;
bool Contains(const UIWindow* window) const;
bool Connected(UIWindow* from, UIWindow* to);
bool ConnectedToRoot(UIWindow* window);
void UpdateLinks(SnapObject* object);
void Refresh(UIWindow* window);
void CaptureOrigins(UIWindow* window);
void ConstrainGroup(UIWindow* window, int& dx, int& dy, WindowSnapping& snapping);
void MoveConnected(UIWindow* window, int dx, int dy, WindowSnapping& snapping);
void MoveEdge(UIWindow* window, int dx, int dy, int side, WindowSnapping& snapping);
/* 0004 */ SnapObject* root;
/* 0008 */ std::list<SnapObject*> objects;
private:
void ResetVisited();
SnapObject* Find(const UIWindow* window) const;
static void MoveBranch(SnapObject* object, int dx, int dy, int side, WindowSnapping& snapping);
CSnapMgr(const CSnapMgr&) = delete;
CSnapMgr& operator=(const CSnapMgr&) = delete;
};
// STATIC: 0x01334698 / 0x013346A8
extern const int g_snapOppositeSide[4];
extern bool g_snapEnabled;
// STATIC: 0x013346A4 / 0x013346B0
extern int g_snapDirection;
extern SnapObject* g_snapBoundary;
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CSnapMgr) == 16);
#endif
#endif