Blame bus/component.h

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) 2010 Peng Huang <shawn.p.huang@gmail.com>
Packit Service 1d8f1c
 * Copyright (C) 2010 Google 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_COMPONENT_H_
Packit Service 1d8f1c
#define __BUS_COMPONENT_H_
Packit Service 1d8f1c
Packit Service 1d8f1c
#include <ibus.h>
Packit Service 1d8f1c
#include "factoryproxy.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_COMPONENT             \
Packit Service 1d8f1c
    (bus_component_get_type ())
Packit Service 1d8f1c
#define BUS_COMPONENT(obj)             \
Packit Service 1d8f1c
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUS_TYPE_COMPONENT, BusComponent))
Packit Service 1d8f1c
#define BUS_COMPONENT_CLASS(klass)     \
Packit Service 1d8f1c
    (G_TYPE_CHECK_CLASS_CAST ((klass), BUS_TYPE_COMPONENT, BusComponentClass))
Packit Service 1d8f1c
#define BUS_IS_COMPONENT(obj)          \
Packit Service 1d8f1c
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUS_TYPE_COMPONENT))
Packit Service 1d8f1c
#define BUS_IS_COMPONENT_CLASS(klass)  \
Packit Service 1d8f1c
    (G_TYPE_CHECK_CLASS_TYPE ((klass), BUS_TYPE_COMPONENT))
Packit Service 1d8f1c
#define BUS_COMPONENT_GET_CLASS(obj)   \
Packit Service 1d8f1c
    (G_TYPE_INSTANCE_GET_CLASS ((obj), BUS_TYPE_COMPONENT, BusComponentClass))
Packit Service 1d8f1c
Packit Service 1d8f1c
G_BEGIN_DECLS
Packit Service 1d8f1c
Packit Service 1d8f1c
typedef struct _BusComponent BusComponent;
Packit Service 1d8f1c
typedef struct _BusComponentClass BusComponentClass;
Packit Service 1d8f1c
Packit Service 1d8f1c
GType            bus_component_get_type          (void);
Packit Service 1d8f1c
BusComponent    *bus_component_new               (IBusComponent   *component,
Packit Service 1d8f1c
                                                  BusFactoryProxy *factory);
Packit Service 1d8f1c
IBusComponent   *bus_component_get_component     (BusComponent    *component);
Packit Service 1d8f1c
void             bus_component_set_factory       (BusComponent    *compinent,
Packit Service 1d8f1c
                                                  BusFactoryProxy *factory);
Packit Service 1d8f1c
BusFactoryProxy *bus_component_get_factory       (BusComponent    *factory);
Packit Service 1d8f1c
void             bus_component_set_destroy_with_factory
Packit Service 1d8f1c
                                                 (BusComponent    *component,
Packit Service 1d8f1c
                                                  gboolean         with_factory);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_component_get_name:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Return a component name such as "org.freedesktop.IBus.Panel" and "com.google.IBus.Mozc"
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
const gchar     *bus_component_get_name          (BusComponent    *component);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_component_get_engines:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Return a list of IBusEngineDesc objects the component has.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
GList           *bus_component_get_engines       (BusComponent    *component);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_component_start:
Packit Service 1d8f1c
 * @verbose: if TRUE, the stdout and stderr of the child process is not redirected to /dev/null.
Packit Service 1d8f1c
 * @returns: TRUE if the component is successfully started.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Start the component by forking and executing an executable file for the component.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
gboolean         bus_component_start             (BusComponent    *component,
Packit Service 1d8f1c
                                                  gboolean         verbose);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_component_stop:
Packit Service 1d8f1c
 * @returns: TRUE
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Kill a process for the component.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
gboolean         bus_component_stop              (BusComponent    *component);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * bus_component_stop:
Packit Service 1d8f1c
 * @returns: TRUE if a process for the component exists.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
gboolean         bus_component_is_running        (BusComponent    *component);
Packit Service 1d8f1c
Packit Service 1d8f1c
void             bus_component_set_restart       (BusComponent    *component,
Packit Service 1d8f1c
                                                  gboolean         restart);
Packit Service 1d8f1c
BusComponent    *bus_component_from_engine_desc  (IBusEngineDesc  *engine);
Packit Service 1d8f1c
Packit Service 1d8f1c
G_END_DECLS
Packit Service 1d8f1c
#endif
Packit Service 1d8f1c