/src/libreoffice/vcl/source/window/window3.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | |
20 | | #include <vcl/window.hxx> |
21 | | #include <window.h> |
22 | | #include <vcl/cursor.hxx> |
23 | | #include <salframe.hxx> |
24 | | |
25 | | namespace vcl |
26 | | { |
27 | 0 | Size Window::GetOptimalSize() const { return Size(); } |
28 | | |
29 | | void Window::ImplAdjustNWFSizes() |
30 | 0 | { |
31 | 0 | for (Window* pWin = GetWindow(GetWindowType::FirstChild); pWin; |
32 | 0 | pWin = pWin->GetWindow(GetWindowType::Next)) |
33 | 0 | pWin->ImplAdjustNWFSizes(); |
34 | 0 | } |
35 | | |
36 | | void WindowOutputDevice::ImplClearFontData(bool bNewFontLists) |
37 | 0 | { |
38 | 0 | OutputDevice::ImplClearFontData(bNewFontLists); |
39 | 0 | for (Window* pChild = mxOwnerWindow->mpWindowImpl->mpFirstChild; pChild; |
40 | 0 | pChild = pChild->mpWindowImpl->mpNext) |
41 | 0 | pChild->GetOutDev()->ImplClearFontData(bNewFontLists); |
42 | 0 | } |
43 | | |
44 | | void WindowOutputDevice::ImplRefreshFontData(bool bNewFontLists) |
45 | 0 | { |
46 | 0 | OutputDevice::ImplRefreshFontData(bNewFontLists); |
47 | 0 | for (Window* pChild = mxOwnerWindow->mpWindowImpl->mpFirstChild; pChild; |
48 | 0 | pChild = pChild->mpWindowImpl->mpNext) |
49 | 0 | pChild->GetOutDev()->ImplRefreshFontData(bNewFontLists); |
50 | 0 | } |
51 | | |
52 | | void WindowOutputDevice::ImplInitMapModeObjects() |
53 | 65.6k | { |
54 | 65.6k | OutputDevice::ImplInitMapModeObjects(); |
55 | 65.6k | if (mxOwnerWindow->mpWindowImpl->mpCursor) |
56 | 62.3k | mxOwnerWindow->mpWindowImpl->mpCursor->ImplNew(); |
57 | 65.6k | } |
58 | | |
59 | 13.7k | const Font& Window::GetFont() const { return GetOutDev()->GetFont(); } |
60 | 0 | void Window::SetFont(Font const& font) { return GetOutDev()->SetFont(font); } |
61 | | |
62 | 3 | float Window::approximate_char_width() const { return GetOutDev()->approximate_char_width(); } |
63 | | |
64 | 30.1k | const Wallpaper& Window::GetBackground() const { return GetOutDev()->GetBackground(); } |
65 | 26.2k | bool Window::IsBackground() const { return GetOutDev()->IsBackground(); } |
66 | 16.9k | tools::Long Window::GetTextHeight() const { return GetOutDev()->GetTextHeight(); } |
67 | | tools::Long Window::GetTextWidth(const OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen, |
68 | | vcl::text::TextLayoutCache const* pCache, |
69 | | SalLayoutGlyphs const* const pLayoutCache) const |
70 | 6.50k | { |
71 | 6.50k | return GetOutDev()->GetTextWidth(rStr, nIndex, nLen, pCache, pLayoutCache); |
72 | 6.50k | } |
73 | 0 | float Window::approximate_digit_width() const { return GetOutDev()->approximate_digit_width(); } |
74 | | |
75 | | bool Window::IsNativeControlSupported(ControlType nType, ControlPart nPart) const |
76 | 20.2k | { |
77 | 20.2k | return GetOutDev()->IsNativeControlSupported(nType, nPart); |
78 | 20.2k | } |
79 | | |
80 | | bool Window::GetNativeControlRegion(ControlType nType, ControlPart nPart, |
81 | | const tools::Rectangle& rControlRegion, ControlState nState, |
82 | | const ImplControlValue& aValue, |
83 | | tools::Rectangle& rNativeBoundingRegion, |
84 | | tools::Rectangle& rNativeContentRegion) const |
85 | 0 | { |
86 | 0 | return GetOutDev()->GetNativeControlRegion(nType, nPart, rControlRegion, nState, aValue, |
87 | 0 | rNativeBoundingRegion, rNativeContentRegion); |
88 | 0 | } |
89 | | |
90 | 50.5k | Size Window::GetOutputSizePixel() const { return GetOutDev()->GetOutputSizePixel(); } |
91 | | |
92 | 0 | tools::Rectangle Window::GetOutputRectPixel() const { return GetOutDev()->GetOutputRectPixel(); } |
93 | | |
94 | 0 | void Window::SetTextLineColor() { GetOutDev()->SetTextLineColor(); } |
95 | 0 | void Window::SetTextLineColor(const Color& rColor) { GetOutDev()->SetTextLineColor(rColor); } |
96 | 0 | void Window::SetOverlineColor() { GetOutDev()->SetOverlineColor(); } |
97 | 0 | void Window::SetOverlineColor(const Color& rColor) { GetOutDev()->SetOverlineColor(rColor); } |
98 | 17.0k | void Window::SetTextFillColor() { GetOutDev()->SetTextFillColor(); } |
99 | 0 | void Window::SetTextFillColor(const Color& rColor) { GetOutDev()->SetTextFillColor(rColor); } |
100 | 31.3k | const MapMode& Window::GetMapMode() const { return GetOutDev()->GetMapMode(); } |
101 | 13.7k | void Window::SetBackground() { GetOutDev()->SetBackground(); } |
102 | | void Window::SetBackground(const Wallpaper& rBackground) |
103 | 33.4k | { |
104 | 33.4k | GetOutDev()->SetBackground(rBackground); |
105 | 33.4k | } |
106 | 0 | void Window::EnableMapMode(bool bEnable) { GetOutDev()->EnableMapMode(bEnable); } |
107 | 31.0k | bool Window::IsMapModeEnabled() const { return GetOutDev()->IsMapModeEnabled(); } |
108 | | |
109 | 0 | void Window::SetTextColor(const Color& rColor) { GetOutDev()->SetTextColor(rColor); } |
110 | 13.7k | const Color& Window::GetTextColor() const { return GetOutDev()->GetTextColor(); } |
111 | 0 | const Color& Window::GetTextLineColor() const { return GetOutDev()->GetTextLineColor(); } |
112 | | |
113 | 0 | bool Window::IsTextLineColor() const { return GetOutDev()->IsTextLineColor(); } |
114 | | |
115 | 6.57k | Color Window::GetTextFillColor() const { return GetOutDev()->GetTextFillColor(); } |
116 | | |
117 | 0 | bool Window::IsTextFillColor() const { return GetOutDev()->IsTextFillColor(); } |
118 | | |
119 | 0 | const Color& Window::GetOverlineColor() const { return GetOutDev()->GetOverlineColor(); } |
120 | 0 | bool Window::IsOverlineColor() const { return GetOutDev()->IsOverlineColor(); } |
121 | 0 | void Window::SetTextAlign(TextAlign eAlign) { GetOutDev()->SetTextAlign(eAlign); } |
122 | | |
123 | 6.57k | float Window::GetDPIScaleFactor() const { return GetOutDev()->GetDPIScaleFactor(); } |
124 | 0 | tools::Long Window::GetOutOffXPixel() const { return GetOutDev()->GetOutOffXPixel(); } |
125 | 0 | tools::Long Window::GetOutOffYPixel() const { return GetOutDev()->GetOutOffYPixel(); } |
126 | 31.0k | void Window::SetMapMode() { GetOutDev()->SetMapMode(); } |
127 | 34.6k | void Window::SetMapMode(const MapMode& rNewMapMode) { GetOutDev()->SetMapMode(rNewMapMode); } |
128 | 0 | bool Window::IsRTLEnabled() const { return GetOutDev()->IsRTLEnabled(); } |
129 | 7.14k | TextAlign Window::GetTextAlign() const { return GetOutDev()->GetTextAlign(); } |
130 | 42.7k | const AllSettings& Window::GetSettings() const { return GetOutDev()->GetSettings(); } |
131 | | |
132 | | Point Window::LogicToPixel(const Point& rLogicPt) const |
133 | 116 | { |
134 | 116 | return GetOutDev()->LogicToPixel(rLogicPt); |
135 | 116 | } |
136 | | Size Window::LogicToPixel(const Size& rLogicSize) const |
137 | 692 | { |
138 | 692 | return GetOutDev()->LogicToPixel(rLogicSize); |
139 | 692 | } |
140 | | tools::Rectangle Window::LogicToPixel(const tools::Rectangle& rLogicRect) const |
141 | 0 | { |
142 | 0 | return GetOutDev()->LogicToPixel(rLogicRect); |
143 | 0 | } |
144 | | vcl::Region Window::LogicToPixel(const vcl::Region& rLogicRegion) const |
145 | 0 | { |
146 | 0 | return GetOutDev()->LogicToPixel(rLogicRegion); |
147 | 0 | } |
148 | | Point Window::LogicToPixel(const Point& rLogicPt, const MapMode& rMapMode) const |
149 | 0 | { |
150 | 0 | return GetOutDev()->LogicToPixel(rLogicPt, rMapMode); |
151 | 0 | } |
152 | | Size Window::LogicToPixel(const Size& rLogicSize, const MapMode& rMapMode) const |
153 | 0 | { |
154 | 0 | return GetOutDev()->LogicToPixel(rLogicSize, rMapMode); |
155 | 0 | } |
156 | | tools::Rectangle Window::LogicToPixel(const tools::Rectangle& rLogicRect, |
157 | | const MapMode& rMapMode) const |
158 | 0 | { |
159 | 0 | return GetOutDev()->LogicToPixel(rLogicRect, rMapMode); |
160 | 0 | } |
161 | | |
162 | | Point Window::PixelToLogic(const Point& rDevicePt) const |
163 | 3.40k | { |
164 | 3.40k | return GetOutDev()->PixelToLogic(rDevicePt); |
165 | 3.40k | } |
166 | | Size Window::PixelToLogic(const Size& rDeviceSize) const |
167 | 0 | { |
168 | 0 | return GetOutDev()->PixelToLogic(rDeviceSize); |
169 | 0 | } |
170 | | tools::Rectangle Window::PixelToLogic(const tools::Rectangle& rDeviceRect) const |
171 | 221 | { |
172 | 221 | return GetOutDev()->PixelToLogic(rDeviceRect); |
173 | 221 | } |
174 | | tools::PolyPolygon Window::PixelToLogic(const tools::PolyPolygon& rDevicePolyPoly) const |
175 | 0 | { |
176 | 0 | return GetOutDev()->PixelToLogic(rDevicePolyPoly); |
177 | 0 | } |
178 | | vcl::Region Window::PixelToLogic(const vcl::Region& rDeviceRegion) const |
179 | 0 | { |
180 | 0 | return GetOutDev()->PixelToLogic(rDeviceRegion); |
181 | 0 | } |
182 | | Point Window::PixelToLogic(const Point& rDevicePt, const MapMode& rMapMode) const |
183 | 0 | { |
184 | 0 | return GetOutDev()->PixelToLogic(rDevicePt, rMapMode); |
185 | 0 | } |
186 | | Size Window::PixelToLogic(const Size& rDeviceSize, const MapMode& rMapMode) const |
187 | 58 | { |
188 | 58 | return GetOutDev()->PixelToLogic(rDeviceSize, rMapMode); |
189 | 58 | } |
190 | | tools::Rectangle Window::PixelToLogic(const tools::Rectangle& rDeviceRect, |
191 | | const MapMode& rMapMode) const |
192 | 0 | { |
193 | 0 | return GetOutDev()->PixelToLogic(rDeviceRect, rMapMode); |
194 | 0 | } |
195 | | |
196 | | Size Window::LogicToLogic(const Size& rSzSource, const MapMode* pMapModeSource, |
197 | | const MapMode* pMapModeDest) const |
198 | 0 | { |
199 | 0 | return GetOutDev()->LogicToLogic(rSzSource, pMapModeSource, pMapModeDest); |
200 | 0 | } |
201 | | |
202 | | tools::Rectangle Window::GetTextRect(const tools::Rectangle& rRect, const OUString& rStr, |
203 | | DrawTextFlags nStyle, TextRectInfo* pInfo, |
204 | | const vcl::TextLayoutCommon* _pTextLayout) const |
205 | 0 | { |
206 | 0 | return GetOutDev()->GetTextRect(rRect, rStr, nStyle, pInfo, _pTextLayout); |
207 | 0 | } |
208 | | |
209 | 0 | void Window::SetSettings(const AllSettings& rSettings) { GetOutDev()->SetSettings(rSettings); } |
210 | | void Window::SetSettings(const AllSettings& rSettings, bool bChild) |
211 | 0 | { |
212 | 0 | static_cast<vcl::WindowOutputDevice*>(GetOutDev())->SetSettings(rSettings, bChild); |
213 | 0 | } |
214 | | |
215 | 0 | Color Window::GetBackgroundColor() const { return GetOutDev()->GetBackgroundColor(); } |
216 | | |
217 | 6.57k | void Window::EnableRTL(bool bEnable) { GetOutDev()->EnableRTL(bEnable); } |
218 | | |
219 | | void Window::FlashWindow() const |
220 | 0 | { |
221 | 0 | vcl::Window* pMyParent = ImplGetTopmostFrameWindow(); |
222 | |
|
223 | 0 | if (pMyParent && pMyParent->mpWindowImpl) |
224 | 0 | pMyParent->mpWindowImpl->mpFrame->FlashWindow(); |
225 | 0 | } |
226 | | |
227 | | void Window::SetTaskBarProgress(int nCurrentProgress) |
228 | 21.1k | { |
229 | 21.1k | vcl::Window* pMyParent = ImplGetTopmostFrameWindow(); |
230 | | |
231 | 21.1k | if (pMyParent && pMyParent->mpWindowImpl) |
232 | 21.1k | pMyParent->mpWindowImpl->mpFrame->SetTaskBarProgress(nCurrentProgress); |
233 | 21.1k | } |
234 | | |
235 | | void Window::SetTaskBarState(VclTaskBarStates eTaskBarState) |
236 | 6.50k | { |
237 | 6.50k | vcl::Window* pMyParent = ImplGetTopmostFrameWindow(); |
238 | | |
239 | 6.50k | if (pMyParent && pMyParent->mpWindowImpl) |
240 | 6.50k | pMyParent->mpWindowImpl->mpFrame->SetTaskBarState(eTaskBarState); |
241 | 6.50k | } |
242 | | |
243 | | } /* namespace vcl */ |
244 | | |
245 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |