Lines Matching refs:xlib
12 mod xlib; module
41 xlib::XFree(t as *mut c_void); in x_free()
45 struct XDisplay(Rc<NonNull<xlib::Display>>);
50 xlib::XCloseDisplay(self.as_ptr()); in drop()
57 fn as_ptr(&self) -> *mut xlib::Display { in as_ptr()
63 unsafe { xlib::XShmQueryExtension(self.as_ptr()) != 0 } in supports_shm()
69 xlib::XDefaultScreenOfDisplay(self.as_ptr()) in default_screen()
75 unsafe { xlib::XPending(self.as_ptr()) != 0 } in pending_events()
81 xlib::XFlush(self.as_ptr()); in flush()
91 xlib::XNextEvent(self.as_ptr(), &mut ev); in next_event()
99 unsafe { xlib::XConnectionNumber(self.as_ptr()) } in as_raw_descriptor()
103 struct XEvent(xlib::XEvent);
104 impl From<xlib::XEvent> for XEvent {
105 fn from(ev: xlib::XEvent) -> XEvent { in from()
111 fn any(&self) -> xlib::XAnyEvent { in any()
121 fn window(&self) -> xlib::Window { in window()
128 xlib::KeyPress | xlib::KeyRelease => XEventEnum::KeyEvent(unsafe { self.0.xkey }), in as_enum()
129 xlib::ButtonPress => XEventEnum::ButtonEvent { in as_enum()
133 xlib::ButtonRelease => XEventEnum::ButtonEvent { in as_enum()
137 xlib::MotionNotify => XEventEnum::Motion(unsafe { self.0.xmotion }), in as_enum()
138 xlib::Expose => XEventEnum::Expose, in as_enum()
139 xlib::ClientMessage => { in as_enum()
146 let ev_completion: xlib::XShmCompletionEvent = unsafe { transmute_copy(&self.0) }; in as_enum()
155 KeyEvent(xlib::XKeyEvent),
157 event: xlib::XButtonEvent,
160 Motion(xlib::XMotionEvent),
163 ShmCompletionEvent(xlib::ShmSeg),
168 struct XScreen(NonNull<xlib::Screen>);
171 fn as_ptr(&self) -> *mut xlib::Screen { in as_ptr()
177 unsafe { xlib::XScreenNumberOfScreen(self.as_ptr()) } in get_number()
183 image: *mut xlib::XImage,
186 segment_info: Box<xlib::XShmSegmentInfo>,
194 xlib::XShmDetach(self.display.as_ptr(), self.segment_info.as_mut()); in drop()
195 xlib::XDestroyImage(self.image); in drop()
220 visual: *mut xlib::Visual,
222 window: xlib::Window,
223 gc: xlib::GC,
243 visual: *mut xlib::Visual, in create()
249 let depth = xlib::XDefaultDepthOfScreen(screen.as_ptr()) as u32; in create()
251 let black_pixel = xlib::XBlackPixelOfScreen(screen.as_ptr()); in create()
253 let window = xlib::XCreateSimpleWindow( in create()
255 xlib::XRootWindowOfScreen(screen.as_ptr()), in create()
265 let gc = xlib::XCreateGC(display.as_ptr(), window, 0, null_mut()); in create()
269 xlib::XShmGetEventBase(display.as_ptr()) as u32 + xlib::ShmCompletion; in create()
272 let mut delete_window_atom = xlib::XInternAtom( in create()
279 xlib::XSetWMProtocols(display.as_ptr(), window, &mut delete_window_atom, 1); in create()
281 let size_hints = xlib::XAllocSizeHints(); in create()
282 (*size_hints).flags = (xlib::PMinSize | xlib::PMaxSize) as i64; in create()
287 xlib::XSetWMNormalHints(display.as_ptr(), window, size_hints); in create()
291 xlib::XSelectInput( in create()
294 (xlib::ExposureMask in create()
295 | xlib::KeyPressMask in create()
296 | xlib::KeyReleaseMask in create()
297 | xlib::ButtonPressMask in create()
298 | xlib::ButtonReleaseMask in create()
299 | xlib::PointerMotionMask) as i64, in create()
302 xlib::XClearWindow(display.as_ptr(), window); in create()
303 xlib::XMapRaised(display.as_ptr(), window); in create()
356 key.type_ == xlib::KeyPress as i32, in handle_event()
366 if button_event.button & xlib::Button1 != 0 { in handle_event()
377 if motion.state & xlib::Button1Mask != 0 { in handle_event()
414 xlib::XClearWindow(self.display.as_ptr(), self.window); in draw_buffer()
423 xlib::XShmPutImage( in draw_buffer()
454 let mut segment_info: Box<xlib::XShmSegmentInfo> = Box::new(zeroed()); in lazily_allocate_buffer()
455 let image = xlib::XShmCreateImage( in lazily_allocate_buffer()
459 xlib::ZPixmap as i32, in lazily_allocate_buffer()
474 xlib::XDestroyImage(image); in lazily_allocate_buffer()
479 xlib::XDestroyImage(image); in lazily_allocate_buffer()
485 xlib::XShmAttach(self.display.as_ptr(), segment_info.as_mut()); in lazily_allocate_buffer()
531 xlib::XFreeGC(self.display.as_ptr(), self.gc); in drop()
532 xlib::XDestroyWindow(self.display.as_ptr(), self.window); in drop()
547 visual: *mut xlib::Visual,
565 let display = match NonNull::new(xlib::XOpenDisplay( in open_display()
591 let mut visual_info_template = xlib::XVisualInfo { in open_display()
603 let visual_info = xlib::XGetVisualInfo( in open_display()
605 (xlib::VisualScreenMask in open_display()
606 | xlib::VisualDepthMask in open_display()
607 | xlib::VisualRedMaskMask in open_display()
608 | xlib::VisualGreenMaskMask in open_display()
609 | xlib::VisualBlueMaskMask) as i64, in open_display()