xref: /haiku/src/apps/processcontroller/MemoryBarMenuItem.h (revision c05253c64ed5afe485062830e21ff448a48bc741)
1 /*
2  * Copyright 2000, Georges-Edouard Berenger. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _MEMORY_BAR_MENU_ITEM_H_
6 #define _MEMORY_BAR_MENU_ITEM_H_
7 
8 
9 #include <MenuItem.h>
10 
11 class BBitmap;
12 
13 
14 class MemoryBarMenuItem : public BMenuItem {
15 	public:
16 						MemoryBarMenuItem(const char *label, team_id team,
17 							BBitmap* icon, bool deleteIcon, BMessage* message);
18 		virtual			~MemoryBarMenuItem();
19 
20 		virtual	void	DrawContent();
21 		virtual	void	GetContentSize(float* _width, float* _height);
22 
23 		void			DrawIcon();
24 		void			DrawBar(bool force);
25 		int				UpdateSituation(int64 committedMemory);
26 		void			BarUpdate();
27 		void			Init();
28 		void			Reset(char* name, team_id team, BBitmap* icon, bool deleteIcon);
29 
30 	private:
31 		int64			fPhysicalMemory;
32 		int64			fCommittedMemory;
33 		int64			fWriteMemory;
34 		int64			fAllMemory;
35 		int64			fLastCommitted;
36 		int64			fLastWrite;
37 		int64			fLastAll;
38 		team_id			fTeamID;
39 		BBitmap*		fIcon;
40 		double			fGrenze1;
41 		double			fGrenze2;
42 		bool			fDeleteIcon;
43 };
44 
45 #endif // _MEMORY_BAR_MENU_ITEM_H_
46