X-ray emission spectra and chemical bonding in TiC, TiN and TiO