Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

SPEventContext* sp_event_context_new ( GType  type,
SPDesktop desktop,
gchar const *  pref_path,
unsigned int  key 

Creates new SPEventContext object and calls its virtual setup() function.

This is bogus. pref_path should be a private property of the inheriting objects.

Definition at line 787 of file event-context.cpp.

References Inkscape::Preferences::addObserver(), Inkscape::Preferences::get(), and Inkscape::UI::View::View::messageStack().

Referenced by SPDesktop::push_event_context(), and SPDesktop::set_event_context().

    g_return_val_if_fail(g_type_is_a(type, SP_TYPE_EVENT_CONTEXT), NULL);
    g_return_val_if_fail(desktop != NULL, NULL);

    SPEventContext * const ec = (SPEventContext*) g_object_new(type, NULL);

    ec->desktop = desktop;
            = new Inkscape::MessageContext(desktop->messageStack());
    ec->key = key;
    ec->pref_observer = NULL;

    if (pref_path) {
        ec->pref_observer = new ToolPrefObserver(pref_path, ec);

        Inkscape::Preferences *prefs = Inkscape::Preferences::get();

    if (((SPEventContextClass *) G_OBJECT_GET_CLASS(ec))->setup)
        ((SPEventContextClass *) G_OBJECT_GET_CLASS(ec))->setup(ec);

    return ec;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index