Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/gsm-session.h
blob: d4880a9b46912e3d4ccf1df9d1f7c5175b0dfe7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* session.h
 * Copyright (C) 2007 Novell, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */

#ifndef __GSM_SESSION_H__
#define __GSM_SESSION_H__

#include <glib.h>
#include "gsm-client.h"

G_BEGIN_DECLS

#define GSM_TYPE_SESSION            (gsm_session_get_type ())
#define GSM_SESSION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSM_TYPE_SESSION, GsmSession))
#define GSM_SESSION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GSM_TYPE_SESSION, GsmSessionClass))
#define GSM_IS_SESSION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSM_TYPE_SESSION))
#define GSM_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSM_TYPE_SESSION))
#define GSM_SESSION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GSM_TYPE_SESSION, GsmSessionClass))

typedef struct _GsmSession GsmSession;
typedef struct _GsmSessionClass GsmSessionClass;
extern GsmSession *global_session;

typedef enum {
  /* gsm's own startup/initialization phase */
  GSM_SESSION_PHASE_STARTUP,
  
  /* xrandr setup, gnome-settings-daemon, etc */
  GSM_SESSION_PHASE_INITIALIZATION,
  
  /* window/compositing managers */
  GSM_SESSION_PHASE_WINDOW_MANAGER,
  
  /* apps that will create _NET_WM_WINDOW_TYPE_PANEL windows */
  GSM_SESSION_PHASE_PANEL,
  
  /* apps that will create _NET_WM_WINDOW_TYPE_DESKTOP windows */
  GSM_SESSION_PHASE_DESKTOP,
  
  /* everything else */
  GSM_SESSION_PHASE_APPLICATION,
  
  /* done launching */
  GSM_SESSION_PHASE_RUNNING,
  
  /* shutting down */
  GSM_SESSION_PHASE_SHUTDOWN
} GsmSessionPhase;

typedef enum {
  GSM_SESSION_LOGOUT_TYPE_LOGOUT,
  GSM_SESSION_LOGOUT_TYPE_SHUTDOWN
} GsmSessionLogoutType;

typedef enum {
  GSM_SESSION_LOGOUT_MODE_NORMAL,
  GSM_SESSION_LOGOUT_MODE_NO_CONFIRMATION,
  GSM_SESSION_LOGOUT_MODE_FORCE
} GsmSessionLogoutMode;

GType            gsm_session_get_type          (void) G_GNUC_CONST;

void             gsm_session_set_name          (GsmSession *session,
                                                const char *name);

void             gsm_session_start             (GsmSession *session);

GsmSessionPhase  gsm_session_get_phase         (GsmSession *session);

void             gsm_session_initiate_shutdown (GsmSession *session);

char            *gsm_session_register_client   (GsmSession *session,
                                                GsmClient  *client,
                                                const char *previous_id);

GsmSession *gsm_session_create_global (void);

G_END_DECLS

#endif /* __GSM_SESSION_H__ */