Back to index

unity  6.0.0
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
unity::ui::Decaymulator Class Reference

#include <Decaymulator.h>

Collaboration diagram for unity::ui::Decaymulator:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::shared_ptr
< Decaymulator
Ptr

Public Member Functions

 Decaymulator ()

Public Attributes

nux::Property< int > rate_of_decay
nux::Property< int > value

Private Member Functions

void OnValueChanged (int value)
bool OnDecayTimeout ()

Private Attributes

glib::Source::UniquePtr decay_timer_

Detailed Description

Definition at line 31 of file Decaymulator.h.


Member Typedef Documentation

typedef std::shared_ptr<Decaymulator> unity::ui::Decaymulator::Ptr

Definition at line 34 of file Decaymulator.h.


Constructor & Destructor Documentation

Definition at line 25 of file Decaymulator.cpp.

{
  value.changed.connect(sigc::mem_fun(this, &Decaymulator::OnValueChanged));
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 38 of file Decaymulator.cpp.

{
  int partial_decay = rate_of_decay / 100;

  if (value <= partial_decay)
  {
    value = 0;
    decay_timer_.reset();
    return false;
  }

  value = value - partial_decay;
  return true;
}

Here is the caller graph for this function:

void unity::ui::Decaymulator::OnValueChanged ( int  value) [private]

Definition at line 30 of file Decaymulator.cpp.

{
  if (!decay_timer_ && value > 0)
  {
    decay_timer_.reset(new glib::Timeout(10, sigc::mem_fun(this, &Decaymulator::OnDecayTimeout)));
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 45 of file Decaymulator.h.

Definition at line 36 of file Decaymulator.h.

nux::Property<int> unity::ui::Decaymulator::value

Definition at line 37 of file Decaymulator.h.


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