1 /*
2  * This file is part of d-dazzle.
3  *
4  * d-dazzle 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  * d-dazzle 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 d-dazzle; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 module dazzle.DockStack;
20 
21 private import dazzle.DockItemIF;
22 private import dazzle.DockItemT;
23 private import dazzle.c.functions;
24 public  import dazzle.c.types;
25 private import glib.ConstructionException;
26 private import gobject.ObjectG;
27 private import gtk.Box;
28 private import gtk.BuildableIF;
29 private import gtk.BuildableT;
30 private import gtk.OrientableIF;
31 private import gtk.OrientableT;
32 private import gtk.Widget;
33 
34 
35 /** */
36 public class DockStack : Box, DockItemIF
37 {
38 	/** the main Gtk struct */
39 	protected DzlDockStack* dzlDockStack;
40 
41 	/** Get the main Gtk struct */
42 	public DzlDockStack* getDockStackStruct(bool transferOwnership = false)
43 	{
44 		if (transferOwnership)
45 			ownedRef = false;
46 		return dzlDockStack;
47 	}
48 
49 	/** the main Gtk struct as a void* */
50 	protected override void* getStruct()
51 	{
52 		return cast(void*)dzlDockStack;
53 	}
54 
55 	/**
56 	 * Sets our main struct and passes it to the parent class.
57 	 */
58 	public this (DzlDockStack* dzlDockStack, bool ownedRef = false)
59 	{
60 		this.dzlDockStack = dzlDockStack;
61 		super(cast(GtkBox*)dzlDockStack, ownedRef);
62 	}
63 
64 	// add the DockItem capabilities
65 	mixin DockItemT!(DzlDockStack);
66 
67 	alias getStyle = Widget.getStyle;
68 
69 	/** */
70 	public DzlTabStyle getStyle()
71 	{
72 		return dzl_dock_stack_get_style(dzlDockStack);
73 	}
74 	alias getParent = Widget.getParent;
75 	alias getParent = Widget.getParent;
76 
77 	/**
78 	 */
79 
80 	/** */
81 	public static GType getType()
82 	{
83 		return dzl_dock_stack_get_type();
84 	}
85 
86 	/** */
87 	public this()
88 	{
89 		auto p = dzl_dock_stack_new();
90 
91 		if(p is null)
92 		{
93 			throw new ConstructionException("null returned by new");
94 		}
95 
96 		this(cast(DzlDockStack*) p);
97 	}
98 
99 	/** */
100 	public GtkPositionType getEdge()
101 	{
102 		return dzl_dock_stack_get_edge(dzlDockStack);
103 	}
104 
105 	/** */
106 	public bool getShowPinnedButton()
107 	{
108 		return dzl_dock_stack_get_show_pinned_button(dzlDockStack) != 0;
109 	}
110 
111 	/** */
112 	public void setEdge(GtkPositionType edge)
113 	{
114 		dzl_dock_stack_set_edge(dzlDockStack, edge);
115 	}
116 
117 	/** */
118 	public void setShowPinnedButton(bool showPinnedButton)
119 	{
120 		dzl_dock_stack_set_show_pinned_button(dzlDockStack, showPinnedButton);
121 	}
122 
123 	/** */
124 	public void setStyle(DzlTabStyle style)
125 	{
126 		dzl_dock_stack_set_style(dzlDockStack, style);
127 	}
128 }