source: trunk/gtk/tr_backend.h @ 249

Last change on this file since 249 was 249, checked in by joshe, 16 years ago

Some minor code cleanups.
Handle things a little better when quitting.

File size: 1.4 KB
Line 
1#ifndef TR_BACKEND_H
2#define TR_BACKEND_H
3
4#include <glib-object.h>
5
6#include "transmission.h"
7#include "bencode.h"
8
9#define TR_BACKEND_TYPE           (tr_backend_get_type ())
10#define TR_BACKEND(obj) \
11  (G_TYPE_CHECK_INSTANCE_CAST ((obj), TR_BACKEND_TYPE, TrBackend))
12#define TR_BACKEND_CLASS(klass) \
13  (G_TYPE_CHECK_CLASS_CAST ((klass), TR_BACKEND_TYPE, TrBackendClass))
14#define TR_IS_BACKEND(obj) \
15  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TR_BACKEND_TYPE))
16#define TR_IS_BACKEND_CLASS(klass) \
17  (G_TYPE_CHECK_CLASS_TYPE ((klass), TR_BACKEND_TYPE))
18#define TR_BACKEND_GET_CLASS(obj) \
19  (G_TYPE_INSTANCE_GET_CLASS ((obj), TR_BACKEND_TYPE, TrBackendClass))
20
21typedef struct _TrBackend TrBackend;
22typedef struct _TrBackendClass TrBackendClass;
23
24/* treat the contents of this structure as private */
25struct _TrBackend {
26  GObject parent;
27  tr_handle_t *handle;
28  GList *torrents;
29  gboolean disposed;
30};
31
32struct _TrBackendClass {
33  GObjectClass parent;
34};
35
36GType
37tr_backend_get_type(void);
38
39TrBackend *
40tr_backend_new(void);
41
42tr_handle_t *
43tr_backend_handle(TrBackend *back);
44
45void
46tr_backend_save_state(TrBackend *back, char **errstr);
47
48GList *
49tr_backend_load_state(TrBackend *back, benc_val_t *state, GList **errors);
50
51void
52tr_backend_stop_torrents(TrBackend *back);
53
54gboolean
55tr_backend_torrents_stopped(TrBackend *back);
56
57#ifdef TR_WANT_BACKEND_PRIVATE
58void
59tr_backend_add_torrent(TrBackend *back, GObject *tor);
60#endif
61
62#endif
Note: See TracBrowser for help on using the repository browser.