summaryrefslogtreecommitdiffstats
path: root/Meter.h
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2006-03-04 18:16:49 +0000
committerHisham Muhammad <hisham@gobolinux.org>2006-03-04 18:16:49 +0000
commitd6231bab89d634da5564491196b7c478db038505 (patch)
treebfc0bf00b138763eb41132fd27a8f389a78bf3a4 /Meter.h
Initial import.
Diffstat (limited to 'Meter.h')
-rw-r--r--Meter.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/Meter.h b/Meter.h
new file mode 100644
index 00000000..7c58c188
--- /dev/null
+++ b/Meter.h
@@ -0,0 +1,94 @@
+/* Do not edit this file. It was automatically genarated. */
+
+#ifndef HEADER_Meter
+#define HEADER_Meter
+/*
+htop
+(C) 2004-2006 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Object.h"
+#include "CRT.h"
+#include "ListItem.h"
+#include "String.h"
+
+#include <stdlib.h>
+#include <curses.h>
+#include <string.h>
+#include <math.h>
+#include <sys/param.h>
+
+#include "debug.h"
+#include <assert.h>
+
+#define METER_BARBUFFER_LEN 128
+#define METER_GRAPHBUFFER_LEN 128
+
+
+typedef struct Meter_ Meter;
+
+typedef void(*Meter_SetValues)(Meter*);
+typedef void(*Meter_Draw)(Meter*, int, int, int);
+
+typedef enum MeterMode_ {
+ UNSET,
+ BAR,
+ TEXT,
+ GRAPH,
+ LED,
+ LAST_METERMODE
+} MeterMode;
+
+struct Meter_ {
+ Object super;
+
+ int h;
+ int w;
+ Meter_Draw draw;
+ Meter_SetValues setValues;
+ int items;
+ int* attributes;
+ double* values;
+ double total;
+ char* caption;
+ char* name;
+ union {
+ RichString* rs;
+ char* c;
+ double* graph;
+ } displayBuffer;
+ MeterMode mode;
+};
+
+extern char* METER_CLASS;
+
+
+
+
+
+Meter* Meter_new(char* name, char* caption, int items);
+
+void Meter_init(Meter* this, char* name, char* caption, int items);
+
+void Meter_delete(Object* cast);
+
+
+void Meter_done(Meter* this);
+
+
+
+
+
+#define DrawDot(a,y,c) do { \
+ attrset(a); \
+ mvaddstr(y, x+k, c); \
+} while(0)
+
+
+void Meter_setMode(Meter* this, MeterMode mode);
+
+ListItem* Meter_toListItem(Meter* this);
+
+#endif

© 2014-2024 Faster IT GmbH | imprint | privacy policy