1
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
2
/* vim:set et sts=4: */
4
* Copyright (C) 2010 Peng Huang <shawn.p.huang@gmail.com>
5
* Copyright (C) 2010 Google Inc.
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the
19
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
* Boston, MA 02111-1307, USA.
22
#ifndef __BUS_COMPONENT_H_
23
#define __BUS_COMPONENT_H_
26
#include "factoryproxy.h"
32
/* define GOBJECT macros */
33
#define BUS_TYPE_COMPONENT \
34
(bus_component_get_type ())
35
#define BUS_COMPONENT(obj) \
36
(G_TYPE_CHECK_INSTANCE_CAST ((obj), BUS_TYPE_COMPONENT, BusComponent))
37
#define BUS_COMPONENT_CLASS(klass) \
38
(G_TYPE_CHECK_CLASS_CAST ((klass), BUS_TYPE_COMPONENT, BusComponentClass))
39
#define BUS_IS_COMPONENT(obj) \
40
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUS_TYPE_COMPONENT))
41
#define BUS_IS_COMPONENT_CLASS(klass) \
42
(G_TYPE_CHECK_CLASS_TYPE ((klass), BUS_TYPE_COMPONENT))
43
#define BUS_COMPONENT_GET_CLASS(obj) \
44
(G_TYPE_INSTANCE_GET_CLASS ((obj), BUS_TYPE_COMPONENT, BusComponentClass))
48
typedef struct _BusComponent BusComponent;
49
typedef struct _BusComponentClass BusComponentClass;
51
GType bus_component_get_type (void);
52
BusComponent *bus_component_new (IBusComponent *component,
53
BusFactoryProxy *factory);
54
IBusComponent *bus_component_get_component (BusComponent *component);
55
void bus_component_set_factory (BusComponent *compinent,
56
BusFactoryProxy *factory);
57
BusFactoryProxy *bus_component_get_factory (BusComponent *factory);
58
void bus_component_set_destroy_with_factory
59
(BusComponent *component,
60
gboolean with_factory);
63
* bus_component_get_name:
65
* Return a component name such as "org.freedesktop.IBus.Panel" and "com.google.IBus.Mozc"
67
const gchar *bus_component_get_name (BusComponent *component);
70
* bus_component_get_engines:
72
* Return a list of IBusEngineDesc objects the component has.
74
GList *bus_component_get_engines (BusComponent *component);
77
* bus_component_start:
78
* @verbose: if TRUE, the stdout and stderr of the child process is not redirected to /dev/null.
79
* @returns: TRUE if the component is successfully started.
81
* Start the component by forking and executing an executable file for the component.
83
gboolean bus_component_start (BusComponent *component,
90
* Kill a process for the component.
92
gboolean bus_component_stop (BusComponent *component);
96
* @returns: TRUE if a process for the component exists.
98
gboolean bus_component_is_running (BusComponent *component);
100
void bus_component_set_restart (BusComponent *component,
102
BusComponent *bus_component_from_engine_desc (IBusEngineDesc *engine);