[glibmm] Add Gio::SimplePermission
- From: Juan R. Garcia Blanco <juanrgar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Add Gio::SimplePermission
- Date: Sat, 19 Jul 2014 10:42:06 +0000 (UTC)
commit 0417e5faae6be7a887ba3e15df481a97c71b4645
Author: Juan R. GarcĂa Blanco <juanrgar gmail com>
Date: Sat Jul 19 12:29:27 2014 +0200
Add Gio::SimplePermission
* gio/giomm.h: Add giomm/simplepermission.h.
* gio/src/simplepermission.[hg|ccg]: New files.
* gio/src/filelist.am: Add simplepermission.hg.
* tools/extra_defs_gen/generate_defs_gio.cc: Add
G_TYPE_SIMPLE_PERMISSION (although SimplePermission has no
signals nor properties).
* See https://bugzilla.gnome.org/show_bug.cgi?id=732436
gio/giomm.h | 1 +
gio/src/filelist.am | 1 +
gio/src/simplepermission.ccg | 23 +++++++++++++
gio/src/simplepermission.hg | 50 +++++++++++++++++++++++++++++
tools/extra_defs_gen/generate_defs_gio.cc | 1 +
5 files changed, 76 insertions(+), 0 deletions(-)
---
diff --git a/gio/giomm.h b/gio/giomm.h
index c640291..a618251 100644
--- a/gio/giomm.h
+++ b/gio/giomm.h
@@ -116,6 +116,7 @@
#include <giomm/settings.h>
#include <giomm/simpleaction.h>
#include <giomm/simpleactiongroup.h>
+#include <giomm/simplepermission.h>
#include <giomm/socket.h>
#include <giomm/socketaddress.h>
#include <giomm/socketaddressenumerator.h>
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index 4fc8aef..8ce9dd5 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -103,6 +103,7 @@ giomm_files_any_hg = \
settings.hg \
simpleaction.hg \
simpleactiongroup.hg \
+ simplepermission.hg \
socket.hg \
socketaddress.hg \
socketaddressenumerator.hg \
diff --git a/gio/src/simplepermission.ccg b/gio/src/simplepermission.ccg
new file mode 100644
index 0000000..c22ac8b
--- /dev/null
+++ b/gio/src/simplepermission.ccg
@@ -0,0 +1,23 @@
+/* Copyright (C) 2014 The gtkmm Development Team
+ *
+ * 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.1 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+
+
+namespace Gio
+{
+} // namespace Gio
diff --git a/gio/src/simplepermission.hg b/gio/src/simplepermission.hg
new file mode 100644
index 0000000..c6a2ea3
--- /dev/null
+++ b/gio/src/simplepermission.hg
@@ -0,0 +1,50 @@
+/* Copyright (C) 2014 The giomm Development Team
+ *
+ * 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.1 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <giomm/permission.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(giomm/private/permission_p.h)
+
+namespace Gio
+{
+
+/** A Permission that doesn't change value.
+ *
+ * SimplePermission is a trivial implementation of Permission that
+ * represents a permission that is either always or never allowed. The
+ * value is given at construction and doesn't change.
+ *
+ * Calling Permission::acquire() or Permission::release() will result
+ * in errors.
+ */
+class SimplePermission : public Permission
+{
+ _CLASS_GOBJECT(SimplePermission, GSimplePermission, G_SIMPLE_PERMISSION, Gio::Permission, GPermission)
+
+protected:
+
+ _WRAP_CTOR(SimplePermission(bool allowed), g_simple_permission_new)
+
+public:
+
+ _WRAP_CREATE(bool allowed)
+
+ // SimplePermission has no properties nor signals.
+};
+
+} // namespace Gio
diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc
index 06069f3..213f52e 100644
--- a/tools/extra_defs_gen/generate_defs_gio.cc
+++ b/tools/extra_defs_gen/generate_defs_gio.cc
@@ -116,6 +116,7 @@ int main(int, char**)
<< get_defs(G_TYPE_NETWORK_ADDRESS)
<< get_defs(G_TYPE_NETWORK_SERVICE)
<< get_defs(G_TYPE_SETTINGS)
+ << get_defs(G_TYPE_SIMPLE_PERMISSION)
<< get_defs(G_TYPE_SOCKET)
<< get_defs(G_TYPE_SOCKET_CLIENT)
<< get_defs(G_TYPE_SOCKET_CONNECTION)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]