/*
 * This file is autogenerated with bcop:
 * The Compiz option code generator
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */


#include <core/core.h>

#include "animationjc_options.h"

AnimationjcOptions::AnimationjcOptions (bool init /* = true */) :
    mOptions (AnimationjcOptions::OptionNum),
    mNotify (AnimationjcOptions::OptionNum)
{
    if (init)
        initOptions ();
}

void
AnimationjcOptions::initOptions ()
{

    // blackhole_delay
    mOptions[AnimationjcOptions::BlackholeDelay].setName ("blackhole_delay", CompOption::TypeFloat);
    mOptions[AnimationjcOptions::BlackholeDelay].rest ().set (0.0, 0.99, 0.01);
    mOptions[AnimationjcOptions::BlackholeDelay].value().set((float) 0.75);

    // flicker_amplitude
    mOptions[AnimationjcOptions::FlickerAmplitude].setName ("flicker_amplitude", CompOption::TypeInt);
    mOptions[AnimationjcOptions::FlickerAmplitude].rest ().set (1, 10);
    mOptions[AnimationjcOptions::FlickerAmplitude].value().set((int) 3);

    // ghost_grid
    mOptions[AnimationjcOptions::GhostGrid].setName ("ghost_grid", CompOption::TypeInt);
    mOptions[AnimationjcOptions::GhostGrid].rest ().set (2, 20);
    mOptions[AnimationjcOptions::GhostGrid].value().set((int) 20);

    // ghost_saturation
    mOptions[AnimationjcOptions::GhostSaturation].setName ("ghost_saturation", CompOption::TypeFloat);
    mOptions[AnimationjcOptions::GhostSaturation].rest ().set (0.0, 1.0, 0.1);
    mOptions[AnimationjcOptions::GhostSaturation].value().set((float) 0.0);

    // ghost_amplitude
    mOptions[AnimationjcOptions::GhostAmplitude].setName ("ghost_amplitude", CompOption::TypeFloat);
    mOptions[AnimationjcOptions::GhostAmplitude].rest ().set (0.0, 5.0, 0.1f);
    mOptions[AnimationjcOptions::GhostAmplitude].value().set((float) 1.0);

    // ghost_wave_speed
    mOptions[AnimationjcOptions::GhostWaveSpeed].setName ("ghost_wave_speed", CompOption::TypeFloat);
    mOptions[AnimationjcOptions::GhostWaveSpeed].rest ().set (0.0, 5.0, 0.1f);
    mOptions[AnimationjcOptions::GhostWaveSpeed].value().set((float) 1.0);

    // popcorn_kernel_height
    mOptions[AnimationjcOptions::PopcornKernelHeight].setName ("popcorn_kernel_height", CompOption::TypeFloat);
    mOptions[AnimationjcOptions::PopcornKernelHeight].rest ().set (0.0, 5.0, 0.1);
    mOptions[AnimationjcOptions::PopcornKernelHeight].value().set((float) 1.0);

    // raindrop_amplitude
    mOptions[AnimationjcOptions::RaindropAmplitude].setName ("raindrop_amplitude", CompOption::TypeFloat);
    mOptions[AnimationjcOptions::RaindropAmplitude].rest ().set (-5.0, 5.0, 0.1);
    mOptions[AnimationjcOptions::RaindropAmplitude].value().set((float) 1.0);

    // raindrop_wavelength
    mOptions[AnimationjcOptions::RaindropWavelength].setName ("raindrop_wavelength", CompOption::TypeFloat);
    mOptions[AnimationjcOptions::RaindropWavelength].rest ().set (0.0, 1.0, 0.05);
    mOptions[AnimationjcOptions::RaindropWavelength].value().set((float) 0.4);

    // raindrop_num_waves
    mOptions[AnimationjcOptions::RaindropNumWaves].setName ("raindrop_num_waves", CompOption::TypeInt);
    mOptions[AnimationjcOptions::RaindropNumWaves].rest ().set (1, 5);
    mOptions[AnimationjcOptions::RaindropNumWaves].value().set((int) 1);

}

AnimationjcOptions::~AnimationjcOptions ()
{
}


CompOption::Vector &
AnimationjcOptions::getOptions ()
{
    return mOptions;
}

bool
AnimationjcOptions::setOption (const CompString &name, CompOption::Value &value)
{
    CompOption   *o;
    unsigned int index;

    o = CompOption::findOption (mOptions, name, &index);

    if (!o)
        return false;

    switch (index)
    {
        case AnimationjcOptions::BlackholeDelay:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::BlackholeDelay].empty ())
                    mNotify[AnimationjcOptions::BlackholeDelay] (o, AnimationjcOptions::BlackholeDelay);
                return true;
            }
            break;
        case AnimationjcOptions::FlickerAmplitude:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::FlickerAmplitude].empty ())
                    mNotify[AnimationjcOptions::FlickerAmplitude] (o, AnimationjcOptions::FlickerAmplitude);
                return true;
            }
            break;
        case AnimationjcOptions::GhostGrid:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::GhostGrid].empty ())
                    mNotify[AnimationjcOptions::GhostGrid] (o, AnimationjcOptions::GhostGrid);
                return true;
            }
            break;
        case AnimationjcOptions::GhostSaturation:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::GhostSaturation].empty ())
                    mNotify[AnimationjcOptions::GhostSaturation] (o, AnimationjcOptions::GhostSaturation);
                return true;
            }
            break;
        case AnimationjcOptions::GhostAmplitude:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::GhostAmplitude].empty ())
                    mNotify[AnimationjcOptions::GhostAmplitude] (o, AnimationjcOptions::GhostAmplitude);
                return true;
            }
            break;
        case AnimationjcOptions::GhostWaveSpeed:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::GhostWaveSpeed].empty ())
                    mNotify[AnimationjcOptions::GhostWaveSpeed] (o, AnimationjcOptions::GhostWaveSpeed);
                return true;
            }
            break;
        case AnimationjcOptions::PopcornKernelHeight:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::PopcornKernelHeight].empty ())
                    mNotify[AnimationjcOptions::PopcornKernelHeight] (o, AnimationjcOptions::PopcornKernelHeight);
                return true;
            }
            break;
        case AnimationjcOptions::RaindropAmplitude:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::RaindropAmplitude].empty ())
                    mNotify[AnimationjcOptions::RaindropAmplitude] (o, AnimationjcOptions::RaindropAmplitude);
                return true;
            }
            break;
        case AnimationjcOptions::RaindropWavelength:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::RaindropWavelength].empty ())
                    mNotify[AnimationjcOptions::RaindropWavelength] (o, AnimationjcOptions::RaindropWavelength);
                return true;
            }
            break;
        case AnimationjcOptions::RaindropNumWaves:
            if (o->set (value))
            {
                if (!mNotify[AnimationjcOptions::RaindropNumWaves].empty ())
                    mNotify[AnimationjcOptions::RaindropNumWaves] (o, AnimationjcOptions::RaindropNumWaves);
                return true;
            }
            break;
        default:
            break;
    }
    return false;

}

