summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation/script.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2008-09-25 04:27:18 +0000
committerTed Gould <ted@canonical.com>2008-09-25 04:27:18 +0000
commitc1b561191ad1d561c352681cb94dc192a1ab0d6a (patch)
treeed6bc0f3b629a25febd2c6d7e59fe458e88686d9 /src/extension/implementation/script.cpp
parent[i18n] Added use of plural forms. (diff)
downloadinkscape-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/implementation/script.cpp')
-rw-r--r--src/extension/implementation/script.cpp54
1 files changed, 17 insertions, 37 deletions
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;