~ubuntu-branches/ubuntu/quantal/ibus/quantal

« back to all changes in this revision

Viewing changes to bus/component.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry Warsaw
  • Date: 2011-08-11 17:00:57 UTC
  • mfrom: (6.2.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110811170057-6dmbfs4s3cchzl7x
Tags: 1.3.99.20110419-1ubuntu1
* Merge with Debian unstable.  Remaining Ubuntu changes:
  - Indicator support:
    + Add 05_appindicator.patch: Use an indicator rather than a notification
      icon.
    + debian/control: Recommend python-appindicator.
  - debian/control: Install im-switch instead of im-config by default.
  - debian/README.source: Removed, it was outdated and no longer correct
  - debian/patches/01_ubuntu_desktop: Fix "Desktop entry needs the
    X-Ubuntu-Gettext-Domain key"  (LP: #457632)
  - debian/patches/02_title_update.patch: Rename "IBus Preferences" to
    "Keyboard Input Methods"
  - debian/patches/06_locale_parser.patch: Cherry-picked from upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
 
2
/* vim:set et sts=4: */
 
3
/* bus - The Input Bus
 
4
 * Copyright (C) 2010 Peng Huang <shawn.p.huang@gmail.com>
 
5
 * Copyright (C) 2010 Google Inc.
 
6
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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.
 
21
 */
 
22
#ifndef __BUS_COMPONENT_H_
 
23
#define __BUS_COMPONENT_H_
 
24
 
 
25
#include <ibus.h>
 
26
#include "factoryproxy.h"
 
27
 
 
28
/*
 
29
 * Type macros.
 
30
 */
 
31
 
 
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))
 
45
 
 
46
G_BEGIN_DECLS
 
47
 
 
48
typedef struct _BusComponent BusComponent;
 
49
typedef struct _BusComponentClass BusComponentClass;
 
50
 
 
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);
 
61
 
 
62
/**
 
63
 * bus_component_get_name:
 
64
 *
 
65
 * Return a component name such as "org.freedesktop.IBus.Panel" and "com.google.IBus.Mozc"
 
66
 */
 
67
const gchar     *bus_component_get_name          (BusComponent    *component);
 
68
 
 
69
/**
 
70
 * bus_component_get_engines:
 
71
 *
 
72
 * Return a list of IBusEngineDesc objects the component has.
 
73
 */
 
74
GList           *bus_component_get_engines       (BusComponent    *component);
 
75
 
 
76
/**
 
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.
 
80
 *
 
81
 * Start the component by forking and executing an executable file for the component.
 
82
 */
 
83
gboolean         bus_component_start             (BusComponent    *component,
 
84
                                                  gboolean         verbose);
 
85
 
 
86
/**
 
87
 * bus_component_stop:
 
88
 * @returns: TRUE
 
89
 *
 
90
 * Kill a process for the component.
 
91
 */
 
92
gboolean         bus_component_stop              (BusComponent    *component);
 
93
 
 
94
/**
 
95
 * bus_component_stop:
 
96
 * @returns: TRUE if a process for the component exists.
 
97
 */
 
98
gboolean         bus_component_is_running        (BusComponent    *component);
 
99
 
 
100
void             bus_component_set_restart       (BusComponent    *component,
 
101
                                                  gboolean         restart);
 
102
BusComponent    *bus_component_from_engine_desc  (IBusEngineDesc  *engine);
 
103
 
 
104
G_END_DECLS
 
105
#endif
 
106