annotate libinterp/corefcn/graphics.in.h @ 32632:2e484f9f1f18 stable

maint: update Octave Project Developers copyright for the new year
author John W. Eaton <jwe@octave.org>
date Fri, 22 Dec 2023 12:08:17 -0500
parents 05b4479c29d8
children 4b601ca024d5 1c40194c7b1f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
32632
2e484f9f1f18 maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 32589
diff changeset
3 // Copyright (C) 2007-2024 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 20785
diff changeset
26 #if ! defined (octave_graphics_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17787
diff changeset
27 #define octave_graphics_h 1
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21209
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21209
diff changeset
30
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
31 #include <cctype>
23639
b488e958d024 Use modf, pow from C++ std library.
Rik <rik@octave.org>
parents: 23583
diff changeset
32 #include <cmath>
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
33
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
34 #include <algorithm>
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
35 #include <list>
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
36 #include <map>
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
37 #include <memory>
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
38 #include <set>
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
39 #include <sstream>
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
40 #include <string>
30299
f306fe9bfa0d Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30253
diff changeset
41 #include <unordered_map>
27798
8c1cb06468db Change class of coplanar_last_idx for patch objects (bug #55895).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27734
diff changeset
42 #include <vector>
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
43
11075
4e31d44a9763 extract caseless_str class to separate header file
John W. Eaton <jwe@octave.org>
parents: 11074
diff changeset
44 #include "caseless-str.h"
9004
17ba311ef110 add one more missing include
Jaroslav Hajek <highegg@gmail.com>
parents: 8944
diff changeset
45
21100
e39e05d90788 Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents: 21055
diff changeset
46 #include "errwarn.h"
23774
41795b504a8b don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents: 23763
diff changeset
47 #include "graphics-handle.h"
41795b504a8b don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents: 23763
diff changeset
48 #include "graphics-toolkit.h"
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
49 #include "oct-map.h"
7936
78400fde223e Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents: 7902
diff changeset
50 #include "oct-mutex.h"
13985
43cc49c7abd1 Use thread-safe atomic reference counting (GCC and MSVC).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13938
diff changeset
51 #include "oct-refcount.h"
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
52 #include "ov.h"
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents: 21200
diff changeset
53 #include "text-renderer.h"
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
54
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 31241
diff changeset
55 OCTAVE_BEGIN_NAMESPACE(octave)
29993
b5fae48ad807 move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29913
diff changeset
56
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
57 // FIXME: maybe this should be a configure option?
8944
cb0e9facc342 make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
58 // Matlab defaults to "Helvetica", but that causes problems for many
cb0e9facc342 make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
59 // gnuplot users.
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 20785
diff changeset
60 #if ! defined (OCTAVE_DEFAULT_FONTNAME)
8944
cb0e9facc342 make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
61 #define OCTAVE_DEFAULT_FONTNAME "*"
cb0e9facc342 make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
62 #endif
cb0e9facc342 make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
63
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
64 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
65
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
66 class OCTINTERP_API base_scaler
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
67 {
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
68 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
69
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
70 OCTAVE_DEFAULT_CONSTRUCT_COPY_MOVE (base_scaler)
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
71
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
72 virtual ~base_scaler () = default;
7440
4e3b073e910e [project @ 2008-02-02 18:23:50 by jwe]
jwe
parents: 7439
diff changeset
73
20893
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
74 virtual Matrix scale (const Matrix&) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
75 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
76 error ("invalid axis scale");
20893
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
77 }
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
78
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
79 virtual NDArray scale (const NDArray&) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
80 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
81 error ("invalid axis scale");
20893
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
82 }
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
83
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
84 virtual double scale (double) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
85 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
86 error ("invalid axis scale");
20893
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
87 }
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
88
384ff5aa9437 2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents: 20791
diff changeset
89 virtual double unscale (double) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
90 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
91 error ("invalid axis scale");
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
92 }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
93
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
94 virtual base_scaler * clone () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
95 { return new base_scaler (); }
7832
e06fdf7ea647 Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7830
diff changeset
96
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
97 virtual bool is_linear () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
98 { return false; }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
99 };
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
100
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
101 class lin_scaler : public base_scaler
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
102 {
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
103 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
104
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
105 OCTAVE_DEFAULT_CONSTRUCT_COPY_MOVE_DELETE (lin_scaler)
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
106
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
107 Matrix scale (const Matrix& m) const { return m; }
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
108
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
109 NDArray scale (const NDArray& m) const { return m; }
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
110
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
111 double scale (double d) const { return d; }
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
112
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
113 double unscale (double d) const { return d; }
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
114
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
115 base_scaler * clone () const { return new lin_scaler (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
116
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
117 bool is_linear () const { return true; }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
118 };
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
119
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
120 class log_scaler : public base_scaler
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
121 {
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
122 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
123
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
124 OCTAVE_DEFAULT_CONSTRUCT_COPY_MOVE_DELETE (log_scaler)
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
125
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
126 Matrix scale (const Matrix& m) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
127 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
128 Matrix retval (m.rows (), m.cols ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
129
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
130 do_scale (m.data (), retval.fortran_vec (), m.numel ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
131
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
132 return retval;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
133 }
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
134
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
135 NDArray scale (const NDArray& m) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
136 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
137 NDArray retval (m.dims ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
138
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
139 do_scale (m.data (), retval.fortran_vec (), m.numel ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
140
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
141 return retval;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
142 }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
143
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
144 double scale (double d) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
145 { return log10 (d); }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
146
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
147 double unscale (double d) const
23639
b488e958d024 Use modf, pow from C++ std library.
Rik <rik@octave.org>
parents: 23583
diff changeset
148 { return std::pow (10.0, d); }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
149
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
150 base_scaler * clone () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
151 { return new log_scaler (); }
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
152
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
153 private:
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
154 void do_scale (const double *src, double *dest, int n) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
155 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
156 for (int i = 0; i < n; i++)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
157 dest[i] = log10 (src[i]);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
158 }
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
159 };
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
160
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
161 class OCTINTERP_API neg_log_scaler : public base_scaler
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
162 {
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
163 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
164
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
165 OCTAVE_DEFAULT_CONSTRUCT_COPY_MOVE_DELETE (neg_log_scaler)
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
166
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
167 Matrix scale (const Matrix& m) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
168 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
169 Matrix retval (m.rows (), m.cols ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
170
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
171 do_scale (m.data (), retval.fortran_vec (), m.numel ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
172
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
173 return retval;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
174 }
13756
6dfebfa334cb allow negative data log plots with OpenGL+FLTK graphics (bug #34232)
John W. Eaton <jwe@octave.org>
parents: 13722
diff changeset
175
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
176 NDArray scale (const NDArray& m) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
177 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
178 NDArray retval (m.dims ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
179
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
180 do_scale (m.data (), retval.fortran_vec (), m.numel ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
181
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
182 return retval;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
183 }
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
184
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
185 double scale (double d) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
186 { return -log10 (-d); }
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
187
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
188 double unscale (double d) const
23639
b488e958d024 Use modf, pow from C++ std library.
Rik <rik@octave.org>
parents: 23583
diff changeset
189 { return -std::pow (10.0, -d); }
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
190
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
191 base_scaler * clone () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
192 { return new neg_log_scaler (); }
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
193
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
194 private:
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
195 void do_scale (const double *src, double *dest, int n) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
196 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
197 for (int i = 0; i < n; i++)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
198 dest[i] = -log10 (-src[i]);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
199 }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
200 };
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
201
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
202 class OCTINTERP_API scaler
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
203 {
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
204 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
205
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
206 scaler () : m_rep (new base_scaler ()) { }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
207
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
208 scaler (const scaler& s) : m_rep (s.m_rep->clone ()) { }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
209
12164
18e9a8da7d18 eliminate some -Weffc++ warnings
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 12126
diff changeset
210 scaler (const std::string& s)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
211 : m_rep (s == "log"
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
212 ? new log_scaler ()
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
213 : (s == "neglog"
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
214 ? new neg_log_scaler ()
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
215 : (s == "linear"
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
216 ? new lin_scaler ()
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
217 : new base_scaler ())))
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
218 { }
12164
18e9a8da7d18 eliminate some -Weffc++ warnings
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 12126
diff changeset
219
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
220 ~scaler () { delete m_rep; }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
221
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
222 Matrix scale (const Matrix& m) const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
223 { return m_rep->scale (m); }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
224
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
225 NDArray scale (const NDArray& m) const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
226 { return m_rep->scale (m); }
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
227
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
228 double scale (double d) const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
229 { return m_rep->scale (d); }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
230
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
231 double unscale (double d) const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
232 { return m_rep->unscale (d); }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
233
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
234 bool is_linear () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
235 { return m_rep->is_linear (); }
7832
e06fdf7ea647 Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7830
diff changeset
236
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
237 scaler& operator = (const scaler& s)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
238 {
26383
5455de7c8566 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26376
diff changeset
239 if (&s != this)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
240 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
241 if (m_rep)
26383
5455de7c8566 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26376
diff changeset
242 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
243 delete m_rep;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
244 m_rep = nullptr;
26383
5455de7c8566 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26376
diff changeset
245 }
5455de7c8566 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26376
diff changeset
246
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
247 m_rep = s.m_rep->clone ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
248 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
249
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
250 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
251 }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
252
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
253 scaler& operator = (const std::string& s)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
254 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
255 if (m_rep)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
256 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
257 delete m_rep;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
258 m_rep = nullptr;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
259 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
260
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
261 if (s == "log")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
262 m_rep = new log_scaler ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
263 else if (s == "neglog")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
264 m_rep = new neg_log_scaler ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
265 else if (s == "linear")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
266 m_rep = new lin_scaler ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
267 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
268 m_rep = new base_scaler ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
269
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
270 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
271 }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
272
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
273 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
274 base_scaler *m_rep;
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
275 };
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
276
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
277 // ---------------------------------------------------------------------
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
278
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
279 class OCTINTERP_API property;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
280
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
281 // FIXME: These values should probably be defined inside a namespace or
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
282 // class, but which one is most appropriate? For now, prefix with
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
283 // "GCB_" to avoid conflict with PERSISTENT token ID used in the lexer.
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
284 // The lexer token IDs should probably also be fixed...
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
285
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
286 enum listener_mode { GCB_POSTSET, GCB_PERSISTENT, GCB_PREDELETE };
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
287
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
288 class OCTINTERP_API base_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
289 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
290 public:
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
291 friend class property;
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
292
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
293 public:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
294 base_property ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
295 : m_id (-1), m_count (1), m_name (), m_parent (), m_hidden (),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
296 m_listeners ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
297 { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
298
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
299 base_property (const std::string& s, const graphics_handle& h)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
300 : m_id (-1), m_count (1), m_name (s), m_parent (h), m_hidden (false),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
301 m_listeners ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
302 { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
303
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
304 base_property (const base_property& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
305 : m_id (-1), m_count (1), m_name (p.m_name), m_parent (p.m_parent),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
306 m_hidden (p.m_hidden), m_listeners ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
307 { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
308
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
309 // FIXME: should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
310 base_property& operator = (const base_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
311
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
312 virtual ~base_property () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
313
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
314 bool ok () const { return m_parent.ok (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
315
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
316 std::string get_name () const { return m_name; }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
317
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
318 void set_name (const std::string& s) { m_name = s; }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
319
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
320 graphics_handle get_parent () const { return m_parent; }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
321
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
322 void set_parent (const graphics_handle& h) { m_parent = h; }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
323
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
324 bool is_hidden () const { return m_hidden; }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
325
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
326 void set_hidden (bool flag) { m_hidden = flag; }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
327
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
328 virtual bool is_radio () const { return false; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
329
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
330 int get_id () const { return m_id; }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
331
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
332 void set_id (int d) { m_id = d; }
8059
75c99d3f97d7 Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents: 8058
diff changeset
333
11576
8ac9687dbe9f rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
334 // Sets property value, notifies graphics toolkit.
8058
ca39c21fa4b8 [mq]: generic_octave_to_backend_nofitication
John W. Eaton <jwe@octave.org>
parents: 8052
diff changeset
335 // If do_run is true, runs associated listeners.
13321
5ea207067ee5 Export base_property::set.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13307
diff changeset
336 OCTINTERP_API bool set (const octave_value& v, bool do_run = true,
5ea207067ee5 Export base_property::set.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13307
diff changeset
337 bool do_notify_toolkit = true);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
338
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
339 virtual octave_value get () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
340 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
341 error (R"(get: invalid property "%s")", m_name.c_str ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
342 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
343
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
344 virtual std::string values_as_string () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
345 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
346 error (R"(values_as_string: invalid property "%s")", m_name.c_str ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
347 }
10717
9d4a198614ab Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents: 10596
diff changeset
348
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
349 virtual Cell values_as_cell () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
350 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
351 error (R"(values_as_cell: invalid property "%s")", m_name.c_str ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
352 }
10717
9d4a198614ab Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents: 10596
diff changeset
353
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
354 base_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
355 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
356 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
357 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
358 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
359
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
360 void add_listener (const octave_value& v, listener_mode mode = GCB_POSTSET)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
361 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
362 octave_value_list& l = m_listeners[mode];
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
363 l.resize (l.length () + 1, v);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
364 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
365
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
366 void delete_listener (const octave_value& v = octave_value (),
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
367 listener_mode mode = GCB_POSTSET)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
368 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
369 octave_value_list& l = m_listeners[mode];
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
370
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
371 if (v.is_defined ())
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
372 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
373 bool found = false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
374 int i;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
375
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
376 for (i = 0; i < l.length (); i++)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
377 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
378 if (v.internal_rep () == l(i).internal_rep ())
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
379 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
380 found = true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
381 break;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
382 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
383 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
384 if (found)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
385 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
386 for (int j = i; j < l.length () - 1; j++)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
387 l(j) = l(j + 1);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
388
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
389 l.resize (l.length () - 1);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
390 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
391 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
392 else
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
393 {
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
394 if (mode == GCB_PERSISTENT)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
395 l.resize (0);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
396 else
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
397 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
398 octave_value_list lnew (0);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
399 octave_value_list& lp = m_listeners[GCB_PERSISTENT];
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
400 for (int i = l.length () - 1; i >= 0 ; i--)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
401 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
402 for (int j = 0; j < lp.length (); j++)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
403 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
404 if (l(i).internal_rep () == lp(j).internal_rep ())
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
405 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
406 lnew.resize (lnew.length () + 1, l(i));
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
407 break;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
408 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
409 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
410 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
411 l = lnew;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
412 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
413 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
414
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
415 }
8299
be9b14945774 Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents: 8291
diff changeset
416
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
417 OCTINTERP_API void run_listeners (listener_mode mode = GCB_POSTSET);
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
418
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
419 virtual base_property * clone () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
420 { return new base_property (*this); }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
421
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
422 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
423 virtual bool do_set (const octave_value&)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
424 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
425 error (R"(set: invalid property "%s")", m_name.c_str ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
426 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
427
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
428 private:
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
429 typedef std::map<listener_mode, octave_value_list> listener_map;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
430 typedef std::map<listener_mode, octave_value_list>::iterator
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
431 listener_map_iterator;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
432 typedef std::map<listener_mode, octave_value_list>::const_iterator
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
433 listener_map_const_iterator;
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
434
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
435 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
436 int m_id;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
437 octave::refcount<octave_idx_type> m_count;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
438 std::string m_name;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
439 graphics_handle m_parent;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
440 bool m_hidden;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
441 listener_map m_listeners;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
442 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
443
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
444 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
445
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
446 class OCTINTERP_API string_property : public base_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
447 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
448 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
449
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
450 string_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
451
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
452 string_property (const std::string& s, const graphics_handle& h,
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
453 const std::string& val = "")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
454 : base_property (s, h), m_str (val) { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
455
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
456 string_property (const string_property&) = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
457
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
458 // FIXME: should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
459 string_property& operator = (const string_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
460
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
461 ~string_property () = default;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
462
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
463 octave_value get () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
464 { return octave_value (m_str); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
465
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
466 std::string string_value () const { return m_str; }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
467
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
468 string_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
469 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
470 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
471 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
472 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
473
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
474 base_property * clone () const { return new string_property (*this); }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
475
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
476 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
477 bool do_set (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
478 {
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
479 if (! val.is_string ())
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
480 error (R"(set: invalid string property value for "%s")",
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
481 get_name ().c_str ());
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
482
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
483 std::string new_str = val.string_value ();
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
484
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
485 if (new_str != m_str)
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
486 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
487 m_str = new_str;
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
488 return true;
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
489 }
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
490 return false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
491 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
492
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
493 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
494 std::string m_str;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
495 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
496
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
497 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
498
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
499 class OCTINTERP_API string_array_property : public base_property
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
500 {
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
501 public:
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
502 enum desired_enum { string_t, cell_t };
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
503
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
504 string_array_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
505
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
506 string_array_property (const std::string& s, const graphics_handle& h,
16890
830f27544bb7 Accept char array inputs for linestyleorder property (bug #34906).
Rik <rik@octave.org>
parents: 16832
diff changeset
507 const std::string& val = "", const char& sep = '|',
830f27544bb7 Accept char array inputs for linestyleorder property (bug #34906).
Rik <rik@octave.org>
parents: 16832
diff changeset
508 const desired_enum& typ = string_t)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
509 : base_property (s, h), m_desired_type (typ), m_separator (sep), m_str ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
510 {
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
511 std::size_t pos = 0;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
512
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
513 while (true)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
514 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
515 std::size_t new_pos = val.find_first_of (m_separator, pos);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
516
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
517 if (new_pos == std::string::npos)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
518 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
519 m_str.append (val.substr (pos));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
520 break;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
521 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
522 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
523 m_str.append (val.substr (pos, new_pos - pos));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
524
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
525 pos = new_pos + 1;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
526 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
527 }
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
528
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
529 string_array_property (const std::string& s, const graphics_handle& h,
16890
830f27544bb7 Accept char array inputs for linestyleorder property (bug #34906).
Rik <rik@octave.org>
parents: 16832
diff changeset
530 const Cell& c, const char& sep = '|',
830f27544bb7 Accept char array inputs for linestyleorder property (bug #34906).
Rik <rik@octave.org>
parents: 16832
diff changeset
531 const desired_enum& typ = string_t)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
532 : base_property (s, h), m_desired_type (typ), m_separator (sep), m_str ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
533 {
23575
e95738a119da maint: Deprecate is_cellstr and replace with iscellstr.
Rik <rik@octave.org>
parents: 23564
diff changeset
534 if (! c.iscellstr ())
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
535 error (R"(set: invalid order property value for "%s")",
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
536 get_name ().c_str ());
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
537
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
538 string_vector strings (c.numel ());
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
539
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
540 for (octave_idx_type i = 0; i < c.numel (); i++)
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
541 strings[i] = c(i).string_value ();
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
542
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
543 m_str = strings;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
544 }
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
545
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
546 string_array_property (const string_array_property&) = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
547
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
548 // FIXME: should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
549 string_array_property& operator = (const string_array_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
550
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
551 ~string_array_property () = default;
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
552
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
553 octave_value get () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
554 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
555 if (m_desired_type == string_t)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
556 return octave_value (string_value ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
557 else
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
558 return octave_value (cell_value ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
559 }
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
560
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
561 std::string string_value () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
562 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
563 std::string s;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
564
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
565 for (octave_idx_type i = 0; i < m_str.numel (); i++)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
566 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
567 s += m_str[i];
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
568 if (i != m_str.numel () - 1)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
569 s += m_separator;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
570 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
571
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
572 return s;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
573 }
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
574
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
575 Cell cell_value () const {return Cell (m_str);}
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
576
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
577 string_vector string_vector_value () const { return m_str; }
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
578
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
579 string_array_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
580 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
581 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
582 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
583 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
584
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
585 base_property * clone () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
586 { return new string_array_property (*this); }
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
587
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
588 protected:
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
589 bool do_set (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
590 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
591 if (val.is_string () && val.rows () == 1)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
592 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
593 bool replace = false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
594 std::string new_str = val.string_value ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
595 string_vector strings;
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
596 std::size_t pos = 0;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
597
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
598 // Split single string on delimiter (usually '|')
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
599 while (pos != std::string::npos)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
600 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
601 std::size_t new_pos = new_str.find_first_of (m_separator, pos);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
602
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
603 if (new_pos == std::string::npos)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
604 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
605 strings.append (new_str.substr (pos));
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
606 break;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
607 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
608 else
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
609 strings.append (new_str.substr (pos, new_pos - pos));
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
610
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
611 pos = new_pos + 1;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
612 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
613
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
614 if (m_str.numel () == strings.numel ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
615 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
616 for (octave_idx_type i = 0; i < m_str.numel (); i++)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
617 if (strings[i] != m_str[i])
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
618 {
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
619 replace = true;
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
620 break;
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
621 }
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
622 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
623 else
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
624 replace = true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
625
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
626 m_desired_type = string_t;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
627
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
628 if (replace)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
629 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
630 m_str = strings;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
631 return true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
632 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
633 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
634 else if (val.is_string ()) // multi-row character matrix
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
635 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
636 bool replace = false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
637 charMatrix chm = val.char_matrix_value ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
638 octave_idx_type nel = chm.rows ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
639 string_vector strings (nel);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
640
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
641 if (nel != m_str.numel ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
642 replace = true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
643 for (octave_idx_type i = 0; i < nel; i++)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
644 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
645 strings[i] = chm.row_as_string (i);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
646 if (! replace && strings[i] != m_str[i])
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
647 replace = true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
648 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
649
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
650 m_desired_type = string_t;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
651
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
652 if (replace)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
653 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
654 m_str = strings;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
655 return true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
656 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
657 }
23575
e95738a119da maint: Deprecate is_cellstr and replace with iscellstr.
Rik <rik@octave.org>
parents: 23564
diff changeset
658 else if (val.iscellstr ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
659 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
660 bool replace = false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
661 Cell new_cell = val.cell_value ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
662
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
663 string_vector strings = new_cell.cellstr_value ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
664
20232
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 20181
diff changeset
665 octave_idx_type nel = strings.numel ();
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 20181
diff changeset
666
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
667 if (nel != m_str.numel ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
668 replace = true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
669 else
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
670 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
671 for (octave_idx_type i = 0; i < nel; i++)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
672 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
673 if (strings[i] != m_str[i])
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
674 {
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
675 replace = true;
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
676 break;
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
677 }
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
678 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
679 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
680
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
681 m_desired_type = cell_t;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
682
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
683 if (replace)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
684 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
685 m_str = strings;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
686 return true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
687 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
688 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
689 else
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
690 error (R"(set: invalid string property value for "%s")",
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
691 get_name ().c_str ());
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
692
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
693 return false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
694 }
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
695
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
696 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
697 desired_enum m_desired_type;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
698 char m_separator;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
699 string_vector m_str;
10135
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
700 };
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
701
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
702 // ---------------------------------------------------------------------
4516a0c97ced Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents: 10121
diff changeset
703
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
704 class OCTINTERP_API text_label_property : public base_property
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
705 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
706 public:
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
707 enum type { char_t, cellstr_t };
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
708
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
709 text_label_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
710
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
711 text_label_property (const std::string& s, const graphics_handle& h,
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
712 const std::string& val = "")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
713 : base_property (s, h), m_value (val), m_stored_type (char_t)
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
714 { }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
715
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
716 text_label_property (const std::string& s, const graphics_handle& h,
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
717 const NDArray& nda)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
718 : base_property (s, h), m_stored_type (char_t)
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
719 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
720 octave_idx_type nel = nda.numel ();
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
721
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
722 m_value.resize (nel);
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
723
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
724 for (octave_idx_type i = 0; i < nel; i++)
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
725 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
726 std::ostringstream buf;
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
727 buf << nda(i);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
728 m_value[i] = buf.str ();
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
729 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
730 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
731
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
732 text_label_property (const std::string& s, const graphics_handle& h,
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
733 const Cell& c)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
734 : base_property (s, h), m_stored_type (cellstr_t)
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
735 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
736 octave_idx_type nel = c.numel ();
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
737
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
738 m_value.resize (nel);
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
739
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
740 for (octave_idx_type i = 0; i < nel; i++)
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
741 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
742 octave_value tmp = c(i);
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
743
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
744 if (tmp.is_string ())
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
745 m_value[i] = c(i).string_value ();
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
746 else
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
747 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
748 double d = c(i).double_value ();
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
749
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
750 std::ostringstream buf;
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
751 buf << d;
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
752 m_value[i] = buf.str ();
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
753 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
754 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
755 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
756
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
757 text_label_property (const text_label_property&) = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
758
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
759 // FIXME: should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
760 text_label_property& operator = (const text_label_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
761
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
762 ~text_label_property () = default;
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
763
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
764 bool empty () const
12965
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12959
diff changeset
765 {
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12959
diff changeset
766 octave_value tmp = get ();
23577
80c42f4cca13 maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents: 23576
diff changeset
767 return tmp.isempty ();
12965
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12959
diff changeset
768 }
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12959
diff changeset
769
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
770 octave_value get () const
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
771 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
772 if (m_stored_type == char_t)
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
773 return octave_value (char_value ());
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
774 else
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
775 return octave_value (cell_value ());
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
776 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
777
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
778 std::string string_value () const
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
779 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
780 return m_value.empty () ? "" : m_value[0];
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
781 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
782
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
783 string_vector string_vector_value () const { return m_value; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
784
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
785 charMatrix char_value () const { return charMatrix (m_value, ' '); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
786
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
787 Cell cell_value () const {return Cell (m_value); }
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
788
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
789 text_label_property& operator = (const octave_value& val)
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
790 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
791 set (val);
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
792 return *this;
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
793 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
794
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
795 base_property * clone () const { return new text_label_property (*this); }
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
796
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
797 protected:
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
798
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
799 bool do_set (const octave_value& val)
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
800 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
801 if (val.is_string ())
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
802 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
803 m_value = val.string_vector_value ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
804
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
805 m_stored_type = char_t;
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
806 }
23576
00e518162fda maint: Deprecate is_cell and replace with iscell.
Rik <rik@octave.org>
parents: 23575
diff changeset
807 else if (val.iscell ())
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
808 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
809 Cell c = val.cell_value ();
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
810
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
811 octave_idx_type nel = c.numel ();
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
812
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
813 m_value.resize (nel);
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
814
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
815 for (octave_idx_type i = 0; i < nel; i++)
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
816 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
817 octave_value tmp = c(i);
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
818
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
819 if (tmp.is_string ())
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
820 m_value[i] = c(i).string_value ();
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
821 else
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
822 {
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
823 double d = c(i).double_value ();
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
824
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
825 std::ostringstream buf;
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
826 buf << d;
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
827 m_value[i] = buf.str ();
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
828 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
829 }
12965
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12959
diff changeset
830
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
831 m_stored_type = cellstr_t;
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
832 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
833 else
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
834 {
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
835 NDArray nda;
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
836
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
837 try
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
838 {
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
839 nda = val.array_value ();
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
840 }
29163
8f67ad8b3103 maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents: 29015
diff changeset
841 catch (octave::execution_exception& ee)
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
842 {
29163
8f67ad8b3103 maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents: 29015
diff changeset
843 error (ee, R"(set: invalid string property value for "%s")",
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
844 get_name ().c_str ());
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
845 }
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
846
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
847 octave_idx_type nel = nda.numel ();
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
848
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
849 m_value.resize (nel);
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
850
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
851 for (octave_idx_type i = 0; i < nel; i++)
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
852 {
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
853 std::ostringstream buf;
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
854 buf << nda(i);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
855 m_value[i] = buf.str ();
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
856 }
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
857
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
858 m_stored_type = char_t;
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
859 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
860
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
861 return true;
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
862 }
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
863
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
864 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
865 string_vector m_value;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
866 type m_stored_type;
12959
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
867 };
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
868
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
869 // ---------------------------------------------------------------------
0c86ae6f7c34 new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents: 12777
diff changeset
870
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
871 class OCTINTERP_API radio_values
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
872 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
873 public:
21017
93748bcaec17 maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents: 20990
diff changeset
874 OCTINTERP_API radio_values (const std::string& opt_string = "");
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
875
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
876 OCTAVE_DEFAULT_COPY_MOVE_DELETE (radio_values)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
877
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
878 std::string default_value () const { return m_default_val; }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
879
13236
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
880 bool validate (const std::string& val, std::string& match)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
881 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
882 bool retval = true;
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
883
13236
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
884 if (! contains (val, match))
20956
850e3d2533d4 maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents: 20955
diff changeset
885 error ("invalid value = %s", val.c_str ());
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
886
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
887 return retval;
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
888 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
889
13236
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
890 bool contains (const std::string& val, std::string& match)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
891 {
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
892 std::size_t k = 0;
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
893
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
894 std::size_t len = val.length ();
13236
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
895
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
896 std::string first_match;
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
897
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
898 for (const auto& possible_val : m_possible_vals)
13236
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
899 {
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
900 if (possible_val.compare (val, len))
13236
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
901 {
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
902 if (len == possible_val.length ())
13236
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
903 {
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
904 // We found a full match (consider the case of val == "replace"
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
905 // with possible values "replace" and "replacechildren"). Any
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
906 // other matches are irrelevant, so set match and return now.
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
907 match = possible_val;
13236
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
908 return true;
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
909 }
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
910 else
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
911 {
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
912 if (k == 0)
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
913 first_match = possible_val;
13236
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
914
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
915 k++;
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
916 }
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
917 }
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
918 }
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
919
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
920 if (k == 1)
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
921 {
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
922 match = first_match;
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
923 return true;
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
924 }
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
925 else
8bb526fb3349 allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents: 13132
diff changeset
926 return false;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
927 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
928
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
929 OCTINTERP_API std::string values_as_string () const;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
930
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
931 OCTINTERP_API Cell values_as_cell () const;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
932
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
933 octave_idx_type nelem () const { return m_possible_vals.size (); }
10717
9d4a198614ab Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents: 10596
diff changeset
934
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
935 private:
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
936 // Might also want to cache
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
937 std::string m_default_val;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
938 std::set<caseless_str> m_possible_vals;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
939 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
940
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
941 class OCTINTERP_API radio_property : public base_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
942 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
943 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
944
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
945 radio_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
946
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
947 radio_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
948 const radio_values& v = radio_values ())
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
949 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
950 m_vals (v), m_current_val (v.default_value ()) { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
951
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
952 radio_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
953 const std::string& v)
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
954 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
955 m_vals (v), m_current_val (m_vals.default_value ()) { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
956
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
957 radio_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
958 const radio_values& v, const std::string& def)
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
959 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
960 m_vals (v), m_current_val (def) { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
961
31883
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
962 OCTAVE_DEFAULT_COPY_MOVE_CTOR (radio_property)
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
963 OCTAVE_DISABLE_COPY_MOVE_ASGN (radio_property)
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
964
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
965 ~radio_property () = default;
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
966
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
967 octave_value get () const { return octave_value (m_current_val); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
968
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
969 const std::string& current_value () const { return m_current_val; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
970
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
971 std::string values_as_string () const
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
972 { return m_vals.values_as_string (); }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
973
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
974 Cell values_as_cell () const { return m_vals.values_as_cell (); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
975
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
976 bool is (const caseless_str& v) const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
977 { return v.compare (m_current_val); }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
978
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
979 bool is_radio () const { return true; }
10717
9d4a198614ab Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents: 10596
diff changeset
980
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
981 radio_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
982 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
983 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
984 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
985 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
986
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
987 base_property * clone () const { return new radio_property (*this); }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
988
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
989 protected:
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
990 bool do_set (const octave_value& newval)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
991 {
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
992 if (! newval.is_string ())
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
993 error (R"(set: invalid value for radio property "%s")",
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
994 get_name ().c_str ());
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
995
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
996 std::string s = newval.string_value ();
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
997
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
998 std::string match;
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
999
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1000 if (! m_vals.validate (s, match))
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
1001 error (R"(set: invalid value for radio property "%s" (value = %s))",
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1002 get_name ().c_str (), s.c_str ());
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1003
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1004 if (match != m_current_val)
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1005 {
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1006 if (s.length () != match.length ())
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1007 warning_with_id ("Octave:abbreviated-property-match",
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1008 "%s: allowing %s to match %s value %s",
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1009 "set", s.c_str (), get_name ().c_str (),
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1010 match.c_str ());
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1011 m_current_val = match;
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1012 return true;
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1013 }
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1014 return false;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1015 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1016
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1017 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1018 radio_values m_vals;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1019 std::string m_current_val;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1020 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1021
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1022 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1023
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1024 class OCTINTERP_API color_values
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1025 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1026 public:
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1027 color_values (double r = 0, double g = 0, double b = 1)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1028 : m_rgb (1, 3)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1029 {
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1030 m_rgb(0) = r;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1031 m_rgb(1) = g;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1032 m_rgb(2) = b;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1033
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1034 validate ();
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1035 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1036
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
1037 color_values (const std::string& str)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1038 : m_rgb (1, 3)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1039 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1040 if (! str2rgb (str))
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1041 error ("invalid color specification: %s", str.c_str ());
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1042 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1043
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1044 OCTAVE_DEFAULT_COPY_MOVE_DELETE (color_values)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1045
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1046 bool operator == (const color_values& c) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1047 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1048 return (m_rgb(0) == c.m_rgb(0)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1049 && m_rgb(1) == c.m_rgb(1)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1050 && m_rgb(2) == c.m_rgb(2));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1051 }
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1052
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1053 bool operator != (const color_values& c) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1054 { return ! (*this == c); }
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1055
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1056 Matrix rgb () const { return m_rgb; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1057
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1058 operator octave_value () const { return m_rgb; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1059
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1060 void validate () const
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1061 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1062 for (int i = 0; i < 3; i++)
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1063 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1064 if (m_rgb(i) < 0 || m_rgb(i) > 1)
20730
948f45a2931e don't check error_state after creating color object
John W. Eaton <jwe@octave.org>
parents: 20726
diff changeset
1065 error ("invalid RGB color specification");
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1066 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1067 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1068
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1069 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1070 Matrix m_rgb;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1071
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
1072 OCTINTERP_API bool str2rgb (const std::string& str);
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1073 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1074
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1075 class OCTINTERP_API color_property : public base_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1076 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1077 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1078
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1079 color_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1080
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1081 color_property (const color_values& c, const radio_values& v)
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1082 : base_property ("", graphics_handle ()),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1083 m_current_type (color_t), m_color_val (c), m_radio_val (v),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1084 m_current_val (v.default_value ())
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1085 { }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1086
17645
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
1087 color_property (const radio_values& v, const color_values& c)
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
1088 : base_property ("", graphics_handle ()),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1089 m_current_type (radio_t), m_color_val (c), m_radio_val (v),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1090 m_current_val (v.default_value ())
17645
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
1091 { }
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
1092
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1093 color_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1094 const color_values& c = color_values (),
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1095 const radio_values& v = radio_values ())
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1096 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1097 m_current_type (color_t), m_color_val (c), m_radio_val (v),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1098 m_current_val (v.default_value ())
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1099 { }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1100
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1101 color_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1102 const radio_values& v)
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1103 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1104 m_current_type (radio_t), m_color_val (color_values ()), m_radio_val (v),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1105 m_current_val (v.default_value ())
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1106 { }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1107
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1108 color_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1109 const std::string& v)
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1110 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1111 m_current_type (radio_t), m_color_val (color_values ()), m_radio_val (v),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1112 m_current_val (m_radio_val.default_value ())
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1113 { }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1114
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1115 color_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1116 const color_property& v)
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1117 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1118 m_current_type (v.m_current_type), m_color_val (v.m_color_val),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1119 m_radio_val (v.m_radio_val), m_current_val (v.m_current_val)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1120 { }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1121
31883
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1122 OCTAVE_DEFAULT_COPY_MOVE_CTOR (color_property)
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1123 OCTAVE_DISABLE_COPY_MOVE_ASGN (color_property)
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1124
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1125 ~color_property () = default;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1126
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1127 octave_value get () const
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1128 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1129 if (m_current_type == color_t)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1130 return m_color_val.rgb ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1131
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1132 return m_current_val;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1133 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1134
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1135 bool is_rgb () const { return (m_current_type == color_t); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1136
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1137 bool is_radio () const { return (m_current_type == radio_t); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1138
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1139 bool is (const std::string& v) const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1140 { return (is_radio () && m_current_val == v); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1141
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1142 Matrix rgb () const
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1143 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1144 if (m_current_type != color_t)
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20711
diff changeset
1145 error ("color has no RGB value");
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1146
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1147 return m_color_val.rgb ();
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1148 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1149
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1150 const std::string& current_value () const
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1151 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1152 if (m_current_type != radio_t)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1153 error ("color has no radio value");
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1154
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1155 return m_current_val;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1156 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1157
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1158 color_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1159 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1160 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1161 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1162 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1163
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1164 operator octave_value () const { return get (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1165
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1166 base_property * clone () const { return new color_property (*this); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1167
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1168 std::string values_as_string () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1169 { return m_radio_val.values_as_string (); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1170
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1171 Cell values_as_cell () const { return m_radio_val.values_as_cell (); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1172
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1173 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1174 OCTINTERP_API bool do_set (const octave_value& newval);
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1175
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1176 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1177 enum current_enum { color_t, radio_t } m_current_type;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1178 color_values m_color_val;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1179 radio_values m_radio_val;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1180 std::string m_current_val;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1181 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1182
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1183 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1184
23124
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1185 enum finite_type
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1186 {
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1187 NO_CHECK,
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1188 FINITE,
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1189 NOT_NAN,
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1190 NOT_INF
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1191 };
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1192
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1193 class OCTINTERP_API double_property : public base_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1194 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1195 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1196
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1197 double_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1198
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1199 double_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1200 double d = 0)
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1201 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1202 m_current_val (d), m_finite_constraint (NO_CHECK),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1203 m_minval (std::pair<double, bool> (octave_NaN, true)),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1204 m_maxval (std::pair<double, bool> (octave_NaN, true)) { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1205
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1206 double_property (const double_property& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1207 : base_property (p), m_current_val (p.m_current_val),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1208 m_finite_constraint (NO_CHECK),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1209 m_minval (std::pair<double, bool> (octave_NaN, true)),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1210 m_maxval (std::pair<double, bool> (octave_NaN, true)) { }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1211
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1212 // FIXME: should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1213 double_property& operator = (const double_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1214
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1215 ~double_property () = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1216
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1217 octave_value get () const { return octave_value (m_current_val); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1218
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1219 double double_value () const { return m_current_val; }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1220
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1221 double_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1222 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1223 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1224 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1225 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1226
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1227 base_property * clone () const
23124
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1228 {
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1229 double_property *p = new double_property (*this);
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1230
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1231 p->m_finite_constraint = m_finite_constraint;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1232 p->m_minval = m_minval;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1233 p->m_maxval = m_maxval;
23124
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1234
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1235 return p;
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1236 }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1237
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1238 void add_constraint (const std::string& type, double val, bool inclusive)
22910
23847979b91e maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
1239 {
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1240 if (type == "min")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1241 m_minval = std::pair<double, bool> (val, inclusive);
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1242 else if (type == "max")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1243 m_maxval = std::pair<double, bool> (val, inclusive);
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1244 }
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1245
23124
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1246 void add_constraint (const finite_type finite)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1247 { m_finite_constraint = finite; }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1248
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1249 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1250 bool do_set (const octave_value& v)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1251 {
23582
0cc2011d800e maint: Deprecate is_real_type and replace with isreal.
Rik <rik@octave.org>
parents: 23577
diff changeset
1252 if (! v.is_scalar_type () || ! v.isreal ())
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
1253 error (R"(set: invalid value for double property "%s")",
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1254 get_name ().c_str ());
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
1255
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
1256 double new_val = v.double_value ();
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
1257
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1258 // Check min and max
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1259 if (! octave::math::isnan (m_minval.first))
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1260 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1261 if (m_minval.second && m_minval.first > new_val)
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
1262 error (R"(set: "%s" must be greater than or equal to %g)",
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1263 get_name ().c_str (), m_minval.first);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1264 else if (! m_minval.second && m_minval.first >= new_val)
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
1265 error (R"(set: "%s" must be greater than %g)",
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1266 get_name ().c_str (), m_minval.first);
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1267 }
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1268
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1269 if (! octave::math::isnan (m_maxval.first))
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1270 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1271 if (m_maxval.second && m_maxval.first < new_val)
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
1272 error (R"(set: "%s" must be less than or equal to %g)",
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1273 get_name ().c_str (), m_maxval.first);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1274 else if (! m_maxval.second && m_maxval.first <= new_val)
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
1275 error (R"(set: "%s" must be less than %g)",
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1276 get_name ().c_str (), m_maxval.first);
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1277 }
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1278
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1279 if (m_finite_constraint == NO_CHECK) { /* do nothing */ }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1280 else if (m_finite_constraint == FINITE)
25103
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1281 {
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1282 if (! octave::math::isfinite (new_val))
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1283 error (R"(set: "%s" must be finite)", get_name ().c_str ());
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1284 }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1285 else if (m_finite_constraint == NOT_NAN)
25103
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1286 {
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1287 if (octave::math::isnan (new_val))
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1288 error (R"(set: "%s" must not be nan)", get_name ().c_str ());
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1289 }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1290 else if (m_finite_constraint == NOT_INF)
25103
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1291 {
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1292 if (octave::math::isinf (new_val))
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1293 error (R"(set: "%s" must not be infinite)", get_name ().c_str ());
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
1294 }
23124
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1295
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1296 if (new_val != m_current_val)
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
1297 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1298 m_current_val = new_val;
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
1299 return true;
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
1300 }
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
1301
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1302 return false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1303 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1304
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1305 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1306 double m_current_val;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1307 finite_type m_finite_constraint;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1308 std::pair<double, bool> m_minval, m_maxval;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1309 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1310
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1311 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1312
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1313 class OCTINTERP_API double_radio_property : public base_property
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1314 {
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1315 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1316
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1317 double_radio_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1318
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1319 double_radio_property (double d, const radio_values& v)
17652
57750dc54ab6 maint: Correct indentation in graphics.cc, graphics.in.h. No code changes.
Rik <rik@octave.org>
parents: 17646
diff changeset
1320 : base_property ("", graphics_handle ()),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1321 m_current_type (double_t), m_dval (d), m_radio_val (v),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1322 m_current_val (v.default_value ())
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1323 { }
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1324
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1325 double_radio_property (const std::string& nm, const graphics_handle& h,
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
1326 const std::string& v)
17652
57750dc54ab6 maint: Correct indentation in graphics.cc, graphics.in.h. No code changes.
Rik <rik@octave.org>
parents: 17646
diff changeset
1327 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1328 m_current_type (radio_t), m_dval (0), m_radio_val (v),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1329 m_current_val (m_radio_val.default_value ())
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1330 { }
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1331
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1332 double_radio_property (const std::string& nm, const graphics_handle& h,
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
1333 const double_radio_property& v)
17652
57750dc54ab6 maint: Correct indentation in graphics.cc, graphics.in.h. No code changes.
Rik <rik@octave.org>
parents: 17646
diff changeset
1334 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1335 m_current_type (v.m_current_type), m_dval (v.m_dval),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1336 m_radio_val (v.m_radio_val), m_current_val (v.m_current_val)
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1337 { }
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1338
31883
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1339 OCTAVE_DEFAULT_COPY_MOVE_CTOR (double_radio_property)
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1340 OCTAVE_DISABLE_COPY_MOVE_ASGN (double_radio_property)
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1341
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1342 ~double_radio_property () = default;
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1343
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1344 octave_value get () const
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1345 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1346 if (m_current_type == double_t)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1347 return m_dval;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1348
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1349 return m_current_val;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1350 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1351
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1352 bool is_double () const { return (m_current_type == double_t); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1353
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1354 bool is_radio () const { return (m_current_type == radio_t); }
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1355
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1356 bool is (const std::string& v) const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1357 { return (is_radio () && m_current_val == v); }
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1358
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1359 double double_value () const
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1360 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1361 if (m_current_type != double_t)
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1362 error ("%s: property has no double", get_name ().c_str ());
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1363
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1364 return m_dval;
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1365 }
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1366
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1367 const std::string& current_value () const
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1368 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1369 if (m_current_type != radio_t)
26107
05dfcb24ef12 Supply missing arguments to variable length *printf functions (bug #55046).
Rik <rik@octave.org>
parents: 26055
diff changeset
1370 error ("%s: property has no radio value", get_name ().c_str ());
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1371
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1372 return m_current_val;
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1373 }
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1374
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1375 double_radio_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1376 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1377 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1378 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1379 }
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1380
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1381 operator octave_value () const { return get (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1382
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1383 base_property * clone () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1384 { return new double_radio_property (*this); }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1385
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1386 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1387 OCTINTERP_API bool do_set (const octave_value& v);
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1388
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1389 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1390 enum current_enum { double_t, radio_t } m_current_type;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1391 double m_dval;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1392 radio_values m_radio_val;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1393 std::string m_current_val;
7844
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1394 };
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1395
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1396 // ---------------------------------------------------------------------
3d60445d3638 Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7842
diff changeset
1397
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1398 class OCTINTERP_API array_property : public base_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1399 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1400 public:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1401 array_property ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1402 : base_property ("", graphics_handle ()), m_data (Matrix ()),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1403 m_min_val (), m_max_val (), m_min_pos (), m_max_neg (),
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
1404 m_type_constraints (), m_size_constraints (),
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
1405 m_finite_constraint (NO_CHECK),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1406 m_minval (std::pair<double, bool> (octave_NaN, true)),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1407 m_maxval (std::pair<double, bool> (octave_NaN, true))
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1408 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1409 get_data_limits ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1410 }
7836
4fb2db9c87dd Turn cdata properties into array_property. Add min/max computation to array_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7835
diff changeset
1411
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1412 array_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1413 const octave_value& m)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1414 : base_property (nm, h), m_data (m.issparse () ? m.full_value () : m),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1415 m_min_val (), m_max_val (), m_min_pos (), m_max_neg (),
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
1416 m_type_constraints (), m_size_constraints (),
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
1417 m_finite_constraint (NO_CHECK),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1418 m_minval (std::pair<double, bool> (octave_NaN, true)),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1419 m_maxval (std::pair<double, bool> (octave_NaN, true))
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1420 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1421 get_data_limits ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1422 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1423
7848
6bb2bbc2bf45 Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7847
diff changeset
1424 // This copy constructor is only intended to be used
6bb2bbc2bf45 Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7847
diff changeset
1425 // internally to access min/max values; no need to
6bb2bbc2bf45 Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7847
diff changeset
1426 // copy constraints.
6bb2bbc2bf45 Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7847
diff changeset
1427 array_property (const array_property& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1428 : base_property (p), m_data (p.m_data),
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
1429 m_min_val (p.m_min_val), m_max_val (p.m_max_val),
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
1430 m_min_pos (p.m_min_pos), m_max_neg (p.m_max_neg),
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
1431 m_type_constraints (), m_size_constraints (),
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
1432 m_finite_constraint (NO_CHECK),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1433 m_minval (std::pair<double, bool> (octave_NaN, true)),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1434 m_maxval (std::pair<double, bool> (octave_NaN, true))
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1435 { }
7848
6bb2bbc2bf45 Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7847
diff changeset
1436
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1437 // FIXME: Should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1438 array_property& operator = (const array_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1439
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1440 ~array_property () = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1441
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1442 octave_value get () const { return m_data; }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1443
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1444 void add_constraint (const std::string& type)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1445 { m_type_constraints.insert (type); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1446
7524
a653856aa3e1 array_value::add_constraint: pass dim_vector as const reference, not value
John W. Eaton <jwe@octave.org>
parents: 7523
diff changeset
1447 void add_constraint (const dim_vector& dims)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1448 { m_size_constraints.push_back (dims); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1449
23124
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1450 void add_constraint (const finite_type finite)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1451 { m_finite_constraint = finite; }
23124
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1452
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1453 void add_constraint (const std::string& type, double val, bool inclusive)
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1454 {
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1455 if (type == "min")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1456 m_minval = std::pair<double, bool> (val, inclusive);
23124
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1457 else if (type == "max")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1458 m_maxval = std::pair<double, bool> (val, inclusive);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1459 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1460
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1461 double min_val () const { return m_min_val; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1462 double max_val () const { return m_max_val; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1463 double min_pos () const { return m_min_pos; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1464 double max_neg () const { return m_max_neg; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1465
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1466 Matrix get_limits () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1467 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1468 Matrix m (1, 4);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1469
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1470 m(0) = min_val ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1471 m(1) = max_val ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1472 m(2) = min_pos ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1473 m(3) = max_neg ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1474
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1475 return m;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1476 }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
1477
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1478 array_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1479 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1480 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1481 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1482 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1483
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1484 base_property * clone () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1485 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1486 array_property *p = new array_property (*this);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1487
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1488 p->m_type_constraints = m_type_constraints;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1489 p->m_size_constraints = m_size_constraints;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1490 p->m_finite_constraint = m_finite_constraint;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1491 p->m_minval = m_minval;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1492 p->m_maxval = m_maxval;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1493
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1494 return p;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1495 }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1496
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1497 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1498 bool do_set (const octave_value& v)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1499 {
23583
b7747a2c88b2 maint: Deprecate is_sparse_type and replace with issparse.
Rik <rik@octave.org>
parents: 23582
diff changeset
1500 octave_value tmp = (v.issparse () ? v.full_value () : v);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1501
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1502 if (! validate (tmp))
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
1503 error (R"(invalid value for array property "%s")",
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1504 get_name ().c_str ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1505
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1506 // FIXME: should we check for actual data change?
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1507 if (! is_equal (tmp))
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1508 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1509 m_data = tmp;
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1510
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1511 get_data_limits ();
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1512
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1513 return true;
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1514 }
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
1515
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1516 return false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1517 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1518
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1519 private:
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1520 OCTINTERP_API bool validate (const octave_value& v);
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1521
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1522 OCTINTERP_API bool is_equal (const octave_value& v) const;
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1523
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1524 OCTINTERP_API void get_data_limits ();
7836
4fb2db9c87dd Turn cdata properties into array_property. Add min/max computation to array_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7835
diff changeset
1525
7523
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1526 protected:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1527 octave_value m_data;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1528 double m_min_val;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1529 double m_max_val;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1530 double m_min_pos;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1531 double m_max_neg;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1532 std::set<std::string> m_type_constraints;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1533 std::list<dim_vector> m_size_constraints;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1534 finite_type m_finite_constraint;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1535 std::pair<double, bool> m_minval, m_maxval;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1536 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1537
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1538 class OCTINTERP_API row_vector_property : public array_property
7523
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1539 {
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1540 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1541
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1542 row_vector_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1543
7523
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1544 row_vector_property (const std::string& nm, const graphics_handle& h,
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
1545 const octave_value& m)
7527
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1546 : array_property (nm, h, m)
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1547 {
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1548 add_constraint (dim_vector (-1, 1));
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1549 add_constraint (dim_vector (1, -1));
17631
94dd9bba06a0 Fix validation of array properties to set(), avoid segfaults (bug #bug #35687).
Rik <rik@octave.org>
parents: 17625
diff changeset
1550 add_constraint (dim_vector (0, 0));
7527
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1551 }
7523
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1552
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1553 row_vector_property (const row_vector_property& p)
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1554 : array_property (p)
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1555 {
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1556 add_constraint (dim_vector (-1, 1));
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1557 add_constraint (dim_vector (1, -1));
17631
94dd9bba06a0 Fix validation of array properties to set(), avoid segfaults (bug #bug #35687).
Rik <rik@octave.org>
parents: 17625
diff changeset
1558 add_constraint (dim_vector (0, 0));
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1559 }
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1560
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1561 // FIXME: should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1562 row_vector_property& operator = (const row_vector_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1563
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1564 ~row_vector_property () = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1565
7527
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1566 void add_constraint (const std::string& type)
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1567 {
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1568 array_property::add_constraint (type);
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1569 }
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1570
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1571 void add_constraint (const dim_vector& dims)
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1572 {
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1573 array_property::add_constraint (dims);
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1574 }
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1575
23124
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1576 void add_constraint (const finite_type finite)
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1577 {
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1578 array_property::add_constraint (finite);
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1579 }
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1580
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1581 void add_constraint (const std::string& type, double val, bool inclusive)
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1582 {
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1583 array_property::add_constraint (type, val, inclusive);
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1584 }
9e54152e382b Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23116
diff changeset
1585
7527
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1586 void add_constraint (octave_idx_type len)
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1587 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1588 m_size_constraints.remove (dim_vector (1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1589 m_size_constraints.remove (dim_vector (-1, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1590 m_size_constraints.remove (dim_vector (0, 0));
7527
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1591
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1592 add_constraint (dim_vector (1, len));
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1593 add_constraint (dim_vector (len, 1));
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1594 }
7523
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1595
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1596 row_vector_property& operator = (const octave_value& val)
7527
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1597 {
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1598 set (val);
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1599 return *this;
d219e712c20e make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents: 7526
diff changeset
1600 }
7523
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1601
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1602 base_property * clone () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1603 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1604 row_vector_property *p = new row_vector_property (*this);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1605
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1606 p->m_type_constraints = m_type_constraints;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1607 p->m_size_constraints = m_size_constraints;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1608 p->m_finite_constraint = m_finite_constraint;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1609 p->m_minval = m_minval;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1610 p->m_maxval = m_maxval;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1611
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1612 return p;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1613 }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1614
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1615 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1616 bool do_set (const octave_value& v)
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1617 {
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1618 bool retval = array_property::do_set (v);
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1619
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1620 dim_vector dv = m_data.dims ();
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1621
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1622 if (dv(0) > 1 && dv(1) == 1)
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1623 {
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1624 int tmp = dv(0);
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1625 dv(0) = dv(1);
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1626 dv(1) = tmp;
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1627
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1628 m_data = m_data.reshape (dv);
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1629 }
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1630
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1631 return retval;
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1632 }
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1633
7523
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1634 private:
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1635 OCTINTERP_API bool validate (const octave_value& v);
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1636 };
f2000f1971ab new row_vector_property class
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
1637
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1638 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1639
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1640 class OCTINTERP_API bool_property : public radio_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1641 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1642 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1643
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1644 bool_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1645
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1646 bool_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1647 bool val)
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1648 : radio_property (nm, h, radio_values (val ? "{on}|off" : "on|{off}"))
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1649 { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1650
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1651 bool_property (const std::string& nm, const graphics_handle& h,
23449
c763214a8260 maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents: 23447
diff changeset
1652 const char *val)
24687
8b935067a257 Allow printing without updating qt visible or invisible figures (bug #52940).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24637
diff changeset
1653 : radio_property (nm, h, radio_values (std::string (val) == "on" ?
24635
b708857d634e Correctly display boolean properties default values (bug #52768)
Sahil Yadav <yadavsahil5198@gmail.com>
parents: 24534
diff changeset
1654 "{on}|off" : "on|{off}"), val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1655 { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1656
31883
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1657 OCTAVE_DEFAULT_COPY_MOVE_CTOR (bool_property)
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1658 OCTAVE_DISABLE_COPY_MOVE_ASGN (bool_property)
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1659
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1660 ~bool_property () = default;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1661
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1662 bool is_on () const { return is ("on"); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1663
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1664 bool_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1665 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1666 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1667 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1668 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1669
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1670 base_property * clone () const { return new bool_property (*this); }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1671
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1672 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1673 bool do_set (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1674 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1675 if (val.is_bool_scalar ())
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1676 return radio_property::do_set (val.bool_value () ? "on" : "off");
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1677 else
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1678 return radio_property::do_set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1679 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1680 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1681
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1682 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1683
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1684 class OCTINTERP_API handle_property : public base_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1685 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1686 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1687
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1688 handle_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1689
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1690 handle_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1691 const graphics_handle& val = graphics_handle ())
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1692 : base_property (nm, h),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1693 m_current_val (val) { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1694
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1695 handle_property (const handle_property&) = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1696
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1697 // FIXME: should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1698 handle_property& operator = (const handle_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1699
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1700 ~handle_property () = default;
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1701
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1702 octave_value get () const { return m_current_val.as_octave_value (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1703
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1704 graphics_handle handle_value () const { return m_current_val; }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1705
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1706 handle_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1707 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1708 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1709 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1710 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1711
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1712 handle_property& operator = (const graphics_handle& h)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1713 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1714 set (octave_value (h.value ()));
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1715 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1716 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1717
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1718 void invalidate ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1719 { m_current_val = octave::numeric_limits<double>::NaN (); }
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
1720
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1721 base_property * clone () const { return new handle_property (*this); }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1722
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1723 void add_constraint (const std::string& type)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1724 { m_type_constraints.insert (type); }
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
1725
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1726 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1727 OCTINTERP_API bool do_set (const octave_value& v);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1728 std::set<std::string> m_type_constraints;
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1729
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1730 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1731 graphics_handle m_current_val;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1732 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1733
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1734 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1735
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1736 class OCTINTERP_API any_property : public base_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1737 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1738 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1739
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1740 any_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1741
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1742 any_property (const std::string& nm, const graphics_handle& h,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1743 const octave_value& m = Matrix ())
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1744 : base_property (nm, h), m_data (m) { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1745
31883
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1746 OCTAVE_DEFAULT_COPY_MOVE_CTOR (any_property)
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
1747 OCTAVE_DISABLE_COPY_MOVE_ASGN (any_property)
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1748
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1749 ~any_property () = default;
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1750
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1751 octave_value get () const { return m_data; }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1752
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1753 any_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1754 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1755 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1756 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1757 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1758
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1759 base_property * clone () const { return new any_property (*this); }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
1760
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1761 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
1762 bool do_set (const octave_value& v)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1763 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1764 m_data = v;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1765 return true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1766 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
1767
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1768 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1769 octave_value m_data;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1770 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1771
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1772 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1773
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1774 class OCTINTERP_API children_property : public base_property
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1775 {
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1776 public:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1777 children_property ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1778 : base_property ("", graphics_handle ()), m_children_list ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1779 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1780 do_init_children (Matrix ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1781 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1782
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1783 children_property (const std::string& nm, const graphics_handle& h,
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
1784 const Matrix& val)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1785 : base_property (nm, h), m_children_list ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1786 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1787 do_init_children (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1788 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1789
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1790 children_property (const children_property& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1791 : base_property (p), m_children_list ()
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1792 {
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1793 do_init_children (p.m_children_list);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1794 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1795
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1796 children_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1797 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1798 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1799 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1800 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1801
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1802 // FIXME: should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1803 children_property& operator = (const children_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1804
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1805 ~children_property () = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1806
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1807 base_property * clone () const { return new children_property (*this); }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1808
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
1809 bool remove_child (double val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1810 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1811 return do_remove_child (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1812 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1813
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
1814 void adopt (double val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1815 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1816 do_adopt_child (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1817 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1818
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1819 Matrix get_children () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1820 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1821 return do_get_children (false);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1822 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1823
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1824 Matrix get_hidden () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1825 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1826 return do_get_children (true);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1827 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1828
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1829 Matrix get_all () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1830 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1831 return do_get_all_children ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1832 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1833
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1834 octave_value get () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1835 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1836 return octave_value (get_children ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1837 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1838
26930
ead8f91c5556 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26918
diff changeset
1839 void delete_children (bool clear = false, bool from_root = false)
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
1840 {
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
1841 do_delete_children (clear, from_root);
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
1842 }
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
1843
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
1844 void renumber (graphics_handle old_gh, graphics_handle new_gh)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1845 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1846 for (auto& hchild : m_children_list)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1847 {
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
1848 if (hchild == old_gh)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1849 {
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
1850 hchild = new_gh.value ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1851 return;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1852 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1853 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1854
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1855 error ("children_list::renumber: child not found!");
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1856 }
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
1857
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1858 private:
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1859 typedef std::list<double>::iterator children_list_iterator;
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1860 typedef std::list<double>::const_iterator const_children_list_iterator;
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1861 std::list<double> m_children_list;
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1862
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1863 protected:
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1864 bool do_set (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1865 {
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1866 Matrix new_kids;
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1867
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1868 try
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1869 {
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1870 new_kids = val.matrix_value ();
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1871 }
29163
8f67ad8b3103 maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents: 29015
diff changeset
1872 catch (octave::execution_exception& ee)
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1873 {
29163
8f67ad8b3103 maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents: 29015
diff changeset
1874 error (ee, "set: children must be an array of graphics handles");
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1875 }
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1876
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1877 octave_idx_type nel = new_kids.numel ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1878
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1879 const Matrix new_kids_column = new_kids.reshape (dim_vector (nel, 1));
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1880
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1881 bool is_ok = true;
19678
c17e1cefdbd3 Fix reordering graphics property children for hidden objects (bug #44211)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19666
diff changeset
1882 bool add_hidden = true;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1883
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1884 const Matrix visible_kids = do_get_children (false);
31241
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1885 const Matrix hidden_kids = do_get_children (true);
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1886
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1887 if (visible_kids.numel () == new_kids.numel ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1888 {
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1889 Matrix t1 = visible_kids.sort ();
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1890 Matrix t2 = new_kids_column.sort ();
31241
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1891 Matrix t3 = hidden_kids.sort ();
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1892
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1893 if (t1 != t2)
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1894 is_ok = false;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1895
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1896 if (t1 == t3)
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1897 add_hidden = false;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1898 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1899 else
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1900 is_ok = false;
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1901
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
1902 if (! is_ok)
31241
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1903 error ("set: new children list must be a permutation of existing "
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1904 "children with visible handles");
26383
5455de7c8566 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26376
diff changeset
1905
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1906 m_children_list.clear ();
26383
5455de7c8566 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26376
diff changeset
1907
5455de7c8566 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26376
diff changeset
1908 // Don't use do_init_children here, as that reverses the
5455de7c8566 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26376
diff changeset
1909 // order of the list, and we don't want to do that if setting
5455de7c8566 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26376
diff changeset
1910 // the child list directly.
31241
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1911 for (octave_idx_type i = 0; i < new_kids_column.numel (); i++)
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1912 m_children_list.push_back (new_kids_column.xelem (i));
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1913
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1914 if (add_hidden)
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1915 for (octave_idx_type i = 0; i < hidden_kids.numel (); i++)
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1916 m_children_list.push_back (hidden_kids.xelem (i));
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1917
5ea5fe592a9a Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 31238
diff changeset
1918 return true;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1919 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1920
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1921 private:
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
1922 void do_init_children (const Matrix& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1923 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1924 m_children_list.clear ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1925 for (octave_idx_type i = 0; i < val.numel (); i++)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1926 m_children_list.push_front (val.xelem (i));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1927 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1928
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
1929 void do_init_children (const std::list<double>& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1930 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1931 m_children_list.clear ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1932 m_children_list = val;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1933 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1934
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1935 OCTINTERP_API Matrix do_get_children (bool return_hidden) const;
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1936
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1937 Matrix do_get_all_children () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1938 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1939 Matrix retval (m_children_list.size (), 1);
21568
3d60ed163b70 maint: Eliminate bad spacing around '='.
Rik <rik@octave.org>
parents: 21562
diff changeset
1940 octave_idx_type i = 0;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1941
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1942 for (const auto& hchild : m_children_list)
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
1943 retval(i++) = hchild;
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
1944
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1945 return retval;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1946 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1947
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1948 bool do_remove_child (double child)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1949 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1950 for (auto it = m_children_list.begin (); it != m_children_list.end (); it++)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1951 {
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
1952 if (*it == child)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1953 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1954 m_children_list.erase (it);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1955 return true;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1956 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1957 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1958 return false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1959 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1960
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
1961 void do_adopt_child (double val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1962 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1963 m_children_list.push_front (val);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1964 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
1965
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
1966 void do_delete_children (bool clear, bool from_root);
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1967 };
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1968
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1969 // ---------------------------------------------------------------------
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
1970
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
1971 class OCTINTERP_API callback_property : public base_property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1972 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1973 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1974
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1975 callback_property () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1976
7364
0e07f78369d1 [project @ 2008-01-12 08:38:17 by jwe]
jwe
parents: 7363
diff changeset
1977 callback_property (const std::string& nm, const graphics_handle& h,
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1978 const octave_value& m)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1979 : base_property (nm, h), m_callback (m) { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1980
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1981 callback_property (const callback_property&) = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1982
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1983 // FIXME: should we define assignment?
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1984 callback_property& operator = (const callback_property&) = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1985
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
1986 ~callback_property () = default;
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1987
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1988 octave_value get () const { return m_callback; }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1989
7367
600808df131c [project @ 2008-01-14 08:58:02 by jwe]
jwe
parents: 7366
diff changeset
1990 OCTINTERP_API void execute (const octave_value& data = octave_value ()) const;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1991
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
1992 bool is_defined () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1993 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
1994 return (m_callback.is_defined () && ! m_callback.isempty ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1995 }
10517
9cdd6c8c05a4 [mq]: fltk_cb
Shai Ayal <shaiay@users.sourceforge.net>
parents: 10505
diff changeset
1996
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
1997 callback_property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1998 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1999 set (val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2000 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2001 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2002
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2003 base_property * clone () const { return new callback_property (*this); }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
2004
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2005 protected:
8063
41bc700ff642 Trigger actions/listeners only for actual property change
Michael Goffioul
parents: 8061
diff changeset
2006 bool do_set (const octave_value& v)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2007 {
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
2008 if (! validate (v))
23803
90689bdbe048 Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents: 23795
diff changeset
2009 error (R"(invalid value for callback property "%s")",
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2010 get_name ().c_str ());
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
2011
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2012 m_callback = v;
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
2013 return true;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2014 return false;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2015 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2016
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2017 private:
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2018 OCTINTERP_API bool validate (const octave_value& v) const;
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2019
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2020 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2021 octave_value m_callback;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2022 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2023
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2024 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2025
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2026 class OCTINTERP_API property
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2027 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2028 public:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2029 property () : m_rep (new base_property ("", graphics_handle ()))
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2030 { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2031
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2032 property (base_property *bp, bool persist = false) : m_rep (bp)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2033 { if (persist) m_rep->m_count++; }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2034
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2035 property (const property& p) : m_rep (p.m_rep)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2036 {
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2037 m_rep->m_count++;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2038 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2039
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2040 ~property ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2041 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2042 if (--m_rep->m_count == 0)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2043 delete m_rep;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2044 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2045
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2046 bool ok () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2047 { return m_rep->ok (); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2048
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2049 std::string get_name () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2050 { return m_rep->get_name (); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2051
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2052 void set_name (const std::string& name)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2053 { m_rep->set_name (name); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2054
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2055 graphics_handle get_parent () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2056 { return m_rep->get_parent (); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2057
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2058 void set_parent (const graphics_handle& h)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2059 { m_rep->set_parent (h); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2060
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2061 bool is_hidden () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2062 { return m_rep->is_hidden (); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2063
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2064 void set_hidden (bool flag)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2065 { m_rep->set_hidden (flag); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2066
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2067 bool is_radio () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2068 { return m_rep->is_radio (); }
10717
9d4a198614ab Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents: 10596
diff changeset
2069
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2070 int get_id () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2071 { return m_rep->get_id (); }
8059
75c99d3f97d7 Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents: 8058
diff changeset
2072
75c99d3f97d7 Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents: 8058
diff changeset
2073 void set_id (int d)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2074 { m_rep->set_id (d); }
8059
75c99d3f97d7 Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents: 8058
diff changeset
2075
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2076 octave_value get () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2077 { return m_rep->get (); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2078
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2079 bool set (const octave_value& val, bool do_run = true,
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2080 bool do_notify_toolkit = true)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2081 { return m_rep->set (val, do_run, do_notify_toolkit); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2082
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2083 std::string values_as_string () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2084 { return m_rep->values_as_string (); }
10717
9d4a198614ab Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents: 10596
diff changeset
2085
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2086 Cell values_as_cell () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2087 { return m_rep->values_as_cell (); }
10717
9d4a198614ab Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents: 10596
diff changeset
2088
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2089 property& operator = (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2090 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2091 *m_rep = val;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2092 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2093 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2094
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2095 property& operator = (const property& p)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2096 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2097 if (m_rep && --m_rep->m_count == 0)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2098 delete m_rep;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2099
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2100 m_rep = p.m_rep;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2101 m_rep->m_count++;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2102
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2103 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2104 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2105
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
2106 void add_listener (const octave_value& v, listener_mode mode = GCB_POSTSET)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2107 { m_rep->add_listener (v, mode); }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2108
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2109 void delete_listener (const octave_value& v = octave_value (),
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
2110 listener_mode mode = GCB_POSTSET)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2111 { m_rep->delete_listener (v, mode); }
8299
be9b14945774 Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents: 8291
diff changeset
2112
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
2113 void run_listeners (listener_mode mode = GCB_POSTSET)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2114 { m_rep->run_listeners (mode); }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2115
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2116 static OCTINTERP_API property
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2117 create (const std::string& name, const graphics_handle& parent,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2118 const caseless_str& type, const octave_value_list& args);
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
2119
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2120 property clone () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2121 { return property (m_rep->clone ()); }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
2122
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2123 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2124 base_property *m_rep;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2125 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2126
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2127 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2128
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
2129 typedef std::pair<std::string, octave_value> pval_pair;
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
2130
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2131 class OCTINTERP_API pval_vector : public std::vector<pval_pair>
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2132 {
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
2133 public:
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2134 const_iterator find (const std::string pname) const
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2135 {
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2136 const_iterator it;
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2137
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2138 for (it = (*this).begin (); it != (*this).end (); it++)
21021
a5b99b09f8fd maint: Use comparison operators rather than compare() for strings.
Rik <rik@octave.org>
parents: 21017
diff changeset
2139 if (pname == (*it).first)
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2140 return it;
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2141
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2142 return (*this).end ();
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2143 }
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2144
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2145 iterator find (const std::string pname)
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2146 {
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2147 iterator it;
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2148
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2149 for (it = (*this).begin (); it != (*this).end (); it++)
21021
a5b99b09f8fd maint: Use comparison operators rather than compare() for strings.
Rik <rik@octave.org>
parents: 21017
diff changeset
2150 if (pname == (*it).first)
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2151 return it;
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2152
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2153 return (*this).end ();
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2154 }
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2155
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2156 octave_value lookup (const std::string pname) const
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2157 {
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2158 octave_value retval;
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2159
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2160 const_iterator it = find (pname);
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2161
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2162 if (it != (*this).end ())
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
2163 retval = (*it).second;
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2164
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2165 return retval;
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2166 }
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2167
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2168 octave_value& operator [] (const std::string pname)
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2169 {
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2170 iterator it = find (pname);
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2171
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2172 if (it == (*this).end ())
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2173 {
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2174 push_back (pval_pair (pname, octave_value ()));
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2175 return (*this).back ().second;
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2176 }
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2177
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2178 return (*it).second;
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2179 }
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2180
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2181 void erase (const std::string pname)
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2182 {
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2183 iterator it = find (pname);
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2184 if (it != (*this).end ())
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2185 erase (it);
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2186 }
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2187
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2188 void erase (iterator it)
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2189 {
21880
a6952c880cec maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents: 21824
diff changeset
2190 std::vector<pval_pair>::erase (it);
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2191 }
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2192
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2193 };
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2194
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2195 class OCTINTERP_API property_list
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2196 {
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2197 public:
19086
dc88c5784f74 Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19047
diff changeset
2198 typedef pval_vector pval_map_type;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2199 typedef std::map<std::string, pval_map_type> plist_map_type;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2200
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2201 typedef pval_map_type::iterator pval_map_iterator;
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2202 typedef pval_map_type::const_iterator pval_map_const_iterator;
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2203
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2204 typedef plist_map_type::iterator plist_map_iterator;
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2205 typedef plist_map_type::const_iterator plist_map_const_iterator;
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2206
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2207 property_list (const plist_map_type& m = plist_map_type ())
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2208 : m_plist_map (m) { }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2209
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
2210 OCTAVE_DEFAULT_COPY_MOVE_DELETE (property_list)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2211
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2212 OCTINTERP_API void set (const caseless_str& name, const octave_value& val);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2213
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2214 OCTINTERP_API octave_value lookup (const caseless_str& name) const;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2215
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2216 plist_map_iterator begin () { return m_plist_map.begin (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2217 plist_map_const_iterator begin () const { return m_plist_map.begin (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2218
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2219 plist_map_iterator end () { return m_plist_map.end (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2220 plist_map_const_iterator end () const { return m_plist_map.end (); }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2221
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2222 plist_map_iterator find (const std::string& go_name)
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2223 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2224 return m_plist_map.find (go_name);
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2225 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2226
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2227 plist_map_const_iterator find (const std::string& go_name) const
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2228 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2229 return m_plist_map.find (go_name);
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2230 }
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2231
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2232 OCTINTERP_API octave_scalar_map
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2233 as_struct (const std::string& prefix_arg) const;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2234
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2235 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2236 plist_map_type m_plist_map;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2237 };
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2238
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2239 // ---------------------------------------------------------------------
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2240
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2241 class base_graphics_object;
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2242 class graphics_object;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2243
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
2244 class OCTINTERP_API base_properties
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2245 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2246 public:
7176
6525eb2fba0f [project @ 2007-11-14 20:42:06 by jwe]
jwe
parents: 7168
diff changeset
2247 base_properties (const std::string& ty = "unknown",
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2248 const graphics_handle& mh = graphics_handle (),
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2249 const graphics_handle& p = graphics_handle ());
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2250
31883
56809fe23e53 eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
2251 OCTAVE_DISABLE_COPY_MOVE (base_properties)
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
2252
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2253 virtual ~base_properties () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2254
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2255 virtual std::string graphics_object_name () const { return "unknown"; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2256
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2257 OCTINTERP_API void mark_modified ();
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2258
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2259 OCTINTERP_API void override_defaults (base_graphics_object& obj);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2260
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
2261 virtual void init_integerhandle (const octave_value&)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2262 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2263 panic_impossible ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2264 }
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
2265
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2266 // Look through DEFAULTS for properties with given CLASS_NAME, and
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2267 // apply them to the current object with set (virtual method).
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2268
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2269 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2270 set_from_list (base_graphics_object& obj, property_list& defaults);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2271
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2272 void insert_property (const std::string& name, property p)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2273 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2274 p.set_name (name);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2275 p.set_parent (m___myhandle__);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2276 m_all_props[name] = p;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2277 }
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2278
9972
d32a6cc0193b unshare dynamic properties
John W. Eaton <jwe@octave.org>
parents: 9815
diff changeset
2279 virtual void set (const caseless_str&, const octave_value&);
9185
1e5c11890f85 check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents: 9004
diff changeset
2280
1e5c11890f85 check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents: 9004
diff changeset
2281 virtual octave_value get (const caseless_str& pname) const;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2282
9616
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2283 virtual octave_value get (const std::string& pname) const
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2284 {
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2285 return get (caseless_str (pname));
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2286 }
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2287
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2288 virtual octave_value get (const char *pname) const
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2289 {
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2290 return get (caseless_str (pname));
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2291 }
2093499ec9f4 avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents: 9585
diff changeset
2292
7379
a78c7bccda91 [project @ 2008-01-15 18:42:29 by jwe]
jwe
parents: 7377
diff changeset
2293 virtual octave_value get (bool all = false) const;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2294
28346
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2295 // FIXME: It seems like this function should be const, but that is
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2296 // currently not possible with the way that properties are stored as
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2297 // specific types in the graphics_object classes.
9185
1e5c11890f85 check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents: 9004
diff changeset
2298 virtual property get_property (const caseless_str& pname);
1e5c11890f85 check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents: 9004
diff changeset
2299
9585
06b8b51dca48 also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents: 9582
diff changeset
2300 virtual bool has_property (const caseless_str&) const
06b8b51dca48 also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents: 9582
diff changeset
2301 {
06b8b51dca48 also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents: 9582
diff changeset
2302 panic_impossible ();
06b8b51dca48 also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents: 9582
diff changeset
2303 return false;
06b8b51dca48 also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents: 9582
diff changeset
2304 }
7864
56f781f38f0b Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7862
diff changeset
2305
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2306 bool is_modified () const { return is___modified__ (); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2307
26930
ead8f91c5556 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26918
diff changeset
2308 virtual void remove_child (const graphics_handle& h, bool = false)
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2309 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2310 if (m_children.remove_child (h.value ()))
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2311 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2312 m_children.run_listeners ();
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2313 mark_modified ();
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2314 }
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2315 }
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2316
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2317 virtual void adopt (const graphics_handle& h)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2318 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2319 m_children.adopt (h.value ());
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2320 m_children.run_listeners ();
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
2321 mark_modified ();
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2322 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2323
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2324 virtual octave::graphics_toolkit get_toolkit () const;
7419
f62fb98f1da2 [project @ 2008-01-25 08:24:48 by jwe]
jwe
parents: 7408
diff changeset
2325
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2326 virtual Matrix
20946
6eff66fb8a02 style fixes for comments
John W. Eaton <jwe@octave.org>
parents: 20893
diff changeset
2327 get_boundingbox (bool /* finternal */ = false,
6eff66fb8a02 style fixes for comments
John W. Eaton <jwe@octave.org>
parents: 20893
diff changeset
2328 const Matrix& /* parent_pix_size */ = Matrix ()) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2329 { return Matrix (1, 4, 0.0); }
7447
25018e35b4cb [project @ 2008-02-05 22:38:57 by jwe]
jwe
parents: 7446
diff changeset
2330
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2331 virtual void update_boundingbox ();
7828
4739b6a1925c Implement resize handler mechanism (call resizefcn on figure resize and notify children).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7827
diff changeset
2332
12389
5367bd36b9f8 implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents: 12334
diff changeset
2333 virtual void update_autopos (const std::string& elem_type);
5367bd36b9f8 implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents: 12334
diff changeset
2334
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2335 virtual void add_listener (const caseless_str&, const octave_value&,
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
2336 listener_mode = GCB_POSTSET);
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2337
8299
be9b14945774 Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents: 8291
diff changeset
2338 virtual void delete_listener (const caseless_str&, const octave_value&,
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
2339 listener_mode = GCB_POSTSET);
8299
be9b14945774 Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents: 8291
diff changeset
2340
27698
f65b1666e650 don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents: 27682
diff changeset
2341 void set_beingdeleted (const octave_value& val)
f65b1666e650 don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents: 27682
diff changeset
2342 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2343 m_beingdeleted.set (val, true, false);
29014
df307ee1fb30 Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 28346
diff changeset
2344 update_beingdeleted ();
27698
f65b1666e650 don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents: 27682
diff changeset
2345 }
f65b1666e650 don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents: 27682
diff changeset
2346
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2347 void set_tag (const octave_value& val) { m_tag = val; }
7176
6525eb2fba0f [project @ 2007-11-14 20:42:06 by jwe]
jwe
parents: 7168
diff changeset
2348
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2349 OCTINTERP_API void set_parent (const octave_value& val);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2350
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2351 Matrix get_children () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2352 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2353 return m_children.get_children ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2354 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2355
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2356 Matrix get_all_children () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2357 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2358 return m_children.get_all ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2359 }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2360
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2361 Matrix get_hidden_children () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2362 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2363 return m_children.get_hidden ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2364 }
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2365
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2366 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2367 get_children_of_type (const caseless_str& type, bool get_invisible,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2368 bool traverse,
32589
05b4479c29d8 maint: C++ style check for libinterp/ before 9.1 release.
Rik <rik@octave.org>
parents: 32116
diff changeset
2369 std::list<graphics_object>& children_list) const;
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
2370
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2371 void set_modified (const octave_value& val) { set___modified__ (val); }
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2372
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2373 void set___modified__ (const octave_value& val) { m___modified__ = val; }
7366
2a2115742cb5 [project @ 2008-01-13 06:46:39 by jwe]
jwe
parents: 7365
diff changeset
2374
28298
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2375 // Redirect calls to "uicontextmenu" to "contextmenu".
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2376
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2377 graphics_handle get_uicontextmenu () const
28298
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2378 {
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2379 return get_contextmenu ();
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2380 }
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2381
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2382 void set_uicontextmenu (const octave_value& val)
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2383 {
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2384 set_contextmenu (val);
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2385 }
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2386
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2387 void reparent (const graphics_handle& new_parent) { m_parent = new_parent; }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2388
7214
86d0b16f2bb2 [project @ 2007-11-29 03:40:04 by jwe]
jwe
parents: 7213
diff changeset
2389 // Update data limits for AXIS_TYPE (xdata, ydata, etc.) in the parent
86d0b16f2bb2 [project @ 2007-11-29 03:40:04 by jwe]
jwe
parents: 7213
diff changeset
2390 // axes object.
86d0b16f2bb2 [project @ 2007-11-29 03:40:04 by jwe]
jwe
parents: 7213
diff changeset
2391
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2392 virtual void update_axis_limits (const std::string& axis_type) const;
7214
86d0b16f2bb2 [project @ 2007-11-29 03:40:04 by jwe]
jwe
parents: 7213
diff changeset
2393
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2394 virtual void update_axis_limits (const std::string& axis_type,
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2395 const graphics_handle& h) const;
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2396
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2397 virtual void update_contextmenu () const;
20077
69f92e0affd2 Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20051
diff changeset
2398
26930
ead8f91c5556 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26918
diff changeset
2399 virtual void delete_children (bool clear = false, bool from_root = false)
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2400 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2401 m_children.delete_children (clear, from_root);
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2402 }
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2403
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
2404 void renumber_child (graphics_handle old_gh, graphics_handle new_gh)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2405 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2406 m_children.renumber (old_gh, new_gh);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2407 }
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
2408
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
2409 void renumber_parent (graphics_handle new_gh)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2410 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2411 m_parent = new_gh;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2412 }
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
2413
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2414 static OCTINTERP_API property_list::pval_map_type factory_defaults ();
7222
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2415
26122
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
2416 // FIXME: These functions should be generated automatically by the
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
2417 // genprops.awk script.
7222
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2418 //
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2419 // EMIT_BASE_PROPERTIES_GET_FUNCTIONS
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2420
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2421 virtual octave_value get_alim () const { return octave_value (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2422 virtual octave_value get_clim () const { return octave_value (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2423 virtual octave_value get_xlim () const { return octave_value (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2424 virtual octave_value get_ylim () const { return octave_value (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2425 virtual octave_value get_zlim () const { return octave_value (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2426
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2427 virtual bool is_aliminclude () const { return false; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2428 virtual bool is_climinclude () const { return false; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2429 virtual bool is_xliminclude () const { return false; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2430 virtual bool is_yliminclude () const { return false; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2431 virtual bool is_zliminclude () const { return false; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2432
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2433 OCTINTERP_API bool is_handle_visible () const;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2434
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2435 OCTINTERP_API std::set<std::string> dynamic_property_names () const;
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2436
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2437 OCTINTERP_API bool has_dynamic_property (const std::string& pname) const;
9185
1e5c11890f85 check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents: 9004
diff changeset
2438
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2439 protected:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2440 std::set<std::string> m_dynamic_properties;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2441
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2442 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2443 set_dynamic (const caseless_str& pname, const octave_value& val);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2444
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2445 OCTINTERP_API octave_value get_dynamic (const caseless_str& pname) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2446
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2447 OCTINTERP_API octave_value get_dynamic (bool all = false) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2448
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2449 OCTINTERP_API property get_property_dynamic (const caseless_str& pname) const;
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2450
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2451 BEGIN_BASE_PROPERTIES
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2452 // properties common to all objects
27698
f65b1666e650 don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents: 27682
diff changeset
2453 bool_property beingdeleted s , "off"
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2454 radio_property busyaction , "{queue}|cancel"
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2455 callback_property buttondownfcn , Matrix ()
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2456 children_property children gf , Matrix ()
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2457 bool_property clipping , "on"
28298
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2458 handle_property contextmenu u , graphics_handle ()
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2459 callback_property createfcn , Matrix ()
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2460 callback_property deletefcn , Matrix ()
24395
41cf6ee90cb6 Better handling of "handlevisibility" property (bug #52621).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24277
diff changeset
2461 radio_property handlevisibility u , "{on}|callback|off"
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2462 bool_property hittest , "on"
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2463 bool_property interruptible , "on"
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2464 handle_property parent fs , p
24523
501986e12b8b Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24501
diff changeset
2465 radio_property pickableparts , "{visible}|all|none"
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2466 bool_property selected , "off"
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2467 bool_property selectionhighlight , "on"
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2468 string_property tag s , ""
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2469 string_property type frs , ty
28298
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
2470 handle_property uicontextmenu gsh , graphics_handle ()
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2471 any_property userdata , Matrix ()
26045
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
2472 bool_property visible u , "on"
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
2473
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
2474 // Octave-specific properties
27682
e18237114cf8 Hide __appdata__ internal property (bug #57211).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 27446
diff changeset
2475 any_property __appdata__ h , Matrix ()
22665
4ea5b0c3b10f Make base graphics property __modified__ hidden (bug #49205).
Rik <rik@octave.org>
parents: 22631
diff changeset
2476 bool_property __modified__ hs , "on"
8061
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2477 graphics_handle __myhandle__ fhrs , mh
f819e8992367 Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents: 8059
diff changeset
2478 END_PROPERTIES
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2479
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2480 virtual void update_beingdeleted () { };
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2481
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2482 virtual void update_handlevisibility ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2483
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2484 virtual void update_visible () { };
26045
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
2485
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2486 protected:
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2487 struct cmp_caseless_str
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2488 {
30155
14b098a6ba46 maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents: 30053
diff changeset
2489 public:
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
2490 bool operator () (const caseless_str& a, const caseless_str& b) const
8052
961d4c52ffae Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents: 8023
diff changeset
2491 {
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2492 std::string a1 = a;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2493 std::transform (a1.begin (), a1.end (), a1.begin (), tolower);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2494 std::string b1 = b;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2495 std::transform (b1.begin (), b1.end (), b1.begin (), tolower);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2496
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2497 return a1 < b1;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2498 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2499 };
8052
961d4c52ffae Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents: 8023
diff changeset
2500
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2501 std::map<caseless_str, property, cmp_caseless_str> m_all_props;
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2502
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
2503 protected:
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2504
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2505 virtual void init ()
22910
23847979b91e maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
2506 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2507 m_contextmenu.add_constraint ("uicontextmenu");
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
2508 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2509 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2510
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
2511 class OCTINTERP_API base_graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2512 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2513 public:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2514 friend class graphics_object;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2515
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2516 base_graphics_object () : m_toolkit_flag (false) { }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2517
31837
febd82d1a8de use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents: 31827
diff changeset
2518 OCTAVE_DISABLE_COPY_MOVE (base_graphics_object)
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
2519
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2520 virtual ~base_graphics_object () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2521
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2522 virtual void mark_modified ()
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2523 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2524 if (! valid_object ())
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2525 error ("base_graphics_object::mark_modified: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2526
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2527 get_properties ().mark_modified ();
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2528 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2529
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2530 virtual void override_defaults (base_graphics_object& obj)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2531 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2532 if (! valid_object ())
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2533 error ("base_graphics_object::override_defaults: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2534 get_properties ().override_defaults (obj);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2535 }
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
2536
23433
c9fab0bc983e maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents: 23401
diff changeset
2537 void build_user_defaults_map (property_list::pval_map_type& def,
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2538 const std::string go_name) const;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2539
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2540 virtual void set_from_list (property_list& plist)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2541 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2542 if (! valid_object ())
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2543 error ("base_graphics_object::set_from_list: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2544
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2545 get_properties ().set_from_list (*this, plist);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2546 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2547
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2548 virtual void set (const caseless_str& pname, const octave_value& pval)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2549 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2550 if (! valid_object ())
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2551 error ("base_graphics_object::set: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2552
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2553 get_properties ().set (pname, pval);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2554 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2555
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2556 virtual void set_defaults (const std::string&)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2557 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2558 error ("base_graphics_object::set_defaults: invalid graphics object");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2559 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2560
26918
0a13d8d19790 avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents: 26879
diff changeset
2561 // The following version of the get method is not declared virtual
0a13d8d19790 avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents: 26879
diff changeset
2562 // because no derived class overrides it.
0a13d8d19790 avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents: 26879
diff changeset
2563
0a13d8d19790 avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents: 26879
diff changeset
2564 octave_value get (bool all = false) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2565 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2566 if (! valid_object ())
20956
850e3d2533d4 maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents: 20955
diff changeset
2567 error ("base_graphics_object::get: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2568
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2569 return get_properties ().get (all);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2570 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2571
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2572 virtual octave_value get (const caseless_str& pname) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2573 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2574 if (! valid_object ())
20956
850e3d2533d4 maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents: 20955
diff changeset
2575 error ("base_graphics_object::get: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2576
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2577 return get_properties ().get (pname);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2578 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2579
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
2580 virtual octave_value get_default (const caseless_str&) const;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2581
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
2582 virtual octave_value get_factory_default (const caseless_str&) const;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2583
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2584 virtual octave_value get_defaults () const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2585 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2586 error ("base_graphics_object::get_defaults: invalid graphics object");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2587 }
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
2588
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2589 virtual property_list get_defaults_list () const
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2590 {
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2591 if (! valid_object ())
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2592 error ("base_graphics_object::get_defaults_list: invalid graphics object");
21055
5e00ed38a58b maint: Replace if/error/else paradigm with just if/error.
Rik <rik@octave.org>
parents: 21021
diff changeset
2593
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2594 return property_list ();
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2595 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2596
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2597 virtual octave_value get_factory_defaults () const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2598 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2599 error ("base_graphics_object::get_factory_defaults: invalid graphics object");
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2600 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2601
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2602 virtual property_list get_factory_defaults_list () const
18963
a30e1d20fd3c Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents: 18961
diff changeset
2603 {
a30e1d20fd3c Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents: 18961
diff changeset
2604 error ("base_graphics_object::get_factory_defaults_list: invalid graphics object");
a30e1d20fd3c Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents: 18961
diff changeset
2605 }
a30e1d20fd3c Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents: 18961
diff changeset
2606
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
2607 virtual bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
2608 {
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
2609 return base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
2610 }
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
2611
28346
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2612 // FIXME: It seems like this function should be const, but that is
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2613 // currently not possible.
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2614 virtual std::string values_as_string ();
10717
9d4a198614ab Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents: 10596
diff changeset
2615
28346
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2616 // FIXME: It seems like this function should be const, but that is
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2617 // currently not possible.
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
2618 virtual std::string value_as_string (const std::string& prop);
18118
ca84d3c9dc24 set: allow retrieving allowed values for individual properties
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 17822
diff changeset
2619
28346
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2620 // FIXME: It seems like this function should be const, but that is
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2621 // currently not possible.
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2622 virtual octave_scalar_map values_as_struct ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2623
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2624 virtual graphics_handle get_parent () const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2625 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2626 if (! valid_object ())
20956
850e3d2533d4 maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents: 20955
diff changeset
2627 error ("base_graphics_object::get_parent: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2628
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2629 return get_properties ().get_parent ();
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2630 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2631
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2632 graphics_handle get_handle () const
7936
78400fde223e Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents: 7902
diff changeset
2633 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2634 if (! valid_object ())
20956
850e3d2533d4 maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents: 20955
diff changeset
2635 error ("base_graphics_object::get_handle: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2636
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2637 return get_properties ().get___myhandle__ ();
7936
78400fde223e Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents: 7902
diff changeset
2638 }
78400fde223e Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents: 7902
diff changeset
2639
26930
ead8f91c5556 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26918
diff changeset
2640 virtual void remove_child (const graphics_handle& h, bool from_root = false)
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2641 {
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2642 if (! valid_object ())
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2643 error ("base_graphics_object::remove_child: invalid graphics object");
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2644
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2645 get_properties ().remove_child (h, from_root);
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2646 }
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
2647
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2648 virtual void adopt (const graphics_handle& h)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2649 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2650 if (! valid_object ())
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2651 error ("base_graphics_object::adopt: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2652
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2653 get_properties ().adopt (h);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2654 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2655
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2656 virtual void reparent (const graphics_handle& np)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2657 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2658 if (! valid_object ())
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2659 error ("base_graphics_object::reparent: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2660
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2661 get_properties ().reparent (np);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2662 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2663
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2664 virtual void defaults () const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2665 {
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
2666 if (! valid_object ())
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2667 error ("base_graphics_object::default: invalid graphics object");
20962
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
2668
3aa293be0e8d maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents: 20956
diff changeset
2669 std::string msg = (type () + "::defaults");
21100
e39e05d90788 Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents: 21055
diff changeset
2670 err_not_implemented (msg.c_str ());
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2671 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2672
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2673 virtual base_properties& get_properties ()
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2674 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2675 static base_properties properties;
22190
e68128601f5e skip invalid objects in Qt graphics event handlers (bug #46501)
John W. Eaton <jwe@octave.org>
parents: 22069
diff changeset
2676 warning ("base_graphics_object::get_properties: invalid graphics object");
e68128601f5e skip invalid objects in Qt graphics event handlers (bug #46501)
John W. Eaton <jwe@octave.org>
parents: 22069
diff changeset
2677 return properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2678 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2679
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2680 virtual const base_properties& get_properties () const
7222
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2681 {
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2682 static base_properties properties;
22190
e68128601f5e skip invalid objects in Qt graphics event handlers (bug #46501)
John W. Eaton <jwe@octave.org>
parents: 22069
diff changeset
2683 warning ("base_graphics_object::get_properties: invalid graphics object");
e68128601f5e skip invalid objects in Qt graphics event handlers (bug #46501)
John W. Eaton <jwe@octave.org>
parents: 22069
diff changeset
2684 return properties;
7222
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2685 }
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2686
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2687 virtual void update_axis_limits (const std::string& axis_type);
7214
86d0b16f2bb2 [project @ 2007-11-29 03:40:04 by jwe]
jwe
parents: 7213
diff changeset
2688
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2689 virtual void update_axis_limits (const std::string& axis_type,
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2690 const graphics_handle& h);
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2691
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2692 virtual bool valid_object () const { return false; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2693
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2694 bool valid_toolkit_object () const { return m_toolkit_flag; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2695
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2696 virtual std::string type () const
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2697 {
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2698 return (valid_object () ? get_properties ().graphics_object_name ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2699 : "unknown");
7386
22815fa9c368 [project @ 2008-01-15 21:28:43 by jwe]
jwe
parents: 7384
diff changeset
2700 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2701
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2702 bool isa (const std::string& go_name) const
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2703 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2704 return type () == go_name;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2705 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2706
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2707 virtual octave::graphics_toolkit get_toolkit () const
7419
f62fb98f1da2 [project @ 2008-01-25 08:24:48 by jwe]
jwe
parents: 7408
diff changeset
2708 {
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2709 if (! valid_object ())
20956
850e3d2533d4 maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents: 20955
diff changeset
2710 error ("base_graphics_object::get_toolkit: invalid graphics object");
20976
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2711
0fd972b06a6f maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents: 20962
diff changeset
2712 return get_properties ().get_toolkit ();
7419
f62fb98f1da2 [project @ 2008-01-25 08:24:48 by jwe]
jwe
parents: 7408
diff changeset
2713 }
f62fb98f1da2 [project @ 2008-01-25 08:24:48 by jwe]
jwe
parents: 7408
diff changeset
2714
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2715 virtual void add_property_listener (const std::string& nm,
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
2716 const octave_value& v,
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
2717 listener_mode mode = GCB_POSTSET)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2718 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2719 if (valid_object ())
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2720 get_properties ().add_listener (nm, v, mode);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2721 }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2722
8299
be9b14945774 Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents: 8291
diff changeset
2723 virtual void delete_property_listener (const std::string& nm,
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
2724 const octave_value& v,
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
2725 listener_mode mode = GCB_POSTSET)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2726 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2727 if (valid_object ())
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2728 get_properties ().delete_listener (nm, v, mode);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2729 }
8299
be9b14945774 Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents: 8291
diff changeset
2730
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2731 virtual void remove_all_listeners ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2732
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2733 virtual void reset_default_properties ();
10722
755fcb5baad3 Add the reset built function
David Bateman <dbateman@free.fr>
parents: 10717
diff changeset
2734
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2735 protected:
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2736 virtual void initialize (const graphics_object& go)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2737 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2738 if (! m_toolkit_flag)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2739 m_toolkit_flag = get_toolkit ().initialize (go);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2740 }
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2741
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2742 virtual void finalize (const graphics_object& go)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2743 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2744 if (m_toolkit_flag)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2745 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2746 get_toolkit ().finalize (go);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2747 m_toolkit_flag = false;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2748 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2749 }
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2750
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2751 virtual void update (const graphics_object& go, int id)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2752 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2753 if (m_toolkit_flag)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2754 get_toolkit ().update (go, id);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2755 }
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2756
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2757 protected:
12164
18e9a8da7d18 eliminate some -Weffc++ warnings
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 12126
diff changeset
2758
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2759 // A flag telling whether this object is a valid object
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2760 // in the backend context.
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2761 bool m_toolkit_flag;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2762 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2763
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
2764 class OCTINTERP_API graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2765 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2766 public:
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
2767
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2768 graphics_object () : m_rep (new base_graphics_object ()) { }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2769
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2770 graphics_object (base_graphics_object *new_rep) : m_rep (new_rep) { }
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
2771
24991
831389905438 omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents: 24795
diff changeset
2772 graphics_object (const graphics_object&) = default;
831389905438 omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents: 24795
diff changeset
2773
831389905438 omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents: 24795
diff changeset
2774 graphics_object& operator = (const graphics_object&) = default;
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
2775
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2776 ~graphics_object () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2777
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2778 void mark_modified () { m_rep->mark_modified (); }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2779
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2780 void override_defaults (base_graphics_object& obj)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2781 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2782 m_rep->override_defaults (obj);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2783 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2784
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2785 void override_defaults ()
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
2786 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2787 m_rep->override_defaults (*m_rep);
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
2788 }
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
2789
23433
c9fab0bc983e maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents: 23401
diff changeset
2790 void build_user_defaults_map (property_list::pval_map_type& def,
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2791 const std::string go_name) const
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2792 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2793 m_rep->build_user_defaults_map (def, go_name);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2794 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2795
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2796 void set_from_list (property_list& plist) { m_rep->set_from_list (plist); }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2797
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
2798 void set (const caseless_str& name, const octave_value& val)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2799 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2800 m_rep->set (name, val);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2801 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2802
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2803 OCTINTERP_API void set (const octave_value_list& args);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2804
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2805 OCTINTERP_API void set (const Array<std::string>& names, const Cell& values,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2806 octave_idx_type row);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2807
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2808 OCTINTERP_API void set (const octave_map& m);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2809
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2810 OCTINTERP_API void set_value_or_default (const caseless_str& name,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2811 const octave_value& val);
10056
33ba83a06a42 Fix set function to allow cell and struct arguments.
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9972
diff changeset
2812
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2813 void set_defaults (const std::string& mode) { m_rep->set_defaults (mode); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2814
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2815 octave_value get (bool all = false) const { return m_rep->get (all); }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2816
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
2817 octave_value get (const caseless_str& name) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2818 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2819 return name.compare ("default")
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2820 ? get_defaults ()
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
2821 : (name.compare ("factory")
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2822 ? get_factory_defaults () : m_rep->get (name));
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2823 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2824
9620
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2825 octave_value get (const std::string& name) const
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2826 {
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2827 return get (caseless_str (name));
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2828 }
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2829
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2830 octave_value get (const char *name) const
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2831 {
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2832 return get (caseless_str (name));
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2833 }
b00af0da85dd graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents: 9616
diff changeset
2834
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
2835 octave_value get_default (const caseless_str& name) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2836 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2837 return m_rep->get_default (name);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2838 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2839
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
2840 octave_value get_factory_default (const caseless_str& name) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2841 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2842 return m_rep->get_factory_default (name);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2843 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2844
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2845 octave_value get_defaults () const { return m_rep->get_defaults (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2846
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2847 property_list get_defaults_list () const
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2848 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2849 return m_rep->get_defaults_list ();
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2850 }
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
2851
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2852 octave_value get_factory_defaults () const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2853 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2854 return m_rep->get_factory_defaults ();
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2855 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2856
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2857 property_list get_factory_defaults_list () const
18963
a30e1d20fd3c Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents: 18961
diff changeset
2858 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2859 return m_rep->get_factory_defaults_list ();
18963
a30e1d20fd3c Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents: 18961
diff changeset
2860 }
a30e1d20fd3c Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents: 18961
diff changeset
2861
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
2862 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
2863 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2864 return m_rep->has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
2865 }
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
2866
28346
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2867 // FIXME: It seems like this function should be const, but that is
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2868 // currently not possible.
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2869 std::string values_as_string () { return m_rep->values_as_string (); }
10717
9d4a198614ab Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents: 10596
diff changeset
2870
28346
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2871 // FIXME: It seems like this function should be const, but that is
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2872 // currently not possible.
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2873 std::string value_as_string (const std::string& prop)
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
2874 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2875 return m_rep->value_as_string (prop);
18118
ca84d3c9dc24 set: allow retrieving allowed values for individual properties
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 17822
diff changeset
2876 }
ca84d3c9dc24 set: allow retrieving allowed values for individual properties
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 17822
diff changeset
2877
28346
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2878 // FIXME: It seems like this function should be const, but that is
d0555f415774 fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
2879 // currently not possible.
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2880 octave_map values_as_struct () { return m_rep->values_as_struct (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2881
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2882 graphics_handle get_parent () const { return m_rep->get_parent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2883
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2884 graphics_handle get_handle () const { return m_rep->get_handle (); }
7936
78400fde223e Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents: 7902
diff changeset
2885
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
2886 OCTINTERP_API graphics_object get_ancestor (const std::string& type) const;
11250
830b940e7ff4 Turn xget_ancestor into regular API
Michael Goffioul <michael.goffioul@gmail.com>
parents: 11247
diff changeset
2887
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2888 void remove_child (const graphics_handle& h) { m_rep->remove_child (h); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2890 void adopt (const graphics_handle& h) { m_rep->adopt (h); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2891
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2892 void reparent (const graphics_handle& h) { m_rep->reparent (h); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2893
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2894 void defaults () const { m_rep->defaults (); }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2895
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2896 bool isa (const std::string& go_name) const { return m_rep->isa (go_name); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2897
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2898 base_properties& get_properties () { return m_rep->get_properties (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2899
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2900 const base_properties& get_properties () const
7222
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2901 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2902 return m_rep->get_properties ();
7222
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2903 }
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2904
7214
86d0b16f2bb2 [project @ 2007-11-29 03:40:04 by jwe]
jwe
parents: 7213
diff changeset
2905 void update_axis_limits (const std::string& axis_type)
86d0b16f2bb2 [project @ 2007-11-29 03:40:04 by jwe]
jwe
parents: 7213
diff changeset
2906 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2907 m_rep->update_axis_limits (axis_type);
7214
86d0b16f2bb2 [project @ 2007-11-29 03:40:04 by jwe]
jwe
parents: 7213
diff changeset
2908 }
86d0b16f2bb2 [project @ 2007-11-29 03:40:04 by jwe]
jwe
parents: 7213
diff changeset
2909
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2910 void update_axis_limits (const std::string& axis_type,
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2911 const graphics_handle& h)
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
2912 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2913 m_rep->update_axis_limits (axis_type, h);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2914 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2915
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2916 bool valid_object () const { return m_rep->valid_object (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2917
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2918 std::string type () const { return m_rep->type (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2919
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2920 operator bool () const { return m_rep->valid_object (); }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2921
26122
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
2922 // FIXME: These functions should be generated automatically by the
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
2923 // genprops.awk script.
7222
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2924 //
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
2925 // EMIT_GRAPHICS_OBJECT_GET_FUNCTIONS
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2926
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2927 octave_value get_alim () const
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
2928 { return get_properties ().get_alim (); }
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
2929
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2930 octave_value get_clim () const
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
2931 { return get_properties ().get_clim (); }
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
2932
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2933 octave_value get_xlim () const
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2934 { return get_properties ().get_xlim (); }
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2935
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2936 octave_value get_ylim () const
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2937 { return get_properties ().get_ylim (); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2938
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2939 octave_value get_zlim () const
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2940 { return get_properties ().get_zlim (); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2941
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2942 bool is_aliminclude () const
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
2943 { return get_properties ().is_aliminclude (); }
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
2944
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2945 bool is_climinclude () const
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
2946 { return get_properties ().is_climinclude (); }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2947
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2948 bool is_xliminclude () const
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2949 { return get_properties ().is_xliminclude (); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2950
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2951 bool is_yliminclude () const
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2952 { return get_properties ().is_yliminclude (); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2953
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2954 bool is_zliminclude () const
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
2955 { return get_properties ().is_zliminclude (); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2956
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2957 bool is_handle_visible () const
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 8247
diff changeset
2958 { return get_properties ().is_handle_visible (); }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
2959
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2960 octave::graphics_toolkit get_toolkit () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2961 { return m_rep->get_toolkit (); }
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents: 7406
diff changeset
2962
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2963 void add_property_listener (const std::string& nm, const octave_value& v,
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
2964 listener_mode mode = GCB_POSTSET)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2965 { m_rep->add_property_listener (nm, v, mode); }
7849
3249f64f69b2 Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7848
diff changeset
2966
8299
be9b14945774 Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents: 8291
diff changeset
2967 void delete_property_listener (const std::string& nm, const octave_value& v,
27320
1dfd6ae74fbf use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents: 27099
diff changeset
2968 listener_mode mode = GCB_POSTSET)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2969 { m_rep->delete_property_listener (nm, v, mode); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2970
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2971 void remove_all_listeners () { m_rep->remove_all_listeners (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2972
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2973 void initialize () { m_rep->initialize (*this); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2974
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2975 void finalize () { m_rep->finalize (*this); }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2976
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2977 void update (int id) { m_rep->update (*this, id); }
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
2978
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
2979 void reset_default_properties ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2980 { m_rep->reset_default_properties (); }
10722
755fcb5baad3 Add the reset built function
David Bateman <dbateman@free.fr>
parents: 10717
diff changeset
2981
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents: 7406
diff changeset
2982 private:
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
2983
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
2984 std::shared_ptr<base_graphics_object> m_rep;
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents: 7406
diff changeset
2985 };
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents: 7406
diff changeset
2986
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents: 7406
diff changeset
2987 // ---------------------------------------------------------------------
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents: 7406
diff changeset
2988
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
2989 class OCTINTERP_API root_figure : public base_graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2990 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2991 public:
23763
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
2992
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
2993 // The gh_manager constructor creates the single instance of
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
2994 // the root_figure object.
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
2995
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
2996 friend class gh_manager;
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
2997
7821
f79dcba526a8 Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7527
diff changeset
2998 class OCTINTERP_API properties : public base_properties
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
2999 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3000 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3001 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3002 remove_child (const graphics_handle& h, bool from_root = false);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3003
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3004 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3005 get_boundingbox (bool internal = false,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3006 const Matrix& parent_pix_size = Matrix ()) const;
14357
e7c74f56cd03 fltk toolkit requires figure units to be "pixels". Bug # 35430.
Ben Abbott <bpabbott@mac.com>
parents: 14324
diff changeset
3007
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3008 // See the genprops.awk script for an explanation of the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3009 // properties declarations.
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3010
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3011 // FIXME: Properties that still don't have callbacks are:
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3012 // monitorpositions, pointerlocation, pointerwindow.
18764
89448a7523b2 Add some more callbacks for root properties (bug #42347).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18737
diff changeset
3013 // Note that these properties are not yet used by Octave, so setting
89448a7523b2 Add some more callbacks for root properties (bug #42347).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18737
diff changeset
3014 // them will have no effect.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3015
20459
564e59f75ef8 Remove obsolete properties from root figure object.
Rik <rik@octave.org>
parents: 20428
diff changeset
3016 // FIXME: The commandwindowsize property has been deprecated in Matlab
564e59f75ef8 Remove obsolete properties from root figure object.
Rik <rik@octave.org>
parents: 20428
diff changeset
3017 // and is now available through matlab.desktop.comandwindow.size.
564e59f75ef8 Remove obsolete properties from root figure object.
Rik <rik@octave.org>
parents: 20428
diff changeset
3018 // Until Octave has something similar, keep this property in root.
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3019
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3020 // Programming note: Keep property list sorted if new ones are added.
9778
2364eebcd644 new root figure properties
John W. Eaton <jwe@octave.org>
parents: 9777
diff changeset
3021
8247
e41f420875db set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents: 8222
diff changeset
3022 BEGIN_PROPERTIES (root_figure, root)
9778
2364eebcd644 new root figure properties
John W. Eaton <jwe@octave.org>
parents: 9777
diff changeset
3023 handle_property callbackobject Sr , graphics_handle ()
2364eebcd644 new root figure properties
John W. Eaton <jwe@octave.org>
parents: 9777
diff changeset
3024 array_property commandwindowsize r , Matrix (1, 2, 0)
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
3025 handle_property currentfigure S , graphics_handle ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3026 string_property fixedwidthfontname , "Courier"
21952
a5924b0cbf42 Return "Screensize" for root graphics property "MonitorPositions" (partial fix bug #48239).
Rik <rik@octave.org>
parents: 21948
diff changeset
3027 array_property monitorpositions r , default_screensize ()
10949
848f3a13b7cf Backed out changeset 6b50fd2d4ca6
David Bateman <dbateman@free.fr>
parents: 10948
diff changeset
3028 array_property pointerlocation , Matrix (1, 2, 0)
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3029 double_property pointerwindow r , 0.0
8560
5cc594679cdc get display characteristics from system
John W. Eaton <jwe@octave.org>
parents: 8465
diff changeset
3030 double_property screendepth r , default_screendepth ()
9778
2364eebcd644 new root figure properties
John W. Eaton <jwe@octave.org>
parents: 9777
diff changeset
3031 double_property screenpixelsperinch r , default_screenpixelsperinch ()
10949
848f3a13b7cf Backed out changeset 6b50fd2d4ca6
David Bateman <dbateman@free.fr>
parents: 10948
diff changeset
3032 array_property screensize r , default_screensize ()
9778
2364eebcd644 new root figure properties
John W. Eaton <jwe@octave.org>
parents: 9777
diff changeset
3033 bool_property showhiddenhandles , "off"
25903
06c41d1ae5b1 Allow 'characters' as a value for the Units property of root object (bug #54742).
Rik <rik@octave.org>
parents: 25891
diff changeset
3034 radio_property units U , "{pixels}|inches|centimeters|points|normalized|characters"
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
3035 // Hide base properties which don't make sense for root object
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
3036 //radio_property beingdeleted h , "{off}|on"
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3037 END_PROPERTIES
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3038 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3039
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3040 private:
23763
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
3041
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3042 properties m_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3043
23763
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
3044 protected:
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
3045
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3046 root_figure ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3047 : m_properties (0, graphics_handle ()), m_default_properties (),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3048 m_factory_properties (init_factory_properties ())
23763
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
3049 { }
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
3050
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3051 public:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3052
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
3053 OCTAVE_DISABLE_COPY_MOVE (root_figure)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
3054
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3055 ~root_figure () = default;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3056
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3057 void mark_modified () { }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3058
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3059 void override_defaults (base_graphics_object& obj)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3060 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3061 // Now override with our defaults. If the default_properties
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3062 // list includes the properties for all defaults (line,
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3063 // surface, etc.) then we don't have to know the type of OBJ
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3064 // here, we just call its set function and let it decide which
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3065 // properties from the list to use.
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3066 obj.set_from_list (m_default_properties);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3067 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3068
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
3069 void set (const caseless_str& name, const octave_value& value)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3070 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3071 if (name.compare ("default", 7))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3072 // strip "default", pass rest to function that will
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3073 // parse the remainder and add the element to the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3074 // default_properties map.
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3075 m_default_properties.set (name.substr (7), value);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3076 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3077 m_properties.set (name, value);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3078 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3079
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
3080 octave_value get (const caseless_str& name) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3081 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3082 octave_value retval;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3083
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3084 if (name.compare ("default", 7))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3085 return get_default (name.substr (7));
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3086 else if (name.compare ("factory", 7))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3087 return get_factory_default (name.substr (7));
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3088 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3089 retval = m_properties.get (name);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3090
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3091 return retval;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3092 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3093
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
3094 octave_value get_default (const caseless_str& name) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3095 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3096 octave_value retval = m_default_properties.lookup (name);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3097
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3098 if (retval.is_undefined ())
7847
40b16e04172a Make backend switching work.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7846
diff changeset
3099 {
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
3100 // no default property found, use factory default
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3101 retval = m_factory_properties.lookup (name);
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
3102
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
3103 if (retval.is_undefined ())
15468
6437fa7263dd use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
3104 error ("get: invalid default property '%s'", name.c_str ());
7847
40b16e04172a Make backend switching work.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7846
diff changeset
3105 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3106
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3107 return retval;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3108 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3109
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
3110 octave_value get_factory_default (const caseless_str& name) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3111 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3112 octave_value retval = m_factory_properties.lookup (name);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3113
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3114 if (retval.is_undefined ())
15468
6437fa7263dd use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
3115 error ("get: invalid factory default property '%s'", name.c_str ());
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3116
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3117 return retval;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3118 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3119
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3120 octave_value get_defaults () const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3121 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3122 return m_default_properties.as_struct ("default");
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3123 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3124
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3125 property_list get_defaults_list () const
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
3126 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3127 return m_default_properties;
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
3128 }
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
3129
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3130 octave_value get_factory_defaults () const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3131 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3132 return m_factory_properties.as_struct ("factory");
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3133 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3134
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3135 property_list get_factory_defaults_list () const
18963
a30e1d20fd3c Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents: 18961
diff changeset
3136 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3137 return m_factory_properties;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3138 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3139
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3140 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3141
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3142 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3143
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3144 bool valid_object () const { return true; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3145
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3146 OCTINTERP_API void reset_default_properties ();
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
3147
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3148 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3149 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3150 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3151 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3152 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3153 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3154 }
10722
755fcb5baad3 Add the reset built function
David Bateman <dbateman@free.fr>
parents: 10717
diff changeset
3155
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3156 private:
23763
54aa9a3250b4 make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents: 23639
diff changeset
3157
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3158 property_list m_default_properties;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3159
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3160 property_list m_factory_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3161
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3162 static OCTINTERP_API property_list::plist_map_type
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3163 init_factory_properties ();
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3164 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3165
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3166 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3167
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
3168 class OCTINTERP_API figure : public base_graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3169 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3170 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3171
7445
af92b34f3a3a [project @ 2008-02-04 07:53:07 by jwe]
jwe
parents: 7441
diff changeset
3172 class OCTINTERP_API properties : public base_properties
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3173 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3174 public:
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
3175 void init_integerhandle (const octave_value& val)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3176 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3177 m_integerhandle = val;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3178 }
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
3179
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3180 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3181 remove_child (const graphics_handle& h, bool from_root = false);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3182
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3183 OCTINTERP_API void set_visible (const octave_value& val);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3184
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3185 OCTINTERP_API octave::graphics_toolkit get_toolkit () const;
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3186
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3187 OCTINTERP_API void set_toolkit (const octave::graphics_toolkit& b);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3188
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3189 OCTINTERP_API void set___graphics_toolkit__ (const octave_value& val);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3190
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3191 OCTINTERP_API void adopt (const graphics_handle& h);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3192
31020
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3193 // Alias "innerposition" to "position".
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3194 octave_value get_innerposition () const
31020
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3195 {
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3196 return get_position ();
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3197 }
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3198
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3199 void set_innerposition (const octave_value& val)
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3200 {
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3201 set_position (val);
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3202 }
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3203
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3204 OCTINTERP_API void set_position (const octave_value& val,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3205 bool do_notify_toolkit = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3206
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3207 OCTINTERP_API void set_outerposition (const octave_value& val,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3208 bool do_notify_toolkit = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3209
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3210 OCTINTERP_API Matrix bbox2position (const Matrix& bbox) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3211
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3212 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3213 get_boundingbox (bool internal = false,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3214 const Matrix& parent_pix_size = Matrix ()) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3215
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3216 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3217 set_boundingbox (const Matrix& bb, bool internal = false,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3218 bool do_notify_toolkit = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3219
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3220 OCTINTERP_API Matrix map_from_boundingbox (double x, double y) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3221
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3222 OCTINTERP_API Matrix map_to_boundingbox (double x, double y) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3223
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3224 OCTINTERP_API void update_units (const caseless_str& old_units);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3225
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3226 OCTINTERP_API void update_paperunits (const caseless_str& old_paperunits);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3227
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3228 OCTINTERP_API std::string get_title () const;
8059
75c99d3f97d7 Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents: 8058
diff changeset
3229
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3230 // See the genprops.awk script for an explanation of the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3231 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3232 // Programming note: Keep property list sorted if new ones are added.
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3233
8247
e41f420875db set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents: 8222
diff changeset
3234 BEGIN_PROPERTIES (figure)
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3235 array_property alphamap , Matrix (64, 1, 1)
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3236 callback_property buttondownfcn , Matrix ()
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
3237 callback_property closerequestfcn , "closereq"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3238 color_property color , color_property (color_values (1, 1, 1), radio_values ("none"))
20761
47cec845dd5a Set default colormap to viridis
Carlo de Falco <carlo.defalco@polimi.it>
parents: 20756
diff changeset
3239 array_property colormap , viridis_colormap ()
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
3240 handle_property currentaxes S , graphics_handle ()
7405
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3241 string_property currentcharacter r , ""
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3242 handle_property currentobject r , graphics_handle ()
10517
9cdd6c8c05a4 [mq]: fltk_cb
Shai Ayal <shaiay@users.sourceforge.net>
parents: 10505
diff changeset
3243 array_property currentpoint r , Matrix (2, 1, 0)
31020
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3244 bool_property dockcontrols , "on"
11247
29b1f7d68665 make filename property of figure objects writable
John W. Eaton <jwe@octave.org>
parents: 11175
diff changeset
3245 string_property filename , ""
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3246 bool_property graphicssmoothing , "on"
31020
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3247 array_property innerposition sg , default_figure_position ()
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13810
diff changeset
3248 bool_property integerhandle S , "on"
21323
030d4d6c2b58 Implement figure property "InvertHardCopy" for printing (bug #47230).
Rik <rik@octave.org>
parents: 21289
diff changeset
3249 bool_property inverthardcopy , "on"
7405
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3250 callback_property keypressfcn , Matrix ()
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3251 callback_property keyreleasefcn , Matrix ()
21948
241d39c66e8f Update graphics properties for figure object.
Rik <rik@octave.org>
parents: 21905
diff changeset
3252 radio_property menubar , "{figure}|none"
7405
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3253 string_property name , ""
25273
ac6ba9f2fa41 Add new Figure graphic property "Number" (bug #53343).
Rik <rik@octave.org>
parents: 25173
diff changeset
3254 array_property number rG , Matrix ()
21948
241d39c66e8f Update graphics properties for figure object.
Rik <rik@octave.org>
parents: 21905
diff changeset
3255 radio_property nextplot , "{add}|new|replace|replacechildren"
7405
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3256 bool_property numbertitle , "on"
13713
d99aa455296e Add outerposition property to figure objects.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13703
diff changeset
3257 array_property outerposition s , Matrix (1, 4, -1.0)
21948
241d39c66e8f Update graphics properties for figure object.
Rik <rik@octave.org>
parents: 21905
diff changeset
3258 radio_property paperorientation U , "{portrait}|landscape"
18773
70ea5a2856fe Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18766
diff changeset
3259 array_property paperposition m , default_figure_paperposition ()
21948
241d39c66e8f Update graphics properties for figure object.
Rik <rik@octave.org>
parents: 21905
diff changeset
3260 // FIXME: Matlab default is "auto", but this messes up hgsave BIST test.
27432
1e79d913baaa Change default figure property "paperpositionmode" to "auto" (bug #56916).
Rik <rik@octave.org>
parents: 27335
diff changeset
3261 radio_property paperpositionmode au , "{auto}|manual"
10991
9d3a7ad94ee6 Respect the units and paperunits figure properties and the units and fontunits axes properties
David Bateman <dbateman@free.fr>
parents: 10990
diff changeset
3262 array_property papersize U , default_figure_papersize ()
9d3a7ad94ee6 Respect the units and paperunits figure properties and the units and fontunits axes properties
David Bateman <dbateman@free.fr>
parents: 10990
diff changeset
3263 radio_property papertype SU , "{usletter}|uslegal|a0|a1|a2|a3|a4|a5|b0|b1|b2|b3|b4|b5|arch-a|arch-b|arch-c|arch-d|arch-e|a|b|c|d|e|tabloid|<custom>"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3264 radio_property paperunits Su , "{inches}|centimeters|normalized|points"
31020
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3265 radio_property pointer , "{arrow}|crosshair|ibeam|watch|topl|topr|botl|botr|left|top|right|bottom|circle|cross|fleur|custom|hand"
27099
2cd31365c84a Implement "pointer" and related figure properties for Qt toolkit (bug #56347)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26985
diff changeset
3266 array_property pointershapecdata , Matrix (16, 16, 1)
2cd31365c84a Implement "pointer" and related figure properties for Qt toolkit (bug #56347)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26985
diff changeset
3267 array_property pointershapehotspot , Matrix (1, 2, 1)
13713
d99aa455296e Add outerposition property to figure objects.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13703
diff changeset
3268 array_property position s , default_figure_position ()
21367
0035733e4b3a graphics.in.h: Make sure XXXmode properties switch to "manual" if XXX is set.
Rik <rik@octave.org>
parents: 21323
diff changeset
3269 radio_property renderer m , "{opengl}|painters"
7405
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3270 radio_property renderermode , "{auto}|manual"
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3271 bool_property resize , "on"
26129
3c61c8137664 Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents: 26125
diff changeset
3272 // FIXME: "resizefcn" is no longer recommended by Matlab,
3c61c8137664 Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents: 26125
diff changeset
3273 // and has been replaced with "sizechangedfcn"
21948
241d39c66e8f Update graphics properties for figure object.
Rik <rik@octave.org>
parents: 21905
diff changeset
3274 // Eventually this will need to be hidden, and then removed.
7405
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3275 callback_property resizefcn , Matrix ()
21948
241d39c66e8f Update graphics properties for figure object.
Rik <rik@octave.org>
parents: 21905
diff changeset
3276 radio_property selectiontype , "{normal}|extend|alt|open"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3277 callback_property sizechangedfcn , Matrix ()
21948
241d39c66e8f Update graphics properties for figure object.
Rik <rik@octave.org>
parents: 21905
diff changeset
3278 radio_property toolbar , "{auto}|figure|none"
241d39c66e8f Update graphics properties for figure object.
Rik <rik@octave.org>
parents: 21905
diff changeset
3279 radio_property units Su , "{pixels}|normalized|inches|centimeters|points|characters"
7405
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3280 callback_property windowbuttondownfcn , Matrix ()
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3281 callback_property windowbuttonmotionfcn , Matrix ()
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3282 callback_property windowbuttonupfcn , Matrix ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3283 callback_property windowkeypressfcn , Matrix ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3284 callback_property windowkeyreleasefcn , Matrix ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3285 callback_property windowscrollwheelfcn , Matrix ()
31020
cb9451780a15 Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents: 30999
diff changeset
3286 radio_property windowstate , "{normal}|minimized|maximized|fullscreen"
7405
b0734cf13ad4 [project @ 2008-01-19 07:33:00 by jwe]
jwe
parents: 7404
diff changeset
3287 radio_property windowstyle , "{normal}|modal|docked"
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
3288
24687
8b935067a257 Allow printing without updating qt visible or invisible figures (bug #52940).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24637
diff changeset
3289 // Overridden base property
24637
3d78a7eb5aa4 Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents: 24635
diff changeset
3290 // Property is not implemented for figures.
3d78a7eb5aa4 Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents: 24635
diff changeset
3291 // Hide it and set it to a default value that works.
3d78a7eb5aa4 Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents: 24635
diff changeset
3292 radio_property pickableparts h , "{visible}"
3d78a7eb5aa4 Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents: 24635
diff changeset
3293
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3294 // Octave-specific properties
21684
1449e3b98941 store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents: 21659
diff changeset
3295 mutable string_property __gl_extensions__ hr , ""
1449e3b98941 store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents: 21659
diff changeset
3296 mutable string_property __gl_renderer__ hr , ""
1449e3b98941 store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents: 21659
diff changeset
3297 mutable string_property __gl_vendor__ hr , ""
1449e3b98941 store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents: 21659
diff changeset
3298 mutable string_property __gl_version__ hr , ""
24687
8b935067a257 Allow printing without updating qt visible or invisible figures (bug #52940).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24637
diff changeset
3299 bool_property __gl_window__ h , "off"
23774
41795b504a8b don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents: 23763
diff changeset
3300 string_property __graphics_toolkit__ hs , default_graphics_toolkit ()
13699
dd9b32af0a01 Implement guidata/guihandles.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13324
diff changeset
3301 any_property __guidata__ h , Matrix ()
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3302 radio_property __mouse_mode__ hS , "{none}|pan|rotate|select|text|zoom"
24687
8b935067a257 Allow printing without updating qt visible or invisible figures (bug #52940).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24637
diff changeset
3303 bool_property __printing__ h , "off"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3304 any_property __pan_mode__ h , Matrix ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3305 any_property __plot_stream__ h , Matrix ()
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3306 any_property __rotate_mode__ h , Matrix ()
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3307 any_property __zoom_mode__ h , Matrix ()
25884
4e108574385c Improve OpenGL rendering on high resolution screens with Qt 5 (bug #49053)
John Swensen <jpswensen@gmail.com>
parents: 25867
diff changeset
3308 double_property __device_pixel_ratio__ hU , 1.0
21948
241d39c66e8f Update graphics properties for figure object.
Rik <rik@octave.org>
parents: 21905
diff changeset
3309
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3310 END_PROPERTIES
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
3311
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
3312 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3313 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3314 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3315 m_alphamap.add_constraint (dim_vector (-1, 1));
30053
0b67964031be allow figure alphamap property to be a column vector (bug #61085)
John W. Eaton <jwe@octave.org>
parents: 30040
diff changeset
3316 m_alphamap.add_constraint (dim_vector (1, -1));
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3317 m_colormap.add_constraint (dim_vector (-1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3318 m_colormap.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3319 m_outerposition.add_constraint (dim_vector (1, 4));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3320 m_outerposition.add_constraint (FINITE);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3321 m_paperposition.add_constraint (dim_vector (1, 4));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3322 m_paperposition.add_constraint (FINITE);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3323 m_papersize.add_constraint (dim_vector (1, 2));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3324 m_papersize.add_constraint (FINITE);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3325 m_pointershapecdata.add_constraint (dim_vector (16, 16));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3326 m_pointershapecdata.add_constraint (dim_vector (32, 32));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3327 m_pointershapehotspot.add_constraint (dim_vector (1, 2));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3328 m_position.add_constraint (dim_vector (1, 4));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3329 m_position.add_constraint (FINITE);
27709
0a84a7d0998d don't declare figure::properties::toolkit as mutable
John W. Eaton <jwe@octave.org>
parents: 27698
diff changeset
3330
0a84a7d0998d don't declare figure::properties::toolkit as mutable
John W. Eaton <jwe@octave.org>
parents: 27698
diff changeset
3331 init_toolkit ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3332 }
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents: 7406
diff changeset
3333
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
3334 private:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3335 OCTINTERP_API Matrix get_auto_paperposition ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3336
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3337 void update_paperpositionmode ()
18773
70ea5a2856fe Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18766
diff changeset
3338 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3339 if (m_paperpositionmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3340 m_paperposition.set (get_auto_paperposition ());
18773
70ea5a2856fe Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18766
diff changeset
3341 }
70ea5a2856fe Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18766
diff changeset
3342
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3343 OCTINTERP_API void update_handlevisibility ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3344
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3345 OCTINTERP_API void init_toolkit ();
27709
0a84a7d0998d don't declare figure::properties::toolkit as mutable
John W. Eaton <jwe@octave.org>
parents: 27698
diff changeset
3346
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3347 octave::graphics_toolkit m_toolkit;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3348 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3349
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3350 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3351 properties m_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3352
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3353 public:
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
3354
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3355 figure (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3356 : base_graphics_object (), m_properties (mh, p), m_default_properties ()
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
3357 { }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3358
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
3359 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (figure)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
3360
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3361 ~figure () = default;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3362
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3363 void override_defaults (base_graphics_object& obj)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3364 {
26878
3c7c5b7c3044 doc: Refer to "root object" rather than "root figure object".
Rik <rik@octave.org>
parents: 26520
diff changeset
3365 // Allow parent (root object) to override first (properties knows how
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3366 // to find the parent object).
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3367 m_properties.override_defaults (obj);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3368
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3369 // Now override with our defaults. If the default_properties
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3370 // list includes the properties for all defaults (line,
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3371 // surface, etc.) then we don't have to know the type of OBJ
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3372 // here, we just call its set function and let it decide which
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3373 // properties from the list to use.
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3374 obj.set_from_list (m_default_properties);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3375 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3376
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
3377 void set (const caseless_str& name, const octave_value& value)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3378 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3379 if (name.compare ("default", 7))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3380 // strip "default", pass rest to function that will
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3381 // parse the remainder and add the element to the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3382 // default_properties map.
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3383 m_default_properties.set (name.substr (7), value);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3384 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3385 m_properties.set (name, value);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3386 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3387
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
3388 octave_value get (const caseless_str& name) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3389 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3390 octave_value retval;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3391
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3392 if (name.compare ("default", 7))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3393 retval = get_default (name.substr (7));
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3394 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3395 retval = m_properties.get (name);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3396
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3397 return retval;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3398 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3399
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3400 OCTINTERP_API octave_value get_default (const caseless_str& name) const;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3401
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3402 octave_value get_defaults () const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3403 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3404 return m_default_properties.as_struct ("default");
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3405 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3406
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3407 property_list get_defaults_list () const
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
3408 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3409 return m_default_properties;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3410 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3411
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3412 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3413
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3414 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3415
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3416 bool valid_object () const { return true; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3417
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3418 OCTINTERP_API void reset_default_properties ();
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
3419
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3420 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3421 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3422 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3423 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3424 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3425 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
3426 }
10722
755fcb5baad3 Add the reset built function
David Bateman <dbateman@free.fr>
parents: 10717
diff changeset
3427
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3428 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3429 property_list m_default_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3430 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3431
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3432 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3433
7435
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3434 class OCTINTERP_API graphics_xform
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3435 {
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3436 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3437
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3438 graphics_xform ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3439 : m_xform (xform_eye ()), m_xform_inv (xform_eye ()),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3440 m_sx ("linear"), m_sy ("linear"), m_sz ("linear"), m_zlim (1, 2, 0.0)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3441 {
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3442 m_zlim(1) = 1.0;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3443 }
7435
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3444
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3445 graphics_xform (const Matrix& xm, const Matrix& xim,
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10317
diff changeset
3446 const scaler& x, const scaler& y, const scaler& z,
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10317
diff changeset
3447 const Matrix& zl)
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3448 : m_xform (xm), m_xform_inv (xim), m_sx (x), m_sy (y),
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3449 m_sz (z), m_zlim (zl)
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3450 { }
7435
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3451
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3452 graphics_xform (const graphics_xform& g)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3453 : m_xform (g.m_xform), m_xform_inv (g.m_xform_inv), m_sx (g.m_sx),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3454 m_sy (g.m_sy), m_sz (g.m_sz), m_zlim (g.m_zlim) { }
7435
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3455
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3456 ~graphics_xform () = default;
7435
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3457
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3458 graphics_xform& operator = (const graphics_xform& g)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3459 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3460 m_xform = g.m_xform;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3461 m_xform_inv = g.m_xform_inv;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3462 m_sx = g.m_sx;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3463 m_sy = g.m_sy;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3464 m_sz = g.m_sz;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3465 m_zlim = g.m_zlim;
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3466
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3467 return *this;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3468 }
7435
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3469
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3470 static OCTINTERP_API ColumnVector xform_vector (double x, double y, double z);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3471
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3472 static OCTINTERP_API Matrix xform_eye ();
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3473
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3474 OCTINTERP_API ColumnVector
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3475 transform (double x, double y, double z, bool use_scale = true) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3476
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3477 OCTINTERP_API ColumnVector
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3478 untransform (double x, double y, double z, bool use_scale = true) const;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
3479
10553
f88e3d5d88e2 avoid GCC warnings
John W. Eaton <jwe@octave.org>
parents: 10517
diff changeset
3480 ColumnVector untransform (double x, double y, bool use_scale = true) const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3481 { return untransform (x, y, (m_zlim(0)+m_zlim(1))/2, use_scale); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3482
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3483 Matrix xscale (const Matrix& m) const { return m_sx.scale (m); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3484 Matrix yscale (const Matrix& m) const { return m_sy.scale (m); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3485 Matrix zscale (const Matrix& m) const { return m_sz.scale (m); }
7435
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3486
7832
e06fdf7ea647 Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7830
diff changeset
3487 Matrix scale (const Matrix& m) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3488 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3489 bool has_z = (m.columns () > 2);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3490
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3491 if (m_sx.is_linear () && m_sy.is_linear ()
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3492 && (! has_z || m_sz.is_linear ()))
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3493 return m;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3494
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3495 Matrix retval (m.dims ());
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3496
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3497 int r = m.rows ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3498
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3499 for (int i = 0; i < r; i++)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3500 {
32589
05b4479c29d8 maint: C++ style check for libinterp/ before 9.1 release.
Rik <rik@octave.org>
parents: 32116
diff changeset
3501 retval(i, 0) = m_sx.scale (m(i, 0));
05b4479c29d8 maint: C++ style check for libinterp/ before 9.1 release.
Rik <rik@octave.org>
parents: 32116
diff changeset
3502 retval(i, 1) = m_sy.scale (m(i, 1));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3503 if (has_z)
32589
05b4479c29d8 maint: C++ style check for libinterp/ before 9.1 release.
Rik <rik@octave.org>
parents: 32116
diff changeset
3504 retval(i, 2) = m_sz.scale (m(i, 2));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3505 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3506
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3507 return retval;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3508 }
7832
e06fdf7ea647 Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7830
diff changeset
3509
7435
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3510 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3511 Matrix m_xform;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3512 Matrix m_xform_inv;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3513 scaler m_sx, m_sy, m_sz;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3514 Matrix m_zlim;
7435
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3515 };
464a55f1a5c2 [project @ 2008-02-01 06:47:48 by jwe]
jwe
parents: 7427
diff changeset
3516
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3517 enum
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3518 {
12327
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
3519 AXE_ANY_DIR = 0,
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
3520 AXE_DEPTH_DIR = 1,
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
3521 AXE_HORZ_DIR = 2,
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
3522 AXE_VERT_DIR = 3
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
3523 };
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
3524
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
3525 class OCTINTERP_API axes : public base_graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3526 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3527 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3528
7445
af92b34f3a3a [project @ 2008-02-04 07:53:07 by jwe]
jwe
parents: 7441
diff changeset
3529 class OCTINTERP_API properties : public base_properties
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3530 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3531 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3532
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3533 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3534 set_defaults (base_graphics_object& obj, const std::string& mode);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3535
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3536 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3537 remove_child (const graphics_handle& h, bool from_root = false);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3538
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3539 OCTINTERP_API void adopt (const graphics_handle& h);
25423
13b1b9a0d9c5 Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents: 25418
diff changeset
3540
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3541 const scaler& get_x_scaler () const { return m_sx; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3542 const scaler& get_y_scaler () const { return m_sy; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3543 const scaler& get_z_scaler () const { return m_sz; }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
3544
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3545 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3546 get_boundingbox (bool internal = false,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3547 const Matrix& parent_pix_size = Matrix ()) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3548 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3549 get_extent (bool with_text = false,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3550 bool only_text_height=false) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3551
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3552 OCTINTERP_API double
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3553 get___fontsize_points__ (double box_pix_height = 0) const;
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
3554
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3555 void update_boundingbox ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3556 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3557 if (units_is ("normalized"))
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3558 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3559 sync_positions ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3560 base_properties::update_boundingbox ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3561 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3562 }
7828
4739b6a1925c Implement resize handler mechanism (call resizefcn on figure resize and notify children).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7827
diff changeset
3563
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3564 OCTINTERP_API void update_camera ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3565 OCTINTERP_API void update_axes_layout ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3566 OCTINTERP_API void update_aspectratios ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3567 void update_transform ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3568 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3569 update_aspectratios ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3570 update_camera ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3571 update_axes_layout ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
3572 }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
3573
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3574 OCTINTERP_API void sync_positions ();
17098
786bcce466e9 Initialize the tightinset during initialization of axes.
Ben Abbott <bpabbott@mac.com>
parents: 17011
diff changeset
3575
28303
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3576 // Redirect calls to "activepositionproperty" to "positionconstraint".
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3577
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3578 std::string get_activepositionproperty () const
28303
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3579 {
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3580 std::string cur_val;
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3581
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3582 if (m_positionconstraint.is ("innerposition"))
28303
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3583 cur_val = "position";
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3584 else
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3585 cur_val = "outerposition";
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3586
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3587 return cur_val;
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3588 }
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3589
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3590 void set_activepositionproperty (const octave_value& val)
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3591 {
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3592 // call set method to validate the input
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3593 m_activepositionproperty.set (val);
28303
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3594
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3595 if (val.char_matrix_value ().row_as_string (0) == "position")
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3596 set_positionconstraint ("innerposition");
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3597 else
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3598 set_positionconstraint (val);
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3599 }
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3600
28302
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3601 // Redirect calls to "innerposition" to "position".
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3602
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3603 octave_value get_innerposition () const
28302
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3604 {
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3605 return get_position ();
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3606 }
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3607
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3608 void set_innerposition (const octave_value& val)
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3609 {
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3610 set_position (val);
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3611 }
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3612
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3613 OCTINTERP_API void update_autopos (const std::string& elem_type);
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3614 OCTINTERP_API void update_xlabel_position ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3615 OCTINTERP_API void update_ylabel_position ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3616 OCTINTERP_API void update_zlabel_position ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3617 OCTINTERP_API void update_title_position ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3618
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3619 graphics_xform get_transform () const
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3620 {
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3621 return graphics_xform (m_x_render, m_x_render_inv,
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3622 m_sx, m_sy, m_sz, m_x_zlim);
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3623 }
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3624
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3625 Matrix get_transform_matrix () const { return m_x_render; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3626 Matrix get_inverse_transform_matrix () const { return m_x_render_inv; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3627 Matrix get_opengl_matrix_1 () const { return m_x_gl_mat1; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3628 Matrix get_opengl_matrix_2 () const { return m_x_gl_mat2; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3629 Matrix get_transform_zlim () const { return m_x_zlim; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3630
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3631 int get_xstate () const { return m_xstate; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3632 int get_ystate () const { return m_ystate; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3633 int get_zstate () const { return m_zstate; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3634 double get_xPlane () const { return m_xPlane; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3635 double get_xPlaneN () const { return m_xPlaneN; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3636 double get_yPlane () const { return m_yPlane; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3637 double get_yPlaneN () const { return m_yPlaneN; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3638 double get_zPlane () const { return m_zPlane; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3639 double get_zPlaneN () const { return m_zPlaneN; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3640 double get_xpTick () const { return m_xpTick; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3641 double get_xpTickN () const { return m_xpTickN; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3642 double get_ypTick () const { return m_ypTick; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3643 double get_ypTickN () const { return m_ypTickN; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3644 double get_zpTick () const { return m_zpTick; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3645 double get_zpTickN () const { return m_zpTickN; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3646 double get_x_min () const { return std::min (m_xPlane, m_xPlaneN); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3647 double get_x_max () const { return std::max (m_xPlane, m_xPlaneN); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3648 double get_y_min () const { return std::min (m_yPlane, m_yPlaneN); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3649 double get_y_max () const { return std::max (m_yPlane, m_yPlaneN); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3650 double get_z_min () const { return std::min (m_zPlane, m_zPlaneN); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3651 double get_z_max () const { return std::max (m_zPlane, m_zPlaneN); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3652 double get_fx () const { return m_fx; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3653 double get_fy () const { return m_fy; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3654 double get_fz () const { return m_fz; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3655 double get_xticklen () const { return m_xticklen; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3656 double get_yticklen () const { return m_yticklen; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3657 double get_zticklen () const { return m_zticklen; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3658 double get_xtickoffset () const { return m_xtickoffset; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3659 double get_ytickoffset () const { return m_ytickoffset; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3660 double get_ztickoffset () const { return m_ztickoffset; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3661 bool get_x2Dtop () const { return m_x2Dtop; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3662 bool get_y2Dright () const { return m_y2Dright; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3663 bool get_layer2Dtop () const { return m_layer2Dtop; }
23859
7148b237f94f Fix regression introduced by cset 06805aabbdd1 (bug #50750).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23803
diff changeset
3664 bool get_is2D (bool include_kids = false) const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3665 { return (include_kids ? (m_is2D && ! m_has3Dkids) : m_is2D); }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3666 void set_has3Dkids (bool val) { m_has3Dkids = val; }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3667 bool get_xySym () const { return m_xySym; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3668 bool get_xyzSym () const { return m_xyzSym; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3669 bool get_zSign () const { return m_zSign; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3670 bool get_nearhoriz () const { return m_nearhoriz; }
12327
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
3671
7842
1357bcae6e29 added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7836
diff changeset
3672 ColumnVector pixel2coord (double px, double py) const
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3673 {
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3674 return get_transform ().untransform (px, py,
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3675 (m_x_zlim(0)+m_x_zlim(1))/2);
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3676 }
7842
1357bcae6e29 added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7836
diff changeset
3677
1357bcae6e29 added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7836
diff changeset
3678 ColumnVector coord2pixel (double x, double y, double z) const
1357bcae6e29 added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7836
diff changeset
3679 { return get_transform ().transform (x, y, z); }
1357bcae6e29 added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7836
diff changeset
3680
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3681 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3682 zoom_about_point (const std::string& mode, double x, double y,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3683 double factor, bool push_to_zoom_stack = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3684 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3685 zoom (const std::string& mode, double factor,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3686 bool push_to_zoom_stack = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3687 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3688 zoom (const std::string& mode, const Matrix& xl, const Matrix& yl,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3689 bool push_to_zoom_stack = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3690
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3691 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3692 translate_view (const std::string& mode,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3693 double x0, double x1, double y0, double y1,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3694 bool push_to_zoom_stack = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3695
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3696 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3697 pan (const std::string& mode, double factor,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3698 bool push_to_zoom_stack = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3699
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3700 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3701 rotate3d (double x0, double x1, double y0, double y1,
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 19659
diff changeset
3702 bool push_to_zoom_stack = true);
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 19659
diff changeset
3703
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3704 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3705 rotate_view (double delta_az, double delta_el,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3706 bool push_to_zoom_stack = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3707
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3708 OCTINTERP_API void unzoom ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3709 OCTINTERP_API void update_handlevisibility ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3710 OCTINTERP_API void push_zoom_stack ();
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3711 OCTINTERP_API void clear_zoom_stack (bool do_unzoom = true);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3712
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3713 OCTINTERP_API void update_units (const caseless_str& old_units);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3714
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3715 OCTINTERP_API void update_font (std::string prop = "");
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3716
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3717 OCTINTERP_API void update_fontunits (const caseless_str& old_fontunits);
10991
9d3a7ad94ee6 Respect the units and paperunits figure properties and the units and fontunits axes properties
David Bateman <dbateman@free.fr>
parents: 10990
diff changeset
3718
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3719 void increase_num_lights () { m_num_lights++; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3720 void decrease_num_lights () { m_num_lights--; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3721 unsigned int get_num_lights () const { return m_num_lights; }
25423
13b1b9a0d9c5 Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents: 25418
diff changeset
3722
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
3723 private:
23401
e0c20a22da7e eliminate some errors exposed by -fsanitize=undefined
John W. Eaton <jwe@octave.org>
parents: 23396
diff changeset
3724
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3725 scaler m_sx = scaler ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3726 scaler m_sy = scaler ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3727 scaler m_sz = scaler ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3728
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3729 Matrix m_x_render = Matrix ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3730 Matrix m_x_render_inv = Matrix ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3731 Matrix m_x_gl_mat1 = Matrix ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3732 Matrix m_x_gl_mat2 = Matrix ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3733 Matrix m_x_zlim = Matrix ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3734
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3735 std::list<octave_value> m_zoom_stack = std::list<octave_value> ();
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
3736
12327
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
3737 // Axes layout data
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3738 int m_xstate = 0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3739 int m_ystate = 0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3740 int m_zstate = 0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3741
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3742 double m_xPlane = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3743 double m_yPlane = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3744 double m_zPlane = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3745
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3746 double m_xPlaneN = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3747 double m_yPlaneN = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3748 double m_zPlaneN = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3749
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3750 double m_xpTick = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3751 double m_ypTick = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3752 double m_zpTick = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3753
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3754 double m_xpTickN = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3755 double m_ypTickN = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3756 double m_zpTickN = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3757
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3758 double m_fx = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3759 double m_fy = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3760 double m_fz = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3761
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3762 double m_xticklen = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3763 double m_yticklen = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3764 double m_zticklen = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3765
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3766 double m_xtickoffset = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3767 double m_ytickoffset = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3768 double m_ztickoffset = 0.0;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3769
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3770 bool m_x2Dtop = false;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3771 bool m_y2Dright = false;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3772 bool m_layer2Dtop = false;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3773 bool m_is2D = false;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3774 bool m_has3Dkids = false;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3775 bool m_xySym = false;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3776 bool m_xyzSym = false;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3777 bool m_zSign = false;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3778 bool m_nearhoriz = false;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3779
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3780 unsigned int m_num_lights = 0;
25423
13b1b9a0d9c5 Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents: 25418
diff changeset
3781
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents: 21200
diff changeset
3782 // Text renderer, used for calculation of text (tick labels) size
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3783 octave::text_renderer m_txt_renderer;
12777
6c1d0f03c331 Avoid redundant calls to set_font of text renderers (Bug #31305)
Konstantinos Poulios <logari81@gmail.com>
parents: 12685
diff changeset
3784
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3785 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3786 set_text_child (handle_property& h, const std::string& who,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3787 const octave_value& v);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3788
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3789 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3790 delete_text_child (handle_property& h, bool from_root = false);
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
3791
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3792 // See the genprops.awk script for an explanation of the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3793 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3794 // Programming note: Keep property list sorted if new ones are added.
8222
11badf6c9e9f __go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents: 8210
diff changeset
3795
8247
e41f420875db set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents: 8222
diff changeset
3796 BEGIN_PROPERTIES (axes)
28303
af912e78ce43 Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28302
diff changeset
3797 radio_property activepositionproperty gsh , "{outerposition}|position"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3798 row_vector_property alim m , default_lim ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3799 radio_property alimmode , "{auto}|manual"
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3800 // FIXME: not yet implemented
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3801 array_property alphamap , Matrix ()
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3802 radio_property alphascale , "{linear}|log"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3803 color_property ambientlightcolor , color_values (1, 1, 1)
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
3804 bool_property box u , "off"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3805 radio_property boxstyle , "{back}|full"
24127
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
3806 row_vector_property cameraposition mu , Matrix (1, 3, 0.0)
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
3807 radio_property camerapositionmode u , "{auto}|manual"
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
3808 row_vector_property cameratarget mu , Matrix (1, 3, 0.0)
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
3809 radio_property cameratargetmode u , "{auto}|manual"
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
3810 row_vector_property cameraupvector mu , Matrix (1, 3, 0.0)
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
3811 radio_property cameraupvectormode u , "{auto}|manual"
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
3812 double_property cameraviewangle mu , 6.6086
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
3813 radio_property cameraviewanglemode u , "{auto}|manual"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3814 row_vector_property clim m , default_lim ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3815 radio_property climmode al , "{auto}|manual"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3816 radio_property clippingstyle , "{3dbox}|rectangle"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3817 color_property color , color_property (color_values (1, 1, 1), radio_values ("none"))
23524
7c278572db66 Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents: 23457
diff changeset
3818 array_property colormap sg , Matrix ()
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
3819 array_property colororder , default_colororder ()
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3820 double_property colororderindex , 1.0
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3821 radio_property colorscale , "{linear}|log"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3822 array_property currentpoint , Matrix (2, 3, 0.0)
23067
6825dd6bbe39 Change some axes properties to row_vector_property (bug #50048).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23057
diff changeset
3823 row_vector_property dataaspectratio mu , Matrix (1, 3, 1.0)
11167
51ac3a08e53c Fix {d,pb}aspectratios for OpenGL backends.
Konstantinos Poulios <logari81@googlemail.com>
parents: 11163
diff changeset
3824 radio_property dataaspectratiomode u , "{auto}|manual"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3825 radio_property fontangle u , "{normal}|italic"
12777
6c1d0f03c331 Avoid redundant calls to set_font of text renderers (Bug #31305)
Konstantinos Poulios <logari81@gmail.com>
parents: 12685
diff changeset
3826 string_property fontname u , OCTAVE_DEFAULT_FONTNAME
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3827 double_property fontsize mu , 10
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3828 // FIXME: not yet implemented
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3829 radio_property fontsizemode , "{auto}|manual"
26858
0adb232f93b9 Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26715
diff changeset
3830 bool_property fontsmoothing u , "on"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3831 radio_property fontunits SU , "{points}|inches|centimeters|normalized|pixels"
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3832 radio_property fontweight u , "{normal}|bold"
21367
0035733e4b3a graphics.in.h: Make sure XXXmode properties switch to "manual" if XXX is set.
Rik <rik@octave.org>
parents: 21323
diff changeset
3833 double_property gridalpha m , 0.15
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3834 radio_property gridalphamode , "{auto}|manual"
26682
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
3835 color_property gridcolor m , color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"))
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3836 radio_property gridcolormode , "{auto}|manual"
22056
05ad23810150 Use default gridlinestyle of '-' for Matlab compatibility.
Rik <rik@octave.org>
parents: 22022
diff changeset
3837 radio_property gridlinestyle , "{-}|--|:|-.|none"
28302
1f5ec8c025bc Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28298
diff changeset
3838 array_property innerposition sg , default_axes_position ()
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3839 // FIXME: Should be an array of "interaction objects".
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
3840 // Make it read-only for now.
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3841 any_property interactions r , Matrix ()
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
3842 double_property labelfontsizemultiplier u , 1.1
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3843 radio_property layer u , "{bottom}|top"
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3844 // FIXME: Should be a "layoutoptions" object. Make it read-only for now.
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3845 handle_property layout r , graphics_handle ()
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3846 // FIXME: Should be a "legend" object. Make it read-only for now.
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3847 handle_property legend r , graphics_handle ()
17382
50b2863d10a6 Create Matlab compatible linestyleorder char matrices (bug #34906)
Rik <rik@octave.org>
parents: 17104
diff changeset
3848 // FIXME: should be kind of string array.
50b2863d10a6 Create Matlab compatible linestyleorder char matrices (bug #34906)
Rik <rik@octave.org>
parents: 17104
diff changeset
3849 any_property linestyleorder S , "-"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3850 double_property linestyleorderindex , 1.0
7403
135c13496faf [project @ 2008-01-19 06:06:46 by jwe]
jwe
parents: 7395
diff changeset
3851 double_property linewidth , 0.5
21367
0035733e4b3a graphics.in.h: Make sure XXXmode properties switch to "manual" if XXX is set.
Rik <rik@octave.org>
parents: 21323
diff changeset
3852 double_property minorgridalpha m , 0.25
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3853 radio_property minorgridalphamode , "{auto}|manual"
21367
0035733e4b3a graphics.in.h: Make sure XXXmode properties switch to "manual" if XXX is set.
Rik <rik@octave.org>
parents: 21323
diff changeset
3854 color_property minorgridcolor m , color_property (color_values (0.1, 0.1, 0.1), radio_values ("none"))
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3855 radio_property minorgridcolormode , "{auto}|manual"
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3856 radio_property minorgridlinestyle , "{:}|-|--|-.|none"
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3857 radio_property nextplot , "{replace}|add|replacechildren"
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3858 double_property nextseriesindex r , 1.0
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3859 array_property outerposition u , default_axes_outerposition ()
23067
6825dd6bbe39 Change some axes properties to row_vector_property (bug #50048).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23057
diff changeset
3860 row_vector_property plotboxaspectratio mu , Matrix (1, 3, 1.0)
11167
51ac3a08e53c Fix {d,pb}aspectratios for OpenGL backends.
Konstantinos Poulios <logari81@googlemail.com>
parents: 11163
diff changeset
3861 radio_property plotboxaspectratiomode u , "{auto}|manual"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3862 array_property position u , default_axes_position ()
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3863 radio_property positionconstraint , "{outerposition}|innerposition"
18819
92e9d4710f78 Fix typo in graphics.in.h (bug #42535).
Michael Godfrey <michaeldgodfrey@gmail.com>
parents: 17822
diff changeset
3864 radio_property projection , "{orthographic}|perspective"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3865 radio_property sortmethod , "{depth}|childorder"
32116
7e774d71c491 Add support for "none" option to axes graphic property "TickDir".
Rik <rik@octave.org>
parents: 31883
diff changeset
3866 radio_property tickdir mu , "{in}|out|both|none"
12327
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
3867 radio_property tickdirmode u , "{auto}|manual"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3868 // FIXME: Added recently to Matlab, should replace interpreter property.
26055
8b9e6a39e0a2 Allow log axes to be exported correctly in tex formats (bug #50130).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26045
diff changeset
3869 radio_property ticklabelinterpreter u , "{tex}|latex|none"
14391
c9ec21bef97a Fix ticklength updating (bug # 35438).
Ben Abbott <bpabbott@mac.com>
parents: 14357
diff changeset
3870 array_property ticklength u , default_axes_ticklength ()
7403
135c13496faf [project @ 2008-01-19 06:06:46 by jwe]
jwe
parents: 7395
diff changeset
3871 array_property tightinset r , Matrix (1, 4, 0.0)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3872 handle_property title SOf , make_graphics_handle ("text", m___myhandle__, false, false, false)
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
3873 double_property titlefontsizemultiplier u , 1.1
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
3874 radio_property titlefontweight u , "{bold}|normal"
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3875 // FIXME: Should be a "axestoolbar" object. Make it read-only for now.
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3876 handle_property toolbar r , graphics_handle ()
10991
9d3a7ad94ee6 Respect the units and paperunits figure properties and the units and fontunits axes properties
David Bateman <dbateman@free.fr>
parents: 10990
diff changeset
3877 radio_property units SU , "{normalized}|inches|centimeters|points|pixels|characters"
18646
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
3878 array_property view u , default_axes_view ()
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3879 // FIXME: Should be a "ruler" object. Make it read-only for now.
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3880 handle_property xaxis r , graphics_handle ()
24976
47f25e164ab1 Delete graphics properties or allowed values scheduled for deprecation in 4.6
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24795
diff changeset
3881 radio_property xaxislocation u , "{bottom}|top|origin"
26682
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
3882 color_property xcolor mu , color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"))
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3883 radio_property xcolormode , "{auto}|manual"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3884 radio_property xdir u , "{normal}|reverse"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3885 bool_property xgrid , "off"
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3886 handle_property xlabel SOf , make_graphics_handle ("text", m___myhandle__, false, false, false)
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3887 row_vector_property xlim mu , default_lim ()
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
3888 radio_property xlimitmethod u , "{tickaligned}|tight|padded"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3889 radio_property xlimmode al , "{auto}|manual"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3890 bool_property xminorgrid , "off"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3891 bool_property xminortick , "off"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3892 radio_property xscale alu , "{linear}|log"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3893 row_vector_property xtick mu , default_axes_tick ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3894 // FIXME: should be kind of string array.
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3895 any_property xticklabel S , ""
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3896 radio_property xticklabelmode u , "{auto}|manual"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3897 double_property xticklabelrotation , 0.0
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3898 radio_property xtickmode u , "{auto}|manual"
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3899 // FIXME: Should be a "ruler" object. Make it read-only for now.
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3900 handle_property yaxis r , graphics_handle ()
24976
47f25e164ab1 Delete graphics properties or allowed values scheduled for deprecation in 4.6
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24795
diff changeset
3901 radio_property yaxislocation u , "{left}|right|origin"
26682
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
3902 color_property ycolor mu , color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"))
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3903 radio_property ycolormode , "{auto}|manual"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3904 radio_property ydir u , "{normal}|reverse"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3905 bool_property ygrid , "off"
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3906 handle_property ylabel SOf , make_graphics_handle ("text", m___myhandle__, false, false, false)
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3907 row_vector_property ylim mu , default_lim ()
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
3908 radio_property ylimitmethod u , "{tickaligned}|tight|padded"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3909 radio_property ylimmode al , "{auto}|manual"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3910 bool_property yminorgrid , "off"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3911 bool_property yminortick , "off"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3912 radio_property yscale alu , "{linear}|log"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3913 row_vector_property ytick mu , default_axes_tick ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3914 any_property yticklabel S , ""
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3915 radio_property yticklabelmode u , "{auto}|manual"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3916 double_property yticklabelrotation , 0.0
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3917 radio_property ytickmode u , "{auto}|manual"
28282
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3918 // FIXME: Should be a "ruler" object. Make it read-only for now.
044cea7947db Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28079
diff changeset
3919 handle_property zaxis r , graphics_handle ()
26682
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
3920 color_property zcolor mu , color_property (color_values (0.15, 0.15, 0.15), radio_values ("none"))
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3921 radio_property zcolormode , "{auto}|manual"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3922 radio_property zdir u , "{normal}|reverse"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3923 bool_property zgrid , "off"
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3924 handle_property zlabel SOf , make_graphics_handle ("text", m___myhandle__, false, false, false)
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3925 row_vector_property zlim mu , default_lim ()
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
3926 radio_property zlimitmethod u , "{tickaligned}|tight|padded"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3927 radio_property zlimmode al , "{auto}|manual"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3928 bool_property zminorgrid , "off"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3929 bool_property zminortick , "off"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3930 radio_property zscale alu , "{linear}|log"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3931 row_vector_property ztick mu , default_axes_tick ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3932 any_property zticklabel S , ""
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3933 radio_property zticklabelmode u , "{auto}|manual"
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3934 double_property zticklabelrotation , 0.0
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3935 radio_property ztickmode u , "{auto}|manual"
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
3936
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3937 // Octave-specific properties
24501
2f10c3265607 Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24452
diff changeset
3938 array_property __colormap__ hu , Matrix ()
20258
530803d4f65f Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents: 20232
diff changeset
3939 double_property mousewheelzoom , 0.5
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
3940
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3941 // hidden properties for alignment of subplots
22622
4191f8b5070c Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents: 22407
diff changeset
3942 radio_property __autopos_tag__ h , "{none}|subplot"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3943 // hidden properties for inset
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
3944 array_property looseinset hu , Matrix (1, 4, 0.0)
12126
85f9a5b211fd restructuring draw_axes, enabling minor ticks/grid in fltk, closing bug 31800
Konstantinos Poulios <logari81@googlemail.com>
parents: 11586
diff changeset
3945 // hidden properties for minor ticks
22623
76f1164d2135 Rename [xyz]mtick properties to [xyz]minortickvalues (bug #49205).
Rik <rik@octave.org>
parents: 22622
diff changeset
3946 row_vector_property xminortickvalues h , Matrix ()
76f1164d2135 Rename [xyz]mtick properties to [xyz]minortickvalues (bug #49205).
Rik <rik@octave.org>
parents: 22622
diff changeset
3947 row_vector_property yminortickvalues h , Matrix ()
76f1164d2135 Rename [xyz]mtick properties to [xyz]minortickvalues (bug #49205).
Rik <rik@octave.org>
parents: 22622
diff changeset
3948 row_vector_property zminortickvalues h , Matrix ()
19047
1288a2f27769 Handle non "points" fontunits properties (bug # 40158)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19044
diff changeset
3949 // hidden property for text rendering
22622
4191f8b5070c Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents: 22407
diff changeset
3950 double_property __fontsize_points__ hgr , 0
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
3951 END_PROPERTIES
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
3952
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
3953 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3954 OCTINTERP_API void init ();
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
3955
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
3956 private:
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3957
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3958 std::string
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3959 get_scale (const std::string& scale, const Matrix& lims)
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3960 {
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3961 std::string retval = scale;
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3962
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3963 if (scale == "log" && lims.numel () > 1 && lims(0) < 0 && lims(1) < 0)
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3964 retval = "neglog";
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3965
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3966 return retval;
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3967 }
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3968
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3969 void update_xscale ()
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3970 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3971 m_sx = get_scale (get_xscale (), m_xlim.get ().matrix_value ());
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3972 }
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3973
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3974 void update_yscale ()
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3975 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3976 m_sy = get_scale (get_yscale (), m_ylim.get ().matrix_value ());
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3977 }
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3978
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3979 void update_zscale ()
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3980 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3981 m_sz = get_scale (get_zscale (), m_zlim.get ().matrix_value ());
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
3982 }
7427
65f0a8ced9d2 [project @ 2008-01-28 22:42:18 by jwe]
jwe
parents: 7419
diff changeset
3983
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3984 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
3985 update_label_color (handle_property label, color_property col);
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3986 void update_xcolor ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3987 { update_label_color (m_xlabel, m_xcolor); }
23001
14f1738a56ae Use C++ updaters for labels color (bug #49980).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22619
diff changeset
3988
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3989 void update_ycolor ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3990 { update_label_color (m_ylabel, m_ycolor); }
23001
14f1738a56ae Use C++ updaters for labels color (bug #49980).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22619
diff changeset
3991
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3992 void update_zcolor ()
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
3993 { update_label_color (m_zlabel, m_zcolor); }
23001
14f1738a56ae Use C++ updaters for labels color (bug #49980).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22619
diff changeset
3994
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3995 void update_view () { sync_positions (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3996
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3997 void update_cameraposition () { update_transform (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3998 void update_cameratarget () { update_transform (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
3999 void update_cameraupvector () { update_transform (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4000 void update_cameraviewangle () { update_transform (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4001
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4002 void update_camerapositionmode ()
24127
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4003 {
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4004 if (camerapositionmode_is ("auto"))
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4005 update_cameraposition ();
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4006 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4007 void update_cameratargetmode ()
24127
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4008 {
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4009 if (cameratargetmode_is ("auto"))
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4010 update_cameratarget ();
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4011 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4012 void update_cameraupvectormode ()
24127
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4013 {
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4014 if (cameraupvectormode_is ("auto"))
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4015 update_cameraupvector ();
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4016 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4017 void update_cameraviewanglemode ()
24127
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4018 {
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4019 if (cameraviewanglemode_is ("auto"))
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4020 update_cameraviewangle ();
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4021 }
b188be2b962b Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents: 24120
diff changeset
4022
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4023 void update_dataaspectratio () { sync_positions (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4024 void update_dataaspectratiomode () { sync_positions (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4025 void update_plotboxaspectratio () { sync_positions (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4026 void update_plotboxaspectratiomode () { sync_positions (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4027
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4028 void update_layer () { update_axes_layout (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4029 void update_box ()
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4030 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4031 if (m_xticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4032 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"),
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4033 xaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4034 m_yscale.is ("log") ? 2 :
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4035 (yaxislocation_is ("origin") ? 0 :
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4036 (yaxislocation_is ("left") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4037 m_xlim);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4038 if (m_yticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4039 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"),
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4040 yaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4041 m_xscale.is ("log") ? 2 :
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4042 (xaxislocation_is ("origin") ? 0 :
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4043 (xaxislocation_is ("bottom") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4044 m_ylim);
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4045 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4046 void update_yaxislocation ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4047 {
19652
5b4fd7ebcfc6 Update "tightinset" when "x/yaxislocation" is changed
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19597
diff changeset
4048 sync_positions ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4049 update_axes_layout ();
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4050 if (m_xticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4051 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"),
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4052 xaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4053 m_yscale.is ("log") ? 2 :
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4054 (yaxislocation_is ("origin") ? 0 :
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4055 (yaxislocation_is ("left") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4056 m_xlim);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4057 if (m_yticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4058 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"),
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4059 yaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4060 m_xscale.is ("log") ? 2 :
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4061 (xaxislocation_is ("origin") ? 0 :
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4062 (xaxislocation_is ("bottom") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4063 m_ylim);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4064 update_ylabel_position ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4065 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4066 void update_xaxislocation ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4067 {
19652
5b4fd7ebcfc6 Update "tightinset" when "x/yaxislocation" is changed
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19597
diff changeset
4068 sync_positions ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4069 update_axes_layout ();
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4070 if (m_xticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4071 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"),
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4072 xaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4073 m_yscale.is ("log") ? 2 :
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4074 (yaxislocation_is ("origin") ? 0 :
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4075 (yaxislocation_is ("left") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4076 m_xlim);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4077 if (m_yticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4078 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"),
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4079 yaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4080 m_xscale.is ("log") ? 2 :
24191
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4081 (xaxislocation_is ("origin") ? 0 :
fdd67d871a72 Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents: 24127
diff changeset
4082 (xaxislocation_is ("bottom") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4083 m_ylim);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4084 update_xlabel_position ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4085 }
12327
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
4086
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4087 void update_xdir () { update_camera (); update_axes_layout (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4088 void update_ydir () { update_camera (); update_axes_layout (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4089 void update_zdir () { update_camera (); update_axes_layout (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4090
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4091 void update_ticklength ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4092 void update_tickdir () { update_ticklength (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4093 void update_tickdirmode () { update_ticklength (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4094
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4095 void update_ticklabelinterpreter ()
26055
8b9e6a39e0a2 Allow log axes to be exported correctly in tex formats (bug #50130).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26045
diff changeset
4096 {
29650
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4097 update_xtick (false);
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4098 update_ytick (false);
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4099 update_ztick (true);
26055
8b9e6a39e0a2 Allow log axes to be exported correctly in tex formats (bug #50130).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26045
diff changeset
4100 }
26469
bf835b1d04b1 Don't use C++ callbacks to notify position changes from Qt figures (bug #48519)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26383
diff changeset
4101
29650
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4102 void update_xtick (bool sync_pos = true)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4103 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4104 calc_ticks_and_lims (m_xlim, m_xtick, m_xminortickvalues,
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4105 m_xlimmode.is ("auto"), m_xtickmode.is ("auto"),
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4106 m_xscale.is ("log"), m_xlimitmethod.is ("padded"),
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4107 m_xlimitmethod.is ("tight"));
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4108 if (m_xticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4109 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"),
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4110 xaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4111 m_yscale.is ("log") ? 2 :
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4112 (yaxislocation_is ("origin") ? 0 :
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4113 (yaxislocation_is ("left") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4114 m_xlim);
29650
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4115
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4116 if (sync_pos)
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4117 sync_positions ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4118 }
29650
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4119 void update_ytick (bool sync_pos = true)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4120 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4121 calc_ticks_and_lims (m_ylim, m_ytick, m_yminortickvalues,
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4122 m_ylimmode.is ("auto"), m_ytickmode.is ("auto"),
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4123 m_yscale.is ("log"), m_ylimitmethod.is ("padded"),
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4124 m_ylimitmethod.is ("tight"));
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4125 if (m_yticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4126 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"),
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4127 yaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4128 m_xscale.is ("log") ? 2 :
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4129 (xaxislocation_is ("origin") ? 0 :
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4130 (xaxislocation_is ("bottom") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4131 m_ylim);
29650
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4132
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4133 if (sync_pos)
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4134 sync_positions ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4135 }
29650
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4136 void update_ztick (bool sync_pos = true)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4137 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4138 calc_ticks_and_lims (m_zlim, m_ztick, m_zminortickvalues,
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4139 m_zlimmode.is ("auto"), m_ztickmode.is ("auto"),
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4140 m_zscale.is ("log"), m_zlimitmethod.is ("padded"),
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4141 m_zlimitmethod.is ("tight"));
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4142 if (m_zticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4143 calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false,
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4144 2, m_zlim);
29650
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4145
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4146 if (sync_pos)
360d21b028b1 Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29572
diff changeset
4147 sync_positions ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4148 }
9347
3da821b161e9 imported patch ticklabel
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9188
diff changeset
4149
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4150 void update_xtickmode ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4151 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4152 if (m_xtickmode.is ("auto"))
22710
0cbe4714ce1b Correct locations of minor grid lines for manual ticks (bug #45850).
Markus Mützel <markus.muetzel@gmx.de>
parents: 22665
diff changeset
4153 update_xtick ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4154 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4155 void update_ytickmode ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4156 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4157 if (m_ytickmode.is ("auto"))
22710
0cbe4714ce1b Correct locations of minor grid lines for manual ticks (bug #45850).
Markus Mützel <markus.muetzel@gmx.de>
parents: 22665
diff changeset
4158 update_ytick ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4159 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4160 void update_ztickmode ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4161 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4162 if (m_ztickmode.is ("auto"))
22710
0cbe4714ce1b Correct locations of minor grid lines for manual ticks (bug #45850).
Markus Mützel <markus.muetzel@gmx.de>
parents: 22665
diff changeset
4163 update_ztick ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4164 }
11394
ecd87194adb6 Update ticks after {xyz}tickmode is set to auto
Konstantinos Poulios <logari81@googlemail.com>
parents: 11385
diff changeset
4165
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4166 void update_xticklabelmode ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4167 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4168 if (m_xticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4169 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"),
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4170 xaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4171 m_yscale.is ("log") ? 2 :
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4172 (yaxislocation_is ("origin") ? 0 :
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4173 (yaxislocation_is ("left") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4174 m_xlim);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4175 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4176 void update_yticklabelmode ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4177 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4178 if (m_yticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4179 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"),
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4180 yaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4181 m_xscale.is ("log") ? 2 :
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4182 (xaxislocation_is ("origin") ? 0 :
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4183 (xaxislocation_is ("bottom") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4184 m_ylim);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4185 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4186 void update_zticklabelmode ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4187 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4188 if (m_zticklabelmode.is ("auto"))
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
4189 calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"),
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30299
diff changeset
4190 false, 2, m_zlim);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4191 }
9347
3da821b161e9 imported patch ticklabel
Michael Goffioul <michael.goffioul@gmail.com>
parents: 9188
diff changeset
4192
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4193 void update_fontname ()
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
4194 {
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4195 update_font ("fontname");
19684
2b93834e5ede Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19678
diff changeset
4196 sync_positions ();
2b93834e5ede Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19678
diff changeset
4197 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4198 void update_fontsize ()
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
4199 {
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4200 update_font ("fontsize");
19684
2b93834e5ede Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19678
diff changeset
4201 sync_positions ();
2b93834e5ede Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19678
diff changeset
4202 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4203 void update_fontsmoothing ()
26858
0adb232f93b9 Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26715
diff changeset
4204 {
0adb232f93b9 Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26715
diff changeset
4205 update_font ("fontsmoothing");
0adb232f93b9 Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26715
diff changeset
4206 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4207 void update_fontangle ()
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
4208 {
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4209 update_font ("fontangle");
19684
2b93834e5ede Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19678
diff changeset
4210 sync_positions ();
2b93834e5ede Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19678
diff changeset
4211 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4212 void update_fontweight ()
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
4213 {
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4214 update_font ("fontweight");
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4215 sync_positions ();
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4216 }
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4217
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4218 void update_titlefontsizemultiplier ()
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4219 {
26371
87f11da73b19 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26194
diff changeset
4220 // update_font handles title and axis labels
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4221 update_font ("fontsize");
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4222 sync_positions ();
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4223 }
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4224
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4225 void update_labelfontsizemultiplier ()
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4226 {
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4227 update_font ("fontsize");
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4228 sync_positions ();
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4229 }
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4230
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4231 void update_titlefontweight ()
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4232 {
26371
87f11da73b19 graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents: 26194
diff changeset
4233 // update_font handles title and axis labels
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22710
diff changeset
4234 update_font ("fontweight");
19684
2b93834e5ede Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19678
diff changeset
4235 sync_positions ();
2b93834e5ede Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19678
diff changeset
4236 }
12777
6c1d0f03c331 Avoid redundant calls to set_font of text renderers (Bug #31305)
Konstantinos Poulios <logari81@gmail.com>
parents: 12685
diff changeset
4237
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4238 OCTINTERP_API void update_outerposition ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4239 OCTINTERP_API void update_position ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4240 OCTINTERP_API void update_looseinset ();
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4241
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4242 OCTINTERP_API double calc_tick_sep (double minval, double maxval);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4243 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4244 calc_ticks_and_lims (array_property& lims, array_property& ticks,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4245 array_property& mticks, bool limmode_is_auto,
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4246 bool tickmode_is_auto, bool is_logscale,
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4247 bool method_is_padded, bool method_is_tight);
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4248 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4249 calc_ticklabels (const array_property& ticks, any_property& labels,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4250 bool is_logscale, const bool is_origin,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4251 const int other_axislocation,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4252 const array_property& axis_lims);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4253 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4254 get_ticklabel_extents (const Matrix& ticks,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4255 const string_vector& ticklabels,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4256 const Matrix& limits);
12334
63dc132a1000 Move axes labels and title positioning to axes::properties
Konstantinos Poulios <logari81@gmail.com>
parents: 12327
diff changeset
4257
7854
228858e69bd1 added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7850
diff changeset
4258 void fix_limits (array_property& lims)
228858e69bd1 added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7850
diff changeset
4259 {
23577
80c42f4cca13 maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents: 23576
diff changeset
4260 if (lims.get ().isempty ())
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4261 return;
7854
228858e69bd1 added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7850
diff changeset
4262
228858e69bd1 added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7850
diff changeset
4263 Matrix l = lims.get ().matrix_value ();
228858e69bd1 added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7850
diff changeset
4264 if (l(0) > l(1))
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4265 {
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4266 l(0) = 0;
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4267 l(1) = 1;
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4268 lims = l;
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4269 }
7854
228858e69bd1 added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents: 7850
diff changeset
4270 else if (l(0) == l(1))
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4271 {
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4272 l(0) -= 0.5;
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4273 l(1) += 0.5;
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4274 lims = l;
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 10289
diff changeset
4275 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
4276 }
7446
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4277
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4278 OCTINTERP_API Matrix calc_tightbox (const Matrix& init_pos);
12440
2ed62b9f949e synchronization of axes position and outerposition
Konstantinos Poulios <logari81@googlemail.com>
parents: 12433
diff changeset
4279
23524
7c278572db66 Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents: 23457
diff changeset
4280 void set_colormap (const octave_value& val)
7c278572db66 Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents: 23457
diff changeset
4281 {
7c278572db66 Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents: 23457
diff changeset
4282 set___colormap__ (val);
7c278572db66 Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents: 23457
diff changeset
4283 }
7c278572db66 Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents: 23457
diff changeset
4284
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4285 void update___colormap__ ()
24501
2f10c3265607 Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24452
diff changeset
4286 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4287 m_colormap.run_listeners (GCB_POSTSET);
24501
2f10c3265607 Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24452
diff changeset
4288 }
2f10c3265607 Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 24452
diff changeset
4289
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4290 OCTINTERP_API octave_value get_colormap () const;
23524
7c278572db66 Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents: 23457
diff changeset
4291
7446
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4292 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4293 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4294 get_axis_limits (double xmin, double xmax,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4295 double min_pos, double max_neg,
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4296 const bool logscale, const std::string& method);
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4297
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4298 OCTINTERP_API void
30390
a61e1a0f6024 maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents: 30299
diff changeset
4299 check_axis_limits (Matrix& limits, const Matrix kids,
a61e1a0f6024 maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents: 30299
diff changeset
4300 const bool logscale, char& update_type);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
4301
19663
dfea01b3425f more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents: 19659
diff changeset
4302 void update_xlim ()
7446
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4303 {
24030
ec3d37eeafa2 Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23859
diff changeset
4304 update_axis_limits ("xlim");
ec3d37eeafa2 Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23859
diff changeset
4305
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4306 calc_ticks_and_lims (m_xlim, m_xtick, m_xminortickvalues,
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4307 m_xlimmode.is ("auto"), m_xtickmode.is ("auto"),
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4308 m_xscale.is ("log"), m_xlimitmethod.is ("padded"),
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4309 m_xlimitmethod.is ("tight"));
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4310 if (m_xticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4311 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4312 m_xaxislocation.is ("origin"),
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4313 m_yscale.is ("log") ? 2 :
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4314 (yaxislocation_is ("origin") ? 0 :
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4315 (yaxislocation_is ("left") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4316 m_xlim);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4317
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4318 fix_limits (m_xlim);
7855
f317f14516cb Add zoom stack facility in axes object.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7854
diff changeset
4319
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
4320 update_xscale ();
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
4321
12327
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
4322 update_axes_layout ();
7446
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4323 }
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4324
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4325 void update_xlimitmethod ()
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4326 {
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4327 update_xlim ();
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4328 }
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4329
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4330 void update_ylim ()
7446
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4331 {
24030
ec3d37eeafa2 Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23859
diff changeset
4332 update_axis_limits ("ylim");
ec3d37eeafa2 Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23859
diff changeset
4333
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4334 calc_ticks_and_lims (m_ylim, m_ytick, m_yminortickvalues,
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4335 m_ylimmode.is ("auto"), m_ytickmode.is ("auto"),
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4336 m_yscale.is ("log"), m_ylimitmethod.is ("padded"),
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4337 m_ylimitmethod.is ("tight"));
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4338 if (m_yticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4339 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"),
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4340 yaxislocation_is ("origin"),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4341 m_xscale.is ("log") ? 2 :
23116
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4342 (xaxislocation_is ("origin") ? 0 :
868daa374c49 Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23084
diff changeset
4343 (xaxislocation_is ("bottom") ? -1 : 1)),
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4344 m_ylim);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4345
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4346 fix_limits (m_ylim);
7855
f317f14516cb Add zoom stack facility in axes object.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7854
diff changeset
4347
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
4348 update_yscale ();
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
4349
12327
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
4350 update_axes_layout ();
7446
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4351 }
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4352
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4353 void update_ylimitmethod ()
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4354 {
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4355 update_ylim ();
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4356 }
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4357
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4358 void update_zlim ()
7446
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4359 {
24030
ec3d37eeafa2 Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23859
diff changeset
4360 update_axis_limits ("zlim");
ec3d37eeafa2 Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents: 23859
diff changeset
4361
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4362 calc_ticks_and_lims (m_zlim, m_ztick, m_zminortickvalues,
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4363 m_zlimmode.is ("auto"), m_ztickmode.is ("auto"),
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4364 m_zscale.is ("log"), m_zlimitmethod.is ("padded"),
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4365 m_zlimitmethod.is ("tight"));
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4366 if (m_zticklabelmode.is ("auto"))
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4367 calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false,
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4368 2, m_zlim);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4369
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4370 fix_limits (m_zlim);
7855
f317f14516cb Add zoom stack facility in axes object.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7854
diff changeset
4371
14324
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
4372 update_zscale ();
5a2b012b10c7 allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents: 14314
diff changeset
4373
12327
2ad37783bf01 Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents: 12324
diff changeset
4374 update_axes_layout ();
7446
4bfbec4b0e24 [project @ 2008-02-04 21:17:18 by jwe]
jwe
parents: 7445
diff changeset
4375 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
4376
30659
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4377 void update_zlimitmethod ()
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4378 {
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4379 update_zlim ();
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4380 }
4c0c02102ba9 Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 30565
diff changeset
4381
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4382 void trigger_normals_calc ();
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
4383
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4384 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4385
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4386 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4387 properties m_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4388
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4389 public:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4390 axes (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4391 : base_graphics_object (), m_properties (mh, p), m_default_properties ()
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4392 {
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4393 m_properties.update_transform ();
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4394 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4395
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
4396 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (axes)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
4397
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4398 ~axes () = default;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4399
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4400 void override_defaults (base_graphics_object& obj)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4401 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4402 // Allow parent (figure) to override first (properties knows how
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4403 // to find the parent object).
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4404 m_properties.override_defaults (obj);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4405
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4406 // Now override with our defaults. If the default_properties
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4407 // list includes the properties for all defaults (line,
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4408 // surface, etc.) then we don't have to know the type of OBJ
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4409 // here, we just call its set function and let it decide which
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4410 // properties from the list to use.
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4411 obj.set_from_list (m_default_properties);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4412 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4413
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
4414 void set (const caseless_str& name, const octave_value& value)
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4415 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4416 if (name.compare ("default", 7))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4417 // strip "default", pass rest to function that will
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4418 // parse the remainder and add the element to the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4419 // default_properties map.
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4420 m_default_properties.set (name.substr (7), value);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4421 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4422 m_properties.set (name, value);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4423 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4424
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4425 void set_defaults (const std::string& mode)
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4426 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4427 m_properties.set_defaults (*this, mode);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4428 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4429
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7176
diff changeset
4430 octave_value get (const caseless_str& name) const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4431 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4432 octave_value retval;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4433
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4434 // FIXME: finish this.
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4435 if (name.compare ("default", 7))
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4436 retval = get_default (name.substr (7));
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4437 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4438 retval = m_properties.get (name);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4439
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4440 return retval;
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4441 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4442
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4443 OCTINTERP_API octave_value get_default (const caseless_str& name) const;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4444
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4445 octave_value get_defaults () const
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4446 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4447 return m_default_properties.as_struct ("default");
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4448 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4449
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4450 property_list get_defaults_list () const
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
4451 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4452 return m_default_properties;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4453 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4454
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4455 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4456
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4457 const base_properties& get_properties () const { return m_properties; }
7222
dd8b3bbeeaf9 [project @ 2007-11-30 06:23:25 by jwe]
jwe
parents: 7214
diff changeset
4458
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4459 OCTINTERP_API void update_axis_limits (const std::string& axis_type);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4460
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4461 OCTINTERP_API void update_axis_limits (const std::string& axis_type,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4462 const graphics_handle& h);
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
4463
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4464 bool valid_object () const { return true; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4465
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4466 OCTINTERP_API void reset_default_properties ();
10722
755fcb5baad3 Add the reset built function
David Bateman <dbateman@free.fr>
parents: 10717
diff changeset
4467
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4468 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4469 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4470 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4471 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4472 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4473 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4474 }
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4475
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
4476 protected:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4477 OCTINTERP_API void initialize (const graphics_object& go);
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
4478
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4479 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4480 property_list m_default_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4481 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4482
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4483 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4484
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
4485 class OCTINTERP_API line : public base_graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4486 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4487 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4488
7821
f79dcba526a8 Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7527
diff changeset
4489 class OCTINTERP_API properties : public base_properties
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4490 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4491 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4492
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4493 // See the genprops.awk script for an explanation of the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4494 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4495 // Programming note: Keep property list sorted if new ones are added.
7366
2a2115742cb5 [project @ 2008-01-13 06:46:39 by jwe]
jwe
parents: 7365
diff changeset
4496
8247
e41f420875db set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents: 8222
diff changeset
4497 BEGIN_PROPERTIES (line)
20738
f90295782d60 Accept color value of "none" for line objects (bug #44224).
Rik <rik@octave.org>
parents: 20730
diff changeset
4498 color_property color , color_property (color_values (0, 0, 0), radio_values ("none"))
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4499 string_property displayname , ""
22759
39f39eb4e476 Implement "linejoin" property (bug #48387)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22755
diff changeset
4500 radio_property linejoin , "{round}|miter|chamfer"
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
4501 radio_property linestyle , "{-}|--|:|-.|none"
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
4502 double_property linewidth , 0.5
30253
20fd3c03fd74 Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents: 30155
diff changeset
4503 radio_property marker , "{none}|+|o|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram"
17645
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
4504 color_property markeredgecolor , color_property (radio_values ("{auto}|none"), color_values (0, 0, 0))
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
4505 color_property markerfacecolor , color_property (radio_values ("auto|{none}"), color_values (0, 0, 0))
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
4506 double_property markersize , 6
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4507 row_vector_property xdata u , default_data ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4508 string_property xdatasource , ""
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4509 row_vector_property ydata u , default_data ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4510 string_property ydatasource , ""
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4511 row_vector_property zdata u , Matrix ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4512 string_property zdatasource , ""
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4513
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4514 // hidden properties for limit computation
26715
24e11ee4fe45 Improve calculation of zlim and aspect ratios for 2d objects (bug #55634).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26712
diff changeset
4515 row_vector_property xlim hlr , default_data_lim ()
24e11ee4fe45 Improve calculation of zlim and aspect ratios for 2d objects (bug #55634).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26712
diff changeset
4516 row_vector_property ylim hlr , default_data_lim ()
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4517 row_vector_property zlim hlr , Matrix ()
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4518 bool_property xliminclude hl , "on"
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4519 bool_property yliminclude hl , "on"
26715
24e11ee4fe45 Improve calculation of zlim and aspect ratios for 2d objects (bug #55634).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26712
diff changeset
4520 bool_property zliminclude hl , "on"
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4521 END_PROPERTIES
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4522
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
4523 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4524 void init ()
25103
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
4525 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4526 m_linewidth.add_constraint ("min", 0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4527 m_markersize.add_constraint ("min", 0, false);
25103
078b795c5219 maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents: 25054
diff changeset
4528 }
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
4529
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4530 private:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4531 OCTINTERP_API Matrix compute_xlim () const;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4532 OCTINTERP_API Matrix compute_ylim () const;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4533
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4534 void update_xdata () { set_xlim (compute_xlim ()); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4535
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4536 void update_ydata () { set_ylim (compute_ylim ()); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4537
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4538 void update_zdata () { set_zlim (m_zdata.get_limits ()); }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4539 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4540
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4541 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4542 properties m_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4543
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4544 public:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4545 line (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4546 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
4547 { }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4548
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
4549 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (line)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
4550
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4551 ~line () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4552
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4553 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4554
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4555 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4556
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4557 bool valid_object () const { return true; }
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4558
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4559 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4560 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4561 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4562 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4563 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4564 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4565 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4566 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4567
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4568 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4569
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
4570 class OCTINTERP_API text : public base_graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4571 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4572 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4573
7821
f79dcba526a8 Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7527
diff changeset
4574 class OCTINTERP_API properties : public base_properties
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4575 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4576 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4577
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4578 OCTINTERP_API double
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4579 get___fontsize_points__ (double box_pix_height = 0) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4580
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4581 OCTINTERP_API void update_text_extent ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4582
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4583 OCTINTERP_API void update_font ();
25884
4e108574385c Improve OpenGL rendering on high resolution screens with Qt 5 (bug #49053)
John Swensen <jpswensen@gmail.com>
parents: 25867
diff changeset
4584
14448
7a49519913e3 Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents: 14391
diff changeset
4585 void set_position (const octave_value& val)
7a49519913e3 Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents: 14391
diff changeset
4586 {
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4587 octave_value new_val (val);
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4588
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4589 if (new_val.numel () == 2)
14448
7a49519913e3 Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents: 14391
diff changeset
4590 {
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4591 dim_vector dv (1, 3);
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4592
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4593 new_val = new_val.resize (dv, true);
14448
7a49519913e3 Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents: 14391
diff changeset
4594 }
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4595
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4596 if (m_position.set (new_val, false))
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4597 {
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4598 set_positionmode ("manual");
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4599 update_position ();
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4600 m_position.run_listeners (GCB_POSTSET);
20545
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4601 mark_modified ();
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4602 }
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4603 else
c547458dc10e eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents: 20459
diff changeset
4604 set_positionmode ("manual");
14448
7a49519913e3 Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents: 14391
diff changeset
4605 }
7a49519913e3 Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents: 14391
diff changeset
4606
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4607 // See the genprops.awk script for an explanation of the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4608 // properties declarations.
26122
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
4609 // Programming note: Keep property list sorted if new ones are added.
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4610
8247
e41f420875db set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents: 8222
diff changeset
4611 BEGIN_PROPERTIES (text)
17646
993ea21b7e03 graphics.in.h: Text "edgecolor" property should default to "none".
Rik <rik@octave.org>
parents: 17645
diff changeset
4612 color_property backgroundcolor , color_property (radio_values ("{none}"), color_values (1, 1, 1))
26682
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
4613 color_property color u , color_property (color_values (0, 0, 0), radio_values ("none"))
17645
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
4614 color_property edgecolor , color_property (radio_values ("{none}"), color_values (0, 0, 0))
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4615 bool_property editing , "off"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4616 array_property extent rG , Matrix (1, 4, 0.0)
28079
999351c323ce remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
4617 radio_property fontangle u , "{normal}|italic"
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10317
diff changeset
4618 string_property fontname u , OCTAVE_DEFAULT_FONTNAME
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10317
diff changeset
4619 double_property fontsize u , 10
26858
0adb232f93b9 Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26715
diff changeset
4620 bool_property fontsmoothing u , "on"
19047
1288a2f27769 Handle non "points" fontunits properties (bug # 40158)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19044
diff changeset
4621 radio_property fontunits SU , "inches|centimeters|normalized|{points}|pixels"
26275
dd97dc559679 maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents: 26194
diff changeset
4622 radio_property fontweight u , "{normal}|bold"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4623 radio_property horizontalalignment mu , "{left}|center|right"
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10317
diff changeset
4624 radio_property interpreter u , "{tex}|none|latex"
7377
46b58515067d [project @ 2008-01-15 06:57:15 by jwe]
jwe
parents: 7370
diff changeset
4625 radio_property linestyle , "{-}|--|:|-.|none"
46b58515067d [project @ 2008-01-15 06:57:15 by jwe]
jwe
parents: 7370
diff changeset
4626 double_property linewidth , 0.5
26185
ef0998af70f9 Change "Margin" default of text object to 3.
Rik <rik@octave.org>
parents: 26129
diff changeset
4627 double_property margin , 3
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4628 array_property position smu , Matrix (1, 3, 0.0)
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4629 double_property rotation mu , 0
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4630 text_label_property string u , ""
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4631 radio_property units u , "{data}|pixels|normalized|inches|centimeters|points"
11455
2be9e22796d2 improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents: 11394
diff changeset
4632 radio_property verticalalignment mu , "top|cap|{middle}|baseline|bottom"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4633
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4634 // hidden properties for limit computation
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4635 row_vector_property xlim hlr , Matrix ()
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4636 row_vector_property ylim hlr , Matrix ()
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4637 row_vector_property zlim hlr , Matrix ()
11281
3f952c6973f7 graphics.h.in: Change intended for 11272.
Ben Abbott <bpabbott@mac.com>
parents: 11250
diff changeset
4638 bool_property xliminclude hl , "off"
3f952c6973f7 graphics.h.in: Change intended for 11272.
Ben Abbott <bpabbott@mac.com>
parents: 11250
diff changeset
4639 bool_property yliminclude hl , "off"
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4640 bool_property zliminclude hl , "off"
11385
71e7467fbd34 Disable auto-positioning of manually positioned title and axes labels.
Konstantinos Poulios <logari81@googlemail.com>
parents: 11384
diff changeset
4641 // hidden properties for auto-positioning
12389
5367bd36b9f8 implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents: 12334
diff changeset
4642 radio_property positionmode hu , "{auto}|manual"
5367bd36b9f8 implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents: 12334
diff changeset
4643 radio_property rotationmode hu , "{auto}|manual"
5367bd36b9f8 implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents: 12334
diff changeset
4644 radio_property horizontalalignmentmode hu , "{auto}|manual"
5367bd36b9f8 implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents: 12334
diff changeset
4645 radio_property verticalalignmentmode hu , "{auto}|manual"
22622
4191f8b5070c Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents: 22407
diff changeset
4646 radio_property __autopos_tag__ h , "{none}|xlabel|ylabel|zlabel|title"
19047
1288a2f27769 Handle non "points" fontunits properties (bug # 40158)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19044
diff changeset
4647 // hidden property for text rendering
22622
4191f8b5070c Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents: 22407
diff changeset
4648 double_property __fontsize_points__ hgr , 0
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4649 END_PROPERTIES
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4650
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4651 OCTINTERP_API Matrix get_data_position () const;
29433
8811d8274118 Allow arbitrary text rotation onscreen (bug #33118)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 29359
diff changeset
4652 OCTINTERP_API Matrix get_extent_matrix (bool rotated = false) const;
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4653 const uint8NDArray& get_pixels () const { return m_pixels; }
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents: 21200
diff changeset
4654
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents: 21200
diff changeset
4655 // Text renderer, used for calculation of text size
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4656 octave::text_renderer m_txt_renderer;
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10317
diff changeset
4657
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
4658 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4659 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4660 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4661 m_position.add_constraint (dim_vector (1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4662 m_fontsize.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4663 m_linewidth.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4664 m_margin.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4665 m_cached_units = get_units ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4666 update_font ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4667 }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4668
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4669 private:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4670 void update_position ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4671 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4672 Matrix pos = get_data_position ();
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4673 Matrix lim;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4674
26712
f8e7c1750222 Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents: 26682
diff changeset
4675 lim = Matrix (1, 4, pos(0));
23450
855122b993da maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents: 23449
diff changeset
4676 lim(2) = (lim(2) <= 0 ? octave::numeric_limits<double>::Inf () : lim(2));
26712
f8e7c1750222 Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents: 26682
diff changeset
4677 lim(3) = (lim(3) >= 0 ? -octave::numeric_limits<double>::Inf () : lim(3));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4678 set_xlim (lim);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4679
26712
f8e7c1750222 Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents: 26682
diff changeset
4680 lim = Matrix (1, 4, pos(1));
23450
855122b993da maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents: 23449
diff changeset
4681 lim(2) = (lim(2) <= 0 ? octave::numeric_limits<double>::Inf () : lim(2));
26712
f8e7c1750222 Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents: 26682
diff changeset
4682 lim(3) = (lim(3) >= 0 ? -octave::numeric_limits<double>::Inf () : lim(3));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4683 set_ylim (lim);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4684
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4685 if (pos.numel () == 3)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4686 {
26712
f8e7c1750222 Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents: 26682
diff changeset
4687 lim = Matrix (1, 4, pos(2));
23450
855122b993da maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents: 23449
diff changeset
4688 lim(2) = (lim(2) <= 0 ? octave::numeric_limits<double>::Inf ()
855122b993da maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents: 23449
diff changeset
4689 : lim(2));
26712
f8e7c1750222 Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents: 26682
diff changeset
4690 lim(3) = (lim(3) >= 0 ? -octave::numeric_limits<double>::Inf ()
f8e7c1750222 Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents: 26682
diff changeset
4691 : lim(3));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4692 set_zlim (lim);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4693 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4694 }
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10317
diff changeset
4695
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4696 OCTINTERP_API void request_autopos ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4697 void update_positionmode () { request_autopos (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4698 void update_rotationmode () { request_autopos (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4699 void update_horizontalalignmentmode () { request_autopos (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4700 void update_verticalalignmentmode () { request_autopos (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4701
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4702 void update_string () { request_autopos (); update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4703 void update_rotation () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4704 void update_fontname () { update_font (); update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4705 void update_fontsize () { update_font (); update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4706 void update_fontsmoothing () { update_font (); update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4707
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4708 void update_color ()
26682
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
4709 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4710 if (! m_color.is ("none"))
26682
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
4711 {
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
4712 update_font ();
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
4713 update_text_extent ();
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
4714 }
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
4715 }
0780d3f4ecad Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents: 26639
diff changeset
4716
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4717 void update_fontangle ()
23396
945b53af4655 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 23258
diff changeset
4718 {
945b53af4655 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 23258
diff changeset
4719 update_font ();
23210
3a298e07002c Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23201
diff changeset
4720 update_text_extent ();
3a298e07002c Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23201
diff changeset
4721 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4722 void update_fontweight () { update_font (); update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4723
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4724 void update_interpreter () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4725 void update_horizontalalignment () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4726 void update_verticalalignment () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4727
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4728 OCTINTERP_API void update_units ();
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4729 OCTINTERP_API void update_fontunits (const caseless_str& old_fontunits);
10402
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10317
diff changeset
4730
9f2bf537a651 Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents: 10317
diff changeset
4731 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4732 std::string m_cached_units;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4733 uint8NDArray m_pixels;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4734 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4735
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4736 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4737 properties m_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4738
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4739 public:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4740 text (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4741 : base_graphics_object (), m_properties (mh, p)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4742 {
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4743 m_properties.set_clipping ("off");
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4744 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4745
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
4746 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (text)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
4747
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4748 ~text () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4749
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4750 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4751
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4752 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4753
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4754 bool valid_object () const { return true; }
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4755
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4756 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4757 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4758 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4759 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4760 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4761 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4762 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4763 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4764
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4765 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4766
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
4767 class OCTINTERP_API image : public base_graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4768 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4769 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4770
7821
f79dcba526a8 Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7527
diff changeset
4771 class OCTINTERP_API properties : public base_properties
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4772 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4773 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4774
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4775 bool is_aliminclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4776 { return (m_aliminclude.is_on () && m_alphadatamapping.is ("scaled")); }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4777 std::string get_aliminclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4778 { return m_aliminclude.current_value (); }
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4779
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4780 bool is_climinclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4781 { return (m_climinclude.is_on () && m_cdatamapping.is ("scaled")); }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4782 std::string get_climinclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4783 { return m_climinclude.current_value (); }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4784
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4785 OCTINTERP_API octave_value get_color_data () const;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4786
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4787 void initialize_data () { update_cdata (); }
19324
68db8396c378 Make "image ()" use the default image cdata
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19087
diff changeset
4788
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4789 // See the genprops.awk script for an explanation of the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4790 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4791 // Programming note: Keep property list sorted if new ones are added.
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4792
8247
e41f420875db set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents: 8222
diff changeset
4793 BEGIN_PROPERTIES (image)
18646
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
4794 array_property alphadata u , Matrix (1, 1, 1.0)
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
4795 radio_property alphadatamapping al , "{none}|direct|scaled"
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
4796 array_property cdata u , default_image_cdata ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4797 radio_property cdatamapping al , "scaled|{direct}"
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4798 row_vector_property xdata mu , Matrix ()
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4799 row_vector_property ydata mu , Matrix ()
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4800 // hidden properties for limit computation
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4801 row_vector_property alim hlr , Matrix ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4802 row_vector_property clim hlr , Matrix ()
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
4803 row_vector_property xlim hlr , Matrix ()
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
4804 row_vector_property ylim hlr , Matrix ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4805 bool_property aliminclude hlg , "on"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4806 bool_property climinclude hlg , "on"
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4807 bool_property xliminclude hl , "on"
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4808 bool_property yliminclude hl , "on"
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4809 radio_property xdatamode ha , "{auto}|manual"
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4810 radio_property ydatamode ha , "{auto}|manual"
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4811 END_PROPERTIES
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4812
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
4813 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4814 void init ()
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
4815 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4816 m_xdata.add_constraint (2);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4817 m_xdata.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4818 m_ydata.add_constraint (2);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4819 m_ydata.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4820 m_cdata.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4821 m_cdata.add_constraint ("single");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4822 m_cdata.add_constraint ("logical");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4823 m_cdata.add_constraint ("int8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4824 m_cdata.add_constraint ("int16");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4825 m_cdata.add_constraint ("int32");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4826 m_cdata.add_constraint ("int64");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4827 m_cdata.add_constraint ("uint8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4828 m_cdata.add_constraint ("uint16");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4829 m_cdata.add_constraint ("uint32");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4830 m_cdata.add_constraint ("uint64");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4831 m_cdata.add_constraint ("real");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4832 m_cdata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4833 m_cdata.add_constraint (dim_vector (-1, -1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4834 m_alphadata.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4835 m_alphadata.add_constraint ("uint8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4836 m_alphadata.add_constraint (dim_vector (-1, -1));
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
4837 }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4838
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4839 private:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4840 void update_alphadata ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4841 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4842 if (alphadatamapping_is ("scaled"))
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4843 set_alim (m_alphadata.get_limits ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4844 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4845 m_alim = m_alphadata.get_limits ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4846 }
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4847
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4848 void update_cdata ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4849 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4850 if (cdatamapping_is ("scaled"))
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4851 set_clim (m_cdata.get_limits ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4852 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4853 m_clim = m_cdata.get_limits ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4854
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4855 if (m_xdatamode.is ("auto"))
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4856 update_xdata ();
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
4857
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4858 if (m_ydatamode.is ("auto"))
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4859 update_ydata ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
4860 }
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
4861
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4862 void update_xdata ()
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
4863 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4864 if (m_xdata.get ().isempty ())
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4865 set_xdatamode ("auto");
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
4866
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4867 if (m_xdatamode.is ("auto"))
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4868 {
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4869 set_xdata (get_auto_xdata ());
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4870 set_xdatamode ("auto");
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4871 }
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
4872
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4873 Matrix limits = m_xdata.get_limits ();
11076
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4874 float dp = pixel_xsize ();
9687
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4875
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4876 limits(0) = limits(0) - dp;
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4877 limits(1) = limits(1) + dp;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
4878 set_xlim (limits);
9687
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4879 }
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4880
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4881 void update_ydata ()
9687
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4882 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4883 if (m_ydata.get ().isempty ())
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4884 set_ydatamode ("auto");
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
4885
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4886 if (m_ydatamode.is ("auto"))
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4887 {
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
4888 set_ydata (get_auto_ydata ());
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4889 set_ydatamode ("auto");
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4890 }
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
4891
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4892 Matrix limits = m_ydata.get_limits ();
11076
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4893 float dp = pixel_ysize ();
9687
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4894
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4895 limits(0) = limits(0) - dp;
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4896 limits(1) = limits(1) + dp;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
4897 set_ylim (limits);
9687
86aa08bbc887 image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents: 9680
diff changeset
4898 }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
4899
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4900 Matrix get_auto_xdata ()
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4901 {
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4902 dim_vector dv = get_cdata ().dims ();
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4903 Matrix data;
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4904 if (dv(1) > 0.)
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4905 {
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4906 data = Matrix (1, 2, 1);
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4907 data(1) = dv(1);
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4908 }
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4909 return data;
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4910 }
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4911
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4912 Matrix get_auto_ydata ()
18899
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4913 {
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4914 dim_vector dv = get_cdata ().dims ();
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4915 Matrix data;
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4916 if (dv(0) > 0.)
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4917 {
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4918 data = Matrix (1, 2, 1);
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4919 data(1) = dv(0);
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4920 }
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4921 return data;
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4922 }
3d9e503aea2c Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18850
diff changeset
4923
11076
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4924 float pixel_size (octave_idx_type dim, const Matrix limits)
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4925 {
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4926 octave_idx_type l = dim - 1;
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4927 float dp;
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4928
11089
d761f0dc997e graphics.h.in: Properly set image pixel size when unique(x/ydata) is scalar.
Ben Abbott <bpabbott@mac.com>
parents: 11076
diff changeset
4929 if (l > 0 && limits(0) != limits(1))
11076
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4930 dp = (limits(1) - limits(0))/(2*l);
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4931 else
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4932 {
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4933 if (limits(1) == limits(2))
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4934 dp = 0.5;
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4935 else
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4936 dp = (limits(1) - limits(0))/2;
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4937 }
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4938 return dp;
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4939 }
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4940
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4941 public:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4942 float pixel_xsize ()
11076
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4943 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4944 return pixel_size ((get_cdata ().dims ())(1), m_xdata.get_limits ());
11076
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4945 }
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4946
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4947 float pixel_ysize ()
11076
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4948 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4949 return pixel_size ((get_cdata ().dims ())(0), m_ydata.get_limits ());
11076
b748b86cb8c1 fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents: 11075
diff changeset
4950 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4951 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4952
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4953 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4954 properties m_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4955
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4956 public:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4957 image (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4958 : base_graphics_object (), m_properties (mh, p)
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4959 {
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4960 m_properties.initialize_data ();
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4961 }
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4962
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
4963 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (image)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
4964
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4965 ~image () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4966
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4967 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4968
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4969 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4970
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
4971 bool valid_object () const { return true; }
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4972
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4973 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4974 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
4975 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4976 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4977 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4978 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
4979 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4980 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4981
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4982 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
4983
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4984 class OCTINTERP_API light : public base_graphics_object
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4985 {
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4986 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
4987
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4988 class OCTINTERP_API properties : public base_properties
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4989 {
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4990 // See the genprops.awk script for an explanation of the
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4991 // properties declarations.
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4992 // Programming note: Keep property list sorted if new ones are added.
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4993
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4994 BEGIN_PROPERTIES (light)
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4995 color_property color , color_values (1, 1, 1)
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4996 array_property position , default_light_position ()
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4997 radio_property style , "{infinite}|local"
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4998 END_PROPERTIES
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
4999
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5000 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5001 void init ()
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5002 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5003 m_position.add_constraint (dim_vector (1, 3));
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5004 }
26045
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5005
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5006 private:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5007 OCTINTERP_API void update_visible ();
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5008 };
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5009
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5010 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5011 properties m_properties;
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5012
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5013 public:
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5014 light (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5015 : base_graphics_object (), m_properties (mh, p)
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5016 { }
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5017
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5018 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (light)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5019
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5020 ~light () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5021
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5022 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5023
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5024 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5025
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5026 bool valid_object () const { return true; }
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5027
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5028 bool has_readonly_property (const caseless_str& pname) const
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5029 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5030 bool retval = m_properties.has_readonly_property (pname);
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5031 if (! retval)
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5032 retval = base_properties::has_readonly_property (pname);
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5033 return retval;
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5034 }
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5035
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5036 protected:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5037 OCTINTERP_API void initialize (const graphics_object& go);
21789
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5038 };
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5039
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5040 // ---------------------------------------------------------------------
6afdf40be534 Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents: 21782
diff changeset
5041
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
5042 class OCTINTERP_API patch : public base_graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5043 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5044 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5045
7821
f79dcba526a8 Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7527
diff changeset
5046 class OCTINTERP_API properties : public base_properties
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5047 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5048 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5049
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5050 octave_value get_color_data () const;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
5051
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5052 // Matlab allows incoherent data to be stored into patch properties.
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
5053 // The patch should then be ignored by the renderer.
23433
c9fab0bc983e maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents: 23401
diff changeset
5054 bool has_bad_data (std::string& msg) const
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
5055 {
30040
805357e6b058 maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents: 29993
diff changeset
5056 msg = m_bad_data_msg;
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
5057 return ! msg.empty ();
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
5058 }
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5059
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5060 bool is_aliminclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5061 { return (m_aliminclude.is_on () && m_alphadatamapping.is ("scaled")); }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5062 std::string get_aliminclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5063 { return m_aliminclude.current_value (); }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5064
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5065 bool is_climinclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5066 { return (m_climinclude.is_on () && m_cdatamapping.is ("scaled")); }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5067 std::string get_climinclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5068 { return m_climinclude.current_value (); }
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5069
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5070 OCTINTERP_API bool get_do_lighting () const;
25423
13b1b9a0d9c5 Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents: 25418
diff changeset
5071
30040
805357e6b058 maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents: 29993
diff changeset
5072 std::vector<std::vector<octave_idx_type>> m_coplanar_last_idx;
25418
762eb2e33a7f Enable support of non-coplanar faces in patches for OpenGL (bug #47677).
Markus Muetzel <markus.muetzel@gmx.de>
parents: 25273
diff changeset
5073
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5074 // See the genprops.awk script for an explanation of the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5075 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5076 // Programming note: Keep property list sorted if new ones are added.
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5077
8247
e41f420875db set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents: 8222
diff changeset
5078 BEGIN_PROPERTIES (patch)
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5079 radio_property alphadatamapping l , "none|{scaled}|direct"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5080 double_property ambientstrength , 0.3
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5081 radio_property backfacelighting , "unlit|lit|{reverselit}"
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5082 array_property cdata u , Matrix ()
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5083 radio_property cdatamapping l , "{scaled}|direct"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5084 double_property diffusestrength , 0.6
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5085 string_property displayname , ""
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5086 double_radio_property edgealpha , double_radio_property (1.0, radio_values ("flat|interp"))
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5087 color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"))
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5088 radio_property edgelighting u , "{none}|flat|gouraud|phong"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5089 double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp"))
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5090 color_property facecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"))
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5091 radio_property facelighting u , "none|{flat}|gouraud|phong"
21654
a0ebc922fd52 Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents: 21568
diff changeset
5092 array_property facenormals m , Matrix ()
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5093 radio_property facenormalsmode u , "{auto}|manual"
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5094 array_property faces u , default_patch_faces ()
7848
6bb2bbc2bf45 Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7847
diff changeset
5095 array_property facevertexalphadata , Matrix ()
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5096 array_property facevertexcdata u , Matrix ()
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
5097 radio_property linestyle , "{-}|--|:|-.|none"
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
5098 double_property linewidth , 0.5
30253
20fd3c03fd74 Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents: 30155
diff changeset
5099 radio_property marker , "{none}|+|o|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram"
17645
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
5100 color_property markeredgecolor , color_property (radio_values ("none|{auto}|flat"), color_values (0, 0, 0))
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
5101 color_property markerfacecolor , color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0))
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
5102 double_property markersize , 6
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5103 double_property specularcolorreflectance , 1.0
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5104 double_property specularexponent , 10.0
18646
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
5105 double_property specularstrength , 0.9
21654
a0ebc922fd52 Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents: 21568
diff changeset
5106 array_property vertexnormals m , Matrix ()
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5107 radio_property vertexnormalsmode u , "{auto}|manual"
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5108 array_property vertices u , default_patch_vertices ()
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5109 array_property xdata u , default_patch_xdata ()
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5110 array_property ydata u , default_patch_ydata ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5111 array_property zdata u , Matrix ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5112
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5113 // hidden properties for limit computation
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5114 row_vector_property alim hlr , Matrix ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5115 row_vector_property clim hlr , Matrix ()
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5116 row_vector_property xlim hlr , Matrix ()
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5117 row_vector_property ylim hlr , Matrix ()
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5118 row_vector_property zlim hlr , Matrix ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5119 bool_property aliminclude hlg , "on"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5120 bool_property climinclude hlg , "on"
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5121 bool_property xliminclude hl , "on"
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5122 bool_property yliminclude hl , "on"
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5123 bool_property zliminclude hl , "on"
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5124 END_PROPERTIES
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5125
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
5126 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5127 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5128 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5129 m_xdata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5130 m_ydata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5131 m_zdata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5132 m_faces.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5133 m_vertices.add_constraint (dim_vector (-1, 2));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5134 m_vertices.add_constraint (dim_vector (-1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5135 m_cdata.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5136 m_cdata.add_constraint ("single");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5137 m_cdata.add_constraint ("logical");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5138 m_cdata.add_constraint ("int8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5139 m_cdata.add_constraint ("int16");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5140 m_cdata.add_constraint ("int32");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5141 m_cdata.add_constraint ("int64");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5142 m_cdata.add_constraint ("uint8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5143 m_cdata.add_constraint ("uint16");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5144 m_cdata.add_constraint ("uint32");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5145 m_cdata.add_constraint ("uint64");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5146 m_cdata.add_constraint ("real");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5147 m_cdata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5148 m_cdata.add_constraint (dim_vector (-1, -1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5149 m_facevertexcdata.add_constraint (dim_vector (-1, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5150 m_facevertexcdata.add_constraint (dim_vector (-1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5151 m_facevertexcdata.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5152 m_facevertexalphadata.add_constraint (dim_vector (-1, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5153 m_facevertexalphadata.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5154 m_facenormals.add_constraint (dim_vector (-1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5155 m_facenormals.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5156 m_vertexnormals.add_constraint (dim_vector (-1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5157 m_vertexnormals.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5158
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5159 m_ambientstrength.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5160 m_ambientstrength.add_constraint ("max", 1.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5161 m_diffusestrength.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5162 m_diffusestrength.add_constraint ("max", 1.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5163 m_linewidth.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5164 m_markersize.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5165 m_specularcolorreflectance.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5166 m_specularcolorreflectance.add_constraint ("max", 1.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5167 m_specularexponent.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5168 m_specularstrength.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5169 m_specularstrength.add_constraint ("max", 1.0, true);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5170 }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5171
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5172 public:
26018
50583f514ae4 Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25991
diff changeset
5173 void update_normals (bool reset, bool force = false)
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5174 {
26018
50583f514ae4 Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25991
diff changeset
5175 update_face_normals (reset, force);
50583f514ae4 Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25991
diff changeset
5176 update_vertex_normals (reset, force);
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5177 }
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5178
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5179
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5180 private:
30040
805357e6b058 maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents: 29993
diff changeset
5181 std::string m_bad_data_msg;
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5182
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5183 void update_faces () { update_data ();}
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5184
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5185 void update_vertices () { update_data ();}
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5186
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5187 void update_facevertexcdata () { update_data ();}
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5188
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5189 OCTINTERP_API void update_fvc ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5190
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5191 void update_xdata ()
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
5192 {
23577
80c42f4cca13 maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents: 23576
diff changeset
5193 if (get_xdata ().isempty ())
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5194 {
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
5195 // For compatibility with matlab behavior,
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
5196 // if x/ydata are set empty, silently empty other *data and
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
5197 // faces properties while vertices remain unchanged.
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5198 set_ydata (Matrix ());
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5199 set_zdata (Matrix ());
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5200 set_cdata (Matrix ());
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5201 set_faces (Matrix ());
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5202 }
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5203 else
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5204 {
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5205 update_fvc ();
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5206 update_normals (true);
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5207 }
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5208
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5209 set_xlim (m_xdata.get_limits ());
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5210 }
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5211
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5212 void update_ydata ()
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
5213 {
23577
80c42f4cca13 maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents: 23576
diff changeset
5214 if (get_ydata ().isempty ())
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5215 {
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5216 set_xdata (Matrix ());
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5217 set_zdata (Matrix ());
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5218 set_cdata (Matrix ());
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5219 set_faces (Matrix ());
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5220 }
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5221 else
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5222 {
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5223 update_fvc ();
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5224 update_normals (true);
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5225 }
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5226
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5227 set_ylim (m_ydata.get_limits ());
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5228 }
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5229
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5230 void update_zdata ()
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
5231 {
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5232 update_fvc ();
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5233 update_normals (true);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5234 set_zlim (m_zdata.get_limits ());
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5235 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
5236
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5237 void update_cdata ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5238 {
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5239 update_fvc ();
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5240 update_normals (false);
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5241
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5242 if (cdatamapping_is ("scaled"))
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5243 set_clim (m_cdata.get_limits ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5244 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5245 m_clim = m_cdata.get_limits ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5246 }
18901
df972b9d080a Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18899
diff changeset
5247
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5248 OCTINTERP_API void update_data ();
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5249
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5250 OCTINTERP_API void calc_face_normals (Matrix& normals);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5251 OCTINTERP_API void update_face_normals (bool reset, bool force = false);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5252 OCTINTERP_API void update_vertex_normals (bool reset, bool force = false);
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5253
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5254 void update_edgelighting ()
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5255 {
26045
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5256 update_normals (false);
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5257 }
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5258
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5259 void update_facelighting ()
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5260 {
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5261 update_normals (false);
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5262 }
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5263
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5264 void update_facenormalsmode ()
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5265 {
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5266 update_face_normals (false);
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5267 }
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5268
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5269 void update_vertexnormalsmode ()
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5270 {
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5271 update_vertex_normals (false);
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5272 }
26045
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5273
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5274 void update_visible ()
26045
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5275 {
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5276 if (is_visible ())
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5277 update_normals (false);
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5278 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5279 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5280
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5281 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5282 properties m_properties;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5283 property_list m_default_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5284
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5285 public:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5286 patch (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5287 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
5288 { }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5289
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5290 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (patch)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5291
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5292 ~patch () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5293
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5294 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5295
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5296 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5297
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5298 bool valid_object () const { return true; }
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5299
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5300 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5301 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5302 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5303 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5304 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5305 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5306 }
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5307
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5308 OCTINTERP_API void reset_default_properties ();
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5309
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5310 protected:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5311 OCTINTERP_API void initialize (const graphics_object& go);
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5312
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5313 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5314
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5315 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5316
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5317 class OCTINTERP_API scatter : public base_graphics_object
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5318 {
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5319 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5320
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5321 class OCTINTERP_API properties : public base_properties
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5322 {
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5323 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5324
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5325 OCTINTERP_API octave_value get_color_data () const;
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5326
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5327 // Matlab allows incoherent data to be stored in scatter properties.
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5328 // The scatter object should then be ignored by the renderer.
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5329 bool has_bad_data (std::string& msg) const
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5330 {
30040
805357e6b058 maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents: 29993
diff changeset
5331 msg = m_bad_data_msg;
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5332 return ! msg.empty ();
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5333 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5334
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5335 bool is_aliminclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5336 { return m_aliminclude.is_on (); }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5337 std::string get_aliminclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5338 { return m_aliminclude.current_value (); }
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5339
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5340 bool is_climinclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5341 { return m_climinclude.is_on (); }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5342 std::string get_climinclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5343 { return m_climinclude.current_value (); }
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5344
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5345 // See the genprops.awk script for an explanation of the
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5346 // properties declarations.
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5347 // Programming note: Keep property list sorted if new ones are added.
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5348
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5349 BEGIN_PROPERTIES (scatter)
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5350 array_property annotation , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5351 array_property cdata mu , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5352 radio_property cdatamode u , "{auto}|manual"
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5353 string_property cdatasource , ""
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5354 array_property datatiptemplate , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5355 string_property displayname , ""
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5356 array_property latitudedata , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5357 string_property latitudedatasource , ""
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5358 double_property linewidth , 0.5
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5359 array_property longitudedata , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5360 string_property longitudedatasource , ""
30253
20fd3c03fd74 Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents: 30155
diff changeset
5361 radio_property marker , "{o}|+|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram|none"
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5362 double_property markeredgealpha , 1.0
28414
04349a21c750 Implement "none" for scatter "markeredgecolor" property (bug #58508)
Rik <rik@octave.org>
parents: 28348
diff changeset
5363 color_property markeredgecolor , color_property (radio_values ("{flat}|none"), color_values (0, 0, 0))
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5364 double_property markerfacealpha , 1.0
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5365 color_property markerfacecolor , color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0))
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5366 array_property rdata , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5367 string_property rdatasource , ""
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5368 array_property seriesindex u , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5369 array_property sizedata u , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5370 string_property sizedatasource , ""
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5371 array_property thetadata , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5372 string_property thetadatasource , ""
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5373 array_property xdata u , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5374 string_property xdatasource , ""
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5375 array_property ydata u , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5376 string_property ydatasource , ""
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5377 array_property zdata u , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5378 string_property zdatasource , ""
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5379
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5380 // hidden properties for limit computation
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5381 row_vector_property alim hlr , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5382 row_vector_property clim hlr , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5383 row_vector_property xlim hlr , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5384 row_vector_property ylim hlr , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5385 row_vector_property zlim hlr , Matrix ()
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5386 bool_property aliminclude hlg , "on"
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5387 bool_property climinclude hlg , "on"
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5388 bool_property xliminclude hl , "on"
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5389 bool_property yliminclude hl , "on"
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5390 bool_property zliminclude hl , "on"
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5391 END_PROPERTIES
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5392
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5393 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5394 void init ()
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5395 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5396 m_xdata.add_constraint (dim_vector (-1, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5397 m_xdata.add_constraint (dim_vector (1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5398 m_xdata.add_constraint (dim_vector (-1, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5399 m_xdata.add_constraint (dim_vector (0, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5400 m_ydata.add_constraint (dim_vector (-1, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5401 m_ydata.add_constraint (dim_vector (1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5402 m_ydata.add_constraint (dim_vector (-1, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5403 m_ydata.add_constraint (dim_vector (0, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5404 m_zdata.add_constraint (dim_vector (-1, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5405 m_zdata.add_constraint (dim_vector (1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5406 m_zdata.add_constraint (dim_vector (-1, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5407 m_zdata.add_constraint (dim_vector (0, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5408 m_sizedata.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5409 m_sizedata.add_constraint (dim_vector (-1, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5410 m_sizedata.add_constraint (dim_vector (1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5411 m_sizedata.add_constraint (dim_vector (-1, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5412 m_sizedata.add_constraint (dim_vector (0, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5413 m_cdata.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5414 m_cdata.add_constraint ("single");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5415 m_cdata.add_constraint ("logical");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5416 m_cdata.add_constraint ("int8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5417 m_cdata.add_constraint ("int16");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5418 m_cdata.add_constraint ("int32");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5419 m_cdata.add_constraint ("int64");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5420 m_cdata.add_constraint ("uint8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5421 m_cdata.add_constraint ("uint16");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5422 m_cdata.add_constraint ("uint32");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5423 m_cdata.add_constraint ("uint64");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5424 m_cdata.add_constraint ("real");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5425 m_cdata.add_constraint (dim_vector (-1, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5426 m_cdata.add_constraint (dim_vector (-1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5427 m_cdata.add_constraint (dim_vector (-1, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5428 m_cdata.add_constraint (dim_vector (0, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5429
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5430 m_linewidth.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5431 m_seriesindex.add_constraint (dim_vector (1, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5432 m_seriesindex.add_constraint (dim_vector (-1, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5433 m_seriesindex.add_constraint (dim_vector (0, -1));
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5434 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5435
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5436 public:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5437 OCTINTERP_API void update_color ();
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5438
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5439 private:
30040
805357e6b058 maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents: 29993
diff changeset
5440 std::string m_bad_data_msg;
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5441
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5442 void update_xdata ()
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5443 {
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5444 if (get_xdata ().isempty ())
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5445 {
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5446 // For compatibility with Matlab behavior,
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5447 // if x/ydata are set empty, silently empty other *data properties.
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5448 set_ydata (Matrix ());
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5449 set_zdata (Matrix ());
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5450 bool cdatamode_auto = m_cdatamode.is ("auto");
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5451 set_cdata (Matrix ());
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5452 if (cdatamode_auto)
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5453 set_cdatamode ("auto");
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5454 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5455
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5456 set_xlim (m_xdata.get_limits ());
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5457
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5458 update_data ();
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5459 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5460
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5461 void update_ydata ()
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5462 {
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5463 if (get_ydata ().isempty ())
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5464 {
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5465 set_xdata (Matrix ());
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5466 set_zdata (Matrix ());
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5467 bool cdatamode_auto = m_cdatamode.is ("auto");
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5468 set_cdata (Matrix ());
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5469 if (cdatamode_auto)
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5470 set_cdatamode ("auto");
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5471 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5472
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5473 set_ylim (m_ydata.get_limits ());
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5474
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5475 update_data ();
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5476 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5477
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5478 void update_zdata ()
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5479 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5480 set_zlim (m_zdata.get_limits ());
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5481
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5482 update_data ();
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5483 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5484
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5485 void update_sizedata ()
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5486 {
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5487 update_data ();
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5488 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5489
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5490 void update_cdata ()
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5491 {
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5492 if (get_cdata ().matrix_value ().rows () == 1)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5493 set_clim (m_cdata.get_limits ());
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5494 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5495 m_clim = m_cdata.get_limits ();
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5496
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5497 update_data ();
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5498 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5499
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5500 void update_cdatamode ()
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5501 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5502 if (m_cdatamode.is ("auto"))
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5503 update_color ();
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5504 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5505
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5506 void update_seriesindex ()
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5507 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5508 if (m_cdatamode.is ("auto"))
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5509 update_color ();
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5510 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5511
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5512 void update_data ();
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5513
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5514 };
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5515
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5516 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5517 properties m_properties;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5518 property_list m_default_properties;
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5519
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5520 public:
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5521 scatter (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5522 : base_graphics_object (), m_properties (mh, p)
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5523 {
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5524 // FIXME: seriesindex should increment by one each time a new scatter
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5525 // object is added to the axes.
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5526 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5527
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5528 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (scatter)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5529
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5530 ~scatter () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5531
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5532 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5533
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5534 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5535
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5536 bool valid_object () const { return true; }
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5537
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5538 bool has_readonly_property (const caseless_str& pname) const
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5539 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5540 bool retval = m_properties.has_readonly_property (pname);
28286
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5541 if (! retval)
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5542 retval = base_properties::has_readonly_property (pname);
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5543 return retval;
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5544 }
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5545
496735a910c1 Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28282
diff changeset
5546 protected:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5547 OCTINTERP_API void initialize (const graphics_object& go);
25425
107920dd7715 Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25423
diff changeset
5548
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5549 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5550
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5551 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5552
7365
f5e801eee0d1 [project @ 2008-01-13 06:33:32 by jwe]
jwe
parents: 7364
diff changeset
5553 class OCTINTERP_API surface : public base_graphics_object
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5554 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5555 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5556
7821
f79dcba526a8 Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7527
diff changeset
5557 class OCTINTERP_API properties : public base_properties
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5558 {
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5559 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5560
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5561 octave_value get_color_data () const;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5562
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5563 bool is_aliminclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5564 { return (m_aliminclude.is_on () && m_alphadatamapping.is ("scaled")); }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5565 std::string get_aliminclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5566 { return m_aliminclude.current_value (); }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5567
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5568 bool is_climinclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5569 { return (m_climinclude.is_on () && m_cdatamapping.is ("scaled")); }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5570 std::string get_climinclude () const
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5571 { return m_climinclude.current_value (); }
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5572
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5573 OCTINTERP_API bool get_do_lighting () const;
25423
13b1b9a0d9c5 Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents: 25418
diff changeset
5574
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5575 // See the genprops.awk script for an explanation of the
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5576 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5577 // Programming note: Keep property list sorted if new ones are added.
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5578
8247
e41f420875db set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents: 8222
diff changeset
5579 BEGIN_PROPERTIES (surface)
18646
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
5580 array_property alphadata u , Matrix (1, 1, 1.0)
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5581 radio_property alphadatamapping l , "none|direct|{scaled}"
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5582 double_property ambientstrength , 0.3
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5583 radio_property backfacelighting , "unlit|lit|{reverselit}"
18646
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
5584 array_property cdata u , default_surface_cdata ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5585 radio_property cdatamapping al , "{scaled}|direct"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5586 string_property cdatasource , ""
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5587 double_property diffusestrength , 0.6
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5588 string_property displayname , ""
7846
d7737a4268b7 Fix typos in property names (edgealpha/facealpha).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7844
diff changeset
5589 double_radio_property edgealpha , double_radio_property (1.0, radio_values ("flat|interp"))
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5590 color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp"))
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5591 radio_property edgelighting u , "{none}|flat|gouraud|phong"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5592 double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp|texturemap"))
17645
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
5593 color_property facecolor , color_property (radio_values ("none|{flat}|interp|texturemap"), color_values (0, 0, 0))
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5594 radio_property facelighting u , "none|{flat}|gouraud|phong"
21654
a0ebc922fd52 Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents: 21568
diff changeset
5595 array_property facenormals m , Matrix ()
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5596 radio_property facenormalsmode u , "{auto}|manual"
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5597 radio_property linestyle , "{-}|--|:|-.|none"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5598 double_property linewidth , 0.5
30253
20fd3c03fd74 Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents: 30155
diff changeset
5599 radio_property marker , "{none}|+|o|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram"
17645
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
5600 color_property markeredgecolor , color_property (radio_values ("none|{auto}|flat"), color_values (0, 0, 0))
85a057ad1ba6 Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents: 17631
diff changeset
5601 color_property markerfacecolor , color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0))
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5602 double_property markersize , 6
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5603 radio_property meshstyle , "{both}|row|column"
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5604 double_property specularcolorreflectance , 1
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5605 double_property specularexponent , 10
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5606 double_property specularstrength , 0.9
21654
a0ebc922fd52 Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents: 21568
diff changeset
5607 array_property vertexnormals m , Matrix ()
a0ebc922fd52 Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents: 21568
diff changeset
5608 radio_property vertexnormalsmode u , "{auto}|manual"
18646
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
5609 array_property xdata u , default_surface_xdata ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5610 string_property xdatasource , ""
18646
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
5611 array_property ydata u , default_surface_ydata ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5612 string_property ydatasource , ""
18646
2deed6538c72 Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents: 18645
diff changeset
5613 array_property zdata u , default_surface_zdata ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5614 string_property zdatasource , ""
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5615
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5616 // hidden properties for limit computation
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5617 row_vector_property alim hlr , Matrix ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5618 row_vector_property clim hlr , Matrix ()
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5619 row_vector_property xlim hlr , Matrix ()
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5620 row_vector_property ylim hlr , Matrix ()
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5621 row_vector_property zlim hlr , Matrix ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5622 bool_property aliminclude hlg , "on"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5623 bool_property climinclude hlg , "on"
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5624 bool_property xliminclude hl , "on"
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5625 bool_property yliminclude hl , "on"
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5626 bool_property zliminclude hl , "on"
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5627 END_PROPERTIES
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5628
7363
c31e5dab4f85 [project @ 2008-01-12 08:21:57 by jwe]
jwe
parents: 7307
diff changeset
5629 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5630 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5631 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5632 m_xdata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5633 m_ydata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5634 m_zdata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5635 m_cdata.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5636 m_cdata.add_constraint ("single");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5637 m_cdata.add_constraint ("logical");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5638 m_cdata.add_constraint ("int8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5639 m_cdata.add_constraint ("int16");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5640 m_cdata.add_constraint ("int32");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5641 m_cdata.add_constraint ("int64");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5642 m_cdata.add_constraint ("uint8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5643 m_cdata.add_constraint ("uint16");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5644 m_cdata.add_constraint ("uint32");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5645 m_cdata.add_constraint ("uint64");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5646 m_cdata.add_constraint ("real");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5647 m_cdata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5648 m_cdata.add_constraint (dim_vector (-1, -1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5649 m_alphadata.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5650 m_alphadata.add_constraint ("uint8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5651 m_alphadata.add_constraint (dim_vector (-1, -1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5652 m_facenormals.add_constraint (dim_vector (-1, -1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5653 m_facenormals.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5654 m_vertexnormals.add_constraint (dim_vector (-1, -1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5655 m_vertexnormals.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5656
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5657 m_ambientstrength.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5658 m_ambientstrength.add_constraint ("max", 1.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5659 m_diffusestrength.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5660 m_diffusestrength.add_constraint ("max", 1.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5661 m_linewidth.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5662 m_markersize.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5663 m_specularcolorreflectance.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5664 m_specularcolorreflectance.add_constraint ("max", 1.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5665 m_specularexponent.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5666 m_specularstrength.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5667 m_specularstrength.add_constraint ("max", 1.0, true);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5668 }
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5669
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5670 public:
26018
50583f514ae4 Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25991
diff changeset
5671 void update_normals (bool reset, bool force = false)
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5672 {
26018
50583f514ae4 Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25991
diff changeset
5673 update_face_normals (reset, force);
50583f514ae4 Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25991
diff changeset
5674 update_vertex_normals (reset, force);
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5675 }
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5676
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5677
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5678 private:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5679 void update_alphadata ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5680 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5681 if (alphadatamapping_is ("scaled"))
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5682 set_alim (m_alphadata.get_limits ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5683 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5684 m_alim = m_alphadata.get_limits ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5685 }
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5686
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5687 void update_cdata ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5688 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5689 if (cdatamapping_is ("scaled"))
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5690 set_clim (m_cdata.get_limits ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5691 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5692 m_clim = m_cdata.get_limits ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5693 }
7829
8ca8e97e8c0a Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7828
diff changeset
5694
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5695 void update_xdata ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5696 {
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5697 update_normals (true);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5698 set_xlim (m_xdata.get_limits ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5699 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
5700
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5701 void update_ydata ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5702 {
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5703 update_normals (true);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5704 set_ylim (m_ydata.get_limits ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5705 }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5706
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5707 void update_zdata ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5708 {
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5709 update_normals (true);
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5710 set_zlim (m_zdata.get_limits ());
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5711 }
7862
8f3459a90bf3 Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7860
diff changeset
5712
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5713 OCTINTERP_API void update_face_normals (bool reset, bool force = false);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5714 OCTINTERP_API void update_vertex_normals (bool reset, bool force = false);
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5715
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5716 void update_facenormalsmode ()
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5717 { update_face_normals (false); }
21654
a0ebc922fd52 Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents: 21568
diff changeset
5718
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5719 void update_vertexnormalsmode ()
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5720 { update_vertex_normals (false); }
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5721
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5722 void update_edgelighting ()
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5723 { update_normals (false); }
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5724
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5725 void update_facelighting ()
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5726 { update_normals (false); }
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5727
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5728 void update_visible ()
26045
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5729 {
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5730 if (is_visible ())
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5731 update_normals (false);
10145b9ad883 Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26037
diff changeset
5732 }
25867
49ffa78f9243 Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents: 25449
diff changeset
5733
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5734 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5735
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5736 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5737 properties m_properties;
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5738
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5739 public:
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5740 surface (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5741 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
5742 { }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5743
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5744 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (surface)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5745
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5746 ~surface () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5747
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5748 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5749
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5750 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5751
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5752 bool valid_object () const { return true; }
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5753
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5754 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5755 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5756 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5757 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5758 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5759 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5760 }
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5761 };
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
5762
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5763 // ---------------------------------------------------------------------
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5764
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5765 class OCTINTERP_API hggroup : public base_graphics_object
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5766 {
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5767 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5768
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5769 class OCTINTERP_API properties : public base_properties
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5770 {
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5771 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5772
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5773 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5774 remove_child (const graphics_handle& h, bool from_root = false);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5775
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5776 OCTINTERP_API void adopt (const graphics_handle& h);
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5777
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5778 // See the genprops.awk script for an explanation of the
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5779 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5780 // Programming note: Keep property list sorted if new ones are added.
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5781
8247
e41f420875db set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents: 8222
diff changeset
5782 BEGIN_PROPERTIES (hggroup)
15519
f915996325b7 Add missing DisplayName and EraseMode properties to hggroups (bug #37442)
Ben Abbott <bpabbott@mac.com>
parents: 15468
diff changeset
5783 string_property displayname , ""
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5784
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5785 // hidden properties for limit computation
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5786 row_vector_property alim hr , Matrix ()
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5787 row_vector_property clim hr , Matrix ()
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
5788 row_vector_property xlim hr , Matrix ()
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
5789 row_vector_property ylim hr , Matrix ()
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
5790 row_vector_property zlim hr , Matrix ()
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5791 bool_property aliminclude h , "on"
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5792 bool_property climinclude h , "on"
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5793 bool_property xliminclude h , "on"
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5794 bool_property yliminclude h , "on"
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5795 bool_property zliminclude h , "on"
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5796 END_PROPERTIES
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5797
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5798 private:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5799 OCTINTERP_API void update_limits () const;
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5800
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5801 OCTINTERP_API void update_limits (const graphics_handle& h) const;
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5802
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5803 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5804 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5805 { }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
5806
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5807 };
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5808
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5809 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5810 properties m_properties;
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5811
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5812 public:
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5813 hggroup (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5814 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
5815 { }
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5816
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5817 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (hggroup)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5818
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5819 ~hggroup () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5820
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5821 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5822
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5823 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5824
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5825 bool valid_object () const { return true; }
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
5826
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5827 OCTINTERP_API void update_axis_limits (const std::string& axis_type);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5828
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5829 OCTINTERP_API void update_axis_limits (const std::string& axis_type,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5830 const graphics_handle& h);
11175
c0a95a5c6d25 Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents: 11167
diff changeset
5831
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5832 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5833 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5834 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5835 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5836 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5837 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5838 }
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5839
7865
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5840 };
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5841
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5842 // ---------------------------------------------------------------------
b74039822fd2 Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents: 7864
diff changeset
5843
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5844 class OCTINTERP_API uimenu : public base_graphics_object
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5845 {
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5846 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5847
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5848 class OCTINTERP_API properties : public base_properties
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5849 {
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5850 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5851
26930
ead8f91c5556 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26918
diff changeset
5852 void remove_child (const graphics_handle& h, bool from_root = false)
26982
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
5853 {
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
5854 base_properties::remove_child (h, from_root);
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
5855 }
8d7265e353a0 Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26878
diff changeset
5856
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5857 void adopt (const graphics_handle& h)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5858 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5859 base_properties::adopt (h);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5860 }
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5861
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5862 // See the genprops.awk script for an explanation of the
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5863 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5864 // Programming note: Keep property list sorted if new ones are added.
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5865
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5866 BEGIN_PROPERTIES (uimenu)
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5867 string_property accelerator , ""
30999
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5868 // Deprecated in R2017b (replaced by "MenuSelectedFcn")
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5869 callback_property callback hgs , Matrix ()
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5870 bool_property checked , "off"
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5871 bool_property enable , "on"
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5872 color_property foregroundcolor , color_values (0, 0, 0)
30999
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5873 // Deprecated in R2017b (replaced by "Text")
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5874 string_property label hgs , ""
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5875 callback_property menuselectedfcn , Matrix ()
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5876 // Deprecated in R2017b, but replacement of re-ordering "children"
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5877 // property of parent does not work yet in Octave.
20045
ae12edf69bce Set default uimenu position property to 0 (Bug #44770)
John Donoghue
parents: 19987
diff changeset
5878 double_property position , 0
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5879 bool_property separator , "off"
29913
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5880 string_property text , ""
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
5881
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5882 // Octave-specific properties
22622
4191f8b5070c Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents: 22407
diff changeset
5883 string_property __fltk_label__ h , ""
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
5884 any_property __object__ h , Matrix ()
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5885 END_PROPERTIES
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5886
30999
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5887 // Make "Label" an alias for "Text".
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5888 std::string get_label () const
29913
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5889 {
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5890 return get_text ();
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5891 }
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5892
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5893 void set_label (const octave_value& val)
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5894 {
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5895 set_text (val);
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5896 }
3eca54836f97 Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents: 29889
diff changeset
5897
30999
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5898 // Make "Callback" an alias for "MenuSelectedFcn".
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5899 octave_value get_callback () const
30999
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5900 {
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5901 return get_menuselectedfcn ();
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5902 }
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5903
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5904 void set_callback (const octave_value& val)
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5905 {
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5906 set_menuselectedfcn (val);
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5907 }
fef2957c38ec Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents: 30994
diff changeset
5908
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5909 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5910 void init ()
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
5911 {
30993
63710f3bd981 Stop incorrect error when reset() called on uimenu handle (bug #62425)
Rik <rik@octave.org>
parents: 30564
diff changeset
5912 m_position.add_constraint ("min", 0, true);
22831
96228c17a66a Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents: 22759
diff changeset
5913 }
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5914 };
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5915
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5916 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5917 properties m_properties;
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5918
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5919 public:
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5920 uimenu (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5921 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
5922 { }
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5923
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5924 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uimenu)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5925
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5926 ~uimenu () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5927
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5928 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5929
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5930 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5931
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5932 bool valid_object () const { return true; }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11577
diff changeset
5933
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5934 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5935 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5936 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5937 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5938 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5939 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5940 }
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
5941
11155
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5942 };
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5943
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5944 // ---------------------------------------------------------------------
f0e9befd6a1c add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents: 11089
diff changeset
5945
28298
e55ff14249c3 Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28286
diff changeset
5946 // FIXME: This class has been renamed to "contextmenu" in Matlab R2020a.
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5947 class OCTINTERP_API uicontextmenu : public base_graphics_object
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5948 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5949 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
5950
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5951 class OCTINTERP_API properties : public base_properties
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5952 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5953 public:
20181
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20171
diff changeset
5954
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20171
diff changeset
5955 void add_dependent_obj (graphics_handle gh)
30040
805357e6b058 maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents: 29993
diff changeset
5956 { m_dependent_obj_list.push_back (gh); }
20077
69f92e0affd2 Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20051
diff changeset
5957
20181
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20171
diff changeset
5958 // FIXME: the list may contain duplicates.
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20171
diff changeset
5959 // Should we return only unique elements?
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5960 const std::list<graphics_handle> get_dependent_obj_list ()
30040
805357e6b058 maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents: 29993
diff changeset
5961 { return m_dependent_obj_list; }
20077
69f92e0affd2 Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20051
diff changeset
5962
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5963 // See the genprops.awk script for an explanation of the
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5964 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
5965 // Programming note: Keep property list sorted if new ones are added.
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5966
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5967 BEGIN_PROPERTIES (uicontextmenu)
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
5968 callback_property callback , Matrix ()
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5969 array_property position , Matrix (1, 2, 0.0)
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
5970
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
5971 // Octave-specific properties
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
5972 any_property __object__ h , Matrix ()
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5973 END_PROPERTIES
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5974
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5975 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5976 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5977 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5978 m_position.add_constraint (dim_vector (1, 2));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5979 m_position.add_constraint (dim_vector (2, 1));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5980 m_visible.set (octave_value (false));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
5981 }
20077
69f92e0affd2 Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20051
diff changeset
5982
69f92e0affd2 Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20051
diff changeset
5983 private:
69f92e0affd2 Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20051
diff changeset
5984 // List of objects that might depend on this uicontextmenu object
30040
805357e6b058 maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents: 29993
diff changeset
5985 std::list<graphics_handle> m_dependent_obj_list;
29014
df307ee1fb30 Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 28346
diff changeset
5986
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
5987 OCTINTERP_API void update_beingdeleted ();
29014
df307ee1fb30 Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 28346
diff changeset
5988
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5989 };
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5990
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5991 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5992 properties m_properties;
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5993
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5994 public:
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5995 uicontextmenu (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
5996 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
5997 { }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
5998
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
5999 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uicontextmenu)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6000
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6001 ~uicontextmenu () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6002
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6003 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6004
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6005 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6006
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6007 bool valid_object () const { return true; }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6008
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6009 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6010 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6011 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6012 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6013 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6014 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6015 }
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6016
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6017 };
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6018
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6019 // ---------------------------------------------------------------------
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6020
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6021 class OCTINTERP_API uicontrol : public base_graphics_object
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6022 {
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6023 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6024
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6025 class OCTINTERP_API properties : public base_properties
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6026 {
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6027 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6028
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6029 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6030 get_boundingbox (bool internal = false,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6031 const Matrix& parent_pix_size = Matrix ()) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6032
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6033 OCTINTERP_API double
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6034 get___fontsize_points__ (double box_pix_height = 0) const;
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6035
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6036 // See the genprops.awk script for an explanation of the
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6037 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
6038 // Programming note: Keep property list sorted if new ones are added.
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6039
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6040 BEGIN_PROPERTIES (uicontrol)
25429
ecc488aa56a0 Change default ui* objects color for compatibility (bug #53805)
Guillaume Flandin <guillaume.offline@gmail.com>
parents: 25425
diff changeset
6041 color_property backgroundcolor , color_values (0.94, 0.94, 0.94)
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6042 callback_property callback , Matrix ()
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6043 array_property cdata , Matrix ()
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6044 bool_property clipping , "on"
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6045 radio_property enable , "{on}|inactive|off"
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6046 array_property extent rG , Matrix (1, 4, 0.0)
28079
999351c323ce remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
6047 radio_property fontangle u , "{normal}|italic"
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6048 string_property fontname u , OCTAVE_DEFAULT_FONTNAME
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6049 double_property fontsize u , 10
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6050 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels"
26275
dd97dc559679 maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents: 26194
diff changeset
6051 radio_property fontweight u , "{normal}|bold"
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6052 color_property foregroundcolor , color_values (0, 0, 0)
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
6053 radio_property horizontalalignment , "left|{center}|right"
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6054 callback_property keypressfcn , Matrix ()
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6055 double_property listboxtop , 1
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6056 double_property max , 1
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6057 double_property min , 0
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6058 array_property position , default_control_position ()
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6059 array_property sliderstep , default_control_sliderstep ()
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6060 string_array_property string u , ""
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6061 radio_property style S , "{pushbutton}|togglebutton|radiobutton|checkbox|edit|text|slider|frame|listbox|popupmenu"
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6062 string_property tooltipstring , ""
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6063 radio_property units u , "normalized|inches|centimeters|points|{pixels}|characters"
22619
7adc5bbd840a graphics: set uicontrol value default to 0 and handle special cases (Bug #48255)
John D
parents: 22407
diff changeset
6064 row_vector_property value , Matrix (1, 1, 0.0)
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6065 radio_property verticalalignment , "top|{middle}|bottom"
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6066
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6067 // Octave-specific properties
26037
864448a7f347 Don't set keyboard focus on newly created uicontrol objects (bug #54942)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26024
diff changeset
6068 bool_property __focus__ h , "off"
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6069 any_property __object__ h , Matrix ()
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6070 END_PROPERTIES
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6071
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6072 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6073 std::string m_cached_units;
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6074
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6075 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6076 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6077 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6078 m_cdata.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6079 m_cdata.add_constraint ("single");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6080 m_cdata.add_constraint ("uint8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6081 m_cdata.add_constraint (dim_vector (-1, -1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6082 m_cdata.add_constraint (dim_vector (0, 0));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6083 m_position.add_constraint (dim_vector (1, 4));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6084 m_sliderstep.add_constraint (dim_vector (1, 2));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6085 m_fontsize.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6086 m_cached_units = get_units ();
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6087 }
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6088
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6089 OCTINTERP_API void update_text_extent ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6090
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6091 void update_string () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6092 void update_fontname () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6093 void update_fontsize () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6094 void update_fontangle ()
23396
945b53af4655 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 23258
diff changeset
6095 {
945b53af4655 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 23258
diff changeset
6096 update_text_extent ();
23210
3a298e07002c Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23201
diff changeset
6097 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6098 void update_fontweight () { update_text_extent (); }
23210
3a298e07002c Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 23201
diff changeset
6099
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6100 OCTINTERP_API void update_fontunits (const caseless_str& old_units);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6101
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6102 OCTINTERP_API void update_units ();
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6103
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6104 };
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6105
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6106 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6107 properties m_properties;
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6108
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6109 public:
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6110 uicontrol (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6111 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
6112 { }
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6113
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6114 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uicontrol)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6115
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6116 ~uicontrol () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6117
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6118 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6119
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6120 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6121
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6122 bool valid_object () const { return true; }
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6123
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6124 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6125 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6126 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6127 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6128 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6129 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6130 }
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6131 };
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6132
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6133 // ---------------------------------------------------------------------
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6134
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6135 class OCTINTERP_API uibuttongroup : public base_graphics_object
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6136 {
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6137 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6138
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6139 class OCTINTERP_API properties : public base_properties
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6140 {
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6141 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6142
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6143 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6144 remove_child (const graphics_handle& h, bool from_root = false);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6145
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6146 OCTINTERP_API void adopt (const graphics_handle& h);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6147
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6148 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6149 get_boundingbox (bool internal = false,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6150 const Matrix& parent_pix_size = Matrix ()) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6151
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6152 OCTINTERP_API double
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6153 get___fontsize_points__ (double box_pix_height = 0) const;
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6154
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6155 // See the genprops.awk script for an explanation of the
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6156 // properties declarations.
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6157 // Programming note: Keep property list sorted if new ones are added.
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6158
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6159 BEGIN_PROPERTIES (uibuttongroup)
25429
ecc488aa56a0 Change default ui* objects color for compatibility (bug #53805)
Guillaume Flandin <guillaume.offline@gmail.com>
parents: 25425
diff changeset
6160 color_property backgroundcolor , color_values (0.94, 0.94, 0.94)
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6161 radio_property bordertype , "none|{etchedin}|etchedout|beveledin|beveledout|line"
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6162 double_property borderwidth , 1
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6163 bool_property clipping , "on"
28079
999351c323ce remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
6164 radio_property fontangle , "{normal}|italic"
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6165 string_property fontname , OCTAVE_DEFAULT_FONTNAME
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6166 double_property fontsize , 10
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6167 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels"
26275
dd97dc559679 maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents: 26194
diff changeset
6168 radio_property fontweight , "{normal}|bold"
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6169 color_property foregroundcolor , color_values (0, 0, 0)
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6170 color_property highlightcolor , color_values (1, 1, 1)
26194
4f1b3651fa5f Implement "SizeChangedFcn" for uipanel and uibuttongroup (bug #55085).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26185
diff changeset
6171 array_property position S , default_panel_position ()
26129
3c61c8137664 Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents: 26125
diff changeset
6172 // FIXME: "resizefcn" is no longer recommended by Matlab,
3c61c8137664 Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents: 26125
diff changeset
6173 // and has been replaced with "sizechangedfcn"
3c61c8137664 Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents: 26125
diff changeset
6174 // Eventually this will need to be hidden, and then removed.
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6175 callback_property resizefcn , Matrix ()
24120
0d446e938f1f maint: clean up code formatting in generated graphics.h
Mike Miller <mtmiller@octave.org>
parents: 24071
diff changeset
6176 handle_property selectedobject S , graphics_handle ()
0d446e938f1f maint: clean up code formatting in generated graphics.h
Mike Miller <mtmiller@octave.org>
parents: 24071
diff changeset
6177 callback_property selectionchangedfcn , Matrix ()
25449
d2d9701d2dcb Change default ShadowColor property to match Matlab (bug #53805).
Rik <rik@octave.org>
parents: 25436
diff changeset
6178 color_property shadowcolor , color_values (0.7, 0.7, 0.7)
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6179 callback_property sizechangedfcn , Matrix ()
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6180 radio_property units S , "{normalized}|inches|centimeters|points|pixels|characters"
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6181 string_property title , ""
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6182 radio_property titleposition , "{lefttop}|centertop|righttop|leftbottom|centerbottom|rightbottom"
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6183
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6184 // Octave-specific properties
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6185 any_property __object__ h , Matrix ()
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6186 END_PROPERTIES
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6187
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6188 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6189 void init ()
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6190 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6191 m_position.add_constraint (dim_vector (1, 4));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6192 m_borderwidth.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6193 m_fontsize.add_constraint ("min", 0.0, false);
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6194 }
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6195
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6196 // void update_text_extent ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6197 // void update_string () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6198 // void update_fontname () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6199 // void update_fontsize () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6200 // void update_fontangle () { update_text_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6201 // void update_fontweight () { update_fontweight (); }
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6202
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6203 OCTINTERP_API void update_units (const caseless_str& old_units);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6204 OCTINTERP_API void update_fontunits (const caseless_str& old_units);
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6205
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6206 };
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6207
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6208 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6209 properties m_properties;
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6210
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6211 public:
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6212 uibuttongroup (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6213 : base_graphics_object (), m_properties (mh, p)
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6214 { }
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6215
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6216 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uibuttongroup)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6217
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6218 ~uibuttongroup () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6219
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6220 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6221
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6222 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6223
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6224 bool valid_object () const { return true; }
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6225
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6226 bool has_readonly_property (const caseless_str& pname) const
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6227 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6228 bool retval = m_properties.has_readonly_property (pname);
21824
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6229 if (! retval)
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6230 retval = base_properties::has_readonly_property (pname);
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6231 return retval;
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6232 }
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6233
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6234 };
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6235
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6236 // ---------------------------------------------------------------------
6780a8657be3 Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents: 21789
diff changeset
6237
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6238 class OCTINTERP_API uipanel : public base_graphics_object
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6239 {
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6240 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6241
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6242 class OCTINTERP_API properties : public base_properties
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6243 {
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6244 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6245
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6246 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6247 get_boundingbox (bool internal = false,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6248 const Matrix& parent_pix_size = Matrix ()) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6249
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6250 OCTINTERP_API double
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6251 get___fontsize_points__ (double box_pix_height = 0) const;
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6252
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6253 // See the genprops.awk script for an explanation of the
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6254 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
6255 // Programming note: Keep property list sorted if new ones are added.
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6256
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6257 BEGIN_PROPERTIES (uipanel)
25429
ecc488aa56a0 Change default ui* objects color for compatibility (bug #53805)
Guillaume Flandin <guillaume.offline@gmail.com>
parents: 25425
diff changeset
6258 color_property backgroundcolor , color_values (0.94, 0.94, 0.94)
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6259 radio_property bordertype , "none|{etchedin}|etchedout|beveledin|beveledout|line"
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6260 double_property borderwidth , 1
28079
999351c323ce remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
6261 radio_property fontangle , "{normal}|italic"
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6262 string_property fontname , OCTAVE_DEFAULT_FONTNAME
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6263 double_property fontsize , 10
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6264 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels"
26275
dd97dc559679 maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents: 26194
diff changeset
6265 radio_property fontweight , "{normal}|bold"
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6266 color_property foregroundcolor , color_values (0, 0, 0)
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6267 color_property highlightcolor , color_values (1, 1, 1)
26194
4f1b3651fa5f Implement "SizeChangedFcn" for uipanel and uibuttongroup (bug #55085).
Markus Mützel <markus.muetzel@gmx.de>
parents: 26185
diff changeset
6268 array_property position S , default_panel_position ()
26129
3c61c8137664 Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents: 26125
diff changeset
6269 // FIXME: "resizefcn" is no longer recommended by Matlab,
3c61c8137664 Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents: 26125
diff changeset
6270 // and has been replaced with "sizechangedfcn"
3c61c8137664 Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents: 26125
diff changeset
6271 // Eventually this will need to be hidden, and then removed.
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6272 callback_property resizefcn , Matrix ()
25449
d2d9701d2dcb Change default ShadowColor property to match Matlab (bug #53805).
Rik <rik@octave.org>
parents: 25436
diff changeset
6273 color_property shadowcolor , color_values (0.7, 0.7, 0.7)
26129
3c61c8137664 Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents: 26125
diff changeset
6274 callback_property sizechangedfcn , Matrix ()
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6275 string_property title , ""
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6276 radio_property titleposition , "{lefttop}|centertop|righttop|leftbottom|centerbottom|rightbottom"
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6277 radio_property units S , "{normalized}|inches|centimeters|points|pixels|characters"
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6278 // Octave-specific properties
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6279 any_property __object__ h , Matrix ()
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6280 END_PROPERTIES
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6282 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6283 void init ()
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
6284 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6285 m_borderwidth.add_constraint ("min", 0.0, true);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6286 m_fontsize.add_constraint ("min", 0.0, false);
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6287 m_position.add_constraint (dim_vector (1, 4));
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19834
diff changeset
6288 }
19593
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 18819
diff changeset
6289
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6290 OCTINTERP_API void update_units (const caseless_str& old_units);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6291 OCTINTERP_API void update_fontunits (const caseless_str& old_units);
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6292
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6293 };
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6294
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6295 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6296 properties m_properties;
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6297
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6298 public:
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6299 uipanel (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6300 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
6301 { }
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6302
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6303 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uipanel)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6304
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6305 ~uipanel () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6306
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6307 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6308
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6309 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6310
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6311 bool valid_object () const { return true; }
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6312
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6313 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6314 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6315 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6316 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6317 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6318 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6319 }
13281
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6320 };
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6321
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6322 // ---------------------------------------------------------------------
834f904a3dcb Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13236
diff changeset
6323
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6324 class OCTINTERP_API uitable : public base_graphics_object
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6325 {
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6326 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6327
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6328 class OCTINTERP_API properties : public base_properties
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6329 {
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6330 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6331
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6332 OCTINTERP_API Matrix
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6333 get_boundingbox (bool internal = false,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6334 const Matrix& parent_pix_size = Matrix ()) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6335
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6336 OCTINTERP_API double
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6337 get___fontsize_points__ (double box_pix_height = 0) const;
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6338
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6339 OCTINTERP_API double
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6340 get_fontsize_pixels (double box_pix_height = 0) const;
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6341
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6342 // See the genprops.awk script for an explanation of the
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6343 // properties declarations.
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6344 // Programming note: Keep property list sorted if new ones are added.
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6345
26122
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
6346 // FIXME: keypressfcn, keyreleasefcn, rearrangeablecolumns properties
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
6347 // seem to have been removed from Matlab.
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
6348
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6349 BEGIN_PROPERTIES (uitable)
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6350 any_property __object__ h , Matrix ()
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6351 array_property backgroundcolor , default_table_backgroundcolor ()
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6352 callback_property celleditcallback , Matrix ()
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6353 callback_property cellselectioncallback , Matrix ()
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6354 row_vector_property columneditable , Matrix ()
26122
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
6355 any_property columnformat S , Cell ()
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6356 any_property columnname , "numbered"
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6357 any_property columnwidth S , "auto"
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6358 any_property data u , Matrix ()
26122
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
6359 bool_property enable , "on"
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6360 array_property extent rG , Matrix (1, 4, 0.0)
28079
999351c323ce remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
6361 radio_property fontangle u , "{normal}|italic"
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6362 string_property fontname u , OCTAVE_DEFAULT_FONTNAME
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6363 double_property fontsize u , 10
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6364 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels"
26275
dd97dc559679 maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents: 26194
diff changeset
6365 radio_property fontweight u , "{normal}|bold"
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6366 color_property foregroundcolor , color_values (0, 0, 0)
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6367 callback_property keypressfcn , Matrix ()
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6368 callback_property keyreleasefcn , Matrix ()
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6369 array_property position , default_table_position ()
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6370 bool_property rearrangeablecolumns , "off"
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6371 any_property rowname , "numbered"
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6372 bool_property rowstriping , "on"
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6373 string_property tooltipstring , ""
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6374 radio_property units S , "normalized|inches|centimeters|points|{pixels}|characters"
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6375 END_PROPERTIES
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6376
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6377 OCTINTERP_API Matrix get_extent_matrix () const;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6378
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6379 OCTINTERP_API Matrix get_backgroundcolor_rgb ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6380
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6381 OCTINTERP_API Matrix get_alternatebackgroundcolor_rgb ();
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6382
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6383 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6384 void init ()
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6385 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6386 m_position.add_constraint (dim_vector (1, 4));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6387 m_extent.add_constraint (dim_vector (1, 4));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6388 m_backgroundcolor.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6389 m_backgroundcolor.add_constraint (dim_vector (-1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6390 m_columneditable.add_constraint ("logical");
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6391 }
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6392
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6393 OCTINTERP_API void update_units (const caseless_str& old_units);
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6394 OCTINTERP_API void update_fontunits (const caseless_str& old_units);
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6395 void update_table_extent () { };
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6396 void update_data () { update_table_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6397 void update_fontname () { update_table_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6398 void update_fontsize () { update_table_extent (); }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6399 void update_fontangle ()
26122
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
6400 {
26275
dd97dc559679 maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents: 26194
diff changeset
6401 update_table_extent ();
26122
4d1c6c60f6b3 Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents: 26112
diff changeset
6402 }
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6403 void update_fontweight () { update_table_extent (); }
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6404 };
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6405
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6406 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6407 properties m_properties;
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6408
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6409 public:
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6410 uitable (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6411 : base_graphics_object (), m_properties (mh, p)
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6412 { }
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6413
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6414 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uitable)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6415
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6416 ~uitable () = default;
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6417
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6418 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6419
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6420 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6421
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6422 bool valid_object () const { return true; }
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6423
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6424 bool has_readonly_property (const caseless_str& pname) const
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6425 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6426 bool retval = m_properties.has_readonly_property (pname);
26112
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6427 if (! retval)
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6428 retval = base_properties::has_readonly_property (pname);
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6429 return retval;
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6430 }
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6431 };
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6432
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6433 // ---------------------------------------------------------------------
36e0e5b428e7 Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents: 26107
diff changeset
6434
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6435 class OCTINTERP_API uitoolbar : public base_graphics_object
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6436 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6437 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6438
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6439 class OCTINTERP_API properties : public base_properties
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6440 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6441 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6442
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6443 // See the genprops.awk script for an explanation of the
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6444 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
6445 // Programming note: Keep property list sorted if new ones are added.
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6446
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6447 BEGIN_PROPERTIES (uitoolbar)
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6448 // Octave-specific properties
20593
3af34e1ef330 Preliminary inclusion of uixx objects properties in the manual (bug #46076)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20545
diff changeset
6449 any_property __object__ h , Matrix ()
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6450 END_PROPERTIES
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6451
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6452 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6453 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6454 { }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6455 };
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6456
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6457 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6458 properties m_properties;
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6459
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6460 public:
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6461 uitoolbar (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6462 : base_graphics_object (), m_properties (mh, p), m_default_properties ()
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
6463 { }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6464
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6465 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uitoolbar)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6466
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6467 ~uitoolbar () = default;
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6468
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6469 void override_defaults (base_graphics_object& obj)
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6470 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6471 // Allow parent (figure) to override first (properties knows how
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6472 // to find the parent object).
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6473 m_properties.override_defaults (obj);
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6474
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6475 // Now override with our defaults. If the default_properties
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6476 // list includes the properties for all defaults (line,
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6477 // surface, etc.) then we don't have to know the type of OBJ
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6478 // here, we just call its set function and let it decide which
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6479 // properties from the list to use.
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6480 obj.set_from_list (m_default_properties);
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6481 }
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6482
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6483 void set (const caseless_str& name, const octave_value& value)
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6484 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6485 if (name.compare ("default", 7))
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6486 // strip "default", pass rest to function that will
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6487 // parse the remainder and add the element to the
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6488 // default_properties map.
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6489 m_default_properties.set (name.substr (7), value);
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6490 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6491 m_properties.set (name, value);
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6492 }
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6493
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6494 octave_value get (const caseless_str& name) const
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6495 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6496 octave_value retval;
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6497
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6498 if (name.compare ("default", 7))
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6499 retval = get_default (name.substr (7));
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6500 else
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6501 retval = m_properties.get (name);
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6502
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6503 return retval;
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6504 }
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6505
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6506 OCTINTERP_API octave_value get_default (const caseless_str& name) const;
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6507
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6508 octave_value get_defaults () const
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6509 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6510 return m_default_properties.as_struct ("default");
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6511 }
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6512
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6513 property_list get_defaults_list () const
19666
e7df12f37f71 Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 19663
diff changeset
6514 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6515 return m_default_properties;
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6516 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6517
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6518 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6519
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6520 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6521
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6522 bool valid_object () const { return true; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6523
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6524 OCTINTERP_API void reset_default_properties ();
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6525
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6526 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6527 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6528 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6529 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6530 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6531 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6532 }
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6533
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6534 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6535 property_list m_default_properties;
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6536 };
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6537
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6538 // ---------------------------------------------------------------------
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6539
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6540 class OCTINTERP_API uipushtool : public base_graphics_object
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6541 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6542 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6543
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6544 class OCTINTERP_API properties : public base_properties
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6545 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6546 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6547
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6548 // See the genprops.awk script for an explanation of the
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6549 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
6550 // Programming note: Keep property list sorted if new ones are added.
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6551
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6552 BEGIN_PROPERTIES (uipushtool)
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6553 array_property cdata , Matrix ()
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
6554 callback_property clickedcallback , Matrix ()
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6555 bool_property enable , "on"
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6556 bool_property separator , "off"
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6557 string_property tooltipstring , ""
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6558
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6559 // Octave-specific properties
26869
992f55ef87f5 Use an uitoolbar and ui*tools to build the default figure toolbar (bug #55795)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26858
diff changeset
6560 string_property __named_icon__ , ""
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6561 any_property __object__ h , Matrix ()
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6562 END_PROPERTIES
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6563
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6564 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6565 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6566 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6567 m_cdata.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6568 m_cdata.add_constraint ("single");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6569 m_cdata.add_constraint ("uint8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6570 m_cdata.add_constraint (dim_vector (-1, -1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6571 m_cdata.add_constraint (dim_vector (0, 0));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6572 }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6573 };
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6574
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6575 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6576 properties m_properties;
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6577
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6578 public:
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6579 uipushtool (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6580 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
6581 { }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6582
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6583 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uipushtool)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6584
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6585 ~uipushtool () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6586
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6587 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6588
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6589 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6590
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6591 bool valid_object () const { return true; }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6592
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6593 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6594 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6595 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6596 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6597 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6598 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6599 }
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6600
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6601 };
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6602
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6603 // ---------------------------------------------------------------------
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6604
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6605 class OCTINTERP_API uitoggletool : public base_graphics_object
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6606 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6607 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6608
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6609 class OCTINTERP_API properties : public base_properties
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6610 {
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6611 public:
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6612
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6613 // See the genprops.awk script for an explanation of the
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6614 // properties declarations.
17099
a033fd3669c0 Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents: 17098
diff changeset
6615 // Programming note: Keep property list sorted if new ones are added.
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6616
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6617 BEGIN_PROPERTIES (uitoggletool)
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6618 array_property cdata , Matrix ()
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
6619 callback_property clickedcallback , Matrix ()
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6620 bool_property enable , "on"
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
6621 callback_property offcallback , Matrix ()
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14563
diff changeset
6622 callback_property oncallback , Matrix ()
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6623 bool_property separator , "off"
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6624 bool_property state , "off"
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6625 string_property tooltipstring , ""
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6626
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6627 // Octave-specific properties
26869
992f55ef87f5 Use an uitoolbar and ui*tools to build the default figure toolbar (bug #55795)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26858
diff changeset
6628 string_property __named_icon__ , ""
24452
55ddb7a4cca2 Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents: 24451
diff changeset
6629 any_property __object__ h , Matrix ()
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6630 END_PROPERTIES
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6631
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6632 protected:
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6633 void init ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6634 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6635 m_cdata.add_constraint ("double");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6636 m_cdata.add_constraint ("single");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6637 m_cdata.add_constraint ("uint8");
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6638 m_cdata.add_constraint (dim_vector (-1, -1, 3));
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6639 m_cdata.add_constraint (dim_vector (0, 0));
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6640 }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6641 };
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6642
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6643 private:
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6644 properties m_properties;
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6645
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6646 public:
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6647 uitoggletool (const graphics_handle& mh, const graphics_handle& p)
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6648 : base_graphics_object (), m_properties (mh, p)
20051
10600b2dd3c1 make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents: 20045
diff changeset
6649 { }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6650
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6651 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uitoggletool)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6652
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6653 ~uitoggletool () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6654
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6655 base_properties& get_properties () { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6656
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6657 const base_properties& get_properties () const { return m_properties; }
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6658
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6659 bool valid_object () const { return true; }
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6660
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6661 bool has_readonly_property (const caseless_str& pname) const
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6662 {
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6663 bool retval = m_properties.has_readonly_property (pname);
18567
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6664 if (! retval)
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6665 retval = base_properties::has_readonly_property (pname);
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6666 return retval;
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6667 }
8d5cb159fbc7 Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 18119
diff changeset
6668
13703
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6669 };
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6670
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6671 // ---------------------------------------------------------------------
22ce748da25f Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13699
diff changeset
6672
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6673 OCTINTERP_API octave_value
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
6674 get_property_from_handle (double handle, const std::string& property,
30896
c9788d7f6e65 maint: Use "fcn" as preferred abbreviation for "function" in libinterp/.
Rik <rik@octave.org>
parents: 30659
diff changeset
6675 const std::string& fcn);
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6676 OCTINTERP_API bool
18119
ec9b35e60f95 style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents: 18118
diff changeset
6677 set_property_in_handle (double handle, const std::string& property,
30896
c9788d7f6e65 maint: Use "fcn" as preferred abbreviation for "function" in libinterp/.
Rik <rik@octave.org>
parents: 30659
diff changeset
6678 const octave_value& arg, const std::string& fcn);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6679
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6680 // ---------------------------------------------------------------------
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6681
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6682 class graphics_event;
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6683
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6684 class
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6685 OCTINTERP_API
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6686 base_graphics_event
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6687 {
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6688 public:
25960
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6689 enum priority { INTERRUPT, QUEUE, CANCEL };
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
6690
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6691 friend class graphics_event;
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6692
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6693 base_graphics_event ()
25960
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6694 : m_busyaction (QUEUE)
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6695 { };
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6696
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6697 base_graphics_event (int busyaction)
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6698 : m_busyaction (busyaction)
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6699 { };
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6700
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6701 OCTAVE_DEFAULT_COPY_MOVE (base_graphics_event)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
6702
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6703 virtual ~base_graphics_event () = default;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6704
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6705 int get_busyaction () { return m_busyaction; };
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6706
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6707 virtual void execute () = 0;
25960
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6708
30390
a61e1a0f6024 maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents: 30299
diff changeset
6709 private:
25960
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6710 int m_busyaction;
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6711 };
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6712
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6713 class
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6714 OCTINTERP_API
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6715 graphics_event
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6716 {
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6717 public:
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
6718
30390
a61e1a0f6024 maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents: 30299
diff changeset
6719 typedef void (*event_fcn) (void *);
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6720
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6721 graphics_event () = default;
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
6722
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6723 graphics_event (base_graphics_event *new_rep) : m_rep (new_rep) { }
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
6724
24991
831389905438 omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents: 24795
diff changeset
6725 graphics_event (const graphics_event&) = default;
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
6726
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6727 ~graphics_event () = default;
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
6728
24991
831389905438 omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents: 24795
diff changeset
6729 graphics_event& operator = (const graphics_event&) = default;
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6730
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6731 int get_busyaction ()
25960
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6732 {
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6733 if (ok ())
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6734 return m_rep->get_busyaction ();
25960
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6735 else
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6736 error ("graphics_event::busyaction: invalid graphics_event");
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6737 }
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6738
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6739 void execute ()
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
6740 {
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
6741 if (ok ())
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6742 m_rep->execute ();
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6743 }
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6744
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6745 bool ok () const { return (m_rep != nullptr); }
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6746
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6747 static OCTINTERP_API graphics_event
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6748 create_callback_event (const graphics_handle& h,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6749 const std::string& name,
25960
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6750 const octave_value& data = Matrix (),
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6751 int busyaction = base_graphics_event::QUEUE);
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6752
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6753 static OCTINTERP_API graphics_event
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6754 create_callback_event (const graphics_handle& h,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6755 const octave_value& cb,
25960
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6756 const octave_value& data = Matrix (),
ae9d6a491c06 Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25903
diff changeset
6757 int busyaction = base_graphics_event::QUEUE);
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6758
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6759 static OCTINTERP_API graphics_event
26520
278ae90567a7 Don't use C++ callback to notify close request from Qt Figures (bug #54187)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26469
diff changeset
6760 create_mcode_event (const graphics_handle& h, const std::string& cmd,
278ae90567a7 Don't use C++ callback to notify close request from Qt Figures (bug #54187)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26469
diff changeset
6761 int busyaction);
278ae90567a7 Don't use C++ callback to notify close request from Qt Figures (bug #54187)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26469
diff changeset
6762
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6763 static OCTINTERP_API graphics_event
23457
21baad6b35c4 maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents: 23450
diff changeset
6764 create_function_event (event_fcn fcn, void *data = nullptr);
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6765
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6766 static OCTINTERP_API graphics_event
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
6767 create_set_event (const graphics_handle& h, const std::string& name,
26469
bf835b1d04b1 Don't use C++ callbacks to notify position changes from Qt figures (bug #48519)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26383
diff changeset
6768 const octave_value& value, bool notify_toolkit = true,
bf835b1d04b1 Don't use C++ callbacks to notify position changes from Qt figures (bug #48519)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26383
diff changeset
6769 bool redraw_figure = false);
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6770 private:
24252
f8c263f961c1 use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents: 24191
diff changeset
6771
29889
3ab696e02f55 use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
6772 std::shared_ptr <base_graphics_event> m_rep;
7964
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6773 };
9cd3ee5298a0 Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents: 7936
diff changeset
6774
31663
a74935a6cc75 move gh_manager class out of graphics.in.h and graphics.cc to separate files
John W. Eaton <jwe@octave.org>
parents: 31606
diff changeset
6775 OCTINTERP_API base_graphics_object *
a74935a6cc75 move gh_manager class out of graphics.in.h and graphics.cc to separate files
John W. Eaton <jwe@octave.org>
parents: 31606
diff changeset
6776 make_graphics_object_from_type (const caseless_str& type,
a74935a6cc75 move gh_manager class out of graphics.in.h and graphics.cc to separate files
John W. Eaton <jwe@octave.org>
parents: 31606
diff changeset
6777 const graphics_handle& h = graphics_handle (),
a74935a6cc75 move gh_manager class out of graphics.in.h and graphics.cc to separate files
John W. Eaton <jwe@octave.org>
parents: 31606
diff changeset
6778 const graphics_handle& p = graphics_handle ());
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6779
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6780 OCTINTERP_API void
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6781 get_children_limits (double& min_val, double& max_val,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6782 double& min_pos, double& max_neg,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29163
diff changeset
6783 const Matrix& kids, char limit_type);
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6784
10917
888c75785221 Improvements to FLTK backend rotation
Jordi Guti?rrez Hermoso <jordigh@gmail.com>
parents: 10792
diff changeset
6785 OCTINTERP_API int calc_dimensions (const graphics_object& gh);
888c75785221 Improvements to FLTK backend rotation
Jordi Guti?rrez Hermoso <jordigh@gmail.com>
parents: 10792
diff changeset
6786
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6787 // This function is NOT equivalent to the scripting language function gcf.
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6788 OCTINTERP_API graphics_handle gcf ();
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6789
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6790 // This function is NOT equivalent to the scripting language function gca.
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6791 OCTINTERP_API graphics_handle gca ();
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6792
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31707
diff changeset
6793 OCTINTERP_API void close_all_figures ();
14014
907d03def9d5 explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents: 13992
diff changeset
6794
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 31241
diff changeset
6795 OCTAVE_END_NAMESPACE(octave)
29993
b5fae48ad807 move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29913
diff changeset
6796
6874
94bda6abc224 [project @ 2007-09-06 21:34:24 by jwe]
jwe
parents:
diff changeset
6797 #endif