23 #ifndef BAGEL_BAGLIB_STORAGE_DEV_WIN_H 24 #define BAGEL_BAGLIB_STORAGE_DEV_WIN_H 26 #include "bagel/spacebar/boflib/gui/dialog.h" 27 #include "bagel/spacebar/boflib/list.h" 28 #include "bagel/spacebar/baglib/object.h" 29 #include "bagel/spacebar/baglib/save_game_file.h" 40 #define SDEV_CLOSEP 66 41 #define SDEV_GAMEWIN 77 42 #define SDEV_ZOOMPDA 88 49 const char *_lpszResourceName;
54 _lpszResourceName =
nullptr;
58 void setResource(
const char *lpszResourceName) {
59 _lpszResourceName = lpszResourceName;
61 void setResource(uint32 nResId) {
64 const char *getResourceName()
const {
65 return _lpszResourceName;
67 uint32 getResourceId()
const {
82 kMouseNONE = 0x0000, kMouseDRAGGING = 0x0001
101 MouseActivity _nCurrMouseActivity;
113 static bool _bHandledUpEvent;
114 static bool _hidePdaFl;
115 FilterFunction _pBitmapFilter;
117 bool _bForeignList :
true;
118 bool _bCloseOnOpen :
true;
119 bool _bCloseup :
true;
121 bool _bCustom :
true;
122 bool _bFirstPaint :
true;
124 static bool _bPanPreFiltered;
125 static bool _bDirtyAllObjects;
126 static bool _bPreFilter;
136 static void initialize();
137 static void shutdown();
144 void setDiskID(uint16 nDiskID) {
147 uint16 getDiskID()
const {
151 virtual ErrorCode setloadFilePos(
const CBofPoint) {
155 bool isCloseup()
const {
158 void setCloseup(
bool b =
true) {
164 void setCIC(
bool b =
true) {
169 bool isCustom()
const {
172 void setCustom(
bool b =
true) {
176 int getDeviceType()
const {
180 int getObjectCount();
182 CBagObject *getObject(
int nRefId,
bool bActiveOnly =
false);
187 static CBofPoint &getLastCursorLocation() {
188 return *_xCursorLocation;
195 bool contains(
CBagObject *pObj,
bool bActive =
true);
202 virtual void setRect(
const CBofRect &xRect) {
207 return _cDestRect.topLeft();
210 virtual void setPosition(
const CBofPoint &pos);
212 virtual ErrorCode addObject(
CBagObject *pObj,
int nPos = 0);
213 virtual ErrorCode activateLocalObject(
CBagObject *pObj);
214 virtual ErrorCode activateLocalObject(
const CBofString &sName);
215 virtual ErrorCode attachActiveObjects();
217 virtual ErrorCode removeObject(
CBagObject *pRObj);
218 virtual ErrorCode deactivateLocalObject(
CBagObject *pObj);
219 virtual ErrorCode deactivateLocalObject(
const CBofString &sName);
220 virtual ErrorCode detachActiveObjects();
222 virtual void setHelpFilename(
const CBofString &) {
232 void setFilterId(uint16 nId) {
235 uint16 getFilterId()
const {
239 void setFadeId(uint16 nId) {
242 uint16 getFadeId()
const {
250 return _xPrevLocation;
256 bool getCloseOnOpen()
const {
257 return _bCloseOnOpen;
259 void setCloseOnOpen(
bool bVal) {
260 _bCloseOnOpen = bVal;
263 uint16 getExitOnEdge()
const {
266 void setExitOnEdge(uint16 nVal) {
271 return _pLActiveObject;
274 ErrorCode setLActiveObject(
CBagObject *pObj) {
275 _pLActiveObject = pObj;
279 virtual ErrorCode onLActiveObject(uint32 ,
CBofPoint *,
void * =
nullptr);
281 MouseActivity getLActivity()
const {
282 return _nCurrMouseActivity;
284 void setLActivity(MouseActivity ma) {
285 _nCurrMouseActivity = ma;
288 ErrorCode paintStorageDevice(
CBofWindow *pWnd, CBofBitmap *pBmp =
nullptr,
CBofRect * =
nullptr);
292 virtual void setAssociateWnd(
CBofWindow *pWnd) {
293 _pAssociateWnd = pWnd;
296 return _pAssociateWnd;
301 virtual ErrorCode setBackground(CBofBitmap *pBmp) = 0;
302 virtual CBofBitmap *getBackground() = 0;
304 return _sBackgroundName;
307 ErrorCode attach()
override;
308 ErrorCode detach()
override;
310 virtual ErrorCode close();
312 virtual ErrorCode loadObjects();
313 virtual ErrorCode releaseObjects();
314 virtual ErrorCode noObjectsUnderMouse();
323 virtual ErrorCode loadFile(
const CBofString &sWldName);
324 virtual ErrorCode loadFileFromStream(
CBagIfstream &fpInput,
const CBofString &sWldName,
bool bAttach =
true);
326 virtual void onMouseMove(uint32 ,
CBofPoint *,
void * =
nullptr);
327 virtual ErrorCode onMouseOver(uint32 ,
CBofPoint *,
void * =
nullptr);
328 virtual void onLButtonDown(uint32 ,
CBofPoint *,
void * =
nullptr);
329 virtual void onLButtonUp(uint32 ,
CBofPoint *,
void * =
nullptr);
331 virtual ErrorCode onCursorUpdate(
int ) {
356 int getNumFloatPages()
const {
359 void setNumFloatPages(
int nFloatPages) {
360 _nFloatPages = nFloatPages;
365 void onSetFilter(
bool (*filterFunction)(uint16 nFilterId, CBofBitmap *,
CBofRect *));
369 FilterFunction getFilter();
373 bool isFiltered()
const {
374 return _nFilterId != 0;
378 static void setDirtyAllObjects(
bool b) {
379 _bDirtyAllObjects = b;
381 static bool getDirtyAllObjects() {
382 return _bDirtyAllObjects;
386 static void setPreFiltered(
bool b =
true) {
387 _bPanPreFiltered = b;
389 static bool getPreFiltered() {
390 return _bPanPreFiltered;
394 static bool preFilterPan() {
397 static void setPreFilterPan(
bool b =
true) {
399 _bDirtyAllObjects = b;
414 CBofBitmap *_pWorkBmp;
422 static void initialize() {
426 ErrorCode attach()
override;
427 ErrorCode detach()
override;
429 ErrorCode close()
override;
431 void onTimer(uint32 nEventID)
override;
433 void setOnUpdate(
bool bVal =
true) {
436 bool getOnUpdate()
const {
440 virtual ErrorCode paintScreen(
CBofRect *pRect =
nullptr);
445 return getWindowRect();
448 ErrorCode setBackground(CBofBitmap *pBmp)
override;
450 CBofBitmap *getBackground()
override {
451 return getBackdrop();
453 virtual CBofBitmap *getWorkBmp() {
457 ErrorCode loadFile(
const CBofString &sFile)
override;
460 return _sHelpFileName;
463 void setHelpFilename(
const CBofString &s)
override {
467 virtual ErrorCode onRender(CBofBitmap *pBmp,
CBofRect *pRect =
nullptr);
469 void onMainLoop()
override;
470 void onClose()
override;
471 void onMouseMove(uint32 nFlags,
CBofPoint *,
void * =
nullptr)
override;
472 void onLButtonDown(uint32 nFlags,
CBofPoint *point,
void * =
nullptr)
override;
473 void onLButtonUp(uint32 nFlags,
CBofPoint *point,
void * =
nullptr)
override;
475 void onKeyHit(uint32 lKey, uint32 nRepCount)
override;
478 virtual ErrorCode setWorkBmp();
479 virtual ErrorCode killWorkBmp();
494 virtual ErrorCode paintScreen(
CBofRect *pRect =
nullptr);
499 return paintObjects(list, pBmp, emptyRect);
503 return getWindowRect();
506 ErrorCode setBackground(CBofBitmap *pBmp)
override {
508 return setBackdrop(pBmp);
514 CBofBitmap *getBackground()
override {
515 return getBackdrop();
518 ErrorCode loadFile(
const CBofString &sFile)
override;
520 ErrorCode create(
const char *pszName,
CBofRect *pRect,
CBofWindow *pParent, uint32 nControlID = 0)
override;
522 ErrorCode attach()
override;
524 ErrorCode close()
override;
527 return _sHelpFileName;
530 void setHelpFilename(
const CBofString &s)
override {
534 void onMainLoop()
override;
535 virtual ErrorCode onRender(CBofBitmap *pBmp,
CBofRect *pRect =
nullptr);
538 void onClose()
override;
539 void onMouseMove(uint32 nFlags,
CBofPoint *,
void * =
nullptr)
override;
540 void onLButtonDown(uint32 nFlags,
CBofPoint *point,
void * =
nullptr)
override;
541 void onLButtonUp(uint32 nFlags,
CBofPoint *point,
void * =
nullptr)
override;
549 static int nSDevMngrs;
558 ErrorCode releaseStorageDevices();
563 int getNumStorageDevices()
const {
564 return _xStorageDeviceList.getCount();
568 return _xStorageDeviceList[nIndex];
577 void saveObjList(
StObj *pObjList,
int nNumEntries);
578 void restoreObjList(
StObj *pObjList,
int nNumEntries);
581 extern bool g_allowPaintFl;
Definition: event_sdev.h:31
Definition: ifstream.h:32
Definition: parse_object.h:48
Definition: storage_dev_win.h:47
Definition: save_game_file.h:77
Definition: storage_dev_win.h:547
Definition: storage_dev_win.h:486
Definition: storage_dev_win.h:410
Definition: storage_dev_win.h:79