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 = AtkImage.html 27 * outPack = atk 28 * outFile = Image 29 * strct = AtkImage 30 * realStrct= 31 * ctorStrct= 32 * clss = Image 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - atk_image_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * structWrap: 48 * module aliases: 49 * local aliases: 50 * overrides: 51 */ 52 53 module atk.Image; 54 55 public import gtkc.atktypes; 56 57 private import gtkc.atk; 58 private import glib.ConstructionException; 59 private import gobject.ObjectG; 60 61 62 private import glib.Str; 63 64 65 66 67 /** 68 * AtkImage should be implemented by AtkObject subtypes on behalf of 69 * components which display image/pixmap information onscreen, and 70 * which provide information (other than just widget borders, etc.) 71 * via that image content. For instance, icons, buttons with icons, 72 * toolbar elements, and image viewing panes typically should 73 * implement AtkImage. 74 * 75 * AtkImage primarily provides two types of information: coordinate 76 * information (useful for screen review mode of screenreaders, and 77 * for use by onscreen magnifiers), and descriptive information. The 78 * descriptive information is provided for alternative, text-only 79 * presentation of the most significant information present in the 80 * image. 81 */ 82 public class Image 83 { 84 85 /** the main Gtk struct */ 86 protected AtkImage* atkImage; 87 88 89 public AtkImage* getImageStruct() 90 { 91 return atkImage; 92 } 93 94 95 /** the main Gtk struct as a void* */ 96 protected void* getStruct() 97 { 98 return cast(void*)atkImage; 99 } 100 101 /** 102 * Sets our main struct and passes it to the parent class 103 */ 104 public this (AtkImage* atkImage) 105 { 106 this.atkImage = atkImage; 107 } 108 109 /** 110 */ 111 112 /** 113 * Gets the position of the image in the form of a point specifying the 114 * images top-left corner. 115 * Params: 116 * x = address of gint to put x coordinate position; otherwise, -1 if value cannot be obtained. 117 * y = address of gint to put y coordinate position; otherwise, -1 if value cannot be obtained. 118 * coordType = specifies whether the coordinates are relative to the screen 119 * or to the components top level window 120 */ 121 public void getImagePosition(out int x, out int y, AtkCoordType coordType) 122 { 123 // void atk_image_get_image_position (AtkImage *image, gint *x, gint *y, AtkCoordType coord_type); 124 atk_image_get_image_position(atkImage, &x, &y, coordType); 125 } 126 127 /** 128 * Get a textual description of this image. 129 * Returns: a string representing the image description 130 */ 131 public string getImageDescription() 132 { 133 // const gchar * atk_image_get_image_description (AtkImage *image); 134 return Str.toString(atk_image_get_image_description(atkImage)); 135 } 136 137 /** 138 * Sets the textual description for this image. 139 * Params: 140 * description = a string description to set for image 141 * Returns: boolean TRUE, or FALSE if operation could not be completed. 142 */ 143 public int setImageDescription(string description) 144 { 145 // gboolean atk_image_set_image_description (AtkImage *image, const gchar *description); 146 return atk_image_set_image_description(atkImage, Str.toStringz(description)); 147 } 148 149 /** 150 * Get the width and height in pixels for the specified image. 151 * The values of width and height are returned as -1 if the 152 * values cannot be obtained (for instance, if the object is not onscreen). 153 * Params: 154 * width = filled with the image width, or -1 if the value cannot be obtained. 155 * height = filled with the image height, or -1 if the value cannot be obtained. 156 */ 157 public void getImageSize(out int width, out int height) 158 { 159 // void atk_image_get_image_size (AtkImage *image, gint *width, gint *height); 160 atk_image_get_image_size(atkImage, &width, &height); 161 } 162 163 /** 164 * Since ATK 1.12 165 * Returns: a string corresponding to the POSIX LC_MESSAGES locale used by the image description, or NULL if the image does not specify a locale. 166 */ 167 public string getImageLocale() 168 { 169 // const gchar * atk_image_get_image_locale (AtkImage *image); 170 return Str.toString(atk_image_get_image_locale(atkImage)); 171 } 172 }