/*
 * 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 "animationaddon_options.h"

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

void
AnimationaddonOptions::initOptions ()
{
    unsigned short color[4];

    // time_step_intense
    mOptions[AnimationaddonOptions::TimeStepIntense].setName ("time_step_intense", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::TimeStepIntense].rest ().set (1, 400);
    mOptions[AnimationaddonOptions::TimeStepIntense].value().set((int) 30);

    // airplane_path_length
    mOptions[AnimationaddonOptions::AirplanePathLength].setName ("airplane_path_length", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::AirplanePathLength].rest ().set (0.5, 3, 0.1);
    mOptions[AnimationaddonOptions::AirplanePathLength].value().set((float) 1);

    // airplane_fly_to_taskbar
    mOptions[AnimationaddonOptions::AirplaneFlyToTaskbar].setName ("airplane_fly_to_taskbar", CompOption::TypeBool);
    mOptions[AnimationaddonOptions::AirplaneFlyToTaskbar].value().set(true);

    // beam_size
    mOptions[AnimationaddonOptions::BeamSize].setName ("beam_size", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::BeamSize].rest ().set (0.1, 20, 0.1);
    mOptions[AnimationaddonOptions::BeamSize].value().set((float) 8);

    // beam_spacing
    mOptions[AnimationaddonOptions::BeamSpacing].setName ("beam_spacing", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::BeamSpacing].rest ().set (1, 20);
    mOptions[AnimationaddonOptions::BeamSpacing].value().set((int) 5);

    // beam_color
    mOptions[AnimationaddonOptions::BeamColor].setName ("beam_color", CompOption::TypeColor);
    color[0] = MAX (0, MIN (0xffff, 0x7fff));
    color[1] = MAX (0, MIN (0xffff, 0x7fff));
    color[2] = MAX (0, MIN (0xffff, 0x7fff));
    color[3] = MAX (0, MIN (0xffff, 0xffff));
    mOptions[AnimationaddonOptions::BeamColor].value().set(color);

    // beam_slowdown
    mOptions[AnimationaddonOptions::BeamSlowdown].setName ("beam_slowdown", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::BeamSlowdown].rest ().set (0.1, 10, 0.1);
    mOptions[AnimationaddonOptions::BeamSlowdown].value().set((float) 1);

    // beam_life
    mOptions[AnimationaddonOptions::BeamLife].setName ("beam_life", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::BeamLife].rest ().set (0.1, 1, 0.1);
    mOptions[AnimationaddonOptions::BeamLife].value().set((float) 0.7);

    // fire_particles
    mOptions[AnimationaddonOptions::FireParticles].setName ("fire_particles", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::FireParticles].rest ().set (100, 10000);
    mOptions[AnimationaddonOptions::FireParticles].value().set((int) 1000);

    // fire_size
    mOptions[AnimationaddonOptions::FireSize].setName ("fire_size", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::FireSize].rest ().set (0.1, 20, 0.1);
    mOptions[AnimationaddonOptions::FireSize].value().set((float) 5);

    // fire_slowdown
    mOptions[AnimationaddonOptions::FireSlowdown].setName ("fire_slowdown", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::FireSlowdown].rest ().set (0.1, 10, 0.1);
    mOptions[AnimationaddonOptions::FireSlowdown].value().set((float) 0.5);

    // fire_life
    mOptions[AnimationaddonOptions::FireLife].setName ("fire_life", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::FireLife].rest ().set (0.1, 1, 0.1);
    mOptions[AnimationaddonOptions::FireLife].value().set((float) 0.7);

    // fire_color
    mOptions[AnimationaddonOptions::FireColor].setName ("fire_color", CompOption::TypeColor);
    color[0] = MAX (0, MIN (0xffff, 0xffff));
    color[1] = MAX (0, MIN (0xffff, 0x3333));
    color[2] = MAX (0, MIN (0xffff, 0x0555));
    color[3] = MAX (0, MIN (0xffff, 0xffff));
    mOptions[AnimationaddonOptions::FireColor].value().set(color);

    // fire_direction
    mOptions[AnimationaddonOptions::FireDirection].setName ("fire_direction", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::FireDirection].rest ().set (0, 5);
    mOptions[AnimationaddonOptions::FireDirection].value().set((int) 0);

    // fire_constant_speed
    mOptions[AnimationaddonOptions::FireConstantSpeed].setName ("fire_constant_speed", CompOption::TypeBool);
    mOptions[AnimationaddonOptions::FireConstantSpeed].value().set(false);

    // fire_smoke
    mOptions[AnimationaddonOptions::FireSmoke].setName ("fire_smoke", CompOption::TypeBool);
    mOptions[AnimationaddonOptions::FireSmoke].value().set(false);

    // fire_mystical
    mOptions[AnimationaddonOptions::FireMystical].setName ("fire_mystical", CompOption::TypeBool);
    mOptions[AnimationaddonOptions::FireMystical].value().set(false);

    // domino_direction
    mOptions[AnimationaddonOptions::DominoDirection].setName ("domino_direction", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::DominoDirection].rest ().set (0, 5);
    mOptions[AnimationaddonOptions::DominoDirection].value().set((int) 5);

    // explode_gridx
    mOptions[AnimationaddonOptions::ExplodeGridx].setName ("explode_gridx", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::ExplodeGridx].rest ().set (1, 200);
    mOptions[AnimationaddonOptions::ExplodeGridx].value().set((int) 13);

    // explode_gridy
    mOptions[AnimationaddonOptions::ExplodeGridy].setName ("explode_gridy", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::ExplodeGridy].rest ().set (1, 200);
    mOptions[AnimationaddonOptions::ExplodeGridy].value().set((int) 10);

    // explode_spokes
    mOptions[AnimationaddonOptions::ExplodeSpokes].setName ("explode_spokes", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::ExplodeSpokes].rest ().set (1, 100);
    mOptions[AnimationaddonOptions::ExplodeSpokes].value().set((int) 2);

    // explode_tiers
    mOptions[AnimationaddonOptions::ExplodeTiers].setName ("explode_tiers", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::ExplodeTiers].rest ().set (1, 100);
    mOptions[AnimationaddonOptions::ExplodeTiers].value().set((int) 3);

    // explode_thickness
    mOptions[AnimationaddonOptions::ExplodeThickness].setName ("explode_thickness", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::ExplodeThickness].rest ().set (0, 100, 1);
    mOptions[AnimationaddonOptions::ExplodeThickness].value().set((float) 15);

    // explode_tessellation
    mOptions[AnimationaddonOptions::ExplodeTessellation].setName ("explode_tessellation", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::ExplodeTessellation].rest ().set (0, 2);
    mOptions[AnimationaddonOptions::ExplodeTessellation].value().set((int) 0);

    // fold_gridx
    mOptions[AnimationaddonOptions::FoldGridx].setName ("fold_gridx", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::FoldGridx].rest ().set (1, 100);
    mOptions[AnimationaddonOptions::FoldGridx].value().set((int) 3);

    // fold_gridy
    mOptions[AnimationaddonOptions::FoldGridy].setName ("fold_gridy", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::FoldGridy].rest ().set (1, 100);
    mOptions[AnimationaddonOptions::FoldGridy].value().set((int) 3);

    // fold_dir
    mOptions[AnimationaddonOptions::FoldDir].setName ("fold_dir", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::FoldDir].rest ().set (0, 1);
    mOptions[AnimationaddonOptions::FoldDir].value().set((int) 1);

    // glide3_away_position
    mOptions[AnimationaddonOptions::Glide3AwayPosition].setName ("glide3_away_position", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::Glide3AwayPosition].rest ().set (-2, 1, 0.05);
    mOptions[AnimationaddonOptions::Glide3AwayPosition].value().set((float) -0.4);

    // glide3_away_angle
    mOptions[AnimationaddonOptions::Glide3AwayAngle].setName ("glide3_away_angle", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::Glide3AwayAngle].rest ().set (-540, 540, 5);
    mOptions[AnimationaddonOptions::Glide3AwayAngle].value().set((float) 45);

    // glide3_thickness
    mOptions[AnimationaddonOptions::Glide3Thickness].setName ("glide3_thickness", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::Glide3Thickness].rest ().set (0, 100, 1);
    mOptions[AnimationaddonOptions::Glide3Thickness].value().set((float) 0);

    // razr_direction
    mOptions[AnimationaddonOptions::RazrDirection].setName ("razr_direction", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::RazrDirection].rest ().set (0, 5);
    mOptions[AnimationaddonOptions::RazrDirection].value().set((int) 5);

    // skewer_direction
    mOptions[AnimationaddonOptions::SkewerDirection].setName ("skewer_direction", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::SkewerDirection].rest ().set (0, 9);
    mOptions[AnimationaddonOptions::SkewerDirection].value().set((int) 8);

    // skewer_tessellation
    mOptions[AnimationaddonOptions::SkewerTessellation].setName ("skewer_tessellation", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::SkewerTessellation].rest ().set (0, 1);
    mOptions[AnimationaddonOptions::SkewerTessellation].value().set((int) 0);

    // skewer_gridx
    mOptions[AnimationaddonOptions::SkewerGridx].setName ("skewer_gridx", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::SkewerGridx].rest ().set (1, 100);
    mOptions[AnimationaddonOptions::SkewerGridx].value().set((int) 6);

    // skewer_gridy
    mOptions[AnimationaddonOptions::SkewerGridy].setName ("skewer_gridy", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::SkewerGridy].rest ().set (1, 100);
    mOptions[AnimationaddonOptions::SkewerGridy].value().set((int) 4);

    // skewer_thickness
    mOptions[AnimationaddonOptions::SkewerThickness].setName ("skewer_thickness", CompOption::TypeFloat);
    mOptions[AnimationaddonOptions::SkewerThickness].rest ().set (0, 100, 1);
    mOptions[AnimationaddonOptions::SkewerThickness].value().set((float) 0);

    // skewer_rotation
    mOptions[AnimationaddonOptions::SkewerRotation].setName ("skewer_rotation", CompOption::TypeInt);
    mOptions[AnimationaddonOptions::SkewerRotation].rest ().set (-720, 720);
    mOptions[AnimationaddonOptions::SkewerRotation].value().set((int) 0);

}

AnimationaddonOptions::~AnimationaddonOptions ()
{
}


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

bool
AnimationaddonOptions::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 AnimationaddonOptions::TimeStepIntense:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::TimeStepIntense].empty ())
                    mNotify[AnimationaddonOptions::TimeStepIntense] (o, AnimationaddonOptions::TimeStepIntense);
                return true;
            }
            break;
        case AnimationaddonOptions::AirplanePathLength:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::AirplanePathLength].empty ())
                    mNotify[AnimationaddonOptions::AirplanePathLength] (o, AnimationaddonOptions::AirplanePathLength);
                return true;
            }
            break;
        case AnimationaddonOptions::AirplaneFlyToTaskbar:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::AirplaneFlyToTaskbar].empty ())
                    mNotify[AnimationaddonOptions::AirplaneFlyToTaskbar] (o, AnimationaddonOptions::AirplaneFlyToTaskbar);
                return true;
            }
            break;
        case AnimationaddonOptions::BeamSize:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::BeamSize].empty ())
                    mNotify[AnimationaddonOptions::BeamSize] (o, AnimationaddonOptions::BeamSize);
                return true;
            }
            break;
        case AnimationaddonOptions::BeamSpacing:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::BeamSpacing].empty ())
                    mNotify[AnimationaddonOptions::BeamSpacing] (o, AnimationaddonOptions::BeamSpacing);
                return true;
            }
            break;
        case AnimationaddonOptions::BeamColor:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::BeamColor].empty ())
                    mNotify[AnimationaddonOptions::BeamColor] (o, AnimationaddonOptions::BeamColor);
                return true;
            }
            break;
        case AnimationaddonOptions::BeamSlowdown:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::BeamSlowdown].empty ())
                    mNotify[AnimationaddonOptions::BeamSlowdown] (o, AnimationaddonOptions::BeamSlowdown);
                return true;
            }
            break;
        case AnimationaddonOptions::BeamLife:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::BeamLife].empty ())
                    mNotify[AnimationaddonOptions::BeamLife] (o, AnimationaddonOptions::BeamLife);
                return true;
            }
            break;
        case AnimationaddonOptions::FireParticles:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FireParticles].empty ())
                    mNotify[AnimationaddonOptions::FireParticles] (o, AnimationaddonOptions::FireParticles);
                return true;
            }
            break;
        case AnimationaddonOptions::FireSize:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FireSize].empty ())
                    mNotify[AnimationaddonOptions::FireSize] (o, AnimationaddonOptions::FireSize);
                return true;
            }
            break;
        case AnimationaddonOptions::FireSlowdown:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FireSlowdown].empty ())
                    mNotify[AnimationaddonOptions::FireSlowdown] (o, AnimationaddonOptions::FireSlowdown);
                return true;
            }
            break;
        case AnimationaddonOptions::FireLife:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FireLife].empty ())
                    mNotify[AnimationaddonOptions::FireLife] (o, AnimationaddonOptions::FireLife);
                return true;
            }
            break;
        case AnimationaddonOptions::FireColor:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FireColor].empty ())
                    mNotify[AnimationaddonOptions::FireColor] (o, AnimationaddonOptions::FireColor);
                return true;
            }
            break;
        case AnimationaddonOptions::FireDirection:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FireDirection].empty ())
                    mNotify[AnimationaddonOptions::FireDirection] (o, AnimationaddonOptions::FireDirection);
                return true;
            }
            break;
        case AnimationaddonOptions::FireConstantSpeed:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FireConstantSpeed].empty ())
                    mNotify[AnimationaddonOptions::FireConstantSpeed] (o, AnimationaddonOptions::FireConstantSpeed);
                return true;
            }
            break;
        case AnimationaddonOptions::FireSmoke:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FireSmoke].empty ())
                    mNotify[AnimationaddonOptions::FireSmoke] (o, AnimationaddonOptions::FireSmoke);
                return true;
            }
            break;
        case AnimationaddonOptions::FireMystical:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FireMystical].empty ())
                    mNotify[AnimationaddonOptions::FireMystical] (o, AnimationaddonOptions::FireMystical);
                return true;
            }
            break;
        case AnimationaddonOptions::DominoDirection:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::DominoDirection].empty ())
                    mNotify[AnimationaddonOptions::DominoDirection] (o, AnimationaddonOptions::DominoDirection);
                return true;
            }
            break;
        case AnimationaddonOptions::ExplodeGridx:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::ExplodeGridx].empty ())
                    mNotify[AnimationaddonOptions::ExplodeGridx] (o, AnimationaddonOptions::ExplodeGridx);
                return true;
            }
            break;
        case AnimationaddonOptions::ExplodeGridy:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::ExplodeGridy].empty ())
                    mNotify[AnimationaddonOptions::ExplodeGridy] (o, AnimationaddonOptions::ExplodeGridy);
                return true;
            }
            break;
        case AnimationaddonOptions::ExplodeSpokes:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::ExplodeSpokes].empty ())
                    mNotify[AnimationaddonOptions::ExplodeSpokes] (o, AnimationaddonOptions::ExplodeSpokes);
                return true;
            }
            break;
        case AnimationaddonOptions::ExplodeTiers:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::ExplodeTiers].empty ())
                    mNotify[AnimationaddonOptions::ExplodeTiers] (o, AnimationaddonOptions::ExplodeTiers);
                return true;
            }
            break;
        case AnimationaddonOptions::ExplodeThickness:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::ExplodeThickness].empty ())
                    mNotify[AnimationaddonOptions::ExplodeThickness] (o, AnimationaddonOptions::ExplodeThickness);
                return true;
            }
            break;
        case AnimationaddonOptions::ExplodeTessellation:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::ExplodeTessellation].empty ())
                    mNotify[AnimationaddonOptions::ExplodeTessellation] (o, AnimationaddonOptions::ExplodeTessellation);
                return true;
            }
            break;
        case AnimationaddonOptions::FoldGridx:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FoldGridx].empty ())
                    mNotify[AnimationaddonOptions::FoldGridx] (o, AnimationaddonOptions::FoldGridx);
                return true;
            }
            break;
        case AnimationaddonOptions::FoldGridy:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FoldGridy].empty ())
                    mNotify[AnimationaddonOptions::FoldGridy] (o, AnimationaddonOptions::FoldGridy);
                return true;
            }
            break;
        case AnimationaddonOptions::FoldDir:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::FoldDir].empty ())
                    mNotify[AnimationaddonOptions::FoldDir] (o, AnimationaddonOptions::FoldDir);
                return true;
            }
            break;
        case AnimationaddonOptions::Glide3AwayPosition:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::Glide3AwayPosition].empty ())
                    mNotify[AnimationaddonOptions::Glide3AwayPosition] (o, AnimationaddonOptions::Glide3AwayPosition);
                return true;
            }
            break;
        case AnimationaddonOptions::Glide3AwayAngle:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::Glide3AwayAngle].empty ())
                    mNotify[AnimationaddonOptions::Glide3AwayAngle] (o, AnimationaddonOptions::Glide3AwayAngle);
                return true;
            }
            break;
        case AnimationaddonOptions::Glide3Thickness:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::Glide3Thickness].empty ())
                    mNotify[AnimationaddonOptions::Glide3Thickness] (o, AnimationaddonOptions::Glide3Thickness);
                return true;
            }
            break;
        case AnimationaddonOptions::RazrDirection:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::RazrDirection].empty ())
                    mNotify[AnimationaddonOptions::RazrDirection] (o, AnimationaddonOptions::RazrDirection);
                return true;
            }
            break;
        case AnimationaddonOptions::SkewerDirection:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::SkewerDirection].empty ())
                    mNotify[AnimationaddonOptions::SkewerDirection] (o, AnimationaddonOptions::SkewerDirection);
                return true;
            }
            break;
        case AnimationaddonOptions::SkewerTessellation:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::SkewerTessellation].empty ())
                    mNotify[AnimationaddonOptions::SkewerTessellation] (o, AnimationaddonOptions::SkewerTessellation);
                return true;
            }
            break;
        case AnimationaddonOptions::SkewerGridx:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::SkewerGridx].empty ())
                    mNotify[AnimationaddonOptions::SkewerGridx] (o, AnimationaddonOptions::SkewerGridx);
                return true;
            }
            break;
        case AnimationaddonOptions::SkewerGridy:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::SkewerGridy].empty ())
                    mNotify[AnimationaddonOptions::SkewerGridy] (o, AnimationaddonOptions::SkewerGridy);
                return true;
            }
            break;
        case AnimationaddonOptions::SkewerThickness:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::SkewerThickness].empty ())
                    mNotify[AnimationaddonOptions::SkewerThickness] (o, AnimationaddonOptions::SkewerThickness);
                return true;
            }
            break;
        case AnimationaddonOptions::SkewerRotation:
            if (o->set (value))
            {
                if (!mNotify[AnimationaddonOptions::SkewerRotation].empty ())
                    mNotify[AnimationaddonOptions::SkewerRotation] (o, AnimationaddonOptions::SkewerRotation);
                return true;
            }
            break;
        default:
            break;
    }
    return false;

}

