Porting all files but ui.cpp

Porting all files but ui.cpp
Compilation is ok but no test done yet - need ui.cpp