X-ray emission spectra and electronic structure of CuIr2S4 and CuIr2Se4