6 pure module function term_get_window_width(this) result(x)
7 class(terminal),
intent(in) :: this
13 module subroutine term_set_window_width(this, x)
14 class(terminal),
intent(inout) :: this
15 integer,
intent(in) :: x
17 this%m_windowWidth = gnuplot_default_window_width
19 this%m_windowWidth = abs(x)
24 pure module function term_get_window_height(this) result(x)
25 class(terminal),
intent(in) :: this
27 x = this%m_windowHeight
31 module subroutine term_set_window_height(this, x)
32 class(terminal),
intent(inout) :: this
33 integer,
intent(in) :: x
35 this%m_windowHeight = gnuplot_default_window_height
37 this%m_windowHeight = abs(x)
42 pure module function term_get_plot_window_number(this) result(x)
43 class(terminal),
intent(in) :: this
49 module subroutine term_set_plot_window_number(this, x)
50 class(terminal),
intent(inout) :: this
51 integer(int32),
intent(in) :: x
56 module function term_get_title(this) result(str)
57 class(terminal),
intent(in) :: this
58 character(len = :),
allocatable :: str
61 allocate(
character(len = n) :: str)
62 str = trim(this%m_title)
66 module subroutine term_set_title(this, txt)
67 class(terminal),
intent(inout) :: this
68 character(len = *),
intent(in) :: txt
70 n = min(len_trim(txt), gnuplot_max_label_length)
73 this%m_title(1:n) = txt(1:n)
74 this%m_hasTitle = .true.
76 this%m_hasTitle = .false.
81 module function term_get_font_name(this) result(name)
82 class(terminal),
intent(in) :: this
83 character(len = :),
allocatable :: name
85 n = len_trim(this%m_fontName)
86 allocate(
character(len = n) :: name)
87 name = trim(this%m_fontName)
91 module subroutine term_set_font_name(this, name)
92 class(terminal),
intent(inout) :: this
93 character(len = *),
intent(in) :: name
95 n = min(len_trim(name), gnuplot_max_label_length)
98 this%m_fontName = gnuplot_default_fontname
100 this%m_fontName(1:n) = name(1:n)
105 pure module function term_get_font_size(this) result(sz)
106 class(terminal),
intent(in) :: this
112 module subroutine term_set_font_size(this, sz)
113 class(terminal),
intent(inout) :: this
114 integer(int32),
intent(in) :: sz
116 this%m_fontSize = gnuplot_default_font_size
118 this%m_fontSize = abs(sz)
123 module function term_get_command_string(this) result(x)
125 class(terminal),
intent(in) :: this
126 character(len = :),
allocatable :: x
129 type(string_builder) :: str
132 call str%initialize()
133 call str%append(
"set term ")
134 call str%append(this%get_id_string())
135 call str%append(
" enhanced ")
136 call str%append(to_string(this%get_plot_window_number()))
137 call str%append(
" font ")
139 call str%append(this%get_font_name())
141 call str%append(to_string(this%get_font_size()))
143 call str%append(
" size ")
144 call str%append(to_string(this%get_window_width()))
146 call str%append(to_string(this%get_window_height()))
147 if (this%m_hasTitle)
then
148 call str%append(
' title "')
149 call str%append(this%get_title())
152 x = char(str%to_string())