summaryrefslogtreecommitdiff
path: root/src/trg-torrent-graph.h
blob: 914a184ff0d790f857a70a901acd3c7e230af937 (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
/* trg-torrent-graph.h */

#ifndef _TRG_TORRENT_GRAPH
#define _TRG_TORRENT_GRAPH

#include <gtk/gtk.h>

#define TRG_WITH_GRAPH !GTK_CHECK_VERSION( 3, 0, 0 )

#if TRG_WITH_GRAPH

#include <glib-object.h>
#include "trg-torrent-model.h"

G_BEGIN_DECLS
#define TRG_TYPE_TORRENT_GRAPH trg_torrent_graph_get_type()
#define TRG_TORRENT_GRAPH(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRG_TYPE_TORRENT_GRAPH, TrgTorrentGraph))
#define TRG_TORRENT_GRAPH_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST ((klass), TRG_TYPE_TORRENT_GRAPH, TrgTorrentGraphClass))
#define TRG_IS_TORRENT_GRAPH(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRG_TYPE_TORRENT_GRAPH))
#define TRG_IS_TORRENT_GRAPH_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE ((klass), TRG_TYPE_TORRENT_GRAPH))
#define TRG_TORRENT_GRAPH_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), TRG_TYPE_TORRENT_GRAPH, TrgTorrentGraphClass))
    typedef struct {
    GtkVBox parent;
} TrgTorrentGraph;

typedef struct {
    GtkVBoxClass parent_class;
} TrgTorrentGraphClass;

GType trg_torrent_graph_get_type(void);

TrgTorrentGraph *trg_torrent_graph_new(GtkStyle * style);

unsigned trg_torrent_graph_get_num_bars(TrgTorrentGraph * g);

void trg_torrent_graph_clear_background();

void trg_torrent_graph_draw(TrgTorrentGraph * g);

void trg_torrent_graph_start(TrgTorrentGraph * g);

void trg_torrent_graph_stop(TrgTorrentGraph * g);

void trg_torrent_graph_change_speed(TrgTorrentGraph * g, guint new_speed);

void trg_torrent_graph_set_speed(TrgTorrentGraph * g,
                                 trg_torrent_model_update_stats * stats);
void trg_torrent_graph_set_nothing(TrgTorrentGraph * g);

G_END_DECLS

#endif
#endif /* _TRG_TORRENT_GRAPH */