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.ShortcutsWindow; 26 27 private import gobject.Signals; 28 private import gtk.Window; 29 private import gtk.c.functions; 30 public import gtk.c.types; 31 public import gtkc.gtktypes; 32 private import std.algorithm; 33 34 35 /** 36 * A GtkShortcutsWindow shows brief information about the keyboard shortcuts 37 * and gestures of an application. The shortcuts can be grouped, and you can 38 * have multiple sections in this window, corresponding to the major modes of 39 * your application. 40 * 41 * Additionally, the shortcuts can be filtered by the current view, to avoid 42 * showing information that is not relevant in the current application context. 43 * 44 * The recommended way to construct a GtkShortcutsWindow is with GtkBuilder, 45 * by populating a #GtkShortcutsWindow with one or more #GtkShortcutsSection 46 * objects, which contain #GtkShortcutsGroups that in turn contain objects of 47 * class #GtkShortcutsShortcut. 48 * 49 * # A simple example: 50 * 51 * ![](gedit-shortcuts.png) 52 * 53 * This example has as single section. As you can see, the shortcut groups 54 * are arranged in columns, and spread across several pages if there are too 55 * many to find on a single page. 56 * 57 * The .ui file for this example can be found [here](https://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/shortcuts-gedit.ui). 58 * 59 * # An example with multiple views: 60 * 61 * ![](clocks-shortcuts.png) 62 * 63 * This example shows a #GtkShortcutsWindow that has been configured to show only 64 * the shortcuts relevant to the "stopwatch" view. 65 * 66 * The .ui file for this example can be found [here](https://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/shortcuts-clocks.ui). 67 * 68 * # An example with multiple sections: 69 * 70 * ![](builder-shortcuts.png) 71 * 72 * This example shows a #GtkShortcutsWindow with two sections, "Editor Shortcuts" 73 * and "Terminal Shortcuts". 74 * 75 * The .ui file for this example can be found [here](https://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/shortcuts-builder.ui). 76 */ 77 public class ShortcutsWindow : Window 78 { 79 /** the main Gtk struct */ 80 protected GtkShortcutsWindow* gtkShortcutsWindow; 81 82 /** Get the main Gtk struct */ 83 public GtkShortcutsWindow* getShortcutsWindowStruct(bool transferOwnership = false) 84 { 85 if (transferOwnership) 86 ownedRef = false; 87 return gtkShortcutsWindow; 88 } 89 90 /** the main Gtk struct as a void* */ 91 protected override void* getStruct() 92 { 93 return cast(void*)gtkShortcutsWindow; 94 } 95 96 /** 97 * Sets our main struct and passes it to the parent class. 98 */ 99 public this (GtkShortcutsWindow* gtkShortcutsWindow, bool ownedRef = false) 100 { 101 this.gtkShortcutsWindow = gtkShortcutsWindow; 102 super(cast(GtkWindow*)gtkShortcutsWindow, ownedRef); 103 } 104 105 106 /** */ 107 public static GType getType() 108 { 109 return gtk_shortcuts_window_get_type(); 110 } 111 112 /** 113 * The ::close signal is a 114 * [keybinding signal][GtkBindingSignal] 115 * which gets emitted when the user uses a keybinding to close 116 * the window. 117 * 118 * The default binding for this signal is the Escape key. 119 */ 120 gulong addOnClose(void delegate(ShortcutsWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 121 { 122 return Signals.connect(this, "close", dlg, connectFlags ^ ConnectFlags.SWAPPED); 123 } 124 125 /** 126 * The ::search signal is a 127 * [keybinding signal][GtkBindingSignal] 128 * which gets emitted when the user uses a keybinding to start a search. 129 * 130 * The default binding for this signal is Control-F. 131 */ 132 gulong addOnSearch(void delegate(ShortcutsWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 133 { 134 return Signals.connect(this, "search", dlg, connectFlags ^ ConnectFlags.SWAPPED); 135 } 136 }