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 = gtk
28  * outFile = Border
29  * strct   = GtkBorder
30  * realStrct=
31  * ctorStrct=
32  * clss    = Border
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_border_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * structWrap:
47  * 	- GtkBorder* -> Border
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gtk.Border;
54 
55 public  import gtkc.gtktypes;
56 
57 private import gtkc.gtk;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 private import gobject.Signals;
62 public  import gtkc.gdktypes;
63 
64 
65 
66 
67 
68 /**
69  * Description
70  */
71 public class Border
72 {
73 	
74 	/** the main Gtk struct */
75 	protected GtkBorder* gtkBorder;
76 	
77 	
78 	public GtkBorder* getBorderStruct()
79 	{
80 		return gtkBorder;
81 	}
82 	
83 	
84 	/** the main Gtk struct as a void* */
85 	protected void* getStruct()
86 	{
87 		return cast(void*)gtkBorder;
88 	}
89 	
90 	/**
91 	 * Sets our main struct and passes it to the parent class
92 	 */
93 	public this (GtkBorder* gtkBorder)
94 	{
95 		this.gtkBorder = gtkBorder;
96 	}
97 	
98 	/**
99 	 */
100 	int[string] connectedSignals;
101 	
102 	void delegate(Border)[] onRealizeListeners;
103 	/**
104 	 * Emitted when the style has been initialized for a particular
105 	 * colormap and depth. Connecting to this signal is probably seldom
106 	 * useful since most of the time applications and widgets only
107 	 * deal with styles that have been already realized.
108 	 * Since 2.4
109 	 */
110 	void addOnRealize(void delegate(Border) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
111 	{
112 		if ( !("realize" in connectedSignals) )
113 		{
114 			Signals.connectData(
115 			getStruct(),
116 			"realize",
117 			cast(GCallback)&callBackRealize,
118 			cast(void*)this,
119 			null,
120 			connectFlags);
121 			connectedSignals["realize"] = 1;
122 		}
123 		onRealizeListeners ~= dlg;
124 	}
125 	extern(C) static void callBackRealize(GtkStyle* styleStruct, Border _border)
126 	{
127 		foreach ( void delegate(Border) dlg ; _border.onRealizeListeners )
128 		{
129 			dlg(_border);
130 		}
131 	}
132 	
133 	void delegate(Border)[] onUnrealizeListeners;
134 	/**
135 	 * Emitted when the aspects of the style specific to a particular colormap
136 	 * and depth are being cleaned up. A connection to this signal can be useful
137 	 * if a widget wants to cache objects like a GdkGC as object data on GtkStyle.
138 	 * This signal provides a convenient place to free such cached objects.
139 	 * Since 2.4
140 	 */
141 	void addOnUnrealize(void delegate(Border) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
142 	{
143 		if ( !("unrealize" in connectedSignals) )
144 		{
145 			Signals.connectData(
146 			getStruct(),
147 			"unrealize",
148 			cast(GCallback)&callBackUnrealize,
149 			cast(void*)this,
150 			null,
151 			connectFlags);
152 			connectedSignals["unrealize"] = 1;
153 		}
154 		onUnrealizeListeners ~= dlg;
155 	}
156 	extern(C) static void callBackUnrealize(GtkStyle* styleStruct, Border _border)
157 	{
158 		foreach ( void delegate(Border) dlg ; _border.onUnrealizeListeners )
159 		{
160 			dlg(_border);
161 		}
162 	}
163 	
164 	
165 	/**
166 	 * Allocates a new GtkBorder structure and initializes its elements to zero.
167 	 * Since 2.14
168 	 * Throws: ConstructionException GTK+ fails to create the object.
169 	 */
170 	public this ()
171 	{
172 		// GtkBorder * gtk_border_new (void);
173 		auto p = gtk_border_new();
174 		if(p is null)
175 		{
176 			throw new ConstructionException("null returned by gtk_border_new()");
177 		}
178 		this(cast(GtkBorder*) p);
179 	}
180 	
181 	/**
182 	 * Copies a GtkBorder structure.
183 	 * Returns: a copy of border_.
184 	 */
185 	public Border copy()
186 	{
187 		// GtkBorder * gtk_border_copy (const GtkBorder *border_);
188 		auto p = gtk_border_copy(gtkBorder);
189 		
190 		if(p is null)
191 		{
192 			return null;
193 		}
194 		
195 		return ObjectG.getDObject!(Border)(cast(GtkBorder*) p);
196 	}
197 	
198 	/**
199 	 * Frees a GtkBorder structure.
200 	 */
201 	public void free()
202 	{
203 		// void gtk_border_free (GtkBorder *border_);
204 		gtk_border_free(gtkBorder);
205 	}
206 }