Photoemission from surface-atom core levels, surface densities of states, and metal-atom clusters: A unified picture