How to write my _tkinter.so

In termux, there is no ‘_tkinter.so’, and cannot install python3-tkinter. So I tried to wrote a _tkinter.c which use Qt instead of tcl/tk to create GUI so that I can use tkinter on it. However, I don’t know the api of the original ‘_tkinter.c’. Which functions should be implemented in this file?