~ubuntu-branches/ubuntu/dapper/gnome-screensaver/dapper

« back to all changes in this revision

Viewing changes to src/cut-n-paste/fusa-manager.h

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2005-10-10 00:18:18 UTC
  • Revision ID: james.westby@ubuntu.com-20051010001818-3mujs05r8rht7xi1
Tags: upstream-0.0.15
ImportĀ upstreamĀ versionĀ 0.0.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Fast User Switch Applet: fusa-manager.h
 
3
 * 
 
4
 * Copyright (C) 2005 James M. Cape <jcape@ignore-your.tv>.
 
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 of the License, or
 
9
 * (at your option) 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  02111-1307  USA
 
19
 */
 
20
 
 
21
/*
 
22
 * Singleton object to manage FusaDisplay and FusaUser objects, and handle GDM
 
23
 * interaction/configs.
 
24
 */
 
25
 
 
26
#ifndef __FUSA_MANAGER_H__
 
27
#define __FUSA_MANAGER_H__ 1
 
28
 
 
29
#include <gdk/gdkscreen.h>
 
30
 
 
31
#include "fusa-display.h"
 
32
#include "fusa-user.h"
 
33
 
 
34
G_BEGIN_DECLS
 
35
 
 
36
#define FUSA_TYPE_MANAGER \
 
37
  (fusa_manager_get_type ())
 
38
#define FUSA_MANAGER(object) \
 
39
  (G_TYPE_CHECK_INSTANCE_CAST ((object), FUSA_TYPE_MANAGER, FusaManager))
 
40
#define FUSA_IS_MANAGER(object) \
 
41
  (G_TYPE_CHECK_INSTANCE_TYPE ((object), FUSA_TYPE_MANAGER))
 
42
 
 
43
#define FUSA_MANAGER_DM_ERROR \
 
44
  (fusa_manager_dm_error_get_quark ())
 
45
 
 
46
#define FUSA_MANAGER_SIGNAL_USER_ADDED \
 
47
  "user-added"
 
48
#define FUSA_MANAGER_SIGNAL_USER_REMOVED \
 
49
  "user-removed"
 
50
#define FUSA_MANAGER_SIGNAL_DISPLAY_ADDED \
 
51
  "display-added"
 
52
#define FUSA_MANAGER_SIGNAL_DISPLAY_REMOVED \
 
53
  "display-removed"
 
54
 
 
55
 
 
56
typedef enum
 
57
{
 
58
  FUSA_MANAGER_DM_ERROR_UNKNOWN               = -1,
 
59
  FUSA_MANAGER_DM_ERROR_NOT_RUNNING           =  0,
 
60
  FUSA_MANAGER_DM_ERROR_FLEXI_LIMIT_REACHED   =  1,
 
61
  FUSA_MANAGER_DM_ERROR_X_ERROR               =  2,
 
62
  FUSA_MANAGER_DM_ERROR_X_FAILED              =  3,
 
63
  FUSA_MANAGER_DM_ERROR_X_LIMIT_REACHED       =  4,
 
64
  FUSA_MANAGER_DM_ERROR_XNEST_AUTH_ERROR      =  5,
 
65
  FUSA_MANAGER_DM_ERROR_X_NOT_FOUND           =  6,
 
66
  FUSA_MANAGER_DM_ERROR_LOGOUT_ACTION         =  7,
 
67
  FUSA_MANAGER_DM_ERROR_CONSOLES_UNSUPPORTED  =  8,
 
68
  FUSA_MANAGER_DM_ERROR_INVALID_CONSOLE       =  9,
 
69
  FUSA_MANAGER_DM_ERROR_UNKNOWN_CONFIG        =  50,
 
70
  FUSA_MANAGER_DM_ERROR_PERMISSIONS           =  100,
 
71
  FUSA_MANAGER_DM_ERROR_TOO_MANY_MESSAGES     =  200,
 
72
  FUSA_MANAGER_DM_ERROR_OTHER                 = -2
 
73
}
 
74
FusaManagerDmError;
 
75
 
 
76
typedef struct _FusaManager FusaManager;
 
77
  
 
78
typedef void (*FusaManagerDisplayCallback)      (FusaManager  *manager,
 
79
                                                 FusaDisplay  *display,
 
80
                                                 const GError *error,
 
81
                                                 gpointer      data);
 
82
 
 
83
GType        fusa_manager_get_type              (void) G_GNUC_CONST;
 
84
 
 
85
FusaManager *fusa_manager_ref_default           (void);
 
86
 
 
87
/* Users */
 
88
GSList      *fusa_manager_list_users            (FusaManager *manager);
 
89
FusaUser    *fusa_manager_get_user              (FusaManager *manager,
 
90
                                                 const gchar *name);
 
91
FusaUser    *fusa_manager_get_user_by_uid       (FusaManager *manager,
 
92
                                                 uid_t        uid);
 
93
 
 
94
/* Displays */
 
95
GSList      *fusa_manager_list_displays         (FusaManager *manager);
 
96
FusaDisplay *fusa_manager_get_display           (FusaManager *manager,
 
97
                                                 const gchar *name);
 
98
FusaDisplay *fusa_manager_get_display_by_screen (FusaManager *manager,
 
99
                                                 GdkScreen   *screen);
 
100
 
 
101
/* Methods */
 
102
void         fusa_manager_activate_display      (FusaManager                *manager,
 
103
                                                 FusaDisplay                *display,
 
104
                                                 GdkScreen                  *screen,
 
105
                                                 FusaManagerDisplayCallback  func,
 
106
                                                 gpointer                    data,
 
107
                                                 GDestroyNotify              notify);
 
108
void         fusa_manager_new_console           (FusaManager                *manager,
 
109
                                                 GdkScreen                  *screen,
 
110
                                                 FusaManagerDisplayCallback  func,
 
111
                                                 gpointer                    data,
 
112
                                                 GDestroyNotify              notify);
 
113
void         fusa_manager_new_xnest             (FusaManager                *manager,
 
114
                                                 GdkScreen                  *screen,
 
115
                                                 FusaManagerDisplayCallback  func,
 
116
                                                 gpointer                    data,
 
117
                                                 GDestroyNotify              notify);
 
118
 
 
119
/* Errors */
 
120
GQuark       fusa_manager_dm_error_get_quark    (void) G_GNUC_CONST;
 
121
 
 
122
G_END_DECLS
 
123
 
 
124
#endif /* !__FUSA_MANAGER_H__ */