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

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

void
EzoomOptions::initOptions ()
{
    unsigned int state;
    CompAction action;
    unsigned short color[4];

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

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

    // zoom_in_button
    mOptions[EzoomOptions::ZoomInButton].setName ("zoom_in_button", CompOption::TypeButton);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitButton);
    action.buttonFromString ("<Super>Button4");
    mOptions[EzoomOptions::ZoomInButton].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomInButton].value ().action ());

    // zoom_in_key
    mOptions[EzoomOptions::ZoomInKey].setName ("zoom_in_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomInKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomInKey].value ().action ());

    // zoom_out_button
    mOptions[EzoomOptions::ZoomOutButton].setName ("zoom_out_button", CompOption::TypeButton);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitButton);
    action.buttonFromString ("<Super>Button5");
    mOptions[EzoomOptions::ZoomOutButton].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomOutButton].value ().action ());

    // zoom_out_key
    mOptions[EzoomOptions::ZoomOutKey].setName ("zoom_out_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomOutKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomOutKey].value ().action ());

    // zoom_box_button
    mOptions[EzoomOptions::ZoomBoxButton].setName ("zoom_box_button", CompOption::TypeButton);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitButton);
    action.buttonFromString ("<Super>Button2");
    mOptions[EzoomOptions::ZoomBoxButton].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomBoxButton].value ().action ());

    // zoom_box_outline_color
    mOptions[EzoomOptions::ZoomBoxOutlineColor].setName ("zoom_box_outline_color", CompOption::TypeColor);
    color[0] = MAX (0, MIN (0xffff, 0x2fff));
    color[1] = MAX (0, MIN (0xffff, 0x2fff));
    color[2] = MAX (0, MIN (0xffff, 0x4fff));
    color[3] = MAX (0, MIN (0xffff, 0x9fff));
    mOptions[EzoomOptions::ZoomBoxOutlineColor].value().set(color);

    // zoom_box_fill_color
    mOptions[EzoomOptions::ZoomBoxFillColor].setName ("zoom_box_fill_color", CompOption::TypeColor);
    color[0] = MAX (0, MIN (0xffff, 0x2fff));
    color[1] = MAX (0, MIN (0xffff, 0x2fff));
    color[2] = MAX (0, MIN (0xffff, 0x2fff));
    color[3] = MAX (0, MIN (0xffff, 0x4fff));
    mOptions[EzoomOptions::ZoomBoxFillColor].value().set(color);

    // zoom_smoothing
    mOptions[EzoomOptions::ZoomSmoothing].setName ("zoom_smoothing", CompOption::TypeInt);
    mOptions[EzoomOptions::ZoomSmoothing].rest ().set (0, 1);
    mOptions[EzoomOptions::ZoomSmoothing].value().set((int) 1);

    // center_mouse_key
    mOptions[EzoomOptions::CenterMouseKey].setName ("center_mouse_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::CenterMouseKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::CenterMouseKey].value ().action ());

    // spec_target_focus
    mOptions[EzoomOptions::SpecTargetFocus].setName ("spec_target_focus", CompOption::TypeBool);
    mOptions[EzoomOptions::SpecTargetFocus].value().set(false);

    // zoom_specific_1
    mOptions[EzoomOptions::ZoomSpecific1].setName ("zoom_specific_1", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific1].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific1].value().set((float) 1.0);

    // zoom_specific_1_key
    mOptions[EzoomOptions::ZoomSpecific1Key].setName ("zoom_specific_1_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific1Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific1Key].value ().action ());

    // zoom_specific_2
    mOptions[EzoomOptions::ZoomSpecific2].setName ("zoom_specific_2", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific2].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific2].value().set((float) 1.0);

    // zoom_specific_2_key
    mOptions[EzoomOptions::ZoomSpecific2Key].setName ("zoom_specific_2_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific2Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific2Key].value ().action ());

    // zoom_specific_3
    mOptions[EzoomOptions::ZoomSpecific3].setName ("zoom_specific_3", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific3].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific3].value().set((float) 1.0);

    // zoom_specific_3_key
    mOptions[EzoomOptions::ZoomSpecific3Key].setName ("zoom_specific_3_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific3Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific3Key].value ().action ());

    // zoom_specific_4
    mOptions[EzoomOptions::ZoomSpecific4].setName ("zoom_specific_4", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific4].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific4].value().set((float) 1.0);

    // zoom_specific_4_key
    mOptions[EzoomOptions::ZoomSpecific4Key].setName ("zoom_specific_4_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific4Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific4Key].value ().action ());

    // zoom_specific_5
    mOptions[EzoomOptions::ZoomSpecific5].setName ("zoom_specific_5", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific5].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific5].value().set((float) 1.0);

    // zoom_specific_5_key
    mOptions[EzoomOptions::ZoomSpecific5Key].setName ("zoom_specific_5_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific5Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific5Key].value ().action ());

    // zoom_specific_6
    mOptions[EzoomOptions::ZoomSpecific6].setName ("zoom_specific_6", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific6].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific6].value().set((float) 1.0);

    // zoom_specific_6_key
    mOptions[EzoomOptions::ZoomSpecific6Key].setName ("zoom_specific_6_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific6Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific6Key].value ().action ());

    // zoom_specific_7
    mOptions[EzoomOptions::ZoomSpecific7].setName ("zoom_specific_7", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific7].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific7].value().set((float) 1.0);

    // zoom_specific_7_key
    mOptions[EzoomOptions::ZoomSpecific7Key].setName ("zoom_specific_7_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific7Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific7Key].value ().action ());

    // zoom_specific_8
    mOptions[EzoomOptions::ZoomSpecific8].setName ("zoom_specific_8", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific8].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific8].value().set((float) 1.0);

    // zoom_specific_8_key
    mOptions[EzoomOptions::ZoomSpecific8Key].setName ("zoom_specific_8_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific8Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific8Key].value ().action ());

    // zoom_specific_9
    mOptions[EzoomOptions::ZoomSpecific9].setName ("zoom_specific_9", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific9].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific9].value().set((float) 1.0);

    // zoom_specific_9_key
    mOptions[EzoomOptions::ZoomSpecific9Key].setName ("zoom_specific_9_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific9Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific9Key].value ().action ());

    // zoom_specific_10
    mOptions[EzoomOptions::ZoomSpecific10].setName ("zoom_specific_10", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific10].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific10].value().set((float) 1.0);

    // zoom_specific_10_key
    mOptions[EzoomOptions::ZoomSpecific10Key].setName ("zoom_specific_10_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific10Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific10Key].value ().action ());

    // zoom_specific_11
    mOptions[EzoomOptions::ZoomSpecific11].setName ("zoom_specific_11", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific11].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific11].value().set((float) 1.0);

    // zoom_specific_11_key
    mOptions[EzoomOptions::ZoomSpecific11Key].setName ("zoom_specific_11_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific11Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific11Key].value ().action ());

    // zoom_specific_12
    mOptions[EzoomOptions::ZoomSpecific12].setName ("zoom_specific_12", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific12].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific12].value().set((float) 1.0);

    // zoom_specific_12_key
    mOptions[EzoomOptions::ZoomSpecific12Key].setName ("zoom_specific_12_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific12Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific12Key].value ().action ());

    // zoom_specific_13
    mOptions[EzoomOptions::ZoomSpecific13].setName ("zoom_specific_13", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific13].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific13].value().set((float) 1.0);

    // zoom_specific_13_key
    mOptions[EzoomOptions::ZoomSpecific13Key].setName ("zoom_specific_13_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific13Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific13Key].value ().action ());

    // zoom_specific_14
    mOptions[EzoomOptions::ZoomSpecific14].setName ("zoom_specific_14", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific14].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific14].value().set((float) 1.0);

    // zoom_specific_14_key
    mOptions[EzoomOptions::ZoomSpecific14Key].setName ("zoom_specific_14_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific14Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific14Key].value ().action ());

    // zoom_specific_15
    mOptions[EzoomOptions::ZoomSpecific15].setName ("zoom_specific_15", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific15].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific15].value().set((float) 1.0);

    // zoom_specific_15_key
    mOptions[EzoomOptions::ZoomSpecific15Key].setName ("zoom_specific_15_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific15Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific15Key].value ().action ());

    // zoom_specific_16
    mOptions[EzoomOptions::ZoomSpecific16].setName ("zoom_specific_16", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomSpecific16].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ZoomSpecific16].value().set((float) 1.0);

    // zoom_specific_16_key
    mOptions[EzoomOptions::ZoomSpecific16Key].setName ("zoom_specific_16_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::ZoomSpecific16Key].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::ZoomSpecific16Key].value ().action ());

    // lock_zoom_key
    mOptions[EzoomOptions::LockZoomKey].setName ("lock_zoom_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::LockZoomKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::LockZoomKey].value ().action ());

    // pan_left_key
    mOptions[EzoomOptions::PanLeftKey].setName ("pan_left_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::PanLeftKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::PanLeftKey].value ().action ());

    // pan_right_key
    mOptions[EzoomOptions::PanRightKey].setName ("pan_right_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::PanRightKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::PanRightKey].value ().action ());

    // pan_up_key
    mOptions[EzoomOptions::PanUpKey].setName ("pan_up_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::PanUpKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::PanUpKey].value ().action ());

    // pan_down_key
    mOptions[EzoomOptions::PanDownKey].setName ("pan_down_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::PanDownKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::PanDownKey].value ().action ());

    // fit_to_zoom_key
    mOptions[EzoomOptions::FitToZoomKey].setName ("fit_to_zoom_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    mOptions[EzoomOptions::FitToZoomKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::FitToZoomKey].value ().action ());

    // fit_to_window_key
    mOptions[EzoomOptions::FitToWindowKey].setName ("fit_to_window_key", CompOption::TypeKey);
    state = CompAction::StateAutoGrab;
    action = CompAction ();
    action.setState (state | CompAction::StateInitKey);
    action.keyFromString ("<Super>r");
    mOptions[EzoomOptions::FitToWindowKey].value().set (action);
    if (screen) screen->addAction (&mOptions[EzoomOptions::FitToWindowKey].value ().action ());

    // zoom_factor
    mOptions[EzoomOptions::ZoomFactor].setName ("zoom_factor", CompOption::TypeFloat);
    mOptions[EzoomOptions::ZoomFactor].rest ().set (1.01, 3, 0.01);
    mOptions[EzoomOptions::ZoomFactor].value().set((float) 1.150);

    // minimum_zoom
    mOptions[EzoomOptions::MinimumZoom].setName ("minimum_zoom", CompOption::TypeFloat);
    mOptions[EzoomOptions::MinimumZoom].rest ().set (0.000001, 0.999999, 0.0001);
    mOptions[EzoomOptions::MinimumZoom].value().set((float) 0.125);

    // zoom_mode
    mOptions[EzoomOptions::ZoomMode].setName ("zoom_mode", CompOption::TypeInt);
    mOptions[EzoomOptions::ZoomMode].rest ().set (0, 1);
    mOptions[EzoomOptions::ZoomMode].value().set((int) 0);

    // scale_mouse
    mOptions[EzoomOptions::ScaleMouse].setName ("scale_mouse", CompOption::TypeBool);
    mOptions[EzoomOptions::ScaleMouse].value().set(true);

    // scale_mouse_dynamic
    mOptions[EzoomOptions::ScaleMouseDynamic].setName ("scale_mouse_dynamic", CompOption::TypeBool);
    mOptions[EzoomOptions::ScaleMouseDynamic].value().set(true);

    // scale_mouse_static
    mOptions[EzoomOptions::ScaleMouseStatic].setName ("scale_mouse_static", CompOption::TypeFloat);
    mOptions[EzoomOptions::ScaleMouseStatic].rest ().set (0.1, 1.0, 0.01);
    mOptions[EzoomOptions::ScaleMouseStatic].value().set((float) 0.2);

    // hide_original_mouse
    mOptions[EzoomOptions::HideOriginalMouse].setName ("hide_original_mouse", CompOption::TypeBool);
    mOptions[EzoomOptions::HideOriginalMouse].value().set(true);

    // restrain_mouse
    mOptions[EzoomOptions::RestrainMouse].setName ("restrain_mouse", CompOption::TypeBool);
    mOptions[EzoomOptions::RestrainMouse].value().set(false);

    // restrain_margin
    mOptions[EzoomOptions::RestrainMargin].setName ("restrain_margin", CompOption::TypeInt);
    mOptions[EzoomOptions::RestrainMargin].rest ().set (0, 50);
    mOptions[EzoomOptions::RestrainMargin].value().set((int) 5);

    // pan_factor
    mOptions[EzoomOptions::PanFactor].setName ("pan_factor", CompOption::TypeFloat);
    mOptions[EzoomOptions::PanFactor].rest ().set (0.001, 1.0, 0.001);
    mOptions[EzoomOptions::PanFactor].value().set((float) 0.1);

    // follow_focus
    mOptions[EzoomOptions::FollowFocus].setName ("follow_focus", CompOption::TypeBool);
    mOptions[EzoomOptions::FollowFocus].value().set(true);

    // focus_fit_window
    mOptions[EzoomOptions::FocusFitWindow].setName ("focus_fit_window", CompOption::TypeBool);
    mOptions[EzoomOptions::FocusFitWindow].value().set(false);

    // autoscale_min
    mOptions[EzoomOptions::AutoscaleMin].setName ("autoscale_min", CompOption::TypeFloat);
    mOptions[EzoomOptions::AutoscaleMin].rest ().set (0.000001, 0.999999, 0.0001);
    mOptions[EzoomOptions::AutoscaleMin].value().set((float) 0.25);

    // always_focus_fit_window
    mOptions[EzoomOptions::AlwaysFocusFitWindow].setName ("always_focus_fit_window", CompOption::TypeBool);
    mOptions[EzoomOptions::AlwaysFocusFitWindow].value().set(false);

    // follow_focus_delay
    mOptions[EzoomOptions::FollowFocusDelay].setName ("follow_focus_delay", CompOption::TypeInt);
    mOptions[EzoomOptions::FollowFocusDelay].rest ().set (0, 15);
    mOptions[EzoomOptions::FollowFocusDelay].value().set((int) 0);

    // speed
    mOptions[EzoomOptions::Speed].setName ("speed", CompOption::TypeFloat);
    mOptions[EzoomOptions::Speed].rest ().set (0.1, 100, 0.1);
    mOptions[EzoomOptions::Speed].value().set((float) 25);

    // timestep
    mOptions[EzoomOptions::Timestep].setName ("timestep", CompOption::TypeFloat);
    mOptions[EzoomOptions::Timestep].rest ().set (0.1, 50, 0.1);
    mOptions[EzoomOptions::Timestep].value().set((float) 1.2);

}

EzoomOptions::~EzoomOptions ()
{
}


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

bool
EzoomOptions::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 EzoomOptions::SetZoomArea:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::SetZoomArea].empty ())
                    mNotify[EzoomOptions::SetZoomArea] (o, EzoomOptions::SetZoomArea);
                return true;
            }
            break;
        case EzoomOptions::EnsureVisibility:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::EnsureVisibility].empty ())
                    mNotify[EzoomOptions::EnsureVisibility] (o, EzoomOptions::EnsureVisibility);
                return true;
            }
            break;
        case EzoomOptions::ZoomInButton:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomInButton].empty ())
                    mNotify[EzoomOptions::ZoomInButton] (o, EzoomOptions::ZoomInButton);
                return true;
            }
            break;
        case EzoomOptions::ZoomInKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomInKey].empty ())
                    mNotify[EzoomOptions::ZoomInKey] (o, EzoomOptions::ZoomInKey);
                return true;
            }
            break;
        case EzoomOptions::ZoomOutButton:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomOutButton].empty ())
                    mNotify[EzoomOptions::ZoomOutButton] (o, EzoomOptions::ZoomOutButton);
                return true;
            }
            break;
        case EzoomOptions::ZoomOutKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomOutKey].empty ())
                    mNotify[EzoomOptions::ZoomOutKey] (o, EzoomOptions::ZoomOutKey);
                return true;
            }
            break;
        case EzoomOptions::ZoomBoxButton:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomBoxButton].empty ())
                    mNotify[EzoomOptions::ZoomBoxButton] (o, EzoomOptions::ZoomBoxButton);
                return true;
            }
            break;
        case EzoomOptions::ZoomBoxOutlineColor:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomBoxOutlineColor].empty ())
                    mNotify[EzoomOptions::ZoomBoxOutlineColor] (o, EzoomOptions::ZoomBoxOutlineColor);
                return true;
            }
            break;
        case EzoomOptions::ZoomBoxFillColor:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomBoxFillColor].empty ())
                    mNotify[EzoomOptions::ZoomBoxFillColor] (o, EzoomOptions::ZoomBoxFillColor);
                return true;
            }
            break;
        case EzoomOptions::ZoomSmoothing:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSmoothing].empty ())
                    mNotify[EzoomOptions::ZoomSmoothing] (o, EzoomOptions::ZoomSmoothing);
                return true;
            }
            break;
        case EzoomOptions::CenterMouseKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::CenterMouseKey].empty ())
                    mNotify[EzoomOptions::CenterMouseKey] (o, EzoomOptions::CenterMouseKey);
                return true;
            }
            break;
        case EzoomOptions::SpecTargetFocus:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::SpecTargetFocus].empty ())
                    mNotify[EzoomOptions::SpecTargetFocus] (o, EzoomOptions::SpecTargetFocus);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific1:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific1].empty ())
                    mNotify[EzoomOptions::ZoomSpecific1] (o, EzoomOptions::ZoomSpecific1);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific1Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific1Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific1Key] (o, EzoomOptions::ZoomSpecific1Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific2:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific2].empty ())
                    mNotify[EzoomOptions::ZoomSpecific2] (o, EzoomOptions::ZoomSpecific2);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific2Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific2Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific2Key] (o, EzoomOptions::ZoomSpecific2Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific3:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific3].empty ())
                    mNotify[EzoomOptions::ZoomSpecific3] (o, EzoomOptions::ZoomSpecific3);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific3Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific3Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific3Key] (o, EzoomOptions::ZoomSpecific3Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific4:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific4].empty ())
                    mNotify[EzoomOptions::ZoomSpecific4] (o, EzoomOptions::ZoomSpecific4);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific4Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific4Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific4Key] (o, EzoomOptions::ZoomSpecific4Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific5:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific5].empty ())
                    mNotify[EzoomOptions::ZoomSpecific5] (o, EzoomOptions::ZoomSpecific5);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific5Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific5Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific5Key] (o, EzoomOptions::ZoomSpecific5Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific6:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific6].empty ())
                    mNotify[EzoomOptions::ZoomSpecific6] (o, EzoomOptions::ZoomSpecific6);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific6Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific6Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific6Key] (o, EzoomOptions::ZoomSpecific6Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific7:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific7].empty ())
                    mNotify[EzoomOptions::ZoomSpecific7] (o, EzoomOptions::ZoomSpecific7);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific7Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific7Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific7Key] (o, EzoomOptions::ZoomSpecific7Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific8:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific8].empty ())
                    mNotify[EzoomOptions::ZoomSpecific8] (o, EzoomOptions::ZoomSpecific8);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific8Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific8Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific8Key] (o, EzoomOptions::ZoomSpecific8Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific9:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific9].empty ())
                    mNotify[EzoomOptions::ZoomSpecific9] (o, EzoomOptions::ZoomSpecific9);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific9Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific9Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific9Key] (o, EzoomOptions::ZoomSpecific9Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific10:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific10].empty ())
                    mNotify[EzoomOptions::ZoomSpecific10] (o, EzoomOptions::ZoomSpecific10);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific10Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific10Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific10Key] (o, EzoomOptions::ZoomSpecific10Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific11:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific11].empty ())
                    mNotify[EzoomOptions::ZoomSpecific11] (o, EzoomOptions::ZoomSpecific11);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific11Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific11Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific11Key] (o, EzoomOptions::ZoomSpecific11Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific12:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific12].empty ())
                    mNotify[EzoomOptions::ZoomSpecific12] (o, EzoomOptions::ZoomSpecific12);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific12Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific12Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific12Key] (o, EzoomOptions::ZoomSpecific12Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific13:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific13].empty ())
                    mNotify[EzoomOptions::ZoomSpecific13] (o, EzoomOptions::ZoomSpecific13);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific13Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific13Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific13Key] (o, EzoomOptions::ZoomSpecific13Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific14:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific14].empty ())
                    mNotify[EzoomOptions::ZoomSpecific14] (o, EzoomOptions::ZoomSpecific14);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific14Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific14Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific14Key] (o, EzoomOptions::ZoomSpecific14Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific15:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific15].empty ())
                    mNotify[EzoomOptions::ZoomSpecific15] (o, EzoomOptions::ZoomSpecific15);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific15Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific15Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific15Key] (o, EzoomOptions::ZoomSpecific15Key);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific16:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific16].empty ())
                    mNotify[EzoomOptions::ZoomSpecific16] (o, EzoomOptions::ZoomSpecific16);
                return true;
            }
            break;
        case EzoomOptions::ZoomSpecific16Key:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomSpecific16Key].empty ())
                    mNotify[EzoomOptions::ZoomSpecific16Key] (o, EzoomOptions::ZoomSpecific16Key);
                return true;
            }
            break;
        case EzoomOptions::LockZoomKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::LockZoomKey].empty ())
                    mNotify[EzoomOptions::LockZoomKey] (o, EzoomOptions::LockZoomKey);
                return true;
            }
            break;
        case EzoomOptions::PanLeftKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::PanLeftKey].empty ())
                    mNotify[EzoomOptions::PanLeftKey] (o, EzoomOptions::PanLeftKey);
                return true;
            }
            break;
        case EzoomOptions::PanRightKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::PanRightKey].empty ())
                    mNotify[EzoomOptions::PanRightKey] (o, EzoomOptions::PanRightKey);
                return true;
            }
            break;
        case EzoomOptions::PanUpKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::PanUpKey].empty ())
                    mNotify[EzoomOptions::PanUpKey] (o, EzoomOptions::PanUpKey);
                return true;
            }
            break;
        case EzoomOptions::PanDownKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::PanDownKey].empty ())
                    mNotify[EzoomOptions::PanDownKey] (o, EzoomOptions::PanDownKey);
                return true;
            }
            break;
        case EzoomOptions::FitToZoomKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::FitToZoomKey].empty ())
                    mNotify[EzoomOptions::FitToZoomKey] (o, EzoomOptions::FitToZoomKey);
                return true;
            }
            break;
        case EzoomOptions::FitToWindowKey:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::FitToWindowKey].empty ())
                    mNotify[EzoomOptions::FitToWindowKey] (o, EzoomOptions::FitToWindowKey);
                return true;
            }
            break;
        case EzoomOptions::ZoomFactor:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomFactor].empty ())
                    mNotify[EzoomOptions::ZoomFactor] (o, EzoomOptions::ZoomFactor);
                return true;
            }
            break;
        case EzoomOptions::MinimumZoom:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::MinimumZoom].empty ())
                    mNotify[EzoomOptions::MinimumZoom] (o, EzoomOptions::MinimumZoom);
                return true;
            }
            break;
        case EzoomOptions::ZoomMode:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ZoomMode].empty ())
                    mNotify[EzoomOptions::ZoomMode] (o, EzoomOptions::ZoomMode);
                return true;
            }
            break;
        case EzoomOptions::ScaleMouse:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ScaleMouse].empty ())
                    mNotify[EzoomOptions::ScaleMouse] (o, EzoomOptions::ScaleMouse);
                return true;
            }
            break;
        case EzoomOptions::ScaleMouseDynamic:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ScaleMouseDynamic].empty ())
                    mNotify[EzoomOptions::ScaleMouseDynamic] (o, EzoomOptions::ScaleMouseDynamic);
                return true;
            }
            break;
        case EzoomOptions::ScaleMouseStatic:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::ScaleMouseStatic].empty ())
                    mNotify[EzoomOptions::ScaleMouseStatic] (o, EzoomOptions::ScaleMouseStatic);
                return true;
            }
            break;
        case EzoomOptions::HideOriginalMouse:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::HideOriginalMouse].empty ())
                    mNotify[EzoomOptions::HideOriginalMouse] (o, EzoomOptions::HideOriginalMouse);
                return true;
            }
            break;
        case EzoomOptions::RestrainMouse:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::RestrainMouse].empty ())
                    mNotify[EzoomOptions::RestrainMouse] (o, EzoomOptions::RestrainMouse);
                return true;
            }
            break;
        case EzoomOptions::RestrainMargin:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::RestrainMargin].empty ())
                    mNotify[EzoomOptions::RestrainMargin] (o, EzoomOptions::RestrainMargin);
                return true;
            }
            break;
        case EzoomOptions::PanFactor:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::PanFactor].empty ())
                    mNotify[EzoomOptions::PanFactor] (o, EzoomOptions::PanFactor);
                return true;
            }
            break;
        case EzoomOptions::FollowFocus:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::FollowFocus].empty ())
                    mNotify[EzoomOptions::FollowFocus] (o, EzoomOptions::FollowFocus);
                return true;
            }
            break;
        case EzoomOptions::FocusFitWindow:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::FocusFitWindow].empty ())
                    mNotify[EzoomOptions::FocusFitWindow] (o, EzoomOptions::FocusFitWindow);
                return true;
            }
            break;
        case EzoomOptions::AutoscaleMin:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::AutoscaleMin].empty ())
                    mNotify[EzoomOptions::AutoscaleMin] (o, EzoomOptions::AutoscaleMin);
                return true;
            }
            break;
        case EzoomOptions::AlwaysFocusFitWindow:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::AlwaysFocusFitWindow].empty ())
                    mNotify[EzoomOptions::AlwaysFocusFitWindow] (o, EzoomOptions::AlwaysFocusFitWindow);
                return true;
            }
            break;
        case EzoomOptions::FollowFocusDelay:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::FollowFocusDelay].empty ())
                    mNotify[EzoomOptions::FollowFocusDelay] (o, EzoomOptions::FollowFocusDelay);
                return true;
            }
            break;
        case EzoomOptions::Speed:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::Speed].empty ())
                    mNotify[EzoomOptions::Speed] (o, EzoomOptions::Speed);
                return true;
            }
            break;
        case EzoomOptions::Timestep:
            if (o->set (value))
            {
                if (!mNotify[EzoomOptions::Timestep].empty ())
                    mNotify[EzoomOptions::Timestep] (o, EzoomOptions::Timestep);
                return true;
            }
            break;
        default:
            break;
    }
    return false;

}

