|
| 1 | +#include <rime_api.h> |
1 | 2 | #include <rime/candidate.h>
|
2 | 3 | #include <rime/translation.h>
|
3 | 4 | #include <rime/segmentation.h>
|
|
15 | 16 | #include <rime/gear/memory.h>
|
16 | 17 | #include <rime/dict/dictionary.h>
|
17 | 18 | #include <rime/dict/user_dictionary.h>
|
| 19 | +#include <rime/service.h> |
18 | 20 | #include <rime/switcher.h>
|
19 | 21 | #include "lua_gears.h"
|
20 |
| -#include <rime/service.h> |
21 | 22 | #include <boost/regex.hpp>
|
22 | 23 |
|
23 | 24 | #include "lib/lua_export_type.h"
|
@@ -1845,43 +1846,35 @@ namespace KeySequenceReg {
|
1845 | 1846 |
|
1846 | 1847 | namespace RimeApiReg {
|
1847 | 1848 | string get_rime_version() {
|
1848 |
| - RimeApi* rime = rime_get_api(); |
1849 |
| - return string(rime->get_version()); |
| 1849 | + return string(rime_get_api()->get_version()); |
1850 | 1850 | }
|
1851 | 1851 |
|
1852 | 1852 | string get_shared_data_dir() {
|
1853 |
| - RimeApi* rime = rime_get_api(); |
1854 |
| - return string(rime->get_shared_data_dir()); |
| 1853 | + return Service::instance().deployer().shared_data_dir.string(); |
1855 | 1854 | }
|
1856 | 1855 |
|
1857 | 1856 | string get_user_data_dir() {
|
1858 |
| - RimeApi* rime = rime_get_api(); |
1859 |
| - return string(rime->get_user_data_dir()); |
| 1857 | + return Service::instance().deployer().user_data_dir.string(); |
1860 | 1858 | }
|
1861 | 1859 |
|
1862 | 1860 | string get_sync_dir() {
|
1863 |
| - RimeApi* rime = rime_get_api(); |
1864 |
| - return string(rime->get_sync_dir()); |
| 1861 | + return Service::instance().deployer().sync_dir.string(); |
1865 | 1862 | }
|
1866 | 1863 |
|
1867 | 1864 | string get_distribution_name(){
|
1868 |
| - Deployer &deployer(Service::instance().deployer()); |
1869 |
| - return deployer.distribution_name; |
| 1865 | + return Service::instance().deployer().distribution_name; |
1870 | 1866 | }
|
1871 | 1867 |
|
1872 | 1868 | string get_distribution_code_name(){
|
1873 |
| - Deployer &deployer(Service::instance().deployer()); |
1874 |
| - return deployer.distribution_code_name; |
| 1869 | + return Service::instance().deployer().distribution_code_name; |
1875 | 1870 | }
|
1876 | 1871 |
|
1877 | 1872 | string get_distribution_version(){
|
1878 |
| - Deployer &deployer(Service::instance().deployer()); |
1879 |
| - return deployer.distribution_version; |
| 1873 | + return Service::instance().deployer().distribution_version; |
1880 | 1874 | }
|
1881 | 1875 |
|
1882 | 1876 | string get_user_id(){
|
1883 |
| - Deployer &deployer(Service::instance().deployer()); |
1884 |
| - return deployer.user_id; |
| 1877 | + return Service::instance().deployer().user_id; |
1885 | 1878 | }
|
1886 | 1879 |
|
1887 | 1880 | // boost::regex api
|
|
0 commit comments