
On 10/10/05, bulia byak <buliabyak@...400...> wrote:
On 10/10/05, Ben Fowler <ben.the.mole@...400...> wrote:
I was stepping through inkscape under gdb (on BSD without X) and found that the "sp-console-main( )" seems to have a code path that calls gdk_devices_list() (whilst loading preferences).
Good point. The console main definitely does not need to load the tablet preferences. But it needs the regular preferences, and as far as I remember they are all loaded in one function that also calls the tablet prefs loader. Can you try to separate them, so that tablet prefs are only loaded for GUI?
Well, yes and no.
I was looking here http://www.inkscape.org/doc/doxygen/html/inkscape_8cpp.php#a38 , where inkscape_load_preferences( ) calls sp_input_load_from_preferences() .
A 'quick and dirty' way round would be to make that call conditional upon the value of use_gui.
(Is this what you meant?)
This looks a little baroque.
Are you sure that the console application should load user preferences? User preferences are often pertinent to a user sitting in front of the application and interacting with it, this is why Gnome has a desktop-wide way of loading/saving defaults and preferences (at least I assume it does!).
i need to write about this from an architecural point of view, because I want to check first that Inkscape is a Gnome Application within the meaning of the Act,
(See http://developer.gnome.org/doc/tutorials/gnome-libs/gnome-libraries-overview... for my picture of how Gnome sits on GTK which sits on GDK).
and second that Inkscape does (or will in the future) use the Model-View-Controller pattern exempli gratia: "The 'model-view-controller' paradigm introduces the controller object in between the view (the GUI class) and the model (the object) to communicate between the other two objects. The actual implementation of the controller object can vary quite a bit, but the idea of an object to 'transform' events to changes in data and execution of methods is the essence of this pattern." http://en.wikipedia.org/wiki/MVC .
These are matters for the future, maybe not so far off, but for today, do you agree that it is the functions that I named above that need looking at, and that there exist an approach which is acceptable to you?
Ben