diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-23 11:20:40 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-09-23 14:11:39 +0300 |
commit | 827c46e7d75000cb03b0ce21759f9d0825f0c096 (patch) | |
tree | 3a84ccc45d54607c61328b18f58f914c1d6ec240 /include/vcl/builder.hxx | |
parent | 7cbbefae224ab85343accb42b03f9431ec693a83 (diff) |
fdo#82577: Handle Window
Put the VCL Window class in the vcl namespace. Avoids clash with the X11
Window typedef.
Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
Diffstat (limited to 'include/vcl/builder.hxx')
-rw-r--r-- | include/vcl/builder.hxx | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index f9adddb84585..4e62f41f95fc 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -44,7 +44,7 @@ class VCL_DLLPUBLIC VclBuilder: private boost::noncopyable { public: typedef std::map<OString, OString> stringmap; - typedef ::Window* (*customMakeWidget)(::Window *pParent, stringmap &rVec); + typedef vcl::Window* (*customMakeWidget)(vcl::Window *pParent, stringmap &rVec); private: typedef boost::ptr_map<OUString, osl::Module> ModuleMap; //We store these until the builder is deleted, that way we can use the @@ -73,10 +73,10 @@ private: struct WinAndId { OString m_sID; - ::Window *m_pWindow; + vcl::Window *m_pWindow; short m_nResponseId; PackingData m_aPackingData; - WinAndId(const OString &rId, ::Window *pWindow, bool bVertical) + WinAndId(const OString &rId, vcl::Window *pWindow, bool bVertical) : m_sID(rId) , m_pWindow(pWindow) , m_nResponseId(RET_CANCEL) @@ -184,7 +184,7 @@ private: } }; - typedef std::map< ::Window*, stringmap> AtkMap; + typedef std::map< vcl::Window*, stringmap> AtkMap; struct ParserState { @@ -209,7 +209,7 @@ private: Translations m_aTranslations; - std::map< ::Window*, ::Window*> m_aRedundantParentWidgets; + std::map< vcl::Window*, vcl::Window*> m_aRedundantParentWidgets; std::vector<SizeGroup> m_aSizeGroups; @@ -232,17 +232,17 @@ private: OString m_sID; OString m_sHelpRoot; ResHookProc m_pStringReplace; - ::Window *m_pParent; + vcl::Window *m_pParent; bool m_bToplevelHasDeferredInit; bool m_bToplevelHasDeferredProperties; bool m_bToplevelParentFound; ParserState *m_pParserState; - ::Window *get_by_name(const OString& sID); + vcl::Window *get_by_name(const OString& sID); void delete_by_name(const OString& sID); class sortIntoBestTabTraversalOrder - : public std::binary_function<const ::Window*, const ::Window*, bool> + : public std::binary_function<const vcl::Window*, const vcl::Window*, bool> { VclBuilder *m_pBuilder; public: @@ -250,22 +250,22 @@ private: : m_pBuilder(pBuilder) { } - bool operator()(const ::Window *pA, const ::Window *pB) const; + bool operator()(const vcl::Window *pA, const vcl::Window *pB) const; }; /// XFrame to be able to extract labels and other properties of the UNO commands (like of .uno:Bold). css::uno::Reference<css::frame::XFrame> m_xFrame; public: - VclBuilder(::Window *pParent, const OUString& sUIRootDir, const OUString& sUIFile, + VclBuilder(vcl::Window *pParent, const OUString& sUIRootDir, const OUString& sUIFile, const OString& sID = OString(), const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>()); ~VclBuilder(); - ::Window *get_widget_root(); + vcl::Window *get_widget_root(); //sID must exist and be of type T template <typename T> T* get(T*& ret, const OString& sID) { - ::Window *w = get_by_name(sID); + vcl::Window *w = get_by_name(sID); SAL_WARN_IF(!w, "vcl.layout", "widget \"" << sID.getStr() << "\" not found in .ui"); SAL_WARN_IF(!dynamic_cast<T*>(w), "vcl.layout", ".ui widget \"" << sID.getStr() << "\" needs to correspond to vcl type " << typeid(T).name()); @@ -281,9 +281,9 @@ public: return ret; } //sID may not exist, but must be of type T if it does - template <typename T /*= ::Window if we had c++11*/> T* get(const OString& sID) + template <typename T /*= vcl::Window if we had c++11*/> T* get(const OString& sID) { - ::Window *w = get_by_name(sID); + vcl::Window *w = get_by_name(sID); SAL_WARN_IF(w && !dynamic_cast<T*>(w), "vcl.layout", ".ui widget \"" << sID.getStr() << "\" needs to correspond to vcl type " << typeid(T).name()); assert(!w || dynamic_cast<T*>(w)); @@ -293,16 +293,16 @@ public: PopupMenu* get_menu(const OString& sID); //given an sID return the response value for that widget - short get_response(const ::Window *pWindow) const; + short get_response(const vcl::Window *pWindow) const; - OString get_by_window(const ::Window *pWindow) const; - void delete_by_window(const ::Window *pWindow); + OString get_by_window(const vcl::Window *pWindow) const; + void delete_by_window(const vcl::Window *pWindow); //release ownership of pWindow, i.e. don't delete it - void drop_ownership(const ::Window *pWindow); + void drop_ownership(const vcl::Window *pWindow); //apply the properties of rProps to pWindow - static void set_properties(::Window *pWindow, const stringmap &rProps); + static void set_properties(vcl::Window *pWindow, const stringmap &rProps); //Convert _ gtk markup to ~ vcl markup static OString convertMnemonicMarkup(const OString &rIn); @@ -322,8 +322,8 @@ public: void setDeferredProperties(); //Helpers to retrofit all the existing code to the builder - static void reorderWithinParent(std::vector< ::Window*>& rChilds, bool bIsButtonBox); - static void reorderWithinParent(::Window &rWindow, sal_uInt16 nNewPosition); + static void reorderWithinParent(std::vector< vcl::Window*>& rChilds, bool bIsButtonBox); + static void reorderWithinParent(vcl::Window &rWindow, sal_uInt16 nNewPosition); /// Get label of the command (like of .uno:Save) from the description service static OUString getCommandLabel(const OUString& rCommand, const css::uno::Reference<css::uno::XComponentContext>& rContext, const OUString& rModuleId); @@ -335,12 +335,12 @@ public: css::uno::Reference<css::frame::XFrame> getFrame() { return m_xFrame; } private: - ::Window *insertObject(::Window *pParent, + vcl::Window *insertObject(vcl::Window *pParent, const OString &rClass, const OString &rID, stringmap &rProps, stringmap &rPangoAttributes, stringmap &rAtkProps, std::vector<OString> &rItems); - ::Window *makeObject(::Window *pParent, + vcl::Window *makeObject(vcl::Window *pParent, const OString &rClass, const OString &rID, stringmap &rVec, const std::vector<OString> &rItems); @@ -358,10 +358,10 @@ private: void handleTranslations(xmlreader::XmlReader &reader); - void handleChild(::Window *pParent, xmlreader::XmlReader &reader); - ::Window* handleObject(::Window *pParent, xmlreader::XmlReader &reader); - void handlePacking(::Window *pCurrent, ::Window *pParent, xmlreader::XmlReader &reader); - void applyPackingProperty(::Window *pCurrent, ::Window *pParent, xmlreader::XmlReader &reader); + void handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader); + vcl::Window* handleObject(vcl::Window *pParent, xmlreader::XmlReader &reader); + void handlePacking(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader); + void applyPackingProperty(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader); void collectProperty(xmlreader::XmlReader &reader, const OString &rID, stringmap &rVec); void collectPangoAttribute(xmlreader::XmlReader &reader, stringmap &rMap); void collectAtkAttribute(xmlreader::XmlReader &reader, stringmap &rMap); @@ -376,21 +376,21 @@ private: void handleRow(xmlreader::XmlReader &reader, const OString &rID, sal_Int32 nRowIndex); void handleAdjustment(const OString &rID, stringmap &rProperties); void handleTextBuffer(const OString &rID, stringmap &rProperties); - void handleTabChild(::Window *pParent, xmlreader::XmlReader &reader); + void handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &reader); void handleMenu(xmlreader::XmlReader &reader, const OString &rID); std::vector<OString> handleItems(xmlreader::XmlReader &reader, const OString &rID); void handleSizeGroup(xmlreader::XmlReader &reader, const OString &rID); - void handleAtkObject(xmlreader::XmlReader &reader, const OString &rID, ::Window *pWindow); + void handleAtkObject(xmlreader::XmlReader &reader, const OString &rID, vcl::Window *pWindow); void handleActionWidget(xmlreader::XmlReader &reader); - PackingData get_window_packing_data(const ::Window *pWindow) const; - void set_window_packing_position(const ::Window *pWindow, sal_Int32 nPosition); + PackingData get_window_packing_data(const vcl::Window *pWindow) const; + void set_window_packing_position(const vcl::Window *pWindow, sal_Int32 nPosition); - ::Window* prepareWidgetOwnScrolling(::Window *pParent, WinBits &rWinStyle); - void cleanupWidgetOwnScrolling(::Window *pScrollParent, ::Window *pWindow, stringmap &rMap); + vcl::Window* prepareWidgetOwnScrolling(vcl::Window *pParent, WinBits &rWinStyle); + void cleanupWidgetOwnScrolling(vcl::Window *pScrollParent, vcl::Window *pWindow, stringmap &rMap); void set_response(const OString& sID, short nResponse); }; @@ -421,7 +421,7 @@ public: { return m_pUIBuilder->get<T>(ret, sID); } - template <typename T /*= ::Window if we had c++11*/> T* get(const OString & sID) + template <typename T /*= vcl::Window if we had c++11*/> T* get(const OString & sID) { return m_pUIBuilder->get<T>(sID); } |