Skip to content

Instantly share code, notes, and snippets.

View Osspial's full-sized avatar
👩‍🎓
enjoying university

Osspial

👩‍🎓
enjoying university
  • Pittsburgh, PA
View GitHub Profile

The cef_callback_impl macro isn't all that complex - most of the heavy lifting here is getting done by the trait system. However, it is the jumping-off point into the trait system, so it's a good place to start looking at that.

For reference, here's the macro definition itself:

macro_rules! cef_callback_impl {
    (impl $RefCounted:ty: $CType:ty {
        $(fn $fn_name:ident(&mut $self:ident, $($field_name:ident: $field_ty:ty: $c_ty:ty),+ $(,)?) $(-> $ret:ty)? $body:block)+
    }) => {
        impl $RefCounted {
@Osspial
Osspial / 020.md
Last active June 21, 2019 21:22

Hello, all!

I'm one of the maintainers of Winit, the main pure-Rust window creation library written. Even if you haven't used it directly, you've probably heard of projects that depends on it - Servo and Alacritty being the best-known applications that depend on our codebase. If you've done any graphics programming in Rust using Glutin (or dependent projects including gfx-rs, Glium, and Amethyst) we've been the ones making the windows actually show up on your desktop.

There are a few important announcements I'd like to make:

@Osspial
Osspial / winit_help_ad.md
Last active May 19, 2019 11:56
winit help post

Hello, all!

I'm one of the maintainers of Winit, the main pure-Rust window creation library written. Even if you haven't used it directly, you've probably heard of projects that depends on it - Servo and Alacritty being the best-known applications that depend on our codebase. If you've done any game programming in Rust using Glutin (or dependent projects including gfx-rs, Glium, and Amethyst) we've been the ones making the windows actually show up on your desktop.

However, for such a core piece of infrastructure in the Rust ecosystem, we have astonishingly little manpower. Only three of the seven platforms we support have active maintainers: X11, macOS,

Help wanted on:

Winit

Windows:

  • Implement incremental window resizing
  • Implement popup windows
  • Implement minimized/maximized events [#208]
  • WM_IME_* support ([#508])
  • Add with_position ([#806])
@Osspial
Osspial / design.md
Created August 24, 2018 01:27
Event Loop 2.0 Original Design
  • Depricate the poll_events function, in favor of run_forever with the expanded ControlFlow enum.
  • Change the definition of ControlFlow to the following:
    pub enum ControlFlow {
        /// Equivalent to the current `Continue`. Suspends the thread until another OS event
        /// arrives.
        Wait,
        /// Suspends the thread until either another event arrives, or the timeout expires.
        WaitTimeout(Duration),
        /// Replaces the `poll_events` method's functionality. After all the OS's events have
@Osspial
Osspial / events_loop_v2.md
Last active August 24, 2018 01:33
Events Loop 2.0 Semifinal Changes

Event Loop 2.0 Changelog

A history of the changelog can be viewed by checking the Revisions tab above.

  • Change all occurrences of EventsLoop to EventLoop.
  • Previously flat API is now exposed through event, event_loop, monitor, and window modules.
  • os module changes:
    • Renamed to platform.
    • All traits now have platform-specific suffixes.
  • Exposes new desktop module on Windows, Mac, and Linux.
@Osspial
Osspial / imb.md
Last active June 27, 2018 23:51
Interlaced Mutable Borrows

Interlaced Mutable Borrows

Syntax

&imb foo

Goals

Add a mechanism for statically-verified shared mutable state. Also enables partial borrows.

Summary

struct World;
struct UI;
struct VulkanoRenderer;
struct GFXRenderer;
impl Renderer<World> for VulkanoRenderer{/*...*/}
impl Renderer<UI> for VulkanoRenderer{/*...*/}
impl Renderer<World> for GFXRenderer{/*...*/}
@Osspial
Osspial / macro_reparse.rs
Created April 22, 2017 20:30
Error messages when reparsing macro tokens
// This works
macro_rules! macro_into_ident {
(id) => ();
}
macro_rules! ident_into_macro {
($ident:ident) => (macro_into_ident!($ident););
}
ident_into_macro!(id);
// This also works