ScummVM API documentation
storage_dev_bmp.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_STORAGE_DEV_BMP_H
24 #define BAGEL_BAGLIB_STORAGE_DEV_BMP_H
25 
26 #include "bagel/baglib/bmp_object.h"
27 #include "bagel/baglib/storage_dev_win.h"
28 
29 namespace Bagel {
30 
32 protected:
33  int _nMaskColor;
34  CBofPoint _xCursorLocation; // Current cursor location in bmp.
35  CBofRect _cSrcRect;
36  bool _bTrans;
37  CBofBitmap *_pWorkBmp;
38 
39 public:
40  CBagStorageDevBmp(CBofWindow *pParent = nullptr, const CBofRect &xRect = CBofRect(), bool bTrans = true);
41  virtual ~CBagStorageDevBmp();
42 
43  CBofBitmap *getWorkBmp() const {
44  return _pWorkBmp;
45  }
46  ErrorCode setWorkBmp();
47  ErrorCode killWorkBmp();
48 
49  CBofRect getRect() override {
50  return CBagStorageDev::getRect();
51  }
52  void setRect(const CBofRect &xRect) override {
53  CBagStorageDev::setRect(xRect);
54  }
55  CBofPoint getPosition() override {
56  return CBagStorageDev::getPosition();
57  }
58  void setPosition(const CBofPoint &pos) override {
59  CBagStorageDev::setPosition(pos);
60  }
61 
62  bool getTransparent() const {
63  return _bTrans;
64  }
65  void setTransparent(bool bTrans = true) override {
66  _bTrans = bTrans;
67  }
68 
69  ErrorCode setBackground(CBofBitmap *pBmp) override;
70  CBofBitmap *getBackground() override {
71  return getBitmap();
72  }
73 
74  ErrorCode loadFileFromStream(CBagIfstream &fpInput, const CBofString &sWldName, bool bAttach = true) override;
75 
76  bool isAttached() override {
77  return CBagBmpObject::isAttached();
78  }
79 
80  virtual bool paintFGObjects(CBofBitmap *) {
81  return true;
82  }
83 
84  ErrorCode attach() override;
85  ErrorCode detach() override;
86 
87  ErrorCode update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect = nullptr, int nMaskColor = -1) override;
88 
93  void onLButtonUp(uint32 nFlags, CBofPoint *xPoint, void *info) override;
94 
99  void onLButtonDown(uint32 nFlags, CPoint *xPoint, void *info = nullptr) override;
100 
101  const CBofPoint devPtToViewPort(const CBofPoint &xPoint) override;
102 };
103 
104 } // namespace Bagel
105 
106 #endif
Definition: window.h:50
void onLButtonDown(uint32 nFlags, CPoint *xPoint, void *info=nullptr) override
Definition: bitmap.h:55
Definition: rect.h:36
Definition: ifstream.h:31
Definition: string.h:38
void onLButtonUp(uint32 nFlags, CBofPoint *xPoint, void *info) override
Definition: bagel.h:31
Definition: point.h:34
Definition: storage_dev_win.h:78
Definition: bmp_object.h:33
Definition: storage_dev_bmp.h:31