Commit fbecc673 authored by Yuanle Song's avatar Yuanle Song

v0.4.0 renamed dbus services; use code gen.

parent 0816351b
<!DOCTYPE node PUBLIC
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" >
<node>
<interface name="com.emacsos.zero.ZeroPinyinService1.ZeroPinyinServiceInterface">
<!--
GetCandidates:
@preedit_str: the preedit string
@fetch_size: how many candidates to fetch
@candidates: the candidates
@matched_preedit_str_lengths: the matched str length in preedit str for
each candidate
Get candidates for a preedit string. This method will fetch at least
fetch_size candidates if they exists. However, this method is allowed to
return more candidates than fetch_size.
-->
<method name="GetCandidates">
<arg type="s" name="preedit_str"/>
<arg type="u" name="fetch_size"/>
<arg type="as" name="candidates" direction="out"/>
<arg type="au" name="matched_preedit_str_lengths" direction="out"/>
</method>
<method name="Quit"/>
<annotation name="org.gtk.GDBus.C.Name" value="ZeroPinyinService"/>
</interface>
</node>
[D-BUS Service]
Name=com.emacsos.zero.ZeroPinyinService
Name=com.emacsos.zero.ZeroPinyinService1
Exec=/home/sylecn/bin/sbin/zero-pinyin-service
This diff is collapsed.
# -*- mode: conf -*-
project('zero-pinyin-service', ['c', 'cpp'],
version: '0.3.2',
version: '0.4.0',
license: 'GPL',
default_options: [
'warning_level=2',
......@@ -30,19 +30,34 @@ if get_option('buildtype').startswith('release')
language: ['c', 'cpp'])
endif
install_data('com.emacsos.zero.ZeroPinyinService1.ZeroPinyinServiceInterface.xml',
install_dir: '/usr/share/dbus-1/interfaces/')
install_data('com.emacsos.zero.ZeroPinyinService1.service',
install_dir: '/usr/share/dbus-1/services/')
glib = dependency('glib-2.0')
gio = dependency('gio-unix-2.0')
uuid = dependency('uuid')
sqlite3 = dependency('sqlite3')
shared_dep = [glib, gio, uuid, sqlite3]
gen_inc = include_directories('.')
gdbus_codegen = find_program('gdbus-codegen')
zero_panel_generated = custom_target('zero-panel-generated',
input: 'com.emacsos.zero.ZeroPinyinService1.ZeroPinyinServiceInterface.xml',
output: ['zero-pinyin-service-generated.h', 'zero-pinyin-service-generated.c'],
command: [gdbus_codegen, '--generate-c-code', 'zero-pinyin-service-generated', '@[email protected]'])
src = [
'../PinyinParser.cc',
'../sqlite3_util.c',
'parse-pinyin.cpp',
'zero-pinyin-service.c',
zero_panel_generated,
'main.c']
executable('zero-pinyin-service', src,
include_directories: gen_inc,
dependencies: shared_dep,
install: true, install_dir: '/home/sylecn/bin/sbin/')
......
......@@ -5,10 +5,11 @@
#include <string.h>
#include <sqlite3.h>
#ifdef __cplusplus
extern "C"
{
#endif
G_BEGIN_DECLS
#define ZERO_PINYIN_WELL_KNOWN_NAME "com.emacsos.zero.ZeroPinyinService1"
#define ZERO_PINYIN_OBJECT_PATH "/com/emacsos/zero/ZeroPinyinService1"
#define ZERO_PINYIN_INTERFACE_NAME "com.emacsos.zero.ZeroPinyinService1.ZeroPinyinServiceInterface"
typedef struct {
gint shengmu_i;
......@@ -45,8 +46,6 @@ void get_candidates (sqlite3* db,
GVariantBuilder *candidates_builder,
GVariantBuilder *matched_lengths_builder);
#ifdef __cplusplus
}
#endif
G_END_DECLS
#endif /* _ZERO_PINYIN_SERVICE_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment