|
Packit Service |
1d8f1c |
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
|
Packit Service |
1d8f1c |
/* vim:set et sts=4: */
|
|
Packit Service |
1d8f1c |
/* bus - The Input Bus
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2010 Red Hat, Inc.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
1d8f1c |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
1d8f1c |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
1d8f1c |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
1d8f1c |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
1d8f1c |
* Lesser General Public License for more details.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
1d8f1c |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
Packit Service |
1d8f1c |
* USA
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
#ifndef __BUS_DBUS_IMPL_H_
|
|
Packit Service |
1d8f1c |
#define __BUS_DBUS_IMPL_H_
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#include <gio/gio.h>
|
|
Packit Service |
1d8f1c |
#include <ibus.h>
|
|
Packit Service |
1d8f1c |
#include "connection.h"
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*
|
|
Packit Service |
1d8f1c |
* Type macros.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* define GOBJECT macros */
|
|
Packit Service |
1d8f1c |
#define BUS_TYPE_DBUS_IMPL \
|
|
Packit Service |
1d8f1c |
(bus_dbus_impl_get_type ())
|
|
Packit Service |
1d8f1c |
#define BUS_DBUS_IMPL(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_CAST ((obj), BUS_TYPE_DBUS_IMPL, BusDBusImpl))
|
|
Packit Service |
1d8f1c |
#define BUS_DBUS_IMPL_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_CAST ((klass), BUS_TYPE_DBUS_IMPL, BusDBusImplClass))
|
|
Packit Service |
1d8f1c |
#define BUS_IS_DBUS_IMPL(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUS_TYPE_DBUS_IMPL))
|
|
Packit Service |
1d8f1c |
#define BUS_IS_DBUS_IMPL_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_TYPE ((klass), BUS_TYPE_DBUS_IMPL))
|
|
Packit Service |
1d8f1c |
#define BUS_DBUS_IMPL_GET_CLASS(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_INSTANCE_GET_CLASS ((obj), BUS_TYPE_DBUS_IMPL, BusDBusImplClass))
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#define BUS_DEFAULT_DBUS \
|
|
Packit Service |
1d8f1c |
(bus_dbus_impl_get_default ())
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_BEGIN_DECLS
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
typedef struct _BusDBusImpl BusDBusImpl;
|
|
Packit Service |
1d8f1c |
typedef struct _BusDBusImplClass BusDBusImplClass;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GType bus_dbus_impl_get_type (void);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* bus_dbus_impl_get_default:
|
|
Packit Service |
1d8f1c |
* @returns: a BusDBusImpl object which is a singleton.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Instantiate a BusDBusImpl object (if necessary) and return the object.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
BusDBusImpl *bus_dbus_impl_get_default (void);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* bus_dbus_impl_new_connection:
|
|
Packit Service |
1d8f1c |
* @connection: A new connection.
|
|
Packit Service |
1d8f1c |
* @returns: TRUE
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Register all IBusServices (e.g. DBus, IBus, IBus.InputContext) to the connection so that the service_method_call function
|
|
Packit Service |
1d8f1c |
* for each service could be called.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean bus_dbus_impl_new_connection (BusDBusImpl *dbus,
|
|
Packit Service |
1d8f1c |
BusConnection *connection);
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* bus_dbus_impl_get_connection_by_name:
|
|
Packit Service |
1d8f1c |
* @name: A connection name like ":1.0" and "org.freedesktop.IBus.Panel".
|
|
Packit Service |
1d8f1c |
* @returns: A BusConnection object which corresponds to the name.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Search for an active connection whose name is name. If not found, return NULL.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
BusConnection *bus_dbus_impl_get_connection_by_name
|
|
Packit Service |
1d8f1c |
(BusDBusImpl *dbus,
|
|
Packit Service |
1d8f1c |
const gchar *name);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* bus_dbus_impl_forward_message:
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Push the message to the queue (dbus->forward_queue) and schedule a idle function call (bus_dbus_impl_forward_message_idle_cb) which
|
|
Packit Service |
1d8f1c |
* actually forwards the message to the destination. Note that the destination of the message is embedded in the message.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void bus_dbus_impl_forward_message (BusDBusImpl *dbus,
|
|
Packit Service |
1d8f1c |
BusConnection *connection,
|
|
Packit Service |
1d8f1c |
GDBusMessage *message);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* bus_dbus_impl_dispatch_message_by_rule:
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Push the message to the queue (dbus->dispatch_queue) and schedule a idle function call (bus_dbus_impl_dispatch_message_by_rule_idle_cb)
|
|
Packit Service |
1d8f1c |
* which actually dispatch the message by rule.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void bus_dbus_impl_dispatch_message_by_rule
|
|
Packit Service |
1d8f1c |
(BusDBusImpl *dbus,
|
|
Packit Service |
1d8f1c |
GDBusMessage *message,
|
|
Packit Service |
1d8f1c |
BusConnection *skip_connection);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* bus_dbus_impl_register_object:
|
|
Packit Service |
1d8f1c |
* @object: A new service which implements IBusService, like BusIBusImpl and BusInputContext.
|
|
Packit Service |
1d8f1c |
* @returns: FALSE if dbus is already destroyed. otherwise TRUE.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Add the IBusService to the daemon. See bus_dbus_impl_new_connection for details.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean bus_dbus_impl_register_object (BusDBusImpl *dbus,
|
|
Packit Service |
1d8f1c |
IBusService *object);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* bus_dbus_impl_unregister_object:
|
|
Packit Service |
1d8f1c |
* @object: A new service which implements IBusService, like BusIBusImpl and BusInputContext.
|
|
Packit Service |
1d8f1c |
* @returns: FALSE if dbus is already destroyed. otherwise TRUE.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Remove the IBusService from the daemon.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean bus_dbus_impl_unregister_object(BusDBusImpl *dbus,
|
|
Packit Service |
1d8f1c |
IBusService *object);
|
|
Packit Service |
1d8f1c |
G_END_DECLS
|
|
Packit Service |
1d8f1c |
#endif
|
|
Packit Service |
1d8f1c |
|