pub fn create_drawing_window_with_events<'a, TProperties: 'a+FloWindowProperties>(window_properties: TProperties) -> (DrawingTarget, impl Clone+Send+Stream<Item=DrawEvent>) {
    let (width, height)     = window_properties.size().get();

    // Create the canvas
    let (target, stream)    = DrawingTarget::new();
    target.draw(|gc| {
        // Default window layout is 1:1 for the requested window size
        gc.clear_canvas(Color::Rgba(1.0, 1.0, 1.0, 1.0));
        gc.canvas_height(height as _);
        gc.center_region(0.0, 0.0, width as _, height as _);
    });

    // Get the stream of drawing instructions (and gather them into batches)
    let target_stream       = stream;
    let target_stream       = drawing_without_dashed_lines(target_stream);
    let target_stream       = drawing_with_laid_out_text(target_stream);
    let target_stream       = drawing_with_text_as_paths(target_stream);
    let target_stream       = BatchedStream { stream: Some(target_stream), frame_count: 0, waiting: vec![] };

    // Create the events stream
    let events              = create_drawing_window_from_stream(target_stream, window_properties);

    // Return the result
    (target, events)
}
///
/// Creates a drawing target that will render to a window, along with a stream of events from that window
///
Creates a drawing target that will render to a window, along with a stream of events from that window
Creates a drawing target that will render to a window along with a stream of events from that window
pub fn create_drawing_window_with_events<'a, TProperties: 'a+FloWindowProperties>(window_properties: TProperties) -> (DrawingTarget, impl Clone+Send+Stream<Item=DrawEvent>) {
    let (width, height)     = window_properties.size().get();
    // Create the canvas
    let (target, stream)    = DrawingTarget::new();
    target.draw(|gc| {
        // Default window layout is 1:1 for the requested window size
        gc.clear_canvas(Color::Rgba(1.0, 1.0, 1.0, 1.0));
        gc.canvas_height(height as _);
        gc.center_region(0.0, 0.0, width as _, height as _);
    });
    // Get the stream of drawing instructions (and gather them into batches)
    let target_stream       = stream;
    let target_stream       = drawing_without_dashed_lines(target_stream);
    let target_stream       = drawing_with_laid_out_text(target_stream);
    let target_stream       = drawing_with_text_as_paths(target_stream);
    let target_stream       = BatchedStream { stream: Some(target_stream), frame_count: 0, waiting: vec![] };
    // Create the events stream
    let events              = create_drawing_window_from_stream(target_stream, window_properties);
    // Return the result
    (target, events)
}
pub fn create_drawing_window_with_events < ' a , TProperties : ' a + FloWindowProperties > ( window_properties : TProperties ) -> ( DrawingTarget , impl Clone + Send + Stream < Item = DrawEvent > ) { let ( width , height ) = window_properties . size ( ) . get ( ) ; // Create the canvas let ( target , stream ) = DrawingTarget :: new ( ) ; target . draw ( | gc | { // Default window layout is 1:1 for the requested window size gc . clear_canvas ( Color :: Rgba ( 1.0 , 1.0 , 1.0 , 1.0 ) ) ; gc . canvas_height ( height as _ ) ; gc . center_region ( 0.0 , 0.0 , width as _ , height as _ ) ; } ) ; // Get the stream of drawing instructions (and gather them into batches) let target_stream = stream ; let target_stream = drawing_without_dashed_lines ( target_stream ) ; let target_stream = drawing_with_laid_out_text ( target_stream ) ; let target_stream = drawing_with_text_as_paths ( target_stream ) ; let target_stream = BatchedStream { stream : Some ( target_stream ) , frame_count : 0 , waiting : vec ! [ ] } ; // Create the events stream let events = create_drawing_window_from_stream ( target_stream , window_properties ) ; // Return the result ( target , events ) }
Creates a drawing target that will render to a window, along with a stream of events from that window
Creates a drawing target that will render to a window along with a stream of events from that window
window_properties
TProperties