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 = TextAttributes
29  * strct   = GtkTextAttributes
30  * realStrct=
31  * ctorStrct=
32  * clss    = TextAttributes
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_text_attributes_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * 	- event
46  * imports:
47  * 	- gtkc.Loader
48  * 	- gtkc.paths
49  * structWrap:
50  * 	- GtkTextAttributes* -> TextAttributes
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module gtk.TextAttributes;
57 
58 public  import gtkc.gtktypes;
59 
60 private import gtkc.gtk;
61 private import glib.ConstructionException;
62 private import gobject.ObjectG;
63 
64 private import gobject.Signals;
65 public  import gtkc.gdktypes;
66 
67 private import gtkc.Loader;
68 private import gtkc.paths;
69 
70 
71 
72 
73 /**
74  * You may wish to begin by reading the text widget
75  * conceptual overview which gives an overview of all the objects and
76  * data types related to the text widget and how they work together.
77  *
78  * Tags should be in the GtkTextTagTable for a given GtkTextBuffer
79  * before using them with that buffer.
80  *
81  * gtk_text_buffer_create_tag() is the best way to create tags.
82  * See gtk3-demo for numerous examples.
83  *
84  * For each property of GtkTextTag, there is a "set" property, e.g.
85  * "font-set" corresponds to "font". These "set" properties reflect
86  * whether a property has been set or not.
87  * They are maintained by GTK+ and you should not set them independently.
88  */
89 public class TextAttributes
90 {
91 	
92 	/** the main Gtk struct */
93 	protected GtkTextAttributes* gtkTextAttributes;
94 	
95 	
96 	public GtkTextAttributes* getTextAttributesStruct()
97 	{
98 		return gtkTextAttributes;
99 	}
100 	
101 	
102 	/** the main Gtk struct as a void* */
103 	protected void* getStruct()
104 	{
105 		return cast(void*)gtkTextAttributes;
106 	}
107 	
108 	/**
109 	 * Sets our main struct and passes it to the parent class
110 	 */
111 	public this (GtkTextAttributes* gtkTextAttributes)
112 	{
113 		this.gtkTextAttributes = gtkTextAttributes;
114 	}
115 	
116 	~this ()
117 	{
118 		if (  Linker.isLoaded(LIBRARY.GTK) && gtkTextAttributes !is null )
119 		{
120 			gtk_text_attributes_unref(gtkTextAttributes);
121 		}
122 	}
123 	
124 	//TODO: properties ?
125 	
126 	/**
127 	 */
128 	
129 	/**
130 	 * Creates a GtkTextAttributes, which describes
131 	 * a set of properties on some text.
132 	 * Throws: ConstructionException GTK+ fails to create the object.
133 	 */
134 	public this ()
135 	{
136 		// GtkTextAttributes * gtk_text_attributes_new (void);
137 		auto p = gtk_text_attributes_new();
138 		if(p is null)
139 		{
140 			throw new ConstructionException("null returned by gtk_text_attributes_new()");
141 		}
142 		this(cast(GtkTextAttributes*) p);
143 	}
144 	
145 	/**
146 	 * Copies src and returns a new GtkTextAttributes.
147 	 * Returns: a copy of src, free with gtk_text_attributes_unref()
148 	 */
149 	public TextAttributes copy()
150 	{
151 		// GtkTextAttributes * gtk_text_attributes_copy (GtkTextAttributes *src);
152 		auto p = gtk_text_attributes_copy(gtkTextAttributes);
153 		
154 		if(p is null)
155 		{
156 			return null;
157 		}
158 		
159 		return ObjectG.getDObject!(TextAttributes)(cast(GtkTextAttributes*) p);
160 	}
161 	
162 	/**
163 	 * Copies the values from src to dest so that dest has
164 	 * the same values as src. Frees existing values in dest.
165 	 * Params:
166 	 * dest = another GtkTextAttributes
167 	 */
168 	public void copyValues(TextAttributes dest)
169 	{
170 		// void gtk_text_attributes_copy_values (GtkTextAttributes *src,  GtkTextAttributes *dest);
171 		gtk_text_attributes_copy_values(gtkTextAttributes, (dest is null) ? null : dest.getTextAttributesStruct());
172 	}
173 	
174 	/**
175 	 * Decrements the reference count on values, freeing the structure
176 	 * if the reference count reaches 0.
177 	 */
178 	public void unref()
179 	{
180 		// void gtk_text_attributes_unref (GtkTextAttributes *values);
181 		gtk_text_attributes_unref(gtkTextAttributes);
182 	}
183 	
184 	/**
185 	 * Increments the reference count on values.
186 	 * Returns: the GtkTextAttributes that were passed in
187 	 */
188 	public TextAttributes doref()
189 	{
190 		// GtkTextAttributes * gtk_text_attributes_ref (GtkTextAttributes *values);
191 		auto p = gtk_text_attributes_ref(gtkTextAttributes);
192 		
193 		if(p is null)
194 		{
195 			return null;
196 		}
197 		
198 		return ObjectG.getDObject!(TextAttributes)(cast(GtkTextAttributes*) p);
199 	}
200 }