summaryrefslogtreecommitdiff
path: root/lib/bluetooth-plugin.h
blob: 9f6069c0c991b8eb1028592cc0eaaeb823592a0d (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
#ifndef _GNOME_BLUETOOTH_PLUGIN_H_
#define _GNOME_BLUETOOTH_PLUGIN_H_

#include <gmodule.h>
#include <gtk/gtk.h>

typedef struct _GbtPluginInfo GbtPluginInfo;
typedef struct _GbtPlugin GbtPlugin;

struct _GbtPluginInfo 
{
	const char *id;
	gboolean (* has_config_widget) (const char *bdaddr, const char **uuids);
	GtkWidget * (* get_config_widgets) (const char *bdaddr, const char **uuids);
	void (* device_removed) (const char *bdaddr);
};

struct _GbtPlugin
{
	GModule *module;
	GbtPluginInfo *info;
};

#define GBT_INIT_PLUGIN(plugininfo)					\
	gboolean gbt_init_plugin (GbtPlugin *plugin);			\
	G_MODULE_EXPORT gboolean					\
	gbt_init_plugin (GbtPlugin *plugin) {				\
		plugin->info = &(plugininfo);				\
		return TRUE;						\
	}

#define SOEXT           ("." G_MODULE_SUFFIX)
#define SOEXT_LEN       (strlen (SOEXT))

#endif /* _GNOME_BLUETOOTH_PLUGIN_H_ */