gfio: use G_OBJECT(), not GTK_OBJECT()
[fio.git] / gfio.h
CommitLineData
53e0e85d
JA
1#ifndef GFIO_H
2#define GFIO_H
3
4#include <gtk/gtk.h>
5
41666588
JA
6#include "stat.h"
7#include "thread_options.h"
49c34176 8#include "ghelpers.h"
8dfd6071 9#include "graph.h"
49c34176 10
53e0e85d
JA
11struct probe_widget {
12 GtkWidget *hostname;
13 GtkWidget *os;
14 GtkWidget *arch;
15 GtkWidget *fio_ver;
16};
17
53e0e85d
JA
18struct eta_widget {
19 GtkWidget *names;
20 struct multitext_widget iotype;
21 struct multitext_widget bs;
22 struct multitext_widget ioengine;
23 struct multitext_widget iodepth;
24 GtkWidget *jobs;
25 GtkWidget *files;
26 GtkWidget *read_bw;
27 GtkWidget *read_iops;
28 GtkWidget *cr_bw;
29 GtkWidget *cr_iops;
30 GtkWidget *write_bw;
31 GtkWidget *write_iops;
32 GtkWidget *cw_bw;
33 GtkWidget *cw_iops;
34};
35
36struct gfio_graphs {
37#define DRAWING_AREA_XDIM 1000
38#define DRAWING_AREA_YDIM 400
39 GtkWidget *drawing_area;
40 struct graph *iops_graph;
8dfd6071
JA
41 graph_label_t read_iops;
42 graph_label_t write_iops;
53e0e85d 43 struct graph *bandwidth_graph;
8dfd6071
JA
44 graph_label_t read_bw;
45 graph_label_t write_bw;
53e0e85d
JA
46};
47
48/*
49 * Main window widgets and data
50 */
51struct gui {
52 GtkUIManager *uimanager;
53 GtkRecentManager *recentmanager;
54 GtkActionGroup *actiongroup;
55 guint recent_ui_id;
56 GtkWidget *menu;
57 GtkWidget *window;
58 GtkWidget *vbox;
59 GtkWidget *thread_status_pb;
60 GtkWidget *buttonbox;
61 GtkWidget *notebook;
62 GtkWidget *error_info_bar;
63 GtkWidget *error_label;
64 GtkListStore *log_model;
65 GtkWidget *log_tree;
66 GtkWidget *log_view;
67 struct gfio_graphs graphs;
68 struct probe_widget probe;
69 struct eta_widget eta;
70 pthread_t server_t;
71
72 pthread_t t;
73 int handler_running;
74
b98ab718 75 GHashTable *ge_hash;
53e0e85d
JA
76} main_ui;
77
78enum {
79 GE_STATE_NEW = 1,
80 GE_STATE_CONNECTED,
81 GE_STATE_JOB_SENT,
82 GE_STATE_JOB_STARTED,
83 GE_STATE_JOB_RUNNING,
84 GE_STATE_JOB_DONE,
85};
86
87enum {
88 GFIO_BUTTON_CONNECT = 0,
89 GFIO_BUTTON_SEND,
90 GFIO_BUTTON_START,
91 GFIO_BUTTON_NR,
92};
93
94/*
95 * Notebook entry
96 */
97struct gui_entry {
53e0e85d
JA
98 struct gui *ui;
99
100 GtkWidget *vbox;
101 GtkWidget *job_notebook;
102 GtkWidget *thread_status_pb;
103 GtkWidget *buttonbox;
104 GtkWidget *button[GFIO_BUTTON_NR];
105 GtkWidget *notebook;
106 GtkWidget *error_info_bar;
107 GtkWidget *error_label;
108 GtkWidget *results_window;
109 GtkWidget *results_notebook;
110 GtkUIManager *results_uimanager;
111 GtkWidget *results_menu;
112 GtkWidget *disk_util_vbox;
113 GtkListStore *log_model;
114 GtkWidget *log_tree;
115 GtkWidget *log_view;
116 struct gfio_graphs graphs;
117 struct probe_widget probe;
118 struct eta_widget eta;
119 GtkWidget *page_label;
120 gint page_num;
121 unsigned int state;
122
123 struct graph *clat_graph;
124 struct graph *lat_bucket_graph;
125
126 struct gfio_client *client;
0cf3ece0
JA
127 char *job_file;
128 char *host;
129 int port;
130 int type;
131 int server_start;
53e0e85d
JA
132};
133
134struct end_results {
135 struct group_run_stats gs;
136 struct thread_stat ts;
137};
138
cf3d8241
JA
139struct gfio_client_options {
140 struct flist_head list;
141 struct thread_options o;
142};
143
53e0e85d
JA
144struct gfio_client {
145 struct gui_entry *ge;
146 struct fio_client *client;
147 GtkWidget *err_entry;
753e9e64 148
cf3d8241 149 struct flist_head o_list;
753e9e64 150 unsigned int o_list_nr;
53e0e85d
JA
151
152 struct end_results *results;
153 unsigned int nr_results;
154
155 struct cmd_du_pdu *du;
156 unsigned int nr_du;
157};
158
53e0e85d
JA
159#define GFIO_MIME "text/fio"
160
1252d8f2
JA
161extern void gfio_view_log(struct gui *ui);
162extern void gfio_set_state(struct gui_entry *ge, unsigned int state);
163extern void clear_ge_ui_info(struct gui_entry *ge);
164
165extern const char *gfio_graph_font;
166extern GdkColor gfio_color_white;
167
53e0e85d 168#endif