xref: /haiku/headers/os/interface/Picture.h (revision d734a8ce5a83e48e17a2d0d6635090d48c5ad161)
1 /*******************************************************************************
2 /
3 /	File:			Picture.h
4 /
5 /   Description:    BPicture records a series of drawing instructions that can
6 /                   be "replayed" later.
7 /
8 /	Copyright 1995-98, Be Incorporated, All Rights Reserved
9 /
10 *******************************************************************************/
11 
12 #ifndef	_PICTURE_H
13 #define	_PICTURE_H
14 
15 #include <BeBuild.h>
16 #include <InterfaceDefs.h>
17 #include <Rect.h>
18 #include <Archivable.h>
19 
20 class BView;
21 struct _BPictureExtent_;
22 
23 /*----------------------------------------------------------------*/
24 /*----- BPicture class -------------------------------------------*/
25 
26 class BPicture : public BArchivable {
27 public:
28 							BPicture();
29 							BPicture(const BPicture &original);
30 							BPicture(BMessage *data);
31 virtual						~BPicture();
32 static	BArchivable			*Instantiate(BMessage *data);
33 virtual	status_t			Archive(BMessage *data, bool deep = true) const;
34 virtual	status_t			Perform(perform_code d, void *arg);
35 
36 		status_t			Play(void **callBackTable,
37 								int32 tableEntries,
38 								void *userData);
39 
40 		status_t			Flatten(BDataIO *stream);
41 		status_t			Unflatten(BDataIO *stream);
42 
43 /*----- Private or reserved -----------------------------------------*/
44 private:
45 
46 friend class BWindow;
47 friend class BView;
48 friend class BPrintJob;
49 
50 virtual	void				_ReservedPicture1();
51 virtual	void				_ReservedPicture2();
52 virtual	void				_ReservedPicture3();
53 
54 		BPicture			&operator=(const BPicture &);
55 
56 		void				init_data();
57 		void				import_data(const void *data, int32 size, BPicture **subs, int32 subCount);
58 		void				import_old_data(const void *data, int32 size);
59 		void				set_token(int32 token);
60 		bool				assert_local_copy();
61 		bool				assert_old_local_copy();
62 		bool				assert_server_copy();
63 
64 		/**Deprecated API**/
65 							BPicture(const void *data, int32 size);
66 		const void			*Data() const;
67 		int32				DataSize() const;
68 
69 		void				usurp(BPicture *lameDuck);
70 		BPicture			*step_down();
71 
72 		int32				token;
73 		_BPictureExtent_	*extent;
74 		BPicture			*usurped;
75 		uint32				_reserved[3];
76 };
77 
78 /*-------------------------------------------------------------*/
79 /*-------------------------------------------------------------*/
80 
81 #endif /* _PICTURE_H */
82