~ubuntu-branches/ubuntu/trusty/parole/trusty-proposed

« back to all changes in this revision

Viewing changes to plugins/sample/sample-provider.c

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2010-04-28 21:42:11 UTC
  • Revision ID: james.westby@ubuntu.com-20100428214211-i7olyr9ch8tnpnaf
Tags: upstream-0.2.0.2
ImportĀ upstreamĀ versionĀ 0.2.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * * Copyright (C) 2009 Ali <aliov@xfce.org>
 
3
 *
 
4
 * Licensed under the GNU General Public License Version 2
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 */
 
20
 
 
21
#ifdef HAVE_CONFIG_H
 
22
#include <config.h>
 
23
#endif
 
24
 
 
25
#include "sample-provider.h"
 
26
 
 
27
static void   sample_provider_iface_init           (ParoleProviderPluginIface *iface);
 
28
static void   sample_provider_finalize             (GObject                   *object);
 
29
 
 
30
 
 
31
struct _SampleProviderClass
 
32
{
 
33
    GObjectClass parent_class;
 
34
};
 
35
 
 
36
struct _SampleProvider
 
37
{
 
38
    GObject      parent;
 
39
    ParoleProviderPlayer *player;
 
40
};
 
41
 
 
42
PAROLE_DEFINE_TYPE_WITH_CODE (SampleProvider, 
 
43
                              sample_provider, 
 
44
                              G_TYPE_OBJECT,
 
45
                              PAROLE_IMPLEMENT_INTERFACE (PAROLE_TYPE_PROVIDER_PLUGIN, 
 
46
                                                          sample_provider_iface_init));
 
47
                                                          
 
48
static gboolean sample_provider_is_configurable (ParoleProviderPlugin *plugin)
 
49
{
 
50
    return FALSE;
 
51
}
 
52
 
 
53
static void
 
54
sample_provider_set_player (ParoleProviderPlugin *plugin, ParoleProviderPlayer *player)
 
55
{
 
56
    SampleProvider *provider;
 
57
    provider = SAMPLE_PROVIDER (plugin);
 
58
    
 
59
    provider->player = player;
 
60
}
 
61
 
 
62
static void
 
63
sample_provider_iface_init (ParoleProviderPluginIface *iface)
 
64
{
 
65
    iface->get_is_configurable = sample_provider_is_configurable;
 
66
    iface->set_player = sample_provider_set_player;
 
67
}
 
68
 
 
69
static void sample_provider_class_init (SampleProviderClass *klass)
 
70
{
 
71
    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
72
    
 
73
    gobject_class->finalize = sample_provider_finalize;
 
74
}
 
75
 
 
76
static void sample_provider_init (SampleProvider *provider)
 
77
{
 
78
    provider->player = NULL;
 
79
}
 
80
 
 
81
static void sample_provider_finalize (GObject *object)
 
82
{
 
83
    G_OBJECT_CLASS (sample_provider_parent_class)->finalize (object);
 
84
}