~ubuntu-branches/ubuntu/intrepid/enigma/intrepid

« back to all changes in this revision

Viewing changes to src/display_internal.hh

  • Committer: Bazaar Package Importer
  • Author(s): Erich Schubert
  • Date: 2005-08-28 15:30:09 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050828153009-sky64kb6tcq37xt5
Tags: 0.92.1-1
* New upstream subversion checkout
* Remove menu.s3m, which we are allowed to distributed but not to modify
  also copyright notice is confusing... (Closes: #321669)
* Rebuild with new libzipios (Closes: #325405)
  I hope this works without a versioned build-dependency
* Added "enigma replaces enigma-data" for upgrades (Closes: #308558)
* Added notes about the fonts copyright.
* updated to policy 3.6.2.1 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef DISPLAY_INTERNAL_HH
2
 
#define DISPLAY_INTERNAL_HH
3
 
 
4
 
#include "display.hh"
5
 
 
6
 
namespace display
7
 
{
8
 
    using px::V2;
9
 
 
10
 
    class DisplayLayer;
11
 
    class StatusBarImpl;
12
 
    class Model;
13
 
 
14
 
    typedef px::Rect          ScreenArea;
15
 
    typedef px::Rect          WorldArea;
16
 
    typedef std::list<Model*> ModelList;
17
 
 
18
 
 
19
 
    class Window {
20
 
    public:
21
 
        Window() {}
22
 
        Window (const ScreenArea &area) : m_area(area)
23
 
        {}
24
 
 
25
 
        const ScreenArea &get_area() const { return m_area; }
26
 
    private:
27
 
        ScreenArea m_area;
28
 
    };
29
 
 
30
 
 
31
 
    class TextDisplay {
32
 
    public:
33
 
        TextDisplay(px::Font &f);
34
 
 
35
 
        void set_text(const std::string &t, bool scrolling, double duration = -1);
36
 
 
37
 
        void tick(double dtime);
38
 
        bool has_changed() const { return changedp; }
39
 
        bool has_finished() const { return finishedp; }
40
 
 
41
 
        void draw(px::GC &gc, const px::Rect &r);
42
 
    private:
43
 
        px::Rect                area;
44
 
        std::string             text;
45
 
        bool                    changedp, finishedp;
46
 
        bool                    pingpong;
47
 
        double                  xoff;
48
 
        double                  scrollspeed; // pixels per second
49
 
        std::auto_ptr<px::Surface>  textsurface;
50
 
        px::Font               &font;
51
 
        double                  time, maxtime;
52
 
    };
53
 
 
54
 
    class StatusBarImpl : public StatusBar, public Window {
55
 
    public:
56
 
        StatusBarImpl (const ScreenArea &area);
57
 
        ~StatusBarImpl();
58
 
 
59
 
        bool has_changed() const { return m_changedp; }
60
 
        void redraw (px::GC &gc, const ScreenArea &r);
61
 
        void tick (double dtime);
62
 
        void new_world();
63
 
 
64
 
        // StatusBar interface.
65
 
        void set_time (double time);
66
 
        void set_inventory (const std::vector<std::string> &modelnames);
67
 
        void show_text (const std::string &str, bool scrolling, double duration);
68
 
        void hide_text();
69
 
 
70
 
        void show_move_counter (bool active);
71
 
        void show_odometer (bool active);
72
 
 
73
 
        void set_speed (double speed);
74
 
        void set_travelled_distance (double distance);
75
 
        void set_counter (int new_counter);
76
 
 
77
 
    private:
78
 
        ScreenArea     m_itemarea;
79
 
        std::vector<Model*> m_models;
80
 
        bool           m_changedp;
81
 
        TextDisplay    m_textview;
82
 
 
83
 
        double m_leveltime;
84
 
        bool   m_showtime_p;
85
 
        int    m_counter;
86
 
        bool   m_showcounter_p;
87
 
        bool   m_showodometer_p;
88
 
        bool   m_interruptible; // Current text message may be interrupted
89
 
        bool m_text_active;
90
 
    };
91
 
 
92
 
 
93
 
}
94
 
 
95
 
#endif