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