1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright 2013-2015, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
#![allow(unused_imports)]
use ffi;
use cast::{GTK_APP_LAUNCH_CONTEXT};
use std::str;
use std::string;
struct_Widget!(AppLaunchContext);
impl AppLaunchContext {/*
pub fn new() -> Option<AppLaunchContext> {
assert_initialized_main_thread!();
let tmp_pointer = unsafe { ffi::g_app_launch_context_new() };
if tmp_pointer.is_null() {
None
} else {
Some(::FFIWidget::wrap_widget(tmp_pointer as *mut ::ffi::GtkWidget))
}
}
pub fn setenv(&self, variable: &str, value: &str) -> () {
unsafe {
variable.with_c_str(|c_variable| {
value.with_c_str(|c_value| {
ffi::g_app_launch_context_setenv(GTK_APP_LAUNCH_CONTEXT(self.unwrap_widget()), c_variable, c_value)
})
})
}
}
pub fn unsetenv(&self, variable: &str) -> () {
unsafe {
variable.with_c_str(|c_variable| {
ffi::g_app_launch_context_unsetenv(GTK_APP_LAUNCH_CONTEXT(self.unwrap_widget()), c_variable)
})
}
}
pub fn get_environment(&self) -> Vec<String> {
let env = unsafe { ffi::g_app_launch_context_get_environment(GTK_APP_LAUNCH_CONTEXT(self.unwrap_widget())) };
let mut ret = Vec::new();
if env.is_not_null() {
let mut it = 0;
unsafe {
loop {
let tmp = env.offset(it);
if tmp.is_null() {
break;
}
ret.push(FromCStr::from_raw_buf(*tmp));
it += 1;
}
}
}
ret
}
pub fn get_display(&self, info: &::AppInfo, files: &glib::List) -> Option<String> {
let tmp_pointer = unsafe { ffi::g_app_launch_context_get_display(GTK_APP_LAUNCH_CONTEXT(self.unwrap_widget()), GTK_APP_INFO(info.unwrap_widget()), files.unwrap()) };
if tmp_pointer.is_null() {
None
} else {
Some(FromCStr::from_raw_buf(tmp_pointer))
}
}
pub fn get_startup_notify_id(&self, app_info: &::AppInfo, files: &glib::List) -> Option<String> {
let tmp_pointer = unsafe { ffi::g_app_launch_context_get_startup_notify_id(GTK_APP_LAUNCH_CONTEXT(self.unwrap_widget()), GTK_APP_INFO(app_info.unwrap_widget()), files.unwrap()) };
if tmp_pointer.is_null() {
None
} else {
Some(FromCStr::from_raw_buf(tmp_pointer))
}
}
pub fn launch_failed(&self, startup_notify_id: &str) -> () {
unsafe {
startup_notify_id.with_c_str(|c_str|{
ffi::g_app_launch_context_launch_failed(GTK_APP_LAUNCH_CONTEXT(self.unwrap_widget()), c_str)
})
}
}*/
}
impl_drop!(AppLaunchContext);
impl_TraitWidget!(AppLaunchContext);