MxViewport

MxViewport — single child scrollable container

Functions

Properties

gboolean sync-adjustments Read / Write
float x-origin Read / Write
float y-origin Read / Write
float z-origin Read / Write

Types and Values

struct MxViewport
struct MxViewportClass

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── MxWidget
                ╰── MxBin
                    ╰── MxViewport

Implemented Interfaces

MxViewport implements ClutterContainer, ClutterScriptable, ClutterAnimatable, AtkImplementorIface, MxStylable, MxFocusable and MxScrollable.

Description

MxViewport allows non-scrollable children (like images or text) to be scrollable by implementing the MxScrollable and ClutterContainer interface.

To use it, add the non-scrollable child to an MxViewport; then sit the viewport inside an MxScrollView to get the scrollbars.

Figure 11. MxViewport around an MxLabel

An example of a large label (which isn't normally scrollable), placed inside an MxViewport, which is in turn inside an MxScrollView.

MxViewport around an MxLabel

Do not use MxViewport if you need good performance as it does can not be selective about the area of its child that is painted/picked. Therefore if the child is very large or contains a lot of children, you will experience poor performance.

Functions

mx_viewport_new ()

ClutterActor *
mx_viewport_new (void);

mx_viewport_set_origin ()

void
mx_viewport_set_origin (MxViewport *viewport,
                        gfloat x,
                        gfloat y,
                        gfloat z);

mx_viewport_get_origin ()

void
mx_viewport_get_origin (MxViewport *viewport,
                        gfloat *x,
                        gfloat *y,
                        gfloat *z);

mx_viewport_set_sync_adjustments ()

void
mx_viewport_set_sync_adjustments (MxViewport *viewport,
                                  gboolean sync);

mx_viewport_get_sync_adjustments ()

gboolean
mx_viewport_get_sync_adjustments (MxViewport *viewport);

Types and Values

struct MxViewport

struct MxViewport;

The contents of this structure are private and should only be accessed through the public API.


struct MxViewportClass

struct MxViewportClass {
  MxBinClass parent_class;

  /* padding for future expansion */
  void (*_padding_0) (void);
  void (*_padding_1) (void);
  void (*_padding_2) (void);
  void (*_padding_3) (void);
  void (*_padding_4) (void);
};

Property Details

The “sync-adjustments” property

  “sync-adjustments”         gboolean

Whether to synchronise adjustments with viewport size.

Owner: MxViewport

Flags: Read / Write

Default value: TRUE


The “x-origin” property

  “x-origin”                 float

Origin's X coordinate in pixels.

Owner: MxViewport

Flags: Read / Write

Default value: 0


The “y-origin” property

  “y-origin”                 float

Origin's Y coordinate in pixels.

Owner: MxViewport

Flags: Read / Write

Default value: 0


The “z-origin” property

  “z-origin”                 float

Origin's Z coordinate in pixels.

Owner: MxViewport

Flags: Read / Write

Default value: 0