23 #ifndef BAGEL_BAGLIB_STORAGE_DEV_WIN_H 24 #define BAGEL_BAGLIB_STORAGE_DEV_WIN_H 26 #include "bagel/boflib/gui/dialog.h" 27 #include "bagel/boflib/list.h" 28 #include "bagel/baglib/object.h" 29 #include "bagel/baglib/save_game_file.h" 39 #define SDEV_CLOSEP 66 40 #define SDEV_GAMEWIN 77 41 #define SDEV_ZOOMPDA 88 48 const char *_lpszResourceName;
53 _lpszResourceName =
nullptr;
57 void setResource(
const char *lpszResourceName) {
58 _lpszResourceName = lpszResourceName;
60 void setResource(uint32 nResId) {
63 const char *getResourceName()
const {
64 return _lpszResourceName;
66 uint32 getResourceId()
const {
80 enum MouseActivity { kMouseNONE = 0x0000, kMouseDRAGGING = 0x0001 };
98 MouseActivity _nCurrMouseActivity;
110 static bool _bHandledUpEvent;
111 static bool _hidePdaFl;
112 FilterFunction _pBitmapFilter;
114 bool _bForeignList :
true;
115 bool _bCloseOnOpen :
true;
116 bool _bCloseup :
true;
118 bool _bCustom :
true;
119 bool _bFirstPaint :
true;
121 static bool _bPanPreFiltered;
122 static bool _bDirtyAllObjects;
123 static bool _bPreFilter;
133 static void initialize();
134 static void shutdown();
141 void setDiskID(uint16 nDiskID) {
144 uint16 getDiskID()
const {
148 virtual ErrorCode setloadFilePos(
const CBofPoint) {
152 bool isCloseup()
const {
155 void setCloseup(
bool b =
true) {
161 void setCIC(
bool b =
true) {
166 bool isCustom()
const {
169 void setCustom(
bool b =
true) {
173 int getDeviceType()
const {
177 int getObjectCount();
179 CBagObject *getObject(
int nRefId,
bool bActiveOnly =
false);
184 static CBofPoint &getLastCursorLocation() {
185 return *_xCursorLocation;
192 bool contains(
CBagObject *pObj,
bool bActive =
true);
199 virtual void setRect(
const CBofRect &xRect) {
204 return _cDestRect.topLeft();
207 virtual void setPosition(
const CBofPoint &pos);
209 virtual ErrorCode addObject(
CBagObject *pObj,
int nPos = 0);
210 virtual ErrorCode activateLocalObject(
CBagObject *pObj);
211 virtual ErrorCode activateLocalObject(
const CBofString &sName);
212 virtual ErrorCode attachActiveObjects();
214 virtual ErrorCode removeObject(
CBagObject *pRObj);
215 virtual ErrorCode deactivateLocalObject(
CBagObject *pObj);
216 virtual ErrorCode deactivateLocalObject(
const CBofString &sName);
217 virtual ErrorCode detachActiveObjects();
219 virtual void setHelpFilename(
const CBofString &) {}
228 void setFilterId(uint16 nId) {
231 uint16 getFilterId()
const {
235 void setFadeId(uint16 nId) {
238 uint16 getFadeId()
const {
246 return _xPrevLocation;
252 bool getCloseOnOpen()
const {
253 return _bCloseOnOpen;
255 void setCloseOnOpen(
bool bVal) {
256 _bCloseOnOpen = bVal;
259 uint16 getExitOnEdge()
const {
262 void setExitOnEdge(uint16 nVal) {
267 return _pLActiveObject;
270 ErrorCode setLActiveObject(
CBagObject *pObj) {
271 _pLActiveObject = pObj;
275 virtual ErrorCode onLActiveObject(uint32 ,
CBofPoint * ,
void * =
nullptr);
277 MouseActivity getLActivity()
const {
278 return _nCurrMouseActivity;
280 void setLActivity(MouseActivity ma) {
281 _nCurrMouseActivity = ma;
284 ErrorCode paintStorageDevice(
CBofWindow *pWnd, CBofBitmap *pBmp =
nullptr,
CBofRect * =
nullptr);
288 virtual void setAssociateWnd(
CBofWindow *pWnd) {
289 _pAssociateWnd = pWnd;
292 return _pAssociateWnd;
297 virtual ErrorCode setBackground(CBofBitmap *pBmp) = 0;
298 virtual CBofBitmap *getBackground() = 0;
300 return _sBackgroundName;
303 ErrorCode attach()
override;
304 ErrorCode detach()
override;
306 virtual ErrorCode close();
308 virtual ErrorCode loadObjects();
309 virtual ErrorCode releaseObjects();
310 virtual ErrorCode noObjectsUnderMouse();
319 virtual ErrorCode loadFile(
const CBofString &sWldName);
320 virtual ErrorCode loadFileFromStream(
CBagIfstream &fpInput,
const CBofString &sWldName,
bool bAttach =
true);
322 virtual void onMouseMove(uint32 ,
CBofPoint * ,
void * =
nullptr);
323 virtual ErrorCode onMouseOver(uint32 ,
CBofPoint * ,
void * =
nullptr);
324 virtual void onLButtonDown(uint32 ,
CBofPoint * ,
void * =
nullptr);
325 virtual void onLButtonUp(uint32 ,
CBofPoint * ,
void * =
nullptr);
327 virtual ErrorCode onCursorUpdate(
int ) {
352 int getNumFloatPages()
const {
355 void setNumFloatPages(
int nFloatPages) {
356 _nFloatPages = nFloatPages;
361 void onSetFilter(
bool (*filterFunction)(uint16 nFilterId, CBofBitmap *,
CBofRect *));
365 FilterFunction getFilter();
369 bool isFiltered()
const {
370 return _nFilterId != 0;
374 static void setDirtyAllObjects(
bool b) {
375 _bDirtyAllObjects = b;
377 static bool getDirtyAllObjects() {
378 return _bDirtyAllObjects;
382 static void setPreFiltered(
bool b =
true) {
383 _bPanPreFiltered = b;
385 static bool getPreFiltered() {
386 return _bPanPreFiltered;
390 static bool preFilterPan() {
393 static void setPreFilterPan(
bool b =
true) {
395 _bDirtyAllObjects = b;
410 CBofBitmap *_pWorkBmp;
418 static void initialize() {
422 ErrorCode attach()
override;
423 ErrorCode detach()
override;
425 ErrorCode close()
override;
427 void onTimer(uint32 nEventID)
override;
429 void setOnUpdate(
bool bVal =
true) {
432 bool getOnUpdate()
const {
436 virtual ErrorCode paintScreen(
CBofRect *pRect =
nullptr);
441 return getWindowRect();
444 ErrorCode setBackground(CBofBitmap *pBmp)
override;
446 CBofBitmap *getBackground()
override {
447 return getBackdrop();
449 virtual CBofBitmap *getWorkBmp() {
453 ErrorCode loadFile(
const CBofString &sFile)
override;
456 return _sHelpFileName;
459 void setHelpFilename(
const CBofString &s)
override {
463 virtual ErrorCode onRender(CBofBitmap *pBmp,
CBofRect *pRect =
nullptr);
465 void onMainLoop()
override;
466 void onClose()
override;
467 void onMouseMove(uint32 nFlags,
CBofPoint *,
void * =
nullptr)
override;
468 void onLButtonDown(uint32 nFlags,
CBofPoint *point,
void * =
nullptr)
override;
469 void onLButtonUp(uint32 nFlags,
CBofPoint *point,
void * =
nullptr)
override;
471 void onKeyHit(uint32 lKey, uint32 nRepCount)
override;
474 virtual ErrorCode setWorkBmp();
475 virtual ErrorCode killWorkBmp();
490 virtual ErrorCode paintScreen(
CBofRect *pRect =
nullptr);
495 return paintObjects(list, pBmp, emptyRect);
499 return getWindowRect();
502 ErrorCode setBackground(CBofBitmap *pBmp)
override {
504 return setBackdrop(pBmp);
510 CBofBitmap *getBackground()
override {
511 return getBackdrop();
514 ErrorCode loadFile(
const CBofString &sFile)
override;
516 ErrorCode create(
const char *pszName,
CBofRect *pRect,
CBofWindow *pParent, uint32 nControlID = 0)
override;
518 ErrorCode attach()
override;
520 ErrorCode close()
override;
523 return _sHelpFileName;
526 void setHelpFilename(
const CBofString &s)
override {
530 void onMainLoop()
override;
531 virtual ErrorCode onRender(CBofBitmap *pBmp,
CBofRect *pRect =
nullptr);
534 void onClose()
override;
535 void onMouseMove(uint32 nFlags,
CBofPoint *,
void * =
nullptr)
override;
536 void onLButtonDown(uint32 nFlags,
CBofPoint *point,
void * =
nullptr)
override;
537 void onLButtonUp(uint32 nFlags,
CBofPoint *point,
void * =
nullptr)
override;
545 static int nSDevMngrs;
554 ErrorCode releaseStorageDevices();
559 int getNumStorageDevices()
const {
560 return _xStorageDeviceList.getCount();
564 return _xStorageDeviceList[nIndex];
573 void saveObjList(
StObj *pObjList,
int nNumEntries);
574 void restoreObjList(
StObj *pObjList,
int nNumEntries);
577 extern bool g_allowPaintFl;
Definition: storage_dev_win.h:406
Definition: ifstream.h:31
Definition: parse_object.h:45
Definition: event_sdev.h:30
Definition: storage_dev_win.h:46
Definition: storage_dev_win.h:482
Definition: storage_dev_win.h:78
Definition: save_game_file.h:76
Definition: storage_dev_win.h:543