annotate libinterp/corefcn/base-text-renderer.h @ 22331:b81b08cc4c83

maint: Indent namespaces in more files.
author John W. Eaton <jwe@octave.org>
date Wed, 17 Aug 2016 11:43:27 -0400
parents 71dd9d5a5ecd
children 34ce5be04942
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 /*
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 Copyright (C) 2016 John W. Eaton
22323
bac0d6f07a3e maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
4 Copyright (C) 2009-2016 Michael Goffioul
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 This file is part of Octave.
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 option) any later version.
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 for more details.
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 along with Octave; see the file COPYING. If not, see
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 <http://www.gnu.org/licenses/>.
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 */
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 #if ! defined (octave_base_text_renderer_h)
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 #define octave_base_text_renderer_h 1
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21209
diff changeset
27 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21209
diff changeset
28
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include <list>
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 #include <string>
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 #include "dMatrix.h"
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 #include "uint8NDArray.h"
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 #include "text-renderer.h"
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 #include "txt-eng.h"
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37
22326
71dd9d5a5ecd move more new classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22323
diff changeset
38 namespace octave
71dd9d5a5ecd move more new classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22323
diff changeset
39 {
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
40 class
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
41 base_text_renderer : public text_processor
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
42 {
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
43 public:
22326
71dd9d5a5ecd move more new classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22323
diff changeset
44
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
45 base_text_renderer (void) : text_processor () { }
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
47 virtual ~base_text_renderer (void) { }
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
49 virtual Matrix
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
50 get_extent (text_element *elt, double rotation) = 0;
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
52 virtual Matrix
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
53 get_extent (const std::string& txt, double rotation,
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
54 const caseless_str& interpreter) = 0;
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
56 virtual void
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
57 set_font (const std::string& name, const std::string& weight,
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
58 const std::string& angle, double size) = 0;
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
60 virtual void set_color (const Matrix& c) = 0;
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
62 virtual void
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
63 text_to_pixels (const std::string& txt, uint8NDArray& pxls,
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
64 Matrix& bbox, int halign, int valign, double rotation,
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
65 const caseless_str& interpreter,
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
66 bool handle_rotation) = 0;
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
68 virtual void
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
69 text_to_strlist (const std::string& txt,
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
70 std::list<text_renderer::string>& lst,
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
71 Matrix& box, int halign, int valign, double rotation,
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
72 const caseless_str& interpreter = "tex") = 0;
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
74 private:
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
76 // No copying!
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
78 base_text_renderer (const base_text_renderer&);
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79
22331
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
80 base_text_renderer& operator = (const base_text_renderer&);
b81b08cc4c83 maint: Indent namespaces in more files.
John W. Eaton <jwe@octave.org>
parents: 22326
diff changeset
81 };
22326
71dd9d5a5ecd move more new classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22323
diff changeset
82 }
71dd9d5a5ecd move more new classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22323
diff changeset
83
21209
67d2965af0b5 revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 #endif