use eggdbus to generate the AuthorizationResult enumeration
authorDavid Zeuthen <davidz@redhat.com>
Sun, 7 Dec 2008 17:38:40 +0000 (12:38 -0500)
committerDavid Zeuthen <davidz@redhat.com>
Sun, 7 Dec 2008 17:38:40 +0000 (12:38 -0500)
data/org.freedesktop.PolicyKit1.Authority.xml
src/polkit/Makefile.am
src/polkit/polkitauthorizationresult.c [deleted file]
src/polkit/polkitauthorizationresult.h [deleted file]

index 19b2351..dcad356 100644 (file)
@@ -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"/>
     </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">
index 22291ff..39d4a6e 100644 (file)
@@ -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)
diff --git a/src/polkit/polkitauthorizationresult.c b/src/polkit/polkitauthorizationresult.c
deleted file mode 100644 (file)
index 1123691..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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;
-}
diff --git a/src/polkit/polkitauthorizationresult.h b/src/polkit/polkitauthorizationresult.h
deleted file mode 100644 (file)
index 041ae35..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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 */
-