view.h 1.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#ifndef _VIEW_H_
#define _VIEW_H_

#include "gui/gui.h"

/* defines the public API of views */

typedef struct view {
  void (*clear)(struct view *this);
  void (*append)(struct view *this, ...);
Cedric Roux's avatar
Cedric Roux committed
11
  void (*set)(struct view *this, char *name, ...);
12 13
} view;

Cedric Roux's avatar
Cedric Roux committed
14 15
enum xy_mode { XY_LOOP_MODE, XY_FORCED_MODE };

16 17
view *new_view_stdout(void);
view *new_view_textlist(int maxsize, float refresh_rate, gui *g, widget *w);
Cedric Roux's avatar
XY view  
Cedric Roux committed
18
view *new_view_xy(int length, float refresh_rate, gui *g, widget *w,
Cedric Roux's avatar
Cedric Roux committed
19
    int color, enum xy_mode mode);
Cedric Roux's avatar
Cedric Roux committed
20 21
view *new_view_tti(float refresh_rate, gui *g, widget *w,
    int color);
Cedric Roux's avatar
Cedric Roux committed
22 23
view *new_view_scrolltti(float refresh_rate, gui *g, widget *w,
    int color, widget *throughput_label);
Cedric Roux's avatar
Cedric Roux committed
24 25
view *new_view_time(int number_of_seconds, float refresh_rate,
    gui *g, widget *w);
26
view *new_subview_time(view *time, int line, int color, int size);
Cedric Roux's avatar
Cedric Roux committed
27 28 29
view *new_view_ticktime(float refresh_rate, gui *g, widget *w);
view *new_subview_ticktime(view *ticktime, int line, int color, int size);
void ticktime_set_tick(view *ticktime, void *logger);
30 31

#endif /* _VIEW_H_ */