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