~ubuntu-branches/ubuntu/karmic/xfce4-session/karmic

« back to all changes in this revision

Viewing changes to xfce4-session/xfsm-client.c

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2005-11-06 22:01:12 UTC
  • mto: (4.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051106220112-5rusox237ymjghsp
Tags: upstream-4.2.3
ImportĀ upstreamĀ versionĀ 4.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: xfsm-client.c 4711 2004-11-01 16:10:55Z benny $ */
 
2
/*-
 
3
 * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org>
 
4
 * All rights reserved.
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2, or (at your option)
 
9
 * any later version.
 
10
 *                                                                              
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *                                                                              
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
19
 * 02111-1307, USA.
 
20
 */
 
21
 
 
22
#ifdef HAVE_CONFIG_H
 
23
#include <config.h>
 
24
#endif
 
25
 
 
26
#include <libxfsm/xfsm-util.h>
 
27
 
 
28
#include <xfce4-session/xfsm-client.h>
 
29
#include <xfce4-session/xfsm-global.h>
 
30
 
 
31
 
 
32
XfsmClient*
 
33
xfsm_client_new (SmsConn sms_conn)
 
34
{
 
35
  XfsmClient *client;
 
36
  
 
37
  client = g_new0 (XfsmClient, 1);
 
38
  client->sms_conn = sms_conn;
 
39
  client->state = XFSM_CLIENT_IDLE;
 
40
  
 
41
  return client;
 
42
}
 
43
 
 
44
void
 
45
xfsm_client_free (XfsmClient *client)
 
46
{
 
47
  g_return_if_fail (client != NULL);
 
48
  
 
49
  if (client->properties != NULL)
 
50
    xfsm_properties_free (client->properties);
 
51
  if (client->save_timeout_id > 0)
 
52
    g_source_remove (client->save_timeout_id);
 
53
  g_free (client);
 
54
}
 
55
 
 
56
 
 
57
void
 
58
xfsm_client_set_initial_properties (XfsmClient     *client,
 
59
                                    XfsmProperties *properties)
 
60
{
 
61
  g_return_if_fail (client != NULL);
 
62
  g_return_if_fail (properties != NULL);
 
63
  
 
64
  if (client->properties != NULL)
 
65
    xfsm_properties_free (client->properties);
 
66
  client->properties = properties;
 
67
  client->id = properties->client_id;
 
68
}
 
69
 
 
70
 
 
71