diff options
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/brdwin.cxx | 16 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 74 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 48 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 34 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 204 |
5 files changed, 250 insertions, 126 deletions
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 45b83b098e71..6d05ba906783 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -2354,20 +2354,4 @@ Size ImplBorderWindow::GetOptimalSize(WindowSizeType eType) const return Size(0, 0); } -void ImplBorderWindow::setChildAnyProperty(const rtl::OString &rString, const ::com::sun::star::uno::Any &rValue) -{ - Window* pClientWindow = ImplGetClientWindow(); - if (pClientWindow) - pClientWindow->setChildAnyProperty(rString, rValue); -} - -::com::sun::star::uno::Any ImplBorderWindow::getWidgetAnyProperty(const rtl::OString &rString) const -{ - ::com::sun::star::uno::Any aAny; - Window* pClientWindow = ImplGetClientWindow(); - if (pClientWindow) - aAny = pClientWindow->getWidgetAnyProperty(rString); - return aAny; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 43f4030a974e..0176bfadfe23 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -599,8 +599,8 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader) for (size_t i = 0; i < aChilds.size(); ++i) { - sal_uInt16 nPosition = aChilds[i]->getWidgetProperty<sal_uInt16>(sPosition, 0xFFFF); - if (nPosition == 0xFFFF) + sal_Int32 nPosition = get_window_packing_position(aChilds[i]); + if (nPosition == -1) continue; reorderWithinParent(*aChilds[i], nPosition); } @@ -832,29 +832,44 @@ void VclBuilder::applyPackingProperty(Window *pCurrent, xmlreader::XmlReader::TEXT_NORMALIZED, &name, &nsId); rtl::OString sValue(name.begin, name.length); - if ( sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("expand")) || - sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("fill")) ) + if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("expand"))) { bool bTrue = (sValue[0] == 't' || sValue[0] == 'T' || sValue[0] == '1'); - pCurrent->setChildProperty(sKey, bTrue); + pCurrent->set_expand(bTrue); } - else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("position"))) + else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("fill"))) { - pCurrent->setChildProperty(sKey, static_cast<sal_uInt16>(sValue.toInt32())); + bool bTrue = (sValue[0] == 't' || sValue[0] == 'T' || sValue[0] == '1'); + pCurrent->set_fill(bTrue); } else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("pack-type"))) { - sal_Int32 nPackType = (sValue[0] == 'e' || sValue[0] == 'e') ? VCL_PACK_END : VCL_PACK_START; - pCurrent->setChildProperty(sKey, nPackType); + VclPackType ePackType = (sValue[0] == 'e' || sValue[0] == 'e') ? VCL_PACK_END : VCL_PACK_START; + pCurrent->set_pack_type(ePackType); + } + else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("left-attach"))) + { + pCurrent->set_grid_left_attach(sValue.toInt32()); + } + else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("top-attach"))) + { + pCurrent->set_grid_top_attach(sValue.toInt32()); } - else if ( - sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("left-attach")) || - sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("top-attach")) || - sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("width")) || - sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("height")) - ) + else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("width"))) { - pCurrent->setChildProperty(sKey, sValue.toInt32()); + pCurrent->set_grid_width(sValue.toInt32()); + } + else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("height"))) + { + pCurrent->set_grid_height(sValue.toInt32()); + } + else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("padding"))) + { + pCurrent->set_padding(sValue.toInt32()); + } + else if (sKey.equalsL(RTL_CONSTASCII_STRINGPARAM("position"))) + { + set_window_packing_position(pCurrent, sValue.toInt32()); } else fprintf(stderr, "unknown packing %s\n", sKey.getStr()); @@ -934,9 +949,9 @@ Window *VclBuilder::get_by_name(rtl::OString sID) return NULL; } -rtl::OString VclBuilder::get_by_window(const Window *pWindow) +rtl::OString VclBuilder::get_by_window(const Window *pWindow) const { - for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(), + for (std::vector<WinAndId>::const_iterator aI = m_aChildren.begin(), aEnd = m_aChildren.end(); aI != aEnd; ++aI) { if (aI->m_pWindow == pWindow) @@ -946,6 +961,28 @@ rtl::OString VclBuilder::get_by_window(const Window *pWindow) return rtl::OString(); } +sal_Int32 VclBuilder::get_window_packing_position(const Window *pWindow) const +{ + for (std::vector<WinAndId>::const_iterator aI = m_aChildren.begin(), + aEnd = m_aChildren.end(); aI != aEnd; ++aI) + { + if (aI->m_pWindow == pWindow) + return aI->m_nPosition; + } + + return -1; +} + +void VclBuilder::set_window_packing_position(const Window *pWindow, sal_Int32 nPosition) +{ + for (std::vector<WinAndId>::iterator aI = m_aChildren.begin(), + aEnd = m_aChildren.end(); aI != aEnd; ++aI) + { + if (aI->m_pWindow == pWindow) + aI->m_nPosition = nPosition; + } +} + VclBuilder::ListStore *VclBuilder::get_model_by_name(rtl::OString sID) { for (std::vector<ModelAndId>::iterator aI = m_aModels.begin(), @@ -994,7 +1031,6 @@ void VclBuilder::swapGuts(Window &rOrig, Window &rReplacement) Window *pOrigsNext = rOrig.mpWindowImpl->mpNext; Window *pOrigsPrev = rOrig.mpWindowImpl->mpPrev; std::swap(rOrig.mpWindowImpl, rReplacement.mpWindowImpl); - std::swap(rOrig.m_aWidgetProperties, rReplacement.m_aWidgetProperties); assert(rReplacement.mpWindowImpl->mpPrev == pOrigsPrev); assert(rReplacement.mpWindowImpl->mpNext == pOrigsNext); if (pOrigsNext) diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index d3a8ab4757c7..6c9305c4f56c 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -170,7 +170,7 @@ void VclBox::setAllocation(const Size &rAllocation) if (!pChild->IsVisible()) continue; ++nVisibleChildren; - bool bExpand = pChild->getWidgetProperty<sal_Bool>(sExpand); + bool bExpand = pChild->get_expand(); if (bExpand) ++nExpandChildren; } @@ -210,12 +210,12 @@ void VclBox::setAllocation(const Size &rAllocation) if (!pChild->IsVisible()) continue; - sal_Int32 ePacking = pChild->getWidgetProperty<sal_Int32>(sPackType); + sal_Int32 ePacking = pChild->get_pack_type(); if (ePacking != ePackType) continue; - long nPadding = pChild->getWidgetProperty<sal_Int32>(sPadding); + long nPadding = pChild->get_padding(); Size aBoxSize; if (m_bHomogeneous) @@ -225,7 +225,7 @@ void VclBox::setAllocation(const Size &rAllocation) aBoxSize = pChild->get_preferred_size(); long nPrimaryDimension = getPrimaryDimension(aBoxSize); nPrimaryDimension += nPadding; - bool bExpand = pChild->getWidgetProperty<bool>(sExpand); + bool bExpand = pChild->get_expand(); if (bExpand) setPrimaryDimension(aBoxSize, nPrimaryDimension + nExtraSpace); } @@ -235,7 +235,7 @@ void VclBox::setAllocation(const Size &rAllocation) Size aChildSize(aBoxSize); long nPrimaryCoordinate = getPrimaryCoordinate(aPos); - bool bFill = pChild->getWidgetProperty<sal_Bool>(sFill, sal_True); + bool bFill = pChild->get_fill(); if (bFill) { setPrimaryDimension(aChildSize, std::max(static_cast<long>(1), @@ -287,10 +287,8 @@ Size VclButtonBox::calculateRequisition() const { sal_uInt16 nVisibleChildren = 0; - rtl::OString sChildMinWidth(RTL_CONSTASCII_STRINGPARAM("child-min-width")); - sal_Int32 nChildMinWidth = getWidgetStyleProperty<sal_Int32>(sChildMinWidth, DEFAULT_CHILD_MIN_WIDTH); - rtl::OString sChildMinHeight(RTL_CONSTASCII_STRINGPARAM("child-min-height")); - sal_Int32 nChildMinHeight = getWidgetStyleProperty<sal_Int32>(sChildMinHeight, DEFAULT_CHILD_MIN_HEIGHT); + sal_Int32 nChildMinWidth = DEFAULT_CHILD_MIN_WIDTH; //to-do, pull from theme + sal_Int32 nChildMinHeight = DEFAULT_CHILD_MIN_HEIGHT; //to-do, pull from theme Size aSize(nChildMinWidth, nChildMinHeight); for (Window *pChild = GetWindow(WINDOW_FIRSTCHILD); pChild; pChild = pChild->GetWindow(WINDOW_NEXT)) @@ -413,12 +411,12 @@ VclGrid::array_type VclGrid::assembleGrid() const if (!pChild->IsVisible()) continue; - sal_Int32 nLeftAttach = pChild->getWidgetProperty<sal_Int32>(sLeftAttach); - sal_Int32 nWidth = pChild->getWidgetProperty<sal_Int32>(sWidth, 1); + sal_Int32 nLeftAttach = pChild->get_grid_left_attach(); + sal_Int32 nWidth = pChild->get_grid_width(); sal_Int32 nMaxXPos = nLeftAttach+nWidth-1; - sal_Int32 nTopAttach = pChild->getWidgetProperty<sal_Int32>(sTopAttach); - sal_Int32 nHeight = pChild->getWidgetProperty<sal_Int32>(sHeight, 1); + sal_Int32 nTopAttach = pChild->get_grid_top_attach(); + sal_Int32 nHeight = pChild->get_grid_height(); sal_Int32 nMaxYPos = nTopAttach+nHeight-1; sal_Int32 nCurrentMaxXPos = A.shape()[0]-1; @@ -448,11 +446,11 @@ VclGrid::array_type VclGrid::assembleGrid() const const Window *pChild = A[x][y]; if (pChild) { - sal_Int32 nWidth = pChild->getWidgetProperty<sal_Int32>(sWidth, 1); + sal_Int32 nWidth = pChild->get_grid_width(); for (sal_Int32 nSpanX = 0; nSpanX < nWidth; ++nSpanX) aNonEmptyCols[x+nSpanX] = true; - sal_Int32 nHeight = pChild->getWidgetProperty<sal_Int32>(sHeight, 1); + sal_Int32 nHeight = pChild->get_grid_height(); for (sal_Int32 nSpanY = 0; nSpanY < nHeight; ++nSpanY) aNonEmptyRows[y+nSpanY] = true; } @@ -514,11 +512,11 @@ void VclGrid::calcMaxs(const array_type &A, std::vector<long> &rWidths, std::vec continue; Size aChildSize = pChild->get_preferred_size(); - sal_Int32 nWidth = pChild->getWidgetProperty<sal_Int32>(sWidth, 1); + sal_Int32 nWidth = pChild->get_grid_width(); for (sal_Int32 nSpanX = 0; nSpanX < nWidth; ++nSpanX) rWidths[x+nSpanX] = std::max(rWidths[x+nSpanX], aChildSize.Width()/nWidth); - sal_Int32 nHeight = pChild->getWidgetProperty<sal_Int32>(sHeight, 1); + sal_Int32 nHeight = pChild->get_grid_height(); for (sal_Int32 nSpanY = 0; nSpanY < nHeight; ++nSpanY) rHeights[y+nSpanY] = std::max(rHeights[y+nSpanY], aChildSize.Height()/nHeight); } @@ -619,12 +617,12 @@ void VclGrid::setAllocation(const Size& rAllocation) { Size aChildAlloc(0, 0); - sal_Int32 nWidth = pChild->getWidgetProperty<sal_Int32>(sWidth, 1); + sal_Int32 nWidth = pChild->get_grid_width(); for (sal_Int32 nSpanX = 0; nSpanX < nWidth; ++nSpanX) aChildAlloc.Width() += aWidths[x+nSpanX]; aChildAlloc.Width() += get_column_spacing()*(nWidth-1); - sal_Int32 nHeight = pChild->getWidgetProperty<sal_Int32>(sHeight, 1); + sal_Int32 nHeight = pChild->get_grid_height(); for (sal_Int32 nSpanY = 0; nSpanY < nHeight; ++nSpanY) aChildAlloc.Height() += aHeights[y+nSpanY]; aChildAlloc.Height() += get_row_spacing()*(nHeight-1); @@ -715,14 +713,10 @@ bool VclGrid::set_property(const rtl::OString &rKey, const rtl::OString &rValue) void setGridAttach(Window &rWidget, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nWidth, sal_Int32 nHeight) { - rtl::OString sLeftAttach(RTL_CONSTASCII_STRINGPARAM("left-attach")); - rWidget.setChildProperty<sal_Int32>(sLeftAttach, nLeft); - rtl::OString sTopAttach(RTL_CONSTASCII_STRINGPARAM("top-attach")); - rWidget.setChildProperty<sal_Int32>(sTopAttach, nTop); - rtl::OString sWidth(RTL_CONSTASCII_STRINGPARAM("width")); - rWidget.setChildProperty<sal_Int32>(sWidth, nWidth); - rtl::OString sHeight(RTL_CONSTASCII_STRINGPARAM("height")); - rWidget.setChildProperty<sal_Int32>(sHeight, nHeight); + rWidget.set_grid_left_attach(nLeft); + rWidget.set_grid_top_attach(nTop); + rWidget.set_grid_width(nWidth); + rWidget.set_grid_height(nHeight); } const Window *VclBin::get_child() const diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 543dfe07557b..997499125e48 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -634,6 +634,14 @@ void Window::ImplInitWindowData( WindowType nType ) mpWindowImpl->mnDlgCtrlFlags = 0; // DialogControl-Flags mpWindowImpl->mnLockCount = 0; // LockCount mpWindowImpl->meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called + mpWindowImpl->meHalign = VCL_ALIGN_FILL; + mpWindowImpl->meValign = VCL_ALIGN_FILL; + mpWindowImpl->mePackType = VCL_PACK_START; + mpWindowImpl->mnPadding = 0; + mpWindowImpl->mnGridHeight = 1; + mpWindowImpl->mnGridLeftAttach = 0; + mpWindowImpl->mnGridTopAttach = 0; + mpWindowImpl->mnGridWidth = 1; mpWindowImpl->mbFrame = sal_False; // sal_True: Window is a frame window mpWindowImpl->mbBorderWin = sal_False; // sal_True: Window is a border window mpWindowImpl->mbOverlapWin = sal_False; // sal_True: Window is a overlap window @@ -711,8 +719,8 @@ void Window::ImplInitWindowData( WindowType nType ) mpWindowImpl->mbFakeFocusSet = sal_False; // sal_True: pretend as if the window has focus. mpWindowImpl->mbHexpand = false; mpWindowImpl->mbVexpand = false; - mpWindowImpl->meHalign = VCL_ALIGN_FILL; - mpWindowImpl->meValign = VCL_ALIGN_FILL; + mpWindowImpl->mbExpand = false; + mpWindowImpl->mbFill = true; mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // sal_True: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active @@ -5411,28 +5419,6 @@ void Window::SetStyle( WinBits nStyle ) } } -void Window::set_height_request(sal_Int32 nHeightRequest) -{ - DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - - if ( mpWindowImpl->mnHeightRequest != nHeightRequest ) - { - mpWindowImpl->mnHeightRequest = nHeightRequest; - queue_resize(); - } -} - -void Window::set_width_request(sal_Int32 nWidthRequest) -{ - DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - - if ( mpWindowImpl->mnWidthRequest != nWidthRequest ) - { - mpWindowImpl->mnWidthRequest = nWidthRequest; - queue_resize(); - } -} - // ----------------------------------------------------------------------- void Window::SetExtendedStyle( WinBits nExtendedStyle ) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index b966a19de7cd..f760f130f423 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1761,34 +1761,6 @@ void Window::queue_resize() pParent->Resize(); } -void Window::setChildAnyProperty(const rtl::OString &rString, const uno::Any &rValue) -{ - m_aWidgetProperties[rString] <<= rValue; -} - -uno::Any Window::getWidgetAnyProperty(const rtl::OString &rString) const -{ - uno::Any aAny; - ChildPropertyMap::const_iterator aI = m_aWidgetProperties.find(rString); - if (aI != m_aWidgetProperties.end()) - aAny = aI->second; - return aAny; -} - -Size Window::get_preferred_size() const -{ - Size aRet(mpWindowImpl->mnWidthRequest, mpWindowImpl->mnHeightRequest); - if (aRet.Width() == -1 || aRet.Height() == -1) - { - Size aOptimal = GetOptimalSize(WINDOWSIZE_PREFERRED); - if (aRet.Width() == -1) - aRet.Width() = aOptimal.Width(); - if (aRet.Height() == -1) - aRet.Height() = aOptimal.Height(); - } - return aRet; -} - void Window::take_properties(Window &rOther) { if (!mpWindowImpl) @@ -1838,6 +1810,14 @@ void Window::take_properties(Window &rOther) mpWindowImpl->mnDlgCtrlFlags = pWindowImpl->mnDlgCtrlFlags; mpWindowImpl->mnLockCount = pWindowImpl->mnLockCount; mpWindowImpl->meAlwaysInputMode = pWindowImpl->meAlwaysInputMode; + mpWindowImpl->meHalign = pWindowImpl->meHalign; + mpWindowImpl->meValign = pWindowImpl->meValign; + mpWindowImpl->mePackType = pWindowImpl->mePackType; + mpWindowImpl->mnPadding = pWindowImpl->mnPadding; + mpWindowImpl->mnGridHeight = pWindowImpl->mnGridHeight; + mpWindowImpl->mnGridLeftAttach = pWindowImpl->mnGridLeftAttach; + mpWindowImpl->mnGridTopAttach = pWindowImpl->mnGridTopAttach; + mpWindowImpl->mnGridWidth = pWindowImpl->mnGridWidth; mpWindowImpl->mbFrame = pWindowImpl->mbFrame; mpWindowImpl->mbBorderWin = pWindowImpl->mbBorderWin; mpWindowImpl->mbOverlapWin = pWindowImpl->mbOverlapWin; @@ -1914,10 +1894,8 @@ void Window::take_properties(Window &rOther) mpWindowImpl->mbFakeFocusSet = pWindowImpl->mbFakeFocusSet; mpWindowImpl->mbHexpand = pWindowImpl->mbHexpand; mpWindowImpl->mbVexpand = pWindowImpl->mbVexpand; - mpWindowImpl->meHalign = pWindowImpl->meHalign; - mpWindowImpl->meValign = pWindowImpl->meValign; - - std::swap(m_aWidgetProperties, rOther.m_aWidgetProperties); + mpWindowImpl->mbExpand = pWindowImpl->mbExpand; + mpWindowImpl->mbFill = pWindowImpl->mbFill; bool bHasBorderWindow = mpWindowImpl->mpBorderWindow; bool bOtherHasBorderWindow = pWindowImpl->mpBorderWindow; @@ -2018,44 +1996,190 @@ bool Window::set_property(const rtl::OString &rKey, const rtl::OString &rValue) return true; } +void Window::set_height_request(sal_Int32 nHeightRequest) +{ + DBG_CHKTHIS( Window, ImplDbgCheckWindow ); + + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + + if ( pWindowImpl->mnHeightRequest != nHeightRequest ) + { + pWindowImpl->mnHeightRequest = nHeightRequest; + queue_resize(); + } +} + +void Window::set_width_request(sal_Int32 nWidthRequest) +{ + DBG_CHKTHIS( Window, ImplDbgCheckWindow ); + + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + + if ( pWindowImpl->mnWidthRequest != nWidthRequest ) + { + pWindowImpl->mnWidthRequest = nWidthRequest; + queue_resize(); + } +} + +Size Window::get_preferred_size() const +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + + Size aRet(pWindowImpl->mnWidthRequest, pWindowImpl->mnHeightRequest); + if (aRet.Width() == -1 || aRet.Height() == -1) + { + Size aOptimal = GetOptimalSize(WINDOWSIZE_PREFERRED); + if (aRet.Width() == -1) + aRet.Width() = aOptimal.Width(); + if (aRet.Height() == -1) + aRet.Height() = aOptimal.Height(); + } + return aRet; +} + VclAlign Window::get_halign() const { - return mpWindowImpl->meHalign; + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->meHalign; } void Window::set_halign(VclAlign eAlign) { - mpWindowImpl->meHalign = eAlign; + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->meHalign = eAlign; } VclAlign Window::get_valign() const { - return mpWindowImpl->meValign; + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->meValign; } void Window::set_valign(VclAlign eAlign) { - mpWindowImpl->meValign = eAlign; + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->meValign = eAlign; } bool Window::get_hexpand() const { - return mpWindowImpl->mbHexpand; + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mbHexpand; } void Window::set_hexpand(bool bExpand) { - mpWindowImpl->mbHexpand = bExpand; + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mbHexpand = bExpand; } bool Window::get_vexpand() const { - return mpWindowImpl->mbVexpand; + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mbVexpand; } void Window::set_vexpand(bool bExpand) { - mpWindowImpl->mbVexpand = bExpand; + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mbVexpand = bExpand; +} + +bool Window::get_expand() const +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mbExpand; +} + +void Window::set_expand(bool bExpand) +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mbExpand = bExpand; +} + +VclPackType Window::get_pack_type() const +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mePackType; +} + +void Window::set_pack_type(VclPackType ePackType) +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mePackType = ePackType; +} + +sal_Int32 Window::get_padding() const +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mnPadding; +} + +void Window::set_padding(sal_Int32 nPadding) +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mnPadding = nPadding; +} + +bool Window::get_fill() const +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mbFill; +} + +void Window::set_fill(bool bFill) +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mbFill = bFill; +} + +sal_Int32 Window::get_grid_width() const +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mnGridWidth; +} + +void Window::set_grid_width(sal_Int32 nCols) +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mnGridWidth = nCols; +} + +sal_Int32 Window::get_grid_left_attach() const +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mnGridLeftAttach; +} + +void Window::set_grid_left_attach(sal_Int32 nAttach) +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mnGridLeftAttach = nAttach; +} + +sal_Int32 Window::get_grid_height() const +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mnGridHeight; +} + +void Window::set_grid_height(sal_Int32 nRows) +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mnGridHeight = nRows; +} + +sal_Int32 Window::get_grid_top_attach() const +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + return pWindowImpl->mnGridTopAttach; +} + +void Window::set_grid_top_attach(sal_Int32 nAttach) +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mnGridTopAttach = nAttach; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |