ScummVM API documentation
rp_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_RP_OBJECT_H
24 #define BAGEL_BAGLIB_RP_OBJECT_H
25 
26 #include "bagel/spacebar/baglib/dossier_object.h"
27 #include "bagel/spacebar/baglib/expression.h"
28 #include "bagel/spacebar/baglib/movie_object.h"
29 #include "bagel/spacebar/baglib/text_object.h"
30 
31 namespace Bagel {
32 namespace SpaceBar {
33 
34 class DossierObj {
35 public:
36  DossierObj();
37  virtual ~DossierObj();
38 
39  CBagDossierObject *_pDossier;
40  CBofString _sDossier;
41  CBagExpression *_xDosExp;
42  bool _bDisplayDossier;
43 };
44 
45 enum RPStates {
46  RP_NO_MODE = 0,
47  RP_RESULTS,
48  RP_READ_DOSSIER,
49  RP_REVIEW,
50  RP_MAIN_MENU
51 };
52 
53 class CBagRPObject : public CBagObject {
54 private:
55  CBofList<DossierObj *> *_pTouchedList; // dossiers to show if alias touched it
56  CBofList<DossierObj *> *_pUntouchedList; // dossiers to show if alias did not touch it
57  CBagMovieObject *_pMovieObj; // a movie to play
58  CBofString _sMovieObj; // Name of movie
59  CBagVar *_pVarObj; // associated global var
60  CBagTextObject *_pDescObj; // description of residue printed object
61  CBagTextObject *_pObjectName; // description of residue printed object
62  CBofString _sObjectName; // description of residue printed object
63 
64  CBagVar *_pSaveVar; // Var to save info to
65  CBagVar *_pTouchedVar; // variable indicating touched or not
66  int _nRPTime; // time to execute
67 
68  CBofRect _cOrigRect; // Original text rect
69 
70  int16 _nCurDossier; // index of current dossier
71  // member data boolS
72  bool _bOrigRectInit : true; // Original text initialized
73  bool _bRPReported : true; // been reported yet?
74  bool _bResPrinted : true; // been submitted?
75  bool _bTouched : true; // been touched?
76  bool _bRPRead : true; // been read
77  bool _bRPTimeSet : true; // had time residue printing occurred?
78  bool _bCurVisible : true; // Current one being displayed?
79  bool _bInitialized : true; // initialization state
80  bool _bMoviePlayed : true; // Has the movie played yet?
81 
82  static CBofList<CBagRPObject *> *_pRPList; // all the residue print objects
83  static int32 _nLastRPQCheck; // last time we surfed the queue.
84  static CBagVar *_turnCount; // Ptr to turnCount global
85  static CBagVar *_pLogStateVar; // Ptr to log state global
86  static CBagVar *_pPrevLogStateVar; // Ptr to prev log state global
87  static CBagVar *_pBarLogPages; // Ptr to total pages global
88  static CBagVar *_pPrevBarPage; //
89  static CBagVar *_pCurBarPage; // current bar page
90  static CBagRPObject *_pCurRPObject; // Most recent residue print object.
91  static CBagRPObject *_pActivateThisGuy; // The one we want to activate
92  static RPStates _eRPMode; // Current state of display
93 public:
94  CBagRPObject();
95  virtual ~CBagRPObject();
96 
97  ParseCodes setInfo(CBagIfstream &istr) override;
98 
99  ErrorCode attach() override;
100  ErrorCode detach() override;
101 
102  bool runObject() override;
103 
104  ErrorCode update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect, int) override;
105 
106  void onLButtonUp(uint32, CBofPoint *, void * = nullptr) override;
107 
108  void setTouchedDos(CBofString &s, CBagExpression *x);
109  void setUntouchedDos(CBofString &s, CBagExpression *x);
110 
111  bool activateRPObject();
112  void deactivateRPObject();
113 
114  bool getTimeSet() {
115  return _bRPTimeSet;
116  }
117  void setTimeSet(bool b) {
118  _bRPTimeSet = b;
119  }
120 
121  void evaluateDossiers();
122 
123  void saveResiduePrintedVars();
124  void restoreResiduePrintedVars();
125 
126  bool initialize();
127 
128  CBagDossierObject *getActiveDossier();
129  void setActiveDossier(CBagDossierObject *);
130 
131  static bool addToMsgQueue(CBagRPObject *);
132 
133  static bool zoomed();
134 
135  // Command (bagcoobj) objects, activated from script
136  static int runResiduePrintedQueue();
137  static int updateResiduePrintedQueue();
138  static void deactivateResiduePrintedQueue();
139 
140  static void activateResiduePrintedReview();
141  static void deactivateResiduePrintedReview();
142 
143  static void setLogState(RPStates eLogMode);
144  static RPStates getLogState();
145 
146  static void setLogPages(int);
147 
148  static void showResiduePrintedReview();
149  static void hideResiduePrintedReview();
150 
151  static int residuePrintedResultsWaiting();
152  static void removeAllFromMsgQueue(CBagRPObject *pRPObj);
153 
154  static void showPdaLog();
155 
156  static void synchronizeResiduePrintedObjects(bool);
157 };
158 
159 } // namespace SpaceBar
160 } // namespace Bagel
161 
162 #endif
Definition: dossier_object.h:32
Definition: rp_object.h:34
Definition: ifstream.h:32
Definition: object.h:86
Definition: rect.h:35
Definition: rp_object.h:53
Definition: text_object.h:38
Definition: movie_object.h:39
Definition: string.h:38
Definition: afxwin.h:27
Definition: expression.h:33
Definition: point.h:32
Definition: list.h:60
Definition: var.h:33
Definition: bitmap.h:57