source: trunk/gtk/tr_torrent.h @ 248

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

Major internal restructuring for the GTK GUI,

GObject-derived wrappers are used for tr_handle_t and tr_torrent_t.

Use bencoding to store prefs and state file.
Make sure to always group error messages when adding multiple torrents at once.
Remove some unused code.
Many miscellaneous cleanups.

File size: 1.4 KB
Line 
1#ifndef TR_TORRENT_H
2#define TR_TORRENT_H
3
4#include <glib-object.h>
5
6#include "transmission.h"
7#include "bencode.h"
8
9#define TR_TORRENT_TYPE           (tr_torrent_get_type ())
10#define TR_TORRENT(obj) \
11  (G_TYPE_CHECK_INSTANCE_CAST ((obj), TR_TORRENT_TYPE, TrTorrent))
12#define TR_TORRENT_CLASS(klass) \
13  (G_TYPE_CHECK_CLASS_CAST ((klass), TR_TORRENT_TYPE, TrTorrentClass))
14#define TR_IS_TORRENT(obj) \
15  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TR_TORRENT_TYPE))
16#define TR_IS_TORRENT_CLASS(klass) \
17  (G_TYPE_CHECK_CLASS_TYPE ((klass), TR_TORRENT_TYPE))
18#define TR_TORRENT_GET_CLASS(obj) \
19  (G_TYPE_INSTANCE_GET_CLASS ((obj), TR_TORRENT_TYPE, TrTorrentClass))
20
21typedef struct _TrTorrent TrTorrent;
22typedef struct _TrTorrentClass TrTorrentClass;
23
24/* treat the contents of this structure as private */
25struct _TrTorrent {
26  GObject parent;
27  tr_torrent_t *handle;
28  GObject *back;
29  char *dir;
30  gboolean disposed;
31};
32
33struct _TrTorrentClass {
34  GObjectClass parent;
35};
36
37GType
38tr_torrent_get_type(void);
39
40tr_torrent_t *
41tr_torrent_handle(TrTorrent *tor);
42
43tr_stat_t *
44tr_torrent_stat(TrTorrent *tor);
45
46tr_info_t *
47tr_torrent_info(TrTorrent *tor);
48
49TrTorrent *
50tr_torrent_new(GObject *backend, const char *torrent, const char *dir,
51               gboolean *paused, char **err);
52
53TrTorrent *
54tr_torrent_new_with_state(GObject *backend, benc_val_t *state, char **err);
55
56#ifdef TR_WANT_TORRENT_PRIVATE
57void
58tr_torrent_get_state(TrTorrent *tor, benc_val_t *state);
59#endif
60
61#endif
Note: See TracBrowser for help on using the repository browser.