melies-cvs Mailing List for melies
Status: Pre-Alpha
Brought to you by:
blackburst
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(20) |
Jul
(66) |
Aug
(30) |
Sep
(87) |
Oct
(6) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Anders D. <bla...@us...> - 2004-03-17 15:37:16
|
Update of /cvsroot/melies/meliesfx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32171 Modified Files: AUTHORS Log Message: Updated Index: AUTHORS =================================================================== RCS file: /cvsroot/melies/meliesfx/AUTHORS,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AUTHORS 2 Jul 2003 16:20:33 -0000 1.3 --- AUTHORS 17 Mar 2004 15:27:48 -0000 1.4 *************** *** 10,14 **** Ron Brinkman Drew Hess, Florian Kainz & Co - Martin Munthe Drew Perttula Timothy M. Shead --- 10,13 ---- |
From: <bla...@us...> - 2003-10-11 11:07:48
|
Update of /cvsroot/melies/meliesfx/sdk In directory sc8-pr-cvs1:/tmp/cvs-serv12125 Added Files: iimageinput.h iimageoutput.h iimagefactory.h Removed Files: iimage.h Log Message: * Refactored image i/o --- NEW FILE: iimageinput.h --- #ifndef SDK_IIMAGEINPUT_H #define SDK_IIMAGEINPUT_H // :: melies fx // Copyright (c) 2002-2003, Anders Dahnielson // // Contact: an...@da... // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA /** \file \brief Declares melies::iimageinput \author Anders Dahnielson (an...@da...) */ // Interfaces #include "iscanline.h" #include "iunknown.h" namespace melies { ///////////////////////////////////////////////////////////////////////////// // melies::iimageinput /// Abstract interface that encapsulates a image input object class iimageinput : public virtual iunknown { public: /// Read scanline virtual iscanline* Scanline() = 0; /// Get image width virtual const int Width() = 0; /// Get image height virtual const int Height() = 0; protected: iimageinput() {} iimageinput(const iimageinput& RHS); iimageinput& operator=(const iimageinput& RHS) { return *this; } virtual ~iimageinput() {} }; } // namespace melies #endif // SDK_IIMAGEINPUT_H --- NEW FILE: iimageoutput.h --- #ifndef SDK_IIMAGEOUTPUT_H #define SDK_IIMAGEOUTPUT_H // :: melies fx // Copyright (c) 2002-2003, Anders Dahnielson // // Contact: an...@da... // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA /** \file \brief Declares melies::iimageoutput \author Anders Dahnielson (an...@da...) */ // Interfaces #include "iscanline.h" #include "iunknown.h" namespace melies { ///////////////////////////////////////////////////////////////////////////// // melies::iimageoutput /// Abstract interface that encapsulates a image output object class iimageoutput : public virtual iunknown { public: /// Write scanline virtual void SetScanline(iscanline* pkScanline) = 0; /// Get image width virtual const int Width() = 0; /// Get image height virtual const int Height() = 0; protected: iimageoutput() {} iimageoutput(const iimageoutput& RHS); iimageoutput& operator=(const iimageoutput& RHS) { return *this; } virtual ~iimageoutput() {} }; } // namespace melies #endif // SDK_IIMAGEOUTPUT_H --- NEW FILE: iimagefactory.h --- #ifndef SDK_IIMAGEFACTORY_H #define SDK_IIMAGEFACTORY_H // :: melies fx // Copyright (c) 2002-2003, Anders Dahnielson // // Contact: an...@da... // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA /** \file \brief Declares melies::iimagefactory \author Anders Dahnielson (an...@da...) */ // Interfaces #include "iimageinput.h" #include "iimageoutput.h" #include "iunknown.h" namespace melies { ///////////////////////////////////////////////////////////////////////////// // melies::iimagefactory class iimagefactory : public virtual iunknown { public: virtual iimageinput* InputFile(std::string strFilePath) = 0; virtual iimageoutput* OutputFile(std::string strFilePath, const int iWidth, const int iHeight) = 0; protected: iimagefactory() {} iimagefactory(const iimagefactory& RHS); iimagefactory& operator=(const iimagefactory& RHS) { return *this; } virtual ~iimagefactory() {} }; } // namespace melies #endif // SDK_IIMAGEFACTORY_H --- iimage.h DELETED --- |
From: <bla...@us...> - 2003-10-10 10:56:52
|
Update of /cvsroot/melies/meliesfx/modules/python In directory sc8-pr-cvs1:/tmp/cvs-serv28327/modules/python Modified Files: objects.cpp Log Message: * Fixed the property assignment Index: objects.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/python/objects.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** objects.cpp 30 Sep 2003 18:40:37 -0000 1.3 --- objects.cpp 10 Oct 2003 10:56:39 -0000 1.4 *************** *** 627,638 **** boost::any value; ! if (prop->Type() == typeid(int)) ! value = boost::any(PyInt_AsLong(object)); ! else if (prop->Type() == typeid(long)) ! value = boost::any(PyLong_AsLong(object)); ! else if (prop->Type() == typeid(double)) ! value = boost::any(PyFloat_AsDouble(object)); ! else if (prop->Type() == typeid(std::string)) ! value = boost::any(PyString_AsString(object)); return (prop->SetValue(value)) ? PYVAL_TRUE : PYVAL_FALSE; --- 627,638 ---- boost::any value; ! if (PyInt_Check(object)) ! value = PyInt_AsLong(object); ! else if (PyLong_Check(object)) ! value = PyLong_AsLong(object); ! else if (PyFloat_Check(object)) ! value = PyFloat_AsDouble(object); ! else if (PyString_Check(object)) ! value = PyString_AsString(object); return (prop->SetValue(value)) ? PYVAL_TRUE : PYVAL_FALSE; |
From: <bla...@us...> - 2003-10-10 10:56:52
|
Update of /cvsroot/melies/meliesfx/sdk In directory sc8-pr-cvs1:/tmp/cvs-serv28327/sdk Modified Files: expression.cpp expression.h propertyproxy.h Log Message: * Fixed the property assignment Index: expression.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/sdk/expression.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** expression.cpp 23 Aug 2003 15:48:43 -0000 1.1 --- expression.cpp 10 Oct 2003 10:56:39 -0000 1.2 *************** *** 245,255 **** ///////////////////////////////////////////////////////////////////////////// ! // math_grammar ! // Encapsulates math grammar ! struct math_grammar : ! public grammar<math_grammar> { ! math_grammar(stack_t& rkStack, trace_t& rkTrace) : m_rkStack(rkStack), m_rkTrace(rkTrace) --- 245,255 ---- ///////////////////////////////////////////////////////////////////////////// ! // number_grammar ! // Encapsulates number grammar ! struct number_grammar : ! public grammar<number_grammar> { ! number_grammar(stack_t& rkStack, trace_t& rkTrace) : m_rkStack(rkStack), m_rkTrace(rkTrace) *************** *** 260,264 **** struct definition { ! definition(math_grammar const& self) { expression = --- 260,264 ---- struct definition { ! definition(number_grammar const& self) { expression = *************** *** 379,386 **** // Encapsulates image grammar ! struct general_grammar : ! public grammar<general_grammar> { ! general_grammar(trace_t& rkTrace) : m_rkTrace(rkTrace) { --- 379,386 ---- // Encapsulates image grammar ! struct image_grammar : ! public grammar<image_grammar> { ! image_grammar(trace_t& rkTrace) : m_rkTrace(rkTrace) { *************** *** 390,394 **** struct definition { ! definition(general_grammar const& self) { expression = --- 390,394 ---- struct definition { ! definition(image_grammar const& self) { expression = *************** *** 420,427 **** { ! // Evaluate math expression ! bool math(std::string strExpression, stack_t& rkStack, trace_t& rkTrace) { ! return boost::spirit::parse(strExpression.c_str(), math_grammar(rkStack, rkTrace), boost::spirit::space_p).full; } --- 420,427 ---- { ! // Evaluate number expression ! bool number(std::string strExpression, stack_t& rkStack, trace_t& rkTrace) { ! return boost::spirit::parse(strExpression.c_str(), number_grammar(rkStack, rkTrace), boost::spirit::space_p).full; } *************** *** 432,439 **** } ! // Evaluate general expression ! bool general(std::string strExpression, trace_t& rkTrace) { ! return boost::spirit::parse(strExpression.c_str(), general_grammar(rkTrace), boost::spirit::space_p).full; } --- 432,439 ---- } ! // Evaluate image expression ! bool image(std::string strExpression, trace_t& rkTrace) { ! return boost::spirit::parse(strExpression.c_str(), image_grammar(rkTrace), boost::spirit::space_p).full; } Index: expression.h =================================================================== RCS file: /cvsroot/melies/meliesfx/sdk/expression.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** expression.h 12 Sep 2003 16:53:36 -0000 1.2 --- expression.h 10 Oct 2003 10:56:39 -0000 1.3 *************** *** 51,62 **** typedef std::stack<double> stack_t; ! /// Evaluate math expression ! bool math(std::string strExpression, stack_t& rkStack, trace_t& rkTrace); /// Evaluate literal expression bool literal(std::string strExpression, trace_t& rkTrace, std::string& rstrLiteral); ! /// Evaluate general expression ! bool general(std::string strExpression, trace_t& rkTrace); } // namespace expression --- 51,62 ---- typedef std::stack<double> stack_t; ! /// Evaluate number expression ! bool number(std::string strExpression, stack_t& rkStack, trace_t& rkTrace); /// Evaluate literal expression bool literal(std::string strExpression, trace_t& rkTrace, std::string& rstrLiteral); ! /// Evaluate image expression ! bool image(std::string strExpression, trace_t& rkTrace); } // namespace expression Index: propertyproxy.h =================================================================== RCS file: /cvsroot/melies/meliesfx/sdk/propertyproxy.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** propertyproxy.h 22 Sep 2003 11:46:56 -0000 1.6 --- propertyproxy.h 10 Oct 2003 10:56:39 -0000 1.7 *************** *** 34,37 **** --- 34,43 ---- #include "result.h" + // Boost + #include <boost/lexical_cast.hpp> + + // STL + #include <iostream> + namespace melies { *************** *** 115,143 **** std::vector<SigC::Connection> m_kConnections; ! bool evaluate_expression() { try { ! m_kTrace.clear(); ! if (expression::general(boost::any_cast<std::string>(m_kExpression), m_kTrace)) ! { ! // If expression contain object.property name ! iproperty* pkProperty = dynamic_cast<ipropertycollection*>( ! application()->Document()->Object(boost::get<0>(m_kTrace[0])))->Property(boost::get<1>(m_kTrace[0])); ! m_kValue = boost::any_cast<T>(pkProperty->Value()); ! } else ! { ! // If expression contain actual value ! m_kValue = boost::any_cast<T>(m_kExpression); ! } ! m_changed_signal.emit(); ! return true; } catch (...) { ! return false; } } void add_dependency(std::string strObjectName, std::string strPropertyName) --- 121,154 ---- std::vector<SigC::Connection> m_kConnections; ! std::string expression_cast() { try { ! if (m_kExpression.type() == typeid(int)) ! return boost::lexical_cast<std::string>(boost::any_cast<int>(m_kExpression)); ! else if (m_kExpression.type() == typeid(long)) ! return boost::lexical_cast<std::string>(boost::any_cast<long>(m_kExpression)); ! else if (m_kExpression.type() == typeid(double)) ! return boost::lexical_cast<std::string>(boost::any_cast<double>(m_kExpression)); ! else if (m_kExpression.type() == typeid(float)) ! return boost::lexical_cast<std::string>(boost::any_cast<float>(m_kExpression)); ! else if (m_kExpression.type() == typeid(long)) ! return boost::any_cast<std::string>(m_kExpression); else ! return std::string(""); } catch (...) { ! return std::string(""); } } + + bool evaluate_expression() + { + // Note: This is just a fallback member function used where there are + // no specialization available. For specializations, see below. + + return false; + } void add_dependency(std::string strObjectName, std::string strPropertyName) *************** *** 169,175 **** { m_kTrace.clear(); ! if (expression::general(boost::any_cast<std::string>(m_kExpression), m_kTrace)) { - // If expression contain object.property name iproperty* pkProperty = dynamic_cast<ipropertycollection*>( application()->Document()->Object(boost::get<0>(m_kTrace[0])))->Property(boost::get<1>(m_kTrace[0])); --- 180,185 ---- { m_kTrace.clear(); ! if (expression::image(expression_cast(), m_kTrace)) { iproperty* pkProperty = dynamic_cast<ipropertycollection*>( application()->Document()->Object(boost::get<0>(m_kTrace[0])))->Property(boost::get<1>(m_kTrace[0])); *************** *** 196,200 **** m_kTrace.clear(); expression::stack_t kStack; ! if (expression::math(boost::any_cast<std::string>(m_kExpression), kStack, m_kTrace)) { m_kValue = kStack.top(); --- 206,210 ---- m_kTrace.clear(); expression::stack_t kStack; ! if (expression::number(expression_cast(), kStack, m_kTrace)) { m_kValue = kStack.top(); *************** *** 214,217 **** --- 224,255 ---- ///////////////////////////////////////////////////////////////////////////// + // melies::propertyproxy<float> + + /// Specialization of property proxy + template <> bool + propertyproxy<float>::evaluate_expression() + { + try + { + m_kTrace.clear(); + expression::stack_t kStack; + if (expression::number(expression_cast(), kStack, m_kTrace)) + { + m_kValue = static_cast<float>(kStack.top()); + m_changed_signal.emit(); + return true; + } + else + { + return false; + } + } + catch (...) + { + return false; + } + } + + ///////////////////////////////////////////////////////////////////////////// // melies::propertyproxy<int> *************** *** 224,228 **** m_kTrace.clear(); expression::stack_t kStack; ! if (expression::math(boost::any_cast<std::string>(m_kExpression), kStack, m_kTrace)) { m_kValue = static_cast<int>(kStack.top()); --- 262,266 ---- m_kTrace.clear(); expression::stack_t kStack; ! if (expression::number(expression_cast(), kStack, m_kTrace)) { m_kValue = static_cast<int>(kStack.top()); *************** *** 252,256 **** m_kTrace.clear(); std::string strLiteral; ! if (expression::literal(boost::any_cast<std::string>(m_kExpression), m_kTrace, strLiteral)) { if (strLiteral.size()) --- 290,294 ---- m_kTrace.clear(); std::string strLiteral; ! if (expression::literal(expression_cast(), m_kTrace, strLiteral)) { if (strLiteral.size()) |
From: <bla...@us...> - 2003-10-10 10:56:51
|
Update of /cvsroot/melies/meliesfx/share/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv28327/share/scripts Modified Files: test.py Log Message: * Fixed the property assignment Index: test.py =================================================================== RCS file: /cvsroot/melies/meliesfx/share/scripts/test.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test.py 29 Sep 2003 13:06:42 -0000 1.1 --- test.py 10 Oct 2003 10:56:39 -0000 1.2 *************** *** 9,19 **** # Assign the properties ! Application.Document.Objects.bg_plate.input = '"bg.####.exr"' ! Application.Document.Objects.fg_plate.input = '"fg.####.exr"' Application.Document.Objects.linear1.cPoint = '"0.5@1, 0@100"' ! Application.Document.Objects.brightness1.input = '"bg_plate"' ! Application.Document.Objects.brightness1.value = '"linear1"' ! Application.Document.Objects.brightness2.input = '"fg_plate"' ! Application.Document.Objects.brightness2.value = '"brightness1.value"' --- 9,19 ---- # Assign the properties ! Application.Document.Objects.bg_plate.imageName = '"bg.####.exr"' ! Application.Document.Objects.fg_plate.imageName = '"fg.####.exr"' Application.Document.Objects.linear1.cPoint = '"0.5@1, 0@100"' ! Application.Document.Objects.brightness1.input = "bg_plate" ! Application.Document.Objects.brightness1.value = "linear1" ! Application.Document.Objects.brightness2.input = "fg_plate" ! Application.Document.Objects.brightness2.value = "brightness1.value" |
From: <bla...@us...> - 2003-10-10 10:56:48
|
Update of /cvsroot/melies/meliesfx/share In directory sc8-pr-cvs1:/tmp/cvs-serv28327/share Modified Files: python.conf Log Message: * Fixed the property assignment Index: python.conf =================================================================== RCS file: /cvsroot/melies/meliesfx/share/python.conf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** python.conf 30 Sep 2003 18:40:38 -0000 1.2 --- python.conf 10 Oct 2003 10:56:39 -0000 1.3 *************** *** 1,9 **** # ! # python.config ! # by Anders Dahnielson # ! # This is the configuration file for the Python- ! # environment under Melies. # import Melies --- 1,25 ---- + # :: melies fx + # Copyright (c) 2002-2003, Anders Dahnielson # ! # Contact: an...@da... # ! # This program is free software; you can redistribute it and/or ! # modify it under the terms of the GNU General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This program is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # General Public License for more details. # + # You should have received a copy of the GNU General Public + # License along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + #/** \file + # \brief Configuration file for the Python environment under Melies + # \author Anders Dahnielson (an...@da...) + #*/ import Melies |
From: <bla...@us...> - 2003-10-08 10:07:55
|
Update of /cvsroot/melies/meliesfx In directory sc8-pr-cvs1:/tmp/cvs-serv27698 Modified Files: acinclude.m4 Log Message: * Fixed some macros Index: acinclude.m4 =================================================================== RCS file: /cvsroot/melies/meliesfx/acinclude.m4,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** acinclude.m4 29 Sep 2003 13:13:05 -0000 1.5 --- acinclude.m4 8 Oct 2003 10:07:50 -0000 1.6 *************** *** 161,166 **** AC_MSG_CHECKING([for OpenEXR]) ! if pkg-config --version OpenEXR >/dev/null 2>/dev/null; then ! MELIES_OPENEXR_VERSION=`pkg-config --version OpenEXR` MELIES_OPENEXR_CFLAGS=`pkg-config --cflags OpenEXR` MELIES_OPENEXR_LIBS=`pkg-config --libs OpenEXR` --- 161,166 ---- AC_MSG_CHECKING([for OpenEXR]) ! if pkg-config --exists OpenEXR >/dev/null 2>/dev/null; then ! MELIES_OPENEXR_VERSION=`pkg-config --modversion OpenEXR` MELIES_OPENEXR_CFLAGS=`pkg-config --cflags OpenEXR` MELIES_OPENEXR_LIBS=`pkg-config --libs OpenEXR` *************** *** 181,186 **** if test x$withval != xno; then if test x$withval == xyes; then ! if pkg-config --version Irend >/dev/null 2>/dev/null; then ! MELIES_IREND_VERSION=`pkg-config --version Irend` MELIES_IREND_CFLAGS=`pkg-config --cflags Irend` MELIES_IREND_LIBS=`pkg-config --libs Irend` --- 181,186 ---- if test x$withval != xno; then if test x$withval == xyes; then ! if pkg-config --exists Irend >/dev/null 2>/dev/null; then ! MELIES_IREND_VERSION=`pkg-config --modversion Irend` MELIES_IREND_CFLAGS=`pkg-config --cflags Irend` MELIES_IREND_LIBS=`pkg-config --libs Irend` |
From: <bla...@us...> - 2003-09-30 18:42:05
|
Update of /cvsroot/melies/meliesfx/share/man In directory sc8-pr-cvs1:/tmp/cvs-serv30926/share/man Modified Files: meliesfx.1.in Log Message: * Updated man page Index: meliesfx.1.in =================================================================== RCS file: /cvsroot/melies/meliesfx/share/man/meliesfx.1.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** meliesfx.1.in 29 Sep 2003 17:17:17 -0000 1.5 --- meliesfx.1.in 30 Sep 2003 18:42:01 -0000 1.6 *************** *** 17,20 **** --- 17,22 ---- .SH OPTIONS + Main application command-line options that overrides both defaults and the environment variables, below. Each user interface may also provide its own additional set of options. + .B -h, --help .RS *************** *** 25,29 **** [paths] .RS ! Overrides the path(s) for loading plugin libraries (this overrides both defaults and the MELIES_LIB_PATHS environment variable, below).Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE --- 27,31 ---- [paths] .RS ! Overrides the path(s) for loading plugin libraries. Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE *************** *** 31,35 **** [path] .RS ! Overrides the path for configuration files (this overrides both defaults and the MELIES_CONF_PATH environment variable, below). .RE --- 33,37 ---- [path] .RS ! Overrides the path for configuration files. .RE *************** *** 37,41 **** [path] .RS ! Overrides the path for storing temporary cache files (this overrides both defaults and the MELIES_CACHE_PATH environment variable, below). .RE --- 39,43 ---- [path] .RS ! Overrides the path for storing temporary cache files. .RE *************** *** 43,47 **** [path] .RS ! Overrides the path for share directory (this overrides both defaults and the MELIES_SHARE_PATH environment variable, below). .RE --- 45,49 ---- [path] .RS ! Overrides the path for share directory. .RE *************** *** 49,53 **** [document] .RS ! Specifies what document plugin to be used for managing documents (this overrides both defaults and the MELIES_DOCUMENT environment variable, below). .RE --- 51,55 ---- [document] .RS ! Specifies what document plugin to be used for managing documents. .RE *************** *** 55,59 **** [flipbook] .RS ! Specifies what flipbook plugin to be used (this overrides both defaults and the MELIES_FLIPBOOK environment variable, below). .RE --- 57,61 ---- [flipbook] .RS ! Specifies what flipbook plugin to be used. .RE *************** *** 61,65 **** [gui] .RS ! Specifies the type of graphical user interface to display (this overrides both defaults and the MELIES_GUI environment variable, below). .RE --- 63,67 ---- [gui] .RS ! Specifies the type of graphical user interface to display. .RE *************** *** 75,82 **** .SH ENVIRONMENT VARIABLES .B MELIES_LIB_PATHS .RS ! Overrides the path(s) for loading plugin libraries (this overrides the default, but can be overridden by the --libpaths option, above).Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE --- 77,85 ---- .SH ENVIRONMENT VARIABLES + The environment variabled overrides the defaults, but can be overridden in its turn by the command-line options, above. .B MELIES_LIB_PATHS .RS ! Overrides the path(s) for loading plugin libraries. Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE *************** *** 118,122 **** .SH COPYRIGHT ! Copyright (C) 2002-2003 Anders Dahnielson .br This software is licensed under the GNU General Public License; see the source for copying conditions. --- 121,125 ---- .SH COPYRIGHT ! Copyright (c) 2002-2003 Anders Dahnielson .br This software is licensed under the GNU General Public License; see the source for copying conditions. |
From: <bla...@us...> - 2003-09-30 18:40:43
|
Update of /cvsroot/melies/meliesfx/application In directory sc8-pr-cvs1:/tmp/cvs-serv30657/application Modified Files: application.cpp Makefile.am Log Message: * Fixed various things Index: application.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/application/application.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** application.cpp 29 Sep 2003 17:17:16 -0000 1.16 --- application.cpp 30 Sep 2003 18:40:38 -0000 1.17 *************** *** 133,149 **** { // Instance Document ! std::cout << "Loading document ... " << m_strDocumentName << std::endl; m_pkDocument = melies::factor_plugin<melies::idocument>(m_strDocumentName, m_vpkPlugins); ! return_if_fail(m_pkDocument); // Instance Flipbook ! std::cout << "Loading flipbook ... " << m_strFlipBookName << std::endl; m_pkFlipbook = melies::factor_plugin<melies::iflip>(m_strFlipBookName, m_vpkPlugins); ! return_if_fail(m_pkFlipbook); // Instance GUI ! std::cout << "Loading gui ... " << m_strGuiName << std::endl; m_pkGUI = melies::factor_plugin<melies::igui>(m_strGuiName, m_vpkPlugins); ! return_if_fail(m_pkGUI); m_pkGUI->Show(m_vstrOptions); } --- 133,174 ---- { // Instance Document ! std::cout << "Loading document (" << m_strDocumentName << ") ... "; m_pkDocument = melies::factor_plugin<melies::idocument>(m_strDocumentName, m_vpkPlugins); ! if (m_pkDocument) ! { ! std::cout << "done" << std::endl; ! } ! else ! { ! std::cout << "failed!" << std::endl; ! return; ! } // Instance Flipbook ! std::cout << "Loading flipbook (" << m_strFlipBookName << ") ... "; m_pkFlipbook = melies::factor_plugin<melies::iflip>(m_strFlipBookName, m_vpkPlugins); ! if (m_pkFlipbook) ! { ! std::cout << "done" << std::endl; ! } ! else ! { ! std::cout << "failed!" << std::endl; ! return; ! } // Instance GUI ! std::cout << "Loading gui (" << m_strGuiName << ") ... "; m_pkGUI = melies::factor_plugin<melies::igui>(m_strGuiName, m_vpkPlugins); ! if (m_pkGUI) ! { ! std::cout << "done" << std::endl; ! } ! else ! { ! std::cout << "failed!" << std::endl; ! return; ! } ! m_pkGUI->Show(m_vstrOptions); } Index: Makefile.am =================================================================== RCS file: /cvsroot/melies/meliesfx/application/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.am 23 Aug 2003 15:50:53 -0000 1.8 --- Makefile.am 30 Sep 2003 18:40:38 -0000 1.9 *************** *** 9,13 **** CXXFLAGS = $(GNUCXXFLAGS) ! AM_CXXFLAGS = -DLOG_DOMAIN=\"MELIES\" INCLUDES = -I$(top_srcdir) @MELIES_SIGC_CFLAGS@ @MELIES_GLIB_CFLAGS@ @MELIES_OPENEXR_CFLAGS@ @MELIES_IREND_CFLAGS@ AM_LDFLAGS = \ --- 9,13 ---- CXXFLAGS = $(GNUCXXFLAGS) ! AM_CXXFLAGS = -DLOG_DOMAIN=\"MELIESAPP\" INCLUDES = -I$(top_srcdir) @MELIES_SIGC_CFLAGS@ @MELIES_GLIB_CFLAGS@ @MELIES_OPENEXR_CFLAGS@ @MELIES_IREND_CFLAGS@ AM_LDFLAGS = \ |
From: <bla...@us...> - 2003-09-30 18:40:43
|
Update of /cvsroot/melies/meliesfx/modules/document In directory sc8-pr-cvs1:/tmp/cvs-serv30657/modules/document Modified Files: document.cpp Log Message: * Fixed various things Index: document.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/document/document.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** document.cpp 25 Sep 2003 12:58:36 -0000 1.7 --- document.cpp 30 Sep 2003 18:40:38 -0000 1.8 *************** *** 76,80 **** { // Sanity check ... ! return_val_if_fail(pkObject, false); if (!Object(pkObject->Label())) --- 76,80 ---- { // Sanity check ... ! return_val_if_fail(pkObject, false); if (!Object(pkObject->Label())) *************** *** 96,100 **** return *i; - throw 0; return 0; } --- 96,99 ---- |
From: <bla...@us...> - 2003-09-30 18:40:43
|
Update of /cvsroot/melies/meliesfx/share In directory sc8-pr-cvs1:/tmp/cvs-serv30657/share Modified Files: python.conf Log Message: * Fixed various things Index: python.conf =================================================================== RCS file: /cvsroot/melies/meliesfx/share/python.conf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** python.conf 29 Sep 2003 13:06:41 -0000 1.1 --- python.conf 30 Sep 2003 18:40:38 -0000 1.2 *************** *** 1,4 **** # ! # config.py # by Anders Dahnielson # --- 1,4 ---- # ! # python.config # by Anders Dahnielson # *************** *** 12,24 **** def __init__(self, object): ! self.__dict__['__data__'] = object return def __getattr__(self, name): ! if (name != '__data__'): return Melies.Object.Property(self.__data__, name) def __setattr__(self, name, value): ! if (name != '__data__'): return Melies.Object.SetProperty(self.__data__, name, value) --- 12,24 ---- def __init__(self, object): ! self.__dict__["__data__"] = object return def __getattr__(self, name): ! if (name != "__data__" and name != "__repr__"): return Melies.Object.Property(self.__data__, name) def __setattr__(self, name, value): ! if (name != "__data__" and name != "__repr__"): return Melies.Object.SetProperty(self.__data__, name, value) *************** *** 26,38 **** def __init__(self, document): ! self.__dict__['__data__'] = document return def __getattr__(self, name): ! if (name != '__data__'): return CObject(Melies.Document.Object(self.__data__, name)) ! def __setattr__(self, name, value): ! if (name != '__data__'): return Melies.Document.SetObject(self.__data__, name, value) --- 26,38 ---- def __init__(self, document): ! self.__dict__["__data__"] = document return def __getattr__(self, name): ! if (name != "__data__" and name != "__repr__"): return CObject(Melies.Document.Object(self.__data__, name)) ! def __setattr__(self, name, value): ! if (name != "__data__" and name != "__repr__"): return Melies.Document.SetObject(self.__data__, name, value) |
From: <bla...@us...> - 2003-09-30 18:40:42
|
Update of /cvsroot/melies/meliesfx/sdk In directory sc8-pr-cvs1:/tmp/cvs-serv30657/sdk Modified Files: propertycollection.h Log Message: * Fixed various things Index: propertycollection.h =================================================================== RCS file: /cvsroot/melies/meliesfx/sdk/propertycollection.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** propertycollection.h 23 Aug 2003 15:48:43 -0000 1.2 --- propertycollection.h 30 Sep 2003 18:40:38 -0000 1.3 *************** *** 53,62 **** iproperty* Property(std::string strProperty) ! { for (properties_t::iterator i = m_properties.begin(); i != m_properties.end(); ++i) if ((*i)->Name() == strProperty) return *i; - throw 0; return 0; } --- 53,61 ---- iproperty* Property(std::string strProperty) ! { for (properties_t::iterator i = m_properties.begin(); i != m_properties.end(); ++i) if ((*i)->Name() == strProperty) return *i; return 0; } |
From: <bla...@us...> - 2003-09-30 18:40:42
|
Update of /cvsroot/melies/meliesfx/modules/python In directory sc8-pr-cvs1:/tmp/cvs-serv30657/modules/python Modified Files: cli.cpp objects.cpp Log Message: * Fixed various things Index: cli.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/python/cli.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cli.cpp 29 Sep 2003 13:08:23 -0000 1.3 --- cli.cpp 30 Sep 2003 18:40:37 -0000 1.4 *************** *** 56,60 **** bool Show(const std::vector<std::string> vstrOptions) { ! std::cout << "Running with Python CLI ..." << std::endl; melies::application()->Execute("", "python"); PyRun_AnyFile(stdin, "stdin"); --- 56,60 ---- bool Show(const std::vector<std::string> vstrOptions) { ! std::cout << std::endl; melies::application()->Execute("", "python"); PyRun_AnyFile(stdin, "stdin"); Index: objects.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/python/objects.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** objects.cpp 29 Sep 2003 13:08:23 -0000 1.2 --- objects.cpp 30 Sep 2003 18:40:37 -0000 1.3 *************** *** 402,408 **** melies::idocument* doc = python_cast<melies::idocument*>(self); melies::ipluginfactory* factory = python_cast<melies::ipluginfactory*>(object); ! if (!doc || !factory) return PYVAL_FALSE; --- 402,412 ---- melies::idocument* doc = python_cast<melies::idocument*>(self); + + if (!doc) + return PYVAL_FALSE; + melies::ipluginfactory* factory = python_cast<melies::ipluginfactory*>(object); ! if (!factory) return PYVAL_FALSE; *************** *** 412,419 **** return PYVAL_FALSE; ! if (!doc->SetObject(obj)) return PYVAL_FALSE; ! if (!obj->SetLabel(std::string(name))) return PYVAL_FALSE; --- 416,423 ---- return PYVAL_FALSE; ! if (!obj->SetLabel(std::string(name))) return PYVAL_FALSE; ! if (!doc->SetObject(obj)) return PYVAL_FALSE; *************** *** 605,614 **** return PYVAL_FALSE; ! melies::ipropertycollection* props = python_cast<melies::ipropertycollection*>(self); if (!props) return PYVAL_FALSE; ! melies::iproperty* prop = props->Property(std::string(name)); if (!prop) --- 609,624 ---- return PYVAL_FALSE; ! melies::iobject* obj = python_cast<melies::iobject*>(self); ! ! if (!obj) ! return PYVAL_FALSE; ! ! melies::ipropertycollection* props = dynamic_cast<melies::ipropertycollection*>(obj); if (!props) return PYVAL_FALSE; ! std::string strName(name); ! melies::iproperty* prop = props->Property(strName); if (!prop) *************** *** 637,646 **** return PYVAL_FALSE; ! melies::ipropertycollection* props = python_cast<melies::ipropertycollection*>(self); if (!props) return PYVAL_FALSE; ! melies::iproperty* prop = props->Property(std::string(name)); if (!prop) --- 647,662 ---- return PYVAL_FALSE; ! melies::iobject* obj = python_cast<melies::iobject*>(self); ! ! if (!obj) ! return PYVAL_FALSE; ! ! melies::ipropertycollection* props = dynamic_cast<melies::ipropertycollection*>(obj); if (!props) return PYVAL_FALSE; ! std::string strName(name); ! melies::iproperty* prop = props->Property(strName); if (!prop) |
From: <bla...@us...> - 2003-09-30 18:37:55
|
Update of /cvsroot/melies/meliesfx/modules/source In directory sc8-pr-cvs1:/tmp/cvs-serv29998/modules/source Modified Files: module.cpp Makefile.am Added Files: filein.cpp Log Message: * Added FileIn to source module --- NEW FILE: filein.cpp --- // :: melies fx // Copyright (c) 2002-2003, Anders Dahnielson // // Contact: an...@da... // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA /** \file \brief Implementation of FileIn tool -- this is a simple first iteration \author Anders Dahnielson (an...@da...) */ // Interfaces #include <sdk/idocument.h> #include <sdk/iproperty.h> #include <sdk/itool.h> #include <sdk/module.h> #include <sdk/object.h> #include <sdk/propertycollection.h> #include <sdk/propertyproxy.h> #include <sdk/result.h> // STL #include <string> namespace { ///////////////////////////////////////////////////////////////////////////// // filein_implementation class filein_implementation : public melies::itool, public melies::object, public melies::propertycollection, public SigC::Object { public: filein_implementation() : object("FileIn"), m_strImageName("temp.tmp"), m_pkOutput(this), m_kImageNameProxy(m_strImageName, false, "imageName", "Image name [literal]", m_imagename_signal), m_kOutputProxy(m_pkOutput, true, "output", "Output image [image]", m_output_signal) { register_property(m_kImageNameProxy); register_property(m_kOutputProxy); } bool Attach(melies::iunknown* pkParent) { return_val_if_fail(pkParent, false); return true; } melies::iscanline* GetScanline(int iLine, std::string strChannel) { return 0; } bool AncestorOf(const std::string strAncestor) { if (strAncestor == Label()) return true; else return false; } static melies::ipluginfactory& get_factory() { static melies::pluginfactory<filein_implementation, melies::interface_list<melies::iobject, melies::interface_list<melies::itool> > > factory( "FileIn", "Read image" ); return factory; } private: // Properties std::string m_strImageName; melies::itool* m_pkOutput; // Proxies melies::propertyproxy<std::string> m_kImageNameProxy; melies::propertyproxy<melies::itool*> m_kOutputProxy; // Signals SigC::Signal0<void> m_imagename_signal; SigC::Signal0<void> m_output_signal; }; } // namespace namespace melies { namespace factory { namespace source { ////////////////////////////////////////////////////////////////////////////// // melies::factory::source::filein melies::ipluginfactory& filein() { return filein_implementation::get_factory(); } } // namespace source } // namespace factory } // namespace melies Index: module.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/source/module.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** module.cpp 3 Jul 2003 10:12:59 -0000 1.3 --- module.cpp 30 Sep 2003 18:37:49 -0000 1.4 *************** *** 33,37 **** namespace source { ! // plug factories here } // namespace source --- 33,38 ---- namespace source { ! ! extern melies::ipluginfactory& filein(); } // namespace source *************** *** 40,43 **** MELIES_MODULE_START(source, Registry) ! // register plugs here MELIES_MODULE_END --- 41,44 ---- MELIES_MODULE_START(source, Registry) ! Registry.RegisterPlugin(melies::factory::source::filein()); MELIES_MODULE_END Index: Makefile.am =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/source/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 27 Jun 2003 20:07:03 -0000 1.1 --- Makefile.am 30 Sep 2003 18:37:49 -0000 1.2 *************** *** 0 **** --- 1,9 ---- + lib_LTLIBRARIES = libmeliessource.la + + libmeliessource_la_SOURCES = \ + filein.cpp \ + module.cpp + + CXXFLAGS = $(GNUCXXFLAGS) + AM_CXXFLAGS = -DLOG_DOMAIN=\"SOURCELIB\" + INCLUDES = -I$(top_srcdir) @MELIES_SIGC_CFLAGS@ @MELIES_OPENEXR_CFLAGS@ @MELIES_IREND_CFLAGS@ |
From: <bla...@us...> - 2003-09-29 17:19:47
|
Update of /cvsroot/melies/meliesfx/sdk In directory sc8-pr-cvs1:/tmp/cvs-serv21296/sdk Modified Files: iscanline.h Log Message: * Updated the iscanline interface Index: iscanline.h =================================================================== RCS file: /cvsroot/melies/meliesfx/sdk/iscanline.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** iscanline.h 30 Jun 2003 17:29:09 -0000 1.1 --- iscanline.h 29 Sep 2003 17:19:36 -0000 1.2 *************** *** 26,29 **** --- 26,32 ---- */ + // Half + #include <half.h> + namespace melies { *************** *** 36,39 **** --- 39,49 ---- public virtual iunknown { + public: + /// Access individual pixels + virtual half& operator[](std::size_t i) = 0; + + /// Get scanline length + virtual std::size_t size() = 0; + protected: iscanline() {} |
From: <bla...@us...> - 2003-09-29 17:19:47
|
Update of /cvsroot/melies/meliesfx/modules/python In directory sc8-pr-cvs1:/tmp/cvs-serv21296/modules/python Modified Files: Makefile.am Log Message: * Updated the iscanline interface Index: Makefile.am =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/python/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 25 Sep 2003 16:16:57 -0000 1.4 --- Makefile.am 29 Sep 2003 17:19:36 -0000 1.5 *************** *** 13,15 **** CXXFLAGS = $(GNUCXXFLAGS) AM_CXXFLAGS = -DLOG_DOMAIN=\"PYTHONLIB\" ! AM_CPPFLAGS = -I$(top_srcdir) @MELIES_PYTHON_CFLAGS@ @MELIES_SIGC_CFLAGS@ --- 13,15 ---- CXXFLAGS = $(GNUCXXFLAGS) AM_CXXFLAGS = -DLOG_DOMAIN=\"PYTHONLIB\" ! AM_CPPFLAGS = -I$(top_srcdir) @MELIES_PYTHON_CFLAGS@ @MELIES_SIGC_CFLAGS@ @MELIES_OPENEXR_CFLAGS@ |
From: <bla...@us...> - 2003-09-29 17:17:31
|
Update of /cvsroot/melies/meliesfx/share/man In directory sc8-pr-cvs1:/tmp/cvs-serv20906/share/man Modified Files: meliesfx.1.in Log Message: * Updated defaults, commandline options, and environment variables Index: meliesfx.1.in =================================================================== RCS file: /cvsroot/melies/meliesfx/share/man/meliesfx.1.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** meliesfx.1.in 3 Jul 2003 12:04:52 -0000 1.4 --- meliesfx.1.in 29 Sep 2003 17:17:17 -0000 1.5 *************** *** 8,22 **** .SH DESCRIPTION ! melies fx is a 2d compositing system for film and video work where the main objective ! is rendering speed and flexible design not features. .PP ! In melies fx the compositing process is edited as a directed acylic graph where nodes ! represent image operations and connecting edges depict flow of image information. ! melies fx can either be run in GUI mode for interactive editing of the graph and ! previewing of comps or in command-line batch mode. .PP ! The graphs interactivly edited in the user interface is saved as human readable scripts. ! The renderer features full support for expression and control structures in ! scripts. .PP .RI "Please visit " "http://melies.sourceforge.net" " for more information." --- 8,16 ---- .SH DESCRIPTION ! melies fx is a 2d compositing system for film and video work where the main objective is rendering speed and flexible design not features. .PP ! In melies fx the compositing process is edited as a directed acylic graph where nodes represent image operations and connecting edges depict flow of image information. melies fx can either be run in GUI mode for interactive editing of the graph and previewing of comps or in command-line batch mode. .PP ! The graphs interactivly edited in the user interface is saved as human readable scripts. The renderer features full support for expression and control structures in scripts. .PP .RI "Please visit " "http://melies.sourceforge.net" " for more information." *************** *** 29,36 **** .B --libpaths ! [path] .RS ! Overrides the path(s) for loading plugin libraries (this overrides both defaults and the MELIES_LIB_PATHS environment variable, below). ! Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE --- 23,29 ---- .B --libpaths ! [paths] .RS ! Overrides the path(s) for loading plugin libraries (this overrides both defaults and the MELIES_LIB_PATHS environment variable, below).Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE *************** *** 44,60 **** [path] .RS ! Overrides the the path for storing temporary cache files (this overrides both defaults and the MELIES_CACHE_PATH environment variable, below). .RE ! .B --gui ! [gui type] .RS ! Specifies the type of graphical user interface to display (valid values are "none" or "graphite"). .RE ! .B --script ! [file] .RS ! Run script without graphical user interface and exit. .RE --- 37,65 ---- [path] .RS ! Overrides the path for storing temporary cache files (this overrides both defaults and the MELIES_CACHE_PATH environment variable, below). .RE ! .B --sharepath ! [path] .RS ! Overrides the path for share directory (this overrides both defaults and the MELIES_SHARE_PATH environment variable, below). .RE ! .B --document ! [document] .RS ! Specifies what document plugin to be used for managing documents (this overrides both defaults and the MELIES_DOCUMENT environment variable, below). ! .RE ! ! .B --flipbook ! [flipbook] ! .RS ! Specifies what flipbook plugin to be used (this overrides both defaults and the MELIES_FLIPBOOK environment variable, below). ! .RE ! ! .B --gui ! [gui] ! .RS ! Specifies the type of graphical user interface to display (this overrides both defaults and the MELIES_GUI environment variable, below). .RE *************** *** 73,78 **** .B MELIES_LIB_PATHS .RS ! Overrides the path(s) for loading plugin libraries (this overrides the default, but can be overridden by the --libpaths option, above). ! Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE --- 78,82 ---- .B MELIES_LIB_PATHS .RS ! Overrides the path(s) for loading plugin libraries (this overrides the default, but can be overridden by the --libpaths option, above).Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE *************** *** 92,95 **** --- 96,114 ---- .RE + .B MELIES_DOCUMENT + .RS + Overrides the default document plugin. + .RE + + .B MELIES_FLIPBOOK + .RS + Overrides the default flipbook plugin. + .RE + + .B MELIES_GUI + .RS + Overrides the default graphical user interface plugin. + .RE + .SH AUTHORS Written by Anders Dahnielson <bla...@us...>, and Mikael Sundell <msu...@us...> *************** *** 101,105 **** Copyright (C) 2002-2003 Anders Dahnielson .br ! This software is licensed under the GNU General Public License; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --- 120,124 ---- Copyright (C) 2002-2003 Anders Dahnielson .br ! This software is licensed under the GNU General Public License; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
From: <bla...@us...> - 2003-09-29 17:17:31
|
Update of /cvsroot/melies/meliesfx/application In directory sc8-pr-cvs1:/tmp/cvs-serv20906/application Modified Files: application.cpp main.cpp melies.in Log Message: * Updated defaults, commandline options, and environment variables Index: application.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/application/application.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** application.cpp 29 Sep 2003 12:59:35 -0000 1.15 --- application.cpp 29 Sep 2003 17:17:16 -0000 1.16 *************** *** 133,144 **** --- 133,147 ---- { // Instance Document + std::cout << "Loading document ... " << m_strDocumentName << std::endl; m_pkDocument = melies::factor_plugin<melies::idocument>(m_strDocumentName, m_vpkPlugins); return_if_fail(m_pkDocument); // Instance Flipbook + std::cout << "Loading flipbook ... " << m_strFlipBookName << std::endl; m_pkFlipbook = melies::factor_plugin<melies::iflip>(m_strFlipBookName, m_vpkPlugins); return_if_fail(m_pkFlipbook); // Instance GUI + std::cout << "Loading gui ... " << m_strGuiName << std::endl; m_pkGUI = melies::factor_plugin<melies::igui>(m_strGuiName, m_vpkPlugins); return_if_fail(m_pkGUI); Index: main.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/application/main.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** main.cpp 29 Sep 2003 12:59:35 -0000 1.11 --- main.cpp 29 Sep 2003 17:17:17 -0000 1.12 *************** *** 179,183 **** } ! g_strGuiName = (*option); } else if((*option) == "--flipbook") --- 179,183 ---- } ! g_strDocumentName = (*option); } else if((*option) == "--flipbook") *************** *** 190,194 **** } ! g_strGuiName = (*option); } else if((*option) == "--gui") --- 190,194 ---- } ! g_strFlipBookName = (*option); } else if((*option) == "--gui") *************** *** 292,296 **** melies::iplugincollection* pkPlugins = melies::factory::plugincollection(); pkPlugins->LoadModules(g_strLibPaths, true); ! // Create the main application object ... melies::iapplication* const application = melies::factory::application( --- 292,296 ---- melies::iplugincollection* pkPlugins = melies::factory::plugincollection(); pkPlugins->LoadModules(g_strLibPaths, true); ! // Create the main application object ... melies::iapplication* const application = melies::factory::application( Index: melies.in =================================================================== RCS file: /cvsroot/melies/meliesfx/application/melies.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** melies.in 2 Jul 2003 16:17:53 -0000 1.1 --- melies.in 29 Sep 2003 17:17:17 -0000 1.2 *************** *** 57,60 **** --- 57,82 ---- ##################################################### + # Setup plugin defaults that can be overridden ... + + melies_document=document + melies_flipbook=flipbook + melies_gui=none + + ###################################################### + # Override plugin defaults with environment variables + + if [ -n "$MELIES_DOCUMENT" ]; then + melies_document=$MELIES_DOCUMENT + fi + + if [ -n "$MELIES_FLIPBOOK" ]; then + melies_flipbook=$MELIES_FLIPBOOK + fi + + if [ -n "$MELIES_GUI" ]; then + melies_gui=$MELIES_GUI + fi + + ##################################################### # Look for arguments that allow us to return immediately ... *************** *** 96,98 **** --- 118,123 ---- --cachepath $melies_cache \ --sharepath $melies_share \ + --document $melies_document \ + --flipbook $melies_flipbook \ + --gui $melies_gui \ $arguments |
From: <bla...@us...> - 2003-09-29 15:42:28
|
Update of /cvsroot/melies/meliesfx/application In directory sc8-pr-cvs1:/tmp/cvs-serv30141/application Modified Files: application.cpp main.cpp factory.h Log Message: * Added commandline options for document and flipbook as well, gui now defaults to none Index: application.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/application/application.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** application.cpp 25 Sep 2003 16:15:01 -0000 1.14 --- application.cpp 29 Sep 2003 12:59:35 -0000 1.15 *************** *** 62,65 **** --- 62,67 ---- const std::string strCachePath, const std::string strSharePath, + const std::string strDocumentName, + const std::string strFlipBookName, const std::string strGuiName ) : *************** *** 69,72 **** --- 71,76 ---- m_strCachePath(strCachePath), m_strSharePath(strSharePath), + m_strDocumentName(strDocumentName), + m_strFlipBookName(strFlipBookName), m_strGuiName(strGuiName), m_pkDocument(0), *************** *** 129,137 **** { // Instance Document ! m_pkDocument = melies::factor_plugin<melies::idocument>("document", m_vpkPlugins); return_if_fail(m_pkDocument); // Instance Flipbook ! m_pkFlipbook = melies::factor_plugin<melies::iflip>("flipbook", m_vpkPlugins); return_if_fail(m_pkFlipbook); --- 133,141 ---- { // Instance Document ! m_pkDocument = melies::factor_plugin<melies::idocument>(m_strDocumentName, m_vpkPlugins); return_if_fail(m_pkDocument); // Instance Flipbook ! m_pkFlipbook = melies::factor_plugin<melies::iflip>(m_strFlipBookName, m_vpkPlugins); return_if_fail(m_pkFlipbook); *************** *** 182,185 **** --- 186,191 ---- const std::string m_strCachePath; const std::string m_strSharePath; + const std::string m_strDocumentName; + const std::string m_strFlipBookName; const std::string m_strGuiName; *************** *** 217,225 **** const std::string strCachePath, const std::string strSharePath, const std::string strGuiName ) { if (!g_pkInstance) ! g_pkInstance = new application_implementation(pkPlugins, vstrOptions, strConfigPath, strCachePath, strSharePath, strGuiName); return g_pkInstance; --- 223,242 ---- const std::string strCachePath, const std::string strSharePath, + const std::string strDocumentName, + const std::string strFlipBookName, const std::string strGuiName ) { if (!g_pkInstance) ! g_pkInstance = new application_implementation( ! pkPlugins, ! vstrOptions, ! strConfigPath, ! strCachePath, ! strSharePath, ! strDocumentName, ! strFlipBookName, ! strGuiName ! ); return g_pkInstance; Index: main.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/application/main.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** main.cpp 25 Sep 2003 12:58:36 -0000 1.10 --- main.cpp 29 Sep 2003 12:59:35 -0000 1.11 *************** *** 47,51 **** bool g_bVerbose = false; ! std::string g_strGuiName = "graphite"; std::string g_strLibPaths = "./"; std::string g_strConfigPath = "./"; --- 47,53 ---- bool g_bVerbose = false; ! std::string g_strDocumentName = "document"; ! std::string g_strFlipBookName = "flipbook"; ! std::string g_strGuiName = "none"; std::string g_strLibPaths = "./"; std::string g_strConfigPath = "./"; *************** *** 111,114 **** --- 113,118 ---- Stream << " --cachepath [path] overrides cache path" << std::endl; Stream << " --sharepath [path] overrides share path" << std::endl; + Stream << " --document [name] overrides document to be used" << std::endl; + Stream << " --flipbook [name] overrides flipbook to be used" << std::endl; Stream << " --gui [name] overrides graphical user interface to be used" << std::endl; Stream << " --version prints program version information and exits" << std::endl; *************** *** 166,170 **** for(stringarray::const_iterator option = Options.begin(); option != Options.end(); ++option) { ! if((*option) == "--gui") { ++option; --- 170,196 ---- for(stringarray::const_iterator option = Options.begin(); option != Options.end(); ++option) { ! if((*option) == "--document") ! { ! ++option; ! if(option == Options.end()) ! { ! handle_error("You must supply a valid document type with the --document option!", Quit, Error); ! return stringarray(); ! } ! ! g_strGuiName = (*option); ! } ! else if((*option) == "--flipbook") ! { ! ++option; ! if(option == Options.end()) ! { ! handle_error("You must supply a valid flipbook type with the --flipbook option!", Quit, Error); ! return stringarray(); ! } ! ! g_strGuiName = (*option); ! } ! else if((*option) == "--gui") { ++option; *************** *** 182,186 **** if(option == Options.end()) { ! handle_error("You must supply a directory path with the --libpath option!", Quit, Error); return stringarray(); } --- 208,212 ---- if(option == Options.end()) { ! handle_error("You must supply a directory path with the --libpaths option!", Quit, Error); return stringarray(); } *************** *** 274,278 **** g_strCachePath, g_strSharePath, ! g_strGuiName); // Enter main loop --- 300,307 ---- g_strCachePath, g_strSharePath, ! g_strDocumentName, ! g_strFlipBookName, ! g_strGuiName ! ); // Enter main loop Index: factory.h =================================================================== RCS file: /cvsroot/melies/meliesfx/application/factory.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** factory.h 25 Sep 2003 12:58:36 -0000 1.9 --- factory.h 29 Sep 2003 12:59:35 -0000 1.10 *************** *** 39,43 **** /// Create a application object ! melies::iapplication* application(melies::iplugincollection* pkPlugins, const std::vector<std::string> vstrOptions, const std::string strConfigPath, const std::string strCachePath, const std::string strSharePath, const std::string strGuiName); /// Create a plugincollection object --- 39,52 ---- /// Create a application object ! melies::iapplication* application( ! melies::iplugincollection* pkPlugins, ! const std::vector<std::string> vstrOptions, ! const std::string strConfigPath, ! const std::string strCachePath, ! const std::string strSharePath, ! const std::string strDocumentName, ! const std::string strFlipBookName, ! const std::string strGuiName ! ); /// Create a plugincollection object |
From: <bla...@us...> - 2003-09-29 13:17:04
|
Update of /cvsroot/melies/meliesfx/modules/python In directory sc8-pr-cvs1:/tmp/cvs-serv1907 Removed Files: pythonmacros.h Log Message: * Removed --- pythonmacros.h DELETED --- |
From: <bla...@us...> - 2003-09-29 13:15:55
|
Update of /cvsroot/melies/meliesfx/share/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv1685 Removed Files: test Log Message: * Removed --- test DELETED --- |
From: <bla...@us...> - 2003-09-29 13:13:22
|
Update of /cvsroot/melies/meliesfx In directory sc8-pr-cvs1:/tmp/cvs-serv1089 Modified Files: acinclude.m4 configure.ac Log Message: * Updated build system Index: acinclude.m4 =================================================================== RCS file: /cvsroot/melies/meliesfx/acinclude.m4,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** acinclude.m4 24 Sep 2003 19:20:24 -0000 1.4 --- acinclude.m4 29 Sep 2003 13:13:05 -0000 1.5 *************** *** 225,228 **** --- 225,244 ---- ######################################################## + # MELIES_WITH_QT + + AC_DEFUN(MELIES_WITH_QT, [ + AC_SUBST(MELIES_QT_SUBDIR) + AC_ARG_WITH(fltk, [ --with-qt build Qt-based GUI [[no]]],[],[withval=no]) + if test x$withval != xno; then + AC_CHECK_PROG(melies_have_qmake, qmake, yes, no) + if test x$melies_have_qmake == xno; then + AC_MSG_ERROR([couldn't find qmake ...]) + else + MELIES_QT_SUBDIR="quart" + fi + fi + ]) + + ######################################################## # MELIES_WITH_JAVASCRIPT Index: configure.ac =================================================================== RCS file: /cvsroot/melies/meliesfx/configure.ac,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** configure.ac 24 Sep 2003 19:20:25 -0000 1.12 --- configure.ac 29 Sep 2003 13:13:05 -0000 1.13 *************** *** 20,23 **** --- 20,24 ---- MELIES_WITH_FLTK + MELIES_WITH_QT MELIES_WITH_JAVASCRIPT *************** *** 59,62 **** --- 60,64 ---- modules/flipbook/Makefile \ modules/graphite/Makefile \ + modules/gem/Makefile \ modules/iff/Makefile \ modules/javascript/Makefile \ *************** *** 71,74 **** --- 73,77 ---- modules/png/Makefile \ modules/python/Makefile \ + modules/quart/Makefile \ modules/ruby/Makefile \ modules/sgi/Makefile \ |
From: <bla...@us...> - 2003-09-29 13:13:22
|
Update of /cvsroot/melies/meliesfx/modules In directory sc8-pr-cvs1:/tmp/cvs-serv1089/modules Modified Files: Makefile.am Log Message: * Updated build system Index: Makefile.am =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.am 24 Sep 2003 19:20:25 -0000 1.7 --- Makefile.am 29 Sep 2003 13:13:05 -0000 1.8 *************** *** 22,25 **** --- 22,26 ---- png \ @MELIES_PYTHON_SUBDIR@ \ + @MELIES_QT_SUBDIR@ \ @MELIES_RUBY_SUBDIR@ \ sgi \ |
From: <bla...@us...> - 2003-09-29 13:12:38
|
Update of /cvsroot/melies/meliesfx/modules/flipbook In directory sc8-pr-cvs1:/tmp/cvs-serv926/modules/flipbook Modified Files: flipbook.cpp Log Message: * Fix: Removed 'virtual' ... shouldn't be there in the first place Index: flipbook.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/flipbook/flipbook.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** flipbook.cpp 25 Sep 2003 12:58:37 -0000 1.5 --- flipbook.cpp 29 Sep 2003 13:12:21 -0000 1.6 *************** *** 51,59 **** } ! virtual void Play() { } ! virtual void Stop() { } --- 51,59 ---- } ! void Play() { } ! void Stop() { } |
From: <bla...@us...> - 2003-09-29 13:08:42
|
Update of /cvsroot/melies/meliesfx/modules/python In directory sc8-pr-cvs1:/tmp/cvs-serv32611/modules/python Modified Files: cli.cpp extlang.cpp objects.cpp objects.h pythonmacros.h Log Message: * Added functionality to the python environment Index: cli.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/python/cli.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cli.cpp 25 Sep 2003 16:16:57 -0000 1.2 --- cli.cpp 29 Sep 2003 13:08:23 -0000 1.3 *************** *** 23,26 **** --- 23,29 ---- */ + // Python + #include "objects.h" + // Interface #include <sdk/iapplication.h> *************** *** 53,65 **** bool Show(const std::vector<std::string> vstrOptions) { - std::string input; std::cout << "Running with Python CLI ..." << std::endl; ! ! while(1) ! { ! std::cin >> input; ! if (!input.empty()) ! melies::application()->Execute(input, "python"); ! } return true; --- 56,62 ---- bool Show(const std::vector<std::string> vstrOptions) { std::cout << "Running with Python CLI ..." << std::endl; ! melies::application()->Execute("", "python"); ! PyRun_AnyFile(stdin, "stdin"); return true; Index: extlang.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/python/extlang.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** extlang.cpp 25 Sep 2003 16:16:57 -0000 1.3 --- extlang.cpp 29 Sep 2003 13:08:23 -0000 1.4 *************** *** 32,35 **** --- 32,38 ---- #include <sdk/result.h> + // STL + #include <string> + namespace { *************** *** 61,66 **** { Py_Initialize(); ! Py_InitModule("Application", PyApplicationModule::Methods); ! PyRun_SimpleString("import Application"); } } --- 64,85 ---- { Py_Initialize(); ! ! PyObject* module = PyMelies_New(); ! ! PyObject* app = PyApplication_New(); ! PyObject* flip = PyFlipBook_New(); ! PyObject* doc = PyDocument_New(); ! PyObject* gui = PyUserInterface_New(); ! PyObject* obj = PyObjekt_New(); ! ! PyModule_AddObject(module, "Application", app); ! PyModule_AddObject(module, "FlipBook", flip); ! PyModule_AddObject(module, "Document", doc); ! PyModule_AddObject(module, "UserInterface", gui); ! PyModule_AddObject(module, "Object", obj); ! ! std::string strFile = melies::application()->ConfigPath() + "/python.conf"; ! FILE *fp = fopen(strFile.c_str(), "r"); ! PyRun_SimpleFile(fp, (char*)strFile.c_str()); } } Index: objects.cpp =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/python/objects.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** objects.cpp 25 Sep 2003 16:16:57 -0000 1.1 --- objects.cpp 29 Sep 2003 13:08:23 -0000 1.2 *************** *** 18,143 **** // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #include <iostream> #include <sdk/iapplication.h> ! #include "objects.h" ! PyMethodDef PyApplicationModule::Methods[] = { - {"ConfigPath", ConfigPath, METH_VARARGS, "Returns the absolute path to the configure directory"}, - {"CachePath", CachePath, METH_VARARGS, "Returns the absolute path to the cache directory"}, - {"SharePath", SharePath, METH_VARARGS, "Returns the absolute path to the share directory"}, - {"ScriptPath", ScriptPath, METH_VARARGS, " Return the path to the loaded script"}, - {"GuiName", GuiName, METH_VARARGS, "Return name of the loaded GUI"}, ! {"FlipBook", FlipBook, METH_VARARGS, "Return the flipbook object"}, ! {"Plugins", Plugins, METH_VARARGS, "Return collection of loaded plugins"}, ! {"Document", Document, METH_VARARGS, "Return the document object"}, ! {"UserInterface", UserInterface, METH_VARARGS, "Return the user interface object"}, ! {"Load", Load, METH_VARARGS, "Load document from file"}, ! {"Save", Save, METH_VARARGS, "Save document to file"}, ! {"Execute", Execute, METH_VARARGS, "Execute extension language script"}, ! {"Quit", Quit, METH_VARARGS, "Quit the application"}, ! {"Print", Print, METH_VARARGS, "cout"}, ! {"Error", Quit, METH_VARARGS, "cerr"}, ! {NULL, NULL, 0, NULL} ! }; ! PyObject* PyApplicationModule::ConfigPath(PyObject *self, PyObject *args) ! { ! return StringToPyVal(melies::application()->ConfigPath()); ! } ! PyObject* PyApplicationModule::CachePath(PyObject *self, PyObject *args) ! { ! return StringToPyVal(melies::application()->CachePath()); ! } ! PyObject* PyApplicationModule::SharePath(PyObject *self, PyObject *args) ! { ! return StringToPyVal(melies::application()->SharePath()); ! } ! PyObject* PyApplicationModule::ScriptPath(PyObject *self, PyObject *args) ! { ! return StringToPyVal(melies::application()->ScriptPath()); ! } ! PyObject* PyApplicationModule::GuiName(PyObject *self, PyObject *args) ! { ! return StringToPyVal(melies::application()->GuiName()); ! } ! PyObject* PyApplicationModule::FlipBook(PyObject *self, PyObject *args) ! { ! return PYVAL_NONE; ! } ! PyObject* PyApplicationModule::Plugins(PyObject *self, PyObject *args) { ! return PYVAL_NONE; } ! PyObject* PyApplicationModule::Document(PyObject *self, PyObject *args) { - return PYVAL_NONE; - } ! PyObject* PyApplicationModule::UserInterface(PyObject *self, PyObject *args) { ! return PYVAL_NONE; } ! PyObject* PyApplicationModule::Load(PyObject *self, PyObject *args) { - return PYVAL_NONE; - } ! PyObject* PyApplicationModule::Save(PyObject *self, PyObject *args) { ! return PYVAL_NONE; } ! PyObject* PyApplicationModule::Execute(PyObject *self, PyObject *args) { - return PYVAL_NONE; - } ! PyObject* PyApplicationModule::Quit(PyObject *self, PyObject *args) { ! melies::application()->Quit(); ! return PYVAL_NONE; } ! PyObject* PyApplicationModule::Print(PyObject *self, PyObject *args) { - PyObject *object1; ! if(!PyArg_ParseTuple(args, "O", &object1)) ! return PYVAL_FALSE; ! if(!PyString_Check(object1)) ! return PYVAL_FALSE; ! std::cout << PyString_AsString(object1); ! return PYVAL_NONE; ! } ! PyObject* PyApplicationModule::Error(PyObject *self, PyObject *args) { ! PyObject *object1; ! if(!PyArg_ParseTuple(args, "O", &object1)) ! return PYVAL_FALSE; ! if(!PyString_Check(object1)) ! return PYVAL_FALSE; ! std::cerr << PyString_AsString(object1); ! return PYVAL_NONE; } --- 18,691 ---- // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // Python ! #include "objects.h" + // Interface #include <sdk/iapplication.h> ! #include <sdk/icurve.h> ! #include <sdk/idocument.h> ! #include <sdk/iflip.h> ! #include <sdk/igui.h> ! #include <sdk/iobject.h> ! #include <sdk/iplugincollection.h> ! #include <sdk/iproperty.h> ! #include <sdk/ipropertycollection.h> ! #include <sdk/itool.h> ! // STL ! #include <iostream> ! #include <string> ! ! // Boost ! #include <boost/any.hpp> ! ! ///////////////////////////////////////////////////////////////////// ! // PyMelies ! ! namespace PyMelies { ! static PyObject* application(PyObject*, PyObject *args) ! { ! return ObjectToPyVal(melies::application()); ! } ! static PyObject* curve(PyObject*, PyObject *args) ! { ! char* name; ! if(!PyArg_ParseTuple(args, "s", &name)) ! return PYVAL_FALSE; ! melies::iplugincollection::factories_t kPlugins = melies::application()->Plugins(); ! for (melies::iplugincollection::factories_t::iterator i = kPlugins.begin(); i != kPlugins.end(); ++i) ! { ! if ((*i)->Implements(typeid(melies::icurve)) && (*i)->Name() == name) ! return ObjectToPyVal(*i); ! } ! return PYVAL_NONE; ! } ! static PyObject* tool(PyObject*, PyObject *args) ! { ! char* name; ! if(!PyArg_ParseTuple(args, "s", &name)) ! return PYVAL_FALSE; ! melies::iplugincollection::factories_t kPlugins = melies::application()->Plugins(); ! for (melies::iplugincollection::factories_t::iterator i = kPlugins.begin(); i != kPlugins.end(); ++i) ! { ! if ((*i)->Implements(typeid(melies::itool)) && (*i)->Name() == name) ! return ObjectToPyVal(*i); ! } ! return PYVAL_NONE; ! } ! static PyMethodDef Methods[] = ! { ! {"application", application, METH_VARARGS, ""}, ! {"curve", curve, METH_VARARGS, ""}, ! {"tool", tool, METH_VARARGS, ""}, ! {NULL} ! }; ! } // PyMelies ! ! PyObject* PyMelies_New() { ! return Py_InitModule("Melies", PyMelies::Methods); } ! ///////////////////////////////////////////////////////////////////// ! // PyApplication ! ! namespace PyApplication { ! static PyObject* ConfigPath(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! return StringToPyVal(app->ConfigPath()); ! } ! ! static PyObject* CachePath(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! return StringToPyVal(app->CachePath()); ! } ! ! static PyObject* SharePath(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! return StringToPyVal(app->SharePath()); ! } ! ! static PyObject* ScriptPath(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! return StringToPyVal(app->ScriptPath()); ! } ! ! static PyObject* GuiName(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! return StringToPyVal(app->GuiName()); ! } ! ! static PyObject* FlipBook(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! return ObjectToPyVal(app->FlipBook()); ! } ! ! static PyObject* Document(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! return ObjectToPyVal(app->Document());; ! } ! ! static PyObject* UserInterface(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! return ObjectToPyVal(app->UserInterface());; ! } ! ! static PyObject* Load(PyObject*, PyObject *args) ! { ! PyObject *self; ! char *strFilePath, *strType; ! ! if(!PyArg_ParseTuple(args, "Oss", &self, &strFilePath, &strType)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! app->Load(std::string(strFilePath), std::string(strType)); ! return PYVAL_NONE; ! } ! ! static PyObject* Save(PyObject*, PyObject *args) ! { ! PyObject *self; ! char *strFilePath, *strType; ! ! if(!PyArg_ParseTuple(args, "Oss", &self, &strFilePath, &strType)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! app->Save(std::string(strFilePath), std::string(strType)); ! return PYVAL_NONE; ! } ! ! static PyObject* Execute(PyObject*, PyObject *args) ! { ! PyObject *self; ! char *strFilePath, *strType; ! ! if(!PyArg_ParseTuple(args, "Oss", &self, &strFilePath, &strType)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! app->Execute(std::string(strFilePath), std::string(strType)); ! return PYVAL_NONE; ! } ! ! static PyObject* Quit(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iapplication* app = python_cast<melies::iapplication*>(self); ! ! if (!app) ! return PYVAL_FALSE; ! ! app->Quit(); ! return PYVAL_NONE; ! } ! ! static PyMethodDef Methods[] = ! { ! {"ConfigPath", ConfigPath, METH_VARARGS, ""}, ! {"CachePath", CachePath, METH_VARARGS, ""}, ! {"SharePath", SharePath, METH_VARARGS, ""}, ! {"ScriptPath", ScriptPath, METH_VARARGS, ""}, ! {"GuiName", GuiName, METH_VARARGS, ""}, ! ! {"FlipBook", FlipBook, METH_VARARGS, ""}, ! {"Document", Document, METH_VARARGS, ""}, ! {"UserInterface", UserInterface, METH_VARARGS, ""}, ! ! {"Load", Load, METH_VARARGS, ""}, ! {"Save", Save, METH_VARARGS, ""}, ! {"Execute", Execute, METH_VARARGS, ""}, ! {"Quit", Quit, METH_VARARGS, ""}, ! ! {NULL} ! }; ! ! } // PyApplication ! ! PyObject* PyApplication_New() { ! return Py_InitModule("Application", PyApplication::Methods); } ! ///////////////////////////////////////////////////////////////////// ! // PyFlipBookClass ! ! namespace PyFlipBook { ! static PyObject* Play(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iflip* flip = python_cast<melies::iflip*>(self); ! ! if (!flip) ! return PYVAL_FALSE; ! ! flip->Play(); ! return PYVAL_NONE; ! } ! ! static PyObject* Stop(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::iflip* flip = python_cast<melies::iflip*>(self); ! ! if (!flip) ! return PYVAL_FALSE; ! ! flip->Stop(); ! return PYVAL_NONE; ! } ! ! static PyMethodDef Methods[] = ! { ! {"Play", Play, METH_VARARGS, ""}, ! {"Stop", Stop, METH_VARARGS, ""}, ! {NULL} ! }; ! ! } // PyFlipBook ! ! PyObject* PyFlipBook_New() { ! return Py_InitModule("FlipBook", PyFlipBook::Methods); } ! ///////////////////////////////////////////////////////////////////// ! // PyDocument ! ! namespace PyDocument { ! static PyObject* Clear(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! return (doc->Clear()) ? PYVAL_TRUE : PYVAL_FALSE; ! } ! ! static PyObject* SetObject(PyObject*, PyObject *args) ! { ! PyObject *self, *object; ! char* name; ! ! if(!PyArg_ParseTuple(args, "OsO", &self, &name, &object)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! melies::ipluginfactory* factory = python_cast<melies::ipluginfactory*>(object); ! ! if (!doc || !factory) ! return PYVAL_FALSE; ! ! melies::iobject* obj = dynamic_cast<melies::iobject*>(factory->Create()); ! ! if (!obj) ! return PYVAL_FALSE; ! ! if (!doc->SetObject(obj)) ! return PYVAL_FALSE; ! ! if (!obj->SetLabel(std::string(name))) ! return PYVAL_FALSE; ! ! return PYVAL_TRUE; ! } ! ! static PyObject* Object(PyObject*, PyObject *args) ! { ! PyObject *self; ! char* label; ! ! if(!PyArg_ParseTuple(args, "Os", &self, &label)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! melies::iobject* obj = doc->Object(std::string(label)); ! ! if (!obj) ! return PYVAL_FALSE; ! ! return ObjectToPyVal(obj); ! } ! ! static PyObject* SetTime(PyObject*, PyObject *args) ! { ! PyObject *self; ! int time; ! ! if(!PyArg_ParseTuple(args, "Oi", &self, &time)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! return (doc->SetTime(time)) ? PYVAL_TRUE : PYVAL_FALSE; ! } ! ! static PyObject* Time(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! return IntToPyVal(doc->Time()); ! } ! ! static PyObject* SetStart(PyObject*, PyObject *args) ! { ! PyObject *self; ! int start; ! ! if(!PyArg_ParseTuple(args, "Oi", &self, &start)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! return (doc->SetStart(start)) ? PYVAL_TRUE : PYVAL_FALSE; ! } ! ! static PyObject* Start(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! return IntToPyVal(doc->Start()); ! } ! ! static PyObject* SetEnd(PyObject*, PyObject *args) ! { ! PyObject *self; ! int end; ! ! if(!PyArg_ParseTuple(args, "Oi", &self, &end)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! return (doc->SetEnd(end)) ? PYVAL_TRUE : PYVAL_FALSE; ! } ! ! static PyObject* End(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! return IntToPyVal(doc->End()); ! } ! ! static PyObject* SetFPS(PyObject*, PyObject *args) ! { ! PyObject *self; ! int fps; ! ! if(!PyArg_ParseTuple(args, "Oi", &self, &fps)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! return (doc->SetFPS(fps)) ? PYVAL_TRUE : PYVAL_FALSE; ! } ! ! static PyObject* FPS(PyObject*, PyObject *args) ! { ! PyObject *self; ! ! if(!PyArg_ParseTuple(args, "O", &self)) ! return PYVAL_FALSE; ! ! melies::idocument* doc = python_cast<melies::idocument*>(self); ! ! if (!doc) ! return PYVAL_FALSE; ! ! return IntToPyVal(doc->FPS()); ! } ! ! static PyMethodDef Methods[] = ! { ! {"Clear", Clear, METH_VARARGS, ""}, ! {"SetObject", SetObject, METH_VARARGS, ""}, ! {"Object", Object, METH_VARARGS, ""}, ! ! {"SetTime", SetTime, METH_VARARGS, ""}, ! {"Time", Time, METH_VARARGS, ""}, ! {"SetStart", SetStart, METH_VARARGS, ""}, ! {"Start", Start, METH_VARARGS, ""}, ! {"SetEnd", SetEnd, METH_VARARGS, ""}, ! {"End", End, METH_VARARGS, ""}, ! {"SetFPS", SetFPS, METH_VARARGS, ""}, ! {"FPS", FPS, METH_VARARGS, ""}, ! ! {NULL} ! }; ! ! } // PyDocument ! ! PyObject* PyDocument_New() { ! return Py_InitModule("Document", PyDocument::Methods); } ! ///////////////////////////////////////////////////////////////////// ! // PyObjekt ! ! namespace PyObjekt { ! static PyObject* SetProperty(PyObject*, PyObject *args) ! { ! PyObject *self, *object; ! char* name; ! if(!PyArg_ParseTuple(args, "OsO", &self, &name, &object)) ! return PYVAL_FALSE; ! melies::ipropertycollection* props = python_cast<melies::ipropertycollection*>(self); ! if (!props) ! return PYVAL_FALSE; ! melies::iproperty* prop = props->Property(std::string(name)); ! ! if (!prop) ! return PYVAL_FALSE; ! ! boost::any value; ! ! if (prop->Type() == typeid(int)) ! value = boost::any(PyInt_AsLong(object)); ! else if (prop->Type() == typeid(long)) ! value = boost::any(PyLong_AsLong(object)); ! else if (prop->Type() == typeid(double)) ! value = boost::any(PyFloat_AsDouble(object)); ! else if (prop->Type() == typeid(std::string)) ! value = boost::any(PyString_AsString(object)); ! ! return (prop->SetValue(value)) ? PYVAL_TRUE : PYVAL_FALSE; ! } ! ! static PyObject* Property(PyObject*, PyObject *args) ! { ! PyObject *self; ! char* name; ! ! if(!PyArg_ParseTuple(args, "Os", &self, &name)) ! return PYVAL_FALSE; ! ! melies::ipropertycollection* props = python_cast<melies::ipropertycollection*>(self); ! ! if (!props) ! return PYVAL_FALSE; ! ! melies::iproperty* prop = props->Property(std::string(name)); ! ! if (!prop) ! return PYVAL_FALSE; ! ! if (prop->Type() == typeid(int)) ! return IntToPyVal(boost::any_cast<int>(prop->Value())); ! else if (prop->Type() == typeid(long)) ! return LongToPyVal(boost::any_cast<long>(prop->Value())); ! else if (prop->Type() == typeid(double)) ! return DoubleToPyVal(boost::any_cast<double>(prop->Value())); ! else if (prop->Type() == typeid(std::string)) ! return StringToPyVal(boost::any_cast<std::string>(prop->Value())); ! ! return PYVAL_NONE; ! } ! ! static PyMethodDef Methods[] = ! { ! {"SetProperty", SetProperty, METH_VARARGS, ""}, ! {"Property", Property, METH_VARARGS, ""}, ! {NULL} ! }; ! ! } // PyObjekt ! ! PyObject* PyObjekt_New() { ! return Py_InitModule("Object", PyObjekt::Methods); ! } ! ///////////////////////////////////////////////////////////////////// ! // PyUserInterface ! namespace PyUserInterface ! { ! static PyMethodDef Methods[] = ! { ! {NULL} ! }; ! } // PyUserInterface ! ! PyObject* PyUserInterface_New() ! { ! return Py_InitModule("UserInterface", PyUserInterface::Methods); } Index: objects.h =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/python/objects.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** objects.h 25 Sep 2003 16:16:57 -0000 1.1 --- objects.h 29 Sep 2003 13:08:23 -0000 1.2 *************** *** 21,87 **** // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #include "pythonmacros.h" ! template<class InterfaceType, class BaseType> ! class PythonSkeleton ! { ! public: ! typedef PythonSkeleton<InterfaceType, BaseType> Skeleton; ! typedef BaseType Owner; ! static PyMethodDef Methods[]; ! static PyObject* Create(InterfaceType* const Interface) ! { ! // Sanity checks ... ! assert_warning(Interface); ! // Wrap the 'Interface' into a PyCObject ! return PyCObject_FromVoidPtr(Interface, NULL); ! } ! static InterfaceType* Interface(PyObject *object) ! { ! // Unwrap the 'Interface' from the PyCObject ! if (PyCObject_Check(object)) ! return reinterpret_cast<InterfaceType*>(PyCObject_AsVoidPtr(object)); ! else ! return 0; ! } ! template<class NewInterfaceType, class NewActualType> ! static PyObject* DynamicCast(PyObject* const Object) ! { ! NewInterfaceType* const i = dynamic_cast<NewInterfaceType*>(Interface(Object)); ! return_val_if_fail(i, PYVAL_FALSE); ! return NewActualType::Create(i); ! } ! }; ! class PyApplicationModule { ! public: ! static PyMethodDef Methods[]; ! static PyObject* ConfigPath(PyObject *self, PyObject *args); ! static PyObject* CachePath(PyObject *self, PyObject *args); ! static PyObject* SharePath(PyObject *self, PyObject *args); ! static PyObject* ScriptPath(PyObject *self, PyObject *args); ! static PyObject* GuiName(PyObject *self, PyObject *args); ! static PyObject* FlipBook(PyObject *self, PyObject *args); ! static PyObject* Plugins(PyObject *self, PyObject *args); ! static PyObject* Document(PyObject *self, PyObject *args); ! static PyObject* UserInterface(PyObject *self, PyObject *args); ! static PyObject* Load(PyObject *self, PyObject *args); ! static PyObject* Save(PyObject *self, PyObject *args); ! static PyObject* Execute(PyObject *self, PyObject *args); ! static PyObject* Quit(PyObject *self, PyObject *args); ! static PyObject* Print(PyObject *self, PyObject *args); ! static PyObject* Error(PyObject *self, PyObject *args); ! }; #endif // MODULE_PYTHON_OBJECTS_H --- 21,105 ---- // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #include <Python.h> ! #include <string> ! // Factories ! PyObject* PyMelies_New(); ! PyObject* PyFlipBook_New(); ! PyObject* PyPlugin_New(); ! PyObject* PyDocument_New(); ! PyObject* PyUserInterface_New(); ! PyObject* PyApplication_New(); ! PyObject* PyObjekt_New(); ! // Common conversions ! // From integer to Python integer ! inline PyObject* IntToPyVal(int i) ! { ! return Py_BuildValue("i", i); ! } ! // From long to Python integer ! inline PyObject* LongToPyVal(long l) ! { ! return Py_BuildValue("l", l); ! } ! // From double to Python float ! inline PyObject* DoubleToPyVal(double d) ! { ! return Py_BuildValue("d", d); ! } ! // From std::string to Python string ! inline PyObject* StringToPyVal(std::string s) ! { ! return Py_BuildValue("s", (char*)s.c_str()); ! } ! // From InterfaceType to Python object ! template<class T> ! inline PyObject* ObjectToPyVal(T* const Interface) { ! return PyCObject_FromVoidPtr(Interface, NULL); ! } ! // python_cast<>() ! template<class T> ! inline T python_cast(PyObject *object) ! { ! if (PyCObject_Check(object)) ! return reinterpret_cast<T>(PyCObject_AsVoidPtr(object)); ! else ! return 0; ! } ! // Init Python class ! inline PyObject* Py_InitClass(char* Name, PyMethodDef* Methods) ! { ! PyObject* classDict = PyDict_New(); ! PyObject* className = PyString_FromString(Name); ! PyObject* classObject = PyClass_New(NULL, classDict, className); ! PyMethodDef* def; ! for (def = Methods; def->ml_name != NULL; def++) { ! PyObject* func = PyCFunction_New(def, NULL); ! PyObject* method = PyMethod_New(func, NULL, classObject); ! PyDict_SetItemString(classDict, def->ml_name, method); ! } ! return classObject; ! } ! ! // Well known Python values ! #define PYVAL_VOID Py_BuildValue("") ! #define PYVAL_NULL Py_BuildValue("") ! #define PYVAL_NONE Py_BuildValue("") ! #define PYVAL_ZERO INT_TO_PYVAL(0) ! #define PYVAL_ONE INT_TO_PYVAL(1) ! #define PYVAL_FALSE NULL ! #define PYVAL_TRUE Py_BuildValue("i", 1) #endif // MODULE_PYTHON_OBJECTS_H Index: pythonmacros.h =================================================================== RCS file: /cvsroot/melies/meliesfx/modules/python/pythonmacros.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pythonmacros.h 24 Sep 2003 19:08:28 -0000 1.1 --- pythonmacros.h 29 Sep 2003 13:08:23 -0000 1.2 *************** *** 1,69 **** - #ifndef MODULE_PYTHON_PYTHON_H - #define MODULE_PYTHON_PYTHON_H - - // :: melies fx - // Copyright (c) 2002-2003, Anders Dahnielson - // - // Contact: an...@da... - // - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public - // License as published by the Free Software Foundation; either - // version 2 of the License, or (at your option) any later version. - // - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - // General Public License for more details. - // - // You should have received a copy of the GNU General Public - // License along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - /** \file - \brief Define macros usefull when extending the python scripting engine - \author Anders Dahnielson (an...@da...) - */ - - #include <Python.h> - - #include <string> - - /// Common conversions - - // From integer to Python integer - inline PyObject* IntToPyVal(int i) - { - return Py_BuildValue("i", i); - } - - // From long to Python integer - inline PyObject* LongToPyVal(long l) - { - return Py_BuildValue("l", l); - } - - // From double to Python float - inline PyObject* DoubleToPyVal(double d) - { - return Py_BuildValue("d", d); - } - - // From std::string to Python string - inline PyObject* StringToPyVal(std::string s) - { - return Py_BuildValue("s", (char*)s.c_str()); - } - - /// Well known Python values - #define PYVAL_VOID Py_BuildValue("") - #define PYVAL_NULL Py_BuildValue("") - #define PYVAL_NONE Py_BuildValue("") - #define PYVAL_ZERO INT_TO_PYVAL(0) - #define PYVAL_ONE INT_TO_PYVAL(1) - #define PYVAL_FALSE NULL - #define PYVAL_TRUE Py_BuildValue("i", 1) - - #endif // MODULE_PYTHON_PYTHON_H - - --- 0 ---- |