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 private import std.algorithm; 32 33 34 /** 35 * A `GtkShortcutsWindow` shows information about the keyboard shortcuts 36 * and gestures of an application. 37 * 38 * The shortcuts can be grouped, and you can have multiple sections in this 39 * window, corresponding to the major modes of 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 45 * [class@Gtk.Builder], by populating a `GtkShortcutsWindow` with one or 46 * more `GtkShortcutsSection` objects, which contain `GtkShortcutsGroups` 47 * that in turn contain objects of 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://gitlab.gnome.org/GNOME/gtk/tree/master/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://gitlab.gnome.org/GNOME/gtk/tree/master/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://gitlab.gnome.org/GNOME/gtk/tree/master/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 * Emitted when the user uses a keybinding to close the window. 114 * 115 * This is a [keybinding signal](class.SignalAction.html). 116 * 117 * The default binding for this signal is the Escape key. 118 */ 119 gulong addOnClose(void delegate(ShortcutsWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 120 { 121 return Signals.connect(this, "close", dlg, connectFlags ^ ConnectFlags.SWAPPED); 122 } 123 124 /** 125 * Emitted when the user uses a keybinding to start a search. 126 * 127 * This is a [keybinding signal](class.SignalAction.html). 128 * 129 * The default binding for this signal is Control-F. 130 */ 131 gulong addOnSearch(void delegate(ShortcutsWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 132 { 133 return Signals.connect(this, "search", dlg, connectFlags ^ ConnectFlags.SWAPPED); 134 } 135 }