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