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 atk.ImageT; 26 27 public import atk.c.functions; 28 public import atk.c.types; 29 public import glib.Str; 30 public import gtkc.atktypes; 31 32 33 /** 34 * #AtkImage should be implemented by #AtkObject subtypes on behalf of 35 * components which display image/pixmap information onscreen, and 36 * which provide information (other than just widget borders, etc.) 37 * via that image content. For instance, icons, buttons with icons, 38 * toolbar elements, and image viewing panes typically should 39 * implement #AtkImage. 40 * 41 * #AtkImage primarily provides two types of information: coordinate 42 * information (useful for screen review mode of screenreaders, and 43 * for use by onscreen magnifiers), and descriptive information. The 44 * descriptive information is provided for alternative, text-only 45 * presentation of the most significant information present in the 46 * image. 47 */ 48 public template ImageT(TStruct) 49 { 50 /** Get the main Gtk struct */ 51 public AtkImage* getImageStruct(bool transferOwnership = false) 52 { 53 if (transferOwnership) 54 ownedRef = false; 55 return cast(AtkImage*)getStruct(); 56 } 57 58 59 /** 60 * Get a textual description of this image. 61 * 62 * Returns: a string representing the image description 63 */ 64 public string getImageDescription() 65 { 66 return Str.toString(atk_image_get_image_description(getImageStruct())); 67 } 68 69 /** 70 * Retrieves the locale identifier associated to the #AtkImage. 71 * 72 * Returns: a string corresponding to the POSIX 73 * `LC_MESSAGES` locale used by the image description, or 74 * %NULL if the image does not specify a locale. 75 * 76 * Since: 1.12 77 */ 78 public string getImageLocale() 79 { 80 return Str.toString(atk_image_get_image_locale(getImageStruct())); 81 } 82 83 /** 84 * Gets the position of the image in the form of a point specifying the 85 * images top-left corner. 86 * 87 * Params: 88 * x = address of #gint to put x coordinate position; otherwise, -1 if value cannot be obtained. 89 * y = address of #gint to put y coordinate position; otherwise, -1 if value cannot be obtained. 90 * coordType = specifies whether the coordinates are relative to the screen 91 * or to the components top level window 92 */ 93 public void getImagePosition(out int x, out int y, AtkCoordType coordType) 94 { 95 atk_image_get_image_position(getImageStruct(), &x, &y, coordType); 96 } 97 98 /** 99 * Get the width and height in pixels for the specified image. 100 * The values of @width and @height are returned as -1 if the 101 * values cannot be obtained (for instance, if the object is not onscreen). 102 * 103 * Params: 104 * width = filled with the image width, or -1 if the value cannot be obtained. 105 * height = filled with the image height, or -1 if the value cannot be obtained. 106 */ 107 public void getImageSize(out int width, out int height) 108 { 109 atk_image_get_image_size(getImageStruct(), &width, &height); 110 } 111 112 /** 113 * Sets the textual description for this image. 114 * 115 * Params: 116 * description = a string description to set for @image 117 * 118 * Returns: boolean TRUE, or FALSE if operation could 119 * not be completed. 120 */ 121 public bool setImageDescription(string description) 122 { 123 return atk_image_set_image_description(getImageStruct(), Str.toStringz(description)) != 0; 124 } 125 }