refactor(framework): cleanup layout header file
This commit is contained in:
parent
ab1c2a51ff
commit
4d65771853
@ -23,17 +23,16 @@
|
|||||||
#include <QtWidgets/QComboBox>
|
#include <QtWidgets/QComboBox>
|
||||||
#include <QtWidgets/QFrame>
|
#include <QtWidgets/QFrame>
|
||||||
#include <QtWidgets/QHBoxLayout>
|
#include <QtWidgets/QHBoxLayout>
|
||||||
|
#include <QtWidgets/QMainWindow>
|
||||||
#include <QtWidgets/QSplitter>
|
#include <QtWidgets/QSplitter>
|
||||||
#include <QtWidgets/QStackedWidget>
|
#include <QtWidgets/QStackedWidget>
|
||||||
#include <QtWidgets/QToolButton>
|
#include <QtWidgets/QToolButton>
|
||||||
#include <QtWidgets/QMainWindow>
|
|
||||||
#include <QtWidgets/QVBoxLayout>
|
#include <QtWidgets/QVBoxLayout>
|
||||||
#include <QtWidgets/QtWidgets>
|
#include <QtWidgets/QtWidgets>
|
||||||
#include <QtXml/QDomElement>
|
#include <QtXml/QDomElement>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
// Forward declarations
|
// Forward declarations
|
||||||
class TULayoutView;
|
class TULayoutView;
|
||||||
class TULayoutViewHolder;
|
class TULayoutViewHolder;
|
||||||
@ -91,13 +90,6 @@ class WID_HBoxLayout;
|
|||||||
// - AC_ResponderTemplateWidget<QWidget> vtable: 0x18004ce68
|
// - AC_ResponderTemplateWidget<QWidget> vtable: 0x18004ce68
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
// Toon Boom internal classes - forward declarations only
|
|
||||||
// These are implemented in Toon Boom DLLs and cannot be extended by users
|
|
||||||
class AC_ResponderTemplate;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class AC_ResponderTemplateWidget;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Toolbar configuration and state for a view
|
* @brief Toolbar configuration and state for a view
|
||||||
*
|
*
|
||||||
@ -222,23 +214,24 @@ public:
|
|||||||
// Constructors - implemented in ToonBoomLayout.dll
|
// Constructors - implemented in ToonBoomLayout.dll
|
||||||
TULayoutView();
|
TULayoutView();
|
||||||
TULayoutView(const TULayoutView &other);
|
TULayoutView(const TULayoutView &other);
|
||||||
virtual ~TULayoutView(); // slot 0
|
virtual ~TULayoutView(); // slot 0
|
||||||
|
|
||||||
TULayoutView &operator=(const TULayoutView &other);
|
TULayoutView &operator=(const TULayoutView &other);
|
||||||
|
|
||||||
// ===== PURE VIRTUAL METHODS (MUST override all 5) =====
|
// ===== PURE VIRTUAL METHODS (MUST override all 5) =====
|
||||||
virtual QWidget *widget() = 0; // slot 1
|
virtual QWidget *widget() = 0; // slot 1
|
||||||
virtual TULayoutView *initiate(QWidget *parent); // slot 2
|
virtual TULayoutView *initiate(QWidget *parent); // slot 2
|
||||||
virtual const QWidget *getWidget() const = 0; // slot 3
|
virtual const QWidget *getWidget() const = 0; // slot 3
|
||||||
virtual QWidget *getWidget() = 0; // slot 4
|
virtual QWidget *getWidget() = 0; // slot 4
|
||||||
|
|
||||||
// ===== Virtual methods with default implementations =====
|
// ===== Virtual methods with default implementations =====
|
||||||
virtual const TULayoutViewHolder *getParentHolderWidget() const; // slot 5
|
virtual const TULayoutViewHolder *getParentHolderWidget() const; // slot 5
|
||||||
virtual TULayoutViewHolder *getParentHolderWidget(); // slot 6
|
virtual TULayoutViewHolder *getParentHolderWidget(); // slot 6
|
||||||
virtual bool hasMenu(); // slot 7
|
virtual bool hasMenu(); // slot 7
|
||||||
virtual void setMenu(AC_Manager *manager, const char *menuName, MenuType type); // slot 8
|
virtual void setMenu(AC_Manager *manager, const char *menuName,
|
||||||
virtual void setMenu(AC_Menu *menu, MenuType type); // slot 9
|
MenuType type); // slot 8
|
||||||
virtual AC_Menu *menu(MenuType type); // slot 10
|
virtual void setMenu(AC_Menu *menu, MenuType type); // slot 9
|
||||||
|
virtual AC_Menu *menu(MenuType type); // slot 10
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the QDomElement defining this view's toolbar
|
* @brief Returns the QDomElement defining this view's toolbar
|
||||||
@ -262,28 +255,40 @@ public:
|
|||||||
* @see TULayoutView_getActionManager()
|
* @see TULayoutView_getActionManager()
|
||||||
* @see docs/TULayoutView_Toolbar_Integration.md
|
* @see docs/TULayoutView_Toolbar_Integration.md
|
||||||
*/
|
*/
|
||||||
virtual QDomElement toolbar(); // slot 11
|
virtual QDomElement toolbar(); // slot 11
|
||||||
|
|
||||||
virtual void setToolbarInfo(const LAY_ToolbarInfo &info); // slot 12
|
virtual void setToolbarInfo(const LAY_ToolbarInfo &info); // slot 12
|
||||||
virtual void connectView() {} // slot 13 (empty impl)
|
virtual void connectView() {} // slot 13 (empty impl)
|
||||||
virtual void disconnectView() {} // slot 14 (empty impl)
|
virtual void disconnectView() {} // slot 14 (empty impl)
|
||||||
virtual bool initializedFromCopy(); // slot 15
|
virtual bool initializedFromCopy(); // slot 15
|
||||||
virtual QString getCaption(bool includeAdvanced) const; // slot 16
|
virtual QString getCaption(bool includeAdvanced) const; // slot 16
|
||||||
virtual QString getDynamicTextForCaption() const; // slot 17
|
virtual QString getDynamicTextForCaption() const; // slot 17
|
||||||
virtual bool wantEditionStack() const { return false; } // slot 18 (returns false)
|
virtual bool wantEditionStack() const {
|
||||||
virtual QString displayName() const; // slot 19
|
return false;
|
||||||
virtual void compositeChanged(const QString &) {} // slot 20 (empty impl)
|
} // slot 18 (returns false)
|
||||||
virtual void dropOverComposite(QDropEvent *, const QString &) {} // slot 21 (empty)
|
virtual QString displayName() const; // slot 19
|
||||||
virtual bool wantComposites() const { return false; } // slot 22 (returns false)
|
virtual void compositeChanged(const QString &) {} // slot 20 (empty impl)
|
||||||
virtual void initActionManager(AC_Manager *) {} // slot 23 (empty impl)
|
virtual void dropOverComposite(QDropEvent *, const QString &) {
|
||||||
virtual bool wantDisplaySelector() const { return false; } // slot 24 (returns false)
|
} // slot 21 (empty)
|
||||||
virtual bool isUsingDefaultDisplay() const { return false; } // slot 25 (returns false)
|
virtual bool wantComposites() const {
|
||||||
virtual bool storeViewPreferences(QDomElement &) const { return false; } // slot 26
|
return false;
|
||||||
virtual void loadViewPreferences(const QDomElement &) {} // slot 27 (empty impl)
|
} // slot 22 (returns false)
|
||||||
virtual QString cshHelpId(); // slot 28
|
virtual void initActionManager(AC_Manager *) {} // slot 23 (empty impl)
|
||||||
|
virtual bool wantDisplaySelector() const {
|
||||||
|
return false;
|
||||||
|
} // slot 24 (returns false)
|
||||||
|
virtual bool isUsingDefaultDisplay() const {
|
||||||
|
return false;
|
||||||
|
} // slot 25 (returns false)
|
||||||
|
virtual bool storeViewPreferences(QDomElement &) const {
|
||||||
|
return false;
|
||||||
|
} // slot 26
|
||||||
|
virtual void loadViewPreferences(const QDomElement &) {
|
||||||
|
} // slot 27 (empty impl)
|
||||||
|
virtual QString cshHelpId(); // slot 28
|
||||||
|
|
||||||
// ===== MORE PURE VIRTUALS =====
|
// ===== MORE PURE VIRTUALS =====
|
||||||
virtual void triggerMenuChanged() = 0; // slot 29 - MUST override!
|
virtual void triggerMenuChanged() = 0; // slot 29 - MUST override!
|
||||||
|
|
||||||
// Non-virtual methods
|
// Non-virtual methods
|
||||||
void setCaption(const QString &caption);
|
void setCaption(const QString &caption);
|
||||||
@ -294,8 +299,8 @@ public:
|
|||||||
static bool inClosingState();
|
static bool inClosingState();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void copy(const TULayoutView &other); // slot 30
|
virtual void copy(const TULayoutView &other); // slot 30
|
||||||
virtual void isTULayoutView() = 0; // slot 31 - MUST override!
|
virtual void isTULayoutView() = 0; // slot 31 - MUST override!
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Member layout (x64):
|
// Member layout (x64):
|
||||||
@ -310,9 +315,9 @@ private:
|
|||||||
static int _uniqueId; // Static counter for unique names
|
static int _uniqueId; // Static counter for unique names
|
||||||
};
|
};
|
||||||
|
|
||||||
// Note: AC_ResponderTemplateWidget<T> is a template class defined in Toon Boom DLLs
|
// Note: AC_ResponderTemplateWidget<T> is a template class defined in Toon Boom
|
||||||
// that combines a QWidget subclass with AC_Responder capabilities.
|
// DLLs that combines a QWidget subclass with AC_Responder capabilities. Memory
|
||||||
// Memory layout for AC_ResponderTemplateWidget<QWidget>:
|
// layout for AC_ResponderTemplateWidget<QWidget>:
|
||||||
// - +0x00: vptr (QObject)
|
// - +0x00: vptr (QObject)
|
||||||
// - +0x10: vptr (QPaintDevice)
|
// - +0x10: vptr (QPaintDevice)
|
||||||
// - +0x18-0x27: QWidget members
|
// - +0x18-0x27: QWidget members
|
||||||
@ -425,8 +430,10 @@ class TUWidgetLayoutView;
|
|||||||
* @param widget Pointer to TUWidgetLayoutView
|
* @param widget Pointer to TUWidgetLayoutView
|
||||||
* @return Pointer to embedded TULayoutView at offset +104
|
* @return Pointer to embedded TULayoutView at offset +104
|
||||||
*/
|
*/
|
||||||
inline TULayoutView *TUWidgetLayoutView_getLayoutView(TUWidgetLayoutView *widget) {
|
inline TULayoutView *
|
||||||
return reinterpret_cast<TULayoutView *>(reinterpret_cast<char *>(widget) + 104);
|
TUWidgetLayoutView_getLayoutView(TUWidgetLayoutView *widget) {
|
||||||
|
return reinterpret_cast<TULayoutView *>(reinterpret_cast<char *>(widget) +
|
||||||
|
104);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -434,8 +441,10 @@ inline TULayoutView *TUWidgetLayoutView_getLayoutView(TUWidgetLayoutView *widget
|
|||||||
* @param view Pointer to TULayoutView (must be embedded in TUWidgetLayoutView)
|
* @param view Pointer to TULayoutView (must be embedded in TUWidgetLayoutView)
|
||||||
* @return Pointer to containing TUWidgetLayoutView at offset -104
|
* @return Pointer to containing TUWidgetLayoutView at offset -104
|
||||||
*/
|
*/
|
||||||
inline TUWidgetLayoutView *TULayoutView_getWidgetLayoutView(TULayoutView *view) {
|
inline TUWidgetLayoutView *
|
||||||
return reinterpret_cast<TUWidgetLayoutView *>(reinterpret_cast<char *>(view) - 104);
|
TULayoutView_getWidgetLayoutView(TULayoutView *view) {
|
||||||
|
return reinterpret_cast<TUWidgetLayoutView *>(reinterpret_cast<char *>(view) -
|
||||||
|
104);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -654,6 +663,7 @@ public slots:
|
|||||||
virtual void enterEvent(QEnterEvent *event) override;
|
virtual void enterEvent(QEnterEvent *event) override;
|
||||||
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
||||||
virtual void mousePressEvent(QMouseEvent *event) override;
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Qt event overrides
|
// Qt event overrides
|
||||||
virtual void closeEvent(QCloseEvent *event) override;
|
virtual void closeEvent(QCloseEvent *event) override;
|
||||||
@ -800,24 +810,24 @@ protected:
|
|||||||
void selectDefaultLayout();
|
void selectDefaultLayout();
|
||||||
void setUniqueLayout(QString &name);
|
void setUniqueLayout(QString &name);
|
||||||
static void setUniqueLayout(const QList<QString> &existing, QString &name);
|
static void setUniqueLayout(const QList<QString> &existing, QString &name);
|
||||||
void addToolbarConfig(
|
void addToolbarConfig(std::map<QString, ToolbarButtonConfig> &configMap,
|
||||||
std::map<QString, ToolbarButtonConfig> &configMap, const QString &name,
|
const QString &name, const QList<QString> &config,
|
||||||
const QList<QString> &config, bool isDefault);
|
bool isDefault);
|
||||||
void clearToolbarConfig(std::map<QString, ToolbarButtonConfig> &configMap,
|
void clearToolbarConfig(std::map<QString, ToolbarButtonConfig> &configMap,
|
||||||
bool defaultOnly);
|
bool defaultOnly);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Member layout (x64):
|
// Member layout (x64):
|
||||||
// vptr at +0x00
|
// vptr at +0x00
|
||||||
TULayout *m_currentLayout; // +0x08
|
TULayout *m_currentLayout; // +0x08
|
||||||
TULayout *m_previousLayout; // +0x10
|
TULayout *m_previousLayout; // +0x10
|
||||||
std::vector<TULayout *> m_layouts; // +0x18 (24 bytes)
|
std::vector<TULayout *> m_layouts; // +0x18 (24 bytes)
|
||||||
std::vector<TULayout *> m_toolbarLayouts; // +0x30 (24 bytes)
|
std::vector<TULayout *> m_toolbarLayouts; // +0x30 (24 bytes)
|
||||||
QString m_layoutPath; // +0x50 (24 bytes)
|
QString m_layoutPath; // +0x50 (24 bytes)
|
||||||
std::map<QString, ToolbarButtonConfig> *m_globalToolbarConfig; // +0x68
|
std::map<QString, ToolbarButtonConfig> *m_globalToolbarConfig; // +0x68
|
||||||
void *_reserved; // +0x70
|
void *_reserved; // +0x70
|
||||||
std::map<QString, ToolbarButtonConfig> *m_viewToolbarConfig; // +0x78
|
std::map<QString, ToolbarButtonConfig> *m_viewToolbarConfig; // +0x78
|
||||||
int m_flags; // +0x80
|
int m_flags; // +0x80
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -885,21 +895,21 @@ public:
|
|||||||
private:
|
private:
|
||||||
// Member layout (x64):
|
// Member layout (x64):
|
||||||
// QObject members at +0x00 to +0x0F
|
// QObject members at +0x00 to +0x0F
|
||||||
QFrame *m_mainFrame; // +0x10
|
QFrame *m_mainFrame; // +0x10
|
||||||
WID_VBoxLayout *m_mainLayout; // +0x18
|
WID_VBoxLayout *m_mainLayout; // +0x18
|
||||||
char _reserved[0x48]; // +0x20-0x5F (padding)
|
char _reserved[0x48]; // +0x20-0x5F (padding)
|
||||||
std::vector<TULayoutSplitter *> m_splitters; // +0x60
|
std::vector<TULayoutSplitter *> m_splitters; // +0x60
|
||||||
std::vector<TULayoutFrame *> m_frames; // +0x78
|
std::vector<TULayoutFrame *> m_frames; // +0x78
|
||||||
std::vector<TULayoutArea *> m_areas; // +0x90
|
std::vector<TULayoutArea *> m_areas; // +0x90
|
||||||
std::vector<TULayoutArea *> m_pluginAreas; // +0xA8
|
std::vector<TULayoutArea *> m_pluginAreas; // +0xA8
|
||||||
QPoint m_savedPos; // +0xC0
|
QPoint m_savedPos; // +0xC0
|
||||||
QSize m_savedSize; // +0xC8
|
QSize m_savedSize; // +0xC8
|
||||||
int m_stateFlags; // +0xD0
|
int m_stateFlags; // +0xD0
|
||||||
int _padding; // +0xD4
|
int _padding; // +0xD4
|
||||||
TULayoutFrame *m_currentLayoutFrame; // +0xD8
|
TULayoutFrame *m_currentLayoutFrame; // +0xD8
|
||||||
char _reserved2[0x10]; // +0xE0-0xEF (padding)
|
char _reserved2[0x10]; // +0xE0-0xEF (padding)
|
||||||
TULayoutManager *m_owner; // +0xF0
|
TULayoutManager *m_owner; // +0xF0
|
||||||
AC_Manager *m_actionManager; // +0xF8
|
AC_Manager *m_actionManager; // +0xF8
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -941,11 +951,13 @@ public:
|
|||||||
|
|
||||||
// Area management
|
// Area management
|
||||||
bool addArea(const char *type, const QString &name, TULayoutView *view,
|
bool addArea(const char *type, const QString &name, TULayoutView *view,
|
||||||
bool visible, bool createFrame, bool docked, const QSize &minSize,
|
bool visible, bool createFrame, bool docked,
|
||||||
bool useMinSize, bool isPlugin, bool defaultVisible, bool unknown);
|
const QSize &minSize, bool useMinSize, bool isPlugin,
|
||||||
|
bool defaultVisible, bool unknown);
|
||||||
bool addPluginArea(const char *type, const QString &name, TULayoutView *view,
|
bool addPluginArea(const char *type, const QString &name, TULayoutView *view,
|
||||||
bool visible, bool createFrame, bool docked,
|
bool visible, bool createFrame, bool docked,
|
||||||
const QSize &minSize, bool useMinSize, bool defaultVisible);
|
const QSize &minSize, bool useMinSize,
|
||||||
|
bool defaultVisible);
|
||||||
void delAreas(TULayoutFrame *frame = nullptr);
|
void delAreas(TULayoutFrame *frame = nullptr);
|
||||||
TULayoutArea *findArea(const QString &name);
|
TULayoutArea *findArea(const QString &name);
|
||||||
TULayoutArea *findArea(QWidget *widget);
|
TULayoutArea *findArea(QWidget *widget);
|
||||||
@ -968,13 +980,15 @@ public:
|
|||||||
double ratio, Qt::Orientation orientation, TULayoutView *&view,
|
double ratio, Qt::Orientation orientation, TULayoutView *&view,
|
||||||
TULayoutFrame *&newFrame, bool visible, double splitRatio);
|
TULayoutFrame *&newFrame, bool visible, double splitRatio);
|
||||||
bool addViewHorizontal(const char *type, const QString &name,
|
bool addViewHorizontal(const char *type, const QString &name,
|
||||||
TULayoutFrame *frame, double ratio, TULayoutView *&view,
|
TULayoutFrame *frame, double ratio,
|
||||||
TULayoutFrame *&newFrame, bool visible, double splitRatio);
|
TULayoutView *&view, TULayoutFrame *&newFrame,
|
||||||
|
bool visible, double splitRatio);
|
||||||
bool addViewVertical(const char *type, const QString &name,
|
bool addViewVertical(const char *type, const QString &name,
|
||||||
TULayoutFrame *frame, double ratio, TULayoutView *&view,
|
TULayoutFrame *frame, double ratio, TULayoutView *&view,
|
||||||
TULayoutFrame *&newFrame, bool visible, double splitRatio);
|
TULayoutFrame *&newFrame, bool visible,
|
||||||
bool addDetached(const QString &name, const QString &type, TULayoutView *&view,
|
double splitRatio);
|
||||||
TULayoutFrame *&frame);
|
bool addDetached(const QString &name, const QString &type,
|
||||||
|
TULayoutView *&view, TULayoutFrame *&frame);
|
||||||
void deleteAllViews();
|
void deleteAllViews();
|
||||||
TULayoutView *findInstance(const QString &name);
|
TULayoutView *findInstance(const QString &name);
|
||||||
TULayoutView *findInstance(const QWidget *widget);
|
TULayoutView *findInstance(const QWidget *widget);
|
||||||
@ -1022,7 +1036,8 @@ public:
|
|||||||
void registerGlobalToolbar(const QToolBar *toolbar);
|
void registerGlobalToolbar(const QToolBar *toolbar);
|
||||||
void clearGlobalToolBarList();
|
void clearGlobalToolBarList();
|
||||||
void getAllToolbars(std::list<QToolBar *> &viewToolbars,
|
void getAllToolbars(std::list<QToolBar *> &viewToolbars,
|
||||||
std::list<QToolBar *> &globalToolbars, bool includeHidden);
|
std::list<QToolBar *> &globalToolbars,
|
||||||
|
bool includeHidden);
|
||||||
bool isGlobalToolbar(const QString &name) const;
|
bool isGlobalToolbar(const QString &name) const;
|
||||||
bool isGlobalToolbar(const QToolBar *toolbar) const;
|
bool isGlobalToolbar(const QToolBar *toolbar) const;
|
||||||
virtual bool getMainToolbarDefaultVisibility(const QToolBar &toolbar) const;
|
virtual bool getMainToolbarDefaultVisibility(const QToolBar &toolbar) const;
|
||||||
@ -1112,7 +1127,8 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void sortToolbarList(QList<QToolBar *> list,
|
void sortToolbarList(QList<QToolBar *> list,
|
||||||
std::list<QToolBar *> &viewToolbars,
|
std::list<QToolBar *> &viewToolbars,
|
||||||
std::list<QToolBar *> &globalToolbars, bool includeHidden);
|
std::list<QToolBar *> &globalToolbars,
|
||||||
|
bool includeHidden);
|
||||||
QToolBar *getToolbarUnderMouse();
|
QToolBar *getToolbarUnderMouse();
|
||||||
void moveGlobalToolbar();
|
void moveGlobalToolbar();
|
||||||
void toolbarWasCustomized(QString name);
|
void toolbarWasCustomized(QString name);
|
||||||
@ -1124,9 +1140,9 @@ private:
|
|||||||
// TULayoutStorage members at +0x28 to +0xAF
|
// TULayoutStorage members at +0x28 to +0xAF
|
||||||
// PLUG_ToolbarService at +0xB0
|
// PLUG_ToolbarService at +0xB0
|
||||||
// PLUG_MenuService at +0xB8
|
// PLUG_MenuService at +0xB8
|
||||||
bool m_unknown; // +0xC0
|
bool m_unknown; // +0xC0
|
||||||
char _padding[7]; // +0xC1-0xC7
|
char _padding[7]; // +0xC1-0xC7
|
||||||
TULayoutManager_Private *m_private; // +0xC8
|
TULayoutManager_Private *m_private; // +0xC8
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TOON_BOOM_LAYOUT_HPP
|
#endif // TOON_BOOM_LAYOUT_HPP
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user