scriptdialog.cpp revision a2b0b037f061468f703f86918b774728c81fc407
/**
* @file
* Dialog for executing and monitoring script execution.
*/
/* Author:
* Bob Jamison
*
* Copyright (C) 2004-2008 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 Javascript script
*/
void executeJavascript();
/**
* Execute a Python script
*/
void executePython();
/**
* Execute a Ruby script
*/
void executeRuby();
private:
//## Script text
//## Output text
//## Error text
};
static const char *defaultCodeStr =
"/**\n"
" * This is some example Javascript.\n"
" * Try 'Execute Javascript'\n"
" */\n"
"importPackage(javax.swing);\n"
"function sayHello() {\n"
" JOptionPane.showMessageDialog(null, 'Hello, world!',\n"
" 'Welcome to Inkscape', JOptionPane.WARNING_MESSAGE);\n"
"}\n"
"\n"
"sayHello();\n"
"\n";
//#########################################################################
//## 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
*/
{
if (!ok)
{
//do we want something here?
}
}
/**
* Execute the script in the dialog
*/
void ScriptDialogImpl::executeJavascript()
{
}
/**
* Execute the script in the dialog
*/
void ScriptDialogImpl::executePython()
{
}
/**
* Execute the script in the dialog
*/
void ScriptDialogImpl::executeRuby()
{
}
//#########################################################################
//## 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()
//### 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
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :