Trait animate::ActorCanvasExt[][src]

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

Trait containing all Canvas methods.

Implementors

Canvas

Required methods

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

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

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

fn get_property_height(&self) -> i32[src]

The height of the canvas.

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

The height of the canvas.

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.

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

The width of the canvas.

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

The width of the canvas.

fn connect_draw<F: Fn(&Self, &Context, i32, i32) -> bool + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[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

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

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

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

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

Loading content...

Implementors

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

Loading content...