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 gsk.RepeatNode; 26 27 private import glib.ConstructionException; 28 private import gobject.ObjectG; 29 private import graphene.Rect; 30 private import gsk.RenderNode; 31 private import gsk.c.functions; 32 public import gsk.c.types; 33 34 35 /** 36 * A render node repeating its single child node. 37 */ 38 public class RepeatNode : RenderNode 39 { 40 /** the main Gtk struct */ 41 protected GskRepeatNode* gskRepeatNode; 42 43 /** Get the main Gtk struct */ 44 public GskRepeatNode* getRepeatNodeStruct(bool transferOwnership = false) 45 { 46 if (transferOwnership) 47 ownedRef = false; 48 return gskRepeatNode; 49 } 50 51 /** the main Gtk struct as a void* */ 52 protected override void* getStruct() 53 { 54 return cast(void*)gskRepeatNode; 55 } 56 57 /** 58 * Sets our main struct and passes it to the parent class. 59 */ 60 public this (GskRepeatNode* gskRepeatNode, bool ownedRef = false) 61 { 62 this.gskRepeatNode = gskRepeatNode; 63 super(cast(GskRenderNode*)gskRepeatNode, ownedRef); 64 } 65 66 67 /** */ 68 public static GType getType() 69 { 70 return gsk_repeat_node_get_type(); 71 } 72 73 /** 74 * Creates a `GskRenderNode` that will repeat the drawing of @child across 75 * the given @bounds. 76 * 77 * Params: 78 * bounds = The bounds of the area to be painted 79 * child = The child to repeat 80 * childBounds = The area of the child to repeat or %NULL to 81 * use the child's bounds 82 * 83 * Returns: A new `GskRenderNode` 84 * 85 * Throws: ConstructionException GTK+ fails to create the object. 86 */ 87 public this(Rect bounds, RenderNode child, Rect childBounds) 88 { 89 auto __p = gsk_repeat_node_new((bounds is null) ? null : bounds.getRectStruct(), (child is null) ? null : child.getRenderNodeStruct(), (childBounds is null) ? null : childBounds.getRectStruct()); 90 91 if(__p is null) 92 { 93 throw new ConstructionException("null returned by new"); 94 } 95 96 this(cast(GskRepeatNode*) __p); 97 } 98 99 /** 100 * Retrieves the child of @node. 101 * 102 * Returns: a `GskRenderNode` 103 */ 104 public RenderNode getChild() 105 { 106 auto __p = gsk_repeat_node_get_child(cast(GskRenderNode*)gskRepeatNode); 107 108 if(__p is null) 109 { 110 return null; 111 } 112 113 return ObjectG.getDObject!(RenderNode)(cast(GskRenderNode*) __p); 114 } 115 116 /** 117 * Retrieves the bounding rectangle of the child of @node. 118 * 119 * Returns: a bounding rectangle 120 */ 121 public Rect getChildBounds() 122 { 123 auto __p = gsk_repeat_node_get_child_bounds(cast(GskRenderNode*)gskRepeatNode); 124 125 if(__p is null) 126 { 127 return null; 128 } 129 130 return ObjectG.getDObject!(Rect)(cast(graphene_rect_t*) __p); 131 } 132 }