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

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

void
AnimationsimOptions::initOptions ()
{

    // flyin_direction
    mOptions[AnimationsimOptions::FlyinDirection].setName ("flyin_direction", CompOption::TypeInt);
    mOptions[AnimationsimOptions::FlyinDirection].rest ().set (0, 4);
    mOptions[AnimationsimOptions::FlyinDirection].value().set((int) 0);

    // flyin_direction_x
    mOptions[AnimationsimOptions::FlyinDirectionX].setName ("flyin_direction_x", CompOption::TypeFloat);
    mOptions[AnimationsimOptions::FlyinDirectionX].rest ().set (-1000, 1000, 0.01);
    mOptions[AnimationsimOptions::FlyinDirectionX].value().set((float) 0);

    // flyin_direction_y
    mOptions[AnimationsimOptions::FlyinDirectionY].setName ("flyin_direction_y", CompOption::TypeFloat);
    mOptions[AnimationsimOptions::FlyinDirectionY].rest ().set (-1000, 1000, 0.01);
    mOptions[AnimationsimOptions::FlyinDirectionY].value().set((float) 0);

    // flyin_fade
    mOptions[AnimationsimOptions::FlyinFade].setName ("flyin_fade", CompOption::TypeBool);
    mOptions[AnimationsimOptions::FlyinFade].value().set(true);

    // flyin_distance
    mOptions[AnimationsimOptions::FlyinDistance].setName ("flyin_distance", CompOption::TypeFloat);
    mOptions[AnimationsimOptions::FlyinDistance].rest ().set (5, 1000, 0.01);
    mOptions[AnimationsimOptions::FlyinDistance].value().set((float) 20);

    // rotatein_direction
    mOptions[AnimationsimOptions::RotateinDirection].setName ("rotatein_direction", CompOption::TypeInt);
    mOptions[AnimationsimOptions::RotateinDirection].rest ().set (1, 4);
    mOptions[AnimationsimOptions::RotateinDirection].value().set((int) 3);

    // rotatein_angle
    mOptions[AnimationsimOptions::RotateinAngle].setName ("rotatein_angle", CompOption::TypeFloat);
    mOptions[AnimationsimOptions::RotateinAngle].rest ().set (-720, 720, 0.1f);
    mOptions[AnimationsimOptions::RotateinAngle].value().set((float) 90);

    // bounce_max_size
    mOptions[AnimationsimOptions::BounceMaxSize].setName ("bounce_max_size", CompOption::TypeFloat);
    mOptions[AnimationsimOptions::BounceMaxSize].rest ().set (1.0, 3.0, 0.1f);
    mOptions[AnimationsimOptions::BounceMaxSize].value().set((float) 1.2);

    // bounce_min_size
    mOptions[AnimationsimOptions::BounceMinSize].setName ("bounce_min_size", CompOption::TypeFloat);
    mOptions[AnimationsimOptions::BounceMinSize].rest ().set (0.1, 1.0, 0.1f);
    mOptions[AnimationsimOptions::BounceMinSize].value().set((float) 0.6);

    // bounce_number
    mOptions[AnimationsimOptions::BounceNumber].setName ("bounce_number", CompOption::TypeInt);
    mOptions[AnimationsimOptions::BounceNumber].rest ().set (0, 10);
    mOptions[AnimationsimOptions::BounceNumber].value().set((int) 3);

    // bounce_fade
    mOptions[AnimationsimOptions::BounceFade].setName ("bounce_fade", CompOption::TypeBool);
    mOptions[AnimationsimOptions::BounceFade].value().set(true);

    // sheet_start_percent
    mOptions[AnimationsimOptions::SheetStartPercent].setName ("sheet_start_percent", CompOption::TypeFloat);
    mOptions[AnimationsimOptions::SheetStartPercent].rest ().set (1.0, 150.0, 0.1f);
    mOptions[AnimationsimOptions::SheetStartPercent].value().set((float) 80.0);

    // fan_angle
    mOptions[AnimationsimOptions::FanAngle].setName ("fan_angle", CompOption::TypeFloat);
    mOptions[AnimationsimOptions::FanAngle].rest ().set (0, 90, 0.1);
    mOptions[AnimationsimOptions::FanAngle].value().set((float) 35);

    // expandpw_horiz_first
    mOptions[AnimationsimOptions::ExpandpwHorizFirst].setName ("expandpw_horiz_first", CompOption::TypeBool);
    mOptions[AnimationsimOptions::ExpandpwHorizFirst].value().set(true);

    // expandpw_initial_horiz
    mOptions[AnimationsimOptions::ExpandpwInitialHoriz].setName ("expandpw_initial_horiz", CompOption::TypeInt);
    mOptions[AnimationsimOptions::ExpandpwInitialHoriz].rest ().set (0, 50);
    mOptions[AnimationsimOptions::ExpandpwInitialHoriz].value().set((int) 20);

    // expandpw_initial_vert
    mOptions[AnimationsimOptions::ExpandpwInitialVert].setName ("expandpw_initial_vert", CompOption::TypeInt);
    mOptions[AnimationsimOptions::ExpandpwInitialVert].rest ().set (0, 50);
    mOptions[AnimationsimOptions::ExpandpwInitialVert].value().set((int) 20);

    // expandpw_delay
    mOptions[AnimationsimOptions::ExpandpwDelay].setName ("expandpw_delay", CompOption::TypeFloat);
    mOptions[AnimationsimOptions::ExpandpwDelay].rest ().set (0.0, 1.0, 0.1f);
    mOptions[AnimationsimOptions::ExpandpwDelay].value().set((float) 0.25);

}

AnimationsimOptions::~AnimationsimOptions ()
{
}


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

bool
AnimationsimOptions::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 AnimationsimOptions::FlyinDirection:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::FlyinDirection].empty ())
                    mNotify[AnimationsimOptions::FlyinDirection] (o, AnimationsimOptions::FlyinDirection);
                return true;
            }
            break;
        case AnimationsimOptions::FlyinDirectionX:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::FlyinDirectionX].empty ())
                    mNotify[AnimationsimOptions::FlyinDirectionX] (o, AnimationsimOptions::FlyinDirectionX);
                return true;
            }
            break;
        case AnimationsimOptions::FlyinDirectionY:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::FlyinDirectionY].empty ())
                    mNotify[AnimationsimOptions::FlyinDirectionY] (o, AnimationsimOptions::FlyinDirectionY);
                return true;
            }
            break;
        case AnimationsimOptions::FlyinFade:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::FlyinFade].empty ())
                    mNotify[AnimationsimOptions::FlyinFade] (o, AnimationsimOptions::FlyinFade);
                return true;
            }
            break;
        case AnimationsimOptions::FlyinDistance:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::FlyinDistance].empty ())
                    mNotify[AnimationsimOptions::FlyinDistance] (o, AnimationsimOptions::FlyinDistance);
                return true;
            }
            break;
        case AnimationsimOptions::RotateinDirection:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::RotateinDirection].empty ())
                    mNotify[AnimationsimOptions::RotateinDirection] (o, AnimationsimOptions::RotateinDirection);
                return true;
            }
            break;
        case AnimationsimOptions::RotateinAngle:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::RotateinAngle].empty ())
                    mNotify[AnimationsimOptions::RotateinAngle] (o, AnimationsimOptions::RotateinAngle);
                return true;
            }
            break;
        case AnimationsimOptions::BounceMaxSize:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::BounceMaxSize].empty ())
                    mNotify[AnimationsimOptions::BounceMaxSize] (o, AnimationsimOptions::BounceMaxSize);
                return true;
            }
            break;
        case AnimationsimOptions::BounceMinSize:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::BounceMinSize].empty ())
                    mNotify[AnimationsimOptions::BounceMinSize] (o, AnimationsimOptions::BounceMinSize);
                return true;
            }
            break;
        case AnimationsimOptions::BounceNumber:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::BounceNumber].empty ())
                    mNotify[AnimationsimOptions::BounceNumber] (o, AnimationsimOptions::BounceNumber);
                return true;
            }
            break;
        case AnimationsimOptions::BounceFade:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::BounceFade].empty ())
                    mNotify[AnimationsimOptions::BounceFade] (o, AnimationsimOptions::BounceFade);
                return true;
            }
            break;
        case AnimationsimOptions::SheetStartPercent:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::SheetStartPercent].empty ())
                    mNotify[AnimationsimOptions::SheetStartPercent] (o, AnimationsimOptions::SheetStartPercent);
                return true;
            }
            break;
        case AnimationsimOptions::FanAngle:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::FanAngle].empty ())
                    mNotify[AnimationsimOptions::FanAngle] (o, AnimationsimOptions::FanAngle);
                return true;
            }
            break;
        case AnimationsimOptions::ExpandpwHorizFirst:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::ExpandpwHorizFirst].empty ())
                    mNotify[AnimationsimOptions::ExpandpwHorizFirst] (o, AnimationsimOptions::ExpandpwHorizFirst);
                return true;
            }
            break;
        case AnimationsimOptions::ExpandpwInitialHoriz:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::ExpandpwInitialHoriz].empty ())
                    mNotify[AnimationsimOptions::ExpandpwInitialHoriz] (o, AnimationsimOptions::ExpandpwInitialHoriz);
                return true;
            }
            break;
        case AnimationsimOptions::ExpandpwInitialVert:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::ExpandpwInitialVert].empty ())
                    mNotify[AnimationsimOptions::ExpandpwInitialVert] (o, AnimationsimOptions::ExpandpwInitialVert);
                return true;
            }
            break;
        case AnimationsimOptions::ExpandpwDelay:
            if (o->set (value))
            {
                if (!mNotify[AnimationsimOptions::ExpandpwDelay].empty ())
                    mNotify[AnimationsimOptions::ExpandpwDelay] (o, AnimationsimOptions::ExpandpwDelay);
                return true;
            }
            break;
        default:
            break;
    }
    return false;

}

