  We study theoretically the mechanisms of square wave formation of a
vertically emitting micro-cavity operated in the Gires-Tournois regime that
contains a Kerr medium and that is subjected to strong time-delayed optical
feedback and detuned optical injection. We show that in the limit of large
delay, square wave solutions of the time-delayed system can be treated as
relative homoclinic solutions of an equation with an advanced argument. Based
on this, we use concepts of classical homoclinic bifurcation theory to study
different types of square wave solutions. In particular, we unveil the
mechanisms behind the collapsed snaking scenario of square waves and explain
the formation of complex-shaped multistable square wave solutions through a
Bykov T-point. Finally we relate the position of the T-point to the position of
the Maxwell point in the original time-delayed system.
