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