  We present a study of transverse single-spin asymmetries (SSAs) in
$p^\uparrow p\to J/\psi\,X$ and $p^\uparrow p\to D X$ within the framework of
the generalized parton model (GPM), which includes both spin and transverse
momentum effects, and show how they can provide useful information on the still
almost unknown gluon Sivers function. Moreover, by adopting a modified version
of this model, named color gauge invariant (CGI) GPM, we analyze the impact of
the initial- and final-state interactions on our predictions. As a consequence,
we find that these two processes are sensitive to different gluon Sivers
functions, which can be expressed as linear combinations of two distinct,
universal gluon distributions. We therefore define proper observables which
could allow for a separate extraction of these two independent Sivers
functions. At the same time, we show how it would be possible to discriminate
between the GPM and the CGI-GPM approaches by comparing the corresponding
estimates of SSAs with present and future experimental results at RHIC.
