Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions
CairoSlider Class Reference

#include <CairoSlider.hh>

Inheritance diagram for CairoSlider:
[legend]
Collaboration diagram for CairoSlider:
[legend]

Public Member Functions

 CairoSlider ()
 ~CairoSlider ()

Protected Member Functions

virtual bool on_draw (const Cairo::RefPtr< Cairo::Context > &cr)=0
 Override to draw the widget.
int get_border ()
 Returns the current position of the slider.
double get_percentage ()
 Get the current percentage shown in the slider.
void set_percentage (double p)
 Set the slider to p and redraw.
virtual void on_percent_change ()=0
 Called whenever the percentage changes.
virtual double get_update_timeout ()
 Only allows updates every <x.xx> seconds.
virtual Gdk::RGBA & get_active_color ()
 Get the active color of the slider.
virtual Gdk::RGBA & get_inactive_color ()
 Get the inactive color of the slider.

Detailed Description

Definition at line 7 of file CairoSlider.hh.


Constructor & Destructor Documentation


Member Function Documentation

virtual Gdk::RGBA& CairoSlider::get_active_color ( ) [protected, virtual]

Get the active color of the slider.

Returns:
a non-null Gdk::RGBA instance
int CairoSlider::get_border ( ) [protected]

Returns the current position of the slider.

This is useful in on_draw(), you shouldn't calculate the percentage value from this though

Returns:
integer between 0 and allocation.get_width()
virtual Gdk::RGBA& CairoSlider::get_inactive_color ( ) [protected, virtual]

Get the inactive color of the slider.

Returns:
a non-null Gdk::RGBA instance
double CairoSlider::get_percentage ( ) [protected]

Get the current percentage shown in the slider.

Returns:
a double from 0.0 to 100.0
virtual double CairoSlider::get_update_timeout ( ) [inline, protected, virtual]

Only allows updates every <x.xx> seconds.

Definition at line 62 of file CairoSlider.hh.

virtual bool CairoSlider::on_draw ( const Cairo::RefPtr< Cairo::Context > &  cr) [protected, pure virtual]

Override to draw the widget.

on_draw() is always called when the widget needs to be redrawn, therefore all drawing logic should happen here, possibly in a optimized way.

See also: http://developer.gnome.org/gtkmm-tutorial/3.0/chapter-drawingarea.html

Parameters:
cra Cairo::Context
Returns:
true if everything is handeled, false to let other callbacks be called

Implemented in GManager::VolumeSlider.

virtual void CairoSlider::on_percent_change ( ) [protected, pure virtual]

Called whenever the percentage changes.

Implemented in GManager::VolumeSlider.

void CairoSlider::set_percentage ( double  p) [protected]

Set the slider to p and redraw.

Parameters:
pa double between 0.0 and 100.0

The documentation for this class was generated from the following file: