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.NativeIF; 26 27 private import gdk.Surface; 28 private import gobject.ObjectG; 29 private import gsk.Renderer; 30 private import gtk.NativeIF; 31 private import gtk.c.functions; 32 public import gtk.c.types; 33 34 35 /** 36 * `GtkNative` is the interface implemented by all widgets that have 37 * their own `GdkSurface`. 38 * 39 * The obvious example of a `GtkNative` is `GtkWindow`. 40 * 41 * Every widget that is not itself a `GtkNative` is contained in one, 42 * and you can get it with [method@Gtk.Widget.get_native]. 43 * 44 * To get the surface of a `GtkNative`, use [method@Gtk.Native.get_surface]. 45 * It is also possible to find the `GtkNative` to which a surface 46 * belongs, with [func@Gtk.Native.get_for_surface]. 47 * 48 * In addition to a [class@Gdk.Surface], a `GtkNative` also provides 49 * a [class@Gsk.Renderer] for rendering on that surface. To get the 50 * renderer, use [method@Gtk.Native.get_renderer]. 51 */ 52 public interface NativeIF{ 53 /** Get the main Gtk struct */ 54 public GtkNative* getNativeStruct(bool transferOwnership = false); 55 56 /** the main Gtk struct as a void* */ 57 protected void* getStruct(); 58 59 60 /** */ 61 public static GType getType() 62 { 63 return gtk_native_get_type(); 64 } 65 66 /** 67 * Finds the `GtkNative` associated with the surface. 68 * 69 * Params: 70 * surface = a `GdkSurface` 71 * 72 * Returns: the `GtkNative` that is associated with @surface 73 */ 74 public static NativeIF getForSurface(Surface surface) 75 { 76 auto __p = gtk_native_get_for_surface((surface is null) ? null : surface.getSurfaceStruct()); 77 78 if(__p is null) 79 { 80 return null; 81 } 82 83 return ObjectG.getDObject!(NativeIF)(cast(GtkNative*) __p); 84 } 85 86 /** 87 * Returns the renderer that is used for this `GtkNative`. 88 * 89 * Returns: the renderer for @self 90 */ 91 public Renderer getRenderer(); 92 93 /** 94 * Returns the surface of this `GtkNative`. 95 * 96 * Returns: the surface of @self 97 */ 98 public Surface getSurface(); 99 100 /** 101 * Retrieves the surface transform of @self. 102 * 103 * This is the translation from @self's surface coordinates into 104 * @self's widget coordinates. 105 * 106 * Params: 107 * x = return location for the x coordinate 108 * y = return location for the y coordinate 109 */ 110 public void getSurfaceTransform(out double x, out double y); 111 112 /** 113 * Realizes a `GtkNative`. 114 * 115 * This should only be used by subclasses. 116 */ 117 public void realizeNative(); 118 119 /** 120 * Unrealizes a `GtkNative`. 121 * 122 * This should only be used by subclasses. 123 */ 124 public void unrealizeNative(); 125 }