Classifying compact 4-manifolds via generalized regular genus and G-degree