@@ -79,6 +79,28 @@ static int setGammaIndex(lua_State *L) {
79
79
return 0 ;
80
80
}
81
81
82
+ static int getHyphDictList (lua_State *L) {
83
+ lua_newtable (L);
84
+ HyphDictionaryList *list = HyphMan::getDictList ();
85
+ for (int i = 0 ; i < list->length (); i++) {
86
+ lua_pushnumber (L, i+1 );
87
+ lua_pushstring (L, UnicodeToLocal (list->get (i)->getId ()).c_str ());
88
+ lua_settable (L, -3 );
89
+ }
90
+ return 1 ;
91
+ }
92
+
93
+ static int getSelectedHyphDict (lua_State *L) {
94
+ lua_pushstring (L, UnicodeToLocal (HyphMan::getSelectedDictionary ()->getId ()).c_str ());
95
+ return 1 ;
96
+ }
97
+
98
+ static int setHyphDictionary (lua_State *L) {
99
+ const char *id = luaL_checkstring (L, 1 );
100
+ HyphMan::getDictList ()->activate ((lString16)id);
101
+ return 0 ;
102
+ }
103
+
82
104
static int loadDocument (lua_State *L) {
83
105
CreDocument *doc = (CreDocument*) luaL_checkudata (L, 1 , " credocument" );
84
106
const char *file_name = luaL_checkstring (L, 2 );
@@ -657,6 +679,9 @@ static const struct luaL_Reg cre_func[] = {
657
679
{" getGammaIndex" , getGammaIndex},
658
680
{" setGammaIndex" , setGammaIndex},
659
681
{" registerFont" , registerFont},
682
+ {" getHyphDictList" , getHyphDictList},
683
+ {" getSelectedHyphDict" , getSelectedHyphDict},
684
+ {" setHyphDictionary" , setHyphDictionary},
660
685
{NULL , NULL }
661
686
};
662
687
0 commit comments