gdritter repos knurling / c14dd91
very basic rust statusbar Getty Ritter 5 years ago
6 changed file(s) with 603 addition(s) and 0 deletion(s). Collapse all Expand all
1 /target
2 **/*.rs.bk*~
3 *~
1 # This file is automatically @generated by Cargo.
2 # It is not intended for manual editing.
3 [[package]]
4 name = "bitflags"
5 version = "1.0.4"
6 source = "registry+https://github.com/rust-lang/crates.io-index"
7
8 [[package]]
9 name = "cairo-rs"
10 version = "0.6.0"
11 source = "registry+https://github.com/rust-lang/crates.io-index"
12 dependencies = [
13 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
14 "cairo-sys-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
15 "glib 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
16 "glib-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
17 "gobject-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
18 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
19 ]
20
21 [[package]]
22 name = "cairo-sys-rs"
23 version = "0.8.0"
24 source = "registry+https://github.com/rust-lang/crates.io-index"
25 dependencies = [
26 "glib-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
27 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
28 "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
29 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
30 "x11 2.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
31 ]
32
33 [[package]]
34 name = "glib"
35 version = "0.7.1"
36 source = "registry+https://github.com/rust-lang/crates.io-index"
37 dependencies = [
38 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
39 "glib-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
40 "gobject-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
41 "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
42 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
43 ]
44
45 [[package]]
46 name = "glib-sys"
47 version = "0.8.0"
48 source = "registry+https://github.com/rust-lang/crates.io-index"
49 dependencies = [
50 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
51 "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
52 ]
53
54 [[package]]
55 name = "gobject-sys"
56 version = "0.8.0"
57 source = "registry+https://github.com/rust-lang/crates.io-index"
58 dependencies = [
59 "glib-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
60 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
61 "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
62 ]
63
64 [[package]]
65 name = "lazy_static"
66 version = "1.3.0"
67 source = "registry+https://github.com/rust-lang/crates.io-index"
68
69 [[package]]
70 name = "libc"
71 version = "0.2.50"
72 source = "registry+https://github.com/rust-lang/crates.io-index"
73
74 [[package]]
75 name = "pango"
76 version = "0.6.0"
77 source = "registry+https://github.com/rust-lang/crates.io-index"
78 dependencies = [
79 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
80 "glib 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
81 "glib-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
82 "gobject-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
83 "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
84 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
85 "pango-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
86 ]
87
88 [[package]]
89 name = "pango-sys"
90 version = "0.8.0"
91 source = "registry+https://github.com/rust-lang/crates.io-index"
92 dependencies = [
93 "glib-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
94 "gobject-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
95 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
96 "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
97 ]
98
99 [[package]]
100 name = "pangocairo"
101 version = "0.7.0"
102 source = "registry+https://github.com/rust-lang/crates.io-index"
103 dependencies = [
104 "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
105 "cairo-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
106 "cairo-sys-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
107 "glib 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
108 "glib-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
109 "gobject-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
110 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
111 "pango 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
112 "pango-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
113 "pangocairo-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
114 ]
115
116 [[package]]
117 name = "pangocairo-sys"
118 version = "0.9.0"
119 source = "registry+https://github.com/rust-lang/crates.io-index"
120 dependencies = [
121 "cairo-sys-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
122 "glib-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
123 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
124 "pango-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
125 "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
126 ]
127
128 [[package]]
129 name = "pkg-config"
130 version = "0.3.14"
131 source = "registry+https://github.com/rust-lang/crates.io-index"
132
133 [[package]]
134 name = "redox_syscall"
135 version = "0.1.51"
136 source = "registry+https://github.com/rust-lang/crates.io-index"
137
138 [[package]]
139 name = "time"
140 version = "0.1.42"
141 source = "registry+https://github.com/rust-lang/crates.io-index"
142 dependencies = [
143 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
144 "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)",
145 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
146 ]
147
148 [[package]]
149 name = "winapi"
150 version = "0.3.6"
151 source = "registry+https://github.com/rust-lang/crates.io-index"
152 dependencies = [
153 "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
154 "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
155 ]
156
157 [[package]]
158 name = "winapi-i686-pc-windows-gnu"
159 version = "0.4.0"
160 source = "registry+https://github.com/rust-lang/crates.io-index"
161
162 [[package]]
163 name = "winapi-x86_64-pc-windows-gnu"
164 version = "0.4.0"
165 source = "registry+https://github.com/rust-lang/crates.io-index"
166
167 [[package]]
168 name = "x11"
169 version = "2.18.1"
170 source = "registry+https://github.com/rust-lang/crates.io-index"
171 dependencies = [
172 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
173 "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
174 ]
175
176 [[package]]
177 name = "xsamp"
178 version = "0.1.0"
179 dependencies = [
180 "cairo-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
181 "cairo-sys-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
182 "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
183 "pango 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
184 "pangocairo 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
185 "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
186 "x11 2.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
187 ]
188
189 [metadata]
190 "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
191 "checksum cairo-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9e09d8a818b2ccc8983f04d95a9350c3cf8d24cc456cedca3b88fa3a81fdc0e2"
192 "checksum cairo-sys-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3fa13914fdc013387afa771f554f2f71d6ae931f4e5be9246c337d60c3dc484"
193 "checksum glib 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e8fdc159c196a5dfa53a92929ac4c10c8a6637ffb43951f3fff89c2cd2365"
194 "checksum glib-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5bda542f3caee39a027638e9644ff89204101ad916fd7370b585ad2c5fc97e61"
195 "checksum gobject-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23e05a14290d3dc255223cba51db4b0f3da438d5250657996fa99b2a30faf43e"
196 "checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
197 "checksum libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)" = "aab692d7759f5cd8c859e169db98ae5b52c924add2af5fbbca11d12fefb567c1"
198 "checksum pango 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4e36b55d7cd522bd183efeb3dfabc547bda1f26eadf8a1241dac09ab3fd3242c"
199 "checksum pango-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "747ab9cd4d537e6dc5ef0e4308c10dde8b706673b0237fed4e056b8d2c0b23c8"
200 "checksum pangocairo 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "706e885b46a16ba96f46f3c8d880ca6082c2c62693b75f3d167bd3aa4e34b0d4"
201 "checksum pangocairo-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "868310e83da5269323c28bd47b641557d032426f396cddfa45e247ff44da9a12"
202 "checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
203 "checksum redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)" = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85"
204 "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"
205 "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
206 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
207 "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
208 "checksum x11 2.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39697e3123f715483d311b5826e254b6f3cfebdd83cf7ef3358f579c3d68e235"
1 [package]
2 name = "xsamp"
3 version = "0.1.0"
4 authors = ["Getty Ritter <samothes@infinitenegativeutility.com>"]
5 edition = "2018"
6
7 [dependencies]
8 cairo-rs = "*"
9 pango = "*"
10 pangocairo = "*"
11 time = "*"
12 libc = "*"
13
14 [dependencies.cairo-sys-rs]
15 version = "*"
16 features = ["xlib"]
17
18 [dependencies.x11]
19 version = "*"
20 features = ["xlib", "xinput"]
1 fn main() {
2 println!("cargo:rustc-flags=-l X11");
3 }
1 mod window;
2
3 use x11::xlib;
4 use x11::xinput2;
5
6 use std::ffi::CString;
7 use std::os::raw::{c_int,c_uchar};
8 use std::ptr;
9
10 use pango::LayoutExt;
11
12 use window::{Event,Window};
13
14 fn main() {
15 unsafe {
16 let mut w = Window::create();
17 w.change_property("_NET_WM_WINDOW_TYPE", "_NET_WM_WINDOW_TYPE_DOCK");
18
19 {
20 let prop = w.intern("_NET_WM_STRUT_PARTIAL");
21 let val = [
22 0i64, 0, 36, 0,
23 0, 0, 0, 0,
24 0, 3840, 0, 0,
25 ];
26 xlib::XChangeProperty(
27 w.display,
28 w.window,
29 prop,
30 xlib::XA_CARDINAL,
31 32,
32 xlib::PropModeReplace,
33 std::mem::transmute(val.as_ptr()),
34 val.len() as c_int,
35 );
36 }
37
38 {
39 let prop = w.intern("_NET_WM_STRUT");
40 let val = &[
41 0i64, 0, 36, 0,
42 ];
43 xlib::XChangeProperty(
44 w.display,
45 w.window,
46 prop,
47 xlib::XA_CARDINAL,
48 32,
49 xlib::PropModeReplace,
50 std::mem::transmute(val.as_ptr()),
51 val.len() as c_int,
52 );
53 }
54
55 w.set_title("rbar");
56
57 {
58 let mut opcode = 0;
59 let mut event = 0;
60 let mut error = 0;
61 let xinput_str = CString::new("XInputExtension").unwrap();
62 let _xinput_available =
63 xlib::XQueryExtension(w.display, xinput_str.as_ptr(), &mut opcode, &mut event, &mut error);
64
65 let mut mask: [c_uchar;1] = [0];
66 let mut input_event_mask = xinput2::XIEventMask {
67 deviceid: xinput2::XIAllMasterDevices,
68 mask_len: mask.len() as i32,
69 mask: mask.as_mut_ptr(),
70 };
71 let events = &[
72 xinput2::XI_ButtonPress,
73 xinput2::XI_ButtonRelease,
74 ];
75 for &event in events {
76 xinput2::XISetMask(&mut mask, event);
77 }
78
79
80 match xinput2::XISelectEvents(w.display, w.window, &mut input_event_mask, 1) {
81 status if status as u8 == xlib::Success => (),
82 err => panic!("Failed to select events {:?}", err)
83 }
84 }
85
86 w.set_protocols();
87 w.map();
88
89 let surf = w.get_cairo_surface();
90 let ctx = cairo::Context::new(&surf);
91
92 let window_fd = w.get_fd();
93
94 let mut fds = std::mem::uninitialized();
95 let mut input = format!("Loading...");
96 let mut stdin = std::io::BufReader::new(std::io::stdin());
97 let mut timer = libc::timeval {
98 tv_sec: 5,
99 tv_usec: 0,
100 };
101 draw(&ctx, "[1]");
102
103 loop {
104 use std::io::BufRead;
105
106 libc::FD_ZERO(&mut fds);
107 libc::FD_SET(window_fd, &mut fds);
108 libc::FD_SET(1, &mut fds);
109
110 libc::select(window_fd + 1, &mut fds, ptr::null_mut(), ptr::null_mut(), &mut timer);
111
112 if libc::FD_ISSET(1, &mut fds) {
113 input = String::new();
114 stdin.read_line(&mut input).unwrap();
115 if input == "" {
116 break;
117 }
118 draw(&ctx, &input);
119 }
120
121 while w.has_events() {
122 draw(&ctx, &input);
123 match w.handle() {
124 Event::QuitEvent => break,
125 e => (),
126 }
127 }
128
129 }
130 }
131 }
132
133
134 fn draw(ctx: &cairo::Context, left: &str) {
135 let now = time::now();
136
137 ctx.set_source_rgb(0.1, 0.1, 0.1);
138 ctx.paint();
139 ctx.set_source_rgb(1.0, 1.0, 1.0);
140
141 let layout = pangocairo::functions::create_layout(&ctx).unwrap();
142 layout.set_alignment(pango::Alignment::Right);
143 layout.set_width((3840 - 20) * pango::SCALE);
144 let mut font = pango::FontDescription::from_string("Fira Mono 18");
145 font.set_weight(pango::Weight::Bold);
146 layout.set_font_description(&font);
147 ctx.move_to(10.0, 4.0);
148 layout.set_text(&time::strftime("%a %b %d %H:%M", &now).unwrap());
149 pangocairo::functions::show_layout(&ctx, &layout);
150
151 layout.set_alignment(pango::Alignment::Left);
152 layout.set_text(left);
153 pangocairo::functions::show_layout(&ctx, &layout);
154 }
1 use x11::{xlib,xinput2};
2
3 use std::ffi::CString;
4 use std::{mem,ptr};
5 use std::os::raw::c_int;
6
7 pub struct Window {
8 pub display: *mut xlib::_XDisplay,
9 pub screen: i32,
10 pub window: u64,
11 pub wm_protocols: u64,
12 pub wm_delete_window: u64,
13 }
14
15 impl Window {
16 pub fn create() -> Window {
17 unsafe {
18 let display = xlib::XOpenDisplay(ptr::null());
19 let screen = xlib::XDefaultScreen(display);
20 let window = xlib::XCreateSimpleWindow(
21 display,
22 xlib::XRootWindow(display, screen),
23 0,
24 0,
25 3840,
26 36,
27 1,
28 xlib::XBlackPixel(display, screen),
29 xlib::XWhitePixel(display, screen),
30 );
31 let wm_protocols = {
32 let cstr = CString::new("WM_PROTOCOLS").unwrap();
33 xlib::XInternAtom(display, cstr.as_ptr(), 0)
34 };
35 let wm_delete_window = {
36 let cstr = CString::new("WM_DELETE_WINDOW").unwrap();
37 xlib::XInternAtom(display, cstr.as_ptr(), 0)
38 };
39 Window {
40 display,
41 screen,
42 window,
43 wm_protocols,
44 wm_delete_window,
45 }
46 }
47 }
48
49 pub fn set_protocols(&mut self) {
50 let mut protocols = [self.intern("WM_DELETE_WINDOW")];
51 unsafe {
52 xlib::XSetWMProtocols(
53 self.display,
54 self.window,
55 protocols.as_mut_ptr(),
56 protocols.len() as c_int,
57 );
58 }
59 }
60
61 pub fn set_title(&mut self, name: &str) {
62 unsafe {
63 xlib::XStoreName(
64 self.display,
65 self.window,
66 CString::new(name).unwrap().as_ptr(),
67 );
68 }
69 }
70
71 pub fn map(&mut self) {
72 unsafe {
73 xlib::XMapWindow(self.display, self.window);
74 }
75 }
76
77 pub fn intern(&mut self, s: &str) -> u64 {
78 unsafe {
79 let cstr = CString::new(s).unwrap();
80 xlib::XInternAtom(self.display, cstr.as_ptr(), 0)
81 }
82 }
83
84 pub fn change_property(&mut self, prop: &str, val: &str) {
85 let prop = self.intern(prop);
86 let val = self.intern(val);
87 unsafe {
88 xlib::XChangeProperty(
89 self.display,
90 self.window,
91 prop,
92 xlib::XA_ATOM,
93 32,
94 xlib::PropModeReplace,
95 mem::transmute(&val),
96 1,
97 );
98 }
99 }
100
101 pub fn get_cairo_surface(&mut self) -> cairo::Surface {
102 unsafe {
103 let s = cairo_sys::cairo_xlib_surface_create(
104 self.display,
105 self.window,
106 xlib::XDefaultVisual(self.display, self.screen),
107 3840,
108 64,
109 );
110 cairo::Surface::from_raw_none(s)
111 }
112 }
113
114 pub fn handle(&mut self) -> Event {
115 // to find out if we're getting a delete window event
116
117 let mut e = unsafe { mem::uninitialized() };
118 unsafe { xlib::XNextEvent(self.display, &mut e) };
119 match e.get_type() {
120 xlib::ClientMessage => {
121 let xclient: xlib::XClientMessageEvent = From::from(e);
122 if xclient.message_type == self.wm_protocols && xclient.format == 32 {
123 let protocol = xclient.data.get_long(0) as xlib::Atom;
124 if protocol == self.wm_delete_window {
125 return Event::QuitEvent;
126 }
127 }
128 }
129
130 xlib::Expose => return Event::ShowEvent,
131
132 xlib::GenericEvent => {
133 let mut cookie: xlib::XGenericEventCookie = From::from(e);
134 unsafe { xlib::XGetEventData(self.display, &mut cookie) };
135 match cookie.evtype {
136 xinput2::XI_ButtonPress => {
137 let data: &xinput2::XIDeviceEvent = unsafe { mem::transmute(cookie.data) };
138 return Event::MouseEvent { x: data.event_x, y: data.event_y };
139 }
140 _ => (),
141 }
142 }
143 _ => (),
144 }
145
146 Event::Other
147 }
148
149 pub fn has_events(&mut self) -> bool {
150 unsafe {
151 xlib::XPending(self.display) != 0
152 }
153 }
154
155 pub fn show(&mut self) {
156 unsafe {
157 xlib::XClearArea(
158 self.display,
159 self.window,
160 0,
161 0,
162 3840,
163 36,
164 1
165 );
166 }
167 }
168
169 pub fn get_fd(&mut self) -> i32 {
170 unsafe {
171 xlib::XConnectionNumber(self.display)
172 }
173 }
174 }
175
176
177 impl Drop for Window {
178 fn drop(&mut self) {
179 unsafe {
180 xlib::XCloseDisplay(self.display);
181 }
182 }
183 }
184
185 #[derive(Debug)]
186 pub enum Event {
187 MouseEvent { x:f64, y: f64 },
188 ShowEvent,
189 QuitEvent,
190 Other,
191 }
192
193 /*
194 cairo_surface_t *cairo_create_x11_surface0(int x, int y)
195 {
196 Display *dsp;
197 Drawable da;
198 int screen;
199 cairo_surface_t *sfc;
200
201 if ((dsp = XOpenDisplay(NULL)) == NULL)
202 exit(1);
203 screen = DefaultScreen(dsp);
204 da = XCreateSimpleWindow(dsp, DefaultRootWindow(dsp),
205 0, 0, x, y, 0, 0, 0);
206 XSelectInput(dsp, da, ButtonPressMask | KeyPressMask);
207 XMapWindow(dsp, da);
208
209 sfc = cairo_xlib_surface_create(dsp, da,
210 DefaultVisual(dsp, screen), x, y);
211 cairo_xlib_surface_set_size(sfc, x, y);
212
213 return sfc;
214 }
215 */