Trait ux::SurfaceExt[][src]

pub trait SurfaceExt: 'static {
    pub fn invalidate(&self);
pub fn set_content_size(&self, width: f64, height: f64) -> bool;
pub fn connect_draw<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self, &Canvas<'_>, i32, i32) -> bool
;
pub fn connect_looped<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_animating_notify<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
; }

Required methods

pub fn invalidate(&self)[src]

Invalidates a Content.

This function should be called by Content implementations when they change the way a the content should be painted regardless of the actor state.

pub fn set_content_size(&self, width: f64, height: f64) -> bool[src]

Sets the size of the surface context, and invalidates the content.

This function will cause the self to be invalidated only if the size of the canvas surface has changed.

If you want to invalidate the contents of the self when setting the size, you can use the return value of the function to conditionally call Content::invalidate:

  if (!canvas_set_size (canvas, width, height))
    content_invalidate (CONTENT (canvas));

width

the width of the canvas, in pixels

height

the height of the canvas, in pixels

Returns

this function returns true if the size change caused a content invalidation, and false otherwise

pub fn connect_draw<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self, &Canvas<'_>, i32, i32) -> bool
[src]

The Canvas::draw signal is emitted each time a canvas is invalidated.

It is safe to connect multiple handlers to this signal: each handler invocation will be automatically protected by cairo_save and cairo_restore pairs.

cr

the Cairo context used to draw

width

the width of the canvas

height

the height of the canvas

Returns

true if the signal emission should stop, and false otherwise

pub fn connect_looped<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

pub fn connect_property_animating_notify<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

Loading content...

Implementors

impl<O> SurfaceExt for O where
    O: Is<Surface>, 
[src]

pub fn invalidate(&self)[src]

Invalidates a Content.

This function should be called by Content implementations when they change the way a the content should be painted regardless of the actor state.

pub fn set_content_size(&self, width: f64, height: f64) -> bool[src]

Sets the size of the surface context, and invalidates the content.

This function will cause the self to be invalidated only if the size of the canvas surface has changed.

If you want to invalidate the contents of the self when setting the size, you can use the return value of the function to conditionally call Content::invalidate:

  if (!canvas_set_size (canvas, width, height))
    content_invalidate (CONTENT (canvas));

width

the width of the canvas, in pixels

height

the height of the canvas, in pixels

Returns

this function returns true if the size change caused a content invalidation, and false otherwise

pub fn connect_draw<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&O, &Canvas<'_>, i32, i32) -> bool
[src]

The Canvas::draw signal is emitted each time a canvas is invalidated.

It is safe to connect multiple handlers to this signal: each handler invocation will be automatically protected by cairo_save and cairo_restore pairs.

cr

the Cairo context used to draw

width

the width of the canvas

height

the height of the canvas

Returns

true if the signal emission should stop, and false otherwise

Loading content...