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 * Conversion parameters: 26 * inFile = gdk-Application-launching.html 27 * outPack = gdk 28 * outFile = AppLaunchContext 29 * strct = GdkAppLaunchContext 30 * realStrct= 31 * ctorStrct= 32 * clss = AppLaunchContext 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gdk_app_launch_context_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - gdk.Display 48 * - gdk.Screen 49 * - gio.IconIF 50 * structWrap: 51 * - GIcon* -> IconIF 52 * - GdkDisplay* -> Display 53 * - GdkScreen* -> Screen 54 * module aliases: 55 * local aliases: 56 * overrides: 57 */ 58 59 module gdk.AppLaunchContext; 60 61 public import gtkc.gdktypes; 62 63 private import gtkc.gdk; 64 private import glib.ConstructionException; 65 private import gobject.ObjectG; 66 67 68 private import glib.Str; 69 private import gdk.Display; 70 private import gdk.Screen; 71 private import gio.IconIF; 72 73 74 75 76 /** 77 * Description 78 * GdkAppLaunchContext is an implementation of GAppLaunchContext that 79 * handles launching an application in a graphical context. It provides 80 * startup notification and allows to launch applications on a specific 81 * screen or workspace. 82 * $(DDOC_COMMENT example) 83 */ 84 public class AppLaunchContext 85 { 86 87 /** the main Gtk struct */ 88 protected GdkAppLaunchContext* gdkAppLaunchContext; 89 90 91 public GdkAppLaunchContext* getAppLaunchContextStruct() 92 { 93 return gdkAppLaunchContext; 94 } 95 96 97 /** the main Gtk struct as a void* */ 98 protected void* getStruct() 99 { 100 return cast(void*)gdkAppLaunchContext; 101 } 102 103 /** 104 * Sets our main struct and passes it to the parent class 105 */ 106 public this (GdkAppLaunchContext* gdkAppLaunchContext) 107 { 108 this.gdkAppLaunchContext = gdkAppLaunchContext; 109 } 110 111 /** 112 */ 113 114 /** 115 * Creates a new GdkAppLaunchContext. 116 * Since 2.14 117 * Throws: ConstructionException GTK+ fails to create the object. 118 */ 119 public this () 120 { 121 // GdkAppLaunchContext * gdk_app_launch_context_new (void); 122 auto p = gdk_app_launch_context_new(); 123 if(p is null) 124 { 125 throw new ConstructionException("null returned by gdk_app_launch_context_new()"); 126 } 127 this(cast(GdkAppLaunchContext*) p); 128 } 129 130 /** 131 * Sets the display on which applications will be launched when 132 * using this context. See also gdk_app_launch_context_set_screen(). 133 * Since 2.14 134 * Params: 135 * display = a GdkDisplay 136 */ 137 public void setDisplay(Display display) 138 { 139 // void gdk_app_launch_context_set_display (GdkAppLaunchContext *context, GdkDisplay *display); 140 gdk_app_launch_context_set_display(gdkAppLaunchContext, (display is null) ? null : display.getDisplayStruct()); 141 } 142 143 /** 144 * Sets the screen on which applications will be launched when 145 * using this context. See also gdk_app_launch_context_set_display(). 146 * If both screen and display are set, the screen takes priority. 147 * If neither screen or display are set, the default screen and 148 * display are used. 149 * Since 2.14 150 * Params: 151 * screen = a GdkScreen 152 */ 153 public void setScreen(Screen screen) 154 { 155 // void gdk_app_launch_context_set_screen (GdkAppLaunchContext *context, GdkScreen *screen); 156 gdk_app_launch_context_set_screen(gdkAppLaunchContext, (screen is null) ? null : screen.getScreenStruct()); 157 } 158 159 /** 160 * Sets the workspace on which applications will be launched when 161 * using this context when running under a window manager that 162 * supports multiple workspaces, as described in the 163 * Extended 164 * Window Manager Hints. 165 * When the workspace is not specified or desktop is set to -1, 166 * it is up to the window manager to pick one, typically it will 167 * be the current workspace. 168 * Since 2.14 169 * Params: 170 * desktop = the number of a workspace, or -1 171 */ 172 public void setDesktop(int desktop) 173 { 174 // void gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context, gint desktop); 175 gdk_app_launch_context_set_desktop(gdkAppLaunchContext, desktop); 176 } 177 178 /** 179 * Sets the timestamp of context. The timestamp should ideally 180 * be taken from the event that triggered the launch. 181 * Window managers can use this information to avoid moving the 182 * focus to the newly launched application when the user is busy 183 * typing in another window. This is also known as 'focus stealing 184 * prevention'. 185 * Since 2.14 186 * Params: 187 * timestamp = a timestamp 188 */ 189 public void setTimestamp(uint timestamp) 190 { 191 // void gdk_app_launch_context_set_timestamp (GdkAppLaunchContext *context, guint32 timestamp); 192 gdk_app_launch_context_set_timestamp(gdkAppLaunchContext, timestamp); 193 } 194 195 /** 196 * Sets the icon for applications that are launched with this 197 * context. 198 * Window Managers can use this information when displaying startup 199 * notification. 200 * See also gdk_app_launch_context_set_icon_name(). 201 * Since 2.14 202 * Params: 203 * icon = a GIcon, or NULL. [allow-none] 204 */ 205 public void setIcon(IconIF icon) 206 { 207 // void gdk_app_launch_context_set_icon (GdkAppLaunchContext *context, GIcon *icon); 208 gdk_app_launch_context_set_icon(gdkAppLaunchContext, (icon is null) ? null : icon.getIconTStruct()); 209 } 210 211 /** 212 * Sets the icon for applications that are launched with this context. 213 * The icon_name will be interpreted in the same way as the Icon field 214 * in desktop files. See also gdk_app_launch_context_set_icon(). 215 * If both icon and icon_name are set, the icon_name takes priority. 216 * If neither icon or icon_name is set, the icon is taken from either 217 * the file that is passed to launched application or from the GAppInfo 218 * for the launched application itself. 219 * Since 2.14 220 * Params: 221 * iconName = an icon name, or NULL. [allow-none] 222 */ 223 public void setIconName(string iconName) 224 { 225 // void gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context, const char *icon_name); 226 gdk_app_launch_context_set_icon_name(gdkAppLaunchContext, Str.toStringz(iconName)); 227 } 228 }