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 = 27 * outPack = gio 28 * outFile = DBusInterfaceInfo 29 * strct = GDBusInterfaceInfo 30 * realStrct= 31 * ctorStrct= 32 * clss = DBusInterfaceInfo 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - g_dbus_interface_info_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - glib.StringG 48 * - gio.DBusMethodInfo 49 * - gio.DBusPropertyInfo 50 * - gio.DBusSignalInfo 51 * structWrap: 52 * - GDBusInterfaceInfo* -> DBusInterfaceInfo 53 * - GDBusMethodInfo* -> DBusMethodInfo 54 * - GDBusPropertyInfo* -> DBusPropertyInfo 55 * - GDBusSignalInfo* -> DBusSignalInfo 56 * - GString* -> StringG 57 * module aliases: 58 * local aliases: 59 * overrides: 60 */ 61 62 module gio.DBusInterfaceInfo; 63 64 public import gtkc.giotypes; 65 66 private import gtkc.gio; 67 private import glib.ConstructionException; 68 private import gobject.ObjectG; 69 70 private import glib.Str; 71 private import glib.StringG; 72 private import gio.DBusMethodInfo; 73 private import gio.DBusPropertyInfo; 74 private import gio.DBusSignalInfo; 75 76 77 78 /** 79 * Various data structures and convenience routines to parse and 80 * generate D-Bus introspection XML. Introspection information is 81 * used when registering objects with g_dbus_connection_register_object(). 82 * 83 * The format of D-Bus introspection XML is specified in the 84 * D-Bus specification. 85 */ 86 public class DBusInterfaceInfo 87 { 88 89 /** the main Gtk struct */ 90 protected GDBusInterfaceInfo* gDBusInterfaceInfo; 91 92 93 /** Get the main Gtk struct */ 94 public GDBusInterfaceInfo* getDBusInterfaceInfoStruct() 95 { 96 return gDBusInterfaceInfo; 97 } 98 99 100 /** the main Gtk struct as a void* */ 101 protected void* getStruct() 102 { 103 return cast(void*)gDBusInterfaceInfo; 104 } 105 106 /** 107 * Sets our main struct and passes it to the parent class 108 */ 109 public this (GDBusInterfaceInfo* gDBusInterfaceInfo) 110 { 111 this.gDBusInterfaceInfo = gDBusInterfaceInfo; 112 } 113 114 /** 115 */ 116 117 /** 118 * Looks up information about a method. 119 * The cost of this function is O(n) in number of methods unless 120 * g_dbus_interface_info_cache_build() has been used on info. 121 * Since 2.26 122 * Params: 123 * name = A D-Bus method name (typically in CamelCase) 124 * Returns: A GDBusMethodInfo or NULL if not found. Do not free, it is owned by info. [transfer none] 125 */ 126 public DBusMethodInfo lookupMethod(string name) 127 { 128 // GDBusMethodInfo * g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info, const gchar *name); 129 auto p = g_dbus_interface_info_lookup_method(gDBusInterfaceInfo, Str.toStringz(name)); 130 131 if(p is null) 132 { 133 return null; 134 } 135 136 return ObjectG.getDObject!(DBusMethodInfo)(cast(GDBusMethodInfo*) p); 137 } 138 139 /** 140 * Looks up information about a signal. 141 * The cost of this function is O(n) in number of signals unless 142 * g_dbus_interface_info_cache_build() has been used on info. 143 * Since 2.26 144 * Params: 145 * name = A D-Bus signal name (typically in CamelCase) 146 * Returns: A GDBusSignalInfo or NULL if not found. Do not free, it is owned by info. [transfer none] 147 */ 148 public DBusSignalInfo lookupSignal(string name) 149 { 150 // GDBusSignalInfo * g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info, const gchar *name); 151 auto p = g_dbus_interface_info_lookup_signal(gDBusInterfaceInfo, Str.toStringz(name)); 152 153 if(p is null) 154 { 155 return null; 156 } 157 158 return ObjectG.getDObject!(DBusSignalInfo)(cast(GDBusSignalInfo*) p); 159 } 160 161 /** 162 * Looks up information about a property. 163 * The cost of this function is O(n) in number of properties unless 164 * g_dbus_interface_info_cache_build() has been used on info. 165 * Since 2.26 166 * Params: 167 * name = A D-Bus property name (typically in CamelCase). 168 * Returns: A GDBusPropertyInfo or NULL if not found. Do not free, it is owned by info. [transfer none] 169 */ 170 public DBusPropertyInfo lookupProperty(string name) 171 { 172 // GDBusPropertyInfo * g_dbus_interface_info_lookup_property (GDBusInterfaceInfo *info, const gchar *name); 173 auto p = g_dbus_interface_info_lookup_property(gDBusInterfaceInfo, Str.toStringz(name)); 174 175 if(p is null) 176 { 177 return null; 178 } 179 180 return ObjectG.getDObject!(DBusPropertyInfo)(cast(GDBusPropertyInfo*) p); 181 } 182 183 /** 184 * Builds a lookup-cache to speed up 185 * g_dbus_interface_info_lookup_method(), 186 * g_dbus_interface_info_lookup_signal() and 187 * g_dbus_interface_info_lookup_property(). 188 * If this has already been called with info, the existing cache is 189 * used and its use count is increased. 190 * Note that info cannot be modified until 191 * g_dbus_interface_info_cache_release() is called. 192 * Since 2.30 193 */ 194 public void cacheBuild() 195 { 196 // void g_dbus_interface_info_cache_build (GDBusInterfaceInfo *info); 197 g_dbus_interface_info_cache_build(gDBusInterfaceInfo); 198 } 199 200 /** 201 * Decrements the usage count for the cache for info built by 202 * g_dbus_interface_info_cache_build() (if any) and frees the 203 * resources used by the cache if the usage count drops to zero. 204 * Since 2.30 205 */ 206 public void cacheRelease() 207 { 208 // void g_dbus_interface_info_cache_release (GDBusInterfaceInfo *info); 209 g_dbus_interface_info_cache_release(gDBusInterfaceInfo); 210 } 211 212 /** 213 * Appends an XML representation of info (and its children) to string_builder. 214 * This function is typically used for generating introspection XML 215 * documents at run-time for handling the 216 * org.freedesktop.DBus.Introspectable.Introspect 217 * method. 218 * Since 2.26 219 * Params: 220 * indent = Indentation level. 221 * stringBuilder = A GString to to append XML data to. [out] 222 */ 223 public void generateXml(uint indent, StringG stringBuilder) 224 { 225 // void g_dbus_interface_info_generate_xml (GDBusInterfaceInfo *info, guint indent, GString *string_builder); 226 g_dbus_interface_info_generate_xml(gDBusInterfaceInfo, indent, (stringBuilder is null) ? null : stringBuilder.getStringGStruct()); 227 } 228 229 /** 230 * If info is statically allocated does nothing. Otherwise increases 231 * the reference count. 232 * Since 2.26 233 * Returns: The same info. 234 */ 235 public DBusInterfaceInfo doref() 236 { 237 // GDBusInterfaceInfo * g_dbus_interface_info_ref (GDBusInterfaceInfo *info); 238 auto p = g_dbus_interface_info_ref(gDBusInterfaceInfo); 239 240 if(p is null) 241 { 242 return null; 243 } 244 245 return ObjectG.getDObject!(DBusInterfaceInfo)(cast(GDBusInterfaceInfo*) p); 246 } 247 248 /** 249 * If info is statically allocated, does nothing. Otherwise decreases 250 * the reference count of info. When its reference count drops to 0, 251 * the memory used is freed. 252 * Since 2.26 253 */ 254 public void unref() 255 { 256 // void g_dbus_interface_info_unref (GDBusInterfaceInfo *info); 257 g_dbus_interface_info_unref(gDBusInterfaceInfo); 258 } 259 }