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