Hi devs,
A bit of bother with a new DesktopPrefObserver to watch for a new settings modification. The diff is available here:
https://code.launchpad.net/~doctormo/inkscape/image-outline-option/+merge/21...
The idea is simply to initalise the observer and specify the option to observe. See failed variable _image_render_observer in desktop.cpp and desktop.h
The error comes from the string, it says the string is a `const char [36]` while it needs a const GLib::ustring. Usually I've seen the code be more flexible about const strings at compile time, but this one is being picky.
Any ideas?
Also a question about the option. Should it be enabled or disabled by default? Would a user expect bitmap images to be exceptions in outline mode or would they expect them to be red squares with an X inside by default?
Best Regards, Martin Owens
Martin Owens-2 wrote
The error comes from the string, it says the string is a `const char [36]` while it needs a const GLib::ustring. Usually I've seen the code be more flexible about const strings at compile time, but this one is being picky.
Create a const Glib::ustring with your C string.
const Glib::ustring pref_path("/options/rendering/imageinoutlinemode"); _image_render_observer = DesktopPrefObserver(*this, pref_path);
I'm not sure why it would do this but I guess it should work.
And I think the pref should by default be off (stable users may not know what to make of it, and I personally have no use for it, even being a tracer myself).
-- View this message in context: http://inkscape.13.x6.nabble.com/Preference-Observer-in-Init-tp4970271p49702... Sent from the Inkscape - Dev mailing list archive at Nabble.com.
2014-04-19 1:15 GMT+02:00 Martin Owens <doctormo@...400...>:
Also a question about the option. Should it be enabled or disabled by default? Would a user expect bitmap images to be exceptions in outline mode or would they expect them to be red squares with an X inside by default?
By default, images in outline mode should be rendered as red boxes with "X". Outline mode is intended to show the structure of the document and be as fast as possible.
Further note: the new method redrawDesktop() is incorrect, and this actually shouldn't cause a redraw. It only works because the relevant function is buggy and causes unnecessary updates. The correct way to do this is to call update() on Inkscape::Drawing with reset = STATE_ALL, and then call requestRedraw() on SPCanvas with an infinite rectangle.
Regards, Krzysztof
On Sat, 2014-04-19 at 19:20 +0200, Krzysztof Kosiński wrote:
Further note: the new method redrawDesktop() is incorrect, and this actually shouldn't cause a redraw. It only works because the relevant function is buggy and causes unnecessary updates. The correct way to do this is to call update() on Inkscape::Drawing with reset = STATE_ALL, and then call requestRedraw() on SPCanvas with an infinite rectangle.
It's a reposition of the original code. There's another call in desktop.cpp to that same call, is that incorrect? Should they be merged into your single proposed call replacement?
Martin,
2014-04-19 20:21 GMT+02:00 Martin Owens <doctormo@...400...>:
On Sat, 2014-04-19 at 19:20 +0200, Krzysztof Kosiński wrote:
Further note: the new method redrawDesktop() is incorrect, and this actually shouldn't cause a redraw. It only works because the relevant function is buggy and causes unnecessary updates. The correct way to do this is to call update() on Inkscape::Drawing with reset = STATE_ALL, and then call requestRedraw() on SPCanvas with an infinite rectangle.
It's a reposition of the original code. There's another call in desktop.cpp to that same call, is that incorrect? Should they be merged into your single proposed call replacement?
The original code was also not correct. If the semantic is "redraw absolutely everything", then yes, it should be replaced.
Regards, Krzysztof
participants (3)
-
Krzysztof Kosiński
-
liamw
-
Martin Owens