~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/cpp/app_templates/noatunvisual/plugin_impl.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#ifndef %{APPNAMEUC}_IMPL_H
 
3
#define %{APPNAMEUC}_IMPL_H
 
4
 
 
5
struct SDL_Surface;
 
6
 
 
7
/**
 
8
 * @short This class is used for painting and supports some effects.
 
9
 * Note: This is used in Blurscope. Feel free to remove this and
 
10
 *       implement your own drawing routines!
 
11
 */
 
12
template<class Pixel> class Bitmap
 
13
{
 
14
public:
 
15
    int width, height, extra;
 
16
    Pixel *data;
 
17
 
 
18
    Bitmap(int e=0) : extra(e), data(0) { }
 
19
    ~Bitmap() { delete[] data; }
 
20
 
 
21
    inline void addPixel(int x, int y, int bright1, int bright2);
 
22
    void addVertLine(int x, int y, int y2, int br1, int br2);
 
23
    
 
24
    void fadeStar();
 
25
    
 
26
    void size(int w,int h)
 
27
    {
 
28
        delete[] data;
 
29
        width = w;
 
30
        height = h;
 
31
        data = new Pixel[w*h+extra];
 
32
        clear();
 
33
    }
 
34
 
 
35
    void clear()
 
36
    {
 
37
        memset(data,0,sizeof(Pixel)*(width*height+extra));
 
38
    }
 
39
};
 
40
 
 
41
/**
 
42
 * @short This class does:
 
43
 * o set up view
 
44
 * o drawing routines.
 
45
 */
 
46
class %{APPNAME}View
 
47
{
 
48
public:
 
49
    %{APPNAME}View(int in);
 
50
    ~%{APPNAME}View();
 
51
    
 
52
protected:
 
53
    /** Screen initialization with SDL. Note, that you can initialize OpenGL with SDL!  */
 
54
    void startVideo();
 
55
    /** SDL event queue  */
 
56
    void checkInput();
 
57
    /** Used in Blurscope. Feel free to implement your own drawing routines!  */
 
58
    void setupPalette(double dummy=0.0);
 
59
 
 
60
    /** Draw everything.  */
 
61
    void repaint();
 
62
 
 
63
private:
 
64
    /** used for pipelining  */
 
65
    int mFd;
 
66
 
 
67
    /** SDL screen surface  */
 
68
    SDL_Surface *surface;
 
69
    Bitmap<unsigned short> outputBmp;
 
70
    
 
71
    bool fullscreen;
 
72
    int width;
 
73
    int height;
 
74
};
 
75
 
 
76
#endif // %{APPNAMEUC}_IMPL_H
 
77