~ubuntu-branches/ubuntu/oneiric/rhythmbox/oneiric

« back to all changes in this revision

Viewing changes to lib/rb-thread.h

  • Committer: Bazaar Package Importer
  • Author(s): Rico Tzschichholz
  • Date: 2011-07-29 16:41:38 UTC
  • mto: This revision was merged to the branch mainline in revision 191.
  • Revision ID: james.westby@ubuntu.com-20110729164138-wwicy8nqalm18ck7
Tags: upstream-2.90.1~20110802
ImportĀ upstreamĀ versionĀ 2.90.1~20110802

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  Copyright (C) 2005 Colin Walters <walters@verbum.org>
3
 
 *
4
 
 *  This program is free software; you can redistribute it and/or modify
5
 
 *  it under the terms of the GNU General Public License as published by
6
 
 *  the Free Software Foundation; either version 2 of the License, or
7
 
 *  (at your option) any later version.
8
 
 *
9
 
 *  The Rhythmbox authors hereby grant permission for non-GPL compatible
10
 
 *  GStreamer plugins to be used and distributed together with GStreamer
11
 
 *  and Rhythmbox. This permission is above and beyond the permissions granted
12
 
 *  by the GPL license by which Rhythmbox is covered. If you modify this code
13
 
 *  you may extend this exception to your version of the code, but you are not
14
 
 *  obligated to do so. If you do not wish to do so, delete this exception
15
 
 *  statement from your version.
16
 
 *
17
 
 *  This program is distributed in the hope that it will be useful,
18
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
 *  GNU General Public License for more details.
21
 
 *
22
 
 *  You should have received a copy of the GNU General Public License
23
 
 *  along with this program; if not, write to the Free Software
24
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
25
 
 *
26
 
 */
27
 
 
28
 
#ifndef __RB_THREAD_H
29
 
#define __RB_THREAD_H
30
 
 
31
 
#include <glib-object.h>
32
 
 
33
 
G_BEGIN_DECLS
34
 
 
35
 
#define RB_TYPE_THREAD         (rb_thread_get_type ())
36
 
#define RB_THREAD(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_THREAD, RBThread))
37
 
#define RB_THREAD_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_THREAD, RBThreadClass))
38
 
#define RB_IS_THREAD(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_THREAD))
39
 
#define RB_IS_THREAD_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_THREAD))
40
 
#define RB_THREAD_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_THREAD, RBThreadClass))
41
 
 
42
 
typedef struct RBThreadPrivate RBThreadPrivate;
43
 
 
44
 
typedef struct
45
 
{
46
 
        GObject parent;
47
 
 
48
 
        RBThreadPrivate *priv;
49
 
} RBThread;
50
 
 
51
 
typedef struct
52
 
{
53
 
        GObjectClass parent;
54
 
} RBThreadClass;
55
 
 
56
 
typedef gpointer (*RBThreadActionFunc)        (gpointer data, gpointer user_data, gint *exit_flag);
57
 
typedef void (*RBThreadResultFunc)        (gpointer data, gpointer user_data);
58
 
typedef void (*RBThreadActionDestroyFunc) (gpointer data, gpointer user_data);
59
 
typedef void (*RBThreadResultDestroyFunc) (gpointer result, gpointer user_data);
60
 
 
61
 
GType           rb_thread_get_type              (void);
62
 
 
63
 
RBThread *      rb_thread_new                   (GMainContext *context,
64
 
                                                 RBThreadActionFunc action_cb,
65
 
                                                 RBThreadResultFunc result_cb,
66
 
                                                 RBThreadActionDestroyFunc action_destroy_func,
67
 
                                                 RBThreadResultDestroyFunc result_destroy_func,
68
 
                                                 gpointer user_data);
69
 
 
70
 
void            rb_thread_push_action           (RBThread *thread,
71
 
                                                 gpointer  action);
72
 
 
73
 
void            rb_thread_terminate             (RBThread *thread);
74
 
 
75
 
G_END_DECLS
76
 
 
77
 
#endif /* __RB_THREAD_H */