Minsky: 3.17.0
fontDisplay.h
Go to the documentation of this file.
1
/*
2
@copyright Steve Keen 2017
3
@author Russell Standish
4
This file is part of Minsky.
5
6
Minsky is free software: you can redistribute it and/or modify it
7
under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
Minsky is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with Minsky. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef FONTDISPLAY_H
21
#define FONTDISPLAY_H
22
#include "
renderNativeWindow.h
"
23
#include "
classdesc_access.h
"
24
#include <pango.h>
25
26
namespace
minsky
27
{
28
// display a sample of the current selected font
29
class
FontDisplay
:
public
RenderNativeWindow
30
{
31
bool
redraw
(
int
,
int
,
int
width,
int
height)
override
{
32
cairo_move_to(surface->cairo(),0,0);
33
ecolab::Pango pango(surface->cairo());
34
pango.setFontSize(10);
35
pango.setText(
"←→↑↓—▼αΣ∫√⊗≤"
);
36
pango.show();
37
return
true
;
38
}
39
CLASSDESC_ACCESS
(
FontDisplay
);
40
public
:
41
void
requestRedraw
() {
if
(surface.get()) surface->requestRedraw();}
42
FontDisplay
()=
default
;
43
FontDisplay
(
const
FontDisplay
&)=
default
;
44
FontDisplay
&
operator=
(
const
FontDisplay
&) {
return
*
this
;}
45
};
46
}
47
48
#include "fontDisplay.cd"
49
#include "fontDisplay.xcd"
50
#endif
classdesc_access.h
minsky::FontDisplay
Definition:
fontDisplay.h:29
minsky::FontDisplay::CLASSDESC_ACCESS
CLASSDESC_ACCESS(FontDisplay)
minsky::FontDisplay::operator=
FontDisplay & operator=(const FontDisplay &)
Definition:
fontDisplay.h:44
minsky::FontDisplay::redraw
bool redraw(int, int, int width, int height) override
Definition:
fontDisplay.h:31
minsky::FontDisplay::requestRedraw
void requestRedraw()
Definition:
fontDisplay.h:41
minsky
Definition:
constMap.h:22
minsky::RenderNativeWindow
Definition:
renderNativeWindow.h:42
minsky::FontDisplay::FontDisplay
FontDisplay()=default
renderNativeWindow.h
model
fontDisplay.h
Generated on Wed Jun 18 2025 16:22:22 for Minsky: 3.17.0 by
1.8.14