diff --git a/src/bind/javabind.h b/src/bind/javabind.h
index f01627a1533125e20366991ce676a8bdc214109b..894f52d5dddffe902625054a7b4d97ffbbf34f8f 100644 (file)
--- a/src/bind/javabind.h
+++ b/src/bind/javabind.h
-#ifndef __JAVABIND_H__
-#define __JAVABIND_H__
/**
/**
- * This is a simple mechanism to bind Inkscape to Java, and thence
+ * @file
+ * @brief This is a simple mechanism to bind Inkscape to Java, and thence
* to all of the nice things that can be layered upon that.
*
* Authors:
* to all of the nice things that can be layered upon that.
*
* Authors:
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifndef __JAVABIND_H__
+#define __JAVABIND_H__
+
#include <glibmm.h>
#include <vector>
#include <glibmm.h>
#include <vector>
typedef Glib::ustring String;
typedef Glib::ustring String;
+/**
+ * This is the base class of all things which will be C++ object
+ * instances
+ */
+class BaseObject
+{
+public:
+
+ /**
+ * Simple constructor
+ */
+ BaseObject()
+ {}
+
+ /**
+ * Destructor
+ */
+ virtual ~BaseObject()
+ {}
+
+};
+
/**
*
/**
*
BIND_INT,
BIND_BOOLEAN,
BIND_DOUBLE,
BIND_INT,
BIND_BOOLEAN,
BIND_DOUBLE,
- BIND_STRING
+ BIND_STRING,
+ BIND_OBJECT
} ValueType;
/**
} ValueType;
/**
init();
}
init();
}
+ /**
+ *
+ */
+ Value(int ival)
+ {
+ init();
+ setInt(ival);
+ }
+
+ /**
+ *
+ */
+ Value(bool bval)
+ {
+ init();
+ setBoolean(bval);
+ }
+
+ /**
+ *
+ */
+ Value(double dval)
+ {
+ init();
+ setDouble(dval);
+ }
+
+ /**
+ *
+ */
+ Value(const String &sval)
+ {
+ init();
+ setString(sval);
+ }
+
/**
*
*/
/**
*
*/
/**
*
*/
/**
*
*/
- virtual bool callMain(const String &/*className*/)
+ virtual bool callMain(const String &/*className*/,
+ const std::vector<String> &/*args*/)
{
return false;
}
{
return false;
}
/**
*
*/
/**
*
*/
- virtual bool doBinding()
+ virtual bool scriptRun(const String &/*lang*/, const String &/*script*/)
{
return false;
}
{
return false;
}
-
- virtual String stdOutGet()
+
+ /**
+ *
+ */
+ virtual bool scriptRunFile(const String &/*lang*/, const String &/*fileName*/)
{
{
- return stdOutBuf;
+ return false;
}
}
- virtual void stdOutClear()
+ /**
+ *
+ */
+ virtual bool showConsole()
{
{
- stdOutBuf.clear();
+ return false;
}
}
- virtual String stdErrGet()
+ /**
+ *
+ */
+ virtual bool doBinding()
{
{
- return stdErrBuf;
+ return false;
}
}
-
- virtual void stdErrClear()
+
+ /**
+ *
+ */
+ virtual String getException()
+ {
+ return "";
+ }
+
+ virtual String logGet()
{
{
- stdErrBuf.clear();
+ return logBuf;
}
}
- virtual void stdOut(int ch)
+ virtual void logClear()
{
{
- stdOutBuf.push_back((char)ch);
+ logBuf.clear();
}
}
- virtual void stdErr(int ch)
+ virtual void log(int ch)
{
{
- stdErrBuf.push_back((char)ch);
+ logBuf.push_back((char)ch);
+ if (ch == '\n' || ch == '\r')
+ {
+ g_message("%s", logBuf.c_str());
+ logBuf.clear();
+ }
}
}
String stdOutBuf;
String stdErrBuf;
String stdOutBuf;
String stdErrBuf;
+ String logBuf;
};
};