Logo Search packages:      
Sourcecode: inkscape version File versions

SPAction * Inkscape::Verb::get_action ( SPView *  view  )  [inherited]

A function to get an action if it exists, or otherwise to build it.

Parameters:
view The view which this action would relate to
Returns:
The action, or NULL if there is an error.
This function will get the action for a given view for this verb. It will create the verb if it can't be found in the ActionTable. Also, if the ActionTable has not been created, it gets created by this function.

Definition at line 521 of file verbs.cpp.

References Inkscape::Verb::_actions, and Inkscape::Verb::make_action().

{
    SPAction * action = NULL;

    if (_actions == NULL) {
        _actions = new ActionTable;
    }
    ActionTable::iterator action_found = _actions->find(view);

    if (action_found != _actions->end()) {
        action = action_found->second;
    } else {
        action = this->make_action(view);
        // if (action == NULL) printf("Hmm, NULL in %s\n", _name);
        _actions->insert(ActionTable::value_type(view, action));
    }

    return action;
}


Generated by  Doxygen 1.6.0   Back to index