1 /* 2 * Copyright (C) 2010 Robert Ancell. 3 * Author: Robert Ancell <robert.ancell@canonical.com> 4 * 5 * This library is free software; you can redistribute it and/or modify it under 6 * the terms of the GNU Lesser General Public License as published by the Free 7 * Software Foundation; either version 2 or version 3 of the License. 8 * See http://www.gnu.org/copyleft/lgpl.html the full text of the license. 9 */ 10 11 #ifndef LIGHTDM_SESSION_H_ 12 #define LIGHTDM_SESSION_H_ 13 14 #include <glib-object.h> 15 16 G_BEGIN_DECLS 17 18 #define LIGHTDM_TYPE_SESSION (lightdm_session_get_type()) 19 #define LIGHTDM_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIGHTDM_TYPE_SESSION, LightDMSession)) 20 #define LIGHTDM_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIGHTDM_TYPE_SESSION, LightDMSessionClass)) 21 #define LIGHTDM_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIGHTDM_TYPE_SESSION)) 22 #define LIGHTDM_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIGHTDM_TYPE_SESSION)) 23 #define LIGHTDM_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIGHTDM_TYPE_SESSION, LightDMSessionClass)) 24 25 typedef struct _LightDMSession LightDMSession; 26 typedef struct _LightDMSessionClass LightDMSessionClass; 27 28 struct _LightDMSession 29 { 30 GObject parent_instance; 31 }; 32 33 struct _LightDMSessionClass 34 { 35 /*< private >*/ 36 GObjectClass parent_class; 37 38 /* Reserved */ 39 void (*reserved1) (void); 40 void (*reserved2) (void); 41 void (*reserved3) (void); 42 void (*reserved4) (void); 43 void (*reserved5) (void); 44 void (*reserved6) (void); 45 }; 46 47 #ifdef GLIB_VERSION_2_44 48 typedef LightDMSession *LightDMSession_autoptr; glib_autoptr_cleanup_LightDMSession(LightDMSession ** _ptr)49static inline void glib_autoptr_cleanup_LightDMSession (LightDMSession **_ptr) 50 { 51 glib_autoptr_cleanup_GObject ((GObject **) _ptr); 52 } 53 #endif 54 55 GType lightdm_session_get_type (void); 56 57 GList *lightdm_get_sessions (void); 58 59 GList *lightdm_get_remote_sessions (void); 60 61 const gchar *lightdm_session_get_key (LightDMSession *session); 62 63 const gchar *lightdm_session_get_session_type (LightDMSession *session); 64 65 const gchar *lightdm_session_get_name (LightDMSession *session); 66 67 const gchar *lightdm_session_get_comment (LightDMSession *session); 68 69 G_END_DECLS 70 71 #endif /* LIGHTDM_SESSION_H_ */ 72