Logo Search packages:      
Sourcecode: inkscape version File versions

SPAction * Inkscape::Verb::make_action_helper ( SPView *  view,
SPActionEventVector vector,
void *  in_pntr = NULL 
) [protected, inherited]

A quick little convience function to make building actions a little bit easier.

Parameters:
view Which view the action should be created for.
vector The function vector for the verb.
Returns:
The created action.
This function does a couple of things. The most obvious is that it allocates and creates the action. When it does this it translates the _name and _tip variables. This allows them to be staticly allocated easily, and get translated in the end. Then, if the action gets crated, a listener is added to the action with the vector that is passed in.

Definition at line 481 of file verbs.cpp.

References Inkscape::Verb::_code, Inkscape::Verb::_id, Inkscape::Verb::_image, Inkscape::Verb::_name, and Inkscape::Verb::_tip.

Referenced by Inkscape::EffectLastVerb::make_action(), Inkscape::TutorialVerb::make_action(), Inkscape::HelpVerb::make_action(), Inkscape::DialogVerb::make_action(), make_action(), Inkscape::ContextVerb::make_action(), Inkscape::ObjectVerb::make_action(), Inkscape::LayerVerb::make_action(), Inkscape::SelectionVerb::make_action(), Inkscape::EditVerb::make_action(), and Inkscape::FileVerb::make_action().

{
    SPAction *action;
    
    //std::cout << "Adding action: " << _code << std::endl;
    action = sp_action_new(view, _id, _(_name),
                           _(_tip), _image, this);

    if (action != NULL) {
        if (in_pntr == NULL) {
            nr_active_object_add_listener (
                (NRActiveObject *) action,
                (NRObjectEventVector *) vector,
                sizeof (SPActionEventVector),
                reinterpret_cast<void *>(_code)
            );
        } else {
            nr_active_object_add_listener (
                (NRActiveObject *) action,
                (NRObjectEventVector *) vector,
                sizeof (SPActionEventVector),
                in_pntr
            );
        }
    }

    return action;
}


Generated by  Doxygen 1.6.0   Back to index