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
|
||||||
*
|
*
|
||||||
@ -236,7 +228,8 @@ public:
|
|||||||
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,
|
||||||
|
MenuType type); // slot 8
|
||||||
virtual void setMenu(AC_Menu *menu, MenuType type); // slot 9
|
virtual void setMenu(AC_Menu *menu, MenuType type); // slot 9
|
||||||
virtual AC_Menu *menu(MenuType type); // slot 10
|
virtual AC_Menu *menu(MenuType type); // slot 10
|
||||||
|
|
||||||
@ -270,16 +263,28 @@ public:
|
|||||||
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 {
|
||||||
|
return false;
|
||||||
|
} // slot 18 (returns false)
|
||||||
virtual QString displayName() const; // slot 19
|
virtual QString displayName() const; // slot 19
|
||||||
virtual void compositeChanged(const QString &) {} // slot 20 (empty impl)
|
virtual void compositeChanged(const QString &) {} // slot 20 (empty impl)
|
||||||
virtual void dropOverComposite(QDropEvent *, const QString &) {} // slot 21 (empty)
|
virtual void dropOverComposite(QDropEvent *, const QString &) {
|
||||||
virtual bool wantComposites() const { return false; } // slot 22 (returns false)
|
} // slot 21 (empty)
|
||||||
|
virtual bool wantComposites() const {
|
||||||
|
return false;
|
||||||
|
} // slot 22 (returns false)
|
||||||
virtual void initActionManager(AC_Manager *) {} // slot 23 (empty impl)
|
virtual void initActionManager(AC_Manager *) {} // slot 23 (empty impl)
|
||||||
virtual bool wantDisplaySelector() const { return false; } // slot 24 (returns false)
|
virtual bool wantDisplaySelector() const {
|
||||||
virtual bool isUsingDefaultDisplay() const { return false; } // slot 25 (returns false)
|
return false;
|
||||||
virtual bool storeViewPreferences(QDomElement &) const { return false; } // slot 26
|
} // slot 24 (returns false)
|
||||||
virtual void loadViewPreferences(const QDomElement &) {} // slot 27 (empty impl)
|
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
|
virtual QString cshHelpId(); // slot 28
|
||||||
|
|
||||||
// ===== MORE PURE VIRTUALS =====
|
// ===== MORE PURE VIRTUALS =====
|
||||||
@ -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,9 +810,9 @@ 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);
|
||||||
|
|
||||||
@ -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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user