Commit c63cccdf authored by David Zeuthen's avatar David Zeuthen

use eggdbus to generate the AuthorizationResult enumeration

parent 40cca695
......@@ -7,7 +7,7 @@
<annotation name="org.gtk.EggDBus.Struct.Signature" value="(sa{sv})"/>
</annotation>
<!-- The error domain used -->
<!-- The error domain used for reporting erros -->
<annotation name="org.gtk.EggDBus.DeclareErrorDomain" value="Error">
<annotation name="org.gtk.EggDBus.ErrorDomain.Member" value="org.freedesktop.PolicyKit1.Error.Failed">
<annotation name="org.gtk.EggDBus.DocString" value="The operation failed"/>
......@@ -17,6 +17,20 @@
</annotation>
</annotation>
<!-- An enumeration for -->
<annotation name="org.gtk.EggDBus.DeclareEnum" value="AuthorizationResult">
<annotation name="org.gtk.EggDBus.Enum.Member" value="NotAuthorized">
<annotation name="org.gtk.EggDBus.DocString" value="The subject is not authorized for the specified action"/>
</annotation>
<annotation name="org.gtk.EggDBus.Enum.Member" value="Authorized">
<annotation name="org.gtk.EggDBus.DocString" value="The subject is authorized for the specified action"/>
</annotation>
<annotation name="org.gtk.EggDBus.Enum.Member" value="Challenge">
<annotation name="org.gtk.EggDBus.DocString" value="The subject is authorized if more information is provided"/>
</annotation>
</annotation>
<interface name="org.freedesktop.PolicyKit1.Authority">
<method name="SayHello">
......
......@@ -20,6 +20,7 @@ BUILT_SOURCES = \
polkitauthority.h polkitauthority.c \
polkiterror.h polkiterror.c \
polkitbindingsmarshal.h polkitbindingsmarshal.c \
polkitauthorizationresult.h polkitauthorizationresult.c \
polkitbindingsmarshal.list \
$(NULL)
......@@ -53,7 +54,6 @@ libpolkit_gobject_1_la_SOURCES = \
polkitauthoritystub.h polkitauthoritystub.c \
polkitactiondescription.h polkitactiondescription.c \
polkitauthorizationclaim.h polkitauthorizationclaim.c \
polkitauthorizationresult.h polkitauthorizationresult.c \
polkitsubject.h polkitsubject.c \
$(BUILT_SOURCES) \
$(NULL)
......
/*
* Copyright (C) 2008 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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 Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: David Zeuthen <davidz@redhat.com>
*/
#include "config.h"
#include <polkit/polkitauthorizationresult.h>
/**
* SECTION:polkitauthorizationresult
* @title: PolkitAuthorizationResult
* @short_description: Result of checking a claim
* @include: polkit/polkit.h
*
* The #PolkitAuthorizationResult enumeration is for possible results
* when checking whether a claim is authorized.
**/
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
GType
polkit_authorization_result_get_type (void)
{
static GType etype = 0;
if (etype == 0)
{
static const GEnumValue values[] = {
ENUM_ENTRY (POLKIT_AUTHORIZATION_RESULT_NOT_AUTHORIZED, "NotAuthorized"),
ENUM_ENTRY (POLKIT_AUTHORIZATION_RESULT_AUTHORIZED, "Authorized"),
ENUM_ENTRY (POLKIT_AUTHORIZATION_RESULT_CHALLENGE, "Challenge"),
{ 0, 0, 0 }
};
etype = g_enum_register_static ("PolkitAuthorizationResult", values);
}
return etype;
}
/*
* Copyright (C) 2008 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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 Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: David Zeuthen <davidz@redhat.com>
*/
#if !defined (_POLKIT_COMPILATION) && !defined(_POLKIT_INSIDE_POLKIT_H)
#error "Only <polkit/polkit.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef __POLKIT_AUTHORIZATION_RESULT_H
#define __POLKIT_AUTHORIZATION_RESULT_H
#include <glib-object.h>
G_BEGIN_DECLS
#define POLKIT_TYPE_AUTHORIZATION_RESULT (polkit_authorization_result_get_type ())
/**
* PolkitAuthorizationResult:
* @POLKIT_AUTHORIZATION_RESULT_NOT_AUTHORIZED: Not authorized.
* @POLKIT_AUTHORIZATION_RESULT_AUTHORIZED: Authorized.
* @POLKIT_AUTHORIZATION_RESULT_CHALLENGE: Can be authorized if further information is given.
*
* The possible results when checking whether a claim is authorized.
*/
typedef enum {
POLKIT_AUTHORIZATION_RESULT_NOT_AUTHORIZED,
POLKIT_AUTHORIZATION_RESULT_AUTHORIZED,
POLKIT_AUTHORIZATION_RESULT_CHALLENGE
} PolkitAuthorizationResult;
GType polkit_authorization_result_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __POLKIT_AUTHORIZATION_RESULT_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment