23 #ifndef BAGEL_BAGLIB_OBJECT_H 24 #define BAGEL_BAGLIB_OBJECT_H 26 #include "bagel/spacebar/baglib/expression.h" 27 #include "bagel/spacebar/baglib/res.h" 28 #include "bagel/spacebar/boflib/gfx/bitmap.h" 29 #include "bagel/boflib/string.h" 30 #include "bagel/spacebar/baglib/parse_object.h" 36 typedef void *(*BagFuncPtr)(int,
void *);
40 BMP_OBJ = BOF_BMP_OBJ,
41 SPRITE_OBJ = BOF_SPRITE_OBJ,
42 BUTTON_OBJ = BOF_BUTTON_OBJ,
43 SOUND_OBJ = BOF_SOUND_OBJ,
44 LINK_OBJ = BOF_LINK_OBJ,
45 TEXT_OBJ = BOF_TEXT_OBJ,
46 CHAR_OBJ = BOF_CHAR_OBJ,
47 VAR_OBJ = BOF_VAR_OBJ,
48 AREA_OBJ = BOF_AREA_OBJ,
49 EXPRESS_OBJ = BOF_EXPRESS_OBJ,
50 COMMAND_OBJ = BOF_COMM_OBJ,
51 MOVIE_OBJ = BOF_MOVIE_OBJ,
52 THING_OBJ = BOF_THING_OBJ,
53 RESPRNT_OBJ = BOF_RESPRNT_OBJ,
54 DOSSIER_OBJ = BOF_DOSSIER_OBJ,
58 enum BAG_OBJECT_PROPERTIES {
81 CBofString getStringTypeOfObject(BagObjectType n);
98 uint16 _xObjType = AREA_OBJ;
101 uint16 _nProperties = 0;
106 byte _nOverCursor = 0;
108 byte _bMsgWaiting : 1;
109 byte _bAlwaysUpdate : 1;
113 byte _bInteractive = 0;
116 bool isProperty(BAG_OBJECT_PROPERTIES xProp) {
117 return _nProperties & xProp;
120 void setProperty(BAG_OBJECT_PROPERTIES xProp,
bool bVal);
126 bool isInteractive() {
127 return _bInteractive;
129 void setInteractive(
bool b) {
130 _bInteractive = (byte)b;
134 virtual bool runCallBack() {
138 virtual BagFuncPtr getCallBack() {
143 virtual bool runObject();
153 ErrorCode attach()
override;
154 ErrorCode detach()
override;
156 BagObjectType getType() {
157 return (BagObjectType)_xObjType;
159 void setType(BagObjectType nType) {
160 _xObjType = (uint16)nType;
164 virtual bool isInside(
const CBofPoint &xPoint) {
165 return getRect().ptInRect(xPoint);
170 return isProperty(MOVABLE);
172 void setMovable(
bool b =
true) {
173 setProperty(MOVABLE, b);
176 bool isStretchable() {
177 return isProperty(STRETCH);
179 void setStretchable(
bool b =
true) {
180 setProperty(STRETCH, b);
184 return isProperty(MODAL);
186 void setModal(
bool b =
true) {
187 setProperty(MODAL, b);
189 virtual bool isModalDone() {
194 return isProperty(VISIBLE);
196 void setVisible(
bool b =
true) {
197 setProperty(VISIBLE, b);
201 return isProperty(HIGHLIGHT);
203 void setHighlight(
bool b =
true) {
204 setProperty(HIGHLIGHT, b);
208 return isProperty(ACTIVE);
210 void setActive(
bool b =
true) {
211 setProperty(ACTIVE, b);
214 bool isTransparent() {
215 return isProperty(TRANSPAR);
218 virtual void setTransparent(
bool b =
true) {
219 setProperty(TRANSPAR, b);
222 bool isHideOnClick() {
223 return isProperty(HIDEONCLK);
225 void setHideOnClick(
bool b =
true) {
226 setProperty(HIDEONCLK, b);
229 bool isImmediateRun() {
230 return isProperty(IMRUN);
232 void setImmediateRun(
bool b =
true) {
233 setProperty(IMRUN, b);
237 return isProperty(LOCAL);
239 void setLocal(
bool b =
true) {
240 setProperty(LOCAL, b);
244 return isProperty(NEGATIVE);
246 void setNegative(
bool b =
true) {
247 setProperty(NEGATIVE, b);
250 bool isConstantUpdate() {
251 return isProperty(CONUPDATE);
253 void setConstantUpdate(
bool b =
true) {
254 setProperty(CONUPDATE, b);
258 return isProperty(TIMELESS);
261 void setTimeless(
bool b =
true);
264 return isProperty(FLOATING);
266 void setFloating(
bool b =
true) {
267 setProperty(FLOATING, b);
271 return isProperty(PRELOAD);
273 void setPreload(
bool b =
true) {
274 setProperty(PRELOAD, b);
278 void setForeGround(
bool b =
true);
280 void setProperties(
int nProperties);
283 virtual const CBofString *getInitInfo()
const;
284 virtual void setInitInfo(
const CBofString &) {
286 virtual int getProperty(
const CBofString &sProp);
287 virtual void setProperty(
const CBofString &,
int nVal);
293 void setDirty(
bool b =
true) {
298 bool isMsgWaiting() {
299 return _bMsgWaiting != 0;
302 void setMsgWaiting(
bool b =
true) {
303 _bMsgWaiting = (byte)b;
306 bool isAlwaysUpdate() {
307 return _bAlwaysUpdate != 0;
310 void setAlwaysUpdate(
bool b =
true) {
311 _bAlwaysUpdate = (byte)b;
318 void setNoMenu(
bool b =
true) {
323 virtual int getRefId();
324 virtual int getOverCursor();
325 virtual int getState();
331 virtual void setFileName(
const CBofString &s);
332 virtual void setSize(
const CBofSize &) {
334 virtual void setRefId(
int id);
335 virtual void setOverCursor(
int curs);
336 virtual void setState(
int state);
337 virtual void setMenuPtr(
CBagMenu *pm);
338 virtual void setPosition(
const CBofPoint &pos);
350 virtual void onLButtonDown(uint32 ,
CBofPoint *,
void * =
nullptr) {
352 virtual void onLButtonUp(uint32 ,
CBofPoint *,
void * =
nullptr);
353 virtual bool onMouseMove(uint32 ,
CBofPoint ,
void * =
nullptr);
354 virtual bool onMouseOver(uint32 ,
CBofPoint ,
void * =
nullptr);
357 inline void CBagObject::setFileName(
const CBofString &s) {
361 inline void CBagObject::setMenuPtr(
CBagMenu *pm) {
Definition: ifstream.h:32
Definition: parse_object.h:48
Definition: expression.h:33
ParseCodes setInfo(CBagIfstream &istr) override
Definition: storage_dev_win.h:79