|
Packit Service |
1d8f1c |
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
|
Packit Service |
1d8f1c |
/* vim:set et sts=4: */
|
|
Packit Service |
1d8f1c |
/* ibus - The Input Bus
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2015 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 |
|
|
Packit Service |
1d8f1c |
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
|
|
Packit Service |
1d8f1c |
#error "Only <ibus.h> can be included directly"
|
|
Packit Service |
1d8f1c |
#endif
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#ifndef __IBUS_SERVICE_H_
|
|
Packit Service |
1d8f1c |
#define __IBUS_SERVICE_H_
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* SECTION: ibusservice
|
|
Packit Service |
1d8f1c |
* @short_description: IBus service back-end.
|
|
Packit Service |
1d8f1c |
* @stability: Stable
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* An IBusService is a base class for services.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#include <gio/gio.h>
|
|
Packit Service |
1d8f1c |
#include "ibusobject.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 IBUS_TYPE_SERVICE \
|
|
Packit Service |
1d8f1c |
(ibus_service_get_type ())
|
|
Packit Service |
1d8f1c |
#define IBUS_SERVICE(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_SERVICE, IBusService))
|
|
Packit Service |
1d8f1c |
#define IBUS_SERVICE_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_SERVICE, IBusServiceClass))
|
|
Packit Service |
1d8f1c |
#define IBUS_IS_SERVICE(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_SERVICE))
|
|
Packit Service |
1d8f1c |
#define IBUS_IS_SERVICE_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_SERVICE))
|
|
Packit Service |
1d8f1c |
#define IBUS_SERVICE_GET_CLASS(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_SERVICE, IBusServiceClass))
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_BEGIN_DECLS
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
typedef struct _IBusService IBusService;
|
|
Packit Service |
1d8f1c |
typedef struct _IBusServiceClass IBusServiceClass;
|
|
Packit Service |
1d8f1c |
typedef struct _IBusServicePrivate IBusServicePrivate;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusService:
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* An opaque data type representing an IBusService.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
struct _IBusService {
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
IBusObject parent;
|
|
Packit Service |
1d8f1c |
IBusServicePrivate *priv;
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
struct _IBusServiceClass {
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
IBusObjectClass parent;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*< public >*/
|
|
Packit Service |
1d8f1c |
/* virtual functions */
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusServiceClass::service_method_call:
|
|
Packit Service |
1d8f1c |
* @service: An #IBusService.
|
|
Packit Service |
1d8f1c |
* @connection: A dbus connection.
|
|
Packit Service |
1d8f1c |
* @sender: A sender.
|
|
Packit Service |
1d8f1c |
* @object_path: An object path.
|
|
Packit Service |
1d8f1c |
* @interface_name: An interface name.
|
|
Packit Service |
1d8f1c |
* @method_name: A method name.
|
|
Packit Service |
1d8f1c |
* @parameters: A parameters.
|
|
Packit Service |
1d8f1c |
* @invocation: A dbus method invocation.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* The ::service_method_call class method is to connect
|
|
Packit Service |
1d8f1c |
* GDBusInterfaceMethodCallFunc().
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void (* service_method_call)
|
|
Packit Service |
1d8f1c |
(IBusService *service,
|
|
Packit Service |
1d8f1c |
GDBusConnection *connection,
|
|
Packit Service |
1d8f1c |
const gchar *sender,
|
|
Packit Service |
1d8f1c |
const gchar *object_path,
|
|
Packit Service |
1d8f1c |
const gchar *interface_name,
|
|
Packit Service |
1d8f1c |
const gchar *method_name,
|
|
Packit Service |
1d8f1c |
GVariant *parameters,
|
|
Packit Service |
1d8f1c |
GDBusMethodInvocation
|
|
Packit Service |
1d8f1c |
*invocation);
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusServiceClass::service_get_property:
|
|
Packit Service |
1d8f1c |
* @service: An #IBusService.
|
|
Packit Service |
1d8f1c |
* @connection: A dbus connection.
|
|
Packit Service |
1d8f1c |
* @sender: A sender.
|
|
Packit Service |
1d8f1c |
* @object_path: An object path.
|
|
Packit Service |
1d8f1c |
* @interface_name: An interface name.
|
|
Packit Service |
1d8f1c |
* @property_name: A property name.
|
|
Packit Service |
1d8f1c |
* @error: Return location for error or %NULL.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* The ::service_get_property class method is to connect
|
|
Packit Service |
1d8f1c |
* GDBusInterfaceGetPropertyFunc().
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: (nullable) (transfer full): A variant.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
GVariant * (* service_get_property)
|
|
Packit Service |
1d8f1c |
(IBusService *service,
|
|
Packit Service |
1d8f1c |
GDBusConnection *connection,
|
|
Packit Service |
1d8f1c |
const gchar *sender,
|
|
Packit Service |
1d8f1c |
const gchar *object_path,
|
|
Packit Service |
1d8f1c |
const gchar *interface_name,
|
|
Packit Service |
1d8f1c |
const gchar *property_name,
|
|
Packit Service |
1d8f1c |
GError **error);
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusServiceClass::service_set_property:
|
|
Packit Service |
1d8f1c |
* @service: An #IBusService.
|
|
Packit Service |
1d8f1c |
* @connection: A dbus connection.
|
|
Packit Service |
1d8f1c |
* @sender: A sender.
|
|
Packit Service |
1d8f1c |
* @object_path: An object path.
|
|
Packit Service |
1d8f1c |
* @interface_name: An interface name.
|
|
Packit Service |
1d8f1c |
* @property_name: An property name.
|
|
Packit Service |
1d8f1c |
* @value: An property value.
|
|
Packit Service |
1d8f1c |
* @error: Return location for error or %NULL.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* The ::service_set_property class method is to connect
|
|
Packit Service |
1d8f1c |
* GDBusInterfaceSetPropertyFunc().
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if set the value else %FALSE.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean (* service_set_property)
|
|
Packit Service |
1d8f1c |
(IBusService *service,
|
|
Packit Service |
1d8f1c |
GDBusConnection *connection,
|
|
Packit Service |
1d8f1c |
const gchar *sender,
|
|
Packit Service |
1d8f1c |
const gchar *object_path,
|
|
Packit Service |
1d8f1c |
const gchar *interface_name,
|
|
Packit Service |
1d8f1c |
const gchar *property_name,
|
|
Packit Service |
1d8f1c |
GVariant *value,
|
|
Packit Service |
1d8f1c |
GError **error);
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
GArray *interfaces;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* padding */
|
|
Packit Service |
1d8f1c |
gpointer pdummy[4];
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GType ibus_service_get_type (void);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_service_new:
|
|
Packit Service |
1d8f1c |
* @connection: A GDBusConnection.
|
|
Packit Service |
1d8f1c |
* @path: Object path.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Creantes a new #IBusService.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: A newly allocated #IBusService
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
IBusService *ibus_service_new (GDBusConnection *connection,
|
|
Packit Service |
1d8f1c |
const gchar *path);
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_service_get_object_path:
|
|
Packit Service |
1d8f1c |
* @service: An IBusService.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Gets the object path of an IBusService.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: The object path of @service
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
const gchar *ibus_service_get_object_path (IBusService *service);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_service_get_connection:
|
|
Packit Service |
1d8f1c |
* @service: An IBusService.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Gets a connections.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: (transfer none): A #GDBusConnection of an #IBusService instance.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
GDBusConnection *ibus_service_get_connection (IBusService *service);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_service_register:
|
|
Packit Service |
1d8f1c |
* @service: An IBusService.
|
|
Packit Service |
1d8f1c |
* @connection: A GDBusConnection the service will be registered to.
|
|
Packit Service |
1d8f1c |
* @error: Return location for error or NULL.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Registers service to a connection.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if the service was registered, %FALSE otherwise.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_service_register (IBusService *service,
|
|
Packit Service |
1d8f1c |
GDBusConnection *connection,
|
|
Packit Service |
1d8f1c |
GError **error);
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_service_unregister:
|
|
Packit Service |
1d8f1c |
* @service: An IBusService.
|
|
Packit Service |
1d8f1c |
* @connection: A GDBusConnection the service was registered with.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Unregisters service from a connection.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_service_unregister (IBusService *service,
|
|
Packit Service |
1d8f1c |
GDBusConnection *connection);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_service_send_signal:
|
|
Packit Service |
1d8f1c |
* @service: An IBusService.
|
|
Packit Service |
1d8f1c |
* @interface: The interface the signal is emitted from.
|
|
Packit Service |
1d8f1c |
* @name: Name of the signal.
|
|
Packit Service |
1d8f1c |
* @first_arg_type: Type of first argument.
|
|
Packit Service |
1d8f1c |
* @...: Rest of arguments, NULL to mark the end.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Sends signal to all the #IBusConnections of an #IBusService.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if succeed; %FALSE otherwise.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* see_also: g_dbus_connection_emit_signal()
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_service_emit_signal (IBusService *service,
|
|
Packit Service |
1d8f1c |
const gchar *dest_bus_name,
|
|
Packit Service |
1d8f1c |
const gchar *interface_name,
|
|
Packit Service |
1d8f1c |
const gchar *signal_name,
|
|
Packit Service |
1d8f1c |
GVariant *parameters,
|
|
Packit Service |
1d8f1c |
GError **error);
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_service_class_add_interfaces:
|
|
Packit Service |
1d8f1c |
* @klass: An IBusServiceClass.
|
|
Packit Service |
1d8f1c |
* @xml_data: The introspection xml data.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Set the interface introspection information with the service class.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: %TRUE if @xml_data is valid and succeeded to be added;
|
|
Packit Service |
1d8f1c |
* %FALSE otherwise.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
gboolean ibus_service_class_add_interfaces
|
|
Packit Service |
1d8f1c |
(IBusServiceClass *klass,
|
|
Packit Service |
1d8f1c |
const gchar *xml_data);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_END_DECLS
|
|
Packit Service |
1d8f1c |
#endif
|
|
Packit Service |
1d8f1c |
|