aboutsummaryrefslogtreecommitdiff
path: root/hardinfo.h
blob: 8ba587d094cd99ee6f661c21504f63b6807afcc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef __HARDINFO_H__
#define __HARDINFO_H__

#define walk_until(x)   while((*buf != '\0') && (*buf != x)) buf++
#define walk_until_inclusive(x) walk_until(x); buf++

#define PREFIX		"/usr/share/hardinfo/"
#define IMG_PREFIX	PREFIX "pixmaps/"

#include <gtk/gtk.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>

#include "config.h"

#ifdef ENABLE_NLS
#define	INTL_PREFIX	PREFIX "lang/"
#include "intl.h"
#else
#define _(x)	(x)
#endif

typedef struct _GenericDevice	GenericDevice;
typedef enum   _DeviceType	DeviceType;

typedef struct _MainWindow	MainWindow;

enum _DeviceType {
	NONE, PCI, ISAPnP, USB,
	IDE, SCSI, SERIAL, PARPORT,
	V4L
};

struct _GenericDevice {
	gpointer device;
	DeviceType type;

	GtkCTreeNode *node;
	
	GenericDevice *next;
};

struct _MainWindow {
	GtkWidget *window;
	
	GtkWidget *ctree;
	
	GtkWidget *frame;
	GtkWidget *framec;
	
	GtkWidget *membar;
	GtkWidget *uptime;
	
	GtkWidget *recv_bytes;
	GtkWidget *recv_errors;
	GtkWidget *recv_packets;
	
	GtkWidget *trans_bytes;
	GtkWidget *trans_errors;
	GtkWidget *trans_packets;
};

extern GenericDevice *generic_devices;

#include "ide.h"
#include "scsi.h"
#include "isapnp.h"
#include "usb.h"
#include "pci.h"
#include "serial.h"
#include "parport.h"
#include "v4l.h"

#include "x11.h"
#include "net.h"

#include "about.h"

GtkCTreeNode *tree_group_new(MainWindow *mainwindow, const gchar *name,
        DeviceType type);
void tree_insert_item(MainWindow *mainwindow, GtkCTreeNode *group, gchar *name,
                gpointer data);
void hi_insert_generic(gpointer device, DeviceType type);

#endif