loudmouth/lm-feature-ping.c
author Mikael Hallendal <micke@imendio.com>
Mon, 06 Oct 2008 02:17:36 +0200
changeset 506 9d9be7000667
parent 505 ba6f96b3e4a8
child 507 06e7b24dbcb3
permissions -rw-r--r--
Added properties, signals and start/stop calls to LmFeaturePing.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     2
/*
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     3
 * Copyright (C) 2008 Imendio AB
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     4
 *
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     6
 * modify it under the terms of the GNU Lesser General Public License as
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     7
 * published by the Free Software Foundation; either version 2 of the
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     8
 * License, or (at your option) any later version.
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     9
 *
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    13
 * Lesser General Public License for more details.
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    14
 *
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    15
 * You should have received a copy of the GNU Lesser General Public
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    16
 * License along with this program; if not, write to the
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    18
 * Boston, MA 02111-1307, USA.
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    19
 */
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    20
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    21
#include <config.h>
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    22
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    23
#include "lm-connection.h"
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    24
#include "lm-marshal.h"
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    25
#include "lm-feature-ping.h"
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    26
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    27
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), LM_TYPE_FEATURE_PING, LmFeaturePingPriv))
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    28
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    29
typedef struct LmFeaturePingPriv LmFeaturePingPriv;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    30
struct LmFeaturePingPriv {
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    31
        LmConnection *connection;
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    32
	guint         keep_alive_rate;
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    33
	GSource      *keep_alive_source;
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    34
	guint         keep_alive_counter;
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    35
};
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    36
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    37
static void     feature_ping_finalize            (GObject           *object);
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    38
static void     feature_ping_get_property        (GObject           *object,
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    39
                                                  guint              param_id,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    40
                                                  GValue            *value,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    41
                                                  GParamSpec        *pspec);
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    42
static void     feature_ping_set_property        (GObject           *object,
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    43
                                                  guint              param_id,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    44
                                                  const GValue      *value,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    45
                                                  GParamSpec        *pspec);
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    46
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    47
G_DEFINE_TYPE (LmFeaturePing, lm_feature_ping, G_TYPE_OBJECT)
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    48
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    49
enum {
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    50
	PROP_0,
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    51
        PROP_CONNECTION,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    52
        PROP_RATE
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    53
};
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    54
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    55
enum {
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    56
        TIMED_OUT,
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    57
	LAST_SIGNAL
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    58
};
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    59
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    60
static guint signals[LAST_SIGNAL] = { 0 };
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    61
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    62
static void
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    63
lm_feature_ping_class_init (LmFeaturePingClass *class)
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    64
{
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    65
	GObjectClass *object_class = G_OBJECT_CLASS (class);
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    66
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    67
	object_class->finalize     = feature_ping_finalize;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    68
	object_class->get_property = feature_ping_get_property;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    69
	object_class->set_property = feature_ping_set_property;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    70
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    71
        g_object_class_install_property (object_class,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    72
                                         PROP_CONNECTION,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    73
                                         g_param_spec_pointer ("connection",
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    74
                                                               "Connection",
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    75
                                                               "The LmConnection to use",
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    76
                                                               G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    77
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    78
        g_object_class_install_property (object_class,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    79
					 PROP_RATE,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    80
					 g_param_spec_uint ("rate",
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    81
                                                            "Timeout Rate",
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    82
                                                            "Keep alive rate in seconds",
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    83
                                                            0, G_MAXUINT,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    84
                                                            0,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    85
                                                            G_PARAM_READWRITE));
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    86
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    87
        signals[TIMED_OUT] = 
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    88
		g_signal_new ("timed-out",
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    89
			      G_OBJECT_CLASS_TYPE (object_class),
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    90
			      G_SIGNAL_RUN_LAST,
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    91
			      0,
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    92
			      NULL, NULL,
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    93
			      lm_marshal_VOID__VOID,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
    94
			      G_TYPE_NONE, 0);
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    95
	
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    96
	g_type_class_add_private (object_class, sizeof (LmFeaturePingPriv));
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    97
}
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    98
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    99
static void
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   100
lm_feature_ping_init (LmFeaturePing *feature_ping)
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   101
{
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   102
	LmFeaturePingPriv *priv;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   103
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   104
	priv = GET_PRIV (feature_ping);
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   105
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   106
}
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   107
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   108
static void
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   109
feature_ping_finalize (GObject *object)
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   110
{
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   111
	LmFeaturePingPriv *priv;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   112
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   113
	priv = GET_PRIV (object);
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   114
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   115
	(G_OBJECT_CLASS (lm_feature_ping_parent_class)->finalize) (object);
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   116
}
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   117
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   118
static void
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   119
feature_ping_get_property (GObject    *object,
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   120
                           guint       param_id,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   121
                           GValue     *value,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   122
                           GParamSpec *pspec)
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   123
{
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   124
	LmFeaturePingPriv *priv;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   125
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   126
	priv = GET_PRIV (object);
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   127
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   128
	switch (param_id) {
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   129
	case PROP_RATE:
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   130
		g_value_set_uint (value, priv->keep_alive_rate);
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   131
		break;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   132
	default:
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   133
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   134
		break;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   135
	};
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   136
}
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   137
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   138
static void
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   139
feature_ping_set_property (GObject      *object,
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   140
                           guint         param_id,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   141
                           const GValue *value,
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   142
                           GParamSpec   *pspec)
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   143
{
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   144
	LmFeaturePingPriv *priv;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   145
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   146
	priv = GET_PRIV (object);
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   147
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   148
	switch (param_id) {
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   149
        case PROP_CONNECTION:
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   150
                priv->connection = g_value_get_pointer (value);
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   151
                break;
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   152
        case PROP_RATE:
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   153
		priv->keep_alive_rate = g_value_get_uint (value);
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   154
                /* Restart the pings */
505
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   155
		break;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   156
	default:
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   157
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   158
		break;
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   159
	};
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   160
}
ba6f96b3e4a8 Added stubs for LmFeaturePing which will hold the XMPP Ping feature.
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
   161
506
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   162
void
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   163
lm_feature_ping_start (LmFeaturePing *fp)
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   164
{
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   165
        g_return_if_fail (LM_IS_FEATURE_PING (fp));
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   166
}
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   167
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   168
void
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   169
lm_feature_ping_stop (LmFeaturePing *fp)
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   170
{
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   171
        g_return_if_fail (LM_IS_FEATURE_PING (fp));
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   172
}
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   173
9d9be7000667 Added properties, signals and start/stop calls to LmFeaturePing.
Mikael Hallendal <micke@imendio.com>
parents: 505
diff changeset
   174