Ewl_Scrollport: A Scrollable Viewing Area
Detailed Description
Provides a framework for viewing large sets of widgets in a smaller viewable region. For most uses, Ewl_Scrollpane will be easier to work with.
- Remarks:
- Inherits from Ewl_Container.
Data Structures | |
struct | Ewl_Scrollport |
Inherits from Ewl_Container and extends it to provide a framework for panning around larger widgets. Vertical and horizontal scrollbars are provided, but they do not move the enclosed box. It the the job of the user to set the sizes used in this widget. More... | |
struct | Ewl_Scrollport_Kinetic_Info |
Enables a scrollport to be scrolled with kinetic behaviour. More... | |
Defines | |
#define | EWL_SCROLLPORT(scrollport) ((Ewl_Scrollport *) scrollport) |
#define | EWL_SCROLLPORT_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_SCROLLPORT_TYPE)) |
#define | EWL_SCROLLPORT_KINETIC_INFO(scroll_info) ((Ewl_Scrollport_Scroll_Info_Base *) scroll_info) |
#define | EWL_SCROLLPORT_TYPE "scrollport" |
Typedefs | |
typedef Ewl_Scrollport | Ewl_Scrollport |
typedef Ewl_Scrollport_Kinetic_Info | Ewl_Scrollport_Kinetic_Info |
Functions | |
void | ewl_scrollport_area_geometry_get (Ewl_Scrollport *s, int *x, int *y, int *w, int *h) |
Gets the geometry used to calculate the scrollbar sizes. | |
void | ewl_scrollport_area_size_set (Ewl_Scrollport *s, int w, int h) |
Sets the content geometry. | |
void | ewl_scrollport_cb_child_resize (Ewl_Container *p, Ewl_Widget *c, int size, Ewl_Orientation o) |
void | ewl_scrollport_cb_child_show (Ewl_Container *p, Ewl_Widget *c) |
void | ewl_scrollport_cb_configure (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_scrollport_cb_hscroll (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_scrollport_cb_visible_area_configure (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_scrollport_cb_vscroll (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_scrollport_cb_wheel_scroll (Ewl_Widget *w, void *ev_data, void *user_data) |
Ewl_Scrollport_Flags | ewl_scrollport_hscrollbar_flag_get (Ewl_Scrollport *s) |
Get flags for horizontal scrollbar. | |
void | ewl_scrollport_hscrollbar_flag_set (Ewl_Scrollport *s, Ewl_Scrollport_Flags f) |
Set flags for horizontal scrollbar. | |
Ewl_Widget * | ewl_scrollport_hscrollbar_get (Ewl_Scrollport *s) |
Retrieves the vertical scrollbar. | |
double | ewl_scrollport_hscrollbar_step_get (Ewl_Scrollport *s) |
Retrieves the value of the stepping of the vertical scrollbar in s. | |
double | ewl_scrollport_hscrollbar_value_get (Ewl_Scrollport *s) |
Retrieves the value of the horizontal scrollbar in s. | |
void | ewl_scrollport_hscrollbar_value_set (Ewl_Scrollport *s, double val) |
Set the value of the horizontal scrollbar in s to val. | |
int | ewl_scrollport_init (Ewl_Scrollport *s) |
Creates a new scrollport. | |
double | ewl_scrollport_kinetic_dampen_get (Ewl_Scrollport *s) |
Gets the minimum velocity for kinetic scrolling. | |
void | ewl_scrollport_kinetic_dampen_set (Ewl_Scrollport *s, double d) |
Sets the multiplier to reduce the velocity of kinetic scrolling. | |
int | ewl_scrollport_kinetic_fps_get (Ewl_Scrollport *s) |
void | ewl_scrollport_kinetic_fps_set (Ewl_Scrollport *s, int fps) |
Sets the number of times per second to recalculate velocity and update the tree. | |
double | ewl_scrollport_kinetic_max_velocity_get (Ewl_Scrollport *s) |
Gets the maximum velocity for kinetic scrolling. | |
void | ewl_scrollport_kinetic_max_velocity_set (Ewl_Scrollport *s, double v) |
Sets the maximum velocity for kinetic scrolling. | |
double | ewl_scrollport_kinetic_min_velocity_get (Ewl_Scrollport *s) |
Gets the minimum velocity for kinetic scrolling. | |
void | ewl_scrollport_kinetic_min_velocity_set (Ewl_Scrollport *s, double v) |
Sets the minimum velocity for kinetic scrolling. | |
Ewl_Kinetic_Scroll | ewl_scrollport_kinetic_scrolling_get (Ewl_Scrollport *s) |
Gets the type of kinetic scrolling used. | |
void | ewl_scrollport_kinetic_scrolling_set (Ewl_Scrollport *s, Ewl_Kinetic_Scroll type) |
Sets up default values and callbacks for kinetic scrolling. | |
Ewl_Widget * | ewl_scrollport_new (void) |
Create a new scrollpane. | |
void | ewl_scrollport_visible_area_geometry_get (Ewl_Scrollport *s, int *x, int *y, int *w, int *h) |
Gets the geometry of the visible area. | |
void | ewl_scrollport_visible_area_geometry_set (Ewl_Scrollport *s, int x, int y, int w, int h) |
Sets the visible current geometry. | |
Ewl_Container * | ewl_scrollport_visible_area_get (Ewl_Scrollport *s) |
Retrieves the visible area container. | |
Ewl_Scrollport_Flags | ewl_scrollport_vscrollbar_flag_get (Ewl_Scrollport *s) |
Get flags for vertical scrollbar. | |
void | ewl_scrollport_vscrollbar_flag_set (Ewl_Scrollport *s, Ewl_Scrollport_Flags f) |
Set flags for vertical scrollbar. | |
Ewl_Widget * | ewl_scrollport_vscrollbar_get (Ewl_Scrollport *s) |
Retrieves the vertical scrollbar. | |
double | ewl_scrollport_vscrollbar_step_get (Ewl_Scrollport *s) |
Retrieves the value of the stepping of the vertical scrollbar in s. | |
double | ewl_scrollport_vscrollbar_value_get (Ewl_Scrollport *s) |
Retrieves the value of the vertical scrollbar in s. | |
void | ewl_scrollport_vscrollbar_value_set (Ewl_Scrollport *s, double val) |
Set the value of the vertical scrollbar in s to val. | |
Variables | |
int | Ewl_Scrollport::area_h |
int | Ewl_Scrollport::area_w |
int | Ewl_Scrollport::area_x_offset |
int | Ewl_Scrollport::area_y_offset |
Ewl_Scrollport_Flags | Ewl_Scrollport::hflag |
Ewl_Widget * | Ewl_Scrollport::hscrollbar |
Ewl_Scrollport_Kinetic_Info * | Ewl_Scrollport::kinfo |
Ewl_Kinetic_Scroll | Ewl_Scrollport::type |
Ewl_Scrollport_Flags | Ewl_Scrollport::vflag |
Ewl_Widget * | Ewl_Scrollport::visible_area |
Ewl_Widget * | Ewl_Scrollport::vscrollbar |
Define Documentation
#define EWL_SCROLLPORT | ( | scrollport | ) | ((Ewl_Scrollport *) scrollport) |
Typecasts a pointer to an Ewl_Scrollport pointer.
#define EWL_SCROLLPORT_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_SCROLLPORT_TYPE)) |
Returns TRUE if the widget is an Ewl_Scrollport, FALSE otherwise
#define EWL_SCROLLPORT_KINETIC_INFO | ( | scroll_info | ) | ((Ewl_Scrollport_Scroll_Info_Base *) scroll_info) |
#define EWL_SCROLLPORT_TYPE "scrollport" |
The type name for the Ewl_Scrollport widget
Typedef Documentation
typedef struct Ewl_Scrollport Ewl_Scrollport |
The scrollport provides a framework for panning around larger widgets.
typedef struct Ewl_Scrollport_Kinetic_Info Ewl_Scrollport_Kinetic_Info |
This is a forward declaration, the actual structure is defined in ewl_scrollport_kinetic.c
Function Documentation
void ewl_scrollport_area_geometry_get | ( | Ewl_Scrollport * | s, | |
int * | x, | |||
int * | y, | |||
int * | w, | |||
int * | h | |||
) |
Gets the geometry used to calculate the scrollbar sizes.
- Parameters:
-
s,: the scrollport to get the geometry from x,: the current x offset of the content y,: the current y offset of the content w,: used to return the width h,: used to return the height
- Returns:
- Returns no value
void ewl_scrollport_area_size_set | ( | Ewl_Scrollport * | s, | |
int | w, | |||
int | h | |||
) |
Sets the content geometry.
- Parameters:
-
s,: The scrollport to set the geometry of w,: The content width h,: The content height
- Returns:
- Returns no value
void ewl_scrollport_cb_child_resize | ( | Ewl_Container * | p, | |
Ewl_Widget * | c, | |||
int | size, | |||
Ewl_Orientation | o | |||
) |
void ewl_scrollport_cb_child_show | ( | Ewl_Container * | p, | |
Ewl_Widget * | c | |||
) |
void ewl_scrollport_cb_configure | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
void ewl_scrollport_cb_hscroll | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
void ewl_scrollport_cb_visible_area_configure | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
void ewl_scrollport_cb_vscroll | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
void ewl_scrollport_cb_wheel_scroll | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
Ewl_Scrollport_Flags ewl_scrollport_hscrollbar_flag_get | ( | Ewl_Scrollport * | s | ) |
Get flags for horizontal scrollbar.
- Parameters:
-
s,: the scrollport that contains the scrollbar to retrieve
- Returns:
- Returns the flags of the horizontal scrollbar, 0 on failure.
void ewl_scrollport_hscrollbar_flag_set | ( | Ewl_Scrollport * | s, | |
Ewl_Scrollport_Flags | f | |||
) |
Set flags for horizontal scrollbar.
- Parameters:
-
s,: the scrollport that contains the scrollbar to change f,: the flags to set on the horizontal scrollbar in s
- Returns:
- Returns no value.
Ewl_Widget* ewl_scrollport_hscrollbar_get | ( | Ewl_Scrollport * | s | ) |
Retrieves the vertical scrollbar.
- Parameters:
-
s,: the scrollport to retrieve the vertical scrollbar from
- Returns:
- Returns the vertical scrollbar
double ewl_scrollport_hscrollbar_step_get | ( | Ewl_Scrollport * | s | ) |
Retrieves the value of the stepping of the vertical scrollbar in s.
- Parameters:
-
s,: the scrollport to retrieve its vertical scrollbar stepping
- Returns:
- Returns the value of the stepping of the vertical scrollbar in s on success.
double ewl_scrollport_hscrollbar_value_get | ( | Ewl_Scrollport * | s | ) |
Retrieves the value of the horizontal scrollbar in s.
- Parameters:
-
s,: the scrollport to retrieve it's horizontal scrollbar value
- Returns:
- Returns the value of the horizontal scrollbar in s on success.
void ewl_scrollport_hscrollbar_value_set | ( | Ewl_Scrollport * | s, | |
double | val | |||
) |
Set the value of the horizontal scrollbar in s to val.
- Parameters:
-
s,: the scrollport to set the horizontal scrollbar value val,: the value to set the scrollbar too
- Returns:
- Returns nothing
int ewl_scrollport_init | ( | Ewl_Scrollport * | s | ) |
Creates a new scrollport.
- Parameters:
-
s,: the scrollport to initialize
- Returns:
- Returns no value.
double ewl_scrollport_kinetic_dampen_get | ( | Ewl_Scrollport * | s | ) |
Gets the minimum velocity for kinetic scrolling.
- Parameters:
-
s,: The scrollport to work with
- Returns:
- Returns the minimum velocity
void ewl_scrollport_kinetic_dampen_set | ( | Ewl_Scrollport * | s, | |
double | d | |||
) |
Sets the multiplier to reduce the velocity of kinetic scrolling.
- Parameters:
-
s,: The scrollport to work with d,: The multiplier to reduce velocity
- Returns:
- Returns no value
int ewl_scrollport_kinetic_fps_get | ( | Ewl_Scrollport * | s | ) |
- Parameters:
-
s,: The scrollport to work with
- Returns:
- Returns the current frames per second brief Gets the times per second the timer used for scrolling will be called
void ewl_scrollport_kinetic_fps_set | ( | Ewl_Scrollport * | s, | |
int | fps | |||
) |
Sets the number of times per second to recalculate velocity and update the tree.
- Parameters:
-
s,: The scrollport to work with fps,: The desired frames per second
- Returns:
- Returns no value
double ewl_scrollport_kinetic_max_velocity_get | ( | Ewl_Scrollport * | s | ) |
Gets the maximum velocity for kinetic scrolling.
- Parameters:
-
s,: The scrollport to work with
- Returns:
- Returns the maximum velocity
void ewl_scrollport_kinetic_max_velocity_set | ( | Ewl_Scrollport * | s, | |
double | v | |||
) |
Sets the maximum velocity for kinetic scrolling.
- Parameters:
-
s,: The scrollport to work with v,: The maximum velocity
- Returns:
- Returns no value
double ewl_scrollport_kinetic_min_velocity_get | ( | Ewl_Scrollport * | s | ) |
Gets the minimum velocity for kinetic scrolling.
- Parameters:
-
s,: The scrollport to work with
- Returns:
- Returns the minimum velocity
void ewl_scrollport_kinetic_min_velocity_set | ( | Ewl_Scrollport * | s, | |
double | v | |||
) |
Sets the minimum velocity for kinetic scrolling.
- Parameters:
-
s,: The scrollport to work with v,: The minimum velocity
- Returns:
- Returns no value
Ewl_Kinetic_Scroll ewl_scrollport_kinetic_scrolling_get | ( | Ewl_Scrollport * | s | ) |
Gets the type of kinetic scrolling used.
- Parameters:
-
s,: The scrollport to use
- Returns:
- Returns the type of scrolling used
void ewl_scrollport_kinetic_scrolling_set | ( | Ewl_Scrollport * | s, | |
Ewl_Kinetic_Scroll | type | |||
) |
Sets up default values and callbacks for kinetic scrolling.
- Parameters:
-
s,: The scrollport to setup type,: To use kinetic scrolling or not
- Returns:
- Returns no value
Ewl_Widget* ewl_scrollport_new | ( | void | ) |
Create a new scrollpane.
- Returns:
- Returns a new scrollport on success, NULL on failure
void ewl_scrollport_visible_area_geometry_get | ( | Ewl_Scrollport * | s, | |
int * | x, | |||
int * | y, | |||
int * | w, | |||
int * | h | |||
) |
Gets the geometry of the visible area.
- Parameters:
-
s,: The scrollport to get the geometry from x,: Used to return the x offset y,: Used to return the y offset w,: Used to return the width h,: Used to return the height
- Returns:
- Returns no value
void ewl_scrollport_visible_area_geometry_set | ( | Ewl_Scrollport * | s, | |
int | x, | |||
int | y, | |||
int | w, | |||
int | h | |||
) |
Sets the visible current geometry.
- Parameters:
-
s,: The scrollport to set the visible geometry of x,: The horizontal offset of the visible content y,: The vertical offset of the visible content
- Returns:
- Returns no value
Ewl_Container* ewl_scrollport_visible_area_get | ( | Ewl_Scrollport * | s | ) |
Retrieves the visible area container.
- Parameters:
-
s,: the scrollport to retrieve its visible area container
- Returns:
- Returns the container holding the children added to the scrollport.
Ewl_Scrollport_Flags ewl_scrollport_vscrollbar_flag_get | ( | Ewl_Scrollport * | s | ) |
Get flags for vertical scrollbar.
- Parameters:
-
s,: the scrollport that contains the scrollbar to retrieve
- Returns:
- Returns the flags of the vertical scrollbar on success, 0 on failure.
void ewl_scrollport_vscrollbar_flag_set | ( | Ewl_Scrollport * | s, | |
Ewl_Scrollport_Flags | f | |||
) |
Set flags for vertical scrollbar.
- Parameters:
-
s,: the scrollport that contains the scrollbar to change f,: the flags to set on the vertical scrollbar in s
- Returns:
- Returns no value.
Ewl_Widget* ewl_scrollport_vscrollbar_get | ( | Ewl_Scrollport * | s | ) |
Retrieves the vertical scrollbar.
- Parameters:
-
s,: the scrollport to retrieve the vertical scrollbar from
- Returns:
- Returns the vertical scrollbar
double ewl_scrollport_vscrollbar_step_get | ( | Ewl_Scrollport * | s | ) |
Retrieves the value of the stepping of the vertical scrollbar in s.
- Parameters:
-
s,: the scrollport to retrieve its vertical scrollbar stepping
- Returns:
- Returns the value of the stepping of the vertical scrollbar in s on success.
double ewl_scrollport_vscrollbar_value_get | ( | Ewl_Scrollport * | s | ) |
Retrieves the value of the vertical scrollbar in s.
- Parameters:
-
s,: the scrollport to retrieve it's vertical scrollbar value
- Returns:
- Returns the value of the vertical scrollbar in s on success.
void ewl_scrollport_vscrollbar_value_set | ( | Ewl_Scrollport * | s, | |
double | val | |||
) |
Set the value of the vertical scrollbar in s to val.
- Parameters:
-
s,: the scrollport to set the vertical scrollbar value val,: the value to set the scrollbar too
- Returns:
- Returns nothing
Variable Documentation
int Ewl_Scrollport::area_h [inherited] |
int Ewl_Scrollport::area_w [inherited] |
int Ewl_Scrollport::area_x_offset [inherited] |
int Ewl_Scrollport::area_y_offset [inherited] |
Ewl_Scrollport_Flags Ewl_Scrollport::hflag [inherited] |
Flags for horizontal scrollbar
Ewl_Widget* Ewl_Scrollport::hscrollbar [inherited] |
Horizontal scrollbar
Ewl_Scrollport_Kinetic_Info* Ewl_Scrollport::kinfo [inherited] |
Kinetic scrolling info
Ewl_Kinetic_Scroll Ewl_Scrollport::type [inherited] |
If the scrollport is to use kinetic scrolling
Ewl_Scrollport_Flags Ewl_Scrollport::vflag [inherited] |
Flags for vertical scrollbar
Ewl_Widget* Ewl_Scrollport::visible_area [inherited] |
Clips the enclosed widget
Ewl_Widget* Ewl_Scrollport::vscrollbar [inherited] |
Vertical scrollbar