Trait ux::ActorCanvasExt[][src]

pub trait ActorCanvasExt: 'static {
Show methods pub fn get_scale_factor(&self) -> i32;
pub fn set_scale_factor(&self, scale: i32);
pub fn set_size(&self, width: i32, height: i32) -> bool;
pub fn get_property_height(&self) -> i32;
pub fn set_property_height(&self, height: i32);
pub fn get_property_scale_factor_set(&self) -> bool;
pub fn get_property_width(&self) -> i32;
pub fn set_property_width(&self, width: i32);
pub fn connect_draw<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self, &Context, i32, i32) -> bool
;
pub fn connect_property_height_notify<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_scale_factor_notify<F>(
        &self,
        f: F
    ) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_scale_factor_set_notify<F>(
        &self,
        f: F
    ) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_width_notify<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
}

Trait containing all Canvas methods.

Implementors

Canvas

Required methods

pub fn get_scale_factor(&self) -> i32[src]

Retrieves the scaling factor of self, as set using CanvasExt::set_scale_factor.

Returns

the scaling factor, or -1 if the self uses the default from Settings

pub fn set_scale_factor(&self, scale: i32)[src]

Sets the scaling factor for the Cairo surface used by self.

This function should rarely be used.

The default scaling factor of a Canvas content uses the Settings:window-scaling-factor property, which is set by the windowing system. By using this function it is possible to override that setting.

Changing the scale factor will invalidate the self.

scale

the scale factor, or -1 for the default

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

Sets the size of the self, 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 get_property_height(&self) -> i32[src]

The height of the canvas.

pub fn set_property_height(&self, height: i32)[src]

The height of the canvas.

pub fn get_property_scale_factor_set(&self) -> bool[src]

Whether the Canvas:scale-factor property is set.

If the Canvas:scale-factor-set property is false then Canvas will use the Settings:window-scaling-factor property.

pub fn get_property_width(&self) -> i32[src]

The width of the canvas.

pub fn set_property_width(&self, width: i32)[src]

The width of the canvas.

pub fn connect_draw<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self, &Context, 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_property_height_notify<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

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

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

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

Loading content...

Implementors

impl<O> ActorCanvasExt for O where
    O: IsA<ActorCanvas>, 
[src]

Loading content...