~ubuntu-branches/ubuntu/oneiric/dbus-glib/oneiric-updates

« back to all changes in this revision

Viewing changes to test/interfaces/test-objects.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-11-01 10:51:01 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061101105101-2dbr969h8k05n1b2
Tags: 0.72-0ubuntu1
* Sync with pkg-utopia SVN. This is infact 0.72-1 which sits in NEW
* New upstream release
* debian/control:
  + Require libdbus-1-dev (>= 0.94) and libglib2.0-dev (>= 2.6)
  + Add build dependency on gtk-doc-tools (>= 1.4)
* debian/control,
  debian/libdbus-glib-1-doc.install:
  + Add libdbus-glib-1-doc package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "test-objects.h"
 
2
#include "test-interfaces.h"
 
3
 
 
4
static gboolean
 
5
test_song_dbus_get_title (TestSong  *song,
 
6
                          gchar    **title,
 
7
                          GError   **error)
 
8
{
 
9
        *title = g_strdup ("Hello, Goodbye");
 
10
        return TRUE;
 
11
}
 
12
 
 
13
#include "test-song-glue.h"
 
14
 
 
15
static gchar *
 
16
test_song_say_hello (TestHello *hello)
 
17
{
 
18
        return g_strdup ("Hello, hello...");
 
19
}
 
20
 
 
21
static void
 
22
test_song_init (TestSong *song)
 
23
{
 
24
}
 
25
 
 
26
static void
 
27
test_song_hello_init (TestHelloIface *iface)
 
28
{
 
29
        iface->say_hello = test_song_say_hello;
 
30
}
 
31
 
 
32
 
 
33
static void
 
34
test_song_class_init (TestSongClass *klass)
 
35
{
 
36
        dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass),
 
37
                                         &dbus_glib_test_song_object_info);
 
38
}
 
39
 
 
40
G_DEFINE_TYPE_WITH_CODE (TestSong, test_song, G_TYPE_OBJECT,
 
41
                         G_IMPLEMENT_INTERFACE (TEST_TYPE_HELLO, test_song_hello_init))
 
42
 
 
43
static gchar *
 
44
test_beatles_song_say_goodbye (TestGoodbye *goodbye)
 
45
{
 
46
        return g_strdup ("I don't know why you say goodbye, I say hello.");
 
47
}
 
48
 
 
49
static void
 
50
test_beatles_song_init (TestBeatlesSong *song)
 
51
{
 
52
}
 
53
 
 
54
static void
 
55
test_beatles_song_goodbye_init (TestGoodbyeIface *iface)
 
56
{
 
57
        iface->say_goodbye = test_beatles_song_say_goodbye;
 
58
}
 
59
 
 
60
static void
 
61
test_beatles_song_class_init (TestBeatlesSongClass *klass)
 
62
{
 
63
}
 
64
 
 
65
G_DEFINE_TYPE_WITH_CODE (TestBeatlesSong, test_beatles_song, TEST_TYPE_SONG,
 
66
                         G_IMPLEMENT_INTERFACE (TEST_TYPE_GOODBYE, test_beatles_song_goodbye_init))
 
67
 
 
68
 
 
69
TestBeatlesSong *
 
70
test_beatles_song_new (void)
 
71
{
 
72
        return TEST_BEATLES_SONG (g_object_new (TEST_TYPE_BEATLES_SONG, NULL));
 
73
}