Logo Search packages:      
Sourcecode: inkscape version File versions

bool Inkscape::Extension::Extension::get_param_bool ( const gchar *  name,
const SPReprDoc *  doc = NULL 

Gets a parameter identified by name with the bool placed in value.

The value of the parameter identified by the name
name The name of the parameter to get
doc The document to look in for document specific parameters
To get the parameter to be used the function param_shared is called. This function is inline so it shouldn't cause the stack to build or anything like that. If it can't find the parameter, it will throw and exception - we aren't catching that because we want the calling function to catch it.

Next up, the parameter that we got, we're making sure that it is a bool parameter. If it isn't, then we throw a param_wrong_type exception.

Finally, if everything is okay, the boolean value that is stored in the parameter is placed in value.

Definition at line 544 of file extension.cpp.

References PARAM_BOOL, param_shared(), parameters, Inkscape::Extension::Extension::param_switch_t::t_bool, Inkscape::Extension::Extension::param_t::type, and Inkscape::Extension::Extension::param_t::val.

    Extension::param_t * param;
    param = Extension::param_shared(name, parameters);

    if (param->type != Extension::PARAM_BOOL) {
        throw Extension::param_wrong_type();

    return param->val.t_bool;

Generated by  Doxygen 1.6.0   Back to index