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 module gio.DBusMethodInfo; 26 27 private import gobject.ObjectG; 28 private import gtkc.gio; 29 public import gtkc.giotypes; 30 private import gtkd.Loader; 31 32 33 /** 34 * Information about a method on an D-Bus interface. 35 * 36 * Since: 2.26 37 */ 38 public class DBusMethodInfo 39 { 40 /** the main Gtk struct */ 41 protected GDBusMethodInfo* gDBusMethodInfo; 42 protected bool ownedRef; 43 44 /** Get the main Gtk struct */ 45 public GDBusMethodInfo* getDBusMethodInfoStruct(bool transferOwnership = false) 46 { 47 if (transferOwnership) 48 ownedRef = false; 49 return gDBusMethodInfo; 50 } 51 52 /** the main Gtk struct as a void* */ 53 protected void* getStruct() 54 { 55 return cast(void*)gDBusMethodInfo; 56 } 57 58 /** 59 * Sets our main struct and passes it to the parent class. 60 */ 61 public this (GDBusMethodInfo* gDBusMethodInfo, bool ownedRef = false) 62 { 63 this.gDBusMethodInfo = gDBusMethodInfo; 64 this.ownedRef = ownedRef; 65 } 66 67 ~this () 68 { 69 if ( Linker.isLoaded(LIBRARY_GIO) && ownedRef ) 70 g_dbus_method_info_unref(gDBusMethodInfo); 71 } 72 73 74 /** */ 75 public static GType getType() 76 { 77 return g_dbus_method_info_get_type(); 78 } 79 80 /** 81 * If @info is statically allocated does nothing. Otherwise increases 82 * the reference count. 83 * 84 * Returns: The same @info. 85 * 86 * Since: 2.26 87 */ 88 public DBusMethodInfo doref() 89 { 90 auto p = g_dbus_method_info_ref(gDBusMethodInfo); 91 92 if(p is null) 93 { 94 return null; 95 } 96 97 return ObjectG.getDObject!(DBusMethodInfo)(cast(GDBusMethodInfo*) p, true); 98 } 99 100 /** 101 * If @info is statically allocated, does nothing. Otherwise decreases 102 * the reference count of @info. When its reference count drops to 0, 103 * the memory used is freed. 104 * 105 * Since: 2.26 106 */ 107 public void unref() 108 { 109 g_dbus_method_info_unref(gDBusMethodInfo); 110 } 111 }