summaryrefslogtreecommitdiff
path: root/ohmd/ohm-plugin-internal.h
blob: 00eea75a1a4f086c7192b64572eaebe79644d5b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * Copyright (C) 2007 Richard Hughes <richard@hughsie.com>
 *
 * Licensed under the GNU Lesser General Public License Version 2
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef __OHM_PLUGIN_INTERNAL_H
#define __OHM_PLUGIN_INTERNAL_H

#include <glib-object.h>
#include "ohm-plugin.h"

G_BEGIN_DECLS

#define OHM_TYPE_PLUGIN		(ohm_plugin_get_type ())
#define OHM_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), OHM_TYPE_PLUGIN, OhmPlugin))
#define OHM_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), OHM_TYPE_PLUGIN, OhmPluginClass))
#define OHM_IS_PLUGIN(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), OHM_TYPE_PLUGIN))
#define OHM_IS_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), OHM_TYPE_PLUGIN))
#define OHM_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), OHM_TYPE_PLUGIN, OhmPluginClass))

typedef struct _OhmPluginPrivate OhmPluginPrivate;
typedef struct _OhmPluginClass OhmPluginClass;

struct _OhmPlugin
{
	GObject		 parent;
	const OhmPluginDesc *desc;
	const OhmPluginKeyIdMap *interested;
	const char **provides;
	const char **requires;
	const char **suggests;
	const char **prevents;
	OhmPluginPrivate *priv;
};

struct _OhmPluginClass
{
	GObjectClass	parent_class;
};

GType		 ohm_plugin_get_type			(void);
OhmPlugin	*ohm_plugin_new				(void);

gboolean	 ohm_plugin_load			(OhmPlugin      *plugin,
							 const gchar	*name);

const gchar	*ohm_plugin_get_name			(OhmPlugin	*plugin);
const gchar	*ohm_plugin_get_version			(OhmPlugin	*plugin);
const gchar	*ohm_plugin_get_author			(OhmPlugin	*plugin);
gboolean	 ohm_plugin_notify			(OhmPlugin      *plugin,
							 const char	*key,
							 gint		 id,
							 gint		 value);

gboolean	 ohm_plugin_initialize			(OhmPlugin      *plugin);

G_END_DECLS

#endif /* __OHM_PLUGIN_INTERNAL_H */