File: scim_unikey_helper.cpp

package info (click to toggle)
scim-unikey 0.3.1%2Bdebian-3.2
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 2,504 kB
  • sloc: sh: 10,650; cpp: 7,490; makefile: 171; sed: 16
file content (74 lines) | stat: -rw-r--r-- 1,844 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
   Scim-Unikey Input Method

   Copyright (C) 2008-2009 Ubuntu-VN <http://www.ubuntu-vn.org>
   Author: Le Quoc Tuan <mr.lequoctuan@gmail.com>
   Home: http://scim-unikey.googlecode.com
   License: GNU LESSER GENERAL PUBLIC LICENSE v2.1
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#define Uses_SCIM_CONFIG_BASE
#define Uses_SCIM_CONFIG_PATH
#define Uses_SCIM_MODULE
#define Uses_SCIM_IMENGINE_MODULE
#define Uses_SCIM_HELPER
#define Uses_STL_MAP

#include <libintl.h>
#define _(String) dgettext(PACKAGE_NAME,String)

#include <scim.h>
#include "scim_unikey_const.h"

#define scim_module_init                        unikey_helper_LTX_scim_module_init
#define scim_module_exit                        unikey_helper_LTX_scim_module_exit
#define scim_helper_module_number_of_helpers    unikey_helper_LTX_scim_helper_module_number_of_helpers
#define scim_helper_module_get_helper_info      unikey_helper_LTX_scim_helper_module_get_helper_info
#define scim_helper_module_run_helper           unikey_helper_LTX_scim_helper_module_run_helper

using namespace scim;

static HelperInfo __helper_info (String("d64561de-c638-427e-9f9c-dd84e15043ab"),
								 String(_("Unikey Setup")),
								 String(SCIM_ICONDIR)+String(SCIM_UNIKEY_ICON_MAIN),
								 String(""),
								 SCIM_HELPER_STAND_ALONE);

extern "C"
{
	void scim_module_init()
	{
	}

	void scim_module_exit()
	{
	}

	unsigned int scim_helper_module_number_of_helpers()
	{
		return 1;
	}

	bool scim_helper_module_get_helper_info(unsigned int idx, HelperInfo &info)
	{
		if (idx == 0)
		{
			info = __helper_info;
			return true;
		}
		return false;
	}

	void scim_helper_module_run_helper(const String &uuid, const ConfigPointer &config, const String &display)
	{
		if (uuid == "d64561de-c638-427e-9f9c-dd84e15043ab")
		{
			system(LIBEXECDIR "/scim-setup-unikey &");
		}
	}
}