$themeDisplay
is your friend and might have everything that you're looking for (including the current layout (page). The javadoc I linked is not that great, but the methods you'll find there are mostly descriptive and should give you a clue what kind of current context you can get from this object.
e.g. in a Theme, you can use $themeDisplay.getLayout().getRegularURL($request)
to get the current page