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 gsv.SourceGutter;
26 
27 private import gdk.Window;
28 private import gobject.ObjectG;
29 private import gsv.SourceGutterRenderer;
30 private import gsvc.gsv;
31 public  import gsvc.gsvtypes;
32 
33 
34 /** */
35 public class SourceGutter : ObjectG
36 {
37 	/** the main Gtk struct */
38 	protected GtkSourceGutter* gtkSourceGutter;
39 
40 	/** Get the main Gtk struct */
41 	public GtkSourceGutter* getSourceGutterStruct()
42 	{
43 		return gtkSourceGutter;
44 	}
45 
46 	/** the main Gtk struct as a void* */
47 	protected override void* getStruct()
48 	{
49 		return cast(void*)gtkSourceGutter;
50 	}
51 
52 	protected override void setStruct(GObject* obj)
53 	{
54 		gtkSourceGutter = cast(GtkSourceGutter*)obj;
55 		super.setStruct(obj);
56 	}
57 
58 	/**
59 	 * Sets our main struct and passes it to the parent class.
60 	 */
61 	public this (GtkSourceGutter* gtkSourceGutter, bool ownedRef = false)
62 	{
63 		this.gtkSourceGutter = gtkSourceGutter;
64 		super(cast(GObject*)gtkSourceGutter, ownedRef);
65 	}
66 
67 
68 	/** */
69 	public static GType getType()
70 	{
71 		return gtk_source_gutter_get_type();
72 	}
73 
74 	/**
75 	 *
76 	 *
77 	 * Deprecated: Use gtk_source_gutter_renderer_get_padding() instead.
78 	 */
79 	public void getPadding(int* xpad, int* ypad)
80 	{
81 		gtk_source_gutter_get_padding(gtkSourceGutter, xpad, ypad);
82 	}
83 
84 	/**
85 	 * Finds the #GtkSourceGutterRenderer at (x, y).
86 	 *
87 	 * Params:
88 	 *     x = The x position to get identified.
89 	 *     y = The y position to get identified.
90 	 *
91 	 * Return: the renderer at (x, y) or %NULL.
92 	 */
93 	public SourceGutterRenderer getRendererAtPos(int x, int y)
94 	{
95 		auto p = gtk_source_gutter_get_renderer_at_pos(gtkSourceGutter, x, y);
96 		
97 		if(p is null)
98 		{
99 			return null;
100 		}
101 		
102 		return ObjectG.getDObject!(SourceGutterRenderer)(cast(GtkSourceGutterRenderer*) p);
103 	}
104 
105 	/**
106 	 * Get the #GdkWindow of the gutter. The window will only be available when the
107 	 * gutter has at least one, non-zero width, cell renderer packed.
108 	 *
109 	 * Deprecated: Use gtk_text_view_get_window() instead.
110 	 *
111 	 * Return: the #GdkWindow of the gutter, or %NULL
112 	 *     if the gutter has no window.
113 	 *
114 	 * Since: 2.8
115 	 */
116 	public Window getWindow()
117 	{
118 		auto p = gtk_source_gutter_get_window(gtkSourceGutter);
119 		
120 		if(p is null)
121 		{
122 			return null;
123 		}
124 		
125 		return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
126 	}
127 
128 	/**
129 	 * Insert @renderer into the gutter. If @renderer is yet unowned then gutter
130 	 * claims its ownership. Otherwise just increases renderer's reference count.
131 	 * @renderer cannot be already inserted to another gutter.
132 	 *
133 	 * Params:
134 	 *     renderer = a gutter renderer (must inherit from #GtkSourceGutterRenderer).
135 	 *     position = the renderer position.
136 	 *
137 	 * Return: %TRUE if operation succeeded. Otherwise %FALSE.
138 	 *
139 	 * Since: 3.0
140 	 */
141 	public bool insert(SourceGutterRenderer renderer, int position)
142 	{
143 		return gtk_source_gutter_insert(gtkSourceGutter, (renderer is null) ? null : renderer.getSourceGutterRendererStruct(), position) != 0;
144 	}
145 
146 	/**
147 	 * Invalidates the drawable area of the gutter. You can use this to force a
148 	 * redraw of the gutter if something has changed and needs to be redrawn.
149 	 *
150 	 * Since: 2.8
151 	 */
152 	public void queueDraw()
153 	{
154 		gtk_source_gutter_queue_draw(gtkSourceGutter);
155 	}
156 
157 	/**
158 	 * Removes @renderer from @gutter.
159 	 *
160 	 * Params:
161 	 *     renderer = a #GtkSourceGutterRenderer.
162 	 *
163 	 * Since: 2.8
164 	 */
165 	public void remove(SourceGutterRenderer renderer)
166 	{
167 		gtk_source_gutter_remove(gtkSourceGutter, (renderer is null) ? null : renderer.getSourceGutterRendererStruct());
168 	}
169 
170 	/**
171 	 * Reorders @renderer in @gutter to new @position.
172 	 *
173 	 * Params:
174 	 *     renderer = a #GtkCellRenderer.
175 	 *     position = the new renderer position.
176 	 *
177 	 * Since: 2.8
178 	 */
179 	public void reorder(SourceGutterRenderer renderer, int position)
180 	{
181 		gtk_source_gutter_reorder(gtkSourceGutter, (renderer is null) ? null : renderer.getSourceGutterRendererStruct(), position);
182 	}
183 
184 	/**
185 	 *
186 	 *
187 	 * Deprecated: Use gtk_source_gutter_renderer_set_padding() instead.
188 	 */
189 	public void setPadding(int xpad, int ypad)
190 	{
191 		gtk_source_gutter_set_padding(gtkSourceGutter, xpad, ypad);
192 	}
193 }