Ab initio periodic approach to electronic structure and magnetic exchange in A 2 CuO 2 X 2 (A=Ca,Sr and X=F,Cl) high-T c superconductor parent compounds