/src/libreoffice/vcl/inc/salgeom.hxx
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 | | #pragma once |
21 | | |
22 | | #include <iostream> |
23 | | |
24 | | #include <vcl/dllapi.h> |
25 | | #include <vcl/WindowPosSize.hxx> |
26 | | #include <tools/long.hxx> |
27 | | |
28 | | // There are some unused functions, which I would keep to ease understanding. |
29 | | class SalFrameGeometry : public vcl::WindowPosSize |
30 | | { |
31 | | // non-drawable area / margins / frame / decorations around the client area |
32 | | sal_uInt32 m_nLeftDecoration, m_nTopDecoration, m_nRightDecoration, m_nBottomDecoration; |
33 | | unsigned int m_nDisplayScreenNumber; |
34 | | |
35 | | public: |
36 | | SalFrameGeometry() |
37 | 11.0k | : m_nLeftDecoration(0) |
38 | 11.0k | , m_nTopDecoration(0) |
39 | 11.0k | , m_nRightDecoration(0) |
40 | 11.0k | , m_nBottomDecoration(0) |
41 | 11.0k | , m_nDisplayScreenNumber(0) |
42 | 11.0k | { |
43 | 11.0k | } |
44 | | |
45 | 0 | constexpr sal_uInt32 leftDecoration() const { return m_nLeftDecoration; } |
46 | 0 | void setLeftDecoration(sal_uInt32 nLeftDecoration) { m_nLeftDecoration = nLeftDecoration; } |
47 | 0 | constexpr sal_uInt32 topDecoration() const { return m_nTopDecoration; } |
48 | 0 | void setTopDecoration(sal_uInt32 nTopDecoration) { m_nTopDecoration = nTopDecoration; } |
49 | 0 | constexpr sal_uInt32 rightDecoration() const { return m_nRightDecoration; } |
50 | 0 | void setRightDecoration(sal_uInt32 nRightDecoration) { m_nRightDecoration = nRightDecoration; } |
51 | 0 | constexpr sal_uInt32 bottomDecoration() const { return m_nBottomDecoration; } |
52 | | void setBottomDecoration(sal_uInt32 nBottomDecoration) |
53 | 0 | { |
54 | 0 | m_nBottomDecoration = nBottomDecoration; |
55 | 0 | } |
56 | | void setDecorations(sal_uInt32 nLeft, sal_uInt32 nTop, sal_uInt32 nRight, sal_uInt32 nBottom) |
57 | 0 | { |
58 | 0 | m_nLeftDecoration = nLeft; |
59 | 0 | m_nTopDecoration = nTop; |
60 | 0 | m_nRightDecoration = nRight; |
61 | 0 | m_nBottomDecoration = nBottom; |
62 | 0 | } |
63 | | |
64 | 0 | unsigned int screen() const { return m_nDisplayScreenNumber; } |
65 | 0 | void setScreen(unsigned int nScreen) { m_nDisplayScreenNumber = nScreen; } |
66 | | }; |
67 | | |
68 | | inline std::ostream& operator<<(std::ostream& s, const SalFrameGeometry& rGeom) |
69 | 0 | { |
70 | 0 | s << *static_cast<const vcl::WindowPosSize*>(&rGeom) << ":{" << rGeom.leftDecoration() << "," |
71 | 0 | << rGeom.topDecoration() << "," << rGeom.rightDecoration() << "," << rGeom.bottomDecoration() |
72 | 0 | << "}s" << rGeom.screen(); |
73 | 0 | return s; |
74 | 0 | } |
75 | | |
76 | | /// Interface used to share logic on sizing between |
77 | | /// SalVirtualDevices and SalFrames |
78 | | class VCL_PLUGIN_PUBLIC SalGeometryProvider |
79 | | { |
80 | | public: |
81 | 1.10M | virtual ~SalGeometryProvider() {} |
82 | | virtual tools::Long GetWidth() const = 0; |
83 | | virtual tools::Long GetHeight() const = 0; |
84 | | virtual bool IsOffScreen() const = 0; |
85 | | }; |
86 | | |
87 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |