A distribution is essentially a linear map which eats functions and spits out numbers. A very common way to define a distribution is to choose some function $\phi$ and then define the distribution $D_\phi$ as
$$D_\phi[f] :=\int_{-\infty}^\infty\mathrm dx\ \phi(x) f(x)\tag{1}$$
It's not hard to see that this is a linear map - $D_\phi[a f + b g] = a D_\phi[f]+b D_\phi[g]$ for any two numbers $a,b$. We call $\phi$ the kernel of the distribution $D_\phi$, and distributions which arise in this way are called regular.
Not all distributions arise in this way. The delta distribution $\Delta_a$ eats functions $f$ and simply evaluates them at $a$. This distribution is not regular - there is no kernel from which this distribution could possibly arise - but it is often convenient to write it as
$$\Delta_a[f] := \int_{-\infty}^\infty \mathrm dx \ \delta(x-a) f(x)\tag{2}$$
This looks similar to $(1)$, but we must be careful; $\delta$ is not a real function. It is just a convenient mathematical prescription for evaluating $f$ at the point $a$. Even so, it becomes clear quite quickly that it is very convenient to manipulate $\delta$ as though it were a real function, while simply bearing in mind that at the end of the day we need to apply an integral sign if we want a well-defined result.
Distributions can be defined by more complex procedures, as long as the result is a linear map. Let $C$ be a contour and $\phi$ be a function which has a pole at some complex number $z_0\in C$, and let $C(\epsilon)$ be the result of starting with $C$ and removing all points within a distance $\epsilon$ of $z_0$. Then the principal value distribution $\Pi_\phi$ is defined as follows:
$$\Pi_\phi[f] := \lim_{\epsilon\rightarrow 0^+}\int_{C(\epsilon)} \mathrm dz \ \phi(z) f(z)\tag{3}$$
This distribution is also not regular, and does not arise due to a simple integral kernel due to the need for the limiting procedure. However, in analogy with the delta "function" example $(2)$ above, we define the notation
$$\Pi_\phi[f] := \int_C \mathrm dz \ \mathcal P\big[\phi(z)\big]f(z)$$
where it is understood that the right-hand side is a convenient shorthand for $(3)$. In other words, we are free to manipulate the symbol $\mathcal P\big[\phi(z)\big]$ while bearing in mind that at the end of the day, we will ultimately need to perform an integral, at which time we should refer back to $(3)$.
In this particular example, the integration contour of interest is the real line. Given a test function $f$, we would have for the first term in the OP
$$\int_{-\infty}^\infty \mathrm d\omega\ \pi\delta(\omega) f(\omega) = \pi f(0)$$
while for the second term,
$$\int_{-\infty}^\infty \mathrm d\omega\ i\mathcal P\left[\frac{1}{\omega}\right]f(\omega) = \lim_{\epsilon\rightarrow 0^+} \left[\int_{-\infty}^{-\epsilon} \mathrm d\omega \ i\frac{f(\omega)}{\omega} + \int_{\epsilon}^\infty \mathrm d\omega\ i \frac{f(\omega)}{\omega} \right]$$