diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2018-11-17 22:22:03 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2022-02-24 19:59:24 +0100 |
commit | da4ff03c5ca427cf7cc4574f52f5190dc1b0dfb9 (patch) | |
tree | 184fd1c8e207f2ee137b2d9bded274a855e4bb37 /codegen/valaerrordomainregisterfunction.vala | |
parent | a1530007a7c1b829cdf5876f4090d30b502c1bc3 (diff) | |
download | vala-da4ff03c5ca427cf7cc4574f52f5190dc1b0dfb9.tar.gz |
codegen: Emit GType definition for error domains
Fixes https://gitlab.gnome.org/GNOME/vala/issues/699
Diffstat (limited to 'codegen/valaerrordomainregisterfunction.vala')
-rw-r--r-- | codegen/valaerrordomainregisterfunction.vala | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/codegen/valaerrordomainregisterfunction.vala b/codegen/valaerrordomainregisterfunction.vala new file mode 100644 index 000000000..b4be3295e --- /dev/null +++ b/codegen/valaerrordomainregisterfunction.vala @@ -0,0 +1,51 @@ +/* valaerrordomainregisterfunction.vala + * + * Copyright (C) 2018 Rico Tzschichholz + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Rico Tzschichholz <ricotz@ubuntu.com> + */ + +using GLib; + +/** + * C function to register an error domain at runtime. + */ +public class Vala.ErrorDomainRegisterFunction : TypeRegisterFunction { + /** + * Specifies the error domain to be registered. + */ + public weak ErrorDomain error_domain_reference { get; set; } + + /** + * Creates a new C function to register the specified error domain at runtime. + * + * @param edomain an error domain + * @return newly created error domain register function + */ + public ErrorDomainRegisterFunction (ErrorDomain edomain) { + error_domain_reference = edomain; + } + + public override TypeSymbol get_type_declaration () { + return error_domain_reference; + } + + public override SymbolAccessibility get_accessibility () { + return error_domain_reference.access; + } +} |