diff options
| author | Ted Gould <ted@gould.cx> | 2008-09-25 04:27:18 +0000 |
|---|---|---|
| committer | Ted Gould <ted@canonical.com> | 2008-09-25 04:27:18 +0000 |
| commit | c1b561191ad1d561c352681cb94dc192a1ab0d6a (patch) | |
| tree | ed6bc0f3b629a25febd2c6d7e59fe458e88686d9 /src/extension | |
| parent | [i18n] Added use of plural forms. (diff) | |
| download | inkscape-c1b561191ad1d561c352681cb94dc192a1ab0d6a.tar.gz inkscape-c1b561191ad1d561c352681cb94dc192a1ab0d6a.zip | |
Sorry, I got off on a branch and ended up with a bunch of things. I'm just going to flatten and merge... Here's the list.
* Added a focus mode activated by Shift+F11. The goal of this mode is to
remove all toolbars for a short period so that you maximize screen area.
Useful on small screens. Also when you know lots of shortcuts.
* Created what I'm calling "Quick Zoom." The idea here is to have a modal
zoom for touching up something with fine detail and then returning to what
you're doing. This is activated with the letter "Q" on the keyboard. When
you release it, you return back to where you were. This will zoom in on
selected objects, or if you're in the node tool selected nodes.
* Added .svg on the temporary files in extensions. This'll make many of
them happier. This only works on recent versions of GLib, but shouldn't
break older ones more than they already are.
* Moved the Inkscape configuration directory on Linux from ~/.inkscape
to ~/.config/Inkscape. This is the new way to do things with the cross
desktop naming spec. I'm unsure whether we should be putting crash dumps
in .config or .cache though.
* Removed 'tools_switch_current' because every usage of it already had a
pointer to where it needed to go. Removes usage of globals.
* Made it so that dialogs will be transparent when not focused. This is
an alternate to having the docked, and one that I like better as I feel it
gives me more screen area. You can adjust how much transparency and the
speed of the animation in the preferences dialog. (Note: this requires
GTK+ 2.12 and a compositor, but gracefully degrades if you don't have
either)
(bzr r6882)
Diffstat (limited to 'src/extension')
| -rw-r--r-- | src/extension/db.h | 2 | ||||
| -rw-r--r-- | src/extension/implementation/script.cpp | 54 | ||||
| -rw-r--r-- | src/extension/implementation/script.h | 14 | ||||
| -rw-r--r-- | src/extension/timer.cpp | 2 |
4 files changed, 33 insertions, 39 deletions
diff --git a/src/extension/db.h b/src/extension/db.h index c67a62bf2..9505ac779 100644 --- a/src/extension/db.h +++ b/src/extension/db.h @@ -64,7 +64,7 @@ public: typedef std::list<Input *> InputList; typedef std::list<Effect *> EffectList; - InputList &get_input_list (InputList &ou_list); + InputList &get_input_list (InputList &ou_list); OutputList &get_output_list (OutputList &ou_list); EffectList &get_effect_list (EffectList &ou_list); }; /* class DB */ diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 1f6d973c3..9475b4796 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -11,23 +11,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -/* -TODO: -FIXME: - After Inkscape makes a formal requirement for a GTK version above 2.11.4, please - replace all the instances of ink_ext_XXXXXX in this file that represent - svg files with ink_ext_XXXXXX.svg . Doing so will prevent errors in extensions - that call inkscape to manipulate the file. - - "** (inkscape:5848): WARNING **: Format autodetect failed. The file is being opened as SVG." - - references: - http://www.gtk.org/api/2.6/glib/glib-File-Utilities.html#g-mkstemp - http://ftp.gnome.org/pub/gnome/sources/glib/2.11/glib-2.11.4.changes - http://developer.gnome.org/doc/API/2.0/glib/glib-File-Utilities.html#g-mkstemp - - --Aaron Spike -*/ #define __INKSCAPE_EXTENSION_IMPLEMENTATION_SCRIPT_C__ #ifdef HAVE_CONFIG_H @@ -77,19 +60,18 @@ namespace Inkscape { namespace Extension { namespace Implementation { -void pump_events (void) { +/** \brief Make GTK+ events continue to come through a little bit + + This just keeps coming the events through so that we'll make the GUI + update and look pretty. +*/ +void +Script::pump_events (void) { while( Gtk::Main::events_pending() ) Gtk::Main::iteration(); return; } -//Interpreter lookup table -struct interpreter_t { - gchar const *identity; - gchar const *prefstring; - gchar const *defaultval; -}; - /** \brief A table of what interpreters to call for a given language @@ -97,7 +79,7 @@ struct interpreter_t { given script. It also tracks the preference to use to overwrite the given interpreter to a custom one per user. */ -static interpreter_t const interpreterTab[] = { +Script::interpreter_t const Script::interpreterTab[] = { {"perl", "perl-interpreter", "perl" }, #ifdef WIN32 {"python", "python-interpreter", "pythonw" }, @@ -111,12 +93,13 @@ static interpreter_t const interpreterTab[] = { -/** - * Look up an interpreter name, and translate to something that - * is executable - */ -static Glib::ustring -resolveInterpreterExecutable(const Glib::ustring &interpNameArg) +/** \brief Look up an interpreter name, and translate to something that + is executable + \param interpNameArg The name of the interpreter that we're looking + for, should be an entry in interpreterTab +*/ +Glib::ustring +Script::resolveInterpreterExecutable(const Glib::ustring &interpNameArg) { Glib::ustring interpName = interpNameArg; @@ -184,8 +167,6 @@ resolveInterpreterExecutable(const Glib::ustring &interpNameArg) return interpName; } - - /** \brief This function creates a script object and sets up the variables. \return A script object @@ -199,7 +180,6 @@ Script::Script() : { } - /** * brief Destructor */ @@ -573,7 +553,7 @@ Script::open(Inkscape::Extension::Input *module, std::string tempfilename_out; int tempfd_out = 0; try { - tempfd_out = Inkscape::IO::file_open_tmp(tempfilename_out, "ink_ext_XXXXXX"); + tempfd_out = Inkscape::IO::file_open_tmp(tempfilename_out, "ink_ext_XXXXXX.svg"); } catch (...) { /// \todo Popup dialog here return NULL; @@ -647,7 +627,7 @@ Script::save(Inkscape::Extension::Output *module, std::string tempfilename_in; int tempfd_in = 0; try { - tempfd_in = Inkscape::IO::file_open_tmp(tempfilename_in, "ink_ext_XXXXXX"); + tempfd_in = Inkscape::IO::file_open_tmp(tempfilename_in, "ink_ext_XXXXXX.svg"); } catch (...) { /// \todo Popup dialog here return; diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index 226a6beb2..4620375f9 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -199,6 +199,20 @@ private: const std::list<std::string> &in_params, const Glib::ustring &filein, file_listener &fileout); + + void pump_events (void); + + /** \brief A definition of an interpreter, which can be specified + in the INX file, but we need to know what to call */ + struct interpreter_t { + gchar const *identity; /**< The ID that is in the INX file */ + gchar const *prefstring; /**< The preferences key that can override the default */ + gchar const *defaultval; /**< The default value if there are no preferences */ + }; + static interpreter_t const interpreterTab[]; + + Glib::ustring resolveInterpreterExecutable(const Glib::ustring &interpNameArg); + }; // class Script diff --git a/src/extension/timer.cpp b/src/extension/timer.cpp index c7a9331a0..640bf143d 100644 --- a/src/extension/timer.cpp +++ b/src/extension/timer.cpp @@ -31,7 +31,7 @@ bool ExpirationTimer::timer_started = false; This function creates the timer, and sets the time to the current time, plus what ever the current timeout is. Also, if this is the first timer extension, the timer is kicked off. This function - also sets up teh circularly linked list of all the timers. + also sets up the circularly linked list of all the timers. */ ExpirationTimer::ExpirationTimer (Extension * in_extension): locked(0), |
