MokoFingerScroll

MokoFingerScroll — A scrolling widget designed for touch screens

Synopsis

                    MokoFingerScroll;
enum                MokoFingerScrollMode;
enum                MokoFingerScrollIndicatorMode;
GtkWidget*          moko_finger_scroll_new              (void);
GtkWidget*          moko_finger_scroll_new_full         (gint mode,
                                                         gboolean enabled,
                                                         gdouble vel_min,
                                                         gdouble vel_max,
                                                         gdouble decel,
                                                         guint sps);
void                moko_finger_scroll_add_with_viewport
                                                        (MokoFingerScroll *scroll,
                                                         GtkWidget *child);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkEventBox
                                       +----MokoFingerScroll

Implemented Interfaces

MokoFingerScroll implements GtkBuildable and AtkImplementorIface.

Properties

  "deceleration"             gdouble               : Read / Write / Construct
  "enabled"                  gboolean              : Read / Write / Construct
  "hindicator-mode"          MokoFingerScrollIndicatorMode  : Read / Write / Construct
  "mode"                     MokoFingerScrollMode  : Read / Write / Construct
  "spring-color"             guint                 : Read / Write / Construct
  "spring-speed"             gdouble               : Read / Write / Construct
  "sps"                      guint                 : Read / Write / Construct
  "velocity-max"             gdouble               : Read / Write / Construct
  "velocity-min"             gdouble               : Read / Write / Construct
  "vindicator-mode"          MokoFingerScrollIndicatorMode  : Read / Write / Construct

Description

MokoFingerScroll implements a scrolled window designed to be used with a touch screen interface. The user scrolls the child widget by activating the pointing device and dragging it over the widget.

Details

MokoFingerScroll

typedef struct _MokoFingerScroll MokoFingerScroll;

MokoFingerScroll has no publicly accessible fields


enum MokoFingerScrollMode

typedef enum {
	MOKO_FINGER_SCROLL_MODE_PUSH,
	MOKO_FINGER_SCROLL_MODE_ACCEL,
	MOKO_FINGER_SCROLL_MODE_AUTO
} MokoFingerScrollMode;

Used to change the behaviour of the finger scrolling

MOKO_FINGER_SCROLL_MODE_PUSH

Scrolling follows pointer

MOKO_FINGER_SCROLL_MODE_ACCEL

Scrolling uses physics to "spin" the widget

MOKO_FINGER_SCROLL_MODE_AUTO

Automatically chooses between push and accel modes, depending on input.

enum MokoFingerScrollIndicatorMode

typedef enum {
	MOKO_FINGER_SCROLL_INDICATOR_MODE_AUTO,
	MOKO_FINGER_SCROLL_INDICATOR_MODE_SHOW,
	MOKO_FINGER_SCROLL_INDICATOR_MODE_HIDE
} MokoFingerScrollIndicatorMode;	


moko_finger_scroll_new ()

GtkWidget*          moko_finger_scroll_new              (void);

Create a new finger scroll widget

Returns :

the newly created MokoFingerScroll

moko_finger_scroll_new_full ()

GtkWidget*          moko_finger_scroll_new_full         (gint mode,
                                                         gboolean enabled,
                                                         gdouble vel_min,
                                                         gdouble vel_max,
                                                         gdouble decel,
                                                         guint sps);

Create a new MokoFingerScroll widget and set various properties

mode :

MokoFingerScrollMode

enabled :

Value for the enabled property

vel_min :

Value for the velocity-min property

vel_max :

Value for the velocity-max property

decel :

Value for the deceleration property

sps :

Value for the sps property

Returns :

the newly create MokoFingerScrull

moko_finger_scroll_add_with_viewport ()

void                moko_finger_scroll_add_with_viewport
                                                        (MokoFingerScroll *scroll,
                                                         GtkWidget *child);

Convenience function used to add a child to a GtkViewport, and add the viewport to the scrolled window.

scroll :

A MokoFingerScroll

child :

Child widget to add to the viewport

Property Details

The "deceleration" property

  "deceleration"             gdouble               : Read / Write / Construct

The multiplier used when decelerating when in acceleration scrolling mode.

Allowed values: [0,1]

Default value: 0.95


The "enabled" property

  "enabled"                  gboolean              : Read / Write / Construct

Enable or disable finger-scroll.

Default value: TRUE


The "hindicator-mode" property

  "hindicator-mode"          MokoFingerScrollIndicatorMode  : Read / Write / Construct

Mode of the horizontal scrolling indicator.

Default value: MOKO_FINGER_SCROLL_INDICATOR_MODE_AUTO


The "mode" property

  "mode"                     MokoFingerScrollMode  : Read / Write / Construct

Change the finger-scrolling mode.

Default value: MOKO_FINGER_SCROLL_MODE_AUTO


The "spring-color" property

  "spring-color"             guint                 : Read / Write / Construct

spring area color.

Default value: 4294967295


The "spring-speed" property

  "spring-speed"             gdouble               : Read / Write / Construct

The multiplier used when decelerating when in spring.

Allowed values: [0,1]

Default value: 0.85


The "sps" property

  "sps"                      guint                 : Read / Write / Construct

Amount of scroll events to generate per second.

Default value: 15


The "velocity-max" property

  "velocity-max"             gdouble               : Read / Write / Construct

Maximum distance the child widget should scroll per 'frame', in pixels.

Allowed values: >= 0

Default value: 48


The "velocity-min" property

  "velocity-min"             gdouble               : Read / Write / Construct

Minimum distance the child widget should scroll per 'frame', in pixels.

Allowed values: >= 0

Default value: 0


The "vindicator-mode" property

  "vindicator-mode"          MokoFingerScrollIndicatorMode  : Read / Write / Construct

Mode of the vertical scrolling indicator.

Default value: MOKO_FINGER_SCROLL_INDICATOR_MODE_AUTO

See Also

#GtkScrolledWindow