Convert d_x11.c to C++