/usr/include/d/gtkd-3/gtk/HeaderBar.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gtk.HeaderBar;
private import glib.ConstructionException;
private import glib.Str;
private import gobject.ObjectG;
private import gtk.Container;
private import gtk.Widget;
private import gtk.c.functions;
public import gtk.c.types;
public import gtkc.gtktypes;
/**
* GtkHeaderBar is similar to a horizontal #GtkBox. It allows children to
* be placed at the start or the end. In addition, it allows a title and
* subtitle to be displayed. The title will be centered with respect to
* the width of the box, even if the children at either side take up
* different amounts of space. The height of the titlebar will be
* set to provide sufficient space for the subtitle, even if none is
* currently set. If a subtitle is not needed, the space reservation
* can be turned off with gtk_header_bar_set_has_subtitle().
*
* GtkHeaderBar can add typical window frame controls, such as minimize,
* maximize and close buttons, or the window icon.
*/
public class HeaderBar : Container
{
/** the main Gtk struct */
protected GtkHeaderBar* gtkHeaderBar;
/** Get the main Gtk struct */
public GtkHeaderBar* getHeaderBarStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gtkHeaderBar;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gtkHeaderBar;
}
protected override void setStruct(GObject* obj)
{
gtkHeaderBar = cast(GtkHeaderBar*)obj;
super.setStruct(obj);
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GtkHeaderBar* gtkHeaderBar, bool ownedRef = false)
{
this.gtkHeaderBar = gtkHeaderBar;
super(cast(GtkContainer*)gtkHeaderBar, ownedRef);
}
/** */
public static GType getType()
{
return gtk_header_bar_get_type();
}
/**
* Creates a new #GtkHeaderBar widget.
*
* Returns: a new #GtkHeaderBar
*
* Since: 3.10
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this()
{
auto p = gtk_header_bar_new();
if(p is null)
{
throw new ConstructionException("null returned by new");
}
this(cast(GtkHeaderBar*) p);
}
/**
* Retrieves the custom title widget of the header. See
* gtk_header_bar_set_custom_title().
*
* Returns: the custom title widget
* of the header, or %NULL if none has been set explicitly.
*
* Since: 3.10
*/
public Widget getCustomTitle()
{
auto p = gtk_header_bar_get_custom_title(gtkHeaderBar);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
}
/**
* Gets the decoration layout set with
* gtk_header_bar_set_decoration_layout().
*
* Returns: the decoration layout
*
* Since: 3.12
*/
public string getDecorationLayout()
{
return Str.toString(gtk_header_bar_get_decoration_layout(gtkHeaderBar));
}
/**
* Retrieves whether the header bar reserves space for
* a subtitle, regardless if one is currently set or not.
*
* Returns: %TRUE if the header bar reserves space
* for a subtitle
*
* Since: 3.12
*/
public bool getHasSubtitle()
{
return gtk_header_bar_get_has_subtitle(gtkHeaderBar) != 0;
}
/**
* Returns whether this header bar shows the standard window
* decorations.
*
* Returns: %TRUE if the decorations are shown
*
* Since: 3.10
*/
public bool getShowCloseButton()
{
return gtk_header_bar_get_show_close_button(gtkHeaderBar) != 0;
}
/**
* Retrieves the subtitle of the header. See gtk_header_bar_set_subtitle().
*
* Returns: the subtitle of the header, or %NULL if none has
* been set explicitly. The returned string is owned by the widget
* and must not be modified or freed.
*
* Since: 3.10
*/
public string getSubtitle()
{
return Str.toString(gtk_header_bar_get_subtitle(gtkHeaderBar));
}
/**
* Retrieves the title of the header. See gtk_header_bar_set_title().
*
* Returns: the title of the header, or %NULL if none has
* been set explicitly. The returned string is owned by the widget
* and must not be modified or freed.
*
* Since: 3.10
*/
public string getTitle()
{
return Str.toString(gtk_header_bar_get_title(gtkHeaderBar));
}
/**
* Adds @child to @bar, packed with reference to the
* end of the @bar.
*
* Params:
* child = the #GtkWidget to be added to @bar
*
* Since: 3.10
*/
public void packEnd(Widget child)
{
gtk_header_bar_pack_end(gtkHeaderBar, (child is null) ? null : child.getWidgetStruct());
}
/**
* Adds @child to @bar, packed with reference to the
* start of the @bar.
*
* Params:
* child = the #GtkWidget to be added to @bar
*
* Since: 3.10
*/
public void packStart(Widget child)
{
gtk_header_bar_pack_start(gtkHeaderBar, (child is null) ? null : child.getWidgetStruct());
}
/**
* Sets a custom title for the #GtkHeaderBar.
*
* The title should help a user identify the current view. This
* supersedes any title set by gtk_header_bar_set_title() or
* gtk_header_bar_set_subtitle(). To achieve the same style as
* the builtin title and subtitle, use the “title” and “subtitle”
* style classes.
*
* You should set the custom title to %NULL, for the header title
* label to be visible again.
*
* Params:
* titleWidget = a custom widget to use for a title
*
* Since: 3.10
*/
public void setCustomTitle(Widget titleWidget)
{
gtk_header_bar_set_custom_title(gtkHeaderBar, (titleWidget is null) ? null : titleWidget.getWidgetStruct());
}
/**
* Sets the decoration layout for this header bar, overriding
* the #GtkSettings:gtk-decoration-layout setting.
*
* There can be valid reasons for overriding the setting, such
* as a header bar design that does not allow for buttons to take
* room on the right, or only offers room for a single close button.
* Split header bars are another example for overriding the
* setting.
*
* The format of the string is button names, separated by commas.
* A colon separates the buttons that should appear on the left
* from those on the right. Recognized button names are minimize,
* maximize, close, icon (the window icon) and menu (a menu button
* for the fallback app menu).
*
* For example, “menu:minimize,maximize,close” specifies a menu
* on the left, and minimize, maximize and close buttons on the right.
*
* Params:
* layout = a decoration layout, or %NULL to
* unset the layout
*
* Since: 3.12
*/
public void setDecorationLayout(string layout)
{
gtk_header_bar_set_decoration_layout(gtkHeaderBar, Str.toStringz(layout));
}
/**
* Sets whether the header bar should reserve space
* for a subtitle, even if none is currently set.
*
* Params:
* setting = %TRUE to reserve space for a subtitle
*
* Since: 3.12
*/
public void setHasSubtitle(bool setting)
{
gtk_header_bar_set_has_subtitle(gtkHeaderBar, setting);
}
/**
* Sets whether this header bar shows the standard window decorations,
* including close, maximize, and minimize.
*
* Params:
* setting = %TRUE to show standard window decorations
*
* Since: 3.10
*/
public void setShowCloseButton(bool setting)
{
gtk_header_bar_set_show_close_button(gtkHeaderBar, setting);
}
/**
* Sets the subtitle of the #GtkHeaderBar. The title should give a user
* an additional detail to help him identify the current view.
*
* Note that GtkHeaderBar by default reserves room for the subtitle,
* even if none is currently set. If this is not desired, set the
* #GtkHeaderBar:has-subtitle property to %FALSE.
*
* Params:
* subtitle = a subtitle, or %NULL
*
* Since: 3.10
*/
public void setSubtitle(string subtitle)
{
gtk_header_bar_set_subtitle(gtkHeaderBar, Str.toStringz(subtitle));
}
/**
* Sets the title of the #GtkHeaderBar. The title should help a user
* identify the current view. A good title should not include the
* application name.
*
* Params:
* title = a title, or %NULL
*
* Since: 3.10
*/
public void setTitle(string title)
{
gtk_header_bar_set_title(gtkHeaderBar, Str.toStringz(title));
}
}
|