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

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

void
ImgsvgOptions::initOptions ()
{
    unsigned int state;
    CompAction action;

    // set
    mOptions[ImgsvgOptions::Set].setName ("set", CompOption::TypeAction);
    state = CompAction::StateAutoGrab;
    mOptions[ImgsvgOptions::Set].value().set(CompAction ());
    mOptions[ImgsvgOptions::Set].value().action ().setState (state);

}

ImgsvgOptions::~ImgsvgOptions ()
{
}


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

bool
ImgsvgOptions::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 ImgsvgOptions::Set:
            if (o->set (value))
            {
                if (!mNotify[ImgsvgOptions::Set].empty ())
                    mNotify[ImgsvgOptions::Set] (o, ImgsvgOptions::Set);
                return true;
            }
            break;
        default:
            break;
    }
    return false;

}

