summaryrefslogtreecommitdiffstats
path: root/libksirtet/common/misc_ui.h
blob: fb2fd02a432993fc2bc439c5e4578eaec1e749c1 (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef COMMON_MISC_UI_H
#define COMMON_MISC_UI_H

#include <tqcanvas.h>
#include <tqptrvector.h>
#include <tqhbox.h>

#include <kgameprogress.h>
#include "lib/libksirtet_export.h"

#include "base/board.h"

/*****************************************************************************/
class LIBKSIRTET_EXPORT ShowNextPiece : public FixedCanvasView
{
 TQ_OBJECT
  
 public:
    ShowNextPiece(BaseBoard *, TQWidget *parent);
};

/*****************************************************************************/
class LIBKSIRTET_EXPORT Shadow : public TQWidget
{
 TQ_OBJECT
  
 public:
    Shadow(BaseBoard *, TQWidget *parent);

    virtual TQSize sizeHint() const;
    virtual TQSizePolicy sizePolicy() const;
    void setDisplay(bool show);

 private:
    int              _xOffset;
    const BaseBoard *_board;
    bool             _show;

    void paintEvent(TQPaintEvent *);
};

/*****************************************************************************/
class Led;

class LIBKSIRTET_EXPORT GiftPool : public TQHBox
{
 TQ_OBJECT
  
 public:
    GiftPool(TQWidget *parent);

    virtual TQSize sizeHint() const;
    virtual TQSizePolicy sizePolicy() const;

    void reset();
	void put(uint);
	uint take();
	bool pending() const { return ready; }

 private slots:
    void timeout() { ready = true; }

 private:
	TQPtrVector<Led> leds;
	uint         _timeout, nb;
	bool         ready;
};


/*****************************************************************************/
class LIBKSIRTET_EXPORT PlayerProgress : public KGameProgress
{
  TQ_OBJECT
  
public:
  PlayerProgress(BaseBoard *board, TQWidget *parent = 0, const char *name = 0);
  
  virtual TQSize sizeHint() const;
  virtual TQSizePolicy sizePolicy() const;
  
private:
  BaseBoard *_board;
};

#endif