From: guigues Date: Tue, 1 Jul 2008 07:58:26 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: r0.6.1~2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=5d503ab0e50fbae3cd2ebd26e6c815557abbe42e;p=bbtk.git *** empty log message *** --- diff --git a/kernel/appli/CMakeLists.txt b/kernel/appli/CMakeLists.txt index fa74e8d..f2e4ae1 100644 --- a/kernel/appli/CMakeLists.txt +++ b/kernel/appli/CMakeLists.txt @@ -1,6 +1,8 @@ +IF(WIN32) # Replace strings in a file (sed for windows) SUBDIRS(bbSed) +ENDIF(WIN32) # The BlackBox Interpreter SUBDIRS(bbi) @@ -19,8 +21,8 @@ SUBDIRS(bbCreatePackage) # Utility that creates a new user black box SUBDIRS(bbCreateBlackBox) -# The black box script developer -SUBDIRS(bbed) +# The black box script development studio +SUBDIRS(bbStudio) # The black box package browser SUBDIRS(bbPackageBrowser) diff --git a/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in b/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in index 332f038..75c4595 100644 --- a/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in +++ b/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in @@ -40,6 +40,7 @@ echo "author = " $AUTHOR echo "description = " $DESCRIPTION echo "category = " $CATEGORY echo "type = " $TYPE +echo "format = " $FORMAT echo "input = " $INPUT @@ -55,7 +56,7 @@ echo " - Creating ${FILENAME}.xml" sed s,__BLACKBOXNAME__,"${BOX}", < ${INPUT} | sed s/__AUTHOR__/"${AUTHOR}"/ | sed s{__DESCRIPTION__{"${DESCRIPTION}"{ | sed s/__CATEGORY__/"${CATEGORY}"/ > ${OUTPUT_DIR}/${FILENAME}.xml -if [ ${FORMAT}="C++" ] +if [ "${FORMAT}" = "C++" ] then if [ -f ${OUTPUT_DIR}/${FILENAME}.h ] then diff --git a/kernel/appli/bbCreatePackage/bbCreatePackage.sh.in b/kernel/appli/bbCreatePackage/bbCreatePackage.sh.in index 6a02645..d5e84f0 100755 --- a/kernel/appli/bbCreatePackage/bbCreatePackage.sh.in +++ b/kernel/appli/bbCreatePackage/bbCreatePackage.sh.in @@ -40,10 +40,10 @@ fi cp -R ${INPUT} "$OUTPUT/$PACK" cd $OUTPUT/$PACK -${BINPATH}/bbSed CMakeLists.txt WITHOUT_NAME "${PACK}" > CMakeLists2.txt -${BINPATH}/bbSed CMakeLists2.txt WITHOUT_AUTHOR "${AUTHOR}" > CMakeLists3.txt -${BINPATH}/bbSed CMakeLists3.txt WITHOUT_DESCRIPTION "${DESCRIPTION}" > CMakeLists.txt +sed s,WITHOUT_NAME,"${PACK}", < CMakeLists.txt | \ +sed s,WITHOUT_AUTHOR,"${AUTHOR}", | \ +sed s,WITHOUT_DESCRIPTION,"${DESCRIPTION}", > CMakeLists.txt -rm -f CMakeLists2.txt CMakeLists3.txt +#rm -f CMakeLists2.txt CMakeLists3.txt echo "Done !" echo "Edit the file '$OUTPUT/${PACK}/CMakeLists.txt' to customize your package" diff --git a/kernel/appli/bbStudio/CMakeLists.txt b/kernel/appli/bbStudio/CMakeLists.txt new file mode 100644 index 0000000..99f7d87 --- /dev/null +++ b/kernel/appli/bbStudio/CMakeLists.txt @@ -0,0 +1,22 @@ +#OPTION(BUILD_bbi_GRAPHICAL "Build bbi in graphical mode (requires wxWidgets)" OFF) +#SWITCH_ON_IF_ALL_BUILD(BUILD_bbi_GRAPHICAL) +#IF (BUILD_bbi_GRAPHICAL) +# SET(USE_WXWIDGETS ON CACHE BOOL "Use WxWidgets" FORCE) +#ENDIF (BUILD_bbi_GRAPHICAL) + + +SET(SOURCES + bbStudio + ) + + +IF(BBTK_USE_WXWIDGETS AND WIN32) + ADD_EXECUTABLE(bbStudio WIN32 ${SOURCES}) + SET_TARGET_PROPERTIES(bbStudio PROPERTIES LINK_FLAGS /subsystem:console ) +ELSE(BBTK_USE_WXWIDGETS AND WIN32) + ADD_EXECUTABLE(bbStudio ${SOURCES} ) +ENDIF(BBTK_USE_WXWIDGETS AND WIN32) + + +TARGET_LINK_LIBRARIES(bbStudio bbtk) +INSTALL_TARGETS(/bin/ bbStudio) diff --git a/kernel/appli/bbStudio/bbStudio.cxx b/kernel/appli/bbStudio/bbStudio.cxx new file mode 100644 index 0000000..b994e49 --- /dev/null +++ b/kernel/appli/bbStudio/bbStudio.cxx @@ -0,0 +1,119 @@ +#ifdef _USE_WXWIDGETS_ + +//========================================================================== +// WITH WX +//========================================================================== +#include "bbtkWxGUIScriptingInterface.h" + +#include +#include + + +static const wxCmdLineEntryDesc cmdLineDesc[] = +{ + { wxCMD_LINE_PARAM, NULL, NULL, _T("file1 [file2 [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, + { wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Prints this help") }, + { wxCMD_LINE_NONE } +}; + + + +class wxBBIApp : public wxApp +{ +public: + bool OnInit( ); + int OnExit() { return true; } + void OnInitCmdLine(wxCmdLineParser& parser); + bool OnCmdLineParsed(wxCmdLineParser& parser); + + bool usage; + std::vector input_file; +}; + +IMPLEMENT_APP(wxBBIApp); + +void wxBBIApp::OnInitCmdLine(wxCmdLineParser& parser) +{ + // std::cout << "OnInitCmdLine"<Show(true); + + std::vector::const_iterator i; + i=input_file.begin(); + if (i!=input_file.end()) I->Open(*i); + + return true; +} + + +#if defined(_WIN32) + +// How to have a Console and wxWidgets +// http://www.wxwidgets.org/wiki/index.php/MSVC_Setup_Guide +// In Visual C++ 6 (7 should be similar), to create an application that is both a console application +// (cout's to the console are visible) and has a wxWidgets GUI, +// you need to use the linker option "/subsystem:console" and the following code: +int main(int argc, char* argv[]) +{ + return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL); +} + +#endif // defined(_WIN32) + + +#else +//========================================================================== +// WITHOUT WX +//========================================================================== +int main(int argc, char* argv[]) +{ + std::cout << "bbStudio was not compiled with wxWidgets : ciao !" < bbtk_install_gnome_tmp -sed s,BBED,${BBED},g bbtk_install_gnome_tmp > bbtk_install_gnome_tmp2 -mv bbtk_install_gnome_tmp2 ${HOME}/.local/share/applications/bbed.desktop +echo "* Creating bbStudio launcher on desktop (${HOME}/.local/share/applications/bbStudio.desktop)" +sed s,HOME,${HOME},g ${DATAPATH}/bbStudio.desktop.in > bbtk_install_gnome_tmp +sed s,BBSTUDIO,${BBSTUDIO},g bbtk_install_gnome_tmp > bbtk_install_gnome_tmp2 +mv bbtk_install_gnome_tmp2 ${HOME}/.local/share/applications/bbStudio.desktop rm bbtk_install_gnome_tmp -ln -s ${HOME}/.local/share/applications/bbed.desktop ${HOME}/Desktop/bbed.desktop +ln -s ${HOME}/.local/share/applications/bbStudio.desktop ${HOME}/Desktop/bbStudio.desktop echo "* Copying icons in ${HOME}/.local/share/applications/" cp ${ICONSPATH}/*.png ${HOME}/.local/share/applications/ diff --git a/kernel/src/bbtkExecuter.cxx b/kernel/src/bbtkExecuter.cxx index 9fa297f..f8d71a2 100644 --- a/kernel/src/bbtkExecuter.cxx +++ b/kernel/src/bbtkExecuter.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkExecuter.cxx,v $ $ Language: C++ - Date: $Date: 2008/04/22 09:40:10 $ - Version: $Revision: 1.20 $ + Date: $Date: 2008/07/01 07:58:28 $ + Version: $Revision: 1.21 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -107,7 +107,7 @@ namespace bbtk // Create user package Package::Pointer p = - Package::New("user","internal to bbi", + Package::New("user","internal", "User defined black boxes", "", BBTK_STRINGIFY_SYMBOL(BBTK_VERSION)); @@ -122,7 +122,7 @@ namespace bbtk ComplexBlackBoxDescriptor::New("workspace"); // mRootCBB->Reference(); r->SetFactory(GetFactory()); - r->AddToAuthor("bbi (internal)"); + r->AddToAuthor("bbtk"); r->AddToDescription("User's workspace"); mOpenDefinition.push_back(CBBDefinition(r,"user")); // Register it into the user package @@ -538,7 +538,7 @@ namespace bbtk p->SetDocURL(filename_rootHtml); p->SetDocRelativeURL(simplefilename_rootHtml); - p->CreateHtmlPage(filename_rootHtml,"bbi","user package",custom_header,custom_title,detail,level,relative_link); + p->CreateHtmlPage(filename_rootHtml,"bbtk","user package",custom_header,custom_title,detail,level,relative_link); std::string page = filename_rootHtml; /* diff --git a/kernel/src/bbtkFactory.cxx b/kernel/src/bbtkFactory.cxx index 8c28996..bc21a29 100644 --- a/kernel/src/bbtkFactory.cxx +++ b/kernel/src/bbtkFactory.cxx @@ -4,8 +4,8 @@ Program: bbtk Module: $RCSfile: bbtkFactory.cxx,v $ Language: C++ -Date: $Date: 2008/04/22 08:29:09 $ -Version: $Revision: 1.36 $ +Date: $Date: 2008/07/01 07:58:28 $ +Version: $Revision: 1.37 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de @@ -1016,7 +1016,7 @@ namespace bbtk ptm = gmtime ( &rawtime ); s << "


\n"; - s << "Automatically generated by bbi on " + s << "Automatically generated by bbtk on " << ptm->tm_mday << "/" << ptm->tm_mon << "/" << ptm->tm_year+1900 << " - " << ptm->tm_hour << ":" << ptm->tm_min << " GMT\n"; s << "\n"; diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index f908f65..7d2eb54 100644 --- a/kernel/src/bbtkInterpreter.cxx +++ b/kernel/src/bbtkInterpreter.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkInterpreter.cxx,v $ $ Language: C++ - Date: $Date: 2008/05/15 08:02:36 $ - Version: $Revision: 1.66 $ + Date: $Date: 2008/07/01 07:58:28 $ + Version: $Revision: 1.67 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -239,7 +239,7 @@ namespace bbtk info.argmax = 0; info.code = cReset; info.syntax = "reset"; - info.help = "Deletes all boxes and unloads all packages (bbi is reset to its start state)"; + info.help = "Deletes all boxes and unloads all packages (reset to start state)"; mCommandDict[info.keyword] = info; info.keyword = "author"; @@ -287,7 +287,7 @@ namespace bbtk info.argmax = 2; info.code = cInclude; info.syntax = "include [source]"; - info.help = "Includes the file .\n 'source' : If the keyword 'source' is provided then informs bbi that the included file is the source of the current box definition (Advanced; used to get the right 'Include' field in html doc of packages 'appli' scripts)."; + info.help = "Includes the file .\n 'source' : If the keyword 'source' is provided then informs the interpreter that the included file is the source of the current box definition (Advanced; used to get the right 'Include' field in html doc of packages 'appli' scripts)."; mCommandDict[info.keyword] = info; info.keyword = "quit"; diff --git a/kernel/src/bbtkWxGUIScriptingInterface.cxx b/kernel/src/bbtkWxGUIScriptingInterface.cxx index 669d9ac..9a6d3a7 100644 --- a/kernel/src/bbtkWxGUIScriptingInterface.cxx +++ b/kernel/src/bbtkWxGUIScriptingInterface.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $ Language: C++ - Date: $Date: 2008/06/26 06:50:05 $ - Version: $Revision: 1.12 $ + Date: $Date: 2008/07/01 07:58:28 $ + Version: $Revision: 1.13 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -121,7 +121,7 @@ namespace bbtk SetMenuBar( menuBar ); CreateStatusBar(); - SetStatusText( _T("Welcome to bbi !") ); + SetStatusText( _T("Welcome to bbStudio !") ); // mWxGUITextEditor = new WxGUITextEditor(this,this); @@ -326,7 +326,7 @@ namespace bbtk { m_mgr.Update(); Refresh(); - wxMessageBox(_T(" bbi\nThe Black Box Toolkit interpreter\n(c) CREATIS-LRMN 2008"), + wxMessageBox(_T(" bbStudio\nThe Black Box Toolkit Development Studio\n(c) CREATIS-LRMN 2008"), _T("About ..."), wxOK | wxICON_INFORMATION, this); }