Loading...
Searching...
No Matches
dbus-server.h
Go to the documentation of this file.
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_DBUS_SERVER_H_
#define _PURPLE_DBUS_SERVER_H_
#include "dbus-purple.h"
#include "value.h"
G_BEGIN_DECLS
typedef struct _PurpleDBusType PurpleDBusType;
struct _PurpleDBusType {
PurpleDBusType *parent;
};
#include "dbus-bindings.h"
/* By convention, the PurpleDBusType variable representing each structure
PurpleSomeStructure has the name PURPLE_DBUS_TYPE_PurpleSomeStructure.
The following macros facilitate defining such variables
#PURPLE_DBUS_DECLARE_TYPE declares an extern variable representing a
given type, for use in header files.
#PURPLE_DBUS_DEFINE_TYPE defines a variable representing a given
type, use in .c files. It defines a new type without a parent; for
types with a parent use #PURPLE_DBUS_DEFINE_INHERITING_TYPE.
*/
#define PURPLE_DBUS_TYPE(type) (&PURPLE_DBUS_TYPE_##type)
#define PURPLE_DBUS_DECLARE_TYPE(type) \
extern PurpleDBusType PURPLE_DBUS_TYPE_##type;
#define PURPLE_DBUS_DEFINE_TYPE(type) \
PurpleDBusType PURPLE_DBUS_TYPE_##type = { NULL };
#define PURPLE_DBUS_DEFINE_INHERITING_TYPE(type, parent) \
PurpleDBusType PURPLE_DBUS_TYPE_##type = { PURPLE_DBUS_TYPE(parent) };
#define PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin) \
if (purple_dbus_get_init_error() != NULL) \
{ \
gchar *title; \
title = g_strdup_printf("Unable to Load %s Plugin", plugin->info->name); \
purple_notify_error(NULL, title, \
_("Purple's D-BUS server is not running for the reason listed below"), \
_(purple_dbus_get_init_error())); \
g_free(title); \
return FALSE; \
}
void purple_dbus_init_ids(void);
void purple_dbus_register_pointer(gpointer node, PurpleDBusType *type);
void purple_dbus_unregister_pointer(gpointer node);
void purple_dbus_signal_emit_purple(const char *name, int num_values,
PurpleValue **values, va_list vargs);
const char *purple_dbus_get_init_error(void);
void *purple_dbus_get_handle(void);
gboolean purple_dbus_is_owner(void);
void purple_dbus_init(void);
void purple_dbus_uninit(void);
#ifndef DBUS_EXPORT
#define DBUS_EXPORT
#endif
/*
Here we include the list of #PURPLE_DBUS_DECLARE_TYPE statements for
all structs defined in purple. This file has been generated by the
#dbus-analyze-types.py script.
*/
#include "dbus-types.h"
G_END_DECLS
#endif /* _PURPLE_DBUS_SERVER_H_ */
dbus-bindings.h
Purple DBUS Bindings.
PurpleDBusType
typedefG_BEGIN_DECLS struct _PurpleDBusType PurpleDBusType
Types of pointers are identified by the ADDRESS of a PurpleDbusType object.
Definition dbus-server.h:48
purple_dbus_uninit
void purple_dbus_uninit(void)
Uninitializes Purple's D-BUS server.
purple_dbus_register_pointer
void purple_dbus_register_pointer(gpointer node, PurpleDBusType *type)
Registers a typed pointer.
purple_dbus_get_init_error
const char * purple_dbus_get_init_error(void)
Returns whether Purple's D-BUS subsystem is up and running.
purple_dbus_unregister_pointer
void purple_dbus_unregister_pointer(gpointer node)
Unregisters a pointer previously registered with purple_dbus_register_pointer.
purple_dbus_is_owner
gboolean purple_dbus_is_owner(void)
Determines whether this instance owns the DBus service name.
purple_dbus_init_ids
void purple_dbus_init_ids(void)
Initializes purple dbus pointer registration engine.
purple_dbus_init
void purple_dbus_init(void)
Starts Purple's D-BUS server.
purple_dbus_signal_emit_purple
void purple_dbus_signal_emit_purple(const char *name, int num_values, PurpleValue **values, va_list vargs)
Emits a dbus signal.
purple_dbus_get_handle
void * purple_dbus_get_handle(void)
Returns the dbus subsystem handle.
PurpleValue
A wrapper for a type, subtype, and specific type of value.
Definition value.h:90
_PurpleDBusType
Definition dbus-server.h:50
value.h
Value wrapper API.