How do I define functionals in Mathematica?


When I write W(f_) := Integrate(f(x), {x, 0, π}) I may rightly conclude that
W(Sin) = 2, W(Cos) = 0, W(Log) = π (-1 + Log(π)) etc. But I am unable to define W(Sin + Cos) or W(Sin(Sin)) etc. Please help.