summaryrefslogtreecommitdiffstats
path: root/kcontrol/info/memory.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /kcontrol/info/memory.h
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/info/memory.h')
-rw-r--r--kcontrol/info/memory.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/kcontrol/info/memory.h b/kcontrol/info/memory.h
new file mode 100644
index 000000000..7f6778c75
--- /dev/null
+++ b/kcontrol/info/memory.h
@@ -0,0 +1,67 @@
+#ifndef _MEMORY_H_KDEINFO_INCLUDED_
+#define _MEMORY_H_KDEINFO_INCLUDED_
+
+#include <qwidget.h>
+#include <qframe.h>
+#include <qlabel.h>
+#include <qtabdialog.h>
+#include <qpushbutton.h>
+#include <qtimer.h>
+
+#include <kcmodule.h>
+#include <kaboutdata.h>
+#include <config.h>
+
+#ifdef HAVE_LONG_LONG
+/* better to use long-long, because some 32bit-machines have more total
+ memory (with swap) than just the 4GB which fits into a 32bit-long */
+typedef unsigned long long t_memsize;
+#else
+typedef unsigned long t_memsize;
+#endif
+
+#define COLOR_USED_MEMORY QColor(255,0,0)
+#define COLOR_USED_SWAP QColor(255,134,64)
+#define COLOR_FREE_MEMORY QColor(127,255,212)
+
+class KMemoryWidget:public KCModule {
+ Q_OBJECT
+
+ public:
+ KMemoryWidget(QWidget * parent, const char *name = 0);
+ ~KMemoryWidget();
+
+ QString quickHelp() const;
+
+ private:
+ QString Not_Available_Text;
+ QTimer *timer;
+
+ bool ram_colors_initialized,
+ swap_colors_initialized,
+ all_colors_initialized;
+
+ QColor ram_colors[4];
+ QString ram_text[4];
+
+ QColor swap_colors[2];
+ QString swap_text[2];
+
+ QColor all_colors[3];
+ QString all_text[3];
+
+ void update();
+
+ bool Display_Graph(int widgetindex,
+ int count,
+ t_memsize total,
+ t_memsize *used,
+ QColor *color,
+ QString *text);
+ public slots:
+ void update_Values();
+};
+
+
+#endif // _MEMORY_H_KDEINFO_INCLUDED_
+