Batch #11020 by cremane: 1 byte-identical, 0 confirmed by peer review. - fn_09720 CSnapMgr::Clear: byte-identical Merged automatically: every function is byte-identical to the original.
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#ifndef RAGNAROK_SOURCE_UI_LAYOUT_SNAPMGR_H
|
|
#define RAGNAROK_SOURCE_UI_LAYOUT_SNAPMGR_H
|
|
|
|
#include <list>
|
|
|
|
class SnapObject;
|
|
class UIWindow;
|
|
|
|
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);
|
|
void MoveConnected(UIWindow* window, int dx, int dy);
|
|
void MoveEdge(UIWindow* window, int dx, int dy, int side);
|
|
|
|
/* 0004 */ SnapObject* root;
|
|
/* 0008 */ std::list<SnapObject*> objects;
|
|
|
|
private:
|
|
void ResetVisited();
|
|
SnapObject* Find(const UIWindow* window) const;
|
|
CSnapMgr(const CSnapMgr&) = delete;
|
|
CSnapMgr& operator=(const CSnapMgr&) = delete;
|
|
};
|
|
|
|
extern const int g_snapOppositeSide[4];
|
|
extern bool g_snapEnabled;
|
|
extern int g_snapDirection;
|
|
extern CSnapMgr g_snapMgr;
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(CSnapMgr) == 16);
|
|
#endif
|
|
|
|
#endif
|