-
Notifications
You must be signed in to change notification settings - Fork 6
/
GUILetter.h
67 lines (43 loc) · 1.18 KB
/
GUILetter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// GUILetter.h
// Design Patterns
//
// Created by Nathan Daly on 4/24/12.
// Copyright 2012 Lions Entertainment. All rights reserved.
//
#ifndef GUI_LETTER_H
#define GUI_LETTER_H
#include "Ptr_config.h"
#include <string>
#include <map>
struct SDL_Surface; // display image
struct SDL_Color; // display image
struct _TTF_Font_;
//typedef _TTF_Font_ TTF_Font;
namespace GUI {
class View; // display image
}
class GUILetter {
public:
void drawself(SDL_Surface *dest, int x, int y) const;
void drawself(GUI::View *dest, int x, int y) const;
int get_height() const;
int get_width() const;
static GUILetter* get_letter(char letter_, int size_, SDL_Color color_);
class Print_GUILetter {
public:
Print_GUILetter(SDL_Surface *dest, int x_, int y_);
void operator() (const GUILetter* letter);
private:
int x, y, width;
SDL_Surface* surface;
};
SDL_Surface *image;
private:
GUILetter() : image (0) {}
~GUILetter() {}
GUILetter(char letter_, TTF_Font* font, int size_, SDL_Color color_);
typedef std::map<int, TTF_Font*> fonts_map_t;
typedef std::map<char, std::map<int, std::map<SDL_Color, GUILetter*> > > letter_map_t;
};
#endif /* FLYWEIGHT_H */