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 * Description 69 * AtkImage should be implemented by AtkObject subtypes on behalf of 70 * components which display image/pixmap information onscreen, and which 71 * provide information (other than just widget borders, etc.) via that 72 * image content. For instance, icons, buttons with icons, toolbar 73 * elements, and image viewing panes typically should implement AtkImage. 74 * AtkImage primarily provides two types of information: coordinate 75 * information (useful for screen review mode of screenreaders, and for use 76 * by onscreen magnifiers), and descriptive information. The descriptive 77 * information is provided for alternative, text-only presentation of the 78 * most significant information present in the image. 79 */ 80 public class Image 81 { 82 83 /** the main Gtk struct */ 84 protected AtkImage* atkImage; 85 86 87 public AtkImage* getImageStruct() 88 { 89 return atkImage; 90 } 91 92 93 /** the main Gtk struct as a void* */ 94 protected void* getStruct() 95 { 96 return cast(void*)atkImage; 97 } 98 99 /** 100 * Sets our main struct and passes it to the parent class 101 */ 102 public this (AtkImage* atkImage) 103 { 104 this.atkImage = atkImage; 105 } 106 107 /** 108 */ 109 110 /** 111 * Gets the position of the image in the form of a point specifying the 112 * images top-left corner. 113 * Params: 114 * x = address of gint to put x coordinate position; otherwise, -1 if value cannot be obtained. 115 * y = address of gint to put y coordinate position; otherwise, -1 if value cannot be obtained. 116 * coordType = specifies whether the coordinates are relative to the screen 117 * or to the components top level window 118 */ 119 public void getImagePosition(out int x, out int y, AtkCoordType coordType) 120 { 121 // void atk_image_get_image_position (AtkImage *image, gint *x, gint *y, AtkCoordType coord_type); 122 atk_image_get_image_position(atkImage, &x, &y, coordType); 123 } 124 125 /** 126 * Get a textual description of this image. 127 * Returns: a string representing the image description 128 */ 129 public string getImageDescription() 130 { 131 // const gchar * atk_image_get_image_description (AtkImage *image); 132 return Str.toString(atk_image_get_image_description(atkImage)); 133 } 134 135 /** 136 * Sets the textual description for this image. 137 * Params: 138 * description = a string description to set for image 139 * Returns: boolean TRUE, or FALSE if operation could not be completed. 140 */ 141 public int setImageDescription(string description) 142 { 143 // gboolean atk_image_set_image_description (AtkImage *image, const gchar *description); 144 return atk_image_set_image_description(atkImage, Str.toStringz(description)); 145 } 146 147 /** 148 * Get the width and height in pixels for the specified image. 149 * The values of width and height are returned as -1 if the 150 * values cannot be obtained (for instance, if the object is not onscreen). 151 * Params: 152 * width = filled with the image width, or -1 if the value cannot be obtained. 153 * height = filled with the image height, or -1 if the value cannot be obtained. 154 */ 155 public void getImageSize(out int width, out int height) 156 { 157 // void atk_image_get_image_size (AtkImage *image, gint *width, gint *height); 158 atk_image_get_image_size(atkImage, &width, &height); 159 } 160 161 /** 162 * Since ATK 1.12 163 * 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. 164 */ 165 public string getImageLocale() 166 { 167 // const gchar * atk_image_get_image_locale (AtkImage *image); 168 return Str.toString(atk_image_get_image_locale(atkImage)); 169 } 170 }