LibreOffice Module vcl (master)  1
salgtype.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_SALGTYPE_HXX
21 #define INCLUDED_VCL_SALGTYPE_HXX
22 
23 #include <o3tl/typed_flags_set.hxx>
24 #include <tools/color.hxx>
25 #include <tools/gen.hxx>
26 #include <ostream>
27 
28 enum class DeviceFormat {
29  NONE = -1,
30  DEFAULT = 0,
31  BITMASK = 1,
32 #ifdef IOS
33  GRAYSCALE = 8
34 #endif
35  };
36 
37 constexpr ::Color SALCOLOR_NONE ( 0xFF, 0xFF, 0xFF, 0xFF );
38 
39 // must equal to class Point
40 struct SalPoint
41 {
42  long mnX;
43  long mnY;
44 };
45 
46 typedef const SalPoint* PCONSTSALPOINT;
47 
48 struct SalTwoRect
49 {
50  long mnSrcX;
51  long mnSrcY;
52  long mnSrcWidth;
54  long mnDestX;
55  long mnDestY;
58 
59  SalTwoRect(long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight,
60  long nDestX, long nDestY, long nDestWidth, long nDestHeight)
61  : mnSrcX(nSrcX), mnSrcY(nSrcY), mnSrcWidth(nSrcWidth), mnSrcHeight(nSrcHeight)
62  , mnDestX(nDestX), mnDestY(nDestY), mnDestWidth(nDestWidth), mnDestHeight(nDestHeight)
63  {
64  }
65 };
66 
67 template <typename charT, typename traits>
68 inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& stream,
69  const SalTwoRect& rPosAry)
70 {
71  tools::Rectangle aSrcRect(rPosAry.mnSrcX, rPosAry.mnSrcY, rPosAry.mnSrcX + rPosAry.mnSrcWidth,
72  rPosAry.mnSrcY + rPosAry.mnSrcHeight);
73  tools::Rectangle aDestRect(rPosAry.mnDestX, rPosAry.mnDestY,
74  rPosAry.mnDestX + rPosAry.mnDestWidth,
75  rPosAry.mnDestY + rPosAry.mnDestHeight);
76  stream << aSrcRect << " => " << aDestRect;
77  return stream;
78 }
79 
80 enum class SalROPColor {
81  N0, N1, Invert
82 };
83 
84 enum class SalInvert {
85  NONE = 0x00,
86  N50 = 0x01,
87  TrackFrame = 0x02
88 };
89 namespace o3tl
90 {
91  template<> struct typed_flags<SalInvert> : is_typed_flags<SalInvert, 0x03> {};
92 }
93 
94 #endif // INCLUDED_VCL_SALGTYPE_HXX
95 
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long mnSrcWidth
Definition: salgtype.hxx:52
long mnSrcHeight
Definition: salgtype.hxx:53
SalROPColor
Definition: salgtype.hxx:80
long mnDestWidth
Definition: salgtype.hxx:56
long mnSrcX
Definition: salgtype.hxx:50
long mnY
Definition: salgtype.hxx:43
tools::SvRef< SotStorageStream > stream
long mnDestY
Definition: salgtype.hxx:55
constexpr::Color SALCOLOR_NONE(0xFF, 0xFF, 0xFF, 0xFF)
const SalPoint * PCONSTSALPOINT
Definition: salgtype.hxx:46
long mnX
Definition: salgtype.hxx:42
SalInvert
Definition: salgtype.hxx:84
long mnSrcY
Definition: salgtype.hxx:51
DeviceFormat
Definition: salgtype.hxx:28
long mnDestX
Definition: salgtype.hxx:54
long mnDestHeight
Definition: salgtype.hxx:57
SalTwoRect(long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, long nDestX, long nDestY, long nDestWidth, long nDestHeight)
Definition: salgtype.hxx:59