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 gtk.IconInfo; 26 27 private import cairo.Surface; 28 private import gdk.RGBA; 29 private import gdk.Window; 30 private import gdkpixbuf.Pixbuf; 31 private import gio.AsyncResultIF; 32 private import gio.Cancellable; 33 private import glib.ConstructionException; 34 private import glib.ErrorG; 35 private import glib.GException; 36 private import glib.Str; 37 private import gobject.ObjectG; 38 private import gtk.IconTheme; 39 private import gtk.Style; 40 private import gtk.StyleContext; 41 private import gtkc.Loader; 42 private import gtkc.gtk; 43 public import gtkc.gtktypes; 44 private import gtkc.paths; 45 46 47 /** 48 * Contains information found when looking up an icon in 49 * an icon theme. 50 */ 51 public class IconInfo : ObjectG 52 { 53 /** the main Gtk struct */ 54 protected GtkIconInfo* gtkIconInfo; 55 56 /** Get the main Gtk struct */ 57 public GtkIconInfo* getIconInfoStruct() 58 { 59 return gtkIconInfo; 60 } 61 62 /** the main Gtk struct as a void* */ 63 protected override void* getStruct() 64 { 65 return cast(void*)gtkIconInfo; 66 } 67 68 protected override void setStruct(GObject* obj) 69 { 70 gtkIconInfo = cast(GtkIconInfo*)obj; 71 super.setStruct(obj); 72 } 73 74 /** 75 * Sets our main struct and passes it to the parent class. 76 */ 77 public this (GtkIconInfo* gtkIconInfo, bool ownedRef = false) 78 { 79 this.gtkIconInfo = gtkIconInfo; 80 super(cast(GObject*)gtkIconInfo, ownedRef); 81 } 82 83 ~this () 84 { 85 if ( Linker.isLoaded(LIBRARY.GTK) && gtkIconInfo !is null ) 86 { 87 gtk_icon_info_free(gtkIconInfo); 88 } 89 } 90 91 /** 92 */ 93 94 public static GType getType() 95 { 96 return gtk_icon_info_get_type(); 97 } 98 99 /** 100 * Creates a #GtkIconInfo for a #GdkPixbuf. 101 * 102 * Params: 103 * iconTheme = a #GtkIconTheme 104 * pixbuf = the pixbuf to wrap in a #GtkIconInfo 105 * 106 * Return: a #GtkIconInfo 107 * 108 * Since: 2.14 109 * 110 * Throws: ConstructionException GTK+ fails to create the object. 111 */ 112 public this(IconTheme iconTheme, Pixbuf pixbuf) 113 { 114 auto p = gtk_icon_info_new_for_pixbuf((iconTheme is null) ? null : iconTheme.getIconThemeStruct(), (pixbuf is null) ? null : pixbuf.getPixbufStruct()); 115 116 if(p is null) 117 { 118 throw new ConstructionException("null returned by new_for_pixbuf"); 119 } 120 121 this(cast(GtkIconInfo*) p, true); 122 } 123 124 /** 125 * Make a copy of a #GtkIconInfo. 126 * 127 * Deprecated: Use g_object_ref() 128 * 129 * Return: the new GtkIconInfo 130 * 131 * Since: 2.4 132 */ 133 public IconInfo copy() 134 { 135 auto p = gtk_icon_info_copy(gtkIconInfo); 136 137 if(p is null) 138 { 139 return null; 140 } 141 142 return ObjectG.getDObject!(IconInfo)(cast(GtkIconInfo*) p, true); 143 } 144 145 /** 146 * Free a #GtkIconInfo and associated information 147 * 148 * Deprecated: Use g_object_unref() 149 * 150 * Since: 2.4 151 */ 152 public void free() 153 { 154 gtk_icon_info_free(gtkIconInfo); 155 } 156 157 /** 158 * This function is deprecated and always returns %FALSE. 159 * 160 * Deprecated: Attachment points are deprecated 161 * 162 * Params: 163 * points = location to store pointer 164 * to an array of points, or %NULL free the array of points with g_free(). 165 * nPoints = location to store the number of points in @points, 166 * or %NULL 167 * 168 * Return: %FALSE 169 * 170 * Since: 2.4 171 */ 172 public bool getAttachPoints(out GdkPoint[] points) 173 { 174 GdkPoint* outpoints = null; 175 int nPoints; 176 177 auto p = gtk_icon_info_get_attach_points(gtkIconInfo, &outpoints, &nPoints) != 0; 178 179 points = outpoints[0 .. nPoints]; 180 181 return p; 182 } 183 184 /** 185 * Gets the base scale for the icon. The base scale is a scale 186 * for the icon that was specified by the icon theme creator. 187 * For instance an icon drawn for a high-dpi screen with window 188 * scale 2 for a base size of 32 will be 64 pixels tall and have 189 * a base scale of 2. 190 * 191 * Return: the base scale 192 * 193 * Since: 3.10 194 */ 195 public int getBaseScale() 196 { 197 return gtk_icon_info_get_base_scale(gtkIconInfo); 198 } 199 200 /** 201 * Gets the base size for the icon. The base size 202 * is a size for the icon that was specified by 203 * the icon theme creator. This may be different 204 * than the actual size of image; an example of 205 * this is small emblem icons that can be attached 206 * to a larger icon. These icons will be given 207 * the same base size as the larger icons to which 208 * they are attached. 209 * 210 * Note that for scaled icons the base size does 211 * not include the base scale. 212 * 213 * Return: the base size, or 0, if no base 214 * size is known for the icon. 215 * 216 * Since: 2.4 217 */ 218 public int getBaseSize() 219 { 220 return gtk_icon_info_get_base_size(gtkIconInfo); 221 } 222 223 /** 224 * Gets the built-in image for this icon, if any. To allow GTK+ to use 225 * built in icon images, you must pass the %GTK_ICON_LOOKUP_USE_BUILTIN 226 * to gtk_icon_theme_lookup_icon(). 227 * 228 * Deprecated: This function is deprecated, use 229 * gtk_icon_theme_add_resource_path() instead of builtin icons. 230 * 231 * Return: the built-in image pixbuf, or %NULL. 232 * No extra reference is added to the returned pixbuf, so if 233 * you want to keep it around, you must use g_object_ref(). 234 * The returned image must not be modified. 235 * 236 * Since: 2.4 237 */ 238 public Pixbuf getBuiltinPixbuf() 239 { 240 auto p = gtk_icon_info_get_builtin_pixbuf(gtkIconInfo); 241 242 if(p is null) 243 { 244 return null; 245 } 246 247 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p); 248 } 249 250 /** 251 * This function is deprecated and always returns %NULL. 252 * 253 * Deprecated: Display names are deprecated 254 * 255 * Return: %NULL 256 * 257 * Since: 2.4 258 */ 259 public string getDisplayName() 260 { 261 return Str.toString(gtk_icon_info_get_display_name(gtkIconInfo)); 262 } 263 264 /** 265 * This function is deprecated and always returns %FALSE. 266 * 267 * Deprecated: Embedded rectangles are deprecated 268 * 269 * Params: 270 * rectangle = #GdkRectangle in which to store embedded 271 * rectangle coordinates; coordinates are only stored 272 * when this function returns %TRUE. 273 * 274 * Return: %FALSE 275 * 276 * Since: 2.4 277 */ 278 public bool getEmbeddedRect(out GdkRectangle rectangle) 279 { 280 return gtk_icon_info_get_embedded_rect(gtkIconInfo, &rectangle) != 0; 281 } 282 283 /** 284 * Gets the filename for the icon. If the %GTK_ICON_LOOKUP_USE_BUILTIN 285 * flag was passed to gtk_icon_theme_lookup_icon(), there may be no 286 * filename if a builtin icon is returned; in this case, you should 287 * use gtk_icon_info_get_builtin_pixbuf(). 288 * 289 * Return: the filename for the icon, or %NULL 290 * if gtk_icon_info_get_builtin_pixbuf() should be used instead. 291 * The return value is owned by GTK+ and should not be modified 292 * or freed. 293 * 294 * Since: 2.4 295 */ 296 public string getFilename() 297 { 298 return Str.toString(gtk_icon_info_get_filename(gtkIconInfo)); 299 } 300 301 /** 302 * Checks if the icon is symbolic or not. This currently uses only 303 * the file name and not the file contents for determining this. 304 * This behaviour may change in the future. 305 * 306 * Return: %TRUE if the icon is symbolic, %FALSE otherwise 307 * 308 * Since: 3.12 309 */ 310 public bool isSymbolic() 311 { 312 return gtk_icon_info_is_symbolic(gtkIconInfo) != 0; 313 } 314 315 /** 316 * Renders an icon previously looked up in an icon theme using 317 * gtk_icon_theme_lookup_icon(); the size will be based on the size 318 * passed to gtk_icon_theme_lookup_icon(). Note that the resulting 319 * pixbuf may not be exactly this size; an icon theme may have icons 320 * that differ slightly from their nominal sizes, and in addition GTK+ 321 * will avoid scaling icons that it considers sufficiently close to the 322 * requested size or for which the source image would have to be scaled 323 * up too far. (This maintains sharpness.). This behaviour can be changed 324 * by passing the %GTK_ICON_LOOKUP_FORCE_SIZE flag when obtaining 325 * the #GtkIconInfo. If this flag has been specified, the pixbuf 326 * returned by this function will be scaled to the exact size. 327 * 328 * Return: the rendered icon; this may be a newly 329 * created icon or a new reference to an internal icon, so you must 330 * not modify the icon. Use g_object_unref() to release your reference 331 * to the icon. 332 * 333 * Since: 2.4 334 * 335 * Throws: GException on failure. 336 */ 337 public Pixbuf loadIcon() 338 { 339 GError* err = null; 340 341 auto p = gtk_icon_info_load_icon(gtkIconInfo, &err); 342 343 if (err !is null) 344 { 345 throw new GException( new ErrorG(err) ); 346 } 347 348 if(p is null) 349 { 350 return null; 351 } 352 353 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true); 354 } 355 356 /** 357 * Asynchronously load, render and scale an icon previously looked up 358 * from the icon theme using gtk_icon_theme_lookup_icon(). 359 * 360 * For more details, see gtk_icon_info_load_icon() which is the synchronous 361 * version of this call. 362 * 363 * Params: 364 * cancellable = optional #GCancellable object, %NULL to ignore 365 * callback = a #GAsyncReadyCallback to call when the 366 * request is satisfied 367 * userData = the data to pass to callback function 368 * 369 * Since: 3.8 370 */ 371 public void loadIconAsync(Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 372 { 373 gtk_icon_info_load_icon_async(gtkIconInfo, (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 374 } 375 376 /** 377 * Finishes an async icon load, see gtk_icon_info_load_icon_async(). 378 * 379 * Params: 380 * res = a #GAsyncResult 381 * 382 * Return: the rendered icon; this may be a newly 383 * created icon or a new reference to an internal icon, so you must 384 * not modify the icon. Use g_object_unref() to release your reference 385 * to the icon. 386 * 387 * Since: 3.8 388 * 389 * Throws: GException on failure. 390 */ 391 public Pixbuf loadIconFinish(AsyncResultIF res) 392 { 393 GError* err = null; 394 395 auto p = gtk_icon_info_load_icon_finish(gtkIconInfo, (res is null) ? null : res.getAsyncResultStruct(), &err); 396 397 if (err !is null) 398 { 399 throw new GException( new ErrorG(err) ); 400 } 401 402 if(p is null) 403 { 404 return null; 405 } 406 407 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true); 408 } 409 410 /** 411 * Renders an icon previously looked up in an icon theme using 412 * gtk_icon_theme_lookup_icon(); the size will be based on the size 413 * passed to gtk_icon_theme_lookup_icon(). Note that the resulting 414 * surface may not be exactly this size; an icon theme may have icons 415 * that differ slightly from their nominal sizes, and in addition GTK+ 416 * will avoid scaling icons that it considers sufficiently close to the 417 * requested size or for which the source image would have to be scaled 418 * up too far. (This maintains sharpness.). This behaviour can be changed 419 * by passing the %GTK_ICON_LOOKUP_FORCE_SIZE flag when obtaining 420 * the #GtkIconInfo. If this flag has been specified, the pixbuf 421 * returned by this function will be scaled to the exact size. 422 * 423 * Params: 424 * forWindow = #GdkWindow to optimize drawing for, or %NULL 425 * 426 * Return: the rendered icon; this may be a newly 427 * created icon or a new reference to an internal icon, so you must 428 * not modify the icon. Use cairo_surface_destroy() to release your 429 * reference to the icon. 430 * 431 * Since: 3.10 432 * 433 * Throws: GException on failure. 434 */ 435 public Surface loadSurface(Window forWindow) 436 { 437 GError* err = null; 438 439 auto p = gtk_icon_info_load_surface(gtkIconInfo, (forWindow is null) ? null : forWindow.getWindowStruct(), &err); 440 441 if (err !is null) 442 { 443 throw new GException( new ErrorG(err) ); 444 } 445 446 if(p is null) 447 { 448 return null; 449 } 450 451 return new Surface(cast(cairo_surface_t*) p); 452 } 453 454 /** 455 * Loads an icon, modifying it to match the system colours for the foreground, 456 * success, warning and error colors provided. If the icon is not a symbolic 457 * one, the function will return the result from gtk_icon_info_load_icon(). 458 * 459 * This allows loading symbolic icons that will match the system theme. 460 * 461 * Unless you are implementing a widget, you will want to use 462 * g_themed_icon_new_with_default_fallbacks() to load the icon. 463 * 464 * As implementation details, the icon loaded needs to be of SVG type, 465 * contain the “symbolic” term as the last component of the icon name, 466 * and use the “fg”, “success”, “warning” and “error” CSS styles in the 467 * SVG file itself. 468 * 469 * See the [Symbolic Icons Specification](http://www.freedesktop.org/wiki/SymbolicIcons) 470 * for more information about symbolic icons. 471 * 472 * Params: 473 * fg = a #GdkRGBA representing the foreground color of the icon 474 * successColor = a #GdkRGBA representing the warning color 475 * of the icon or %NULL to use the default color 476 * warningColor = a #GdkRGBA representing the warning color 477 * of the icon or %NULL to use the default color 478 * errorColor = a #GdkRGBA representing the error color 479 * of the icon or %NULL to use the default color (allow-none) 480 * wasSymbolic = a #gboolean, returns whether the 481 * loaded icon was a symbolic one and whether the @fg color was 482 * applied to it. 483 * 484 * Return: a #GdkPixbuf representing the loaded icon 485 * 486 * Since: 3.0 487 * 488 * Throws: GException on failure. 489 */ 490 public Pixbuf loadSymbolic(RGBA fg, RGBA successColor, RGBA warningColor, RGBA errorColor, out bool wasSymbolic) 491 { 492 int outwasSymbolic; 493 GError* err = null; 494 495 auto p = gtk_icon_info_load_symbolic(gtkIconInfo, (fg is null) ? null : fg.getRGBAStruct(), (successColor is null) ? null : successColor.getRGBAStruct(), (warningColor is null) ? null : warningColor.getRGBAStruct(), (errorColor is null) ? null : errorColor.getRGBAStruct(), &outwasSymbolic, &err); 496 497 if (err !is null) 498 { 499 throw new GException( new ErrorG(err) ); 500 } 501 502 wasSymbolic = (outwasSymbolic == 1); 503 504 if(p is null) 505 { 506 return null; 507 } 508 509 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true); 510 } 511 512 /** 513 * Asynchronously load, render and scale a symbolic icon previously looked up 514 * from the icon theme using gtk_icon_theme_lookup_icon(). 515 * 516 * For more details, see gtk_icon_info_load_symbolic() which is the synchronous 517 * version of this call. 518 * 519 * Params: 520 * fg = a #GdkRGBA representing the foreground color of the icon 521 * successColor = a #GdkRGBA representing the warning color 522 * of the icon or %NULL to use the default color 523 * warningColor = a #GdkRGBA representing the warning color 524 * of the icon or %NULL to use the default color 525 * errorColor = a #GdkRGBA representing the error color 526 * of the icon or %NULL to use the default color (allow-none) 527 * cancellable = optional #GCancellable object, 528 * %NULL to ignore 529 * callback = a #GAsyncReadyCallback to call when the 530 * request is satisfied 531 * userData = the data to pass to callback function 532 * 533 * Since: 3.8 534 */ 535 public void loadSymbolicAsync(RGBA fg, RGBA successColor, RGBA warningColor, RGBA errorColor, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 536 { 537 gtk_icon_info_load_symbolic_async(gtkIconInfo, (fg is null) ? null : fg.getRGBAStruct(), (successColor is null) ? null : successColor.getRGBAStruct(), (warningColor is null) ? null : warningColor.getRGBAStruct(), (errorColor is null) ? null : errorColor.getRGBAStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 538 } 539 540 /** 541 * Finishes an async icon load, see gtk_icon_info_load_symbolic_async(). 542 * 543 * Params: 544 * res = a #GAsyncResult 545 * wasSymbolic = a #gboolean, returns whether the 546 * loaded icon was a symbolic one and whether the @fg color was 547 * applied to it. 548 * 549 * Return: the rendered icon; this may be a newly 550 * created icon or a new reference to an internal icon, so you must 551 * not modify the icon. Use g_object_unref() to release your reference 552 * to the icon. 553 * 554 * Since: 3.8 555 * 556 * Throws: GException on failure. 557 */ 558 public Pixbuf loadSymbolicFinish(AsyncResultIF res, out bool wasSymbolic) 559 { 560 int outwasSymbolic; 561 GError* err = null; 562 563 auto p = gtk_icon_info_load_symbolic_finish(gtkIconInfo, (res is null) ? null : res.getAsyncResultStruct(), &outwasSymbolic, &err); 564 565 if (err !is null) 566 { 567 throw new GException( new ErrorG(err) ); 568 } 569 570 wasSymbolic = (outwasSymbolic == 1); 571 572 if(p is null) 573 { 574 return null; 575 } 576 577 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true); 578 } 579 580 /** 581 * Loads an icon, modifying it to match the system colors for the foreground, 582 * success, warning and error colors provided. If the icon is not a symbolic 583 * one, the function will return the result from gtk_icon_info_load_icon(). 584 * This function uses the regular foreground color and the symbolic colors 585 * with the names “success_color”, “warning_color” and “error_color” from 586 * the context. 587 * 588 * This allows loading symbolic icons that will match the system theme. 589 * 590 * See gtk_icon_info_load_symbolic() for more details. 591 * 592 * Params: 593 * context = a #GtkStyleContext 594 * wasSymbolic = a #gboolean, returns whether the 595 * loaded icon was a symbolic one and whether the @fg color was 596 * applied to it. 597 * 598 * Return: a #GdkPixbuf representing the loaded icon 599 * 600 * Since: 3.0 601 * 602 * Throws: GException on failure. 603 */ 604 public Pixbuf loadSymbolicForContext(StyleContext context, out bool wasSymbolic) 605 { 606 int outwasSymbolic; 607 GError* err = null; 608 609 auto p = gtk_icon_info_load_symbolic_for_context(gtkIconInfo, (context is null) ? null : context.getStyleContextStruct(), &outwasSymbolic, &err); 610 611 if (err !is null) 612 { 613 throw new GException( new ErrorG(err) ); 614 } 615 616 wasSymbolic = (outwasSymbolic == 1); 617 618 if(p is null) 619 { 620 return null; 621 } 622 623 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true); 624 } 625 626 /** 627 * Asynchronously load, render and scale a symbolic icon previously 628 * looked up from the icon theme using gtk_icon_theme_lookup_icon(). 629 * 630 * For more details, see gtk_icon_info_load_symbolic_for_context() 631 * which is the synchronous version of this call. 632 * 633 * Params: 634 * context = a #GtkStyleContext 635 * cancellable = optional #GCancellable object, 636 * %NULL to ignore 637 * callback = a #GAsyncReadyCallback to call when the 638 * request is satisfied 639 * userData = the data to pass to callback function 640 * 641 * Since: 3.8 642 */ 643 public void loadSymbolicForContextAsync(StyleContext context, Cancellable cancellable, GAsyncReadyCallback callback, void* userData) 644 { 645 gtk_icon_info_load_symbolic_for_context_async(gtkIconInfo, (context is null) ? null : context.getStyleContextStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData); 646 } 647 648 /** 649 * Finishes an async icon load, see gtk_icon_info_load_symbolic_for_context_async(). 650 * 651 * Params: 652 * res = a #GAsyncResult 653 * wasSymbolic = a #gboolean, returns whether the 654 * loaded icon was a symbolic one and whether the @fg color was 655 * applied to it. 656 * 657 * Return: the rendered icon; this may be a newly 658 * created icon or a new reference to an internal icon, so you must 659 * not modify the icon. Use g_object_unref() to release your reference 660 * to the icon. 661 * 662 * Since: 3.8 663 * 664 * Throws: GException on failure. 665 */ 666 public Pixbuf loadSymbolicForContextFinish(AsyncResultIF res, out bool wasSymbolic) 667 { 668 int outwasSymbolic; 669 GError* err = null; 670 671 auto p = gtk_icon_info_load_symbolic_for_context_finish(gtkIconInfo, (res is null) ? null : res.getAsyncResultStruct(), &outwasSymbolic, &err); 672 673 if (err !is null) 674 { 675 throw new GException( new ErrorG(err) ); 676 } 677 678 wasSymbolic = (outwasSymbolic == 1); 679 680 if(p is null) 681 { 682 return null; 683 } 684 685 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true); 686 } 687 688 /** 689 * Loads an icon, modifying it to match the system colours for the foreground, 690 * success, warning and error colors provided. If the icon is not a symbolic 691 * one, the function will return the result from gtk_icon_info_load_icon(). 692 * 693 * This allows loading symbolic icons that will match the system theme. 694 * 695 * See gtk_icon_info_load_symbolic() for more details. 696 * 697 * Deprecated: Use gtk_icon_info_load_symbolic_for_context() instead 698 * 699 * Params: 700 * style = a #GtkStyle to take the colors from 701 * state = the widget state to use for colors 702 * wasSymbolic = a #gboolean, returns whether the 703 * loaded icon was a symbolic one and whether the @fg color was 704 * applied to it. 705 * 706 * Return: a #GdkPixbuf representing the loaded icon 707 * 708 * Since: 3.0 709 * 710 * Throws: GException on failure. 711 */ 712 public Pixbuf loadSymbolicForStyle(Style style, GtkStateType state, out bool wasSymbolic) 713 { 714 int outwasSymbolic; 715 GError* err = null; 716 717 auto p = gtk_icon_info_load_symbolic_for_style(gtkIconInfo, (style is null) ? null : style.getStyleStruct(), state, &outwasSymbolic, &err); 718 719 if (err !is null) 720 { 721 throw new GException( new ErrorG(err) ); 722 } 723 724 wasSymbolic = (outwasSymbolic == 1); 725 726 if(p is null) 727 { 728 return null; 729 } 730 731 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true); 732 } 733 734 /** 735 * Sets whether the coordinates returned by gtk_icon_info_get_embedded_rect() 736 * and gtk_icon_info_get_attach_points() should be returned in their 737 * original form as specified in the icon theme, instead of scaled 738 * appropriately for the pixbuf returned by gtk_icon_info_load_icon(). 739 * 740 * Raw coordinates are somewhat strange; they are specified to be with 741 * respect to the unscaled pixmap for PNG and XPM icons, but for SVG 742 * icons, they are in a 1000x1000 coordinate space that is scaled 743 * to the final size of the icon. You can determine if the icon is an SVG 744 * icon by using gtk_icon_info_get_filename(), and seeing if it is non-%NULL 745 * and ends in “.svg”. 746 * 747 * This function is provided primarily to allow compatibility wrappers 748 * for older API's, and is not expected to be useful for applications. 749 * 750 * Deprecated: Embedded rectangles and attachment points are deprecated 751 * 752 * Params: 753 * rawCoordinates = whether the coordinates of embedded rectangles 754 * and attached points should be returned in their original 755 * (unscaled) form. 756 * 757 * Since: 2.4 758 */ 759 public void setRawCoordinates(bool rawCoordinates) 760 { 761 gtk_icon_info_set_raw_coordinates(gtkIconInfo, rawCoordinates); 762 } 763 }