Theory of grating-confined broad-area lasers