/* GDBus - GLib D-Bus Library
*
- * Copyright (C) 2008-2009 Red Hat, Inc.
+ * Copyright (C) 2008-2010 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: David Zeuthen <davidz@redhat.com>
*/
PROP_CREDENTIALS
};
-G_DEFINE_ABSTRACT_TYPE (GDBusAuthMechanism, _g_dbus_auth_mechanism, G_TYPE_OBJECT);
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GDBusAuthMechanism, _g_dbus_auth_mechanism, G_TYPE_OBJECT)
/* ---------------------------------------------------------------------------------------------------- */
if (mechanism->priv->credentials != NULL)
g_object_unref (mechanism->priv->credentials);
- if (G_OBJECT_CLASS (_g_dbus_auth_mechanism_parent_class)->finalize != NULL)
- G_OBJECT_CLASS (_g_dbus_auth_mechanism_parent_class)->finalize (object);
+ G_OBJECT_CLASS (_g_dbus_auth_mechanism_parent_class)->finalize (object);
}
static void
{
GObjectClass *gobject_class;
- g_type_class_add_private (klass, sizeof (GDBusAuthMechanismPrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = _g_dbus_auth_mechanism_get_property;
gobject_class->set_property = _g_dbus_auth_mechanism_set_property;
g_object_class_install_property (gobject_class,
PROP_STREAM,
g_param_spec_object ("stream",
- _("IO Stream"),
- _("The underlying GIOStream used for I/O"),
+ P_("IO Stream"),
+ P_("The underlying GIOStream used for I/O"),
G_TYPE_IO_STREAM,
G_PARAM_READABLE |
G_PARAM_WRITABLE |
g_object_class_install_property (gobject_class,
PROP_CREDENTIALS,
g_param_spec_object ("credentials",
- _("Credentials"),
- _("The credentials of the remote peer"),
+ P_("Credentials"),
+ P_("The credentials of the remote peer"),
G_TYPE_CREDENTIALS,
G_PARAM_READABLE |
G_PARAM_WRITABLE |
static void
_g_dbus_auth_mechanism_init (GDBusAuthMechanism *mechanism)
{
- /* not used for now */
- mechanism->priv = G_TYPE_INSTANCE_GET_PRIVATE (mechanism,
- G_TYPE_DBUS_AUTH_MECHANISM,
- GDBusAuthMechanismPrivate);
+ mechanism->priv = _g_dbus_auth_mechanism_get_instance_private (mechanism);
}
/* ---------------------------------------------------------------------------------------------------- */
const gchar *name;
GDBusAuthMechanismClass *klass;
- g_return_val_if_fail (g_type_is_a (mechanism_type, G_TYPE_DBUS_AUTH_MECHANISM), NULL);
+ g_return_val_if_fail (g_type_is_a (mechanism_type, G_TYPE_DBUS_AUTH_MECHANISM), NULL);
klass = g_type_class_ref (mechanism_type);
g_assert (klass != NULL);
gint priority;
GDBusAuthMechanismClass *klass;
- g_return_val_if_fail (g_type_is_a (mechanism_type, G_TYPE_DBUS_AUTH_MECHANISM), 0);
+ g_return_val_if_fail (g_type_is_a (mechanism_type, G_TYPE_DBUS_AUTH_MECHANISM), 0);
klass = g_type_class_ref (mechanism_type);
g_assert (klass != NULL);
}
gchar *
-_g_dbus_auth_mechanism_encode_data (GDBusAuthMechanism *mechanism,
- const gchar *data,
- gsize data_len,
- gsize *out_data_len)
+_g_dbus_auth_mechanism_encode_data (GDBusAuthMechanism *mechanism,
+ const gchar *data,
+ gsize data_len,
+ gsize *out_data_len)
{
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL);
return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->encode_data (mechanism, data, data_len, out_data_len);
gchar *
-_g_dbus_auth_mechanism_decode_data (GDBusAuthMechanism *mechanism,
- const gchar *data,
- gsize data_len,
- gsize *out_data_len)
+_g_dbus_auth_mechanism_decode_data (GDBusAuthMechanism *mechanism,
+ const gchar *data,
+ gsize data_len,
+ gsize *out_data_len)
{
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL);
return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->decode_data (mechanism, data, data_len, out_data_len);
/* ---------------------------------------------------------------------------------------------------- */
GDBusAuthMechanismState
-_g_dbus_auth_mechanism_server_get_state (GDBusAuthMechanism *mechanism)
+_g_dbus_auth_mechanism_server_get_state (GDBusAuthMechanism *mechanism)
{
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID);
return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_get_state (mechanism);
}
void
-_g_dbus_auth_mechanism_server_initiate (GDBusAuthMechanism *mechanism,
- const gchar *initial_response,
- gsize initial_response_len)
+_g_dbus_auth_mechanism_server_initiate (GDBusAuthMechanism *mechanism,
+ const gchar *initial_response,
+ gsize initial_response_len)
{
g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism));
G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_initiate (mechanism, initial_response, initial_response_len);
}
void
-_g_dbus_auth_mechanism_server_data_receive (GDBusAuthMechanism *mechanism,
- const gchar *data,
- gsize data_len)
+_g_dbus_auth_mechanism_server_data_receive (GDBusAuthMechanism *mechanism,
+ const gchar *data,
+ gsize data_len)
{
g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism));
G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_data_receive (mechanism, data, data_len);
}
gchar *
-_g_dbus_auth_mechanism_server_data_send (GDBusAuthMechanism *mechanism,
- gsize *out_data_len)
+_g_dbus_auth_mechanism_server_data_send (GDBusAuthMechanism *mechanism,
+ gsize *out_data_len)
{
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL);
return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_data_send (mechanism, out_data_len);
}
gchar *
-_g_dbus_auth_mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism)
+_g_dbus_auth_mechanism_server_get_reject_reason (GDBusAuthMechanism *mechanism)
{
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL);
return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_get_reject_reason (mechanism);
}
void
-_g_dbus_auth_mechanism_server_shutdown (GDBusAuthMechanism *mechanism)
+_g_dbus_auth_mechanism_server_shutdown (GDBusAuthMechanism *mechanism)
{
g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism));
G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->server_shutdown (mechanism);
/* ---------------------------------------------------------------------------------------------------- */
GDBusAuthMechanismState
-_g_dbus_auth_mechanism_client_get_state (GDBusAuthMechanism *mechanism)
+_g_dbus_auth_mechanism_client_get_state (GDBusAuthMechanism *mechanism)
{
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), G_DBUS_AUTH_MECHANISM_STATE_INVALID);
return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_get_state (mechanism);
}
gchar *
-_g_dbus_auth_mechanism_client_initiate (GDBusAuthMechanism *mechanism,
- gsize *out_initial_response_len)
+_g_dbus_auth_mechanism_client_initiate (GDBusAuthMechanism *mechanism,
+ gsize *out_initial_response_len)
{
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL);
return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_initiate (mechanism,
}
void
-_g_dbus_auth_mechanism_client_data_receive (GDBusAuthMechanism *mechanism,
- const gchar *data,
- gsize data_len)
+_g_dbus_auth_mechanism_client_data_receive (GDBusAuthMechanism *mechanism,
+ const gchar *data,
+ gsize data_len)
{
g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism));
G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_data_receive (mechanism, data, data_len);
}
gchar *
-_g_dbus_auth_mechanism_client_data_send (GDBusAuthMechanism *mechanism,
- gsize *out_data_len)
+_g_dbus_auth_mechanism_client_data_send (GDBusAuthMechanism *mechanism,
+ gsize *out_data_len)
{
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism), NULL);
return G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_data_send (mechanism, out_data_len);
}
void
-_g_dbus_auth_mechanism_client_shutdown (GDBusAuthMechanism *mechanism)
+_g_dbus_auth_mechanism_client_shutdown (GDBusAuthMechanism *mechanism)
{
g_return_if_fail (G_IS_DBUS_AUTH_MECHANISM (mechanism));
G_DBUS_AUTH_MECHANISM_GET_CLASS (mechanism)->client_shutdown (mechanism);