Class: Clutter::Canvas

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

The Clutter::CanvasClass structure contains private data.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.newClutter::Content

Creates a new instance of Clutter::Canvas.

You should call clutter_canvas_set_size() to set the size of the canvas.

You should call clutter_content_invalidate() every time you wish to draw the contents of the canvas.

Returns:

  • (Clutter::Content)

    The newly allocated instance of Clutter::Canvas. Use g_object_unref() when done.

Instance Method Details

#heightInteger

The height of the canvas.

Returns:

  • (Integer)

    height

#height=(height) ⇒ Integer

The height of the canvas.

Parameters:

  • height (Integer)

Returns:

  • (Integer)

    height

  • (Integer)

    height

#scale_factorInteger

The scaling factor to be applied to the Cairo surface used for drawing.

If Clutter::Canvas:scale-factor is set to a negative value, the value of the Clutter::Settings:window-scaling-factor property is used instead.

Use Clutter::Canvas:scale-factor-set to check if the scale factor is set.

Returns:

  • (Integer)

    scale-factor

#scale_factor=(scale_factor) ⇒ Integer

The scaling factor to be applied to the Cairo surface used for drawing.

If Clutter::Canvas:scale-factor is set to a negative value, the value of the Clutter::Settings:window-scaling-factor property is used instead.

Use Clutter::Canvas:scale-factor-set to check if the scale factor is set.

Parameters:

  • scale_factor (Integer)

Returns:

  • (Integer)

    scale-factor

  • (Integer)

    scale-factor

#scale_factor_set=(scale_factor_set) ⇒ Boolean

Whether the Clutter::Canvas:scale-factor property is set.

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

Parameters:

  • scale_factor_set (Boolean)

Returns:

  • (Boolean)

    scale-factor-set

  • (Boolean)

    scale-factor-set

#scale_factor_set?Boolean

Whether the Clutter::Canvas:scale-factor property is set.

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

Returns:

  • (Boolean)

    scale-factor-set

#set_size(width, height) ⇒ Boolean

Sets the size of the canvas, and invalidates the content.

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

If you want to invalidate the contents of the canvas when setting the size, you can use the return value of the function to conditionally call clutter_content_invalidate():

|[ if (!clutter_canvas_set_size (canvas, width, height)) clutter_content_invalidate (CLUTTER_CONTENT (canvas)); ]|

Parameters:

  • width (Integer)

    the width of the canvas, in pixels

  • height (Integer)

    the height of the canvas, in pixels

Returns:

  • (Boolean)

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

#widthInteger

The width of the canvas.

Returns:

  • (Integer)

    width

#width=(width) ⇒ Integer

The width of the canvas.

Parameters:

  • width (Integer)

Returns:

  • (Integer)

    width

  • (Integer)

    width