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