GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
display.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2009-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_display_h)
27#define octave_display_h 1
28
29#include "octave-config.h"
30
31#include <string>
32
33class Matrix;
34
35OCTAVE_NAMESPACE_BEGIN
36
38 {
39 public:
40
41 // Create object with default values. To be useful, you must call
42 // initialize to find the actual system parameters for the given
43 // display.
44
46 : m_rx (72), m_ry (72), m_ht (1), m_wd (1), m_dp (0),
47 m_dpy_avail (false), m_msg ()
48 { }
49
50 ~display_info (void) = default;
51
52 display_info (const display_info&) = default;
53
55
56 void initialize (void);
57
58 double x_dpi (void) const { return m_rx; }
59
60 double y_dpi (void) const { return m_ry; }
61
62 int height (void) const { return m_ht; }
63
64 int width (void) const { return m_wd; }
65
66 int depth (void) const { return m_dp; }
67
68 bool display_available (void) const { return m_dpy_avail; }
69
70 std::string message (void) const { return m_msg; }
71
72 private:
73
74 // X- and Y- Resolution of the display in dots (pixels) per inch.
75 double m_rx;
76 double m_ry;
77
78 // Height, width, and depth of the display.
79 int m_ht;
80 int m_wd;
81 int m_dp;
82
84
85 // Message associated with any initiailization failure. Set if
86 // m_dpy_avail is false.
87 std::string m_msg;
88 };
89
90OCTAVE_NAMESPACE_END
91
92#endif
Definition: dMatrix.h:42
std::string m_msg
Definition: display.h:87
int depth(void) const
Definition: display.h:66
bool display_available(void) const
Definition: display.h:68
display_info(void)
Definition: display.h:45
int width(void) const
Definition: display.h:64
display_info(const display_info &)=default
void initialize(void)
Definition: display.cc:42
bool m_dpy_avail
Definition: display.h:83
int height(void) const
Definition: display.h:62
~display_info(void)=default
double x_dpi(void) const
Definition: display.h:58
double m_rx
Definition: display.h:75
int m_wd
Definition: display.h:80
double m_ry
Definition: display.h:76
int m_dp
Definition: display.h:81
std::string message(void) const
Definition: display.h:70
int m_ht
Definition: display.h:79
double y_dpi(void) const
Definition: display.h:60
display_info & operator=(const display_info &)=default