Struct ux::Surface[][src]

pub struct Surface { /* fields omitted */ }

Implementations

impl Surface[src]

pub fn new() -> Surface[src]

Trait Implementations

impl AsRef<Actor> for Surface[src]

impl AsRef<ActorCanvas> for Surface[src]

impl AsRef<Surface> for Surface[src]

impl AsRef<Widget> for Surface[src]

impl Clone for Surface[src]

impl Debug for Surface[src]

impl Default for Surface[src]

impl Display for Surface[src]

impl Is<Actor> for Surface[src]

impl Is<ActorCanvas> for Surface[src]

impl Is<Surface> for Surface[src]

impl Is<Widget> for Surface[src]

impl Object for Surface[src]

Auto Trait Implementations

impl !RefUnwindSafe for Surface

impl !Send for Surface

impl !Sync for Surface

impl Unpin for Surface

impl UnwindSafe for Surface

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Construction<T> for T where
    T: Default + Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Fr, To> IntoColor<To> for Fr where
    To: FromColor<Fr>, 
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<O> WidgetExt for O where
    O: Is<Widget>, 
[src]

pub fn apply_style<P>(&self, style: &P) where
    P: Is<Style>, 
[src]

widget_apply_style: @widget: A #Widget @style: A #Style

Used to implement how a new style instance should be applied in the widget. For instance, setting style instance on stylable internal children.

pub fn get_available_area(&self, allocation: &ActorBox, area: &mut ActorBox)[src]

get_available_area: @widget: A #Widget @allocation: A #ActorBox @area: A #ActorBox

Copies @allocation into @area and accounts for the padding values. This gives the area that is available in which to allocate children with respect to padding.

pub fn get_background_color(&self) -> Option<Color<f64>>[src]

get_background_color: @actor: A #Widget

Get the color used as the background. This is set using the “background-color” CSS property. This function should normally only be used by subclasses.

Returns: (transfer none): a #Color

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

get_disabled: @widget: an #Widget

Get the value of the “disabled” property.

pub fn get_padding(&self) -> Padding[src]

get_padding: @widget: A #Widget @padding: (out): A pointer to an #Padding to fill

Gets the padding of the widget, set using the “padding” CSS property. This function should normally only be used by subclasses.

pub fn long_press_cancel(&self)[src]

long_press_cancel: @widget: An Widget

Cancel a long-press timeout if one is running and emit the signal to notify that the long-press has been cancelled.

pub fn long_press_query(&self, event: &mut Event)[src]

long_press_query: @widget: An Widget @event: the event used to determine whether to run a long-press

Emit the long-press query signal and start a long-press timeout if required.

pub fn set_disabled(&self, disabled: bool)[src]

widget_set_disabled: @widget: an #Widget @disabled: value to set

Set the disabled property. Disabled widgets have a “disabled” pseudo-class until disabled is set to #false.