Debian Codegraph @

src/Gui/SoDevicePixelRatioElement.h

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 /****************************************************************************
3 * *
4 * Copyright (c) 2024 Pierre-Louis Boyer <[email protected]> *
5 * *
6 * This file is part of FreeCAD. *
7 * *
8 * FreeCAD is free software: you can redistribute it and/or modify it *
9 * under the terms of the GNU Lesser General Public License as *
10 * published by the Free Software Foundation, either version 2.1 of the *
11 * License, or (at your option) any later version. *
12 * *
13 * FreeCAD is distributed in the hope that it will be useful, but *
14 * WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with FreeCAD. If not, see *
20 * <https://www.gnu.org/licenses/>. *
21 * *
22 ***************************************************************************/
23
24 #ifndef SO_DEVICE_PIXEL_RATIO_ELEMENT_H
25 #define SO_DEVICE_PIXEL_RATIO_ELEMENT_H
26
27 #include <Inventor/elements/SoFloatElement.h>
28
29 class SoState;
30
31 class SoDevicePixelRatioElement: public SoFloatElement
32 {
33 SO_ELEMENT_HEADER(SoDevicePixelRatioElement);
34
35 public:
36 // Initializes the class
37 static void initClass();
38
39 // Initializes the element
40 virtual void init(SoState* state) override;
41
42 // Sets the device pixel ratio
43 static void set(SoState* state, float dpr);
44
45 // Retrieves the device pixel ratio
46 static float get(SoState* state);
47
48 protected:
49 virtual ~SoDevicePixelRatioElement();
50 };
51
52 #endif // SO_DEVICE_PIXEL_RATIO_ELEMENT_H