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 = GtkRuler.html 27 * outPack = gtk 28 * outFile = Ruler 29 * strct = GtkRuler 30 * realStrct= 31 * ctorStrct= 32 * clss = Ruler 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - OrientableIF 40 * prefixes: 41 * - gtk_ruler_ 42 * - gtk_ 43 * omit structs: 44 * omit prefixes: 45 * omit code: 46 * omit signals: 47 * imports: 48 * - gtk.OrientableIF 49 * - gtk.OrientableT 50 * structWrap: 51 * module aliases: 52 * local aliases: 53 * overrides: 54 */ 55 56 module gtk.Ruler; 57 58 public import gtkc.gtktypes; 59 60 private import gtkc.gtk; 61 private import glib.ConstructionException; 62 private import gobject.ObjectG; 63 64 65 private import gtk.OrientableIF; 66 private import gtk.OrientableT; 67 68 69 70 private import gtk.Widget; 71 72 /** 73 * Description 74 * Note 75 * This widget is considered too specialized/little-used for 76 * GTK+, and will be removed in GTK 3. If your application needs this widget, 77 * feel free to use it, as the widget is useful in some applications; it's just 78 * not of general interest. However, we are not accepting new features for the 79 * widget, and it will move out of the GTK+ distribution. 80 * The GTKRuler widget is a base class for horizontal and vertical rulers. Rulers 81 * are used to show the mouse pointer's location in a window. The ruler can either 82 * be horizontal or vertical on the window. Within the ruler a small triangle 83 * indicates the location of the mouse relative to the horizontal or vertical 84 * ruler. See GtkHRuler to learn how to create a new horizontal ruler. See 85 * GtkVRuler to learn how to create a new vertical ruler. 86 */ 87 public class Ruler : Widget, OrientableIF 88 { 89 90 /** the main Gtk struct */ 91 protected GtkRuler* gtkRuler; 92 93 94 public GtkRuler* getRulerStruct() 95 { 96 return gtkRuler; 97 } 98 99 100 /** the main Gtk struct as a void* */ 101 protected override void* getStruct() 102 { 103 return cast(void*)gtkRuler; 104 } 105 106 /** 107 * Sets our main struct and passes it to the parent class 108 */ 109 public this (GtkRuler* gtkRuler) 110 { 111 super(cast(GtkWidget*)gtkRuler); 112 this.gtkRuler = gtkRuler; 113 } 114 115 protected override void setStruct(GObject* obj) 116 { 117 super.setStruct(obj); 118 gtkRuler = cast(GtkRuler*)obj; 119 } 120 121 // add the Orientable capabilities 122 mixin OrientableT!(GtkRuler); 123 124 /** 125 */ 126 127 /** 128 * Warning 129 * gtk_ruler_set_metric has been deprecated since version 2.24 and should not be used in newly-written code. GtkRuler has been removed from GTK 3 for being 130 * unmaintained and too specialized. There is no replacement. 131 * This calls the GTKMetricType to set the ruler to units defined. Available units 132 * are GTK_PIXELS, GTK_INCHES, or GTK_CENTIMETERS. The default unit of measurement 133 * is GTK_PIXELS. 134 * Params: 135 * metric = the unit of measurement 136 */ 137 public void setMetric(GtkMetricType metric) 138 { 139 // void gtk_ruler_set_metric (GtkRuler *ruler, GtkMetricType metric); 140 gtk_ruler_set_metric(gtkRuler, metric); 141 } 142 143 /** 144 * Warning 145 * gtk_ruler_set_range is deprecated and should not be used in newly-written code. 146 * This sets the range of the ruler. 147 * Deprecated: 2.24: GtkRuler has been removed from GTK 3 for being 148 * unmaintained and too specialized. There is no replacement. 149 * Params: 150 * lower = the lower limit of the ruler 151 * upper = the upper limit of the ruler 152 * position = the mark on the ruler 153 * maxSize = the maximum size of the ruler used when calculating the space to 154 * leave for the text 155 */ 156 public void setRange(double lower, double upper, double position, double maxSize) 157 { 158 // void gtk_ruler_set_range (GtkRuler *ruler, gdouble lower, gdouble upper, gdouble position, gdouble max_size); 159 gtk_ruler_set_range(gtkRuler, lower, upper, position, maxSize); 160 } 161 162 /** 163 * Warning 164 * gtk_ruler_get_metric is deprecated and should not be used in newly-written code. 165 * Gets the units used for a GtkRuler. See gtk_ruler_set_metric(). 166 * Returns: the units currently used for ruler Deprecated: 2.24: GtkRuler has been removed from GTK 3 for being unmaintained and too specialized. There is no replacement. 167 */ 168 public GtkMetricType getMetric() 169 { 170 // GtkMetricType gtk_ruler_get_metric (GtkRuler *ruler); 171 return gtk_ruler_get_metric(gtkRuler); 172 } 173 174 /** 175 * Warning 176 * gtk_ruler_get_range is deprecated and should not be used in newly-written code. 177 * Retrieves values indicating the range and current position of a GtkRuler. 178 * See gtk_ruler_set_range(). 179 * Deprecated: 2.24: GtkRuler has been removed from GTK 3 for being 180 * unmaintained and too specialized. There is no replacement. 181 * Params: 182 * lower = location to store lower limit of the ruler, or NULL. [allow-none] 183 * upper = location to store upper limit of the ruler, or NULL. [allow-none] 184 * position = location to store the current position of the mark on the ruler, or NULL. [allow-none] 185 * maxSize = location to store the maximum size of the ruler used when calculating 186 * the space to leave for the text, or NULL. 187 */ 188 public void getRange(out double lower, out double upper, out double position, out double maxSize) 189 { 190 // void gtk_ruler_get_range (GtkRuler *ruler, gdouble *lower, gdouble *upper, gdouble *position, gdouble *max_size); 191 gtk_ruler_get_range(gtkRuler, &lower, &upper, &position, &maxSize); 192 } 193 }