[134] | 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
---|
| 2 | * |
---|
| 3 | * gdm-display-access-file.h - Abstraction around xauth cookies |
---|
| 4 | * |
---|
| 5 | * Copyright (C) 2007 Ray Strode <rstrode@redhat.com> |
---|
| 6 | * |
---|
| 7 | * Written by Ray Strode <rstrode@redhat.com> |
---|
| 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or modify |
---|
| 10 | * it under the terms of the GNU General Public License as published by |
---|
| 11 | * the Free Software Foundation; either version 2, or (at your option) |
---|
| 12 | * any later version. |
---|
| 13 | * |
---|
| 14 | * This program is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this program; if not, write to the Free Software |
---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
| 22 | * 02111-1307, USA. |
---|
| 23 | */ |
---|
| 24 | #ifndef __GDM_DISPLAY_ACCESS_FILE_H__ |
---|
| 25 | #define __GDM_DISPLAY_ACCESS_FILE_H__ |
---|
| 26 | |
---|
| 27 | #include <glib.h> |
---|
| 28 | #include <glib-object.h> |
---|
| 29 | |
---|
| 30 | #include "gdm-display.h" |
---|
| 31 | |
---|
| 32 | G_BEGIN_DECLS |
---|
| 33 | #define GDM_TYPE_DISPLAY_ACCESS_FILE (gdm_display_access_file_get_type ()) |
---|
| 34 | #define GDM_DISPLAY_ACCESS_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDM_TYPE_DISPLAY_ACCESS_FILE, GdmDisplayAccessFile)) |
---|
| 35 | #define GDM_DISPLAY_ACCESS_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDM_TYPE_DISPLAY_ACCESS_FILE, GdmDisplayAccessFileClass)) |
---|
| 36 | #define GDM_IS_DISPLAY_ACCESS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDM_TYPE_DISPLAY_ACCESS_FILE)) |
---|
| 37 | #define GDM_IS_DISPLAY_ACCESS_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDM_TYPE_DISPLAY_ACCESS_FILE)) |
---|
| 38 | #define GDM_DISPLAY_ACCESS_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GDM_TYPE_DISPLAY_ACCESS_FILE, GdmDisplayAccessFileClass)) |
---|
| 39 | #define GDM_DISPLAY_ACCESS_FILE_ERROR (gdm_display_access_file_error_quark ()) |
---|
| 40 | |
---|
| 41 | typedef struct _GdmDisplayAccessFile GdmDisplayAccessFile; |
---|
| 42 | typedef struct _GdmDisplayAccessFileClass GdmDisplayAccessFileClass; |
---|
| 43 | typedef struct _GdmDisplayAccessFilePrivate GdmDisplayAccessFilePrivate; |
---|
| 44 | typedef enum _GdmDisplayAccessFileError GdmDisplayAccessFileError; |
---|
| 45 | |
---|
| 46 | struct _GdmDisplayAccessFile |
---|
| 47 | { |
---|
| 48 | GObject parent; |
---|
| 49 | |
---|
| 50 | GdmDisplayAccessFilePrivate *priv; |
---|
| 51 | }; |
---|
| 52 | |
---|
| 53 | struct _GdmDisplayAccessFileClass |
---|
| 54 | { |
---|
| 55 | GObjectClass parent_class; |
---|
| 56 | }; |
---|
| 57 | |
---|
| 58 | enum _GdmDisplayAccessFileError |
---|
| 59 | { |
---|
| 60 | GDM_DISPLAY_ACCESS_FILE_ERROR_GENERAL = 0, |
---|
| 61 | GDM_DISPLAY_ACCESS_FILE_ERROR_FINDING_AUTH_ENTRY |
---|
| 62 | }; |
---|
| 63 | |
---|
| 64 | GQuark gdm_display_access_file_error_quark (void); |
---|
| 65 | GType gdm_display_access_file_get_type (void); |
---|
| 66 | |
---|
| 67 | GdmDisplayAccessFile *gdm_display_access_file_new (const char *username); |
---|
| 68 | gboolean gdm_display_access_file_open (GdmDisplayAccessFile *file, |
---|
| 69 | GError **error); |
---|
| 70 | gboolean gdm_display_access_file_add_display (GdmDisplayAccessFile *file, |
---|
| 71 | GdmDisplay *display, |
---|
| 72 | char **cookie, |
---|
| 73 | gsize *cookie_size, |
---|
| 74 | GError **error); |
---|
| 75 | gboolean gdm_display_access_file_add_display_with_cookie (GdmDisplayAccessFile *file, |
---|
| 76 | GdmDisplay *display, |
---|
| 77 | const char *cookie, |
---|
| 78 | gsize cookie_size, |
---|
| 79 | GError **error); |
---|
| 80 | gboolean gdm_display_access_file_remove_display (GdmDisplayAccessFile *file, |
---|
| 81 | GdmDisplay *display, |
---|
| 82 | GError **error); |
---|
| 83 | |
---|
| 84 | void gdm_display_access_file_close (GdmDisplayAccessFile *file); |
---|
| 85 | char *gdm_display_access_file_get_path (GdmDisplayAccessFile *file); |
---|
| 86 | |
---|
| 87 | G_END_DECLS |
---|
| 88 | #endif /* __GDM_DISPLAY_ACCESS_FILE_H__ */ |
---|