Gravity theory in four dimensions has three independent topological parameters. In the Lagrangian, these show up as coefficients of three topological densities, namely Nieh-Yan, Pontryagin and Euler. We analyse the Hamiltonian theory based on this generalized Lagrangian. The resulting theory develops a nontrivial dependence on all three parameters, and is shown to admit a SU(2) gauge theoretic interpretation with a set of seven first class constraints corresponding to three SU (2) rotations, three spatial diffeomorphism and one to evolution in a timelike direction. We also study how the topological parameters affect the gravity action with or without a cosmological constant for manifolds with boundaries. For both Dirichlet and locally AdS asymptotia, the Barbero-Immirzi parameter is shown to appear as the only independent topological coupling constant in the action principle. Our analyses indicate that there might be nontrivial implications of the topological parameters in the quantum theory of gravity.