A General Theory of Entropy