GNU Octave
4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
libinterp
corefcn
display.cc
Go to the documentation of this file.
1
/*
2
3
Copyright (C) 2009-2017 John W. Eaton
4
5
This file is part of Octave.
6
7
Octave is free software; you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by the
9
Free Software Foundation; either version 3 of the License, or (at your
10
option) any later version.
11
12
Octave is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with Octave; see the file COPYING. If not, see
19
<http://www.gnu.org/licenses/>.
20
21
*/
22
23
#if defined (HAVE_CONFIG_H)
24
# include "config.h"
25
#endif
26
27
#include "
singleton-cleanup.h
"
28
29
#include "
cdisplay.h
"
30
#include "
display.h
"
31
#include "
error.h
"
32
33
display_info
*
display_info::instance
= 0;
34
35
void
36
display_info::init
(
bool
query)
37
{
38
if
(query)
39
{
40
int
avail = 0;
41
42
const
char
*msg =
octave_get_display_info
(&
ht
, &
wd
, &
dp
, &
rx
, &
ry
,
43
&avail);
44
45
dpy_avail
= avail;
46
47
if
(msg)
48
err_msg
= msg;
49
}
50
}
51
52
bool
53
display_info::instance_ok
(
bool
query)
54
{
55
bool
retval
=
true
;
56
57
if
(!
instance
)
58
{
59
instance
=
new
display_info
(query);
60
61
if
(
instance
)
62
singleton_cleanup_list::add
(
cleanup_instance
);
63
}
64
65
if
(!
instance
)
66
error
(
"unable to create display_info object!"
);
67
68
return
retval
;
69
}
display_info
Definition:
display.h:32
display_info::dpy_avail
bool dpy_avail
Definition:
display.h:105
error
void error(const char *fmt,...)
Definition:
error.cc:570
singleton-cleanup.h
display_info::display_info
display_info(bool query=true)
Definition:
display.h:38
error.h
display_info::err_msg
std::string err_msg
Definition:
display.h:107
display.h
cdisplay.h
display_info::rx
double rx
Definition:
display.h:102
octave_get_display_info
const char * octave_get_display_info(int *ht, int *wd, int *dp, double *rx, double *ry, int *dpy_avail)
Definition:
cdisplay.c:51
display_info::cleanup_instance
static void cleanup_instance(void)
Definition:
display.h:94
singleton_cleanup_list::add
static void add(fptr f)
Definition:
singleton-cleanup.h:22
display_info::wd
int wd
Definition:
display.h:98
retval
octave_value retval
Definition:
data.cc:6294
display_info::dp
int dp
Definition:
display.h:99
display_info::init
void init(bool query=true)
Definition:
display.cc:36
display_info::ry
double ry
Definition:
display.h:103
display_info::ht
int ht
Definition:
display.h:97
display_info::instance
static display_info * instance
Definition:
display.h:92
display_info::instance_ok
static bool instance_ok(bool query=true)
Definition:
display.cc:53
Generated on Wed May 10 2017 15:42:46 for GNU Octave by
1.8.8