scriptdialog.cpp revision 963f23115db07f460bdd862b957f8bd9dba88b9b
/**
* Dialog for executing and monitoring script execution
*
* Author:
* Bob Jamison
*
* Copyright (C) 2004-2007 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/textview.h>
#include "scriptdialog.h"
namespace Inkscape {
namespace UI {
namespace Dialog {
//#########################################################################
//## I M P L E M E N T A T I O N
//#########################################################################
/**
*/
class ScriptDialogImpl : public ScriptDialog
{
public:
/**
* Constructor
*/
/**
* Destructor
*/
{}
/**
* Clear the text
*/
void clear();
/**
* Execute the script
*/
/**
* Execute a Python script
*/
void executePython();
/**
* Execute a Perl script
*/
void executePerl();
private:
//## Script text
//## Output text
//## Error text
};
static char *defaultPythonCodeStr =
#if defined(WITH_PYTHON)
"# This is a sample Python script.\n"
"# To run it, select 'Execute Python' from the File menu above.\n"
"desktop = inkscape.activeDesktop\n"
"dialogmanager = desktop.dialogManager\n"
"document = inkscape.activeDocument\n"
"inkscape.hello()\n"
"dialogmanager.showAbout()\n"
"# This is a sample Perl script.\n"
"# To run it, select 'Execute Perl' from the File menu above.\n"
"my $desktop = $inkscape->getDesktop();\n"
"my $dialogmanager = $inkscape->getDialogManager();\n"
"my $document = $desktop->getDocument();\n"
"$document->hello();\n"
"$dialogmanager->showAbout();\n"
#else
"# This is where you could type a script.\n"
"# However, no scripting languages have been compiled\n"
"# into Inkscape, so this window has no functionality.\n"
"# When compiling Inkscape, run \"configure\" with\n"
#endif
"";
//#########################################################################
//## E V E N T S
//#########################################################################
{
}
/**
* Also a public method. Remove all text from the dialog
*/
void ScriptDialogImpl::clear()
{
}
/**
* Execute the script in the dialog
*/
void
lang)
{
if (!ok)
{
//do we want something here?
}
}
/**
* Execute the script in the dialog
*/
void ScriptDialogImpl::executePython()
{
}
/**
* Execute the script in the dialog
*/
void ScriptDialogImpl::executePerl()
{
}
//#########################################################################
//## C O N S T R U C T O R / D E S T R U C T O R
//#########################################################################
/**
* Constructor
*/
{
//## Add a menu for clear()
#ifdef WITH_PYTHON
#endif
#ifdef WITH_PERL
#endif
//### Set up the script field
scriptText.set_editable(true);
//### Set up the output field
outputText.set_editable(true);
//### Set up the error field
errorText.set_editable(true);
// sick of this thing shrinking too much
}
/**
* Factory method. Use this to create a new ScriptDialog
*/
{
return *dialog;
}
} //namespace Dialogs
} //namespace UI
} //namespace Inkscape
//#########################################################################
//## E N D O F F I L E
//#########################################################################