1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = gio-D-Bus-Introspection-Data.html 27 * outPack = gio 28 * outFile = DBusAnnotationInfo 29 * strct = GDBusAnnotationInfo 30 * realStrct= 31 * ctorStrct= 32 * clss = DBusAnnotationInfo 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - g_dbus_annotation_info_ 41 * omit structs: 42 * omit prefixes: 43 * - g_dbus_interface_info_ 44 * - g_dbus_node_info_ 45 * - g_dbus_method_info_ 46 * - g_dbus_signal_info_ 47 * - g_dbus_property_info_ 48 * - g_dbus_arg_info_ 49 * omit code: 50 * - g_dbus_annotation_info_lookup 51 * omit signals: 52 * imports: 53 * - glib.Str 54 * structWrap: 55 * - GDBusAnnotationInfo* -> DBusAnnotationInfo 56 * module aliases: 57 * local aliases: 58 * overrides: 59 */ 60 61 module gio.DBusAnnotationInfo; 62 63 public import gtkc.giotypes; 64 65 private import gtkc.gio; 66 private import glib.ConstructionException; 67 private import gobject.ObjectG; 68 69 private import glib.Str; 70 71 72 private import gobject.Boxed; 73 74 /** 75 * Various data structures and convenience routines to parse and 76 * generate D-Bus introspection XML. Introspection information is 77 * used when registering objects with g_dbus_connection_register_object(). 78 * 79 * The format of D-Bus introspection XML is specified in the 80 * D-Bus specification. 81 */ 82 public class DBusAnnotationInfo : Boxed 83 { 84 85 /** the main Gtk struct */ 86 protected GDBusAnnotationInfo* gDBusAnnotationInfo; 87 88 89 /** Get the main Gtk struct */ 90 public GDBusAnnotationInfo* getDBusAnnotationInfoStruct() 91 { 92 return gDBusAnnotationInfo; 93 } 94 95 96 /** the main Gtk struct as a void* */ 97 protected void* getStruct() 98 { 99 return cast(void*)gDBusAnnotationInfo; 100 } 101 102 /** 103 * Sets our main struct and passes it to the parent class 104 */ 105 public this (GDBusAnnotationInfo* gDBusAnnotationInfo) 106 { 107 this.gDBusAnnotationInfo = gDBusAnnotationInfo; 108 } 109 110 /** 111 * Looks up the value of an annotation. 112 * This cost of this function is O(n) in number of annotations. 113 * Since 2.26 114 * Params: 115 * annotations = A array of annotations or NULL. 116 * name = The name of the annotation to look up. 117 * Returns: The value or null if not found. 118 */ 119 public static string lookup(DBusAnnotationInfo[] annotations, string name) 120 { 121 // const gchar * g_dbus_annotation_info_lookup (GDBusAnnotationInfo **annotations, const gchar *name); 122 123 GDBusAnnotationInfo*[] annotationsArray = new GDBusAnnotationInfo*[annotations.length+1]; 124 for ( int i = 0; i < annotations.length ; i++ ) 125 { 126 annotationsArray[i] = annotations[i].getDBusAnnotationInfoStruct(); 127 } 128 annotationsArray[$-1] = null; 129 130 return Str.toString(g_dbus_annotation_info_lookup(annotationsArray.ptr, Str.toStringz(name))); 131 } 132 133 /** 134 */ 135 136 /** 137 * If info is statically allocated does nothing. Otherwise increases 138 * the reference count. 139 * Since 2.26 140 * Returns: The same info. 141 */ 142 public DBusAnnotationInfo doref() 143 { 144 // GDBusAnnotationInfo * g_dbus_annotation_info_ref (GDBusAnnotationInfo *info); 145 auto p = g_dbus_annotation_info_ref(gDBusAnnotationInfo); 146 147 if(p is null) 148 { 149 return null; 150 } 151 152 return ObjectG.getDObject!(DBusAnnotationInfo)(cast(GDBusAnnotationInfo*) p); 153 } 154 155 /** 156 * If info is statically allocated, does nothing. Otherwise decreases 157 * the reference count of info. When its reference count drops to 0, 158 * the memory used is freed. 159 * Since 2.26 160 */ 161 public void unref() 162 { 163 // void g_dbus_annotation_info_unref (GDBusAnnotationInfo *info); 164 g_dbus_annotation_info_unref(gDBusAnnotationInfo); 165 } 166 }