diff options
author | Juan R. García Blanco <juanrgar@gmail.com> | 2014-07-19 12:29:27 +0200 |
---|---|---|
committer | Juan R. García Blanco <juanrgar@gmail.com> | 2014-07-19 12:36:46 +0200 |
commit | 0417e5faae6be7a887ba3e15df481a97c71b4645 (patch) | |
tree | bf0eb454ed96934e2b5ea0119442fdf5cd12ce7c | |
parent | c6092ece126b691078199b1a1c607d4d78f65f8b (diff) | |
download | glibmm-0417e5faae6be7a887ba3e15df481a97c71b4645.tar.gz |
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
-rw-r--r-- | gio/giomm.h | 1 | ||||
-rw-r--r-- | gio/src/filelist.am | 1 | ||||
-rw-r--r-- | gio/src/simplepermission.ccg | 23 | ||||
-rw-r--r-- | gio/src/simplepermission.hg | 50 | ||||
-rw-r--r-- | 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 c6402912..a618251a 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 4fc8aeff..8ce9dd5f 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 00000000..c22ac8b2 --- /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 00000000..c6a2ea3d --- /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 06069f39..213f52e8 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) |