Many soft-ware programs are available in the market for the design of optical instruments. However, most of them axe not suitable for modeling x-ray optical elements. The simulation of the x-ray source characteristics (emission, geometry) strongly depends on the type of generator used (synchrotron insertion devices, FEL, x-ray tube, laser-generated plasma, etc.). The optical elements are usually grazing mirrors, multilayers and crystals, with very different characteristics than optical elements used in other photon ranges. In addition, the reflectivities of such optical devices must be calculated taking into account tabulated optical constants. In the last years we have developed a new approach for creating a common tool for x-ray optics and sources modeling, lumping together small program from different origins and authors, adding an unified x-ray database and gluing all this in a user-friendly and powerful data manipulation environment. The result is the XOP code which is now used in many synchrotron facilities. Ea addition to the first level calculations available in XOP, we have incorporated an interface to the popular x-ray tracing code SHADOW that allows the simulation of the complete beamline and produces accurate values of beam sizes, divergences, flux and energy resolution. I will review the present state of XOP and the SHADOW Visual Interface. I will then present the plans for a new version in preparation. Then I will discuss new ideas and possible requirements for simulating the forthcoming x-ray optics for fourth generation x-ray sources.