+IF(WIN32)
# Replace strings in a file (sed for windows)
SUBDIRS(bbSed)
+ENDIF(WIN32)
# The BlackBox Interpreter
SUBDIRS(bbi)
# 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)
echo "description = " $DESCRIPTION
echo "category = " $CATEGORY
echo "type = " $TYPE
+echo "format = " $FORMAT
echo "input = " $INPUT
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
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"
--- /dev/null
+#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)
--- /dev/null
+#ifdef _USE_WXWIDGETS_
+
+//==========================================================================
+// WITH WX
+//==========================================================================
+#include "bbtkWxGUIScriptingInterface.h"
+
+#include <wx/cmdline.h>
+#include <vector>
+
+
+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<std::string> input_file;
+};
+
+IMPLEMENT_APP(wxBBIApp);
+
+void wxBBIApp::OnInitCmdLine(wxCmdLineParser& parser)
+{
+ // std::cout << "OnInitCmdLine"<<std::endl;
+ parser.SetDesc(cmdLineDesc);
+}
+
+bool wxBBIApp::OnCmdLineParsed(wxCmdLineParser& parser)
+{
+ int argc = parser.GetParamCount();
+ for (int i=0; i<argc; ++i)
+ {
+ std::string s = bbtk::wx2std(parser.GetParam(i));
+ input_file.push_back(s);
+ }
+
+ bool help = ( parser.Found(_T("h")) );
+ usage = (help && (input_file.size()==0));
+ if (usage) {
+ std::cout << "bbStudio (The Black Box Development Studio) - bbtk "
+ << bbtk::GetVersion() << " - (c) Creatis 2007-2008"
+ << std::endl;
+ parser.Usage();
+ }
+
+ return true;
+}
+
+
+
+// ----------------------------------------------------------------------------
+// The `main program' equivalent, creating the windows and returning the
+// main frame
+bool wxBBIApp::OnInit( )
+{
+ // std::cout << "OnInit"<<std::endl;
+ wxApp::OnInit();
+#ifdef __WXGTK__
+ //See http://www.wxwindows.org/faqgtk.htm#locale
+ setlocale(LC_NUMERIC, "C");
+#endif
+ if (usage) return false;
+
+ bbtk::WxGUIScriptingInterface *I =
+ new bbtk::WxGUIScriptingInterface(0,_T("bbStudio"),wxSize(800,600));
+ SetTopWindow(I);
+ I->Show(true);
+
+ std::vector<std::string>::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 !" <<std::endl;
+ return 0;
+}
+
+// EOF
+#endif //#ifdef _USE_WXWIDGETS_
+
+
+
)
INSTALL(
- FILES bbi.desktop.in bbed.desktop.in bbs.xml
+ FILES bbi.desktop.in bbStudio.desktop.in bbs.xml
DESTINATION ${BBTK_DATA_INSTALL_PATH}/install-gnome
)
INSTALL(
[Desktop Entry]
Version=1.0
Encoding=UTF-8
-Name=bbed
+Name=bbStudio
MimeType=text/bbs;
-Exec=BBED %f
+Exec=BBSTUDIO %f
Type=Application
Terminal=false
NoDisplay=false
-GenericName[en_US]="The Black Box Editor (bbed)"
+GenericName[en_US]="The Black Box Studio (bbStudio)"
Icon=HOME/.local/share/applications/BlueBlackBox.png
#!/bin/bash
-echo "***** Installing bbi on gnome desktop *****"
+echo "***** Installing bbtk components on gnome desktop *****"
BBI=$(which bbi)
-BBED=$(which bbed)
-echo "* bbi path = ${BBI}"
-echo "* bbed path = ${BBED}"
+BBSTUDIO=$(which bbStudio)
+echo "* bbi path = ${BBI}"
+echo "* bbStudio path = ${BBSTUDIO}"
TMP=$(which $0|rev)
TMP2=$(echo ${TMP#*/}|rev)
ln -s ${HOME}/.local/share/applications/bbi.desktop ${HOME}/Desktop/bbi.desktop
# The desktop launcher & its icon
-echo "* Creating bbed launcher on desktop (${HOME}/.local/share/applications/bbed.desktop)"
-sed s,HOME,${HOME},g ${DATAPATH}/bbed.desktop.in > 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/
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
// 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));
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
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;
/*
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
ptm = gmtime ( &rawtime );
s << "<p><hr>\n";
- s << "Automatically generated by <b>bbi</b> on "
+ s << "Automatically generated by <b>bbtk</b> on "
<< ptm->tm_mday << "/" << ptm->tm_mon << "/" << ptm->tm_year+1900
<< " - " << ptm->tm_hour << ":" << ptm->tm_min << " GMT\n";
s << "</body></html>\n";
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
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";
info.argmax = 2;
info.code = cInclude;
info.syntax = "include <filename> [source]";
- info.help = "Includes the file <filename>.\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 <filename>.\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";
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
SetMenuBar( menuBar );
CreateStatusBar();
- SetStatusText( _T("Welcome to bbi !") );
+ SetStatusText( _T("Welcome to bbStudio !") );
//
mWxGUITextEditor = new WxGUITextEditor(this,this);
{
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);
}