Blame src/ibusproxy.h

Packit 3ff832
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
Packit 3ff832
/* vim:set et sts=4: */
Packit 3ff832
/* ibus - The Input Bus
Packit 3ff832
 * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
Packit 3ff832
 * Copyright (C) 2008-2013 Red Hat, Inc.
Packit 3ff832
 *
Packit 3ff832
 * This library is free software; you can redistribute it and/or
Packit 3ff832
 * modify it under the terms of the GNU Lesser General Public
Packit 3ff832
 * License as published by the Free Software Foundation; either
Packit 3ff832
 * version 2.1 of the License, or (at your option) any later version.
Packit 3ff832
 *
Packit 3ff832
 * This library is distributed in the hope that it will be useful,
Packit 3ff832
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 3ff832
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 3ff832
 * Lesser General Public License for more details.
Packit 3ff832
 *
Packit 3ff832
 * You should have received a copy of the GNU Lesser General Public
Packit 3ff832
 * License along with this library; if not, write to the Free Software
Packit 3ff832
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
Packit 3ff832
 * USA
Packit 3ff832
 */
Packit 3ff832
Packit 3ff832
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
Packit 3ff832
#error "Only <ibus.h> can be included directly"
Packit 3ff832
#endif
Packit 3ff832
Packit 3ff832
#ifndef __IBUS_PROXY_H_
Packit 3ff832
#define __IBUS_PROXY_H_
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * SECTION: ibusproxy
Packit 3ff832
 * @short_description: Base proxy object.
Packit 3ff832
 * @stability: Stable
Packit 3ff832
 *
Packit 3ff832
 * An IBusProxy is the base of all proxy objects,
Packit 3ff832
 * which communicate the corresponding #IBusServices on the other end of
Packit 3ff832
 * IBusConnection.
Packit 3ff832
 * For example, IBus clients (such as editors, web browsers) invoke the proxy
Packit 3ff832
 * object,
Packit 3ff832
 * IBusInputContext to communicate with the InputContext service of the
Packit 3ff832
 * ibus-daemon.
Packit 3ff832
 *
Packit 3ff832
 * Almost all services have corresponding proxies, except very simple services.
Packit 3ff832
 */
Packit 3ff832
Packit 3ff832
#include <gio/gio.h>
Packit 3ff832
Packit 3ff832
/*
Packit 3ff832
 * Type macros.
Packit 3ff832
 */
Packit 3ff832
Packit 3ff832
/* define GOBJECT macros */
Packit 3ff832
#define IBUS_TYPE_PROXY             \
Packit 3ff832
    (ibus_proxy_get_type ())
Packit 3ff832
#define IBUS_PROXY(obj)             \
Packit 3ff832
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PROXY, IBusProxy))
Packit 3ff832
#define IBUS_PROXY_CLASS(klass)     \
Packit 3ff832
    (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PROXY, IBusProxyClass))
Packit 3ff832
#define IBUS_IS_PROXY(obj)          \
Packit 3ff832
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PROXY))
Packit 3ff832
#define IBUS_IS_PROXY_CLASS(klass)  \
Packit 3ff832
    (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PROXY))
Packit 3ff832
#define IBUS_PROXY_GET_CLASS(obj)   \
Packit 3ff832
    (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PROXY, IBusProxyClass))
Packit 3ff832
Packit 3ff832
G_BEGIN_DECLS
Packit 3ff832
Packit 3ff832
typedef struct _IBusProxy IBusProxy;
Packit 3ff832
typedef struct _IBusProxyClass IBusProxyClass;
Packit 3ff832
Packit 3ff832
#define IBUS_PROXY_FLAGS(obj)             (IBUS_PROXY (obj)->flags)
Packit 3ff832
#define IBUS_PROXY_SET_FLAGS(obj,flag)    G_STMT_START{ (IBUS_PROXY_FLAGS (obj) |= (flag)); }G_STMT_END
Packit 3ff832
#define IBUS_PROXY_UNSET_FLAGS(obj,flag)  G_STMT_START{ (IBUS_PROXY_FLAGS (obj) &= ~(flag)); }G_STMT_END
Packit 3ff832
#define IBUS_PROXY_DESTROYED(obj)         (IBUS_PROXY_FLAGS (obj) & IBUS_DESTROYED)
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * IBusProxy:
Packit 3ff832
 *
Packit 3ff832
 * An opaque data type representing an IBusProxy.
Packit 3ff832
 */
Packit 3ff832
struct _IBusProxy {
Packit 3ff832
    GDBusProxy parent;
Packit 3ff832
    /* instance members */
Packit 3ff832
    guint32 flags;
Packit 3ff832
    gboolean own;
Packit 3ff832
};
Packit 3ff832
Packit 3ff832
struct _IBusProxyClass {
Packit 3ff832
    GDBusProxyClass parent;
Packit 3ff832
Packit 3ff832
    /* class members */
Packit 3ff832
    void    (* destroy)     (IBusProxy      *proxy);
Packit 3ff832
    /*< private >*/
Packit 3ff832
    /* padding */
Packit 3ff832
    gpointer pdummy[7];
Packit 3ff832
};
Packit 3ff832
Packit 3ff832
GType   ibus_proxy_get_type (void);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_proxy_destroy:
Packit 3ff832
 * @proxy: An #IBusProxy
Packit 3ff832
 *
Packit 3ff832
 * Dispose the proxy object. If the dbus connection is alive and the own
Packit 3ff832
 * variable above is TRUE (which is the default),
Packit 3ff832
 * org.freedesktop.IBus.Service.Destroy method will be called.
Packit 3ff832
 * Note that "destroy" signal might be emitted when ibus_proxy_destroy is
Packit 3ff832
 * called or the underlying dbus connection for the proxy is terminated.
Packit 3ff832
 * In the callback of the destroy signal, you might have to call something
Packit 3ff832
 * like 'g_object_unref(the_proxy);'.
Packit 3ff832
 */
Packit 3ff832
void    ibus_proxy_destroy  (IBusProxy      *proxy);
Packit 3ff832
Packit 3ff832
G_END_DECLS
Packit 3ff832
#endif
Packit 3ff832