gfio: move more code to ghelpers.c
[fio.git] / gfio.c
diff --git a/gfio.c b/gfio.c
index 675a87754777bad33f6ff8e02c2f6c4626bce319..5413da29d7fd153f82f054e91725e9b16c9d067c 100644 (file)
--- a/gfio.c
+++ b/gfio.c
@@ -76,7 +76,7 @@ static struct button_spec {
 
 static void gfio_update_thread_status(struct gui_entry *ge, char *status_message, double perc);
 static void gfio_update_thread_status_all(char *status_message, double perc);
-void report_error(GError *error);
+static void report_error(GError *error);
 
 static struct graph *setup_iops_graph(void)
 {
@@ -117,54 +117,6 @@ static void setup_graphs(struct gfio_graphs *g)
        g->bandwidth_graph = setup_bandwidth_graph();
 }
 
-static void multitext_add_entry(struct multitext_widget *mt, const char *text)
-{
-       mt->text = realloc(mt->text, (mt->max_text + 1) * sizeof(char *));
-       mt->text[mt->max_text] = strdup(text);
-       mt->max_text++;
-}
-
-static void multitext_set_entry(struct multitext_widget *mt, unsigned int index)
-{
-       if (index >= mt->max_text)
-               return;
-       if (!mt->text || !mt->text[index])
-               return;
-
-       mt->cur_text = index;
-       gtk_entry_set_text(GTK_ENTRY(mt->entry), mt->text[index]);
-}
-
-static void multitext_update_entry(struct multitext_widget *mt,
-                                  unsigned int index, const char *text)
-{
-       if (!mt->text)
-               return;
-
-       if (mt->text[index])
-               free(mt->text[index]);
-
-       mt->text[index] = strdup(text);
-       if (mt->cur_text == index)
-               gtk_entry_set_text(GTK_ENTRY(mt->entry), mt->text[index]);
-}
-
-static void multitext_free(struct multitext_widget *mt)
-{
-       int i;
-
-       gtk_entry_set_text(GTK_ENTRY(mt->entry), "");
-
-       for (i = 0; i < mt->max_text; i++) {
-               if (mt->text[i])
-                       free(mt->text[i]);
-       }
-
-       free(mt->text);
-       mt->cur_text = -1;
-       mt->max_text = 0;
-}
-
 static void clear_ge_ui_info(struct gui_entry *ge)
 {
        gtk_label_set_text(GTK_LABEL(ge->probe.hostname), "");
@@ -359,51 +311,6 @@ static void gfio_set_state(struct gui_entry *ge, unsigned int state)
        update_button_states(ge->ui, ge);
 }
 
-#define ALIGN_LEFT 1
-#define ALIGN_RIGHT 2
-#define INVISIBLE 4
-#define UNSORTABLE 8
-
-GtkTreeViewColumn *tree_view_column(GtkWidget *tree_view, int index, const char *title, unsigned int flags)
-{
-       GtkCellRenderer *renderer;
-       GtkTreeViewColumn *col;
-       double xalign = 0.0; /* left as default */
-       PangoAlignment align;
-       gboolean visible;
-
-       align = (flags & ALIGN_LEFT) ? PANGO_ALIGN_LEFT :
-               (flags & ALIGN_RIGHT) ? PANGO_ALIGN_RIGHT :
-               PANGO_ALIGN_CENTER;
-       visible = !(flags & INVISIBLE);
-
-       renderer = gtk_cell_renderer_text_new();
-       col = gtk_tree_view_column_new();
-
-       gtk_tree_view_column_set_title(col, title);
-       if (!(flags & UNSORTABLE))
-               gtk_tree_view_column_set_sort_column_id(col, index);
-       gtk_tree_view_column_set_resizable(col, TRUE);
-       gtk_tree_view_column_pack_start(col, renderer, TRUE);
-       gtk_tree_view_column_add_attribute(col, renderer, "text", index);
-       gtk_object_set(GTK_OBJECT(renderer), "alignment", align, NULL);
-       switch (align) {
-       case PANGO_ALIGN_LEFT:
-               xalign = 0.0;
-               break;
-       case PANGO_ALIGN_CENTER:
-               xalign = 0.5;
-               break;
-       case PANGO_ALIGN_RIGHT:
-               xalign = 1.0;
-               break;
-       }
-       gtk_cell_renderer_set_alignment(GTK_CELL_RENDERER(renderer), xalign, 0.5);
-       gtk_tree_view_column_set_visible(col, visible);
-       gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), col);
-       return col;
-}
-
 static void gfio_ui_setup_log(struct gui *ui)
 {
        GtkTreeSelection *selection;
@@ -1993,7 +1900,7 @@ static void on_info_bar_response(GtkWidget *widget, gint response,
        }
 }
 
-void report_error(GError *error)
+static void report_error(GError *error)
 {
        struct gui *ui = &main_ui;