ScummVM API documentation
time_object.h
1 
2 /* ScummVM - Graphic Adventure Engine
3  *
4  * ScummVM is the legal property of its developers, whose names
5  * are too numerous to list here. Please refer to the COPYRIGHT
6  * file distributed with this source distribution.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef BAGEL_BAGLIB_TIME_OBJECT_H
24 #define BAGEL_BAGLIB_TIME_OBJECT_H
25 
26 #include "bagel/spacebar/baglib/object.h"
27 #include "bagel/spacebar/boflib/gfx/bitmap.h"
28 #include "bagel/spacebar/boflib/gfx/sprite.h"
29 
30 namespace Bagel {
31 namespace SpaceBar {
32 
36 class CBagTimeObject : public CBagObject {
37 private:
38  CBofString _sVariable;
39 
40  CBofSprite *_xDig1; // x-:--
41  CBofSprite *_xDig2; // -x:--
42  CBofSprite *_xColon; // --:--
43  CBofSprite *_xDig3; // --:x-
44  CBofSprite *_xDig4; // --:-x
45 
46  int _nCels;
47 
48 public:
50  virtual ~CBagTimeObject();
51 
55  ErrorCode attach() override;
56  ErrorCode detach() override;
57  bool isAttached() override {
58  return _xDig1 != nullptr;
59  }
60 
65  ParseCodes setInfo(CBagIfstream &istr) override;
66 
67  CBofRect getRect() override;
68  int getCels() {
69  return _nCels;
70  }
71 
72  void setCels(int nCels);
73  void setPosition(const CBofPoint &pos) override;
74 
80  ErrorCode update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect = nullptr, int /*nMaskColor*/ = -1) override;
81 
82  void setVariable(const CBofString &sProp) {
83  _sVariable = sProp;
84  }
85 };
86 
87 } // namespace SpaceBar
88 } // namespace Bagel
89 
90 #endif
Definition: ifstream.h:32
Definition: object.h:86
Definition: rect.h:35
ErrorCode attach() override
Definition: sprite.h:39
Definition: string.h:38
ErrorCode update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect=nullptr, int=-1) override
Definition: afxwin.h:27
Definition: point.h:32
ParseCodes setInfo(CBagIfstream &istr) override
Definition: time_object.h:36
Definition: bitmap.h:57