Energy flow in QCD and event shape functions